1 #ifndef _Sample2D_Text_HeaderFile
2 #define _Sample2D_Text_HeaderFile
3 #include <Standard_Macro.hxx>
4 #include <Standard_DefineHandle.hxx>
5 #include <Graphic3d_HorizontalTextAlignment.hxx>
6 #include <Graphic3d_VerticalTextAlignment.hxx>
7 #include <TCollection_AsciiString.hxx>
10 DEFINE_STANDARD_HANDLE(Sample2D_Text,AIS_InteractiveObject)
11 class Sample2D_Text : public AIS_InteractiveObject
17 Sample2D_Text (const TCollection_AsciiString& theText,const gp_Pnt& thePosition,
18 const Aspect_TypeOfText theType = Aspect_TOT_SOLID,
19 const Quantity_PlaneAngle theAngle = 0.0 ,
20 const Quantity_Color theColor = Quantity_NOC_YELLOW,
21 const Font_FontAspect theFontAspect = Font_FA_Regular,
22 const Standard_CString theFont = "Courier",
23 const Standard_Real theHeight = 1,
24 const Graphic3d_HorizontalTextAlignment theHAlign = Graphic3d_HTA_LEFT,
25 const Graphic3d_VerticalTextAlignment theVAlign = Graphic3d_VTA_BOTTOM,
26 const Standard_Boolean theIsZoomable = Standard_True);
28 inline TCollection_AsciiString GetText() const { return myText ; }
29 inline void SetText(const TCollection_AsciiString& theText) { myText = theText; }
30 inline void GetCoord(gp_Pnt& thePosition) const { thePosition=gp_Pnt(myPosition); }
31 inline void SetCoord(const gp_Pnt& thePosition) { myPosition = thePosition; }
32 inline Standard_Integer GetTypeOfText() const { return myTypeOfText; }
33 inline void SetTypeOfText(const Aspect_TypeOfText theTypeOfText) { myTypeOfText = theTypeOfText; }
34 inline Standard_Real GetAngle() const { return myAngle; }
35 inline void SetAngle(const Standard_Real theAngle) { myAngle = theAngle; }
36 inline Quantity_Color GetColor() const { return myColor; }
37 inline void SetColor(const Quantity_Color theColor) { myColor = theColor; }
38 inline Quantity_Factor GetScale() const { return myScale; }
39 inline void SetScale (const Quantity_Factor theScale) { myScale = theScale; }
40 inline Standard_Boolean GetIsZoomable() const { return myIsZoomable; }
41 inline void SetIsZoomable(const Standard_Boolean theIsZoomable) { myIsZoomable = theIsZoomable;}
44 DEFINE_STANDARD_RTTI(Sample2D_Text)
48 void Compute ( const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
49 const Handle(Prs3d_Presentation)& aPresentation,
50 const Standard_Integer aMode);
52 void ComputeSelection (const Handle(SelectMgr_Selection)& /*aSelection*/,
53 const Standard_Integer /*aMode*/)
59 TCollection_AsciiString myText ;
61 Aspect_TypeOfText myTypeOfText ;
62 Standard_Real myAngle ;
63 Quantity_Color myColor ;
64 Standard_CString myFont ;
65 Quantity_Factor myScale ;
66 Standard_Real myHeight ;
67 Font_FontAspect myFontAspect ;
68 Standard_Boolean myIsZoomable ;
69 Graphic3d_HorizontalTextAlignment myHAlign ;
70 Graphic3d_VerticalTextAlignment myVAlign ;