Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Vis::Object3D Class Reference

Hierarchical 3D scene object that owns a list of nested sub-objects and inherits its property bag from Base::PropertyContainer. More...

#include <Object3D.hpp>

+ Inheritance diagram for CDPL::Vis::Object3D:

Public Types

typedef std::shared_ptr< Object3DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated Object3D instances. More...
 
- Public Types inherited from CDPL::Base::PropertyContainer
typedef PropertyMap::value_type PropertyEntry
 A Base::LookupKey / Base::Any pair that stores the property value for a given property key. More...
 
typedef PropertyMap::const_iterator ConstPropertyIterator
 A constant iterator used to iterate over the property entries. More...
 

Public Member Functions

 Object3D ()
 Default constructor. More...
 
 Object3D (const Object3D &obj)
 Constructs a copy of the Object3D instance obj. More...
 
virtual ~Object3D ()
 Virtual destructor. More...
 
Object3Doperator= (const Object3D &obj)
 Assignment operator. More...
 
void clear ()
 Removes all sub-objects and clears all properties of this object. More...
 
std::size_t getNumSubObjects () const
 Returns the number of sub-objects directly owned by this object. More...
 
ConstObject3DIterator getSubObjectsBegin () const
 Returns a constant iterator pointing to the beginning of the sub-objects. More...
 
Object3DIterator getSubObjectsBegin ()
 Returns a mutable iterator pointing to the beginning of the sub-objects. More...
 
ConstObject3DIterator getSubObjectsEnd () const
 Returns a constant iterator pointing to the end of the sub-objects. More...
 
Object3DIterator getSubObjectsEnd ()
 Returns a mutable iterator pointing to the end of the sub-objects. More...
 
ConstObject3DIterator begin () const
 Returns a constant iterator pointing to the beginning of the sub-objects. More...
 
Object3DIterator begin ()
 Returns a mutable iterator pointing to the beginning of the sub-objects. More...
 
ConstObject3DIterator end () const
 Returns a constant iterator pointing to the end of the sub-objects. More...
 
Object3DIterator end ()
 Returns a mutable iterator pointing to the end of the sub-objects. More...
 
const Object3DgetSubObject (std::size_t idx) const
 Returns a const reference to the sub-object at index idx. More...
 
Object3DgetSubObject (std::size_t idx)
 Returns a non-const reference to the sub-object at index idx. More...
 
Object3DaddSubObject ()
 Creates a new empty sub-object and appends it to the sub-object list. More...
 
Object3DaddSubObject (const SharedPointer &object)
 Appends the supplied object to the sub-object list. More...
 
void removeSubObject (std::size_t idx)
 Removes the sub-object at index idx. More...
 
Object3DIterator removeSubObject (const Object3DIterator &it)
 Removes the sub-object specified by the iterator it. More...
 
- Public Member Functions inherited from CDPL::Base::PropertyContainer
std::size_t getNumProperties () const
 Returns the number of property entries. More...
 
template<typename T >
void setProperty (const LookupKey &key, T &&val)
 Sets the value of the property specified by key to val. More...
 
template<typename T >
const T & getProperty (const LookupKey &key) const
 Returns the value of the property specified by key as a const reference to an object of type T. More...
 
template<typename T >
const T & getPropertyOrDefault (const LookupKey &key, const T &def_val) const
 Returns the value of the property specified by key as a const reference to an object of type T, or the default value def_val if a stored value does not exist. More...
 
const AnygetProperty (const LookupKey &key, bool throw_=false) const
 Returns the value of the property specified by key. More...
 
bool isPropertySet (const LookupKey &key) const
 Tells whether or not a value has been assigned to the property specified by key. More...
 
ConstPropertyIterator getPropertiesBegin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator getPropertiesEnd () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
ConstPropertyIterator begin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator end () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
bool removeProperty (const LookupKey &key)
 Clears the value of the property specified by key. More...
 
void clearProperties ()
 Clears all property values. More...
 
void addProperties (const PropertyContainer &cntnr)
 Adds the property value entries in the PropertyContainer instance cntnr. More...
 
void copyProperties (const PropertyContainer &cntnr)
 Replaces the current set of properties by a copy of the entries in cntnr. More...
 
void swap (PropertyContainer &cntnr)
 Exchanges the properties of this container with the properties of the container cntnr. More...
 
const PropertyContainergetProperties () const
 Returns a const reference to itself. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Base::PropertyContainer
 PropertyContainer ()
 Constructs an empty PropertyContainer instance. More...
 
 PropertyContainer (const PropertyContainer &cntnr)
 Constructs a copy of the PropertyContainer instance cntnr. More...
 
virtual ~PropertyContainer ()
 Virtual destructor. More...
 
PropertyContaineroperator= (const PropertyContainer &cntnr)
 Assignment operator. More...
 

Detailed Description

Hierarchical 3D scene object that owns a list of nested sub-objects and inherits its property bag from Base::PropertyContainer.

Concrete 3D representations (e.g. those produced by Vis::FeatureContainerObject3DFactory) are typically assembled as trees of nested Object3D instances annotated with rendering-relevant properties.

Since
1.3

Member Typedef Documentation

◆ SharedPointer

typedef std::shared_ptr<Object3D> CDPL::Vis::Object3D::SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated Object3D instances.

Constructor & Destructor Documentation

◆ Object3D() [1/2]

CDPL::Vis::Object3D::Object3D ( )

Default constructor.

◆ Object3D() [2/2]

CDPL::Vis::Object3D::Object3D ( const Object3D obj)

Constructs a copy of the Object3D instance obj.

Parameters
objThe Object3D instance to copy.

◆ ~Object3D()

virtual CDPL::Vis::Object3D::~Object3D ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ operator=()

Object3D& CDPL::Vis::Object3D::operator= ( const Object3D obj)

Assignment operator.

Parameters
objThe Object3D instance to copy.
Returns
A reference to itself.

◆ clear()

void CDPL::Vis::Object3D::clear ( )

Removes all sub-objects and clears all properties of this object.

◆ getNumSubObjects()

std::size_t CDPL::Vis::Object3D::getNumSubObjects ( ) const

Returns the number of sub-objects directly owned by this object.

Returns
The sub-object count.

◆ getSubObjectsBegin() [1/2]

ConstObject3DIterator CDPL::Vis::Object3D::getSubObjectsBegin ( ) const

Returns a constant iterator pointing to the beginning of the sub-objects.

Returns
A constant iterator pointing to the beginning of the sub-objects.

◆ getSubObjectsBegin() [2/2]

Object3DIterator CDPL::Vis::Object3D::getSubObjectsBegin ( )

Returns a mutable iterator pointing to the beginning of the sub-objects.

Returns
A mutable iterator pointing to the beginning of the sub-objects.

◆ getSubObjectsEnd() [1/2]

ConstObject3DIterator CDPL::Vis::Object3D::getSubObjectsEnd ( ) const

Returns a constant iterator pointing to the end of the sub-objects.

Returns
A constant iterator pointing to the end of the sub-objects.

◆ getSubObjectsEnd() [2/2]

Object3DIterator CDPL::Vis::Object3D::getSubObjectsEnd ( )

Returns a mutable iterator pointing to the end of the sub-objects.

Returns
A mutable iterator pointing to the end of the sub-objects.

◆ begin() [1/2]

ConstObject3DIterator CDPL::Vis::Object3D::begin ( ) const

Returns a constant iterator pointing to the beginning of the sub-objects.

Returns
A constant iterator pointing to the beginning of the sub-objects.

◆ begin() [2/2]

Object3DIterator CDPL::Vis::Object3D::begin ( )

Returns a mutable iterator pointing to the beginning of the sub-objects.

Returns
A mutable iterator pointing to the beginning of the sub-objects.

◆ end() [1/2]

ConstObject3DIterator CDPL::Vis::Object3D::end ( ) const

Returns a constant iterator pointing to the end of the sub-objects.

Returns
A constant iterator pointing to the end of the sub-objects.

◆ end() [2/2]

Object3DIterator CDPL::Vis::Object3D::end ( )

Returns a mutable iterator pointing to the end of the sub-objects.

Returns
A mutable iterator pointing to the end of the sub-objects.

◆ getSubObject() [1/2]

const Object3D& CDPL::Vis::Object3D::getSubObject ( std::size_t  idx) const

Returns a const reference to the sub-object at index idx.

Parameters
idxThe zero-based sub-object index.
Returns
A const reference to the sub-object.
Exceptions
Base::IndexErrorif the number of sub-objects is zero or idx is not in the range [0, getNumSubObjects() - 1].

◆ getSubObject() [2/2]

Object3D& CDPL::Vis::Object3D::getSubObject ( std::size_t  idx)

Returns a non-const reference to the sub-object at index idx.

Parameters
idxThe zero-based sub-object index.
Returns
A non-const reference to the sub-object.
Exceptions
Base::IndexErrorif the number of sub-objects is zero or idx is not in the range [0, getNumSubObjects() - 1].

◆ addSubObject() [1/2]

Object3D& CDPL::Vis::Object3D::addSubObject ( )

Creates a new empty sub-object and appends it to the sub-object list.

Returns
A reference to the newly created sub-object.

◆ addSubObject() [2/2]

Object3D& CDPL::Vis::Object3D::addSubObject ( const SharedPointer object)

Appends the supplied object to the sub-object list.

Parameters
objectA smart pointer to the sub-object to append.
Returns
A reference to the appended sub-object.

◆ removeSubObject() [1/2]

void CDPL::Vis::Object3D::removeSubObject ( std::size_t  idx)

Removes the sub-object at index idx.

Parameters
idxThe zero-based index of the sub-object to remove.
Exceptions
Base::IndexErrorif the number of sub-objects is zero or idx is not in the range [0, getNumSubObjects() - 1].

◆ removeSubObject() [2/2]

Object3DIterator CDPL::Vis::Object3D::removeSubObject ( const Object3DIterator &  it)

Removes the sub-object specified by the iterator it.

Parameters
itAn iterator that specifies the sub-object to remove.
Returns
A mutable iterator pointing to the next sub-object in the list.
Exceptions
Base::RangeErrorif the number of sub-objects is zero or it is not in the range [getSubObjectsBegin(), getSubObjectsEnd() - 1].

The documentation for this class was generated from the following file: