Data Structures | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
dynamicIndexedOctree Class Reference

Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted. More...

Collaboration diagram for dynamicIndexedOctree:
Collaboration graph
[legend]

Data Structures

class  node
 Tree node. Has up pointer and down pointers. More...
 

Public Member Functions

 dynamicIndexedOctree (const Type &shapes, const treeBoundBox &bb, const label maxLevels, const scalar maxLeafRatio, const scalar maxDuplicity)
 Construct from shapes. More...
 
autoPtr< dynamicIndexedOctree< Type > > clone () const
 Clone. More...
 
const Type & shapes () const
 Reference to shape. More...
 
const List< node > & nodes () const
 List of all nodes. More...
 
const contentListListcontents () const
 List of all contents (referenced by those nodes that are. More...
 
const treeBoundBoxbb () const
 Top bounding box. More...
 
pointIndexHit findNearest (const point &sample, const scalar nearestDistSqr) const
 Calculate nearest point on nearest shape. More...
 
void findNearest (const label nodeI, const point &, scalar &nearestDistSqr, label &nearestShapeI, point &nearestPoint) const
 Low level: calculate nearest starting from subnode. More...
 
pointIndexHit findNearest (const linePointRef &ln, treeBoundBox &tightest, point &linePoint) const
 Find nearest to line. More...
 
pointIndexHit findLine (const point &start, const point &end) const
 Find nearest intersection of line between start and end. More...
 
pointIndexHit findLineAny (const point &start, const point &end) const
 Find any intersection of line between start and end. More...
 
labelList findBox (const treeBoundBox &bb) const
 Find (in no particular order) indices of all shapes inside or. More...
 
labelList findSphere (const point &centre, const scalar radiusSqr) const
 Find (in no particular order) indices of all shapes inside or. More...
 
labelBits findNode (const label nodeI, const point &) const
 Find deepest node (as parent+octant) containing point. Starts. More...
 
label findInside (const point &) const
 Find shape containing point. Only implemented for certain. More...
 
const labelListfindIndices (const point &) const
 Find the shape indices that occupy the result of findNode. More...
 
volumeType getVolumeType (const point &) const
 Determine type (inside/outside/mixed) for point. unknown if. More...
 
template<class CompareOp >
void findNear (const scalar nearDist, const dynamicIndexedOctree< Type > &tree2, CompareOp &cop) const
 Find near pairs and apply CompareOp to them. More...
 
bool insert (label startIndex, label endIndex)
 Insert a new object into the tree. More...
 
bool insertIndex (const label nodIndex, const label index, label &nLevels)
 
bool remove (const label index)
 Remove an object from the tree. More...
 
label removeIndex (const label nodIndex, const label index)
 
void print (prefixOSstream &, const bool printContents, const label) const
 Print tree. Either print all indices (printContent = true) or. More...
 
bool write (Ostream &os) const
 
void writeTreeInfo () const
 

Static Public Member Functions

static scalar & perturbTol ()
 Get the perturbation tolerance. More...
 
static bool isContent (const labelBits i)
 
static bool isEmpty (const labelBits i)
 
static bool isNode (const labelBits i)
 
static label getContent (const labelBits i)
 
static label getNode (const labelBits i)
 
static direction getOctant (const labelBits i)
 
static volumeType getSide (const vector &outsideNormal, const vector &vec)
 Helper function to return the side. Returns outside if. More...
 
static bool overlaps (const point &bbMin, const point &bbMax, const scalar nearestDistSqr, const point &sample)
 Helper: does bb intersect a sphere around sample? Or is any. More...
 

Private Member Functions

void divide (const autoPtr< DynamicList< label > > &indices, const treeBoundBox &bb, contentListList &result) const
 Split list of indices into 8 bins. More...
 
node divide (const treeBoundBox &bb, const label contentI, const label parentNodeIndex, const label octantToBeDivided)
 Subdivide the contents node at position contentI. More...
 
void recursiveSubDivision (const treeBoundBox &subBb, const label contentI, const label parentIndex, const label octant, label &nLevels)
 
volumeType calcVolumeType (const label nodeI) const
 Determine inside/outside per node (mixed if cannot be. More...
 
volumeType getVolumeType (const label nodeI, const point &) const
 Search cached volume type. More...
 
void findNearest (const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint) const
 Find nearest point to line. More...
 
treeBoundBox subBbox (const label parentNodeI, const direction octant) const
 Return bbox of octant. More...
 
bool walkToParent (const label nodeI, const direction octant, label &parentNodeI, label &parentOctant) const
 Walk to parent of node+octant. More...
 
bool walkToNeighbour (const point &facePoint, const direction faceID, label &nodeI, direction &octant) const
 Walk tree to neighbouring node. Return false if edge of tree. More...
 
void traverseNode (const bool findAny, const point &treeStart, const vector &treeVec, const point &start, const point &end, const label nodeI, const direction octantI, pointIndexHit &hitInfo, direction &faceID) const
 Traverse a node. If intersects a triangle return first. More...
 
pointIndexHit findLine (const bool findAny, const point &treeStart, const point &treeEnd, const label startNodeI, const direction startOctantI, const bool verbose=false) const
 Find any or nearest intersection. More...
 
pointIndexHit findLine (const bool findAny, const point &start, const point &end) const
 Find any or nearest intersection of line between start and end. More...
 
void findBox (const label nodeI, const treeBoundBox &searchBox, labelHashSet &elements) const
 Find all elements intersecting box. More...
 
void findSphere (const label nodeI, const point &centre, const scalar radiusSqr, labelHashSet &elements) const
 Find all elements intersecting sphere. More...
 
label countElements (const labelBits index) const
 Count number of elements on this and sublevels. More...
 
void writeOBJ (const label nodeI, const direction octant) const
 Dump node+octant to an obj file. More...
 

Static Private Member Functions

static bool overlaps (const treeBoundBox &parentBb, const direction octant, const scalar nearestDistSqr, const point &sample)
 Helper: does bb intersect a sphere around sample? Or is any. More...
 
static point pushPoint (const treeBoundBox &, const point &, const bool pushInside)
 Helper: take a point on/close to face of bb and push it. More...
 
static point pushPoint (const treeBoundBox &, const direction, const point &, const bool pushInside)
 Helper: take a point on face of bb and push it. More...
 
static point pushPointIntoFace (const treeBoundBox &bb, const vector &dir, const point &pt)
 Helper: take point on face(s) of bb and push it away from. More...
 
static word faceString (const direction faceID)
 Debug: return verbose the bounding box faces. More...
 
template<class CompareOp >
static void findNear (const scalar nearDist, const bool okOrder, const dynamicIndexedOctree< Type > &tree1, const labelBits index1, const treeBoundBox &bb1, const dynamicIndexedOctree< Type > &tree2, const labelBits index2, const treeBoundBox &bb2, CompareOp &cop)
 
static labelBits contentPlusOctant (const label i, const direction octant)
 From index into contents_ to subNodes_ entry. More...
 
static labelBits nodePlusOctant (const label i, const direction octant)
 From index into nodes_ to subNodes_ entry. More...
 
static labelBits emptyPlusOctant (const direction octant)
 From empty to subNodes_ entry. More...
 

Private Attributes

const Type shapes_
 Underlying shapes for geometric queries. More...
 
const treeBoundBox bb_
 
const label maxLevels_
 
label nLevelsMax_
 Current number of levels in the tree. More...
 
const scalar maxLeafRatio_
 
const label minSize_
 
const scalar maxDuplicity_
 
DynamicList< nodenodes_
 List of all nodes. More...
 
contentListList contents_
 List of all contents (referenced by those nodes that are contents) More...
 
PackedList< 2 > nodeTypes_
 Per node per octant whether is fully inside/outside/mixed. More...
 

Static Private Attributes

static scalar perturbTol_ = 10*SMALL
 Relative peturbation tolerance. Determines when point is. More...
 

Friends

Ostreamoperator (Ostream &, const dynamicIndexedOctree< Type > &)
 

Detailed Description

Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted.

Source files

Definition at line 55 of file dynamicIndexedOctree.H.

Constructor & Destructor Documentation

◆ dynamicIndexedOctree()

dynamicIndexedOctree ( const Type &  shapes,
const treeBoundBox bb,
const label  maxLevels,
const scalar  maxLeafRatio,
const scalar  maxDuplicity 
)

Construct from shapes.

Definition at line 2309 of file dynamicIndexedOctree.C.

References insert().

Here is the call graph for this function:

Member Function Documentation

◆ overlaps() [1/2]

bool overlaps ( const treeBoundBox parentBb,
const direction  octant,
const scalar  nearestDistSqr,
const point sample 
)
staticprivate

Helper: does bb intersect a sphere around sample? Or is any.

corner point of bb closer than nearestDistSqr to sample. (bb is implicitly provided as parent bb + octant)

Accelerated version of

treeBoundBox subBb(parentBb.subBbox(mid, octant)) overlaps ( subBb.min(), subBb.max(), nearestDistSqr, sample )

Definition at line 87 of file dynamicIndexedOctree.C.

References boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ divide() [1/2]

void divide ( const autoPtr< DynamicList< label > > &  indices,
const treeBoundBox bb,
contentListList result 
) const
private

Split list of indices into 8 bins.

according to where they are in relation to mid.

Definition at line 150 of file dynamicIndexedOctree.C.

References DynamicList::append(), forAll, and treeBoundBox::subBbox().

Here is the call graph for this function:

◆ divide() [2/2]

Foam::dynamicIndexedOctree< Type >::node divide ( const treeBoundBox bb,
const label  contentI,
const label  parentNodeIndex,
const label  octantToBeDivided 
)
private

Subdivide the contents node at position contentI.

Appends to contents.

Definition at line 193 of file dynamicIndexedOctree.C.

References Foam::abort(), dynamicIndexedOctree::node::bb_, Foam::diag(), Foam::divide(), Foam::FatalError, FatalErrorInFunction, Foam::mag(), boundBox::max(), Foam::max(), boundBox::min(), dynamicIndexedOctree::node::parent_, and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ recursiveSubDivision()

void recursiveSubDivision ( const treeBoundBox subBb,
const label  contentI,
const label  parentIndex,
const label  octant,
label nLevels 
)
private

Definition at line 288 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::bb_, Foam::divide(), treeBoundBox::subBbox(), and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ calcVolumeType()

Foam::volumeType calcVolumeType ( const label  nodeI) const
private

Determine inside/outside per node (mixed if cannot be.

determined). Only valid for closed shapes.

Definition at line 341 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::bb_, boundBox::midpoint(), treeBoundBox::subBbox(), and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ getVolumeType() [1/2]

volumeType getVolumeType ( const label  nodeI,
const point  
) const
private

Search cached volume type.

◆ findNearest() [1/4]

void findNearest ( const label  nodeI,
const linePointRef ln,
treeBoundBox tightest,
label nearestShapeI,
point linePoint,
point nearestPoint 
) const
private

Find nearest point to line.

Definition at line 563 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::bb_, Foam::ln(), treeBoundBox::overlaps(), treeBoundBox::searchOrder(), treeBoundBox::subBbox(), and dynamicIndexedOctree::node::subNodes_.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subBbox()

Foam::treeBoundBox subBbox ( const label  parentNodeI,
const direction  octant 
) const
private

Return bbox of octant.

Definition at line 629 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::bb_, treeBoundBox::subBbox(), and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ pushPoint() [1/2]

static point pushPoint ( const treeBoundBox ,
const point ,
const bool  pushInside 
)
staticprivate

Helper: take a point on/close to face of bb and push it.

inside or outside of bb.

◆ pushPoint() [2/2]

static point pushPoint ( const treeBoundBox ,
const  direction,
const point ,
const bool  pushInside 
)
staticprivate

Helper: take a point on face of bb and push it.

inside or outside of bb.

◆ pushPointIntoFace()

Foam::point pushPointIntoFace ( const treeBoundBox bb,
const vector dir,
const point pt 
)
staticprivate

Helper: take point on face(s) of bb and push it away from.

edges of face.

Definition at line 839 of file dynamicIndexedOctree.C.

References Foam::abort(), Foam::endl(), treeBoundBox::faceBits(), Foam::facePoint(), Foam::FatalError, FatalErrorInFunction, Foam::mag(), boundBox::max(), boundBox::min(), treeBoundBox::posBits(), s(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ walkToParent()

bool walkToParent ( const label  nodeI,
const direction  octant,
label parentNodeI,
label parentOctant 
) const
private

Walk to parent of node+octant.

Definition at line 1195 of file dynamicIndexedOctree.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ walkToNeighbour()

bool walkToNeighbour ( const point facePoint,
const direction  faceID,
label nodeI,
direction octant 
) const
private

Walk tree to neighbouring node. Return false if edge of tree.

hit.

Definition at line 1245 of file dynamicIndexedOctree.C.

References Foam::abort(), treeBoundBox::contains(), Foam::endl(), Foam::facePoint(), Foam::FatalError, FatalErrorInFunction, and Y.

Here is the call graph for this function:

◆ faceString()

Foam::word faceString ( const direction  faceID)
staticprivate

Debug: return verbose the bounding box faces.

Definition at line 1483 of file dynamicIndexedOctree.C.

◆ traverseNode()

void traverseNode ( const bool  findAny,
const point treeStart,
const vector treeVec,
const point start,
const point end,
const label  nodeI,
const direction  octantI,
pointIndexHit hitInfo,
direction faceID 
) const
private

Traverse a node. If intersects a triangle return first.

intersection point. findAny=true : return any intersection findAny=false: return nearest (to start) intersection

Definition at line 1535 of file dynamicIndexedOctree.C.

References Foam::abort(), treeBoundBox::contains(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, PointIndexHit< Point >::hit(), treeBoundBox::intersects(), treeBoundBox::posBits(), PointIndexHit< Point >::setHit(), PointIndexHit< Point >::setIndex(), PointIndexHit< Point >::setPoint(), List::size(), and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ findLine() [1/3]

pointIndexHit findLine ( const bool  findAny,
const point treeStart,
const point treeEnd,
const label  startNodeI,
const direction  startOctantI,
const bool  verbose = false 
) const
private

Find any or nearest intersection.

◆ findLine() [2/3]

Foam::pointIndexHit findLine ( const bool  findAny,
const point start,
const point end 
) const
private

Find any or nearest intersection of line between start and end.

Definition at line 1886 of file dynamicIndexedOctree.C.

References treeBoundBox::intersects(), and treeBoundBox::posBits().

Here is the call graph for this function:

◆ findBox() [1/2]

void findBox ( const label  nodeI,
const treeBoundBox searchBox,
labelHashSet elements 
) const
private

Find all elements intersecting box.

Definition at line 1957 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::bb_, forAll, HashSet< Key, Hash >::insert(), treeBoundBox::overlaps(), treeBoundBox::subBbox(), and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ findSphere() [1/2]

void findSphere ( const label  nodeI,
const point centre,
const scalar  radiusSqr,
labelHashSet elements 
) const
private

Find all elements intersecting sphere.

Definition at line 2004 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::bb_, forAll, HashSet< Key, Hash >::insert(), treeBoundBox::overlaps(), treeBoundBox::subBbox(), and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ findNear() [1/2]

void findNear ( const scalar  nearDist,
const bool  okOrder,
const dynamicIndexedOctree< Type > &  tree1,
const labelBits  index1,
const treeBoundBox bb1,
const dynamicIndexedOctree< Type > &  tree2,
const labelBits  index2,
const treeBoundBox bb2,
CompareOp &  cop 
)
staticprivate

◆ countElements()

Foam::label countElements ( const labelBits  index) const
private

Count number of elements on this and sublevels.

Definition at line 2227 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::subNodes_.

◆ writeOBJ()

void writeOBJ ( const label  nodeI,
const direction  octant 
) const
private

◆ contentPlusOctant()

static labelBits contentPlusOctant ( const label  i,
const direction  octant 
)
inlinestaticprivate

From index into contents_ to subNodes_ entry.

Definition at line 390 of file dynamicIndexedOctree.H.

◆ nodePlusOctant()

static labelBits nodePlusOctant ( const label  i,
const direction  octant 
)
inlinestaticprivate

From index into nodes_ to subNodes_ entry.

Definition at line 400 of file dynamicIndexedOctree.H.

◆ emptyPlusOctant()

static labelBits emptyPlusOctant ( const direction  octant)
inlinestaticprivate

From empty to subNodes_ entry.

Definition at line 410 of file dynamicIndexedOctree.H.

◆ perturbTol()

Foam::scalar & perturbTol ( )
static

Get the perturbation tolerance.

Definition at line 2345 of file dynamicIndexedOctree.C.

◆ clone()

autoPtr<dynamicIndexedOctree<Type> > clone ( ) const
inline

Clone.

Definition at line 437 of file dynamicIndexedOctree.H.

◆ shapes()

const Type& shapes ( ) const
inline

Reference to shape.

Definition at line 451 of file dynamicIndexedOctree.H.

References dynamicIndexedOctree::shapes_.

Referenced by dynamicIndexedOctree::findNear().

Here is the caller graph for this function:

◆ nodes()

const List<node>& nodes ( ) const
inline

List of all nodes.

Definition at line 457 of file dynamicIndexedOctree.H.

References dynamicIndexedOctree::nodes_.

Referenced by dynamicIndexedOctree::findNear().

Here is the caller graph for this function:

◆ contents()

const contentListList& contents ( ) const
inline

List of all contents (referenced by those nodes that are.

contents)

Definition at line 464 of file dynamicIndexedOctree.H.

Referenced by dynamicIndexedOctree::findNear().

Here is the caller graph for this function:

◆ bb()

const treeBoundBox& bb ( ) const
inline

Top bounding box.

Definition at line 470 of file dynamicIndexedOctree.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and dynamicIndexedOctree::nodes_.

Referenced by dynamicIndexedOctree::findNear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isContent()

static bool isContent ( const labelBits  i)
inlinestatic

Definition at line 483 of file dynamicIndexedOctree.H.

References labelBits::val().

Referenced by dynamicIndexedOctree::findNear(), and dynamicIndexedOctree::getContent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

static bool isEmpty ( const labelBits  i)
inlinestatic

Definition at line 488 of file dynamicIndexedOctree.H.

References labelBits::val().

Here is the call graph for this function:

◆ isNode()

static bool isNode ( const labelBits  i)
inlinestatic

Definition at line 493 of file dynamicIndexedOctree.H.

References labelBits::val().

Referenced by dynamicIndexedOctree::findNear(), and dynamicIndexedOctree::getNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContent()

static label getContent ( const labelBits  i)
inlinestatic

Definition at line 498 of file dynamicIndexedOctree.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, dynamicIndexedOctree::isContent(), and labelBits::val().

Referenced by dynamicIndexedOctree::findNear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNode()

static label getNode ( const labelBits  i)
inlinestatic

Definition at line 508 of file dynamicIndexedOctree.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, dynamicIndexedOctree::isNode(), and labelBits::val().

Referenced by dynamicIndexedOctree::findNear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOctant()

static direction getOctant ( const labelBits  i)
inlinestatic

Definition at line 518 of file dynamicIndexedOctree.H.

References labelBits::bits().

Here is the call graph for this function:

◆ findNearest() [2/4]

pointIndexHit findNearest ( const point sample,
const scalar  nearestDistSqr 
) const

Calculate nearest point on nearest shape.

Returns

  • bool : any point found nearer than nearestDistSqr
  • label: index in shapes
  • point: actual nearest point found

◆ findNearest() [3/4]

void findNearest ( const label  nodeI,
const point ,
scalar &  nearestDistSqr,
label nearestShapeI,
point nearestPoint 
) const

Low level: calculate nearest starting from subnode.

◆ findNearest() [4/4]

Foam::pointIndexHit findNearest ( const linePointRef ln,
treeBoundBox tightest,
point linePoint 
) const

Find nearest to line.

Returns

  • bool : any point found?
  • label: index in shapes
  • point: actual nearest point found sets:
  • linePoint : corresponding nearest point on line

Definition at line 2381 of file dynamicIndexedOctree.C.

References Foam::ln().

Here is the call graph for this function:

◆ findLine() [3/3]

Foam::pointIndexHit findLine ( const point start,
const point end 
) const

Find nearest intersection of line between start and end.

Definition at line 2415 of file dynamicIndexedOctree.C.

◆ findLineAny()

Foam::pointIndexHit findLineAny ( const point start,
const point end 
) const

Find any intersection of line between start and end.

Definition at line 2427 of file dynamicIndexedOctree.C.

◆ findBox() [2/2]

labelList findBox ( const treeBoundBox bb) const

Find (in no particular order) indices of all shapes inside or.

overlapping bounding box (i.e. all shapes not outside box)

◆ findSphere() [2/2]

Foam::labelList findSphere ( const point centre,
const scalar  radiusSqr 
) const

Find (in no particular order) indices of all shapes inside or.

overlapping a bounding sphere (i.e. all shapes not outside sphere)

Definition at line 2456 of file dynamicIndexedOctree.C.

References HashTable::toc().

Here is the call graph for this function:

◆ findNode()

Foam::labelBits findNode ( const label  nodeI,
const point sample 
) const

Find deepest node (as parent+octant) containing point. Starts.

off from starting index in nodes_ (use 0 to start from top) Use getNode and getOctant to extract info, or call findIndices.

Definition at line 2476 of file dynamicIndexedOctree.C.

References Foam::abort(), dynamicIndexedOctree::node::bb_, treeBoundBox::contains(), Foam::FatalError, FatalErrorInFunction, dynamicIndexedOctree::node::subNodes_, and treeBoundBox::subOctant().

Here is the call graph for this function:

◆ findInside()

Foam::label findInside ( const point sample) const

Find shape containing point. Only implemented for certain.

shapes.

Definition at line 2523 of file dynamicIndexedOctree.C.

References forAll, and dynamicIndexedOctree::node::subNodes_.

◆ findIndices()

const Foam::labelList & findIndices ( const point sample) const

Find the shape indices that occupy the result of findNode.

Definition at line 2555 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::subNodes_.

◆ getVolumeType() [2/2]

volumeType getVolumeType ( const point ) const

Determine type (inside/outside/mixed) for point. unknown if.

cannot be determined (e.g. non-manifold surface)

◆ getSide()

Foam::volumeType getSide ( const vector outsideNormal,
const vector vec 
)
static

Helper function to return the side. Returns outside if.

outsideNormal&vec >= 0, inside otherwise

Definition at line 467 of file dynamicIndexedOctree.C.

◆ overlaps() [2/2]

static bool overlaps ( const point bbMin,
const point bbMax,
const scalar  nearestDistSqr,
const point sample 
)
static

Helper: does bb intersect a sphere around sample? Or is any.

corner point of bb closer than nearestDistSqr to sample.

◆ findNear() [2/2]

void findNear ( const scalar  nearDist,
const dynamicIndexedOctree< Type > &  tree2,
CompareOp &  cop 
) const

Find near pairs and apply CompareOp to them.

tree2 can be *this or different tree.

Definition at line 2650 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::bb().

Here is the call graph for this function:

◆ insert()

bool insert ( label  startIndex,
label  endIndex 
)

Insert a new object into the tree.

Definition at line 2672 of file dynamicIndexedOctree.C.

References Foam::divide(), Foam::max(), and success.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertIndex()

bool insertIndex ( const label  nodIndex,
const label  index,
label nLevels 
)

Definition at line 2719 of file dynamicIndexedOctree.C.

References treeBoundBox::subBbox().

Here is the call graph for this function:

◆ remove()

bool remove ( const label  index)

Remove an object from the tree.

Definition at line 2795 of file dynamicIndexedOctree.C.

Referenced by main().

Here is the caller graph for this function:

◆ removeIndex()

Foam::label removeIndex ( const label  nodIndex,
const label  index 
)

Definition at line 2810 of file dynamicIndexedOctree.C.

References DynamicList::append(), forAll, treeBoundBox::subBbox(), and DynamicList::transfer().

Here is the call graph for this function:

◆ print()

void print ( prefixOSstream os,
const bool  printContents,
const label  nodeI 
) const

Print tree. Either print all indices (printContent = true) or.

just size of contents nodes.

Definition at line 2894 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::node::bb_, Foam::endl(), forAll, Foam::nl, dynamicIndexedOctree::node::parent_, prefixOSstream::prefix(), print(), List::size(), treeBoundBox::subBbox(), dynamicIndexedOctree::node::subNodes_, and writeOBJ().

Here is the call graph for this function:

◆ write()

bool write ( Ostream os) const

Definition at line 2993 of file dynamicIndexedOctree.C.

References IOstream::good().

Here is the call graph for this function:

◆ writeTreeInfo()

void writeTreeInfo ( ) const

Definition at line 2966 of file dynamicIndexedOctree.C.

References Foam::endl(), forAll, Foam::nl, and Foam::Pout.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator

Ostream& operator ( Ostream ,
const dynamicIndexedOctree< Type > &   
)
friend

Field Documentation

◆ perturbTol_

Foam::scalar perturbTol_ = 10*SMALL
staticprivate

Relative peturbation tolerance. Determines when point is.

considered to be close to face/edge of bb of node. The tolerance is relative to the bounding box of the smallest node.

Definition at line 134 of file dynamicIndexedOctree.H.

◆ shapes_

const Type shapes_
private

Underlying shapes for geometric queries.

Definition at line 140 of file dynamicIndexedOctree.H.

Referenced by dynamicIndexedOctree::shapes().

◆ bb_

const treeBoundBox bb_
private

Definition at line 142 of file dynamicIndexedOctree.H.

◆ maxLevels_

const label maxLevels_
private

Definition at line 144 of file dynamicIndexedOctree.H.

◆ nLevelsMax_

label nLevelsMax_
private

Current number of levels in the tree.

Definition at line 147 of file dynamicIndexedOctree.H.

◆ maxLeafRatio_

const scalar maxLeafRatio_
private

Definition at line 149 of file dynamicIndexedOctree.H.

◆ minSize_

const label minSize_
private

Definition at line 151 of file dynamicIndexedOctree.H.

◆ maxDuplicity_

const scalar maxDuplicity_
private

Definition at line 153 of file dynamicIndexedOctree.H.

◆ nodes_

DynamicList<node> nodes_
private

List of all nodes.

Definition at line 156 of file dynamicIndexedOctree.H.

Referenced by dynamicIndexedOctree::bb(), and dynamicIndexedOctree::nodes().

◆ contents_

contentListList contents_
private

List of all contents (referenced by those nodes that are contents)

Definition at line 159 of file dynamicIndexedOctree.H.

◆ nodeTypes_

PackedList<2> nodeTypes_
mutableprivate

Per node per octant whether is fully inside/outside/mixed.

Definition at line 162 of file dynamicIndexedOctree.H.


The documentation for this class was generated from the following files: