Provides logical grouping of Element objects. More...
#include <cadex/Drawing/Layer.hxx>
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. | |
![]() | |
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 | |
![]() | |
typedef std::shared_ptr< internal::BaseObjectImpl > | ImplType |
![]() | |
BaseObject (const ImplType &theImpl) | |
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.
|
inline |
Constructor.
Creates not initialized object, for which IsNull() returns true.
|
explicit |
Constructor.
Creates a named object, if theName is not empty.
void cadex::Drawing::Layer::Accept | ( | ElementVisitor & | theVisitor | ) | const |
Accepts the element visitor.
Calls overloaded operator() of theVisitor for each element in drawing layer.
void cadex::Drawing::Layer::Add | ( | const Element & | theElement | ) |
Adds element to the drawing layer.
bool cadex::Drawing::Layer::IsVisible | ( | ) | const |
Returns true if the drawing layer is visible.
Returns false if the drawing layer IsNull().
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.