kfbxmatrix.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXMATH_KFBXMATRIX_H
00005 #define FBXFILESDK_KFBXMATH_KFBXMATRIX_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2009 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00044 #include <fbxfilesdk/kfbxmath/kfbxvector4.h>
00045 
00046 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00047 
00048 class KFbxQuaternion;
00049 class KFbxXMatrix;
00050 
00051 
00055 class KFBX_DLL KFbxMatrix : public fbxDouble44
00056 {
00057 
00058 public:
00059 
00064 
00066     KFbxMatrix ();
00067 
00071     KFbxMatrix (const KFbxMatrix& pM);
00072 
00078     KFbxMatrix (const KFbxVector4& pT,
00079                 const KFbxVector4& pR,
00080                 const KFbxVector4& pS);
00081 
00087     KFbxMatrix (const KFbxVector4& pT,
00088                 const KFbxQuaternion& pQ,
00089                 const KFbxVector4& pS);
00090 
00094     KFbxMatrix (const KFbxXMatrix& pM);
00095         
00097     ~KFbxMatrix ();
00098         
00100 
00105 
00111     double Get(int pY, int pX) const;
00112 
00117     KFbxVector4 GetRow(int pY) const;
00118 
00123     KFbxVector4 GetColumn(int pX) const;
00124 
00130     void Set(int pY, int pX, double pValue);
00131 
00133     void SetIdentity();
00134     
00140     void SetTRS(const KFbxVector4& pT,
00141                 const KFbxVector4& pR,
00142                 const KFbxVector4& pS);
00143 
00149     void SetTQS(const KFbxVector4& pT,
00150                 const KFbxQuaternion& pQ,
00151                 const KFbxVector4& pS);
00152 
00157     void SetRow(int pY, const KFbxVector4& pRow);
00158 
00163     void SetColumn(int pX, const KFbxVector4& pColumn);
00164 
00173     void GetElements(KFbxVector4 & pTranslation, KFbxQuaternion & pRotation,
00174         KFbxVector4 & pShearing, KFbxVector4 & pScaling, double & pSign) const;
00175 
00179     KFbxMatrix& operator=(const KFbxMatrix& pMatrix);
00180     
00182 
00187 
00191     KFbxMatrix operator-() const;
00192     
00197     KFbxMatrix operator+(const KFbxMatrix& pMatrix) const;
00198 
00203     KFbxMatrix operator-(const KFbxMatrix& pMatrix) const;
00204 
00209     KFbxMatrix operator*(const KFbxMatrix& pMatrix) const;
00210 
00215     KFbxMatrix& operator+=(const KFbxMatrix& pMatrix);
00216 
00221     KFbxMatrix& operator-=(const KFbxMatrix& pMatrix);
00222 
00227     KFbxMatrix& operator*=(const KFbxMatrix& pMatrix);
00228 
00232     KFbxMatrix Inverse() const;
00233 
00237     KFbxMatrix Transpose() const;
00238 
00240 
00245 
00250     KFbxVector4 MultNormalize(const KFbxVector4& pVector) const;
00251 
00253 
00258 
00263     bool operator==(const KFbxMatrix & pM) const;
00264 
00269     bool operator==(const KFbxXMatrix & pM) const;
00270 
00275     bool operator!=(const KFbxMatrix & pM) const;
00276 
00281     bool operator!=(const KFbxXMatrix & pM) const;
00282 
00283     
00285 
00290 
00292     operator double* ();
00293 
00295     operator const double* () const;
00296 
00298     typedef const double(kDouble44)[4][4] ;
00299 
00301     inline kDouble44 & Double44() const { return *((kDouble44 *)&mData); }
00302 
00304 
00305     // Matrix data.
00306 //  double mData[4][4];
00307 
00308 };
00309 
00310 inline EFbxType FbxTypeOf( KFbxMatrix   const &pItem )  { return eDOUBLE44; }
00311 
00312 
00313 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00314 
00315 #endif // FBXFILESDK_KFBXMATH_KFBXMATRIX_H
00316