OpenFOAM logo
Open Source CFD Toolkit

line Class Template Reference

Collaboration diagram for line:

Collaboration graph
[legend]
List of all members.

template<class Point, class PointRef>
class Foam::line< Point, PointRef >


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.
vector vec () const
 Return start-end vector.
pointHit 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.

Friends

Istreamoperator>> (Istream &, line &)
Ostreamoperator (Ostream &, const line &)

Constructor & Destructor Documentation

line const Point &  start,
const Point &  end
[inline]
 

Construct from two points.

Definition at line 48 of file lineI.H.

References Istream::readBegin().

Here is the call graph for this function:

line Istream  )  [inline]
 

Construct from Istream.

Definition at line 56 of file lineI.H.


Member Function Documentation

Point centre  )  const [inline]
 

Return centre (centroid).

Definition at line 87 of file lineI.H.

References Foam::mag(), and line::vec().

Here is the call graph for this function:

PointRef end  )  const [inline]
 

Return second vertex.

Definition at line 80 of file lineI.H.

scalar mag  )  const [inline]
 

Return scalar magnitude.

Definition at line 94 of file lineI.H.

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 141 of file lineI.H.

References Foam::vector.

pointHit 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 109 of file lineI.H.

References p.

PointRef start  )  const [inline]
 

Return first vertex.

Definition at line 74 of file lineI.H.

vector vec  )  const [inline]
 

Return start-end vector.

Definition at line 101 of file lineI.H.

References p, Foam::point, and Foam::vector.

Referenced by line::centre().


Friends And Related Function Documentation

Ostream& operator Ostream ,
const line< Point, PointRef > & 
[friend]
 

Istream& operator>> Istream ,
line< Point, PointRef > & 
[friend]
 


The documentation for this class was generated from the following files:
For further information go to www.openfoam.org