line< Point, PointRef > Class Template Reference

A line primitive. More...

Public Member Functions

 line (const Point &from, const Point &to)
 Construct from two points. More...
 
 line (const UList< Point > &points, const FixedList< label, 2 > &indices)
 Construct from two points in the list of points. More...
 
 line (Istream &is)
 Construct from Istream. More...
 
PointRef first () const noexcept
 Return first point. More...
 
PointRef second () const noexcept
 Return second (last) point. More...
 
PointRef last () const noexcept
 Return last (second) point. More...
 
PointRef start () const noexcept
 Return first point. More...
 
PointRef end () const noexcept
 Return second (last) point. More...
 
Point centre () const
 Return centre (centroid) More...
 
scalar mag () const
 Return scalar magnitude. More...
 
Point vec () const
 Return start-to-end vector. More...
 
Point unitVec () const
 Return the unit vector (start-to-end) More...
 
PointHit< PointnearestDist (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 &is, line &l)
 
Ostreamoperator (Ostream &os, const line &l)
 

Detailed Description

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

A line primitive.

Source files

Definition at line 53 of file line.H.

Constructor & Destructor Documentation

◆ line() [1/3]

line ( const Point from,
const Point to 
)
inline

Construct from two points.

Definition at line 35 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 44 of file lineI.H.

◆ line() [3/3]

line ( Istream is)
inlineexplicit

Construct from Istream.

Definition at line 55 of file lineI.H.

Member Function Documentation

◆ first()

PointRef first ( ) const
inlinenoexcept

Return first point.

Definition at line 64 of file lineI.H.

◆ second()

PointRef second ( ) const
inlinenoexcept

Return second (last) point.

Definition at line 71 of file lineI.H.

◆ last()

PointRef last ( ) const
inlinenoexcept

Return last (second) point.

Definition at line 78 of file lineI.H.

◆ start()

PointRef start ( ) const
inlinenoexcept

Return first point.

Definition at line 85 of file lineI.H.

Referenced by plane::lineIntersect(), and slidingInterface::modifyMotionPoints().

Here is the caller graph for this function:

◆ end()

PointRef end ( ) const
inlinenoexcept

Return second (last) point.

Definition at line 91 of file lineI.H.

◆ centre()

Point centre ( ) const
inline

Return centre (centroid)

Definition at line 98 of file lineI.H.

Referenced by surfaceFeatures::nearestSurfEdge().

Here is the caller graph for this function:

◆ mag()

Foam::scalar mag ( ) const
inline

Return scalar magnitude.

Definition at line 105 of file lineI.H.

References Foam::mag().

Referenced by slidingInterface::modifyMotionPoints(), and lumpedPointMovement::setInterpolator().

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

◆ vec()

Point vec ( ) const
inline

Return start-to-end vector.

Definition at line 112 of file lineI.H.

Referenced by plane::lineIntersect(), slidingInterface::modifyMotionPoints(), and lumpedPointMovement::setInterpolator().

Here is the caller graph for this function:

◆ unitVec()

Point unitVec ( ) const
inline

Return the unit vector (start-to-end)

Definition at line 119 of file lineI.H.

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

Referenced by lumpedPointMovement::setInterpolator().

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

◆ nearestDist() [1/4]

Foam::PointHit< Point > nearestDist ( const Point p) const

Return nearest distance to line from a given point.

If the nearest point is on the line, return a hit

Definition at line 130 of file lineI.H.

References Foam::constant::physicoChemical::b, Foam::constant::physicoChemical::c1, Foam::constant::physicoChemical::c2, Foam::mag(), and p.

Referenced by treeDataFace::getVolumeType(), slidingInterface::modifyMotionPoints(), and faceCollapser::setRefinement().

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

◆ 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 162 of file lineI.H.

References Foam::constant::physicoChemical::b, Foam::constant::universal::c, PointHit< PointType >::distance(), stdFoam::end(), edge::end(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::min(), PointHit< PointType >::rawPoint(), s, and edge::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

Definition at line 39 of file line.C.

References Foam::constant::electromagnetic::e, stdFoam::end(), Foam::mag(), Foam::max(), Foam::min(), Vector2D< Cmpt >::perp(), and s.

Here is the call graph for this function:

◆ 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 is,
line< Point, PointRef > &  l 
)
friend

◆ operator

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

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