HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_SortKDTree Class Reference

#include <GU_Sort.h>

+ Inheritance diagram for GU_SortKDTree:

Public Member Functions

 GU_SortKDTree (size_t size)
 
void setPos (int idx, const UT_Vector3 &pos)
 
const intgetIndices () const
 
int comparePosition (int idx0, int idx1, int dim) const override
 
const floatgetP (int idx) const override
 Return the position associated with the given point. More...
 
- Public Member Functions inherited from UT_KDTree
 UT_KDTree (int dim=3, size_t size=0)
 
virtual ~UT_KDTree ()
 
virtual void buildIfNeeded (bool enable_multithreading=true)
 This must be called before querying, to build and balance the tree. More...
 
int64 getMemoryUsage (bool inclusive) const
 
void setEntries (size_t size)
 
size_t getEntries () const
 
void growEntries (size_t amount)
 
size_t getRebalanceCount () const
 
void setRebalanceCount (size_t count)
 
void setBalancer (ut_KDBalancer balance)
 
void setMaxLeafNodes (int max_leaf_nodes)
 
void flagDirty ()
 
virtual bool pointsHaveRadius () const
 
virtual fpreal getRadius (int) const
 Return the radius associated with the point in question. More...
 
virtual bool isValid (int) const
 Returns whether the given index should be considered in searches. More...
 
virtual bool isValid (int idx, const UT_KDQueryPt &) const
 
virtual int getInvalidLimit (int maxn) const
 
template<typename QueryPoint >
int findClosest (const QueryPoint &pt, fpreal max_distance_squared)
 
template<typename QueryPoint >
int findClosestQueue (const QueryPoint &pt, ut_KDPQueue &queue, fpreal max_distance_squared)
 
template<typename QueryPoint >
int findClosest (UT_IntArray &list, const QueryPoint &pt, fpreal max_distance_squared, int max_nodes, bool sorted=true)
 
template<typename QueryPoint >
int findClosestQueue (UT_IntArray &list, const QueryPoint &pt, ut_KDPQueue &q, fpreal max_distance_squared, int max_nodes, bool sorted=true)
 
template<typename QueryPoint >
int findClosest (UT_IntArray &list, UT_FloatArray &dist, const QueryPoint &pt, fpreal max_distance_squared, int max_nodes, bool sorted=true)
 
template<typename QueryPoint >
int findClosestQueue (UT_IntArray &list, UT_FloatArray &dist, const QueryPoint &pt, ut_KDPQueue &q, fpreal max_distance_squared, int max_nodes, bool sorted=true)
 
template<typename QueryPoint >
int findNClosest (UT_IntArray &list, const QueryPoint &pt, int max_nodes)
 
template<typename QueryPoint >
int findAllClosest (UT_IntArray &list, const QueryPoint &pt, fpreal max_distance_squared)
 
void traverse (Visitor &visitor)
 
void filterVolume (VolumeData &data, const UT_Vector3 &pos, const UT_Filter &filter, const AggregateVolume &aggdata, int max_nodes)
 
const fprealgetBoxMin ()
 
const fprealgetBoxMax ()
 

Additional Inherited Members

- Public Types inherited from UT_KDTree
enum  ut_KDBalancer { UT_KD_MEDIAN, UT_KD_SAH, UT_KD_CENTROID }
 KD Tree balancing algorithms. See setBalancer. More...
 
- Static Public Member Functions inherited from UT_KDTree
static ut_KDPQueuePtr createQueue ()
 
- Protected Member Functions inherited from UT_KDTree
int getHead () const
 
bool isValid (int node, const UT_KDTubeQuery &) const
 
bool isValid (int node, const UT_KDLineQuery &) const
 
bool isValid (int node, const UT_KDTriQuery &) const
 
bool isValid (int node, const UT_KDTetQuery &) const
 
bool isValid (int node, const UT_KDQueryPtUnitWrap &) const
 
template<typename QueryPoint >
int findClosest (ut_KDPQueue &list, const QueryPoint &pt)
 
template<typename QueryPoint >
void recurseFind (ut_KDPQueue &list, const QueryPoint &pt, int split, int lo, int hi) const
 
template<typename QueryPoint >
void recurseFindTube (ut_KDPQueue &list, const QueryPoint &pt, int split, int lo, int hi) const
 
template<typename QueryPoint >
void recurseFindTri (ut_KDPQueue &list, const QueryPoint &pt, int split, int lo, int hi) const
 
template<typename QueryPoint >
void findInLeaf (ut_KDPQueue &list, const QueryPoint &pt, int lo, int hi, int invalid_limit, int &invalid) const
 
bool isBalanced () const
 
void traverseRecursive (Visitor &visitor, int split, int nodeid, UT_BoundingBox &box, int lo, int hi)
 
void computeBox (int start_index=0)
 
bool isBoxClose (const fpreal *P, fpreal qd, fpreal r) const
 
void balance (bool enable_multithreading=true)
 
void balanceSet (int &split, fpreal &radius, int *list, int entries, fpreal *boxmin, fpreal *boxmax, UT_Lock *splitlock)
 
- Protected Attributes inherited from UT_KDTree
fpreal myBMin [UT_KD_MAXDIM]
 
fpreal myBMax [UT_KD_MAXDIM]
 
intmyList
 
UT_Array< KDSplitmySplits
 
UT_Lock myLock
 For protecting tree balancing and bounding box computation. More...
 
size_t myEntries
 This marks the number of entries that have been added to our tree. More...
 
size_t myFullEntries
 
size_t myRebalanceCount
 
int myDim
 
int myMaxLeafNodes
 
bool myBalanced
 
bool myBoxComputed
 
bool myHasRadius
 A faster way to evaluate pointsHaveRadius() at runtime. More...
 
ut_KDBalancer myBalancer
 

Detailed Description

Definition at line 14 of file GU_Sort.h.

Constructor & Destructor Documentation

GU_SortKDTree::GU_SortKDTree ( size_t  size)
inline

Definition at line 16 of file GU_Sort.h.

Member Function Documentation

int GU_SortKDTree::comparePosition ( int  idx0,
int  idx1,
int  dim 
) const
inlineoverridevirtual

The compare function should compare the distance between two points (given by idx0 and idx1) in the dimension specified. The dimension will be between 0 and 3. For example, comparePosition(...) { fpreal delta = myP[idx0](dim) - myP[idx1](dim); return delta < 0 ? -1 : (delta > 0 ? 1 : 0); }

Implements UT_KDTree.

Definition at line 29 of file GU_Sort.h.

const int* GU_SortKDTree::getIndices ( ) const
inline

Definition at line 27 of file GU_Sort.h.

const float* GU_SortKDTree::getP ( int  idx) const
inlineoverridevirtual

Return the position associated with the given point.

Implements UT_KDTree.

Definition at line 33 of file GU_Sort.h.

void GU_SortKDTree::setPos ( int  idx,
const UT_Vector3 pos 
)
inline

Definition at line 25 of file GU_Sort.h.


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