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_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 class XCAFDoc_VisMaterialTool : public TDF_Attribute
0036 {
0037 DEFINE_STANDARD_RTTIEXT(XCAFDoc_VisMaterialTool, TDF_Attribute)
0038 public:
0039
0040
0041 Standard_EXPORT static Handle(XCAFDoc_VisMaterialTool) Set (const TDF_Label& L);
0042
0043 Standard_EXPORT static const Standard_GUID& GetID();
0044
0045 public:
0046
0047 Standard_EXPORT XCAFDoc_VisMaterialTool();
0048
0049
0050 Standard_EXPORT TDF_Label BaseLabel() const { return Label(); }
0051
0052
0053 Standard_EXPORT const Handle(XCAFDoc_ShapeTool)& ShapeTool();
0054
0055
0056 Standard_Boolean IsMaterial (const TDF_Label& theLabel) const { return !GetMaterial (theLabel).IsNull(); }
0057
0058
0059 Standard_EXPORT static Handle(XCAFDoc_VisMaterial) GetMaterial (const TDF_Label& theMatLabel);
0060
0061
0062 Standard_EXPORT TDF_Label AddMaterial (const Handle(XCAFDoc_VisMaterial)& theMat,
0063 const TCollection_AsciiString& theName) const;
0064
0065
0066 Standard_EXPORT TDF_Label AddMaterial(const TCollection_AsciiString& theName) const;
0067
0068
0069 Standard_EXPORT void RemoveMaterial (const TDF_Label& theLabel) const;
0070
0071
0072 Standard_EXPORT void GetMaterials (TDF_LabelSequence& Labels) const;
0073
0074
0075 Standard_EXPORT void SetShapeMaterial (const TDF_Label& theShapeLabel,
0076 const TDF_Label& theMaterialLabel) const;
0077
0078
0079 Standard_EXPORT void UnSetShapeMaterial (const TDF_Label& theShapeLabel) const;
0080
0081
0082 Standard_EXPORT Standard_Boolean IsSetShapeMaterial (const TDF_Label& theLabel) const;
0083
0084
0085
0086
0087
0088 Standard_EXPORT static Standard_Boolean GetShapeMaterial (const TDF_Label& theShapeLabel, TDF_Label& theMaterialLabel);
0089
0090
0091 Standard_EXPORT static Handle(XCAFDoc_VisMaterial) GetShapeMaterial (const TDF_Label& theShapeLabel);
0092
0093
0094
0095
0096
0097 Standard_EXPORT Standard_Boolean SetShapeMaterial (const TopoDS_Shape& theShape,
0098 const TDF_Label& theMaterialLabel);
0099
0100
0101
0102 Standard_EXPORT Standard_Boolean UnSetShapeMaterial (const TopoDS_Shape& theShape);
0103
0104
0105 Standard_EXPORT Standard_Boolean IsSetShapeMaterial (const TopoDS_Shape& theShape);
0106
0107
0108
0109
0110
0111 Standard_EXPORT Standard_Boolean GetShapeMaterial (const TopoDS_Shape& theShape, TDF_Label& theMaterialLabel);
0112
0113
0114 Standard_EXPORT Handle(XCAFDoc_VisMaterial) GetShapeMaterial (const TopoDS_Shape& theShape);
0115
0116 public:
0117
0118
0119 virtual const Standard_GUID& ID() const Standard_OVERRIDE { return GetID(); }
0120
0121
0122 virtual void Restore (const Handle(TDF_Attribute)& ) Standard_OVERRIDE {}
0123
0124
0125 virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE { return new XCAFDoc_VisMaterialTool(); }
0126
0127
0128 virtual void Paste (const Handle(TDF_Attribute)& ,
0129 const Handle(TDF_RelocationTable)& ) const Standard_OVERRIDE {}
0130
0131 private:
0132
0133 Handle(XCAFDoc_ShapeTool) myShapeTool;
0134
0135 };
0136
0137 DEFINE_STANDARD_HANDLE(XCAFDoc_VisMaterialTool, TDF_Attribute)
0138
0139 #endif