15 #ifndef __UT_LineTree_h__
16 #define __UT_LineTree_h__
43 int size()
const {
return myLineList.size(); }
49 myLineList.setCapacity(capacity);
65 int findNearestLineSegment(
const UT_Vector3 &pt,
float *dist2 = NULL )
const;
70 unsigned findKNearestLineSegments(
const UT_Vector3 &pt,
74 float max_dist2)
const;
76 unsigned findKNearestLineSegments(
const UT_Vector3 &pt,
79 unsigned max_lines )
const;
84 { myRequestedThreshold = threshold; }
92 { myLineList(
id).reverse(); }
98 void dumpTree(
bool verbose =
true)
const;
106 myIDir = 1.0F / (myP2 - myP1);
113 myIDir = 1.0F / (myP2 - myP1);
126 , myLineList(list) {}
127 bool operator()(
int idx)
const
129 return myBox.isLineInside(myLineList(idx).myP1,
130 myLineList(idx).myIDir);
138 int *lines,
int nlines,
int depth);
139 void dumpTree(
const utLineTreeNode *node,
141 unsigned &num_octnodes,
142 unsigned &num_leafnodes,
143 double &num_leaflines,
145 unsigned depth = 0)
const;
147 void getKClosestLine(
148 const utLeafNode *tree,
154 float in_max_dist2)
const;
159 unsigned myRequestedThreshold;
160 unsigned myThreshold;
163 #endif // __UT_LineTree_h__
void setCapacity(unsigned capacity)
void reverse(I begin, I end)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
void requestThreshold(unsigned threshold)
GLint GLint GLsizei GLsizei GLsizei depth
UT_UniquePtr< utLineTreeNode > utLineTreeNodePtr
const UT_Vector3 & linePos1(int id) const
LeafData & operator=(const LeafData &)=delete
const UT_Vector3 & linePos2(int id) const