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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMTextureToGeom.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_TEXTURETOGEOM_H__
 
11
#define __MayaDM_TEXTURETOGEOM_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class TextureToGeom : public DependNode
 
18
{
 
19
public:
 
20
        struct OutColorData{
 
21
                void write(FILE* file) const
 
22
                {
 
23
                }
 
24
        };
 
25
public:
 
26
 
 
27
        TextureToGeom():DependNode(){}
 
28
        TextureToGeom(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
29
                :DependNode(file, name, parent, "textureToGeom", shared, create){}
 
30
        virtual ~TextureToGeom(){}
 
31
 
 
32
        void setSegGroupIds(size_t sgi_i,int sgi)
 
33
        {
 
34
                if(sgi == -1) return;
 
35
                fprintf(mFile,"\tsetAttr \".sgi[%i]\" %i;\n", sgi_i,sgi);
 
36
        }
 
37
        void setSegGroupIds(size_t sgi_start,size_t sgi_end,int* sgi)
 
38
        {
 
39
                fprintf(mFile,"\tsetAttr \".sgi[%i:%i]\" ", sgi_start,sgi_end);
 
40
                size_t size = (sgi_end-sgi_start)*1+1;
 
41
                for(size_t i=0;i<size;++i)
 
42
                {
 
43
                        fprintf(mFile,"%i",sgi[i]);
 
44
                        if(i+1<size) fprintf(mFile," ");
 
45
                }
 
46
                fprintf(mFile,";\n");
 
47
        }
 
48
        void startSegGroupIds(size_t sgi_start,size_t sgi_end)const
 
49
        {
 
50
                fprintf(mFile,"\tsetAttr \".sgi[%i:%i]\"",sgi_start,sgi_end);
 
51
        }
 
52
        void appendSegGroupIds(int sgi)const
 
53
        {
 
54
                fprintf(mFile," %i",sgi);
 
55
        }
 
56
        void endSegGroupIds()const
 
57
        {
 
58
                fprintf(mFile,";\n");
 
59
        }
 
60
        void setInputMesh(const mesh& im)
 
61
        {
 
62
                fprintf(mFile,"\tsetAttr \".im\" -type \"mesh\" ");
 
63
                im.write(mFile);
 
64
                fprintf(mFile,";\n");
 
65
        }
 
66
        void setInputMeshUVSet(const string& iuv)
 
67
        {
 
68
                if(iuv == "NULL") return;
 
69
                fprintf(mFile,"\tsetAttr \".iuv\" -type \"string\" ");
 
70
                iuv.write(mFile);
 
71
                fprintf(mFile,";\n");
 
72
        }
 
73
        void setQuantize(bool qut)
 
74
        {
 
75
                if(qut == 0) return;
 
76
                fprintf(mFile,"\tsetAttr \".qut\" %i;\n", qut);
 
77
        }
 
78
        void setQuantizeLevels(unsigned char qutl)
 
79
        {
 
80
                if(qutl == 10) return;
 
81
                fprintf(mFile,"\tsetAttr \".qutl\" %i;\n", qutl);
 
82
        }
 
83
        void setMaxColorDiff(float mcd)
 
84
        {
 
85
                if(mcd == 0.125) return;
 
86
                fprintf(mFile,"\tsetAttr \".mcd\" %f;\n", mcd);
 
87
        }
 
88
        void setMinSegmentSize(float msz)
 
89
        {
 
90
                if(msz == 0.005) return;
 
91
                fprintf(mFile,"\tsetAttr \".msz\" %f;\n", msz);
 
92
        }
 
93
        void setSpatialRadius(int spr)
 
94
        {
 
95
                if(spr == 7) return;
 
96
                fprintf(mFile,"\tsetAttr \".spr\" %i;\n", spr);
 
97
        }
 
98
        void setColorRange(float crng)
 
99
        {
 
100
                if(crng == 4.5) return;
 
101
                fprintf(mFile,"\tsetAttr \".crng\" %f;\n", crng);
 
102
        }
 
103
        void setImageFile(const string& if_)
 
104
        {
 
105
                if(if_ == "NULL") return;
 
106
                fprintf(mFile,"\tsetAttr \".if\" -type \"string\" ");
 
107
                if_.write(mFile);
 
108
                fprintf(mFile,";\n");
 
109
        }
 
110
        void setMeshQuality(double mq)
 
111
        {
 
112
                if(mq == 0.1) return;
 
113
                fprintf(mFile,"\tsetAttr \".mq\" %f;\n", mq);
 
114
        }
 
115
        void setSurfaceOffset(float so)
 
116
        {
 
117
                if(so == 0.01) return;
 
118
                fprintf(mFile,"\tsetAttr \".so\" %f;\n", so);
 
119
        }
 
120
        void setSmoothBoundary(bool smbd)
 
121
        {
 
122
                if(smbd == 1) return;
 
123
                fprintf(mFile,"\tsetAttr \".smbd\" %i;\n", smbd);
 
124
        }
 
125
        void setSmoothFactor(float smf)
 
126
        {
 
127
                if(smf == 0.5) return;
 
128
                fprintf(mFile,"\tsetAttr \".smf\" %f;\n", smf);
 
129
        }
 
130
        void setFitTolerance(float ft)
 
131
        {
 
132
                if(ft == 0.007) return;
 
133
                fprintf(mFile,"\tsetAttr \".ft\" %f;\n", ft);
 
134
        }
 
135
        void setHardCornerDetect(bool hcd)
 
136
        {
 
137
                if(hcd == 1) return;
 
138
                fprintf(mFile,"\tsetAttr \".hcd\" %i;\n", hcd);
 
139
        }
 
140
        void setHardCornerMaxLength(float hcml)
 
141
        {
 
142
                if(hcml == 10.0) return;
 
143
                fprintf(mFile,"\tsetAttr \".hcml\" %f;\n", hcml);
 
144
        }
 
145
        void setSimplifyBoundary(bool smpl)
 
146
        {
 
147
                if(smpl == 1) return;
 
148
                fprintf(mFile,"\tsetAttr \".smpl\" %i;\n", smpl);
 
149
        }
 
150
        void setSimplifyThreshold(double smpt)
 
151
        {
 
152
                if(smpt == 0) return;
 
153
                fprintf(mFile,"\tsetAttr \".smpt\" %f;\n", smpt);
 
154
        }
 
155
        void setPointsOnBoundary(bool pob)
 
156
        {
 
157
                if(pob == 0) return;
 
158
                fprintf(mFile,"\tsetAttr \".pob\" %i;\n", pob);
 
159
        }
 
160
        void setMaxPointsAdded(int mpa)
 
161
        {
 
162
                if(mpa == 0) return;
 
163
                fprintf(mFile,"\tsetAttr \".mpa\" %i;\n", mpa);
 
164
        }
 
165
        void setShaderScript(const string& shs)
 
166
        {
 
167
                if(shs == "NULL") return;
 
168
                fprintf(mFile,"\tsetAttr \".shs\" -type \"string\" ");
 
169
                shs.write(mFile);
 
170
                fprintf(mFile,";\n");
 
171
        }
 
172
        void getSegmentCount()const
 
173
        {
 
174
                fprintf(mFile,"\"%s.sc\"",mName.c_str());
 
175
        }
 
176
        void getOutput()const
 
177
        {
 
178
                fprintf(mFile,"\"%s.out\"",mName.c_str());
 
179
        }
 
180
        void getOutColorData(size_t ocd_i)const
 
181
        {
 
182
                fprintf(mFile,"\"%s.ocd[%i]\"",mName.c_str(),ocd_i);
 
183
        }
 
184
        void getOutColorData()const
 
185
        {
 
186
 
 
187
                fprintf(mFile,"\"%s.ocd\"",mName.c_str());
 
188
        }
 
189
        void getOutColor(size_t ocd_i)const
 
190
        {
 
191
                fprintf(mFile,"\"%s.ocd[%i].oc\"",mName.c_str(),ocd_i);
 
192
        }
 
193
        void getOutColor()const
 
194
        {
 
195
 
 
196
                fprintf(mFile,"\"%s.ocd.oc\"",mName.c_str());
 
197
        }
 
198
        void getOutColorR(size_t ocd_i)const
 
199
        {
 
200
                fprintf(mFile,"\"%s.ocd[%i].oc.ocr\"",mName.c_str(),ocd_i);
 
201
        }
 
202
        void getOutColorR()const
 
203
        {
 
204
 
 
205
                fprintf(mFile,"\"%s.ocd.oc.ocr\"",mName.c_str());
 
206
        }
 
207
        void getOutColorG(size_t ocd_i)const
 
208
        {
 
209
                fprintf(mFile,"\"%s.ocd[%i].oc.ocg\"",mName.c_str(),ocd_i);
 
210
        }
 
211
        void getOutColorG()const
 
212
        {
 
213
 
 
214
                fprintf(mFile,"\"%s.ocd.oc.ocg\"",mName.c_str());
 
215
        }
 
216
        void getOutColorB(size_t ocd_i)const
 
217
        {
 
218
                fprintf(mFile,"\"%s.ocd[%i].oc.ocb\"",mName.c_str(),ocd_i);
 
219
        }
 
220
        void getOutColorB()const
 
221
        {
 
222
 
 
223
                fprintf(mFile,"\"%s.ocd.oc.ocb\"",mName.c_str());
 
224
        }
 
225
        void getOutAlpha(size_t ocd_i)const
 
226
        {
 
227
                fprintf(mFile,"\"%s.ocd[%i].oa\"",mName.c_str(),ocd_i);
 
228
        }
 
229
        void getOutAlpha()const
 
230
        {
 
231
 
 
232
                fprintf(mFile,"\"%s.ocd.oa\"",mName.c_str());
 
233
        }
 
234
        void getOutSegFace(size_t ofm_i)const
 
235
        {
 
236
                fprintf(mFile,"\"%s.ofm[%i]\"",mName.c_str(),ofm_i);
 
237
        }
 
238
        void getOutSegFace()const
 
239
        {
 
240
 
 
241
                fprintf(mFile,"\"%s.ofm\"",mName.c_str());
 
242
        }
 
243
        void getSegGroupIds(size_t sgi_i)const
 
244
        {
 
245
                fprintf(mFile,"\"%s.sgi[%i]\"",mName.c_str(),sgi_i);
 
246
        }
 
247
        void getSegGroupIds()const
 
248
        {
 
249
 
 
250
                fprintf(mFile,"\"%s.sgi\"",mName.c_str());
 
251
        }
 
252
        void getInputMesh()const
 
253
        {
 
254
                fprintf(mFile,"\"%s.im\"",mName.c_str());
 
255
        }
 
256
        void getInputMeshUVSet()const
 
257
        {
 
258
                fprintf(mFile,"\"%s.iuv\"",mName.c_str());
 
259
        }
 
260
        void getQuantize()const
 
261
        {
 
262
                fprintf(mFile,"\"%s.qut\"",mName.c_str());
 
263
        }
 
264
        void getQuantizeLevels()const
 
265
        {
 
266
                fprintf(mFile,"\"%s.qutl\"",mName.c_str());
 
267
        }
 
268
        void getMaxColorDiff()const
 
269
        {
 
270
                fprintf(mFile,"\"%s.mcd\"",mName.c_str());
 
271
        }
 
272
        void getMinSegmentSize()const
 
273
        {
 
274
                fprintf(mFile,"\"%s.msz\"",mName.c_str());
 
275
        }
 
276
        void getSpatialRadius()const
 
277
        {
 
278
                fprintf(mFile,"\"%s.spr\"",mName.c_str());
 
279
        }
 
280
        void getColorRange()const
 
281
        {
 
282
                fprintf(mFile,"\"%s.crng\"",mName.c_str());
 
283
        }
 
284
        void getImageFile()const
 
285
        {
 
286
                fprintf(mFile,"\"%s.if\"",mName.c_str());
 
287
        }
 
288
        void getMeshQuality()const
 
289
        {
 
290
                fprintf(mFile,"\"%s.mq\"",mName.c_str());
 
291
        }
 
292
        void getSurfaceOffset()const
 
293
        {
 
294
                fprintf(mFile,"\"%s.so\"",mName.c_str());
 
295
        }
 
296
        void getSmoothBoundary()const
 
297
        {
 
298
                fprintf(mFile,"\"%s.smbd\"",mName.c_str());
 
299
        }
 
300
        void getSmoothFactor()const
 
301
        {
 
302
                fprintf(mFile,"\"%s.smf\"",mName.c_str());
 
303
        }
 
304
        void getFitTolerance()const
 
305
        {
 
306
                fprintf(mFile,"\"%s.ft\"",mName.c_str());
 
307
        }
 
308
        void getHardCornerDetect()const
 
309
        {
 
310
                fprintf(mFile,"\"%s.hcd\"",mName.c_str());
 
311
        }
 
312
        void getHardCornerMaxLength()const
 
313
        {
 
314
                fprintf(mFile,"\"%s.hcml\"",mName.c_str());
 
315
        }
 
316
        void getSimplifyBoundary()const
 
317
        {
 
318
                fprintf(mFile,"\"%s.smpl\"",mName.c_str());
 
319
        }
 
320
        void getSimplifyThreshold()const
 
321
        {
 
322
                fprintf(mFile,"\"%s.smpt\"",mName.c_str());
 
323
        }
 
324
        void getPointsOnBoundary()const
 
325
        {
 
326
                fprintf(mFile,"\"%s.pob\"",mName.c_str());
 
327
        }
 
328
        void getMaxPointsAdded()const
 
329
        {
 
330
                fprintf(mFile,"\"%s.mpa\"",mName.c_str());
 
331
        }
 
332
        void getShaderScript()const
 
333
        {
 
334
                fprintf(mFile,"\"%s.shs\"",mName.c_str());
 
335
        }
 
336
protected:
 
337
        TextureToGeom(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
338
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
339
 
 
340
};
 
341
}//namespace MayaDM
 
342
#endif//__MayaDM_TEXTURETOGEOM_H__