File indexing completed on 2026-07-04 08:33:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _XCAFDoc_VisMaterialTool_HeaderFile
0015 #define _XCAFDoc_VisMaterialTool_HeaderFile
0016
0017 #include <Standard_Type.hxx>
0018 #include <TDF_LabelSequence.hxx>
0019
0020 class TopoDS_Shape;
0021 class XCAFDoc_ShapeTool;
0022 class XCAFDoc_VisMaterial;
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 class XCAFDoc_VisMaterialTool : public TDF_Attribute
0038 {
0039 DEFINE_STANDARD_RTTIEXT(XCAFDoc_VisMaterialTool, TDF_Attribute)
0040 public:
0041
0042 Standard_EXPORT static Handle(XCAFDoc_VisMaterialTool) Set(const TDF_Label& L);
0043
0044 Standard_EXPORT static const Standard_GUID& GetID();
0045
0046 public:
0047
0048 Standard_EXPORT XCAFDoc_VisMaterialTool();
0049
0050
0051 Standard_EXPORT TDF_Label BaseLabel() const { return Label(); }
0052
0053
0054 Standard_EXPORT const Handle(XCAFDoc_ShapeTool)& ShapeTool();
0055
0056
0057 Standard_Boolean IsMaterial(const TDF_Label& theLabel) const
0058 {
0059 return !GetMaterial(theLabel).IsNull();
0060 }
0061
0062
0063 Standard_EXPORT static Handle(XCAFDoc_VisMaterial) GetMaterial(const TDF_Label& theMatLabel);
0064
0065
0066 Standard_EXPORT TDF_Label AddMaterial(const Handle(XCAFDoc_VisMaterial)& theMat,
0067 const TCollection_AsciiString& theName) const;
0068
0069
0070 Standard_EXPORT TDF_Label AddMaterial(const TCollection_AsciiString& theName) const;
0071
0072
0073 Standard_EXPORT void RemoveMaterial(const TDF_Label& theLabel) const;
0074
0075
0076 Standard_EXPORT void GetMaterials(TDF_LabelSequence& Labels) const;
0077
0078
0079 Standard_EXPORT void SetShapeMaterial(const TDF_Label& theShapeLabel,
0080 const TDF_Label& theMaterialLabel) const;
0081
0082
0083 Standard_EXPORT void UnSetShapeMaterial(const TDF_Label& theShapeLabel) const;
0084
0085
0086 Standard_EXPORT Standard_Boolean IsSetShapeMaterial(const TDF_Label& theLabel) const;
0087
0088
0089
0090
0091
0092 Standard_EXPORT static Standard_Boolean GetShapeMaterial(const TDF_Label& theShapeLabel,
0093 TDF_Label& theMaterialLabel);
0094
0095
0096 Standard_EXPORT static Handle(XCAFDoc_VisMaterial) GetShapeMaterial(
0097 const TDF_Label& theShapeLabel);
0098
0099
0100
0101
0102
0103 Standard_EXPORT Standard_Boolean SetShapeMaterial(const TopoDS_Shape& theShape,
0104 const TDF_Label& theMaterialLabel);
0105
0106
0107
0108 Standard_EXPORT Standard_Boolean UnSetShapeMaterial(const TopoDS_Shape& theShape);
0109
0110
0111 Standard_EXPORT Standard_Boolean IsSetShapeMaterial(const TopoDS_Shape& theShape);
0112
0113
0114
0115
0116
0117 Standard_EXPORT Standard_Boolean GetShapeMaterial(const TopoDS_Shape& theShape,
0118 TDF_Label& theMaterialLabel);
0119
0120
0121 Standard_EXPORT Handle(XCAFDoc_VisMaterial) GetShapeMaterial(const TopoDS_Shape& theShape);
0122
0123 public:
0124
0125 virtual const Standard_GUID& ID() const Standard_OVERRIDE { return GetID(); }
0126
0127
0128 virtual void Restore(const Handle(TDF_Attribute)&) Standard_OVERRIDE {}
0129
0130
0131 virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE
0132 {
0133 return new XCAFDoc_VisMaterialTool();
0134 }
0135
0136
0137 virtual void Paste(const Handle(TDF_Attribute)&,
0138 const Handle(TDF_RelocationTable)&) const Standard_OVERRIDE
0139 {
0140 }
0141
0142 private:
0143 Handle(XCAFDoc_ShapeTool) myShapeTool;
0144 };
0145
0146 DEFINE_STANDARD_HANDLE(XCAFDoc_VisMaterialTool, TDF_Attribute)
0147
0148 #endif