OpenWalnut  1.3.1
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
WGridTransformOrthoTemplate< T > Class Template Reference

Implements an orthogonal grid transformation. More...

#include <WGridTransformOrtho.h>

Public Types

typedef WMatrixFixed< T, 3, 1 > Vector3Type
 Convenience typedef for 3d vectors of the appropriate numerical type.

Public Member Functions

 WGridTransformOrthoTemplate ()
 Constructs an identity transform.
template<typename InputType >
 WGridTransformOrthoTemplate (WGridTransformOrthoTemplate< InputType > const &rhs)
 Copy constructor.
template<typename InputType >
 WGridTransformOrthoTemplate (InputType scaleX, InputType scaleY, InputType scaleZ)
 Construct a transformation that scales the grid space.
template<typename InputType >
 WGridTransformOrthoTemplate (WMatrix< InputType > const &mat)
 Construct a transformation from a transformation matrix.
 ~WGridTransformOrthoTemplate ()
 Destructor.
template<typename InputType >
WGridTransformOrthoTemplate< T > & operator= (WGridTransformOrthoTemplate< InputType > const &rhs)
 Assignment operator.
Vector3Type positionToWorldSpace (Vector3Type const &position) const
 Transforms a position from grid space to world space.
Vector3Type positionToGridSpace (Vector3Type const &position) const
 Transforms a position from world space to grid space.
Vector3Type directionToWorldSpace (Vector3Type const &direction) const
 Transforms a direction from grid space to world space.
Vector3Type directionToGridSpace (Vector3Type const &direction) const
 Transforms a direction from world space to grid space.
getOffsetX () const
 Returns the distance between samples in x direction.
getOffsetY () const
 Returns the distance between samples in y direction.
getOffsetZ () const
 Returns the distance between samples in z direction.
Vector3Type getDirectionX () const
 Returns the vector determining the direction of samples in x direction.
Vector3Type getDirectionY () const
 Returns the vector determining the direction of samples in y direction.
Vector3Type getDirectionZ () const
 Returns the vector determining the direction of samples in z direction.
Vector3Type getUnitDirectionX () const
 Returns the vector determining the unit (normalized) direction of samples in x direction.
Vector3Type getUnitDirectionY () const
 Returns the vector determining the unit (normalized) direction of samples in y direction.
Vector3Type getUnitDirectionZ () const
 Returns the vector determining the unit (normalized) direction of samples in z direction.
Vector3Type getOrigin () const
 Returns the position of the origin of the grid.
const Vector3TypegetScaling () const
 Returns the scaling of the grid.
WMatrix< T > getTransformationMatrix () const
 Returns a 4x4 matrix that represents the grid's transformaion.
 operator WMatrix4d () const
 Cast the transformation to the corresponding 4x4 matrix.
bool isNotRotated () const
 Check if this transform does not include a rotation.
template<typename VecType >
void translate (VecType const &vec)
 Translate by a vector.
template<typename VecType >
void scale (VecType const &scale)
 Scale the transform.

Private Member Functions

template<typename InputType >
void copyFrom (WGridTransformOrthoTemplate< InputType > const &input)
 This is a helper function which copies the parameter of another instance to its own.

Private Attributes

Vector3Type m_unitDirectionX
 normalized direction of the grid's x-axis in world coordinates
Vector3Type m_unitDirectionY
 normalized direction of the grid's y-axis in world coordinates
Vector3Type m_unitDirectionZ
 normalized direction of the grid's z-axis in world coordinates
Vector3Type m_scaling
 the scaling factors for the 3 axes, i.e. the distance between samples
Vector3Type m_origin
 the origin of the grid in world coordinates

Friends

class WGridTransformOrthoTemplate

Detailed Description

template<typename T>
class WGridTransformOrthoTemplate< T >

Implements an orthogonal grid transformation.

Definition at line 40 of file WGridTransformOrtho.h.

Member Typedef Documentation

template<typename T>
typedef WMatrixFixed< T, 3, 1 > WGridTransformOrthoTemplate< T >::Vector3Type

Convenience typedef for 3d vectors of the appropriate numerical type.

Definition at line 49 of file WGridTransformOrtho.h.

Constructor & Destructor Documentation

Constructs an identity transform.

template<typename T >
template<typename InputType >
WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate ( WGridTransformOrthoTemplate< InputType > const &  rhs)

Copy constructor.

Copies the data from an WGridTransformOrthoTemplate object with arbitary numerical type.

Parameters
rhsA WGridTransformOrthoTemplate object, which mustn't have the same numerical type.

Definition at line 275 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::copyFrom().

template<typename T >
template<typename InputType >
WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate ( InputType  scaleX,
InputType  scaleY,
InputType  scaleZ 
)

Construct a transformation that scales the grid space.

Parameters
scaleXThe scale in the x-direction.
scaleYThe scale in the y-direction.
scaleZThe scale in the z-direction.

Definition at line 282 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

template<typename T >
template<typename InputType >
WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate ( WMatrix< InputType > const &  mat)

Construct a transformation from a transformation matrix.

The provided matrix represents the transformation from grid to world space.

Parameters
matThe matrix.

Definition at line 294 of file WGridTransformOrtho.h.

References WMatrix< T >::getNbCols(), WMatrix< T >::getNbRows(), WGridTransformOrthoTemplate< T >::m_origin, WGridTransformOrthoTemplate< T >::m_scaling, WGridTransformOrthoTemplate< T >::m_unitDirectionX, WGridTransformOrthoTemplate< T >::m_unitDirectionY, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

template<typename T >
WGridTransformOrthoTemplate< T >::~WGridTransformOrthoTemplate ( )

Destructor.

Definition at line 315 of file WGridTransformOrtho.h.

Member Function Documentation

template<typename T >
template<typename InputType >
void WGridTransformOrthoTemplate< T >::copyFrom ( WGridTransformOrthoTemplate< InputType > const &  input)
private
template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::directionToGridSpace ( Vector3Type const &  direction) const

Transforms a direction from world space to grid space.

Parameters
directionThe position in world space.
Returns
The same position in grid space.

Definition at line 375 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling, WGridTransformOrthoTemplate< T >::m_unitDirectionX, WGridTransformOrthoTemplate< T >::m_unitDirectionY, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

Referenced by WGridTransformTest::testTransformationToGridSpace().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::directionToWorldSpace ( Vector3Type const &  direction) const

Transforms a direction from grid space to world space.

Parameters
directionThe direction in grid space.
Returns
The same direction in world space.

Definition at line 359 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling, WGridTransformOrthoTemplate< T >::m_unitDirectionX, WGridTransformOrthoTemplate< T >::m_unitDirectionY, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

Referenced by WGridTransformTest::testTransformationToWorldSpace().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionX ( ) const

Returns the vector determining the direction of samples in x direction.

Adding this vector to a grid position in world coordinates yields the position of the next sample along the grids (world coordinate) x-axis.

Returns
The vector determining the direction of samples in x direction.

Definition at line 403 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling, and WGridTransformOrthoTemplate< T >::m_unitDirectionX.

Referenced by WGridTransformTest::testCompareConstructors(), and WGridTransformTest::testInstantiation().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionY ( ) const

Returns the vector determining the direction of samples in y direction.

Adding this vector to a grid position in world coordinates yields the position of the next sample along the grids (world coordinate) y-axis.

Returns
The vector determining the direction of samples in y direction.

Definition at line 409 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling, and WGridTransformOrthoTemplate< T >::m_unitDirectionY.

Referenced by WGridTransformTest::testCompareConstructors(), and WGridTransformTest::testInstantiation().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionZ ( ) const

Returns the vector determining the direction of samples in z direction.

Adding this vector to a grid position in world coordinates yields the position of the next sample along the grids (world coordinate) z-axis.

Returns
The vector determining the direction of samples in z direction.

Definition at line 415 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

Referenced by WGridTransformTest::testCompareConstructors(), and WGridTransformTest::testInstantiation().

template<typename T >
T WGridTransformOrthoTemplate< T >::getOffsetX ( ) const

Returns the distance between samples in x direction.

Returns
The distance between samples in x direction.

Definition at line 385 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

Referenced by WGridTransformTest::testCompareConstructors(), and WGridTransformTest::testInstantiation().

template<typename T >
T WGridTransformOrthoTemplate< T >::getOffsetY ( ) const

Returns the distance between samples in y direction.

Returns
The distance between samples in y direction.

Definition at line 391 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

Referenced by WGridTransformTest::testCompareConstructors(), and WGridTransformTest::testInstantiation().

template<typename T >
T WGridTransformOrthoTemplate< T >::getOffsetZ ( ) const

Returns the distance between samples in z direction.

Returns
The distance between samples in z direction.

Definition at line 397 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

Referenced by WGridTransformTest::testCompareConstructors(), and WGridTransformTest::testInstantiation().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getOrigin ( ) const

Returns the position of the origin of the grid.

Returns
The position of the origin of the grid.

Definition at line 439 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_origin.

Referenced by WGridTransformTest::testCompareConstructors(), and WGridTransformTest::testInstantiation().

template<typename T >
const WGridTransformOrthoTemplate< T >::Vector3Type & WGridTransformOrthoTemplate< T >::getScaling ( ) const
inline

Returns the scaling of the grid.

Returns
The scaling of the grid.

Definition at line 445 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

template<typename T >
WMatrix< T > WGridTransformOrthoTemplate< T >::getTransformationMatrix ( ) const
template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionX ( ) const

Returns the vector determining the unit (normalized) direction of samples in x direction.

Returns
The vector determining the unit (normalized) direction of samples in x direction.

Definition at line 421 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_unitDirectionX.

Referenced by WGridTransformTest::testInstantiation().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionY ( ) const

Returns the vector determining the unit (normalized) direction of samples in y direction.

Returns
The vector determining the unit (normalized) direction of samples in y direction.

Definition at line 427 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_unitDirectionY.

Referenced by WGridTransformTest::testInstantiation().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionZ ( ) const

Returns the vector determining the unit (normalized) direction of samples in z direction.

Returns
The vector determining the unit (normalized) direction of samples in z direction.

Definition at line 433 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

Referenced by WGridTransformTest::testInstantiation().

template<typename T >
bool WGridTransformOrthoTemplate< T >::isNotRotated ( ) const

Check if this transform does not include a rotation.

Returns
True, if this transform only scales and translates.

Definition at line 490 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_unitDirectionX, WGridTransformOrthoTemplate< T >::m_unitDirectionY, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

template<typename T >
WGridTransformOrthoTemplate< T >::operator WMatrix4d ( ) const
template<typename T >
template<typename InputType >
WGridTransformOrthoTemplate< T > & WGridTransformOrthoTemplate< T >::operator= ( WGridTransformOrthoTemplate< InputType > const &  rhs)

Assignment operator.

Copies the data from an WGridTransformOrthoTemplate object with arbitary numerical type.

Parameters
rhsA WGridTransformOrthoTemplate object, which mustn't have the same numerical type.
Returns
this

Definition at line 321 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::copyFrom().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::positionToGridSpace ( Vector3Type const &  position) const

Transforms a position from world space to grid space.

Parameters
positionThe position in world space.
Returns
The same position in grid space.

Definition at line 348 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_origin, WGridTransformOrthoTemplate< T >::m_scaling, WGridTransformOrthoTemplate< T >::m_unitDirectionX, WGridTransformOrthoTemplate< T >::m_unitDirectionY, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

Referenced by WGridTransformTest::testTransformationToGridSpace().

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::positionToWorldSpace ( Vector3Type const &  position) const

Transforms a position from grid space to world space.

Parameters
positionThe position in grid space.
Returns
The same position in world space.

Definition at line 331 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_origin, WGridTransformOrthoTemplate< T >::m_scaling, WGridTransformOrthoTemplate< T >::m_unitDirectionX, WGridTransformOrthoTemplate< T >::m_unitDirectionY, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

Referenced by WGridTransformTest::testTransformationToWorldSpace().

template<typename T >
template<typename VecType >
void WGridTransformOrthoTemplate< T >::scale ( VecType const &  scale)

Scale the transform.

Parameters
scaleA vector of scaling coeffs for the 3 directions.

Definition at line 508 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

template<typename T >
template<typename VecType >
void WGridTransformOrthoTemplate< T >::translate ( VecType const &  vec)

Translate by a vector.

Parameters
vecThe vector.

Definition at line 499 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_origin.

Member Data Documentation

template<typename T>
Vector3Type WGridTransformOrthoTemplate< T >::m_origin
private
template<typename T>
Vector3Type WGridTransformOrthoTemplate< T >::m_scaling
private
template<typename T>
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionX
private
template<typename T>
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionY
private
template<typename T>
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionZ
private

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