Visual Computing Library
Loading...
Searching...
No Matches
vcl::Plane< Scalar, NORM > Class Template Reference

The Plane class represent a 2D plane in 3D space. More...

#include <vclib/space/core/plane.h>

Public Types

using ScalarType = Scalar
 
using PointType = Point3< Scalar >
 

Public Member Functions

 Plane ()
 Empty constructor. The plane is uninitialized.
 
 Plane (const Point3< Scalar > &direction, Scalar offset)
 Constructor of a plane given a direction and an offset.
 
 Plane (const Point3< Scalar > &p0, const Point3< Scalar > &normal)
 Constructor of a plane given a point lying to the plane and the normal of the plane.
 
 Plane (const Point3< Scalar > &p0, const Point3< Scalar > &p1, const Point3< Scalar > &p2)
 Constructor of a plane given three points.
 
template<typename S >
auto cast () const
 
const Point3< Scalar > & direction () const
 Returns the direction component of the plane.
 
Scalar offset () const
 Returns the offset component of the plane.
 
Point3< Scalar > projectPoint (const Point3< Scalar > &p) const
 Given a point, returns the point projected to this plane.
 
Point3< Scalar > mirrorPoint (const Point3< Scalar > &p) const
 Given a point, returns the point mirrored w.r.t. this plane.
 
bool operator== (const Plane &p) const
 
bool operator!= (const Plane &p) const
 

Private Attributes

Point3< Scalar > mDir
 
Scalar mOffset
 

Detailed Description

template<typename Scalar, bool NORM = true>
class vcl::Plane< Scalar, NORM >

The Plane class represent a 2D plane in 3D space.

This is the class for infinite planes in 3D space. A Plane is stored just as a Point3 and a scalar:

  • a direction (not necessarily normalized),
  • an offset from the origin

Just to be clear, given a point p on a plane it always holds: plane.direction().dot(p) == plane.offset()

A vcl::Plane, once initialized, cannot be changed.

Constructor & Destructor Documentation

◆ Plane() [1/3]

template<typename Scalar , bool NORM = true>
vcl::Plane< Scalar, NORM >::Plane ( const Point3< Scalar > &  direction,
Scalar  offset 
)
inline

Constructor of a plane given a direction and an offset.

Parameters
direction
offset

◆ Plane() [2/3]

template<typename Scalar , bool NORM = true>
vcl::Plane< Scalar, NORM >::Plane ( const Point3< Scalar > &  p0,
const Point3< Scalar > &  normal 
)
inline

Constructor of a plane given a point lying to the plane and the normal of the plane.

Parameters
p0
normal

◆ Plane() [3/3]

template<typename Scalar , bool NORM = true>
vcl::Plane< Scalar, NORM >::Plane ( const Point3< Scalar > &  p0,
const Point3< Scalar > &  p1,
const Point3< Scalar > &  p2 
)
inline

Constructor of a plane given three points.

Parameters
p0
p1
p2

Member Function Documentation

◆ direction()

template<typename Scalar , bool NORM = true>
const Point3< Scalar > & vcl::Plane< Scalar, NORM >::direction ( ) const
inline

Returns the direction component of the plane.

Returns

◆ mirrorPoint()

template<typename Scalar , bool NORM = true>
Point3< Scalar > vcl::Plane< Scalar, NORM >::mirrorPoint ( const Point3< Scalar > &  p) const
inline

Given a point, returns the point mirrored w.r.t. this plane.

Parameters
p
Returns

◆ offset()

template<typename Scalar , bool NORM = true>
Scalar vcl::Plane< Scalar, NORM >::offset ( ) const
inline

Returns the offset component of the plane.

Returns

◆ projectPoint()

template<typename Scalar , bool NORM = true>
Point3< Scalar > vcl::Plane< Scalar, NORM >::projectPoint ( const Point3< Scalar > &  p) const
inline

Given a point, returns the point projected to this plane.

Parameters
p
Returns

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