# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# 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:

List of all members.

## Public Member Functions
virtual const char * | className ()
| Returns the name of the class.
| ActorTree ()
virtual int | childrenCount () const
| Returns the number of child nodes of an ActorTreeAbstract node.
virtual ActorTreeAbstract * | child (int i)
| Returns the i-th child node of an ActorTreeAbstract node.
virtual const ActorTreeAbstract * | child (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:
  - ActorKdTree
  - SceneManager
  - SceneManagerActorKdTree
  - SceneManagerActorTree
  - Actor

## Constructor & Destructor Documentation

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

## Member Function Documentation

virtual const char* vl::ActorTree::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::ActorTreeAbstract.

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

Returns the number of child nodes of an ActorTreeAbstract node.

Implements vl::ActorTreeAbstract.

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

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

Implements vl::ActorTreeAbstract.

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

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

Implements vl::ActorTreeAbstract.

void ActorTree::addChild | ( | ActorTreeAbstract * | node | ) |

void ActorTree::setChild | ( | int | i,
|  | ActorTreeAbstract * | node |
| ) |  |  |

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

void ActorTree::eraseAllChildren | ( |  | ) |

## Member Data Documentation

std::vector< ref<ActorTreeAbstract> > vl::ActorTree::mChildren

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/ActorTree.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/ActorTree.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 29 11:11:44 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.