OpenWalnut
1.5.0dev
|
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. 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... | |
T | getOffsetX () const |
Returns the distance between samples in x direction. More... | |
T | getOffsetY () const |
Returns the distance between samples in y direction. More... | |
T | 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 Vector3Type & | getScaling () 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... | |
Implements an orthogonal grid transformation.
Definition at line 39 of file WGridTransformOrtho.h.
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.
WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate |
Constructs an identity transform.
Definition at line 279 of file WGridTransformOrtho.h.
WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate | ( | WGridTransformOrthoTemplate< InputType > const & | rhs | ) |
Copy constructor.
Copies the data from an WGridTransformOrthoTemplate object with arbitary numerical type.
rhs | A WGridTransformOrthoTemplate object, which mustn't have the same numerical type. |
Definition at line 290 of file WGridTransformOrtho.h.
References WGridTransformOrthoTemplate< T >::copyFrom().
WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate | ( | InputType | scaleX, |
InputType | scaleY, | ||
InputType | scaleZ | ||
) |
Construct a transformation that scales the grid space.
scaleX | The scale in the x-direction. |
scaleY | The scale in the y-direction. |
scaleZ | The scale in the z-direction. |
Definition at line 297 of file WGridTransformOrtho.h.
References WGridTransformOrthoTemplate< T >::m_scaling.
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.
mat | The 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.
WGridTransformOrthoTemplate< T >::~WGridTransformOrthoTemplate |
Destructor.
Definition at line 330 of file WGridTransformOrtho.h.
|
private |
This is a helper function which copies the parameter of another instance to its own.
input | A 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().
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::directionToGridSpace | ( | Vector3Type const & | direction | ) | const |
Transforms a direction from world space to grid space.
direction | The position in world 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().
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::directionToWorldSpace | ( | Vector3Type const & | direction | ) | const |
Transforms a direction from grid space to world space.
direction | The direction in grid 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().
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.
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().
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.
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().
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.
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().
T WGridTransformOrthoTemplate< T >::getOffsetX |
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().
T WGridTransformOrthoTemplate< T >::getOffsetY |
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().
T WGridTransformOrthoTemplate< T >::getOffsetZ |
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().
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getOrigin |
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().
|
inline |
Returns the scaling of the grid.
Definition at line 460 of file WGridTransformOrtho.h.
References WGridTransformOrthoTemplate< T >::m_scaling.
WMatrix< T > WGridTransformOrthoTemplate< T >::getTransformationMatrix |
Returns a 4x4 matrix that represents the grid's transformaion.
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().
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionX |
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().
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionY |
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().
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionZ |
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().
bool WGridTransformOrthoTemplate< T >::isNotRotated |
Check if this transform does not include a rotation.
Definition at line 505 of file WGridTransformOrtho.h.
References WGridTransformOrthoTemplate< T >::m_unitDirectionX, WGridTransformOrthoTemplate< T >::m_unitDirectionY, and WGridTransformOrthoTemplate< T >::m_unitDirectionZ.
WGridTransformOrthoTemplate< T >::operator WMatrix4d |
Cast the transformation to the corresponding 4x4 matrix.
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.
WGridTransformOrthoTemplate< T > & WGridTransformOrthoTemplate< T >::operator= | ( | WGridTransformOrthoTemplate< InputType > const & | rhs | ) |
Assignment operator.
Copies the data from an WGridTransformOrthoTemplate object with arbitary numerical type.
rhs | A WGridTransformOrthoTemplate object, which mustn't have the same numerical type. |
Definition at line 336 of file WGridTransformOrtho.h.
References WGridTransformOrthoTemplate< T >::copyFrom().
bool WGridTransformOrthoTemplate< T >::operator== | ( | const WGridTransformOrthoTemplate< T > & | other | ) | const |
Compares two grid transforms.
other | the one to compare against |
Definition at line 550 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.
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::positionToGridSpace | ( | Vector3Type const & | position | ) | const |
Transforms a position from world space to grid space.
position | The position in world 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().
WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::positionToWorldSpace | ( | Vector3Type const & | position | ) | const |
Transforms a position from grid space to world space.
position | The position in grid 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().
void WGridTransformOrthoTemplate< T >::scale | ( | T const & | scale | ) |
Scale the transform.
scale | scaling coeffitient for the 3 directions. |
Definition at line 531 of file WGridTransformOrtho.h.
References WGridTransformOrthoTemplate< T >::m_scaling, and WGridTransformOrthoTemplate< T >::scale().
void WGridTransformOrthoTemplate< T >::scale | ( | VecType const & | scale | ) |
Scale the transform.
scale | A 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().
void WGridTransformOrthoTemplate< T >::translate | ( | VecType const & | vec | ) |
Translate by a vector.
vec | The 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().
this (friend) is necessary to allow casting
Definition at line 43 of file WGridTransformOrtho.h.
|
private |
the origin of the grid in world coordinates
Definition at line 272 of file WGridTransformOrtho.h.
Referenced by WGridTransformOrthoTemplate< T >::copyFrom(), WGridTransformOrthoTemplate< T >::getOrigin(), WGridTransformOrthoTemplate< T >::getTransformationMatrix(), WGridTransformOrthoTemplate< T >::operator WMatrix4d(), WGridTransformOrthoTemplate< T >::operator==(), WGridTransformOrthoTemplate< T >::positionToGridSpace(), WGridTransformOrthoTemplate< T >::positionToWorldSpace(), WGridTransformOrthoTemplate< T >::translate(), and WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate().
|
private |
the scaling factors for the 3 axes, i.e. the distance between samples
Definition at line 269 of file WGridTransformOrtho.h.
Referenced by WGridTransformOrthoTemplate< T >::copyFrom(), WGridTransformOrthoTemplate< T >::directionToGridSpace(), WGridTransformOrthoTemplate< T >::directionToWorldSpace(), WGridTransformOrthoTemplate< T >::getDirectionX(), WGridTransformOrthoTemplate< T >::getDirectionY(), WGridTransformOrthoTemplate< T >::getDirectionZ(), WGridTransformOrthoTemplate< T >::getOffsetX(), WGridTransformOrthoTemplate< T >::getOffsetY(), WGridTransformOrthoTemplate< T >::getOffsetZ(), WGridTransformOrthoTemplate< T >::getScaling(), WGridTransformOrthoTemplate< T >::getTransformationMatrix(), WGridTransformOrthoTemplate< T >::operator WMatrix4d(), WGridTransformOrthoTemplate< T >::operator==(), WGridTransformOrthoTemplate< T >::positionToGridSpace(), WGridTransformOrthoTemplate< T >::positionToWorldSpace(), WGridTransformOrthoTemplate< T >::scale(), and WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate().
|
private |
normalized direction of the grid's x-axis in world coordinates
Definition at line 260 of file WGridTransformOrtho.h.
Referenced by WGridTransformOrthoTemplate< T >::copyFrom(), WGridTransformOrthoTemplate< T >::directionToGridSpace(), WGridTransformOrthoTemplate< T >::directionToWorldSpace(), WGridTransformOrthoTemplate< T >::getDirectionX(), WGridTransformOrthoTemplate< T >::getTransformationMatrix(), WGridTransformOrthoTemplate< T >::getUnitDirectionX(), WGridTransformOrthoTemplate< T >::isNotRotated(), WGridTransformOrthoTemplate< T >::operator WMatrix4d(), WGridTransformOrthoTemplate< T >::operator==(), WGridTransformOrthoTemplate< T >::positionToGridSpace(), WGridTransformOrthoTemplate< T >::positionToWorldSpace(), and WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate().
|
private |
normalized direction of the grid's y-axis in world coordinates
Definition at line 263 of file WGridTransformOrtho.h.
Referenced by WGridTransformOrthoTemplate< T >::copyFrom(), WGridTransformOrthoTemplate< T >::directionToGridSpace(), WGridTransformOrthoTemplate< T >::directionToWorldSpace(), WGridTransformOrthoTemplate< T >::getDirectionY(), WGridTransformOrthoTemplate< T >::getTransformationMatrix(), WGridTransformOrthoTemplate< T >::getUnitDirectionY(), WGridTransformOrthoTemplate< T >::isNotRotated(), WGridTransformOrthoTemplate< T >::operator WMatrix4d(), WGridTransformOrthoTemplate< T >::operator==(), WGridTransformOrthoTemplate< T >::positionToGridSpace(), WGridTransformOrthoTemplate< T >::positionToWorldSpace(), and WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate().
|
private |
normalized direction of the grid's z-axis in world coordinates
Definition at line 266 of file WGridTransformOrtho.h.
Referenced by WGridTransformOrthoTemplate< T >::copyFrom(), WGridTransformOrthoTemplate< T >::directionToGridSpace(), WGridTransformOrthoTemplate< T >::directionToWorldSpace(), WGridTransformOrthoTemplate< T >::getDirectionZ(), WGridTransformOrthoTemplate< T >::getTransformationMatrix(), WGridTransformOrthoTemplate< T >::getUnitDirectionZ(), WGridTransformOrthoTemplate< T >::isNotRotated(), WGridTransformOrthoTemplate< T >::operator WMatrix4d(), WGridTransformOrthoTemplate< T >::operator==(), WGridTransformOrthoTemplate< T >::positionToGridSpace(), WGridTransformOrthoTemplate< T >::positionToWorldSpace(), and WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate().