Define a weighted bidirectional mapping relation on objects.
There are two object set. The source object of mapping is in source set. The destination object is in destination set. Each object can have multiple mapping relation with other objects.
Definition at line 31 of file kfbxweightedmapping.h.
#include <kfbxweightedmapping.h>
Classes |
|
struct | KElement |
Record one mapping from one object. More... |
|
Public Types |
|
enum | ESet { eSOURCE, eDESTINATION } |
Object set type in the mapping relation. More... |
|
Public Member Functions |
|
void | Reset (int pSourceSize, int pDestinationSize) |
Remove all weighted relations and give new
source and destination sets sizes. |
|
void | Add (int pSourceIndex, int pDestinationIndex, double pWeight) |
Add a weighted mapping relation. |
|
int | GetElementCount (ESet pSet) const |
Get the number of elements of a set.
|
|
int | GetRelationCount (ESet pSet, int pElement) const |
Get the number of relations an element of a
set is linked to. |
|
KElement & | GetRelation (ESet pSet, int pElement, int pIndex) |
Get one of the relations an element of a set
is linked to. |
|
int | GetRelationIndex (ESet pSet, int pElementInSet, int pElementInOtherSet) const |
Given the index of an element in the other
set, get the index of one of the relations an element of a set is
linked to. |
|
double | GetRelationSum (ESet pSet, int pElement, bool pAbsoluteValue) const |
Get the sum of the weights from the
relations an element of a set is linked to. |
|
void | Normalize (ESet pSet, bool pAbsoluteValue) |
Normalize the weights of the relations of
all the elements of a set. |
|
Constructor and Destructor |
|
KFbxWeightedMapping (int pSourceSize, int pDestinationSize) | |
Constructor. |
|
~KFbxWeightedMapping () | |
Destructor. |
enum ESet |
Object set type in the mapping relation.
Definition at line 38 of file kfbxweightedmapping.h.
{ eSOURCE, eDESTINATION } ESet;
KFbxWeightedMapping | ( | int | pSourceSize, |
int | pDestinationSize | ||
) |
Constructor.
Initialize the source set and destination set.
pSourceSize | Source set size |
pDestinationSize | Destination set size |
~KFbxWeightedMapping | ( | ) |
Destructor.
void Reset | ( | int | pSourceSize, |
int | pDestinationSize | ||
) |
Remove all weighted relations and give new source and destination sets sizes.
pSourceSize | New source set size. |
pDestinationSize | New destination set size. |
void Add | ( | int | pSourceIndex, |
int | pDestinationIndex, | ||
double | pWeight | ||
) |
Add a weighted mapping relation.
pSourceIndex | Index of the source object. |
pDestinationIndex | Index of the destination object. |
pWeight | Weight of the mapping. |
int GetElementCount | ( | ESet | pSet | ) | const |
Get the number of elements of a set.
pSet | source or destination set. |
int GetRelationCount | ( | ESet | pSet, |
int | pElement | ||
) | const |
Get the number of relations an element of a set is linked to.
For example, for one object (which index is specified by pElement) in source set (specified by pSet), the function return how many objects (as destination) the object (as source) mapping to.
pSet | Source or destination set. |
pElement | Object index in the set. |
Get one of the relations an element of a set is linked to.
pSet | Source or destination set. |
pElement | Object index in the set. |
pIndex | Relation index of the object linked to. |
int GetRelationIndex | ( | ESet | pSet, |
int | pElementInSet, | ||
int | pElementInOtherSet | ||
) | const |
Given the index of an element in the other set, get the index of one of the relations an element of a set is linked to.
Returns -1 if there is not relation between these elements.
pSet | Source or destination set. |
pElementInSet | Object index in the set. |
pElementInOtherSet | Object index in another set. |
double GetRelationSum | ( | ESet | pSet, |
int | pElement, | ||
bool | pAbsoluteValue | ||
) | const |
Get the sum of the weights from the relations an element of a set is linked to.
pSet | Source or destination set. |
pElement | Object index in the set. |
pAbsoluteValue | Flag to convert negative value to positive value. |
void Normalize | ( | ESet | pSet, |
bool | pAbsoluteValue | ||
) |
Normalize the weights of the relations of all the elements of a set.
pSet | Source or destination set. |
pAbsoluteValue | Flag to convert negative value to positive value. |