dynamicTreeDataPoint Class Reference

Holds (reference to) pointField. Encapsulation of data needed for octree searches. Used for searching for nearest point. No bounding boxes around points. Only overlaps and calcNearest are implemented, rest makes little sense. More...

Public Member Functions

 ClassName ("dynamicTreeDataPoint")
 
 dynamicTreeDataPoint (const DynamicList< point > &points)
 Construct from List. Holds reference! More...
 
label size () const
 
const DynamicList< point > & shapePoints () const
 Get representative point cloud for all shapes inside. More...
 
volumeType getVolumeType (const dynamicIndexedOctree< dynamicTreeDataPoint > &, const point &) const
 Get type (inside,outside,mixed,unknown) of point w.r.t. surface. More...
 
bool overlaps (const label index, const treeBoundBox &sampleBb) const
 Does (bb of) shape at index overlap bb. More...
 
bool overlaps (const label index, const point &centre, const scalar radiusSqr) const
 Check if any point on shape is inside sphere. More...
 
void findNearest (const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
 Calculates nearest (to sample) point in shape. More...
 
void findNearest (const labelUList &indices, const linePointRef &ln, treeBoundBox &tightest, label &minIndex, point &linePoint, point &nearestPoint) const
 Calculates nearest (to line) point in shape. More...
 
bool intersects (const label index, const point &start, const point &end, point &result) const
 Calculate intersection of shape with ray. Sets result. More...
 

Detailed Description

Holds (reference to) pointField. Encapsulation of data needed for octree searches. Used for searching for nearest point. No bounding boxes around points. Only overlaps and calcNearest are implemented, rest makes little sense.

Optionally works on subset of points.

Source files

Definition at line 61 of file dynamicTreeDataPoint.H.

Constructor & Destructor Documentation

◆ dynamicTreeDataPoint()

dynamicTreeDataPoint ( const DynamicList< point > &  points)

Construct from List. Holds reference!

Definition at line 42 of file dynamicTreeDataPoint.C.

Member Function Documentation

◆ ClassName()

ClassName ( "dynamicTreeDataPoint"  )

◆ size()

label size ( ) const
inline

Definition at line 83 of file dynamicTreeDataPoint.H.

References UList< T >::size().

Here is the call graph for this function:

◆ shapePoints()

const Foam::DynamicList< Foam::point > & shapePoints ( ) const

Get representative point cloud for all shapes inside.

(one point per shape)

Definition at line 54 of file dynamicTreeDataPoint.C.

◆ getVolumeType()

Foam::volumeType getVolumeType ( const dynamicIndexedOctree< dynamicTreeDataPoint > &  oc,
const point sample 
) const

Get type (inside,outside,mixed,unknown) of point w.r.t. surface.

Only makes sense for closed surfaces.

Definition at line 60 of file dynamicTreeDataPoint.C.

References volumeType::UNKNOWN.

◆ overlaps() [1/2]

bool overlaps ( const label  index,
const treeBoundBox sampleBb 
) const

Does (bb of) shape at index overlap bb.

Definition at line 70 of file dynamicTreeDataPoint.C.

References treeBoundBox::contains().

Here is the call graph for this function:

◆ overlaps() [2/2]

bool overlaps ( const label  index,
const point centre,
const scalar  radiusSqr 
) const

Check if any point on shape is inside sphere.

Definition at line 80 of file dynamicTreeDataPoint.C.

References Foam::magSqr(), and p.

Here is the call graph for this function:

◆ findNearest() [1/2]

void findNearest ( const labelUList indices,
const point sample,
scalar &  nearestDistSqr,
label &  nearestIndex,
point nearestPoint 
) const

Calculates nearest (to sample) point in shape.

Returns actual point and distance (squared)

Definition at line 100 of file dynamicTreeDataPoint.C.

References forAll, and Foam::magSqr().

Here is the call graph for this function:

◆ findNearest() [2/2]

void findNearest ( const labelUList indices,
const linePointRef ln,
treeBoundBox tightest,
label &  minIndex,
point linePoint,
point nearestPoint 
) const

Calculates nearest (to line) point in shape.

Returns point and distance (squared)

Definition at line 128 of file dynamicTreeDataPoint.C.

References treeBoundBox::contains(), PointHit< PointType >::distance(), forAll, Foam::ln(), Foam::magSqr(), boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), PointHit< PointType >::rawPoint(), Foam::sqr(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ intersects()

bool intersects ( const label  index,
const point start,
const point end,
point result 
) const
inline

Calculate intersection of shape with ray. Sets result.

accordingly

Definition at line 145 of file dynamicTreeDataPoint.H.


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