//=======================================================================
AIS_TextLabel::AIS_TextLabel()
: myText ("?"),
- myFont ("Courier"),
- myFontAspect (Font_FA_Regular),
myHasOrientation3D (Standard_False),
myHasFlipping (Standard_False)
{
//=======================================================================
void AIS_TextLabel::SetFont (Standard_CString theFont)
{
- myFont = theFont;
- myDrawer->TextAspect()->SetFont (myFont.ToCString());
+ myDrawer->TextAspect()->SetFont (theFont);
}
//=======================================================================
return myOrientation3D.Location();
}
+//=======================================================================
+//function : FontName
+//purpose :
+//=======================================================================
+const TCollection_AsciiString& AIS_TextLabel::FontName() const
+{
+ return myDrawer->TextAspect()->Aspect()->Font();
+}
+
+//=======================================================================
+//function : FontAspect
+//purpose :
+//=======================================================================
+Font_FontAspect AIS_TextLabel::FontAspect() const
+{
+ return myDrawer->TextAspect()->Aspect()->GetTextFontAspect();
+}
+
//=======================================================================
//function : Orientation3D
//purpose :
//! Returns position.
Standard_EXPORT const gp_Pnt& Position() const;
+ //! Returns the label text.
+ const TCollection_ExtendedString& Text() const { return myText; }
+
+ //! Returns the font of the label text.
+ Standard_EXPORT const TCollection_AsciiString& FontName() const;
+
+ //! Returns the font aspect of the label text.
+ Standard_EXPORT Font_FontAspect FontAspect() const;
+
//! Returns label orientation in the model 3D space.
Standard_EXPORT const gp_Ax2& Orientation3D() const;
protected:
TCollection_ExtendedString myText;
- TCollection_AsciiString myFont;
- Font_FontAspect myFontAspect;
gp_Ax2 myOrientation3D;
Standard_Boolean myHasOrientation3D;
Standard_Boolean myHasFlipping;