2df785d7 |
1 | // Created on: 2016-10-20 |
2 | // Created by: Irina KRYLOVA |
3 | // Copyright (c) 2016 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | |
17 | #ifndef _XCAFView_Object_HeaderFile |
18 | #define _XCAFView_Object_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <gp_Dir.hxx> |
24 | #include <gp_Pln.hxx> |
25 | #include <gp_Pnt.hxx> |
0c63f2f8 |
26 | #include <TColgp_HArray1OfPnt.hxx> |
2df785d7 |
27 | #include <TCollection_HAsciiString.hxx> |
28 | #include <XCAFView_ProjectionType.hxx> |
29 | |
30 | class XCAFView_Object; |
31 | DEFINE_STANDARD_HANDLE(XCAFView_Object, Standard_Transient) |
32 | |
a8a3b37c |
33 | //! Access object for saved view |
2df785d7 |
34 | class XCAFView_Object : public Standard_Transient |
35 | { |
36 | |
37 | public: |
38 | |
39 | Standard_EXPORT XCAFView_Object(); |
40 | |
41 | Standard_EXPORT XCAFView_Object(const Handle(XCAFView_Object)& theObj); |
42 | |
0f57ab75 |
43 | void SetName(Handle(TCollection_HAsciiString) theName) |
2df785d7 |
44 | { |
45 | myName = theName; |
46 | } |
47 | |
0f57ab75 |
48 | Handle(TCollection_HAsciiString) Name() |
2df785d7 |
49 | { |
50 | return myName; |
51 | } |
52 | |
0f57ab75 |
53 | void SetType(XCAFView_ProjectionType theType) |
2df785d7 |
54 | { |
55 | myType = theType; |
56 | } |
57 | |
0f57ab75 |
58 | XCAFView_ProjectionType Type() |
2df785d7 |
59 | { |
60 | return myType; |
61 | } |
62 | |
0f57ab75 |
63 | void SetProjectionPoint(gp_Pnt thePoint) |
2df785d7 |
64 | { |
65 | myProjectionPoint = thePoint; |
66 | } |
67 | |
0f57ab75 |
68 | gp_Pnt ProjectionPoint() |
2df785d7 |
69 | { |
70 | return myProjectionPoint; |
71 | } |
72 | |
0f57ab75 |
73 | void SetViewDirection(gp_Dir theDirection) |
2df785d7 |
74 | { |
75 | myViewDirection = theDirection; |
76 | } |
77 | |
0f57ab75 |
78 | gp_Dir ViewDirection() |
2df785d7 |
79 | { |
80 | return myViewDirection; |
81 | } |
82 | |
0f57ab75 |
83 | void SetUpDirection(gp_Dir theDirection) |
2df785d7 |
84 | { |
85 | myUpDirection = theDirection; |
86 | } |
87 | |
0f57ab75 |
88 | gp_Dir UpDirection() |
2df785d7 |
89 | { |
90 | return myUpDirection; |
91 | } |
92 | |
0f57ab75 |
93 | void SetZoomFactor(Standard_Real theZoomFactor) |
2df785d7 |
94 | { |
95 | myZoomFactor = theZoomFactor; |
96 | } |
97 | |
0f57ab75 |
98 | Standard_Real ZoomFactor() |
2df785d7 |
99 | { |
100 | return myZoomFactor; |
101 | } |
102 | |
0f57ab75 |
103 | void SetWindowHorizontalSize(Standard_Real theSize) |
2df785d7 |
104 | { |
105 | myWindowHorizontalSize = theSize; |
106 | } |
107 | |
0f57ab75 |
108 | Standard_Real WindowHorizontalSize() |
2df785d7 |
109 | { |
110 | return myWindowHorizontalSize; |
111 | } |
112 | |
0f57ab75 |
113 | void SetWindowVerticalSize(Standard_Real theSize) |
2df785d7 |
114 | { |
115 | myWindowVerticalSize = theSize; |
116 | } |
117 | |
0f57ab75 |
118 | Standard_Real WindowVerticalSize() |
2df785d7 |
119 | { |
120 | return myWindowVerticalSize; |
121 | } |
122 | |
0f57ab75 |
123 | void SetClippingExpression(Handle(TCollection_HAsciiString) theExpression) |
2df785d7 |
124 | { |
0c63f2f8 |
125 | myClippingExpression = theExpression; |
2df785d7 |
126 | } |
127 | |
0f57ab75 |
128 | Handle(TCollection_HAsciiString) ClippingExpression() |
2df785d7 |
129 | { |
0c63f2f8 |
130 | return myClippingExpression; |
2df785d7 |
131 | } |
132 | |
0f57ab75 |
133 | void UnsetFrontPlaneClipping() |
2df785d7 |
134 | { |
135 | myFrontPlaneClipping = Standard_False; |
136 | } |
137 | |
0f57ab75 |
138 | Standard_Boolean HasFrontPlaneClipping() |
2df785d7 |
139 | { |
140 | return myFrontPlaneClipping; |
141 | } |
142 | |
0f57ab75 |
143 | void SetFrontPlaneDistance(Standard_Real theDistance) |
2df785d7 |
144 | { |
145 | myFrontPlaneDistance = theDistance; |
146 | myFrontPlaneClipping = Standard_True; |
147 | } |
148 | |
0f57ab75 |
149 | Standard_Real FrontPlaneDistance() |
2df785d7 |
150 | { |
151 | return myFrontPlaneDistance; |
152 | } |
153 | |
0f57ab75 |
154 | void UnsetBackPlaneClipping() |
2df785d7 |
155 | { |
156 | myBackPlaneClipping = Standard_False; |
157 | } |
158 | |
0f57ab75 |
159 | Standard_Boolean HasBackPlaneClipping() |
2df785d7 |
160 | { |
161 | return myBackPlaneClipping; |
162 | } |
163 | |
0f57ab75 |
164 | void SetBackPlaneDistance(Standard_Real theDistance) |
2df785d7 |
165 | { |
166 | myBackPlaneDistance = theDistance; |
167 | myBackPlaneClipping = Standard_True; |
168 | } |
169 | |
0f57ab75 |
170 | Standard_Real BackPlaneDistance() |
2df785d7 |
171 | { |
172 | return myBackPlaneDistance; |
173 | } |
174 | |
0f57ab75 |
175 | void SetViewVolumeSidesClipping(Standard_Boolean theViewVolumeSidesClipping) |
2df785d7 |
176 | { |
177 | myViewVolumeSidesClipping = theViewVolumeSidesClipping; |
178 | } |
179 | |
0f57ab75 |
180 | Standard_Boolean HasViewVolumeSidesClipping() |
2df785d7 |
181 | { |
182 | return myViewVolumeSidesClipping; |
183 | } |
0c63f2f8 |
184 | |
0f57ab75 |
185 | void CreateGDTPoints(const Standard_Integer theLenght) |
0c63f2f8 |
186 | { |
187 | if (theLenght > 0) |
188 | myGDTPoints = new TColgp_HArray1OfPnt(1, theLenght); |
189 | } |
190 | |
0f57ab75 |
191 | Standard_Boolean HasGDTPoints() |
0c63f2f8 |
192 | { |
193 | return (!myGDTPoints.IsNull()); |
194 | } |
195 | |
0f57ab75 |
196 | Standard_Integer NbGDTPoints() |
0c63f2f8 |
197 | { |
198 | if (myGDTPoints.IsNull()) |
199 | return 0; |
200 | return myGDTPoints->Length(); |
201 | } |
202 | |
0f57ab75 |
203 | void SetGDTPoint(const Standard_Integer theIndex, const gp_Pnt thePoint) |
0c63f2f8 |
204 | { |
205 | if (myGDTPoints.IsNull()) |
206 | return; |
207 | if (theIndex > 0 && theIndex <= myGDTPoints->Length()) |
208 | myGDTPoints->SetValue(theIndex, thePoint); |
209 | } |
210 | |
0f57ab75 |
211 | gp_Pnt GDTPoint(const Standard_Integer theIndex) |
0c63f2f8 |
212 | { |
213 | if (myGDTPoints.IsNull()) |
214 | return gp_Pnt(); |
215 | if (theIndex > 0 && theIndex <= myGDTPoints->Length()) |
216 | return myGDTPoints->Value(theIndex); |
217 | else |
218 | return gp_Pnt(); |
219 | } |
2df785d7 |
220 | |
221 | DEFINE_STANDARD_RTTIEXT(XCAFView_Object,Standard_Transient) |
222 | |
223 | private: |
224 | |
225 | Handle(TCollection_HAsciiString) myName; |
226 | XCAFView_ProjectionType myType; |
227 | gp_Pnt myProjectionPoint; |
228 | gp_Dir myViewDirection; |
229 | gp_Dir myUpDirection; |
230 | Standard_Real myZoomFactor; |
231 | Standard_Real myWindowHorizontalSize; |
232 | Standard_Real myWindowVerticalSize; |
0c63f2f8 |
233 | Handle(TCollection_HAsciiString) myClippingExpression; |
2df785d7 |
234 | Standard_Boolean myFrontPlaneClipping; |
235 | Standard_Real myFrontPlaneDistance; |
236 | Standard_Boolean myBackPlaneClipping; |
237 | Standard_Real myBackPlaneDistance; |
238 | Standard_Boolean myViewVolumeSidesClipping; |
0c63f2f8 |
239 | Handle(TColgp_HArray1OfPnt) myGDTPoints; // Point for each GDT to describe position of GDT frame in View. |
2df785d7 |
240 | }; |
241 | |
242 | #endif // _XCAFView_Object_HeaderFile |