36 #ifndef dynamicIndexedOctree_H 37 #define dynamicIndexedOctree_H 58 template<
class Type>
Ostream&
operator<<
81 public dynamicIndexedOctreeName
135 static scalar perturbTol_;
145 const label maxLevels_;
150 const scalar maxLeafRatio_;
152 const label minSize_;
154 const scalar maxDuplicity_;
160 contentListList contents_;
174 const scalar nearestDistSqr,
186 contentListList& result
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,
412 const label maxLevels,
413 const scalar maxLeafRatio,
414 const scalar maxDuplicity
433 const Type&
shapes()
const 446 const contentListList&
contents()
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,
629 bool remove(
const label index);
641 const bool printContents,
645 bool write(Ostream& os)
const;
652 friend Ostream& operator<< <Type>
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
TemplateName(blendedSchemeBase)
const labelList & findIndices(const point &) const
Find the shape indices that occupy the result of findNode.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Tree node. Has up pointer and down pointers.
A 1D vector of objects of type <T> with a fixed size <Size>.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void print(prefixOSstream &, const bool printContents, const label) const
Print tree. Either print all indices (printContent = true) or.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
label parent_
Parent node (index into nodes_ of tree)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m K].
bool insert(label startIndex, label endIndex)
Insert a new object into the tree.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
DynamicList< autoPtr< DynamicList< label > > > contentListList
static bool isContent(const labelBits i)
FixedList< labelBits, 8 > subNodes_
IDs of the 8 nodes on all sides of the mid point.
static label getContent(const labelBits i)
label removeIndex(const label nodIndex, const label index)
static bool isEmpty(const labelBits i)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Version of OSstream which prints a prefix on each line.
friend Ostream & operator<<(Ostream &os, const node &n)
const Type & shapes() const
Reference to shape.
A class for handling words, derived from string.
void writeTreeInfo() const
Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted...
treeBoundBox bb_
Bounding box of this node.
errorManip< error > abort(error &err)
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
friend Istream & operator>>(Istream &is, node &n)
bool insertIndex(const label nodIndex, const label index, label &nLevels)
label facePoint(const int facei, const block &block, const label i, const label j)
friend bool operator==(const node &a, const node &b)
dynamicIndexedOctree(const Type &shapes, const treeBoundBox &bb, const label maxLevels, const scalar maxLeafRatio, const scalar maxDuplicity)
Construct from shapes.
const List< node > & nodes() const
List of all nodes.
static scalar & perturbTol()
Get the perturbation tolerance.
static volumeType getSide(const vector &outsideNormal, const vector &vec)
Helper function to return the side. Returns outside if.
friend bool operator!=(const node &a, const node &b)
pointIndexHit findLineAny(const point &start, const point &end) const
Find any intersection of line between start and end.
autoPtr< dynamicIndexedOctree< Type > > clone() const
Clone.
Standard boundBox + extra functionality for use in octree.
A 29bits label and 3bits direction packed into single label.
labelBits findNode(const label nodeI, const point &) const
Find deepest node (as parent+octant) containing point. Starts.
static bool isNode(const labelBits i)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const contentListList & contents() const
List of all contents (referenced by those nodes that are.
static label getNode(const labelBits i)
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
static direction getOctant(const labelBits i)
bool write(Ostream &os) const
const treeBoundBox & bb() const
Top bounding box.