![]() |
SCENE C++ API
2.0.31
|
Information container which can be used to build up a hierarchical tree structure of container elements. More...
#include <lsobject.h>
Public Member Functions | |
Eigen::Matrix4d | getTransformationToGlobal () const |
Calculates the transformation matrix which transforms local object coordinates to global coordinates. More... | |
void | select () |
Selects this object. More... | |
LSIterator< ref_ptr< LSObject > > | getChildIterator () const |
Gets an iterator which can be used for a breadth-first iteration over all objects below the object in the object hierarchy. More... | |
ref_ptr< LSObject > | getParent () const |
Returns the parent of this object. More... | |
unsigned int | getNumChildren () const |
Returns the number of children of this object. More... | |
ref_ptr< LSObject > | getChild (unsigned int n) const |
Returns the n-th child of this object. More... | |
ref_ptr< LSObject > | getChild (LSString name) const |
Returns the child of this object with a given name. More... | |
bool | rmChild (unsigned int n) |
Removes a child from this object. More... | |
bool | rmChild (LSString name) |
Removes a child from this object. More... | |
LSResult::Result | addChild (LSString name, LSString typeName, ref_ptr< LSObject > &childOut) |
Creates a new child of the given type. More... | |
LSResult::Result | generateUniqueChildName (const LSString &baseName, LSString &nameOut) const |
Generates a valid and unique name for a new child of this object based on the provided base name. More... | |
LSResult::Result | setParent (ref_ptr< LSObject > newParent) |
Changes the parent of this object. More... | |
![]() | |
LSString | getTypeName () const |
Gets the type name of this instance. More... | |
LSString | getName () const |
Gets the name of the container. More... | |
LSResult::Result | setName (LSString name) |
Sets the name of the container. More... | |
LSString | getUuid () const |
Returns the unique id of the container. More... | |
LSString | assignUuid () |
Assigns a unique id to the container if the container does not not yet have a unique id. More... | |
unsigned int | getNumAttributes () const |
Get the number of attributes in the container. More... | |
LSString | getAttributeName (unsigned int index) const |
Get the name of an attribute in the container. More... | |
unsigned int | getAttributeIndex (LSString name) const |
Get the index of an attribute in the container. More... | |
LSAttribute | getAttribute (unsigned int index) const |
Get an attribute based on its index. More... | |
LSAttribute | getAttribute (LSString name) const |
Get an attribute based on its name. More... | |
LSResult::Result | setAttribute (unsigned int index, const LSAttribute &attribute) |
Set an attribute based on its index. More... | |
LSResult::Result | setAttribute (LSString name, const LSAttribute &attribute) |
Set an attribute based on its name. More... | |
LSResult::Result | addCustomAttribute (LSString name, const LSAttribute &attribute) |
Add a new custom attribute to the container. More... | |
bool | removeCustomAttribute (LSString name) |
Remove a custom attribute from the container. More... | |
unsigned int | getNumFields () const |
Returns the number of fields in the container. More... | |
ref_ptr< LSAttributeContainer > | getField (unsigned int index) const |
Returns the field at position n in the container. More... | |
ref_ptr< LSAttributeContainer > | getField (const LSString &name) const |
Returns the field with the given name. More... | |
LSResult::Result | addField (const LSString &name, const LSString &typeName, ref_ptr< LSAttributeContainer > &fieldOut) |
Add a field to the container. More... | |
bool | rmField (const LSString &name) |
Removes the field with a given name from the container. More... | |
Additional Inherited Members | |
![]() | |
void | ref () const |
Increments the internal reference counter. More... | |
void | unref () const |
Decrements the internal reference counter. More... | |
Information container which can be used to build up a hierarchical tree structure of container elements.
Eigen::Matrix4d getTransformationToGlobal | ( | ) | const |
Calculates the transformation matrix which transforms local object coordinates to global coordinates.
void select | ( | ) |
Selects this object.
LSIterator<ref_ptr<LSObject> > getChildIterator | ( | ) | const |
Gets an iterator which can be used for a breadth-first iteration over all objects below the object in the object hierarchy.
Returns the parent of this object.
unsigned int getNumChildren | ( | ) | const |
Returns the number of children of this object.
Returns the n-th child of this object.
n | The position of a child of this object. |
Returns the child of this object with a given name.
name | The name of the object to retrieve. |
bool rmChild | ( | unsigned int | n | ) |
Removes a child from this object.
n | The position of the child to be removed. |
bool rmChild | ( | LSString | name | ) |
Removes a child from this object.
name | The name of the child to be removed. |
LSResult::Result addChild | ( | LSString | name, |
LSString | typeName, | ||
ref_ptr< LSObject > & | childOut | ||
) |
Creates a new child of the given type.
typeName | The type of the object to create, specified by its class name. | |
name | The name of the child to create (The name might be automatically changed when it conflicts with another child). | |
[out] | childOut | The child which has been added. |
LSResult::Result generateUniqueChildName | ( | const LSString & | baseName, |
LSString & | nameOut | ||
) | const |
Generates a valid and unique name for a new child of this object based on the provided base name.
This name can then be used for safely calling addChild with regard to the name of the new child.
baseName | The desired name of the new child. | |
[out] | nameOut | The generated unique name for the new child. |
LSResult::Result setParent | ( | ref_ptr< LSObject > | newParent | ) |
Changes the parent of this object.
This is equal to moving the object in the structure tree. The object must be movable. The object must support the new parent as parent. The new parent must support this object as child. The moved object will keep its global position, meaning the objects local transformation can be changed by this method. This of course only applies to objects with a 3D position.
newParent | Reference to the new parent object that should contain the object as child. |