File indexing completed on 2025-01-18 10:05:34
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;
0031 DEFINE_STANDARD_HANDLE(XCAFDoc_LengthUnit, TDF_Attribute)
0032
0033
0034 class XCAFDoc_LengthUnit : public TDF_Attribute
0035 {
0036
0037 public:
0038
0039
0040 Standard_EXPORT static const Standard_GUID& GetID();
0041
0042
0043
0044
0045
0046 Standard_EXPORT static Handle(XCAFDoc_LengthUnit) Set(const TDF_Label& theLabel,
0047 const TCollection_AsciiString& theUnitName,
0048 const Standard_Real theUnitValue);
0049
0050
0051
0052
0053 Standard_EXPORT static Handle(XCAFDoc_LengthUnit) Set(const TDF_Label& theLabel,
0054 const Standard_Real theUnitValue);
0055
0056
0057
0058
0059
0060 Standard_EXPORT static Handle(XCAFDoc_LengthUnit) Set(const TDF_Label& theLabel,
0061 const Standard_GUID& theGUID,
0062 const TCollection_AsciiString& theUnitName,
0063 const Standard_Real theUnitValue);
0064
0065
0066
0067
0068 Standard_EXPORT void Set(const TCollection_AsciiString& theUnitName,
0069 const Standard_Real theUnitValue);
0070
0071
0072 const TCollection_AsciiString& GetUnitName() const { return myUnitName; }
0073
0074
0075 Standard_Real GetUnitValue() const { return myUnitScaleValue; }
0076
0077 Standard_EXPORT Standard_Boolean IsEmpty() const { return myUnitName.IsEmpty(); }
0078
0079 Standard_EXPORT XCAFDoc_LengthUnit();
0080
0081 Standard_EXPORT virtual const Standard_GUID& ID() const Standard_OVERRIDE;
0082
0083 Standard_EXPORT virtual void Restore(const Handle(TDF_Attribute)& theWith) Standard_OVERRIDE;
0084
0085 Standard_EXPORT virtual void Paste(const Handle(TDF_Attribute)& theInto, const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE;
0086
0087 Standard_EXPORT virtual Standard_OStream& Dump(Standard_OStream& anOS) const Standard_OVERRIDE;
0088
0089
0090 Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0091
0092
0093 DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_LengthUnit, TDF_Attribute)
0094
0095 private:
0096
0097 Standard_Real myUnitScaleValue;
0098 TCollection_AsciiString myUnitName;
0099 };
0100
0101 #endif