kfbxweightedmapping.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002 
00003    Copyright (C) 2010 Autodesk, Inc.
00004    All rights reserved.
00005 
00006    Use of this software is subject to the terms of the Autodesk license agreement
00007    provided at the time of installation or download, or which otherwise accompanies
00008    this software in either electronic or hard copy form.
00009 
00010 ****************************************************************************************/
00011 
00015 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXWEIGHTEDMAPPING_H
00016 #define FBXFILESDK_KFBXPLUGINS_KFBXWEIGHTEDMAPPING_H
00017 
00018 
00019 #include <fbxfilesdk/fbxfilesdk_def.h>
00020 
00021 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00022 
00023 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00024 
00031 class KFBX_DLL KFbxWeightedMapping
00032 {
00033 
00034 public:
00035 
00038     typedef enum 
00039     {
00040         eSOURCE,        
00041         eDESTINATION    
00042     } ESet;
00043 
00045     struct KElement
00046     {
00048         int mIndex;
00050         double mWeight;
00051     };
00052 
00057 
00063     KFbxWeightedMapping(int pSourceSize, int pDestinationSize);
00064 
00066     ~KFbxWeightedMapping();
00068 
00069 
00074     void Reset(int pSourceSize, int pDestinationSize);
00075 
00081     void Add(int pSourceIndex, int pDestinationIndex, double pWeight);
00082 
00086     int GetElementCount(ESet pSet) const;
00087 
00094     int GetRelationCount(ESet pSet, int pElement) const;
00095 
00102     KElement& GetRelation(ESet pSet, int pElement, int pIndex);
00103 
00111     int GetRelationIndex(ESet pSet, int pElementInSet, int pElementInOtherSet) const;
00112 
00119     double GetRelationSum(ESet pSet, int pElement, bool pAbsoluteValue) const;
00120     
00121 
00126     void Normalize(ESet pSet, bool pAbsoluteValue);
00127     
00128 private:
00129 
00131     void Clear();
00132 
00133     KArrayTemplate<KArrayTemplate<KElement>*> mElements[2];
00134 
00135 };      
00136 
00137 typedef class KFBX_DLL KArrayTemplate<KFbxWeightedMapping::KElement> KArrayTemplateKElement;
00138 typedef class KFBX_DLL KArrayTemplate<KArrayTemplate<KFbxWeightedMapping::KElement>*> KArrayTemplateKArrayTemplateKElement;
00139 typedef KFbxWeightedMapping* HKFbxWeightedMapping;
00140 
00141 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00142 
00143 #endif // FBXFILESDK_KFBXPLUGINS_KFBXWEIGHTEDMAPPING_H
00144