A line primitive. More...
Public Member Functions | |
line (const Point &start, const Point &end) | |
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 |
Return first point. More... | |
PointRef | second () const |
Return second (last) point. More... | |
PointRef | last () const |
Return last (second) point. More... | |
PointRef | start () const |
Return first point. More... | |
PointRef | end () const |
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... | |
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 | |
Istream & | operator>> (Istream &is, line &l) |
Ostream & | operator (Ostream &os, const line &l) |
A line primitive.
|
inline |
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 surfaceFeatures::nearestSurfEdge().
|
inline |
Return scalar magnitude.
Definition at line 105 of file lineI.H.
References Foam::mag().
Referenced by slidingInterface::modifyMotionPoints(), and lumpedPointMovement::setInterpolator().
|
inline |
Return start-to-end vector.
Definition at line 112 of file lineI.H.
Referenced by plane::lineIntersect(), slidingInterface::modifyMotionPoints(), and lumpedPointMovement::setInterpolator().
|
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().
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().
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< Point >::distance(), stdFoam::end(), edge::end(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::min(), PointHit< Point >::rawPoint(), s, and edge::start().
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.
scalar nearestDist | ( | const line< point2D, const point2D & > & | edge, |
point2D & | thisPoint, | ||
point2D & | edgePoint | ||
) | const |
2D specialisation