OpenWalnut
1.4.0
|
00001 //--------------------------------------------------------------------------- 00002 // 00003 // Project: OpenWalnut ( http://www.openwalnut.org ) 00004 // 00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS 00006 // For more information see http://www.openwalnut.org/copying 00007 // 00008 // This file is part of OpenWalnut. 00009 // 00010 // OpenWalnut is free software: you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as published by 00012 // the Free Software Foundation, either version 3 of the License, or 00013 // (at your option) any later version. 00014 // 00015 // OpenWalnut is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 // GNU Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public License 00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>. 00022 // 00023 //--------------------------------------------------------------------------- 00024 00025 #ifndef WGRIDTRANSFORMORTHO_H 00026 #define WGRIDTRANSFORMORTHO_H 00027 00028 #include "../common/exceptions/WPreconditionNotMet.h" 00029 #include "../common/math/WMatrix.h" 00030 #include "../common/math/linearAlgebra/WPosition.h" 00031 #include "../common/math/linearAlgebra/WMatrixFixed.h" 00032 00033 /** 00034 * Implements an orthogonal grid transformation. 00035 * 00036 * \class WGridTransformOrthoTemplate 00037 */ 00038 template< typename T > 00039 class WGridTransformOrthoTemplate 00040 { 00041 // this (friend) is necessary to allow casting 00042 template <class U> 00043 friend class WGridTransformOrthoTemplate; 00044 public: 00045 /** 00046 * Convenience typedef for 3d vectors of the appropriate numerical type. 00047 */ 00048 typedef WMatrixFixed< T, 3, 1 > Vector3Type; 00049 00050 /** 00051 * Constructs an identity transform. 00052 */ 00053 WGridTransformOrthoTemplate(); 00054 00055 /** 00056 * Copy constructor. 00057 * Copies the data from an WGridTransformOrthoTemplate object with arbitary numerical type. 00058 * 00059 * \param rhs A WGridTransformOrthoTemplate object, which mustn't have the same numerical type. 00060 */ 00061 template< typename InputType > 00062 WGridTransformOrthoTemplate( WGridTransformOrthoTemplate< InputType > const& rhs ); // NOLINT -- no explicit, this allows casts 00063 /** 00064 * Construct a transformation that scales the grid space. 00065 * \param scaleX The scale in the x-direction. 00066 * \param scaleY The scale in the y-direction. 00067 * \param scaleZ The scale in the z-direction. 00068 */ 00069 template< typename InputType > 00070 WGridTransformOrthoTemplate( InputType scaleX, InputType scaleY, InputType scaleZ ); 00071 00072 /** 00073 * Construct a transformation from a transformation matrix. The provided matrix 00074 * represents the transformation from grid to world space. 00075 * \param mat The matrix. 00076 */ 00077 template< typename InputType > 00078 WGridTransformOrthoTemplate( WMatrix< InputType > const& mat ); // NOLINT 00079 00080 /** 00081 * Destructor. 00082 */ 00083 ~WGridTransformOrthoTemplate(); 00084 00085 00086 /** 00087 * Assignment operator. 00088 * Copies the data from an WGridTransformOrthoTemplate object with arbitary numerical type. 00089 * 00090 * \param rhs A WGridTransformOrthoTemplate object, which mustn't have the same numerical type. 00091 * 00092 * \return this 00093 */ 00094 template< typename InputType > 00095 WGridTransformOrthoTemplate< T >& operator=( WGridTransformOrthoTemplate< InputType > const& rhs ); 00096 /** 00097 * Transforms a position from grid space to world space. 00098 * \param position The position in grid space. 00099 * \return The same position in world space. 00100 */ 00101 Vector3Type positionToWorldSpace( Vector3Type const& position ) const; 00102 00103 /** 00104 * Transforms a position from world space to grid space. 00105 * \param position The position in world space. 00106 * \return The same position in grid space. 00107 */ 00108 Vector3Type positionToGridSpace( Vector3Type const& position ) const; 00109 00110 /** 00111 * Transforms a direction from grid space to world space. 00112 * \param direction The direction in grid space. 00113 * \return The same direction in world space. 00114 */ 00115 Vector3Type directionToWorldSpace( Vector3Type const& direction ) const; 00116 00117 /** 00118 * Transforms a direction from world space to grid space. 00119 * \param direction The position in world space. 00120 * \return The same position in grid space. 00121 */ 00122 Vector3Type directionToGridSpace( Vector3Type const& direction ) const; 00123 00124 /** 00125 * Returns the distance between samples in x direction. 00126 * \return The distance between samples in x direction. 00127 */ 00128 T getOffsetX() const; 00129 00130 /** 00131 * Returns the distance between samples in y direction. 00132 * \return The distance between samples in y direction. 00133 */ 00134 T getOffsetY() const; 00135 00136 /** 00137 * Returns the distance between samples in z direction. 00138 * \return The distance between samples in z direction. 00139 */ 00140 T getOffsetZ() const; 00141 00142 /** 00143 * Returns the vector determining the direction of samples in x direction. 00144 * Adding this vector to a grid position in world coordinates yields the position of the next sample 00145 * along the grids (world coordinate) x-axis. 00146 * \return The vector determining the direction of samples in x direction. 00147 */ 00148 Vector3Type getDirectionX() const; 00149 00150 /** 00151 * Returns the vector determining the direction of samples in y direction. 00152 * Adding this vector to a grid position in world coordinates yields the position of the next sample 00153 * along the grids (world coordinate) y-axis. 00154 * \return The vector determining the direction of samples in y direction. 00155 */ 00156 Vector3Type getDirectionY() const; 00157 00158 /** 00159 * Returns the vector determining the direction of samples in z direction. 00160 * Adding this vector to a grid position in world coordinates yields the position of the next sample 00161 * along the grids (world coordinate) z-axis. 00162 * \return The vector determining the direction of samples in z direction. 00163 */ 00164 Vector3Type getDirectionZ() const; 00165 00166 /** 00167 * Returns the vector determining the unit (normalized) direction of samples in x direction. 00168 * \return The vector determining the unit (normalized) direction of samples in x direction. 00169 */ 00170 Vector3Type getUnitDirectionX() const; 00171 00172 /** 00173 * Returns the vector determining the unit (normalized) direction of samples in y direction. 00174 * \return The vector determining the unit (normalized) direction of samples in y direction. 00175 */ 00176 Vector3Type getUnitDirectionY() const; 00177 00178 /** 00179 * Returns the vector determining the unit (normalized) direction of samples in z direction. 00180 * \return The vector determining the unit (normalized) direction of samples in z direction. 00181 */ 00182 Vector3Type getUnitDirectionZ() const; 00183 00184 /** 00185 * Returns the position of the origin of the grid. 00186 * \return The position of the origin of the grid. 00187 */ 00188 Vector3Type getOrigin() const; 00189 00190 /** 00191 * Returns the scaling of the grid. 00192 * \return The scaling of the grid. 00193 */ 00194 const Vector3Type& getScaling() const; 00195 00196 /** 00197 * Returns a 4x4 matrix that represents the grid's transformaion. 00198 * \return The grid's transformation. 00199 */ 00200 // NOTE: this is temporary and should be removed as soon as all modules are 00201 // adapted to the grid transform object 00202 WMatrix< T > getTransformationMatrix() const; 00203 00204 /** 00205 * Cast the transformation to the corresponding 4x4 matrix. 00206 * 00207 * \return the matrix representing the transform 00208 */ 00209 operator WMatrix4d() const; 00210 00211 /** 00212 * Check if this transform does not include a rotation. 00213 * 00214 * \return True, if this transform only scales and translates. 00215 */ 00216 bool isNotRotated() const; 00217 00218 /** 00219 * Translate by a vector. 00220 * 00221 * \param vec The vector. 00222 */ 00223 template< typename VecType > 00224 void translate( VecType const& vec ); 00225 00226 /** 00227 * Scale the transform. 00228 * 00229 * \param scale A vector of scaling coeffs for the 3 directions. 00230 */ 00231 template< typename VecType > 00232 void scale( VecType const& scale ); 00233 00234 /** 00235 * Scale the transform. 00236 * 00237 * \param scale scaling coeffitient for the 3 directions. 00238 */ 00239 void scale( T const& scale ); 00240 00241 /** 00242 * Compares two grid transforms. 00243 * 00244 * \param other the one to compare against 00245 * 00246 * \return true if transform matches 00247 */ 00248 bool operator==( const WGridTransformOrthoTemplate< T >& other ) const; 00249 00250 private: 00251 /** 00252 * This is a helper function which copies the parameter of another instance to its own. 00253 * 00254 * \param input A WGridTransformOrthoTemplate object with the numerical type InputType. 00255 */ 00256 template< typename InputType > 00257 void copyFrom( WGridTransformOrthoTemplate< InputType > const& input ); 00258 00259 //! normalized direction of the grid's x-axis in world coordinates 00260 Vector3Type m_unitDirectionX; 00261 00262 //! normalized direction of the grid's y-axis in world coordinates 00263 Vector3Type m_unitDirectionY; 00264 00265 //! normalized direction of the grid's z-axis in world coordinates 00266 Vector3Type m_unitDirectionZ; 00267 00268 //! the scaling factors for the 3 axes, i.e. the distance between samples 00269 Vector3Type m_scaling; 00270 00271 //! the origin of the grid in world coordinates 00272 Vector3Type m_origin; 00273 }; 00274 00275 typedef WGridTransformOrthoTemplate< double > WGridTransformOrtho; 00276 typedef WGridTransformOrthoTemplate< float > WGridTransformOrthoFloat; 00277 00278 template< typename T > 00279 WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate() 00280 : m_unitDirectionX( 1.0, 0.0, 0.0 ), 00281 m_unitDirectionY( 0.0, 1.0, 0.0 ), 00282 m_unitDirectionZ( 0.0, 0.0, 1.0 ), 00283 m_scaling( 1.0, 1.0, 1.0 ), 00284 m_origin( 0.0, 0.0, 0.0 ) 00285 { 00286 } 00287 00288 template< typename T > 00289 template< typename InputType > 00290 WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate( WGridTransformOrthoTemplate< InputType > const& rhs ) 00291 { 00292 copyFrom( rhs ); 00293 } 00294 00295 template< typename T > 00296 template< typename InputType > 00297 WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate( InputType scaleX, InputType scaleY, InputType scaleZ ) 00298 : m_unitDirectionX( ( scaleX > 0.0 ) - ( scaleX < 0.0 ), 0.0, 0.0 ), 00299 m_unitDirectionY( 0.0, ( scaleY > 0.0 ) - ( scaleY < 0.0 ), 0.0 ), 00300 m_unitDirectionZ( 0.0, 0.0, ( scaleZ > 0.0 ) - ( scaleZ < 0.0 ) ), 00301 m_scaling( fabs( scaleX ), fabs( scaleY ), fabs( scaleZ ) ), 00302 m_origin( 0.0, 0.0, 0.0 ) 00303 { 00304 WPrecond( m_scaling[ 0 ] != 0.0 && m_scaling[ 1 ] != 0.0 && m_scaling[ 2 ] != 0.0, "" ); 00305 } 00306 00307 template< typename T > 00308 template< typename InputType > 00309 WGridTransformOrthoTemplate< T >::WGridTransformOrthoTemplate( WMatrix< InputType > const& mat ) 00310 { 00311 WPrecond( mat.getNbRows() == 4 && mat.getNbCols() == 4, "" ); 00312 m_unitDirectionX = Vector3Type( mat( 0, 0 ), mat( 1, 0 ), mat( 2, 0 ) ); 00313 m_unitDirectionY = Vector3Type( mat( 0, 1 ), mat( 1, 1 ), mat( 2, 1 ) ); 00314 m_unitDirectionZ = Vector3Type( mat( 0, 2 ), mat( 1, 2 ), mat( 2, 2 ) ); 00315 00316 m_scaling = Vector3Type( length( m_unitDirectionX ), length( m_unitDirectionY ), length( m_unitDirectionZ ) ); 00317 00318 WPrecond( m_scaling[ 0 ] != 0.0 && m_scaling[ 1 ] != 0.0 && m_scaling[ 2 ] != 0.0, "" ); 00319 m_unitDirectionX /= m_scaling[ 0 ]; 00320 m_unitDirectionY /= m_scaling[ 1 ]; 00321 m_unitDirectionZ /= m_scaling[ 2 ]; 00322 00323 WPrecondLess( fabs( dot( m_unitDirectionX, m_unitDirectionY ) ), 0.0001 ); 00324 WPrecondLess( fabs( dot( m_unitDirectionX, m_unitDirectionZ ) ), 0.0001 ); 00325 WPrecondLess( fabs( dot( m_unitDirectionY, m_unitDirectionZ ) ), 0.0001 ); 00326 m_origin = Vector3Type( mat( 0, 3 ), mat( 1, 3 ), mat( 2, 3 ) ); 00327 } 00328 00329 template< typename T > 00330 WGridTransformOrthoTemplate< T >::~WGridTransformOrthoTemplate() 00331 { 00332 } 00333 00334 template< typename T > 00335 template< typename InputType > 00336 WGridTransformOrthoTemplate< T >& WGridTransformOrthoTemplate< T >::operator=( WGridTransformOrthoTemplate< InputType > const& rhs ) 00337 { 00338 if( this != &rhs ) 00339 { 00340 copyFrom( rhs ); 00341 } 00342 return *this; 00343 } 00344 00345 template< typename T > 00346 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::positionToWorldSpace( Vector3Type const& position ) const 00347 { 00348 return Vector3Type( m_scaling[ 0 ] * position[ 0 ] * m_unitDirectionX[ 0 ] + 00349 m_scaling[ 1 ] * position[ 1 ] * m_unitDirectionY[ 0 ] + 00350 m_scaling[ 2 ] * position[ 2 ] * m_unitDirectionZ[ 0 ] + 00351 m_origin[ 0 ], 00352 m_scaling[ 0 ] * position[ 0 ] * m_unitDirectionX[ 1 ] + 00353 m_scaling[ 1 ] * position[ 1 ] * m_unitDirectionY[ 1 ] + 00354 m_scaling[ 2 ] * position[ 2 ] * m_unitDirectionZ[ 1 ] + 00355 m_origin[ 1 ], 00356 m_scaling[ 0 ] * position[ 0 ] * m_unitDirectionX[ 2 ] + 00357 m_scaling[ 1 ] * position[ 1 ] * m_unitDirectionY[ 2 ] + 00358 m_scaling[ 2 ] * position[ 2 ] * m_unitDirectionZ[ 2 ] + 00359 m_origin[ 2 ] ); 00360 } 00361 00362 template< typename T > 00363 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::positionToGridSpace( Vector3Type const& position ) const 00364 { 00365 Vector3Type p = position - m_origin; 00366 p = Vector3Type( dot( p, m_unitDirectionX ), dot( p, m_unitDirectionY ), dot( p, m_unitDirectionZ ) ); 00367 p[ 0 ] /= m_scaling[ 0 ]; 00368 p[ 1 ] /= m_scaling[ 1 ]; 00369 p[ 2 ] /= m_scaling[ 2 ]; 00370 return p; 00371 } 00372 00373 template< typename T > 00374 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::directionToWorldSpace( Vector3Type const& direction ) const 00375 { 00376 return Vector3Type( m_scaling[ 0 ] * direction[ 0 ] * m_unitDirectionX[ 0 ] + 00377 m_scaling[ 1 ] * direction[ 1 ] * m_unitDirectionY[ 0 ] + 00378 m_scaling[ 2 ] * direction[ 2 ] * m_unitDirectionZ[ 0 ], 00379 00380 m_scaling[ 0 ] * direction[ 0 ] * m_unitDirectionX[ 1 ] + 00381 m_scaling[ 1 ] * direction[ 1 ] * m_unitDirectionY[ 1 ] + 00382 m_scaling[ 2 ] * direction[ 2 ] * m_unitDirectionZ[ 1 ], 00383 00384 m_scaling[ 0 ] * direction[ 0 ] * m_unitDirectionX[ 2 ] + 00385 m_scaling[ 1 ] * direction[ 1 ] * m_unitDirectionY[ 2 ] + 00386 m_scaling[ 2 ] * direction[ 2 ] * m_unitDirectionZ[ 2 ] ); 00387 } 00388 00389 template< typename T > 00390 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::directionToGridSpace( Vector3Type const& direction ) const 00391 { 00392 Vector3Type p( dot( direction, m_unitDirectionX ), dot( direction, m_unitDirectionY ), dot( direction, m_unitDirectionZ ) ); 00393 p[ 0 ] /= m_scaling[ 0 ]; 00394 p[ 1 ] /= m_scaling[ 1 ]; 00395 p[ 2 ] /= m_scaling[ 2 ]; 00396 return p; 00397 } 00398 00399 template< typename T > 00400 T WGridTransformOrthoTemplate< T >::getOffsetX() const 00401 { 00402 return m_scaling[ 0 ]; 00403 } 00404 00405 template< typename T > 00406 T WGridTransformOrthoTemplate< T >::getOffsetY() const 00407 { 00408 return m_scaling[ 1 ]; 00409 } 00410 00411 template< typename T > 00412 T WGridTransformOrthoTemplate< T >::getOffsetZ() const 00413 { 00414 return m_scaling[ 2 ]; 00415 } 00416 00417 template< typename T > 00418 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionX() const 00419 { 00420 return m_unitDirectionX * m_scaling[ 0 ]; 00421 } 00422 00423 template< typename T > 00424 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionY() const 00425 { 00426 return m_unitDirectionY * m_scaling[ 1 ]; 00427 } 00428 00429 template< typename T > 00430 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getDirectionZ() const 00431 { 00432 return m_unitDirectionZ * m_scaling[ 2 ]; 00433 } 00434 00435 template< typename T > 00436 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionX() const 00437 { 00438 return m_unitDirectionX; 00439 } 00440 00441 template< typename T > 00442 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionY() const 00443 { 00444 return m_unitDirectionY; 00445 } 00446 00447 template< typename T > 00448 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getUnitDirectionZ() const 00449 { 00450 return m_unitDirectionZ; 00451 } 00452 00453 template< typename T > 00454 typename WGridTransformOrthoTemplate< T >::Vector3Type WGridTransformOrthoTemplate< T >::getOrigin() const 00455 { 00456 return m_origin; 00457 } 00458 00459 template< typename T > 00460 inline const typename WGridTransformOrthoTemplate< T >::Vector3Type& WGridTransformOrthoTemplate< T >::getScaling() const 00461 { 00462 return m_scaling; 00463 } 00464 00465 template< typename T > 00466 WMatrix< T > WGridTransformOrthoTemplate< T >::getTransformationMatrix() const 00467 { 00468 WMatrix< T > mat( 4, 4 ); 00469 mat.makeIdentity(); 00470 mat( 0, 0 ) = m_scaling[ 0 ] * m_unitDirectionX[ 0 ]; 00471 mat( 1, 0 ) = m_scaling[ 0 ] * m_unitDirectionX[ 1 ]; 00472 mat( 2, 0 ) = m_scaling[ 0 ] * m_unitDirectionX[ 2 ]; 00473 mat( 0, 1 ) = m_scaling[ 1 ] * m_unitDirectionY[ 0 ]; 00474 mat( 1, 1 ) = m_scaling[ 1 ] * m_unitDirectionY[ 1 ]; 00475 mat( 2, 1 ) = m_scaling[ 1 ] * m_unitDirectionY[ 2 ]; 00476 mat( 0, 2 ) = m_scaling[ 2 ] * m_unitDirectionZ[ 0 ]; 00477 mat( 1, 2 ) = m_scaling[ 2 ] * m_unitDirectionZ[ 1 ]; 00478 mat( 2, 2 ) = m_scaling[ 2 ] * m_unitDirectionZ[ 2 ]; 00479 mat( 0, 3 ) = m_origin[ 0 ]; 00480 mat( 1, 3 ) = m_origin[ 1 ]; 00481 mat( 2, 3 ) = m_origin[ 2 ]; 00482 return mat; 00483 } 00484 00485 template< typename T > 00486 WGridTransformOrthoTemplate< T >::operator WMatrix4d() const 00487 { 00488 WMatrix4d mat = WMatrix4d::identity(); 00489 mat( 0, 0 ) = m_scaling[ 0 ] * m_unitDirectionX[ 0 ]; 00490 mat( 0, 1 ) = m_scaling[ 0 ] * m_unitDirectionX[ 1 ]; 00491 mat( 0, 2 ) = m_scaling[ 0 ] * m_unitDirectionX[ 2 ]; 00492 mat( 1, 0 ) = m_scaling[ 1 ] * m_unitDirectionY[ 0 ]; 00493 mat( 1, 1 ) = m_scaling[ 1 ] * m_unitDirectionY[ 1 ]; 00494 mat( 1, 2 ) = m_scaling[ 1 ] * m_unitDirectionY[ 2 ]; 00495 mat( 2, 0 ) = m_scaling[ 2 ] * m_unitDirectionZ[ 0 ]; 00496 mat( 2, 1 ) = m_scaling[ 2 ] * m_unitDirectionZ[ 1 ]; 00497 mat( 2, 2 ) = m_scaling[ 2 ] * m_unitDirectionZ[ 2 ]; 00498 mat( 3, 0 ) = m_origin[ 0 ]; 00499 mat( 3, 1 ) = m_origin[ 1 ]; 00500 mat( 3, 2 ) = m_origin[ 2 ]; 00501 return mat; 00502 } 00503 00504 template< typename T > 00505 bool WGridTransformOrthoTemplate< T >::isNotRotated() const 00506 { 00507 return m_unitDirectionX == Vector3Type( T( 1.0 ), T( 0.0 ), T( 0.0 ) ) 00508 && m_unitDirectionY == Vector3Type( T( 0.0 ), T( 1.0 ), T( 0.0 ) ) 00509 && m_unitDirectionZ == Vector3Type( T( 0.0 ), T( 0.0 ), T( 1.0 ) ); 00510 } 00511 00512 template< typename T > 00513 template< typename VecType > 00514 void WGridTransformOrthoTemplate< T >::translate( VecType const& vec ) 00515 { 00516 m_origin[ 0 ] += vec[ 0 ]; 00517 m_origin[ 1 ] += vec[ 1 ]; 00518 m_origin[ 2 ] += vec[ 2 ]; 00519 } 00520 00521 template< typename T > 00522 template< typename VecType> 00523 void WGridTransformOrthoTemplate< T >::scale( VecType const& scale ) 00524 { 00525 m_scaling[ 0 ] *= scale[ 0 ]; 00526 m_scaling[ 1 ] *= scale[ 1 ]; 00527 m_scaling[ 2 ] *= scale[ 2 ]; 00528 } 00529 00530 template< typename T > 00531 void WGridTransformOrthoTemplate< T >::scale( T const& scale ) 00532 { 00533 m_scaling[ 0 ] *= scale; 00534 m_scaling[ 1 ] *= scale; 00535 m_scaling[ 2 ] *= scale; 00536 } 00537 00538 template< typename T > 00539 template< typename InputType > 00540 void WGridTransformOrthoTemplate< T >::copyFrom( WGridTransformOrthoTemplate< InputType > const& input ) 00541 { 00542 this->m_unitDirectionX = static_cast< Vector3Type >( input.m_unitDirectionX ); 00543 this->m_unitDirectionY = static_cast< Vector3Type >( input.m_unitDirectionY ); 00544 this->m_unitDirectionZ = static_cast< Vector3Type >( input.m_unitDirectionZ ); 00545 this->m_scaling = static_cast< Vector3Type >( input.m_scaling ); 00546 this->m_origin = static_cast< Vector3Type >( input.m_origin ); 00547 } 00548 00549 template< typename T > 00550 bool WGridTransformOrthoTemplate< T >::operator==( const WGridTransformOrthoTemplate< T >& other ) const 00551 { 00552 return ( m_unitDirectionX == other.m_unitDirectionX ) && 00553 ( m_unitDirectionY == other.m_unitDirectionY ) && 00554 ( m_unitDirectionZ == other.m_unitDirectionZ ) && 00555 ( m_scaling == other.m_scaling ) && 00556 ( m_origin == other.m_origin ); 00557 } 00558 00559 #endif // WGRIDTRANSFORMORTHO_H