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 | a () const noexcept |
The first point. More... | |
PointRef | b () const noexcept |
The second point. More... | |
PointRef | first () const noexcept |
The first point. More... | |
PointRef | second () const noexcept |
The second (last) point. More... | |
PointRef | start () const noexcept |
The start (first) point. More... | |
PointRef | end () const noexcept |
The end (second) point. More... | |
PointRef | last () const noexcept |
The last (second) point. More... | |
Point | centre () const |
Return centre (centroid) More... | |
scalar | mag () const |
The magnitude (length) of the line. More... | |
Point | vec () const |
Return start-to-end vector. More... | |
Point | unitVec () const |
Return the unit vector (start-to-end) More... | |
Pair< Point > | box () const |
The enclosing (bounding) box for the line. 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 and sets both points (one on *this, one on the provided linePointRef. 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... | |
Static Public Member Functions | |
static Pair< Point > | box (const Point &p0, const Point &p1) |
The enclosing (bounding) box for two points. More... | |
Friends | |
Istream & | operator>> (Istream &, line &) |
Ostream & | operator (Ostream &, const line &) |
A line primitive.
|
inlinenoexcept |
The first point.
Definition at line 222 of file line.H.
Referenced by Foam::areaInvDistSqrWeightedNormalFaceTriangle(), and Foam::areaNormalFaceTriangle().
|
inlinenoexcept |
The second point.
Definition at line 227 of file line.H.
Referenced by Foam::areaInvDistSqrWeightedNormalFaceTriangle(), and Foam::areaNormalFaceTriangle().
|
inlinenoexcept |
|
inlinenoexcept |
The start (first) point.
Definition at line 242 of file line.H.
Referenced by plane::lineIntersect(), and slidingInterface::modifyMotionPoints().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestatic |
The enclosing (bounding) box for two points.
Definition at line 139 of file lineI.H.
References Foam::max(), Foam::min(), and p0.
|
inline |
Return centre (centroid)
Definition at line 83 of file lineI.H.
Referenced by Foam::calcLeVector(), and surfaceFeatures::nearestSurfEdge().
|
inline |
The magnitude (length) of the line.
Definition at line 96 of file lineI.H.
References Foam::constant::physicoChemical::b, and Foam::mag().
Referenced by Foam::calcLeVector(), slidingInterface::modifyMotionPoints(), and lumpedPointMovement::setInterpolator().
|
inline |
Return start-to-end vector.
Definition at line 109 of file lineI.H.
References Foam::constant::physicoChemical::b.
Referenced by Foam::calcLeVector(), plane::lineIntersect(), slidingInterface::modifyMotionPoints(), and lumpedPointMovement::setInterpolator().
|
inline |
Return the unit vector (start-to-end)
Definition at line 122 of file lineI.H.
References Foam::mag(), s, and Foam::Zero.
Referenced by Foam::calcLeVector(), and lumpedPointMovement::setInterpolator().
|
inline |
The enclosing (bounding) box for the line.
Definition at line 149 of file lineI.H.
Referenced by linePoints::box(), and edge::box().
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 163 of file lineI.H.
References Foam::constant::physicoChemical::b, Foam::constant::physicoChemical::c1, Foam::constant::physicoChemical::c2, Foam::mag(), and p.
Referenced by treeDataEdge::findNearest(), slidingInterface::modifyMotionPoints(), treeDataEdge::findNearestOp::operator()(), treeDataEdge::overlaps(), 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 195 of file lineI.H.
References Foam::constant::physicoChemical::b, Foam::constant::universal::c, PointHit< PointType >::distance(), edge::end(), stdFoam::end(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::min(), PointHit< PointType >::point(), s, and edge::start().
scalar nearestDist | ( | const line< point2D, const point2D &> & | e, |
point2D & | thisPt, | ||
point2D & | edgePt | ||
) | const |
Definition at line 32 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
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.