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_;
175 const scalar nearestDistSqr,
196 const label contentI,
197 const label parentNodeIndex,
198 const label octantToBeDivided
202 void recursiveSubDivision
205 const label contentI,
206 const label parentIndex,
228 label& nearestShapeI,
236 const label parentNodeI,
242 static point pushPoint
246 const bool pushInside
251 static point pushPoint
256 const bool pushInside
261 static point pushPointIntoFace
298 const point& treeStart,
312 const point& treeStart,
313 const point& treeEnd,
314 const label startNodeI,
316 const bool verbose =
false
340 const scalar radiusSqr,
345 template<
class CompareOp>
348 const scalar nearDist,
379 static labelBits nodePlusOctant
385 return labelBits(i + 1, octant);
389 static labelBits emptyPlusOctant
394 return labelBits(0, octant);
409 const treeBoundBox&
bb,
410 const label maxLevels,
411 const scalar maxLeafRatio,
412 const scalar maxDuplicity
431 const Type&
shapes()
const
457 return nodes_[0].bb_;
514 const scalar nearestDistSqr
522 scalar& nearestDistSqr,
523 label& nearestShapeI,
565 const scalar radiusSqr
575 template<
class ... Args>
589 const vector& outsideNormal,
599 const scalar nearestDistSqr,
605 template<
class CompareOp>
608 const scalar nearDist,
621 const label nodIndex,
639 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.
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
Write to a stream.
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)
label findInside(const point &, const Args &...) const
Find shape containing point. Only implemented for certain.
autoPtr< dynamicIndexedOctree< Type > > clone() const
Clone.
void writeTreeInfo() const
Print information.
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.