Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions
XCAFDoc_LayerTool Class Reference

Provides tools to store and retrieve attributes (Layers)
of TopoDS_Shape in and from TDocStd_Document
A Document is intended to hold different
attributes of ONE shape and it's sub-shapes

#include <XCAFDoc_LayerTool.hxx>

Inheritance diagram for XCAFDoc_LayerTool:
Inheritance graph
[legend]

Public Member Functions

 XCAFDoc_LayerTool ()
TDF_Label BaseLabel () const
 returns the label under which Layers are stored

const Handle_XCAFDoc_ShapeTool & ShapeTool ()
 Returns internal XCAFDoc_ShapeTool tool

Standard_Boolean IsLayer (const TDF_Label &lab) const
 Returns True if label belongs to a Layertable and
is a Layer definition

Standard_Boolean GetLayer (const TDF_Label &lab, TCollection_ExtendedString &aLayer) const
 Returns Layer defined by label lab
Returns False if the label is not in Layertable
or does not define a Layer

Standard_Boolean FindLayer (const TCollection_ExtendedString &aLayer, TDF_Label &lab) const
 Finds a Layer definition in a Layertable and returns
its label if found
Returns False if Layer is not found in Layertable

TDF_Label FindLayer (const TCollection_ExtendedString &aLayer) const
 Finds a Layer definition in a Layertable and returns
its label if found (or Null label else)

TDF_Label AddLayer (const TCollection_ExtendedString &aLayer) const
 Adds a Layer definition to a Layertable and returns
its label (returns existing label if the same Layer
is already defined)

void RemoveLayer (const TDF_Label &lab) const
 Removes Layer from the Layertable

void GetLayerLabels (TDF_LabelSequence &Labels) const
 Returns a sequence of Layers currently stored
in the Layertable

void SetLayer (const TDF_Label &L, const TDF_Label &LayerL, const Standard_Boolean shapeInOneLayer=Standard_False) const
 Sets a link from label <L> to Layer
defined by <LayerL>
optional parametr <shapeInOneLayer> show could shape be
in number of layers or only in one.

void SetLayer (const TDF_Label &L, const TCollection_ExtendedString &aLayer, const Standard_Boolean shapeInOneLayer=Standard_False) const
 Sets a link from label <L> to Layer <aLayer>
in the Layertable
Adds a Layer as necessary
optional parametr <shapeInOneLayer> show could shape be
in number of layers or only in one.

void UnSetLayers (const TDF_Label &L) const
 Removes a link from label <L> to all layers

Standard_Boolean UnSetOneLayer (const TDF_Label &L, const TCollection_ExtendedString &aLayer) const
 Remove link from label <L> and Layer <aLayer>.
returns FALSE if no such layer.

Standard_Boolean IsSet (const TDF_Label &L, const TCollection_ExtendedString &aLayer) const
 Returns True if label <L> has a Layer assosiated
with the <aLayer>.

Standard_Boolean GetLayers (const TDF_Label &L, Handle< TColStd_HSequenceOfExtendedString > &aLayerS)
 Return sequence of strings <aLayerS> that assosiated with label <L>.

Handle_TColStd_HSequenceOfExtendedString GetLayers (const TDF_Label &L)
 Return sequence of strings that assosiated with label <L>.

void GetShapesOfLayer (const TDF_Label &layerL, TDF_LabelSequence &ShLabels) const
 Return sequanese of shape labels that assigned with layers to <ShLabels>.

Standard_Boolean IsVisible (const TDF_Label &layerL) const
 Return TRUE if layer is visible, FALSE if invisible.

void SetVisibility (const TDF_Label &layerL, const Standard_Boolean isvisible=Standard_True) const
 Set the visibility of layer. If layer is invisible when on it's layer
will set UAttribute with corresponding GUID.

Standard_Boolean SetLayer (const TopoDS_Shape &Sh, const TDF_Label &LayerL, const Standard_Boolean shapeInOneLayer=Standard_False)
 Sets a link from label that containig shape <Sh>
with layer that situated at label <LayerL>.
optional parametr <shapeInOneLayer> show could shape be
in number of layers or only in one.
return FALSE if no such shape <Sh> or label <LayerL>

Standard_Boolean SetLayer (const TopoDS_Shape &Sh, const TCollection_ExtendedString &aLayer, const Standard_Boolean shapeInOneLayer=Standard_False)
 Sets a link from label that containig shape <Sh>
with layer <aLayer>. Add <aLayer> to LayerTable if nessesery.
optional parametr <shapeInOneLayer> show could shape be
in number of layers or only in one.
return FALSE if no such shape <Sh>.

Standard_Boolean UnSetLayers (const TopoDS_Shape &Sh)
 Remove link between shape <Sh> and all Layers at LayerTable.
return FALSE if no such shape <Sh> in XCAF Document.

Standard_Boolean UnSetOneLayer (const TopoDS_Shape &Sh, const TCollection_ExtendedString &aLayer)
 Remove link between shape <Sh> and layer <aLayer>.
returns FALSE if no such layer <aLayer> or shape <Sh>.

Standard_Boolean IsSet (const TopoDS_Shape &Sh, const TCollection_ExtendedString &aLayer)
 Returns True if shape <Sh> has a Layer assosiated
with the <aLayer>.

Standard_Boolean GetLayers (const TopoDS_Shape &Sh, Handle< TColStd_HSequenceOfExtendedString > &aLayerS)
 Return sequence of strings <aLayerS> that assosiated with shape <Sh>.

Handle_TColStd_HSequenceOfExtendedString GetLayers (const TopoDS_Shape &Sh)
 Return sequence of strings that assosiated with shape <Sh>.

const Standard_GUIDID () const
 Returns the ID of the attribute.


void Restore (const Handle< TDF_Attribute > &with)
 Restores the backuped contents from <anAttribute>
into this one. It is used when aborting a
transaction.

Handle_TDF_Attribute NewEmpty () const
 Returns an new empty attribute from the good end
type. It is used by the copy algorithm.

void Paste (const Handle< TDF_Attribute > &into, const Handle< TDF_RelocationTable > &RT) const
 This method is different from the "Copy" one,
because it is used when copying an attribute from
a source structure into a target structure. This
method may paste the contents of <me> into
<intoAttribute>.

The given pasted attribute can be full or empty of
its contents. But don't make a NEW! Just set the
contents!

It is possible to use <aRelocationTable> to
get/set the relocation value of a source
attribute.

Static Public Member Functions

static Handle_XCAFDoc_LayerTool Set (const TDF_Label &L)
 Creates (if not exist) LayerTool.

static const Standard_GUIDGetID ()

Constructor & Destructor Documentation


Member Function Documentation

Handle_TColStd_HSequenceOfExtendedString XCAFDoc_LayerTool::GetLayers ( const TDF_Label L)
Handle_TColStd_HSequenceOfExtendedString XCAFDoc_LayerTool::GetLayers ( const TopoDS_Shape Sh)

Implements TDF_Attribute.

Handle_TDF_Attribute XCAFDoc_LayerTool::NewEmpty ( ) const [virtual]

Implements TDF_Attribute.

void XCAFDoc_LayerTool::Paste ( const Handle< TDF_Attribute > &  intoAttribute,
const Handle< TDF_RelocationTable > &  aRelocationTable 
) const [virtual]

Implements TDF_Attribute.

void XCAFDoc_LayerTool::Restore ( const Handle< TDF_Attribute > &  anAttribute) [virtual]

Implements TDF_Attribute.

static Handle_XCAFDoc_LayerTool XCAFDoc_LayerTool::Set ( const TDF_Label L) [static]
const Handle_XCAFDoc_ShapeTool& XCAFDoc_LayerTool::ShapeTool ( )

The documentation for this class was generated from the following file: