3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | List of all members
K3DTreeMk2 Class Reference

3D specific KD tree More...

#include <K3DTree-mk2.h>

Public Member Functions

 K3DTreeMk2 ()
 
 ~K3DTreeMk2 ()
 Cleans up tree, deallocates nodes. More...
 
void resetPts (std::vector< Point3D > &pts, bool clear=true)
 
void resetPts (std::vector< IonHit > &pts, bool clear=true)
 
bool build ()
 
void getBoundCube (BoundCube &b)
 
void dump (std::ostream &, size_t depth=0, size_t offset=-1) const
 Textual output of tree. tabs are used to separate different levels of the tree. More...
 
size_t findNearestUntagged (const Point3D &queryPt, const BoundCube &b, bool tag=true, size_t pseudoRoot=(size_t) -1)
 
size_t findNearestWithSkip (const Point3D &queryPt, const BoundCube &b, const std::set< size_t > &skipPts, size_t pseudoRoot=(size_t) -1) const
 
void ptsInSphere (const Point3D &origin, float radius, std::vector< size_t > &pts) const
 
void getTreesInSphere (const Point3D &pt, float sqrDist, const BoundCube &domainCube, std::vector< std::pair< size_t, size_t > > &contigousBlocks) const
 Get the contigous node IDs for a subset of points in the tree that are contained. More...
 
size_t getBoxInTree (const BoundCube &box) const
 Get the smallest contigous bounds that will contain a box. More...
 
const Point3DgetPt (size_t index) const
 
const Point3DgetPtRef (size_t index) const
 
void clearTags (std::vector< size_t > &tagsToClear)
 
size_t getOrigIndex (size_t treeIndex) const
 
void clear ()
 
void tag (size_t tagID, bool tagVal=true)
 
bool getTag (size_t treeIndex) const
 
size_t size () const
 
size_t rootIdx () const
 
size_t tagCount () const
 
void clearAllTags ()
 

Static Public Member Functions

static void setProgressPtr (unsigned int *ptr)
 
static void setAbortFlag (ATOMIC_BOOL *ptr)
 
static void setAbortPtr (bool *abortFlag)
 
static void setProgressPointer (unsigned int *p)
 

Detailed Description

3D specific KD tree

Constructor & Destructor Documentation

◆ K3DTreeMk2()

K3DTreeMk2::K3DTreeMk2 ( )
inline

◆ ~K3DTreeMk2()

K3DTreeMk2::~K3DTreeMk2 ( )
inline

Cleans up tree, deallocates nodes.

Member Function Documentation

◆ build()

bool K3DTreeMk2::build ( )

Builds a balanced KD tree from a list of points previously set by "resetPts". returns false if callback returns false;

References ASSERT, and AxisCompareMk2::setAxis().

Referenced by clearAllTags(), SpatialAnalysisFilter::refresh(), ClusterAnalysisFilter::setPropFromBinding(), and SpatialAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ clear()

void K3DTreeMk2::clear ( )
inline

◆ clearAllTags()

void K3DTreeMk2::clearAllTags ( )

◆ clearTags()

void K3DTreeMk2::clearTags ( std::vector< size_t > &  tagsToClear)

Referenced by ClusterAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ dump()

void K3DTreeMk2::dump ( std::ostream &  ,
size_t  depth = 0,
size_t  offset = -1 
) const

Textual output of tree. tabs are used to separate different levels of the tree.

The output from this function can be quite large for even modest trees. Recommended for debugging only

◆ findNearestUntagged()

size_t K3DTreeMk2::findNearestUntagged ( const Point3D queryPt,
const BoundCube b,
bool  tag = true,
size_t  pseudoRoot = (size_t)-1 
)

References ASSERT, and BoundCube::intersects().

Referenced by clearAllTags(), SpatialAnalysisFilter::refresh(), and ClusterAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ findNearestWithSkip()

size_t K3DTreeMk2::findNearestWithSkip ( const Point3D queryPt,
const BoundCube b,
const std::set< size_t > &  skipPts,
size_t  pseudoRoot = (size_t)-1 
) const

References ASSERT, and BoundCube::intersects().

Referenced by generate1DAxialNNHist(), and SpatialAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ getBoundCube()

void K3DTreeMk2::getBoundCube ( BoundCube b)

◆ getBoxInTree()

size_t K3DTreeMk2::getBoxInTree ( const BoundCube box) const

Get the smallest contigous bounds that will contain a box.

References ASSERT, BoundCube::contains(), BoundCube::makeUnion(), BoundCube::segmentTriple(), and BoundCube::setBound().

Referenced by clearAllTags().

Here is the caller graph for this function:

◆ getOrigIndex()

size_t K3DTreeMk2::getOrigIndex ( size_t  treeIndex) const

◆ getPt()

const Point3D * K3DTreeMk2::getPt ( size_t  index) const

References ASSERT, and NodeWalk::index.

Referenced by SpatialAnalysisFilter::refresh(), and ClusterAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ getPtRef()

const Point3D & K3DTreeMk2::getPtRef ( size_t  index) const

◆ getTag()

bool K3DTreeMk2::getTag ( size_t  treeIndex) const

References ASSERT.

Referenced by ClusterAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ getTreesInSphere()

void K3DTreeMk2::getTreesInSphere ( const Point3D pt,
float  sqrDist,
const BoundCube domainCube,
std::vector< std::pair< size_t, size_t > > &  contigousBlocks 
) const

Get the contigous node IDs for a subset of points in the tree that are contained.

References ASSERT, BoundCube::containedInSphere(), and BoundCube::intersects().

◆ ptsInSphere()

void K3DTreeMk2::ptsInSphere ( const Point3D origin,
float  radius,
std::vector< size_t > &  pts 
) const

◆ resetPts() [1/2]

void K3DTreeMk2::resetPts ( std::vector< Point3D > &  pts,
bool  clear = true 
)

◆ resetPts() [2/2]

void K3DTreeMk2::resetPts ( std::vector< IonHit > &  pts,
bool  clear = true 
)

◆ rootIdx()

size_t K3DTreeMk2::rootIdx ( ) const
inline

◆ setAbortFlag()

static void K3DTreeMk2::setAbortFlag ( ATOMIC_BOOL ptr)
inlinestatic

Referenced by ClusterAnalysisFilter::refresh(), and SpatialAnalysisFilter::refresh().

Here is the caller graph for this function:

◆ setAbortPtr()

static void K3DTreeMk2::setAbortPtr ( bool *  abortFlag)
static

◆ setProgressPointer()

static void K3DTreeMk2::setProgressPointer ( unsigned int *  p)
static

◆ setProgressPtr()

static void K3DTreeMk2::setProgressPtr ( unsigned int *  ptr)
inlinestatic

Referenced by ClusterAnalysisFilter::refresh(), and SpatialAnalysisFilter::refresh().

Here is the caller graph for this function:

◆ size()

size_t K3DTreeMk2::size ( ) const

References ASSERT.

Referenced by generate1DAxialDistHistSweep(), and ClusterAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ tag()

void K3DTreeMk2::tag ( size_t  tagID,
bool  tagVal = true 
)

References ASSERT.

Referenced by ClusterAnalysisFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ tagCount()

size_t K3DTreeMk2::tagCount ( ) const

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