kfbxcluster.h

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 (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 
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 
00062 class KFBX_DLL KFbxCluster : public KFbxSubDeformer
00063 {
00064     KFBXOBJECT_DECLARE(KFbxCluster,KFbxSubDeformer);
00065 
00066 public:
00070     ESubDeformerType GetSubDeformerType() {return eCLUSTER; };
00071 
00079     void Reset();
00080 
00103     typedef enum
00104     {
00105         eNORMALIZE,
00106         eADDITIVE,
00107         eTOTAL1
00108     } ELinkMode;
00109 
00114     void SetLinkMode(ELinkMode pMode);
00115 
00119     ELinkMode GetLinkMode() const;
00120 
00127     void SetLink(KFbxNode const* pNode);
00128 
00135     KFbxNode* GetLink();
00136 
00143     KFbxNode const* GetLink() const;
00144 
00155     void SetAssociateModel(KFbxNode *pNode);
00156 
00167     KFbxNode* GetAssociateModel() const;
00168 
00177 
00182     void AddControlPointIndex(int pIndex, double pWeight);
00183 
00188     int GetControlPointIndicesCount();
00189 
00194     int* GetControlPointIndices();
00195 
00200     double* GetControlPointWeights();
00201 
00203 
00207     void SetControlPointIWCount(int pCount);
00208 
00221 
00225     void SetTransformMatrix(KFbxXMatrix& pMatrix);
00226 
00231     KFbxXMatrix& GetTransformMatrix(KFbxXMatrix& pMatrix);
00232 
00236     void SetTransformLinkMatrix(KFbxXMatrix& pMatrix);
00237 
00242     KFbxXMatrix& GetTransformLinkMatrix(KFbxXMatrix& pMatrix);
00243 
00247     void SetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix);
00248 
00253     KFbxXMatrix& GetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix);
00254 
00258     void SetTransformParentMatrix(KFbxXMatrix& pMatrix);
00259 
00264     KFbxXMatrix& GetTransformParentMatrix(KFbxXMatrix& pMatrix);
00265 
00269     bool IsTransformParentSet() const { return mIsTransformParentSet; }
00270 
00272 
00276     KFbxCluster& operator=(KFbxCluster const& pCluster);
00277 
00279 //
00280 //  WARNING!
00281 //
00282 //  Anything beyond these lines may not be documented accurately and is
00283 //  subject to change without notice.
00284 //
00286 
00287 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00288 
00289     // Clone
00290     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00291 
00292 protected:
00293 
00294     KFbxCluster(KFbxSdkManager& pManager, char const* pName);
00295 
00296     virtual void Construct(const KFbxCluster* pFrom);
00297     virtual bool ConstructProperties( bool pForceSet );
00298 
00299     virtual KString     GetTypeName() const;
00300     virtual KStringList GetTypeFlags() const;
00301 
00308 
00309   public:
00314     void SetUserData(KString pUserDataID, KString pUserData);
00315 
00317     KString GetUserDataID () const;
00318 
00320     KString GetUserData () const;
00321 
00323     KString GetUserData (KString pUserDataID) const;
00324 
00326 
00327 protected:
00328 
00329     //  Cluster deformer
00330     ELinkMode               mLinkMode;
00331     KString                 mUserDataID;
00332     KString                 mUserData;
00333     KArrayTemplate<int>     mControlPointIndices;
00334     KArrayTemplate<double>  mControlPointWeights;
00335     KFbxMatrix              mTransform;
00336     KFbxMatrix              mTransformLink;
00337     KFbxMatrix              mTransformAssociate;
00338     KFbxMatrix              mTransformParent;
00339     bool                    mIsTransformParentSet;
00340 
00341 public:
00342     // For pre version 6 support
00343     KString                 mBeforeVersion6LinkName;
00344     KString                 mBeforeVersion6AssociateModelName;
00345 
00346 protected:
00347     // Properties
00348     KFbxTypedProperty<fbxReference> SrcModel;
00349     KFbxTypedProperty<fbxReference> SrcModelReference;
00350 
00351     friend class KFbxScene;
00352 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00353 };
00354 
00355 typedef KFbxCluster* HKFbxCluster;
00356 
00357 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00358 
00359 #endif // FBXFILESDK_KFBXPLUGINS_KFBXCLUSTER_H
00360