fbxweightedmapping.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2012 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 
00013 #ifndef _FBXSDK_SCENE_GEOMETRY_WEIGHTED_MAPPING_H_
00014 #define _FBXSDK_SCENE_GEOMETRY_WEIGHTED_MAPPING_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/base/fbxarray.h>
00019 
00020 #include <fbxsdk/fbxsdk_nsbegin.h>
00021 
00028 class FBXSDK_DLL FbxWeightedMapping
00029 {
00030 public:
00033     enum ESet
00034     {
00035         eSource,        
00036         eDestination    
00037     };
00038 
00040     struct Element
00041     {
00043         int mIndex;
00045         double mWeight;
00046     };
00047 
00052 
00058     FbxWeightedMapping(int pSourceSize, int pDestinationSize);
00059 
00061     ~FbxWeightedMapping();
00063 
00064 
00069     void Reset(int pSourceSize, int pDestinationSize);
00070 
00076     void Add(int pSourceIndex, int pDestinationIndex, double pWeight);
00077 
00081     int GetElementCount(ESet pSet) const;
00082 
00089     int GetRelationCount(ESet pSet, int pElement) const;
00090 
00097     Element& GetRelation(ESet pSet, int pElement, int pIndex);
00098 
00106     int GetRelationIndex(ESet pSet, int pElementInSet, int pElementInOtherSet) const;
00107 
00114     double GetRelationSum(ESet pSet, int pElement, bool pAbsoluteValue) const;
00115     
00116 
00121     void Normalize(ESet pSet, bool pAbsoluteValue);
00122     
00123 private:
00124 
00126     void Clear();
00127 
00128     FbxArray<FbxArray<Element>*> mElements[2];
00129 
00130 };      
00131 
00132 typedef class FBXSDK_DLL FbxArray<FbxWeightedMapping::Element> FbxArrayTemplateElement;
00133 typedef class FBXSDK_DLL FbxArray<FbxArray<FbxWeightedMapping::Element>*> FbxArrayTemplateArrayTemplateElement;
00134 
00135 #include <fbxsdk/fbxsdk_nsend.h>
00136 
00137 #endif /* _FBXSDK_SCENE_GEOMETRY_WEIGHTED_MAPPING_H_ */