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

 ClassNameNoDebug ("dynamicTreeDataPoint")
 
 dynamicTreeDataPoint (const DynamicList< point > &points)
 Construct from List. Holds reference! More...
 
int nDim () const noexcept
 Object dimension == 0 (point element) More...
 
treeBoundBox bounds (const labelUList &indices) const
 Return bounding box for the specified point indices. More...
 
const DynamicList< point > & points () const noexcept
 The original point field. More...
 
bool useSubset () const noexcept
 const labelList& pointLabels() const noexcept { labelList::null(); } More...
 
bool empty () const noexcept
 Is the effective point field empty? More...
 
label size () const noexcept
 The size of the effective point field. More...
 
label objectIndex (label index) const noexcept
 Map from shape index to original (non-subset) point label. More...
 
const pointoperator[] (label index) const
 Point at specified shape index. More...
 
const pointcentre (label index) const
 Point at specified shape index. More...
 
const DynamicList< point > & centres () const noexcept
 Representative point cloud. 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 &searchBox) 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. 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 58 of file dynamicTreeDataPoint.H.

Constructor & Destructor Documentation

◆ dynamicTreeDataPoint()

dynamicTreeDataPoint ( const DynamicList< point > &  points)
explicit

Construct from List. Holds reference!

Definition at line 36 of file dynamicTreeDataPoint.C.

Member Function Documentation

◆ ClassNameNoDebug()

ClassNameNoDebug ( "dynamicTreeDataPoint"  )

◆ nDim()

int nDim ( ) const
inlinenoexcept

Object dimension == 0 (point element)

Definition at line 87 of file dynamicTreeDataPoint.H.

◆ bounds()

Foam::treeBoundBox bounds ( const labelUList indices) const

Return bounding box for the specified point indices.

Definition at line 47 of file dynamicTreeDataPoint.C.

◆ points()

const DynamicList<point>& points ( ) const
inlinenoexcept

The original point field.

Definition at line 100 of file dynamicTreeDataPoint.H.

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

const labelList& pointLabels() const noexcept { labelList::null(); }

Use a subset of points

Definition at line 108 of file dynamicTreeDataPoint.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

Is the effective point field empty?

Definition at line 113 of file dynamicTreeDataPoint.H.

References UList< T >::empty().

Here is the call graph for this function:

◆ size()

label size ( ) const
inlinenoexcept

The size of the effective point field.

Definition at line 118 of file dynamicTreeDataPoint.H.

References UList< T >::size().

Here is the call graph for this function:

◆ objectIndex()

label objectIndex ( label  index) const
inlinenoexcept

Map from shape index to original (non-subset) point label.

Definition at line 123 of file dynamicTreeDataPoint.H.

◆ operator[]()

const point& operator[] ( label  index) const
inline

Point at specified shape index.

Definition at line 128 of file dynamicTreeDataPoint.H.

◆ centre()

const point& centre ( label  index) const
inline

Point at specified shape index.

Definition at line 133 of file dynamicTreeDataPoint.H.

◆ centres()

const DynamicList<point>& centres ( ) const
inlinenoexcept

Representative point cloud.

Definition at line 138 of file dynamicTreeDataPoint.H.

◆ 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 54 of file dynamicTreeDataPoint.C.

References volumeType::UNKNOWN.

◆ overlaps() [1/2]

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

Does (bb of) shape at index overlap bb.

Definition at line 64 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 74 of file dynamicTreeDataPoint.C.

◆ 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 85 of file dynamicTreeDataPoint.C.

◆ 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 111 of file dynamicTreeDataPoint.C.

References treeBoundBox::contains(), PointHit< PointType >::distance(), boundBox::grow(), Foam::ln(), PointHit< PointType >::point(), and Foam::sqr().

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 210 of file dynamicTreeDataPoint.H.

References NotImplemented.


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