7fd59977 |
1 | #ifndef _Sample2D_Text_HeaderFile |
2 | #define _Sample2D_Text_HeaderFile |
3 | #include <Standard_Macro.hxx> |
4 | #include <Standard_DefineHandle.hxx> |
5c1f974e |
5 | #include <Graphic3d_HorizontalTextAlignment.hxx> |
6 | #include <Graphic3d_VerticalTextAlignment.hxx> |
7 | #include <TCollection_AsciiString.hxx> |
7fd59977 |
8 | |
9 | |
5c1f974e |
10 | DEFINE_STANDARD_HANDLE(Sample2D_Text,AIS_InteractiveObject) |
11 | class Sample2D_Text : public AIS_InteractiveObject |
12 | { |
7fd59977 |
13 | |
14 | public: |
15 | |
5c1f974e |
16 | Standard_EXPORT |
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); |
7fd59977 |
27 | |
28 | inline TCollection_AsciiString GetText() const { return myText ; } |
5c1f974e |
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; } |
7fd59977 |
34 | inline Standard_Real GetAngle() const { return myAngle; } |
5c1f974e |
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; } |
7fd59977 |
38 | inline Quantity_Factor GetScale() const { return myScale; } |
5c1f974e |
39 | inline void SetScale (const Quantity_Factor theScale) { myScale = theScale; } |
7fd59977 |
40 | inline Standard_Boolean GetIsZoomable() const { return myIsZoomable; } |
5c1f974e |
41 | inline void SetIsZoomable(const Standard_Boolean theIsZoomable) { myIsZoomable = theIsZoomable;} |
7fd59977 |
42 | |
43 | |
44 | DEFINE_STANDARD_RTTI(Sample2D_Text) |
45 | |
5c1f974e |
46 | private: |
47 | |
48 | void Compute ( const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, |
49 | const Handle(Prs3d_Presentation)& aPresentation, |
50 | const Standard_Integer aMode); |
7fd59977 |
51 | |
5c573e69 |
52 | void ComputeSelection (const Handle(SelectMgr_Selection)& /*aSelection*/, |
53 | const Standard_Integer /*aMode*/) |
5c1f974e |
54 | { |
7fd59977 |
55 | |
5c1f974e |
56 | } |
7fd59977 |
57 | |
7fd59977 |
58 | |
7fd59977 |
59 | TCollection_AsciiString myText ; |
5c1f974e |
60 | gp_Pnt myPosition ; |
7fd59977 |
61 | Aspect_TypeOfText myTypeOfText ; |
62 | Standard_Real myAngle ; |
5c1f974e |
63 | Quantity_Color myColor ; |
64 | Standard_CString myFont ; |
7fd59977 |
65 | Quantity_Factor myScale ; |
7fd59977 |
66 | Standard_Real myHeight ; |
5c1f974e |
67 | Font_FontAspect myFontAspect ; |
7fd59977 |
68 | Standard_Boolean myIsZoomable ; |
5c1f974e |
69 | Graphic3d_HorizontalTextAlignment myHAlign ; |
70 | Graphic3d_VerticalTextAlignment myVAlign ; |
7fd59977 |
71 | |
5c1f974e |
72 | }; |
7fd59977 |
73 | |
74 | #endif |