1 // Created on: 2015-08-06
2 // Created by: Ilya Novikov
3 // Copyright (c) 2004-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #ifndef _XCAFDimTolObjects_GeomToleranceObject_HeaderFile
18 #define _XCAFDimTolObjects_GeomToleranceObject_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <XCAFDimTolObjects_GeomToleranceObjectSequence.hxx>
24 #include <XCAFDimTolObjects_GeomToleranceType.hxx>
25 #include <XCAFDimTolObjects_GeomToleranceTypeValue.hxx>
26 #include <Standard_Real.hxx>
27 #include <XCAFDimTolObjects_GeomToleranceMatReqModif.hxx>
28 #include <XCAFDimTolObjects_GeomToleranceZoneModif.hxx>
29 #include <XCAFDimTolObjects_GeomToleranceModifiersSequence.hxx>
30 #include <Standard_Transient.hxx>
31 #include <XCAFDimTolObjects_GeomToleranceModif.hxx>
33 #include <TopoDS_Shape.hxx>
34 #include <TCollection_HAsciiString.hxx>
36 class XCAFDimTolObjects_GeomToleranceObject;
37 DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_GeomToleranceObject, Standard_Transient)
39 //! Access object to store dimension and tolerance
40 class XCAFDimTolObjects_GeomToleranceObject : public Standard_Transient
45 Standard_EXPORT XCAFDimTolObjects_GeomToleranceObject();
47 Standard_EXPORT XCAFDimTolObjects_GeomToleranceObject(const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObj);
49 //! Sets type of the object.
50 Standard_EXPORT void SetType (const XCAFDimTolObjects_GeomToleranceType theType);
52 //! Returns type of the object.
53 Standard_EXPORT XCAFDimTolObjects_GeomToleranceType GetType() const;
55 //! Sets type of tolerance value.
56 Standard_EXPORT void SetTypeOfValue (const XCAFDimTolObjects_GeomToleranceTypeValue theTypeOfValue);
58 //! Returns type of tolerance value.
59 Standard_EXPORT XCAFDimTolObjects_GeomToleranceTypeValue GetTypeOfValue() const;
61 //! Sets tolerance value.
62 Standard_EXPORT void SetValue (const Standard_Real theValue);
64 //! Returns tolerance value.
65 Standard_EXPORT Standard_Real GetValue() const;
67 //! Sets material requirement of the tolerance.
68 Standard_EXPORT void SetMaterialRequirementModifier (const XCAFDimTolObjects_GeomToleranceMatReqModif theMatReqModif);
70 //! Returns material requirement of the tolerance.
71 Standard_EXPORT XCAFDimTolObjects_GeomToleranceMatReqModif GetMaterialRequirementModifier() const;
73 //! Sets tolerance zone.
74 Standard_EXPORT void SetZoneModifier (const XCAFDimTolObjects_GeomToleranceZoneModif theZoneModif);
76 //! Returns tolerance zone.
77 Standard_EXPORT XCAFDimTolObjects_GeomToleranceZoneModif GetZoneModifier() const;
79 //! Sets value associated with tolerance zone.
80 Standard_EXPORT void SetValueOfZoneModifier (const Standard_Real theValue);
82 //! Returns value associated with tolerance zone.
83 Standard_EXPORT Standard_Real GetValueOfZoneModifier() const;
85 //! Sets new sequence of tolerance modifiers.
86 Standard_EXPORT void SetModifiers (const XCAFDimTolObjects_GeomToleranceModifiersSequence& theModifiers);
88 //! Adds a tolerance modifier to the sequence of modifiers.
89 Standard_EXPORT void AddModifier (const XCAFDimTolObjects_GeomToleranceModif theModifier);
91 //! Returns a sequence of modifiers of the tolerance.
92 Standard_EXPORT XCAFDimTolObjects_GeomToleranceModifiersSequence GetModifiers() const;
94 //! Sets the maximal upper tolerance value for tolerance with modifiers.
95 Standard_EXPORT void SetMaxValueModifier (const Standard_Real theModifier);
97 //! Returns the maximal upper tolerance.
98 Standard_EXPORT Standard_Real GetMaxValueModifier() const;
100 Standard_EXPORT void SetAxis (const gp_Ax2 theAxis);
102 Standard_EXPORT gp_Ax2 GetAxis() const;
104 Standard_EXPORT Standard_Boolean HasAxis () const;
106 //! Sets annotation plane.
107 void SetPlane (const gp_Ax2& thePlane)
110 myHasPlane = Standard_True;
113 //! Returns annotation plane.
114 const gp_Ax2& GetPlane() const { return myPlane; }
116 //! Sets reference point.
117 void SetPoint (const gp_Pnt& thePnt)
120 myHasPnt = Standard_True;
123 //! Returns reference point.
124 const gp_Pnt& GetPoint() const { return myPnt; }
126 //! Sets text position.
127 void SetPointTextAttach (const gp_Pnt& thePntText)
129 myPntText = thePntText;
130 myHasPntText = Standard_True;
133 //! Returns the text position.
134 const gp_Pnt& GetPointTextAttach() const
139 //! Returns True if the object has annotation plane.
140 Standard_Boolean HasPlane() const { return myHasPlane; }
142 //! Returns True if reference point is specified.
143 Standard_Boolean HasPoint() const { return myHasPnt; }
145 //! Returns True if text position is specified.
146 Standard_Boolean HasPointText() const
151 //! Set graphical presentation for object.
152 Standard_EXPORT void SetPresentation(const TopoDS_Shape& thePresentation,
153 const Handle(TCollection_HAsciiString)& thePresentationName)
155 myPresentation = thePresentation;
156 myPresentationName = thePresentationName;
159 //! Returns graphical presentation of the object.
160 Standard_EXPORT TopoDS_Shape GetPresentation() const
162 return myPresentation;
165 //! Returns graphical presentation of the object.
166 Standard_EXPORT Handle(TCollection_HAsciiString) GetPresentationName() const
168 return myPresentationName;
171 DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_GeomToleranceObject,Standard_Transient)
175 XCAFDimTolObjects_GeomToleranceType myType;
176 XCAFDimTolObjects_GeomToleranceTypeValue myTypeOfValue;
177 Standard_Real myValue;
178 XCAFDimTolObjects_GeomToleranceMatReqModif myMatReqModif;
179 XCAFDimTolObjects_GeomToleranceZoneModif myZoneModif;
180 Standard_Real myValueOfZoneModif;
181 XCAFDimTolObjects_GeomToleranceModifiersSequence myModifiers;
182 Standard_Real myMaxValueModif;
184 Standard_Boolean myHasAxis;
188 Standard_Boolean myHasPlane;
189 Standard_Boolean myHasPnt;
190 Standard_Boolean myHasPntText;
191 TopoDS_Shape myPresentation;
192 Handle(TCollection_HAsciiString) myPresentationName;
196 #endif // _XCAFDimTolObjects_GeomToleranceObject_HeaderFile