File indexing completed on 2026-09-18 09:22:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _XCAFDimTolObjects_DatumObject_HeaderFile
0017 #define _XCAFDimTolObjects_DatumObject_HeaderFile
0018
0019 #include <Standard.hxx>
0020
0021 #include <XCAFDimTolObjects_DatumTargetType.hxx>
0022 #include <TCollection_HAsciiString.hxx>
0023 #include <NCollection_Sequence.hxx>
0024 #include <XCAFDimTolObjects_DatumSingleModif.hxx>
0025 #include <XCAFDimTolObjects_DatumModifWithValue.hxx>
0026 #include <Standard_Real.hxx>
0027 #include <TopoDS_Shape.hxx>
0028 #include <Standard_Transient.hxx>
0029 #include <gp_Ax2.hxx>
0030 class XCAFDimTolObjects_DatumObject;
0031
0032
0033 class XCAFDimTolObjects_DatumObject : public Standard_Transient
0034 {
0035
0036 public:
0037 Standard_EXPORT XCAFDimTolObjects_DatumObject();
0038
0039 Standard_EXPORT XCAFDimTolObjects_DatumObject(
0040 const occ::handle<XCAFDimTolObjects_DatumObject>& theObj);
0041
0042
0043 Standard_EXPORT occ::handle<TCollection_HAsciiString> GetSemanticName() const;
0044
0045
0046 Standard_EXPORT void SetSemanticName(const occ::handle<TCollection_HAsciiString>& theName);
0047
0048
0049 Standard_EXPORT occ::handle<TCollection_HAsciiString> GetName() const;
0050
0051
0052 Standard_EXPORT void SetName(const occ::handle<TCollection_HAsciiString>& theTag);
0053
0054
0055 Standard_EXPORT NCollection_Sequence<XCAFDimTolObjects_DatumSingleModif> GetModifiers() const;
0056
0057
0058 Standard_EXPORT void SetModifiers(
0059 const NCollection_Sequence<XCAFDimTolObjects_DatumSingleModif>& theModifiers);
0060
0061
0062 Standard_EXPORT void GetModifierWithValue(XCAFDimTolObjects_DatumModifWithValue& theModifier,
0063 double& theValue) const;
0064
0065
0066 Standard_EXPORT void SetModifierWithValue(const XCAFDimTolObjects_DatumModifWithValue theModifier,
0067 const double theValue);
0068
0069
0070 Standard_EXPORT void AddModifier(const XCAFDimTolObjects_DatumSingleModif theModifier);
0071
0072
0073 Standard_EXPORT TopoDS_Shape GetDatumTarget() const;
0074
0075
0076 Standard_EXPORT void SetDatumTarget(const TopoDS_Shape& theShape);
0077
0078
0079 Standard_EXPORT int GetPosition() const;
0080
0081
0082 Standard_EXPORT void SetPosition(const int thePosition);
0083
0084
0085 Standard_EXPORT bool IsDatumTarget() const;
0086
0087
0088 Standard_EXPORT void IsDatumTarget(const bool theIsDT);
0089
0090
0091 Standard_EXPORT XCAFDimTolObjects_DatumTargetType GetDatumTargetType() const;
0092
0093
0094 Standard_EXPORT void SetDatumTargetType(const XCAFDimTolObjects_DatumTargetType theType);
0095
0096
0097
0098
0099 Standard_EXPORT gp_Ax2 GetDatumTargetAxis() const;
0100
0101
0102 Standard_EXPORT void SetDatumTargetAxis(const gp_Ax2& theAxis);
0103
0104
0105
0106 Standard_EXPORT double GetDatumTargetLength() const;
0107
0108
0109 Standard_EXPORT void SetDatumTargetLength(const double theLength);
0110
0111
0112
0113
0114 Standard_EXPORT double GetDatumTargetWidth() const;
0115
0116
0117 Standard_EXPORT void SetDatumTargetWidth(const double theWidth);
0118
0119
0120 Standard_EXPORT int GetDatumTargetNumber() const;
0121
0122
0123 Standard_EXPORT void SetDatumTargetNumber(const int theNumber);
0124
0125
0126 void SetPlane(const gp_Ax2& thePlane)
0127 {
0128 myPlane = thePlane;
0129 myHasPlane = true;
0130 }
0131
0132
0133 const gp_Ax2& GetPlane() const { return myPlane; }
0134
0135
0136 void SetPoint(const gp_Pnt& thePnt)
0137 {
0138 myPnt = thePnt;
0139 myHasPnt = true;
0140 }
0141
0142
0143 const gp_Pnt& GetPoint() const { return myPnt; }
0144
0145
0146 void SetPointTextAttach(const gp_Pnt& thePntText)
0147 {
0148 myPntText = thePntText;
0149 myHasPntText = true;
0150 }
0151
0152
0153 const gp_Pnt& GetPointTextAttach() const { return myPntText; }
0154
0155
0156 bool HasPlane() const { return myHasPlane; }
0157
0158
0159 bool HasPoint() const { return myHasPnt; }
0160
0161
0162 bool HasPointText() const { return myHasPntText; }
0163
0164
0165 void SetPresentation(const TopoDS_Shape& thePresentation,
0166 const occ::handle<TCollection_HAsciiString>& thePresentationName)
0167 {
0168 myPresentation = thePresentation;
0169 myPresentationName = thePresentationName;
0170 }
0171
0172
0173 TopoDS_Shape GetPresentation() const { return myPresentation; }
0174
0175
0176 occ::handle<TCollection_HAsciiString> GetPresentationName() const { return myPresentationName; }
0177
0178
0179
0180 bool HasDatumTargetParams() { return myIsValidDT; }
0181
0182
0183 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const;
0184
0185 DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_DatumObject, Standard_Transient)
0186
0187 private:
0188 occ::handle<TCollection_HAsciiString> myName;
0189 NCollection_Sequence<XCAFDimTolObjects_DatumSingleModif> myModifiers;
0190 XCAFDimTolObjects_DatumModifWithValue myModifierWithValue;
0191 double myValueOfModifier;
0192 TopoDS_Shape myDatumTarget;
0193 int myPosition;
0194 bool myIsDTarget;
0195 bool myIsValidDT;
0196 XCAFDimTolObjects_DatumTargetType myDTargetType;
0197 double myLength;
0198 double myWidth;
0199 int myDatumTargetNumber;
0200 gp_Ax2 myAxis;
0201 gp_Ax2 myPlane;
0202 gp_Pnt myPnt;
0203 gp_Pnt myPntText;
0204 bool myHasPlane;
0205 bool myHasPnt;
0206 bool myHasPntText;
0207 TopoDS_Shape myPresentation;
0208 occ::handle<TCollection_HAsciiString> mySemanticName;
0209 occ::handle<TCollection_HAsciiString> myPresentationName;
0210 };
0211
0212 #endif