FBX SDK Reference Guide: kfbxcluster.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_CLUSTER_H_
00005 #define _FBXSDK_CLUSTER_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 2008 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 
00067 class KFBX_DLL KFbxCluster : public KFbxSubDeformer
00068 {
00069     KFBXOBJECT_DECLARE(KFbxCluster,KFbxSubDeformer);
00070 public:
00074     ESubDeformerType GetSubDeformerType() {return eCLUSTER; };
00075 
00076 
00084     void Reset();
00085 
00108     typedef enum
00109     {
00110         eNORMALIZE,
00111         eADDITIVE,
00112         eTOTAL1
00113     } ELinkMode;
00114 
00119     void SetLinkMode(ELinkMode pMode);
00120 
00124     ELinkMode GetLinkMode() const;
00125 
00132     void SetLink(KFbxNode const* pNode);
00133 
00140     KFbxNode* GetLink();
00141     KFbxNode const* GetLink() const;
00142 
00153     void SetAssociateModel(KFbxNode *pNode);
00154 
00165     KFbxNode* GetAssociateModel() const;
00166 
00175 
00180     void AddControlPointIndex(int pIndex, double pWeight);
00181 
00186     int GetControlPointIndicesCount();
00187 
00192     int* GetControlPointIndices();
00193 
00198     double* GetControlPointWeights();
00199 
00201 
00202 
00215 
00219     void SetTransformMatrix(KFbxXMatrix& pMatrix);
00220 
00225     KFbxXMatrix& GetTransformMatrix(KFbxXMatrix& pMatrix);
00226 
00230     void SetTransformLinkMatrix(KFbxXMatrix& pMatrix);
00231 
00236     KFbxXMatrix& GetTransformLinkMatrix(KFbxXMatrix& pMatrix);
00237 
00241     void SetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix);
00242 
00247     KFbxXMatrix& GetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix);
00248 
00252     void SetTransformParentMatrix(KFbxXMatrix& pMatrix);
00253 
00258     KFbxXMatrix& GetTransformParentMatrix(KFbxXMatrix& pMatrix);
00259 
00263     bool IsTransformParentSet() const { return mIsTransformParentSet; }
00264 
00266 
00268     KFbxCluster& operator=(KFbxCluster const& pCluster);
00269 
00271 //
00272 //  WARNING!
00273 //
00274 //  Anything beyond these lines may not be documented accurately and is
00275 //  subject to change without notice.
00276 //
00278 
00279 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00280 
00281     // Clone
00282     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00283 
00284 protected:
00285 
00286     KFbxCluster(KFbxSdkManager& pManager, char const* pName);
00287     virtual ~KFbxCluster();
00288 
00289     virtual void Construct(const KFbxCluster* pFrom);
00290     virtual void Destruct(bool pRecursive, bool pDependents);
00291 
00292     virtual bool ConstructProperties( bool pForceSet );
00293 
00294     virtual KString     GetTypeName() const;
00295     virtual KStringList GetTypeFlags() const;
00296 
00303 
00304   public:
00309     void SetUserData(KString pUserDataID, KString pUserData);
00310 
00312     KString GetUserDataID () const;
00313 
00315     KString GetUserData () const;
00316 
00318     KString GetUserData (KString pUserDataID) const;
00319 
00321 
00322 protected:
00323 
00324     //  Cluster deformer
00325     ELinkMode               mLinkMode;
00326     KString                 mUserDataID;
00327     KString                 mUserData;
00328     KArrayTemplate<int>     mControlPointIndices;
00329     KArrayTemplate<double>  mControlPointWeights;
00330     KFbxMatrix              mTransform;
00331     KFbxMatrix              mTransformLink;
00332     KFbxMatrix              mTransformAssociate;
00333     KFbxMatrix              mTransformParent;
00334     bool                    mIsTransformParentSet;
00335 
00336     // For pre version 6 support
00337     KString                 mBeforeVersion6LinkName;
00338     KString                 mBeforeVersion6AssociateModelName;
00339 
00340     // Properties
00341     KFbxTypedProperty<fbxReference> SrcModel;
00342     KFbxTypedProperty<fbxReference> SrcModelReference;
00343 
00344     friend class KFbxReaderFbx;
00345     friend class KFbxReaderFbx6;
00346     friend struct KFbxReaderFbx7Impl;
00347     friend class KFbxWriterFbx;
00348     friend class KFbxWriterFbx6;
00349     friend struct KFbxWriterFbx7Impl;
00350     friend class KFbxScene;
00351 
00352 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00353 };
00354 
00355 typedef KFbxCluster* HKFbxCluster;
00356 
00357 #include <fbxfilesdk_nsend.h>
00358 
00359 #endif // _FBXSDK_CLUSTER_H_