OpenWalnut  1.5.0dev
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>

+ Collaboration diagram for WGridTransformOrthoTemplate< T >:

Public Types

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

Public Member Functions

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

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. More...
 

Private Attributes

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

Friends

template<class U >
class WGridTransformOrthoTemplate
 this (friend) is necessary to allow casting More...
 

Detailed Description

template<typename T>
class WGridTransformOrthoTemplate< T >

Implements an orthogonal grid transformation.

Definition at line 39 of file WGridTransformOrtho.h.

Member Typedef Documentation

◆ Vector3Type

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

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

Definition at line 48 of file WGridTransformOrtho.h.

Constructor & Destructor Documentation

◆ WGridTransformOrthoTemplate() [1/4]

Constructs an identity transform.

Definition at line 279 of file WGridTransformOrtho.h.

◆ WGridTransformOrthoTemplate() [2/4]

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 290 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::copyFrom().

+ Here is the call graph for this function:

◆ WGridTransformOrthoTemplate() [3/4]

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 297 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

◆ WGridTransformOrthoTemplate() [4/4]

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 309 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.

+ Here is the call graph for this function:

◆ ~WGridTransformOrthoTemplate()

Destructor.

Definition at line 330 of file WGridTransformOrtho.h.

Member Function Documentation

◆ copyFrom()

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

This is a helper function which copies the parameter of another instance to its own.

Parameters
inputA WGridTransformOrthoTemplate object with the numerical type InputType.

Definition at line 540 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 WGridTransformOrthoTemplate< T >::operator=(), and WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate().

+ Here is the caller graph for this function:

◆ directionToGridSpace()

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 390 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().

+ Here is the caller graph for this function:

◆ directionToWorldSpace()

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 374 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().

+ Here is the caller graph for this function:

◆ getDirectionX()

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionX

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 418 of file WGridTransformOrtho.h.

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

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

+ Here is the caller graph for this function:

◆ getDirectionY()

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionY

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 424 of file WGridTransformOrtho.h.

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

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

+ Here is the caller graph for this function:

◆ getDirectionZ()

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionZ

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 430 of file WGridTransformOrtho.h.

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

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

+ Here is the caller graph for this function:

◆ getOffsetX()

template<typename T >
T WGridTransformOrthoTemplate< T >::getOffsetX

Returns the distance between samples in x direction.

Returns
The distance between samples in x direction.

Definition at line 400 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

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

+ Here is the caller graph for this function:

◆ getOffsetY()

template<typename T >
T WGridTransformOrthoTemplate< T >::getOffsetY

Returns the distance between samples in y direction.

Returns
The distance between samples in y direction.

Definition at line 406 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

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

+ Here is the caller graph for this function:

◆ getOffsetZ()

template<typename T >
T WGridTransformOrthoTemplate< T >::getOffsetZ

Returns the distance between samples in z direction.

Returns
The distance between samples in z direction.

Definition at line 412 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

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

+ Here is the caller graph for this function:

◆ getOrigin()

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getOrigin

Returns the position of the origin of the grid.

Returns
The position of the origin of the grid.

Definition at line 454 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_origin.

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

+ Here is the caller graph for this function:

◆ getScaling()

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

Returns the scaling of the grid.

Returns
The scaling of the grid.

Definition at line 460 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

◆ getTransformationMatrix()

template<typename T >
WMatrix< T > WGridTransformOrthoTemplate< T >::getTransformationMatrix

Returns a 4x4 matrix that represents the grid's transformaion.

Returns
The grid's transformation.

Definition at line 466 of file WGridTransformOrtho.h.

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

+ Here is the call graph for this function:

◆ getUnitDirectionX()

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionX

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 436 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_unitDirectionX.

Referenced by WGridTransformTest::testInstantiation().

+ Here is the caller graph for this function:

◆ getUnitDirectionY()

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionY

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 442 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_unitDirectionY.

Referenced by WGridTransformTest::testInstantiation().

+ Here is the caller graph for this function:

◆ getUnitDirectionZ()

template<typename T >
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionZ

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 448 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

Referenced by WGridTransformTest::testInstantiation().

+ Here is the caller graph for this function:

◆ isNotRotated()

template<typename T >
bool WGridTransformOrthoTemplate< T >::isNotRotated

Check if this transform does not include a rotation.

Returns
True, if this transform only scales and translates.

Definition at line 505 of file WGridTransformOrtho.h.

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

◆ operator WMatrix4d()

template<typename T >
WGridTransformOrthoTemplate< T >::operator WMatrix4d

Cast the transformation to the corresponding 4x4 matrix.

Returns
the matrix representing the transform

Definition at line 486 of file WGridTransformOrtho.h.

References WMatrixFixed< double, 4, 4 >::identity(), WGridTransformOrthoTemplate< T >::m_origin, WGridTransformOrthoTemplate< T >::m_scaling, WGridTransformOrthoTemplate< T >::m_unitDirectionX, WGridTransformOrthoTemplate< T >::m_unitDirectionY, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.

+ Here is the call graph for this function:

◆ operator=()

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 336 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::copyFrom().

+ Here is the call graph for this function:

◆ operator==()

template<typename T >
bool WGridTransformOrthoTemplate< T >::operator== ( const WGridTransformOrthoTemplate< T > &  other) const

◆ positionToGridSpace()

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 363 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().

+ Here is the caller graph for this function:

◆ positionToWorldSpace()

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 346 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().

+ Here is the caller graph for this function:

◆ scale() [1/2]

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

Scale the transform.

Parameters
scalescaling coeffitient for the 3 directions.

Definition at line 531 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling, and WGridTransformOrthoTemplate< T >::scale().

+ Here is the call graph for this function:

◆ scale() [2/2]

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 523 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_scaling.

Referenced by WGridTransformOrthoTemplate< T >::scale().

+ Here is the caller graph for this function:

◆ translate()

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

Translate by a vector.

Parameters
vecThe vector.

Definition at line 514 of file WGridTransformOrtho.h.

References WGridTransformOrthoTemplate< T >::m_origin.

Referenced by WMDataCreatorScalar::moduleMain(), WMDataCreatorVector::moduleMain(), WMGridRenderer::moduleMain(), and WReaderVTK::readStructuredPoints().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ WGridTransformOrthoTemplate

template<typename T >
template<class U >
friend class WGridTransformOrthoTemplate
friend

this (friend) is necessary to allow casting

Definition at line 43 of file WGridTransformOrtho.h.

Member Data Documentation

◆ m_origin

template<typename T >
Vector3Type WGridTransformOrthoTemplate< T >::m_origin
private

◆ m_scaling

template<typename T >
Vector3Type WGridTransformOrthoTemplate< T >::m_scaling
private

◆ m_unitDirectionX

template<typename T >
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionX
private

◆ m_unitDirectionY

template<typename T >
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionY
private

◆ m_unitDirectionZ

template<typename T >
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionZ
private

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