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

Public Member Functions

 ClassNameNoDebug ("dynamicTreeDataPoint")
 dynamicTreeDataPoint (const DynamicList< point > &points)
 Construct from List. Holds reference!
int nDim () const noexcept
 Object dimension == 0 (point element).
treeBoundBox bounds (const labelUList &indices) const
 Return bounding box for the specified point indices.
const DynamicList< point > & points () const noexcept
 The original point field.
bool useSubset () const noexcept
 const labelList& pointLabels() const noexcept { labelList::null(); }
bool empty () const noexcept
 Is the effective point field empty?
label size () const noexcept
 The size of the effective point field.
label objectIndex (label index) const noexcept
 Map from shape index to original (non-subset) point label.
const pointoperator[] (label index) const
 Point at specified shape index.
const pointcentre (label index) const
 Point at specified shape index.
const DynamicList< point > & centres () const noexcept
 Representative point cloud.
volumeType getVolumeType (const dynamicIndexedOctree< dynamicTreeDataPoint > &, const point &) 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 overlap bb.
bool overlaps (const label index, const point &centre, const scalar radiusSqr) const
 Check if any point on shape is inside sphere.
void findNearest (const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
 Calculates nearest (to sample) point in shape.
void findNearest (const labelUList &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.

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 dynamicTreeDataPoint.H.

Constructor & Destructor Documentation

◆ dynamicTreeDataPoint()

dynamicTreeDataPoint ( const DynamicList< point > & points)
explicit

Construct from List. Holds reference!

Definition at line 35 of file dynamicTreeDataPoint.C.

References points().

Here is the call graph for this function:

Member Function Documentation

◆ ClassNameNoDebug()

ClassNameNoDebug ( "dynamicTreeDataPoint" )

References points().

Here is the call graph for this function:

◆ nDim()

int nDim ( ) const
inlinenoexcept

Object dimension == 0 (point element).

Definition at line 87 of file dynamicTreeDataPoint.H.

References Foam::noexcept.

◆ bounds()

Foam::treeBoundBox bounds ( const labelUList & indices) const

Return bounding box for the specified point indices.

Definition at line 47 of file dynamicTreeDataPoint.C.

◆ points()

const DynamicList< point > & points ( ) const
inlinenoexcept

The original point field.

Definition at line 100 of file dynamicTreeDataPoint.H.

References Foam::noexcept.

Referenced by ClassNameNoDebug(), and dynamicTreeDataPoint().

Here is the caller graph for this function:

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

const labelList& pointLabels() const noexcept { labelList::null(); }

Use a subset of points

Definition at line 108 of file dynamicTreeDataPoint.H.

References Foam::noexcept.

◆ empty()

bool empty ( ) const
inlinenoexcept

Is the effective point field empty?

Definition at line 113 of file dynamicTreeDataPoint.H.

References Foam::noexcept.

◆ size()

label size ( ) const
inlinenoexcept

The size of the effective point field.

Definition at line 118 of file dynamicTreeDataPoint.H.

References Foam::noexcept.

◆ objectIndex()

label objectIndex ( label index) const
inlinenoexcept

Map from shape index to original (non-subset) point label.

Definition at line 123 of file dynamicTreeDataPoint.H.

◆ operator[]()

const point & operator[] ( label index) const
inline

Point at specified shape index.

Definition at line 128 of file dynamicTreeDataPoint.H.

◆ centre()

const point & centre ( label index) const
inline

Point at specified shape index.

Definition at line 133 of file dynamicTreeDataPoint.H.

Referenced by findNearest(), findNearest(), overlaps(), and overlaps().

Here is the caller graph for this function:

◆ centres()

const DynamicList< point > & centres ( ) const
inlinenoexcept

Representative point cloud.

Definition at line 138 of file dynamicTreeDataPoint.H.

References Foam::noexcept.

◆ getVolumeType()

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 53 of file dynamicTreeDataPoint.C.

References volumeType::UNKNOWN.

◆ overlaps() [1/2]

bool overlaps ( const label index,
const treeBoundBox & searchBox ) const

Does (bb of) shape at index overlap bb.

Definition at line 63 of file dynamicTreeDataPoint.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

Check if any point on shape is inside sphere.

Definition at line 73 of file dynamicTreeDataPoint.C.

References centre().

Here is the call graph for this function:

◆ findNearest() [1/2]

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 84 of file dynamicTreeDataPoint.C.

References centre().

Here is the call graph for this function:

◆ findNearest() [2/2]

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 110 of file dynamicTreeDataPoint.C.

References centre(), treeBoundBox::contains(), PointHit< PointType >::distance(), Vector< Cmpt >::distSqr(), boundBox::grow(), Foam::ln(), PointHit< PointType >::point(), and Foam::sqr().

Here is the call graph for this function:

◆ intersects()

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 209 of file dynamicTreeDataPoint.H.

References NotImplemented.


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