![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
This class allows the definition of a text object for display. The text might be defined in one of ways, using: More...
#include <Graphic3d_Text.hxx>

Public Member Functions | |
| Graphic3d_Text (const float theHeight) | |
| Creates default text parameters. | |
| ~Graphic3d_Text () override=default | |
| Destructor. | |
| const NCollection_String & | Text () const |
| Returns text value. | |
| void | SetText (const NCollection_String &theText) |
| Sets text value. | |
| void | SetText (const TCollection_AsciiString &theText) |
| Sets text value. | |
| void | SetText (const char *theText) |
| Sets text value. | |
| const occ::handle< Font_TextFormatter > & | TextFormatter () const |
| void | SetTextFormatter (const occ::handle< Font_TextFormatter > &theFormatter) |
| Setup text default formatter for text within this context. | |
| const gp_Pnt & | Position () const |
| The 3D point of attachment is projected. If the orientation is defined, the text is written in the plane of projection. | |
| void | SetPosition (const gp_Pnt &thePoint) |
| Sets text point. | |
| const gp_Ax2 & | Orientation () const |
| Returns text orientation in 3D space. | |
| bool | HasPlane () const |
| Returns true if the text is filled by a point. | |
| void | SetOrientation (const gp_Ax2 &theOrientation) |
| Sets text orientation in 3D space. | |
| void | ResetOrientation () |
| Reset text orientation in 3D space. | |
| bool | HasOwnAnchorPoint () const |
| Returns true if the text has an anchor point. | |
| void | SetOwnAnchorPoint (const bool theHasOwnAnchor) |
| Returns true if the text has an anchor point. | |
| float | Height () const |
| Sets height of text. (Relative to the Normalized Projection Coordinates (NPC) Space). | |
| void | SetHeight (const float theHeight) |
| Returns height of text. | |
| Graphic3d_HorizontalTextAlignment | HorizontalAlignment () const |
| Returns horizontal alignment of text. | |
| void | SetHorizontalAlignment (const Graphic3d_HorizontalTextAlignment theJustification) |
| Sets horizontal alignment of text. | |
| Graphic3d_VerticalTextAlignment | VerticalAlignment () const |
| Returns vertical alignment of text. | |
| void | SetVerticalAlignment (const Graphic3d_VerticalTextAlignment theJustification) |
| Sets vertical alignment of text. | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. | |
| virtual | ~Standard_Transient ()=default |
| Destructor must be virtual. | |
| virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object. | |
| bool | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
| Returns a true value if this is an instance of Type. | |
| bool | IsInstance (const char *const theTypeName) const |
| Returns a true value if this is an instance of TypeName. | |
| bool | IsKind (const opencascade::handle< Standard_Type > &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| bool | IsKind (const char *const theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| Standard_Transient * | This () const |
| Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. | |
| int | GetRefCount () const noexcept |
| Get the reference counter of this object. | |
| void | IncrementRefCounter () noexcept |
| Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations. | |
| int | DecrementRefCounter () noexcept |
| Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement. | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. | |
Protected Attributes | |
| occ::handle< Font_TextFormatter > | myFormatter |
| text formatter | |
| NCollection_String | myText |
| text value | |
| gp_Ax2 | myOrientation |
| Text orientation in 3D space. | |
| float | myHeight |
| height of text | |
| Graphic3d_HorizontalTextAlignment | myHAlign |
| horizontal alignment | |
| Graphic3d_VerticalTextAlignment | myVAlign |
| vertical alignment | |
| bool | myHasPlane |
| Check if text have orientation in 3D space. | |
| bool | myHasOwnAnchor |
| flag if text uses position as point of attach | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
| typedef void | base_type |
| Returns a type descriptor about this object. | |
Static Public Member Functions inherited from Standard_Transient | |
| static constexpr const char * | get_type_name () |
| Returns a type descriptor about this object. | |
| static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
| Returns type descriptor of Standard_Transient class. | |
This class allows the definition of a text object for display. The text might be defined in one of ways, using:
This class also has parameters of the text height and H/V alignments. Custom formatting is available using Font_TextFormatter.
| Graphic3d_Text::Graphic3d_Text | ( | const float | theHeight | ) |
Creates default text parameters.
|
overridedefault |
Destructor.
|
inline |
Returns true if the text has an anchor point.
|
inline |
Returns true if the text is filled by a point.
|
inline |
Sets height of text. (Relative to the Normalized Projection Coordinates (NPC) Space).
|
inline |
Returns horizontal alignment of text.
|
inline |
Returns text orientation in 3D space.
|
inline |
The 3D point of attachment is projected. If the orientation is defined, the text is written in the plane of projection.
| void Graphic3d_Text::ResetOrientation | ( | ) |
Reset text orientation in 3D space.
|
inline |
Sets horizontal alignment of text.
Sets text orientation in 3D space.
Returns true if the text has an anchor point.
|
inline |
Sets text value.
|
inline |
Sets text value.
|
inline |
Setup text default formatter for text within this context.
|
inline |
Sets vertical alignment of text.
|
inline |
Returns text value.
|
inline |
|
inline |
Returns vertical alignment of text.
|
protected |
text formatter
|
protected |
horizontal alignment
|
protected |
flag if text uses position as point of attach
|
protected |
Check if text have orientation in 3D space.
|
protected |
height of text
|
protected |
Text orientation in 3D space.
|
protected |
text value
|
protected |
vertical alignment