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 pointField & | points () const noexcept |
The original point field. More... | |
const labelList & | pointLabels () 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 point & | operator[] (const label index) const |
Point at specified shape index. More... | |
const point & | centre (const label index) const |
Point at specified shape index. More... | |
tmp< pointField > | centres () 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 ¢re, 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... | |
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.
Definition at line 58 of file treeDataPoint.H.
|
explicit |
Construct from pointField.
Definition at line 35 of file treeDataPoint.C.
treeDataPoint | ( | const pointField & | points, |
const labelUList & | pointLabels, | ||
const bool | useSubsetPoints = true |
||
) |
Construct from subset of pointField, copies point ids.
Definition at line 43 of file treeDataPoint.C.
treeDataPoint | ( | const pointField & | points, |
labelList && | pointLabels, | ||
const bool | useSubsetPoints = true |
||
) |
Construct from subset of pointField, moves point ids.
Definition at line 56 of file treeDataPoint.C.
ClassNameNoDebug | ( | "treeDataPoint" | ) |
|
inlinenoexcept |
Object dimension == 0 (point element)
Definition at line 181 of file treeDataPoint.H.
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().
|
inlinenoexcept |
The original point field.
Definition at line 194 of file treeDataPoint.H.
|
inlinenoexcept |
The subset of point ids to use.
Definition at line 199 of file treeDataPoint.H.
|
inlinenoexcept |
Use a subset of points.
Definition at line 204 of file treeDataPoint.H.
|
inlinenoexcept |
Is the effective point field empty?
Definition at line 209 of file treeDataPoint.H.
References UList< T >::empty().
|
inlinenoexcept |
The size of the effective point field.
Definition at line 217 of file treeDataPoint.H.
References UList< T >::size().
|
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().
|
inline |
Point at specified shape index.
Definition at line 233 of file treeDataPoint.H.
References treeDataPoint::objectIndex().
|
inline |
Point at specified shape index.
Definition at line 241 of file treeDataPoint.H.
References treeDataPoint::objectIndex().
Referenced by treeDataPoint::findNearestOp::operator()().
Foam::tmp< Foam::pointField > centres | ( | ) | const |
Point cloud.
Definition at line 86 of file treeDataPoint.C.
References tmp< T >::New().
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.
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().
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.
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.
|
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().