9ebaae37 |
1 | // Created on: 2015-08-06 |
2 | // Created by: Ilya Novikov |
3 | // Copyright (c) 2004-2014 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 _XCAFDimTolObjects_DatumObject_HeaderFile |
18 | #define _XCAFDimTolObjects_DatumObject_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <XCAFDimTolObjects_DatumObjectSequence.hxx> |
1c9d3225 |
24 | #include <XCAFDimTolObjects_DatumTargetType.hxx> |
9ebaae37 |
25 | #include <TCollection_HAsciiString.hxx> |
26 | #include <XCAFDimTolObjects_DatumModifiersSequence.hxx> |
27 | #include <XCAFDimTolObjects_DatumModifWithValue.hxx> |
28 | #include <Standard_Real.hxx> |
29 | #include <TopoDS_Shape.hxx> |
30 | #include <Standard_Transient.hxx> |
31 | #include <XCAFDimTolObjects_DatumSingleModif.hxx> |
32 | #include <Standard_Boolean.hxx> |
1c9d3225 |
33 | #include <gp_Ax2.hxx> |
9ebaae37 |
34 | |
35 | class XCAFDimTolObjects_DatumObject; |
36 | DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_DatumObject, Standard_Transient) |
37 | |
38 | //! object to store datum |
39 | class XCAFDimTolObjects_DatumObject : public Standard_Transient |
40 | { |
41 | |
42 | public: |
43 | |
44 | Standard_EXPORT XCAFDimTolObjects_DatumObject(); |
45 | |
46 | Standard_EXPORT XCAFDimTolObjects_DatumObject(const Handle(XCAFDimTolObjects_DatumObject)& theObj); |
47 | |
48 | Standard_EXPORT Handle(TCollection_HAsciiString) GetName() const; |
49 | |
50 | Standard_EXPORT void SetName (const Handle(TCollection_HAsciiString)& theTag); |
51 | |
52 | Standard_EXPORT XCAFDimTolObjects_DatumModifiersSequence GetModifiers() const; |
53 | |
54 | Standard_EXPORT void SetModifiers (const XCAFDimTolObjects_DatumModifiersSequence& theModifiers); |
55 | |
56 | Standard_EXPORT void GetModifierWithValue (XCAFDimTolObjects_DatumModifWithValue& theModifier, Standard_Real& theValue) const; |
57 | |
58 | Standard_EXPORT void SetModifierWithValue (const XCAFDimTolObjects_DatumModifWithValue theModifier, const Standard_Real theValue); |
59 | |
60 | Standard_EXPORT void AddModifier (const XCAFDimTolObjects_DatumSingleModif theModifier); |
61 | |
62 | Standard_EXPORT TopoDS_Shape GetDatumTarget() const; |
63 | |
64 | Standard_EXPORT void SetDatumTarget (const TopoDS_Shape& theShape); |
1c9d3225 |
65 | |
66 | Standard_EXPORT Standard_Integer GetPosition () const; |
67 | |
68 | Standard_EXPORT void SetPosition (const Standard_Integer thePosition); |
9ebaae37 |
69 | |
70 | Standard_EXPORT Standard_Boolean IsDatumTarget() const; |
71 | |
1c9d3225 |
72 | Standard_EXPORT void IsDatumTarget(const Standard_Boolean theIsDT); |
73 | |
74 | Standard_EXPORT XCAFDimTolObjects_DatumTargetType GetDatumTargetType() const; |
75 | |
76 | Standard_EXPORT void SetDatumTargetType (const XCAFDimTolObjects_DatumTargetType theType); |
77 | |
78 | Standard_EXPORT gp_Ax2 GetDatumTargetAxis() const; |
79 | |
80 | Standard_EXPORT void SetDatumTargetAxis (const gp_Ax2& theAxis); |
81 | |
82 | Standard_EXPORT Standard_Real GetDatumTargetLength() const; |
83 | |
84 | Standard_EXPORT void SetDatumTargetLength (const Standard_Real theLength); |
85 | |
86 | Standard_EXPORT Standard_Real GetDatumTargetWidth() const; |
87 | |
88 | Standard_EXPORT void SetDatumTargetWidth (const Standard_Real theWidth); |
89 | |
6595eee7 |
90 | Standard_EXPORT Standard_Integer GetDatumTargetNumber() const; |
91 | |
92 | Standard_EXPORT void SetDatumTargetNumber (const Standard_Integer theNumber); |
93 | |
5df609e7 |
94 | Standard_EXPORT void SetPlane (const gp_Ax2& thePlane) |
95 | { |
96 | myPlane = thePlane; |
97 | myHasPlane = Standard_True; |
98 | } |
99 | |
100 | Standard_EXPORT const gp_Ax2& GetPlane() const { return myPlane; } |
101 | |
102 | Standard_EXPORT void SetPoint (const gp_Pnt& thePnt) |
103 | { |
104 | myPnt = thePnt; |
105 | myHasPnt = Standard_True; |
106 | } |
107 | |
108 | Standard_EXPORT const gp_Pnt& GetPoint() const |
109 | { |
110 | return myPnt; |
111 | } |
112 | |
113 | |
114 | Standard_EXPORT void SetPointTextAttach (const gp_Pnt& thePntText) |
115 | { |
116 | myPntText = thePntText; |
117 | myHasPntText = Standard_True; |
118 | } |
119 | |
120 | Standard_EXPORT const gp_Pnt& GetPointTextAttach() const |
121 | { |
122 | return myPntText; |
123 | } |
124 | |
125 | Standard_Boolean HasPlane() const { return myHasPlane; } |
126 | |
127 | Standard_Boolean HasPoint() const { return myHasPnt; } |
128 | |
129 | Standard_EXPORT Standard_Boolean HasPointText() const |
130 | { |
131 | return myHasPntText; |
132 | } |
133 | |
134 | //! Set graphical presentation for object |
135 | Standard_EXPORT void SetPresentation(const TopoDS_Shape& thePresentation, |
136 | const Handle(TCollection_HAsciiString)& thePresentationName) |
137 | { |
138 | myPresentation = thePresentation; |
139 | myPresentationName = thePresentationName; |
140 | } |
141 | |
142 | //! Returns graphical presentation of the object |
143 | Standard_EXPORT TopoDS_Shape GetPresentation() const |
144 | { |
145 | return myPresentation; |
146 | } |
147 | |
148 | //! Returns graphical presentation of the object |
149 | Standard_EXPORT Handle(TCollection_HAsciiString) GetPresentationName() const |
150 | { |
151 | return myPresentationName; |
152 | } |
153 | |
400af1bc |
154 | //! Returns true if datum has valid parameters for datum target (width, length, circle radius etc) |
155 | Standard_EXPORT Standard_Boolean HasDatumTargetParams() |
156 | { |
157 | return myIsValidDT; |
158 | } |
9ebaae37 |
159 | |
92efcf78 |
160 | DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_DatumObject,Standard_Transient) |
9ebaae37 |
161 | |
162 | private: |
163 | |
164 | Handle(TCollection_HAsciiString) myName; |
165 | XCAFDimTolObjects_DatumModifiersSequence myModifiers; |
166 | XCAFDimTolObjects_DatumModifWithValue myModifierWithValue; |
167 | Standard_Real myValueOfModifier; |
168 | TopoDS_Shape myDatumTarget; |
1c9d3225 |
169 | Standard_Integer myPosition; |
170 | Standard_Boolean myIsDTarget; |
400af1bc |
171 | Standard_Boolean myIsValidDT; |
1c9d3225 |
172 | XCAFDimTolObjects_DatumTargetType myDTargetType; |
173 | gp_Ax2 myAxis; |
174 | Standard_Real myLength; |
175 | Standard_Real myWidth; |
6595eee7 |
176 | Standard_Integer myDatumTargetNumber; |
5df609e7 |
177 | gp_Ax2 myPlane; |
178 | gp_Pnt myPnt; |
179 | gp_Pnt myPntText; |
180 | Standard_Boolean myHasPlane; |
181 | Standard_Boolean myHasPnt; |
182 | Standard_Boolean myHasPntText; |
183 | TopoDS_Shape myPresentation; |
184 | Handle(TCollection_HAsciiString) myPresentationName; |
9ebaae37 |
185 | }; |
186 | |
187 | #endif // _XCAFDimTolObjects_DatumObject_HeaderFile |