8#ifdef TTK_ENABLE_64BIT_IDS
14#ifndef vtkSetEnumMacro
15#define vtkSetEnumMacro(name, enumType) \
16 virtual void Set##name(enumType _arg) { \
17 vtkDebugMacro(<< this->GetClassName() << " (" << this \
18 << "): setting " #name " to " \
19 << static_cast<std::underlying_type<enumType>::type>(_arg)); \
20 if(this->name != _arg) { \
27#ifndef vtkGetEnumMacro
28#define vtkGetEnumMacro(name, enumType) \
29 virtual enumType Get##name() const { \
30 vtkDebugMacro(<< this->GetClassName() << " (" << this << "): returning " \
32 << static_cast<std::underlying_type<enumType>::type>( \
38#define ttkSetEnumMacro(name, enumType) \
39 virtual void Set##name(int _arg) { \
40 vtkDebugMacro(<< this->GetClassName() << " (" << this \
41 << "): setting " #name " to " << _arg); \
42 if(this->name != static_cast<enumType>(_arg)) { \
43 this->name = static_cast<enumType>(_arg); \
47 vtkSetEnumMacro(name, enumType);
49#ifdef TTK_REDUCE_TEMPLATE_INSTANTIATIONS
52#ifdef vtkTemplateMacro
53#undef vtkTemplateMacro
54#define vtkTemplateMacro(call) \
55 vtkTemplateMacroCase(VTK_DOUBLE, double, call); \
56 vtkTemplateMacroCase(VTK_FLOAT, float, call); \
57 vtkTemplateMacroCase(VTK_INT, int, call); \
58 vtkTemplateMacroCase(VTK_LONG_LONG, long long, call);
62#define ttkVtkTemplateMacroCase( \
63 dataType, triangulationType, triangulationClass, call) \
64 case triangulationType: { \
65 typedef triangulationClass TTK_TT; \
66 switch(dataType) { vtkTemplateMacro((call)); }; \
69#define ttkVtkTemplateMacro(dataType, triangulationType, call) \
70 switch(triangulationType) { \
71 ttkVtkTemplateMacroCase(dataType, ttk::Triangulation::Type::EXPLICIT, \
72 ttk::ExplicitTriangulation, call); \
73 ttkVtkTemplateMacroCase(dataType, ttk::Triangulation::Type::IMPLICIT, \
74 ttk::ImplicitNoPreconditions, call); \
75 ttkVtkTemplateMacroCase(dataType, \
76 ttk::Triangulation::Type::HYBRID_IMPLICIT, \
77 ttk::ImplicitWithPreconditions, call); \
78 ttkVtkTemplateMacroCase(dataType, ttk::Triangulation::Type::PERIODIC, \
79 ttk::PeriodicNoPreconditions, call); \
80 ttkVtkTemplateMacroCase(dataType, \
81 ttk::Triangulation::Type::HYBRID_PERIODIC, \
82 ttk::PeriodicWithPreconditions, call); \
83 ttkVtkTemplateMacroCase(dataType, ttk::Triangulation::Type::COMPACT, \
84 ttk::CompactTriangulation, call); \
87#define ttkVtkTemplate2MacroCase2( \
88 triangulationClass1, triangulationType2, triangulationClass2, call) \
89 case triangulationType2: { \
90 typedef triangulationClass1 TTK_TT1; \
91 typedef triangulationClass2 TTK_TT2; \
95#define ttkVtkTemplate2MacroCase1( \
96 triangulationType1, triangulationClass1, triangulationType2, call) \
97 case triangulationType1: { \
98 switch(triangulationType2) { \
99 ttkVtkTemplate2MacroCase2(triangulationClass1, \
100 ttk::Triangulation::Type::EXPLICIT, \
101 ttk::ExplicitTriangulation, call); \
102 ttkVtkTemplate2MacroCase2(triangulationClass1, \
103 ttk::Triangulation::Type::IMPLICIT, \
104 ttk::ImplicitNoPreconditions, call); \
105 ttkVtkTemplate2MacroCase2(triangulationClass1, \
106 ttk::Triangulation::Type::HYBRID_IMPLICIT, \
107 ttk::ImplicitWithPreconditions, call); \
108 ttkVtkTemplate2MacroCase2(triangulationClass1, \
109 ttk::Triangulation::Type::PERIODIC, \
110 ttk::PeriodicNoPreconditions, call); \
111 ttkVtkTemplate2MacroCase2(triangulationClass1, \
112 ttk::Triangulation::Type::HYBRID_PERIODIC, \
113 ttk::PeriodicWithPreconditions, call); \
114 ttkVtkTemplate2MacroCase2(triangulationClass1, \
115 ttk::Triangulation::Type::COMPACT, \
116 ttk::CompactTriangulation, call); \
120#define ttkVtkTemplate2Macro(triangulationType1, triangulationType2, call) \
121 switch(triangulationType1) { \
122 ttkVtkTemplate2MacroCase1(ttk::Triangulation::Type::EXPLICIT, \
123 ttk::ExplicitTriangulation, triangulationType2, \
125 ttkVtkTemplate2MacroCase1(ttk::Triangulation::Type::IMPLICIT, \
126 ttk::ImplicitNoPreconditions, \
127 triangulationType2, call); \
128 ttkVtkTemplate2MacroCase1(ttk::Triangulation::Type::HYBRID_IMPLICIT, \
129 ttk::ImplicitWithPreconditions, \
130 triangulationType2, call); \
131 ttkVtkTemplate2MacroCase1(ttk::Triangulation::Type::PERIODIC, \
132 ttk::PeriodicNoPreconditions, \
133 triangulationType2, call); \
134 ttkVtkTemplate2MacroCase1(ttk::Triangulation::Type::HYBRID_PERIODIC, \
135 ttk::PeriodicWithPreconditions, \
136 triangulationType2, call); \
137 ttkVtkTemplate2MacroCase1(ttk::Triangulation::Type::COMPACT, \
138 ttk::CompactTriangulation, triangulationType2, \
142#define ttkTemplate2IdMacro(call) \
143 vtkTemplate2MacroCase1(VTK_LONG_LONG, long long, call); \
144 vtkTemplate2MacroCase1(VTK_UNSIGNED_LONG_LONG, unsigned long long, call); \
145 vtkTemplate2MacroCase1(VTK_ID_TYPE, vtkIdType, call); \
146 vtkTemplate2MacroCase1(VTK_LONG, long, call); \
147 vtkTemplate2MacroCase1(VTK_UNSIGNED_LONG, unsigned long, call); \
148 vtkTemplate2MacroCase1(VTK_INT, int, call); \
149 vtkTemplate2MacroCase1(VTK_UNSIGNED_INT, unsigned int, call);
151#ifndef vtkTemplate2MacroCase1
152#define vtkTemplate2MacroCase1(type1N, type1, call) \
153 vtkTemplate2MacroCase2(type1N, type1, VTK_DOUBLE, double, call); \
154 vtkTemplate2MacroCase2(type1N, type1, VTK_FLOAT, float, call); \
155 vtkTemplate2MacroCase2(type1N, type1, VTK_LONG_LONG, long long, call); \
156 vtkTemplate2MacroCase2( \
157 type1N, type1, VTK_UNSIGNED_LONG_LONG, unsigned long long, call); \
158 vtkTemplate2MacroCase2(type1N, type1, VTK_ID_TYPE, vtkIdType, call); \
159 vtkTemplate2MacroCase2(type1N, type1, VTK_LONG, long, call); \
160 vtkTemplate2MacroCase2( \
161 type1N, type1, VTK_UNSIGNED_LONG, unsigned long, call); \
162 vtkTemplate2MacroCase2(type1N, type1, VTK_INT, int, call); \
163 vtkTemplate2MacroCase2(type1N, type1, VTK_UNSIGNED_INT, unsigned int, call); \
164 vtkTemplate2MacroCase2(type1N, type1, VTK_SHORT, short, call); \
165 vtkTemplate2MacroCase2( \
166 type1N, type1, VTK_UNSIGNED_SHORT, unsigned short, call); \
167 vtkTemplate2MacroCase2(type1N, type1, VTK_CHAR, char, call); \
168 vtkTemplate2MacroCase2(type1N, type1, VTK_SIGNED_CHAR, signed char, call); \
169 vtkTemplate2MacroCase2(type1N, type1, VTK_UNSIGNED_CHAR, unsigned char, call)
172#ifndef vtkTemplate2MacroCase2
173#define vtkTemplate2MacroCase2(type1N, type1, type2N, type2, call) \
174 case vtkTemplate2PackMacro(type1N, type2N): { \
175 typedef type1 VTK_T1; \
176 typedef type2 VTK_T2; \
183#define ttkTypeMacroErrorCase(idx, type) \
185 this->printErr("Unsupported " #idx "-th Template Data Type: " \
186 + std::to_string(static_cast<int>(type))); \
189#define ttkTypeMacroCase(enum, type, number, call) \
191 typedef type T##number; \
195#define ttkTypeMacroT(group, call) \
197 ttkTypeMacroCase(ttk::Triangulation::Type::EXPLICIT, \
198 ttk::ExplicitTriangulation, 0, call); \
200 ttk::Triangulation::Type::COMPACT, ttk::CompactTriangulation, 0, call); \
201 ttkTypeMacroCase(ttk::Triangulation::Type::IMPLICIT, \
202 ttk::ImplicitNoPreconditions, 0, call); \
203 ttkTypeMacroCase(ttk::Triangulation::Type::HYBRID_IMPLICIT, \
204 ttk::ImplicitWithPreconditions, 0, call); \
205 ttkTypeMacroCase(ttk::Triangulation::Type::PERIODIC, \
206 ttk::PeriodicNoPreconditions, 0, call); \
207 ttkTypeMacroCase(ttk::Triangulation::Type::HYBRID_PERIODIC, \
208 ttk::PeriodicWithPreconditions, 0, call); \
209 ttkTypeMacroErrorCase(0, group); \
212#define ttkTypeMacroR(group, call) \
214 ttkTypeMacroCase(VTK_FLOAT, float, 0, call); \
215 ttkTypeMacroCase(VTK_DOUBLE, double, 0, call); \
216 ttkTypeMacroErrorCase(0, group); \
219#define ttkTypeMacroI(group, call) \
221 ttkTypeMacroCase(VTK_INT, int, 0, call); \
222 ttkTypeMacroCase(VTK_UNSIGNED_INT, unsigned int, 0, call); \
223 ttkTypeMacroCase(VTK_CHAR, char, 0, call); \
224 ttkTypeMacroCase(VTK_SIGNED_CHAR, signed char, 0, call); \
225 ttkTypeMacroCase(VTK_UNSIGNED_CHAR, unsigned char, 0, call); \
226 ttkTypeMacroCase(VTK_LONG, long, 0, call); \
227 ttkTypeMacroCase(VTK_LONG_LONG, long long, 0, call); \
228 ttkTypeMacroCase(VTK_UNSIGNED_LONG, unsigned long, 0, call); \
229 ttkTypeMacroCase(VTK_UNSIGNED_LONG_LONG, unsigned long long, 0, call); \
230 ttkTypeMacroCase(VTK_ID_TYPE, vtkIdType, 0, call); \
231 ttkTypeMacroErrorCase(0, group); \
234#define ttkTypeMacroA(group, call) \
236 ttkTypeMacroCase(VTK_FLOAT, float, 0, call); \
237 ttkTypeMacroCase(VTK_DOUBLE, double, 0, call); \
238 ttkTypeMacroCase(VTK_INT, int, 0, call); \
239 ttkTypeMacroCase(VTK_UNSIGNED_INT, unsigned int, 0, call); \
240 ttkTypeMacroCase(VTK_CHAR, char, 0, call); \
241 ttkTypeMacroCase(VTK_SIGNED_CHAR, signed char, 0, call); \
242 ttkTypeMacroCase(VTK_UNSIGNED_CHAR, unsigned char, 0, call); \
243 ttkTypeMacroCase(VTK_LONG, long, 0, call); \
244 ttkTypeMacroCase(VTK_LONG_LONG, long long, 0, call); \
245 ttkTypeMacroCase(VTK_UNSIGNED_LONG, unsigned long, 0, call); \
246 ttkTypeMacroCase(VTK_UNSIGNED_LONG_LONG, unsigned long long, 0, call); \
247 ttkTypeMacroCase(VTK_ID_TYPE, vtkIdType, 0, call); \
248 ttkTypeMacroErrorCase(0, group); \
251#ifdef TTK_REDUCE_TEMPLATE_INSTANTIATIONS
255#define ttkTypeMacroI(group, call) \
257 ttkTypeMacroCase(VTK_INT, int, 0, call); \
258 ttkTypeMacroCase(VTK_LONG_LONG, long long, 0, call); \
259 ttkTypeMacroErrorCase(0, group); \
262#define ttkTypeMacroA(group, call) \
264 ttkTypeMacroCase(VTK_FLOAT, float, 0, call); \
265 ttkTypeMacroCase(VTK_DOUBLE, double, 0, call); \
266 ttkTypeMacroCase(VTK_INT, int, 0, call); \
267 ttkTypeMacroCase(VTK_LONG_LONG, long long, 0, call); \
268 ttkTypeMacroErrorCase(0, group); \
272#define ttkTypeMacroAT(group0, group1, call) \
274 ttkTypeMacroCase(ttk::Triangulation::Type::EXPLICIT, \
275 ttk::ExplicitTriangulation, 1, \
276 ttkTypeMacroA(group0, call)); \
277 ttkTypeMacroCase(ttk::Triangulation::Type::COMPACT, \
278 ttk::CompactTriangulation, 1, \
279 ttkTypeMacroA(group0, call)); \
280 ttkTypeMacroCase(ttk::Triangulation::Type::IMPLICIT, \
281 ttk::ImplicitNoPreconditions, 1, \
282 ttkTypeMacroA(group0, call)); \
283 ttkTypeMacroCase(ttk::Triangulation::Type::HYBRID_IMPLICIT, \
284 ttk::ImplicitWithPreconditions, 1, \
285 ttkTypeMacroA(group0, call)); \
286 ttkTypeMacroCase(ttk::Triangulation::Type::PERIODIC, \
287 ttk::PeriodicNoPreconditions, 1, \
288 ttkTypeMacroA(group0, call)); \
289 ttkTypeMacroCase(ttk::Triangulation::Type::HYBRID_PERIODIC, \
290 ttk::PeriodicWithPreconditions, 1, \
291 ttkTypeMacroA(group0, call)); \
292 ttkTypeMacroErrorCase(1, group1); \
295#define ttkTypeMacroRT(group0, group1, call) \
297 ttkTypeMacroCase(ttk::Triangulation::Type::EXPLICIT, \
298 ttk::ExplicitTriangulation, 1, \
299 ttkTypeMacroR(group0, call)); \
300 ttkTypeMacroCase(ttk::Triangulation::Type::COMPACT, \
301 ttk::CompactTriangulation, 1, \
302 ttkTypeMacroR(group0, call)); \
303 ttkTypeMacroCase(ttk::Triangulation::Type::IMPLICIT, \
304 ttk::ImplicitNoPreconditions, 1, \
305 ttkTypeMacroR(group0, call)); \
306 ttkTypeMacroCase(ttk::Triangulation::Type::HYBRID_IMPLICIT, \
307 ttk::ImplicitWithPreconditions, 1, \
308 ttkTypeMacroR(group0, call)); \
309 ttkTypeMacroCase(ttk::Triangulation::Type::PERIODIC, \
310 ttk::PeriodicNoPreconditions, 1, \
311 ttkTypeMacroR(group0, call)); \
312 ttkTypeMacroCase(ttk::Triangulation::Type::HYBRID_PERIODIC, \
313 ttk::PeriodicWithPreconditions, 1, \
314 ttkTypeMacroR(group0, call)); \
315 ttkTypeMacroErrorCase(1, group1); \
318#define ttkTypeMacroIT(group0, group1, call) \
320 ttkTypeMacroCase(ttk::Triangulation::Type::EXPLICIT, \
321 ttk::ExplicitTriangulation, 1, \
322 ttkTypeMacroI(group0, call)); \
323 ttkTypeMacroCase(ttk::Triangulation::Type::COMPACT, \
324 ttk::CompactTriangulation, 1, \
325 ttkTypeMacroI(group0, call)); \
326 ttkTypeMacroCase(ttk::Triangulation::Type::IMPLICIT, \
327 ttk::ImplicitNoPreconditions, 1, \
328 ttkTypeMacroI(group0, call)); \
329 ttkTypeMacroCase(ttk::Triangulation::Type::HYBRID_IMPLICIT, \
330 ttk::ImplicitWithPreconditions, 1, \
331 ttkTypeMacroI(group0, call)); \
332 ttkTypeMacroCase(ttk::Triangulation::Type::PERIODIC, \
333 ttk::PeriodicNoPreconditions, 1, \
334 ttkTypeMacroI(group0, call)); \
335 ttkTypeMacroCase(ttk::Triangulation::Type::HYBRID_PERIODIC, \
336 ttk::PeriodicWithPreconditions, 1, \
337 ttkTypeMacroI(group0, call)); \
338 ttkTypeMacroErrorCase(1, group1); \
341#define ttkTypeMacroAI(group0, group1, call) \
343 ttkTypeMacroCase(VTK_INT, int, 1, ttkTypeMacroA(group0, call)); \
345 VTK_LONG_LONG, long long, 1, ttkTypeMacroA(group0, call)); \
346 ttkTypeMacroCase(VTK_ID_TYPE, vtkIdType, 1, ttkTypeMacroA(group0, call)); \
347 ttkTypeMacroErrorCase(1, group1); \
350#define ttkTypeMacroRR(group0, group1, call) \
352 ttkTypeMacroCase(VTK_FLOAT, float, 1, ttkTypeMacroR(group0, call)); \
353 ttkTypeMacroCase(VTK_DOUBLE, double, 1, ttkTypeMacroR(group0, call)); \
354 ttkTypeMacroErrorCase(1, group1); \
357#define ttkTypeMacroAA(group0, group1, call) \
359 ttkTypeMacroCase(VTK_FLOAT, float, 1, ttkTypeMacroA(group0, call)); \
360 ttkTypeMacroCase(VTK_DOUBLE, double, 1, ttkTypeMacroA(group0, call)); \
361 ttkTypeMacroCase(VTK_INT, int, 1, ttkTypeMacroA(group0, call)); \
363 VTK_UNSIGNED_INT, unsigned int, 1, ttkTypeMacroA(group0, call)); \
364 ttkTypeMacroCase(VTK_CHAR, char, 1, ttkTypeMacroA(group0, call)); \
366 VTK_SIGNED_CHAR, signed char, 1, ttkTypeMacroA(group0, call)); \
368 VTK_UNSIGNED_CHAR, unsigned char, 1, ttkTypeMacroA(group0, call)); \
369 ttkTypeMacroCase(VTK_LONG, long, 1, ttkTypeMacroA(group0, call)); \
371 VTK_LONG_LONG, long long, 1, ttkTypeMacroA(group0, call)); \
373 VTK_UNSIGNED_LONG, unsigned long, 1, ttkTypeMacroA(group0, call)); \
374 ttkTypeMacroCase(VTK_UNSIGNED_LONG_LONG, unsigned long long, 1, \
375 ttkTypeMacroA(group0, call)); \
376 ttkTypeMacroCase(VTK_ID_TYPE, vtkIdType, 1, ttkTypeMacroA(group0, call)); \
377 ttkTypeMacroErrorCase(1, group1); \
380#define ttkTypeMacroAAA(group0, group1, group2, call) \
383 VTK_FLOAT, float, 2, ttkTypeMacroAA(group0, group1, call)); \
385 VTK_DOUBLE, double, 2, ttkTypeMacroAA(group0, group1, call)); \
386 ttkTypeMacroCase(VTK_INT, int, 2, ttkTypeMacroAA(group0, group1, call)); \
387 ttkTypeMacroCase(VTK_UNSIGNED_INT, unsigned int, 2, \
388 ttkTypeMacroAA(group0, group1, call)); \
389 ttkTypeMacroCase(VTK_CHAR, char, 2, ttkTypeMacroAA(group0, group1, call)); \
391 VTK_SIGNED_CHAR, signed char, 2, ttkTypeMacroAA(group0, group1, call)); \
392 ttkTypeMacroCase(VTK_UNSIGNED_CHAR, unsigned char, 2, \
393 ttkTypeMacroAA(group0, group1, call)); \
394 ttkTypeMacroCase(VTK_LONG, long, 2, ttkTypeMacroAA(group0, group1, call)); \
396 VTK_LONG_LONG, long long, 2, ttkTypeMacroAA(group0, group1, call)); \
397 ttkTypeMacroCase(VTK_UNSIGNED_LONG, unsigned long, 2, \
398 ttkTypeMacroAA(group0, group1, call)); \
399 ttkTypeMacroCase(VTK_UNSIGNED_LONG_LONG, unsigned long long, 2, \
400 ttkTypeMacroAA(group0, group1, call)); \
402 VTK_ID_TYPE, vtkIdType, 2, ttkTypeMacroAA(group0, group1, call)); \
403 ttkTypeMacroErrorCase(2, group2); \
406#define ttkTypeMacroAII(group0, group1, group2, call) \
408 ttkTypeMacroCase(VTK_INT, int, 2, ttkTypeMacroAI(group0, group1, call)); \
410 VTK_LONG_LONG, long long, 2, ttkTypeMacroAI(group0, group1, call)); \
412 VTK_ID_TYPE, vtkIdType, 2, ttkTypeMacroAI(group0, group1, call)); \
413 ttkTypeMacroErrorCase(2, group2); \
416#define ttkTypeMacroRRR(group0, group1, group2, call) \
419 VTK_FLOAT, float, 2, ttkTypeMacroRR(group0, group1, call)); \
421 VTK_DOUBLE, double, 2, ttkTypeMacroRR(group0, group1, call)); \
422 ttkTypeMacroErrorCase(2, group2); \
425#define ttkTypeMacroRRI(group0, group1, group2, call) \
427 ttkTypeMacroCase(VTK_INT, int, 2, ttkTypeMacroRR(group0, group1, call)); \
429 VTK_LONG_LONG, long long, 2, ttkTypeMacroRR(group0, group1, call)); \
431 VTK_ID_TYPE, vtkIdType, 2, ttkTypeMacroRR(group0, group1, call)); \
432 ttkTypeMacroErrorCase(2, group2); \
vtkIntArray ttkSimplexIdTypeArray