File indexing completed on 2026-09-11 09:19:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _XCAFDoc_MaterialTool_HeaderFile
0017 #define _XCAFDoc_MaterialTool_HeaderFile
0018
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021
0022 #include <TDataStd_GenericEmpty.hxx>
0023 #include <Standard_Boolean.hxx>
0024 #include <TDF_Label.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <Standard_Real.hxx>
0027 class XCAFDoc_ShapeTool;
0028 class TDF_Label;
0029 class Standard_GUID;
0030 class TCollection_HAsciiString;
0031
0032
0033
0034
0035
0036
0037 class XCAFDoc_MaterialTool : public TDataStd_GenericEmpty
0038 {
0039
0040 public:
0041 Standard_EXPORT XCAFDoc_MaterialTool();
0042
0043
0044 Standard_EXPORT static occ::handle<XCAFDoc_MaterialTool> Set(const TDF_Label& L);
0045
0046 Standard_EXPORT static const Standard_GUID& GetID();
0047
0048
0049 Standard_EXPORT TDF_Label BaseLabel() const;
0050
0051
0052 Standard_EXPORT const occ::handle<XCAFDoc_ShapeTool>& ShapeTool();
0053
0054
0055
0056 Standard_EXPORT bool IsMaterial(const TDF_Label& lab) const;
0057
0058
0059
0060 Standard_EXPORT void GetMaterialLabels(NCollection_Sequence<TDF_Label>& Labels) const;
0061
0062
0063 Standard_EXPORT TDF_Label
0064 AddMaterial(const occ::handle<TCollection_HAsciiString>& aName,
0065 const occ::handle<TCollection_HAsciiString>& aDescription,
0066 const double aDensity,
0067 const occ::handle<TCollection_HAsciiString>& aDensName,
0068 const occ::handle<TCollection_HAsciiString>& aDensValType) const;
0069
0070
0071 Standard_EXPORT void SetMaterial(const TDF_Label& L, const TDF_Label& MatL) const;
0072
0073
0074
0075 Standard_EXPORT void SetMaterial(const TDF_Label& L,
0076 const occ::handle<TCollection_HAsciiString>& aName,
0077 const occ::handle<TCollection_HAsciiString>& aDescription,
0078 const double aDensity,
0079 const occ::handle<TCollection_HAsciiString>& aDensName,
0080 const occ::handle<TCollection_HAsciiString>& aDensValType) const;
0081
0082
0083
0084 Standard_EXPORT static bool GetMaterial(const TDF_Label& MatL,
0085 occ::handle<TCollection_HAsciiString>& aName,
0086 occ::handle<TCollection_HAsciiString>& aDescription,
0087 double& aDensity,
0088 occ::handle<TCollection_HAsciiString>& aDensName,
0089 occ::handle<TCollection_HAsciiString>& aDensValType);
0090
0091
0092
0093 Standard_EXPORT static double GetDensityForShape(const TDF_Label& ShapeL);
0094
0095 Standard_EXPORT const Standard_GUID& ID() const override;
0096
0097
0098 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0099
0100 DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_MaterialTool, TDataStd_GenericEmpty)
0101
0102 private:
0103 occ::handle<XCAFDoc_ShapeTool> myShapeTool;
0104 };
0105
0106 #endif