0027455: Implementation of connection points
[occt.git] / src / XCAFDimTolObjects / XCAFDimTolObjects_DatumObject.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_DatumObject.hxx>
15
16
17 IMPLEMENT_STANDARD_RTTIEXT(XCAFDimTolObjects_DatumObject,Standard_Transient)
18
19 //=======================================================================
20 //function : XCAFDimTolObjects_DatumObject
21 //purpose  : 
22 //=======================================================================
23
24 XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject()
25 {
26   myIsDTarget = Standard_False;
27   myHasPlane = Standard_False;
28   myHasPnt = Standard_False;
29   myHasPntText = Standard_False;
30 }
31
32 //=======================================================================
33 //function : XCAFDimTolObjects_DatumObject
34 //purpose  : 
35 //=======================================================================
36
37 XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDimTolObjects_DatumObject)& theObj)
38 {
39   myName = theObj->myName;
40   myModifiers = theObj->myModifiers;
41   myModifierWithValue = theObj->myModifierWithValue;
42   myValueOfModifier = theObj->myValueOfModifier;
43   myDatumTarget = theObj->myDatumTarget;
44   myIsDTarget = theObj->myIsDTarget;
45   myAxis = theObj->myAxis;
46   myDTargetType = theObj->myDTargetType;
47   myPlane = theObj->myPlane;
48   myPnt= theObj->myPnt;
49   myPntText= theObj->myPntText;
50   myHasPlane = theObj->myHasPlane;
51   myHasPnt = theObj->myHasPnt;
52   myHasPntText = theObj->myHasPntText;
53 }
54
55 //=======================================================================
56 //function : GetName
57 //purpose  : 
58 //=======================================================================
59
60 Handle(TCollection_HAsciiString) XCAFDimTolObjects_DatumObject::GetName() const
61 {
62   if(myName.IsNull())
63     return new TCollection_HAsciiString();
64   return myName;
65 }
66
67 //=======================================================================
68 //function : SetName
69 //purpose  : 
70 //=======================================================================
71
72 void XCAFDimTolObjects_DatumObject::SetName(const Handle(TCollection_HAsciiString)& theName)
73 {
74   myName = theName;
75 }
76
77 //=======================================================================
78 //function : GetModifiers
79 //purpose  : 
80 //=======================================================================
81
82 XCAFDimTolObjects_DatumModifiersSequence XCAFDimTolObjects_DatumObject::GetModifiers() const
83 {
84   return myModifiers;
85 }
86
87 //=======================================================================
88 //function : SetModifiers
89 //purpose  : 
90 //=======================================================================
91
92 void XCAFDimTolObjects_DatumObject::SetModifiers(const XCAFDimTolObjects_DatumModifiersSequence& theModifiers)
93 {
94   myModifiers = theModifiers;
95 }
96
97 //=======================================================================
98 //function : SetModifierWithValue
99 //purpose  : 
100 //=======================================================================
101
102 void XCAFDimTolObjects_DatumObject::SetModifierWithValue(const XCAFDimTolObjects_DatumModifWithValue theModifier, const Standard_Real theValue)
103 {
104   myModifierWithValue = theModifier;
105   myValueOfModifier = theValue;
106 }
107
108 //=======================================================================
109 //function : GetModifierWithValue
110 //purpose  : 
111 //=======================================================================
112
113 void XCAFDimTolObjects_DatumObject::GetModifierWithValue(XCAFDimTolObjects_DatumModifWithValue& theModifier, Standard_Real& theValue) const
114 {
115   theModifier = myModifierWithValue;
116   theValue = myValueOfModifier;
117 }
118   
119 //=======================================================================
120 //function : AddModifier
121 //purpose  : 
122 //=======================================================================
123
124 void XCAFDimTolObjects_DatumObject::AddModifier(const XCAFDimTolObjects_DatumSingleModif theModifier)
125 {
126   myModifiers.Append(theModifier);
127 }
128
129 //=======================================================================
130 //function : GetDatumTarget
131 //purpose  : 
132 //=======================================================================
133
134 TopoDS_Shape XCAFDimTolObjects_DatumObject::GetDatumTarget()  const
135 {
136   return myDatumTarget;
137 }
138
139 //=======================================================================
140 //function : SetDatumTarget
141 //purpose  : 
142 //=======================================================================
143
144 void XCAFDimTolObjects_DatumObject::SetDatumTarget (const TopoDS_Shape& theShape) 
145 {
146   myDatumTarget = theShape;
147 }
148   
149 //=======================================================================
150 //function : GetPosition
151 //purpose  : 
152 //=======================================================================
153
154 Standard_Integer XCAFDimTolObjects_DatumObject::GetPosition() const
155 {
156   return myPosition;
157 }
158
159 //=======================================================================
160 //function : SetName
161 //purpose  : 
162 //=======================================================================
163
164 void XCAFDimTolObjects_DatumObject::SetPosition(const Standard_Integer thePosition)
165 {
166   myPosition = thePosition;
167 }
168
169 //=======================================================================
170 //function : IsDatumTarget
171 //purpose  : 
172 //=======================================================================
173
174 Standard_Boolean XCAFDimTolObjects_DatumObject::IsDatumTarget() const
175 {
176   return myIsDTarget;
177 }
178
179 //=======================================================================
180 //function : IsDatumTarget
181 //purpose  : 
182 //=======================================================================
183
184 void XCAFDimTolObjects_DatumObject::IsDatumTarget(const Standard_Boolean theIsDT)
185 {
186   myIsDTarget = theIsDT;
187 }
188
189 //=======================================================================
190 //function : GetDatumTargetType
191 //purpose  : 
192 //=======================================================================
193
194 XCAFDimTolObjects_DatumTargetType XCAFDimTolObjects_DatumObject::GetDatumTargetType() const
195 {
196   return myDTargetType;
197 }
198
199 //=======================================================================
200 //function : SetDatumTargetType
201 //purpose  : 
202 //=======================================================================
203
204 void XCAFDimTolObjects_DatumObject::SetDatumTargetType(const XCAFDimTolObjects_DatumTargetType theType)
205 {
206   myDTargetType = theType;
207 }
208
209 //=======================================================================
210 //function : GetDatumTargetAxis
211 //purpose  : 
212 //=======================================================================
213
214 gp_Ax2 XCAFDimTolObjects_DatumObject::GetDatumTargetAxis() const
215 {
216   return myAxis;
217 }
218
219 //=======================================================================
220 //function : SetDatumTargetAxis
221 //purpose  : 
222 //=======================================================================
223
224 void XCAFDimTolObjects_DatumObject::SetDatumTargetAxis(const gp_Ax2& theAxis)
225 {
226   myAxis = theAxis;
227 }
228
229 //=======================================================================
230 //function : GetDatumTargetLength
231 //purpose  : 
232 //=======================================================================
233
234 Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetLength() const
235 {
236   return myLength;
237 }
238
239 //=======================================================================
240 //function : SetDatumTargetLength
241 //purpose  : 
242 //=======================================================================
243
244 void XCAFDimTolObjects_DatumObject::SetDatumTargetLength(const Standard_Real theLength)
245 {
246   myLength = theLength;
247 }
248
249
250 //=======================================================================
251 //function : GetDatumTargetWidth
252 //purpose  : 
253 //=======================================================================
254
255 Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetWidth() const
256 {
257   return myWidth;
258 }
259
260 //=======================================================================
261 //function : SetDatumTargetWidth
262 //purpose  : 
263 //=======================================================================
264
265 void XCAFDimTolObjects_DatumObject::SetDatumTargetWidth(const Standard_Real theWidth)
266 {
267   myWidth = theWidth;
268 }
269
270 //=======================================================================
271 //function : GetDatumTargetNumber
272 //purpose  : 
273 //=======================================================================
274
275 Standard_Integer XCAFDimTolObjects_DatumObject::GetDatumTargetNumber() const
276 {
277   return myDatumTargetNumber;
278 }
279
280 //=======================================================================
281 //function : SetDatumTargetNumber
282 //purpose  : 
283 //=======================================================================
284
285 void XCAFDimTolObjects_DatumObject::SetDatumTargetNumber(const Standard_Integer theNumber)
286 {
287   myDatumTargetNumber = theNumber;
288 }