Developer Documentation
ACG::Geometry::PlaneT< Scalar > Class Template Reference

#include <ACG/Geometry/Types/Plane.hh>

Public Types

enum  IntersectionTarget { Line , LineSegment , Ray }
 
typedef VectorT< Scalar, 3 > Vec3
 typedefs More...
 
typedef VectorT< Scalar, 4 > Vec4
 
typedef Matrix4x4T< Scalar > Mat4x4
 

Public Member Functions

 PlaneT (Scalar _a=0, Scalar _b=0, Scalar _c=0, Scalar _d=0)
 constructor: coefficients More...
 
 PlaneT (const Vec3 &_o, const Vec3 &_n)
 constructor: origin and normal More...
 
 PlaneT (const Vec3 &_v0, const Vec3 &_v1, const Vec3 &_v2)
 constructor: 3 points More...
 
Vec3 normal () const
 normal vector More...
 
const Vec4coeffs () const
 coeffitients More...
 
Scalar distance (const Vec3 &_v) const
 signed distance point-plane More...
 
bool operator() (const Vec3 &_v) const
 predicate: above plane More...
 
bool intersect_line (const Vec3 &_v0, const Vec3 &_v1, Vec3 &_v, Scalar &_t) const
 
bool intersect_ray (const Vec3 &_v0, const Vec3 &_v1, Vec3 &_v, Scalar &_t) const
 
bool intersect_linesegment (const Vec3 &_v0, const Vec3 &_v1, Vec3 &_v, Scalar &_t) const
 
bool intersect (const Vec3 &_v0, const Vec3 &_v1, Vec3 &_v, Scalar &_t, IntersectionTarget _target) const
 General intersection function. More...
 
bool affine_transformation (const Mat4x4 &_M)
 affine transformation of the plane More...
 
void affine_transformation_precomp (const Mat4x4 &_M_inverseTransposed)
 affine transformation of the plane (M^{-T} precomputed) More...
 

Private Member Functions

void HNF ()
 

Private Attributes

Vec4 coeffs_
 

Detailed Description

template<typename Scalar>
class ACG::Geometry::PlaneT< Scalar >

This class stores a plane in normal form and provides useful algorithms for left/right test, itersection, and so on.

Definition at line 78 of file PlaneT.hh.

Member Typedef Documentation

◆ Mat4x4

template<typename Scalar >
typedef Matrix4x4T<Scalar> ACG::Geometry::PlaneT< Scalar >::Mat4x4

Definition at line 85 of file PlaneT.hh.

◆ Vec3

template<typename Scalar >
typedef VectorT<Scalar, 3> ACG::Geometry::PlaneT< Scalar >::Vec3

typedefs

Definition at line 83 of file PlaneT.hh.

◆ Vec4

template<typename Scalar >
typedef VectorT<Scalar, 4> ACG::Geometry::PlaneT< Scalar >::Vec4

Definition at line 84 of file PlaneT.hh.

Member Enumeration Documentation

◆ IntersectionTarget

template<typename Scalar >
enum ACG::Geometry::PlaneT::IntersectionTarget

Definition at line 132 of file PlaneT.hh.

Constructor & Destructor Documentation

◆ PlaneT() [1/3]

template<typename Scalar >
ACG::Geometry::PlaneT< Scalar >::PlaneT ( Scalar  _a = 0,
Scalar  _b = 0,
Scalar  _c = 0,
Scalar  _d = 0 
)
inline

constructor: coefficients

Definition at line 89 of file PlaneT.hh.

◆ PlaneT() [2/3]

template<typename Scalar >
ACG::Geometry::PlaneT< Scalar >::PlaneT ( const Vec3 _o,
const Vec3 _n 
)
inline

constructor: origin and normal

Definition at line 95 of file PlaneT.hh.

◆ PlaneT() [3/3]

template<typename Scalar >
ACG::Geometry::PlaneT< Scalar >::PlaneT ( const Vec3 _v0,
const Vec3 _v1,
const Vec3 _v2 
)
inline

constructor: 3 points

Definition at line 101 of file PlaneT.hh.

Member Function Documentation

◆ affine_transformation()

template<typename Scalar >
bool ACG::Geometry::PlaneT< Scalar >::affine_transformation ( const Mat4x4 _M)
inline

affine transformation of the plane

Definition at line 201 of file PlaneT.hh.

◆ affine_transformation_precomp()

template<typename Scalar >
void ACG::Geometry::PlaneT< Scalar >::affine_transformation_precomp ( const Mat4x4 _M_inverseTransposed)
inline

affine transformation of the plane (M^{-T} precomputed)

Definition at line 212 of file PlaneT.hh.

◆ coeffs()

template<typename Scalar >
const Vec4 & ACG::Geometry::PlaneT< Scalar >::coeffs ( ) const
inline

coeffitients

Definition at line 114 of file PlaneT.hh.

◆ distance()

template<typename Scalar >
Scalar ACG::Geometry::PlaneT< Scalar >::distance ( const Vec3 _v) const
inline

signed distance point-plane

Definition at line 118 of file PlaneT.hh.

◆ HNF()

template<typename Scalar >
void ACG::Geometry::PlaneT< Scalar >::HNF ( )
inlineprivate

Definition at line 221 of file PlaneT.hh.

◆ intersect()

template<typename Scalar >
bool ACG::Geometry::PlaneT< Scalar >::intersect ( const Vec3 _v0,
const Vec3 _v1,
Vec3 _v,
Scalar &  _t,
IntersectionTarget  _target 
) const
inline

General intersection function.

General intersection between a line/ray and the plane.

Parameters
_v0start vector of the ray
_v1end vector of the ray
_vreturned intersection point
_treturned relative distance from the interection to _v0 compared to _v1
_targettype of intersection to test
Returns
true if an intersection was found

Definition at line 160 of file PlaneT.hh.

◆ intersect_line()

template<typename Scalar >
bool ACG::Geometry::PlaneT< Scalar >::intersect_line ( const Vec3 _v0,
const Vec3 _v1,
Vec3 _v,
Scalar &  _t 
) const
inline

Definition at line 135 of file PlaneT.hh.

◆ intersect_linesegment()

template<typename Scalar >
bool ACG::Geometry::PlaneT< Scalar >::intersect_linesegment ( const Vec3 _v0,
const Vec3 _v1,
Vec3 _v,
Scalar &  _t 
) const
inline

Definition at line 145 of file PlaneT.hh.

◆ intersect_ray()

template<typename Scalar >
bool ACG::Geometry::PlaneT< Scalar >::intersect_ray ( const Vec3 _v0,
const Vec3 _v1,
Vec3 _v,
Scalar &  _t 
) const
inline

Definition at line 140 of file PlaneT.hh.

◆ normal()

template<typename Scalar >
Vec3 ACG::Geometry::PlaneT< Scalar >::normal ( ) const
inline

normal vector

Definition at line 110 of file PlaneT.hh.

◆ operator()()

template<typename Scalar >
bool ACG::Geometry::PlaneT< Scalar >::operator() ( const Vec3 _v) const
inline

predicate: above plane

Definition at line 128 of file PlaneT.hh.

Member Data Documentation

◆ coeffs_

template<typename Scalar >
Vec4 ACG::Geometry::PlaneT< Scalar >::coeffs_
private

Definition at line 226 of file PlaneT.hh.


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