# DataExchange
TKXCAF
XCAFDoc

# 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>`

## Public Member Functions

Standard_EXPORT | XCAFDoc_LayerTool ()
Standard_EXPORT TDF_Label | BaseLabel () const
| returns the label under which Layers are stored
Standard_EXPORT const Handle_XCAFDoc_ShapeTool & | ShapeTool ()
| Returns internal XCAFDoc_ShapeTool tool .
Standard_EXPORT Standard_Boolean | IsLayer (const TDF_Label &lab) const
| Returns True if label belongs to a Layertable and is a Layer definition .
Standard_EXPORT 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_EXPORT 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 .
Standard_EXPORT 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) .
Standard_EXPORT 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) .
Standard_EXPORT void | RemoveLayer (const TDF_Label &lab) const
| Removes Layer from the Layertable .
Standard_EXPORT void | GetLayerLabels (TDF_LabelSequence &Labels) const
| Returns a sequence of Layers currently stored in the Layertable .
Standard_EXPORT 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. .
Standard_EXPORT 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. .
Standard_EXPORT void | UnSetLayers (const TDF_Label &L) const
| Removes a link from label <l> to all layers .
Standard_EXPORT 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_EXPORT 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_EXPORT Standard_Boolean | GetLayers (const TDF_Label &L, Handle(TColStd_HSequenceOfExtendedString)&aLayerS)
| Return sequence of strings <alayers> that assosiated with label <l>. .
Standard_EXPORT Handle_TColStd_HSequenceOfExtendedString | GetLayers (const TDF_Label &L)
| Return sequence of strings that assosiated with label <l>. .
Standard_EXPORT void | GetShapesOfLayer (const TDF_Label &layerL, TDF_LabelSequence &ShLabels) const
| Return sequanese of shape labels that assigned with layers to <shlabels>. .
Standard_EXPORT Standard_Boolean | IsVisible (const TDF_Label &layerL) const
| Return TRUE if layer is visible, FALSE if invisible. .
Standard_EXPORT 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_EXPORT 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_EXPORT 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_EXPORT 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_EXPORT 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_EXPORT Standard_Boolean | IsSet (const TopoDS_Shape &Sh, const TCollection_ExtendedString &aLayer)
| Returns True if shape <sh> has a Layer assosiated with the <alayer>. .
Standard_EXPORT Standard_Boolean | GetLayers (const TopoDS_Shape &Sh, Handle(TColStd_HSequenceOfExtendedString)&aLayerS)
| Return sequence of strings <alayers> that assosiated with shape <sh>. .
Standard_EXPORT Handle_TColStd_HSequenceOfExtendedString | GetLayers (const TopoDS_Shape &Sh)
| Return sequence of strings that assosiated with shape <sh>. .
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
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Static Public Member Functions

static Standard_EXPORT Handle_XCAFDoc_LayerTool | Set (const TDF_Label &L)
| Creates (if not exist) LayerTool. .
static Standard_EXPORT const Standard_GUID & | GetID ()

## Private Attributes

Handle_XCAFDoc_ShapeTool | myShapeTool

## Constructor & Destructor Documentation

Standard_EXPORT XCAFDoc_LayerTool::XCAFDoc_LayerTool | ( |  | ) |

## Member Function Documentation

Standard_EXPORT TDF_Label XCAFDoc_LayerTool::AddLayer | ( | const TCollection_ExtendedString & | aLayer | ) | const

Standard_EXPORT TDF_Label XCAFDoc_LayerTool::BaseLabel | ( |  | ) | const

Standard_EXPORT TDF_Label XCAFDoc_LayerTool::FindLayer | ( | const TCollection_ExtendedString & | aLayer | ) | const

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::FindLayer | ( | const TCollection_ExtendedString & | aLayer,
|  | TDF_Label & | lab
| ) | const

static Standard_EXPORT const Standard_GUID& XCAFDoc_LayerTool::GetID | ( |  | ) | `[static]`

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::GetLayer | ( | const TDF_Label & | lab,
|  | TCollection_ExtendedString & | aLayer
| ) | const

Standard_EXPORT void XCAFDoc_LayerTool::GetLayerLabels | ( | TDF_LabelSequence & | Labels | ) | const

Standard_EXPORT Handle_TColStd_HSequenceOfExtendedString XCAFDoc_LayerTool::GetLayers | ( | const TopoDS_Shape & | Sh | ) |

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::GetLayers | ( | const TopoDS_Shape & | Sh,
|  | Handle(TColStd_HSequenceOfExtendedString)& | aLayerS
| ) |

Standard_EXPORT Handle_TColStd_HSequenceOfExtendedString XCAFDoc_LayerTool::GetLayers | ( | const TDF_Label & | L | ) |

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::GetLayers | ( | const TDF_Label & | L,
|  | Handle(TColStd_HSequenceOfExtendedString)& | aLayerS
| ) |

Standard_EXPORT void XCAFDoc_LayerTool::GetShapesOfLayer | ( | const TDF_Label & | layerL,
|  | TDF_LabelSequence & | ShLabels
| ) | const

Standard_EXPORT const XCAFDoc_LayerTool::Handle | ( | Standard_Type |  | ) | const

Standard_EXPORT const Standard_GUID& XCAFDoc_LayerTool::ID | ( |  | ) | const

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::IsLayer | ( | const TDF_Label & | lab | ) | const

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::IsSet | ( | const TopoDS_Shape & | Sh,
|  | const TCollection_ExtendedString & | aLayer
| ) |

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::IsSet | ( | const TDF_Label & | L,
|  | const TCollection_ExtendedString & | aLayer
| ) | const

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::IsVisible | ( | const TDF_Label & | layerL | ) | const

Standard_EXPORT Handle_TDF_Attribute XCAFDoc_LayerTool::NewEmpty | ( |  | ) | const

Standard_EXPORT void XCAFDoc_LayerTool::Paste | ( | const Handle(TDF_Attribute)& | into,
|  | const Handle(TDF_RelocationTable)& | RT
| ) | const

Standard_EXPORT void XCAFDoc_LayerTool::RemoveLayer | ( | const TDF_Label & | lab | ) | const

Standard_EXPORT void XCAFDoc_LayerTool::Restore | ( | const Handle(TDF_Attribute)& | with | ) |

static Standard_EXPORT Handle_XCAFDoc_LayerTool XCAFDoc_LayerTool::Set | ( | const TDF_Label & | L | ) | `[static]`

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::SetLayer | ( | const TopoDS_Shape & | Sh,
|  | const TCollection_ExtendedString & | aLayer,
|  | const Standard_Boolean | shapeInOneLayer = `Standard_False`
| ) |

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::SetLayer | ( | const TopoDS_Shape & | Sh,
|  | const TDF_Label & | LayerL,
|  | const Standard_Boolean | shapeInOneLayer = `Standard_False`
| ) |

Standard_EXPORT void XCAFDoc_LayerTool::SetLayer | ( | const TDF_Label & | L,
|  | const TCollection_ExtendedString & | aLayer,
|  | const Standard_Boolean | shapeInOneLayer = `Standard_False`
| ) | const

Standard_EXPORT void XCAFDoc_LayerTool::SetLayer | ( | const TDF_Label & | L,
|  | const TDF_Label & | LayerL,
|  | const Standard_Boolean | shapeInOneLayer = `Standard_False`
| ) | const

Standard_EXPORT void XCAFDoc_LayerTool::SetVisibility | ( | const TDF_Label & | layerL,
|  | const Standard_Boolean | isvisible = `Standard_True`
| ) | const

Standard_EXPORT const Handle_XCAFDoc_ShapeTool& XCAFDoc_LayerTool::ShapeTool | ( |  | ) |

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::UnSetLayers | ( | const TopoDS_Shape & | Sh | ) |

Standard_EXPORT void XCAFDoc_LayerTool::UnSetLayers | ( | const TDF_Label & | L | ) | const

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::UnSetOneLayer | ( | const TopoDS_Shape & | Sh,
|  | const TCollection_ExtendedString & | aLayer
| ) |

Standard_EXPORT Standard_Boolean XCAFDoc_LayerTool::UnSetOneLayer | ( | const TDF_Label & | L,
|  | const TCollection_ExtendedString & | aLayer
| ) | const

## Field Documentation

Handle_XCAFDoc_ShapeTool XCAFDoc_LayerTool::myShapeTool `[private]`

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

- XCAFDoc_LayerTool.hxx