~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPairBlend.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2008-2009 NetAllied Systems GmbH
 
3
 
 
4
    This file is part of MayaDataModel.
 
5
 
 
6
    Licensed under the MIT Open Source License,
 
7
    for details please see LICENSE file or the website
 
8
    http://www.opensource.org/licenses/mit-license.php
 
9
*/
 
10
#ifndef __MayaDM_PAIRBLEND_H__
 
11
#define __MayaDM_PAIRBLEND_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class PairBlend : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        PairBlend():DependNode(){}
 
23
        PairBlend(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "pairBlend", shared, create){}
 
25
        virtual ~PairBlend(){}
 
26
 
 
27
        void setCurrentDriver(unsigned int c)
 
28
        {
 
29
                if(c == 0) return;
 
30
                fprintf(mFile,"\tsetAttr \".c\" %i;\n", c);
 
31
        }
 
32
        void setInTranslate1(const double3& it1)
 
33
        {
 
34
                fprintf(mFile,"\tsetAttr \".it1\" -type \"double3\" ");
 
35
                it1.write(mFile);
 
36
                fprintf(mFile,";\n");
 
37
        }
 
38
        void setInTranslateX1(double itx1)
 
39
        {
 
40
                if(itx1 == 0) return;
 
41
                fprintf(mFile,"\tsetAttr \".it1.itx1\" %f;\n", itx1);
 
42
        }
 
43
        void setInTranslateY1(double ity1)
 
44
        {
 
45
                if(ity1 == 0) return;
 
46
                fprintf(mFile,"\tsetAttr \".it1.ity1\" %f;\n", ity1);
 
47
        }
 
48
        void setInTranslateZ1(double itz1)
 
49
        {
 
50
                if(itz1 == 0) return;
 
51
                fprintf(mFile,"\tsetAttr \".it1.itz1\" %f;\n", itz1);
 
52
        }
 
53
        void setInRotate1(const double3& ir1)
 
54
        {
 
55
                fprintf(mFile,"\tsetAttr \".ir1\" -type \"double3\" ");
 
56
                ir1.write(mFile);
 
57
                fprintf(mFile,";\n");
 
58
        }
 
59
        void setInRotateX1(double irx1)
 
60
        {
 
61
                if(irx1 == 0) return;
 
62
                fprintf(mFile,"\tsetAttr \".ir1.irx1\" %f;\n", irx1);
 
63
        }
 
64
        void setInRotateY1(double iry1)
 
65
        {
 
66
                if(iry1 == 0) return;
 
67
                fprintf(mFile,"\tsetAttr \".ir1.iry1\" %f;\n", iry1);
 
68
        }
 
69
        void setInRotateZ1(double irz1)
 
70
        {
 
71
                if(irz1 == 0) return;
 
72
                fprintf(mFile,"\tsetAttr \".ir1.irz1\" %f;\n", irz1);
 
73
        }
 
74
        void setInTranslate2(const double3& it2)
 
75
        {
 
76
                fprintf(mFile,"\tsetAttr \".it2\" -type \"double3\" ");
 
77
                it2.write(mFile);
 
78
                fprintf(mFile,";\n");
 
79
        }
 
80
        void setInTranslateX2(double itx2)
 
81
        {
 
82
                if(itx2 == 0) return;
 
83
                fprintf(mFile,"\tsetAttr \".it2.itx2\" %f;\n", itx2);
 
84
        }
 
85
        void setInTranslateY2(double ity2)
 
86
        {
 
87
                if(ity2 == 0) return;
 
88
                fprintf(mFile,"\tsetAttr \".it2.ity2\" %f;\n", ity2);
 
89
        }
 
90
        void setInTranslateZ2(double itz2)
 
91
        {
 
92
                if(itz2 == 0) return;
 
93
                fprintf(mFile,"\tsetAttr \".it2.itz2\" %f;\n", itz2);
 
94
        }
 
95
        void setInRotate2(const double3& ir2)
 
96
        {
 
97
                fprintf(mFile,"\tsetAttr \".ir2\" -type \"double3\" ");
 
98
                ir2.write(mFile);
 
99
                fprintf(mFile,";\n");
 
100
        }
 
101
        void setInRotateX2(double irx2)
 
102
        {
 
103
                if(irx2 == 0) return;
 
104
                fprintf(mFile,"\tsetAttr \".ir2.irx2\" %f;\n", irx2);
 
105
        }
 
106
        void setInRotateY2(double iry2)
 
107
        {
 
108
                if(iry2 == 0) return;
 
109
                fprintf(mFile,"\tsetAttr \".ir2.iry2\" %f;\n", iry2);
 
110
        }
 
111
        void setInRotateZ2(double irz2)
 
112
        {
 
113
                if(irz2 == 0) return;
 
114
                fprintf(mFile,"\tsetAttr \".ir2.irz2\" %f;\n", irz2);
 
115
        }
 
116
        void setWeight(double w)
 
117
        {
 
118
                if(w == 1.0) return;
 
119
                fprintf(mFile,"\tsetAttr \".w\" %f;\n", w);
 
120
        }
 
121
        void setRotateOrder(unsigned int ro)
 
122
        {
 
123
                if(ro == 0) return;
 
124
                fprintf(mFile,"\tsetAttr \".ro\" %i;\n", ro);
 
125
        }
 
126
        void setTranslateXMode(unsigned int txm)
 
127
        {
 
128
                if(txm == 0) return;
 
129
                fprintf(mFile,"\tsetAttr \".txm\" %i;\n", txm);
 
130
        }
 
131
        void setTranslateYMode(unsigned int tym)
 
132
        {
 
133
                if(tym == 0) return;
 
134
                fprintf(mFile,"\tsetAttr \".tym\" %i;\n", tym);
 
135
        }
 
136
        void setTranslateZMode(unsigned int tzm)
 
137
        {
 
138
                if(tzm == 0) return;
 
139
                fprintf(mFile,"\tsetAttr \".tzm\" %i;\n", tzm);
 
140
        }
 
141
        void setRotateMode(unsigned int rm)
 
142
        {
 
143
                if(rm == 0) return;
 
144
                fprintf(mFile,"\tsetAttr \".rm\" %i;\n", rm);
 
145
        }
 
146
        void setRotInterpolation(unsigned int ri)
 
147
        {
 
148
                if(ri == 0) return;
 
149
                fprintf(mFile,"\tsetAttr \".ri\" %i;\n", ri);
 
150
        }
 
151
        void getInTranslate1()const
 
152
        {
 
153
                fprintf(mFile,"\"%s.it1\"",mName.c_str());
 
154
        }
 
155
        void getInTranslateX1()const
 
156
        {
 
157
                fprintf(mFile,"\"%s.it1.itx1\"",mName.c_str());
 
158
        }
 
159
        void getInTranslateY1()const
 
160
        {
 
161
                fprintf(mFile,"\"%s.it1.ity1\"",mName.c_str());
 
162
        }
 
163
        void getInTranslateZ1()const
 
164
        {
 
165
                fprintf(mFile,"\"%s.it1.itz1\"",mName.c_str());
 
166
        }
 
167
        void getInRotate1()const
 
168
        {
 
169
                fprintf(mFile,"\"%s.ir1\"",mName.c_str());
 
170
        }
 
171
        void getInRotateX1()const
 
172
        {
 
173
                fprintf(mFile,"\"%s.ir1.irx1\"",mName.c_str());
 
174
        }
 
175
        void getInRotateY1()const
 
176
        {
 
177
                fprintf(mFile,"\"%s.ir1.iry1\"",mName.c_str());
 
178
        }
 
179
        void getInRotateZ1()const
 
180
        {
 
181
                fprintf(mFile,"\"%s.ir1.irz1\"",mName.c_str());
 
182
        }
 
183
        void getInTranslate2()const
 
184
        {
 
185
                fprintf(mFile,"\"%s.it2\"",mName.c_str());
 
186
        }
 
187
        void getInTranslateX2()const
 
188
        {
 
189
                fprintf(mFile,"\"%s.it2.itx2\"",mName.c_str());
 
190
        }
 
191
        void getInTranslateY2()const
 
192
        {
 
193
                fprintf(mFile,"\"%s.it2.ity2\"",mName.c_str());
 
194
        }
 
195
        void getInTranslateZ2()const
 
196
        {
 
197
                fprintf(mFile,"\"%s.it2.itz2\"",mName.c_str());
 
198
        }
 
199
        void getInRotate2()const
 
200
        {
 
201
                fprintf(mFile,"\"%s.ir2\"",mName.c_str());
 
202
        }
 
203
        void getInRotateX2()const
 
204
        {
 
205
                fprintf(mFile,"\"%s.ir2.irx2\"",mName.c_str());
 
206
        }
 
207
        void getInRotateY2()const
 
208
        {
 
209
                fprintf(mFile,"\"%s.ir2.iry2\"",mName.c_str());
 
210
        }
 
211
        void getInRotateZ2()const
 
212
        {
 
213
                fprintf(mFile,"\"%s.ir2.irz2\"",mName.c_str());
 
214
        }
 
215
        void getWeight()const
 
216
        {
 
217
                fprintf(mFile,"\"%s.w\"",mName.c_str());
 
218
        }
 
219
        void getRotateOrder()const
 
220
        {
 
221
                fprintf(mFile,"\"%s.ro\"",mName.c_str());
 
222
        }
 
223
        void getOutTranslate()const
 
224
        {
 
225
                fprintf(mFile,"\"%s.ot\"",mName.c_str());
 
226
        }
 
227
        void getOutTranslateX()const
 
228
        {
 
229
                fprintf(mFile,"\"%s.ot.otx\"",mName.c_str());
 
230
        }
 
231
        void getOutTranslateY()const
 
232
        {
 
233
                fprintf(mFile,"\"%s.ot.oty\"",mName.c_str());
 
234
        }
 
235
        void getOutTranslateZ()const
 
236
        {
 
237
                fprintf(mFile,"\"%s.ot.otz\"",mName.c_str());
 
238
        }
 
239
        void getOutRotate()const
 
240
        {
 
241
                fprintf(mFile,"\"%s.or\"",mName.c_str());
 
242
        }
 
243
        void getOutRotateX()const
 
244
        {
 
245
                fprintf(mFile,"\"%s.or.orx\"",mName.c_str());
 
246
        }
 
247
        void getOutRotateY()const
 
248
        {
 
249
                fprintf(mFile,"\"%s.or.ory\"",mName.c_str());
 
250
        }
 
251
        void getOutRotateZ()const
 
252
        {
 
253
                fprintf(mFile,"\"%s.or.orz\"",mName.c_str());
 
254
        }
 
255
protected:
 
256
        PairBlend(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
257
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
258
 
 
259
};
 
260
}//namespace MayaDM
 
261
#endif//__MayaDM_PAIRBLEND_H__