Classes | Public Types | Public Member Functions | Friends | List of all members
triangle Class Reference

A triangle primitive used to calculate face normals and swept volumes. More...

Classes

class  dummyOp
 
class  storeOp
 
class  sumAreaOp
 

Public Types

enum  proxType { NONE = 0, POINT, EDGE }
 
typedef Point point_type
 
typedef FixedList< triPoints, 27 > triIntersectionList
 

Public Member Functions

 triangle (const Point &a, const Point &b, const Point &c)
 
 triangle (const FixedList< Point, 3 > &tri)
 
 triangle (const UList< Point > &points, const FixedList< label, 3 > &indices)
 
 triangle (Istream &is)
 
const Pointa () const
 
const Pointb () const
 
const Pointc () const
 
Point centre () const
 
vector areaNormal () const
 
vector unitNormal () const
 
 FOAM_DEPRECATED_FOR (2018-12, "areaNormal() or unitNormal()") vector normal() const
 
scalar mag () const
 
Point circumCentre () const
 
scalar circumRadius () const
 
scalar quality () const
 
scalar sweptVol (const triangle &t) const
 
tensor inertia (PointRef refPt=Zero, scalar density=1.0) const
 
Point randomPoint (Random &rndGen) const
 
Point barycentricToPoint (const barycentric2D &bary) const
 
barycentric2D pointToBarycentric (const point &pt) const
 
scalar pointToBarycentric (const point &pt, barycentric2D &bary) const
 
pointHit ray (const point &p, const vector &q, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
 
pointHit intersection (const point &p, const vector &q, const intersection::algorithm alg, const scalar tol=0.0) const
 
pointHit nearestPointClassify (const point &p, label &nearType, label &nearLabel) const
 
pointHit nearestPoint (const point &p) const
 
bool classify (const point &p, label &nearType, label &nearLabel) const
 
pointHit nearestPoint (const linePointRef &edge, pointHit &edgePoint) const
 
int sign (const point &p, const scalar tol=SMALL) const
 
template<class AboveOp , class BelowOp >
void sliceWithPlane (const plane &pln, AboveOp &aboveOp, BelowOp &belowOp) const
 
template<class InsideOp , class OutsideOp >
void triangleOverlap (const vector &n, const triangle< Point, PointRef > &tri, InsideOp &insideOp, OutsideOp &outsideOp) const
 

Friends

Istreamoperator>> (Istream &, triangle &)
 
Ostreamoperator (Ostream &, const triangle &)
 

Detailed Description

A triangle primitive used to calculate face normals and swept volumes.

Source files

Definition at line 55 of file triangle.H.

Member Typedef Documentation

◆ point_type

typedef Point point_type

Definition at line 84 of file triangle.H.

◆ triIntersectionList

Definition at line 88 of file triangle.H.

Member Enumeration Documentation

◆ proxType

enum proxType
Enumerator
NONE 

Unknown proximity.

POINT 

Close to point.

EDGE 

Close to edge.

Definition at line 91 of file triangle.H.

Constructor & Destructor Documentation

◆ triangle() [1/4]

triangle ( const Point a,
const Point b,
const Point c 
)
inline

Definition at line 31 of file triangleI.H.

◆ triangle() [2/4]

triangle ( const FixedList< Point, 3 > &  tri)
inline

Definition at line 45 of file triangleI.H.

◆ triangle() [3/4]

triangle ( const UList< Point > &  points,
const FixedList< label, 3 > &  indices 
)
inline

Definition at line 57 of file triangleI.H.

◆ triangle() [4/4]

triangle ( Istream is)
inlineexplicit

Definition at line 70 of file triangleI.H.

Member Function Documentation

◆ a()

const Point & a ( ) const
inline

Definition at line 79 of file triangleI.H.

Referenced by triSurfaceTools::calcInterpolationWeights(), offsetSurface::operator()(), lumpedPointMovement::setInterpolator(), and triangle::triangleOverlap().

Here is the caller graph for this function:

◆ b()

const Point & b ( ) const
inline

Definition at line 85 of file triangleI.H.

Referenced by triSurfaceTools::calcInterpolationWeights(), offsetSurface::operator()(), lumpedPointMovement::setInterpolator(), and triangle::triangleOverlap().

Here is the caller graph for this function:

◆ c()

const Point & c ( ) const
inline

Definition at line 91 of file triangleI.H.

Referenced by triSurfaceTools::calcInterpolationWeights(), offsetSurface::operator()(), lumpedPointMovement::setInterpolator(), and triangle::triangleOverlap().

Here is the caller graph for this function:

◆ centre()

Point centre ( ) const
inline

Definition at line 98 of file triangleI.H.

Referenced by momentOfInertia::massPropertiesShell(), polyMesh::pointInCell(), and wallBoundedStreamLine::pushIn().

Here is the caller graph for this function:

◆ areaNormal()

Foam::vector areaNormal ( ) const
inline

◆ unitNormal()

Foam::vector unitNormal ( ) const
inline

Definition at line 112 of file triangleI.H.

References Foam::mag(), n, s, and Foam::Zero.

Here is the call graph for this function:

◆ FOAM_DEPRECATED_FOR()

FOAM_DEPRECATED_FOR ( 2018-  12,
"areaNormal() or unitNormal()"   
) const
inline

Definition at line 213 of file triangle.H.

References triangle::areaNormal().

Here is the call graph for this function:

◆ mag()

Foam::scalar mag ( ) const
inline

Definition at line 121 of file triangleI.H.

References Foam::mag().

Referenced by pointLinear< Type >::correction(), FreeStream< CloudType >::inflow(), momentOfInertia::massPropertiesShell(), and triangle::sumAreaOp::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ circumCentre()

Point circumCentre ( ) const
inline

Definition at line 128 of file triangleI.H.

References Foam::constant::universal::c, Foam::constant::physicoChemical::c1, Foam::constant::physicoChemical::c2, and Foam::mag().

Referenced by Foam::edgeMeshTools::featureProximity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ circumRadius()

Foam::scalar circumRadius ( ) const
inline

Definition at line 155 of file triangleI.H.

References Foam::mag(), Foam::max(), Foam::min(), and Foam::sqrt().

Referenced by Foam::edgeMeshTools::featureProximity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quality()

Foam::scalar quality ( ) const
inline

Definition at line 176 of file triangleI.H.

References Foam::constant::universal::c, Foam::mag(), Foam::sqr(), and Foam::sqrt().

Here is the call graph for this function:

◆ sweptVol()

Foam::scalar sweptVol ( const triangle t) const
inline

Definition at line 192 of file triangleI.H.

◆ inertia()

Foam::tensor inertia ( PointRef  refPt = Zero,
scalar  density = 1.0 
) const
inline

Definition at line 211 of file triangleI.H.

References Foam::I, Foam::mag(), and Tensor::T().

Here is the call graph for this function:

◆ randomPoint()

Point randomPoint ( Random rndGen) const
inline

Definition at line 247 of file triangleI.H.

References Foam::barycentric2D01(), and rndGen.

Referenced by FreeStream< CloudType >::inflow(), and patchInjectionBase::setPositionAndCell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ barycentricToPoint()

Point barycentricToPoint ( const barycentric2D bary) const
inline

Definition at line 255 of file triangleI.H.

◆ pointToBarycentric() [1/2]

Foam::barycentric2D pointToBarycentric ( const point pt) const
inline

Definition at line 265 of file triangleI.H.

Referenced by cellPointWeight::findTriangle(), offsetSurface::operator()(), and lumpedPointMovement::setInterpolator().

Here is the caller graph for this function:

◆ pointToBarycentric() [2/2]

Foam::scalar pointToBarycentric ( const point pt,
barycentric2D bary 
) const
inline

Definition at line 277 of file triangleI.H.

References Foam::mag().

Here is the call graph for this function:

◆ ray()

Foam::pointHit ray ( const point p,
const vector q,
const intersection::algorithm  alg = intersection::FULL_RAY,
const intersection::direction  dir = intersection::VECTOR 
) const
inline

◆ intersection()

Foam::pointHit intersection ( const point p,
const vector q,
const intersection::algorithm  alg,
const scalar  tol = 0.0 
) const
inline

Definition at line 432 of file triangleI.H.

References Foam::det(), and Foam::Zero.

Referenced by mappedPatchBase::facePoint(), and triangleFuncs::intersectBb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestPointClassify()

Foam::pointHit nearestPointClassify ( const point p,
label &  nearType,
label &  nearLabel 
) const

Definition at line 515 of file triangleI.H.

References cp, Foam::mag(), and p.

Referenced by triSurfaceTools::calcInterpolationWeights(), and face::nearestPointClassify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestPoint() [1/2]

Foam::pointHit nearestPoint ( const point p) const
inline

Definition at line 664 of file triangleI.H.

References p.

Referenced by wallBoundedStreamLine::findNearestTet(), cellPointWeight::findTriangle(), and tetrahedron::nearestPoint().

Here is the caller graph for this function:

◆ classify()

bool classify ( const point p,
label &  nearType,
label &  nearLabel 
) const
inline

Definition at line 678 of file triangleI.H.

References p.

◆ nearestPoint() [2/2]

pointHit nearestPoint ( const linePointRef edge,
pointHit edgePoint 
) const
inline

◆ sign()

int sign ( const point p,
const scalar  tol = SMALL 
) const
inline

Definition at line 816 of file triangleI.H.

References p.

◆ sliceWithPlane()

void sliceWithPlane ( const plane pln,
AboveOp &  aboveOp,
BelowOp &  belowOp 
) const
inline

Definition at line 108 of file triangle.C.

◆ triangleOverlap()

void triangleOverlap ( const vector n,
const triangle< Point, PointRef > &  tri,
InsideOp &  insideOp,
OutsideOp &  outsideOp 
) const
inline

Definition at line 121 of file triangle.C.

References triangle::a(), triangle::b(), triangle::c(), Foam::mag(), n, triangle::storeOp::nTris_, s, and triangle::storeOp::tris_.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
triangle  
)
friend

◆ operator

Ostream& operator ( Ostream ,
const triangle  
)
friend

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