RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
ramses::Node Class Reference

The Node is the base class of all nodes and provides scene graph functionality which propagates to its children. More...

#include <Node.h>

Inheritance diagram for ramses::Node:
[legend]
Collaboration diagram for ramses::Node:
[legend]

Public Member Functions

bool hasChild () const
 Returns if node has at least one child Node. More...
 
uint32_t getChildCount () const
 Gets the number of child Nodes of this node. More...
 
NodegetChild (uint32_t index)
 Gets child node at provided index. More...
 
const NodegetChild (uint32_t index) const
 Gets child node at provided index. More...
 
status_t addChild (Node &node)
 Adds child Node to this node. More...
 
status_t removeChild (Node &node)
 Removes a child Node from this node. More...
 
status_t removeAllChildren ()
 Removes all child Nodes from this node. More...
 
bool hasParent () const
 Returns if Node has a parent Node. More...
 
NodegetParent ()
 Gets parent Node of this Node. More...
 
const NodegetParent () const
 Gets parent Node of this Node. More...
 
status_t setParent (Node &node)
 Sets parent Node for this node. More...
 
status_t removeParent ()
 Removes the parent Node from this Node. More...
 
status_t getModelMatrix (float(&modelMatrix)[16]) const
 Gets model (world in scene space) matrix computed from the scene graph. Performance note: this call will cause computation of a transformation chain, however the result is cached therefore subsequent calls will have little to none performance overhead as long as topology or transformation in the chain does not change. More...
 
status_t getInverseModelMatrix (float(&inverseModelMatrix)[16]) const
 Gets inverse model (world in scene space) matrix computed from the scene graph. Performance note: this call will cause computation of a transformation chain, however the result is cached therefore subsequent calls will have little to none performance overhead as long as topology or transformation in the chain does not change. More...
 
status_t rotate (float x, float y, float z)
 Rotates in all three directions with the given values without affecting the currently set rotation convention. More...
 
status_t setRotation (float x, float y, float z)
 Sets the absolute rotation in all three directions for left-handed rotation using Euler ZYX rotation convention. If this function is used to set, then only ramses::Node::getRotation(float&,float&,float&)const can be used to get node rotation, which implicitly uses left-handed Euler ZYX rotation convention. More...
 
status_t setRotation (float x, float y, float z, ERotationConvention rotationConvention)
 Sets the absolute rotation in all three directions for right-handed rotation using the chosen Euler angles rotation convention. If this function is used to set, then only ramses::Node::getRotation(float&,float&,float&,ERotationConvention&)const can be used to get node rotation. More...
 
status_t getRotation (float &x, float &y, float &z) const
 Retrieves the absolute rotation for left-handed rotation using Euler ZYX rotation convention. More...
 
status_t getRotation (float &x, float &y, float &z, ERotationConvention &rotationConvention) const
 Retrieves the absolute rotation for right-handed rotation in all three directions and the used Euler angles rotation convention. This function can be used only if ramses::Node::setRotation(float,float,float,ERotationConvention) is used to set node rotation. More...
 
status_t translate (float x, float y, float z)
 Translates in all three directions with the given values. More...
 
status_t setTranslation (float x, float y, float z)
 Sets the absolute translation the absolute values. More...
 
status_t getTranslation (float &x, float &y, float &z) const
 Retrieves the current absolute translation. More...
 
status_t scale (float x, float y, float z)
 Scales in all three directions with the given values. More...
 
status_t setScaling (float x, float y, float z)
 Sets the absolute scale in all three dimensions. More...
 
status_t getScaling (float &x, float &y, float &z) const
 Retrieves the current absolute scale in all three dimensions. More...
 
status_t setVisibility (EVisibilityMode mode)
 Sets the visibility of the Node. Visibility of a node determines if a renderable is rendered or not and if its resources are loaded. See EVisibilityMode for more details. Those attributes are propagated down to the node's children recursively. A node can only be rendered, if none of its parents are Invisible or Off, the node's resources are only loaded if none of its parents are Off. More...
 
EVisibilityMode getVisibility () const
 Gets the visibility property of the Node. This is just the visibility state of this node object, NOT the hierarchically accumulated visibility of its parents. More...
 
- Public Member Functions inherited from ramses::SceneObject
sceneObjectId_t getSceneObjectId () const
 Returns scene object id which is automatically assigned at creation time of object and is unique within scope of one scene. More...
 
sceneId_t getSceneId () const
 Returns sceneid to which this object belongs to. More...
 
- Public Member Functions inherited from ramses::RamsesObject
const char * getName () const
 Returns the name of the object. More...
 
status_t setName (const char *name)
 Changes the name of the object. More...
 
ERamsesObjectType getType () const
 Gets type of the object. More...
 
bool isOfType (ERamsesObjectType type) const
 Checks if the object is of given type. More...
 
- Public Member Functions inherited from ramses::StatusObject
status_t validate () const
 Generates verbose validation of the object. More...
 
const char * getValidationReport (EValidationSeverity minSeverity=EValidationSeverity_Info) const
 Provides verbose report in human readable form generated by validate. More...
 
const char * getStatusMessage (status_t status) const
 Get the string description for a status provided by a RAMSES API function. More...
 
 StatusObject (const StatusObject &other)=delete
 Deleted copy constructor. More...
 
StatusObjectoperator= (const StatusObject &other)=delete
 Deleted copy assignment. More...
 

Public Attributes

class NodeImpl & impl
 
- Public Attributes inherited from ramses::SceneObject
class SceneObjectImpl & impl
 
- Public Attributes inherited from ramses::ClientObject
class ClientObjectImpl & impl
 
- Public Attributes inherited from ramses::RamsesObject
class RamsesObjectImpl & impl
 
- Public Attributes inherited from ramses::StatusObject
class StatusObjectImpl & impl
 

Protected Member Functions

 Node (NodeImpl &pimpl)
 Constructor for Node. More...
 
virtual ~Node ()
 Destructor of the Node. More...
 
- Protected Member Functions inherited from ramses::SceneObject
 SceneObject (SceneObjectImpl &pimpl)
 Constructor for SceneObject. More...
 
virtual ~SceneObject ()
 Destructor of the SceneObject. More...
 
- Protected Member Functions inherited from ramses::ClientObject
 ClientObject (ClientObjectImpl &pimpl)
 Constructor for ClientObject. More...
 
virtual ~ClientObject ()
 Destructor of the ClientObject. More...
 
- Protected Member Functions inherited from ramses::RamsesObject
 RamsesObject (RamsesObjectImpl &pimpl)
 Constructor for RamsesObject. More...
 
virtual ~RamsesObject ()
 Destructor of the RamsesObject. More...
 
- Protected Member Functions inherited from ramses::StatusObject
 StatusObject (StatusObjectImpl &pimpl)
 Constructor for StatusObject. More...
 
virtual ~StatusObject ()
 Destructor of the StatusObject. More...
 

Friends

class SceneImpl
 Scene is the factory for creating Node instances. More...
 

Detailed Description

The Node is the base class of all nodes and provides scene graph functionality which propagates to its children.

Examples
ramses-example-basic-file-loading/src/main.cpp, ramses-example-basic-renderpasses/src/main.cpp, ramses-example-basic-rendertarget/src/main.cpp, ramses-example-basic-scenegraph/src/main.cpp, ramses-example-local-datalink/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, and ramses-example-renderonce/src/main.cpp.

Constructor & Destructor Documentation

◆ Node()

ramses::Node::Node ( NodeImpl &  pimpl)
explicitprotected

Constructor for Node.

Parameters
[in]pimplInternal data for implementation specifics of Node (sink - instance becomes owner)

◆ ~Node()

virtual ramses::Node::~Node ( )
protectedvirtual

Destructor of the Node.

Member Function Documentation

◆ addChild()

status_t ramses::Node::addChild ( Node node)

Adds child Node to this node.

Parameters
[in]nodeNode to be set as child for this Node.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-file-loading/src/main.cpp.

◆ getChild() [1/2]

Node* ramses::Node::getChild ( uint32_t  index)

Gets child node at provided index.

Parameters
[in]indexIndex of the child Node to be returned. Index range is [0..getChildCount()-1].
Returns
Pointer to Node, if child at index exists.
nullptr if child at index does not exist.

◆ getChild() [2/2]

const Node* ramses::Node::getChild ( uint32_t  index) const

Gets child node at provided index.

Parameters
[in]indexIndex of the child Node to be returned. Index range is [0..getChildCount()-1].
Returns
Pointer to Node, if child at index exists.
nullptr if child at index does not exist.

◆ getChildCount()

uint32_t ramses::Node::getChildCount ( ) const

Gets the number of child Nodes of this node.

Returns
Number of child Nodes of this Node.

◆ getInverseModelMatrix()

status_t ramses::Node::getInverseModelMatrix ( float(&)  inverseModelMatrix[16]) const

Gets inverse model (world in scene space) matrix computed from the scene graph. Performance note: this call will cause computation of a transformation chain, however the result is cached therefore subsequent calls will have little to none performance overhead as long as topology or transformation in the chain does not change.

Parameters
[out]inverseModelMatrixWill be filled with the inverse model matrix 4x4 column-major
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getModelMatrix()

status_t ramses::Node::getModelMatrix ( float(&)  modelMatrix[16]) const

Gets model (world in scene space) matrix computed from the scene graph. Performance note: this call will cause computation of a transformation chain, however the result is cached therefore subsequent calls will have little to none performance overhead as long as topology or transformation in the chain does not change.

Parameters
[out]modelMatrixWill be filled with the model matrix 4x4 column-major
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getParent() [1/2]

Node* ramses::Node::getParent ( )

Gets parent Node of this Node.

Returns
Pointer to parent Node, if parent exists, nullptr otherwise.

◆ getParent() [2/2]

const Node* ramses::Node::getParent ( ) const

Gets parent Node of this Node.

Returns
Pointer to parent Node, if parent exists, nullptr otherwise.

◆ getRotation() [1/2]

status_t ramses::Node::getRotation ( float &  x,
float &  y,
float &  z 
) const

Retrieves the absolute rotation for left-handed rotation using Euler ZYX rotation convention.

This function can be used only if ramses::Node::setRotation(float,float,float) is used to set node rotation, which implicitly uses left-handed Euler ZYX rotation convention, otherwise it will fail.

Default value is 0 for all components.

Deprecated:
This function is deprecated and will be removed in one of the next major releases. It is encouraged if possible to already migrate to using ramses::Node::setRotation(float,float,float,ERotationConvention) and ramses::Node::getRotation(float&,float&,float&,ERotationConvention&)const. If this function is used it is strongly advised to use it for node rotation in the whole scene, i.e., to completely avoid using set/get rotation with custom convention.
Parameters
[out]xCurrent value in degrees on x-axis.
[out]yCurrent value in degrees on y-axis.
[out]zCurrent value in degrees on z-axis.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getRotation() [2/2]

status_t ramses::Node::getRotation ( float &  x,
float &  y,
float &  z,
ERotationConvention rotationConvention 
) const

Retrieves the absolute rotation for right-handed rotation in all three directions and the used Euler angles rotation convention. This function can be used only if ramses::Node::setRotation(float,float,float,ERotationConvention) is used to set node rotation.

Default value is 0 for all components and ERotationConvention::XYZ.

It is possible to use different rotation conventions on different nodes within the same scene. However, it is strongly advised not to mix this function with set/get rotation with legacy convention within same scene.

Parameters
[out]xCurrent value in degrees for rotation around x-axis in case of Tait-Bryan conventions, in case of Proper Euler conventions gets the rotation angle for the first angle in the convention name.
[out]yCurrent value in degrees for rotation around y-axis in case of Tait-Bryan conventions, in case of Proper Euler conventions gets the rotation angle for the second angle in the convention name.
[out]zCurrent value in degrees for rotation around z-axis in case of Tait-Bryan conventions, in case of Proper Euler conventions gets the rotation angle for the third angle in the convention name.
[out]rotationConventionThe rotation convention to use for calculation of rotation matrix.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getScaling()

status_t ramses::Node::getScaling ( float &  x,
float &  y,
float &  z 
) const

Retrieves the current absolute scale in all three dimensions.

Parameters
[out]xThe current scaling in x-dimension.
[out]yThe current scaling in y-dimension.
[out]zThe current scaling in z-dimension.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getTranslation()

status_t ramses::Node::getTranslation ( float &  x,
float &  y,
float &  z 
) const

Retrieves the current absolute translation.

Parameters
[out]xCurrent translation on x-axis.
[out]yCurrent translation on y-axis.
[out]zCurrent translation on z-axis.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-animation-realtime/src/main.cpp.

◆ getVisibility()

EVisibilityMode ramses::Node::getVisibility ( ) const

Gets the visibility property of the Node. This is just the visibility state of this node object, NOT the hierarchically accumulated visibility of its parents.

Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ hasChild()

bool ramses::Node::hasChild ( ) const

Returns if node has at least one child Node.

Returns
true if this Node has at least one child Node, false otherwise.

◆ hasParent()

bool ramses::Node::hasParent ( ) const

Returns if Node has a parent Node.

Returns
true if Node has a parent Node, false otherwise.

◆ removeAllChildren()

status_t ramses::Node::removeAllChildren ( )

Removes all child Nodes from this node.

Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ removeChild()

status_t ramses::Node::removeChild ( Node node)

Removes a child Node from this node.

Parameters
[in]nodeNode to be removed as child from this Node.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ removeParent()

status_t ramses::Node::removeParent ( )

Removes the parent Node from this Node.

Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ rotate()

status_t ramses::Node::rotate ( float  x,
float  y,
float  z 
)

Rotates in all three directions with the given values without affecting the currently set rotation convention.

This function can be used only if ramses::Node::setRotation(float,float,float) is used to set node rotation, which implicitly uses left-handed Euler ZYX rotation convention, otherwise it will fail.

Deprecated:
This function is deprecated and will be removed in one of the next major releases. It is encouraged if possible to already migrate to using ramses::Node::setRotation(float,float,float,ERotationConvention) and ramses::Node::getRotation(float&,float&,float&,ERotationConvention&)const.
Parameters
[in]xValue in degrees which is added to the current rotation around x-axis
[in]yValue in degrees which is added to the current rotation around y-axis
[in]zValue in degrees which is added to the current rotation around z-axis
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-local-pick-handling/src/main.cpp.

◆ scale()

status_t ramses::Node::scale ( float  x,
float  y,
float  z 
)

Scales in all three directions with the given values.

Parameters
[in]xThe relative scaling factor which in x-dimension.
[in]yThe relative scaling factor which in y-dimension.
[in]zThe relative scaling factor which in z-dimension.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-local-pick-handling/src/main.cpp.

◆ setParent()

status_t ramses::Node::setParent ( Node node)

◆ setRotation() [1/2]

status_t ramses::Node::setRotation ( float  x,
float  y,
float  z 
)

Sets the absolute rotation in all three directions for left-handed rotation using Euler ZYX rotation convention. If this function is used to set, then only ramses::Node::getRotation(float&,float&,float&)const can be used to get node rotation, which implicitly uses left-handed Euler ZYX rotation convention.

Deprecated:
This function is deprecated and will be removed in one of the next major releases. It is encouraged if possible to already migrate to using ramses::Node::setRotation(float,float,float,ERotationConvention) and ramses::Node::getRotation(float&,float&,float&,ERotationConvention&)const. If this function is used it is strongly advised to use it for node rotation in the whole scene, i.e., to completely avoid using set/get rotation with custom convention within same scene.
Parameters
[in]xThe value in degrees for the rotation around x-axis.
[in]yThe value in degrees for the rotation around y-axis.
[in]zThe value in degrees for the rotation around z-axis.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-local-offscreenbuffer/src/main.cpp, and ramses-example-local-pick-handling/src/main.cpp.

◆ setRotation() [2/2]

status_t ramses::Node::setRotation ( float  x,
float  y,
float  z,
ERotationConvention  rotationConvention 
)

Sets the absolute rotation in all three directions for right-handed rotation using the chosen Euler angles rotation convention. If this function is used to set, then only ramses::Node::getRotation(float&,float&,float&,ERotationConvention&)const can be used to get node rotation.

It is possible to use different rotation conventions on different nodes within the same scene. However, it is strongly advised not to mix this function with set/get rotation with legacy convention within same scene.

Parameters
[in]xThe value in degrees for the rotation around x-axis in case of Tait-Bryan conventions, for Proper Euler conventions specifies the rotation angle for the first angle in the convention name.
[in]yThe value in degrees for the rotation around y-axis in case of Tait-Bryan conventions, for Proper Euler conventions specifies the rotation angle for the second angle in the convention name.
[in]zThe value in degrees for the rotation around z-axis in case of Tait-Bryan conventions, for Proper Euler conventions specifies the rotation angle for the third angle in the convention name.
[in]rotationConventionThe rotation convention to use for calculation of rotation matrix.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ setScaling()

status_t ramses::Node::setScaling ( float  x,
float  y,
float  z 
)

Sets the absolute scale in all three dimensions.

Parameters
[in]xThe scaling factor in x-dimension.
[in]yThe scaling factor in y-dimension.
[in]zThe scaling factor in z-dimension.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-file-loading/src/main.cpp, ramses-example-local-pick-handling/src/main.cpp, ramses-example-local-scene-referencing/src/main.cpp, and ramses-example-local-viewport-link/src/main.cpp.

◆ setTranslation()

status_t ramses::Node::setTranslation ( float  x,
float  y,
float  z 
)

◆ setVisibility()

status_t ramses::Node::setVisibility ( EVisibilityMode  mode)

Sets the visibility of the Node. Visibility of a node determines if a renderable is rendered or not and if its resources are loaded. See EVisibilityMode for more details. Those attributes are propagated down to the node's children recursively. A node can only be rendered, if none of its parents are Invisible or Off, the node's resources are only loaded if none of its parents are Off.

Parameters
[in]modeVisibility mode for this node (default is Visible)
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ translate()

status_t ramses::Node::translate ( float  x,
float  y,
float  z 
)

Translates in all three directions with the given values.

Parameters
[in]xFloat with relative translation from origin on x-axis.
[in]yFloat with relative translation from origin on y-axis.
[in]zFloat with relative translation from origin on z-axis.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-local-pick-handling/src/main.cpp.

Friends And Related Function Documentation

◆ SceneImpl

friend class SceneImpl
friend

Scene is the factory for creating Node instances.

Member Data Documentation

◆ impl

class NodeImpl& ramses::Node::impl

Stores internal data for implementation specifics of Node.


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