Go to
the documentation of this file.
00001
00011
00012
00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00014 #pragma once
00015 #endif
00016
00017 #ifndef __XSITRANSFORMATION_H__
00018 #define __XSITRANSFORMATION_H__
00019
00020 #include "sicppsdk.h"
00021 #include "xsi_rotation.h"
00022
00023 namespace XSI {
00024
00025 namespace MATH {
00026
00027 class CRotation;
00028 class CVector3;
00029 class CMatrix3;
00030 class CMatrix4;
00031
00032
00083
00084
00085 class SICPPSDKDECL CTransformation
00086 {
00087 public:
00088
00090 CTransformation();
00091
00095 CTransformation( const CTransformation& in_transformation);
00096
00098 ~CTransformation();
00099
00104 CTransformation & operator=( const CTransformation & in_transformation);
00105
00109 CMatrix4 GetMatrix4()const;
00110
00114 void SetMatrix4(const CMatrix4& in_matrix4);
00115
00120 CTransformation& SetRotation( const CRotation &in_Rotation );
00121
00125 CRotation GetRotation() const;
00126
00132 CTransformation& SetRotX(const double& in_dX);
00133
00138 double GetRotX() const;
00139
00145 CTransformation& SetRotY(const double& in_dY);
00146
00151 double GetRotY()const;
00152
00158 CTransformation& SetRotZ(const double& in_dZ);
00159
00164 double GetRotZ()const;
00165
00171 void PutRotationOrder( CRotation::RotationOrder in_Order );
00172
00177 CRotation::RotationOrder GetRotationOrder() const;
00178
00190 CTransformation& SetRotationFromXYZAnglesValues
00191 (
00192 double in_dX,
00193 double in_dY,
00194 double in_dZ,
00195 CRotation::RotationOrder in_Order
00196 );
00197
00206 CTransformation& SetRotationFromXYZAnglesValues
00207 (
00208 double in_dX,
00209 double in_dY,
00210 double in_dZ
00211 );
00212
00218 void GetRotationFromXYZAnglesValues
00219 (
00220 double& io_dX,
00221 double& io_dY,
00222 double& io_dZ
00223 )const;
00224
00229 CTransformation& MulInPlace(const CTransformation& in_transformation);
00230
00236 CTransformation& Mul
00237 (
00238 const CTransformation & in_transformationA,
00239 const CTransformation & in_transformationB
00240 );
00241
00246 CTransformation& AddParentTranslation(const CVector3& in_vector3);
00247
00252 CTransformation& AddLocalTranslation(const CVector3& in_vector3);
00253
00258 CTransformation& AddParentScaling(const CVector3& in_vector3);
00259
00264 CTransformation& AddLocalScaling(const CVector3& in_vector3);
00265
00273 CTransformation& SetRotationFromXYZAxes
00274 (
00275 const CVector3& in_vector3X,
00276 const CVector3& in_vector3Y,
00277 const CVector3& in_vector3Z
00278 );
00279
00286 CTransformation& SetTranslationFromValues
00287 (
00288 double in_dX,
00289 double in_dY,
00290 double in_dZ
00291 );
00292
00298 void GetTranslationValues
00299 (
00300 double& io_dX,
00301 double& io_dY,
00302 double& io_dZ
00303 )const;
00304
00311 CTransformation& SetScalingFromValues
00312 (
00313 double in_dX,
00314 double in_dY,
00315 double in_dZ
00316 );
00317
00323 void GetScalingValues
00324 (
00325 double& io_dX,
00326 double& io_dY,
00327 double& io_dZ
00328 )const;
00329
00335 void GetScalingOrientationXYZAngles
00336 (
00337 double& io_dX,
00338 double& io_dY,
00339 double& io_dZ
00340 )const;
00341
00348 CTransformation& SetScalingOrientationFromXYZAngles
00349 (
00350 double in_dX,
00351 double in_dY,
00352 double in_dZ
00353 );
00354
00358 bool HasScalingOrientation()const;
00359
00363 CTransformation& SetIdentity();
00364
00369 CTransformation& SetTranslation(const CVector3& in_vector3);
00370
00374 CVector3 GetTranslation()const;
00375
00381 CTransformation& SetPosX(const double& in_dX);
00382
00387 double GetPosX()const;
00388
00394 CTransformation& SetPosY(const double& in_dY);
00395
00400 double GetPosY()const;
00401
00407 CTransformation& SetPosZ(const double& in_dZ);
00408
00413 double GetPosZ()const;
00414
00420 CTransformation& SetRotationFromAxisAngle
00421 (
00422 const CVector3& in_vector3,
00423 double in_dAngle
00424 );
00425
00430 CTransformation& SetRotationFromXYZAngles(const CVector3& in_vector3);
00431
00436 double GetRotationAxisAngle (CVector3& io_vector3)const;
00437
00442 CVector3 GetRotationXYZAngles()const;
00443
00448 CTransformation& SetScaling(const CVector3& in_vector3);
00449
00453 CVector3 GetScaling()const;
00454
00460 CTransformation& SetSclX(const double& in_dX);
00461
00466 double GetSclX()const;
00467
00473 CTransformation& SetSclY(const double& in_dY);
00474
00479 double GetSclY()const;
00480
00486 CTransformation& SetSclZ(const double& in_dZ);
00487
00492 double GetSclZ()const;
00493
00498 CTransformation& SetRotationFromMatrix3(const CMatrix3& in_matrix3);
00499
00503 CMatrix3 GetRotationMatrix3()const;
00504
00509 CTransformation& SetRotationFromQuaternion(const CQuaternion& in_quaternion);
00510
00514 CQuaternion GetRotationQuaternion(void)const;
00515
00518 CTransformation& InvertInPlace();
00519
00523 CTransformation& Invert(const CTransformation& in_transfo);
00524
00530 bool EpsilonEquals
00531 (
00532 const CTransformation& in_transformation,
00533 double in_dEpsilon
00534 ) const;
00535
00540 bool Equals(const CTransformation& in_transformation) const;
00541
00547 bool operator ==(const CTransformation & in_transformation ) const;
00548
00554 bool operator !=(const CTransformation & in_transformation ) const;
00555 private:
00556 void* m_ptr;
00557 inline double GetPI(){return 3.14159265358979323846;}
00558 void DegreeToRadian(double& in_Rot);
00559 void RadianToDegree(double& in_Rot);
00560
00561 };
00562
00563 };
00564 };
00565
00566 #endif // __XSITRANSFORMATION_H__