# Visualization Library

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

[Home] [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:

List of all members.

## Public Member Functions

| 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

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 ) |

Definition at line 45 of file ActorTree.cpp.

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

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

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

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:

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/ActorTree.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/ActorTree.cpp

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:20.
Permission is granted to use this page to write and publish articles regarding Visualization Library.