36 #ifndef dynamicIndexedOctree_H
37 #define dynamicIndexedOctree_H
58 template<
class Type>
Ostream&
operator<<
81 public dynamicIndexedOctreeName
109 return is >>
n.bb_ >>
n.parent_ >>
n.subNodes_;
135 static scalar perturbTol_;
145 const label maxLevels_;
150 const scalar maxLeafRatio_;
152 const label minSize_;
154 const scalar maxDuplicity_;
174 const scalar nearestDistSqr,
194 const label contentI,
195 const label parentNodeIndex,
196 const label octantToBeDivided
200 void recursiveSubDivision
203 const label contentI,
204 const label parentIndex,
226 label& nearestShapeI,
234 const label parentNodeI,
240 static point pushPoint
244 const bool pushInside
249 static point pushPoint
254 const bool pushInside
259 static point pushPointIntoFace
297 const point& treeStart,
313 const point& treeStart,
314 const point& treeEnd,
315 const label startNodeI,
317 const bool verbose =
false
342 const scalar radiusSqr,
347 template<
class CompareOp>
350 const scalar nearDist,
381 static labelBits nodePlusOctant
387 return labelBits(i + 1, octant);
391 static labelBits emptyPlusOctant
396 return labelBits(0, octant);
411 const treeBoundBox&
bb,
412 const label maxLevels,
413 const scalar maxLeafRatio,
414 const scalar maxDuplicity
433 const Type&
shapes()
const
459 return nodes_[0].bb_;
516 const scalar nearestDistSqr
525 scalar& nearestDistSqr,
526 label& nearestShapeI,
568 const scalar radiusSqr
591 const vector& outsideNormal,
601 const scalar nearestDistSqr,
607 template<
class CompareOp>
610 const scalar nearDist,
623 const label nodIndex,
641 const bool printContents,
652 friend Ostream& operator<< <Type>
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A 1D vector of objects of type <T> with a fixed size <Size>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
bool empty() const
Return true if the UList is empty (ie, size() is zero)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Tree node. Has up pointer and down pointers.
friend Ostream & operator<<(Ostream &os, const node &n)
FixedList< labelBits, 8 > subNodes_
IDs of the 8 nodes on all sides of the mid point.
label parent_
Parent node (index into nodes_ of tree)
friend bool operator!=(const node &a, const node &b)
friend Istream & operator>>(Istream &is, node &n)
treeBoundBox bb_
Bounding box of this node.
friend bool operator==(const node &a, const node &b)
Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted.
const Type & shapes() const
Reference to shape.
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
static bool isEmpty(const labelBits i)
const labelList & findIndices(const point &) const
Find the shape indices that occupy the result of findNode.
static label getNode(const labelBits i)
static direction getOctant(const labelBits i)
const List< node > & nodes() const
List of all nodes.
static scalar & perturbTol()
Get the perturbation tolerance.
static bool isContent(const labelBits i)
static label getContent(const labelBits i)
label removeIndex(const label nodIndex, const label index)
void print(prefixOSstream &, const bool printContents, const label) const
Print tree. Either print all indices (printContent = true) or.
static volumeType getSide(const vector &outsideNormal, const vector &vec)
Helper function to return the side. Returns outside if.
bool write(Ostream &os) const
dynamicIndexedOctree(const Type &shapes, const treeBoundBox &bb, const label maxLevels, const scalar maxLeafRatio, const scalar maxDuplicity)
Construct from shapes.
const treeBoundBox & bb() const
Top bounding box.
bool remove(const label index)
Remove an object from the tree.
bool insert(label startIndex, label endIndex)
Insert a new object into the tree.
labelBits findNode(const label nodeI, const point &) const
Find deepest node (as parent+octant) containing point. Starts.
static bool isNode(const labelBits i)
autoPtr< dynamicIndexedOctree< Type > > clone() const
Clone.
void writeTreeInfo() const
const contentListList & contents() const
List of all contents (referenced by those nodes that are.
bool insertIndex(const label nodIndex, const label index, label &nLevels)
pointIndexHit findLineAny(const point &start, const point &end) const
Find any intersection of line between start and end.
A 29bits label and 3bits direction packed into single label.
Version of OSstream which prints a prefix on each line.
Standard boundBox + extra functionality for use in octree.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
DynamicList< autoPtr< DynamicList< label > > > contentListList
label facePoint(const int facei, const block &block, const label i, const label j)
TemplateName(FvFaceCellWave)
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.