SpatiumLib
Public Member Functions | Protected Attributes | Friends | List of all members
spatium::geom3d::Plane Class Reference

Plane geometry. More...

#include <Plane.h>

Inheritance diagram for spatium::geom3d::Plane:
Inheritance graph
[legend]
Collaboration diagram for spatium::geom3d::Plane:
Collaboration graph
[legend]

Public Member Functions

 Plane (const Point3 &origin, const Vector3 &normal)
 Constructor. More...
 
 Plane (const Vector3 &normal)
 Constructor. More...
 
 Plane (const Plane &other)=default
 Copy constructor. More...
 
Planeoperator= (const Plane &other)=default
 Assignment operator. More...
 
virtual ~Plane ()=default
 Destructor. More...
 
void origin (const Point3 &origin)
 Set origin of plane. More...
 
Point3 origin () const
 Get origin of plane. More...
 
void normal (const Vector3 &normal)
 Set normal of plane. More...
 
Vector3 normal () const
 Get normal of plane. More...
 
double distanceTo (const Point3 &point) const override
 Calculate Euclidean distance to point. More...
 
Point3 projectPoint (const Point3 &point) const override
 Project point onto plane. More...
 
bool intersectLine (const Point3 &origin, const Vector3 &direction, Point3 &intersection) const override
 Intersect line with plane. There is no intersection if the line is parallel to the plane. More...
 
Vector3 projectVector (const Vector3 &vector) const
 Project vector onto plane. More...
 
- Public Member Functions inherited from spatium::geom3d::Geometry
 Geometry ()=default
 
virtual ~Geometry ()=default
 

Protected Attributes

Point3 m_origin
 
Vector3 m_normal
 

Friends

std::ostream & operator<< (std::ostream &os, const Plane &plane)
 Output to ostream. More...
 

Detailed Description

Plane geometry.

A plane is defined by a point (origin) and a vector perpendicular to the plane (normal).

Constructor & Destructor Documentation

◆ Plane() [1/3]

spatium::geom3d::Plane::Plane ( const Point3 origin,
const Vector3 normal 
)
inline

Constructor.

Parameters
[in]originOrigin
[in]normalNormal

◆ Plane() [2/3]

spatium::geom3d::Plane::Plane ( const Vector3 normal)
inline

Constructor.

Parameters
[in]normalNormal

◆ Plane() [3/3]

spatium::geom3d::Plane::Plane ( const Plane other)
default

Copy constructor.

◆ ~Plane()

virtual spatium::geom3d::Plane::~Plane ( )
virtualdefault

Destructor.

Member Function Documentation

◆ distanceTo()

double spatium::geom3d::Plane::distanceTo ( const Point3 point) const
inlineoverridevirtual

Calculate Euclidean distance to point.

Parameters
[in]pointPoint
Returns
Distance to point

Implements spatium::geom3d::Geometry.

◆ intersectLine()

bool spatium::geom3d::Plane::intersectLine ( const Point3 origin,
const Vector3 direction,
Point3 intersection 
) const
inlineoverridevirtual

Intersect line with plane. There is no intersection if the line is parallel to the plane.

Parameters
[in]originOrigin of line
[in]directionDirection of line
[out]intersectionIntersection point
Returns
True if there is an intersection, otherwise false

Implements spatium::geom3d::Geometry.

◆ normal() [1/2]

void spatium::geom3d::Plane::normal ( const Vector3 normal)
inline

Set normal of plane.

Parameters
[in]normalNormal

◆ normal() [2/2]

Vector3 spatium::geom3d::Plane::normal ( ) const
inline

Get normal of plane.

Returns
Normal

◆ operator=()

Plane& spatium::geom3d::Plane::operator= ( const Plane other)
default

Assignment operator.

◆ origin() [1/2]

void spatium::geom3d::Plane::origin ( const Point3 origin)
inline

Set origin of plane.

Parameters
[in]originOrigin

◆ origin() [2/2]

Point3 spatium::geom3d::Plane::origin ( ) const
inline

Get origin of plane.

Returns
Origin

◆ projectPoint()

Point3 spatium::geom3d::Plane::projectPoint ( const Point3 point) const
inlineoverridevirtual

Project point onto plane.

Parameters
[in]pointPoint
Returns
Projected point

Implements spatium::geom3d::Geometry.

◆ projectVector()

Vector3 spatium::geom3d::Plane::projectVector ( const Vector3 vector) const
inline

Project vector onto plane.

Parameters
[in]vectorVector
Returns
Projected vector

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Plane plane 
)
friend

Output to ostream.

Member Data Documentation

◆ m_normal

Vector3 spatium::geom3d::Plane::m_normal
protected

◆ m_origin

Point3 spatium::geom3d::Plane::m_origin
protected

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