Loading...
Searching...
No Matches
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...

#include <treeDataPoint.H>

Classes

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

Public Member Functions

 ClassNameNoDebug ("treeDataPoint")
 treeDataPoint (const pointField &points)
 Construct from pointField.
 treeDataPoint (const pointField &points, const labelUList &pointLabels, const bool useSubsetPoints=true)
 Construct from subset of pointField, copies point ids.
 treeDataPoint (const pointField &points, labelList &&pointLabels, const bool useSubsetPoints=true)
 Construct from subset of pointField, moves point ids.
int nDim () const noexcept
 Object dimension == 0 (point element).
treeBoundBox bounds (const labelUList &indices) const
 Return bounding box for the specified point indices.
const pointFieldpoints () const noexcept
 The original point field.
const labelListpointLabels () const noexcept
 The subset of point ids to use.
bool useSubset () const noexcept
 Use a subset of points.
bool empty () const noexcept
 Is the effective point field empty?
label size () const noexcept
 The size of the effective point field.
label objectIndex (const label index) const
 Map to the original (non-subset) point label.
const pointoperator[] (const label index) const
 Point at specified shape index.
const pointcentre (const label index) const
 Point at specified shape index.
tmp< pointFieldcentres () const
 Point cloud.
volumeType getVolumeType (const indexedOctree< treeDataPoint > &os, const point &sample) const
 Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
bool overlaps (const label index, const treeBoundBox &searchBox) const
 Does (bb of) shape at index searchBox.
bool overlaps (const label index, const point &centre, const scalar radiusSqr) const
 Does shape at index overlap the sphere.
void findNearest (const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
 Calculates nearest (to sample) point in shape.
label pointLabel (label index) const
 Map to the original (non-subset) point label.

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.

References points().

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

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

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

References pointLabels(), and points().

Here is the call graph for this function:

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

References pointLabels(), and points().

Here is the call graph for this function:

Member Function Documentation

◆ ClassNameNoDebug()

ClassNameNoDebug ( "treeDataPoint" )

References pointLabels(), and points().

Here is the call graph for this function:

◆ nDim()

int nDim ( ) const
inlinenoexcept

Object dimension == 0 (point element).

Definition at line 181 of file treeDataPoint.H.

References Foam::noexcept.

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

References Foam::noexcept.

Referenced by ClassNameNoDebug(), treeDataPoint(), treeDataPoint(), and treeDataPoint().

Here is the caller graph for this function:

◆ pointLabels()

const labelList & pointLabels ( ) const
inlinenoexcept

The subset of point ids to use.

Definition at line 199 of file treeDataPoint.H.

References Foam::noexcept.

Referenced by ClassNameNoDebug(), treeDataPoint(), and treeDataPoint().

Here is the caller graph for this function:

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

Use a subset of points.

Definition at line 204 of file treeDataPoint.H.

References Foam::noexcept.

◆ empty()

bool empty ( ) const
inlinenoexcept

Is the effective point field empty?

Definition at line 209 of file treeDataPoint.H.

References Foam::noexcept.

◆ size()

label size ( ) const
inlinenoexcept

The size of the effective point field.

Definition at line 217 of file treeDataPoint.H.

References Foam::noexcept.

◆ 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 centre(), operator[](), and 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 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 objectIndex().

Referenced by findNearest(), treeDataPoint::findNearestOp::operator()(), overlaps(), and overlaps().

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

References centre(), and 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 117 of file treeDataPoint.C.

References centre().

Here is the call graph for this function:

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

References centre().

Here is the call graph for this function:

◆ 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 objectIndex().

Here is the call graph for this function:

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