TreeNode Class Reference

#include <ArmarXGui/gui-plugins/ConditionViewerPlugin/TreeNode.h>

+ Inheritance diagram for TreeNode:

Public Member Functions

void addChild (TreeNodePtr child)
 Adds a child to the node in the tree structure. More...
 
QRectF getBoundingBox ()
 Retrieve boundingbox of the node. More...
 
std::vector< TreeNodePtrgetChildren () const
 
QSize getSize ()
 Retrieve size of the node. More...
 
QSize getSubTreeSize ()
 Retrieve size of the complete subtree where the current node is root. More...
 
 TreeNode (QGraphicsScene *scene, QSize nodeSize=TreeNode::DefaultNodeSize)
 Constructs a tree node as part of a Qt visualizable tree. More...
 
void update (QPointF positionLeftTop=QPointF(0, 0))
 Updates the layout of the tree. More...
 

Static Public Attributes

static const QSize DefaultNodeHorizontalSeparator
 
static const QSize DefaultNodeSize
 
static const QSize DefaultNodeVerticalSeparator
 

Protected Member Functions

virtual void drawEdge (QLineF line)
 Draws an edge to this node. More...
 
virtual void drawNode (QRectF boundingBox)
 Draws the node. More...
 
void setSize (QSize nodeSize)
 Sets size of node. More...
 

Detailed Description

Definition at line 43 of file TreeNode.h.

Constructor & Destructor Documentation

◆ TreeNode()

TreeNode ( QGraphicsScene *  scene,
QSize  nodeSize = TreeNode::DefaultNodeSize 
)

Constructs a tree node as part of a Qt visualizable tree.

Parameters
scenethe graphics scene used for rendering
nodeSitesize of the nodes boundingbox

Definition at line 35 of file TreeNode.cpp.

Member Function Documentation

◆ addChild()

void addChild ( TreeNodePtr  child)

Adds a child to the node in the tree structure.

Parameters
childthe child to add

Definition at line 56 of file TreeNode.cpp.

◆ drawEdge()

void drawEdge ( QLineF  line)
protectedvirtual

Draws an edge to this node.

Overwrite this in order provide your own visualization.

Parameters
lineline from parent to this node

Reimplemented in TermNode.

Definition at line 234 of file TreeNode.cpp.

+ Here is the caller graph for this function:

◆ drawNode()

void drawNode ( QRectF  boundingBox)
protectedvirtual

Draws the node.

Overwrite this in order provide your own visualization.

Parameters
boundingBoxof the node to be drawn

Reimplemented in TermNode.

Definition at line 240 of file TreeNode.cpp.

◆ getBoundingBox()

QRectF getBoundingBox ( )
inline

Retrieve boundingbox of the node.

Only valid after update has been called.

Returns
boundingbox of the node in the graphicsscene

Definition at line 87 of file TreeNode.h.

◆ getChildren()

std::vector< TreeNodePtr > getChildren ( ) const

Definition at line 80 of file TreeNode.cpp.

◆ getSize()

QSize getSize ( )
inline

Retrieve size of the node.

Returns
node size

Definition at line 76 of file TreeNode.h.

◆ getSubTreeSize()

QSize getSubTreeSize ( )
inline

Retrieve size of the complete subtree where the current node is root.

Only valid after update has been callse;

Returns
size of the subtree represented by this node

Definition at line 97 of file TreeNode.h.

◆ setSize()

void setSize ( QSize  nodeSize)
inlineprotected

Sets size of node.

Layout has to be updated afterwards.

Parameters
nodeSizesize of the node

Definition at line 107 of file TreeNode.h.

+ Here is the caller graph for this function:

◆ update()

void update ( QPointF  positionLeftTop = QPointF(0, 0))

Updates the layout of the tree.

Only applicable for the root node. Is ignored for all other nodes.

Parameters
positionLeftTopleft top position in the graphicsscene, where the tree is drawn.

Definition at line 65 of file TreeNode.cpp.

Member Data Documentation

◆ DefaultNodeHorizontalSeparator

const QSize DefaultNodeHorizontalSeparator
static

Definition at line 47 of file TreeNode.h.

◆ DefaultNodeSize

const QSize DefaultNodeSize
static

Definition at line 49 of file TreeNode.h.

◆ DefaultNodeVerticalSeparator

const QSize DefaultNodeVerticalSeparator
static

Definition at line 48 of file TreeNode.h.


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