File indexing completed on 2025-01-18 10:05:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _XCAFDoc_ColorTool_HeaderFile
0017 #define _XCAFDoc_ColorTool_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_LabelSequence.hxx>
0025 #include <XCAFDoc_ColorType.hxx>
0026 class XCAFDoc_ShapeTool;
0027 class TDF_Label;
0028 class Standard_GUID;
0029 class Quantity_Color;
0030 class Quantity_ColorRGBA;
0031 class TopoDS_Shape;
0032
0033
0034 class XCAFDoc_ColorTool;
0035 DEFINE_STANDARD_HANDLE(XCAFDoc_ColorTool, TDataStd_GenericEmpty)
0036
0037
0038
0039
0040
0041
0042 class XCAFDoc_ColorTool : public TDataStd_GenericEmpty
0043 {
0044 public:
0045
0046
0047
0048 Standard_EXPORT static Standard_Boolean AutoNaming();
0049
0050
0051 Standard_EXPORT static void SetAutoNaming (Standard_Boolean theIsAutoNaming);
0052
0053 public:
0054
0055 Standard_EXPORT XCAFDoc_ColorTool();
0056
0057
0058 Standard_EXPORT static Handle(XCAFDoc_ColorTool) Set (const TDF_Label& L);
0059
0060 Standard_EXPORT static const Standard_GUID& GetID();
0061
0062
0063 Standard_EXPORT TDF_Label BaseLabel() const;
0064
0065
0066 Standard_EXPORT const Handle(XCAFDoc_ShapeTool)& ShapeTool();
0067
0068
0069
0070 Standard_EXPORT Standard_Boolean IsColor (const TDF_Label& lab) const;
0071
0072
0073
0074
0075 Standard_EXPORT static Standard_Boolean GetColor (const TDF_Label& lab, Quantity_Color& col);
0076
0077
0078
0079
0080 Standard_EXPORT static Standard_Boolean GetColor(const TDF_Label& lab, Quantity_ColorRGBA& col);
0081
0082
0083
0084
0085 Standard_EXPORT Standard_Boolean FindColor (const Quantity_Color& col, TDF_Label& lab) const;
0086
0087
0088
0089
0090 Standard_EXPORT Standard_Boolean FindColor(const Quantity_ColorRGBA& col, TDF_Label& lab) const;
0091
0092
0093
0094 Standard_EXPORT TDF_Label FindColor (const Quantity_Color& col) const;
0095
0096
0097
0098 Standard_EXPORT TDF_Label FindColor(const Quantity_ColorRGBA& col) const;
0099
0100
0101
0102
0103 Standard_EXPORT TDF_Label AddColor (const Quantity_Color& col) const;
0104
0105
0106
0107
0108 Standard_EXPORT TDF_Label AddColor(const Quantity_ColorRGBA& col) const;
0109
0110
0111 Standard_EXPORT void RemoveColor (const TDF_Label& lab) const;
0112
0113
0114
0115 Standard_EXPORT void GetColors (TDF_LabelSequence& Labels) const;
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125 Standard_EXPORT void SetColor (const TDF_Label& L, const TDF_Label& colorL, const XCAFDoc_ColorType type) const;
0126
0127
0128
0129
0130
0131 Standard_EXPORT void SetColor (const TDF_Label& L, const Quantity_Color& Color, const XCAFDoc_ColorType type) const;
0132
0133
0134
0135
0136
0137 Standard_EXPORT void SetColor(const TDF_Label& L, const Quantity_ColorRGBA& Color, const XCAFDoc_ColorType type) const;
0138
0139
0140
0141 Standard_EXPORT void UnSetColor (const TDF_Label& L, const XCAFDoc_ColorType type) const;
0142
0143
0144
0145 Standard_EXPORT Standard_Boolean IsSet (const TDF_Label& L, const XCAFDoc_ColorType type) const;
0146
0147
0148
0149 Standard_EXPORT static Standard_Boolean GetColor (const TDF_Label& L, const XCAFDoc_ColorType type, TDF_Label& colorL);
0150
0151
0152
0153 Standard_EXPORT static Standard_Boolean GetColor (const TDF_Label& L, const XCAFDoc_ColorType type, Quantity_Color& color);
0154
0155
0156
0157 Standard_EXPORT static Standard_Boolean GetColor(const TDF_Label& L, const XCAFDoc_ColorType type, Quantity_ColorRGBA& color);
0158
0159
0160
0161
0162
0163 Standard_EXPORT Standard_Boolean SetColor (const TopoDS_Shape& S, const TDF_Label& colorL, const XCAFDoc_ColorType type);
0164
0165
0166
0167
0168
0169
0170 Standard_EXPORT Standard_Boolean SetColor (const TopoDS_Shape& S, const Quantity_Color& Color, const XCAFDoc_ColorType type);
0171
0172
0173
0174
0175
0176
0177 Standard_EXPORT Standard_Boolean SetColor(const TopoDS_Shape& S, const Quantity_ColorRGBA& Color, const XCAFDoc_ColorType type);
0178
0179
0180
0181
0182 Standard_EXPORT Standard_Boolean UnSetColor (const TopoDS_Shape& S, const XCAFDoc_ColorType type);
0183
0184
0185
0186 Standard_EXPORT Standard_Boolean IsSet (const TopoDS_Shape& S, const XCAFDoc_ColorType type);
0187
0188
0189
0190 Standard_EXPORT Standard_Boolean GetColor (const TopoDS_Shape& S, const XCAFDoc_ColorType type, TDF_Label& colorL);
0191
0192
0193
0194 Standard_EXPORT Standard_Boolean GetColor (const TopoDS_Shape& S, const XCAFDoc_ColorType type, Quantity_Color& color);
0195
0196
0197
0198 Standard_EXPORT Standard_Boolean GetColor(const TopoDS_Shape& S, const XCAFDoc_ColorType type, Quantity_ColorRGBA& color);
0199
0200
0201 Standard_EXPORT static Standard_Boolean IsVisible (const TDF_Label& L);
0202
0203
0204
0205 Standard_EXPORT void SetVisibility (const TDF_Label& shapeLabel, const Standard_Boolean isvisible = Standard_True);
0206
0207
0208 Standard_EXPORT Standard_Boolean IsColorByLayer (const TDF_Label& L) const;
0209
0210
0211
0212 Standard_EXPORT void SetColorByLayer (const TDF_Label& shapeLabel, const Standard_Boolean isColorByLayer = Standard_False);
0213
0214
0215
0216
0217 Standard_EXPORT Standard_Boolean SetInstanceColor (const TopoDS_Shape& theShape, const XCAFDoc_ColorType type, const Quantity_Color& color, const Standard_Boolean isCreateSHUO = Standard_True);
0218
0219
0220
0221
0222 Standard_EXPORT Standard_Boolean SetInstanceColor(const TopoDS_Shape& theShape, const XCAFDoc_ColorType type, const Quantity_ColorRGBA& color, const Standard_Boolean isCreateSHUO = Standard_True);
0223
0224
0225
0226 Standard_EXPORT Standard_Boolean GetInstanceColor (const TopoDS_Shape& theShape, const XCAFDoc_ColorType type, Quantity_Color& color);
0227
0228
0229
0230 Standard_EXPORT Standard_Boolean GetInstanceColor(const TopoDS_Shape& theShape, const XCAFDoc_ColorType type, Quantity_ColorRGBA& color);
0231
0232
0233
0234 Standard_EXPORT Standard_Boolean IsInstanceVisible (const TopoDS_Shape& theShape);
0235
0236
0237
0238
0239 Standard_EXPORT Standard_Boolean ReverseChainsOfTreeNodes();
0240
0241 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0242
0243
0244 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0245
0246
0247 DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_ColorTool,TDataStd_GenericEmpty)
0248
0249 private:
0250
0251
0252 Handle(XCAFDoc_ShapeTool) myShapeTool;
0253
0254
0255 };
0256
0257
0258
0259
0260
0261
0262
0263 #endif