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 point & | operator[] (label index) const |
Point at specified shape index. More... | |
const point & | centre (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 ¢re, 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... | |
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 dynamicTreeDataPoint.H.
|
explicit |
Construct from List. Holds reference!
Definition at line 36 of file dynamicTreeDataPoint.C.
ClassNameNoDebug | ( | "dynamicTreeDataPoint" | ) |
|
inlinenoexcept |
Object dimension == 0 (point element)
Definition at line 87 of file dynamicTreeDataPoint.H.
Foam::treeBoundBox bounds | ( | const labelUList & | indices | ) | const |
Return bounding box for the specified point indices.
Definition at line 47 of file dynamicTreeDataPoint.C.
|
inlinenoexcept |
The original point field.
Definition at line 100 of file dynamicTreeDataPoint.H.
|
inlinenoexcept |
const labelList& pointLabels() const noexcept { labelList::null(); }
Use a subset of points
Definition at line 108 of file dynamicTreeDataPoint.H.
|
inlinenoexcept |
Is the effective point field empty?
Definition at line 113 of file dynamicTreeDataPoint.H.
References UList< T >::empty().
|
inlinenoexcept |
The size of the effective point field.
Definition at line 118 of file dynamicTreeDataPoint.H.
References UList< T >::size().
|
inlinenoexcept |
Map from shape index to original (non-subset) point label.
Definition at line 123 of file dynamicTreeDataPoint.H.
|
inline |
Point at specified shape index.
Definition at line 128 of file dynamicTreeDataPoint.H.
|
inline |
Point at specified shape index.
Definition at line 133 of file dynamicTreeDataPoint.H.
|
inlinenoexcept |
Representative point cloud.
Definition at line 138 of file dynamicTreeDataPoint.H.
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.
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().
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.
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.
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().
|
inline |
Calculate intersection of shape with ray.
Sets result accordingly
Definition at line 210 of file dynamicTreeDataPoint.H.
References NotImplemented.