FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

line< Point, PointRef > Class Template Reference

A line primitive. More...

#include <OpenFOAM/line.H>


Detailed Description

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

A line primitive.

Source files

Definition at line 69 of file line.H.

List of all members.

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 &)

Constructor & Destructor Documentation

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

Construct from two points.

Definition at line 36 of file lineI.H.

line ( Istream &   is  ) [inline]

Construct from Istream.

Definition at line 44 of file lineI.H.

References IOstream::check(), Istream::readBegin(), and Istream::readEnd().


Member Function Documentation

PointRef end (  ) const [inline]
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
scalar nearestDist ( const line< point2D, const point2D & > &   edge,
point2D &   thisPoint,
point2D &   edgePoint  
) const

Friends And Related Function Documentation

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

The documentation for this class was generated from the following files:
  • src/OpenFOAM/meshes/primitiveShapes/line/line.H
  • src/OpenFOAM/meshes/primitiveShapes/line/lineI.H