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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMCloud.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_CLOUD_H__
 
11
#define __MayaDM_CLOUD_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMTexture3d.h"
 
15
namespace MayaDM
 
16
{
 
17
class Cloud : public Texture3d
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        Cloud():Texture3d(){}
 
23
        Cloud(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :Texture3d(file, name, parent, "cloud", shared, create){}
 
25
        virtual ~Cloud(){}
 
26
 
 
27
        void setXPixelAngle(float xpa)
 
28
        {
 
29
                if(xpa == 0.002053) return;
 
30
                fprintf(mFile,"\tsetAttr \".xpa\" %f;\n", xpa);
 
31
        }
 
32
        void setColor1(const float3& c1)
 
33
        {
 
34
                if(c1 == float3(0.0f,0.0f,0.0f)) return;
 
35
                fprintf(mFile,"\tsetAttr \".c1\" -type \"float3\" ");
 
36
                c1.write(mFile);
 
37
                fprintf(mFile,";\n");
 
38
        }
 
39
        void setColor1R(float c1r)
 
40
        {
 
41
                if(c1r == 0.0) return;
 
42
                fprintf(mFile,"\tsetAttr \".c1.c1r\" %f;\n", c1r);
 
43
        }
 
44
        void setColor1G(float c1g)
 
45
        {
 
46
                if(c1g == 0.0) return;
 
47
                fprintf(mFile,"\tsetAttr \".c1.c1g\" %f;\n", c1g);
 
48
        }
 
49
        void setColor1B(float c1b)
 
50
        {
 
51
                if(c1b == 0.0) return;
 
52
                fprintf(mFile,"\tsetAttr \".c1.c1b\" %f;\n", c1b);
 
53
        }
 
54
        void setColor2(const float3& c2)
 
55
        {
 
56
                if(c2 == float3(1.0f,1.0f,1.0f)) return;
 
57
                fprintf(mFile,"\tsetAttr \".c2\" -type \"float3\" ");
 
58
                c2.write(mFile);
 
59
                fprintf(mFile,";\n");
 
60
        }
 
61
        void setColor2R(float c2r)
 
62
        {
 
63
                if(c2r == 0.0) return;
 
64
                fprintf(mFile,"\tsetAttr \".c2.c2r\" %f;\n", c2r);
 
65
        }
 
66
        void setColor2G(float c2g)
 
67
        {
 
68
                if(c2g == 0.0) return;
 
69
                fprintf(mFile,"\tsetAttr \".c2.c2g\" %f;\n", c2g);
 
70
        }
 
71
        void setColor2B(float c2b)
 
72
        {
 
73
                if(c2b == 0.0) return;
 
74
                fprintf(mFile,"\tsetAttr \".c2.c2b\" %f;\n", c2b);
 
75
        }
 
76
        void setContrast(float c)
 
77
        {
 
78
                if(c == 0.5) return;
 
79
                fprintf(mFile,"\tsetAttr \".c\" %f;\n", c);
 
80
        }
 
81
        void setSoftEdges(bool se)
 
82
        {
 
83
                if(se == true) return;
 
84
                fprintf(mFile,"\tsetAttr \".se\" %i;\n", se);
 
85
        }
 
86
        void setTranspRange(float tr)
 
87
        {
 
88
                if(tr == 0.5) return;
 
89
                fprintf(mFile,"\tsetAttr \".tr\" %f;\n", tr);
 
90
        }
 
91
        void setCenterThresh(float ct)
 
92
        {
 
93
                if(ct == 0.0) return;
 
94
                fprintf(mFile,"\tsetAttr \".ct\" %f;\n", ct);
 
95
        }
 
96
        void setEdgeThresh(float et)
 
97
        {
 
98
                if(et == 1.0) return;
 
99
                fprintf(mFile,"\tsetAttr \".et\" %f;\n", et);
 
100
        }
 
101
        void setRipples(const float3& r)
 
102
        {
 
103
                if(r == float3(1.0f,1.0f,1.0f)) return;
 
104
                fprintf(mFile,"\tsetAttr \".r\" -type \"float3\" ");
 
105
                r.write(mFile);
 
106
                fprintf(mFile,";\n");
 
107
        }
 
108
        void setRipplesX(float rx)
 
109
        {
 
110
                if(rx == 0.0) return;
 
111
                fprintf(mFile,"\tsetAttr \".r.rx\" %f;\n", rx);
 
112
        }
 
113
        void setRipplesY(float ry)
 
114
        {
 
115
                if(ry == 0.0) return;
 
116
                fprintf(mFile,"\tsetAttr \".r.ry\" %f;\n", ry);
 
117
        }
 
118
        void setRipplesZ(float rz)
 
119
        {
 
120
                if(rz == 0.0) return;
 
121
                fprintf(mFile,"\tsetAttr \".r.rz\" %f;\n", rz);
 
122
        }
 
123
        void setDepth(const float2& d)
 
124
        {
 
125
                if(d == float2(0.0f,8.0f)) return;
 
126
                fprintf(mFile,"\tsetAttr \".d\" -type \"float2\" ");
 
127
                d.write(mFile);
 
128
                fprintf(mFile,";\n");
 
129
        }
 
130
        void setDepthMin(float dmn)
 
131
        {
 
132
                if(dmn == 0.0) return;
 
133
                fprintf(mFile,"\tsetAttr \".d.dmn\" %f;\n", dmn);
 
134
        }
 
135
        void setDepthMax(float dmx)
 
136
        {
 
137
                if(dmx == 0.0) return;
 
138
                fprintf(mFile,"\tsetAttr \".d.dmx\" %f;\n", dmx);
 
139
        }
 
140
        void setAmplitude(float a)
 
141
        {
 
142
                if(a == 1.0) return;
 
143
                fprintf(mFile,"\tsetAttr \".a\" %f;\n", a);
 
144
        }
 
145
        void setRatio(float ra)
 
146
        {
 
147
                if(ra == 0.707) return;
 
148
                fprintf(mFile,"\tsetAttr \".ra\" %f;\n", ra);
 
149
        }
 
150
        void getNormalCamera()const
 
151
        {
 
152
                fprintf(mFile,"\"%s.n\"",mName.c_str());
 
153
        }
 
154
        void getNormalCameraX()const
 
155
        {
 
156
                fprintf(mFile,"\"%s.n.nx\"",mName.c_str());
 
157
        }
 
158
        void getNormalCameraY()const
 
159
        {
 
160
                fprintf(mFile,"\"%s.n.ny\"",mName.c_str());
 
161
        }
 
162
        void getNormalCameraZ()const
 
163
        {
 
164
                fprintf(mFile,"\"%s.n.nz\"",mName.c_str());
 
165
        }
 
166
        void getRefPointObj()const
 
167
        {
 
168
                fprintf(mFile,"\"%s.rpo\"",mName.c_str());
 
169
        }
 
170
        void getRefPointObjX()const
 
171
        {
 
172
                fprintf(mFile,"\"%s.rpo.rox\"",mName.c_str());
 
173
        }
 
174
        void getRefPointObjY()const
 
175
        {
 
176
                fprintf(mFile,"\"%s.rpo.roy\"",mName.c_str());
 
177
        }
 
178
        void getRefPointObjZ()const
 
179
        {
 
180
                fprintf(mFile,"\"%s.rpo.roz\"",mName.c_str());
 
181
        }
 
182
        void getRefPointCamera()const
 
183
        {
 
184
                fprintf(mFile,"\"%s.rpc\"",mName.c_str());
 
185
        }
 
186
        void getRefPointCameraX()const
 
187
        {
 
188
                fprintf(mFile,"\"%s.rpc.rcx\"",mName.c_str());
 
189
        }
 
190
        void getRefPointCameraY()const
 
191
        {
 
192
                fprintf(mFile,"\"%s.rpc.rcy\"",mName.c_str());
 
193
        }
 
194
        void getRefPointCameraZ()const
 
195
        {
 
196
                fprintf(mFile,"\"%s.rpc.rcz\"",mName.c_str());
 
197
        }
 
198
        void getXPixelAngle()const
 
199
        {
 
200
                fprintf(mFile,"\"%s.xpa\"",mName.c_str());
 
201
        }
 
202
        void getEyeToTextureMatrix()const
 
203
        {
 
204
                fprintf(mFile,"\"%s.e2t\"",mName.c_str());
 
205
        }
 
206
        void getColor1()const
 
207
        {
 
208
                fprintf(mFile,"\"%s.c1\"",mName.c_str());
 
209
        }
 
210
        void getColor1R()const
 
211
        {
 
212
                fprintf(mFile,"\"%s.c1.c1r\"",mName.c_str());
 
213
        }
 
214
        void getColor1G()const
 
215
        {
 
216
                fprintf(mFile,"\"%s.c1.c1g\"",mName.c_str());
 
217
        }
 
218
        void getColor1B()const
 
219
        {
 
220
                fprintf(mFile,"\"%s.c1.c1b\"",mName.c_str());
 
221
        }
 
222
        void getColor2()const
 
223
        {
 
224
                fprintf(mFile,"\"%s.c2\"",mName.c_str());
 
225
        }
 
226
        void getColor2R()const
 
227
        {
 
228
                fprintf(mFile,"\"%s.c2.c2r\"",mName.c_str());
 
229
        }
 
230
        void getColor2G()const
 
231
        {
 
232
                fprintf(mFile,"\"%s.c2.c2g\"",mName.c_str());
 
233
        }
 
234
        void getColor2B()const
 
235
        {
 
236
                fprintf(mFile,"\"%s.c2.c2b\"",mName.c_str());
 
237
        }
 
238
        void getContrast()const
 
239
        {
 
240
                fprintf(mFile,"\"%s.c\"",mName.c_str());
 
241
        }
 
242
        void getSoftEdges()const
 
243
        {
 
244
                fprintf(mFile,"\"%s.se\"",mName.c_str());
 
245
        }
 
246
        void getTranspRange()const
 
247
        {
 
248
                fprintf(mFile,"\"%s.tr\"",mName.c_str());
 
249
        }
 
250
        void getCenterThresh()const
 
251
        {
 
252
                fprintf(mFile,"\"%s.ct\"",mName.c_str());
 
253
        }
 
254
        void getEdgeThresh()const
 
255
        {
 
256
                fprintf(mFile,"\"%s.et\"",mName.c_str());
 
257
        }
 
258
        void getRipples()const
 
259
        {
 
260
                fprintf(mFile,"\"%s.r\"",mName.c_str());
 
261
        }
 
262
        void getRipplesX()const
 
263
        {
 
264
                fprintf(mFile,"\"%s.r.rx\"",mName.c_str());
 
265
        }
 
266
        void getRipplesY()const
 
267
        {
 
268
                fprintf(mFile,"\"%s.r.ry\"",mName.c_str());
 
269
        }
 
270
        void getRipplesZ()const
 
271
        {
 
272
                fprintf(mFile,"\"%s.r.rz\"",mName.c_str());
 
273
        }
 
274
        void getDepth()const
 
275
        {
 
276
                fprintf(mFile,"\"%s.d\"",mName.c_str());
 
277
        }
 
278
        void getDepthMin()const
 
279
        {
 
280
                fprintf(mFile,"\"%s.d.dmn\"",mName.c_str());
 
281
        }
 
282
        void getDepthMax()const
 
283
        {
 
284
                fprintf(mFile,"\"%s.d.dmx\"",mName.c_str());
 
285
        }
 
286
        void getAmplitude()const
 
287
        {
 
288
                fprintf(mFile,"\"%s.a\"",mName.c_str());
 
289
        }
 
290
        void getRatio()const
 
291
        {
 
292
                fprintf(mFile,"\"%s.ra\"",mName.c_str());
 
293
        }
 
294
protected:
 
295
        Cloud(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
296
                :Texture3d(file, name, parent, nodeType, shared, create) {}
 
297
 
 
298
};
 
299
}//namespace MayaDM
 
300
#endif//__MayaDM_CLOUD_H__