All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
line< Point, PointRef > Class Template Reference

A line primitive. More...

Public Member Functions

 line (const Point &start, const Point &end)
 Construct from two points. More...
 
 line (const UList< Point > &, const FixedList< label, 2 > &indices)
 Construct from two points in the list of points. More...
 
 line (Istream &)
 Construct from Istream. More...
 
PointRef start () const
 Return first vertex. More...
 
PointRef end () const
 Return second vertex. More...
 
Point centre () const
 Return centre (centroid) More...
 
scalar mag () const
 Return scalar magnitude. More...
 
Point vec () const
 Return start-end vector. More...
 
PointHit< Point > nearestDist (const Point &p) const
 Return nearest distance to line from a given point. More...
 
scalar nearestDist (const line< Point, const Point &> &edge, Point &thisPoint, Point &edgePoint) const
 Return nearest distance from line to line. Returns distance. More...
 
template<>
scalar nearestDist (const line< point2D, const point2D & > &e, point2D &thisPt, point2D &edgePt) const
 
template<>
scalar nearestDist (const line< point2D, const point2D & > &edge, point2D &thisPoint, point2D &edgePoint) const
 2D specialisation More...
 

Friends

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

Detailed Description

template<class Point, class PointRef>
class Foam::line< Point, PointRef >

A line primitive.

Source files

Definition at line 56 of file line.H.

Constructor & Destructor Documentation

◆ line() [1/3]

line ( const Point &  start,
const Point &  end 
)
inline

Construct from two points.

Definition at line 31 of file lineI.H.

◆ line() [2/3]

line ( const UList< Point > &  points,
const FixedList< label, 2 > &  indices 
)
inline

Construct from two points in the list of points.

The indices could be from edge etc.

Definition at line 40 of file lineI.H.

◆ line() [3/3]

line ( Istream is)
inline

Construct from Istream.

Definition at line 51 of file lineI.H.

Member Function Documentation

◆ start()

PointRef start ( ) const
inline

◆ end()

PointRef end ( ) const
inline

Return second vertex.

Definition at line 66 of file lineI.H.

Referenced by dynamicTreeDataPoint::findNearest(), line< Point, PointRef >::nearestDist(), triangle< Point, PointRef >::nearestPoint(), and OBJstream::write().

Here is the caller graph for this function:

◆ centre()

Point centre ( ) const
inline

Return centre (centroid)

Definition at line 73 of file lineI.H.

Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNearest(), indexedOctree< Foam::treeDataFace >::findNearest(), and surfaceFeatures::nearestSurfEdge().

Here is the caller graph for this function:

◆ mag()

Foam::scalar mag ( ) const
inline

Return scalar magnitude.

Definition at line 80 of file lineI.H.

References Foam::mag(), and line< Point, PointRef >::vec().

Referenced by slidingInterface::modifyMotionPoints().

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

◆ vec()

Point vec ( ) const
inline

Return start-end vector.

Definition at line 87 of file lineI.H.

References line< Point, PointRef >::nearestDist().

Referenced by plane::lineIntersect(), line< Point, PointRef >::mag(), slidingInterface::modifyMotionPoints(), line< Point, PointRef >::nearestDist(), and triangle< Point, PointRef >::nearestPoint().

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

◆ nearestDist() [1/4]

◆ nearestDist() [2/4]

Foam::scalar nearestDist ( const line< Point, const Point &> &  edge,
Point &  thisPoint,
Point &  edgePoint 
) const

Return nearest distance from line to line. Returns distance.

and sets both points (one on *this, one on the provided linePointRef.

Definition at line 127 of file lineI.H.

References Foam::constant::physicoChemical::b, token::BEGIN_LIST, Foam::constant::universal::c, IOstream::check(), PointHit< Point >::distance(), line< Point, PointRef >::end(), token::END_LIST, Foam::mag(), Foam::magSqr(), Foam::max(), Foam::min(), line< Point, PointRef >::nearestDist(), PointHit< Point >::rawPoint(), Istream::readBegin(), Istream::readEnd(), s(), token::SPACE, and line< Point, PointRef >::start().

Here is the call graph for this function:

◆ nearestDist() [3/4]

scalar nearestDist ( const line< point2D, const point2D &> &  e,
point2D thisPt,
point2D edgePt 
) const

◆ nearestDist() [4/4]

scalar nearestDist ( const line< point2D, const point2D & > &  edge,
point2D thisPoint,
point2D edgePoint 
) const

2D specialisation

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
line< Point, PointRef > &   
)
friend

◆ operator

Ostream& operator ( Ostream ,
const line< Point, PointRef > &   
)
friend

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