0029855: Data Exchange, XCAF GD&T - PMI objects copy constructors ignore presentation
[occt.git] / src / XCAFDimTolObjects / XCAFDimTolObjects_GeomToleranceObject.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #include <XCAFDimTolObjects_GeomToleranceObject.hxx>
15
16 IMPLEMENT_STANDARD_RTTIEXT(XCAFDimTolObjects_GeomToleranceObject,Standard_Transient)
17
18 //=======================================================================
19 //function : XCAFDimTolObjects_GeomTolerance
20 //purpose  : 
21 //=======================================================================
22
23 XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject()
24 {
25   myHasAxis = Standard_False;
26   myHasPlane = Standard_False;
27   myHasPnt = Standard_False;
28   myHasPntText = Standard_False;
29   myAffectedPlaneType = XCAFDimTolObjects_ToleranceZoneAffectedPlane_None;
30 }
31
32 //=======================================================================
33 //function : XCAFDimTolObjects_GeomTolerance
34 //purpose  : 
35 //=======================================================================
36
37 XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject(const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObj)
38 {
39   myType = theObj->myType;
40   myTypeOfValue = theObj->myTypeOfValue;
41   myValue = theObj->myValue;
42   myMatReqModif = theObj->myMatReqModif;
43   myZoneModif = theObj->myZoneModif;
44   myValueOfZoneModif = theObj->myValueOfZoneModif;
45   myModifiers = theObj->myModifiers;
46   myMaxValueModif = theObj->myMaxValueModif;
47   myAxis = theObj->myAxis;
48   myHasAxis = theObj->myHasAxis;
49   myPlane = theObj->myPlane;
50   myPnt= theObj->myPnt;
51   myPntText= theObj->myPntText;
52   myHasPlane = theObj->myHasPlane;
53   myHasPnt = theObj->myHasPnt;
54   myHasPntText = theObj->myHasPntText;
55   mySemanticName = theObj->mySemanticName;
56   myAffectedPlaneType = theObj->myAffectedPlaneType;
57   myAffectedPlane = theObj->myAffectedPlane;
58   myPresentation = theObj->myPresentation;
59   myPresentationName = theObj->myPresentationName;
60 }
61
62 //=======================================================================
63 //function : 
64 //purpose  : 
65 //=======================================================================
66
67 Handle(TCollection_HAsciiString) XCAFDimTolObjects_GeomToleranceObject::GetSemanticName() const
68 {
69   return mySemanticName;
70 }
71
72 //=======================================================================
73 //function : 
74 //purpose  : 
75 //=======================================================================
76
77 void XCAFDimTolObjects_GeomToleranceObject::SetSemanticName(const Handle(TCollection_HAsciiString)& theName)
78 {
79   mySemanticName = theName;
80 }
81
82 //=======================================================================
83 //function :
84 //purpose  : 
85 //=======================================================================
86
87 void XCAFDimTolObjects_GeomToleranceObject::SetType (const XCAFDimTolObjects_GeomToleranceType theType) 
88 {
89   myType = theType;
90 }
91
92 //=======================================================================
93 //function :
94 //purpose  : 
95 //=======================================================================
96
97 XCAFDimTolObjects_GeomToleranceType XCAFDimTolObjects_GeomToleranceObject::GetType()  const
98 {
99   return myType;
100 }
101
102 //=======================================================================
103 //function :
104 //purpose  : 
105 //=======================================================================
106
107 void XCAFDimTolObjects_GeomToleranceObject::SetTypeOfValue (const XCAFDimTolObjects_GeomToleranceTypeValue theTypeOfValue) 
108 {
109   myTypeOfValue = theTypeOfValue;
110 }
111
112 //=======================================================================
113 //function :
114 //purpose  : 
115 //=======================================================================
116
117 XCAFDimTolObjects_GeomToleranceTypeValue XCAFDimTolObjects_GeomToleranceObject::GetTypeOfValue()  const
118 {
119   return myTypeOfValue;
120 }
121
122 //=======================================================================
123 //function :
124 //purpose  : 
125 //=======================================================================
126
127 void XCAFDimTolObjects_GeomToleranceObject::SetValue (const Standard_Real theValue) 
128 {
129   myValue = theValue;
130 }
131
132 //=======================================================================
133 //function :
134 //purpose  : 
135 //=======================================================================
136
137 Standard_Real XCAFDimTolObjects_GeomToleranceObject::GetValue()  const
138 {
139   return myValue;
140 }
141
142 //=======================================================================
143 //function :
144 //purpose  : 
145 //=======================================================================
146
147 void XCAFDimTolObjects_GeomToleranceObject::SetMaterialRequirementModifier (const XCAFDimTolObjects_GeomToleranceMatReqModif theMatReqModif) 
148 {
149   myMatReqModif = theMatReqModif;
150 }
151
152 //=======================================================================
153 //function :
154 //purpose  : 
155 //=======================================================================
156
157 XCAFDimTolObjects_GeomToleranceMatReqModif XCAFDimTolObjects_GeomToleranceObject::GetMaterialRequirementModifier()  const
158 {
159   return myMatReqModif;
160 }
161
162 //=======================================================================
163 //function :
164 //purpose  : 
165 //=======================================================================
166
167 void XCAFDimTolObjects_GeomToleranceObject::SetZoneModifier (const XCAFDimTolObjects_GeomToleranceZoneModif theZoneModif) 
168 {
169   myZoneModif = theZoneModif;
170 }
171
172 //=======================================================================
173 //function :
174 //purpose  : 
175 //=======================================================================
176
177 XCAFDimTolObjects_GeomToleranceZoneModif XCAFDimTolObjects_GeomToleranceObject::GetZoneModifier()  const
178 {
179   return myZoneModif;
180 }
181
182 //=======================================================================
183 //function :
184 //purpose  : 
185 //=======================================================================
186
187 void XCAFDimTolObjects_GeomToleranceObject::SetValueOfZoneModifier (const Standard_Real theValue) 
188 {
189   myValueOfZoneModif = theValue;
190 }
191
192 //=======================================================================
193 //function :
194 //purpose  : 
195 //=======================================================================
196
197 Standard_Real XCAFDimTolObjects_GeomToleranceObject::GetValueOfZoneModifier()  const
198 {
199   return myValueOfZoneModif;
200 }
201
202 //=======================================================================
203 //function :
204 //purpose  : 
205 //=======================================================================
206
207 void XCAFDimTolObjects_GeomToleranceObject::SetModifiers (const XCAFDimTolObjects_GeomToleranceModifiersSequence& theModifiers) 
208 {
209   myModifiers = theModifiers;
210 }
211
212 //=======================================================================
213 //function :
214 //purpose  : 
215 //=======================================================================
216
217 void XCAFDimTolObjects_GeomToleranceObject::AddModifier (const XCAFDimTolObjects_GeomToleranceModif theModifier) 
218 {
219   myModifiers.Append(theModifier);
220 }
221
222 //=======================================================================
223 //function :
224 //purpose  : 
225 //=======================================================================
226
227 XCAFDimTolObjects_GeomToleranceModifiersSequence XCAFDimTolObjects_GeomToleranceObject::GetModifiers()  const
228 {
229   return myModifiers;
230 }
231
232 //=======================================================================
233 //function :
234 //purpose  : 
235 //=======================================================================
236
237 void XCAFDimTolObjects_GeomToleranceObject::SetMaxValueModifier (const Standard_Real theModifier) 
238 {
239   myMaxValueModif = theModifier;
240 }
241
242 //=======================================================================
243 //function :
244 //purpose  : 
245 //=======================================================================
246
247 Standard_Real XCAFDimTolObjects_GeomToleranceObject::GetMaxValueModifier()  const
248 {
249   return myMaxValueModif;
250 }
251
252 //=======================================================================
253 //function :
254 //purpose  : 
255 //=======================================================================
256
257 void XCAFDimTolObjects_GeomToleranceObject::SetAxis (const gp_Ax2 theAxis) 
258 {
259   myAxis = theAxis;
260   myHasAxis = Standard_True;
261 }
262
263 //=======================================================================
264 //function :
265 //purpose  : 
266 //=======================================================================
267
268 gp_Ax2 XCAFDimTolObjects_GeomToleranceObject::GetAxis()  const
269 {
270   return myAxis;
271 }
272
273 //=======================================================================
274 //function :
275 //purpose  : 
276 //=======================================================================
277
278 Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasAxis () const 
279 {
280   return myHasAxis;
281 }