CAD Exchanger SDK
cadex::ModelData_Layer Class Reference

Provides a layer of objects. More...

Inheritance diagram for cadex::ModelData_Layer:


class  ItemVisitor
 Defines a visitor of the layer elements. More...

Public Types

typedef cadex::internal::ModelData_LayerImpl ImplType
- Public Types inherited from cadex::ModelData_BaseObject
typedef int IdType
 Defines a type identifier.

Public Member Functions

 ModelData_Layer ()
 Constructor. More...
 ModelData_Layer (initialized)
 Constructor. More...
 ModelData_Layer (ImplType *theImpl)
 Constructor (reserved for internal use).
 ModelData_Layer (const Base_UTF16String &theName)
 Constructor. More...
bool IsVisible () const
 Returns true if the layer is visible. More...
bool & IsVisible ()
 Sets layer visibility status.
void Add (const ModelData_SceneGraphElement &theElement)
 Adds element to the layer. More...
bool Remove (const ModelData_SceneGraphElement &theElement)
 Removes element from the layer. More...
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. More...
- Public Member Functions inherited from cadex::ModelData_BaseObject
 ModelData_BaseObject ()
 Constructor. More...
IdType TypeId () const
 Returns an object type id. More...
template<typename T >
bool IsOfType () const
 Returns true if the object has a type T. More...
void SetName (const Base_UTF16String &theName)
 Sets an object name. More...
Base_UTF16String Name () const
 Returns an object name. More...
void Nullify ()
 Resets reference to implementation object. More...
bool IsNull () const
 Returns true if the object is nullified. More...
 operator bool () const
 Casts the object to the bool type. More...
internal::ModelData_BaseObjectImpl * Impl () const
 Return a handle to backend (reserved for internal use).

Static Public Member Functions

static IdType GetTypeId ()

Additional Inherited Members

- Protected Member Functions inherited from cadex::ModelData_BaseObject
 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.

Detailed Description

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.

Scene Graph elements can also be accessed using ModelData_Model::ElementVisitor.

The layer holds an IsVisible() attribute, which is true by default.


Constructor & Destructor Documentation

◆ ModelData_Layer() [1/3]

cadex::ModelData_Layer::ModelData_Layer ( )


Creates not initialized object, for which IsNull() returns true.

◆ ModelData_Layer() [2/3]

cadex::ModelData_Layer::ModelData_Layer ( initialized  )


Creates initialized object, for which IsNull() returns false.

◆ ModelData_Layer() [3/3]

cadex::ModelData_Layer::ModelData_Layer ( const Base_UTF16String theName)


Creates a named object, if theName is not empty.

Member Function Documentation

◆ Accept()

void cadex::ModelData_Layer::Accept ( ItemVisitor theVisitor) const

Accepts the element visitor.

Calls overloaded operator() of theVisitor for each element in layer.

◆ Add()

void cadex::ModelData_Layer::Add ( const ModelData_SceneGraphElement theElement)

Adds element to the layer.

See also
Remove(), Find().

◆ IsVisible()

bool cadex::ModelData_Layer::IsVisible ( ) const

Returns true if the layer is visible.

Returns false if the layer IsNull().

◆ Remove()

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.