Go to the documentation of this file.
43 int main(
int argc,
char *argv[])
55 Info<<
"Creating indexed octrees with " << size
56 <<
" points in bounding box: " << overallBb <<
endl;
64 for (
label pI = size - 1; pI >= 0; --pI)
66 scalar factor = pI/scalar(size);
69 pointFieldList[pI] = 0.99*
point(factor, factor, factor);
72 for (
label i=0; i<5; ++i)
75 pointFieldList.append(
point(0.95, 0.95,0.95));
78 Info<<
"Time to construct lists of points: "
93 Info<<
"Time to construct dynamic tree: "
105 Info<<
"Time to construct normal tree: "
108 Info<<
"Statistics of the dynamic tree:" <<
endl;
116 Info<<
"Nearest point to " <<
p <<
" = "
119 for (
label i = 0; i < size; ++i)
123 point(scalar(i)/size, scalar(i)/size, scalar(i)/size),
128 Info<<
"Time to perform " << size
129 <<
" findNearest() calls on the dynamic tree: "
132 for (
label i = 0; i < size; ++i)
136 point(scalar(i)/size, scalar(i)/size, scalar(i)/size),
141 Info<<
"Time to perform " << size
142 <<
" findNearest() calls on the normal tree: "
151 Info<<
nl <<
"Inserting point " <<
p <<
" with index " << index <<
endl;
156 Info<<
"Nearest point to " <<
p <<
" = "
162 Info<<
"Inserting same point " <<
p <<
" with index " << index <<
endl;
166 Info<<
"Nearest point to " <<
p <<
" = "
176 for (
label pI = size - 5; pI >= 5; pI--)
182 Info<<
"Time to remove " << nRemoved <<
" points from the tree: "
188 Info<<
"Nearest point to " <<
p <<
" = "
Starts timing CPU usage and return elapsed time from start.
int main(int argc, char *argv[])
bool insert(label startIndex, label endIndex)
Insert a new object into the tree.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Standard boundBox + extra functionality for use in octree.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Holds (reference to) pointField. Encapsulation of data needed for octree searches....
Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted.
Holds (reference to) pointField. Encapsulation of data needed for octree searches....
bool remove(const label index)
Remove an object from the tree.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
void append(const T &)
Append an element at the end of the list.
Non-pointer based hierarchical recursive searching.
void writeTreeInfo() const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Implements a timeout mechanism via sigalarm.
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint, const FindNearestOp &fnOp) const
Find nearest point to line.
void size(const label)
Override size to be inconsistent with allocated storage.
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint) const
Find nearest point to line.
List< point > pointList
A List of points.
vector point
Point is a vector.