-
Notifications
You must be signed in to change notification settings - Fork 323
Expand file tree
/
Copy pathSceneParameterObjects.h
More file actions
413 lines (376 loc) · 10.8 KB
/
SceneParameterObjects.h
File metadata and controls
413 lines (376 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
#ifndef __SceneParameterObjects_h__
#define __SceneParameterObjects_h__
#include "SPlisHSPlasH/Common.h"
#include <vector>
#include <array>
#include "ParameterObject.h"
namespace Utilities
{
class FluidBlockParameterObject : public GenParam::ParameterObject
{
public:
std::string id;
Vector3r boxMin;
Vector3r boxMax;
Vector3r translation;
Vector3r scale;
std::string visMeshFile;
unsigned char mode;
Vector3r initialVelocity;
Vector3r initialAngularVelocity;
FluidBlockParameterObject()
{
// Default values
id = "Fluid";
visMeshFile = "";
boxMin = Vector3r::Zero();
boxMax = Vector3r::Zero();
mode = 0;
translation = Vector3r::Zero();
scale = Vector3r::Ones();
initialVelocity = Vector3r::Zero();
initialAngularVelocity = Vector3r::Zero();
}
FluidBlockParameterObject(std::string id_, std::string visMeshFile_, Vector3r boxMin_, Vector3r boxMax_, unsigned char mode_, Vector3r translation_, Vector3r scale_,
Vector3r initialVelocity_, Vector3r initialAngularVelocity_)
{
// Default values
id = id_;
boxMin = boxMin_;
boxMax = boxMax_;
translation = translation_;
scale = scale_;
visMeshFile = visMeshFile_;
mode = mode_;
initialVelocity = initialVelocity_;
initialAngularVelocity = initialAngularVelocity_;
}
static int FLUID_BLOCK_ID;
static int FLUID_BLOCK_BOX_MINX;
static int FLUID_BLOCK_BOX_MAXX;
static int FLUID_BLOCK_TRANSLATION;
static int FLUID_BLOCK_SCALE;
static int FLUID_BLOCK_VISMESH;
static int FLUID_BLOCK_MODE;
static int FLUID_BLOCK_INITIAL_VEL;
static int FLUID_BLOCK_INITIAL_ANGVEL;
virtual void initParameters();
};
class FluidModelParameterObject : public GenParam::ParameterObject
{
public:
std::string id;
std::string visMeshFile;
std::string samplesFile;
Vector3r translation;
Vector3r scale;
unsigned char mode;
Vector3r initialVelocity;
Vector3r initialAngularVelocity;
Vector3r axis;
Real angle;
bool invert;
std::array<unsigned int, 3> resolutionSDF;
FluidModelParameterObject()
{
// Default values
id = "Fluid";
translation = Vector3r::Zero();
axis = Vector3r(1, 0, 0);
angle = 0.0;
samplesFile = "";
invert = false;
resolutionSDF = { 20, 20, 20 };
scale = Vector3r::Ones();
visMeshFile = "";
mode = 0;
initialVelocity = Vector3r::Zero();
initialAngularVelocity = Vector3r::Zero();
}
FluidModelParameterObject(std::string id_, std::string visMeshFile_, std::string samplesFile_, Vector3r translation_, Vector3r axis_, Real angle_, Vector3r scale_,
Vector3r initialVelocity_, Vector3r initialAngularVelocity_, unsigned char mode_, bool invert_, std::array<unsigned int, 3> resolutionSDF_)
{
// Default values
id = id_;
translation = translation_;
axis = axis_;
angle = angle_;
samplesFile = samplesFile_;
invert = invert_;
resolutionSDF = resolutionSDF_;
scale = scale_;
visMeshFile = visMeshFile_;
mode = mode_;
initialVelocity = initialVelocity_;
initialAngularVelocity = initialAngularVelocity_;
}
static int FLUID_MODEL_ID;
static int FLUID_MODEL_TRANSLATION;
static int FLUID_MODEL_SCALE;
static int FLUID_MODEL_VISMESH;
static int FLUID_MODEL_MODE;
static int FLUID_MODEL_INITIAL_VEL;
static int FLUID_MODEL_INITIAL_ANGVEL;
static int FLUID_MODEL_SAMPLES_FILE;
static int FLUID_MODEL_ROTAXIS;
static int FLUID_MODEL_ROTANGLE;
static int FLUID_MODEL_INVERT;
static int FLUID_MODEL_RESSDF;
virtual void initParameters();
};
class EmitterParameterObject : public GenParam::ParameterObject
{
public:
std::string id;
unsigned int width;
unsigned int height;
Vector3r x;
Real velocity; // emission velocity
Vector3r axis;
Real angle;
Real emitStartTime;
Real emitEndTime;
unsigned int type; // type: 0 = rectangular, 1 = circle
bool useBoundary;
unsigned int velocityProfile;
EmitterParameterObject()
{
// Default values
id = "Fluid";
width = 5;
height = 5;
x = Vector3r::Zero();
velocity = 1.0;
axis = Vector3r(0, 0, 1);
angle = 0.0;
emitStartTime = 0.0;
emitEndTime = std::numeric_limits<Real>::max();
type = 0;
useBoundary = false;
velocityProfile = 0;
}
EmitterParameterObject(std::string id_, unsigned int width_, unsigned int height_, Vector3r x_, Real velocity_, Vector3r axis_,
Real angle_, Real emitStartTime_, Real emitEndTime_, unsigned int type_, bool useBoundary_, unsigned int velocityProfile_)
{
id = id_;
width = width_;
height = height_;
x = x_;
velocity = velocity_;
axis = axis_;
angle = angle_;
emitStartTime = emitStartTime_;
emitEndTime = emitEndTime_;
type = type_;
useBoundary = useBoundary_;
velocityProfile = velocityProfile_;
}
static int EMITTER_ID;
static int EMITTER_WIDTH;
static int EMITTER_HEIGHT;
static int EMITTER_POSITION;
static int EMITTER_VELOCITY;
static int EMITTER_ROTAXIS;
static int EMITTER_ROTANGLE;
static int EMITTER_STARTTIME;
static int EMITTER_ENDTIME;
static int EMITTER_TYPE;
static int EMITTER_USEBOUNDARY;
static int EMITTER_VELOCITYPROFILE;
virtual void initParameters();
};
/** \brief class to store an animation field object
*/
class AnimationFieldParameterObject : public GenParam::ParameterObject
{
public:
std::string particleFieldName;
std::string expression[3];
unsigned int shapeType;
Vector3r translation;
Vector3r axis;
Real angle;
Vector3r scale;
Real startTime;
Real endTime;
AnimationFieldParameterObject()
{
// Default values
particleFieldName = "";
expression[0] = "";
expression[1] = "";
expression[2] = "";
// 0=Box, 1=Cylinder
shapeType = 0;
// time when emission starts and stops
startTime = 0;
endTime = std::numeric_limits<Real>::max();
scale = Vector3r::Ones();
// shape position
translation = Vector3r::Zero();
// rotation
// default direction without rotation is +x
axis = Vector3r(1.0, 0.0, 0.0);
angle = 0.0;
}
AnimationFieldParameterObject(std::string particleFieldName_, std::string expressionX_, std::string expressionY_, std::string expressionZ_,
unsigned int shapeType_, Vector3r translation_, Vector3r axis_, Real angle_, Vector3r scale_, Real startTime_, Real endTime_)
{
particleFieldName = particleFieldName_;
expression[0] = expressionX_;
expression[1] = expressionY_;
expression[2] = expressionZ_;
shapeType = shapeType_;
startTime = startTime_;
endTime = endTime_;
scale = scale_;
translation = translation_;
axis = axis_;
angle = angle_;
}
static int ANIMATIONFIELD_PARTICLE_FIELD;
static int ANIMATIONFIELD_EXPR_X;
static int ANIMATIONFIELD_EXPR_Y;
static int ANIMATIONFIELD_EXPR_Z;
static int ANIMATIONFIELD_SHAPETYPE;
static int ANIMATIONFIELD_TRANSLATION;
static int ANIMATIONFIELD_ROTAXIS;
static int ANIMATIONFIELD_ROTANGLE;
static int ANIMATIONFIELD_SCALE;
static int ANIMATIONFIELD_STARTTIME;
static int ANIMATIONFIELD_ENDTIME;
virtual void initParameters();
};
/** \brief Class to store particle coloring information */
class MaterialParameterObject : public GenParam::ParameterObject
{
public:
std::string id;
std::string colorField;
unsigned int colorMapType;
Real minVal;
Real maxVal;
bool visible;
unsigned int maxEmitterParticles;
bool emitterReuseParticles;
Vector3r emitterBoxMin;
Vector3r emitterBoxMax;
MaterialParameterObject()
{
// Default values
id = "Fluid";
minVal = 0.0;
maxVal = 10.0;
visible = true;
colorField = "velocity";
colorMapType = 1;
maxEmitterParticles = 10000;
emitterReuseParticles = false;
emitterBoxMin = Vector3r(-1.0, -1.0, -1.0);
emitterBoxMax = Vector3r(1.0, 1.0, 1.0);
}
MaterialParameterObject(std::string id_, std::string colorField_, unsigned int colorMapType_, Real minVal_, Real maxVal_, bool visible_,
unsigned int maxEmitterParticles_, bool emitterReuseParticles_, Vector3r emitterBoxMin_, Vector3r emitterBoxMax_)
{
id = id_;
minVal = minVal_;
maxVal = maxVal_;
visible = visible_;
colorField = colorField_;
colorMapType = colorMapType_;
maxEmitterParticles = maxEmitterParticles_;
emitterReuseParticles = emitterReuseParticles_;
emitterBoxMin = emitterBoxMin_;
emitterBoxMax = emitterBoxMax_;
}
static int MATERIAL_ID;
static int MATERIAL_MIN_VAL;
static int MATERIAL_MAX_VAL;
static int MATERIAL_VISIBLE;
static int MATERIAL_COLOR_FIELD;
static int MATERIAL_COLOR_MAP;
static int MATERIAL_MAX_EMITTER_PARTICLES;
static int MATERIAL_EMITTER_REUSE;
static int MATERIAL_EMITTER_BOX_MIN;
static int MATERIAL_EMITTER_BOX_MAX;
virtual void initParameters();
};
/** \brief Struct to store a boundary object */
class BoundaryParameterObject : public GenParam::ParameterObject
{
public:
std::string samplesFile;
std::string meshFile;
Vector3r translation;
Vector3r axis;
Real angle;
Vector3r scale;
bool dynamic;
bool isWall;
Vector4r color;
std::string mapFile;
bool mapInvert;
Real mapThickness;
Eigen::Matrix<unsigned int, 3, 1, Eigen::DontAlign> mapResolution;
unsigned int samplingMode;
bool isAnimated;
BoundaryParameterObject()
{
// Default values
samplesFile = "";
meshFile = "";
translation = Vector3r::Zero();
axis = Vector3r(1, 0, 0);
angle = 0.0;
scale = Vector3r::Ones();
dynamic = false;
isWall = false;
color = Vector4r(1.0, 0.0, 0.0, 0.0);
samplingMode = 0;
isAnimated = false;
// Maps
mapFile = "";
mapInvert = false;
mapThickness = 0.0;
mapResolution = Eigen::Matrix<unsigned int, 3, 1>(20, 20, 20);
}
BoundaryParameterObject(std::string samplesFile_, std::string meshFile_, Vector3r translation_, Vector3r axis_, Real angle_, Vector3r scale_,
bool dynamic_, bool isWall_, Vector4r color_, std::string mapFile_, bool mapInvert_,
Real mapThickness_, Eigen::Matrix<unsigned int, 3, 1, Eigen::DontAlign> mapResolution_, unsigned int samplingMode_, bool isAnimated_)
{
samplesFile = samplesFile_;
meshFile = meshFile_;
translation = translation_;
axis = axis_;
angle = angle_;
scale = scale_;
dynamic = dynamic_;
isWall = isWall_;
color = color_;
samplingMode = samplingMode_;
isAnimated = isAnimated_;
// Maps
mapFile = mapFile_;
mapInvert = mapInvert_;
mapThickness = mapThickness_;
mapResolution = mapResolution_;
}
static int BOUNDARY_SAMPLES_FILE;
static int BOUNDARY_MESH_FILE;
static int BOUNDARY_TRANSLATION;
static int BOUNDARY_AXIS;
static int BOUNDARY_ANGLE;
static int BOUNDARY_SCALE;
static int BOUNDARY_DYNAMIC;
static int BOUNDARY_IS_WALL;
static int BOUNDARY_COLOR;
static int BOUNDARY_MAP_FILE;
static int BOUNDARY_MAP_INVERT;
static int BOUNDARY_MAP_THICKNESS;
static int BOUNDARY_MAP_RESOLUTION;
static int BOUNDARY_SAMPLING_MODE;
static int BOUNDARY_IS_ANIMATED;
virtual void initParameters();
};
}
#endif