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< 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... | |
scalar | nearestDist (const line< point2D, const point2D & > &e, point2D &thisPt, point2D &edgePt) const |
scalar | nearestDist (const line< point2D, const point2D & > &edge, point2D &thisPoint, point2D &edgePoint) const |
2D specialisation More... | |
Friends | |
Istream & | operator>> (Istream &is, line &l) |
Ostream & | operator (Ostream &os, const line &l) |
A line primitive.
|
inlinenoexcept |
Return first point.
Definition at line 64 of file lineI.H.
Referenced by Foam::calcEdgeNormalFromFace().
|
inlinenoexcept |
Return last (second) point.
Definition at line 78 of file lineI.H.
Referenced by Foam::calcEdgeNormalFromFace().
|
inlinenoexcept |
Return first point.
Definition at line 85 of file lineI.H.
Referenced by plane::lineIntersect(), and slidingInterface::modifyMotionPoints().
|
inline |
Return centre (centroid)
Definition at line 98 of file lineI.H.
Referenced by Foam::calcEdgeNormalFromFace(), and surfaceFeatures::nearestSurfEdge().
|
inline |
Return scalar magnitude.
Definition at line 105 of file lineI.H.
Referenced by Foam::calcEdgeNormalFromFace(), and slidingInterface::modifyMotionPoints().
|
inline |
Return start-to-end vector.
Definition at line 112 of file lineI.H.
Referenced by Foam::calcEdgeNormalFromFace(), plane::lineIntersect(), and slidingInterface::modifyMotionPoints().
|
inline |
Return the unit vector (start-to-end)
Definition at line 119 of file lineI.H.
References Foam::mag(), s(), and Foam::Zero.
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 129 of file lineI.H.
References b, Foam::mag(), and p.
Referenced by treeDataFace::getVolumeType(), slidingInterface::modifyMotionPoints(), and faceCollapser::setRefinement().
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 161 of file lineI.H.
References b, PointHit< PointType >::distance(), edge::end(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::min(), PointHit< PointType >::rawPoint(), s(), and edge::start().
scalar nearestDist | ( | const line< point2D, const point2D & > & | e, |
point2D & | thisPt, | ||
point2D & | edgePt | ||
) | const |
Definition at line 38 of file line.C.
References e, UList< T >::end(), Foam::mag(), Foam::max(), Foam::min(), Vector2D< Cmpt >::perp(), and s().
scalar nearestDist | ( | const line< point2D, const point2D & > & | edge, |
point2D & | thisPoint, | ||
point2D & | edgePoint | ||
) | const |
2D specialisation