35 #ifndef indexedOctree_H
36 #define indexedOctree_H
72 public indexedOctreeName
100 return is >>
n.bb_ >>
n.parent_ >>
n.subNodes_;
126 static scalar perturbTol_;
152 const scalar nearestDistSqr,
186 static label compactContents
190 const label compactLevel,
208 template<
class FindNearestOp>
215 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
287 template<
class FindIntersectOp>
291 const point& treeStart,
302 const FindIntersectOp& fiOp
306 template<
class FindIntersectOp>
310 const point& treeStart,
311 const point& treeEnd,
312 const label startNodeI,
314 const FindIntersectOp& fiOp,
315 const bool verbose =
false
319 template<
class FindIntersectOp>
325 const FindIntersectOp& fiOp
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);
414 const List<node>&
nodes,
422 const treeBoundBox&
bb,
423 const label maxLevels,
424 const scalar maxLeafRatio,
425 const scalar maxDuplicity
446 const Type&
shapes()
const
472 return nodes_[0].bb_;
524 const scalar nearestDistSqr
532 template<
class FindNearestOp>
536 const scalar nearestDistSqr,
538 const FindNearestOp& fnOp
542 template<
class FindNearestOp>
548 scalar& nearestDistSqr,
549 label& nearestShapeI,
552 const FindNearestOp& fnOp
569 template<
class FindNearestOp>
576 const FindNearestOp& fnOp
594 template<
class FindIntersectOp>
599 const FindIntersectOp& fiOp
603 template<
class FindIntersectOp>
608 const FindIntersectOp& fiOp
621 const scalar radiusSqr
644 const vector& outsideNormal,
654 const scalar nearestDistSqr,
660 template<
class CompareOp>
663 const scalar nearDist,
676 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.
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)
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
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)
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)
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.