A line primitive. More...
#include <OpenFOAM/line.H>
A line primitive.
Definition at line 69 of file line.H.
Public Member Functions | |
line (const Point &start, const Point &end) | |
Construct from two points.
| |
line (Istream &) | |
Construct from Istream.
| |
PointRef | start () const |
Return first vertex.
| |
PointRef | end () const |
Return second vertex.
| |
Point | centre () const |
Return centre (centroid)
| |
scalar | mag () const |
Return scalar magnitude.
| |
Point | vec () const |
Return start-end vector.
| |
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.
| |
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 |
Friends | |
Istream & | operator>> (Istream &, line &) |
Ostream & | operator (Ostream &, const line &) |
line | ( | const Point & | start, |
const Point & | end | ||
) | [inline]
|
Construct from Istream.
Definition at line 44 of file lineI.H.
References IOstream::check(), Istream::readBegin(), and Istream::readEnd().
PointRef start | ( | ) | const [inline]
|
Return first vertex.
Definition at line 62 of file lineI.H.
Referenced by treeLeaf< Type >::findNearest(), treeDataPoint::findNearest(), treeDataEdge::findNearest(), plane::lineIntersect(), slidingInterface::modifyMotionPoints(), and line< Point, PointRef >::nearestDist().
PointRef end | ( | ) | const [inline]
|
Return second vertex.
Definition at line 68 of file lineI.H.
Referenced by treeLeaf< Type >::findNearest(), treeDataPoint::findNearest(), treeDataEdge::findNearest(), and line< Point, PointRef >::nearestDist().
Point centre | ( | ) | const [inline]
|
Return centre (centroid)
Definition at line 75 of file lineI.H.
Referenced by treeNode< Type >::findNearest(), and surfaceFeatures::nearestSurfEdge().
scalar mag | ( | ) | const [inline]
|
Return scalar magnitude.
Definition at line 82 of file lineI.H.
References Foam::mag().
Referenced by slidingInterface::modifyMotionPoints().
Point vec | ( | ) | const [inline]
|
Return start-end vector.
Definition at line 89 of file lineI.H.
Referenced by plane::lineIntersect(), and slidingInterface::modifyMotionPoints().
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 96 of file lineI.H.
References b, and Foam::mag().
Referenced by octreeDataPoint::calcNearest(), octreeDataEdges::calcNearest(), treeDataPoint::findNearest(), treeDataEdge::findNearest(), slidingInterface::modifyMotionPoints(), line< Point, PointRef >::nearestDist(), surfaceFeatures::nearestSamples(), and faceCollapser::setRefinement().
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 126 of file lineI.H.
References b, PointHit< Point >::distance(), line< Point, PointRef >::end(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::min(), line< Point, PointRef >::nearestDist(), PointHit< Point >::rawPoint(), and line< Point, PointRef >::start().
scalar nearestDist | ( | const line< point2D, const point2D & > & | e, |
point2D & | thisPt, | ||
point2D & | edgePt | ||
) | const |
Definition at line 37 of file line.C.
References d, line< Point, PointRef >::end(), Foam::mag(), Foam::max(), Foam::min(), line< Point, PointRef >::nearestDist(), Vector2D< Cmpt >::perp(), and line< Point, PointRef >::start().
scalar nearestDist | ( | const line< point2D, const point2D & > & | edge, |
point2D & | thisPoint, | ||
point2D & | edgePoint | ||
) | const |