Node Class Reference

#include <Node.h>

List of all members.

Public Member Functions

 Node (int _id)
 ~Node ()
void setParent (Node *_parent)
NodegetParent ()
void addChild (Node *_child)
void setLevelsForSubTree (int actLevel)
void setBoundariesOfSubTree (float *rootedBoundaries, float *radialBoundaries, float *balloonBoundaries)
int getLevel ()
void renderRootedSubTree (float rootX, float rootY, int maxFanOut, int hierarchyDepth)
void renderRadialSubTree (float rootX, float rootY, float rootAngle, int maxFanOut, int hierarchyDepth, unsigned int *nodesPerLevel)
float renderBalloonSubTree (float rootX, float rootY, float rootAngle, float radius, int maxFanOut, int hierarchyDepth)
int getMaximumFanOutOfSubtree ()
unsigned int getMaxNodesPerLevelOfSubtree (int hierarchyDepth)
unsigned int * getNodesPerLevelOfSubtree (int hierarchyDepth)
void getNodesPerLevel (unsigned int *nodesPerLevel)
int getChildCount ()
unsigned int getMaxDepthOfSubtree ()
unsigned int getMinDepthOfSubtree ()
void getDepths (std::vector< unsigned int > *depths, unsigned int currentDepth)
unsigned int getNodeCountOfSubtree ()
unsigned int getNodeCount (unsigned int nodeCount)
void preComputeRadialSubTree (float rootAngle, unsigned int stopIndex, Node *childFound, bool down, unsigned int *nodesPerLevel)
void computeSiblingsOfSubtree (unsigned int *nodesPerLevel)
NodegetLeftSibling (Node *node, Node *lastNode, bool up)
NodegetRightSibling (Node *node, Node *lastNode, bool up)
NodegetLeftSiblingOfNode (unsigned int *nodesPerLevel)
NodegetRightSiblingOfNode (unsigned int *nodesPerLevel)
void computeSiblingIndex (unsigned int *nextLevelIndices)
unsigned int getSiblingIndex ()
NodegetLeftSibling ()
NodegetRightSibling ()
int getID ()
float getRootedTreeX ()
float getRootedTreeY ()
float getRadialTreeX ()
float getRadialTreeY ()
float getBalloonTreeX ()
float getBalloonTreeY ()
float getRadialLeftLimitAngle ()
float getRadialRightLimitAngle ()
float getRadialLeftBisectorLimitAngle ()
float getRadialRightBisectorLimitAngle ()
float getRadialAnglePerChild ()
float getRadialAngle ()
void computeLeftRadialBisectorLimitAngle ()
void computeRightRadialBisectorLimitAngle ()
void setRadialLeftBisectorLimitAngle (float angle)
void setRadialRightBisectorLimitAngle (float angle)
void setRadialAngle (float angle)
void computeRadialBisectorLimitAngles ()
bool getIsLeftestChild ()
bool getIsRightestChild ()
void setIsLeftestChild (bool value)
void setIsRightestChild (bool value)
void setPreRootedX (float value)
void setPreRootedY (float value)
float getPreRootedX ()
float getPreRootedY ()
float getPreRootedXTmp ()
void preComputeRootedSubTree (bool up, unsigned int stopIndex)
NodefindNodeAtMaxDepth (Node *node, int *maxDepth)
float preComputeBalloonTree (float parentAngle, unsigned int childCountOfParentNode)
void setAngleOfNode (float angle)
float getBalloonRadiusOfNode ()
float getBalloonAngleOfNode ()
void setNodeVisability (bool visable)
void setLineVisability (bool visable)
void setCircleVisability (bool visable)

Private Member Functions

void drawCircle (float x, float y, float z, float radius)
void drawNode (float x, float y, float z, float radius)

Private Attributes

Nodeparent
NodeleftSibling
NoderightSibling
std::vector< Node * > * childVector
int level
int id
float rootedTreeX
float rootedTreeY
float radialTreeX
float radialTreeY
float balloonTreeX
float balloonTreeY
bool showNodes
bool showLines
bool showCircles
float balloonRadiusOfNode
float balloonAngleOfNode
unsigned int siblingIndex
float radialLeftLimitAngle
float radialRightLimitAngle
float radialLeftBisectorLimitAngle
float radialRightBisectorLimitAngle
float radialAnglePerChild
float radialAngle
bool isLeftestChild
bool isRightestChild
float preRootedX
float preRootedXTmp
float preRootedY

Static Private Attributes

static log4cxx::LoggerPtr logger


Detailed Description

Node of the Tree

Constructor & Destructor Documentation

Node::Node ( int  _id  ) 

Constructs a new Node object

Parameters:
_id the ID of the node

Node::~Node (  ) 

Destroys the object


Member Function Documentation

void Node::addChild ( Node _child  ) 

Adds a pointer to a Node object representing a child of the current node to the childVector

Parameters:
_child pointer to a Node object representing a child of the current node

void Node::computeLeftRadialBisectorLimitAngle (  ) 

Precomputes the left bisector limit angle of the childs

void Node::computeRadialBisectorLimitAngles (  ) 

Precomputes the left and right bisector limit angles of the childs

void Node::computeRightRadialBisectorLimitAngle (  ) 

Precomputes the right bisector limit angle of the childs

void Node::computeSiblingIndex ( unsigned int *  nextLevelIndices  ) 

Determines the index of the nodes in one hierarchical level

Parameters:
nextLevelIndices current indices

void Node::computeSiblingsOfSubtree ( unsigned int *  nodesPerLevel  ) 

Computes the siblings of the subtree.

Parameters:
nodesPerLevel Count of nodes per hierarchical level of the tree

void Node::drawCircle ( float  x,
float  y,
float  z,
float  radius 
) [private]

Parameters:
x x-coordinate of the midpoint
y y-coordinate of the midpoint
z z-coordinate of the midpoint
radius radius of the circle

void Node::drawNode ( float  x,
float  y,
float  z,
float  radius 
) [private]

Draws a node as a filled circle at the specified position with the specified radius

Parameters:
x x-coordinate of the node
y y-coordinate of the node
z z-coordinate of the node
radius radius of the circle that is drawn

Node * Node::findNodeAtMaxDepth ( Node node,
int *  maxDepth 
)

Returns one node, which has maximal depth

Parameters:
node Found node (NULL allowed)
maxDepth Maximal depth of the found node
Returns:
Node, which has maximal depth

float Node::getBalloonAngleOfNode (  ) 

Returns the angle of the node in the balloon tree

Returns:
Angle of the node

float Node::getBalloonRadiusOfNode (  ) 

Sets the radius of the node in the balloon tree

Returns:
Radius of the node

float Node::getBalloonTreeX (  ) 

Returns the x-coordinate of the node, when the tree is rendered as a Balloon Tree

Returns:
x-coordinate of the node, when the tree is rendered as a Balloon Tree

float Node::getBalloonTreeY (  ) 

Returns the y-coordinate of the node, when the tree is rendered as a Balloon Tree

Returns:
y-coordinate of the node, when the tree is rendered as a Balloon Tree

int Node::getChildCount (  ) 

Returns the number of children of the node

Returns:
the number of children of the node

void Node::getDepths ( std::vector< unsigned int > *  depths,
unsigned int  currentDepth 
)

Returns all depths of the subtree

Parameters:
depths Computed depths
currentDepth Current depth

int Node::getID (  ) 

Returns the ID of the node

Returns:
the ID of the node

bool Node::getIsLeftestChild (  ) 

Determines if the child is the leftest one

Returns:
True if the child is the leftest one, false otherwise

bool Node::getIsRightestChild (  ) 

Determines if the child is the rightest one

Returns:
True if the child is the rightest one, false otherwise

Node * Node::getLeftSibling (  ) 

Returns the left sibling of that node

Returns:
The left sibling of that node

Node * Node::getLeftSibling ( Node node,
Node lastNode,
bool  up 
)

Call getLeftSiblingOfNode!

Parameters:
node Node, which left sibling should be determined
lastNode Last node which was traversed
up True if the last step was one up in the hierarchy, false otherwise
Returns:
Node which should be processed

Node * Node::getLeftSiblingOfNode ( unsigned int *  nodesPerLevel  ) 

Determines the left sibling of the current node

Parameters:
nodesPerLevel Count of nodes per hierarchical level of the tree
Returns:
The left sibling of that node

int Node::getLevel (  ) 

Returns the level of the node

Returns:
the level of the node

unsigned int Node::getMaxDepthOfSubtree (  ) 

Determines the maximal depth of the subtree

Returns:
The maximal depth of the subtree

int Node::getMaximumFanOutOfSubtree (  ) 

Returns the maximum fanout of the subtree, which is the maximum number of childs of every node in the tree

Returns:
the maximum fanout of the subtree

unsigned int Node::getMaxNodesPerLevelOfSubtree ( int  hierarchyDepth  ) 

Returns the maximum of the number of nodes at all levels.

Parameters:
hierarchyDepth The maximum hierarchical depth of the tree
Returns:
The maximum of the number of nodes at all levels

unsigned int Node::getMinDepthOfSubtree (  ) 

Determines the minimal depth of the subtree

Returns:
The minimal depth of the subtree

unsigned int Node::getNodeCount ( unsigned int  nodeCount  ) 

Call getNodeCountOfSubtree!

Parameters:
nodeCount current count of nodes
Returns:
The count of nodes.

unsigned int Node::getNodeCountOfSubtree (  ) 

Determines the number of nodes in that subtree

Returns:
The Number of nodes in that subtree

void Node::getNodesPerLevel ( unsigned int *  nodesPerLevel  ) 

Call getNodesPerLevelOfSubtree!

Parameters:
nodesPerLevel Current data structure

unsigned int * Node::getNodesPerLevelOfSubtree ( int  hierarchyDepth  ) 

Determines the nodes per hierarchical level of the subtree

Parameters:
hierarchyDepth Maximum depth of the tree
Returns:
Nodes per hierarchical level of the subtree

Node * Node::getParent (  ) 

Returns a pointer to the parent node

Returns:
pointer to the parent node

float Node::getPreRootedX (  ) 

Returns the precomputed X-Value of the node when the tree is rendered as Rooted Tree

Returns:
The Precomputed X-Value of the node when the tree is rendered as Rooted Tree

float Node::getPreRootedXTmp (  ) 

Returns the precomputed X-Value of the node when the tree is rendered as Rooted Tree. It is used for transactions.

Returns:
The precomputed X-Value of the node when the tree is rendered as Rooted Tree. It is used for transactions.

float Node::getPreRootedY (  ) 

Returns the precomputed Y-Value of the node when the tree is rendered as Rooted Tree

Returns:
Precomputed Y-Value of the node when the tree is rendered as Rooted Tree

float Node::getRadialAngle (  ) 

Returns the angle of that node in the radial tree

Returns:
The angle of that node in the radial tree

float Node::getRadialAnglePerChild (  ) 

Returns the angle for each child of that node

Returns:
The angle for each child of that node

float Node::getRadialLeftBisectorLimitAngle (  ) 

Returns the left bisector limit angle of the childs

Returns:
The left bisector limit angle of the childs

float Node::getRadialLeftLimitAngle (  ) 

Returns the left limit angle of the childs

Returns:
The left limit angle of the childs

float Node::getRadialRightBisectorLimitAngle (  ) 

Returns the right bisector limit angle of the childs

Returns:
The right bisector limit angle of the childs

float Node::getRadialRightLimitAngle (  ) 

Returns the right limit angle of the childs

Returns:
The right limit angle of the childs

float Node::getRadialTreeX (  ) 

Returns the x-coordinate of the node, when the tree is rendered as a Radial Tree

Returns:
x-coordinate of the node, when the tree is rendered as a Radial Tree

float Node::getRadialTreeY (  ) 

Returns the y-coordinate of the node, when the tree is rendered as a Radial Tree

Returns:
y-coordinate of the node, when the tree is rendered as a Radial Tree

Node * Node::getRightSibling (  ) 

Returns the right sibling of that node

Returns:
The right sibling of that node

Node * Node::getRightSibling ( Node node,
Node lastNode,
bool  up 
)

Call getRightSiblingOfNode!

Parameters:
node Node, which right sibling should be determined
lastNode Last node which was traversed
up True if the last step was one up in the hierarchy, false otherwise
Returns:
Node which should be processed

Node * Node::getRightSiblingOfNode ( unsigned int *  nodesPerLevel  ) 

Determines the right sibling of the current node

Parameters:
nodesPerLevel Count of nodes per hierarchical level of the tree
Returns:
The right sibling of that node

float Node::getRootedTreeX (  ) 

Returns the x-coordinate of the node, when the tree is rendered as a Rooted Tree

Returns:
x-coordinate of the node, when the tree is rendered as a Rooted Tree

float Node::getRootedTreeY (  ) 

Returns the y-coordinate of the node, when the tree is rendered as a Rooted Tree

Returns:
y-coordinate of the node, when the tree is rendered as a Rooted Tree

unsigned int Node::getSiblingIndex (  ) 

Returns the index of the nodes in one hierarchical level

Returns:
Index of the nodes in one hierarchical level

float Node::preComputeBalloonTree ( float  parentAngle,
unsigned int  childCountOfParentNode 
)

Precomputes the Balloon Tree. The tree is traversed from bottom to top.

Parameters:
parentAngle Angle of the parent node
childCountOfParentNode Number of childs of the parent node
Returns:
The radius of the node

void Node::preComputeRadialSubTree ( float  rootAngle,
unsigned int  stopIndex,
Node childFound,
bool  down,
unsigned int *  nodesPerLevel 
)

Renders the whole subtree as a Rooted Tree

Parameters:
rootX the x-coordiante of the current node representing the root of the subtree
rootY the y-coordiante of the current node representing the root of the subtree
maxFanOut the maximum number of childs for each node in the whole tree
hierarchyDepth Number of levels of the tree Precomputes the radial tree and the rooted tree. The tree is traversed from right to left and from the root node to the nodes at the bottom level.
rootAngle Root angle of the root node
stopIndex siblingIndex to step traversing the siblings
childFound One child of the hierarchy level, or NULL if no one was found until now. Used for getting down in the hierarchy.
down True if the last iteration was a step down in the hierarchy, false otherwise
nodesPerLevel Count of Nodes per level of the tree

void Node::preComputeRootedSubTree ( bool  up,
unsigned int  stopIndex 
)

Improves the rooted tree. Actually the rooted tree is already precomputed in the preComputeRadialSubTree-function This function must be called from one node at the maximum depth. The tree is traversed from right to left and from bottom to top. This function tries to center the nodes. If the order of the sibling nodes at a hierarchical level gets mixed up, all nodes at that hierarchical level are reseted to the original values.

Parameters:
up Determines if the last step was one up in the hierarchy
stopIndex siblingIndex to stop traversing the sibling nodes

float Node::renderBalloonSubTree ( float  rootX,
float  rootY,
float  rootAngle,
float  radius,
int  maxFanOut,
int  hierarchyDepth 
)

Renders the whole subtree as a Balloon Tree

Parameters:
rootX the x-coordiante of the current node representing the root of the subtree
rootY the y-coordiante of the current node representing the root of the subtree
rootAngle The angle of the root node
radius The current radius
maxFanOut the maximum number of childs for each node in the whole tree
hierarchyDepth Number of levels of the tree
Returns:
The maximum of the radii of all children

void Node::renderRadialSubTree ( float  rootX,
float  rootY,
float  rootAngle,
int  maxFanOut,
int  hierarchyDepth,
unsigned int *  nodesPerLevel 
)

Renders the whole subtree as a Radial Tree

Parameters:
rootX the x-coordiante of the current node representing the root of the subtree
rootY the y-coordiante of the current node representing the root of the subtree
rootAngle Root angle
maxFanOut the maximum number of childs for each node in the whole tree
hierarchyDepth Number of levels of the tree
nodesPerLevel Count of Nodes per level of the tree

void Node::renderRootedSubTree ( float  rootX,
float  rootY,
int  maxFanOut,
int  hierarchyDepth 
)

Renders the whole subtree as a Rooted Tree

Parameters:
rootX the x-coordiante of the current node representing the root of the subtree
rootY the y-coordiante of the current node representing the root of the subtree
maxFanOut the maximum number of childs for each node in the whole tree
hierarchyDepth Number of levels of the tree

void Node::setAngleOfNode ( float  angle  ) 

Sets the angle of the node in the balloon tree

Parameters:
angle Angle of the node

void Node::setBoundariesOfSubTree ( float *  rootedBoundaries,
float *  radialBoundaries,
float *  balloonBoundaries 
)

Sets the boundaries of the subtree

Parameters:
rootedBoundaries pointer to an array to store the boundaries of the Rooted Tree in the form xMin, yMin, xMax, yMax
radialBoundaries pointer to an array to store the boundaries of the Radial Tree in the form xMin, yMin, xMax, yMax
balloonBoundaries pointer to an array to store the boundaries of the Balloon Tree in the form xMin, yMin, xMax, yMax

void Node::setCircleVisability ( bool  visable  ) 

Sets a boolean value indicating whether the hierarchy circles should be rendered or not

Parameters:
visable a boolean value indicating whether the hierarchy circles should be rendered or not

void Node::setIsLeftestChild ( bool  value  ) 

Sets if the child is the leftest one

Parameters:
value True if the child is the leftest one, false otherwise

void Node::setIsRightestChild ( bool  value  ) 

Sets if the child is the rightest one

Parameters:
value True if the child is the rightest one, false otherwise

void Node::setLevelsForSubTree ( int  actLevel  ) 

Sets the level for each node in the whole subtree starting with actLevel at the root

Parameters:
actLevel the level of the current node representing the root of the subtree

void Node::setLineVisability ( bool  visable  ) 

Sets a boolean value indicating whether the hierarchy lines should be rendered or not

Parameters:
visable a boolean value indicating whether the hierarchy lines should be rendered or not

void Node::setNodeVisability ( bool  visable  ) 

Sets a boolean value indicating whether the nodes should be rendered or not

Parameters:
visable a boolean value indicating whether the nodes should be rendered or not

void Node::setParent ( Node _parent  ) 

Sets the pointer to the parent node

Parameters:
_parent pointer to the parent node

void Node::setPreRootedX ( float  value  ) 

Sets the precomputed X-Value of the node when the tree is rendered as Rooted Tree

Parameters:
value Precomputed X-Value of the node when the tree is rendered as Rooted Tree

void Node::setPreRootedY ( float  value  ) 

Sets the precomputed Y-Value of the node when the tree is rendered as Rooted Tree

Parameters:
value Precomputed Y-Value of the node when the tree is rendered as Rooted Tree

void Node::setRadialAngle ( float  angle  ) 

Sets the angle of that node in the radial tree

Parameters:
angle The angle of that node in the radial tree

void Node::setRadialLeftBisectorLimitAngle ( float  angle  ) 

Sets the left bisector limit angle of the childs

Parameters:
angle Left bisector limit angle of the childs

void Node::setRadialRightBisectorLimitAngle ( float  angle  ) 

Sets the right bisector limit angle of the childs

Parameters:
angle right bisector limit angle of the childs


Member Data Documentation

float Node::balloonAngleOfNode [private]

Angle of the node in the balloon tree

float Node::balloonRadiusOfNode [private]

Radius of the node in the balloon tree

float Node::balloonTreeX [private]

X-Value of the node when the tree is rendered as Balloon Tree

float Node::balloonTreeY [private]

Y-Value of the node when the tree is rendered as Balloon Tree

std::vector<Node*>* Node::childVector [private]

Pointer to a vector with pointers to Node objects representing the childs of the node

int Node::id [private]

ID of the node

bool Node::isLeftestChild [private]

Determines if the child is the leftest one

bool Node::isRightestChild [private]

Determines if the child is the rightest one

Node* Node::leftSibling [private]

Pointer to the left sibling node

int Node::level [private]

Level of the node, the root has level 0

LoggerPtr Node::logger [static, private]

Node* Node::parent [private]

Pointer to the parent node

float Node::preRootedX [private]

Precomputed X-Value of the node when the tree is rendered as Rooted Tree

float Node::preRootedXTmp [private]

Precomputed X-Value of the node when the tree is rendered as Rooted Tree. It is used for transactions.

float Node::preRootedY [private]

Precomputed Y-Value of the node when the tree is rendered as Rooted Tree

float Node::radialAngle [private]

Angle of that node in the radial tree

float Node::radialAnglePerChild [private]

Angle for each child of that node

The left bisector limit angle of the childs

float Node::radialLeftLimitAngle [private]

The left limit angle of the childs

The right bisector limit angle of the childs

float Node::radialRightLimitAngle [private]

The right limit angle of the childs

float Node::radialTreeX [private]

X-Value of the node when the tree is rendered as Radial Tree

float Node::radialTreeY [private]

Y-Value of the node when the tree is rendered as Radial Tree

Pointer to the right sibling node

float Node::rootedTreeX [private]

X-Value of the node when the tree is rendered as Rooted Tree

float Node::rootedTreeY [private]

Y-Value of the node when the tree is rendered as Rooted Tree

bool Node::showCircles [private]

Boolean value indicating whether the hierarchy circles should be rendered or not

bool Node::showLines [private]

Boolean value indicating whether the hierarchy lines should be rendered or not

bool Node::showNodes [private]

Boolean value indicating whether the nodes should be rendered or not

unsigned int Node::siblingIndex [private]

Index of the nodes in one hierarchical level


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

Generated on Tue Jun 2 19:53:44 2009 for Hierarchical Edge Bundles by  doxygen 1.5.7.1