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 <meshTools/treeDataPoint.H>
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.
Definition at line 57 of file treeDataPoint.H.
Public Member Functions | |
ClassName ("treeDataPoint") | |
treeDataPoint (const pointField &points) | |
Construct from components. Holds reference to points!
| |
label | size () const |
pointField | points () const |
Get representative point cloud for all shapes inside.
| |
label | getVolumeType (const indexedOctree< treeDataPoint > &, const point &) const |
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
| |
bool | overlaps (const label index, const treeBoundBox &sampleBb) const |
Does (bb of) shape at index overlap bb.
| |
void | findNearest (const labelList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const |
Calculates nearest (to sample) point in shape.
| |
void | findNearest (const labelList &indices, const linePointRef &ln, treeBoundBox &tightest, label &minIndex, point &linePoint, point &nearestPoint) const |
Calculates nearest (to line) point in shape.
| |
bool | intersects (const label index, const point &start, const point &end, point &result) const |
Calculate intersection of shape with ray. Sets result.
|
treeDataPoint | ( | const pointField & | points ) |
Construct from components. Holds reference to points!
Definition at line 42 of file treeDataPoint.C.
ClassName | ( | "treeDataPoint" | ) |
label size | ( | ) | const [inline]
|
Definition at line 79 of file treeDataPoint.H.
References List< T >::size().
Foam::pointField points | ( | ) | const |
Get representative point cloud for all shapes inside.
(one point per shape)
Definition at line 50 of file treeDataPoint.C.
Foam::label getVolumeType | ( | const indexedOctree< treeDataPoint > & | 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 59 of file treeDataPoint.C.
bool overlaps | ( | const label | index, |
const treeBoundBox & | sampleBb | ||
) | const |
Does (bb of) shape at index overlap bb.
Definition at line 70 of file treeDataPoint.C.
References treeBoundBox::contains().
void findNearest | ( | const labelList & | 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 82 of file treeDataPoint.C.
References forAll, and Foam::magSqr().
void findNearest | ( | const labelList & | 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 112 of file treeDataPoint.C.
References treeBoundBox::contains(), PointHit< Point >::distance(), line< Point, PointRef >::end(), forAll, Foam::magSqr(), Foam::max(), boundBox::max(), Foam::min(), boundBox::min(), line< Point, PointRef >::nearestDist(), PointHit< Point >::rawPoint(), Foam::sqr(), line< Point, PointRef >::start(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
bool intersects | ( | const label | index, |
const point & | start, | ||
const point & | end, | ||
point & | result | ||
) | const [inline]
|
Calculate intersection of shape with ray. Sets result.
accordingly
Definition at line 134 of file treeDataPoint.H.
References notImplemented.