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 | |
ClassName ("dynamicTreeDataPoint") | |
dynamicTreeDataPoint (const DynamicList< point > &points) | |
Construct from List. Holds reference! More... | |
label | size () const |
const DynamicList< point > & | shapePoints () const |
Get representative point cloud for all shapes inside. 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 &sampleBb) 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. Sets result. 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 59 of file dynamicTreeDataPoint.H.
dynamicTreeDataPoint | ( | const DynamicList< point > & | points | ) |
Construct from List. Holds reference!
Definition at line 40 of file dynamicTreeDataPoint.C.
ClassName | ( | "dynamicTreeDataPoint" | ) |
|
inline |
Definition at line 81 of file dynamicTreeDataPoint.H.
References List< T >::size().
const Foam::DynamicList< Foam::point > & shapePoints | ( | ) | const |
Get representative point cloud for all shapes inside.
(one point per shape)
Definition at line 52 of file dynamicTreeDataPoint.C.
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 58 of file dynamicTreeDataPoint.C.
References volumeType::unknown.
bool overlaps | ( | const label | index, |
const treeBoundBox & | sampleBb | ||
) | const |
Does (bb of) shape at index overlap bb.
Definition at line 68 of file dynamicTreeDataPoint.C.
References treeBoundBox::contains().
Check if any point on shape is inside sphere.
Definition at line 78 of file dynamicTreeDataPoint.C.
References Foam::magSqr(), and p.
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 98 of file dynamicTreeDataPoint.C.
References forAll, and Foam::magSqr().
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 126 of file dynamicTreeDataPoint.C.
References treeBoundBox::contains(), PointHit< Point >::distance(), forAll, Foam::ln(), Foam::magSqr(), boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), PointHit< Point >::rawPoint(), Foam::sqr(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
inline |
Calculate intersection of shape with ray. Sets result.
accordingly
Definition at line 143 of file dynamicTreeDataPoint.H.