File indexing completed on 2026-09-23 09:19:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _XCAFDimTolObjects_GeomToleranceObject_HeaderFile
0017 #define _XCAFDimTolObjects_GeomToleranceObject_HeaderFile
0018
0019 #include <Standard.hxx>
0020
0021 #include <XCAFDimTolObjects_GeomToleranceType.hxx>
0022 #include <XCAFDimTolObjects_GeomToleranceTypeValue.hxx>
0023 #include <Standard_Real.hxx>
0024 #include <XCAFDimTolObjects_GeomToleranceMatReqModif.hxx>
0025 #include <XCAFDimTolObjects_GeomToleranceZoneModif.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <XCAFDimTolObjects_GeomToleranceModif.hxx>
0028 #include <Standard_Transient.hxx>
0029 #include <XCAFDimTolObjects_ToleranceZoneAffectedPlane.hxx>
0030 #include <gp_Pln.hxx>
0031 #include <TopoDS_Shape.hxx>
0032 #include <TCollection_HAsciiString.hxx>
0033
0034
0035 class XCAFDimTolObjects_GeomToleranceObject : public Standard_Transient
0036 {
0037
0038 public:
0039 Standard_EXPORT XCAFDimTolObjects_GeomToleranceObject();
0040
0041 Standard_EXPORT XCAFDimTolObjects_GeomToleranceObject(
0042 const occ::handle<XCAFDimTolObjects_GeomToleranceObject>& theObj);
0043
0044
0045 Standard_EXPORT occ::handle<TCollection_HAsciiString> GetSemanticName() const;
0046
0047
0048 Standard_EXPORT void SetSemanticName(const occ::handle<TCollection_HAsciiString>& theName);
0049
0050
0051 Standard_EXPORT void SetType(const XCAFDimTolObjects_GeomToleranceType theType);
0052
0053
0054 Standard_EXPORT XCAFDimTolObjects_GeomToleranceType GetType() const;
0055
0056
0057 Standard_EXPORT void SetTypeOfValue(
0058 const XCAFDimTolObjects_GeomToleranceTypeValue theTypeOfValue);
0059
0060
0061 Standard_EXPORT XCAFDimTolObjects_GeomToleranceTypeValue GetTypeOfValue() const;
0062
0063
0064 Standard_EXPORT void SetValue(const double theValue);
0065
0066
0067 Standard_EXPORT double GetValue() const;
0068
0069
0070 Standard_EXPORT void SetMaterialRequirementModifier(
0071 const XCAFDimTolObjects_GeomToleranceMatReqModif theMatReqModif);
0072
0073
0074 Standard_EXPORT XCAFDimTolObjects_GeomToleranceMatReqModif GetMaterialRequirementModifier() const;
0075
0076
0077 Standard_EXPORT void SetZoneModifier(const XCAFDimTolObjects_GeomToleranceZoneModif theZoneModif);
0078
0079
0080 Standard_EXPORT XCAFDimTolObjects_GeomToleranceZoneModif GetZoneModifier() const;
0081
0082
0083 Standard_EXPORT void SetValueOfZoneModifier(const double theValue);
0084
0085
0086 Standard_EXPORT double GetValueOfZoneModifier() const;
0087
0088
0089 Standard_EXPORT void SetModifiers(
0090 const NCollection_Sequence<XCAFDimTolObjects_GeomToleranceModif>& theModifiers);
0091
0092
0093 Standard_EXPORT void AddModifier(const XCAFDimTolObjects_GeomToleranceModif theModifier);
0094
0095
0096 Standard_EXPORT NCollection_Sequence<XCAFDimTolObjects_GeomToleranceModif> GetModifiers() const;
0097
0098
0099 Standard_EXPORT void SetMaxValueModifier(const double theModifier);
0100
0101
0102 Standard_EXPORT double GetMaxValueModifier() const;
0103
0104 Standard_EXPORT void SetAxis(const gp_Ax2& theAxis);
0105
0106 Standard_EXPORT gp_Ax2 GetAxis() const;
0107
0108 Standard_EXPORT bool HasAxis() const;
0109
0110
0111 void SetPlane(const gp_Ax2& thePlane)
0112 {
0113 myPlane = thePlane;
0114 myHasPlane = true;
0115 }
0116
0117
0118 const gp_Ax2& GetPlane() const { return myPlane; }
0119
0120
0121 void SetPoint(const gp_Pnt& thePnt)
0122 {
0123 myPnt = thePnt;
0124 myHasPnt = true;
0125 }
0126
0127
0128 const gp_Pnt& GetPoint() const { return myPnt; }
0129
0130
0131 void SetPointTextAttach(const gp_Pnt& thePntText)
0132 {
0133 myPntText = thePntText;
0134 myHasPntText = true;
0135 }
0136
0137
0138 const gp_Pnt& GetPointTextAttach() const { return myPntText; }
0139
0140
0141 bool HasPlane() const { return myHasPlane; }
0142
0143
0144 bool HasPoint() const { return myHasPnt; }
0145
0146
0147 bool HasPointText() const { return myHasPntText; }
0148
0149
0150 void SetPresentation(const TopoDS_Shape& thePresentation,
0151 const occ::handle<TCollection_HAsciiString>& thePresentationName)
0152 {
0153 myPresentation = thePresentation;
0154 myPresentationName = thePresentationName;
0155 }
0156
0157
0158 TopoDS_Shape GetPresentation() const { return myPresentation; }
0159
0160
0161 occ::handle<TCollection_HAsciiString> GetPresentationName() const { return myPresentationName; }
0162
0163
0164 bool HasAffectedPlane() const
0165 {
0166 return (myAffectedPlaneType != XCAFDimTolObjects_ToleranceZoneAffectedPlane_None);
0167 }
0168
0169
0170 XCAFDimTolObjects_ToleranceZoneAffectedPlane GetAffectedPlaneType() const
0171 {
0172 return myAffectedPlaneType;
0173 }
0174
0175
0176 void SetAffectedPlaneType(const XCAFDimTolObjects_ToleranceZoneAffectedPlane theType)
0177 {
0178 myAffectedPlaneType = theType;
0179 }
0180
0181
0182 void SetAffectedPlane(const gp_Pln& thePlane) { myAffectedPlane = thePlane; }
0183
0184
0185 void SetAffectedPlane(const gp_Pln& thePlane,
0186 const XCAFDimTolObjects_ToleranceZoneAffectedPlane theType)
0187 {
0188 myAffectedPlaneType = theType;
0189 myAffectedPlane = thePlane;
0190 }
0191
0192
0193 const gp_Pln& GetAffectedPlane() const { return myAffectedPlane; }
0194
0195
0196 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const;
0197
0198 DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_GeomToleranceObject, Standard_Transient)
0199
0200 private:
0201 XCAFDimTolObjects_GeomToleranceType myType;
0202 XCAFDimTolObjects_GeomToleranceTypeValue myTypeOfValue;
0203 double myValue;
0204 XCAFDimTolObjects_GeomToleranceMatReqModif myMatReqModif;
0205 XCAFDimTolObjects_GeomToleranceZoneModif myZoneModif;
0206 double myValueOfZoneModif;
0207 NCollection_Sequence<XCAFDimTolObjects_GeomToleranceModif> myModifiers;
0208 double myMaxValueModif;
0209 gp_Ax2 myAxis;
0210 bool myHasAxis;
0211 gp_Ax2 myPlane;
0212 gp_Pnt myPnt;
0213 gp_Pnt myPntText;
0214 bool myHasPlane;
0215 bool myHasPnt;
0216 bool myHasPntText;
0217 TopoDS_Shape myPresentation;
0218 occ::handle<TCollection_HAsciiString> mySemanticName;
0219 occ::handle<TCollection_HAsciiString> myPresentationName;
0220 XCAFDimTolObjects_ToleranceZoneAffectedPlane myAffectedPlaneType;
0221 gp_Pln myAffectedPlane;
0222 };
0223
0224 #endif