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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPlace2dTexture.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_PLACE2DTEXTURE_H__
 
11
#define __MayaDM_PLACE2DTEXTURE_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class Place2dTexture : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        Place2dTexture():DependNode(){}
 
23
        Place2dTexture(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "place2dTexture", shared, create){}
 
25
        virtual ~Place2dTexture(){}
 
26
 
 
27
        void setVertexUvOne(const float2& vt1)
 
28
        {
 
29
                fprintf(mFile,"\tsetAttr \".vt1\" -type \"float2\" ");
 
30
                vt1.write(mFile);
 
31
                fprintf(mFile,";\n");
 
32
        }
 
33
        void setVertexUvOneU(float t1u)
 
34
        {
 
35
                if(t1u == 0.0) return;
 
36
                fprintf(mFile,"\tsetAttr \".vt1.t1u\" %f;\n", t1u);
 
37
        }
 
38
        void setVertexUvOneV(float t1v)
 
39
        {
 
40
                if(t1v == 0.0) return;
 
41
                fprintf(mFile,"\tsetAttr \".vt1.t1v\" %f;\n", t1v);
 
42
        }
 
43
        void setVertexUvTwo(const float2& vt2)
 
44
        {
 
45
                fprintf(mFile,"\tsetAttr \".vt2\" -type \"float2\" ");
 
46
                vt2.write(mFile);
 
47
                fprintf(mFile,";\n");
 
48
        }
 
49
        void setVertexUvTwoU(float t2u)
 
50
        {
 
51
                if(t2u == 0.0) return;
 
52
                fprintf(mFile,"\tsetAttr \".vt2.t2u\" %f;\n", t2u);
 
53
        }
 
54
        void setVertexUvTwoV(float t2v)
 
55
        {
 
56
                if(t2v == 0.0) return;
 
57
                fprintf(mFile,"\tsetAttr \".vt2.t2v\" %f;\n", t2v);
 
58
        }
 
59
        void setVertexUvThree(const float2& vt3)
 
60
        {
 
61
                fprintf(mFile,"\tsetAttr \".vt3\" -type \"float2\" ");
 
62
                vt3.write(mFile);
 
63
                fprintf(mFile,";\n");
 
64
        }
 
65
        void setVertexUvThreeU(float t3u)
 
66
        {
 
67
                if(t3u == 0.0) return;
 
68
                fprintf(mFile,"\tsetAttr \".vt3.t3u\" %f;\n", t3u);
 
69
        }
 
70
        void setVertexUvThreeV(float t3v)
 
71
        {
 
72
                if(t3v == 0.0) return;
 
73
                fprintf(mFile,"\tsetAttr \".vt3.t3v\" %f;\n", t3v);
 
74
        }
 
75
        void setVertexCameraOne(const float3& vc1)
 
76
        {
 
77
                fprintf(mFile,"\tsetAttr \".vc1\" -type \"float3\" ");
 
78
                vc1.write(mFile);
 
79
                fprintf(mFile,";\n");
 
80
        }
 
81
        void setVertexCameraOneX(float c1x)
 
82
        {
 
83
                if(c1x == 0.0) return;
 
84
                fprintf(mFile,"\tsetAttr \".vc1.c1x\" %f;\n", c1x);
 
85
        }
 
86
        void setVertexCameraOneY(float c1y)
 
87
        {
 
88
                if(c1y == 0.0) return;
 
89
                fprintf(mFile,"\tsetAttr \".vc1.c1y\" %f;\n", c1y);
 
90
        }
 
91
        void setVertexCameraOneZ(float c1z)
 
92
        {
 
93
                if(c1z == 0.0) return;
 
94
                fprintf(mFile,"\tsetAttr \".vc1.c1z\" %f;\n", c1z);
 
95
        }
 
96
        void setCoverage(const float2& c)
 
97
        {
 
98
                if(c == float2(1.0f,1.0f)) return;
 
99
                fprintf(mFile,"\tsetAttr \".c\" -type \"float2\" ");
 
100
                c.write(mFile);
 
101
                fprintf(mFile,";\n");
 
102
        }
 
103
        void setCoverageU(float cu)
 
104
        {
 
105
                if(cu == 0.0) return;
 
106
                fprintf(mFile,"\tsetAttr \".c.cu\" %f;\n", cu);
 
107
        }
 
108
        void setCoverageV(float cv)
 
109
        {
 
110
                if(cv == 0.0) return;
 
111
                fprintf(mFile,"\tsetAttr \".c.cv\" %f;\n", cv);
 
112
        }
 
113
        void setTranslateFrame(const float2& tf)
 
114
        {
 
115
                if(tf == float2(0.0f,0.0f)) return;
 
116
                fprintf(mFile,"\tsetAttr \".tf\" -type \"float2\" ");
 
117
                tf.write(mFile);
 
118
                fprintf(mFile,";\n");
 
119
        }
 
120
        void setTranslateFrameU(float tfu)
 
121
        {
 
122
                if(tfu == 0.0) return;
 
123
                fprintf(mFile,"\tsetAttr \".tf.tfu\" %f;\n", tfu);
 
124
        }
 
125
        void setTranslateFrameV(float tfv)
 
126
        {
 
127
                if(tfv == 0.0) return;
 
128
                fprintf(mFile,"\tsetAttr \".tf.tfv\" %f;\n", tfv);
 
129
        }
 
130
        void setRotateFrame(double rf)
 
131
        {
 
132
                if(rf == 0) return;
 
133
                fprintf(mFile,"\tsetAttr \".rf\" %f;\n", rf);
 
134
        }
 
135
        void setMirrorU(bool mu)
 
136
        {
 
137
                if(mu == false) return;
 
138
                fprintf(mFile,"\tsetAttr \".mu\" %i;\n", mu);
 
139
        }
 
140
        void setMirrorV(bool mv)
 
141
        {
 
142
                if(mv == false) return;
 
143
                fprintf(mFile,"\tsetAttr \".mv\" %i;\n", mv);
 
144
        }
 
145
        void setStagger(bool s)
 
146
        {
 
147
                if(s == false) return;
 
148
                fprintf(mFile,"\tsetAttr \".s\" %i;\n", s);
 
149
        }
 
150
        void setWrapU(bool wu)
 
151
        {
 
152
                if(wu == true) return;
 
153
                fprintf(mFile,"\tsetAttr \".wu\" %i;\n", wu);
 
154
        }
 
155
        void setWrapV(bool wv)
 
156
        {
 
157
                if(wv == true) return;
 
158
                fprintf(mFile,"\tsetAttr \".wv\" %i;\n", wv);
 
159
        }
 
160
        void setRepeatUV(const float2& re)
 
161
        {
 
162
                if(re == float2(1.0f,1.0f)) return;
 
163
                fprintf(mFile,"\tsetAttr \".re\" -type \"float2\" ");
 
164
                re.write(mFile);
 
165
                fprintf(mFile,";\n");
 
166
        }
 
167
        void setRepeatU(float reu)
 
168
        {
 
169
                if(reu == 0.0) return;
 
170
                fprintf(mFile,"\tsetAttr \".re.reu\" %f;\n", reu);
 
171
        }
 
172
        void setRepeatV(float rev)
 
173
        {
 
174
                if(rev == 0.0) return;
 
175
                fprintf(mFile,"\tsetAttr \".re.rev\" %f;\n", rev);
 
176
        }
 
177
        void setOffset(const float2& of)
 
178
        {
 
179
                if(of == float2(0.0f,0.0f)) return;
 
180
                fprintf(mFile,"\tsetAttr \".of\" -type \"float2\" ");
 
181
                of.write(mFile);
 
182
                fprintf(mFile,";\n");
 
183
        }
 
184
        void setOffsetU(float ofu)
 
185
        {
 
186
                if(ofu == 0.0) return;
 
187
                fprintf(mFile,"\tsetAttr \".of.ofu\" %f;\n", ofu);
 
188
        }
 
189
        void setOffsetV(float ofv)
 
190
        {
 
191
                if(ofv == 0.0) return;
 
192
                fprintf(mFile,"\tsetAttr \".of.ofv\" %f;\n", ofv);
 
193
        }
 
194
        void setRotateUV(double r)
 
195
        {
 
196
                if(r == 0) return;
 
197
                fprintf(mFile,"\tsetAttr \".r\" %f;\n", r);
 
198
        }
 
199
        void setNoiseUV(const float2& n)
 
200
        {
 
201
                if(n == float2(0.0f,0.0f)) return;
 
202
                fprintf(mFile,"\tsetAttr \".n\" -type \"float2\" ");
 
203
                n.write(mFile);
 
204
                fprintf(mFile,";\n");
 
205
        }
 
206
        void setNoiseU(float nu)
 
207
        {
 
208
                if(nu == 0.0) return;
 
209
                fprintf(mFile,"\tsetAttr \".n.nu\" %f;\n", nu);
 
210
        }
 
211
        void setNoiseV(float nv)
 
212
        {
 
213
                if(nv == 0.0) return;
 
214
                fprintf(mFile,"\tsetAttr \".n.nv\" %f;\n", nv);
 
215
        }
 
216
        void setFast(bool fa)
 
217
        {
 
218
                if(fa == false) return;
 
219
                fprintf(mFile,"\tsetAttr \".fa\" %i;\n", fa);
 
220
        }
 
221
        void getUvCoord()const
 
222
        {
 
223
                fprintf(mFile,"\"%s.uv\"",mName.c_str());
 
224
        }
 
225
        void getUCoord()const
 
226
        {
 
227
                fprintf(mFile,"\"%s.uv.u\"",mName.c_str());
 
228
        }
 
229
        void getVCoord()const
 
230
        {
 
231
                fprintf(mFile,"\"%s.uv.v\"",mName.c_str());
 
232
        }
 
233
        void getVertexUvOne()const
 
234
        {
 
235
                fprintf(mFile,"\"%s.vt1\"",mName.c_str());
 
236
        }
 
237
        void getVertexUvOneU()const
 
238
        {
 
239
                fprintf(mFile,"\"%s.vt1.t1u\"",mName.c_str());
 
240
        }
 
241
        void getVertexUvOneV()const
 
242
        {
 
243
                fprintf(mFile,"\"%s.vt1.t1v\"",mName.c_str());
 
244
        }
 
245
        void getVertexUvTwo()const
 
246
        {
 
247
                fprintf(mFile,"\"%s.vt2\"",mName.c_str());
 
248
        }
 
249
        void getVertexUvTwoU()const
 
250
        {
 
251
                fprintf(mFile,"\"%s.vt2.t2u\"",mName.c_str());
 
252
        }
 
253
        void getVertexUvTwoV()const
 
254
        {
 
255
                fprintf(mFile,"\"%s.vt2.t2v\"",mName.c_str());
 
256
        }
 
257
        void getVertexUvThree()const
 
258
        {
 
259
                fprintf(mFile,"\"%s.vt3\"",mName.c_str());
 
260
        }
 
261
        void getVertexUvThreeU()const
 
262
        {
 
263
                fprintf(mFile,"\"%s.vt3.t3u\"",mName.c_str());
 
264
        }
 
265
        void getVertexUvThreeV()const
 
266
        {
 
267
                fprintf(mFile,"\"%s.vt3.t3v\"",mName.c_str());
 
268
        }
 
269
        void getVertexCameraOne()const
 
270
        {
 
271
                fprintf(mFile,"\"%s.vc1\"",mName.c_str());
 
272
        }
 
273
        void getVertexCameraOneX()const
 
274
        {
 
275
                fprintf(mFile,"\"%s.vc1.c1x\"",mName.c_str());
 
276
        }
 
277
        void getVertexCameraOneY()const
 
278
        {
 
279
                fprintf(mFile,"\"%s.vc1.c1y\"",mName.c_str());
 
280
        }
 
281
        void getVertexCameraOneZ()const
 
282
        {
 
283
                fprintf(mFile,"\"%s.vc1.c1z\"",mName.c_str());
 
284
        }
 
285
        void getUvFilterSize()const
 
286
        {
 
287
                fprintf(mFile,"\"%s.fs\"",mName.c_str());
 
288
        }
 
289
        void getUvFilterSizeX()const
 
290
        {
 
291
                fprintf(mFile,"\"%s.fs.fsx\"",mName.c_str());
 
292
        }
 
293
        void getUvFilterSizeY()const
 
294
        {
 
295
                fprintf(mFile,"\"%s.fs.fsy\"",mName.c_str());
 
296
        }
 
297
        void getCoverage()const
 
298
        {
 
299
                fprintf(mFile,"\"%s.c\"",mName.c_str());
 
300
        }
 
301
        void getCoverageU()const
 
302
        {
 
303
                fprintf(mFile,"\"%s.c.cu\"",mName.c_str());
 
304
        }
 
305
        void getCoverageV()const
 
306
        {
 
307
                fprintf(mFile,"\"%s.c.cv\"",mName.c_str());
 
308
        }
 
309
        void getTranslateFrame()const
 
310
        {
 
311
                fprintf(mFile,"\"%s.tf\"",mName.c_str());
 
312
        }
 
313
        void getTranslateFrameU()const
 
314
        {
 
315
                fprintf(mFile,"\"%s.tf.tfu\"",mName.c_str());
 
316
        }
 
317
        void getTranslateFrameV()const
 
318
        {
 
319
                fprintf(mFile,"\"%s.tf.tfv\"",mName.c_str());
 
320
        }
 
321
        void getRotateFrame()const
 
322
        {
 
323
                fprintf(mFile,"\"%s.rf\"",mName.c_str());
 
324
        }
 
325
        void getMirrorU()const
 
326
        {
 
327
                fprintf(mFile,"\"%s.mu\"",mName.c_str());
 
328
        }
 
329
        void getMirrorV()const
 
330
        {
 
331
                fprintf(mFile,"\"%s.mv\"",mName.c_str());
 
332
        }
 
333
        void getStagger()const
 
334
        {
 
335
                fprintf(mFile,"\"%s.s\"",mName.c_str());
 
336
        }
 
337
        void getWrapU()const
 
338
        {
 
339
                fprintf(mFile,"\"%s.wu\"",mName.c_str());
 
340
        }
 
341
        void getWrapV()const
 
342
        {
 
343
                fprintf(mFile,"\"%s.wv\"",mName.c_str());
 
344
        }
 
345
        void getRepeatUV()const
 
346
        {
 
347
                fprintf(mFile,"\"%s.re\"",mName.c_str());
 
348
        }
 
349
        void getRepeatU()const
 
350
        {
 
351
                fprintf(mFile,"\"%s.re.reu\"",mName.c_str());
 
352
        }
 
353
        void getRepeatV()const
 
354
        {
 
355
                fprintf(mFile,"\"%s.re.rev\"",mName.c_str());
 
356
        }
 
357
        void getOffset()const
 
358
        {
 
359
                fprintf(mFile,"\"%s.of\"",mName.c_str());
 
360
        }
 
361
        void getOffsetU()const
 
362
        {
 
363
                fprintf(mFile,"\"%s.of.ofu\"",mName.c_str());
 
364
        }
 
365
        void getOffsetV()const
 
366
        {
 
367
                fprintf(mFile,"\"%s.of.ofv\"",mName.c_str());
 
368
        }
 
369
        void getRotateUV()const
 
370
        {
 
371
                fprintf(mFile,"\"%s.r\"",mName.c_str());
 
372
        }
 
373
        void getNoiseUV()const
 
374
        {
 
375
                fprintf(mFile,"\"%s.n\"",mName.c_str());
 
376
        }
 
377
        void getNoiseU()const
 
378
        {
 
379
                fprintf(mFile,"\"%s.n.nu\"",mName.c_str());
 
380
        }
 
381
        void getNoiseV()const
 
382
        {
 
383
                fprintf(mFile,"\"%s.n.nv\"",mName.c_str());
 
384
        }
 
385
        void getFast()const
 
386
        {
 
387
                fprintf(mFile,"\"%s.fa\"",mName.c_str());
 
388
        }
 
389
        void getOutUV()const
 
390
        {
 
391
                fprintf(mFile,"\"%s.o\"",mName.c_str());
 
392
        }
 
393
        void getOutU()const
 
394
        {
 
395
                fprintf(mFile,"\"%s.o.ou\"",mName.c_str());
 
396
        }
 
397
        void getOutV()const
 
398
        {
 
399
                fprintf(mFile,"\"%s.o.ov\"",mName.c_str());
 
400
        }
 
401
        void getOutUvFilterSize()const
 
402
        {
 
403
                fprintf(mFile,"\"%s.ofs\"",mName.c_str());
 
404
        }
 
405
        void getOutUvFilterSizeX()const
 
406
        {
 
407
                fprintf(mFile,"\"%s.ofs.ofsx\"",mName.c_str());
 
408
        }
 
409
        void getOutUvFilterSizeY()const
 
410
        {
 
411
                fprintf(mFile,"\"%s.ofs.ofsy\"",mName.c_str());
 
412
        }
 
413
        void getDoTransform()const
 
414
        {
 
415
                fprintf(mFile,"\"%s.do\"",mName.c_str());
 
416
        }
 
417
protected:
 
418
        Place2dTexture(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
419
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
420
 
 
421
};
 
422
}//namespace MayaDM
 
423
#endif//__MayaDM_PLACE2DTEXTURE_H__