All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
plane Class Reference

Geometric class that creates a 2D plane and can return the intersection point between a line and the plane. More...

Inheritance diagram for plane:

Classes

class  ray
 A direction and a reference point. More...
 

Public Types

enum  side { NORMAL, FLIP }
 Side of the plane. More...
 

Public Member Functions

 plane (const vector &normalVector)
 Construct from normal vector through the origin. More...
 
 plane (const point &basePoint, const vector &normalVector)
 Construct from normal vector and point in plane. More...
 
 plane (const point &point1, const point &point2, const point &point3)
 Construct from three points in plane. More...
 
 plane (const scalarList &C)
 Construct from coefficients for the. More...
 
 plane (const dictionary &planeDict)
 Construct from dictionary. More...
 
 plane (Istream &is)
 Construct from Istream. Assumes the base + normal notation. More...
 
const vectornormal () const
 Return plane normal. More...
 
const pointrefPoint () const
 Return or return plane base point. More...
 
FixedList< scalar, 4 > planeCoeffs () const
 Return coefficients for the. More...
 
point aPoint () const
 Return a point on the plane. More...
 
point nearestPoint (const point &p) const
 Return nearest point in the plane for the given point. More...
 
scalar distance (const point &p) const
 Return distance from the given point to the plane. More...
 
scalar normalIntersect (const point &pnt0, const vector &dir) const
 Return cut coefficient for plane and line defined by. More...
 
scalar normalIntersect (const ray &r) const
 Return cut coefficient for plane and ray. More...
 
template<class Point , class PointRef >
scalar lineIntersect (const line< Point, PointRef > &l) const
 Return the cutting point between the plane and. More...
 
ray planeIntersect (const plane &) const
 Return the cutting line between this plane and another. More...
 
point planePlaneIntersect (const plane &, const plane &) const
 Return the cutting point between this plane and two other planes. More...
 
side sideOfPlane (const point &p) const
 Return the side of the plane that the point is on. More...
 
point mirror (const point &p) const
 Mirror the supplied point in the plane. Return the mirrored point. More...
 
void writeDict (Ostream &) const
 Write to dictionary. More...
 

Friends

bool operator== (const plane &, const plane &)
 
bool operator!= (const plane &, const plane &)
 
Ostreamoperator<< (Ostream &, const plane &)
 Write plane properties. More...
 

Detailed Description

Geometric class that creates a 2D plane and can return the intersection point between a line and the plane.

Source files

Definition at line 60 of file plane.H.

Member Enumeration Documentation

◆ side

enum side

Side of the plane.

Enumerator
NORMAL 
FLIP 

Definition at line 65 of file plane.H.

Constructor & Destructor Documentation

◆ plane() [1/6]

plane ( const vector normalVector)
explicit

Construct from normal vector through the origin.

Definition at line 97 of file plane.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::mag().

Referenced by plane::ray::dir(), and plane::plane().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plane() [2/6]

plane ( const point basePoint,
const vector normalVector 
)

Construct from normal vector and point in plane.

Definition at line 117 of file plane.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::mag().

Here is the call graph for this function:

◆ plane() [3/6]

plane ( const point point1,
const point point2,
const point point3 
)

Construct from three points in plane.

Definition at line 144 of file plane.C.

◆ plane() [4/6]

plane ( const scalarList C)
explicit

Construct from coefficients for the.

plane equation: ax + by + cz + d = 0

Definition at line 137 of file plane.C.

References plane::plane().

Here is the call graph for this function:

◆ plane() [5/6]

plane ( const dictionary planeDict)
explicit

Construct from dictionary.

Definition at line 154 of file plane.C.

References Foam::abort(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::found(), dictionary::lookup(), Foam::mag(), Foam::nl, and dictionary::subDict().

Here is the call graph for this function:

◆ plane() [6/6]

plane ( Istream is)
explicit

Construct from Istream. Assumes the base + normal notation.

Definition at line 211 of file plane.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::mag().

Here is the call graph for this function:

Member Function Documentation

◆ normal()

const Foam::vector & normal ( ) const

Return plane normal.

Definition at line 233 of file plane.C.

Referenced by geomCellLooper::cut(), plane::ray::dir(), plane::mirror(), NamedEnum< compressibleField, 8 >::names(), plane::planeIntersect(), and cuttingPlane::reCut().

Here is the caller graph for this function:

◆ refPoint()

const Foam::point & refPoint ( ) const

Return or return plane base point.

Definition at line 239 of file plane.C.

Referenced by plane::aPoint(), NamedEnum< compressibleField, 8 >::names(), plane::planeIntersect(), cuttingPlane::reCut(), and searchablePlane::size().

Here is the caller graph for this function:

◆ planeCoeffs()

Foam::FixedList< Foam::scalar, 4 > planeCoeffs ( ) const

Return coefficients for the.

plane equation: ax + by + cz + d = 0

Definition at line 245 of file plane.C.

References Foam::mag(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by plane::aPoint(), plane::ray::dir(), and plane::planePlaneIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aPoint()

Foam::point aPoint ( ) const

Return a point on the plane.

Definition at line 292 of file plane.C.

References Foam::e, Foam::mag(), plane::planeCoeffs(), plane::refPoint(), x, Vector< Cmpt >::x(), y, Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by plane::ray::dir(), and triSurface::triSurfInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestPoint()

Foam::point nearestPoint ( const point p) const

Return nearest point in the plane for the given point.

Definition at line 359 of file plane.C.

Referenced by plane::ray::dir(), and plane::mirror().

Here is the caller graph for this function:

◆ distance()

Foam::scalar distance ( const point p) const

Return distance from the given point to the plane.

Definition at line 365 of file plane.C.

References Foam::mag(), and plane::normalIntersect().

Referenced by geomCellLooper::cut(), plane::ray::dir(), and plane::mirror().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalIntersect() [1/2]

Foam::scalar normalIntersect ( const point pnt0,
const vector dir 
) const

Return cut coefficient for plane and line defined by.

origin and direction

Definition at line 372 of file plane.C.

References Foam::mag().

Referenced by plane::ray::dir(), plane::distance(), plane::lineIntersect(), and plane::normalIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalIntersect() [2/2]

scalar normalIntersect ( const ray r) const
inline

Return cut coefficient for plane and ray.

Definition at line 178 of file plane.H.

References plane::ray::dir(), plane::normalIntersect(), and plane::ray::refPoint().

Here is the call graph for this function:

◆ lineIntersect()

scalar lineIntersect ( const line< Point, PointRef > &  l) const
inline

Return the cutting point between the plane and.

a line passing through the supplied points

Definition at line 186 of file plane.H.

References plane::mirror(), plane::normalIntersect(), plane::operator!=, plane::operator<<, plane::operator==, plane::planeIntersect(), plane::planePlaneIntersect(), plane::sideOfPlane(), line< Point, PointRef >::start(), line< Point, PointRef >::vec(), and plane::writeDict().

Referenced by slidingInterface::modifyMotionPoints(), and Foam::selectCutEdges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ planeIntersect()

Foam::plane::ray planeIntersect ( const plane plane2) const

Return the cutting line between this plane and another.

Returned as direction vector and point line goes through.

Definition at line 384 of file plane.C.

References Foam::mag(), plane::normal(), plane::planePlaneIntersect(), plane::refPoint(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by searchableSurfacesQueries::findNearest(), plane::lineIntersect(), and listPlusEqOp< T >::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ planePlaneIntersect()

Foam::point planePlaneIntersect ( const plane plane2,
const plane plane3 
) const

Return the cutting point between this plane and two other planes.

Definition at line 452 of file plane.C.

References Foam::constant::physicoChemical::b, Foam::inv(), and plane::planeCoeffs().

Referenced by plane::lineIntersect(), listPlusEqOp< T >::operator()(), and plane::planeIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sideOfPlane()

Foam::plane::side sideOfPlane ( const point p) const

Return the side of the plane that the point is on.

If the point is on the plane, then returns NORMAL.

Definition at line 474 of file plane.C.

References plane::FLIP, and plane::NORMAL.

Referenced by plane::lineIntersect().

Here is the caller graph for this function:

◆ mirror()

Foam::point mirror ( const point p) const

Mirror the supplied point in the plane. Return the mirrored point.

Definition at line 482 of file plane.C.

References plane::distance(), plane::nearestPoint(), and plane::normal().

Referenced by plane::lineIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeDict()

void writeDict ( Ostream os) const

Write to dictionary.

Definition at line 497 of file plane.C.

References token::BEGIN_BLOCK, Foam::decrIndent(), token::END_BLOCK, Foam::endl(), Foam::incrIndent(), Foam::indent(), Foam::nl, and Foam::writeEntry().

Referenced by plane::lineIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator==

bool operator== ( const plane ,
const plane  
)
friend

Referenced by plane::lineIntersect().

◆ operator!=

bool operator!= ( const plane ,
const plane  
)
friend

Referenced by plane::lineIntersect().

◆ operator<<

Ostream& operator<< ( Ostream ,
const plane  
)
friend

Write plane properties.

Referenced by plane::lineIntersect().


The documentation for this class was generated from the following files: