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.
 
QRectF getBoundingBox ()
 Retrieve boundingbox of the node.
 
std::vector< TreeNodePtr > getChildren () const
 
QSize getSize ()
 Retrieve size of the node.
 
QSize getSubTreeSize ()
 Retrieve size of the complete subtree where the current node is root.
 
 TreeNode (QGraphicsScene *scene, QSize nodeSize=TreeNode::DefaultNodeSize)
 Constructs a tree node as part of a Qt visualizable tree.
 
void update (QPointF positionLeftTop=QPointF(0, 0))
 Updates the layout of the tree.
 

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.
 
virtual void drawNode (QRectF boundingBox)
 Draws the node.
 
void setSize (QSize nodeSize)
 Sets size of node.
 

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

Member Function Documentation

◆ addChild()

void addChild ( TreeNodePtr child)

Adds a child to the node in the tree structure.

Parameters
childthe child to add

◆ 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.

◆ 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.

◆ getBoundingBox()

QRectF getBoundingBox ( )
inline

Retrieve boundingbox of the node.

Only valid after update has been called.

Returns
boundingbox of the node in the graphicsscene

◆ getChildren()

std::vector< TreeNodePtr > getChildren ( ) const

◆ getSize()

QSize getSize ( )
inline

Retrieve size of the node.

Returns
node size

◆ 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

◆ setSize()

void setSize ( QSize nodeSize)
inlineprotected

Sets size of node.

Layout has to be updated afterwards.

Parameters
nodeSizesize of the node

◆ 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.

Member Data Documentation

◆ DefaultNodeHorizontalSeparator

const QSize DefaultNodeHorizontalSeparator
static

◆ DefaultNodeSize

const QSize DefaultNodeSize
static

◆ DefaultNodeVerticalSeparator

const QSize DefaultNodeVerticalSeparator
static

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