-
Notifications
You must be signed in to change notification settings - Fork 0
/
Enums.h
763 lines (697 loc) · 12.2 KB
/
Enums.h
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
/**
* @file Enums.h
* @author Dan R. Lipsa
* @date 1 May 2010
* @brief Enums used in the program.
* @ingroup utils
*/
#ifndef __ENUMS_H__
#define __ENUMS_H__
/**
* @brief Specifies if this is an element stored in the dmp file or a duplicate
*
*/
struct ElementStatus
{
enum Enum
{
/**
* Stored in the dmp file, no duplicate was made
*/
ORIGINAL,
/**
* Not in the dmp file, a duplicate of an element in the dmp file
*/
DUPLICATE
};
friend ostream& operator<< (ostream& ostr,
ElementStatus::Enum duplicateStatus);
};
/**
* @brief Ways to interact with the data (navigation operations)
*/
class InteractionMode
{
public:
/**
* Names of colors
*/
enum Enum
{
ROTATE,
SCALE,
TRANSLATE,
SELECT,
DESELECT,
COUNT
};
};
/**
* @brief Object the user interacts with (focus, context, light, grid)
*/
struct InteractionObject
{
enum Enum {
FOCUS,
CONTEXT,
LIGHT,
GRID
};
};
/**
* @brief Types of attributes for vertices, edges, faces and bodies
*/
struct AttributeType
{
enum Enum
{
INT,
REAL,
COLOR,
INT_ARRAY,
REAL_ARRAY,
COUNT
};
/**
* Pretty print for a Type
* @param ostr where to print
* @param type what to print
* @return where to print next
*/
friend ostream& operator<< (ostream& ostr, AttributeType::Enum type);
};
/**
* @brief Body scalars.
*/
class BodyScalar
{
public:
enum Enum
{
VELOCITY_X, PROPERTY_BEGIN = VELOCITY_X,
VELOCITY_Y,
VELOCITY_Z,
VELOCITY_MAGNITUDE,
SIDES_PER_BUBBLE, // edges per face for 2D, faces per body for 3D
DEFORMATION_SIMPLE, // P / sqrt (A) for 2D, A / V^(2/3) for 3D
DEFORMATION_EIGEN, // l - l_min / l_max where (l_i are the eigen values
// for the deformation tensor
PRESSURE, DMP_BEGIN = PRESSURE,
TARGET_VOLUME,
ACTUAL_VOLUME,
GROWTH_RATE,
COUNT // 11
};
public:
static const char* ToString (BodyScalar::Enum property);
static Enum FromSizeT (size_t i);
static bool IsValid (size_t i);
private:
static boost::array<const char*, COUNT> NAME;
};
/**
* @brief Vector and tensor attributes (enum values starts after the
* last BodyScalar value)
*/
struct BodyAttribute
{
enum NumberOfComponents
{
SCALAR_NUMBER_OF_COMPONENTS = 1,
VECTOR_NUMBER_OF_COMPONENTS = 3,
TENSOR_NUMBER_OF_COMPONENTS = 9,
MAX_NUMBER_OF_COMPONENTS = 9
};
typedef boost::function<void (
double[MAX_NUMBER_OF_COMPONENTS],
double[MAX_NUMBER_OF_COMPONENTS])> ConvertType;
enum Enum
{
VELOCITY = BodyScalar::COUNT,
DEFORMATION,
COUNT // 13
};
static const char* ToString (BodyAttribute::Enum attribute);
static const char* ToString (size_t attribute);
static string ValueToString (size_t attribute, float* value);
static size_t DependsOn (size_t attribute);
static ConvertType Convert (size_t attribute);
static size_t GetNumberOfComponents (BodyAttribute::Enum attribute);
static size_t GetNumberOfComponents (size_t attribute);
static BodyAttribute::Enum FromSizeT (size_t i);
static vtkDataSetAttributes::AttributeTypes GetType (size_t attribute);
static bool IsScalar (size_t attribute)
{
return GetNumberOfComponents (attribute) == SCALAR_NUMBER_OF_COMPONENTS;
}
static bool IsVector (size_t attribute)
{
return GetNumberOfComponents (attribute) == VECTOR_NUMBER_OF_COMPONENTS;
}
static bool IsTensor (size_t attribute)
{
return GetNumberOfComponents (attribute) == TENSOR_NUMBER_OF_COMPONENTS;
}
static bool IsRedundant (size_t attribute);
private:
struct Info
{
Enum m_attribute;
const char* m_name;
size_t m_numberOfComponents;
};
struct DependsOnInfo
{
size_t m_dependsOnAttribute;
ConvertType m_convert;
};
static boost::array<Info, COUNT> INFO;
static boost::array<DependsOnInfo, COUNT> DEPENDS_ON_INFO;
};
/**
* @brief Other way to display a body (DMP_COLOR) or compute an
* average (T1_KDE) that is conveniently stored as a body attribute.
*/
class OtherScalar
{
public:
enum Enum
{
DMP_COLOR = BodyAttribute::COUNT,
T1_KDE,
COUNT // 15
};
public:
static const char* ToString (OtherScalar::Enum property);
static const char* ToString (size_t property);
static Enum FromSizeT (size_t i);
};
/**
* @brief Options for displaying a Histogram
*/
class HistogramType
{
public:
enum Option
{
UNICOLOR_TIME_STEP = 0x0,
COLOR_MAPPED = 0x1,
ALL_TIME_STEPS_SHOWN = 0x2
};
Q_DECLARE_FLAGS (Options, Option);
};
Q_DECLARE_OPERATORS_FOR_FLAGS (HistogramType::Options);
/**
* @brief Types of palettes for color maps
*/
class PaletteType
{
public:
enum Enum
{
SEQUENTIAL,
DIVERGING
};
static const char* ToString (PaletteType::Enum type);
};
/**
* @brief Types of sequencial palettes for color maps
*/
struct PaletteSequential
{
enum Enum
{
BLACK_BODY,
BREWER_BLUES9,
BREWER_YLORRD9,
COUNT
};
static const char* ToString (PaletteSequential::Enum name);
};
/**
* @brief Types of diverging palettes for color maps
*/
struct PaletteDiverging
{
enum Enum
{
BLUE_RED,
BLUE_TAN,
PURPLE_ORANGE,
GREEN_PURPLE,
GREEN_RED,
COUNT
};
static const char* ToString (PaletteDiverging::Enum name);
};
/**
* @brief A palette (sequential or diverging) for color maps
*/
struct Palette
{
Palette ();
Palette (PaletteType::Enum type, int palette);
Palette (PaletteType::Enum type, PaletteSequential::Enum sequential,
PaletteDiverging::Enum diverging);
PaletteType::Enum m_type;
PaletteSequential::Enum m_sequential;
PaletteDiverging::Enum m_diverging;
string ToString () const;
};
inline ostream& operator<< (ostream& ostr, const Palette& b)
{
return ostr << b.ToString ();
}
/**
* @brief Type of visualization used.
*/
class ViewType
{
public:
enum Enum {
EDGES,
FACES,
BUBBLE_PATHS,
AVERAGE,
T1_KDE,
COUNT
};
static Enum FromSizeT (size_t i);
static bool IsTimeDependent (ViewType::Enum t);
static const char* ToString (ViewType::Enum viewType);
};
/**
* @brief Type of vector visualizations
*/
struct VectorVis
{
enum Enum
{
GLYPH,
STREAMLINE,
PATHLINE,
COUNT
};
};
/**
* @brief Type of edge visualization used
*/
class EdgeVis
{
public:
enum Enum
{
EDGE_NORMAL,
EDGE_TORUS,
EDGE_TORUS_FACE
};
};
/**
* @brief Type of statistics visualization used (average, min or max)
*/
class StatisticsType
{
public:
enum Enum
{
AVERAGE,
MIN,
MAX,
COUNT
};
};
/**
* @brief Types of averages (do we use a per voxel or a global count).
*
* We have two type of averages. For the LOCAL type, a count is stored in each
* voxel. This is used for average of attributes where a voxel is not covered
* in each time step. For the GLOBAL type, a global count is used, equal with
* the number of steps in Average::GetCurrentTimeWindow. This is used for T1KDE.
*/
struct AverageCountType
{
enum Enum
{
LOCAL,
GLOBAL
};
};
/**
* @brief Transformations we apply to the data before we display it.
*/
struct AxisOrderName
{
enum Enum
{
TWO_D,
TWO_D_TIME_DISPLACEMENT,
TWO_D_ROTATE_RIGHT90,
TWO_D_ROTATE_RIGHT90_REFLECTION,
TWO_D_ROTATE_LEFT90,
THREE_D,
COUNT
};
};
/**
* @brief Light number
*/
struct LightNumber
{
enum Enum
{
LIGHT0,
LIGHT1,
LIGHT2,
LIGHT3,
COUNT
};
static Enum FromSizeT (size_t i);
};
/**
* @brief Body selector type
*/
class BodySelectorType
{
public:
enum Enum
{
ALL,
ID,
PROPERTY_VALUE,
COMPOSITE
};
};
/**
* @brief Location of a point in a strip of segments.
*/
struct StripPointLocation
{
enum Enum
{
BEGIN_POINT,
MIDDLE_POINT,
END_POINT,
COUNT
};
};
/**
* @brief Specifies which ends of a tube segment are perpendicular on it.
*/
struct SegmentPerpendicularEnd
{
enum Enum
{
BEGIN_SEGMENT,
END_SEGMENT,
BEGIN_END_SEGMENT,
NONE,
COUNT
};
};
/**
* @brief Number of views displayed
*/
struct ViewCount
{
enum Enum
{
ONE = 1,
TWO,
THREE,
FOUR,
COUNT
};
static ViewCount::Enum FromSizeT (size_t count);
};
/**
* @brief Are views laid out horizontally or vertically
*/
struct ViewLayout
{
enum Enum
{
HORIZONTAL,
VERTICAL
};
};
/**
* @brief View number
*/
struct ViewNumber
{
enum Enum
{
VIEW0,
VIEW1,
VIEW2,
VIEW3,
COUNT
};
static Enum FromSizeT (size_t count);
static const char* ToString (ViewNumber::Enum viewNumber);
};
/**
* @brief Highlight color number. Each palette has its own highlight
* colors that can be used with the colors used in the palette.
*/
struct HighlightNumber
{
enum Enum
{
H0,
H1,
H2,
COUNT
};
};
/**
* @brief Light type (ambient, diffuse, specular)
*/
struct LightType
{
enum Enum
{
AMBIENT,
DIFFUSE,
SPECULAR,
COUNT
};
static GLenum ToOpenGL (LightType::Enum lightType);
};
/**
* @brief Color (red, green or blue)
*/
struct ColorNumber
{
enum Enum
{
RED,
GREEN,
BLUE
};
};
/**
* @brief Body attributes index for attributes present in the DMP file.
*/
struct BodyAttributeIndex
{
enum Enum
{
PRESSURE,
TARGET_VOLUME,
ACTUAL_VOLUME,
ORIGINAL
};
};
/**
* @brief Face attributes index for attributes present in the DMP file.
*/
struct FaceAttributeIndex
{
enum Enum
{
COLOR,
AREA,
CONSTRAINTS
};
};
/**
* @brief Edge attributes index for attributes present in the DMP file.
*/
struct EdgeAttributeIndex
{
enum Enum
{
COLOR,
CONSTRAINTS
};
};
/**
* @brief Vertex attributes index for attributes present in the DMP file.
*/
struct VertexAttributeIndex
{
enum Enum
{
CONSTRAINTS
};
};
/**
* @brief If the viewing volume encloses a rotation of the data
* bounding box or not.
*/
struct ViewingVolumeOperation
{
enum Enum
{
DONT_ENCLOSE2D,
ENCLOSE2D
};
};
/**
* @brief Types of color maps for scalar time-step or average visualizations.
*/
struct ColorMapScalarType
{
enum Enum
{
PROPERTY,
STATISTICS_COUNT,
T1_KDE,
NONE
};
};
/**
* @brief Time linkage
*/
struct TimeLinkage
{
enum Enum
{
INDEPENDENT,
LINKED,
};
};
/**
* @brief Where do we duplicate the original domain
*/
struct DuplicateDomain
{
enum Enum
{
LEFT,
RIGHT,
TOP,
BOTTOM,
COUNT
};
};
/**
* @brief VTK pipeline type (only average 3d for now)
*/
struct PipelineType
{
enum Enum
{
AVERAGE_3D,
COUNT
};
};
/**
* @brief Types of force and torque displayed
*/
struct ForceType
{
enum Enum
{
NETWORK,
PRESSURE,
RESULT,
DIFFERENCE,
COUNT
};
static Enum FromSizeT (size_t i);
};
// a region is all bins i such that first <= i < second
typedef vector<pair<size_t, size_t> > BinRegions;
/**
* @brief Type of topological changes
*/
struct T1Type
{
/**
* 2D: POP_VERTEX
* 3D: any of these, COUNT means the type is unknown
*/
enum Enum
{
QUAD_TO_QUAD,
TRI_TO_EDGE,
EDGE_TO_TRI,
POP_EDGE,
POP_VERTEX,
COUNT
};
static Enum FromSizeT (size_t i);
static QColor ToColor (T1Type::Enum);
static const char* ToString (T1Type::Enum type);
static vtkSmartPointer<vtkLookupTable> GetLookupTable ();
private:
static boost::array<const char*, COUNT> NAME;
static boost::array<QColor, COUNT> COLOR;
};
/**
* @brief Data dimension
*/
class Dimension
{
public:
enum Enum
{
D2D = 2,
D3D
};
};
/**
* @brief What is part of context (everything or unselected objects)
*/
class Context
{
public:
enum Enum
{
UNSELECTED,
ALL
};
};
/**
* @brief If the context is invisible or not
*/
class ContextInvisible
{
public:
enum Enum
{
USER_DEFINED,
ALWAYS
};
};
/**
* @brief What do we average (scalar, vector, tensor, t1kde)
*/
struct AverageType
{
enum Enum
{
SCALAR,
T1KDE,
VECTOR,
TENSOR,
COUNT
};
static const char* ToString (AverageType::Enum type);
};
#endif //__ENUMS_H__
// Local Variables:
// mode: c++
// End: