39 #ifndef Foam_dynamicIndexedOctree_H 40 #define Foam_dynamicIndexedOctree_H 54 Ostream& operator<<(Ostream&, const dynamicIndexedOctree<Type>&);
99 const label maxLevels_;
104 const scalar maxLeafRatio_;
106 const label minSize_;
108 const scalar maxDuplicity_;
139 const label parentNodeIndex,
140 const label octantToBeDivided
144 void recursiveSubDivision
147 const label contentI,
148 const label parentIndex,
155 volumeType calcVolumeType(
const label nodeI)
const;
170 label& nearestShapeI,
178 const label parentNodeI,
184 static point pushPoint
188 const bool pushInside
193 static point pushPoint
198 const bool pushInside
203 static point pushPointIntoFace
241 const point& treeStart,
257 const point& treeStart,
258 const point& treeEnd,
259 const label startNodeI,
261 const bool verbose =
false 287 const scalar radiusSqr,
292 template<
class CompareOp>
295 const scalar nearDist,
310 label countElements(
const labelBits index)
const;
318 const bool leavesOnly,
319 const bool writeLinesOnly =
false 323 void writeOBJ(
const label nodeI,
const direction octant)
const;
335 const label maxLevels,
336 const scalar maxLeafRatio,
337 const scalar maxDuplicity
372 const treeBoundBox&
bb()
const 378 return nodes_[0].bb_;
392 const scalar nearestDistSqr
401 scalar& nearestDistSqr,
402 label& nearestShapeI,
458 const scalar radiusSqr
467 const scalar radiusSqr
476 const scalar radiusSqr,
501 const vector& outsideNormal,
507 template<
class CompareOp>
510 const scalar nearDist,
519 bool insert(label startIndex, label endIndex);
523 const label nodIndex,
529 bool remove(
const label index);
531 label
removeIndex(
const label nodIndex,
const label index);
544 const bool printContents,
555 friend Ostream& operator<< <Type>
const labelList & findIndices(const point &) const
Find the shape indices that occupy the result of findNode.
indexedOctreeBase::node node
Document that we are using the same types of node.
static const treeBoundBox & null() noexcept
The null treeBoundBox is the same as an inverted box.
Template invariant parts for dynamicIndexedOctree.
A 1D vector of objects of type <T> with a fixed length <N>.
PackedList< 2 > & nodeTypes() const noexcept
Per node, per octant whether is fully inside/outside/mixed.
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)...
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
dynamicIndexedOctreeBase()=default
Default construct.
bool insert(label startIndex, label endIndex)
Insert a new object into the tree.
This class describes the interaction of an object (often a face) and a point. It carries the info of ...
ClassName("dynamicIndexedOctree")
Runtime type information.
const Type & shapes() const noexcept
Reference to shape.
An enumeration wrapper for classification of a location as being inside/outside of a volume...
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
label removeIndex(const label nodIndex, const label index)
Version of OSstream that prints a prefix on each line.
A class for handling words, derived from Foam::string.
void writeTreeInfo() const
Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted...
const DynamicList< DynamicList< label > > & contents() const noexcept
List of all contents (referenced by those nodes that are contents)
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...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
bool insertIndex(const label nodIndex, const label index, label &nLevels)
label facePoint(const int facei, const block &block, const label i, const label j)
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
OBJstream os(runTime.globalPath()/outputName)
dynamicIndexedOctree(const Type &shapes, const treeBoundBox &bb, const label maxLevels, const scalar maxLeafRatio, const scalar maxDuplicity)
Construct from shapes.
Template invariant parts for indexedOctree.
static volumeType getSide(const vector &outsideNormal, const vector &vec)
Helper function to return the side. Returns outside if.
bool overlaps(const treeBoundBox &bb) const
True if any shapes overlap the bounding box.
vector point
Point is a vector.
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 with extra functionality for use in octree.
A 29bits (or 61bits) integer label with 3bits direction (eg, octant) packed into single label...
labelBits findNode(const label nodeI, const point &) const
Find deepest node (as parent+octant) containing point. Starts.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
const List< node > & nodes() const noexcept
List of all nodes.
bool write(Ostream &os) const
Tree node. Has up pointer and down pointers.
const treeBoundBox & bb() const
Top bounding box.