Hide menu
Loading...
Searching...
No Matches
cadex::ModelData_DrawingLayer Class Reference

Provides logical grouping of ModelData_DrawingElement objects. More...

#include <cadex/ModelData_DrawingLayer.hxx>

Inheritance diagram for cadex::ModelData_DrawingLayer:
cadex::ModelData_BaseObject

Public Types

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

Public Member Functions

 ModelData_DrawingLayer ()
 Constructor.
 
 ModelData_DrawingLayer (initialized)
 Constructor.
 
 ModelData_DrawingLayer (ImplType *theImpl)
 Constructor (reserved for internal use).
 
 ModelData_DrawingLayer (const Base_UTF16String &theName)
 Constructor.
 
bool IsVisible () const
 Returns true if the drawing layer is visible.
 
void SetIsVisible (bool theIsVisible)
 Sets DrawingLayer visibility status.
 
void SetAppearance (const ModelData_Appearance &theAppearance)
 Sets appearance of the drawing layer.
 
ModelData_Appearance Appearance () const
 Returns the drawing layer's own appearance.
 
void Add (const ModelData_DrawingElement &theElement)
 Adds element to the drawing layer.
 
bool Remove (const ModelData_DrawingElement &theElement)
 Removes element from the drawing layer.
 
bool Contains (const ModelData_DrawingElement &theElement) const
 Returns true if element has already been added to the drawing layer.
 
void Accept (ModelData_DrawingElementVisitor &theVisitor) const
 Accepts the element visitor.
 
- Public Member Functions inherited from cadex::ModelData_BaseObject
 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

- 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 logical grouping of ModelData_DrawingElement objects.

Layers are commonly used to group objects in the drawing by function (e.g. walls, furniture, etc.), but in principle they can represent any type of virtual grouping. All objects in a layer share appearance, can be shown and hidden together. A drawing element can only belong to one layer.

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

Constructor & Destructor Documentation

◆ ModelData_DrawingLayer() [1/3]

cadex::ModelData_DrawingLayer::ModelData_DrawingLayer ( )

Constructor.

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

◆ ModelData_DrawingLayer() [2/3]

cadex::ModelData_DrawingLayer::ModelData_DrawingLayer ( initialized  )
explicit

Constructor.

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

◆ ModelData_DrawingLayer() [3/3]

cadex::ModelData_DrawingLayer::ModelData_DrawingLayer ( const Base_UTF16String theName)
explicit

Constructor.

Creates a named object, if theName is not empty.

Member Function Documentation

◆ Accept()

void cadex::ModelData_DrawingLayer::Accept ( ModelData_DrawingElementVisitor theVisitor) const

Accepts the element visitor.

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

◆ Add()

void cadex::ModelData_DrawingLayer::Add ( const ModelData_DrawingElement theElement)

Adds element to the drawing layer.

See also
Remove(), Contain().

◆ Appearance()

ModelData_Appearance cadex::ModelData_DrawingLayer::Appearance ( ) const

Returns the drawing layer's own appearance.

The appearance for drawing element defines how this object should be visualized and contain the following components:

  • generic color - defines an RGBA color.
  • line styles - define line properties.
See also
Visual Appearances

◆ IsVisible()

bool cadex::ModelData_DrawingLayer::IsVisible ( ) const

Returns true if the drawing layer is visible.

Returns false if the drawing layer IsNull().

◆ Remove()

bool cadex::ModelData_DrawingLayer::Remove ( const ModelData_DrawingElement theElement)

Removes element from the drawing layer.

Returns true if the element has been in the list and false otherwise.