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 myHasPlane = Standard_False;
28 myHasPnt = Standard_False;
29 myHasPntText = Standard_False;
32 //=======================================================================
33 //function : XCAFDimTolObjects_DatumObject
35 //=======================================================================
37 XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDimTolObjects_DatumObject)& theObj)
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;
49 myPntText= theObj->myPntText;
50 myHasPlane = theObj->myHasPlane;
51 myHasPnt = theObj->myHasPnt;
52 myHasPntText = theObj->myHasPntText;
55 //=======================================================================
58 //=======================================================================
60 Handle(TCollection_HAsciiString) XCAFDimTolObjects_DatumObject::GetName() const
63 return new TCollection_HAsciiString();
67 //=======================================================================
70 //=======================================================================
72 void XCAFDimTolObjects_DatumObject::SetName(const Handle(TCollection_HAsciiString)& theName)
77 //=======================================================================
78 //function : GetModifiers
80 //=======================================================================
82 XCAFDimTolObjects_DatumModifiersSequence XCAFDimTolObjects_DatumObject::GetModifiers() const
87 //=======================================================================
88 //function : SetModifiers
90 //=======================================================================
92 void XCAFDimTolObjects_DatumObject::SetModifiers(const XCAFDimTolObjects_DatumModifiersSequence& theModifiers)
94 myModifiers = theModifiers;
97 //=======================================================================
98 //function : SetModifierWithValue
100 //=======================================================================
102 void XCAFDimTolObjects_DatumObject::SetModifierWithValue(const XCAFDimTolObjects_DatumModifWithValue theModifier, const Standard_Real theValue)
104 myModifierWithValue = theModifier;
105 myValueOfModifier = theValue;
108 //=======================================================================
109 //function : GetModifierWithValue
111 //=======================================================================
113 void XCAFDimTolObjects_DatumObject::GetModifierWithValue(XCAFDimTolObjects_DatumModifWithValue& theModifier, Standard_Real& theValue) const
115 theModifier = myModifierWithValue;
116 theValue = myValueOfModifier;
119 //=======================================================================
120 //function : AddModifier
122 //=======================================================================
124 void XCAFDimTolObjects_DatumObject::AddModifier(const XCAFDimTolObjects_DatumSingleModif theModifier)
126 myModifiers.Append(theModifier);
129 //=======================================================================
130 //function : GetDatumTarget
132 //=======================================================================
134 TopoDS_Shape XCAFDimTolObjects_DatumObject::GetDatumTarget() const
136 return myDatumTarget;
139 //=======================================================================
140 //function : SetDatumTarget
142 //=======================================================================
144 void XCAFDimTolObjects_DatumObject::SetDatumTarget (const TopoDS_Shape& theShape)
146 myDatumTarget = theShape;
149 //=======================================================================
150 //function : GetPosition
152 //=======================================================================
154 Standard_Integer XCAFDimTolObjects_DatumObject::GetPosition() const
159 //=======================================================================
162 //=======================================================================
164 void XCAFDimTolObjects_DatumObject::SetPosition(const Standard_Integer thePosition)
166 myPosition = thePosition;
169 //=======================================================================
170 //function : IsDatumTarget
172 //=======================================================================
174 Standard_Boolean XCAFDimTolObjects_DatumObject::IsDatumTarget() const
179 //=======================================================================
180 //function : IsDatumTarget
182 //=======================================================================
184 void XCAFDimTolObjects_DatumObject::IsDatumTarget(const Standard_Boolean theIsDT)
186 myIsDTarget = theIsDT;
189 //=======================================================================
190 //function : GetDatumTargetType
192 //=======================================================================
194 XCAFDimTolObjects_DatumTargetType XCAFDimTolObjects_DatumObject::GetDatumTargetType() const
196 return myDTargetType;
199 //=======================================================================
200 //function : SetDatumTargetType
202 //=======================================================================
204 void XCAFDimTolObjects_DatumObject::SetDatumTargetType(const XCAFDimTolObjects_DatumTargetType theType)
206 myDTargetType = theType;
209 //=======================================================================
210 //function : GetDatumTargetAxis
212 //=======================================================================
214 gp_Ax2 XCAFDimTolObjects_DatumObject::GetDatumTargetAxis() const
219 //=======================================================================
220 //function : SetDatumTargetAxis
222 //=======================================================================
224 void XCAFDimTolObjects_DatumObject::SetDatumTargetAxis(const gp_Ax2& theAxis)
229 //=======================================================================
230 //function : GetDatumTargetLength
232 //=======================================================================
234 Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetLength() const
239 //=======================================================================
240 //function : SetDatumTargetLength
242 //=======================================================================
244 void XCAFDimTolObjects_DatumObject::SetDatumTargetLength(const Standard_Real theLength)
246 myLength = theLength;
250 //=======================================================================
251 //function : GetDatumTargetWidth
253 //=======================================================================
255 Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetWidth() const
260 //=======================================================================
261 //function : SetDatumTargetWidth
263 //=======================================================================
265 void XCAFDimTolObjects_DatumObject::SetDatumTargetWidth(const Standard_Real theWidth)
270 //=======================================================================
271 //function : GetDatumTargetNumber
273 //=======================================================================
275 Standard_Integer XCAFDimTolObjects_DatumObject::GetDatumTargetNumber() const
277 return myDatumTargetNumber;
280 //=======================================================================
281 //function : SetDatumTargetNumber
283 //=======================================================================
285 void XCAFDimTolObjects_DatumObject::SetDatumTargetNumber(const Standard_Integer theNumber)
287 myDatumTargetNumber = theNumber;