A line primitive. More...
#include <line.H>

Public Member Functions | |
| line (const Point &from, const Point &to) | |
| Construct from two points. | |
| line (const UList< Point > &points, const FixedList< label, 2 > &indices) | |
| Construct from two points in the list of points. | |
| line (Istream &is) | |
| Construct from Istream. | |
| PointRef | a () const noexcept |
| The first point. | |
| PointRef | b () const noexcept |
| The second point. | |
| PointRef | first () const noexcept |
| The first point. | |
| PointRef | second () const noexcept |
| The second (last) point. | |
| PointRef | start () const noexcept |
| The start (first) point. | |
| PointRef | end () const noexcept |
| The end (second) point. | |
| PointRef | last () const noexcept |
| The last (second) point. | |
| Point | centre () const |
| Return centre (centroid). | |
| scalar | mag () const |
| The magnitude (length) of the line. | |
| scalar | magSqr () const |
| The magnitude squared (length squared) of the line. | |
| Point | vec () const |
| Return start-to-end vector. | |
| Point | unitVec () const |
| Return the unit vector (start-to-end). | |
| Pair< Point > | box () const |
| The enclosing (bounding) box for the line. | |
| PointHit< Point > | nearestDist (const Point &p) const |
| Return nearest distance to line from a given point. | |
| 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. | |
| 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 | |
Static Public Member Functions | |
| static Pair< Point > | box (const Point &p0, const Point &p1) |
| The enclosing (bounding) box for two points. | |
Friends | |
| Istream & | operator>> (Istream &, line &) |
| Ostream & | operator (Ostream &, const line &) |
A line primitive.
Construct from two points.
Definition at line 44 of file lineI.H.
Referenced by treeDataEdge::line(), and nearestDist().

|
inlinenoexcept |
The first point.
Definition at line 227 of file line.H.
Referenced by Foam::areaInvDistSqrWeightedNormalFaceTriangle(), Foam::areaNormalFaceTriangle(), mag(), magSqr(), nearestDist(), and vec().

|
inlinenoexcept |
The second point.
Definition at line 232 of file line.H.
Referenced by Foam::areaInvDistSqrWeightedNormalFaceTriangle(), Foam::areaNormalFaceTriangle(), nearestDist(), and nearestDist().

|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
The start (first) point.
Definition at line 247 of file line.H.
Referenced by plane::lineIntersect(), slidingInterface::modifyMotionPoints(), and nearestDist().

|
inlinenoexcept |
The end (second) point.
Definition at line 252 of file line.H.
Referenced by nearestDist().

|
inlinenoexcept |
|
inlinestatic |
The enclosing (bounding) box for two points.
Definition at line 155 of file lineI.H.
References Foam::max(), Foam::min(), and p0.

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.
Referenced by Foam::calcLeVector(), and slidingInterface::modifyMotionPoints().


|
inline |
Return start-to-end vector.
Definition at line 122 of file lineI.H.
Referenced by Foam::calcLeVector(), plane::lineIntersect(), slidingInterface::modifyMotionPoints(), and nearestDist().


Return the unit vector (start-to-end).
Definition at line 135 of file lineI.H.
References Foam::mag(), s(), and Foam::Zero.
Referenced by Foam::calcLeVector(), refinementFeatures::findNearestEdge(), and refinementFeatures::findNearestRegionEdge().


|
inline |
| 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 179 of file lineI.H.
References b(), Foam::mag(), p, and vec().
Referenced by treeDataEdge::findNearest(), treeDataFace::getVolumeType(), slidingInterface::modifyMotionPoints(), nearestDist(), treeDataEdge::findNearestOp::operator()(), 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 211 of file lineI.H.
References a(), b, b(), PointHit< PointType >::distance(), edge::end(), end(), line(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::min(), nearestDist(), PointHit< PointType >::point(), s(), edge::start(), and start().

| scalar nearestDist | ( | const line< point2D, const point2D & > & | edge, |
| point2D & | thisPoint, | ||
| point2D & | edgePoint ) const |
2D specialisation
|
friend |
|
friend |