0023776: Redesign of MFC samples after V2d viewer removing
[occt.git] / samples / mfc / standard / 01_Geometry / src / ISession2D / ISession_Text.h
CommitLineData
7fd59977 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>
7fd59977 14#include <TCollection_AsciiString.hxx>
15#include <Aspect_TypeOfText.hxx>
16#include <Standard_Real.hxx>
17#include <Standard_Integer.hxx>
18#include <Quantity_Factor.hxx>
19#include <Quantity_PlaneAngle.hxx>
5c1f974e 20#include <PrsMgr_PresentationManager3d.hxx>
21#include <SelectMgr_Selection.hxx>
7fd59977 22#include <Standard_OStream.hxx>
23#include <Standard_IStream.hxx>
24#include <Standard_CString.hxx>
25#include <SelectMgr_SelectableObject.hxx>
26
27class TCollection_AsciiString;
7fd59977 28class SelectMgr_Selection;
29
30DEFINE_STANDARD_HANDLE(ISession_Text,AIS_InteractiveObject)
31class ISession_Text : public AIS_InteractiveObject
32{
33public:
34 ISession_Text();
35
36 ISession_Text (const TCollection_AsciiString& aText,
37 const Standard_Real anX = 0 ,
38 const Standard_Real anY = 0 ,
39 const Standard_Real aZ = 0 ,
40 const Aspect_TypeOfText aType = Aspect_TOT_SOLID,
41 const Quantity_PlaneAngle anAngle = 0.0 ,
42 const Standard_Real aSlant = 0.0 ,
43 const Standard_Integer aColorIndex = 1 ,
44 const Standard_Integer aFontIndex = 1 ,
45 const Quantity_Factor aScale = 0.1 );
46 ISession_Text
47 (const TCollection_AsciiString& aText,
48 gp_Pnt& aPoint,
49 const Aspect_TypeOfText aType = Aspect_TOT_SOLID,
50 const Quantity_PlaneAngle anAngle = 0.0 ,
51 const Standard_Real aSlant = 0.0 ,
52 const Standard_Integer aColorIndex = 1 ,
53 const Standard_Integer aFontIndex = 1 ,
54 const Quantity_Factor aScale = 0.1 );
55
56 virtual ~ISession_Text();
57
58inline Standard_Integer NbPossibleSelection() const;
59inline TCollection_AsciiString GetText() const;
60inline void SetText(const TCollection_AsciiString& atext) ;
61inline void GetCoord(Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const ;
62inline void SetCoord(const Standard_Real X, const Standard_Real Y, const Standard_Real Z=0);
63inline Aspect_TypeOfText GetTypeOfText() const;
64inline void SetTypeOfText(const Aspect_TypeOfText aNewTypeOfText) ;
65inline Standard_Real GetAngle() const;
66inline void SetAngle(const Standard_Real aNewAngle) ;
67inline Standard_Real GetSlant() const;
68inline void SetSlant(const Standard_Real aNewSlant) ;
69inline Standard_Integer GetColorIndex() const;
70inline void SetColorIndex(const Standard_Integer aNewColorIndex) ;
71inline Standard_Integer GetFontIndex() const;
72inline void SetFontIndex(const Standard_Integer aNewFontIndex) ;
73inline Quantity_Factor GetScale() const;
74inline void SetScale (const Quantity_Factor aNewScale) ;
75
76
77DEFINE_STANDARD_RTTI(ISession_Text)
78
7fd59977 79private:
80
5c1f974e 81 void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
82 const Handle(Prs3d_Presentation)& aPresentation,
83 const Standard_Integer aMode);
84 void Compute (const Handle(Prs3d_Projector)& aProjector,
85 const Handle(Prs3d_Presentation)& aPresentation);
86 void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
87 const Standard_Integer unMode) ;
7fd59977 88
89
90 // Fields PRIVATE
91 //
92TCollection_AsciiString MyText ;
93Standard_Real MyX ;
94Standard_Real MyY ;
95Standard_Real MyZ ;
96Aspect_TypeOfText MyTypeOfText ;
97Standard_Real MyAngle ;
98Standard_Real MySlant ;
99Standard_Integer MyColorIndex ;
100Standard_Integer MyFontIndex ;
101Quantity_Factor MyScale ;
102Standard_Real MyWidth ;
103Standard_Real MyHeight ;
104
105
106};
107
108 inline Standard_Integer ISession_Text::NbPossibleSelection() const
109{ return 1; }
110
111inline TCollection_AsciiString ISession_Text::GetText() const
112{ return MyText ; }
113
114inline void ISession_Text::SetText(const TCollection_AsciiString& atext)
115{ MyText = atext; }
116
117inline void ISession_Text::GetCoord(Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const
118{ X = MyX; Y = MyY; Z = MyZ;}
119
120inline void ISession_Text::SetCoord(const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
121{ MyX = X ; MyY = Y ; MyZ = Z ;}
122
123inline Aspect_TypeOfText ISession_Text::GetTypeOfText() const
124{ return MyTypeOfText; }
125
126inline void ISession_Text::SetTypeOfText(const Aspect_TypeOfText aNewTypeOfText)
127{ MyTypeOfText = aNewTypeOfText; }
128
129inline Standard_Real ISession_Text::GetAngle() const
130{ return MyAngle; }
131
132inline void ISession_Text::SetAngle(const Standard_Real aNewAngle)
133{ MyAngle = aNewAngle; }
134
135inline Standard_Real ISession_Text::GetSlant() const
136{ return MySlant; }
137
138inline void ISession_Text::SetSlant(const Standard_Real aNewSlant)
139{ MySlant = aNewSlant; }
140
141inline Standard_Integer ISession_Text::GetColorIndex() const
142{ return MyColorIndex; }
143
144inline void ISession_Text::SetColorIndex(const Standard_Integer aNewColorIndex)
145{ MyColorIndex = aNewColorIndex; }
146
147inline Standard_Integer ISession_Text::GetFontIndex() const
148{ return MyFontIndex; }
149
150inline void ISession_Text::SetFontIndex(const Standard_Integer aNewFontIndex)
151{ MyFontIndex = aNewFontIndex; }
152
153inline Quantity_Factor ISession_Text::GetScale() const
154{ return MyScale; }
155
156inline void ISession_Text::SetScale(const Quantity_Factor aNewScale)
157{ MyScale = aNewScale; }
158
159#endif // !defined(AFX_ISESSION_TEXT_H__A9B277C4_A69E_11D1_8DA4_0800369C8A03__INCLUDED_)