OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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

Collaboration diagram for treeDataPoint:

List of all members.


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.

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.

Source files

Definition at line 52 of file treeDataPoint.H.


Constructor & Destructor Documentation

treeDataPoint ( const pointField &  points  ) 

Construct from components. Holds reference to points!

Definition at line 35 of file treeDataPoint.C.


Member Function Documentation

ClassName ( "treeDataPoint"   ) 

label size (  )  const [inline]

Definition at line 74 of file treeDataPoint.H.

Foam::pointField points (  )  const

Get representative point cloud for all shapes inside.

(one point per shape)

Definition at line 43 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 54 of file treeDataPoint.C.

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

Does (bb of) shape at index overlap bb.

Definition at line 65 of file treeDataPoint.C.

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

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

References treeBoundBox::contains(), forAll, Foam::magSqr(), boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), and Foam::sqr().

Here is the call graph for this function:

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

References notImplemented.


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd