Public Member Functions | Public Attributes | Private Member Functions | List of all members
SceneModel::TreeNode Class Reference

#include <TreeNode.h>

Inheritance diagram for SceneModel::TreeNode:
Inheritance graph
[legend]

Public Member Functions

void addChild (boost::shared_ptr< TreeNode > pChild)
 
boost::shared_ptr< TreeNodef ()
 
std::vector< boost::shared_ptr< TreeNode > > getChildren ()
 
unsigned int getNumberOfNodes ()
 
boost::shared_ptr< ISM::ObjectSet > getObjectSet ()
 
void printTreeToConsole (unsigned int space)
 
void setIDs ()
 
boost::shared_ptr< TreeNodesetNewRootNodeByType (std::string pType)
 
 TreeNode (boost::shared_ptr< ISM::ObjectSet > pObjectSet)
 
 TreeNode (boost::shared_ptr< TreeNode > pRoot)
 
 ~TreeNode ()
 

Public Attributes

std::vector< boost::shared_ptr< TreeNode > > mChildren
 
unsigned int mID
 
bool mIsReference = false
 
boost::shared_ptr< ISM::ObjectSet > mObjectSet
 
boost::shared_ptr< TreeNodemParent
 
boost::shared_ptr< TreeNodemReferenceTo
 

Private Member Functions

void reassignNewParentNode (boost::shared_ptr< TreeNode > pParent)
 
void updateIDs (unsigned int &pID, bool pUpdateReferencIDs)
 
std::vector< boost::shared_ptr< TreeNode > > updateReferences (boost::shared_ptr< TreeNode > pRoot)
 

Detailed Description

The data structure representing the object relation tree. The nodes represented by this class are objects with a given type and instance id. Edges from this node (represented by a list of nodes) are references to child-objects one level deeper down the tree.

Author
Joachim Gehrung
Version
See SVN

Definition at line 40 of file TreeNode.h.

Constructor & Destructor Documentation

SceneModel::TreeNode::TreeNode ( boost::shared_ptr< ISM::ObjectSet >  pObjectSet)

Constructor.

Parameters
pObjectSetAn object set containing all observations of a single object over time.

Definition at line 22 of file TreeNode.cpp.

SceneModel::TreeNode::TreeNode ( boost::shared_ptr< TreeNode pRoot)

Copy Constructor.

Parameters
pRootThe root node of the tree to copy.

Definition at line 27 of file TreeNode.cpp.

SceneModel::TreeNode::~TreeNode ( )

Destructor.

Definition at line 36 of file TreeNode.cpp.

Member Function Documentation

void SceneModel::TreeNode::addChild ( boost::shared_ptr< TreeNode pChild)

Adds a child to the node.

Parameters
childThe node to add as a child.

Definition at line 100 of file TreeNode.cpp.

boost::shared_ptr< TreeNode > SceneModel::TreeNode::f ( )

Returns a boost shared pointer from this.

Returns
A boost shared pointer from this.

Definition at line 116 of file TreeNode.cpp.

std::vector< boost::shared_ptr< TreeNode > > SceneModel::TreeNode::getChildren ( )

Returns the children of this node.

Returns
The child nodes.

Definition at line 95 of file TreeNode.cpp.

unsigned int SceneModel::TreeNode::getNumberOfNodes ( )

Returns the number of nodes in the tree.

Returns
The number of nodes in the tree.

Definition at line 106 of file TreeNode.cpp.

boost::shared_ptr< ISM::ObjectSet > SceneModel::TreeNode::getObjectSet ( )

Returns the object set associated with the node.

Returns
The object set holding the observations of the object associated with the tree.

Definition at line 90 of file TreeNode.cpp.

void SceneModel::TreeNode::printTreeToConsole ( unsigned int  space)

Prints the generated tree to console.

Parameters
nodeThe root of tree that should be printed.
spaceThe number of leading spaces.

Definition at line 121 of file TreeNode.cpp.

void SceneModel::TreeNode::reassignNewParentNode ( boost::shared_ptr< TreeNode pParent)
private

Recursively reassigns a new parent node.

Parameters
pParentthe new parent node.

Definition at line 139 of file TreeNode.cpp.

void SceneModel::TreeNode::setIDs ( )

Assigns unique IDs to all nodes so references can later be expressed through IDs only.

Definition at line 163 of file TreeNode.cpp.

boost::shared_ptr< TreeNode > SceneModel::TreeNode::setNewRootNodeByType ( std::string  pType)

Rebuilds the tree so that the node with the given type is the new root node.

Parameters
pTypeThe type of the new node.
Returns
The new root node.

Definition at line 40 of file TreeNode.cpp.

void SceneModel::TreeNode::updateIDs ( unsigned int &  pID,
bool  pUpdateReferencIDs 
)
private

Recursively updates the IDs of the nodes through DFS. Used in setIDs().

Parameters
pIDIf conditions are met, pID+1 is assigned as the node's ID.
pUpdateReferenceIDsWhether to update only the non-reference or only the reference node IDs.

Definition at line 171 of file TreeNode.cpp.

std::vector< boost::shared_ptr< TreeNode > > SceneModel::TreeNode::updateReferences ( boost::shared_ptr< TreeNode pRoot)
private

Recursively checks all references in the tree. If they point into pRoot, they are flipped to point out of it instead to avoid circles.

Parameters
pRootA root which should only have references pointing out from it.
Returns
a list of all flipped references

Definition at line 182 of file TreeNode.cpp.

Member Data Documentation

std::vector<boost::shared_ptr<TreeNode> > SceneModel::TreeNode::mChildren

A list of all child nodes.

Definition at line 134 of file TreeNode.h.

unsigned int SceneModel::TreeNode::mID

A unique ID of this node.

Definition at line 149 of file TreeNode.h.

bool SceneModel::TreeNode::mIsReference = false

Whether this node is a reference to another.

Definition at line 139 of file TreeNode.h.

boost::shared_ptr<ISM::ObjectSet> SceneModel::TreeNode::mObjectSet

An object trajectory containing all observations of a single object over time.

Definition at line 123 of file TreeNode.h.

boost::shared_ptr<TreeNode> SceneModel::TreeNode::mParent

A reference to the parent node. Required for changing the structure of the tree later.

Definition at line 129 of file TreeNode.h.

boost::shared_ptr<TreeNode> SceneModel::TreeNode::mReferenceTo

If this node is a reference, this is the node it points to.

Definition at line 144 of file TreeNode.h.


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


asr_relation_graph_generator
Author(s): Meißner Pascal
autogenerated on Fri Nov 15 2019 03:39:19