kfbxcluster.h

Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_CLUSTER_H_
00005 #define _FBXSDK_CLUSTER_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 2007 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 
00042 #include <kaydaradef.h>
00043 #ifndef KFBX_DLL 
00044     #define KFBX_DLL K_DLLIMPORT
00045 #endif
00046 
00047 #include <kaydara.h>
00048 
00049 #include <kfbxplugins/kfbxsubdeformer.h>
00050 #include <kfbxplugins/kfbxgroupname.h>
00051 #include <kfbxmath/kfbxmatrix.h>
00052 
00053 #include <klib/kerror.h>
00054 
00055 #include <kbaselib_forward.h>
00056 
00057 #include <fbxfilesdk_nsbegin.h>
00058 
00059 class KFbxSdkManager; 
00060 class KFbxNode;
00061 class KFbxCluster_internal;
00062 
00063 class KFBX_DLL KFbxCluster : public KFbxSubDeformer
00064 {
00065     KFBXOBJECT_DECLARE(KFbxCluster);
00066 public:
00070     ESubDeformerType GetSubDeformerType() {return eCLUSTER; };
00071 
00072 
00080     void Reset();
00081 
00104     typedef enum   
00105     { 
00106         eNORMALIZE, 
00107         eADDITIVE, 
00108         eTOTAL1
00109     } ELinkMode;
00110 
00115     void SetLinkMode(ELinkMode pMode);
00116     
00120     ELinkMode GetLinkMode() const;
00121     
00128     void SetLink(KFbxNode const* pNode);
00129     
00136     KFbxNode* GetLink();
00137     KFbxNode const* GetLink() const;
00138     
00149     void SetAssociateModel(KFbxNode *pNode);
00150     
00161     KFbxNode* GetAssociateModel() const;
00162     
00171 
00176     void AddControlPointIndex(int pIndex, double pWeight);
00177 
00182     int GetControlPointIndicesCount();
00183 
00188     int* GetControlPointIndices();
00189     
00194     double* GetControlPointWeights();
00195     
00197 
00198 
00211     
00215     void SetTransformMatrix(KFbxXMatrix& pMatrix);
00216 
00221     KFbxXMatrix& GetTransformMatrix(KFbxXMatrix& pMatrix);
00222     
00226     void SetTransformLinkMatrix(KFbxXMatrix& pMatrix);
00227 
00232     KFbxXMatrix& GetTransformLinkMatrix(KFbxXMatrix& pMatrix);
00233     
00237     void SetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix);
00238 
00243     KFbxXMatrix& GetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix);
00244 
00248     void SetTransformParentMatrix(KFbxXMatrix& pMatrix);
00249 
00254     KFbxXMatrix& GetTransformParentMatrix(KFbxXMatrix& pMatrix);
00255 
00259     bool IsTransformParentSet() const { return mIsTransformParentSet; }
00260 
00262 
00264     KFbxCluster& operator=(KFbxCluster const& pCluster);
00265 
00267 //
00268 //  WARNING!
00269 //
00270 //  Anything beyond these lines may not be documented accurately and is 
00271 //  subject to change without notice.
00272 //
00274 
00275 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00276 
00277     // Clone
00278     virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType) const;
00279 
00280 protected:
00281     static char const* GetNamePrefix() { return SUBDEFORMER_PREFIX; }
00282 
00283     KFbxCluster(KFbxSdkManager& pManager, char const* pName);
00284     virtual ~KFbxCluster();
00285 
00286     virtual void Destruct(bool pRecursive, bool pDependents);
00287 
00288     virtual KString     GetTypeName() const;
00289     virtual KStringList GetTypeFlags() const;
00290 
00291     // Properties Handler
00292     virtual KObject* GetFbxObject_internal();
00293     virtual KObject const*  GetFbxObject_internal() const;
00294 
00301 
00302   public:
00307     void SetUserData(KString pUserDataID, KString pUserData);
00308     
00310     KString GetUserDataID () const;
00311     
00313     KString GetUserData () const;
00314     
00316     KString GetUserData (KString pUserDataID) const;
00317 
00319 
00320 protected:
00321 
00322     //  Cluster deformer
00323     ELinkMode               mLinkMode;
00324     KString                 mUserDataID;
00325     KString                 mUserData;
00326     KArrayTemplate<int>     mControlPointIndices;
00327     KArrayTemplate<double>  mControlPointWeights;
00328     KFbxMatrix              mTransform;
00329     KFbxMatrix              mTransformLink;
00330     KFbxMatrix              mTransformAssociate;
00331     KFbxMatrix              mTransformParent;
00332     bool                    mIsTransformParentSet;
00333 
00334     // For pre version 6 support
00335     KString                 mBeforeVersion6LinkName;
00336     KString                 mBeforeVersion6AssociateModelName;
00337 
00338     friend class KFbxReaderFbx;
00339     friend class KFbxReaderFbx6;
00340     friend class KFbxWriterFbx;
00341     friend class KFbxWriterFbx6;
00342     friend class KFbxScene;
00343 
00344 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00345 };
00346 
00347 typedef KFbxCluster* HKFbxCluster;
00348 
00349 #include <fbxfilesdk_nsend.h>
00350 
00351 #endif // _FBXSDK_CLUSTER_H_