A MarkupModel part for drawing text positioned and oriented in 3D. More...
Public Member Functions | |
MarkupPartText3d () | |
Constructs an empty part. More... | |
virtual PartType | type () const |
Returns the type of the part. Always MarkupPart::TEXT_3D. More... | |
virtual BoundingBox | boundingBox () const |
Returns the current bounding box of the part. More... | |
virtual void | setPriority (int priority) |
Sets render priority of the part. More... | |
virtual int | priority () const |
Returns the render priority of the part. More... | |
virtual const Mat4d & | transformation () const |
Returns the current transformation matrix for the part. More... | |
virtual void | setTransformation (const Mat4d &matrix) |
Sets the transformation matrix to use for the part. More... | |
const Font * | font () const |
Returns the font used to draw the labels in the part. More... | |
void | setFont (Font *labelFont) |
Sets the font to use for drawing the labels in the part. More... | |
const Color3f & | textColor () const |
Returns the current text color. More... | |
void | setTextColor (const Color3f &color) |
Sets the text color of the text items in this part. More... | |
float | eyeLiftFactor () const |
Returns the eye lift factor of the 3d text. More... | |
void | setEyeLiftFactor (float factor) |
Sets the eye lift factor for the 3d text. More... | |
unsigned int | maximumNumberOfLabelsToDraw () const |
Returns the maximum number of text items to draw in this part. More... | |
void | setMaximumNumberOfLabelsToDraw (unsigned int maximumNumberToDraw) |
Sets the maximum number of text items to draw in the part. More... | |
size_t | count () const |
Returns the number of text items in the part. More... | |
MarkupText3dItem | textItem (size_t index) const |
Returns the text item at the given index. More... | |
size_t | add (const MarkupText3dItem &item) |
Adds the given text item to the part. More... | |
size_t | add (const Str &text, const Vec3d &position, const Vec3d &directionVector, const Vec3d &upVector, double textHeight) |
Adds a text item to the part with the given parameters. More... | |
void | set (size_t index, const MarkupText3dItem &item) |
Sets the text item at the given index. More... | |
void | remove (size_t index) |
Removes the text item at the given index. More... | |
void | removeAll () |
Removes all labels in the part. More... | |
![]() | |
bool | visible () const |
Returns true if the part is visible. More... | |
void | setVisible (bool visible) |
Sets if the part should be visible or not. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
Static Public Member Functions | |
static PtrRef< MarkupPartText3d > | create (const Str &text, const Color3f &color, const Vec3d &position, const Vec3d &directionVector, const Vec3d &upVector, double textHeight) |
Returns a newly created part with the given settings. More... | |
Additional Inherited Members | |
![]() | |
enum | PartType { LABELS, TEXTS_3D, TRIANGLES, INSTANCED_GEOMETRY, LINES, POINTS, ARROWS, FIXED_SIZE_ARROW, FIXED_SIZE_SPHERE, FIXED_SIZE_IMAGE_GLYPH } |
Enum specifying the type of MarkupPart. More... | |
A MarkupModel part for drawing text positioned and oriented in 3D.
The part can contain any number of text items (MarkupText3dItem). Each text item's position, orientation and size described by:
The texts support picking through the MarkupModel::rayIntersect() method, but as this only returns the part index, you will have to split your text into parts according to the granularity required for picking.
Example:
cee::vis::MarkupPartText3d::MarkupPartText3d | ( | ) |
Constructs an empty part.
size_t cee::vis::MarkupPartText3d::add | ( | const MarkupText3dItem & | item | ) |
Adds the given text item to the part.
size_t cee::vis::MarkupPartText3d::add | ( | const Str & | text, |
const Vec3d & | position, | ||
const Vec3d & | directionVector, | ||
const Vec3d & | upVector, | ||
double | textHeight | ||
) |
Adds a text item to the part with the given parameters.
Note that directionVector and upVector cannot be zero vectors and they do not need to be normalized
The textHeight is the height of the text (in world coordinates) (in the upVector direction).
|
virtual |
Returns the current bounding box of the part.
Implements cee::vis::MarkupPart.
size_t cee::vis::MarkupPartText3d::count | ( | ) | const |
Returns the number of text items in the part.
|
static |
Returns a newly created part with the given settings.
The returned part will have the specified color and have one text item with the given parameters
float cee::vis::MarkupPartText3d::eyeLiftFactor | ( | ) | const |
Returns the eye lift factor of the 3d text.
const Font * cee::vis::MarkupPartText3d::font | ( | ) | const |
Returns the font used to draw the labels in the part.
unsigned int cee::vis::MarkupPartText3d::maximumNumberOfLabelsToDraw | ( | ) | const |
Returns the maximum number of text items to draw in this part.
|
virtual |
Returns the render priority of the part.
Implements cee::vis::MarkupPart.
void cee::vis::MarkupPartText3d::remove | ( | size_t | index | ) |
Removes the text item at the given index.
void cee::vis::MarkupPartText3d::removeAll | ( | ) |
Removes all labels in the part.
void cee::vis::MarkupPartText3d::set | ( | size_t | index, |
const MarkupText3dItem & | item | ||
) |
Sets the text item at the given index.
void cee::vis::MarkupPartText3d::setEyeLiftFactor | ( | float | factor | ) |
Sets the eye lift factor for the 3d text.
The eye lift factor specifies if the text should be moved towards the camera (or away from the camera if the factor is negative).
This is useful for controlling the ordering of items that are defined in the same plane.
void cee::vis::MarkupPartText3d::setFont | ( | Font * | labelFont | ) |
Sets the font to use for drawing the labels in the part.
Default is the large built-in font (Font::createLargeFont())
void cee::vis::MarkupPartText3d::setMaximumNumberOfLabelsToDraw | ( | unsigned int | maximumNumberToDraw | ) |
Sets the maximum number of text items to draw in the part.
The text items within the view volume will be sorted and the closest items up to the given number will be drawn.
|
virtual |
Sets render priority of the part.
The render priority determines the order in which parts get rendered. Parts with lower priorities get rendered first. The default priority is 100.
Implements cee::vis::MarkupPart.
void cee::vis::MarkupPartText3d::setTextColor | ( | const Color3f & | color | ) |
Sets the text color of the text items in this part.
|
virtual |
Sets the transformation matrix to use for the part.
Implements cee::vis::MarkupPart.
const Color3f & cee::vis::MarkupPartText3d::textColor | ( | ) | const |
Returns the current text color.
cee::vis::MarkupText3dItem cee::vis::MarkupPartText3d::textItem | ( | size_t | index | ) | const |
Returns the text item at the given index.
|
virtual |
Returns the current transformation matrix for the part.
Implements cee::vis::MarkupPart.
|
virtual |
Returns the type of the part. Always MarkupPart::TEXT_3D.
Implements cee::vis::MarkupPart.