35 #ifndef indexedOctree_H
36 #define indexedOctree_H
72 public indexedOctreeName
100 return is >>
n.bb_ >>
n.parent_ >>
n.subNodes_;
126 static scalar perturbTol_;
153 const scalar nearestDistSqr,
188 static label compactContents
192 const label compactLevel,
210 template<
class FindNearestOp>
216 label& nearestShapeI,
219 const FindNearestOp& fnOp
225 const label parentNodeI,
231 static point pushPoint
235 const bool pushInside
240 static point pushPoint
245 const bool pushInside
253 static point pushPointIntoFace
286 template<
class FindIntersectOp>
290 const point& treeStart,
298 const FindIntersectOp& fiOp
302 template<
class FindIntersectOp>
306 const point& treeStart,
307 const point& treeEnd,
308 const label startNodeI,
310 const FindIntersectOp& fiOp,
311 const bool verbose =
false
315 template<
class FindIntersectOp>
321 const FindIntersectOp& fiOp
337 const scalar radiusSqr,
342 template<
class CompareOp>
345 const scalar nearDist,
376 static labelBits nodePlusOctant
382 return labelBits(i + 1, octant);
386 static labelBits emptyPlusOctant
391 return labelBits(0, octant);
417 const treeBoundBox&
bb,
418 const label maxLevels,
419 const scalar maxLeafRatio,
420 const scalar maxDuplicity
442 const Type&
shapes()
const
468 return nodes_[0].bb_;
521 const scalar nearestDistSqr
529 template<
class FindNearestOp>
533 const scalar nearestDistSqr,
534 const FindNearestOp& fnOp
538 template<
class FindNearestOp>
543 scalar& nearestDistSqr,
544 label& nearestShapeI,
546 const FindNearestOp& fnOp
564 template<
class FindNearestOp>
571 const FindNearestOp& fnOp
589 template<
class FindIntersectOp>
594 const FindIntersectOp& fiOp
598 template<
class FindIntersectOp>
603 const FindIntersectOp& fiOp
616 const scalar radiusSqr
626 template<
class ... Args>
640 const vector& outsideNormal,
650 const scalar nearestDistSqr,
656 template<
class CompareOp>
659 const scalar nearDist,
672 const bool printContents,
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.
autoPtr< indexedOctree< Type > > clone() const
Clone.
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)
indexedOctree(const Type &shapes)
Construct null.
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.
const treeBoundBox & bb() const
Top bounding box.
const labelListList & contents() const
List of all contents (referenced by those nodes that are.
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.
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.
Motion of the mesh specified as a list of pointMeshMovers.
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)
label facePoint(const int facei, const block &block, const label i, const label j)
List< labelList > labelListList
A List of labelList.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
TemplateName(FvFaceCellWave)
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.