Open CASCADE Technology  7.3.0
Public Member Functions | Data Fields | Protected Attributes

Graphic3d_AspectText3d Class Reference

Creates and updates a group of attributes for text primitives. This group contains the color, font, expansion factor (height/width ratio), and inter-character space. More...

#include <Graphic3d_AspectText3d.hxx>

Inheritance diagram for Graphic3d_AspectText3d:
Inheritance graph
[legend]

Public Member Functions

 Graphic3d_AspectText3d ()
 Creates a context table for text primitives defined with the following default values: More...
 
 Graphic3d_AspectText3d (const Quantity_Color &theColor, const Standard_CString theFont, const Standard_Real theExpansionFactor, const Standard_Real theSpace, const Aspect_TypeOfStyleText theStyle=Aspect_TOST_NORMAL, const Aspect_TypeOfDisplayText theDisplayType=Aspect_TODT_NORMAL)
 Creates a context table for text primitives defined with the specified values. AFont may be to take means from User(example "Courier New") or Font name defined in Font_NameOfFont(example Font_NOF_ASCII_MONO) or use default font("Courier") More...
 
const Quantity_ColorColor () const
 Return the text color. More...
 
const Quantity_ColorRGBAColorRGBA () const
 Return the text color. More...
 
void SetColor (const Quantity_Color &theColor)
 Modifies the color. More...
 
void SetColor (const Quantity_ColorRGBA &theColor)
 Modifies the color. More...
 
void SetExpansionFactor (const Standard_Real theFactor)
 Modifies the expansion factor (height/width ratio) If the factor is less than 1, the characters will be higher than they are wide. More...
 
const TCollection_AsciiStringFont () const
 Return the font. More...
 
void SetFont (const TCollection_AsciiString &theFont)
 Modifies the font. More...
 
void SetFont (const Standard_CString theFont)
 Modifies the font. More...
 
Standard_Real Space () const
 Return the space between characters. More...
 
void SetSpace (const Standard_Real theSpace)
 Modifies the space between the characters. More...
 
Aspect_TypeOfStyleText Style () const
 Return the text style. More...
 
void SetStyle (const Aspect_TypeOfStyleText theStyle)
 Modifies the style of the text. More...
 
Aspect_TypeOfDisplayText DisplayType () const
 Return display type. More...
 
void SetDisplayType (const Aspect_TypeOfDisplayText theDisplayType)
 Define the display type of the text. More...
 
const Quantity_ColorRGBAColorSubTitleRGBA () const
 Return subtitle color. More...
 
const Quantity_ColorColorSubTitle () const
 Return subtitle color. More...
 
void SetColorSubTitle (const Quantity_Color &theColor)
 Modifies the color of the subtitle for the TODT_SUBTITLE TextDisplayType and the color of background for the TODT_DEKALE TextDisplayType. More...
 
void SetColorSubTitle (const Quantity_ColorRGBA &theColor)
 Modifies the color of the subtitle for the TODT_SUBTITLE TextDisplayType and the color of background for the TODT_DEKALE TextDisplayType. More...
 
bool GetTextZoomable () const
 Returns TRUE when the Text Zoomable is on. More...
 
void SetTextZoomable (const bool theFlag)
 Turns usage of text zoomable on/off. More...
 
Standard_Real GetTextAngle () const
 Returns Angle of degree. More...
 
void SetTextAngle (const Standard_Real theAngle)
 Turns usage of text rotated. More...
 
Font_FontAspect GetTextFontAspect () const
 Returns text FontAspect. More...
 
void SetTextFontAspect (const Font_FontAspect theFontAspect)
 Turns usage of Aspect text. More...
 
const Handle< Graphic3d_ShaderProgram > & ShaderProgram () const
 Return the shader program. More...
 
void SetShaderProgram (const Handle< Graphic3d_ShaderProgram > &theProgram)
 Sets up OpenGL/GLSL shader program. More...
 
 Standard_DEPRECATED ("Deprecated method Values() should be replaced by individual property getters") void Values(Quantity_Color &theColor
 Returns the current values of the group. More...
 
 Standard_DEPRECATED ("Deprecated method Values() should be replaced by individual property getters") void Values(Quantity_Color &theColor
 Returns the current values of the group. More...
 
 Standard_DEPRECATED ("Deprecated method Values() should be replaced by individual property getters") void Values(Quantity_Color &theColor
 Returns the current values of the group. More...
 
 Standard_DEPRECATED ("Deprecated method Values() should be replaced by individual property getters") void Values(Quantity_Color &theColor
 Returns the current values of the group. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean 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. More...
 
Standard_Boolean IsKind (const Standard_CString 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. More...
 
Standard_TransientThis () 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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Data Fields

Standard_CStringtheFont
 
Standard_CString Standard_RealtheExpansionFactor
 
Standard_CString Standard_Real Standard_Real &theSpace const
 
 theFont = myFont.ToCString()
 
 theExpansionFactor = myFactor
 
 theSpace = mySpace
 
Standard_CString Standard_Real Standard_RealtheSpace
 
Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleTexttheStyle
 
Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleText Aspect_TypeOfDisplayTexttheDisplayType
 
Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleText Aspect_TypeOfDisplayText Quantity_Color &theColorSubTitle const
 
 theStyle = myStyle
 
 theDisplayType = myDisplayType
 
 theColorSubTitle = myColorSubTitle.GetRGB()
 
Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleText Aspect_TypeOfDisplayText Quantity_ColortheColorSubTitle
 
Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleText Aspect_TypeOfDisplayText Quantity_Color Standard_BooleantheTextZoomable
 
Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleText Aspect_TypeOfDisplayText Quantity_Color Standard_Boolean Standard_Real &theTextAngle const
 
 theTextZoomable = myTextZoomable
 
 theTextAngle = myTextAngle
 
Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleText Aspect_TypeOfDisplayText Quantity_Color Standard_Boolean Standard_RealtheTextAngle
 
Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleText Aspect_TypeOfDisplayText Quantity_Color Standard_Boolean Standard_Real Font_FontAspect &theTextFontAspect const
 
 theTextFontAspect = myTextFontAspect
 

Protected Attributes

TCollection_AsciiString myFont
 
Quantity_ColorRGBA myColor
 
Standard_Real myFactor
 
Standard_Real mySpace
 
Aspect_TypeOfStyleText myStyle
 
Aspect_TypeOfDisplayText myDisplayType
 
Quantity_ColorRGBA myColorSubTitle
 
bool myTextZoomable
 
Standard_Real myTextAngle
 
Font_FontAspect myTextFontAspect
 
Handle< Graphic3d_ShaderProgrammyProgram
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

Creates and updates a group of attributes for text primitives. This group contains the color, font, expansion factor (height/width ratio), and inter-character space.

NOTE: The font name is stored in the aspect instance so it is safe to pass it as const char* to OpenGl package without copying the string. However, the aspect should not be deleted until the text drawn using this aspect is no longer visible. The best practice is to keep the aspect in the object's drawer.

Constructor & Destructor Documentation

◆ Graphic3d_AspectText3d() [1/2]

Graphic3d_AspectText3d::Graphic3d_AspectText3d ( )

Creates a context table for text primitives defined with the following default values:

Color : NOC_YELLOW Font : NOF_ASCII_MONO Expansion factor : 1. Space between characters : 0. The style : TOST_NORMAL The display type : TODT_NORMAL

◆ Graphic3d_AspectText3d() [2/2]

Graphic3d_AspectText3d::Graphic3d_AspectText3d ( const Quantity_Color theColor,
const Standard_CString  theFont,
const Standard_Real  theExpansionFactor,
const Standard_Real  theSpace,
const Aspect_TypeOfStyleText  theStyle = Aspect_TOST_NORMAL,
const Aspect_TypeOfDisplayText  theDisplayType = Aspect_TODT_NORMAL 
)

Creates a context table for text primitives defined with the specified values. AFont may be to take means from User(example "Courier New") or Font name defined in Font_NameOfFont(example Font_NOF_ASCII_MONO) or use default font("Courier")

Member Function Documentation

◆ Color()

const Quantity_Color& Graphic3d_AspectText3d::Color ( ) const
inline

Return the text color.

◆ ColorRGBA()

const Quantity_ColorRGBA& Graphic3d_AspectText3d::ColorRGBA ( ) const
inline

Return the text color.

◆ ColorSubTitle()

const Quantity_Color& Graphic3d_AspectText3d::ColorSubTitle ( ) const
inline

Return subtitle color.

◆ ColorSubTitleRGBA()

const Quantity_ColorRGBA& Graphic3d_AspectText3d::ColorSubTitleRGBA ( ) const
inline

Return subtitle color.

◆ DisplayType()

Aspect_TypeOfDisplayText Graphic3d_AspectText3d::DisplayType ( ) const
inline

Return display type.

◆ Font()

const TCollection_AsciiString& Graphic3d_AspectText3d::Font ( ) const
inline

Return the font.

◆ GetTextAngle()

Standard_Real Graphic3d_AspectText3d::GetTextAngle ( ) const
inline

Returns Angle of degree.

◆ GetTextFontAspect()

Font_FontAspect Graphic3d_AspectText3d::GetTextFontAspect ( ) const
inline

Returns text FontAspect.

◆ GetTextZoomable()

bool Graphic3d_AspectText3d::GetTextZoomable ( ) const
inline

Returns TRUE when the Text Zoomable is on.

◆ SetColor() [1/2]

void Graphic3d_AspectText3d::SetColor ( const Quantity_Color theColor)
inline

Modifies the color.

◆ SetColor() [2/2]

void Graphic3d_AspectText3d::SetColor ( const Quantity_ColorRGBA theColor)
inline

Modifies the color.

◆ SetColorSubTitle() [1/2]

void Graphic3d_AspectText3d::SetColorSubTitle ( const Quantity_Color theColor)
inline

Modifies the color of the subtitle for the TODT_SUBTITLE TextDisplayType and the color of background for the TODT_DEKALE TextDisplayType.

◆ SetColorSubTitle() [2/2]

void Graphic3d_AspectText3d::SetColorSubTitle ( const Quantity_ColorRGBA theColor)
inline

Modifies the color of the subtitle for the TODT_SUBTITLE TextDisplayType and the color of background for the TODT_DEKALE TextDisplayType.

◆ SetDisplayType()

void Graphic3d_AspectText3d::SetDisplayType ( const Aspect_TypeOfDisplayText  theDisplayType)
inline

Define the display type of the text.

TODT_NORMAL Default display. Text only. TODT_SUBTITLE There is a subtitle under the text. TODT_DEKALE The text is displayed with a 3D style. TODT_BLEND The text is displayed in XOR. TODT_DIMENSION Dimension line under text will be invisible.

◆ SetExpansionFactor()

void Graphic3d_AspectText3d::SetExpansionFactor ( const Standard_Real  theFactor)
inline

Modifies the expansion factor (height/width ratio) If the factor is less than 1, the characters will be higher than they are wide.

◆ SetFont() [1/2]

void Graphic3d_AspectText3d::SetFont ( const TCollection_AsciiString theFont)
inline

Modifies the font.

◆ SetFont() [2/2]

void Graphic3d_AspectText3d::SetFont ( const Standard_CString  theFont)
inline

Modifies the font.

◆ SetShaderProgram()

void Graphic3d_AspectText3d::SetShaderProgram ( const Handle< Graphic3d_ShaderProgram > &  theProgram)
inline

Sets up OpenGL/GLSL shader program.

◆ SetSpace()

void Graphic3d_AspectText3d::SetSpace ( const Standard_Real  theSpace)
inline

Modifies the space between the characters.

◆ SetStyle()

void Graphic3d_AspectText3d::SetStyle ( const Aspect_TypeOfStyleText  theStyle)
inline

Modifies the style of the text.

  • TOST_NORMAL Default text. The text is displayed like any other graphic object. This text can be hidden by another object that is nearest from the point of view.
  • TOST_ANNOTATION The text is always visible. The text is displayed over the other object according to the priority.

◆ SetTextAngle()

void Graphic3d_AspectText3d::SetTextAngle ( const Standard_Real  theAngle)
inline

Turns usage of text rotated.

◆ SetTextFontAspect()

void Graphic3d_AspectText3d::SetTextFontAspect ( const Font_FontAspect  theFontAspect)
inline

Turns usage of Aspect text.

◆ SetTextZoomable()

void Graphic3d_AspectText3d::SetTextZoomable ( const bool  theFlag)
inline

Turns usage of text zoomable on/off.

◆ ShaderProgram()

const Handle< Graphic3d_ShaderProgram >& Graphic3d_AspectText3d::ShaderProgram ( ) const
inline

Return the shader program.

◆ Space()

Standard_Real Graphic3d_AspectText3d::Space ( ) const
inline

Return the space between characters.

◆ Standard_DEPRECATED() [1/4]

Graphic3d_AspectText3d::Standard_DEPRECATED ( "Deprecated method Values() should be replaced by individual property getters"  ) &

Returns the current values of the group.

◆ Standard_DEPRECATED() [2/4]

Graphic3d_AspectText3d::Standard_DEPRECATED ( "Deprecated method Values() should be replaced by individual property getters"  ) &

Returns the current values of the group.

◆ Standard_DEPRECATED() [3/4]

Graphic3d_AspectText3d::Standard_DEPRECATED ( "Deprecated method Values() should be replaced by individual property getters"  ) &

Returns the current values of the group.

◆ Standard_DEPRECATED() [4/4]

Graphic3d_AspectText3d::Standard_DEPRECATED ( "Deprecated method Values() should be replaced by individual property getters"  ) &

Returns the current values of the group.

◆ Style()

Aspect_TypeOfStyleText Graphic3d_AspectText3d::Style ( ) const
inline

Return the text style.

Field Documentation

◆ const [1/4]

Standard_CString Standard_Real Standard_Real& theSpace Graphic3d_AspectText3d::const
Initial value:
{
theColor = myColor.GetRGB()

◆ const [2/4]

Initial value:
{
theColor = myColor.GetRGB()

◆ const [3/4]

Initial value:
{
theColor = myColor.GetRGB()

◆ const [4/4]

Initial value:
{
theColor = myColor.GetRGB()

◆ myColor

Quantity_ColorRGBA Graphic3d_AspectText3d::myColor
protected

◆ myColorSubTitle

Quantity_ColorRGBA Graphic3d_AspectText3d::myColorSubTitle
protected

◆ myDisplayType

Aspect_TypeOfDisplayText Graphic3d_AspectText3d::myDisplayType
protected

◆ myFactor

Standard_Real Graphic3d_AspectText3d::myFactor
protected

◆ myFont

TCollection_AsciiString Graphic3d_AspectText3d::myFont
protected

◆ myProgram

Handle< Graphic3d_ShaderProgram > Graphic3d_AspectText3d::myProgram
protected

◆ mySpace

Standard_Real Graphic3d_AspectText3d::mySpace
protected

◆ myStyle

Aspect_TypeOfStyleText Graphic3d_AspectText3d::myStyle
protected

◆ myTextAngle

Standard_Real Graphic3d_AspectText3d::myTextAngle
protected

◆ myTextFontAspect

Font_FontAspect Graphic3d_AspectText3d::myTextFontAspect
protected

◆ myTextZoomable

bool Graphic3d_AspectText3d::myTextZoomable
protected

◆ theColorSubTitle [1/2]

Standard_CString Standard_Real Standard_Real Aspect_TypeOfStyleText Aspect_TypeOfDisplayText Quantity_Color & Graphic3d_AspectText3d::theColorSubTitle = myColorSubTitle.GetRGB()

◆ theColorSubTitle [2/2]

◆ theDisplayType [1/2]

◆ theDisplayType [2/2]

Graphic3d_AspectText3d::theDisplayType = myDisplayType

◆ theExpansionFactor [1/2]

Standard_CString Standard_Real & Graphic3d_AspectText3d::theExpansionFactor

◆ theExpansionFactor [2/2]

Graphic3d_AspectText3d::theExpansionFactor = myFactor

◆ theFont [1/2]

Standard_CString & Graphic3d_AspectText3d::theFont

◆ theFont [2/2]

Graphic3d_AspectText3d::theFont = myFont.ToCString()

◆ theSpace [1/2]

Standard_CString Standard_Real Standard_Real & Graphic3d_AspectText3d::theSpace = mySpace

◆ theSpace [2/2]

Standard_CString Standard_Real Standard_Real& Graphic3d_AspectText3d::theSpace

◆ theStyle [1/2]

◆ theStyle [2/2]

Graphic3d_AspectText3d::theStyle = myStyle

◆ theTextAngle [1/2]

Graphic3d_AspectText3d::theTextAngle = myTextAngle

◆ theTextAngle [2/2]

◆ theTextFontAspect

Graphic3d_AspectText3d::theTextFontAspect = myTextFontAspect

◆ theTextZoomable [1/2]

◆ theTextZoomable [2/2]

Graphic3d_AspectText3d::theTextZoomable = myTextZoomable

The documentation for this class was generated from the following file: