Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DNode< T > Class Template Reference

The U4DNode class represents a node in a Generic tree. More...

Inherits T.

Public Member Functions

 U4DNode ()
 Constructor for the class.
 
 U4DNode (std::string uNodeName)
 
 ~U4DNode ()
 Destructor for the class.
 
void addChild (U4DNode< T > *uChild)
 Method which adds a child node to a scenegraph. More...
 
void removeChild (U4DNode< T > *uChild)
 Method which removes a child node from the scenegraph. More...
 
void changeLastDescendant (U4DNode< T > *uNewLastDescendant)
 Method which changes the node's last descendant in the scenegraph. More...
 
U4DNode< T > * getFirstChild ()
 Method which returns the node's first child in the scenegraph. More...
 
U4DNode< T > * getLastChild ()
 Method which returns the node's last child in the scenegraph. More...
 
U4DNode< T > * getNextSibling ()
 Method which returns the node's next sibling in the scenegraph. More...
 
U4DNode< T > * getPrevSibling ()
 Method which returns the node's previous sibling in the scenegraph. More...
 
U4DNode< T > * prevInPreOrderTraversal ()
 Method which returns the node's previous sibling in pre-order traversal order. More...
 
U4DNode< T > * nextInPreOrderTraversal ()
 Method which returns the node's next pointer in pre-order traversal order. More...
 
bool isLeaf ()
 Method which returns true if the node represents a leaf node in the scenegraph. More...
 
bool isRoot ()
 Method which returns true if the node represents a root node in the scenegraph. More...
 
U4DNode< T > * getParent ()
 Gets the parent to the entity. More...
 
U4DNode< T > * getRootParent ()
 Gets the root parent (top parent in the scenegraph) of the entity. More...
 
U4DNode< T > * searchChild (std::string uName)
 

Public Attributes

U4DNode< T > * parent
 Tree parent pointer.
 
U4DNode< T > * prevSibling
 Tree previous sibling pointer.
 
U4DNode< T > * next
 Tree next pointer.
 
U4DNode< T > * lastDescendant
 Tree last descendant pointer.
 

Detailed Description

template<typename T>
class U4DEngine::U4DNode< T >

The U4DNode class represents a node in a Generic tree.

Member Function Documentation

◆ addChild()

template<typename T >
void U4DEngine::U4DNode< T >::addChild ( U4DNode< T > *  uChild)

Method which adds a child node to a scenegraph.

Parameters
uChildChild node to add to scenegraph

◆ changeLastDescendant()

template<typename T >
void U4DEngine::U4DNode< T >::changeLastDescendant ( U4DNode< T > *  uNewLastDescendant)

Method which changes the node's last descendant in the scenegraph.

Parameters
uNewLastDescendantLast descendant of the node

◆ getFirstChild()

template<typename T >
U4DNode< T > * U4DEngine::U4DNode< T >::getFirstChild ( )

Method which returns the node's first child in the scenegraph.

Returns
Returns the node's first child

◆ getLastChild()

template<typename T >
U4DNode< T > * U4DEngine::U4DNode< T >::getLastChild ( )

Method which returns the node's last child in the scenegraph.

Returns
Returns the node's last child

◆ getNextSibling()

template<typename T >
U4DNode< T > * U4DEngine::U4DNode< T >::getNextSibling ( )

Method which returns the node's next sibling in the scenegraph.

Returns
Returns the node's next sibling

◆ getParent()

template<typename T >
U4DNode< T > * U4DEngine::U4DNode< T >::getParent ( )

Gets the parent to the entity.

Returns
pointer to the entity parent

◆ getPrevSibling()

template<typename T >
U4DNode< T > * U4DEngine::U4DNode< T >::getPrevSibling ( )

Method which returns the node's previous sibling in the scenegraph.

Returns
Returns the node's previous sibling

◆ getRootParent()

template<typename T >
U4DNode< T > * U4DEngine::U4DNode< T >::getRootParent ( )

Gets the root parent (top parent in the scenegraph) of the entity.

Returns
pointer to the root parent

◆ isLeaf()

template<typename T >
bool U4DEngine::U4DNode< T >::isLeaf ( )

Method which returns true if the node represents a leaf node in the scenegraph.

Returns
Returns true if the node represents a leaf node in the scenegraph

◆ isRoot()

template<typename T >
bool U4DEngine::U4DNode< T >::isRoot ( )

Method which returns true if the node represents a root node in the scenegraph.

Returns
Returns true if the node represents a root node in the scenegraph

◆ nextInPreOrderTraversal()

template<typename T >
U4DNode< T > * U4DEngine::U4DNode< T >::nextInPreOrderTraversal ( )

Method which returns the node's next pointer in pre-order traversal order.

Returns
Returns the node's next pointer in pre-order traversal order

◆ prevInPreOrderTraversal()

template<typename T >
U4DNode< T > * U4DEngine::U4DNode< T >::prevInPreOrderTraversal ( )

Method which returns the node's previous sibling in pre-order traversal order.

Returns
Returns the node's previous sibling in pre-order traversal order

◆ removeChild()

template<typename T >
void U4DEngine::U4DNode< T >::removeChild ( U4DNode< T > *  uChild)

Method which removes a child node from the scenegraph.

Parameters
uChildChild node to remove from the scenegraph