Provides a layer of objects. More...
#include <cadex/ModelData_Layer.hxx>
Classes | |
class | ItemVisitor |
Defines a visitor of the layer elements. More... | |
Public Types | |
typedef cadex::internal::ModelData_LayerImpl | ImplType |
![]() | |
typedef int | IdType |
Defines a type identifier. | |
Public Member Functions | |
ModelData_Layer () | |
Constructor. | |
ModelData_Layer (initialized) | |
Constructor. | |
ModelData_Layer (ImplType *theImpl) | |
Constructor (reserved for internal use). | |
ModelData_Layer (const Base_UTF16String &theName) | |
Constructor. | |
bool | IsVisible () const |
Returns true if the layer is visible. | |
bool & | IsVisible () |
Sets layer visibility status. | |
void | Add (const ModelData_SceneGraphElement &theElement) |
Adds element to the layer. | |
bool | Remove (const ModelData_SceneGraphElement &theElement) |
Removes element from the layer. | |
bool | Find (const ModelData_SceneGraphElement &theElement) const |
Returns true if element has already been added to the layer. | |
void | Accept (ItemVisitor &theVisitor) const |
Accepts the element visitor. | |
![]() | |
ModelData_BaseObject () | |
Constructor. | |
IdType | TypeId () const |
Returns an object type id. | |
template<typename T > | |
bool | IsOfType () const |
Returns true if the object has a type T. | |
void | SetName (const Base_UTF16String &theName) |
Sets an object name. | |
Base_UTF16String | Name () const |
void | SetUuid (const Base_Uuid &theUuid) |
Base_Uuid | Uuid () const |
void | Nullify () |
Resets reference to implementation object. | |
bool | IsNull () const |
Returns true if the object is nullified. | |
operator bool () const | |
Casts the object to the bool type. | |
internal::ModelData_BaseObjectImpl * | Impl () const |
Return a handle to backend (reserved for internal use). | |
Static Public Member Functions | |
static IdType | GetTypeId () |
Additional Inherited Members | |
![]() | |
ModelData_BaseObject (const internal::ModelData_BaseObjectImpl *theImpl) | |
Constructor (reserved for internal use). | |
ModelData_BaseObject (const internal::ModelData_BaseObjectImpl *theImpl, const Base_UTF16String &theName) | |
Constructor (reserved for internal use). | |
template<typename T > | |
T * | GetOrCreateImpl () |
Reserved for internal use. | |
Provides a layer of objects.
Layer is a logical group of elements.
Scene Graph elements can be added and removed using Add() and Remove() methods respectively.
Shapes can be added and removed using ModelData_BRepRepresentation::AddToLayer() and ModelData_BRepRepresentation::RemoveFromLayer() methods respectively.
ItemVisitor should be used to access items inside layer.
The layer holds an IsVisible() attribute, which is true by default.
cadex::ModelData_Layer::ModelData_Layer | ( | ) |
Constructor.
Creates not initialized object, for which IsNull() returns true.
cadex::ModelData_Layer::ModelData_Layer | ( | initialized | ) |
Constructor.
Creates initialized object, for which IsNull() returns false.
cadex::ModelData_Layer::ModelData_Layer | ( | const Base_UTF16String & | theName | ) |
Constructor.
Creates a named object, if theName is not empty.
void cadex::ModelData_Layer::Accept | ( | ItemVisitor & | theVisitor | ) | const |
Accepts the element visitor.
Calls overloaded operator() of theVisitor for each element in layer.
void cadex::ModelData_Layer::Add | ( | const ModelData_SceneGraphElement & | theElement | ) |
Adds element to the layer.
bool cadex::ModelData_Layer::IsVisible | ( | ) | const |
Returns true if the layer is visible.
Returns false if the layer IsNull().
bool cadex::ModelData_Layer::Remove | ( | const ModelData_SceneGraphElement & | theElement | ) |
Removes element from the layer.
Returns true if the element has been in the list and false otherwise.