7fd59977 |
1 | #ifndef _Sample2D_Image_HeaderFile |
2 | #define _Sample2D_Image_HeaderFile |
3 | #include <Standard_Macro.hxx> |
4 | #include <Standard_DefineHandle.hxx> |
5 | |
6 | #include <OSD_File.hxx> |
7 | #include <Quantity_Length.hxx> |
8 | #include <Aspect_CardinalPoints.hxx> |
9 | #include <Quantity_Factor.hxx> |
10 | #include <Standard_Boolean.hxx> |
11 | #include <Standard_CString.hxx> |
7fd59977 |
12 | #include <Standard_Integer.hxx> |
13 | #include <Handle_SelectMgr_Selection.hxx> |
14 | #include <Standard_OStream.hxx> |
15 | #include <Standard_IStream.hxx> |
7fd59977 |
16 | |
17 | DEFINE_STANDARD_HANDLE(Sample2D_Image,AIS2D_InteractiveObject) |
18 | class Sample2D_Image : public AIS2D_InteractiveObject { |
19 | |
20 | public: |
21 | |
22 | // Methods PUBLIC |
23 | // |
24 | Standard_EXPORT Sample2D_Image(OSD_File& aFile, |
25 | const Quantity_Length X = 0.0, |
26 | const Quantity_Length Y = 0.0, |
27 | const Quantity_Length adx = 0.0, |
28 | const Quantity_Length ady = 0.0, |
29 | const Aspect_CardinalPoints aTypeOfPlacement = Aspect_CP_Center, |
30 | const Quantity_Factor aScale = 1.0); |
31 | Standard_EXPORT Sample2D_Image(Standard_CString& aFileName, |
32 | const Quantity_Length X = 0.0, |
33 | const Quantity_Length Y = 0.0, |
34 | const Quantity_Length adx = 0.0, |
35 | const Quantity_Length ady = 0.0, |
36 | const Aspect_CardinalPoints aTypeOfPlacement = Aspect_CP_Center, |
37 | const Quantity_Factor aScale = 1.0); |
38 | Standard_EXPORT inline virtual OSD_File GetFile() const; |
39 | Standard_EXPORT inline virtual void SetFile(const OSD_File& anImage) ; |
40 | Standard_EXPORT virtual Standard_CString GetFileName() const; |
41 | Standard_EXPORT virtual void SetFileName(const Standard_CString anImageName) ; |
42 | Standard_EXPORT inline virtual void GetCoord(Quantity_Length& X,Quantity_Length& Y) const; |
43 | Standard_EXPORT inline virtual void SetCoord(const Quantity_Length X,const Quantity_Length Y) ; |
44 | Standard_EXPORT inline virtual void GetOffset(Quantity_Length& adX,Quantity_Length& adY) const; |
45 | Standard_EXPORT inline virtual void SetOffset(const Quantity_Length adX,const Quantity_Length adY) ; |
46 | Standard_EXPORT inline virtual Aspect_CardinalPoints GetTypeOfPlacement() const; |
47 | Standard_EXPORT inline virtual void SetTypeOfPlacement(const Aspect_CardinalPoints aTypeOfPlacement = Aspect_CP_Center) ; |
48 | Standard_EXPORT inline Quantity_Factor GetScale() const; |
49 | Standard_EXPORT inline void SetScale(const Quantity_Factor aNewScale) ; |
50 | Standard_EXPORT inline Standard_Boolean GetIsZoomable() const; |
51 | Standard_EXPORT inline void SetIsZoomable(const Standard_Boolean aIsZoomable) ; |
52 | |
53 | Standard_EXPORT virtual void SetContext(const Handle(AIS2D_InteractiveContext)& theContext) ; |
54 | |
55 | DEFINE_STANDARD_RTTI(Sample2D_Image) |
56 | |
57 | protected: |
58 | |
59 | // Methods PROTECTED |
60 | // |
61 | |
62 | // Fields PROTECTED |
63 | // |
64 | OSD_File myFile; |
65 | Quantity_Length myX; |
66 | Quantity_Length myY; |
67 | Quantity_Length myDx; |
68 | Quantity_Length myDy; |
69 | Aspect_CardinalPoints myTypeOfPlacement; |
70 | Quantity_Factor myScale; |
71 | Standard_Boolean myIsZoomable; |
72 | |
73 | private: |
74 | |
75 | // Methods PRIVATE |
76 | // |
77 | |
78 | // Fields PRIVATE |
79 | // |
80 | |
81 | }; |
82 | |
83 | // other inline functions and methods (like "C++: function call" methods) |
84 | // |
85 | |
86 | inline void Sample2D_Image::GetCoord(Quantity_Length& X, Quantity_Length& Y) const |
87 | { |
88 | X = myX; |
89 | Y = myY; |
90 | } |
91 | |
92 | inline void Sample2D_Image::SetCoord(const Quantity_Length X, const Quantity_Length Y) |
93 | { |
94 | myX = X; |
95 | myY = Y; |
96 | } |
97 | |
98 | inline OSD_File Sample2D_Image::GetFile() const |
99 | { |
100 | return myFile; |
101 | } |
102 | |
103 | inline void Sample2D_Image::SetFile(const OSD_File& aFile) |
104 | { |
105 | myFile = aFile; |
106 | } |
107 | |
108 | inline void Sample2D_Image::GetOffset(Quantity_Length& adX,Quantity_Length& adY) const |
109 | { |
110 | adX = myDx; |
111 | adY = myDy; |
112 | } |
113 | |
114 | inline void Sample2D_Image::SetOffset(const Quantity_Length adX,const Quantity_Length adY) |
115 | { |
116 | myDx = adX; |
117 | myDy = adY; |
118 | } |
119 | |
120 | inline Aspect_CardinalPoints Sample2D_Image::GetTypeOfPlacement() const |
121 | { |
122 | return myTypeOfPlacement; |
123 | } |
124 | |
125 | inline void Sample2D_Image::SetTypeOfPlacement(const Aspect_CardinalPoints aTypeOfPlacement) |
126 | { |
127 | myTypeOfPlacement = aTypeOfPlacement; |
128 | } |
129 | |
130 | |
131 | inline Quantity_Factor Sample2D_Image::GetScale() const |
132 | { |
133 | return myScale; |
134 | } |
135 | |
136 | inline void Sample2D_Image::SetScale(const Quantity_Factor aNewScale) |
137 | { |
138 | myScale = aNewScale; |
139 | } |
140 | |
141 | inline Standard_Boolean Sample2D_Image::GetIsZoomable() const |
142 | { |
143 | return myIsZoomable; |
144 | } |
145 | |
146 | inline void Sample2D_Image::SetIsZoomable(const Standard_Boolean aIsZoomable) |
147 | { |
148 | myIsZoomable = aIsZoomable; |
149 | } |
150 | |
151 | |
152 | #endif |