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

#include <GEO_AttribFind.h>

+ Inheritance diagram for GEO_2DTree:

Public Member Functions

 GEO_2DTree (const UT_Array< UT_Vector2 > &points)
 
int findAllInsideTri (UT_IntArray &list, UT_Array< UT_Vector2 > &offs, ut_KDPQueue &q, const UT_Vector2 &a, const UT_Vector2 &b, const UT_Vector2 &c, float tolerance=1e-7f, bool wrapunitsquare=false)
 NOTE: Although this is non-const, it's safe to call from multiple threads. More...
 
void updatePoints (bool enable_multithreading=true)
 
void buildIfNeeded (bool enable_multithreading=true) override
 This must be called before querying, to build and balance the tree. More...
 
const UT_Vector2getValue (int idx) const
 
- Public Member Functions inherited from UT_KDTree
 UT_KDTree (int dim=3, size_t size=0)
 
virtual ~UT_KDTree ()
 
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 30 of file GEO_AttribFind.h.

Constructor & Destructor Documentation

GEO_2DTree::GEO_2DTree ( const UT_Array< UT_Vector2 > &  points)
inline

Definition at line 33 of file GEO_AttribFind.h.

Member Function Documentation

void GEO_2DTree::buildIfNeeded ( bool  enable_multithreading = true)
inlineoverridevirtual

This must be called before querying, to build and balance the tree.

Reimplemented from UT_KDTree.

Definition at line 62 of file GEO_AttribFind.h.

int GEO_2DTree::findAllInsideTri ( UT_IntArray list,
UT_Array< UT_Vector2 > &  offs,
ut_KDPQueue &  q,
const UT_Vector2 a,
const UT_Vector2 b,
const UT_Vector2 c,
float  tolerance = 1e-7f,
bool  wrapunitsquare = false 
)

NOTE: Although this is non-const, it's safe to call from multiple threads.

const UT_Vector2& GEO_2DTree::getValue ( int  idx) const
inline

Definition at line 66 of file GEO_AttribFind.h.

void GEO_2DTree::updatePoints ( bool  enable_multithreading = true)
inline

Definition at line 57 of file GEO_AttribFind.h.


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