Commit 0637696d authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents 584e1d60 a7c6e264
......@@ -68,7 +68,11 @@ class WGridRegular3DTemplate : public WGrid // NOLINT
*/
friend class WGridRegular3DTest;
public:
/**
* Convenience typedef for 3d vectors of the appropriate numerical type.
*/
typedef WMatrixFixed< T, 3, 1 > Vector3Type;
/**
* Convenience typedef for a boost::shared_ptr< WGridRegular3DTemplate >.
*/
......@@ -87,6 +91,8 @@ public:
/**
* Copy constructor.
* Copies the data from an WGridRegular3DTemplate object with arbitary numerical type.
*
* \param rhs A WGridRegular3DTemplate object, which mustn't have the same numerical type.
*/
template< typename InputType >
WGridRegular3DTemplate( WGridRegular3DTemplate< InputType > const& rhs ); // NOLINT -- no explicit, this allows casts
......@@ -660,7 +666,7 @@ inline typename WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate<
}
template< typename T >
inline int WGridRegular3DTemplate< T >::getVoxelNum( const WGridRegular3DTemplate< T >::Vector3Type& pos ) const
inline int WGridRegular3DTemplate< T >::getVoxelNum( const Vector3Type& pos ) const
{
// Note: the reason for the +1 is that the first and last Voxel in a x-axis
// row are cut.
......@@ -758,7 +764,7 @@ inline size_t WGridRegular3DTemplate< T >::getCellId( const WGridRegular3DTempla
template< typename T >
inline typename WGridRegular3DTemplate< T >::CellVertexArray WGridRegular3DTemplate< T >::getCellVertexIds( size_t cellId ) const
{
WGridRegular3DTemplate< T >::CellVertexArray vertices;
typename WGridRegular3DTemplate< T >::CellVertexArray vertices;
size_t minVertexIdZ = cellId / ( ( m_nbPosX - 1 ) * ( m_nbPosY - 1 ) );
size_t remainderXY = cellId - minVertexIdZ * ( ( m_nbPosX - 1 ) * ( m_nbPosY - 1 ) );
size_t minVertexIdY = remainderXY / ( m_nbPosX - 1 );
......
......@@ -34,7 +34,7 @@
/**
* Implements an orthogonal grid transformation.
*
* \class WGridTransformOrtho
* \class WGridTransformOrthoTemplate
*/
template< typename T >
class WGridTransformOrthoTemplate
......@@ -43,7 +43,11 @@ class WGridTransformOrthoTemplate
template <class U>
friend class WGridTransformOrthoTemplate;
public:
/**
* Convenience typedef for 3d vectors of the appropriate numerical type.
*/
typedef WMatrixFixed< T, 3, 1 > Vector3Type;
/**
* Constructs an identity transform.
*/
......@@ -52,6 +56,8 @@ public:
/**
* Copy constructor.
* Copies the data from an WGridTransformOrthoTemplate object with arbitary numerical type.
*
* \param rhs A WGridTransformOrthoTemplate object, which mustn't have the same numerical type.
*/
template< typename InputType >
WGridTransformOrthoTemplate( WGridTransformOrthoTemplate< InputType > const& rhs ); // NOLINT -- no explicit, this allows casts
......@@ -81,6 +87,10 @@ public:
/**
* Assignment operator.
* Copies the data from an WGridTransformOrthoTemplate object with arbitary numerical type.
*
* \param rhs A WGridTransformOrthoTemplate object, which mustn't have the same numerical type.
*
* \return this
*/
template< typename InputType >
WGridTransformOrthoTemplate< T >& operator=( WGridTransformOrthoTemplate< InputType > const& rhs );
......@@ -223,6 +233,11 @@ public:
void scale( VecType const& scale );
private:
/**
* This is a helper function which copies the parameter of another instance to its own.
*
* \param input A WGridTransformOrthoTemplate object with the numerical type InputType.
*/
template< typename InputType >
void copyFrom( WGridTransformOrthoTemplate< InputType > const& input );
......@@ -259,11 +274,7 @@ template< typename T >
template< typename InputType >
WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate( WGridTransformOrthoTemplate< InputType > const& rhs )
{
this->m_unitDirectionX = static_cast< Vector3Type >( rhs.m_unitDirectionX );
this->m_unitDirectionY = static_cast< Vector3Type >( rhs.m_unitDirectionY );
this->m_unitDirectionZ = static_cast< Vector3Type >( rhs.m_unitDirectionZ );
this->m_scaling = static_cast< Vector3Type >( rhs.m_scaling );
this->m_origin = static_cast< Vector3Type >( rhs.m_origin );
copyFrom( rhs );
}
template< typename T >
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment