Loading [MathJax]/extensions/tex2jax.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
HandleWeightOperation.hpp
1 #pragma once
2 
3 #include <Core/Animation/HandleWeight.hpp>
4 
5 namespace Ra {
6 namespace Core {
7 namespace Animation {
8 
9 /*
10  * Return the WeightMatrix extracted from the MeshWeight vector, for a handle with handle_size
11  * transforms
12  */
13 RA_CORE_API WeightMatrix extractWeightMatrix( const MeshWeight& weight, const uint handle_size );
14 
15 /*
16  * Return the MeshWeight from the given WeightMatrix.
17  */
18 RA_CORE_API MeshWeight extractMeshWeight( Eigen::Ref<const WeightMatrix> matrix );
19 
20 /*
21  * Return the WeightMatrix holding the partition of unity property.
22  * This is obtained by normalizing each row by its l1-norm, assuming:
23  * weights( i, j ) >= 0
24  * lpNorm1( weights.row( i ) ) > 0
25  */
26 RA_CORE_API WeightMatrix partitionOfUnity( Eigen::Ref<const WeightMatrix> weights );
27 
28 /*
29  * Return the index of the weight that influence the most the position of vertex at vertexId.
30  */
31 RA_CORE_API uint getMaxWeightIndex( Eigen::Ref<const WeightMatrix> weights, const uint vertexID );
32 
33 /*
34  * Return the vector containing the index of the handle influencing the most a vertex.
35  */
36 RA_CORE_API void getMaxWeightIndex( Eigen::Ref<const WeightMatrix> weights,
37  std::vector<uint>& handleID );
38 
39 /*
40  * Call Math::checkInvalidNumbers and checkNoWeightVertex on the input matrix
41  */
42 RA_CORE_API bool checkWeightMatrix( Eigen::Ref<const WeightMatrix> matrix,
43  const bool FAIL_ON_ASSERT = false,
44  const bool MT = false );
45 
46 RA_CORE_API bool checkNoWeightVertex( Eigen::Ref<const WeightMatrix> matrix,
47  const bool FAIL_ON_ASSERT = false,
48  const bool MT = false );
49 
54 RA_CORE_API bool normalizeWeights( Eigen::Ref<WeightMatrix> matrix, const bool MT = false );
55 
56 } // namespace Animation
57 } // Namespace Core
58 } // Namespace Ra
Definition: Cage.cpp:3