- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# fbxweightedmapping.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2013 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     FbxWeightedMapping& operator=(const FbxWeightedMapping& pWMap);
    00124
    00125 private:
    00126
    00128     void Clear();
    00129
    00130     FbxArray<FbxArray<Element>*> mElements[2];
    00131
    00132 };
    00133
    00134 typedef class FbxArray<FbxWeightedMapping::Element> FbxArrayTemplateElement;
    00135 typedef class FbxArray<FbxArray<FbxWeightedMapping::Element>*> FbxArrayTemplateArrayTemplateElement;
    00136
    00137 #include <fbxsdk/fbxsdk_nsend.h>
    00138
    00139 #endif /* _FBXSDK_SCENE_GEOMETRY_WEIGHTED_MAPPING_H_ */