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 - 2010 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/kfbxsubdeformer.h>
00044 #include <fbxfilesdk/kfbxplugins/kfbxgroupname.h>
00045 #include <fbxfilesdk/kfbxmath/kfbxmatrix.h>
00046 
00047 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00048 
00049 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00050 
00051 class KFbxSdkManager;
00052 class KFbxNode;
00053 class KFbxCluster_internal;
00054 
00082 class KFBX_DLL KFbxCluster : public KFbxSubDeformer
00083 {
00084     KFBXOBJECT_DECLARE(KFbxCluster,KFbxSubDeformer);
00085 
00086 public:
00094     ESubDeformerType GetSubDeformerType() const {return eCLUSTER; };
00095 
00103     void Reset();
00105 
00131     typedef enum
00132     {
00133         eNORMALIZE,
00134         eADDITIVE,
00135         eTOTAL1
00136     } ELinkMode;
00137 
00142     void SetLinkMode(ELinkMode pMode);
00143 
00147     ELinkMode GetLinkMode() const;
00148 
00154     void SetLink(KFbxNode const* pNode);
00155 
00161     KFbxNode* GetLink();
00162 
00168     KFbxNode const* GetLink() const;
00169 
00179     void SetAssociateModel(KFbxNode *pNode);
00180 
00190     KFbxNode* GetAssociateModel() const;
00192 
00200 
00205     void AddControlPointIndex(int pIndex, double pWeight);
00206 
00211     int GetControlPointIndicesCount() const;
00212 
00217     int* GetControlPointIndices() const;
00218 
00223     double* GetControlPointWeights() const;
00224 
00226 
00231     void SetControlPointIWCount(int pCount);
00232 
00246 
00250     void SetTransformMatrix(const KFbxXMatrix& pMatrix);
00251 
00256     KFbxXMatrix& GetTransformMatrix(KFbxXMatrix& pMatrix) const;
00257 
00261     void SetTransformLinkMatrix(const KFbxXMatrix& pMatrix);
00262 
00267     KFbxXMatrix& GetTransformLinkMatrix(KFbxXMatrix& pMatrix) const;
00268 
00272     void SetTransformAssociateModelMatrix(const KFbxXMatrix& pMatrix);
00273 
00278     KFbxXMatrix& GetTransformAssociateModelMatrix(KFbxXMatrix& pMatrix) const;
00279 
00283     void SetTransformParentMatrix(const KFbxXMatrix& pMatrix);
00284 
00289     KFbxXMatrix& GetTransformParentMatrix(KFbxXMatrix& pMatrix) const;
00290 
00294     bool IsTransformParentSet() const { return mIsTransformParentSet; }
00295 
00297 
00299 //
00300 //  WARNING!
00301 //
00302 //  Anything beyond these lines may not be documented accurately and is
00303 //  subject to change without notice.
00304 //
00306 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00307 
00308     virtual KFbxObject& Copy(const KFbxObject& pObject);
00309 
00310 protected:
00311     KFbxCluster(KFbxSdkManager& pManager, char const* pName);
00312 
00313     virtual void Construct(const KFbxCluster* pFrom);
00314     virtual bool ConstructProperties( bool pForceSet );
00315 
00316     virtual KStringList GetTypeFlags() const;
00317 
00324 
00325   public:
00330     void SetUserData(KString pUserDataID, KString pUserData);
00331 
00333     KString GetUserDataID () const;
00334 
00336     KString GetUserData () const;
00337 
00339     KString GetUserData (KString pUserDataID) const;
00340 
00342 
00343 protected:
00344 
00345     //  Cluster deformer
00346     ELinkMode               mLinkMode;
00347     KString                 mUserDataID;
00348     KString                 mUserData;
00349     KArrayTemplate<int>     mControlPointIndices;
00350     KArrayTemplate<double>  mControlPointWeights;
00351     KFbxMatrix              mTransform;
00352     KFbxMatrix              mTransformLink;
00353     KFbxMatrix              mTransformAssociate;
00354     KFbxMatrix              mTransformParent;
00355     bool                    mIsTransformParentSet;
00356 
00357 public:
00358     // For pre version 6 support
00359     KString                 mBeforeVersion6LinkName;
00360     KString                 mBeforeVersion6AssociateModelName;
00361 
00362 protected:
00363     // Properties
00364     KFbxTypedProperty<fbxReference> SrcModel;
00365     KFbxTypedProperty<fbxReference> SrcModelReference;
00366 
00367     friend class KFbxScene;
00368 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00369 };
00370 
00371 typedef KFbxCluster* HKFbxCluster;
00372 
00373 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00374 
00375 #endif // FBXFILESDK_KFBXPLUGINS_KFBXCLUSTER_H
00376