39 #ifndef Foam_dynamicIndexedOctree_H 40 #define Foam_dynamicIndexedOctree_H 53 Ostream& operator<<(Ostream&, const dynamicIndexedOctree<Type>&);
98 const label maxLevels_;
103 const scalar maxLeafRatio_;
105 const label minSize_;
107 const scalar maxDuplicity_;
138 const label parentNodeIndex,
139 const label octantToBeDivided
143 void recursiveSubDivision
146 const label contentI,
147 const label parentIndex,
154 volumeType calcVolumeType(
const label nodeI)
const;
169 label& nearestShapeI,
177 const label parentNodeI,
183 static point pushPoint
187 const bool pushInside
192 static point pushPoint
197 const bool pushInside
202 static point pushPointIntoFace
240 const point& treeStart,
256 const point& treeStart,
257 const point& treeEnd,
258 const label startNodeI,
260 const bool verbose =
false 286 const scalar radiusSqr,
291 template<
class CompareOp>
294 const scalar nearDist,
309 label countElements(
const labelBits index)
const;
317 const bool leavesOnly,
318 const bool writeLinesOnly =
false 322 void writeOBJ(
const label nodeI,
const direction octant)
const;
334 const label maxLevels,
335 const scalar maxLeafRatio,
336 const scalar maxDuplicity
371 const treeBoundBox&
bb()
const 377 return nodes_[0].bb_;
391 const scalar nearestDistSqr
400 scalar& nearestDistSqr,
401 label& nearestShapeI,
457 const scalar radiusSqr
466 const scalar radiusSqr
475 const scalar radiusSqr,
500 const vector& outsideNormal,
506 template<
class CompareOp>
509 const scalar nearDist,
518 bool insert(label startIndex, label endIndex);
522 const label nodIndex,
528 bool remove(
const label index);
530 label
removeIndex(
const label nodIndex,
const label index);
543 const bool printContents,
554 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.
bool empty() const noexcept
True if List is empty (ie, size() is zero)
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
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...
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.