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

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

Public Member Functions

 U4DEntityNode ()
 Constructor for the class.
 
 U4DEntityNode (std::string uNodeName)
 
 ~U4DEntityNode ()
 Destructor for the class.
 
void addChild (T *uChild)
 Method which adds a child node to a scenegraph. More...
 
void addChild (T *uChild, T *uNext)
 
void removeChild (T *uChild)
 Method which removes a child node from the scenegraph. More...
 
void changeLastDescendant (T *uNewLastDescendant)
 Method which changes the node's last descendant in the scenegraph. More...
 
T * getFirstChild ()
 Method which returns the node's first child in the scenegraph. More...
 
T * getLastChild ()
 Method which returns the node's last child in the scenegraph. More...
 
T * getNextSibling ()
 Method which returns the node's next sibling in the scenegraph. More...
 
T * getPrevSibling ()
 Method which returns the node's previous sibling in the scenegraph. More...
 
T * prevInPreOrderTraversal ()
 Method which returns the node's previous sibling in pre-order traversal order. More...
 
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...
 
T * getParent ()
 Gets the parent to the entity. More...
 
void addChild (T *uChild, int uZDepth)
 Method which adds a child entity to a scenegraph at a particular location. More...
 
T * getRootParent ()
 Gets the root parent (top parent in the scenegraph) of the entity. More...
 
T * searchChild (std::string uName)
 

Public Attributes

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

Detailed Description

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

The U4DEntityNode class represents a node in a Generic tree.

Member Function Documentation

◆ addChild() [1/2]

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

Method which adds a child node to a scenegraph.

Parameters
uChildChild node to add to scenegraph

◆ addChild() [2/2]

template<typename T>
void U4DEngine::U4DEntityNode< T >::addChild ( T *  uChild,
int  uZDepth 
)

Method which adds a child entity to a scenegraph at a particular location.

Parameters
uChildChild entity to add to scenegraph
uZDepthlocation to insert child

◆ changeLastDescendant()

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

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

Parameters
uNewLastDescendantLast descendant of the node

◆ getFirstChild()

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

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

Returns
Returns the node's first child

◆ getLastChild()

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

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

Returns
Returns the node's last child

◆ getNextSibling()

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

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

Returns
Returns the node's next sibling

◆ getParent()

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

Gets the parent to the entity.

Returns
pointer to the entity parent

◆ getPrevSibling()

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

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

Returns
Returns the node's previous sibling

◆ getRootParent()

template<typename T >
T * U4DEngine::U4DEntityNode< 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::U4DEntityNode< 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::U4DEntityNode< 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 >
T * U4DEngine::U4DEntityNode< 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 >
T * U4DEngine::U4DEntityNode< 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::U4DEntityNode< T >::removeChild ( T *  uChild)

Method which removes a child node from the scenegraph.

Parameters
uChildChild node to remove from the scenegraph