// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _XCAFDoc_ColorTool_HeaderFile #define _XCAFDoc_ColorTool_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_DefineHandle_HeaderFile #include #endif #ifndef _Handle_XCAFDoc_ColorTool_HeaderFile #include #endif #ifndef _Handle_XCAFDoc_ShapeTool_HeaderFile #include #endif #ifndef _TDF_Attribute_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _XCAFDoc_ColorType_HeaderFile #include #endif #ifndef _Handle_TDF_Attribute_HeaderFile #include #endif #ifndef _Handle_TDF_RelocationTable_HeaderFile #include #endif class XCAFDoc_ShapeTool; class TDF_Label; class Standard_GUID; class Quantity_Color; class TDF_LabelSequence; class TopoDS_Shape; class TDF_Attribute; class TDF_RelocationTable; //! Provides tools to store and retrieve attributes (colors)
//! of TopoDS_Shape in and from TDocStd_Document
//! A Document is intended to hold different
//! attributes of ONE shape and it's sub-shapes
class XCAFDoc_ColorTool : public TDF_Attribute { public: Standard_EXPORT XCAFDoc_ColorTool(); //! Creates (if not exist) ColorTool.
Standard_EXPORT static Handle_XCAFDoc_ColorTool Set(const TDF_Label& L) ; Standard_EXPORT static const Standard_GUID& GetID() ; //! returns the label under which colors are stored
Standard_EXPORT TDF_Label BaseLabel() const; //! Returns internal XCAFDoc_ShapeTool tool
Standard_EXPORT const Handle_XCAFDoc_ShapeTool& ShapeTool() ; //! Returns True if label belongs to a colortable and
//! is a color definition
Standard_EXPORT Standard_Boolean IsColor(const TDF_Label& lab) const; //! Returns color defined by label lab
//! Returns False if the label is not in colortable
//! or does not define a color
Standard_EXPORT Standard_Boolean GetColor(const TDF_Label& lab,Quantity_Color& col) const; //! Finds a color definition in a colortable and returns
//! its label if found
//! Returns False if color is not found in colortable
Standard_EXPORT Standard_Boolean FindColor(const Quantity_Color& col,TDF_Label& lab) const; //! Finds a color definition in a colortable and returns
//! its label if found (or Null label else)
Standard_EXPORT TDF_Label FindColor(const Quantity_Color& col) const; //! Adds a color definition to a colortable and returns
//! its label (returns existing label if the same color
//! is already defined)
Standard_EXPORT TDF_Label AddColor(const Quantity_Color& col) const; //! Removes color from the colortable
Standard_EXPORT void RemoveColor(const TDF_Label& lab) const; //! Returns a sequence of colors currently stored
//! in the colortable
Standard_EXPORT void GetColors(TDF_LabelSequence& Labels) const; //! Sets a link with GUID defined by (see
//! XCAFDoc::ColorRefGUID()) from label to color
//! defined by
Standard_EXPORT void SetColor(const TDF_Label& L,const TDF_Label& colorL,const XCAFDoc_ColorType type) const; //! Sets a link with GUID defined by (see
//! XCAFDoc::ColorRefGUID()) from label to color
//! in the colortable
//! Adds a color as necessary
Standard_EXPORT void SetColor(const TDF_Label& L,const Quantity_Color& Color,const XCAFDoc_ColorType type) const; //! Removes a link with GUID defined by (see
//! XCAFDoc::ColorRefGUID()) from label to color
Standard_EXPORT void UnSetColor(const TDF_Label& L,const XCAFDoc_ColorType type) const; //! Returns True if label has a color assignment
//! of the type
Standard_EXPORT Standard_Boolean IsSet(const TDF_Label& L,const XCAFDoc_ColorType type) const; //! Returns label with color assigned to as
//! Returns False if no such color is assigned
Standard_EXPORT Standard_Boolean GetColor(const TDF_Label& L,const XCAFDoc_ColorType type,TDF_Label& colorL) ; //! Returns color assigned to as
//! Returns False if no such color is assigned
Standard_EXPORT Standard_Boolean GetColor(const TDF_Label& L,const XCAFDoc_ColorType type,Quantity_Color& color) ; //! Sets a link with GUID defined by (see
//! XCAFDoc::ColorRefGUID()) from label to color
//! defined by
//! Returns False if cannot find a label for shape S
Standard_EXPORT Standard_Boolean SetColor(const TopoDS_Shape& S,const TDF_Label& colorL,const XCAFDoc_ColorType type) ; //! Sets a link with GUID defined by (see
//! XCAFDoc::ColorRefGUID()) from label to color
//! in the colortable
//! Adds a color as necessary
//! Returns False if cannot find a label for shape S
Standard_EXPORT Standard_Boolean SetColor(const TopoDS_Shape& S,const Quantity_Color& Color,const XCAFDoc_ColorType type) ; //! Removes a link with GUID defined by (see
//! XCAFDoc::ColorRefGUID()) from label to color
//! Returns True if such link existed
Standard_EXPORT Standard_Boolean UnSetColor(const TopoDS_Shape& S,const XCAFDoc_ColorType type) ; //! Returns True if label has a color assignment
//! of the type
Standard_EXPORT Standard_Boolean IsSet(const TopoDS_Shape& S,const XCAFDoc_ColorType type) ; //! Returns label with color assigned to as
//! Returns False if no such color is assigned
Standard_EXPORT Standard_Boolean GetColor(const TopoDS_Shape& S,const XCAFDoc_ColorType type,TDF_Label& colorL) ; //! Returns color assigned to as
//! Returns False if no such color is assigned
Standard_EXPORT Standard_Boolean GetColor(const TopoDS_Shape& S,const XCAFDoc_ColorType type,Quantity_Color& color) ; //! Return TRUE if object on this label is visible, FALSE if invisible.
Standard_EXPORT Standard_Boolean IsVisible(const TDF_Label& L) const; //! Set the visibility of object on label. Do nothing if there no any object.
//! Set UAttribute with corresponding GUID.
Standard_EXPORT void SetVisibility(const TDF_Label& shapeLabel,const Standard_Boolean isvisible = Standard_True) ; //! Sets the color of component that styled with SHUO structure
//! Returns FALSE if no sush component found
//! NOTE: create SHUO structeure if it is necessary and if
Standard_EXPORT Standard_Boolean SetInstanceColor(const TopoDS_Shape& theShape,const XCAFDoc_ColorType type,const Quantity_Color& color,const Standard_Boolean isCreateSHUO = Standard_True) ; //! Gets the color of component that styled with SHUO structure
//! Returns FALSE if no sush component or color type
Standard_EXPORT Standard_Boolean GetInstanceColor(const TopoDS_Shape& theShape,const XCAFDoc_ColorType type,Quantity_Color& color) ; //! Gets the visibility status of component that styled with SHUO structure
//! Returns FALSE if no sush component
Standard_EXPORT Standard_Boolean IsInstanceVisible(const TopoDS_Shape& theShape) ; //! Reverses order in chains of TreeNodes (from Last to First) under
//! each Color Label since we became to use function ::Prepend()
//! instead of ::Append() in method SetColor() for acceleration
Standard_EXPORT Standard_Boolean ReverseChainsOfTreeNodes() ; Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; Standard_EXPORT void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const; DEFINE_STANDARD_RTTI(XCAFDoc_ColorTool) protected: private: Handle_XCAFDoc_ShapeTool myShapeTool; }; // other Inline functions and methods (like "C++: function call" methods) #endif