treeDataPoint 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...

Classes

class  findIntersectOp
 Forward to treeDataPoint findIntersect operations (not possible) More...
 
class  findNearestOp
 Forward to treeDataPoint findNearest operations. More...
 

Public Member Functions

 ClassNameNoDebug ("treeDataPoint")
 
 treeDataPoint (const pointField &points)
 Construct from pointField. More...
 
 treeDataPoint (const pointField &points, const labelUList &pointLabels, const bool useSubsetPoints=true)
 Construct from subset of pointField, copies point ids. More...
 
 treeDataPoint (const pointField &points, labelList &&pointLabels, const bool useSubsetPoints=true)
 Construct from subset of pointField, moves point ids. 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 pointFieldpoints () const noexcept
 The original point field. More...
 
const labelListpointLabels () const noexcept
 The subset of point ids to use. More...
 
bool useSubset () const noexcept
 Use a subset of points. 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 (const label index) const
 Map to the original (non-subset) point label. More...
 
const pointoperator[] (const label index) const
 Point at specified shape index. More...
 
const pointcentre (const label index) const
 Point at specified shape index. More...
 
tmp< pointFieldcentres () const
 Point cloud. More...
 
volumeType getVolumeType (const indexedOctree< treeDataPoint > &os, const point &sample) 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 searchBox. More...
 
bool overlaps (const label index, const point &centre, const scalar radiusSqr) const
 Does shape at index overlap the 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...
 
label pointLabel (label index) const
 Map to the original (non-subset) point label. 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 treeDataPoint.H.

Constructor & Destructor Documentation

◆ treeDataPoint() [1/3]

treeDataPoint ( const pointField points)
explicit

Construct from pointField.

Note
Holds reference to the points!

Definition at line 35 of file treeDataPoint.C.

◆ treeDataPoint() [2/3]

treeDataPoint ( const pointField points,
const labelUList pointLabels,
const bool  useSubsetPoints = true 
)

Construct from subset of pointField, copies point ids.

Note
Holds reference to the points!

Definition at line 43 of file treeDataPoint.C.

◆ treeDataPoint() [3/3]

treeDataPoint ( const pointField points,
labelList &&  pointLabels,
const bool  useSubsetPoints = true 
)

Construct from subset of pointField, moves point ids.

Note
Holds reference to the points!

Definition at line 56 of file treeDataPoint.C.

Member Function Documentation

◆ ClassNameNoDebug()

ClassNameNoDebug ( "treeDataPoint"  )

◆ nDim()

int nDim ( ) const
inlinenoexcept

Object dimension == 0 (point element)

Definition at line 181 of file treeDataPoint.H.

◆ bounds()

Foam::treeBoundBox bounds ( const labelUList indices) const

Return bounding box for the specified point indices.

Definition at line 70 of file treeDataPoint.C.

References boundBox::add().

Here is the call graph for this function:

◆ points()

const pointField& points ( ) const
inlinenoexcept

The original point field.

Definition at line 194 of file treeDataPoint.H.

◆ pointLabels()

const labelList& pointLabels ( ) const
inlinenoexcept

The subset of point ids to use.

Definition at line 199 of file treeDataPoint.H.

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

Use a subset of points.

Definition at line 204 of file treeDataPoint.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

Is the effective point field empty?

Definition at line 209 of file treeDataPoint.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 217 of file treeDataPoint.H.

References UList< T >::size().

Here is the call graph for this function:

◆ objectIndex()

label objectIndex ( const label  index) const
inline

Map to the original (non-subset) point label.

Definition at line 225 of file treeDataPoint.H.

Referenced by treeDataPoint::centre(), treeDataPoint::operator[](), and treeDataPoint::pointLabel().

Here is the caller graph for this function:

◆ operator[]()

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

Point at specified shape index.

Definition at line 233 of file treeDataPoint.H.

References treeDataPoint::objectIndex().

Here is the call graph for this function:

◆ centre()

const point& centre ( const label  index) const
inline

Point at specified shape index.

Definition at line 241 of file treeDataPoint.H.

References treeDataPoint::objectIndex().

Referenced by treeDataPoint::findNearestOp::operator()().

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

◆ centres()

Foam::tmp< Foam::pointField > centres ( ) const

Point cloud.

Definition at line 86 of file treeDataPoint.C.

References tmp< T >::New().

Here is the call graph for this function:

◆ getVolumeType()

Foam::volumeType getVolumeType ( const indexedOctree< treeDataPoint > &  os,
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 98 of file treeDataPoint.C.

References volumeType::UNKNOWN.

◆ overlaps() [1/2]

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

Does (bb of) shape at index searchBox.

Definition at line 108 of file treeDataPoint.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

Does shape at index overlap the sphere.

Definition at line 118 of file treeDataPoint.C.

◆ findNearest()

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 147 of file treeDataPoint.C.

◆ pointLabel()

label pointLabel ( label  index) const
inline

Map to the original (non-subset) point label.

/FOAM_DEPRECATED_FOR(2022-10, "objectIndex()")

Definition at line 307 of file treeDataPoint.H.

References treeDataPoint::objectIndex().

Here is the call graph for this function:

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