FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

octreeDataPoint Class Reference

Encapsulation of data needed for octree searches. More...

#include <meshTools/octreeDataPoint.H>


Detailed Description

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. Holds (reference to) pointField.

Source files

Definition at line 60 of file octreeDataPoint.H.

Collaboration diagram for octreeDataPoint:

List of all members.

Public Member Functions

 octreeDataPoint (const pointField &)
 Construct from components. Holds reference to points!
const pointField &  points () const
label  size () const
label  getSampleType (const octree< octreeDataPoint > &, const point &) const
 Get type of sample.
bool  overlaps (const label index, const treeBoundBox &sampleBb) const
 Does (bb of) shape at index overlap bb.
bool  contains (const label index, const point &sample) const
 Does shape at index contain sample.
bool  intersects (const label index, const point &start, const point &end, point &intersectionPoint) const
 Segment (from start to end) intersection with shape.
bool  findTightest (const label index, const point &sample, treeBoundBox &tightest) const
 Sets newTightest to bounding box (and returns true) if.
scalar  calcSign (const label index, const point &sample, vector &n) const
 Given index get unit normal and calculate (numerical) sign.
scalar  calcNearest (const label index, const point &sample, point &nearest) const
 Calculates nearest (to sample) point on/in shape.
scalar  calcNearest (const label index, const linePointRef &ln, point &linePt, point &shapePt) const
 Calculates nearest (to line segment) point in shape.
void  write (Ostream &os, const label index) const
 Write shape at index.

Friends

Ostream &  operator<< (Ostream &, const octreeDataPoint &)

Constructor & Destructor Documentation

octreeDataPoint ( const pointField &   points  ) [explicit]

Construct from components. Holds reference to points!

Definition at line 37 of file octreeDataPoint.C.


Member Function Documentation

const pointField& points (  ) const [inline]

Definition at line 78 of file octreeDataPoint.H.

Referenced by treeLeaf< Type >::findNearest().

label size (  ) const [inline]

Definition at line 83 of file octreeDataPoint.H.

References List< T >::size().

Foam::label getSampleType ( const octree< octreeDataPoint > &   ,
const point &    
) const

Get type of sample.

Get type of volume.

Definition at line 47 of file octreeDataPoint.C.

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

Does (bb of) shape at index overlap bb.

Definition at line 57 of file octreeDataPoint.C.

References treeBoundBox::contains().

bool contains ( const label   index,
const point &   sample  
) const

Does shape at index contain sample.

Definition at line 67 of file octreeDataPoint.C.

References notImplemented.

bool intersects ( const label   index,
const point &   start,
const point &   end,
point &   intersectionPoint  
) const

Segment (from start to end) intersection with shape.

at index. If intersects returns true and sets intersectionPoint

Definition at line 82 of file octreeDataPoint.C.

References notImplemented.

bool findTightest ( const label   index,
const point &   sample,
treeBoundBox &   tightest  
) const

Sets newTightest to bounding box (and returns true) if.

nearer to sample than tightest bounding box. Otherwise returns false.

Definition at line 100 of file octreeDataPoint.C.

References notImplemented.

Foam::scalar calcSign ( const label   index,
const point &   sample,
vector &   n  
) const

Given index get unit normal and calculate (numerical) sign.

of sample. Used to determine accuracy of calcNearest or inside/outside. Note: always returns GREAT since no inside/outside.

Definition at line 117 of file octreeDataPoint.C.

References Vector< Cmpt >::zero.

Foam::scalar calcNearest ( const label   index,
const point &   sample,
point &   nearest  
) const [inline]

Calculates nearest (to sample) point on/in shape.

Returns point and mag(nearest - sample)

Definition at line 131 of file octreeDataPoint.C.

References Foam::magSqr().

Foam::scalar calcNearest ( const label   index,
const linePointRef &   ln,
point &   linePt,
point &   shapePt  
) const

Calculates nearest (to line segment) point in shape.

Returns distance and both point.

Definition at line 160 of file octreeDataPoint.C.

References PointHit< Point >::distance(), line< Point, PointRef >::nearestDist(), and PointHit< Point >::rawPoint().

void write ( Ostream &   os,
const label   index  
) const

Write shape at index.

Definition at line 143 of file octreeDataPoint.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, points, and List< T >::size().


Friends And Related Function Documentation

Ostream& operator<< ( Ostream &   ,
const octreeDataPoint &    
) [friend]

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