#include <Octree.h>
Inheritance diagram for hxa7241_graphics::OctreeVisitor< TYPE >:
Public Member Functions | |
virtual | ~OctreeVisitor () |
virtual void | visitRootV (const OctreeCell *pRootCell, const OctreeData &octreeData) |
void-to-type forwarders | |
virtual void | visitBranchV (const OctreeCell *subCells[8], const OctreeData &octreeData) |
virtual void | visitLeafV (const Array< const void * > &items, const OctreeData &octreeData) |
Protected Member Functions | |
OctreeVisitor () | |
standard object services --------------------------------------------------- | |
virtual void | visitRoot (const OctreeCell *pRootCell, const OctreeData &octreeData)=0 |
commands ------------------------------------------------------------------- | |
virtual void | visitBranch (const OctreeCell *subCells[8], const OctreeData &octreeData)=0 |
virtual void | visitLeaf (const Array< const TYPE * > &items, const OctreeData &octreeData)=0 |
Client of Octree must define a concrete derivative of OctreeVisitor<ItemType>.
This is a reversal of the Visitor pattern: it allows an operation to be performed with the Octree, except the Octree is merely read from and it is the visitor that is modified.
The visit methods are called by the tree nodes during the visit operation. The parameters supply the cell and boundary info. The implementation can call visit on the supplied cell.
The implementation of visitBranch needs to make the OctreeData to be given in each call of visit.
Subcell numbering:
y z 6 7 |/ 2 3 4 5 -x 0 1in binary:
y z 110 111 |/ 010 011 100 101 -x 000 001
The ___V methods simply apply a type-cast to void*s and forward to their abstract counterparts.
hxa7241_graphics::OctreeVisitor< TYPE >::OctreeVisitor | ( | ) | [inline, protected] |
standard object services ---------------------------------------------------
virtual hxa7241_graphics::OctreeVisitor< TYPE >::~OctreeVisitor | ( | ) | [inline, virtual] |
void hxa7241_graphics::OctreeVisitor< TYPE >::visitRootV | ( | const OctreeCell * | pRootCell, | |
const OctreeData & | octreeData | |||
) | [inline, virtual] |
void hxa7241_graphics::OctreeVisitor< TYPE >::visitBranchV | ( | const OctreeCell * | subCells[8], | |
const OctreeData & | octreeData | |||
) | [inline, virtual] |
Implements hxa7241_graphics::OctreeVisitorV.
void hxa7241_graphics::OctreeVisitor< TYPE >::visitLeafV | ( | const Array< const void * > & | items, | |
const OctreeData & | octreeData | |||
) | [inline, virtual] |
Implements hxa7241_graphics::OctreeVisitorV.
virtual void hxa7241_graphics::OctreeVisitor< TYPE >::visitRoot | ( | const OctreeCell * | pRootCell, | |
const OctreeData & | octreeData | |||
) | [protected, pure virtual] |
commands -------------------------------------------------------------------
Called by Octree when visit traversal is at the root.
To continue deeper, implementation calls OctreeRoot::continueVisit( pRootCell, octreeData, *this ). pRootCell can be null.
Implemented in Octree_Visitor_Check_Face, Octree_Visitor_Face, Octree_Visitor_Measure, and Octree_Visitor_Update.
virtual void hxa7241_graphics::OctreeVisitor< TYPE >::visitBranch | ( | const OctreeCell * | subCells[8], | |
const OctreeData & | octreeData | |||
) | [protected, pure virtual] |
Called by Octree when visit traversal is at a branch.
To continue deeper, implementation calls OctreeBranch::continueVisit( subCells, octreeData, subCellIndex, *this ) for any/all subCellIndex values. subCells elements can be null.
Implemented in Octree_Visitor_Check_Face, Octree_Visitor_Face, Octree_Visitor_Measure, and Octree_Visitor_Update.
virtual void hxa7241_graphics::OctreeVisitor< TYPE >::visitLeaf | ( | const Array< const TYPE * > & | items, | |
const OctreeData & | octreeData | |||
) | [protected, pure virtual] |
Called by Octree when visit traversal is at a leaf.