Hide menu
Loading...
Searching...
No Matches

Provides logical grouping of Element objects. More...

#include <cadex/Drawing/Layer.hxx>

Inheritance diagram for cadex::Drawing::Layer:
cadex::BaseObject

Public Member Functions

 Layer ()
 Constructor.
 
 Layer (const UTF16String &theName)
 Constructor.
 
void SetName (const UTF16String &theName)
 Sets a layer name.
 
UTF16String Name () const
 Returns a layer name.
 
void SetUuid (const cadex::Uuid &theUuid)
 
cadex::Uuid Uuid () const
 
bool IsVisible () const
 Returns true if the drawing layer is visible.
 
void SetIsVisible (bool theIsVisible)
 Sets Layer visibility status.
 
void Add (const Element &theElement)
 Adds element to the drawing layer.
 
bool Remove (const Element &theElement)
 Removes element from the drawing layer.
 
bool Contains (const Element &theElement) const
 Returns true if element has already been added to the drawing layer.
 
void Accept (ElementVisitor &theVisitor) const
 Accepts the element visitor.
 
- Public Member Functions inherited from cadex::BaseObject
size_t Id () const
 Return unique identifier of public object.
 
internal::BaseObjectImpl * Impl () const
 
bool IsNull () const
 
 operator bool () const
 
template<typename T >
bool IsOfType () const
 
template<typename T >
T * Impl () const
 Reserved for internal use.
 

Static Public Member Functions

static bool CompareType (const BaseObject &theObject)
 

Additional Inherited Members

- Public Types inherited from cadex::BaseObject
typedef std::shared_ptr< internal::BaseObjectImpl > ImplType
 
- Protected Member Functions inherited from cadex::BaseObject
 BaseObject (const ImplType &theImpl)
 

Detailed Description

Provides logical grouping of Element 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

◆ Layer() [1/2]

cadex::Drawing::Layer::Layer ( )
inline

Constructor.

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

◆ Layer() [2/2]

cadex::Drawing::Layer::Layer ( const UTF16String & theName)
explicit

Constructor.

Creates a named object, if theName is not empty.

Member Function Documentation

◆ Accept()

void cadex::Drawing::Layer::Accept ( ElementVisitor & theVisitor) const

Accepts the element visitor.

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

◆ Add()

void cadex::Drawing::Layer::Add ( const Element & theElement)

Adds element to the drawing layer.

See also
Remove(), Contain().

◆ IsVisible()

bool cadex::Drawing::Layer::IsVisible ( ) const

Returns true if the drawing layer is visible.

Returns false if the drawing layer IsNull().

◆ Remove()

bool cadex::Drawing::Layer::Remove ( const Element & theElement)

Removes element from the drawing layer.

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