1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <XCAFDimTolObjects_DatumObject.hxx>
17 IMPLEMENT_STANDARD_RTTIEXT(XCAFDimTolObjects_DatumObject,Standard_Transient)
19 //=======================================================================
20 //function : XCAFDimTolObjects_DatumObject
22 //=======================================================================
24 XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject()
26 myIsDTarget = Standard_False;
27 myIsValidDT = Standard_False;
28 myHasPlane = Standard_False;
29 myHasPnt = Standard_False;
30 myHasPntText = Standard_False;
33 //=======================================================================
34 //function : XCAFDimTolObjects_DatumObject
36 //=======================================================================
38 XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDimTolObjects_DatumObject)& theObj)
40 myName = theObj->myName;
41 myModifiers = theObj->myModifiers;
42 myModifierWithValue = theObj->myModifierWithValue;
43 myValueOfModifier = theObj->myValueOfModifier;
44 myDatumTarget = theObj->myDatumTarget;
45 myIsDTarget = theObj->myIsDTarget;
46 myIsValidDT = theObj->myIsValidDT;
47 myAxis = theObj->myAxis;
48 myDTargetType = theObj->myDTargetType;
49 myPlane = theObj->myPlane;
51 myPntText= theObj->myPntText;
52 myHasPlane = theObj->myHasPlane;
53 myHasPnt = theObj->myHasPnt;
54 myHasPntText = theObj->myHasPntText;
57 //=======================================================================
60 //=======================================================================
62 Handle(TCollection_HAsciiString) XCAFDimTolObjects_DatumObject::GetName() const
65 return new TCollection_HAsciiString();
69 //=======================================================================
72 //=======================================================================
74 void XCAFDimTolObjects_DatumObject::SetName(const Handle(TCollection_HAsciiString)& theName)
79 //=======================================================================
80 //function : GetModifiers
82 //=======================================================================
84 XCAFDimTolObjects_DatumModifiersSequence XCAFDimTolObjects_DatumObject::GetModifiers() const
89 //=======================================================================
90 //function : SetModifiers
92 //=======================================================================
94 void XCAFDimTolObjects_DatumObject::SetModifiers(const XCAFDimTolObjects_DatumModifiersSequence& theModifiers)
96 myModifiers = theModifiers;
99 //=======================================================================
100 //function : SetModifierWithValue
102 //=======================================================================
104 void XCAFDimTolObjects_DatumObject::SetModifierWithValue(const XCAFDimTolObjects_DatumModifWithValue theModifier, const Standard_Real theValue)
106 myModifierWithValue = theModifier;
107 myValueOfModifier = theValue;
110 //=======================================================================
111 //function : GetModifierWithValue
113 //=======================================================================
115 void XCAFDimTolObjects_DatumObject::GetModifierWithValue(XCAFDimTolObjects_DatumModifWithValue& theModifier, Standard_Real& theValue) const
117 theModifier = myModifierWithValue;
118 theValue = myValueOfModifier;
121 //=======================================================================
122 //function : AddModifier
124 //=======================================================================
126 void XCAFDimTolObjects_DatumObject::AddModifier(const XCAFDimTolObjects_DatumSingleModif theModifier)
128 myModifiers.Append(theModifier);
131 //=======================================================================
132 //function : GetDatumTarget
134 //=======================================================================
136 TopoDS_Shape XCAFDimTolObjects_DatumObject::GetDatumTarget() const
138 return myDatumTarget;
141 //=======================================================================
142 //function : SetDatumTarget
144 //=======================================================================
146 void XCAFDimTolObjects_DatumObject::SetDatumTarget (const TopoDS_Shape& theShape)
148 myDatumTarget = theShape;
151 //=======================================================================
152 //function : GetPosition
154 //=======================================================================
156 Standard_Integer XCAFDimTolObjects_DatumObject::GetPosition() const
161 //=======================================================================
164 //=======================================================================
166 void XCAFDimTolObjects_DatumObject::SetPosition(const Standard_Integer thePosition)
168 myPosition = thePosition;
171 //=======================================================================
172 //function : IsDatumTarget
174 //=======================================================================
176 Standard_Boolean XCAFDimTolObjects_DatumObject::IsDatumTarget() const
181 //=======================================================================
182 //function : IsDatumTarget
184 //=======================================================================
186 void XCAFDimTolObjects_DatumObject::IsDatumTarget(const Standard_Boolean theIsDT)
188 myIsDTarget = theIsDT;
191 //=======================================================================
192 //function : GetDatumTargetType
194 //=======================================================================
196 XCAFDimTolObjects_DatumTargetType XCAFDimTolObjects_DatumObject::GetDatumTargetType() const
198 return myDTargetType;
201 //=======================================================================
202 //function : SetDatumTargetType
204 //=======================================================================
206 void XCAFDimTolObjects_DatumObject::SetDatumTargetType(const XCAFDimTolObjects_DatumTargetType theType)
208 myDTargetType = theType;
211 //=======================================================================
212 //function : GetDatumTargetAxis
214 //=======================================================================
216 gp_Ax2 XCAFDimTolObjects_DatumObject::GetDatumTargetAxis() const
221 //=======================================================================
222 //function : SetDatumTargetAxis
224 //=======================================================================
226 void XCAFDimTolObjects_DatumObject::SetDatumTargetAxis(const gp_Ax2& theAxis)
229 myIsValidDT = Standard_True;
232 //=======================================================================
233 //function : GetDatumTargetLength
235 //=======================================================================
237 Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetLength() const
242 //=======================================================================
243 //function : SetDatumTargetLength
245 //=======================================================================
247 void XCAFDimTolObjects_DatumObject::SetDatumTargetLength(const Standard_Real theLength)
249 myLength = theLength;
250 myIsValidDT = Standard_True;
254 //=======================================================================
255 //function : GetDatumTargetWidth
257 //=======================================================================
259 Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetWidth() const
264 //=======================================================================
265 //function : SetDatumTargetWidth
267 //=======================================================================
269 void XCAFDimTolObjects_DatumObject::SetDatumTargetWidth(const Standard_Real theWidth)
272 myIsValidDT = Standard_True;
275 //=======================================================================
276 //function : GetDatumTargetNumber
278 //=======================================================================
280 Standard_Integer XCAFDimTolObjects_DatumObject::GetDatumTargetNumber() const
282 return myDatumTargetNumber;
285 //=======================================================================
286 //function : SetDatumTargetNumber
288 //=======================================================================
290 void XCAFDimTolObjects_DatumObject::SetDatumTargetNumber(const Standard_Integer theNumber)
292 myDatumTargetNumber = theNumber;