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