3Depict
|
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 Point3D * | getPt (size_t index) const |
const Point3D & | getPtRef (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) |
3D specific KD tree
|
inline |
|
inline |
Cleans up tree, deallocates nodes.
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().
|
inline |
void K3DTreeMk2::clearAllTags | ( | ) |
References build(), findNearestUntagged(), getBoundCube(), getBoxInTree(), resetPts(), BoundCube::setBounds(), and TEST.
void K3DTreeMk2::clearTags | ( | std::vector< size_t > & | tagsToClear | ) |
Referenced by ClusterAnalysisFilter::setPropFromBinding().
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
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().
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().
void K3DTreeMk2::getBoundCube | ( | BoundCube & | b | ) |
References ASSERT, and BoundCube::setBounds().
Referenced by clearAllTags(), SpatialAnalysisFilter::refresh(), ClusterAnalysisFilter::setPropFromBinding(), and SpatialAnalysisFilter::setPropFromBinding().
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().
size_t K3DTreeMk2::getOrigIndex | ( | size_t | treeIndex | ) | const |
References ASSERT.
Referenced by SpatialAnalysisFilter::refresh(), ClusterAnalysisFilter::setPropFromBinding(), and SpatialAnalysisFilter::setPropFromBinding().
const Point3D * K3DTreeMk2::getPt | ( | size_t | index | ) | const |
References ASSERT, and NodeWalk::index.
Referenced by SpatialAnalysisFilter::refresh(), and ClusterAnalysisFilter::setPropFromBinding().
const Point3D & K3DTreeMk2::getPtRef | ( | size_t | index | ) | const |
References ASSERT.
Referenced by generate1DAxialDistHist(), generate1DAxialDistHistSweep(), generate1DAxialNNHist(), and SpatialAnalysisFilter::setPropFromBinding().
bool K3DTreeMk2::getTag | ( | size_t | treeIndex | ) | const |
References ASSERT.
Referenced by ClusterAnalysisFilter::setPropFromBinding().
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().
void K3DTreeMk2::ptsInSphere | ( | const Point3D & | origin, |
float | radius, | ||
std::vector< size_t > & | pts | ||
) | const |
References ASSERT, BoundCube::containedInSphere(), NodeWalk::depth, BoundCube::intersects(), and NodeWalk::NodeWalk().
Referenced by generate1DAxialDistHist(), generate1DAxialDistHistSweep(), ClusterAnalysisFilter::setPropFromBinding(), and SpatialAnalysisFilter::setPropFromBinding().
void K3DTreeMk2::resetPts | ( | std::vector< Point3D > & | pts, |
bool | clear = true |
||
) |
Referenced by clearAllTags(), SpatialAnalysisFilter::refresh(), ClusterAnalysisFilter::setPropFromBinding(), and SpatialAnalysisFilter::setPropFromBinding().
void K3DTreeMk2::resetPts | ( | std::vector< IonHit > & | pts, |
bool | clear = true |
||
) |
References IonHit::getBoundCube().
|
inline |
|
inlinestatic |
Referenced by ClusterAnalysisFilter::refresh(), and SpatialAnalysisFilter::refresh().
|
static |
|
static |
|
inlinestatic |
Referenced by ClusterAnalysisFilter::refresh(), and SpatialAnalysisFilter::refresh().
size_t K3DTreeMk2::size | ( | ) | const |
References ASSERT.
Referenced by generate1DAxialDistHistSweep(), and ClusterAnalysisFilter::setPropFromBinding().
void K3DTreeMk2::tag | ( | size_t | tagID, |
bool | tagVal = true |
||
) |
References ASSERT.
Referenced by ClusterAnalysisFilter::setPropFromBinding().
size_t K3DTreeMk2::tagCount | ( | ) | const |