Workspace 6.21.5
|
#include <Mesh/DataStructures/octree.h>
Public Types | |
using | ScalarType = typename ItemType::ScalarType |
using | VectorType = OctreeVector3< typename ItemType::ScalarType > |
Public Member Functions | |
Octree (const VectorType &boundsMin, const VectorType &boundsMax, ScalarType radiusToLengthDepth=0.25, uint expectedNumItems=0) | |
void | add (const ItemType &item) |
void | add (const ItemType &item, uint targetDepth) |
uint | calculateTargetDepthForRadius (const ScalarType radius) |
size_t | getNumItems () const |
size_t | getNumNodes () const |
void | reportStats () const |
const ItemType * | testAgainst (const ItemType &item) const |
const ItemType * | testAgainst (const VectorType &pos, ScalarType radius) const |
Public Attributes | |
ScalarType | boundingLength_ |
QVector< OctreeItem< ItemType > > | items_ |
uint | maxDepth_ |
QVector< OctreeNode< ScalarType > > | nodes_ |
ScalarType | radiusToLengthDepth_ |
ItemType must support: ScalarType typedef VectorType getPosition() const ScalarType getRadius() const
using ScalarType = typename ItemType::ScalarType |
using VectorType = OctreeVector3<typename ItemType::ScalarType> |
Octree | ( | const VectorType & | boundsMin, |
const VectorType & | boundsMax, | ||
ScalarType | radiusToLengthDepth = 0.25 , |
||
uint | expectedNumItems = 0 |
||
) |
void add | ( | const ItemType & | item | ) |
void add | ( | const ItemType & | item, |
uint | targetDepth | ||
) |
Overload for when calculateTargetDepthForRadius() has been used for multiple particles of the same size
uint calculateTargetDepthForRadius | ( | const ScalarType | radius | ) |
For fixed-resolution sims you can calculate the depth once based on particle size and use the overloaded add() to avoid calculating this for each particle
size_t getNumItems |
size_t getNumNodes |
void reportStats |
const ItemType * testAgainst | ( | const ItemType & | item | ) | const |
const ItemType * testAgainst | ( | const VectorType & | pos, |
ScalarType | radius | ||
) | const |
ScalarType boundingLength_ |
QVector<OctreeItem<ItemType> > items_ |
uint maxDepth_ |
QVector<OctreeNode<ScalarType> > nodes_ |
ScalarType radiusToLengthDepth_ |