2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of MayaDataModel.
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
10
#ifndef __MayaDM_SAMPLERINFO_H__
11
#define __MayaDM_SAMPLERINFO_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMDependNode.h"
17
class SamplerInfo : public DependNode
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(){}
27
void setPointCamera(const float3& p)
29
if(p == float3(0.0f,0.0f,0.0f)) return;
30
fprintf(mFile,"\tsetAttr \".p\" -type \"float3\" ");
34
void setPointCameraX(float px)
37
fprintf(mFile,"\tsetAttr \".p.px\" %f;\n", px);
39
void setPointCameraY(float py)
42
fprintf(mFile,"\tsetAttr \".p.py\" %f;\n", py);
44
void setPointCameraZ(float pz)
47
fprintf(mFile,"\tsetAttr \".p.pz\" %f;\n", pz);
49
void setPointObj(const float3& po)
51
if(po == float3(0.0f,0.0f,0.0f)) return;
52
fprintf(mFile,"\tsetAttr \".po\" -type \"float3\" ");
56
void setPointObjX(float pox)
58
if(pox == 0.0) return;
59
fprintf(mFile,"\tsetAttr \".po.pox\" %f;\n", pox);
61
void setPointObjY(float poy)
63
if(poy == 0.0) return;
64
fprintf(mFile,"\tsetAttr \".po.poy\" %f;\n", poy);
66
void setPointObjZ(float poz)
68
if(poz == 0.0) return;
69
fprintf(mFile,"\tsetAttr \".po.poz\" %f;\n", poz);
71
void setPointWorld(const float3& pw)
73
if(pw == float3(0.0f,0.0f,0.0f)) return;
74
fprintf(mFile,"\tsetAttr \".pw\" -type \"float3\" ");
78
void setPointWorldX(float pwx)
80
if(pwx == 0.0) return;
81
fprintf(mFile,"\tsetAttr \".pw.pwx\" %f;\n", pwx);
83
void setPointWorldY(float pwy)
85
if(pwy == 0.0) return;
86
fprintf(mFile,"\tsetAttr \".pw.pwy\" %f;\n", pwy);
88
void setPointWorldZ(float pwz)
90
if(pwz == 0.0) return;
91
fprintf(mFile,"\tsetAttr \".pw.pwz\" %f;\n", pwz);
93
void setNormalCamera(const float3& n)
95
if(n == float3(0.0f,0.0f,1.0f)) return;
96
fprintf(mFile,"\tsetAttr \".n\" -type \"float3\" ");
100
void setNormalCameraX(float nx)
102
if(nx == 0.0) return;
103
fprintf(mFile,"\tsetAttr \".n.nx\" %f;\n", nx);
105
void setNormalCameraY(float ny)
107
if(ny == 0.0) return;
108
fprintf(mFile,"\tsetAttr \".n.ny\" %f;\n", ny);
110
void setNormalCameraZ(float nz)
112
if(nz == 0.0) return;
113
fprintf(mFile,"\tsetAttr \".n.nz\" %f;\n", nz);
115
void setUvCoord(const float2& uv)
117
if(uv == float2(0.0f,0.0f)) return;
118
fprintf(mFile,"\tsetAttr \".uv\" -type \"float2\" ");
120
fprintf(mFile,";\n");
122
void setUCoord(float u)
125
fprintf(mFile,"\tsetAttr \".uv.u\" %f;\n", u);
127
void setVCoord(float v)
130
fprintf(mFile,"\tsetAttr \".uv.v\" %f;\n", v);
132
void setRayDirection(const float3& r)
134
if(r == float3(0.0f,0.0f,1.0f)) return;
135
fprintf(mFile,"\tsetAttr \".r\" -type \"float3\" ");
137
fprintf(mFile,";\n");
139
void setRayDirectionX(float rx)
141
if(rx == 0.0) return;
142
fprintf(mFile,"\tsetAttr \".r.rx\" %f;\n", rx);
144
void setRayDirectionY(float ry)
146
if(ry == 0.0) return;
147
fprintf(mFile,"\tsetAttr \".r.ry\" %f;\n", ry);
149
void setRayDirectionZ(float rz)
151
if(rz == 0.0) return;
152
fprintf(mFile,"\tsetAttr \".r.rz\" %f;\n", rz);
154
void setTangentUCamera(const float3& tu)
156
if(tu == float3(1.0f,0.0f,0.0f)) return;
157
fprintf(mFile,"\tsetAttr \".tu\" -type \"float3\" ");
159
fprintf(mFile,";\n");
161
void setTangentUx(float tux)
163
if(tux == 0.0) return;
164
fprintf(mFile,"\tsetAttr \".tu.tux\" %f;\n", tux);
166
void setTangentUy(float tuy)
168
if(tuy == 0.0) return;
169
fprintf(mFile,"\tsetAttr \".tu.tuy\" %f;\n", tuy);
171
void setTangentUz(float tuz)
173
if(tuz == 0.0) return;
174
fprintf(mFile,"\tsetAttr \".tu.tuz\" %f;\n", tuz);
176
void setTangentVCamera(const float3& tv)
178
if(tv == float3(0.0f,1.0f,0.0f)) return;
179
fprintf(mFile,"\tsetAttr \".tv\" -type \"float3\" ");
181
fprintf(mFile,";\n");
183
void setTangentVx(float tvx)
185
if(tvx == 0.0) return;
186
fprintf(mFile,"\tsetAttr \".tv.tvx\" %f;\n", tvx);
188
void setTangentVy(float tvy)
190
if(tvy == 0.0) return;
191
fprintf(mFile,"\tsetAttr \".tv.tvy\" %f;\n", tvy);
193
void setTangentVz(float tvz)
195
if(tvz == 0.0) return;
196
fprintf(mFile,"\tsetAttr \".tv.tvz\" %f;\n", tvz);
198
void setPixelCenter(const float2& pc)
200
if(pc == float2(0.0f,0.0f)) return;
201
fprintf(mFile,"\tsetAttr \".pc\" -type \"float2\" ");
203
fprintf(mFile,";\n");
205
void setPixelCenterX(float pcx)
207
if(pcx == 0.0) return;
208
fprintf(mFile,"\tsetAttr \".pc.pcx\" %f;\n", pcx);
210
void setPixelCenterY(float pcy)
212
if(pcy == 0.0) return;
213
fprintf(mFile,"\tsetAttr \".pc.pcy\" %f;\n", pcy);
215
void setFlippedNormal(bool fn)
217
if(fn == false) return;
218
fprintf(mFile,"\tsetAttr \".fn\" %i;\n", fn);
220
void setFacingRatio(float fr)
222
if(fr == 0.0) return;
223
fprintf(mFile,"\tsetAttr \".fr\" %f;\n", fr);
225
void getPointCamera()const
227
fprintf(mFile,"\"%s.p\"",mName.c_str());
229
void getPointCameraX()const
231
fprintf(mFile,"\"%s.p.px\"",mName.c_str());
233
void getPointCameraY()const
235
fprintf(mFile,"\"%s.p.py\"",mName.c_str());
237
void getPointCameraZ()const
239
fprintf(mFile,"\"%s.p.pz\"",mName.c_str());
241
void getPointObj()const
243
fprintf(mFile,"\"%s.po\"",mName.c_str());
245
void getPointObjX()const
247
fprintf(mFile,"\"%s.po.pox\"",mName.c_str());
249
void getPointObjY()const
251
fprintf(mFile,"\"%s.po.poy\"",mName.c_str());
253
void getPointObjZ()const
255
fprintf(mFile,"\"%s.po.poz\"",mName.c_str());
257
void getPointWorld()const
259
fprintf(mFile,"\"%s.pw\"",mName.c_str());
261
void getPointWorldX()const
263
fprintf(mFile,"\"%s.pw.pwx\"",mName.c_str());
265
void getPointWorldY()const
267
fprintf(mFile,"\"%s.pw.pwy\"",mName.c_str());
269
void getPointWorldZ()const
271
fprintf(mFile,"\"%s.pw.pwz\"",mName.c_str());
273
void getNormalCamera()const
275
fprintf(mFile,"\"%s.n\"",mName.c_str());
277
void getNormalCameraX()const
279
fprintf(mFile,"\"%s.n.nx\"",mName.c_str());
281
void getNormalCameraY()const
283
fprintf(mFile,"\"%s.n.ny\"",mName.c_str());
285
void getNormalCameraZ()const
287
fprintf(mFile,"\"%s.n.nz\"",mName.c_str());
289
void getUvCoord()const
291
fprintf(mFile,"\"%s.uv\"",mName.c_str());
293
void getUCoord()const
295
fprintf(mFile,"\"%s.uv.u\"",mName.c_str());
297
void getVCoord()const
299
fprintf(mFile,"\"%s.uv.v\"",mName.c_str());
301
void getRayDirection()const
303
fprintf(mFile,"\"%s.r\"",mName.c_str());
305
void getRayDirectionX()const
307
fprintf(mFile,"\"%s.r.rx\"",mName.c_str());
309
void getRayDirectionY()const
311
fprintf(mFile,"\"%s.r.ry\"",mName.c_str());
313
void getRayDirectionZ()const
315
fprintf(mFile,"\"%s.r.rz\"",mName.c_str());
317
void getTangentUCamera()const
319
fprintf(mFile,"\"%s.tu\"",mName.c_str());
321
void getTangentUx()const
323
fprintf(mFile,"\"%s.tu.tux\"",mName.c_str());
325
void getTangentUy()const
327
fprintf(mFile,"\"%s.tu.tuy\"",mName.c_str());
329
void getTangentUz()const
331
fprintf(mFile,"\"%s.tu.tuz\"",mName.c_str());
333
void getTangentVCamera()const
335
fprintf(mFile,"\"%s.tv\"",mName.c_str());
337
void getTangentVx()const
339
fprintf(mFile,"\"%s.tv.tvx\"",mName.c_str());
341
void getTangentVy()const
343
fprintf(mFile,"\"%s.tv.tvy\"",mName.c_str());
345
void getTangentVz()const
347
fprintf(mFile,"\"%s.tv.tvz\"",mName.c_str());
349
void getMatrixEyeToWorld()const
351
fprintf(mFile,"\"%s.e2w\"",mName.c_str());
353
void getPixelCenter()const
355
fprintf(mFile,"\"%s.pc\"",mName.c_str());
357
void getPixelCenterX()const
359
fprintf(mFile,"\"%s.pc.pcx\"",mName.c_str());
361
void getPixelCenterY()const
363
fprintf(mFile,"\"%s.pc.pcy\"",mName.c_str());
365
void getFlippedNormal()const
367
fprintf(mFile,"\"%s.fn\"",mName.c_str());
369
void getFacingRatio()const
371
fprintf(mFile,"\"%s.fr\"",mName.c_str());
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) {}
379
#endif//__MayaDM_SAMPLERINFO_H__