File indexing completed on 2026-09-15 09:17:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _XCAFDoc_LengthUnit_HeaderFile
0015 #define _XCAFDoc_LengthUnit_HeaderFile
0016
0017 #include <Standard.hxx>
0018 #include <Standard_Type.hxx>
0019 #include <TDF_DerivedAttribute.hxx>
0020
0021 #include <TCollection_AsciiString.hxx>
0022 #include <TDF_Attribute.hxx>
0023 #include <Standard_OStream.hxx>
0024 #include <Standard_GUID.hxx>
0025
0026 class TDF_Label;
0027 class TDF_RelocationTable;
0028
0029
0030 class XCAFDoc_LengthUnit : public TDF_Attribute
0031 {
0032
0033 public:
0034
0035 Standard_EXPORT static const Standard_GUID& GetID();
0036
0037
0038
0039
0040
0041 Standard_EXPORT static occ::handle<XCAFDoc_LengthUnit> Set(
0042 const TDF_Label& theLabel,
0043 const TCollection_AsciiString& theUnitName,
0044 const double theUnitValue);
0045
0046
0047
0048
0049 Standard_EXPORT static occ::handle<XCAFDoc_LengthUnit> Set(const TDF_Label& theLabel,
0050 const double theUnitValue);
0051
0052
0053
0054
0055
0056 Standard_EXPORT static occ::handle<XCAFDoc_LengthUnit> Set(
0057 const TDF_Label& theLabel,
0058 const Standard_GUID& theGUID,
0059 const TCollection_AsciiString& theUnitName,
0060 const double theUnitValue);
0061
0062
0063
0064
0065 Standard_EXPORT void Set(const TCollection_AsciiString& theUnitName, const double theUnitValue);
0066
0067
0068 const TCollection_AsciiString& GetUnitName() const { return myUnitName; }
0069
0070
0071 double GetUnitValue() const { return myUnitScaleValue; }
0072
0073 Standard_EXPORT bool IsEmpty() const { return myUnitName.IsEmpty(); }
0074
0075 Standard_EXPORT XCAFDoc_LengthUnit();
0076
0077 Standard_EXPORT const Standard_GUID& ID() const override;
0078
0079 Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& theWith) override;
0080
0081 Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>& theInto,
0082 const occ::handle<TDF_RelocationTable>& theRT) const override;
0083
0084 Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0085
0086
0087 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0088
0089 DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_LengthUnit, TDF_Attribute)
0090
0091 private:
0092 double myUnitScaleValue;
0093 TCollection_AsciiString myUnitName;
0094 };
0095
0096 #endif