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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMNParticle.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_NPARTICLE_H__
 
11
#define __MayaDM_NPARTICLE_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMParticle.h"
 
15
namespace MayaDM
 
16
{
 
17
class NParticle : public Particle
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        NParticle():Particle(){}
 
23
        NParticle(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :Particle(file, name, parent, "nParticle", shared, create){}
 
25
        virtual ~NParticle(){}
 
26
 
 
27
        void setPlayFromCache(bool pfc)
 
28
        {
 
29
                if(pfc == false) return;
 
30
                fprintf(mFile,"\tsetAttr \".pfc\" %i;\n", pfc);
 
31
        }
 
32
        void setStartPositions(const vectorArray& spns)
 
33
        {
 
34
                if(spns.size == 0) return;
 
35
                fprintf(mFile,"\tsetAttr \".spns\" -type \"vectorArray\" ");
 
36
                spns.write(mFile);
 
37
                fprintf(mFile,";\n");
 
38
        }
 
39
        void setStartVelocities(const vectorArray& sves)
 
40
        {
 
41
                if(sves.size == 0) return;
 
42
                fprintf(mFile,"\tsetAttr \".sves\" -type \"vectorArray\" ");
 
43
                sves.write(mFile);
 
44
                fprintf(mFile,";\n");
 
45
        }
 
46
        void setThickness(float thss)
 
47
        {
 
48
                if(thss == 0.1) return;
 
49
                fprintf(mFile,"\tsetAttr \".thss\" %f;\n", thss);
 
50
        }
 
51
        void setThicknessMap(float thmp)
 
52
        {
 
53
                if(thmp == 0.1) return;
 
54
                fprintf(mFile,"\tsetAttr \".thmp\" %f;\n", thmp);
 
55
        }
 
56
        void setThicknessPerVertex(const doubleArray& thpv)
 
57
        {
 
58
                if(thpv.size == 0) return;
 
59
                fprintf(mFile,"\tsetAttr \".thpv\" -type \"doubleArray\" ");
 
60
                thpv.write(mFile);
 
61
                fprintf(mFile,";\n");
 
62
        }
 
63
        void setBounce(float boce)
 
64
        {
 
65
                if(boce == 0.0) return;
 
66
                fprintf(mFile,"\tsetAttr \".boce\" %f;\n", boce);
 
67
        }
 
68
        void setBounceMap(float bomp)
 
69
        {
 
70
                if(bomp == 0.0) return;
 
71
                fprintf(mFile,"\tsetAttr \".bomp\" %f;\n", bomp);
 
72
        }
 
73
        void setBouncePerVertex(const doubleArray& bpv)
 
74
        {
 
75
                if(bpv.size == 0) return;
 
76
                fprintf(mFile,"\tsetAttr \".bpv\" -type \"doubleArray\" ");
 
77
                bpv.write(mFile);
 
78
                fprintf(mFile,";\n");
 
79
        }
 
80
        void setFriction(float fron)
 
81
        {
 
82
                if(fron == 0.1) return;
 
83
                fprintf(mFile,"\tsetAttr \".fron\" %f;\n", fron);
 
84
        }
 
85
        void setFrictionMap(float frmp)
 
86
        {
 
87
                if(frmp == 0.0) return;
 
88
                fprintf(mFile,"\tsetAttr \".frmp\" %f;\n", frmp);
 
89
        }
 
90
        void setFrictionPerVertex(const doubleArray& fpv)
 
91
        {
 
92
                if(fpv.size == 0) return;
 
93
                fprintf(mFile,"\tsetAttr \".fpv\" -type \"doubleArray\" ");
 
94
                fpv.write(mFile);
 
95
                fprintf(mFile,";\n");
 
96
        }
 
97
        void setDamp(float adng)
 
98
        {
 
99
                if(adng == 0.0) return;
 
100
                fprintf(mFile,"\tsetAttr \".adng\" %f;\n", adng);
 
101
        }
 
102
        void setDampMap(float admp)
 
103
        {
 
104
                if(admp == 0.0) return;
 
105
                fprintf(mFile,"\tsetAttr \".admp\" %f;\n", admp);
 
106
        }
 
107
        void setDampPerVertex(const doubleArray& dpv)
 
108
        {
 
109
                if(dpv.size == 0) return;
 
110
                fprintf(mFile,"\tsetAttr \".dpv\" -type \"doubleArray\" ");
 
111
                dpv.write(mFile);
 
112
                fprintf(mFile,";\n");
 
113
        }
 
114
        void setCollisionFlag(unsigned int cofl)
 
115
        {
 
116
                if(cofl == 2) return;
 
117
                fprintf(mFile,"\tsetAttr \".cofl\" %i;\n", cofl);
 
118
        }
 
119
        void setSelfCollisionFlag(unsigned int scfl)
 
120
        {
 
121
                if(scfl == 0) return;
 
122
                fprintf(mFile,"\tsetAttr \".scfl\" %i;\n", scfl);
 
123
        }
 
124
        void setMaxSelfCollisionIterations(int msci)
 
125
        {
 
126
                if(msci == 4) return;
 
127
                fprintf(mFile,"\tsetAttr \".msci\" %i;\n", msci);
 
128
        }
 
129
        void setMaxIterations(int mxit)
 
130
        {
 
131
                if(mxit == 500) return;
 
132
                fprintf(mFile,"\tsetAttr \".mxit\" %i;\n", mxit);
 
133
        }
 
134
        void setPointMass(float pmss)
 
135
        {
 
136
                if(pmss == 1.0) return;
 
137
                fprintf(mFile,"\tsetAttr \".pmss\" %f;\n", pmss);
 
138
        }
 
139
        void setMassMap(float mamp)
 
140
        {
 
141
                if(mamp == 1.0) return;
 
142
                fprintf(mFile,"\tsetAttr \".mamp\" %f;\n", mamp);
 
143
        }
 
144
        void setMassPerVertex(const doubleArray& mpv)
 
145
        {
 
146
                if(mpv.size == 0) return;
 
147
                fprintf(mFile,"\tsetAttr \".mpv\" -type \"doubleArray\" ");
 
148
                mpv.write(mFile);
 
149
                fprintf(mFile,";\n");
 
150
        }
 
151
        void setRestLengthScale(float rlsc)
 
152
        {
 
153
                if(rlsc == 1.0) return;
 
154
                fprintf(mFile,"\tsetAttr \".rlsc\" %f;\n", rlsc);
 
155
        }
 
156
        void setActive(bool actv)
 
157
        {
 
158
                if(actv == 1) return;
 
159
                fprintf(mFile,"\tsetAttr \".actv\" %i;\n", actv);
 
160
        }
 
161
        void setCollide(bool cold)
 
162
        {
 
163
                if(cold == 1) return;
 
164
                fprintf(mFile,"\tsetAttr \".cold\" %i;\n", cold);
 
165
        }
 
166
        void setSelfCollide(bool scld)
 
167
        {
 
168
                if(scld == 1) return;
 
169
                fprintf(mFile,"\tsetAttr \".scld\" %i;\n", scld);
 
170
        }
 
171
        void setCollisionLayer(float cll)
 
172
        {
 
173
                if(cll == 0.0) return;
 
174
                fprintf(mFile,"\tsetAttr \".cll\" %f;\n", cll);
 
175
        }
 
176
        void setWindShadowDiffusion(float wsdi)
 
177
        {
 
178
                if(wsdi == 0.0) return;
 
179
                fprintf(mFile,"\tsetAttr \".wsdi\" %f;\n", wsdi);
 
180
        }
 
181
        void setWindShadowDistance(float wsds)
 
182
        {
 
183
                if(wsds == 0.0) return;
 
184
                fprintf(mFile,"\tsetAttr \".wsds\" %f;\n", wsds);
 
185
        }
 
186
        void setAirPushDistance(float apds)
 
187
        {
 
188
                if(apds == 0.0) return;
 
189
                fprintf(mFile,"\tsetAttr \".apds\" %f;\n", apds);
 
190
        }
 
191
        void setAirPushVorticity(float apvy)
 
192
        {
 
193
                if(apvy == 0.0) return;
 
194
                fprintf(mFile,"\tsetAttr \".apvy\" %f;\n", apvy);
 
195
        }
 
196
        void setPushOut(float pou)
 
197
        {
 
198
                if(pou == 0.0) return;
 
199
                fprintf(mFile,"\tsetAttr \".pou\" %f;\n", pou);
 
200
        }
 
201
        void setPushOutRadius(float por)
 
202
        {
 
203
                if(por == 10.0) return;
 
204
                fprintf(mFile,"\tsetAttr \".por\" %f;\n", por);
 
205
        }
 
206
        void setCrossoverPush(float cop)
 
207
        {
 
208
                if(cop == 0.0) return;
 
209
                fprintf(mFile,"\tsetAttr \".cop\" %f;\n", cop);
 
210
        }
 
211
        void setTrappedCheck(bool tpc)
 
212
        {
 
213
                if(tpc == 0) return;
 
214
                fprintf(mFile,"\tsetAttr \".tpc\" %i;\n", tpc);
 
215
        }
 
216
        void setThicknessMapType(unsigned int tmt)
 
217
        {
 
218
                if(tmt == 2) return;
 
219
                fprintf(mFile,"\tsetAttr \".tmt\" %i;\n", tmt);
 
220
        }
 
221
        void setBounceMapType(unsigned int bmt)
 
222
        {
 
223
                if(bmt == 2) return;
 
224
                fprintf(mFile,"\tsetAttr \".bmt\" %i;\n", bmt);
 
225
        }
 
226
        void setFrictionMapType(unsigned int fmt)
 
227
        {
 
228
                if(fmt == 2) return;
 
229
                fprintf(mFile,"\tsetAttr \".fmt\" %i;\n", fmt);
 
230
        }
 
231
        void setDampMapType(unsigned int dmt)
 
232
        {
 
233
                if(dmt == 2) return;
 
234
                fprintf(mFile,"\tsetAttr \".dmt\" %i;\n", dmt);
 
235
        }
 
236
        void setMassMapType(unsigned int mmt)
 
237
        {
 
238
                if(mmt == 2) return;
 
239
                fprintf(mFile,"\tsetAttr \".mmt\" %i;\n", mmt);
 
240
        }
 
241
        void setLocalSpaceOutput(bool lsou)
 
242
        {
 
243
                if(lsou == 0) return;
 
244
                fprintf(mFile,"\tsetAttr \".lsou\" %i;\n", lsou);
 
245
        }
 
246
        void setDisplayColor(const float3& dcl)
 
247
        {
 
248
                fprintf(mFile,"\tsetAttr \".dcl\" -type \"float3\" ");
 
249
                dcl.write(mFile);
 
250
                fprintf(mFile,";\n");
 
251
        }
 
252
        void setDisplayColorR(float dcr)
 
253
        {
 
254
                if(dcr == 1.0) return;
 
255
                fprintf(mFile,"\tsetAttr \".dcl.dcr\" %f;\n", dcr);
 
256
        }
 
257
        void setDisplayColorG(float dcg)
 
258
        {
 
259
                if(dcg == 0.8) return;
 
260
                fprintf(mFile,"\tsetAttr \".dcl.dcg\" %f;\n", dcg);
 
261
        }
 
262
        void setDisplayColorB(float dcb)
 
263
        {
 
264
                if(dcb == 0.0) return;
 
265
                fprintf(mFile,"\tsetAttr \".dcl.dcb\" %f;\n", dcb);
 
266
        }
 
267
        void getInputMesh()const
 
268
        {
 
269
                fprintf(mFile,"\"%s.imsh\"",mName.c_str());
 
270
        }
 
271
        void getPositions()const
 
272
        {
 
273
                fprintf(mFile,"\"%s.poss\"",mName.c_str());
 
274
        }
 
275
        void getPlayFromCache()const
 
276
        {
 
277
                fprintf(mFile,"\"%s.pfc\"",mName.c_str());
 
278
        }
 
279
        void getStartPositions()const
 
280
        {
 
281
                fprintf(mFile,"\"%s.spns\"",mName.c_str());
 
282
        }
 
283
        void getStartVelocities()const
 
284
        {
 
285
                fprintf(mFile,"\"%s.sves\"",mName.c_str());
 
286
        }
 
287
        void getThickness()const
 
288
        {
 
289
                fprintf(mFile,"\"%s.thss\"",mName.c_str());
 
290
        }
 
291
        void getThicknessMap()const
 
292
        {
 
293
                fprintf(mFile,"\"%s.thmp\"",mName.c_str());
 
294
        }
 
295
        void getThicknessPerVertex()const
 
296
        {
 
297
                fprintf(mFile,"\"%s.thpv\"",mName.c_str());
 
298
        }
 
299
        void getBounce()const
 
300
        {
 
301
                fprintf(mFile,"\"%s.boce\"",mName.c_str());
 
302
        }
 
303
        void getBounceMap()const
 
304
        {
 
305
                fprintf(mFile,"\"%s.bomp\"",mName.c_str());
 
306
        }
 
307
        void getBouncePerVertex()const
 
308
        {
 
309
                fprintf(mFile,"\"%s.bpv\"",mName.c_str());
 
310
        }
 
311
        void getFriction()const
 
312
        {
 
313
                fprintf(mFile,"\"%s.fron\"",mName.c_str());
 
314
        }
 
315
        void getFrictionMap()const
 
316
        {
 
317
                fprintf(mFile,"\"%s.frmp\"",mName.c_str());
 
318
        }
 
319
        void getFrictionPerVertex()const
 
320
        {
 
321
                fprintf(mFile,"\"%s.fpv\"",mName.c_str());
 
322
        }
 
323
        void getDamp()const
 
324
        {
 
325
                fprintf(mFile,"\"%s.adng\"",mName.c_str());
 
326
        }
 
327
        void getDampMap()const
 
328
        {
 
329
                fprintf(mFile,"\"%s.admp\"",mName.c_str());
 
330
        }
 
331
        void getDampPerVertex()const
 
332
        {
 
333
                fprintf(mFile,"\"%s.dpv\"",mName.c_str());
 
334
        }
 
335
        void getCollisionFlag()const
 
336
        {
 
337
                fprintf(mFile,"\"%s.cofl\"",mName.c_str());
 
338
        }
 
339
        void getSelfCollisionFlag()const
 
340
        {
 
341
                fprintf(mFile,"\"%s.scfl\"",mName.c_str());
 
342
        }
 
343
        void getMaxSelfCollisionIterations()const
 
344
        {
 
345
                fprintf(mFile,"\"%s.msci\"",mName.c_str());
 
346
        }
 
347
        void getMaxIterations()const
 
348
        {
 
349
                fprintf(mFile,"\"%s.mxit\"",mName.c_str());
 
350
        }
 
351
        void getPointMass()const
 
352
        {
 
353
                fprintf(mFile,"\"%s.pmss\"",mName.c_str());
 
354
        }
 
355
        void getMassMap()const
 
356
        {
 
357
                fprintf(mFile,"\"%s.mamp\"",mName.c_str());
 
358
        }
 
359
        void getMassPerVertex()const
 
360
        {
 
361
                fprintf(mFile,"\"%s.mpv\"",mName.c_str());
 
362
        }
 
363
        void getRestLengthScale()const
 
364
        {
 
365
                fprintf(mFile,"\"%s.rlsc\"",mName.c_str());
 
366
        }
 
367
        void getActive()const
 
368
        {
 
369
                fprintf(mFile,"\"%s.actv\"",mName.c_str());
 
370
        }
 
371
        void getCollide()const
 
372
        {
 
373
                fprintf(mFile,"\"%s.cold\"",mName.c_str());
 
374
        }
 
375
        void getSelfCollide()const
 
376
        {
 
377
                fprintf(mFile,"\"%s.scld\"",mName.c_str());
 
378
        }
 
379
        void getCollisionLayer()const
 
380
        {
 
381
                fprintf(mFile,"\"%s.cll\"",mName.c_str());
 
382
        }
 
383
        void getWindShadowDiffusion()const
 
384
        {
 
385
                fprintf(mFile,"\"%s.wsdi\"",mName.c_str());
 
386
        }
 
387
        void getWindShadowDistance()const
 
388
        {
 
389
                fprintf(mFile,"\"%s.wsds\"",mName.c_str());
 
390
        }
 
391
        void getAirPushDistance()const
 
392
        {
 
393
                fprintf(mFile,"\"%s.apds\"",mName.c_str());
 
394
        }
 
395
        void getAirPushVorticity()const
 
396
        {
 
397
                fprintf(mFile,"\"%s.apvy\"",mName.c_str());
 
398
        }
 
399
        void getPushOut()const
 
400
        {
 
401
                fprintf(mFile,"\"%s.pou\"",mName.c_str());
 
402
        }
 
403
        void getPushOutRadius()const
 
404
        {
 
405
                fprintf(mFile,"\"%s.por\"",mName.c_str());
 
406
        }
 
407
        void getCrossoverPush()const
 
408
        {
 
409
                fprintf(mFile,"\"%s.cop\"",mName.c_str());
 
410
        }
 
411
        void getTrappedCheck()const
 
412
        {
 
413
                fprintf(mFile,"\"%s.tpc\"",mName.c_str());
 
414
        }
 
415
        void getThicknessMapType()const
 
416
        {
 
417
                fprintf(mFile,"\"%s.tmt\"",mName.c_str());
 
418
        }
 
419
        void getBounceMapType()const
 
420
        {
 
421
                fprintf(mFile,"\"%s.bmt\"",mName.c_str());
 
422
        }
 
423
        void getFrictionMapType()const
 
424
        {
 
425
                fprintf(mFile,"\"%s.fmt\"",mName.c_str());
 
426
        }
 
427
        void getDampMapType()const
 
428
        {
 
429
                fprintf(mFile,"\"%s.dmt\"",mName.c_str());
 
430
        }
 
431
        void getMassMapType()const
 
432
        {
 
433
                fprintf(mFile,"\"%s.mmt\"",mName.c_str());
 
434
        }
 
435
        void getNextState()const
 
436
        {
 
437
                fprintf(mFile,"\"%s.nxst\"",mName.c_str());
 
438
        }
 
439
        void getCurrentState()const
 
440
        {
 
441
                fprintf(mFile,"\"%s.cust\"",mName.c_str());
 
442
        }
 
443
        void getStartState()const
 
444
        {
 
445
                fprintf(mFile,"\"%s.stst\"",mName.c_str());
 
446
        }
 
447
        void getNucleusId()const
 
448
        {
 
449
                fprintf(mFile,"\"%s.nuid\"",mName.c_str());
 
450
        }
 
451
        void getLocalSpaceOutput()const
 
452
        {
 
453
                fprintf(mFile,"\"%s.lsou\"",mName.c_str());
 
454
        }
 
455
        void getDisplayColor()const
 
456
        {
 
457
                fprintf(mFile,"\"%s.dcl\"",mName.c_str());
 
458
        }
 
459
        void getDisplayColorR()const
 
460
        {
 
461
                fprintf(mFile,"\"%s.dcl.dcr\"",mName.c_str());
 
462
        }
 
463
        void getDisplayColorG()const
 
464
        {
 
465
                fprintf(mFile,"\"%s.dcl.dcg\"",mName.c_str());
 
466
        }
 
467
        void getDisplayColorB()const
 
468
        {
 
469
                fprintf(mFile,"\"%s.dcl.dcb\"",mName.c_str());
 
470
        }
 
471
protected:
 
472
        NParticle(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
473
                :Particle(file, name, parent, nodeType, shared, create) {}
 
474
 
 
475
};
 
476
}//namespace MayaDM
 
477
#endif//__MayaDM_NPARTICLE_H__