Workspace 6.21.5
Public Types | Public Member Functions | Public Attributes | List of all members
Octree< ItemType > Class Template Reference

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

Detailed Description

template<typename ItemType>
class CSIRO::Mesh::Octree< ItemType >

ItemType must support: ScalarType typedef VectorType getPosition() const ScalarType getRadius() const

Member Typedef Documentation

◆ ScalarType

using ScalarType = typename ItemType::ScalarType

◆ VectorType

using VectorType = OctreeVector3<typename ItemType::ScalarType>

Constructor & Destructor Documentation

◆ Octree()

Octree ( const VectorType boundsMin,
const VectorType boundsMax,
ScalarType  radiusToLengthDepth = 0.25,
uint  expectedNumItems = 0 
)

Member Function Documentation

◆ add() [1/2]

void add ( const ItemType &  item)

◆ add() [2/2]

void add ( const ItemType &  item,
uint  targetDepth 
)

Overload for when calculateTargetDepthForRadius() has been used for multiple particles of the same size

◆ calculateTargetDepthForRadius()

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

◆ getNumItems()

size_t getNumItems

◆ getNumNodes()

size_t getNumNodes

◆ reportStats()

void reportStats

◆ testAgainst() [1/2]

const ItemType * testAgainst ( const ItemType &  item) const

◆ testAgainst() [2/2]

const ItemType * testAgainst ( const VectorType pos,
ScalarType  radius 
) const

Member Data Documentation

◆ boundingLength_

ScalarType boundingLength_

◆ items_

QVector<OctreeItem<ItemType> > items_

◆ maxDepth_

uint maxDepth_

◆ nodes_

QVector<OctreeNode<ScalarType> > nodes_

◆ radiusToLengthDepth_

ScalarType radiusToLengthDepth_