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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMSamplerInfo.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_SAMPLERINFO_H__
 
11
#define __MayaDM_SAMPLERINFO_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class SamplerInfo : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        SamplerInfo():DependNode(){}
 
23
        SamplerInfo(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "samplerInfo", shared, create){}
 
25
        virtual ~SamplerInfo(){}
 
26
 
 
27
        void setPointCamera(const float3& p)
 
28
        {
 
29
                if(p == float3(0.0f,0.0f,0.0f)) return;
 
30
                fprintf(mFile,"\tsetAttr \".p\" -type \"float3\" ");
 
31
                p.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setPointCameraX(float px)
 
35
        {
 
36
                if(px == 0.0) return;
 
37
                fprintf(mFile,"\tsetAttr \".p.px\" %f;\n", px);
 
38
        }
 
39
        void setPointCameraY(float py)
 
40
        {
 
41
                if(py == 0.0) return;
 
42
                fprintf(mFile,"\tsetAttr \".p.py\" %f;\n", py);
 
43
        }
 
44
        void setPointCameraZ(float pz)
 
45
        {
 
46
                if(pz == 0.0) return;
 
47
                fprintf(mFile,"\tsetAttr \".p.pz\" %f;\n", pz);
 
48
        }
 
49
        void setPointObj(const float3& po)
 
50
        {
 
51
                if(po == float3(0.0f,0.0f,0.0f)) return;
 
52
                fprintf(mFile,"\tsetAttr \".po\" -type \"float3\" ");
 
53
                po.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setPointObjX(float pox)
 
57
        {
 
58
                if(pox == 0.0) return;
 
59
                fprintf(mFile,"\tsetAttr \".po.pox\" %f;\n", pox);
 
60
        }
 
61
        void setPointObjY(float poy)
 
62
        {
 
63
                if(poy == 0.0) return;
 
64
                fprintf(mFile,"\tsetAttr \".po.poy\" %f;\n", poy);
 
65
        }
 
66
        void setPointObjZ(float poz)
 
67
        {
 
68
                if(poz == 0.0) return;
 
69
                fprintf(mFile,"\tsetAttr \".po.poz\" %f;\n", poz);
 
70
        }
 
71
        void setPointWorld(const float3& pw)
 
72
        {
 
73
                if(pw == float3(0.0f,0.0f,0.0f)) return;
 
74
                fprintf(mFile,"\tsetAttr \".pw\" -type \"float3\" ");
 
75
                pw.write(mFile);
 
76
                fprintf(mFile,";\n");
 
77
        }
 
78
        void setPointWorldX(float pwx)
 
79
        {
 
80
                if(pwx == 0.0) return;
 
81
                fprintf(mFile,"\tsetAttr \".pw.pwx\" %f;\n", pwx);
 
82
        }
 
83
        void setPointWorldY(float pwy)
 
84
        {
 
85
                if(pwy == 0.0) return;
 
86
                fprintf(mFile,"\tsetAttr \".pw.pwy\" %f;\n", pwy);
 
87
        }
 
88
        void setPointWorldZ(float pwz)
 
89
        {
 
90
                if(pwz == 0.0) return;
 
91
                fprintf(mFile,"\tsetAttr \".pw.pwz\" %f;\n", pwz);
 
92
        }
 
93
        void setNormalCamera(const float3& n)
 
94
        {
 
95
                if(n == float3(0.0f,0.0f,1.0f)) return;
 
96
                fprintf(mFile,"\tsetAttr \".n\" -type \"float3\" ");
 
97
                n.write(mFile);
 
98
                fprintf(mFile,";\n");
 
99
        }
 
100
        void setNormalCameraX(float nx)
 
101
        {
 
102
                if(nx == 0.0) return;
 
103
                fprintf(mFile,"\tsetAttr \".n.nx\" %f;\n", nx);
 
104
        }
 
105
        void setNormalCameraY(float ny)
 
106
        {
 
107
                if(ny == 0.0) return;
 
108
                fprintf(mFile,"\tsetAttr \".n.ny\" %f;\n", ny);
 
109
        }
 
110
        void setNormalCameraZ(float nz)
 
111
        {
 
112
                if(nz == 0.0) return;
 
113
                fprintf(mFile,"\tsetAttr \".n.nz\" %f;\n", nz);
 
114
        }
 
115
        void setUvCoord(const float2& uv)
 
116
        {
 
117
                if(uv == float2(0.0f,0.0f)) return;
 
118
                fprintf(mFile,"\tsetAttr \".uv\" -type \"float2\" ");
 
119
                uv.write(mFile);
 
120
                fprintf(mFile,";\n");
 
121
        }
 
122
        void setUCoord(float u)
 
123
        {
 
124
                if(u == 0.0) return;
 
125
                fprintf(mFile,"\tsetAttr \".uv.u\" %f;\n", u);
 
126
        }
 
127
        void setVCoord(float v)
 
128
        {
 
129
                if(v == 0.0) return;
 
130
                fprintf(mFile,"\tsetAttr \".uv.v\" %f;\n", v);
 
131
        }
 
132
        void setRayDirection(const float3& r)
 
133
        {
 
134
                if(r == float3(0.0f,0.0f,1.0f)) return;
 
135
                fprintf(mFile,"\tsetAttr \".r\" -type \"float3\" ");
 
136
                r.write(mFile);
 
137
                fprintf(mFile,";\n");
 
138
        }
 
139
        void setRayDirectionX(float rx)
 
140
        {
 
141
                if(rx == 0.0) return;
 
142
                fprintf(mFile,"\tsetAttr \".r.rx\" %f;\n", rx);
 
143
        }
 
144
        void setRayDirectionY(float ry)
 
145
        {
 
146
                if(ry == 0.0) return;
 
147
                fprintf(mFile,"\tsetAttr \".r.ry\" %f;\n", ry);
 
148
        }
 
149
        void setRayDirectionZ(float rz)
 
150
        {
 
151
                if(rz == 0.0) return;
 
152
                fprintf(mFile,"\tsetAttr \".r.rz\" %f;\n", rz);
 
153
        }
 
154
        void setTangentUCamera(const float3& tu)
 
155
        {
 
156
                if(tu == float3(1.0f,0.0f,0.0f)) return;
 
157
                fprintf(mFile,"\tsetAttr \".tu\" -type \"float3\" ");
 
158
                tu.write(mFile);
 
159
                fprintf(mFile,";\n");
 
160
        }
 
161
        void setTangentUx(float tux)
 
162
        {
 
163
                if(tux == 0.0) return;
 
164
                fprintf(mFile,"\tsetAttr \".tu.tux\" %f;\n", tux);
 
165
        }
 
166
        void setTangentUy(float tuy)
 
167
        {
 
168
                if(tuy == 0.0) return;
 
169
                fprintf(mFile,"\tsetAttr \".tu.tuy\" %f;\n", tuy);
 
170
        }
 
171
        void setTangentUz(float tuz)
 
172
        {
 
173
                if(tuz == 0.0) return;
 
174
                fprintf(mFile,"\tsetAttr \".tu.tuz\" %f;\n", tuz);
 
175
        }
 
176
        void setTangentVCamera(const float3& tv)
 
177
        {
 
178
                if(tv == float3(0.0f,1.0f,0.0f)) return;
 
179
                fprintf(mFile,"\tsetAttr \".tv\" -type \"float3\" ");
 
180
                tv.write(mFile);
 
181
                fprintf(mFile,";\n");
 
182
        }
 
183
        void setTangentVx(float tvx)
 
184
        {
 
185
                if(tvx == 0.0) return;
 
186
                fprintf(mFile,"\tsetAttr \".tv.tvx\" %f;\n", tvx);
 
187
        }
 
188
        void setTangentVy(float tvy)
 
189
        {
 
190
                if(tvy == 0.0) return;
 
191
                fprintf(mFile,"\tsetAttr \".tv.tvy\" %f;\n", tvy);
 
192
        }
 
193
        void setTangentVz(float tvz)
 
194
        {
 
195
                if(tvz == 0.0) return;
 
196
                fprintf(mFile,"\tsetAttr \".tv.tvz\" %f;\n", tvz);
 
197
        }
 
198
        void setPixelCenter(const float2& pc)
 
199
        {
 
200
                if(pc == float2(0.0f,0.0f)) return;
 
201
                fprintf(mFile,"\tsetAttr \".pc\" -type \"float2\" ");
 
202
                pc.write(mFile);
 
203
                fprintf(mFile,";\n");
 
204
        }
 
205
        void setPixelCenterX(float pcx)
 
206
        {
 
207
                if(pcx == 0.0) return;
 
208
                fprintf(mFile,"\tsetAttr \".pc.pcx\" %f;\n", pcx);
 
209
        }
 
210
        void setPixelCenterY(float pcy)
 
211
        {
 
212
                if(pcy == 0.0) return;
 
213
                fprintf(mFile,"\tsetAttr \".pc.pcy\" %f;\n", pcy);
 
214
        }
 
215
        void setFlippedNormal(bool fn)
 
216
        {
 
217
                if(fn == false) return;
 
218
                fprintf(mFile,"\tsetAttr \".fn\" %i;\n", fn);
 
219
        }
 
220
        void setFacingRatio(float fr)
 
221
        {
 
222
                if(fr == 0.0) return;
 
223
                fprintf(mFile,"\tsetAttr \".fr\" %f;\n", fr);
 
224
        }
 
225
        void getPointCamera()const
 
226
        {
 
227
                fprintf(mFile,"\"%s.p\"",mName.c_str());
 
228
        }
 
229
        void getPointCameraX()const
 
230
        {
 
231
                fprintf(mFile,"\"%s.p.px\"",mName.c_str());
 
232
        }
 
233
        void getPointCameraY()const
 
234
        {
 
235
                fprintf(mFile,"\"%s.p.py\"",mName.c_str());
 
236
        }
 
237
        void getPointCameraZ()const
 
238
        {
 
239
                fprintf(mFile,"\"%s.p.pz\"",mName.c_str());
 
240
        }
 
241
        void getPointObj()const
 
242
        {
 
243
                fprintf(mFile,"\"%s.po\"",mName.c_str());
 
244
        }
 
245
        void getPointObjX()const
 
246
        {
 
247
                fprintf(mFile,"\"%s.po.pox\"",mName.c_str());
 
248
        }
 
249
        void getPointObjY()const
 
250
        {
 
251
                fprintf(mFile,"\"%s.po.poy\"",mName.c_str());
 
252
        }
 
253
        void getPointObjZ()const
 
254
        {
 
255
                fprintf(mFile,"\"%s.po.poz\"",mName.c_str());
 
256
        }
 
257
        void getPointWorld()const
 
258
        {
 
259
                fprintf(mFile,"\"%s.pw\"",mName.c_str());
 
260
        }
 
261
        void getPointWorldX()const
 
262
        {
 
263
                fprintf(mFile,"\"%s.pw.pwx\"",mName.c_str());
 
264
        }
 
265
        void getPointWorldY()const
 
266
        {
 
267
                fprintf(mFile,"\"%s.pw.pwy\"",mName.c_str());
 
268
        }
 
269
        void getPointWorldZ()const
 
270
        {
 
271
                fprintf(mFile,"\"%s.pw.pwz\"",mName.c_str());
 
272
        }
 
273
        void getNormalCamera()const
 
274
        {
 
275
                fprintf(mFile,"\"%s.n\"",mName.c_str());
 
276
        }
 
277
        void getNormalCameraX()const
 
278
        {
 
279
                fprintf(mFile,"\"%s.n.nx\"",mName.c_str());
 
280
        }
 
281
        void getNormalCameraY()const
 
282
        {
 
283
                fprintf(mFile,"\"%s.n.ny\"",mName.c_str());
 
284
        }
 
285
        void getNormalCameraZ()const
 
286
        {
 
287
                fprintf(mFile,"\"%s.n.nz\"",mName.c_str());
 
288
        }
 
289
        void getUvCoord()const
 
290
        {
 
291
                fprintf(mFile,"\"%s.uv\"",mName.c_str());
 
292
        }
 
293
        void getUCoord()const
 
294
        {
 
295
                fprintf(mFile,"\"%s.uv.u\"",mName.c_str());
 
296
        }
 
297
        void getVCoord()const
 
298
        {
 
299
                fprintf(mFile,"\"%s.uv.v\"",mName.c_str());
 
300
        }
 
301
        void getRayDirection()const
 
302
        {
 
303
                fprintf(mFile,"\"%s.r\"",mName.c_str());
 
304
        }
 
305
        void getRayDirectionX()const
 
306
        {
 
307
                fprintf(mFile,"\"%s.r.rx\"",mName.c_str());
 
308
        }
 
309
        void getRayDirectionY()const
 
310
        {
 
311
                fprintf(mFile,"\"%s.r.ry\"",mName.c_str());
 
312
        }
 
313
        void getRayDirectionZ()const
 
314
        {
 
315
                fprintf(mFile,"\"%s.r.rz\"",mName.c_str());
 
316
        }
 
317
        void getTangentUCamera()const
 
318
        {
 
319
                fprintf(mFile,"\"%s.tu\"",mName.c_str());
 
320
        }
 
321
        void getTangentUx()const
 
322
        {
 
323
                fprintf(mFile,"\"%s.tu.tux\"",mName.c_str());
 
324
        }
 
325
        void getTangentUy()const
 
326
        {
 
327
                fprintf(mFile,"\"%s.tu.tuy\"",mName.c_str());
 
328
        }
 
329
        void getTangentUz()const
 
330
        {
 
331
                fprintf(mFile,"\"%s.tu.tuz\"",mName.c_str());
 
332
        }
 
333
        void getTangentVCamera()const
 
334
        {
 
335
                fprintf(mFile,"\"%s.tv\"",mName.c_str());
 
336
        }
 
337
        void getTangentVx()const
 
338
        {
 
339
                fprintf(mFile,"\"%s.tv.tvx\"",mName.c_str());
 
340
        }
 
341
        void getTangentVy()const
 
342
        {
 
343
                fprintf(mFile,"\"%s.tv.tvy\"",mName.c_str());
 
344
        }
 
345
        void getTangentVz()const
 
346
        {
 
347
                fprintf(mFile,"\"%s.tv.tvz\"",mName.c_str());
 
348
        }
 
349
        void getMatrixEyeToWorld()const
 
350
        {
 
351
                fprintf(mFile,"\"%s.e2w\"",mName.c_str());
 
352
        }
 
353
        void getPixelCenter()const
 
354
        {
 
355
                fprintf(mFile,"\"%s.pc\"",mName.c_str());
 
356
        }
 
357
        void getPixelCenterX()const
 
358
        {
 
359
                fprintf(mFile,"\"%s.pc.pcx\"",mName.c_str());
 
360
        }
 
361
        void getPixelCenterY()const
 
362
        {
 
363
                fprintf(mFile,"\"%s.pc.pcy\"",mName.c_str());
 
364
        }
 
365
        void getFlippedNormal()const
 
366
        {
 
367
                fprintf(mFile,"\"%s.fn\"",mName.c_str());
 
368
        }
 
369
        void getFacingRatio()const
 
370
        {
 
371
                fprintf(mFile,"\"%s.fr\"",mName.c_str());
 
372
        }
 
373
protected:
 
374
        SamplerInfo(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
375
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
376
 
 
377
};
 
378
}//namespace MayaDM
 
379
#endif//__MayaDM_SAMPLERINFO_H__