FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxWeightedMapping Class Reference

#include <fbxweightedmapping.h>

Class Description

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 28 of file fbxweightedmapping.h.

Classes

struct  Element
 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. More...
 
void Add (int pSourceIndex, int pDestinationIndex, double pWeight)
 Add a weighted mapping relation. More...
 
int GetElementCount (ESet pSet) const
 Get the number of elements of a set. More...
 
int GetRelationCount (ESet pSet, int pElement) const
 Get the number of relations an element of a set is linked to. More...
 
ElementGetRelation (ESet pSet, int pElement, int pIndex)
 Get one of the relations an element of a set is linked to. More...
 
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. More...
 
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. More...
 
void Normalize (ESet pSet, bool pAbsoluteValue)
 Normalize the weights of the relations of all the elements of a set. More...
 
FbxWeightedMappingoperator= (const FbxWeightedMapping &pWMap)
 

Constructor and Destructor

 FbxWeightedMapping (int pSourceSize, int pDestinationSize)
 Constructor. More...
 
 ~FbxWeightedMapping ()
 Destructor. More...
 

Member Enumeration Documentation

◆ ESet

enum ESet

Object set type in the mapping relation.

Enumerator
eSource 

Object is as source.

eDestination 

Object is as destination.

Definition at line 33 of file fbxweightedmapping.h.

34  {
35  eSource,
37  };
Object is as destination.

Constructor & Destructor Documentation

◆ FbxWeightedMapping()

FbxWeightedMapping ( int  pSourceSize,
int  pDestinationSize 
)

Constructor.

Initialize the source set and destination set.

Parameters
pSourceSizeSource set size
pDestinationSizeDestination set size

◆ ~FbxWeightedMapping()

Destructor.

Member Function Documentation

◆ Reset()

void Reset ( int  pSourceSize,
int  pDestinationSize 
)

Remove all weighted relations and give new source and destination sets sizes.

Parameters
pSourceSizeNew source set size.
pDestinationSizeNew destination set size.

◆ Add()

void Add ( int  pSourceIndex,
int  pDestinationIndex,
double  pWeight 
)

Add a weighted mapping relation.

Parameters
pSourceIndexIndex of the source object.
pDestinationIndexIndex of the destination object.
pWeightWeight of the mapping.

◆ GetElementCount()

int GetElementCount ( ESet  pSet) const

Get the number of elements of a set.

Parameters
pSetsource or destination set.

◆ GetRelationCount()

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.

Parameters
pSetSource or destination set.
pElementObject index in the set.

◆ GetRelation()

Element& GetRelation ( ESet  pSet,
int  pElement,
int  pIndex 
)

Get one of the relations an element of a set is linked to.

Parameters
pSetSource or destination set.
pElementObject index in the set.
pIndexRelation index of the object linked to.
Returns
Element gives the index of an element in the other set and the assigned weight.

◆ GetRelationIndex()

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.

Parameters
pSetSource or destination set.
pElementInSetObject index in the set.
pElementInOtherSetObject index in another set.
Returns
The index of one of the relations, -1 if there is not relation between these elements.

◆ GetRelationSum()

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.

Parameters
pSetSource or destination set.
pElementObject index in the set.
pAbsoluteValueFlag to convert negative value to positive value.
Returns
The sum of the weights from the relations.

◆ Normalize()

void Normalize ( ESet  pSet,
bool  pAbsoluteValue 
)

Normalize the weights of the relations of all the elements of a set.

Parameters
pSetSource or destination set.
pAbsoluteValueFlag to convert negative value to positive value.

◆ operator=()

FbxWeightedMapping& operator= ( const FbxWeightedMapping pWMap)

The documentation for this class was generated from the following file: