FBX SDK Reference Guide: kfbxcluster.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXCLUSTER_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXCLUSTER_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 <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043 #include <fbxfilesdk/components/kbaselib/kaydara.h>
00044 
00045 #include <fbxfilesdk/kfbxplugins/kfbxsubdeformer.h>
00046 #include <fbxfilesdk/kfbxplugins/kfbxgroupname.h>
00047 #include <fbxfilesdk/kfbxmath/kfbxmatrix.h>
00048 
00049 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00050 
00051 #include <fbxfilesdk/components/kbaselib/kbaselib_forward.h>
00052 
00053 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00054 
00055 class KFbxSdkManager;
00056 class KFbxNode;
00057 class KFbxCluster_internal;
00058 
00063 class KFBX_DLL KFbxCluster : public KFbxSubDeformer
00064 {
00065     KFBXOBJECT_DECLARE(KFbxCluster,KFbxSubDeformer);
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     void SetControlPointIWCount(int pCount);
00199 
00212 
00216     void SetTransformMatrix(KFbxXMatrix& pMatrix);
00217 
00222     KFbxXMatrix& GetTransformMatrix(KFbxXMatrix& pMatrix);
00223 
00227     void SetTransformLinkMatrix(KFbxXMatrix& pMatrix);
00228 
00233     KFbxXMatrix& GetTransformLinkMatrix(KFbxXMatrix& pMatrix);
00234 
00238     void SetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix);
00239 
00244     KFbxXMatrix& GetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix);
00245 
00249     void SetTransformParentMatrix(KFbxXMatrix& pMatrix);
00250 
00255     KFbxXMatrix& GetTransformParentMatrix(KFbxXMatrix& pMatrix);
00256 
00260     bool IsTransformParentSet() const { return mIsTransformParentSet; }
00261 
00263 
00267     KFbxCluster& operator=(KFbxCluster const& pCluster);
00268 
00270 //
00271 //  WARNING!
00272 //
00273 //  Anything beyond these lines may not be documented accurately and is
00274 //  subject to change without notice.
00275 //
00277 
00278 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00279 
00280     // Clone
00281     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00282 
00283 protected:
00284 
00285     KFbxCluster(KFbxSdkManager& pManager, char const* pName);
00286     virtual ~KFbxCluster();
00287 
00288     virtual void Construct(const KFbxCluster* pFrom);
00289     virtual void Destruct(bool pRecursive, bool pDependents);
00290 
00291     virtual bool ConstructProperties( bool pForceSet );
00292 
00293     virtual KString     GetTypeName() const;
00294     virtual KStringList GetTypeFlags() const;
00295 
00302 
00303   public:
00308     void SetUserData(KString pUserDataID, KString pUserData);
00309 
00311     KString GetUserDataID () const;
00312 
00314     KString GetUserData () const;
00315 
00317     KString GetUserData (KString pUserDataID) const;
00318 
00320 
00321 protected:
00322 
00323     //  Cluster deformer
00324     ELinkMode               mLinkMode;
00325     KString                 mUserDataID;
00326     KString                 mUserData;
00327     KArrayTemplate<int>     mControlPointIndices;
00328     KArrayTemplate<double>  mControlPointWeights;
00329     KFbxMatrix              mTransform;
00330     KFbxMatrix              mTransformLink;
00331     KFbxMatrix              mTransformAssociate;
00332     KFbxMatrix              mTransformParent;
00333     bool                    mIsTransformParentSet;
00334 
00335 public:
00336     // For pre version 6 support
00337     KString                 mBeforeVersion6LinkName;
00338     KString                 mBeforeVersion6AssociateModelName;
00339 
00340 protected:
00341     // Properties
00342     KFbxTypedProperty<fbxReference> SrcModel;
00343     KFbxTypedProperty<fbxReference> SrcModelReference;
00344 
00345     friend class KFbxScene;
00346 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00347 };
00348 
00349 typedef KFbxCluster* HKFbxCluster;
00350 
00351 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00352 
00353 #endif // FBXFILESDK_KFBXPLUGINS_KFBXCLUSTER_H
00354