Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
geo::PlaneBase< Vector > Class Template Reference

A base for a plane in space. More...

#include <Decomposer.h>

Public Types

using Vector_t = Vector
 Type for the vector in space. More...
 

Public Member Functions

 PlaneBase (Vector_t const &main, Vector_t const &secondary)
 Constructor: assigns the axes. More...
 
Vector_t const & MainDir () const
 Returns the main axis direction. More...
 
Vector_t const & SecondaryDir () const
 Returns the secondary axis direction. More...
 
Vector_t const & NormalDir () const
 Returns the axis normal to the plane. More...
 
void SetMainDir (Vector_t const &dir)
 Change the main direction of the projection base. More...
 
void SetSecondaryDir (Vector_t const &dir)
 Change the secondary direction of the projection base. More...
 

Static Public Member Functions

static Vector_t PastorizeUnitVector (Vector_t dir)
 Normalizes and rounds a direction vector. More...
 

Static Public Attributes

static constexpr double RoundingTol = 1e-4
 Rounding threshold for vectors. More...
 

Private Member Functions

Vector_t ComputeNormal () const
 Computes the normal to the plane. More...
 
void ResetNormal ()
 Reset normal to the plane. More...
 

Private Attributes

Vector_t fMain
 Main axis on the plane. More...
 
Vector_t fSecondary
 Secondary axis on the plane. More...
 
Vector_t fNormal
 Axis normal to the plane. More...
 

Detailed Description

template<typename Vector>
class geo::PlaneBase< Vector >

A base for a plane in space.


The base contains the two axes, a "main" one ( $ \hat{u} $) and a "secondary" one ( $ \hat{v} $). It also defines a normal ( $ \hat{n} $) to the plane so that the base is positive defined (( $ \hat{u} \times \hat{v} \cdot \hat{m} = +1 $).

Definition at line 39 of file Decomposer.h.

Member Typedef Documentation

template<typename Vector>
using geo::PlaneBase< Vector >::Vector_t = Vector

Type for the vector in space.

Definition at line 41 of file Decomposer.h.

Constructor & Destructor Documentation

template<typename Vector>
geo::PlaneBase< Vector >::PlaneBase ( Vector_t const &  main,
Vector_t const &  secondary 
)
inline

Constructor: assigns the axes.

Definition at line 47 of file Decomposer.h.

49  , fSecondary(PastorizeUnitVector(secondary))
51  {}
Vector_t fSecondary
Secondary axis on the plane.
Definition: Decomposer.h:76
Vector_t fNormal
Axis normal to the plane.
Definition: Decomposer.h:77
static Vector_t PastorizeUnitVector(Vector_t dir)
Normalizes and rounds a direction vector.
Definition: Decomposer.h:71
Vector_t ComputeNormal() const
Computes the normal to the plane.
Definition: Decomposer.h:80
Vector_t fMain
Main axis on the plane.
Definition: Decomposer.h:75

Member Function Documentation

template<typename Vector>
Vector_t geo::PlaneBase< Vector >::ComputeNormal ( ) const
inlineprivate

Computes the normal to the plane.

Definition at line 80 of file Decomposer.h.

81  { return PastorizeUnitVector(MainDir().Cross(SecondaryDir())); }
Vector_t const & MainDir() const
Returns the main axis direction.
Definition: Decomposer.h:54
static Vector_t PastorizeUnitVector(Vector_t dir)
Normalizes and rounds a direction vector.
Definition: Decomposer.h:71
Vector_t const & SecondaryDir() const
Returns the secondary axis direction.
Definition: Decomposer.h:57
template<typename Vector>
Vector_t const& geo::PlaneBase< Vector >::MainDir ( ) const
inline

Returns the main axis direction.

Definition at line 54 of file Decomposer.h.

54 { return fMain; }
Vector_t fMain
Main axis on the plane.
Definition: Decomposer.h:75
template<typename Vector>
Vector_t const& geo::PlaneBase< Vector >::NormalDir ( ) const
inline

Returns the axis normal to the plane.

Definition at line 60 of file Decomposer.h.

60 { return fNormal; }
Vector_t fNormal
Axis normal to the plane.
Definition: Decomposer.h:77
template<typename Vector>
static Vector_t geo::PlaneBase< Vector >::PastorizeUnitVector ( Vector_t  dir)
inlinestatic

Normalizes and rounds a direction vector.

Definition at line 71 of file Decomposer.h.

string dir
Vector rounded01(Vector const &v, Scalar tol)
Returns a vector with all components rounded if close to 0, -1 or +1.
static constexpr double RoundingTol
Rounding threshold for vectors.
Definition: Decomposer.h:44
Vector normalize(Vector const &v)
Returns a vector parallel to v and with norm 1.
template<typename Vector>
void geo::PlaneBase< Vector >::ResetNormal ( )
inlineprivate

Reset normal to the plane.

Definition at line 84 of file Decomposer.h.

84 { fNormal = ComputeNormal(); }
Vector_t fNormal
Axis normal to the plane.
Definition: Decomposer.h:77
Vector_t ComputeNormal() const
Computes the normal to the plane.
Definition: Decomposer.h:80
template<typename Vector>
Vector_t const& geo::PlaneBase< Vector >::SecondaryDir ( ) const
inline

Returns the secondary axis direction.

Definition at line 57 of file Decomposer.h.

57 { return fSecondary; }
Vector_t fSecondary
Secondary axis on the plane.
Definition: Decomposer.h:76
template<typename Vector>
void geo::PlaneBase< Vector >::SetMainDir ( Vector_t const &  dir)
inline

Change the main direction of the projection base.

Definition at line 63 of file Decomposer.h.

63 { fMain = dir; ResetNormal(); }
string dir
void ResetNormal()
Reset normal to the plane.
Definition: Decomposer.h:84
Vector_t fMain
Main axis on the plane.
Definition: Decomposer.h:75
template<typename Vector>
void geo::PlaneBase< Vector >::SetSecondaryDir ( Vector_t const &  dir)
inline

Change the secondary direction of the projection base.

Definition at line 66 of file Decomposer.h.

67  { fSecondary = dir; ResetNormal(); }
Vector_t fSecondary
Secondary axis on the plane.
Definition: Decomposer.h:76
string dir
void ResetNormal()
Reset normal to the plane.
Definition: Decomposer.h:84

Member Data Documentation

template<typename Vector>
Vector_t geo::PlaneBase< Vector >::fMain
private

Main axis on the plane.

Definition at line 75 of file Decomposer.h.

template<typename Vector>
Vector_t geo::PlaneBase< Vector >::fNormal
private

Axis normal to the plane.

Definition at line 77 of file Decomposer.h.

template<typename Vector>
Vector_t geo::PlaneBase< Vector >::fSecondary
private

Secondary axis on the plane.

Definition at line 76 of file Decomposer.h.

template<typename Vector>
constexpr double geo::PlaneBase< Vector >::RoundingTol = 1e-4
static

Rounding threshold for vectors.

Definition at line 44 of file Decomposer.h.


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