File indexing completed on 2025-01-18 10:05:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef _XCAFDimTolObjects_DimensionObject_HeaderFile
0019 #define _XCAFDimTolObjects_DimensionObject_HeaderFile
0020
0021 #include <Standard.hxx>
0022 #include <Standard_Type.hxx>
0023
0024 #include <XCAFDimTolObjects_DimensionObjectSequence.hxx>
0025 #include <XCAFDimTolObjects_DimensionType.hxx>
0026 #include <TColStd_HArray1OfReal.hxx>
0027 #include <XCAFDimTolObjects_DimensionQualifier.hxx>
0028 #include <XCAFDimTolObjects_DimensionFormVariance.hxx>
0029 #include <XCAFDimTolObjects_DimensionGrade.hxx>
0030 #include <Standard_Integer.hxx>
0031 #include <XCAFDimTolObjects_DimensionModifiersSequence.hxx>
0032 #include <TopoDS_Edge.hxx>
0033 #include <gp_Dir.hxx>
0034 #include <gp_Ax2.hxx>
0035 #include <TColgp_HArray1OfPnt.hxx>
0036 #include <Standard_Transient.hxx>
0037 #include <Standard_Real.hxx>
0038 #include <XCAFDimTolObjects_DimensionModif.hxx>
0039 #include <TCollection_HAsciiString.hxx>
0040 #include <NCollection_Vector.hxx>
0041 #include <XCAFDimTolObjects_AngularQualifier.hxx>
0042
0043 class XCAFDimTolObjects_DimensionObject;
0044 DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_DimensionObject, Standard_Transient)
0045
0046
0047 class XCAFDimTolObjects_DimensionObject : public Standard_Transient
0048 {
0049
0050 public:
0051
0052 Standard_EXPORT XCAFDimTolObjects_DimensionObject();
0053
0054 Standard_EXPORT XCAFDimTolObjects_DimensionObject(const Handle(XCAFDimTolObjects_DimensionObject)& theObj);
0055
0056
0057 Standard_EXPORT Handle(TCollection_HAsciiString) GetSemanticName() const;
0058
0059
0060 Standard_EXPORT void SetSemanticName(const Handle(TCollection_HAsciiString)& theName);
0061
0062
0063 Standard_EXPORT void SetQualifier (const XCAFDimTolObjects_DimensionQualifier theQualifier);
0064
0065
0066 Standard_EXPORT XCAFDimTolObjects_DimensionQualifier GetQualifier() const;
0067
0068
0069 Standard_EXPORT Standard_Boolean HasQualifier() const;
0070
0071
0072 Standard_EXPORT void SetAngularQualifier(const XCAFDimTolObjects_AngularQualifier theAngularQualifier);
0073
0074
0075 Standard_EXPORT XCAFDimTolObjects_AngularQualifier GetAngularQualifier() const;
0076
0077
0078 Standard_EXPORT Standard_Boolean HasAngularQualifier() const;
0079
0080
0081 Standard_EXPORT void SetType (const XCAFDimTolObjects_DimensionType theTyupe);
0082
0083
0084 Standard_EXPORT XCAFDimTolObjects_DimensionType GetType() const;
0085
0086
0087
0088 Standard_EXPORT Standard_Real GetValue() const;
0089
0090
0091 Standard_EXPORT Handle(TColStd_HArray1OfReal) GetValues() const;
0092
0093
0094
0095 Standard_EXPORT void SetValue (const Standard_Real theValue);
0096
0097
0098 Standard_EXPORT void SetValues (const Handle(TColStd_HArray1OfReal)& theValue);
0099
0100
0101
0102
0103 Standard_EXPORT Standard_Boolean IsDimWithRange() const;
0104
0105
0106
0107 Standard_EXPORT void SetUpperBound (const Standard_Real theUpperBound);
0108
0109
0110
0111 Standard_EXPORT void SetLowerBound(const Standard_Real theLowerBound);
0112
0113
0114 Standard_EXPORT Standard_Real GetUpperBound() const;
0115
0116
0117 Standard_EXPORT Standard_Real GetLowerBound() const;
0118
0119
0120
0121
0122 Standard_EXPORT Standard_Boolean IsDimWithPlusMinusTolerance() const;
0123
0124
0125
0126
0127 Standard_EXPORT Standard_Boolean SetUpperTolValue(const Standard_Real theUperTolValue);
0128
0129
0130
0131
0132 Standard_EXPORT Standard_Boolean SetLowerTolValue(const Standard_Real theLowerTolValue);
0133
0134
0135 Standard_EXPORT Standard_Real GetUpperTolValue() const;
0136
0137
0138 Standard_EXPORT Standard_Real GetLowerTolValue() const;
0139
0140
0141 Standard_EXPORT Standard_Boolean IsDimWithClassOfTolerance() const;
0142
0143
0144
0145
0146
0147
0148 Standard_EXPORT void SetClassOfTolerance (const Standard_Boolean theHole,
0149 const XCAFDimTolObjects_DimensionFormVariance theFormVariance,
0150 const XCAFDimTolObjects_DimensionGrade theGrade);
0151
0152
0153
0154 Standard_EXPORT Standard_Boolean GetClassOfTolerance (Standard_Boolean& theHole,
0155 XCAFDimTolObjects_DimensionFormVariance& theFormVariance,
0156 XCAFDimTolObjects_DimensionGrade& theGrade) const;
0157
0158
0159 Standard_EXPORT void SetNbOfDecimalPlaces (const Standard_Integer theL, const Standard_Integer theR);
0160
0161
0162 Standard_EXPORT void GetNbOfDecimalPlaces(Standard_Integer& theL, Standard_Integer& theR) const;
0163
0164
0165 Standard_EXPORT XCAFDimTolObjects_DimensionModifiersSequence GetModifiers() const;
0166
0167
0168 Standard_EXPORT void SetModifiers (const XCAFDimTolObjects_DimensionModifiersSequence& theModifiers);
0169
0170
0171 Standard_EXPORT void AddModifier (const XCAFDimTolObjects_DimensionModif theModifier);
0172
0173
0174 Standard_EXPORT TopoDS_Edge GetPath() const;
0175
0176
0177 Standard_EXPORT void SetPath (const TopoDS_Edge& thePath);
0178
0179
0180 Standard_EXPORT Standard_Boolean GetDirection (gp_Dir& theDir) const;
0181
0182
0183 Standard_EXPORT Standard_Boolean SetDirection (const gp_Dir& theDir);
0184
0185
0186 void SetPointTextAttach (const gp_Pnt& thePntText)
0187 {
0188 myPntText = thePntText;
0189 myHasPntText = Standard_True;
0190 }
0191
0192
0193 const gp_Pnt& GetPointTextAttach() const { return myPntText; }
0194
0195
0196 Standard_Boolean HasTextPoint() const
0197 {
0198 return myHasPntText;
0199 }
0200
0201
0202 void SetPlane (const gp_Ax2& thePlane)
0203 {
0204 myPlane = thePlane;
0205 myHasPlane = Standard_True;
0206 }
0207
0208
0209 const gp_Ax2& GetPlane() const { return myPlane; }
0210
0211
0212 Standard_Boolean HasPlane() const { return myHasPlane; }
0213
0214
0215
0216 Standard_Boolean HasPoint() const { return myHasPoint1; }
0217
0218
0219 Standard_Boolean HasPoint2() const { return myHasPoint2; }
0220
0221
0222
0223 void SetPoint(const gp_Pnt& thePnt) {
0224 myPnt1 = thePnt;
0225 myHasPoint1 = Standard_True;
0226 }
0227
0228
0229 void SetPoint2(const gp_Pnt& thePnt) {
0230 myPnt2 = thePnt;
0231 myHasPoint2 = Standard_True;
0232 }
0233
0234
0235
0236 gp_Pnt GetPoint() const {
0237 return myPnt1;
0238 }
0239
0240
0241 gp_Pnt GetPoint2() const {
0242 return myPnt2;
0243 }
0244
0245
0246 void SetPresentation(const TopoDS_Shape& thePresentation,
0247 const Handle(TCollection_HAsciiString)& thePresentationName)
0248 {
0249 myPresentation = thePresentation;
0250 myPresentationName = thePresentationName;
0251 }
0252
0253
0254 TopoDS_Shape GetPresentation() const
0255 {
0256 return myPresentation;
0257 }
0258
0259
0260 Standard_EXPORT Handle(TCollection_HAsciiString) GetPresentationName() const
0261 {
0262 return myPresentationName;
0263 }
0264
0265
0266 Standard_Boolean HasDescriptions() const
0267 {
0268 return (myDescriptions.Length() > 0);
0269 }
0270
0271
0272 Standard_Integer NbDescriptions() const
0273 {
0274 return myDescriptions.Length();
0275 }
0276
0277
0278 Handle(TCollection_HAsciiString) GetDescription(const Standard_Integer theNumber) const
0279 {
0280 if (theNumber < myDescriptions.Lower() || theNumber > myDescriptions.Upper())
0281 return new TCollection_HAsciiString();
0282 return myDescriptions.Value(theNumber);
0283 }
0284
0285
0286 Handle(TCollection_HAsciiString) GetDescriptionName(const Standard_Integer theNumber) const
0287 {
0288 if (theNumber < myDescriptions.Lower() || theNumber > myDescriptions.Upper())
0289 return new TCollection_HAsciiString();
0290 return myDescriptionNames.Value(theNumber);
0291 }
0292
0293
0294 Standard_EXPORT void RemoveDescription(const Standard_Integer theNumber);
0295
0296
0297 void AddDescription(const Handle(TCollection_HAsciiString) theDescription, const Handle(TCollection_HAsciiString) theName)
0298 {
0299 myDescriptions.Append(theDescription);
0300 myDescriptionNames.Append(theName);
0301 }
0302
0303
0304 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0305
0306 DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_DimensionObject,Standard_Transient)
0307
0308 private:
0309
0310 XCAFDimTolObjects_DimensionType myType;
0311 Handle(TColStd_HArray1OfReal) myVal;
0312 XCAFDimTolObjects_DimensionQualifier myQualifier;
0313 XCAFDimTolObjects_AngularQualifier myAngularQualifier;
0314 Standard_Boolean myIsHole;
0315 XCAFDimTolObjects_DimensionFormVariance myFormVariance;
0316 XCAFDimTolObjects_DimensionGrade myGrade;
0317 Standard_Integer myL;
0318 Standard_Integer myR;
0319 XCAFDimTolObjects_DimensionModifiersSequence myModifiers;
0320 TopoDS_Edge myPath;
0321 gp_Dir myDir;
0322 gp_Pnt myPnt1, myPnt2;
0323 Standard_Boolean myHasPoint1, myHasPoint2;
0324 gp_Ax2 myPlane;
0325 Standard_Boolean myHasPlane;
0326 Standard_Boolean myHasPntText;
0327 gp_Pnt myPntText;
0328 TopoDS_Shape myPresentation;
0329 Handle(TCollection_HAsciiString) mySemanticName;
0330 Handle(TCollection_HAsciiString) myPresentationName;
0331 NCollection_Vector<Handle(TCollection_HAsciiString)> myDescriptions;
0332 NCollection_Vector<Handle(TCollection_HAsciiString)> myDescriptionNames;
0333
0334 };
0335
0336 #endif