treeDataPoint 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...

Classes

class  findIntersectOp
 
class  findNearestOp
 

Public Member Functions

 ClassName ("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...
 
bool empty () const
 An empty effective point field? More...
 
label size () const
 The effective point field size. More...
 
const pointFieldpoints () const
 The original point field. More...
 
const labelListpointLabels () const
 The original point ids. More...
 
bool useSubset () const
 Use a subset of points. More...
 
label pointLabel (const label index) const
 The original (non-subset) point label. More...
 
const pointshapePoint (const label index) const
 Point at specified index. More...
 
pointField shapePoints () const
 
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 &sampleBb) const
 Does (bb of) shape at index overlap bb. More...
 
bool overlaps (const label index, const point &centre, const scalar radiusSqr) const
 Does shape at index overlap the sphere. More...
 
const pointoperator[] (const label index) const
 The point at the specified index. More...
 

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 62 of file treeDataPoint.H.

Constructor & Destructor Documentation

◆ treeDataPoint() [1/3]

treeDataPoint ( const pointField points)
explicit

Construct from pointField.

Note
Holds reference to the points!

Definition at line 44 of file treeDataPoint.C.

◆ treeDataPoint() [2/3]

treeDataPoint ( const pointField points,
const labelUList pointLabels,
const bool  useSubsetPoints = true 
)

Construct from subset of pointField, copies point ids.

Note
Holds reference to the points!

Definition at line 51 of file treeDataPoint.C.

◆ treeDataPoint() [3/3]

treeDataPoint ( const pointField points,
labelList &&  pointLabels,
const bool  useSubsetPoints = true 
)

Construct from subset of pointField, moves point ids.

Note
Holds reference to the points!

Definition at line 64 of file treeDataPoint.C.

Member Function Documentation

◆ ClassName()

ClassName ( "treeDataPoint"  )

◆ empty()

bool empty ( ) const
inline

An empty effective point field?

Definition at line 159 of file treeDataPoint.H.

References UList< T >::empty().

Here is the call graph for this function:

◆ size()

label size ( ) const
inline

The effective point field size.

Definition at line 170 of file treeDataPoint.H.

References UList< T >::size().

Here is the call graph for this function:

◆ points()

const pointField & points ( ) const
inline

The original point field.

Definition at line 181 of file treeDataPoint.H.

◆ pointLabels()

const labelList & pointLabels ( ) const
inline

The original point ids.

Definition at line 187 of file treeDataPoint.H.

◆ useSubset()

bool useSubset ( ) const
inline

Use a subset of points.

Definition at line 193 of file treeDataPoint.H.

◆ pointLabel()

label pointLabel ( const label  index) const
inline

The original (non-subset) point label.

Definition at line 199 of file treeDataPoint.H.

◆ shapePoint()

const point & shapePoint ( const label  index) const
inline

Point at specified index.

Definition at line 210 of file treeDataPoint.H.

Referenced by treeDataPoint::findNearestOp::operator()(), treeDataPoint::operator[](), and treeDataPoint::overlaps().

Here is the caller graph for this function:

◆ shapePoints()

Foam::pointField shapePoints ( ) const

Representative point cloud for all shapes inside (one point per shape)

Definition at line 95 of file treeDataPoint.C.

◆ getVolumeType()

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 106 of file treeDataPoint.C.

References volumeType::UNKNOWN.

◆ overlaps() [1/2]

bool overlaps ( const label  index,
const treeBoundBox sampleBb 
) const

Does (bb of) shape at index overlap bb.

Definition at line 116 of file treeDataPoint.C.

References treeBoundBox::contains(), and treeDataPoint::shapePoint().

Here is the call graph for this function:

◆ overlaps() [2/2]

bool overlaps ( const label  index,
const point centre,
const scalar  radiusSqr 
) const

Does shape at index overlap the sphere.

Definition at line 126 of file treeDataPoint.C.

References Foam::magSqr(), and treeDataPoint::shapePoint().

Here is the call graph for this function:

◆ operator[]()

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

The point at the specified index.

Definition at line 254 of file treeDataPoint.H.

References treeDataPoint::shapePoint().

Here is the call graph for this function:

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