Integration of OCCT 6.5.0 from SVN
[occt.git] / samples / mfc / standard / 01_Geometry / src / ISession2D / ISession_Text.h
1 // ISession_Text.h: interface for the ISession_Text class.
2 //
3 //////////////////////////////////////////////////////////////////////
4
5 #if !defined(AFX_ISESSION_TEXT_H__A9B277C4_A69E_11D1_8DA4_0800369C8A03__INCLUDED_)
6 #define AFX_ISESSION_TEXT_H__A9B277C4_A69E_11D1_8DA4_0800369C8A03__INCLUDED_
7
8 #if _MSC_VER >= 1000
9 #pragma once
10 #endif // _MSC_VER >= 1000
11
12 #include <Standard_Macro.hxx>
13 #include <Standard_DefineHandle.hxx>
14
15 #include <TCollection_AsciiString.hxx>
16 #include <Aspect_TypeOfText.hxx>
17 #include <Standard_Real.hxx>
18 #include <Standard_Integer.hxx>
19 #include <Quantity_Factor.hxx>
20 #include <Quantity_PlaneAngle.hxx>
21 #include <Handle_PrsMgr_PresentationManager2d.hxx>
22 #include <Handle_Graphic2d_GraphicObject.hxx>
23 #include <Handle_SelectMgr_Selection.hxx>
24 #include <Standard_OStream.hxx>
25 #include <Standard_IStream.hxx>
26 #include <Standard_CString.hxx>
27 #include <SelectMgr_SelectableObject.hxx>
28
29 class TCollection_AsciiString;
30 class PrsMgr_PresentationManager2d;
31 class Graphic2d_GraphicObject;
32 class SelectMgr_Selection;
33
34 DEFINE_STANDARD_HANDLE(ISession_Text,AIS_InteractiveObject)
35 class ISession_Text : public AIS_InteractiveObject  
36 {
37 public:
38         ISession_Text();
39
40     ISession_Text           (const TCollection_AsciiString& aText,
41                              const Standard_Real            anX         = 0   ,
42                              const Standard_Real            anY         = 0   ,
43                              const Standard_Real            aZ          = 0   ,
44                              const Aspect_TypeOfText        aType       = Aspect_TOT_SOLID,
45                              const Quantity_PlaneAngle      anAngle     = 0.0 ,
46                              const Standard_Real            aSlant      = 0.0 ,
47                              const Standard_Integer         aColorIndex = 1   ,
48                              const Standard_Integer         aFontIndex  = 1   ,
49                              const Quantity_Factor          aScale      = 0.1   );
50     ISession_Text
51                             (const TCollection_AsciiString& aText, 
52                              gp_Pnt&                        aPoint,
53                              const Aspect_TypeOfText        aType       = Aspect_TOT_SOLID,
54                              const Quantity_PlaneAngle      anAngle     = 0.0 ,
55                              const Standard_Real            aSlant      = 0.0 ,
56                              const Standard_Integer         aColorIndex = 1   ,
57                              const Standard_Integer         aFontIndex  = 1   ,
58                              const Quantity_Factor          aScale      = 0.1   );
59
60         virtual ~ISession_Text();
61
62 inline   Standard_Integer        NbPossibleSelection() const;
63 inline   TCollection_AsciiString GetText() const;
64 inline   void                    SetText(const TCollection_AsciiString& atext) ;
65 inline   void                    GetCoord(Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const ;
66 inline   void                    SetCoord(const Standard_Real X, const Standard_Real Y, const Standard_Real Z=0);
67 inline   Aspect_TypeOfText       GetTypeOfText() const;
68 inline   void                    SetTypeOfText(const Aspect_TypeOfText aNewTypeOfText) ;
69 inline   Standard_Real           GetAngle() const;
70 inline   void                    SetAngle(const Standard_Real aNewAngle) ;
71 inline   Standard_Real           GetSlant() const;
72 inline   void                    SetSlant(const Standard_Real aNewSlant) ;
73 inline   Standard_Integer        GetColorIndex() const;
74 inline   void                    SetColorIndex(const Standard_Integer aNewColorIndex) ;
75 inline   Standard_Integer        GetFontIndex() const;
76 inline   void                    SetFontIndex(const Standard_Integer aNewFontIndex) ;
77 inline   Quantity_Factor         GetScale() const;
78 inline   void                    SetScale  (const Quantity_Factor aNewScale) ;
79
80
81 DEFINE_STANDARD_RTTI(ISession_Text)
82
83
84 protected:
85
86  // Methods PROTECTED
87  // 
88
89
90  // Fields PROTECTED
91  //
92
93
94 private: 
95
96  // Methods PRIVATE
97  // 
98
99 void Compute          (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
100                        const Handle(Prs3d_Presentation)& aPresentation,
101                        const Standard_Integer aMode);
102 void Compute          (const Handle(Prs3d_Projector)& aProjector,
103                        const Handle(Prs3d_Presentation)& aPresentation);
104 void Compute          (const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
105                        const Handle(Graphic2d_GraphicObject)& aGrObj,
106                        const Standard_Integer unMode = 0) ;
107 void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
108                        const Standard_Integer unMode) ;
109
110
111  // Fields PRIVATE
112  //
113 TCollection_AsciiString MyText       ; 
114 Standard_Real           MyX          ;
115 Standard_Real           MyY          ;
116 Standard_Real           MyZ          ;
117 Aspect_TypeOfText       MyTypeOfText ;
118 Standard_Real           MyAngle      ;
119 Standard_Real           MySlant      ;
120 Standard_Integer        MyColorIndex ;
121 Standard_Integer        MyFontIndex  ;
122 Quantity_Factor         MyScale      ;
123 Standard_Real           MyWidth      ;
124 Standard_Real           MyHeight     ;
125
126
127 };
128
129  inline Standard_Integer ISession_Text::NbPossibleSelection() const 
130 { return 1; }
131
132 inline TCollection_AsciiString ISession_Text::GetText() const 
133 {  return MyText ; }
134
135 inline void ISession_Text::SetText(const TCollection_AsciiString& atext)
136 {  MyText = atext; }
137
138 inline void ISession_Text::GetCoord(Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const 
139 {  X = MyX;  Y = MyY; Z = MyZ;}
140
141 inline void ISession_Text::SetCoord(const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
142 {  MyX = X ;  MyY = Y ;  MyZ = Z ;}
143
144 inline Aspect_TypeOfText ISession_Text::GetTypeOfText() const 
145 {  return MyTypeOfText; }
146
147 inline void ISession_Text::SetTypeOfText(const Aspect_TypeOfText aNewTypeOfText)
148 {  MyTypeOfText = aNewTypeOfText; }
149
150 inline Standard_Real ISession_Text::GetAngle() const 
151 {  return MyAngle; }
152
153 inline void ISession_Text::SetAngle(const Standard_Real aNewAngle)
154 {  MyAngle = aNewAngle; }
155
156 inline Standard_Real ISession_Text::GetSlant() const 
157 {  return MySlant; }
158
159 inline void ISession_Text::SetSlant(const Standard_Real aNewSlant)
160 {  MySlant = aNewSlant; }
161
162 inline Standard_Integer ISession_Text::GetColorIndex() const 
163 {  return MyColorIndex; }
164
165 inline void ISession_Text::SetColorIndex(const Standard_Integer aNewColorIndex)
166 {  MyColorIndex = aNewColorIndex; }
167
168 inline Standard_Integer ISession_Text::GetFontIndex() const 
169 { return MyFontIndex; }
170
171 inline void ISession_Text::SetFontIndex(const Standard_Integer aNewFontIndex)
172 {  MyFontIndex = aNewFontIndex; }
173
174 inline Quantity_Factor ISession_Text::GetScale() const 
175 {  return MyScale; }
176
177 inline void ISession_Text::SetScale(const Quantity_Factor aNewScale)
178 {  MyScale  = aNewScale; }
179
180 #endif // !defined(AFX_ISESSION_TEXT_H__A9B277C4_A69E_11D1_8DA4_0800369C8A03__INCLUDED_)