OpenWalnut
1.4.0
|
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. | |
T | getOffsetX () const |
Returns the distance between samples in x direction. | |
T | getOffsetY () const |
Returns the distance between samples in y direction. | |
T | 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 Vector3Type & | getScaling () 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. | |
void | scale (T const &scale) |
Scale the transform. | |
bool | operator== (const WGridTransformOrthoTemplate< T > &other) const |
Compares two grid transforms. | |
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 |
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.
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.
void WGridTransformOrthoTemplate< T >::copyFrom | ( | WGridTransformOrthoTemplate< InputType > const & | input | ) | [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 | ( | ) | 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.
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 | ( | ) | 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.
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 | ( | ) | 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.
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 | ( | ) | const |
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 | ( | ) | const |
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 | ( | ) | const |
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 | ( | ) | const |
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().
const WGridTransformOrthoTemplate< T >::Vector3Type & WGridTransformOrthoTemplate< T >::getScaling | ( | ) | const [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 | ( | ) | const |
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 | ( | ) | const |
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 | ( | ) | const |
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 | ( | ) | const |
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 | ( | ) | const |
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 | ( | ) | const |
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 | ( | 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 >::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 >::translate | ( | VecType const & | vec | ) |
Translate by a vector.
vec | The vector. |
Definition at line 514 of file WGridTransformOrtho.h.
References WGridTransformOrthoTemplate< T >::m_origin.
Vector3Type WGridTransformOrthoTemplate< T >::m_origin [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().
Vector3Type WGridTransformOrthoTemplate< T >::m_scaling [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().
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionX [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().
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionY [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().
Vector3Type WGridTransformOrthoTemplate< T >::m_unitDirectionZ [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().