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

octreeDataTriSurface Class Reference

Encapsulates data for octree searches on triSurface. More...

#include <meshTools/octreeDataTriSurface.H>


Detailed Description

Encapsulates data for octree searches on triSurface.

Source files

Definition at line 56 of file octreeDataTriSurface.H.

Collaboration diagram for octreeDataTriSurface:

List of all members.

Public Member Functions

 ClassName ("octreeDataTriSurface")
 octreeDataTriSurface (const triSurface &)
 Construct from triSurface. Holds reference. Bounding box.
 octreeDataTriSurface (const triSurface &, const treeBoundBoxList &)
 Construct from triSurface and bounding box.
const triSurface &  surface () const
const treeBoundBoxList &  allBb () const
label  size () const
label  getSampleType (const octree< octreeDataTriSurface > &, 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 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

Friends

Istream &  operator>> (Istream &, octreeDataTriSurface &)
Ostream &  operator<< (Ostream &, const octreeDataTriSurface &)

Constructor & Destructor Documentation

octreeDataTriSurface ( const triSurface &   surface  )

Construct from triSurface. Holds reference. Bounding box.

calculated from triangle points.

Definition at line 250 of file octreeDataTriSurface.C.

References f(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), and points.

octreeDataTriSurface ( const triSurface &   surface,
const treeBoundBoxList &   allBb  
)

Construct from triSurface and bounding box.

Holds references.

Definition at line 282 of file octreeDataTriSurface.C.

References f(), forAll, and points.


Member Function Documentation

ClassName ( "octreeDataTriSurface"    )
const triSurface& surface (  ) const [inline]

Definition at line 125 of file octreeDataTriSurface.H.

const treeBoundBoxList& allBb (  ) const [inline]

Definition at line 130 of file octreeDataTriSurface.H.

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

label size (  ) const [inline]

Definition at line 135 of file octreeDataTriSurface.H.

References List< T >::size().

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

Does (bb of) shape at index overlap bb.

Exact test of triangle intersecting bb

Definition at line 374 of file octreeDataTriSurface.C.

References treeBoundBox::contains(), f(), triangleFuncs::intersectBb(), treeBoundBox::overlaps(), and points.

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

Does shape at index contain sample.

Definition at line 411 of file octreeDataTriSurface.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 426 of file octreeDataTriSurface.C.

References PointHit< Point >::distance(), f(), intersection::HALF_RAY, PointHit< Point >::hit(), PointHit< Point >::hitPoint(), Foam::mag(), points, triangle< Point, PointRef >::ray(), and intersection::setPlanarTol().

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 470 of file octreeDataTriSurface.C.

References treeBoundBox::calcExtremities(), dist, Foam::mag(), boundBox::max(), boundBox::min(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

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.

Definition at line 509 of file octreeDataTriSurface.C.

References Foam::mag().

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

Calculates nearest (to sample) point in shape.

Returns point and mag(nearest - sample)

Definition at line 530 of file octreeDataTriSurface.C.

References Foam::mag().

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

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 542 of file octreeDataTriSurface.C.

References notImplemented.

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

Definition at line 559 of file octreeDataTriSurface.C.

References token::SPACE.


Friends And Related Function Documentation

Istream& operator>> ( Istream &   ,
octreeDataTriSurface &    
) [friend]
Ostream& operator<< ( Ostream &   ,
const octreeDataTriSurface &    
) [friend]

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