forked from TomohikoMukai/SrtRbfNode
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSrtRbfNode.h
116 lines (109 loc) · 2.38 KB
/
SrtRbfNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef SRTRBF_NODE_H
#define SRTRBF_NODE_H
#pragma once
#include <maya/MPxNode.h>
#include <maya/MPxCommand.h>
#include <maya/MString.h>
#include <maya/MPlug.h>
#include <maya/MPlugArray.h>
#include <maya/MObjectArray.h>
#include <Eigen/Dense>
#include <vector>
#include "PoseVariable.h"
class SrtRbfNode : public MPxNode
{
//
// attribute names
public:
static const MString className;
static const MString inputAttrName[3];
static const MString outputAttrName[3];
static const MString versionAttrName[3];
static const MString numExsAttrName[3];
static const MString primRefAttrName[3];
static const MString primaryAttrName[3];
static const MString secondaryAttrName[3];
static const MString invKerMatAttrName[3];
static const MString affinityAttrName[3];
static const MString rbfAttrName[3];
static const MString distAttrName[3];
static const MString targetAttrName[3];
//
// attributes
protected:
static MObject versionAttr;
static MObject outputAttr;
static MObject numExsAttr;
static MObject affinityAttr;
static MObject rbfAttr;
static MObject targetAttr;
//
// interpolation weight
private:
Eigen::VectorXd weight;
void
updateWeight(
const MPlug& plug,
MDataBlock& dataBlock);
//
// constructor & destructor
public:
SrtRbfNode() { };
virtual ~SrtRbfNode() { };
//
// overrides
public:
MStatus
setDependentsDirty(
const MPlug& plugBeingDirtied,
MPlugArray& affectedPlugs) override;
MStatus
compute(
const MPlug& plug,
MDataBlock& dataBlock) override;
MStatus
addExample(
double add,
int sign);
MStatus
setAffinityConstraint(
bool flag);
MStatus
setRbfType(
int type,
double param);
MStatus
setGeodesicType(
int type);
MStatus
gotoExample(
int eid);
protected:
MStatus
addExampleSupport(
const std::vector<PoseVariable>& primPose,
const PoseVariable& secPpose);
//
// node generation
public:
static MStatus
initSrtRbfNode();
static const MTypeId SrtRbfNodeID;
};
///
class CreateSrtRbfNode : public MPxCommand
{
public:
virtual MStatus
doIt(
const MArgList& args);
};
///
class AddSrtRbfExample : public MPxCommand
{
public:
virtual MStatus
doIt(
const MArgList& args);
};
#endif //SRTRBF_NODE_H