Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Public Attributes

vl::ActorTree Class Reference

The ActorTree class implements a generic tree whose nodes contain Actor[s]. More...

#include <ActorTree.hpp>

Inheritance diagram for vl::ActorTree:
vl::ActorTreeAbstract vl::Object

List of all members.

Public Member Functions

 ActorTree ()
virtual int childrenCount () const
 Returns the number of child nodes of an ActorTreeAbstract node.
virtual ActorTreeAbstractchild (int i)
 Returns the i-th child node of an ActorTreeAbstract node.
virtual const ActorTreeAbstractchild (int i) const
 Returns the i-th child node of an ActorTreeAbstract node.
void addChild (ActorTreeAbstract *node)
void setChild (int i, ActorTreeAbstract *node)
void eraseChild (int i, int count=1)
void eraseAllChildren ()

Public Attributes

std::vector< ref
< ActorTreeAbstract > > 
mChildren

Detailed Description

The ActorTree class implements a generic tree whose nodes contain Actor[s].

Each node of the tree can have any number of children.

Use this class when you want to have direct control over how the Actor[s] are grouped together or to implement specific space partitioning schemes like BSP trees, Quadtrees, Octrees etc. For example you can use the ActorTree class to build a quadtree by assigning 4 children per node and filling them appropriately. Of course you can also use an ActorTree to group a set of Actor[s] based on any other principle. For example animated Actor[s] are usually kept in separate "flat" trees (for example all in a single node) as the computational cost of rebuilding every frame the BSP tree, Quadtree, Octree etc. might be to high.

Note that for performance reasons the ActorKdTree class derives from the ActorTreeAbstract and implements a space partitioning scheme (based on a binary tree) where the splitting planes are in turn choosen so that they are aligned to the world space x, y and z axes.

See also:

Definition at line 62 of file ActorTree.hpp.


Constructor & Destructor Documentation

vl::ActorTree::ActorTree (  ) [inline]

Definition at line 67 of file ActorTree.hpp.

References VL_DEBUG_SET_OBJECT_NAME.


Member Function Documentation

virtual int vl::ActorTree::childrenCount (  ) const [inline, virtual]

Returns the number of child nodes of an ActorTreeAbstract node.

Implements vl::ActorTreeAbstract.

Definition at line 72 of file ActorTree.hpp.

virtual ActorTreeAbstract* vl::ActorTree::child ( int  i ) [inline, virtual]

Returns the i-th child node of an ActorTreeAbstract node.

Implements vl::ActorTreeAbstract.

Definition at line 73 of file ActorTree.hpp.

virtual const ActorTreeAbstract* vl::ActorTree::child ( int  i ) const [inline, virtual]

Returns the i-th child node of an ActorTreeAbstract node.

Implements vl::ActorTreeAbstract.

Definition at line 74 of file ActorTree.hpp.

void ActorTree::addChild ( ActorTreeAbstract node )
void ActorTree::setChild ( int  i,
ActorTreeAbstract node 
)

Definition at line 56 of file ActorTree.cpp.

References vl::Log::error(), mChildren, NULL, and vl::ActorTreeAbstract::parent().

void ActorTree::eraseChild ( int  i,
int  count = 1 
)

Definition at line 68 of file ActorTree.cpp.

References mChildren, NULL, and vl::ActorTreeAbstract::setParent().

void ActorTree::eraseAllChildren (  )

Definition at line 38 of file ActorTree.cpp.

References mChildren, NULL, and vl::ActorTreeAbstract::setParent().


Member Data Documentation

Definition at line 82 of file ActorTree.hpp.

Referenced by addChild(), eraseAllChildren(), eraseChild(), and setChild().


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:08.
Permission is granted to use this page to write and publish articles regarding Visualization Library.