igor::iOctree Class Reference

Octree implementation. More...

#include <iOctree.h>

Public Member Functions

void insert (void *userData, const iaSphered &sphere)
 
void remove (void *userData)
 
void update (void *userData, const iaSphered &sphere)
 
void addFilter (const iFrustumd &frustum)
 
void addFilter (const iPlaned &plane)
 
void addFilter (const iaSphered &sphere)
 
void clearFilter ()
 
void filter ()
 
void filter (const iFrustumd &frustum)
 
const std::vector< void * > & getResult () const
 
 iOctree (const iAACubed &box, float64 halfMinResolution=1.0, uint64 objectCountMaxThreashold=8, uint64 objectCountMinThreashold=2)
 
virtual ~iOctree ()
 
void draw ()
 

Detailed Description

Octree implementation.

Constructor & Destructor Documentation

◆ iOctree()

igor::iOctree::iOctree ( const iAACubed box,
float64  halfMinResolution = 1.0,
uint64  objectCountMaxThreashold = 8,
uint64  objectCountMinThreashold = 2 
)

creates the octree including the root node

Parameters
boxvolume of the whole octree
halfMinResolutionhalf of the minimum size a octree nodes volume has
objectCountMaxThreasholdmaximum amount of objects before splitting the parenting octree node
objectCountMinThreasholdminimum amount of objects in the child nodes of a node before merging them together

◆ ~iOctree()

igor::iOctree::~iOctree ( )
virtual

dtor

Member Function Documentation

◆ addFilter() [1/3]

void igor::iOctree::addFilter ( const iaSphered sphere)

adds sphere to filter set

Parameters
spherethe sphere to filter with

◆ addFilter() [2/3]

void igor::iOctree::addFilter ( const iFrustumd frustum)

adds frustum to filter set

Parameters
frustumthe frustum

◆ addFilter() [3/3]

void igor::iOctree::addFilter ( const iPlaned plane)

adds plane to filter set

Parameters
planethe plane to filter with

◆ clearFilter()

void igor::iOctree::clearFilter ( )

clears filter set

◆ draw()

void igor::iOctree::draw ( )

draws the octrees structure

only use for debugging!

◆ filter() [1/2]

void igor::iOctree::filter ( )

filters the octree using the current filter set

use getResult to get the result

◆ filter() [2/2]

void igor::iOctree::filter ( const iFrustumd frustum)

filters the octree with given frustum

use getResult to get the result

Parameters
frustumthe given frustum

◆ getResult()

const std::vector< void * > & igor::iOctree::getResult ( ) const

returns the result of filtering

Returns
the filtered user data

◆ insert()

void igor::iOctree::insert ( void *  userData,
const iaSphered sphere 
)

insert user data to octree

Parameters
userDatapointer to user data

◆ remove()

void igor::iOctree::remove ( void *  userData)

remove user data from octree

Parameters
userDatapointer to user data

◆ update()

void igor::iOctree::update ( void *  userData,
const iaSphered sphere 
)

update user data in octree

this is called usually if the user data changed it's position

Parameters
userDatapointer to user data

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