Hide menu
No Matches

Provides a layer of objects. More...

#include <cadex/ModelData_Layer.hxx>

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 ()
 ModelData_Layer (initialized)
 ModelData_Layer (ImplType *theImpl)
 Constructor (reserved for internal use).
 ModelData_Layer (const Base_UTF16String &theName)
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.
- Public Member Functions inherited from cadex::ModelData_BaseObject
 ModelData_BaseObject ()
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

- 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.

exploring/layers/Program.cs, and exploring/layers/main.cxx.

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.

exploring/layers/Program.cs, and exploring/layers/main.cxx.

◆ Add()

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

Adds element to the layer.

See also
Remove(), Find().
exploring/layers/Program.cs, and exploring/layers/main.cxx.

◆ 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.