TTK
Loading...
Searching...
No Matches
ImplicitTriangulation.h
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <array>
14
15// base code includes
17
18namespace ttk {
19
21
22 public:
25
30
31 inline const std::array<SimplexId, 3> &getGridDimensions() const override {
32 return this->dimensions_;
33 }
34
35 int getCellEdgeInternal(const SimplexId &cellId,
36 const int &id,
37 SimplexId &edgeId) const override;
38
39 SimplexId getCellEdgeNumberInternal(const SimplexId &cellId) const override;
40
41 const std::vector<std::vector<SimplexId>> *getCellEdgesInternal() override;
42
44 const SimplexId &cellId,
45 const int &localNeighborId,
46 SimplexId &neighborId) const override;
47
49 const SimplexId &cellId) const override;
50
51 const std::vector<std::vector<SimplexId>> *
53
54 int getCellTriangleInternal(const SimplexId &cellId,
55 const int &id,
56 SimplexId &triangleId) const override;
57
59 const SimplexId & /*cellId*/) const override {
60 // NOTE: the output is always 4 here. let's keep the function in there
61 // in case of further generalization to CW-complexes
62 return 4;
63 }
64
65 const std::vector<std::vector<SimplexId>> *
66 getCellTrianglesInternal() override;
67
69 const SimplexId &cellId,
70 const int &localVertexId,
71 SimplexId &vertexId) const override;
72
74 const SimplexId &cellId) const override;
75
77 return dimensionality_;
78 }
79
81 const SimplexId &edgeId) const override;
82
83 const std::vector<std::vector<SimplexId>> *
85
86 const std::vector<std::vector<SimplexId>> *
88
89 const std::vector<std::vector<SimplexId>> *
90 getEdgeTrianglesInternal() override;
91
92 const std::vector<std::array<SimplexId, 2>> *
94
98
100 return edgeNumber_;
101 }
102
104 return triangleNumber_;
105 }
106
110
111 virtual int getTetrahedronEdge(const SimplexId &tetId,
112 const int &id,
113 SimplexId &edgeId) const = 0;
114
115 int getTetrahedronEdges(std::vector<std::vector<SimplexId>> &edges) const;
116
117 virtual int getTetrahedronTriangle(const SimplexId &tetId,
118 const int &id,
119 SimplexId &triangleId) const = 0;
120
122 std::vector<std::vector<SimplexId>> &triangles) const;
123
124 virtual int getTetrahedronNeighbor(const SimplexId &tetId,
125 const int &localNeighborId,
126 SimplexId &neighborId) const = 0;
127
128 virtual SimplexId
130
131 int getTetrahedronNeighbors(std::vector<std::vector<SimplexId>> &neighbors);
132
133 virtual int getTetrahedronVertex(const SimplexId &tetId,
134 const int &localVertexId,
135 SimplexId &vertexId) const = 0;
136
138 const SimplexId & /*triangleId*/) const override {
139 // NOTE: the output is always 3 here. let's keep the function in there
140 // in case of further generalization to CW-complexes
141 return 3;
142 }
143
144 const std::vector<std::vector<SimplexId>> *
145 getTriangleEdgesInternal() override;
146
148 std::vector<std::vector<SimplexId>> &edges) const;
149
151 const SimplexId &triangleId) const override;
152
153 const std::vector<std::vector<SimplexId>> *
155
156 virtual int getTriangleNeighbor(const SimplexId &triangleId,
157 const int &localNeighborId,
158 SimplexId &neighborId) const = 0;
159
160 virtual SimplexId
161 getTriangleNeighborNumber(const SimplexId &triangleId) const = 0;
162
163 int getTriangleNeighbors(std::vector<std::vector<SimplexId>> &neighbors);
164
165 const std::vector<std::vector<SimplexId>> *
167
168 const std::vector<std::array<SimplexId, 3>> *
170
172 getVertexEdgeNumberInternal(const SimplexId &vertexId) const override;
173
174 const std::vector<std::vector<SimplexId>> *
175 getVertexEdgesInternal() override;
176
178 const SimplexId &vertexId) const override;
179
180 const std::vector<std::vector<SimplexId>> *
182
183 const std::vector<std::vector<SimplexId>> *
185
186 const std::vector<std::vector<SimplexId>> *
188
189 const std::vector<std::vector<SimplexId>> *
191
192 inline bool isEmpty() const override {
193 return !vertexNumber_;
194 }
195
197 const SimplexId &triangleId) const override;
198
199 int setInputGrid(const float &xOrigin,
200 const float &yOrigin,
201 const float &zOrigin,
202 const float &xSpacing,
203 const float &ySpacing,
204 const float &zSpacing,
205 const SimplexId &xDim,
206 const SimplexId &yDim,
207 const SimplexId &zDim) override;
208
211 int preconditionEdgesInternal() override = 0;
214
216 if(dimensionality_ == 3) {
218 } else if(dimensionality_ == 2 && !hasPreconditionedTriangles_) {
220 return this->preconditionTrianglesInternal();
221 }
222 return 0;
223 }
224
230 }
231 return 0;
232 }
233
234 inline int getCellVTKIDInternal(const int &ttkId,
235 int &vtkId) const override {
236#ifndef TTK_ENABLE_KAMIKAZE
237 if(ttkId < 0) {
238 return -1;
239 }
240#endif // TTK_ENABLE_KAMIKAZE
241 const SimplexId nSimplexPerCell{this->getDimensionality() == 3 ? 6 : 2};
242 vtkId = ttkId / nSimplexPerCell;
243 return 0;
244 }
245
246#ifdef TTK_ENABLE_MPI
247
248 protected:
249 int preconditionDistributedCells() override;
250
251 public:
252 void createMetaGrid(const double *const bounds) override;
253 int getCellRankInternal(const SimplexId lcid) const override;
254
255 protected:
256 bool isVertexOnGlobalBoundaryInternal(const SimplexId lvid) const override;
257 bool isEdgeOnGlobalBoundaryInternal(const SimplexId leid) const override;
258 bool
259 isTriangleOnGlobalBoundaryInternal(const SimplexId ltid) const override;
260
261 private:
262 std::array<SimplexId, 3>
263 getVertGlobalCoords(const SimplexId lvid) const override;
264 std::array<SimplexId, 3>
265 getVertLocalCoords(const SimplexId gvid) const override;
266
267#endif // TTK_ENABLE_MPI
268
269 protected:
270 enum class VertexPosition : char {
271 // a--------b
272
273 LEFT_CORNER_1D, // a
274 RIGHT_CORNER_1D, // b
275 CENTER_1D,
276 // total: 3 1D cases
277
278 // a--------b
279 // | |
280 // | |
281 // | |
282 // c--------d
283
284 // 2D corners
289 // 2D edges
290 TOP_EDGE_2D, // ab
291 BOTTOM_EDGE_2D, // cd
292 LEFT_EDGE_2D, // ac
293 RIGHT_EDGE_2D, // bd
294 // 2D central strip
295 CENTER_2D,
296 // total: 9 2D cases
297
298 // e--------f
299 // /| /|
300 // / | / |
301 // a--------b |
302 // | g-----|--h
303 // | / | /
304 // |/ |/
305 // c--------d
306
307 // 3D corners
316 // 3D edges
317 TOP_FRONT_EDGE_3D, // ab
319 LEFT_FRONT_EDGE_3D, // ac
321 TOP_BACK_EDGE_3D, // ef
323 LEFT_BACK_EDGE_3D, // eg
324 RIGHT_BACK_EDGE_3D, // fh
325 TOP_LEFT_EDGE_3D, // ae
326 TOP_RIGHT_EDGE_3D, // bf
329 // 3D faces
330 FRONT_FACE_3D, // abcd
331 BACK_FACE_3D, // efgh
332 TOP_FACE_3D, // abef
333 BOTTOM_FACE_3D, // cdgh
334 LEFT_FACE_3D, // aceg
335 RIGHT_FACE_3D, // bdfh
336 // 3D central part
337 CENTER_3D,
338 // total: 27 3D cases
339 };
340
341 // vertex neighbor shifts
342 std::array<SimplexId, 14> vertexNeighborABCDEFGH_{};
343
344 std::array<SimplexId, 10> vertexNeighborABCD_{};
345 std::array<SimplexId, 10> vertexNeighborEFGH_{};
346 std::array<SimplexId, 10> vertexNeighborAEFB_{};
347 std::array<SimplexId, 10> vertexNeighborGHDC_{};
348 std::array<SimplexId, 10> vertexNeighborAEGC_{};
349 std::array<SimplexId, 10> vertexNeighborBFHD_{};
350
351 std::array<SimplexId, 8> vertexNeighborAB_{};
352 std::array<SimplexId, 8> vertexNeighborBD_{};
353 std::array<SimplexId, 8> vertexNeighborGH_{};
354 std::array<SimplexId, 8> vertexNeighborEG_{};
355 std::array<SimplexId, 8> vertexNeighborCG_{};
356 std::array<SimplexId, 8> vertexNeighborBF_{};
357
358 std::array<SimplexId, 7> vertexNeighborB_{};
359 std::array<SimplexId, 7> vertexNeighborG_{};
360
361 std::array<SimplexId, 6> vertexNeighborEF_{};
362 std::array<SimplexId, 6> vertexNeighborCD_{};
363 std::array<SimplexId, 6> vertexNeighborAC_{};
364 std::array<SimplexId, 6> vertexNeighborAE_{};
365 std::array<SimplexId, 6> vertexNeighborFH_{};
366 std::array<SimplexId, 6> vertexNeighborDH_{};
367
368 std::array<SimplexId, 4> vertexNeighborA_{};
369 std::array<SimplexId, 4> vertexNeighborC_{};
370 std::array<SimplexId, 4> vertexNeighborD_{};
371 std::array<SimplexId, 4> vertexNeighborE_{};
372 std::array<SimplexId, 4> vertexNeighborF_{};
373 std::array<SimplexId, 4> vertexNeighborH_{};
374
375 std::array<SimplexId, 6> vertexNeighbor2dABCD_{};
376 std::array<SimplexId, 4> vertexNeighbor2dAB_{};
377 std::array<SimplexId, 4> vertexNeighbor2dCD_{};
378 std::array<SimplexId, 4> vertexNeighbor2dAC_{};
379 std::array<SimplexId, 4> vertexNeighbor2dBD_{};
380 std::array<SimplexId, 3> vertexNeighbor2dB_{};
381 std::array<SimplexId, 3> vertexNeighbor2dC_{};
382 std::array<SimplexId, 2> vertexNeighbor2dA_{};
383 std::array<SimplexId, 2> vertexNeighbor2dD_{};
384
385 enum class EdgePosition : char {
386 // e--------f
387 // /| /|
388 // / | / |
389 // a--------b |
390 // | g-----|--h
391 // | / | /
392 // |/ |/
393 // c--------d
394
395 // length (ab)
396 L_xnn_3D,
397 L_xn0_3D,
398 L_xnN_3D,
399 L_x0n_3D,
400 L_x00_3D,
401 L_x0N_3D,
402 L_xNn_3D,
403 L_xN0_3D,
404 L_xNN_3D,
405 // height (ac)
406 H_nyn_3D,
407 H_ny0_3D,
408 H_nyN_3D,
409 H_0yn_3D,
410 H_0y0_3D,
411 H_0yN_3D,
412 H_Nyn_3D,
413 H_Ny0_3D,
414 H_NyN_3D,
415 // depth (ae)
416 P_nnz_3D,
417 P_n0z_3D,
418 P_nNz_3D,
419 P_0nz_3D,
420 P_00z_3D,
421 P_0Nz_3D,
422 P_Nnz_3D,
423 P_N0z_3D,
424 P_NNz_3D,
425 // diagonal1 (bc)
426 D1_xyn_3D,
427 D1_xy0_3D,
428 D1_xyN_3D,
429 // diagonal2 (ag)
430 D2_nyz_3D,
431 D2_0yz_3D,
432 D2_Nyz_3D,
433 // diagonal3 (be)
434 D3_xnz_3D,
435 D3_x0z_3D,
436 D3_xNz_3D,
437 // diagonal4 (bg)
438 D4_3D,
439
440 // length (ab)
441 L_xn_2D,
442 L_x0_2D,
443 L_xN_2D,
444 // height (ac)
445 H_ny_2D,
446 H_0y_2D,
447 H_Ny_2D,
448 // diagonal1 (bc)
449 D1_2D,
450
453 CENTER_1D,
454 };
455
456 enum class TrianglePosition : char {
457 // e--------f
458 // /| /|
459 // / | / |
460 // a--------b |
461 // | g-----|--h
462 // | / | /
463 // |/ |/
464 // c--------d
465
466 F_3D, // face (abc, bcd)
467 C_3D, // side (abe, bef)
468 H_3D, // top (acg, aeg)
469 D1_3D, // diagonal1 (bdg, beg)
470 D2_3D, // diagonal2 (abg, bgh)
471 D3_3D, // diagonal3 (bcg, bfg)
472
473 TOP_2D, // abc
474 BOTTOM_2D, // bcd
475 };
476
478
479 SimplexId nbvoxels_[3]; // nombre de voxels par axe
480
481 // Vertex helper //
482 SimplexId vshift_[2]; // VertexShift
483
484 // Edge helper //
485 SimplexId esetdims_[7]; // EdgeSetDimensions
486 SimplexId esetshift_[7]; // EdgeSetShift
487 SimplexId eshift_[14]; // EdgeShift
488
489 // Triangle helper //
490 SimplexId tsetdims_[6]; // TriangleSetDimensions
491 SimplexId tsetshift_[6]; // TriangleSetShift
492 SimplexId tshift_[12]; // TriangleShift
493
494 // Tetrahedron helper //
495 SimplexId tetshift_[2]; // TetrahedronShift
496
497 SimplexId cellNumber_; // number of cells
498 SimplexId vertexNumber_; // number of vertices
499 SimplexId edgeNumber_; // number of edges
500 SimplexId triangleNumber_; // number of triangles
501 SimplexId tetrahedronNumber_; // number of tetrahedra
502
503 // 2d helpers
506
507 // acceleration variables
511
512 // acceleration functions
513 int checkAcceleration();
514 bool isPowerOfTwo(unsigned long long int v, unsigned long long int &r);
515
516 //\cond
517 // 2D //
518 void vertexToPosition2d(const SimplexId vertex,
519 SimplexId p[2]) const override;
520 void
521 edgeToPosition2d(const SimplexId edge, const int k, SimplexId p[2]) const;
522 void triangleToPosition2d(const SimplexId triangle,
523 SimplexId p[2]) const override;
524
525 SimplexId getVertexEdge2dA(const SimplexId p[2], const int id) const;
526 SimplexId getVertexEdge2dB(const SimplexId p[2], const int id) const;
527 SimplexId getVertexEdge2dC(const SimplexId p[2], const int id) const;
528 SimplexId getVertexEdge2dD(const SimplexId p[2], const int id) const;
529 SimplexId getVertexEdge2dAB(const SimplexId p[2], const int id) const;
530 SimplexId getVertexEdge2dCD(const SimplexId p[2], const int id) const;
531 SimplexId getVertexEdge2dAC(const SimplexId p[2], const int id) const;
532 SimplexId getVertexEdge2dBD(const SimplexId p[2], const int id) const;
533 SimplexId getVertexEdge2dABCD(const SimplexId p[2], const int id) const;
534
535 SimplexId getVertexStar2dA(const SimplexId p[2], const int id) const;
536 SimplexId getVertexStar2dB(const SimplexId p[2], const int id) const;
537 SimplexId getVertexStar2dC(const SimplexId p[2], const int id) const;
538 SimplexId getVertexStar2dD(const SimplexId p[2], const int id) const;
539 SimplexId getVertexStar2dAB(const SimplexId p[2], const int id) const;
540 SimplexId getVertexStar2dCD(const SimplexId p[2], const int id) const;
541 SimplexId getVertexStar2dAC(const SimplexId p[2], const int id) const;
542 SimplexId getVertexStar2dBD(const SimplexId p[2], const int id) const;
543 SimplexId getVertexStar2dABCD(const SimplexId p[2], const int id) const;
544
545 SimplexId getVertexLink2dA(const SimplexId p[2], const int id) const;
546 SimplexId getVertexLink2dB(const SimplexId p[2], const int id) const;
547 SimplexId getVertexLink2dC(const SimplexId p[2], const int id) const;
548 SimplexId getVertexLink2dD(const SimplexId p[2], const int id) const;
549 SimplexId getVertexLink2dAB(const SimplexId p[2], const int id) const;
550 SimplexId getVertexLink2dCD(const SimplexId p[2], const int id) const;
551 SimplexId getVertexLink2dAC(const SimplexId p[2], const int id) const;
552 SimplexId getVertexLink2dBD(const SimplexId p[2], const int id) const;
553 SimplexId getVertexLink2dABCD(const SimplexId p[2], const int id) const;
554
555 SimplexId getEdgeTriangleL_x0(const SimplexId p[3], const int id) const;
556 SimplexId getEdgeTriangleL_xn(const SimplexId p[3], const int id) const;
557 SimplexId getEdgeTriangleL_xN(const SimplexId p[3], const int id) const;
558 SimplexId getEdgeTriangleH_0y(const SimplexId p[3], const int id) const;
559 SimplexId getEdgeTriangleH_ny(const SimplexId p[3], const int id) const;
560 SimplexId getEdgeTriangleH_Ny(const SimplexId p[3], const int id) const;
561 SimplexId getEdgeTriangleD1_xy(const SimplexId p[3], const int id) const;
562
563 SimplexId getEdgeLink2dL(const SimplexId p[2], const int id) const;
564 SimplexId getEdgeLink2dH(const SimplexId p[2], const int id) const;
565 SimplexId getEdgeLink2dD1(const SimplexId p[2], const int id) const;
566
567 SimplexId getEdgeStar2dL(const SimplexId p[2], const int id) const;
568 SimplexId getEdgeStar2dH(const SimplexId p[2], const int id) const;
569
570 // 3D //
571 void vertexToPosition(const SimplexId vertex,
572 SimplexId p[3]) const override;
573 void
574 edgeToPosition(const SimplexId edge, const int k, SimplexId p[3]) const;
575 void triangleToPosition(const SimplexId triangle,
576 const int k,
577 SimplexId p[3]) const override;
578 void tetrahedronToPosition(const SimplexId tetrahedron,
579 SimplexId p[3]) const override;
580
581 SimplexId getVertexEdgeA(const SimplexId p[3], const int id) const;
582 SimplexId getVertexEdgeB(const SimplexId p[3], const int id) const;
583 SimplexId getVertexEdgeC(const SimplexId p[3], const int id) const;
584 SimplexId getVertexEdgeD(const SimplexId p[3], const int id) const;
585 SimplexId getVertexEdgeE(const SimplexId p[3], const int id) const;
586 SimplexId getVertexEdgeF(const SimplexId p[3], const int id) const;
587 SimplexId getVertexEdgeG(const SimplexId p[3], const int id) const;
588 SimplexId getVertexEdgeH(const SimplexId p[3], const int id) const;
589 SimplexId getVertexEdgeAB(const SimplexId p[3], const int id) const;
590 SimplexId getVertexEdgeCD(const SimplexId p[3], const int id) const;
591 SimplexId getVertexEdgeEF(const SimplexId p[3], const int id) const;
592 SimplexId getVertexEdgeGH(const SimplexId p[3], const int id) const;
593 SimplexId getVertexEdgeAC(const SimplexId p[3], const int id) const;
594 SimplexId getVertexEdgeBD(const SimplexId p[3], const int id) const;
595 SimplexId getVertexEdgeEG(const SimplexId p[3], const int id) const;
596 SimplexId getVertexEdgeFH(const SimplexId p[3], const int id) const;
597 SimplexId getVertexEdgeAE(const SimplexId p[3], const int id) const;
598 SimplexId getVertexEdgeBF(const SimplexId p[3], const int id) const;
599 SimplexId getVertexEdgeCG(const SimplexId p[3], const int id) const;
600 SimplexId getVertexEdgeDH(const SimplexId p[3], const int id) const;
601 SimplexId getVertexEdgeABDC(const SimplexId p[3], const int id) const;
602 SimplexId getVertexEdgeEFHG(const SimplexId p[3], const int id) const;
603 SimplexId getVertexEdgeAEGC(const SimplexId p[3], const int id) const;
604 SimplexId getVertexEdgeBFHD(const SimplexId p[3], const int id) const;
605 SimplexId getVertexEdgeAEFB(const SimplexId p[3], const int id) const;
606 SimplexId getVertexEdgeGHDC(const SimplexId p[3], const int id) const;
607 SimplexId getVertexEdgeABCDEFGH(const SimplexId p[3], const int id) const;
608
609 SimplexId getVertexTriangleA(const SimplexId p[3], const int id) const;
610 SimplexId getVertexTriangleB(const SimplexId p[3], const int id) const;
611 SimplexId getVertexTriangleC(const SimplexId p[3], const int id) const;
612 SimplexId getVertexTriangleD(const SimplexId p[3], const int id) const;
613 SimplexId getVertexTriangleE(const SimplexId p[3], const int id) const;
614 SimplexId getVertexTriangleF(const SimplexId p[3], const int id) const;
615 SimplexId getVertexTriangleG(const SimplexId p[3], const int id) const;
616 SimplexId getVertexTriangleH(const SimplexId p[3], const int id) const;
617 SimplexId getVertexTriangleAB(const SimplexId p[3], const int id) const;
618 SimplexId getVertexTriangleCD(const SimplexId p[3], const int id) const;
619 SimplexId getVertexTriangleEF(const SimplexId p[3], const int id) const;
620 SimplexId getVertexTriangleGH(const SimplexId p[3], const int id) const;
621 SimplexId getVertexTriangleAC(const SimplexId p[3], const int id) const;
622 SimplexId getVertexTriangleBD(const SimplexId p[3], const int id) const;
623 SimplexId getVertexTriangleEG(const SimplexId p[3], const int id) const;
624 SimplexId getVertexTriangleFH(const SimplexId p[3], const int id) const;
625 SimplexId getVertexTriangleAE(const SimplexId p[3], const int id) const;
626 SimplexId getVertexTriangleBF(const SimplexId p[3], const int id) const;
627 SimplexId getVertexTriangleCG(const SimplexId p[3], const int id) const;
628 SimplexId getVertexTriangleDH(const SimplexId p[3], const int id) const;
629 SimplexId getVertexTriangleABDC(const SimplexId p[3], const int id) const;
630 SimplexId getVertexTriangleEFHG(const SimplexId p[3], const int id) const;
631 SimplexId getVertexTriangleAEGC(const SimplexId p[3], const int id) const;
632 SimplexId getVertexTriangleBFHD(const SimplexId p[3], const int id) const;
633 SimplexId getVertexTriangleAEFB(const SimplexId p[3], const int id) const;
634 SimplexId getVertexTriangleGHDC(const SimplexId p[3], const int id) const;
635 SimplexId getVertexTriangleABCDEFGH(const SimplexId p[3],
636 const int id) const;
637
638 SimplexId getVertexLinkA(const SimplexId p[3], const int id) const;
639 SimplexId getVertexLinkB(const SimplexId p[3], const int id) const;
640 SimplexId getVertexLinkC(const SimplexId p[3], const int id) const;
641 SimplexId getVertexLinkD(const SimplexId p[3], const int id) const;
642 SimplexId getVertexLinkE(const SimplexId p[3], const int id) const;
643 SimplexId getVertexLinkF(const SimplexId p[3], const int id) const;
644 SimplexId getVertexLinkG(const SimplexId p[3], const int id) const;
645 SimplexId getVertexLinkH(const SimplexId p[3], const int id) const;
646 SimplexId getVertexLinkAB(const SimplexId p[3], const int id) const;
647 SimplexId getVertexLinkCD(const SimplexId p[3], const int id) const;
648 SimplexId getVertexLinkEF(const SimplexId p[3], const int id) const;
649 SimplexId getVertexLinkGH(const SimplexId p[3], const int id) const;
650 SimplexId getVertexLinkAC(const SimplexId p[3], const int id) const;
651 SimplexId getVertexLinkBD(const SimplexId p[3], const int id) const;
652 SimplexId getVertexLinkEG(const SimplexId p[3], const int id) const;
653 SimplexId getVertexLinkFH(const SimplexId p[3], const int id) const;
654 SimplexId getVertexLinkAE(const SimplexId p[3], const int id) const;
655 SimplexId getVertexLinkBF(const SimplexId p[3], const int id) const;
656 SimplexId getVertexLinkCG(const SimplexId p[3], const int id) const;
657 SimplexId getVertexLinkDH(const SimplexId p[3], const int id) const;
658 SimplexId getVertexLinkABDC(const SimplexId p[3], const int id) const;
659 SimplexId getVertexLinkEFHG(const SimplexId p[3], const int id) const;
660 SimplexId getVertexLinkAEGC(const SimplexId p[3], const int id) const;
661 SimplexId getVertexLinkBFHD(const SimplexId p[3], const int id) const;
662 SimplexId getVertexLinkAEFB(const SimplexId p[3], const int id) const;
663 SimplexId getVertexLinkGHDC(const SimplexId p[3], const int id) const;
664 SimplexId getVertexLinkABCDEFGH(const SimplexId p[3], const int id) const;
665
666 SimplexId getVertexStarA(const SimplexId p[3], const int id) const;
667 SimplexId getVertexStarB(const SimplexId p[3], const int id) const;
668 SimplexId getVertexStarC(const SimplexId p[3], const int id) const;
669 SimplexId getVertexStarD(const SimplexId p[3], const int id) const;
670 SimplexId getVertexStarE(const SimplexId p[3], const int id) const;
671 SimplexId getVertexStarF(const SimplexId p[3], const int id) const;
672 SimplexId getVertexStarG(const SimplexId p[3], const int id) const;
673 SimplexId getVertexStarH(const SimplexId p[3], const int id) const;
674 SimplexId getVertexStarAB(const SimplexId p[3], const int id) const;
675 SimplexId getVertexStarCD(const SimplexId p[3], const int id) const;
676 SimplexId getVertexStarEF(const SimplexId p[3], const int id) const;
677 SimplexId getVertexStarGH(const SimplexId p[3], const int id) const;
678 SimplexId getVertexStarAC(const SimplexId p[3], const int id) const;
679 SimplexId getVertexStarBD(const SimplexId p[3], const int id) const;
680 SimplexId getVertexStarEG(const SimplexId p[3], const int id) const;
681 SimplexId getVertexStarFH(const SimplexId p[3], const int id) const;
682 SimplexId getVertexStarAE(const SimplexId p[3], const int id) const;
683 SimplexId getVertexStarBF(const SimplexId p[3], const int id) const;
684 SimplexId getVertexStarCG(const SimplexId p[3], const int id) const;
685 SimplexId getVertexStarDH(const SimplexId p[3], const int id) const;
686 SimplexId getVertexStarABDC(const SimplexId p[3], const int id) const;
687 SimplexId getVertexStarEFHG(const SimplexId p[3], const int id) const;
688 SimplexId getVertexStarAEGC(const SimplexId p[3], const int id) const;
689 SimplexId getVertexStarBFHD(const SimplexId p[3], const int id) const;
690 SimplexId getVertexStarAEFB(const SimplexId p[3], const int id) const;
691 SimplexId getVertexStarGHDC(const SimplexId p[3], const int id) const;
692 SimplexId getVertexStarABCDEFGH(const SimplexId p[3], const int id) const;
693
694 SimplexId getEdgeTriangleL_x00(const SimplexId p[3], const int id) const;
695 SimplexId getEdgeTriangleL_x0n(const SimplexId p[3], const int id) const;
696 SimplexId getEdgeTriangleL_x0N(const SimplexId p[3], const int id) const;
697 SimplexId getEdgeTriangleL_xn0(const SimplexId p[3], const int id) const;
698 SimplexId getEdgeTriangleL_xnn(const SimplexId p[3], const int id) const;
699 SimplexId getEdgeTriangleL_xnN(const SimplexId p[3], const int id) const;
700 SimplexId getEdgeTriangleL_xN0(const SimplexId p[3], const int id) const;
701 SimplexId getEdgeTriangleL_xNn(const SimplexId p[3], const int id) const;
702 SimplexId getEdgeTriangleL_xNN(const SimplexId p[3], const int id) const;
703
704 SimplexId getEdgeTriangleH_0y0(const SimplexId p[3], const int id) const;
705 SimplexId getEdgeTriangleH_0yn(const SimplexId p[3], const int id) const;
706 SimplexId getEdgeTriangleH_0yN(const SimplexId p[3], const int id) const;
707 SimplexId getEdgeTriangleH_ny0(const SimplexId p[3], const int id) const;
708 SimplexId getEdgeTriangleH_nyn(const SimplexId p[3], const int id) const;
709 SimplexId getEdgeTriangleH_nyN(const SimplexId p[3], const int id) const;
710 SimplexId getEdgeTriangleH_Ny0(const SimplexId p[3], const int id) const;
711 SimplexId getEdgeTriangleH_Nyn(const SimplexId p[3], const int id) const;
712 SimplexId getEdgeTriangleH_NyN(const SimplexId p[3], const int id) const;
713
714 SimplexId getEdgeTriangleP_00z(const SimplexId p[3], const int id) const;
715 SimplexId getEdgeTriangleP_0nz(const SimplexId p[3], const int id) const;
716 SimplexId getEdgeTriangleP_0Nz(const SimplexId p[3], const int id) const;
717 SimplexId getEdgeTriangleP_n0z(const SimplexId p[3], const int id) const;
718 SimplexId getEdgeTriangleP_nnz(const SimplexId p[3], const int id) const;
719 SimplexId getEdgeTriangleP_nNz(const SimplexId p[3], const int id) const;
720 SimplexId getEdgeTriangleP_N0z(const SimplexId p[3], const int id) const;
721 SimplexId getEdgeTriangleP_Nnz(const SimplexId p[3], const int id) const;
722 SimplexId getEdgeTriangleP_NNz(const SimplexId p[3], const int id) const;
723
724 SimplexId getEdgeTriangleD1_xy0(const SimplexId p[3], const int id) const;
725 SimplexId getEdgeTriangleD1_xyn(const SimplexId p[3], const int id) const;
726 SimplexId getEdgeTriangleD1_xyN(const SimplexId p[3], const int id) const;
727
728 SimplexId getEdgeTriangleD2_0yz(const SimplexId p[3], const int id) const;
729 SimplexId getEdgeTriangleD2_nyz(const SimplexId p[3], const int id) const;
730 SimplexId getEdgeTriangleD2_Nyz(const SimplexId p[3], const int id) const;
731
732 SimplexId getEdgeTriangleD3_x0z(const SimplexId p[3], const int id) const;
733 SimplexId getEdgeTriangleD3_xnz(const SimplexId p[3], const int id) const;
734 SimplexId getEdgeTriangleD3_xNz(const SimplexId p[3], const int id) const;
735
736 SimplexId getEdgeTriangleD4_xyz(const SimplexId p[3], const int id) const;
737
738 SimplexId getEdgeLinkL(const SimplexId p[3], const int id) const;
739 SimplexId getEdgeLinkH(const SimplexId p[3], const int id) const;
740 SimplexId getEdgeLinkP(const SimplexId p[3], const int id) const;
741 SimplexId getEdgeLinkD1(const SimplexId p[3], const int id) const;
742 SimplexId getEdgeLinkD2(const SimplexId p[3], const int id) const;
743 SimplexId getEdgeLinkD3(const SimplexId p[3], const int id) const;
744 SimplexId getEdgeLinkD4(const SimplexId p[3], const int id) const;
745
746 SimplexId getEdgeStarL(const SimplexId p[3], const int id) const;
747 SimplexId getEdgeStarH(const SimplexId p[3], const int id) const;
748 SimplexId getEdgeStarP(const SimplexId p[3], const int id) const;
749 SimplexId getEdgeStarD1(const SimplexId p[3], const int id) const;
750 SimplexId getEdgeStarD2(const SimplexId p[3], const int id) const;
751 SimplexId getEdgeStarD3(const SimplexId p[3], const int id) const;
752
753 SimplexId getTriangleVertexF(const SimplexId p[3], const int id) const;
754 SimplexId getTriangleVertexH(const SimplexId p[3], const int id) const;
755 SimplexId getTriangleVertexC(const SimplexId p[3], const int id) const;
756 SimplexId getTriangleVertexD1(const SimplexId p[3], const int id) const;
757 SimplexId getTriangleVertexD2(const SimplexId p[3], const int id) const;
758 SimplexId getTriangleVertexD3(const SimplexId p[3], const int id) const;
759
760 SimplexId getTriangleEdgeF_0(const SimplexId p[3], const int id) const;
761 SimplexId getTriangleEdgeF_1(const SimplexId p[3], const int id) const;
762 SimplexId getTriangleEdgeH_0(const SimplexId p[3], const int id) const;
763 SimplexId getTriangleEdgeH_1(const SimplexId p[3], const int id) const;
764 SimplexId getTriangleEdgeC_0(const SimplexId p[3], const int id) const;
765 SimplexId getTriangleEdgeC_1(const SimplexId p[3], const int id) const;
766 SimplexId getTriangleEdgeD1_0(const SimplexId p[3], const int id) const;
767 SimplexId getTriangleEdgeD1_1(const SimplexId p[3], const int id) const;
768 SimplexId getTriangleEdgeD2_0(const SimplexId p[3], const int id) const;
769 SimplexId getTriangleEdgeD2_1(const SimplexId p[3], const int id) const;
770 SimplexId getTriangleEdgeD3_0(const SimplexId p[3], const int id) const;
771 SimplexId getTriangleEdgeD3_1(const SimplexId p[3], const int id) const;
772
773 SimplexId getTriangleLinkF(const SimplexId p[3], const int id) const;
774 SimplexId getTriangleLinkH(const SimplexId p[3], const int id) const;
775 SimplexId getTriangleLinkC(const SimplexId p[3], const int id) const;
776 SimplexId getTriangleLinkD1(const SimplexId p[3], const int id) const;
777 SimplexId getTriangleLinkD2(const SimplexId p[3], const int id) const;
778 SimplexId getTriangleLinkD3(const SimplexId p[3], const int id) const;
779
780 SimplexId getTriangleStarF(const SimplexId p[3], const int id) const;
781 SimplexId getTriangleStarH(const SimplexId p[3], const int id) const;
782 SimplexId getTriangleStarC(const SimplexId p[3], const int id) const;
783 SimplexId getTriangleStarD1(const SimplexId p[3], const int id) const;
784 SimplexId getTriangleStarD2(const SimplexId p[3], const int id) const;
785 SimplexId getTriangleStarD3(const SimplexId p[3], const int id) const;
786
787 SimplexId getTetrahedronVertexABCG(const SimplexId p[3],
788 const int id) const;
789 SimplexId getTetrahedronVertexBCDG(const SimplexId p[3],
790 const int id) const;
791 SimplexId getTetrahedronVertexABEG(const SimplexId p[3],
792 const int id) const;
793 SimplexId getTetrahedronVertexBEFG(const SimplexId p[3],
794 const int id) const;
795 SimplexId getTetrahedronVertexBFGH(const SimplexId p[3],
796 const int id) const;
797 SimplexId getTetrahedronVertexBDGH(const SimplexId p[3],
798 const int id) const;
799
800 SimplexId getTetrahedronEdgeABCG(const SimplexId p[3], const int id) const;
801 SimplexId getTetrahedronEdgeBCDG(const SimplexId p[3], const int id) const;
802 SimplexId getTetrahedronEdgeABEG(const SimplexId p[3], const int id) const;
803 SimplexId getTetrahedronEdgeBEFG(const SimplexId p[3], const int id) const;
804 SimplexId getTetrahedronEdgeBFGH(const SimplexId p[3], const int id) const;
805 SimplexId getTetrahedronEdgeBDGH(const SimplexId p[3], const int id) const;
806
807 SimplexId getTetrahedronTriangleABCG(const SimplexId p[3],
808 const int id) const;
809 SimplexId getTetrahedronTriangleBCDG(const SimplexId p[3],
810 const int id) const;
811 SimplexId getTetrahedronTriangleABEG(const SimplexId p[3],
812 const int id) const;
813 SimplexId getTetrahedronTriangleBEFG(const SimplexId p[3],
814 const int id) const;
815 SimplexId getTetrahedronTriangleBFGH(const SimplexId p[3],
816 const int id) const;
817 SimplexId getTetrahedronTriangleBDGH(const SimplexId p[3],
818 const int id) const;
819
820 SimplexId getTetrahedronNeighborABCG(const SimplexId t,
821 const SimplexId p[3],
822 const int id) const;
823 SimplexId getTetrahedronNeighborBCDG(const SimplexId t,
824 const SimplexId p[3],
825 const int id) const;
826 SimplexId getTetrahedronNeighborABEG(const SimplexId t,
827 const SimplexId p[3],
828 const int id) const;
829 SimplexId getTetrahedronNeighborBEFG(const SimplexId t,
830 const SimplexId p[3],
831 const int id) const;
832 SimplexId getTetrahedronNeighborBFGH(const SimplexId t,
833 const SimplexId p[3],
834 const int id) const;
835 SimplexId getTetrahedronNeighborBDGH(const SimplexId t,
836 const SimplexId p[3],
837 const int id) const;
838 //\endcond
839 };
840
841 template <typename Derived>
843 inline Derived &underlying() {
844 return static_cast<Derived &>(*this);
845 }
846 inline Derived const &underlying() const {
847 return static_cast<Derived const &>(*this);
848 }
849
850 public:
852 const SimplexId &vertexId) const final {
853
854#ifndef TTK_ENABLE_KAMIKAZE
855 if(vertexId < 0 or vertexId >= vertexNumber_)
856 return -1;
857#endif // !TTK_ENABLE_KAMIKAZE
858
859 switch(this->underlying().getVertexPosition(vertexId)) {
861 return 14;
868 return 10;
875 return 8;
878 return 7;
886 return 6;
897 return 4;
900 return 3;
904 return 2;
907 return 1;
908 }
909
910 return -1;
911 }
912
914 const SimplexId &vertexId) const override;
915
917 const SimplexId &edgeId) const override;
918
920 const SimplexId &vertexId,
921 const int &localNeighborId,
922 SimplexId &neighborId) const final {
923
924#ifndef TTK_ENABLE_KAMIKAZE
925 if(localNeighborId < 0
926 or localNeighborId >= getVertexNeighborNumber(vertexId))
927 return -1;
928#endif // !TTK_ENABLE_KAMIKAZE
929
930 switch(this->underlying().getVertexPosition(vertexId)) {
932 neighborId
933 = vertexId + this->vertexNeighborABCDEFGH_[localNeighborId];
934 break;
936 neighborId = vertexId + this->vertexNeighborABCD_[localNeighborId];
937 break;
939 neighborId = vertexId + this->vertexNeighborEFGH_[localNeighborId];
940 break;
942 neighborId = vertexId + this->vertexNeighborAEFB_[localNeighborId];
943 break;
945 neighborId = vertexId + this->vertexNeighborGHDC_[localNeighborId];
946 break;
948 neighborId = vertexId + this->vertexNeighborAEGC_[localNeighborId];
949 break;
951 neighborId = vertexId + this->vertexNeighborBFHD_[localNeighborId];
952 break;
954 neighborId = vertexId + this->vertexNeighborAB_[localNeighborId];
955 break;
957 neighborId = vertexId + this->vertexNeighborCD_[localNeighborId];
958 break;
960 neighborId = vertexId + this->vertexNeighborAC_[localNeighborId];
961 break;
963 neighborId = vertexId + this->vertexNeighborBD_[localNeighborId];
964 break;
966 neighborId = vertexId + this->vertexNeighborEF_[localNeighborId];
967 break;
969 neighborId = vertexId + this->vertexNeighborGH_[localNeighborId];
970 break;
972 neighborId = vertexId + this->vertexNeighborEG_[localNeighborId];
973 break;
975 neighborId = vertexId + this->vertexNeighborFH_[localNeighborId];
976 break;
978 neighborId = vertexId + this->vertexNeighborAE_[localNeighborId];
979 break;
981 neighborId = vertexId + this->vertexNeighborBF_[localNeighborId];
982 break;
984 neighborId = vertexId + this->vertexNeighborCG_[localNeighborId];
985 break;
987 neighborId = vertexId + this->vertexNeighborDH_[localNeighborId];
988 break;
990 neighborId = vertexId + this->vertexNeighborA_[localNeighborId];
991 break;
993 neighborId = vertexId + this->vertexNeighborB_[localNeighborId];
994 break;
996 neighborId = vertexId + this->vertexNeighborC_[localNeighborId];
997 break;
999 neighborId = vertexId + this->vertexNeighborD_[localNeighborId];
1000 break;
1002 neighborId = vertexId + this->vertexNeighborE_[localNeighborId];
1003 break;
1005 neighborId = vertexId + this->vertexNeighborF_[localNeighborId];
1006 break;
1008 neighborId = vertexId + this->vertexNeighborG_[localNeighborId];
1009 break;
1011 neighborId = vertexId + this->vertexNeighborH_[localNeighborId];
1012 break;
1014 neighborId = vertexId + this->vertexNeighbor2dABCD_[localNeighborId];
1015 break;
1017 neighborId = vertexId + this->vertexNeighbor2dAB_[localNeighborId];
1018 break;
1020 neighborId = vertexId + this->vertexNeighbor2dCD_[localNeighborId];
1021 break;
1023 neighborId = vertexId + this->vertexNeighbor2dAC_[localNeighborId];
1024 break;
1026 neighborId = vertexId + this->vertexNeighbor2dBD_[localNeighborId];
1027 break;
1029 neighborId = vertexId + this->vertexNeighbor2dA_[localNeighborId];
1030 break;
1032 neighborId = vertexId + this->vertexNeighbor2dB_[localNeighborId];
1033 break;
1035 neighborId = vertexId + this->vertexNeighbor2dC_[localNeighborId];
1036 break;
1038 neighborId = vertexId + this->vertexNeighbor2dD_[localNeighborId];
1039 break;
1041 neighborId = (localNeighborId == 0 ? vertexId + 1 : vertexId - 1);
1042 break;
1044 neighborId = vertexId + 1;
1045 break;
1047 neighborId = vertexId - 1;
1048 break;
1049 default:
1050 neighborId = -1;
1051 break;
1052 }
1053
1054 return 0;
1055 }
1056
1057 int getVertexEdgeInternal(const SimplexId &vertexId,
1058 const int &id,
1059 SimplexId &edgeId) const override;
1060
1061 SimplexId
1062 getVertexTriangleNumberInternal(const SimplexId &vertexId) const override;
1063
1064 int getVertexTriangleInternal(const SimplexId &vertexId,
1065 const int &id,
1066 SimplexId &triangleId) const override;
1067
1069 const SimplexId &vertexId,
1070 const int &localLinkId,
1071 SimplexId &linkId) const override;
1072
1074 const SimplexId &vertexId) const override;
1075
1077 const SimplexId &vertexId,
1078 const int &localStarId,
1079 SimplexId &starId) const override;
1080
1082 float &x,
1083 float &y,
1084 float &z) const override;
1085
1086 int getEdgeVertexInternal(const SimplexId &edgeId,
1087 const int &localVertexId,
1088 SimplexId &vertexId) const override;
1089
1090 SimplexId
1091 getEdgeTriangleNumberInternal(const SimplexId &edgeId) const override;
1092
1093 int getEdgeTriangleInternal(const SimplexId &edgeId,
1094 const int &id,
1095 SimplexId &triangleId) const override;
1096
1097 int
1099 const int &localLinkId,
1100 SimplexId &linkId) const override;
1101
1102 int
1104 const int &localStarId,
1105 SimplexId &starId) const override;
1106
1108 const SimplexId &edgeId) const override;
1109
1110 int getTriangleVertexInternal(const SimplexId &triangleId,
1111 const int &localVertexId,
1112 SimplexId &vertexId) const override;
1113
1114 int getTriangleEdgeInternal(const SimplexId &triangleId,
1115 const int &id,
1116 SimplexId &edgeId) const override;
1117
1119 const SimplexId &triangleId,
1120 const int &localLinkId,
1121 SimplexId &linkId) const override;
1122
1124 const SimplexId &triangleId,
1125 const int &localStarId,
1126 SimplexId &starId) const override;
1127
1129 const SimplexId &triangleId) const override;
1130
1131 int getTriangleNeighbor(const SimplexId &triangleId,
1132 const int &localNeighborId,
1133 SimplexId &neighborId) const override;
1134
1135 SimplexId
1136 getTriangleNeighborNumber(const SimplexId &triangleId) const override;
1137
1138 int getTetrahedronVertex(const SimplexId &tetId,
1139 const int &localVertexId,
1140 SimplexId &vertexId) const override;
1141
1142 int getTetrahedronEdge(const SimplexId &tetId,
1143 const int &id,
1144 SimplexId &edgeId) const override;
1145
1146 int getTetrahedronTriangle(const SimplexId &tetId,
1147 const int &id,
1148 SimplexId &triangleId) const override;
1149
1150 SimplexId
1151 getTetrahedronNeighborNumber(const SimplexId &tetId) const override;
1152
1153 int getTetrahedronNeighbor(const SimplexId &tetId,
1154 const int &localNeighborId,
1155 SimplexId &neighborId) const override;
1156 };
1157} // namespace ttk
1158
1160
1161inline void
1163 SimplexId p[2]) const {
1164 if(isAccelerated_) {
1165 p[0] = vertex & mod_[0];
1166 p[1] = vertex >> div_[0];
1167 } else {
1168 p[0] = vertex % vshift_[0];
1169 p[1] = vertex / vshift_[0];
1170 }
1171}
1172
1173inline void ttk::ImplicitTriangulation::edgeToPosition2d(const SimplexId edge,
1174 const int k,
1175 SimplexId p[2]) const {
1176 const int e = (k) ? edge - esetshift_[k - 1] : edge;
1177 p[0] = e % eshift_[2 * k];
1178 p[1] = e / eshift_[2 * k];
1179}
1180
1181inline void
1183 SimplexId p[2]) const {
1184 p[0] = triangle % tshift_[0];
1185 p[1] = triangle / tshift_[0];
1186}
1187
1188inline ttk::SimplexId
1189 ttk::ImplicitTriangulation::getVertexEdge2dA(const SimplexId p[2],
1190 const int id) const {
1191 // V(a)={b,c}
1192 switch(id) {
1193 case 0:
1194 return p[0] + p[1] * eshift_[0]; // ab-L
1195 case 1:
1196 return esetshift_[0] + p[0] + p[1] * eshift_[2]; // ac-H
1197 }
1198 return -1;
1199}
1200
1201inline ttk::SimplexId
1202 ttk::ImplicitTriangulation::getVertexEdge2dB(const SimplexId p[2],
1203 const int id) const {
1204 // V(b)={a,c,d}
1205 switch(id) {
1206 case 0:
1207 return p[0] + p[1] * eshift_[0] - 1; // ba-L
1208 case 1:
1209 return esetshift_[0] + p[0] + p[1] * eshift_[2]; // bd-H
1210 case 2:
1211 return esetshift_[1] + p[0] + p[1] * eshift_[4] - 1; // bc-D1
1212 }
1213 return -1;
1214}
1215
1216inline ttk::SimplexId
1217 ttk::ImplicitTriangulation::getVertexEdge2dC(const SimplexId p[2],
1218 const int id) const {
1219 // V(c)={a,b,d}
1220 switch(id) {
1221 case 0:
1222 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]; // ca-H
1223 case 1:
1224 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4]; // cb-D1
1225 case 2:
1226 return p[0] + p[1] * eshift_[0]; // cd-L
1227 }
1228 return -1;
1229}
1230
1231inline ttk::SimplexId
1232 ttk::ImplicitTriangulation::getVertexEdge2dD(const SimplexId p[2],
1233 const int id) const {
1234 // V(d)={c,b}
1235 switch(id) {
1236 case 0:
1237 return p[0] + p[1] * eshift_[0] - 1; // dc-L
1238 case 1:
1239 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]; // db-H
1240 }
1241 return -1;
1242}
1243
1244inline ttk::SimplexId
1245 ttk::ImplicitTriangulation::getVertexEdge2dAB(const SimplexId p[2],
1246 const int id) const {
1247 // V(ab)=V(b)::{a,c,d}+V(a)::{b}
1248 switch(id) {
1249 case 0:
1250 return p[0] + p[1] * eshift_[0] - 1; // ba-L
1251 case 1:
1252 return esetshift_[1] + p[0] + p[1] * eshift_[4] - 1; // bc-D1
1253 case 2:
1254 return esetshift_[0] + p[0] + p[1] * eshift_[2]; // bd-H
1255 case 3:
1256 return p[0] + p[1] * eshift_[0]; // ab-L
1257 }
1258 return -1;
1259}
1260
1261inline ttk::SimplexId
1262 ttk::ImplicitTriangulation::getVertexEdge2dCD(const SimplexId p[2],
1263 const int id) const {
1264 // V(cd)=V(c)::{a,b,d}+V(d)::{c}
1265 switch(id) {
1266 case 0:
1267 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]; // ca-H
1268 case 1:
1269 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4]; // cb-D1
1270 case 2:
1271 return p[0] + p[1] * eshift_[0]; // cd-L
1272 case 3:
1273 return p[0] + p[1] * eshift_[0] - 1; // dc-L
1274 }
1275 return -1;
1276}
1277
1278inline ttk::SimplexId
1279 ttk::ImplicitTriangulation::getVertexEdge2dAC(const SimplexId p[2],
1280 const int id) const {
1281 // V(ac)=V(c)::{a,b,d}+V(a)::{c}
1282 switch(id) {
1283 case 0:
1284 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]; // ca-H
1285 case 1:
1286 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4]; // cb-D1
1287 case 2:
1288 return p[0] + p[1] * eshift_[0]; // cd-L
1289 case 3:
1290 return esetshift_[0] + p[0] + p[1] * eshift_[2]; // ac-H
1291 }
1292 return -1;
1293}
1294
1295inline ttk::SimplexId
1296 ttk::ImplicitTriangulation::getVertexEdge2dBD(const SimplexId p[2],
1297 const int id) const {
1298 // V(bd)=V(b)::{c,d}+V(d)::{b,c}
1299 switch(id) {
1300 case 0:
1301 return esetshift_[1] + p[0] + p[1] * eshift_[4] - 1; // bc-D1
1302 case 1:
1303 return esetshift_[0] + p[0] + p[1] * eshift_[2]; // bd-H
1304 case 2:
1305 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]; // db-H
1306 case 3:
1307 return p[0] + p[1] * eshift_[0] - 1; // dc-L
1308 }
1309 return -1;
1310}
1311
1312inline ttk::SimplexId
1313 ttk::ImplicitTriangulation::getVertexEdge2dABCD(const SimplexId p[2],
1314 const int id) const {
1315 // V(abcd)=V(d)::{b,c}+V(c)::{b,d}+V(a)::{c}+V(b)::{c}
1316 switch(id) {
1317 case 0:
1318 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]; // db-H
1319 case 1:
1320 return p[0] + p[1] * eshift_[0] - 1; // dc-L
1321 case 2:
1322 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4]; // cb-D1
1323 case 3:
1324 return p[0] + p[1] * eshift_[0]; // cd-L
1325 case 4:
1326 return esetshift_[0] + p[0] + p[1] * eshift_[2]; // ac-H
1327 case 5:
1328 return esetshift_[1] + p[0] + p[1] * eshift_[4] - 1; // bc-D1
1329 }
1330 return -1;
1331}
1332
1333inline ttk::SimplexId
1334 ttk::ImplicitTriangulation::getVertexStar2dA(const SimplexId p[2],
1335 const int /*id*/) const {
1336 return p[0] * 2 + p[1] * tshift_[0];
1337}
1338
1339inline ttk::SimplexId
1340 ttk::ImplicitTriangulation::getVertexStar2dB(const SimplexId p[2],
1341 const int id) const {
1342 switch(id) {
1343 case 0:
1344 return (p[0] - 1) * 2 + p[1] * tshift_[0];
1345 case 1:
1346 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
1347 }
1348 return -1;
1349}
1350
1351inline ttk::SimplexId
1352 ttk::ImplicitTriangulation::getVertexStar2dC(const SimplexId p[2],
1353 const int id) const {
1354 switch(id) {
1355 case 0:
1356 return p[0] * 2 + (p[1] - 1) * tshift_[0];
1357 case 1:
1358 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
1359 }
1360 return -1;
1361}
1362
1363inline ttk::SimplexId
1364 ttk::ImplicitTriangulation::getVertexStar2dD(const SimplexId p[2],
1365 const int /*id*/) const {
1366 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + 1;
1367}
1368
1369inline ttk::SimplexId
1370 ttk::ImplicitTriangulation::getVertexStar2dAB(const SimplexId p[2],
1371 const int id) const {
1372 switch(id) {
1373 case 0:
1374 return (p[0] - 1) * 2 + p[1] * tshift_[0];
1375 case 1:
1376 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
1377 case 2:
1378 return p[0] * 2 + p[1] * tshift_[0];
1379 }
1380 return -1;
1381}
1382
1383inline ttk::SimplexId
1384 ttk::ImplicitTriangulation::getVertexStar2dCD(const SimplexId p[2],
1385 const int id) const {
1386 switch(id) {
1387 case 0:
1388 return p[0] * 2 + (p[1] - 1) * tshift_[0];
1389 case 1:
1390 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
1391 case 2:
1392 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + 1;
1393 }
1394 return -1;
1395}
1396
1397inline ttk::SimplexId
1398 ttk::ImplicitTriangulation::getVertexStar2dAC(const SimplexId p[2],
1399 const int id) const {
1400 switch(id) {
1401 case 0:
1402 return p[0] * 2 + (p[1] - 1) * tshift_[0];
1403 case 1:
1404 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
1405 case 2:
1406 return p[0] * 2 + p[1] * tshift_[0];
1407 }
1408 return -1;
1409}
1410
1411inline ttk::SimplexId
1412 ttk::ImplicitTriangulation::getVertexStar2dBD(const SimplexId p[2],
1413 const int id) const {
1414 switch(id) {
1415 case 0:
1416 return (p[0] - 1) * 2 + p[1] * tshift_[0];
1417 case 1:
1418 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
1419 case 2:
1420 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + 1;
1421 }
1422 return -1;
1423}
1424
1425inline ttk::SimplexId
1426 ttk::ImplicitTriangulation::getVertexStar2dABCD(const SimplexId p[2],
1427 const int id) const {
1428 switch(id) {
1429 case 0:
1430 return (p[0] - 1) * 2 + p[1] * tshift_[0];
1431 case 1:
1432 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
1433 case 2:
1434 return p[0] * 2 + p[1] * tshift_[0];
1435 case 3:
1436 return p[0] * 2 + (p[1] - 1) * tshift_[0];
1437 case 4:
1438 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
1439 case 5:
1440 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + 1;
1441 }
1442 return -1;
1443}
1444
1445inline ttk::SimplexId
1446 ttk::ImplicitTriangulation::getVertexLink2dA(const SimplexId p[2],
1447 const int /*id*/) const {
1448 return esetshift_[1] + p[0] + p[1] * eshift_[4]; // D1::bc
1449}
1450
1451inline ttk::SimplexId
1452 ttk::ImplicitTriangulation::getVertexLink2dB(const SimplexId p[2],
1453 const int id) const {
1454 switch(id) {
1455 case 0:
1456 return esetshift_[0] + p[0] + p[1] * eshift_[2] - 1; // H::ac
1457 case 1:
1458 return p[0] + (p[1] + 1) * eshift_[0] - 1; // L::ab
1459 }
1460 return -1;
1461}
1462
1463inline ttk::SimplexId
1464 ttk::ImplicitTriangulation::getVertexLink2dC(const SimplexId p[2],
1465 const int id) const {
1466 switch(id) {
1467 case 0:
1468 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2] + 1; // H::ac
1469 case 1:
1470 return p[0] + (p[1] - 1) * eshift_[0]; // L::ab
1471 }
1472 return -1;
1473}
1474
1475inline ttk::SimplexId
1476 ttk::ImplicitTriangulation::getVertexLink2dD(const SimplexId p[2],
1477 const int /*id*/) const {
1478 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4] - 1; // D1::bc
1479}
1480
1481inline ttk::SimplexId
1482 ttk::ImplicitTriangulation::getVertexLink2dAB(const SimplexId p[2],
1483 const int id) const {
1484 switch(id) {
1485 case 0:
1486 return esetshift_[0] + p[0] + p[1] * eshift_[2] - 1; // H::ac
1487 case 1:
1488 return p[0] + (p[1] + 1) * eshift_[0] - 1; // L::ab
1489 case 2:
1490 return esetshift_[1] + p[0] + p[1] * eshift_[4]; // D1::bc
1491 }
1492 return -1;
1493}
1494
1495inline ttk::SimplexId
1496 ttk::ImplicitTriangulation::getVertexLink2dCD(const SimplexId p[2],
1497 const int id) const {
1498 switch(id) {
1499 case 0:
1500 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2] + 1; // H::ac
1501 case 1:
1502 return p[0] + (p[1] - 1) * eshift_[0]; // L::ab
1503 case 2:
1504 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4] - 1; // D1::bc
1505 }
1506 return -1;
1507}
1508
1509inline ttk::SimplexId
1510 ttk::ImplicitTriangulation::getVertexLink2dAC(const SimplexId p[2],
1511 const int id) const {
1512 switch(id) {
1513 case 0:
1514 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2] + 1; // H::ac
1515 case 1:
1516 return p[0] + (p[1] - 1) * eshift_[0]; // L::ab
1517 case 2:
1518 return esetshift_[1] + p[0] + p[1] * eshift_[4]; // D1::bc
1519 }
1520 return -1;
1521}
1522
1523inline ttk::SimplexId
1524 ttk::ImplicitTriangulation::getVertexLink2dBD(const SimplexId p[2],
1525 const int id) const {
1526 switch(id) {
1527 case 0:
1528 return esetshift_[0] + p[0] + p[1] * eshift_[2] - 1; // H::ac
1529 case 1:
1530 return p[0] + (p[1] + 1) * eshift_[0] - 1; // L::ab
1531 case 2:
1532 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4] - 1; // D1::bc
1533 }
1534 return -1;
1535}
1536
1537inline ttk::SimplexId
1538 ttk::ImplicitTriangulation::getVertexLink2dABCD(const SimplexId p[2],
1539 const int id) const {
1540 switch(id) {
1541 case 0:
1542 return esetshift_[0] + p[0] + p[1] * eshift_[2] - 1; // H::ac
1543 case 1:
1544 return p[0] + (p[1] + 1) * eshift_[0] - 1; // L::ab
1545 case 2:
1546 return esetshift_[1] + p[0] + p[1] * eshift_[4]; // D1::bc
1547 case 3:
1548 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2] + 1; // H::ac
1549 case 4:
1550 return p[0] + (p[1] - 1) * eshift_[0]; // L::ab
1551 case 5:
1552 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4] - 1; // D1::bc
1553 }
1554 return -1;
1555}
1556
1557inline ttk::SimplexId
1558 ttk::ImplicitTriangulation::getEdgeTriangleL_x0(const SimplexId p[3],
1559 const int id) const {
1560 switch(id) {
1561 case 0:
1562 return p[Di_] * 2;
1563 }
1564 return -1;
1565}
1566
1567inline ttk::SimplexId
1568 ttk::ImplicitTriangulation::getEdgeTriangleL_xn(const SimplexId p[3],
1569 const int id) const {
1570 switch(id) {
1571 case 0:
1572 return p[Di_] * 2 + p[Dj_] * tshift_[0];
1573 case 1:
1574 return p[Di_] * 2 + (p[Dj_] - 1) * tshift_[0] + 1;
1575 }
1576 return -1;
1577}
1578
1579inline ttk::SimplexId
1580 ttk::ImplicitTriangulation::getEdgeTriangleL_xN(const SimplexId p[3],
1581 const int id) const {
1582 switch(id) {
1583 case 0:
1584 return p[Di_] * 2 + (p[Dj_] - 1) * tshift_[0] + 1;
1585 }
1586 return -1;
1587}
1588
1589inline ttk::SimplexId
1590 ttk::ImplicitTriangulation::getEdgeTriangleH_0y(const SimplexId p[3],
1591 const int id) const {
1592 switch(id) {
1593 case 0:
1594 return p[Dj_] * tshift_[0];
1595 }
1596 return -1;
1597}
1598
1599inline ttk::SimplexId
1600 ttk::ImplicitTriangulation::getEdgeTriangleH_ny(const SimplexId p[3],
1601 const int id) const {
1602 switch(id) {
1603 case 0:
1604 return p[Di_] * 2 + p[Dj_] * tshift_[0];
1605 case 1:
1606 return (p[Di_] - 1) * 2 + p[Dj_] * tshift_[0] + 1;
1607 }
1608 return -1;
1609}
1610
1611inline ttk::SimplexId
1612 ttk::ImplicitTriangulation::getEdgeTriangleH_Ny(const SimplexId p[3],
1613 const int id) const {
1614 switch(id) {
1615 case 0:
1616 return (p[Di_] - 1) * 2 + p[Dj_] * tshift_[0] + 1;
1617 }
1618 return -1;
1619}
1620
1621inline ttk::SimplexId
1622 ttk::ImplicitTriangulation::getEdgeTriangleD1_xy(const SimplexId p[3],
1623 const int id) const {
1624 switch(id) {
1625 case 0:
1626 return p[Di_] * 2 + p[Dj_] * tshift_[0];
1627 case 1:
1628 return p[Di_] * 2 + p[Dj_] * tshift_[0] + 1;
1629 }
1630 return -1;
1631}
1632
1633inline ttk::SimplexId
1634 ttk::ImplicitTriangulation::getEdgeLink2dL(const SimplexId p[2],
1635 const int id) const {
1636 if(p[1] > 0 and p[1] < nbvoxels_[Dj_]) {
1637 switch(id) {
1638 case 0:
1639 return p[0] + (p[1] + 1) * vshift_[0];
1640 case 1:
1641 return p[0] + (p[1] - 1) * vshift_[0] + 1;
1642 }
1643 } else if(p[1] == 0)
1644 return p[0] + vshift_[0];
1645 else
1646 return p[0] + (p[1] - 1) * vshift_[0] + 1;
1647 return -1;
1648}
1649
1650inline ttk::SimplexId
1651 ttk::ImplicitTriangulation::getEdgeLink2dH(const SimplexId p[2],
1652 const int id) const {
1653 if(p[0] > 0 and p[0] < nbvoxels_[Di_]) {
1654 switch(id) {
1655 case 0:
1656 return p[0] + p[1] * vshift_[0] + 1;
1657 case 1:
1658 return p[0] + (p[1] + 1) * vshift_[0] - 1;
1659 }
1660 } else if(p[0] == 0)
1661 return p[1] * vshift_[0] + 1;
1662 else
1663 return p[0] + (p[1] + 1) * vshift_[0] - 1;
1664 return -1;
1665}
1666
1667inline ttk::SimplexId
1668 ttk::ImplicitTriangulation::getEdgeLink2dD1(const SimplexId p[2],
1669 const int id) const {
1670 switch(id) {
1671 case 0:
1672 return p[0] + p[1] * vshift_[0];
1673 case 1:
1674 return p[0] + (p[1] + 1) * vshift_[0] + 1;
1675 }
1676 return -1;
1677}
1678
1679inline ttk::SimplexId
1680 ttk::ImplicitTriangulation::getEdgeStar2dL(const SimplexId p[2],
1681 const int id) const {
1682 if(p[1] > 0 and p[1] < nbvoxels_[Dj_]) {
1683 if(id == 0)
1684 return p[0] * 2 + p[1] * tshift_[0];
1685 else
1686 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
1687 } else if(p[1] == 0)
1688 return p[0] * 2 + p[1] * tshift_[0];
1689 else
1690 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
1691}
1692
1693inline ttk::SimplexId
1694 ttk::ImplicitTriangulation::getEdgeStar2dH(const SimplexId p[2],
1695 const int id) const {
1696 if(p[0] > 0 and p[0] < nbvoxels_[Di_]) {
1697 if(id == 0)
1698 return p[0] * 2 + p[1] * tshift_[0];
1699 else
1700 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
1701 } else if(p[0] == 0)
1702 return p[0] * 2 + p[1] * tshift_[0];
1703 else
1704 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
1705}
1706
1708 SimplexId p[3]) const {
1709 if(isAccelerated_) {
1710 p[0] = vertex & mod_[0];
1711 p[1] = (vertex & mod_[1]) >> div_[0];
1712 p[2] = vertex >> div_[1];
1713 } else {
1714 p[0] = vertex % vshift_[0];
1715 p[1] = (vertex % vshift_[1]) / vshift_[0];
1716 p[2] = vertex / vshift_[1];
1717 }
1718}
1719
1720inline void ttk::ImplicitTriangulation::edgeToPosition(const SimplexId edge,
1721 const int k,
1722 SimplexId p[3]) const {
1723 const int e = (k) ? edge - esetshift_[k - 1] : edge;
1724 p[0] = e % eshift_[2 * k];
1725 p[1] = (e % eshift_[2 * k + 1]) / eshift_[2 * k];
1726 p[2] = e / eshift_[2 * k + 1];
1727}
1728
1730 const SimplexId triangle, const int k, SimplexId p[3]) const {
1731 const SimplexId t = (k) ? triangle - tsetshift_[k - 1] : triangle;
1732 p[0] = t % tshift_[2 * k];
1733 p[1] = (t % tshift_[2 * k + 1]) / tshift_[2 * k];
1734 p[2] = t / tshift_[2 * k + 1];
1735}
1736
1737inline void
1739 SimplexId p[3]) const {
1740 p[0] = (tetrahedron % tetshift_[0]) / 6;
1741 p[1] = (tetrahedron % tetshift_[1]) / tetshift_[0];
1742 p[2] = tetrahedron / tetshift_[1];
1743}
1744
1745inline ttk::SimplexId
1746 ttk::ImplicitTriangulation::getVertexEdgeA(const SimplexId p[3],
1747 const int id) const {
1748 // V(a)={b,c,e,g}
1749 switch(id) {
1750 case 0:
1751 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ab-L
1752 case 1:
1753 return esetshift_[0] + p[0] + p[1] * eshift_[2]
1754 + p[2] * eshift_[3]; // ac-H
1755 case 2:
1756 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1757 + p[2] * eshift_[5]; // ae-P
1758 case 3:
1759 return esetshift_[3] + p[0] + p[1] * eshift_[8]
1760 + p[2] * eshift_[9]; // ag-D2
1761 }
1762 return -1;
1763}
1764
1765inline ttk::SimplexId
1766 ttk::ImplicitTriangulation::getVertexEdgeB(const SimplexId p[3],
1767 const int id) const {
1768 // V(b)={a,c,d,e,f,g,h}
1769 switch(id) {
1770 case 0:
1771 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // ba-L
1772 case 1:
1773 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
1774 - 1; // bc-D1
1775 case 2:
1776 return esetshift_[0] + p[0] + p[1] * eshift_[2]
1777 + p[2] * eshift_[3]; // bd-H
1778 case 3:
1779 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
1780 - 1; // be-D3
1781 case 4:
1782 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1783 + p[2] * eshift_[5]; // bf-P
1784 case 5:
1785 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13]
1786 - 1; // bg-D4
1787 case 6:
1788 return esetshift_[3] + p[0] + p[1] * eshift_[8]
1789 + p[2] * eshift_[9]; // bh-D2
1790 }
1791 return -1;
1792}
1793
1794inline ttk::SimplexId
1795 ttk::ImplicitTriangulation::getVertexEdgeC(const SimplexId p[3],
1796 const int id) const {
1797 // V(c)={a,b,d,g}
1798 switch(id) {
1799 case 0:
1800 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
1801 + p[2] * eshift_[3]; // ca-H
1802 case 1:
1803 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
1804 + p[2] * eshift_[7]; // cb-D1
1805 case 2:
1806 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // cd-L
1807 case 3:
1808 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1809 + p[2] * eshift_[5]; // cg-P
1810 }
1811 return -1;
1812}
1813
1814inline ttk::SimplexId
1815 ttk::ImplicitTriangulation::getVertexEdgeD(const SimplexId p[3],
1816 const int id) const {
1817 // V(d)={b,c,g,h}
1818 switch(id) {
1819 case 0:
1820 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
1821 + p[2] * eshift_[3]; // db-H
1822 case 1:
1823 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // dc-L
1824 case 2:
1825 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
1826 - 1; // dg-D3
1827 case 3:
1828 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1829 + p[2] * eshift_[5]; // dh-P
1830 }
1831 return -1;
1832}
1833
1834inline ttk::SimplexId
1835 ttk::ImplicitTriangulation::getVertexEdgeE(const SimplexId p[3],
1836 const int id) const {
1837 // V(e)={a,b,f,g}
1838 switch(id) {
1839 case 0:
1840 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1841 + (p[2] - 1) * eshift_[5]; // ea-P
1842 case 1:
1843 return esetshift_[4] + p[0] + p[1] * eshift_[10]
1844 + (p[2] - 1) * eshift_[11]; // eb-D3
1845 case 2:
1846 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ef-L
1847 case 3:
1848 return esetshift_[0] + p[0] + p[1] * eshift_[2]
1849 + p[2] * eshift_[3]; // eg-H
1850 }
1851 return -1;
1852}
1853
1854inline ttk::SimplexId
1855 ttk::ImplicitTriangulation::getVertexEdgeF(const SimplexId p[3],
1856 const int id) const {
1857 // V(f)={b,e,g,h}
1858 switch(id) {
1859 case 0:
1860 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1861 + (p[2] - 1) * eshift_[5]; // fb-P
1862 case 1:
1863 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // fe-L
1864 case 2:
1865 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
1866 - 1; // fg-D1
1867 case 3:
1868 return esetshift_[0] + p[0] + p[1] * eshift_[2]
1869 + p[2] * eshift_[3]; // fh-H
1870 }
1871 return -1;
1872}
1873
1874inline ttk::SimplexId
1875 ttk::ImplicitTriangulation::getVertexEdgeG(const SimplexId p[3],
1876 const int id) const {
1877 // V(g)={a,b,c,d,e,f,h}
1878 switch(id) {
1879 case 0:
1880 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
1881 + (p[2] - 1) * eshift_[9]; // ga-D2
1882 case 1:
1883 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
1884 + (p[2] - 1) * eshift_[13]; // gb-D4
1885 case 2:
1886 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1887 + (p[2] - 1) * eshift_[5]; // gc-P
1888 case 3:
1889 return esetshift_[4] + p[0] + p[1] * eshift_[10]
1890 + (p[2] - 1) * eshift_[11]; // gd-D3
1891 case 4:
1892 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
1893 + p[2] * eshift_[3]; // ge-H
1894 case 5:
1895 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
1896 + p[2] * eshift_[7]; // gf-D1
1897 case 6:
1898 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // gh-L
1899 }
1900 return -1;
1901}
1902
1903inline ttk::SimplexId
1904 ttk::ImplicitTriangulation::getVertexEdgeH(const SimplexId p[3],
1905 const int id) const {
1906 // V(h)={b,d,f,g}
1907 switch(id) {
1908 case 0:
1909 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
1910 + (p[2] - 1) * eshift_[9]; // hb-D2
1911 case 1:
1912 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1913 + (p[2] - 1) * eshift_[5]; // hd-P
1914 case 2:
1915 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
1916 + p[2] * eshift_[3]; // hf-H
1917 case 3:
1918 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // hg-L
1919 }
1920 return -1;
1921}
1922
1923inline ttk::SimplexId
1924 ttk::ImplicitTriangulation::getVertexEdgeAB(const SimplexId p[3],
1925 const int id) const {
1926 // V(ab)=V(b)+V(a)::{b}
1927 switch(id) {
1928 case 0:
1929 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // ba-L
1930 case 1:
1931 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
1932 - 1; // bc-D1
1933 case 2:
1934 return esetshift_[0] + p[0] + p[1] * eshift_[2]
1935 + p[2] * eshift_[3]; // bd-H
1936 case 3:
1937 return esetshift_[4] + p[0] + p[1] * eshift_[11] + p[2] * eshift_[12]
1938 - 1; // be-D3
1939 case 4:
1940 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1941 + p[2] * eshift_[5]; // bf-P
1942 case 5:
1943 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13]
1944 - 1; // bg-D4
1945 case 6:
1946 return esetshift_[3] + p[0] + p[1] * eshift_[8]
1947 + p[2] * eshift_[9]; // bh-D2
1948 case 7:
1949 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ab-L
1950 }
1951 return -1;
1952}
1953
1954inline ttk::SimplexId
1955 ttk::ImplicitTriangulation::getVertexEdgeCD(const SimplexId p[3],
1956 const int id) const {
1957 // V(cd)=V(d)+V(c)::{b,d}
1958 switch(id) {
1959 case 0:
1960 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
1961 + p[2] * eshift_[3]; // db-H
1962 case 1:
1963 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // dc-L
1964 case 2:
1965 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
1966 - 1; // dg-D3
1967 case 3:
1968 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1969 + p[2] * eshift_[5]; // dh-P
1970 case 4:
1971 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
1972 + p[2] * eshift_[7]; // cb-D1
1973 case 5:
1974 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // cd-L
1975 }
1976 return -1;
1977}
1978
1979inline ttk::SimplexId
1980 ttk::ImplicitTriangulation::getVertexEdgeEF(const SimplexId p[3],
1981 const int id) const {
1982 // V(fe)=V(f)+V(e)::{b,f}
1983 switch(id) {
1984 case 0:
1985 return esetshift_[1] + p[0] + p[1] * eshift_[4]
1986 + (p[2] - 1) * eshift_[5]; // fb-P
1987 case 1:
1988 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // fe-L
1989 case 2:
1990 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
1991 - 1; // fg-D1
1992 case 3:
1993 return esetshift_[0] + p[0] + p[1] * eshift_[2]
1994 + p[2] * eshift_[3]; // fh-H
1995 case 4:
1996 return esetshift_[4] + p[0] + p[1] * eshift_[10]
1997 + (p[2] - 1) * eshift_[11]; // eb-D3
1998 case 5:
1999 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ef-L
2000 }
2001 return -1;
2002}
2003
2004inline ttk::SimplexId
2005 ttk::ImplicitTriangulation::getVertexEdgeGH(const SimplexId p[3],
2006 const int id) const {
2007 // V(gh)=V(g)+V(h)::{g}
2008 switch(id) {
2009 case 0:
2010 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2011 + (p[2] - 1) * eshift_[9]; // ga-D2
2012 case 1:
2013 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
2014 + (p[2] - 1) * eshift_[13]; // gb-D4
2015 case 2:
2016 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2017 + (p[2] - 1) * eshift_[5]; // gc-P
2018 case 3:
2019 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2020 + (p[2] - 1) * eshift_[11]; // gd-D3
2021 case 4:
2022 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2023 + p[2] * eshift_[3]; // ge-H
2024 case 5:
2025 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2026 + p[2] * eshift_[7]; // gf-D1
2027 case 6:
2028 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // gh-L
2029 case 7:
2030 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // hg-L␇
2031 }
2032 return -1;
2033}
2034
2035inline ttk::SimplexId
2036 ttk::ImplicitTriangulation::getVertexEdgeAC(const SimplexId p[3],
2037 const int id) const {
2038 // V(ac)=V(c)+V(a)::{c,g}
2039 switch(id) {
2040 case 0:
2041 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2042 + p[2] * eshift_[3]; // ca-H
2043 case 1:
2044 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2045 + p[2] * eshift_[7]; // cb-D1
2046 case 2:
2047 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // cd-L
2048 case 3:
2049 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2050 + p[2] * eshift_[5]; // cg-P
2051 case 4:
2052 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2053 + p[2] * eshift_[3]; // ac-H
2054 case 5:
2055 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2056 + p[2] * eshift_[9]; // ag-D2
2057 }
2058 return -1;
2059}
2060
2061inline ttk::SimplexId
2062 ttk::ImplicitTriangulation::getVertexEdgeBD(const SimplexId p[3],
2063 const int id) const {
2064 // V(bd)=V(b)+V(d)::{b}
2065 switch(id) {
2066 case 0:
2067 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // ba-L
2068 case 1:
2069 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
2070 - 1; // bc-D1
2071 case 2:
2072 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2073 + p[2] * eshift_[3]; // bd-H
2074 case 3:
2075 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
2076 - 1; // be-D3
2077 case 4:
2078 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2079 + p[2] * eshift_[5]; // bf-P
2080 case 5:
2081 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13]
2082 - 1; // bg-D4
2083 case 6:
2084 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2085 + p[2] * eshift_[9]; // bh-D2
2086 case 7:
2087 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2088 + p[2] * eshift_[3]; // db-H
2089 }
2090 return -1;
2091}
2092
2093inline ttk::SimplexId
2094 ttk::ImplicitTriangulation::getVertexEdgeEG(const SimplexId p[3],
2095 const int id) const {
2096 // V(eg)=V(g)+V(e)::{g}
2097 switch(id) {
2098 case 0:
2099 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2100 + (p[2] - 1) * eshift_[9]; // ga-D2
2101 case 1:
2102 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
2103 + (p[2] - 1) * eshift_[13]; // gb-D4
2104 case 2:
2105 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2106 + (p[2] - 1) * eshift_[5]; // gc-P
2107 case 3:
2108 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2109 + (p[2] - 1) * eshift_[11]; // gd-D3
2110 case 4:
2111 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2112 + p[2] * eshift_[3]; // ge-H
2113 case 5:
2114 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2115 + p[2] * eshift_[7]; // gf-D1
2116 case 6:
2117 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // gh-L
2118 case 7:
2119 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2120 + p[2] * eshift_[3]; // eg-H
2121 }
2122 return -1;
2123}
2124
2125inline ttk::SimplexId
2126 ttk::ImplicitTriangulation::getVertexEdgeFH(const SimplexId p[3],
2127 const int id) const {
2128 // V(fh)=V(f)+V(h)::{b,f}
2129 switch(id) {
2130 case 0:
2131 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2132 + (p[2] - 1) * eshift_[5]; // fb-P
2133 case 1:
2134 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // fe-L
2135 case 2:
2136 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
2137 - 1; // fg-D1
2138 case 3:
2139 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2140 + p[2] * eshift_[3]; // fh-H
2141 case 4:
2142 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2143 + (p[2] - 1) * eshift_[9]; // hb-D2
2144 case 5:
2145 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2146 + p[2] * eshift_[3]; // hf-H
2147 }
2148 return -1;
2149}
2150
2151inline ttk::SimplexId
2152 ttk::ImplicitTriangulation::getVertexEdgeAE(const SimplexId p[3],
2153 const int id) const {
2154 // V(ae)=V(a)+V(e)::{a,b}
2155 switch(id) {
2156 case 0:
2157 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ab-L
2158 case 1:
2159 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2160 + p[2] * eshift_[3]; // ac-H
2161 case 2:
2162 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2163 + p[2] * eshift_[5]; // ae-P
2164 case 3:
2165 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2166 + p[2] * eshift_[9]; // ag-D2
2167 case 4:
2168 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2169 + (p[2] - 1) * eshift_[5]; // ea-P
2170 case 5:
2171 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2172 + (p[2] - 1) * eshift_[11]; // eb-D3
2173 }
2174 return -1;
2175}
2176
2177inline ttk::SimplexId
2178 ttk::ImplicitTriangulation::getVertexEdgeBF(const SimplexId p[3],
2179 const int id) const {
2180 // V(bf)=V(b)+V(f)::{b}
2181 switch(id) {
2182 case 0:
2183 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // ba-L
2184 case 1:
2185 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
2186 - 1; // bc-D1
2187 case 2:
2188 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2189 + p[2] * eshift_[3]; // bd-H
2190 case 3:
2191 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
2192 - 1; // be-D3
2193 case 4:
2194 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2195 + p[2] * eshift_[5]; // bf-P
2196 case 5:
2197 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13]
2198 - 1; // bg-D4
2199 case 6:
2200 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2201 + p[2] * eshift_[9]; // bh-D2
2202 case 7:
2203 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2204 + (p[2] - 1) * eshift_[5]; // fb-P
2205 }
2206 return -1;
2207}
2208
2209inline ttk::SimplexId
2210 ttk::ImplicitTriangulation::getVertexEdgeCG(const SimplexId p[3],
2211 const int id) const {
2212 // V(cg)=V(g)+V(c)::{g}
2213 switch(id) {
2214 case 0:
2215 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2216 + (p[2] - 1) * eshift_[9]; // ga-D2
2217 case 1:
2218 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
2219 + (p[2] - 1) * eshift_[13]; // gb-D4
2220 case 2:
2221 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2222 + (p[2] - 1) * eshift_[5]; // gc-P
2223 case 3:
2224 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2225 + (p[2] - 1) * eshift_[11]; // gd-D3
2226 case 4:
2227 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2228 + p[2] * eshift_[3]; // ge-H
2229 case 5:
2230 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2231 + p[2] * eshift_[7]; // gf-D1
2232 case 6:
2233 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // gh-L
2234 case 7:
2235 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2236 + p[2] * eshift_[5]; // cg-P
2237 }
2238 return -1;
2239}
2240
2241inline ttk::SimplexId
2242 ttk::ImplicitTriangulation::getVertexEdgeDH(const SimplexId p[3],
2243 const int id) const {
2244 // V(dh)=V(d)+V(h)::{b,d}
2245 switch(id) {
2246 case 0:
2247 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2248 + p[2] * eshift_[3]; // db-H
2249 case 1:
2250 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // dc-L
2251 case 2:
2252 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
2253 - 1; // dg-D3
2254 case 3:
2255 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2256 + p[2] * eshift_[5]; // dh-P
2257 case 4:
2258 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2259 + (p[2] - 1) * eshift_[9]; // hb-D2
2260 case 5:
2261 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2262 + (p[2] - 1) * eshift_[5]; // hd-P
2263 }
2264 return -1;
2265}
2266
2267inline ttk::SimplexId
2268 ttk::ImplicitTriangulation::getVertexEdgeABDC(const SimplexId p[3],
2269 const int id) const {
2270 // V(abdc)=V(b)+V(d)::{b}+V(c)::{b}+V(a)::{b}
2271 switch(id) {
2272 case 0:
2273 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // ba-L
2274 case 1:
2275 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
2276 - 1; // bc-D1
2277 case 2:
2278 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2279 + p[2] * eshift_[3]; // bd-H
2280 case 3:
2281 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
2282 - 1; // be-D3
2283 case 4:
2284 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2285 + p[2] * eshift_[5]; // bf-P
2286 case 5:
2287 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13]
2288 - 1; // bg-D4
2289 case 6:
2290 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2291 + p[2] * eshift_[9]; // bh-D2
2292 case 7:
2293 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2294 + p[2] * eshift_[3]; // db-H
2295 case 8:
2296 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2297 + p[2] * eshift_[7]; // cb-D1
2298 case 9:
2299 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ab-L
2300 }
2301 return -1;
2302}
2303
2304inline ttk::SimplexId
2305 ttk::ImplicitTriangulation::getVertexEdgeEFHG(const SimplexId p[3],
2306 const int id) const {
2307 // V(efhg)=V(g)+V(h)::{g}+V(f)::{g,h}
2308 switch(id) {
2309 case 0:
2310 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2311 + (p[2] - 1) * eshift_[9]; // ga-D2
2312 case 1:
2313 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
2314 + (p[2] - 1) * eshift_[13]; // gb-D4
2315 case 2:
2316 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2317 + (p[2] - 1) * eshift_[5]; // gc-P
2318 case 3:
2319 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2320 + (p[2] - 1) * eshift_[11]; // gd-D3
2321 case 4:
2322 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2323 + p[2] * eshift_[3]; // ge-H
2324 case 5:
2325 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2326 + p[2] * eshift_[7]; // gf-D1
2327 case 6:
2328 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // gh-L
2329 case 7:
2330 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // hg-L
2331 case 8:
2332 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
2333 - 1; // fg-D1
2334 case 9:
2335 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2336 + p[2] * eshift_[3]; // fh-H
2337 }
2338 return -1;
2339}
2340
2341inline ttk::SimplexId
2342 ttk::ImplicitTriangulation::getVertexEdgeAEGC(const SimplexId p[3],
2343 const int id) const {
2344 // V(aegc)=V(g)+V(a)::{c,g}+V(c)::{g}
2345 switch(id) {
2346 case 0:
2347 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2348 + (p[2] - 1) * eshift_[9]; // ga-D2
2349 case 1:
2350 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
2351 + (p[2] - 1) * eshift_[13]; // gb-D4
2352 case 2:
2353 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2354 + (p[2] - 1) * eshift_[5]; // gc-P
2355 case 3:
2356 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2357 + (p[2] - 1) * eshift_[11]; // gd-D3
2358 case 4:
2359 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2360 + p[2] * eshift_[3]; // ge-H
2361 case 5:
2362 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2363 + p[2] * eshift_[7]; // gf-D1
2364 case 6:
2365 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // gh-L
2366 case 7:
2367 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2368 + p[2] * eshift_[3]; // ac-H
2369 case 8:
2370 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2371 + p[2] * eshift_[9]; // ag-D2
2372 case 9:
2373 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2374 + p[2] * eshift_[5]; // cg-P
2375 }
2376 return -1;
2377}
2378
2379inline ttk::SimplexId
2380 ttk::ImplicitTriangulation::getVertexEdgeBFHD(const SimplexId p[3],
2381 const int id) const {
2382 // V(bfhd)=V(b)+V(f)::{b}+V(h)::{b}+V(d)::{b}
2383 switch(id) {
2384 case 0:
2385 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // ba-L
2386 case 1:
2387 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
2388 - 1; // bc-D1
2389 case 2:
2390 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2391 + p[2] * eshift_[3]; // bd-H
2392 case 3:
2393 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
2394 - 1; // be-D3
2395 case 4:
2396 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2397 + p[2] * eshift_[5]; // bf-P
2398 case 5:
2399 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13]
2400 - 1; // bg-D4
2401 case 6:
2402 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2403 + p[2] * eshift_[9]; // bh-D2
2404 case 7:
2405 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2406 + (p[2] - 1) * eshift_[5]; // fb-P
2407 case 8:
2408 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2409 + (p[2] - 1) * eshift_[9]; // hb-D2
2410 case 9:
2411 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2412 + p[2] * eshift_[3]; // db-H
2413 }
2414 return -1;
2415}
2416
2417inline ttk::SimplexId
2418 ttk::ImplicitTriangulation::getVertexEdgeAEFB(const SimplexId p[3],
2419 const int id) const {
2420 // V(aefb)=V(b)+V(a)::{b}+V(e)::{b}+V(f)::{b}
2421 switch(id) {
2422 case 0:
2423 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // ba-L
2424 case 1:
2425 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
2426 - 1; // bc-D1
2427 case 2:
2428 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2429 + p[2] * eshift_[3]; // bd-H
2430 case 3:
2431 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
2432 - 1; // be-D3
2433 case 4:
2434 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2435 + p[2] * eshift_[5]; // bf-P
2436 case 5:
2437 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13]
2438 - 1; // bg-D4
2439 case 6:
2440 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2441 + p[2] * eshift_[9]; // bh-D2
2442 case 7:
2443 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ab-L
2444 case 8:
2445 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2446 + (p[2] - 1) * eshift_[11]; // eb-D3
2447 case 9:
2448 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2449 + (p[2] - 1) * eshift_[5]; // fb-P
2450 }
2451 return -1;
2452}
2453
2454inline ttk::SimplexId
2455 ttk::ImplicitTriangulation::getVertexEdgeGHDC(const SimplexId p[3],
2456 const int id) const {
2457 // V(ghdc)=V(g)+V(h)::{g}+V(d)::{g,h}
2458 switch(id) {
2459 case 0:
2460 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2461 + (p[2] - 1) * eshift_[9]; // ga-D2
2462 case 1:
2463 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
2464 + (p[2] - 1) * eshift_[13]; // gb-D4
2465 case 2:
2466 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2467 + (p[2] - 1) * eshift_[5]; // gc-P
2468 case 3:
2469 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2470 + (p[2] - 1) * eshift_[11]; // gd-D3
2471 case 4:
2472 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2473 + p[2] * eshift_[3]; // ge-H
2474 case 5:
2475 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2476 + p[2] * eshift_[7]; // gf-D1
2477 case 6:
2478 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // gh-L
2479 case 7:
2480 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // hg-L
2481 case 8:
2482 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
2483 - 1; // dg-D3
2484 case 9:
2485 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2486 + p[2] * eshift_[5]; // dh-P
2487 }
2488 return -1;
2489}
2490
2491inline ttk::SimplexId
2492 ttk::ImplicitTriangulation::getVertexEdgeABCDEFGH(const SimplexId p[3],
2493 const int id) const {
2494 // V(abcdefgh)=V(g)+V(d)::{g,h}+V(h)::{g}+V(b)::{c,d,g,h}
2495 switch(id) {
2496 case 0:
2497 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
2498 + (p[2] - 1) * eshift_[9]; // ga-D2
2499 case 1:
2500 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
2501 + (p[2] - 1) * eshift_[13]; // gb-D4
2502 case 2:
2503 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2504 + (p[2] - 1) * eshift_[5]; // gc-P
2505 case 3:
2506 return esetshift_[4] + p[0] + p[1] * eshift_[10]
2507 + (p[2] - 1) * eshift_[11]; // gd-D3
2508 case 4:
2509 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
2510 + p[2] * eshift_[3]; // ge-H
2511 case 5:
2512 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
2513 + p[2] * eshift_[7]; // gf-D1
2514 case 6:
2515 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // gh-L
2516 case 7:
2517 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11]
2518 - 1; // dg-D3
2519 case 8:
2520 return esetshift_[1] + p[0] + p[1] * eshift_[4]
2521 + p[2] * eshift_[5]; // dh-P
2522 case 9:
2523 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1] - 1; // hg-L
2524 case 10:
2525 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7]
2526 - 1; // bc-D1
2527 case 11:
2528 return esetshift_[0] + p[0] + p[1] * eshift_[2]
2529 + p[2] * eshift_[3]; // bd-H
2530 case 12:
2531 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13]
2532 - 1; // bg-D4
2533 case 13:
2534 return esetshift_[3] + p[0] + p[1] * eshift_[8]
2535 + p[2] * eshift_[9]; // bh-D2
2536 }
2537 return -1;
2538}
2539
2540inline ttk::SimplexId
2541 ttk::ImplicitTriangulation::getVertexTriangleA(const SimplexId /*p*/[3],
2542 const int id) const {
2543 switch(id) {
2544 case 0:
2545 return 0;
2546 case 1:
2547 return tsetshift_[0];
2548 case 2:
2549 return tsetshift_[1];
2550 case 3:
2551 return tsetshift_[3];
2552 case 4:
2553 return tsetshift_[1] + 1;
2554 }
2555 return -1;
2556}
2557
2558inline ttk::SimplexId
2559 ttk::ImplicitTriangulation::getVertexTriangleB(const SimplexId p[3],
2560 const int id) const {
2561 switch(id) {
2562 case 0:
2563 return (p[0] - 1) * 2 + 1;
2564 case 1:
2565 return tsetshift_[4] + (p[0] - 1) * 2;
2566 case 2:
2567 return tsetshift_[2] + (p[0] - 1) * 2;
2568 case 3:
2569 return tsetshift_[3] + (p[0] - 1) * 2 + 1;
2570 case 4:
2571 return tsetshift_[1] + p[0] * 2;
2572 case 5:
2573 return tsetshift_[1] + p[0] * 2 + 1;
2574 case 6:
2575 return tsetshift_[4] + (p[0] - 1) * 2 + 1;
2576 case 7:
2577 return tsetshift_[0] + (p[0] - 1) * 2 + 1;
2578 case 8:
2579 return tsetshift_[2] + (p[0] - 1) * 2 + 1;
2580 case 9:
2581 return tsetshift_[3] + (p[0] - 1) * 2;
2582 case 10:
2583 return tsetshift_[0] + (p[0] - 1) * 2;
2584 case 11:
2585 return (p[0] - 1) * 2;
2586 }
2587 return -1;
2588}
2589
2590inline ttk::SimplexId
2591 ttk::ImplicitTriangulation::getVertexTriangleC(const SimplexId p[3],
2592 const int id) const {
2593 switch(id) {
2594 case 0:
2595 return (p[1] - 1) * tshift_[0];
2596 case 1:
2597 return (p[1] - 1) * tshift_[0] + 1;
2598 case 2:
2599 return tsetshift_[4] + (p[1] - 1) * tshift_[10];
2600 case 3:
2601 return tsetshift_[0] + p[1] * tshift_[2];
2602 case 4:
2603 return tsetshift_[1] + (p[1] - 1) * tshift_[4];
2604 }
2605 return -1;
2606}
2607
2608inline ttk::SimplexId
2609 ttk::ImplicitTriangulation::getVertexTriangleD(const SimplexId p[3],
2610 const int id) const {
2611 switch(id) {
2612 case 0:
2613 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + 1;
2614 case 1:
2615 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6];
2616 case 2:
2617 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2];
2618 case 3:
2619 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4];
2620 case 4:
2621 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2] + 1;
2622 }
2623 return -1;
2624}
2625
2626inline ttk::SimplexId
2627 ttk::ImplicitTriangulation::getVertexTriangleE(const SimplexId p[3],
2628 const int id) const {
2629 switch(id) {
2630 case 0:
2631 return tsetshift_[0] + (p[2] - 1) * tshift_[3];
2632 case 1:
2633 return tsetshift_[2] + (p[2] - 1) * tshift_[7] + 1;
2634 case 2:
2635 return tsetshift_[1] + (p[2] - 1) * tshift_[5] + 1;
2636 case 3:
2637 return p[2] * tshift_[1];
2638 case 4:
2639 return tsetshift_[0] + (p[2] - 1) * tshift_[3] + 1;
2640 }
2641 return -1;
2642}
2643
2644inline ttk::SimplexId
2645 ttk::ImplicitTriangulation::getVertexTriangleF(const SimplexId p[3],
2646 const int id) const {
2647 switch(id) {
2648 case 0:
2649 return tsetshift_[0] + (p[0] - 1) * 2 + (p[2] - 1) * tshift_[3] + 1;
2650 case 1:
2651 return (p[0] - 1) * 2 + p[2] * tshift_[1];
2652 case 2:
2653 return (p[0] - 1) * 2 + p[2] * tshift_[1] + 1;
2654 case 3:
2655 return tsetshift_[4] + (p[0] - 1) * 2 + (p[2] - 1) * tshift_[11] + 1;
2656 case 4:
2657 return tsetshift_[1] + p[0] * 2 + (p[2] - 1) * tshift_[5] + 1;
2658 }
2659 return -1;
2660}
2661
2662inline ttk::SimplexId
2663 ttk::ImplicitTriangulation::getVertexTriangleG(const SimplexId p[3],
2664 const int id) const {
2665 switch(id) {
2666 case 0:
2667 return tsetshift_[2] + (p[1] - 1) * tshift_[6] + (p[2] - 1) * tshift_[7];
2668 case 1:
2669 return tsetshift_[2] + (p[1] - 1) * tshift_[6] + (p[2] - 1) * tshift_[7]
2670 + 1;
2671 case 2:
2672 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + (p[2] - 1) * tshift_[5];
2673 case 3:
2674 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + (p[2] - 1) * tshift_[5]
2675 + 1;
2676 case 4:
2677 return tsetshift_[3] + (p[1] - 1) * tshift_[8] + (p[2] - 1) * tshift_[9];
2678 case 5:
2679 return tsetshift_[3] + (p[1] - 1) * tshift_[8] + (p[2] - 1) * tshift_[9]
2680 + 1;
2681 case 6:
2682 return tsetshift_[4] + (p[1] - 1) * tshift_[10]
2683 + (p[2] - 1) * tshift_[11];
2684 case 7:
2685 return tsetshift_[4] + (p[1] - 1) * tshift_[10] + (p[2] - 1) * tshift_[11]
2686 + 1;
2687 case 8:
2688 return (p[1] - 1) * tshift_[0] + p[2] * tshift_[1];
2689 case 9:
2690 return (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
2691 case 10:
2692 return tsetshift_[0] + p[1] * tshift_[2] + (p[2] - 1) * tshift_[3];
2693 case 11:
2694 return tsetshift_[0] + p[1] * tshift_[2] + (p[2] - 1) * tshift_[3] + 1;
2695 }
2696 return -1;
2697}
2698
2699inline ttk::SimplexId
2700 ttk::ImplicitTriangulation::getVertexTriangleH(const SimplexId p[3],
2701 const int id) const {
2702 switch(id) {
2703 case 0:
2704 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
2705 + (p[2] - 1) * tshift_[9] + 1;
2706 case 1:
2707 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
2708 case 2:
2709 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
2710 + (p[2] - 1) * tshift_[5];
2711 case 3:
2712 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
2713 + (p[2] - 1) * tshift_[5] + 1;
2714 case 4:
2715 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
2716 + (p[2] - 1) * tshift_[3] + 1;
2717 }
2718 return -1;
2719}
2720
2721inline ttk::SimplexId
2722 ttk::ImplicitTriangulation::getVertexTriangleAB(const SimplexId p[3],
2723 const int id) const {
2724 switch(id) {
2725 case 0:
2726 return (p[0] - 1) * 2 + 1;
2727 case 1:
2728 return tsetshift_[4] + (p[0] - 1) * 2;
2729 case 2:
2730 return tsetshift_[2] + (p[0] - 1) * 2;
2731 case 3:
2732 return tsetshift_[3] + (p[0] - 1) * 2 + 1;
2733 case 4:
2734 return tsetshift_[1] + p[0] * 2;
2735 case 5:
2736 return tsetshift_[1] + p[0] * 2 + 1;
2737 case 6:
2738 return tsetshift_[4] + (p[0] - 1) * 2 + 1;
2739 case 7:
2740 return tsetshift_[0] + (p[0] - 1) * 2 + 1;
2741 case 8:
2742 return tsetshift_[2] + (p[0] - 1) * 2 + 1;
2743 case 9:
2744 return tsetshift_[3] + (p[0] - 1) * 2;
2745 case 10:
2746 return tsetshift_[0] + (p[0] - 1) * 2;
2747 case 11:
2748 return (p[0] - 1) * 2;
2749 case 12:
2750 return p[0] * 2;
2751 case 13:
2752 return tsetshift_[0] + p[0] * 2;
2753 case 14:
2754 return tsetshift_[3] + p[0] * 2;
2755 }
2756 return -1;
2757}
2758
2759inline ttk::SimplexId
2760 ttk::ImplicitTriangulation::getVertexTriangleCD(const SimplexId p[3],
2761 const int id) const {
2762 switch(id) {
2763 case 0:
2764 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + 1;
2765 case 1:
2766 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6];
2767 case 2:
2768 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2];
2769 case 3:
2770 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4];
2771 case 4:
2772 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2] + 1;
2773 case 5:
2774 return p[0] * 2 + (p[1] - 1) * tshift_[0];
2775 case 6:
2776 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
2777 case 7:
2778 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10];
2779 case 8:
2780 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2];
2781 }
2782 return -1;
2783}
2784
2785inline ttk::SimplexId
2786 ttk::ImplicitTriangulation::getVertexTriangleEF(const SimplexId p[3],
2787 const int id) const {
2788 switch(id) {
2789 case 0:
2790 return tsetshift_[0] + (p[0] - 1) * 2 + (p[2] - 1) * tshift_[3] + 1;
2791 case 1:
2792 return (p[0] - 1) * 2 + p[2] * tshift_[1];
2793 case 2:
2794 return (p[0] - 1) * 2 + p[2] * tshift_[1] + 1;
2795 case 3:
2796 return tsetshift_[4] + (p[0] - 1) * 2 + (p[2] - 1) * tshift_[11] + 1;
2797 case 4:
2798 return tsetshift_[1] + p[0] * 2 + (p[2] - 1) * tshift_[5] + 1;
2799 case 5:
2800 return p[0] * 2 + tsetshift_[0] + (p[2] - 1) * tshift_[3];
2801 case 6:
2802 return p[0] * 2 + tsetshift_[2] + (p[2] - 1) * tshift_[7] + 1;
2803 case 7:
2804 return p[0] * 2 + p[2] * tshift_[1];
2805 case 8:
2806 return p[0] * 2 + tsetshift_[0] + (p[2] - 1) * tshift_[3] + 1;
2807 }
2808 return -1;
2809}
2810
2811inline ttk::SimplexId
2812 ttk::ImplicitTriangulation::getVertexTriangleGH(const SimplexId p[3],
2813 const int id) const {
2814 switch(id) {
2815 case 0:
2816 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
2817 + (p[2] - 1) * tshift_[9] + 1;
2818 case 1:
2819 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
2820 case 2:
2821 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
2822 + (p[2] - 1) * tshift_[5];
2823 case 3:
2824 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
2825 + (p[2] - 1) * tshift_[5] + 1;
2826 case 4:
2827 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
2828 + (p[2] - 1) * tshift_[3] + 1;
2829 case 5:
2830 return p[0] * 2 + tsetshift_[2] + (p[1] - 1) * tshift_[6]
2831 + (p[2] - 1) * tshift_[7];
2832 case 6:
2833 return p[0] * 2 + tsetshift_[2] + (p[1] - 1) * tshift_[6]
2834 + (p[2] - 1) * tshift_[7] + 1;
2835 case 7:
2836 return p[0] * 2 + tsetshift_[3] + (p[1] - 1) * tshift_[8]
2837 + (p[2] - 1) * tshift_[9];
2838 case 8:
2839 return p[0] * 2 + tsetshift_[3] + (p[1] - 1) * tshift_[8]
2840 + (p[2] - 1) * tshift_[9] + 1;
2841 case 9:
2842 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
2843 + (p[2] - 1) * tshift_[11];
2844 case 10:
2845 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
2846 + (p[2] - 1) * tshift_[11] + 1;
2847 case 11:
2848 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1];
2849 case 12:
2850 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
2851 case 13:
2852 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2]
2853 + (p[2] - 1) * tshift_[3];
2854 case 14:
2855 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2]
2856 + (p[2] - 1) * tshift_[3] + 1;
2857 }
2858 return -1;
2859}
2860
2861inline ttk::SimplexId
2862 ttk::ImplicitTriangulation::getVertexTriangleAC(const SimplexId p[3],
2863 const int id) const {
2864 switch(id) {
2865 case 0:
2866 return (p[1] - 1) * tshift_[0];
2867 case 1:
2868 return (p[1] - 1) * tshift_[0] + 1;
2869 case 2:
2870 return tsetshift_[4] + (p[1] - 1) * tshift_[10];
2871 case 3:
2872 return tsetshift_[0] + p[1] * tshift_[2];
2873 case 4:
2874 return tsetshift_[1] + (p[1] - 1) * tshift_[4];
2875 case 5:
2876 return p[1] * tshift_[0];
2877 case 6:
2878 return tsetshift_[1] + p[1] * tshift_[4];
2879 case 7:
2880 return tsetshift_[3] + p[1] * tshift_[8];
2881 case 8:
2882 return tsetshift_[1] + p[1] * tshift_[4] + 1;
2883 }
2884 return -1;
2885}
2886
2887inline ttk::SimplexId
2888 ttk::ImplicitTriangulation::getVertexTriangleBD(const SimplexId p[3],
2889 const int id) const {
2890 switch(id) {
2891 case 0:
2892 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + 1;
2893 case 1:
2894 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6];
2895 case 2:
2896 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2];
2897 case 3:
2898 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4];
2899 case 4:
2900 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2] + 1;
2901 case 5:
2902 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
2903 case 6:
2904 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10];
2905 case 7:
2906 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6];
2907 case 8:
2908 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8] + 1;
2909 case 9:
2910 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4];
2911 case 10:
2912 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + 1;
2913 case 11:
2914 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10] + 1;
2915 case 12:
2916 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6] + 1;
2917 case 13:
2918 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8];
2919 case 14:
2920 return (p[0] - 1) * 2 + p[1] * tshift_[0];
2921 }
2922 return -1;
2923}
2924
2925inline ttk::SimplexId
2926 ttk::ImplicitTriangulation::getVertexTriangleEG(const SimplexId p[3],
2927 const int id) const {
2928 switch(id) {
2929 case 0:
2930 return tsetshift_[2] + (p[1] - 1) * tshift_[6] + (p[2] - 1) * tshift_[7];
2931 case 1:
2932 return tsetshift_[2] + (p[1] - 1) * tshift_[6] + (p[2] - 1) * tshift_[7]
2933 + 1;
2934 case 2:
2935 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + (p[2] - 1) * tshift_[5];
2936 case 3:
2937 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + (p[2] - 1) * tshift_[5]
2938 + 1;
2939 case 4:
2940 return tsetshift_[3] + (p[1] - 1) * tshift_[8] + (p[2] - 1) * tshift_[9];
2941 case 5:
2942 return tsetshift_[3] + (p[1] - 1) * tshift_[8] + (p[2] - 1) * tshift_[9]
2943 + 1;
2944 case 6:
2945 return tsetshift_[4] + (p[1] - 1) * tshift_[10]
2946 + (p[2] - 1) * tshift_[11];
2947 case 7:
2948 return tsetshift_[4] + (p[1] - 1) * tshift_[10] + (p[2] - 1) * tshift_[11]
2949 + 1;
2950 case 8:
2951 return (p[1] - 1) * tshift_[0] + p[2] * tshift_[1];
2952 case 9:
2953 return (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
2954 case 10:
2955 return tsetshift_[0] + p[1] * tshift_[2] + (p[2] - 1) * tshift_[3];
2956 case 11:
2957 return tsetshift_[0] + p[1] * tshift_[2] + (p[2] - 1) * tshift_[3] + 1;
2958 case 12:
2959 return tsetshift_[2] + p[1] * tshift_[6] + (p[2] - 1) * tshift_[7] + 1;
2960 case 13:
2961 return tsetshift_[1] + p[1] * tshift_[4] + (p[2] - 1) * tshift_[5] + 1;
2962 case 14:
2963 return p[1] * tshift_[0] + p[2] * tshift_[1];
2964 }
2965 return -1;
2966}
2967
2968inline ttk::SimplexId
2969 ttk::ImplicitTriangulation::getVertexTriangleFH(const SimplexId p[3],
2970 const int id) const {
2971 switch(id) {
2972 case 0:
2973 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
2974 + (p[2] - 1) * tshift_[9] + 1;
2975 case 1:
2976 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
2977 case 2:
2978 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
2979 + (p[2] - 1) * tshift_[5];
2980 case 3:
2981 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
2982 + (p[2] - 1) * tshift_[5] + 1;
2983 case 4:
2984 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
2985 + (p[2] - 1) * tshift_[3] + 1;
2986 case 5:
2987 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
2988 case 6:
2989 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
2990 case 7:
2991 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
2992 + (p[2] - 1) * tshift_[11] + 1;
2993 case 8:
2994 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4]
2995 + (p[2] - 1) * tshift_[5] + 1;
2996 }
2997 return -1;
2998}
2999
3000inline ttk::SimplexId
3001 ttk::ImplicitTriangulation::getVertexTriangleAE(const SimplexId p[3],
3002 const int id) const {
3003 switch(id) {
3004 case 0:
3005 return tsetshift_[0] + (p[2] - 1) * tshift_[3];
3006 case 1:
3007 return tsetshift_[2] + (p[2] - 1) * tshift_[7] + 1;
3008 case 2:
3009 return tsetshift_[1] + (p[2] - 1) * tshift_[5] + 1;
3010 case 3:
3011 return p[2] * tshift_[1];
3012 case 4:
3013 return tsetshift_[0] + (p[2] - 1) * tshift_[3] + 1;
3014 case 5:
3015 return tsetshift_[0] + p[2] * tshift_[3];
3016 case 6:
3017 return tsetshift_[1] + p[2] * tshift_[5];
3018 case 7:
3019 return tsetshift_[3] + p[2] * tshift_[9];
3020 case 8:
3021 return tsetshift_[1] + p[2] * tshift_[5] + 1;
3022 }
3023 return -1;
3024}
3025
3026inline ttk::SimplexId
3027 ttk::ImplicitTriangulation::getVertexTriangleBF(const SimplexId p[3],
3028 const int id) const {
3029 switch(id) {
3030 case 0:
3031 return tsetshift_[0] + (p[0] - 1) * 2 + (p[2] - 1) * tshift_[3] + 1;
3032 case 1:
3033 return (p[0] - 1) * 2 + p[2] * tshift_[1];
3034 case 2:
3035 return (p[0] - 1) * 2 + p[2] * tshift_[1] + 1;
3036 case 3:
3037 return tsetshift_[4] + (p[0] - 1) * 2 + (p[2] - 1) * tshift_[11] + 1;
3038 case 4:
3039 return tsetshift_[1] + p[0] * 2 + (p[2] - 1) * tshift_[5] + 1;
3040 case 5:
3041 return tsetshift_[4] + (p[0] - 1) * 2 + p[2] * tshift_[11];
3042 case 6:
3043 return tsetshift_[2] + (p[0] - 1) * 2 + p[2] * tshift_[7];
3044 case 7:
3045 return tsetshift_[3] + (p[0] - 1) * 2 + p[2] * tshift_[9] + 1;
3046 case 8:
3047 return tsetshift_[1] + p[0] * 2 + p[2] * tshift_[5];
3048 case 9:
3049 return tsetshift_[1] + p[0] * 2 + p[2] * tshift_[5] + 1;
3050 case 10:
3051 return tsetshift_[4] + (p[0] - 1) * 2 + p[2] * tshift_[11] + 1;
3052 case 11:
3053 return tsetshift_[0] + (p[0] - 1) * 2 + p[2] * tshift_[3] + 1;
3054 case 12:
3055 return tsetshift_[2] + (p[0] - 1) * 2 + p[2] * tshift_[7] + 1;
3056 case 13:
3057 return tsetshift_[3] + (p[0] - 1) * 2 + p[2] * tshift_[9];
3058 case 14:
3059 return tsetshift_[0] + (p[0] - 1) * 2 + p[2] * tshift_[3];
3060 }
3061 return -1;
3062}
3063
3064inline ttk::SimplexId
3065 ttk::ImplicitTriangulation::getVertexTriangleCG(const SimplexId p[3],
3066 const int id) const {
3067 switch(id) {
3068 case 0:
3069 return tsetshift_[2] + (p[1] - 1) * tshift_[6] + (p[2] - 1) * tshift_[7];
3070 case 1:
3071 return tsetshift_[2] + (p[1] - 1) * tshift_[6] + (p[2] - 1) * tshift_[7]
3072 + 1;
3073 case 2:
3074 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + (p[2] - 1) * tshift_[5];
3075 case 3:
3076 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + (p[2] - 1) * tshift_[5]
3077 + 1;
3078 case 4:
3079 return tsetshift_[3] + (p[1] - 1) * tshift_[8] + (p[2] - 1) * tshift_[9];
3080 case 5:
3081 return tsetshift_[3] + (p[1] - 1) * tshift_[8] + (p[2] - 1) * tshift_[9]
3082 + 1;
3083 case 6:
3084 return tsetshift_[4] + (p[1] - 1) * tshift_[10]
3085 + (p[2] - 1) * tshift_[11];
3086 case 7:
3087 return tsetshift_[4] + (p[1] - 1) * tshift_[10] + (p[2] - 1) * tshift_[11]
3088 + 1;
3089 case 8:
3090 return (p[1] - 1) * tshift_[0] + p[2] * tshift_[1];
3091 case 9:
3092 return (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3093 case 10:
3094 return tsetshift_[0] + p[1] * tshift_[2] + (p[2] - 1) * tshift_[3];
3095 case 11:
3096 return tsetshift_[0] + p[1] * tshift_[2] + (p[2] - 1) * tshift_[3] + 1;
3097 case 12:
3098 return tsetshift_[4] + (p[1] - 1) * tshift_[10] + p[2] * tshift_[11];
3099 case 13:
3100 return tsetshift_[0] + p[1] * tshift_[2] + p[2] * tshift_[3];
3101 case 14:
3102 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + p[2] * tshift_[5];
3103 }
3104 return -1;
3105}
3106
3107inline ttk::SimplexId
3108 ttk::ImplicitTriangulation::getVertexTriangleDH(const SimplexId p[3],
3109 const int id) const {
3110 switch(id) {
3111 case 0:
3112 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
3113 + (p[2] - 1) * tshift_[9] + 1;
3114 case 1:
3115 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3116 case 2:
3117 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
3118 + (p[2] - 1) * tshift_[5];
3119 case 3:
3120 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
3121 + (p[2] - 1) * tshift_[5] + 1;
3122 case 4:
3123 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3124 + (p[2] - 1) * tshift_[3] + 1;
3125 case 5:
3126 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
3127 + p[2] * tshift_[7];
3128 case 6:
3129 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3130 + p[2] * tshift_[3];
3131 case 7:
3132 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
3133 + p[2] * tshift_[5];
3134 case 8:
3135 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3136 + p[2] * tshift_[3] + 1;
3137 }
3138 return -1;
3139}
3140
3141inline ttk::SimplexId
3142 ttk::ImplicitTriangulation::getVertexTriangleABDC(const SimplexId p[3],
3143 const int id) const {
3144 switch(id) {
3145 case 0:
3146 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
3147 case 1:
3148 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10];
3149 case 2:
3150 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6];
3151 case 3:
3152 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8] + 1;
3153 case 4:
3154 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4];
3155 case 5:
3156 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + 1;
3157 case 6:
3158 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10] + 1;
3159 case 7:
3160 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2] + 1;
3161 case 8:
3162 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6] + 1;
3163 case 9:
3164 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8];
3165 case 10:
3166 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2];
3167 case 11:
3168 return (p[0] - 1) * 2 + p[1] * tshift_[0];
3169 case 12:
3170 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + 1;
3171 case 13:
3172 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6];
3173 case 14:
3174 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4];
3175 case 15:
3176 return p[0] * 2 + (p[1] - 1) * tshift_[0];
3177 case 16:
3178 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
3179 case 17:
3180 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10];
3181 case 18:
3182 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2];
3183 case 19:
3184 return p[0] * 2 + p[1] * tshift_[0];
3185 case 20:
3186 return p[0] * 2 + tsetshift_[3] + p[1] * tshift_[8];
3187 }
3188 return -1;
3189}
3190
3191inline ttk::SimplexId
3192 ttk::ImplicitTriangulation::getVertexTriangleEFHG(const SimplexId p[3],
3193 const int id) const {
3194 switch(id) {
3195 case 0:
3196 return p[0] * 2 + tsetshift_[2] + (p[1] - 1) * tshift_[6]
3197 + (p[2] - 1) * tshift_[7];
3198 case 1:
3199 return p[0] * 2 + tsetshift_[2] + (p[1] - 1) * tshift_[6]
3200 + (p[2] - 1) * tshift_[7] + 1;
3201 case 2:
3202 return p[0] * 2 + tsetshift_[1] + (p[1] - 1) * tshift_[4]
3203 + (p[2] - 1) * tshift_[5];
3204 case 3:
3205 return p[0] * 2 + tsetshift_[1] + (p[1] - 1) * tshift_[4]
3206 + (p[2] - 1) * tshift_[5] + 1;
3207 case 4:
3208 return p[0] * 2 + tsetshift_[3] + (p[1] - 1) * tshift_[8]
3209 + (p[2] - 1) * tshift_[9];
3210 case 5:
3211 return p[0] * 2 + tsetshift_[3] + (p[1] - 1) * tshift_[8]
3212 + (p[2] - 1) * tshift_[9] + 1;
3213 case 6:
3214 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
3215 + (p[2] - 1) * tshift_[11];
3216 case 7:
3217 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
3218 + (p[2] - 1) * tshift_[11] + 1;
3219 case 8:
3220 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1];
3221 case 9:
3222 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3223 case 10:
3224 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2]
3225 + (p[2] - 1) * tshift_[3];
3226 case 11:
3227 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2]
3228 + (p[2] - 1) * tshift_[3] + 1;
3229 case 12:
3230 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
3231 + (p[2] - 1) * tshift_[9] + 1;
3232 case 13:
3233 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3234 case 14:
3235 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3236 + (p[2] - 1) * tshift_[3] + 1;
3237 case 15:
3238 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
3239 case 16:
3240 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
3241 case 17:
3242 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
3243 + (p[2] - 1) * tshift_[11] + 1;
3244 case 18:
3245 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4]
3246 + (p[2] - 1) * tshift_[5] + 1;
3247 case 19:
3248 return p[0] * 2 + tsetshift_[2] + p[1] * tshift_[6]
3249 + (p[2] - 1) * tshift_[7] + 1;
3250 case 20:
3251 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
3252 }
3253 return -1;
3254}
3255
3256inline ttk::SimplexId
3257 ttk::ImplicitTriangulation::getVertexTriangleAEGC(const SimplexId p[3],
3258 const int id) const {
3259 switch(id) {
3260 case 0:
3261 return tsetshift_[2] + (p[1] - 1) * tshift_[6] + (p[2] - 1) * tshift_[7];
3262 case 1:
3263 return tsetshift_[2] + (p[1] - 1) * tshift_[6] + (p[2] - 1) * tshift_[7]
3264 + 1;
3265 case 2:
3266 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + (p[2] - 1) * tshift_[5];
3267 case 3:
3268 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + (p[2] - 1) * tshift_[5]
3269 + 1;
3270 case 4:
3271 return tsetshift_[3] + (p[1] - 1) * tshift_[8] + (p[2] - 1) * tshift_[9];
3272 case 5:
3273 return tsetshift_[3] + (p[1] - 1) * tshift_[8] + (p[2] - 1) * tshift_[9]
3274 + 1;
3275 case 6:
3276 return tsetshift_[4] + (p[1] - 1) * tshift_[10]
3277 + (p[2] - 1) * tshift_[11];
3278 case 7:
3279 return tsetshift_[4] + (p[1] - 1) * tshift_[10] + (p[2] - 1) * tshift_[11]
3280 + 1;
3281 case 8:
3282 return (p[1] - 1) * tshift_[0] + p[2] * tshift_[1];
3283 case 9:
3284 return (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3285 case 10:
3286 return tsetshift_[0] + p[1] * tshift_[2] + (p[2] - 1) * tshift_[3];
3287 case 11:
3288 return tsetshift_[0] + p[1] * tshift_[2] + (p[2] - 1) * tshift_[3] + 1;
3289 case 12:
3290 return tsetshift_[2] + p[1] * tshift_[6] + (p[2] - 1) * tshift_[7] + 1;
3291 case 13:
3292 return tsetshift_[1] + p[1] * tshift_[4] + (p[2] - 1) * tshift_[5] + 1;
3293 case 14:
3294 return p[1] * tshift_[0] + p[2] * tshift_[1];
3295 case 15:
3296 return tsetshift_[0] + p[1] * tshift_[2] + p[2] * tshift_[3];
3297 case 16:
3298 return tsetshift_[1] + p[1] * tshift_[4] + p[2] * tshift_[5];
3299 case 17:
3300 return tsetshift_[3] + p[1] * tshift_[8] + p[2] * tshift_[9];
3301 case 18:
3302 return tsetshift_[1] + p[1] * tshift_[4] + p[2] * tshift_[5] + 1;
3303 case 19:
3304 return tsetshift_[4] + (p[1] - 1) * tshift_[10] + p[2] * tshift_[11];
3305 case 20:
3306 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + p[2] * tshift_[5];
3307 }
3308 return -1;
3309}
3310
3311inline ttk::SimplexId
3312 ttk::ImplicitTriangulation::getVertexTriangleBFHD(const SimplexId p[3],
3313 const int id) const {
3314 switch(id) {
3315 case 0:
3316 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
3317 case 1:
3318 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
3319 + p[2] * tshift_[11];
3320 case 2:
3321 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
3322 + p[2] * tshift_[7];
3323 case 3:
3324 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
3325 + p[2] * tshift_[9] + 1;
3326 case 4:
3327 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5];
3328 case 5:
3329 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
3330 + 1;
3331 case 6:
3332 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
3333 + p[2] * tshift_[11] + 1;
3334 case 7:
3335 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3336 + p[2] * tshift_[3] + 1;
3337 case 8:
3338 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
3339 + p[2] * tshift_[7] + 1;
3340 case 9:
3341 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
3342 + p[2] * tshift_[9];
3343 case 10:
3344 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3345 + p[2] * tshift_[3];
3346 case 11:
3347 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
3348 case 12:
3349 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3350 case 13:
3351 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
3352 + p[2] * tshift_[7];
3353 case 14:
3354 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
3355 + p[2] * tshift_[5];
3356 case 15:
3357 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
3358 + (p[2] - 1) * tshift_[9] + 1;
3359 case 16:
3360 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
3361 + (p[2] - 1) * tshift_[5];
3362 case 17:
3363 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
3364 + (p[2] - 1) * tshift_[5] + 1;
3365 case 18:
3366 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3367 + (p[2] - 1) * tshift_[3] + 1;
3368 case 19:
3369 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
3370 + (p[2] - 1) * tshift_[11] + 1;
3371 case 20:
3372 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4]
3373 + (p[2] - 1) * tshift_[5] + 1;
3374 }
3375 return -1;
3376}
3377
3378inline ttk::SimplexId
3379 ttk::ImplicitTriangulation::getVertexTriangleAEFB(const SimplexId p[3],
3380 const int id) const {
3381 switch(id) {
3382 case 0:
3383 return (p[0] - 1) * 2 + p[2] * tshift_[1] + 1;
3384 case 1:
3385 return tsetshift_[4] + (p[0] - 1) * 2 + p[2] * tshift_[11];
3386 case 2:
3387 return tsetshift_[2] + (p[0] - 1) * 2 + p[2] * tshift_[7];
3388 case 3:
3389 return tsetshift_[3] + (p[0] - 1) * 2 + p[2] * tshift_[9] + 1;
3390 case 4:
3391 return tsetshift_[1] + p[0] * 2 + p[2] * tshift_[5];
3392 case 5:
3393 return tsetshift_[1] + p[0] * 2 + p[2] * tshift_[5] + 1;
3394 case 6:
3395 return tsetshift_[4] + (p[0] - 1) * 2 + p[2] * tshift_[11] + 1;
3396 case 7:
3397 return tsetshift_[0] + (p[0] - 1) * 2 + p[2] * tshift_[3] + 1;
3398 case 8:
3399 return tsetshift_[2] + (p[0] - 1) * 2 + p[2] * tshift_[7] + 1;
3400 case 9:
3401 return tsetshift_[3] + (p[0] - 1) * 2 + p[2] * tshift_[9];
3402 case 10:
3403 return tsetshift_[0] + (p[0] - 1) * 2 + p[2] * tshift_[3];
3404 case 11:
3405 return (p[0] - 1) * 2 + p[2] * tshift_[1];
3406 case 12:
3407 return tsetshift_[0] + (p[0] - 1) * 2 + (p[2] - 1) * tshift_[3] + 1;
3408 case 13:
3409 return tsetshift_[4] + (p[0] - 1) * 2 + (p[2] - 1) * tshift_[11] + 1;
3410 case 14:
3411 return tsetshift_[1] + p[0] * 2 + (p[2] - 1) * tshift_[5] + 1;
3412 case 15:
3413 return p[0] * 2 + tsetshift_[0] + (p[2] - 1) * tshift_[3];
3414 case 16:
3415 return p[0] * 2 + tsetshift_[2] + (p[2] - 1) * tshift_[7] + 1;
3416 case 17:
3417 return p[0] * 2 + p[2] * tshift_[1];
3418 case 18:
3419 return p[0] * 2 + tsetshift_[0] + (p[2] - 1) * tshift_[3] + 1;
3420 case 19:
3421 return p[0] * 2 + tsetshift_[0] + p[2] * tshift_[3];
3422 case 20:
3423 return p[0] * 2 + tsetshift_[3] + p[2] * tshift_[9];
3424 }
3425 return -1;
3426}
3427
3428inline ttk::SimplexId
3429 ttk::ImplicitTriangulation::getVertexTriangleGHDC(const SimplexId p[3],
3430 const int id) const {
3431 switch(id) {
3432 case 0:
3433 return p[0] * 2 + tsetshift_[2] + (p[1] - 1) * tshift_[6]
3434 + (p[2] - 1) * tshift_[7];
3435 case 1:
3436 return p[0] * 2 + tsetshift_[2] + (p[1] - 1) * tshift_[6]
3437 + (p[2] - 1) * tshift_[7] + 1;
3438 case 2:
3439 return p[0] * 2 + tsetshift_[1] + (p[1] - 1) * tshift_[4]
3440 + (p[2] - 1) * tshift_[5];
3441 case 3:
3442 return p[0] * 2 + tsetshift_[1] + (p[1] - 1) * tshift_[4]
3443 + (p[2] - 1) * tshift_[5] + 1;
3444 case 4:
3445 return p[0] * 2 + tsetshift_[3] + (p[1] - 1) * tshift_[8]
3446 + (p[2] - 1) * tshift_[9];
3447 case 5:
3448 return p[0] * 2 + tsetshift_[3] + (p[1] - 1) * tshift_[8]
3449 + (p[2] - 1) * tshift_[9] + 1;
3450 case 6:
3451 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
3452 + (p[2] - 1) * tshift_[11];
3453 case 7:
3454 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
3455 + (p[2] - 1) * tshift_[11] + 1;
3456 case 8:
3457 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1];
3458 case 9:
3459 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3460 case 10:
3461 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2]
3462 + (p[2] - 1) * tshift_[3];
3463 case 11:
3464 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2]
3465 + (p[2] - 1) * tshift_[3] + 1;
3466 case 12:
3467 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
3468 + (p[2] - 1) * tshift_[9] + 1;
3469 case 13:
3470 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3471 case 14:
3472 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3473 + (p[2] - 1) * tshift_[3] + 1;
3474 case 15:
3475 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
3476 + p[2] * tshift_[7];
3477 case 16:
3478 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3479 + p[2] * tshift_[3];
3480 case 17:
3481 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
3482 + p[2] * tshift_[5];
3483 case 18:
3484 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3485 + p[2] * tshift_[3] + 1;
3486 case 19:
3487 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
3488 + p[2] * tshift_[11];
3489 case 20:
3490 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2] + p[2] * tshift_[3];
3491 }
3492 return -1;
3493}
3494
3495inline ttk::SimplexId
3496 ttk::ImplicitTriangulation::getVertexTriangleABCDEFGH(const SimplexId p[3],
3497 const int id) const {
3498 switch(id) {
3499 case 0:
3500 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
3501 case 1:
3502 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
3503 + p[2] * tshift_[11];
3504 case 2:
3505 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
3506 + p[2] * tshift_[7];
3507 case 3:
3508 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
3509 + p[2] * tshift_[9] + 1;
3510 case 4:
3511 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5];
3512 case 5:
3513 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
3514 + 1;
3515 case 6:
3516 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
3517 + p[2] * tshift_[11] + 1;
3518 case 7:
3519 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3520 + p[2] * tshift_[3] + 1;
3521 case 8:
3522 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
3523 + p[2] * tshift_[7] + 1;
3524 case 9:
3525 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
3526 + p[2] * tshift_[9];
3527 case 10:
3528 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3529 + p[2] * tshift_[3];
3530 case 11:
3531 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
3532 case 12:
3533 return p[0] * 2 + tsetshift_[2] + (p[1] - 1) * tshift_[6]
3534 + (p[2] - 1) * tshift_[7];
3535 case 13:
3536 return p[0] * 2 + tsetshift_[2] + (p[1] - 1) * tshift_[6]
3537 + (p[2] - 1) * tshift_[7] + 1;
3538 case 14:
3539 return p[0] * 2 + tsetshift_[1] + (p[1] - 1) * tshift_[4]
3540 + (p[2] - 1) * tshift_[5];
3541 case 15:
3542 return p[0] * 2 + tsetshift_[1] + (p[1] - 1) * tshift_[4]
3543 + (p[2] - 1) * tshift_[5] + 1;
3544 case 16:
3545 return p[0] * 2 + tsetshift_[3] + (p[1] - 1) * tshift_[8]
3546 + (p[2] - 1) * tshift_[9];
3547 case 17:
3548 return p[0] * 2 + tsetshift_[3] + (p[1] - 1) * tshift_[8]
3549 + (p[2] - 1) * tshift_[9] + 1;
3550 case 18:
3551 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
3552 + (p[2] - 1) * tshift_[11];
3553 case 19:
3554 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
3555 + (p[2] - 1) * tshift_[11] + 1;
3556 case 20:
3557 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1];
3558 case 21:
3559 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3560 case 22:
3561 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2]
3562 + (p[2] - 1) * tshift_[3];
3563 case 23:
3564 return p[0] * 2 + tsetshift_[0] + p[1] * tshift_[2]
3565 + (p[2] - 1) * tshift_[3] + 1;
3566 case 24:
3567 return (p[0] - 1) * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
3568 case 25:
3569 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
3570 + p[2] * tshift_[7];
3571 case 26:
3572 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
3573 + p[2] * tshift_[5];
3574 case 27:
3575 return p[0] * 2 + tsetshift_[2] + p[1] * tshift_[6]
3576 + (p[2] - 1) * tshift_[7] + 1;
3577 case 28:
3578 return p[0] * 2 + tsetshift_[1] + p[1] * tshift_[4]
3579 + (p[2] - 1) * tshift_[5] + 1;
3580 case 29:
3581 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
3582 case 30:
3583 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
3584 + (p[2] - 1) * tshift_[9] + 1;
3585 case 31:
3586 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
3587 + (p[2] - 1) * tshift_[3] + 1;
3588 case 32:
3589 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3];
3590 case 33:
3591 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9];
3592 case 34:
3593 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
3594 + (p[2] - 1) * tshift_[11] + 1;
3595 case 35:
3596 return p[0] * 2 + tsetshift_[4] + (p[1] - 1) * tshift_[10]
3597 + p[2] * tshift_[11];
3598 }
3599 return -1;
3600}
3601
3602inline ttk::SimplexId
3603 ttk::ImplicitTriangulation::getVertexLinkA(const SimplexId p[3],
3604 const int id) const {
3605 switch(id) {
3606 case 0:
3607 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
3608 + p[2] * tshift_[11]; // D3::bcg
3609 case 1:
3610 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
3611 + 1; // D1::beg
3612 }
3613 return -1;
3614}
3615
3616inline ttk::SimplexId
3617 ttk::ImplicitTriangulation::getVertexLinkB(const SimplexId p[3],
3618 const int id) const {
3619 switch(id) {
3620 case 0:
3621 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
3622 + p[2] * tshift_[5]; // C::acg
3623 case 1:
3624 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
3625 + p[2] * tshift_[5] + 1; // C::aeg
3626 case 2:
3627 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
3628 + p[2] * tshift_[3]; // H::abe
3629 case 3:
3630 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
3631 + p[2] * tshift_[3] + 1; // H::bef
3632 case 4:
3633 return (p[0] - 1) * 2 + p[1] * tshift_[0]
3634 + (p[2] + 1) * tshift_[1]; // F::abc
3635 case 5:
3636 return (p[0] - 1) * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1]
3637 + 1; // F::bcd
3638 }
3639 return -1;
3640}
3641
3642inline ttk::SimplexId
3643 ttk::ImplicitTriangulation::getVertexLinkC(const SimplexId p[3],
3644 const int id) const {
3645 switch(id) {
3646 case 0:
3647 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
3648 + p[2] * tshift_[9]; // D2::abg
3649 case 1:
3650 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
3651 + p[2] * tshift_[7]; // D1::bdg
3652 }
3653 return -1;
3654}
3655
3656inline ttk::SimplexId
3657 ttk::ImplicitTriangulation::getVertexLinkD(const SimplexId p[3],
3658 const int id) const {
3659 switch(id) {
3660 case 0:
3661 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
3662 + p[2] * tshift_[11]; // D3::bcg
3663 case 1:
3664 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
3665 + p[2] * tshift_[9] + 1; // D2::bgh
3666 }
3667 return -1;
3668}
3669
3670inline ttk::SimplexId
3671 ttk::ImplicitTriangulation::getVertexLinkE(const SimplexId p[3],
3672 const int id) const {
3673 switch(id) {
3674 case 0:
3675 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8]
3676 + (p[2] - 1) * tshift_[9]; // D2::abg
3677 case 1:
3678 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
3679 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
3680 }
3681 return -1;
3682}
3683
3684inline ttk::SimplexId
3685 ttk::ImplicitTriangulation::getVertexLinkF(const SimplexId p[3],
3686 const int id) const {
3687 switch(id) {
3688 case 0:
3689 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
3690 + (p[2] - 1) * tshift_[7] + 1; // D1::beg
3691 case 1:
3692 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
3693 + (p[2] - 1) * tshift_[9] + 1; // D2::bgh
3694 }
3695 return -1;
3696}
3697
3698inline ttk::SimplexId
3699 ttk::ImplicitTriangulation::getVertexLinkG(const SimplexId p[3],
3700 const int id) const {
3701 switch(id) {
3702 case 0:
3703 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
3704 + (p[2] - 1) * tshift_[5]; // C::acg
3705 case 1:
3706 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
3707 + (p[2] - 1) * tshift_[5] + 1; // C::aeg
3708 case 2:
3709 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
3710 + (p[2] - 1) * tshift_[3]; // H::abe
3711 case 3:
3712 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
3713 + (p[2] - 1) * tshift_[3] + 1; // H::bef
3714 case 4:
3715 return p[0] * 2 + (p[1] - 1) * tshift_[0]
3716 + (p[2] - 1) * tshift_[1]; // F::abc
3717 case 5:
3718 return p[0] * 2 + (p[1] - 1) * tshift_[0] + (p[2] - 1) * tshift_[1]
3719 + 1; // F::bcd
3720 }
3721 return -1;
3722}
3723
3724inline ttk::SimplexId
3725 ttk::ImplicitTriangulation::getVertexLinkH(const SimplexId p[3],
3726 const int id) const {
3727 switch(id) {
3728 case 0:
3729 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
3730 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
3731 case 1:
3732 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
3733 + (p[2] - 1) * tshift_[7]; // D1::bdg
3734 }
3735 return -1;
3736}
3737
3738inline ttk::SimplexId
3739 ttk::ImplicitTriangulation::getVertexLinkAB(const SimplexId p[3],
3740 const int id) const {
3741 switch(id) {
3742 case 0:
3743 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
3744 + p[2] * tshift_[11]; // D3::bcg
3745 case 1:
3746 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
3747 + 1; // D1::beg
3748 case 2:
3749 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
3750 + p[2] * tshift_[5]; // C::acg
3751 case 3:
3752 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
3753 + p[2] * tshift_[5] + 1; // C::aeg
3754 case 4:
3755 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
3756 + p[2] * tshift_[3]; // H::abe
3757 case 5:
3758 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
3759 + p[2] * tshift_[3] + 1; // H::bef
3760 case 6:
3761 return (p[0] - 1) * 2 + p[1] * tshift_[0]
3762 + (p[2] + 1) * tshift_[1]; // F::abc
3763 case 7:
3764 return (p[0] - 1) * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1]
3765 + 1; // F::bcd
3766 }
3767 return -1;
3768}
3769
3770inline ttk::SimplexId
3771 ttk::ImplicitTriangulation::getVertexLinkCD(const SimplexId p[3],
3772 const int id) const {
3773 switch(id) {
3774 case 0:
3775 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
3776 + p[2] * tshift_[9]; // D2::abg
3777 case 1:
3778 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
3779 + p[2] * tshift_[7]; // D1::bdg
3780 case 2:
3781 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
3782 + p[2] * tshift_[11]; // D3::bcg
3783 case 3:
3784 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
3785 + p[2] * tshift_[9] + 1; // D2::bgh
3786 }
3787 return -1;
3788}
3789
3790inline ttk::SimplexId
3791 ttk::ImplicitTriangulation::getVertexLinkEF(const SimplexId p[3],
3792 const int id) const {
3793 switch(id) {
3794 case 0:
3795 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8]
3796 + (p[2] - 1) * tshift_[9]; // D2::abg
3797 case 1:
3798 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
3799 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
3800 case 2:
3801 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
3802 + (p[2] - 1) * tshift_[7] + 1; // D1::beg
3803 case 3:
3804 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
3805 + (p[2] - 1) * tshift_[9] + 1; // D2::bgh
3806 }
3807 return -1;
3808}
3809
3810inline ttk::SimplexId
3811 ttk::ImplicitTriangulation::getVertexLinkGH(const SimplexId p[3],
3812 const int id) const {
3813 switch(id) {
3814 case 0:
3815 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
3816 + (p[2] - 1) * tshift_[5]; // C::acg
3817 case 1:
3818 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
3819 + (p[2] - 1) * tshift_[5] + 1; // C::aeg
3820 case 2:
3821 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
3822 + (p[2] - 1) * tshift_[3]; // H::abe
3823 case 3:
3824 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
3825 + (p[2] - 1) * tshift_[3] + 1; // H::bef
3826 case 4:
3827 return p[0] * 2 + (p[1] - 1) * tshift_[0]
3828 + (p[2] - 1) * tshift_[1]; // F::abc
3829 case 5:
3830 return p[0] * 2 + (p[1] - 1) * tshift_[0] + (p[2] - 1) * tshift_[1]
3831 + 1; // F::bcd
3832 case 6:
3833 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
3834 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
3835 case 7:
3836 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
3837 + (p[2] - 1) * tshift_[7]; // D1::bdg
3838 }
3839 return -1;
3840}
3841
3842inline ttk::SimplexId
3843 ttk::ImplicitTriangulation::getVertexLinkAC(const SimplexId p[3],
3844 const int id) const {
3845 switch(id) {
3846 case 0:
3847 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
3848 + p[2] * tshift_[11]; // D3::bcg
3849 case 1:
3850 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
3851 + 1; // D1::beg
3852 case 2:
3853 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
3854 + p[2] * tshift_[9]; // D2::abg
3855 case 3:
3856 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
3857 + p[2] * tshift_[7]; // D1::bdg
3858 }
3859 return -1;
3860}
3861
3862inline ttk::SimplexId
3863 ttk::ImplicitTriangulation::getVertexLinkBD(const SimplexId p[3],
3864 const int id) const {
3865 switch(id) {
3866 case 0:
3867 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
3868 + p[2] * tshift_[5]; // C::acg
3869 case 1:
3870 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
3871 + p[2] * tshift_[5] + 1; // C::aeg
3872 case 2:
3873 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
3874 + p[2] * tshift_[3]; // H::abe
3875 case 3:
3876 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
3877 + p[2] * tshift_[3] + 1; // H::bef
3878 case 4:
3879 return (p[0] - 1) * 2 + p[1] * tshift_[0]
3880 + (p[2] + 1) * tshift_[1]; // F::abc
3881 case 5:
3882 return (p[0] - 1) * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1]
3883 + 1; // F::bcd
3884 case 6:
3885 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
3886 + p[2] * tshift_[11]; // D3::bcg
3887 case 7:
3888 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
3889 + p[2] * tshift_[9] + 1; // D2::bgh
3890 }
3891 return -1;
3892}
3893
3894inline ttk::SimplexId
3895 ttk::ImplicitTriangulation::getVertexLinkEG(const SimplexId p[3],
3896 const int id) const {
3897 switch(id) {
3898 case 0:
3899 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8]
3900 + (p[2] - 1) * tshift_[9]; // D2::abg
3901 case 1:
3902 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
3903 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
3904 case 2:
3905 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
3906 + (p[2] - 1) * tshift_[5]; // C::acg
3907 case 3:
3908 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
3909 + (p[2] - 1) * tshift_[5] + 1; // C::aeg
3910 case 4:
3911 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
3912 + (p[2] - 1) * tshift_[3]; // H::abe
3913 case 5:
3914 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
3915 + (p[2] - 1) * tshift_[3] + 1; // H::bef
3916 case 6:
3917 return p[0] * 2 + (p[1] - 1) * tshift_[0]
3918 + (p[2] - 1) * tshift_[1]; // F::abc
3919 case 7:
3920 return p[0] * 2 + (p[1] - 1) * tshift_[0] + (p[2] - 1) * tshift_[1]
3921 + 1; // F::bcd
3922 }
3923 return -1;
3924}
3925
3926inline ttk::SimplexId
3927 ttk::ImplicitTriangulation::getVertexLinkFH(const SimplexId p[3],
3928 const int id) const {
3929 switch(id) {
3930 case 0:
3931 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
3932 + (p[2] - 1) * tshift_[7] + 1; // D1::beg
3933 case 1:
3934 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
3935 + (p[2] - 1) * tshift_[9] + 1; // D2::bgh
3936 case 2:
3937 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
3938 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
3939 case 3:
3940 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
3941 + (p[2] - 1) * tshift_[7]; // D1::bdg
3942 }
3943 return -1;
3944}
3945
3946inline ttk::SimplexId
3947 ttk::ImplicitTriangulation::getVertexLinkAE(const SimplexId p[3],
3948 const int id) const {
3949 switch(id) {
3950 case 0:
3951 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
3952 + p[2] * tshift_[11]; // D3::bcg
3953 case 1:
3954 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
3955 + 1; // D1::beg
3956 case 2:
3957 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8]
3958 + (p[2] - 1) * tshift_[9]; // D2::abg
3959 case 3:
3960 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
3961 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
3962 }
3963 return -1;
3964}
3965
3966inline ttk::SimplexId
3967 ttk::ImplicitTriangulation::getVertexLinkBF(const SimplexId p[3],
3968 const int id) const {
3969 switch(id) {
3970 case 0:
3971 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
3972 + p[2] * tshift_[5]; // C::acg
3973 case 1:
3974 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
3975 + p[2] * tshift_[5] + 1; // C::aeg
3976 case 2:
3977 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
3978 + p[2] * tshift_[3]; // H::abe
3979 case 3:
3980 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
3981 + p[2] * tshift_[3] + 1; // H::bef
3982 case 4:
3983 return (p[0] - 1) * 2 + p[1] * tshift_[0]
3984 + (p[2] + 1) * tshift_[1]; // F::abc
3985 case 5:
3986 return (p[0] - 1) * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1]
3987 + 1; // F::bcd
3988 case 6:
3989 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
3990 + (p[2] - 1) * tshift_[7] + 1; // D1::beg
3991 case 7:
3992 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
3993 + (p[2] - 1) * tshift_[9] + 1; // D2::bgh
3994 }
3995 return -1;
3996}
3997
3998inline ttk::SimplexId
3999 ttk::ImplicitTriangulation::getVertexLinkCG(const SimplexId p[3],
4000 const int id) const {
4001 switch(id) {
4002 case 0:
4003 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
4004 + p[2] * tshift_[9]; // D2::abg
4005 case 1:
4006 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
4007 + p[2] * tshift_[7]; // D1::bdg
4008 case 2:
4009 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4010 + (p[2] - 1) * tshift_[5]; // C::acg
4011 case 3:
4012 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4013 + (p[2] - 1) * tshift_[5] + 1; // C::aeg
4014 case 4:
4015 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4016 + (p[2] - 1) * tshift_[3]; // H::abe
4017 case 5:
4018 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4019 + (p[2] - 1) * tshift_[3] + 1; // H::bef
4020 case 6:
4021 return p[0] * 2 + (p[1] - 1) * tshift_[0]
4022 + (p[2] - 1) * tshift_[1]; // F::abc
4023 case 7:
4024 return p[0] * 2 + (p[1] - 1) * tshift_[0] + (p[2] - 1) * tshift_[1]
4025 + 1; // F::bcd
4026 }
4027 return -1;
4028}
4029
4030inline ttk::SimplexId
4031 ttk::ImplicitTriangulation::getVertexLinkDH(const SimplexId p[3],
4032 const int id) const {
4033 switch(id) {
4034 case 0:
4035 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4036 + p[2] * tshift_[11]; // D3::bcg
4037 case 1:
4038 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
4039 + p[2] * tshift_[9] + 1; // D2::bgh
4040 case 2:
4041 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4042 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4043 case 3:
4044 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
4045 + (p[2] - 1) * tshift_[7]; // D1::bdg
4046 }
4047 return -1;
4048}
4049
4050inline ttk::SimplexId
4051 ttk::ImplicitTriangulation::getVertexLinkABDC(const SimplexId p[3],
4052 const int id) const {
4053 switch(id) {
4054 case 0:
4055 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
4056 + p[2] * tshift_[11]; // D3::bcg
4057 case 1:
4058 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
4059 + 1; // D1::beg
4060 case 2:
4061 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
4062 + p[2] * tshift_[5]; // C::acg
4063 case 3:
4064 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
4065 + p[2] * tshift_[5] + 1; // C::aeg
4066 case 4:
4067 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
4068 + p[2] * tshift_[3]; // H::abe
4069 case 5:
4070 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
4071 + p[2] * tshift_[3] + 1; // H::bef
4072 case 6:
4073 return (p[0] - 1) * 2 + p[1] * tshift_[0]
4074 + (p[2] + 1) * tshift_[1]; // F::abc
4075 case 7:
4076 return (p[0] - 1) * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1]
4077 + 1; // F::bcd
4078 case 8:
4079 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4080 + p[2] * tshift_[11]; // D3::bcg
4081 case 9:
4082 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
4083 + p[2] * tshift_[9] + 1; // D2::bgh
4084 case 10:
4085 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
4086 + p[2] * tshift_[9]; // D2::abg
4087 case 11:
4088 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
4089 + p[2] * tshift_[7]; // D1::bdg
4090 }
4091 return -1;
4092}
4093
4094inline ttk::SimplexId
4095 ttk::ImplicitTriangulation::getVertexLinkEFHG(const SimplexId p[3],
4096 const int id) const {
4097 switch(id) {
4098 case 0:
4099 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8]
4100 + (p[2] - 1) * tshift_[9]; // D2::abg
4101 case 1:
4102 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
4103 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4104 case 2:
4105 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
4106 + (p[2] - 1) * tshift_[7] + 1; // D1::beg
4107 case 3:
4108 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
4109 + (p[2] - 1) * tshift_[9] + 1; // D2::bgh
4110 case 4:
4111 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4112 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4113 case 5:
4114 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
4115 + (p[2] - 1) * tshift_[7]; // D1::bdg
4116 case 6:
4117 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4118 + (p[2] - 1) * tshift_[5]; // C::acg
4119 case 7:
4120 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4121 + (p[2] - 1) * tshift_[5] + 1; // C::aeg
4122 case 8:
4123 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4124 + (p[2] - 1) * tshift_[3]; // H::abe
4125 case 9:
4126 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4127 + (p[2] - 1) * tshift_[3] + 1; // H::bef
4128 case 10:
4129 return p[0] * 2 + (p[1] - 1) * tshift_[0]
4130 + (p[2] - 1) * tshift_[1]; // F::abc
4131 case 11:
4132 return p[0] * 2 + (p[1] - 1) * tshift_[0] + (p[2] - 1) * tshift_[1]
4133 + 1; // F::bcd
4134 }
4135 return -1;
4136}
4137
4138inline ttk::SimplexId
4139 ttk::ImplicitTriangulation::getVertexLinkAEGC(const SimplexId p[3],
4140 const int id) const {
4141 switch(id) {
4142 case 0:
4143 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
4144 + p[2] * tshift_[11]; // D3::bcg
4145 case 1:
4146 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
4147 + 1; // D1::beg
4148 case 2:
4149 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8]
4150 + (p[2] - 1) * tshift_[9]; // D2::abg
4151 case 3:
4152 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
4153 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4154 case 4:
4155 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4156 + (p[2] - 1) * tshift_[5]; // C::acg
4157 case 5:
4158 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4159 + (p[2] - 1) * tshift_[5] + 1; // C::aeg
4160 case 6:
4161 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4162 + (p[2] - 1) * tshift_[3]; // H::abe
4163 case 7:
4164 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4165 + (p[2] - 1) * tshift_[3] + 1; // H::bef
4166 case 8:
4167 return p[0] * 2 + (p[1] - 1) * tshift_[0]
4168 + (p[2] - 1) * tshift_[1]; // F::abc
4169 case 9:
4170 return p[0] * 2 + (p[1] - 1) * tshift_[0] + (p[2] - 1) * tshift_[1]
4171 + 1; // F::bcd
4172 case 10:
4173 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
4174 + p[2] * tshift_[9]; // D2::abg
4175 case 11:
4176 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
4177 + p[2] * tshift_[7]; // D1::bdg
4178 }
4179 return -1;
4180}
4181
4182inline ttk::SimplexId
4183 ttk::ImplicitTriangulation::getVertexLinkBFHD(const SimplexId p[3],
4184 const int id) const {
4185 switch(id) {
4186 case 0:
4187 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
4188 + p[2] * tshift_[5]; // C::acg
4189 case 1:
4190 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
4191 + p[2] * tshift_[5] + 1; // C::aeg
4192 case 2:
4193 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
4194 + p[2] * tshift_[3]; // H::abe
4195 case 3:
4196 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
4197 + p[2] * tshift_[3] + 1; // H::bef
4198 case 4:
4199 return (p[0] - 1) * 2 + p[1] * tshift_[0]
4200 + (p[2] + 1) * tshift_[1]; // F::abc
4201 case 5:
4202 return (p[0] - 1) * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1]
4203 + 1; // F::bcd
4204 case 6:
4205 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
4206 + (p[2] - 1) * tshift_[7] + 1; // D1::beg
4207 case 7:
4208 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
4209 + (p[2] - 1) * tshift_[9] + 1; // D2::bgh
4210 case 8:
4211 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4212 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4213 case 9:
4214 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
4215 + (p[2] - 1) * tshift_[7]; // D1::bdg
4216 case 10:
4217 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4218 + p[2] * tshift_[11]; // D3::bcg
4219 case 11:
4220 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
4221 + p[2] * tshift_[9] + 1; // D2::bgh
4222 }
4223 return -1;
4224}
4225
4226inline ttk::SimplexId
4227 ttk::ImplicitTriangulation::getVertexLinkAEFB(const SimplexId p[3],
4228 const int id) const {
4229 switch(id) {
4230 case 0:
4231 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
4232 + p[2] * tshift_[11]; // D3::bcg
4233 case 1:
4234 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
4235 + 1; // D1::beg
4236 case 2:
4237 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8]
4238 + (p[2] - 1) * tshift_[9]; // D2::abg
4239 case 3:
4240 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
4241 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4242 case 4:
4243 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
4244 + (p[2] - 1) * tshift_[7] + 1; // D1::beg
4245 case 5:
4246 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
4247 + (p[2] - 1) * tshift_[9] + 1; // D2::bgh
4248 case 6:
4249 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
4250 + p[2] * tshift_[5]; // C::acg
4251 case 7:
4252 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
4253 + p[2] * tshift_[5] + 1; // C::aeg
4254 case 8:
4255 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
4256 + p[2] * tshift_[3]; // H::abe
4257 case 9:
4258 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
4259 + p[2] * tshift_[3] + 1; // H::bef
4260 case 10:
4261 return (p[0] - 1) * 2 + p[1] * tshift_[0]
4262 + (p[2] + 1) * tshift_[1]; // F::abc
4263 case 11:
4264 return (p[0] - 1) * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1]
4265 + 1; // F::bcd
4266 }
4267 return -1;
4268}
4269
4270inline ttk::SimplexId
4271 ttk::ImplicitTriangulation::getVertexLinkGHDC(const SimplexId p[3],
4272 const int id) const {
4273 switch(id) {
4274 case 0:
4275 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4276 + (p[2] - 1) * tshift_[5]; // C::acg
4277 case 1:
4278 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4279 + (p[2] - 1) * tshift_[5] + 1; // C::aeg
4280 case 2:
4281 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4282 + (p[2] - 1) * tshift_[3]; // H::abe
4283 case 3:
4284 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4285 + (p[2] - 1) * tshift_[3] + 1; // H::bef
4286 case 4:
4287 return p[0] * 2 + (p[1] - 1) * tshift_[0]
4288 + (p[2] - 1) * tshift_[1]; // F::abc
4289 case 5:
4290 return p[0] * 2 + (p[1] - 1) * tshift_[0] + (p[2] - 1) * tshift_[1]
4291 + 1; // F::bcd
4292 case 6:
4293 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4294 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4295 case 7:
4296 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
4297 + (p[2] - 1) * tshift_[7]; // D1::bdg
4298 case 8:
4299 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4300 + p[2] * tshift_[11]; // D3::bcg
4301 case 9:
4302 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
4303 + p[2] * tshift_[9] + 1; // D2::bgh
4304 case 10:
4305 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
4306 + p[2] * tshift_[9]; // D2::abg
4307 case 11:
4308 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
4309 + p[2] * tshift_[7]; // D1::bdg
4310 }
4311 return -1;
4312}
4313
4314inline ttk::SimplexId
4315 ttk::ImplicitTriangulation::getVertexLinkABCDEFGH(const SimplexId p[3],
4316 const int id) const {
4317 switch(id) {
4318 case 0:
4319 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
4320 + p[2] * tshift_[11]; // D3::bcg
4321 case 1:
4322 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
4323 + 1; // D1::beg
4324 case 2:
4325 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
4326 + p[2] * tshift_[5]; // C::acg
4327 case 3:
4328 return tsetshift_[1] + (p[0] - 1) * 2 + p[1] * tshift_[4]
4329 + p[2] * tshift_[5] + 1; // C::aeg
4330 case 4:
4331 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
4332 + p[2] * tshift_[3]; // H::abe
4333 case 5:
4334 return tsetshift_[0] + (p[0] - 1) * 2 + (p[1] + 1) * tshift_[2]
4335 + p[2] * tshift_[3] + 1; // H::bef
4336 case 6:
4337 return (p[0] - 1) * 2 + p[1] * tshift_[0]
4338 + (p[2] + 1) * tshift_[1]; // F::abc
4339 case 7:
4340 return (p[0] - 1) * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1]
4341 + 1; // F::bcd
4342 case 8:
4343 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
4344 + p[2] * tshift_[9]; // D2::abg
4345 case 9:
4346 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
4347 + p[2] * tshift_[7]; // D1::bdg
4348 case 10:
4349 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4350 + p[2] * tshift_[11]; // D3::bcg
4351 case 11:
4352 return tsetshift_[3] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[8]
4353 + p[2] * tshift_[9] + 1; // D2::bgh
4354 case 12:
4355 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8]
4356 + (p[2] - 1) * tshift_[9]; // D2::abg
4357 case 13:
4358 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
4359 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4360 case 14:
4361 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
4362 + (p[2] - 1) * tshift_[7] + 1; // D1::beg
4363 case 15:
4364 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
4365 + (p[2] - 1) * tshift_[9] + 1; // D2::bgh
4366 case 16:
4367 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4368 + (p[2] - 1) * tshift_[5]; // C::acg
4369 case 17:
4370 return tsetshift_[1] + (p[0] + 1) * 2 + (p[1] - 1) * tshift_[4]
4371 + (p[2] - 1) * tshift_[5] + 1; // C::aeg
4372 case 18:
4373 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4374 + (p[2] - 1) * tshift_[3]; // H::abe
4375 case 19:
4376 return tsetshift_[0] + p[0] * 2 + (p[1] - 1) * tshift_[2]
4377 + (p[2] - 1) * tshift_[3] + 1; // H::bef
4378 case 20:
4379 return p[0] * 2 + (p[1] - 1) * tshift_[0]
4380 + (p[2] - 1) * tshift_[1]; // F::abc
4381 case 21:
4382 return p[0] * 2 + (p[1] - 1) * tshift_[0] + (p[2] - 1) * tshift_[1]
4383 + 1; // F::bcd
4384 case 22:
4385 return tsetshift_[4] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[10]
4386 + (p[2] - 1) * tshift_[11] + 1; // D3::bfg
4387 case 23:
4388 return tsetshift_[2] + (p[0] - 1) * 2 + (p[1] - 1) * tshift_[6]
4389 + (p[2] - 1) * tshift_[7]; // D1::bdg
4390 }
4391 return -1;
4392}
4393
4394inline ttk::SimplexId
4395 ttk::ImplicitTriangulation::getVertexStarA(const SimplexId p[3],
4396 const int id) const {
4397 switch(id) {
4398 case 0:
4399 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]; // abcg
4400 case 1:
4401 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1] + 2; // abeg
4402 }
4403 return -1;
4404}
4405
4406inline ttk::SimplexId
4407 ttk::ImplicitTriangulation::getVertexStarB(const SimplexId p[3],
4408 const int id) const {
4409 if(id >= 0 && id <= 5)
4410 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1] + id;
4411 return -1;
4412}
4413
4414inline ttk::SimplexId
4415 ttk::ImplicitTriangulation::getVertexStarC(const SimplexId p[3],
4416 const int id) const {
4417 switch(id) {
4418 case 0:
4419 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]; // abcg
4420 case 1:
4421 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4422 + 1; // bcdg
4423 }
4424 return -1;
4425}
4426
4427inline ttk::SimplexId
4428 ttk::ImplicitTriangulation::getVertexStarD(const SimplexId p[3],
4429 const int id) const {
4430 switch(id) {
4431 case 0:
4432 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4433 + 1; // bcdg
4434 case 1:
4435 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4436 + 5; // bdgh
4437 }
4438 return -1;
4439}
4440
4441inline ttk::SimplexId
4442 ttk::ImplicitTriangulation::getVertexStarE(const SimplexId p[3],
4443 const int id) const {
4444 switch(id) {
4445 case 0:
4446 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4447 + 2; // abeg
4448 case 1:
4449 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4450 + 3; // befg
4451 }
4452 return -1;
4453}
4454
4455inline ttk::SimplexId
4456 ttk::ImplicitTriangulation::getVertexStarF(const SimplexId p[3],
4457 const int id) const {
4458 switch(id) {
4459 case 0:
4460 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4461 + 3; // befg
4462 case 1:
4463 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4464 + 4; // bfgh
4465 }
4466 return -1;
4467}
4468
4469inline ttk::SimplexId
4470 ttk::ImplicitTriangulation::getVertexStarG(const SimplexId p[3],
4471 const int id) const {
4472 if(id >= 0 && id <= 5)
4473 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4474 + id;
4475 return -1;
4476}
4477
4478inline ttk::SimplexId
4479 ttk::ImplicitTriangulation::getVertexStarH(const SimplexId p[3],
4480 const int id) const {
4481 switch(id) {
4482 case 0:
4483 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4484 + (p[2] - 1) * tetshift_[1] + 4; // bfgh
4485 case 1:
4486 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4487 + (p[2] - 1) * tetshift_[1] + 5; // bdgh
4488 }
4489 return -1;
4490}
4491
4492inline ttk::SimplexId
4493 ttk::ImplicitTriangulation::getVertexStarAB(const SimplexId p[3],
4494 const int id) const {
4495 if(id >= 0 && id <= 5)
4496 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4497 + id; // tet(b)
4498 switch(id) {
4499 case 6:
4500 return p[0] * 6 + p[1] * tetshift_[0]
4501 + p[2] * tetshift_[1]; // tet(a)::abcg
4502 case 7:
4503 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4504 + 2; // tet(a)::abeg
4505 }
4506 return -1;
4507}
4508
4509inline ttk::SimplexId
4510 ttk::ImplicitTriangulation::getVertexStarCD(const SimplexId p[3],
4511 const int id) const {
4512 switch(id) {
4513 case 0:
4514 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4515 + 1; // tet(d)::bcdg
4516 case 1:
4517 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4518 + 5; // tet(d)::bdgh
4519 case 2:
4520 return p[0] * 6 + (p[1] - 1) * tetshift_[0]
4521 + p[2] * tetshift_[1]; // tet(c)::abcg
4522 case 3:
4523 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4524 + 1; // tet(c)::bcdg
4525 }
4526 return -1;
4527}
4528
4529inline ttk::SimplexId
4530 ttk::ImplicitTriangulation::getVertexStarEF(const SimplexId p[3],
4531 const int id) const {
4532 switch(id) {
4533 case 0:
4534 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4535 + 3; // tet(f)::befg
4536 case 1:
4537 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4538 + 4; // tet(f)::bfgh
4539 case 2:
4540 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4541 + 2; // tet(e)::abeg
4542 case 3:
4543 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4544 + 3; // tet(e)::befg
4545 }
4546 return -1;
4547}
4548
4549inline ttk::SimplexId
4550 ttk::ImplicitTriangulation::getVertexStarGH(const SimplexId p[3],
4551 const int id) const {
4552 if(id >= 0 && id <= 5)
4553 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4554 + id; // tet(g)
4555 switch(id) {
4556 case 6:
4557 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4558 + (p[2] - 1) * tetshift_[1] + 4; // tet(h)::bfgh
4559 case 7:
4560 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4561 + (p[2] - 1) * tetshift_[1] + 5; // tet(h)::bdgh
4562 }
4563 return -1;
4564}
4565
4566inline ttk::SimplexId
4567 ttk::ImplicitTriangulation::getVertexStarAC(const SimplexId p[3],
4568 const int id) const {
4569 switch(id) {
4570 case 0:
4571 return p[0] * 6 + (p[1] - 1) * tetshift_[0]
4572 + p[2] * tetshift_[1]; // tet(c)::abcg
4573 case 1:
4574 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4575 + 1; // tet(c)::bcdg
4576 case 2:
4577 return p[0] * 6 + p[1] * tetshift_[0]
4578 + p[2] * tetshift_[1]; // tet(a)::abcg
4579 case 3:
4580 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4581 + 2; // tet(a)::abeg
4582 }
4583 return -1;
4584}
4585
4586inline ttk::SimplexId
4587 ttk::ImplicitTriangulation::getVertexStarBD(const SimplexId p[3],
4588 const int id) const {
4589 if(id >= 0 && id <= 5)
4590 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4591 + id; // tet(b)
4592 switch(id) {
4593 case 6:
4594 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4595 + 1; // tet(d)::bcdg
4596 case 7:
4597 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4598 + 5; // tet(d)::bdgh
4599 }
4600 return -1;
4601}
4602
4603inline ttk::SimplexId
4604 ttk::ImplicitTriangulation::getVertexStarEG(const SimplexId p[3],
4605 const int id) const {
4606 if(id >= 0 && id <= 5)
4607 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4608 + id; // tet(g)
4609 switch(id) {
4610 case 6:
4611 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4612 + 2; // tet(e)::abeg
4613 case 7:
4614 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4615 + 3; // tet(e)::befg
4616 }
4617 return -1;
4618}
4619
4620inline ttk::SimplexId
4621 ttk::ImplicitTriangulation::getVertexStarFH(const SimplexId p[3],
4622 const int id) const {
4623 switch(id) {
4624 case 0:
4625 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4626 + (p[2] - 1) * tetshift_[1] + 4; // tet(h)::bfgh
4627 case 1:
4628 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4629 + (p[2] - 1) * tetshift_[1] + 5; // tet(h)::bdgh
4630 case 2:
4631 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4632 + 3; // tet(f)::befg
4633 case 3:
4634 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4635 + 4; // tet(f)::bfgh
4636 }
4637 return -1;
4638}
4639
4640inline ttk::SimplexId
4641 ttk::ImplicitTriangulation::getVertexStarAE(const SimplexId p[3],
4642 const int id) const {
4643 switch(id) {
4644 case 0:
4645 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4646 + 2; // tet(e)::abeg
4647 case 1:
4648 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4649 + 3; // tet(e)::befg
4650 case 2:
4651 return p[0] * 6 + p[1] * tetshift_[0]
4652 + p[2] * tetshift_[1]; // tet(a)::abcg
4653 case 3:
4654 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4655 + 2; // tet(a)::abeg
4656 }
4657 return -1;
4658}
4659
4660inline ttk::SimplexId
4661 ttk::ImplicitTriangulation::getVertexStarBF(const SimplexId p[3],
4662 const int id) const {
4663 if(id >= 0 && id <= 5)
4664 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4665 + id; // tet(b)
4666 switch(id) {
4667 case 6:
4668 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4669 + 3; // tet(f)::befg
4670 case 7:
4671 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4672 + 4; // tet(f)::bfgh
4673 }
4674 return -1;
4675}
4676
4677inline ttk::SimplexId
4678 ttk::ImplicitTriangulation::getVertexStarCG(const SimplexId p[3],
4679 const int id) const {
4680 if(id >= 0 && id <= 5)
4681 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4682 + id; // tet(g)
4683 switch(id) {
4684 case 6:
4685 return p[0] * 6 + (p[1] - 1) * tetshift_[0]
4686 + p[2] * tetshift_[1]; // tet(c)::abcg
4687 case 7:
4688 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4689 + 1; // tet(c)::bcdg
4690 }
4691 return -1;
4692}
4693
4694inline ttk::SimplexId
4695 ttk::ImplicitTriangulation::getVertexStarDH(const SimplexId p[3],
4696 const int id) const {
4697 switch(id) {
4698 case 0:
4699 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4700 + (p[2] - 1) * tetshift_[1] + 4; // tet(h)::bfgh
4701 case 1:
4702 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4703 + (p[2] - 1) * tetshift_[1] + 5; // tet(h)::bdgh
4704 case 2:
4705 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4706 + 1; // tet(d)::bcdg
4707 case 3:
4708 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4709 + 5; // tet(d)::bdgh
4710 }
4711 return -1;
4712}
4713
4714inline ttk::SimplexId
4715 ttk::ImplicitTriangulation::getVertexStarABDC(const SimplexId p[3],
4716 const int id) const {
4717 if(id >= 0 && id <= 5)
4718 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4719 + id; // tet(b)
4720 switch(id) {
4721 case 6:
4722 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4723 + 1; // tet(d)::bcdg
4724 case 7:
4725 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4726 + 5; // tet(d)::bdgh
4727 case 8:
4728 return p[0] * 6 + (p[1] - 1) * tetshift_[0]
4729 + p[2] * tetshift_[1]; // tet(c)::abcg
4730 case 9:
4731 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4732 + 1; // tet(c)::bcdg
4733 case 10:
4734 return p[0] * 6 + p[1] * tetshift_[0]
4735 + p[2] * tetshift_[1]; // tet(a)::abcg
4736 case 11:
4737 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4738 + 2; // tet(a)::abeg
4739 }
4740 return -1;
4741}
4742
4743inline ttk::SimplexId
4744 ttk::ImplicitTriangulation::getVertexStarEFHG(const SimplexId p[3],
4745 const int id) const {
4746 if(id >= 0 && id <= 5)
4747 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4748 + id; // tet(g)
4749 switch(id) {
4750 case 6:
4751 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4752 + (p[2] - 1) * tetshift_[1] + 4; // tet(h)::bfgh
4753 case 7:
4754 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4755 + (p[2] - 1) * tetshift_[1] + 5; // tet(h)::bdgh
4756 case 8:
4757 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4758 + 3; // tet(f)::befg
4759 case 9:
4760 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4761 + 4; // tet(f)::bfgh
4762 case 10:
4763 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4764 + 2; // tet(e)::abeg
4765 case 11:
4766 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4767 + 3; // tet(e)::befg
4768 }
4769 return -1;
4770}
4771
4772inline ttk::SimplexId
4773 ttk::ImplicitTriangulation::getVertexStarAEGC(const SimplexId p[3],
4774 const int id) const {
4775 if(id >= 0 && id <= 5)
4776 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4777 + id; // tet(g)
4778 switch(id) {
4779 case 6:
4780 return p[0] * 6 + (p[1] - 1) * tetshift_[0]
4781 + p[2] * tetshift_[1]; // tet(c)::abcg
4782 case 7:
4783 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4784 + 1; // tet(c)::bcdg
4785 case 8:
4786 return p[0] * 6 + p[1] * tetshift_[0]
4787 + p[2] * tetshift_[1]; // tet(a)::abcg
4788 case 9:
4789 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4790 + 2; // tet(a)::abeg
4791 case 10:
4792 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4793 + 2; // tet(e)::abeg
4794 case 11:
4795 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4796 + 3; // tet(e)::befg
4797 }
4798 return -1;
4799}
4800
4801inline ttk::SimplexId
4802 ttk::ImplicitTriangulation::getVertexStarBFHD(const SimplexId p[3],
4803 const int id) const {
4804 if(id >= 0 && id <= 5)
4805 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4806 + id; // tet(b)
4807 switch(id) {
4808 case 6:
4809 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4810 + 3; // tet(f)::befg
4811 case 7:
4812 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4813 + 4; // tet(f)::bfgh
4814 case 8:
4815 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4816 + (p[2] - 1) * tetshift_[1] + 4; // tet(h)::bfgh
4817 case 9:
4818 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4819 + (p[2] - 1) * tetshift_[1] + 5; // tet(h)::bdgh
4820 case 10:
4821 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4822 + 1; // tet(d)::bcdg
4823 case 11:
4824 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4825 + 5; // tet(d)::bdgh
4826 }
4827 return -1;
4828}
4829
4830inline ttk::SimplexId
4831 ttk::ImplicitTriangulation::getVertexStarAEFB(const SimplexId p[3],
4832 const int id) const {
4833 if(id >= 0 && id <= 5)
4834 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4835 + id; // tet(b)
4836 switch(id) {
4837 case 6:
4838 return p[0] * 6 + p[1] * tetshift_[0]
4839 + p[2] * tetshift_[1]; // tet(a)::abcg
4840 case 7:
4841 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4842 + 2; // tet(a)::abeg
4843 case 8:
4844 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4845 + 3; // tet(f)::befg
4846 case 9:
4847 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4848 + 4; // tet(f)::bfgh
4849 case 10:
4850 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4851 + 2; // tet(e)::abeg
4852 case 11:
4853 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4854 + 3; // tet(e)::befg
4855 }
4856 return -1;
4857}
4858
4859inline ttk::SimplexId
4860 ttk::ImplicitTriangulation::getVertexStarGHDC(const SimplexId p[3],
4861 const int id) const {
4862 if(id >= 0 && id <= 5)
4863 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4864 + id; // tet(g)
4865 switch(id) {
4866 case 6:
4867 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4868 + (p[2] - 1) * tetshift_[1] + 4; // tet(h)::bfgh
4869 case 7:
4870 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4871 + (p[2] - 1) * tetshift_[1] + 5; // tet(h)::bdgh
4872 case 8:
4873 return p[0] * 6 + (p[1] - 1) * tetshift_[0]
4874 + p[2] * tetshift_[1]; // tet(c)::abcg
4875 case 9:
4876 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4877 + 1; // tet(c)::bcdg
4878 case 10:
4879 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4880 + 1; // tet(d)::bcdg
4881 case 11:
4882 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4883 + 5; // tet(d)::bdgh
4884 }
4885 return -1;
4886}
4887
4888inline ttk::SimplexId
4889 ttk::ImplicitTriangulation::getVertexStarABCDEFGH(const SimplexId p[3],
4890 const int id) const {
4891 if(id >= 0 && id <= 5)
4892 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4893 + id; // tet(b)
4894 if(id >= 6 && id <= 11)
4895 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1] + id
4896 - 6; // tet(g)
4897 switch(id) {
4898 case 12:
4899 return p[0] * 6 + p[1] * tetshift_[0]
4900 + p[2] * tetshift_[1]; // tet(a)::abcg
4901 case 13:
4902 return p[0] * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
4903 + 2; // tet(a)::abeg
4904 case 14:
4905 return p[0] * 6 + (p[1] - 1) * tetshift_[0]
4906 + p[2] * tetshift_[1]; // tet(c)::abcg
4907 case 15:
4908 return p[0] * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4909 + 1; // tet(c)::bcdg
4910 case 16:
4911 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4912 + 1; // tet(d)::bcdg
4913 case 17:
4914 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
4915 + 5; // tet(d)::bdgh
4916 case 18:
4917 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4918 + 2; // tet(e)::abeg
4919 case 19:
4920 return p[0] * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4921 + 3; // tet(e)::befg
4922 case 20:
4923 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4924 + 3; // tet(f)::befg
4925 case 21:
4926 return (p[0] - 1) * 6 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
4927 + 4; // tet(f)::bfgh
4928 case 22:
4929 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4930 + (p[2] - 1) * tetshift_[1] + 4; // tet(h)::bfgh
4931 case 23:
4932 return (p[0] - 1) * 6 + (p[1] - 1) * tetshift_[0]
4933 + (p[2] - 1) * tetshift_[1] + 5; // tet(h)::bdgh
4934 }
4935 return -1;
4936}
4937
4938inline ttk::SimplexId
4939 ttk::ImplicitTriangulation::getEdgeTriangleL_x00(const SimplexId p[3],
4940 const int id) const {
4941 switch(id) {
4942 case 0:
4943 return p[0] * 2;
4944 case 1:
4945 return tsetshift_[0] + p[0] * 2;
4946 case 2:
4947 return tsetshift_[3] + p[0] * 2;
4948 }
4949 return -1;
4950}
4951
4952inline ttk::SimplexId
4953 ttk::ImplicitTriangulation::getEdgeTriangleL_x0n(const SimplexId p[3],
4954 const int id) const {
4955 switch(id) {
4956 case 0:
4957 return p[0] * 2 + p[2] * tshift_[1];
4958 case 1:
4959 return tsetshift_[0] + p[0] * 2 + p[2] * tshift_[3];
4960 case 2:
4961 return tsetshift_[3] + p[0] * 2 + p[2] * tshift_[9];
4962 case 3:
4963 return tsetshift_[0] + p[0] * 2 + (p[2] - 1) * tshift_[3] + 1;
4964 }
4965 return -1;
4966}
4967
4968inline ttk::SimplexId
4969 ttk::ImplicitTriangulation::getEdgeTriangleL_x0N(const SimplexId p[3],
4970 const int id) const {
4971 switch(id) {
4972 case 0:
4973 return p[0] * 2 + p[2] * tshift_[1];
4974 case 1:
4975 return tsetshift_[0] + p[0] * 2 + (p[2] - 1) * tshift_[3] + 1;
4976 }
4977 return -1;
4978}
4979
4980inline ttk::SimplexId
4981 ttk::ImplicitTriangulation::getEdgeTriangleL_xn0(const SimplexId p[3],
4982 const int id) const {
4983 switch(id) {
4984 case 0:
4985 return p[0] * 2 + p[1] * tshift_[0];
4986 case 1:
4987 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2];
4988 case 2:
4989 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8];
4990 case 3:
4991 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
4992 }
4993 return -1;
4994}
4995
4996inline ttk::SimplexId
4997 ttk::ImplicitTriangulation::getEdgeTriangleL_xnn(const SimplexId p[3],
4998 const int id) const {
4999 switch(id) {
5000 case 0:
5001 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
5002 case 1:
5003 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3];
5004 case 2:
5005 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2]
5006 + (p[2] - 1) * tshift_[3] + 1;
5007 case 3:
5008 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
5009 + (p[2] - 1) * tshift_[9] + 1;
5010 case 4:
5011 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
5012 case 5:
5013 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9];
5014 }
5015 return -1;
5016}
5017
5018inline ttk::SimplexId
5019 ttk::ImplicitTriangulation::getEdgeTriangleL_xnN(const SimplexId p[3],
5020 const int id) const {
5021 switch(id) {
5022 case 0:
5023 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
5024 case 1:
5025 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2]
5026 + (p[2] - 1) * tshift_[3] + 1;
5027 case 2:
5028 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
5029 + (p[2] - 1) * tshift_[9] + 1;
5030 case 3:
5031 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
5032 }
5033 return -1;
5034}
5035
5036inline ttk::SimplexId
5037 ttk::ImplicitTriangulation::getEdgeTriangleL_xN0(const SimplexId p[3],
5038 const int id) const {
5039 switch(id) {
5040 case 0:
5041 return p[0] * 2 + (p[1] - 1) * tshift_[0] + 1;
5042 case 1:
5043 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2];
5044 }
5045 return -1;
5046}
5047
5048inline ttk::SimplexId
5049 ttk::ImplicitTriangulation::getEdgeTriangleL_xNn(const SimplexId p[3],
5050 const int id) const {
5051 switch(id) {
5052 case 0:
5053 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
5054 case 1:
5055 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2]
5056 + (p[2] - 1) * tshift_[3] + 1;
5057 case 2:
5058 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
5059 + (p[2] - 1) * tshift_[9] + 1;
5060 case 3:
5061 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3];
5062 }
5063 return -1;
5064}
5065
5066inline ttk::SimplexId
5067 ttk::ImplicitTriangulation::getEdgeTriangleL_xNN(const SimplexId p[3],
5068 const int id) const {
5069 switch(id) {
5070 case 0:
5071 return p[0] * 2 + (p[1] - 1) * tshift_[0] + p[2] * tshift_[1] + 1;
5072 case 1:
5073 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2]
5074 + (p[2] - 1) * tshift_[3] + 1;
5075 case 2:
5076 return tsetshift_[3] + p[0] * 2 + (p[1] - 1) * tshift_[8]
5077 + (p[2] - 1) * tshift_[9] + 1;
5078 }
5079 return -1;
5080}
5081
5082inline ttk::SimplexId
5083 ttk::ImplicitTriangulation::getEdgeTriangleH_0y0(const SimplexId p[3],
5084 const int id) const {
5085 switch(id) {
5086 case 0:
5087 return p[1] * tshift_[0];
5088 case 1:
5089 return tsetshift_[1] + p[1] * tshift_[4];
5090 }
5091 return -1;
5092}
5093
5094inline ttk::SimplexId
5095 ttk::ImplicitTriangulation::getEdgeTriangleH_0yn(const SimplexId p[3],
5096 const int id) const {
5097 switch(id) {
5098 case 0:
5099 return tsetshift_[1] + p[1] * tshift_[4] + (p[2] - 1) * tshift_[5] + 1;
5100 case 1:
5101 return tsetshift_[2] + p[1] * tshift_[6] + (p[2] - 1) * tshift_[7] + 1;
5102 case 2:
5103 return p[1] * tshift_[0] + p[2] * tshift_[1];
5104 case 3:
5105 return tsetshift_[1] + p[1] * tshift_[4] + p[2] * tshift_[5];
5106 }
5107 return -1;
5108}
5109
5110inline ttk::SimplexId
5111 ttk::ImplicitTriangulation::getEdgeTriangleH_0yN(const SimplexId p[3],
5112 const int id) const {
5113 switch(id) {
5114 case 0:
5115 return tsetshift_[1] + p[1] * tshift_[4] + (p[2] - 1) * tshift_[5] + 1;
5116 case 1:
5117 return tsetshift_[2] + p[1] * tshift_[6] + (p[2] - 1) * tshift_[7] + 1;
5118 case 2:
5119 return p[1] * tshift_[0] + p[2] * tshift_[1];
5120 }
5121 return -1;
5122}
5123
5124inline ttk::SimplexId
5125 ttk::ImplicitTriangulation::getEdgeTriangleH_ny0(const SimplexId p[3],
5126 const int id) const {
5127 switch(id) {
5128 case 0:
5129 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
5130 case 1:
5131 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6];
5132 case 2:
5133 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4];
5134 case 3:
5135 return p[0] * 2 + p[1] * tshift_[0];
5136 }
5137 return -1;
5138}
5139
5140inline ttk::SimplexId
5141 ttk::ImplicitTriangulation::getEdgeTriangleH_nyn(const SimplexId p[3],
5142 const int id) const {
5143 switch(id) {
5144 case 0:
5145 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
5146 case 1:
5147 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
5148 + p[2] * tshift_[7];
5149 case 2:
5150 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5];
5151 case 3:
5152 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4]
5153 + (p[2] - 1) * tshift_[5] + 1;
5154 case 4:
5155 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6]
5156 + (p[2] - 1) * tshift_[7] + 1;
5157 case 5:
5158 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
5159 }
5160 return -1;
5161}
5162
5163inline ttk::SimplexId
5164 ttk::ImplicitTriangulation::getEdgeTriangleH_nyN(const SimplexId p[3],
5165 const int id) const {
5166 switch(id) {
5167 case 0:
5168 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4]
5169 + (p[2] - 1) * tshift_[5] + 1;
5170 case 1:
5171 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6]
5172 + (p[2] - 1) * tshift_[7] + 1;
5173 case 2:
5174 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
5175 case 3:
5176 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
5177 }
5178 return -1;
5179}
5180
5181inline ttk::SimplexId
5182 ttk::ImplicitTriangulation::getEdgeTriangleH_Ny0(const SimplexId p[3],
5183 const int id) const {
5184 switch(id) {
5185 case 0:
5186 return (p[0] - 1) * 2 + p[1] * tshift_[0] + 1;
5187 case 1:
5188 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6];
5189 case 2:
5190 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4];
5191 }
5192 return -1;
5193}
5194
5195inline ttk::SimplexId
5196 ttk::ImplicitTriangulation::getEdgeTriangleH_Nyn(const SimplexId p[3],
5197 const int id) const {
5198 switch(id) {
5199 case 0:
5200 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
5201 case 1:
5202 return tsetshift_[2] + (p[0] - 1) * 2 + p[1] * tshift_[6]
5203 + p[2] * tshift_[7];
5204 case 2:
5205 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5];
5206 case 3:
5207 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4]
5208 + (p[2] - 1) * tshift_[5] + 1;
5209 }
5210 return -1;
5211}
5212
5213inline ttk::SimplexId
5214 ttk::ImplicitTriangulation::getEdgeTriangleH_NyN(const SimplexId p[3],
5215 const int id) const {
5216 switch(id) {
5217 case 0:
5218 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4]
5219 + (p[2] - 1) * tshift_[5] + 1;
5220 case 1:
5221 return (p[0] - 1) * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
5222 }
5223 return -1;
5224}
5225
5226inline ttk::SimplexId
5227 ttk::ImplicitTriangulation::getEdgeTriangleP_00z(const SimplexId p[3],
5228 const int id) const {
5229 switch(id) {
5230 case 0:
5231 return tsetshift_[0] + p[2] * tshift_[3];
5232 case 1:
5233 return tsetshift_[1] + p[2] * tshift_[5] + 1;
5234 }
5235 return -1;
5236}
5237
5238inline ttk::SimplexId
5239 ttk::ImplicitTriangulation::getEdgeTriangleP_0nz(const SimplexId p[3],
5240 const int id) const {
5241 switch(id) {
5242 case 0:
5243 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + p[2] * tshift_[5];
5244 case 1:
5245 return tsetshift_[4] + (p[1] - 1) * tshift_[10] + p[2] * tshift_[11];
5246 case 2:
5247 return tsetshift_[0] + p[1] * tshift_[2] + p[2] * tshift_[3];
5248 case 3:
5249 return tsetshift_[1] + p[1] * tshift_[4] + p[2] * tshift_[5] + 1;
5250 }
5251 return -1;
5252}
5253
5254inline ttk::SimplexId
5255 ttk::ImplicitTriangulation::getEdgeTriangleP_0Nz(const SimplexId p[3],
5256 const int id) const {
5257 switch(id) {
5258 case 0:
5259 return tsetshift_[1] + (p[1] - 1) * tshift_[4] + p[2] * tshift_[5];
5260 case 1:
5261 return tsetshift_[4] + (p[1] - 1) * tshift_[10] + p[2] * tshift_[11];
5262 case 2:
5263 return tsetshift_[0] + p[1] * tshift_[2] + p[2] * tshift_[3];
5264 }
5265 return -1;
5266}
5267
5268inline ttk::SimplexId
5269 ttk::ImplicitTriangulation::getEdgeTriangleP_n0z(const SimplexId p[3],
5270 const int id) const {
5271 switch(id) {
5272 case 0:
5273 return tsetshift_[0] + (p[0] - 1) * 2 + p[2] * tshift_[3] + 1;
5274 case 1:
5275 return tsetshift_[4] + (p[0] - 1) * 2 + p[2] * tshift_[11] + 1;
5276 case 2:
5277 return tsetshift_[1] + p[0] * 2 + p[2] * tshift_[5] + 1;
5278 case 3:
5279 return tsetshift_[0] + p[0] * 2 + p[2] * tshift_[3];
5280 }
5281 return -1;
5282}
5283
5284inline ttk::SimplexId
5285 ttk::ImplicitTriangulation::getEdgeTriangleP_nnz(const SimplexId p[3],
5286 const int id) const {
5287 switch(id) {
5288 case 0:
5289 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
5290 + p[2] * tshift_[3] + 1;
5291 case 1:
5292 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
5293 + p[2] * tshift_[11] + 1;
5294 case 2:
5295 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
5296 + 1;
5297 case 3:
5298 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3];
5299 case 4:
5300 return tsetshift_[4] + p[0] * 2 + (p[1] - 1) * tshift_[10]
5301 + p[2] * tshift_[11];
5302 case 5:
5303 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
5304 + p[2] * tshift_[5];
5305 }
5306 return -1;
5307}
5308
5309inline ttk::SimplexId
5310 ttk::ImplicitTriangulation::getEdgeTriangleP_nNz(const SimplexId p[3],
5311 const int id) const {
5312 switch(id) {
5313 case 0:
5314 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
5315 + p[2] * tshift_[3] + 1;
5316 case 1:
5317 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
5318 + p[2] * tshift_[5];
5319 case 2:
5320 return tsetshift_[4] + p[0] * 2 + (p[1] - 1) * tshift_[10]
5321 + p[2] * tshift_[11];
5322 case 3:
5323 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3];
5324 }
5325 return -1;
5326}
5327
5328inline ttk::SimplexId
5329 ttk::ImplicitTriangulation::getEdgeTriangleP_N0z(const SimplexId p[3],
5330 const int id) const {
5331 switch(id) {
5332 case 0:
5333 return tsetshift_[0] + (p[0] - 1) * 2 + p[2] * tshift_[3] + 1;
5334 case 1:
5335 return tsetshift_[4] + (p[0] - 1) * 2 + p[2] * tshift_[11] + 1;
5336 case 2:
5337 return tsetshift_[1] + p[0] * 2 + p[2] * tshift_[5] + 1;
5338 }
5339 return -1;
5340}
5341
5342inline ttk::SimplexId
5343 ttk::ImplicitTriangulation::getEdgeTriangleP_Nnz(const SimplexId p[3],
5344 const int id) const {
5345 switch(id) {
5346 case 0:
5347 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
5348 + p[2] * tshift_[3] + 1;
5349 case 1:
5350 return tsetshift_[4] + (p[0] - 1) * 2 + p[1] * tshift_[10]
5351 + p[2] * tshift_[11] + 1;
5352 case 2:
5353 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
5354 + 1;
5355 case 3:
5356 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
5357 + p[2] * tshift_[5];
5358 }
5359 return -1;
5360}
5361
5362inline ttk::SimplexId
5363 ttk::ImplicitTriangulation::getEdgeTriangleP_NNz(const SimplexId p[3],
5364 const int id) const {
5365 switch(id) {
5366 case 0:
5367 return tsetshift_[0] + (p[0] - 1) * 2 + p[1] * tshift_[2]
5368 + p[2] * tshift_[3] + 1;
5369 case 1:
5370 return tsetshift_[1] + p[0] * 2 + (p[1] - 1) * tshift_[4]
5371 + p[2] * tshift_[5];
5372 }
5373 return -1;
5374}
5375
5376inline ttk::SimplexId
5377 ttk::ImplicitTriangulation::getEdgeTriangleD1_xy0(const SimplexId p[3],
5378 const int id) const {
5379 switch(id) {
5380 case 0:
5381 return p[0] * 2 + p[1] * tshift_[0];
5382 case 1:
5383 return p[0] * 2 + p[1] * tshift_[0] + 1;
5384 case 2:
5385 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10];
5386 }
5387 return -1;
5388}
5389
5390inline ttk::SimplexId
5391 ttk::ImplicitTriangulation::getEdgeTriangleD1_xyn(const SimplexId p[3],
5392 const int id) const {
5393 switch(id) {
5394 case 0:
5395 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
5396 case 1:
5397 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
5398 case 2:
5399 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10] + p[2] * tshift_[11];
5400 case 3:
5401 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
5402 + (p[2] - 1) * tshift_[11] + 1;
5403 }
5404 return -1;
5405}
5406
5407inline ttk::SimplexId
5408 ttk::ImplicitTriangulation::getEdgeTriangleD1_xyN(const SimplexId p[3],
5409 const int id) const {
5410 switch(id) {
5411 case 0:
5412 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
5413 case 1:
5414 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
5415 case 2:
5416 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10]
5417 + (p[2] - 1) * tshift_[11] + 1;
5418 }
5419 return -1;
5420}
5421
5422inline ttk::SimplexId
5423 ttk::ImplicitTriangulation::getEdgeTriangleD2_0yz(const SimplexId p[3],
5424 const int id) const {
5425 switch(id) {
5426 case 0:
5427 return tsetshift_[1] + p[1] * tshift_[4] + p[2] * tshift_[5];
5428 case 1:
5429 return tsetshift_[1] + p[1] * tshift_[4] + p[2] * tshift_[5] + 1;
5430 case 2:
5431 return tsetshift_[3] + p[1] * tshift_[8] + p[2] * tshift_[9];
5432 }
5433 return -1;
5434}
5435
5436inline ttk::SimplexId
5437 ttk::ImplicitTriangulation::getEdgeTriangleD2_nyz(const SimplexId p[3],
5438 const int id) const {
5439 switch(id) {
5440 case 0:
5441 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5];
5442 case 1:
5443 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
5444 + 1;
5445 case 2:
5446 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9];
5447 case 3:
5448 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
5449 + p[2] * tshift_[9] + 1;
5450 }
5451 return -1;
5452}
5453
5454inline ttk::SimplexId
5455 ttk::ImplicitTriangulation::getEdgeTriangleD2_Nyz(const SimplexId p[3],
5456 const int id) const {
5457 switch(id) {
5458 case 0:
5459 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5];
5460 case 1:
5461 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
5462 + 1;
5463 case 2:
5464 return tsetshift_[3] + (p[0] - 1) * 2 + p[1] * tshift_[8]
5465 + p[2] * tshift_[9] + 1;
5466 }
5467 return -1;
5468}
5469
5470inline ttk::SimplexId
5471 ttk::ImplicitTriangulation::getEdgeTriangleD3_x0z(const SimplexId p[3],
5472 const int id) const {
5473 switch(id) {
5474 case 0:
5475 return tsetshift_[0] + p[0] * 2 + p[2] * tshift_[3];
5476 case 1:
5477 return tsetshift_[0] + p[0] * 2 + p[2] * tshift_[3] + 1;
5478 case 2:
5479 return tsetshift_[2] + p[0] * 2 + p[2] * tshift_[7] + 1;
5480 }
5481 return -1;
5482}
5483
5484inline ttk::SimplexId
5485 ttk::ImplicitTriangulation::getEdgeTriangleD3_xnz(const SimplexId p[3],
5486 const int id) const {
5487 switch(id) {
5488 case 0:
5489 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3];
5490 case 1:
5491 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3]
5492 + 1;
5493 case 2:
5494 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
5495 + 1;
5496 case 3:
5497 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
5498 + p[2] * tshift_[7];
5499 }
5500 return -1;
5501}
5502
5503inline ttk::SimplexId
5504 ttk::ImplicitTriangulation::getEdgeTriangleD3_xNz(const SimplexId p[3],
5505 const int id) const {
5506 switch(id) {
5507 case 0:
5508 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3];
5509 case 1:
5510 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3]
5511 + 1;
5512 case 2:
5513 return tsetshift_[2] + p[0] * 2 + (p[1] - 1) * tshift_[6]
5514 + p[2] * tshift_[7];
5515 }
5516 return -1;
5517}
5518
5519inline ttk::SimplexId
5520 ttk::ImplicitTriangulation::getEdgeTriangleD4_xyz(const SimplexId p[3],
5521 const int id) const {
5522 switch(id) {
5523 case 0:
5524 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7];
5525 case 1:
5526 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
5527 + 1;
5528 case 2:
5529 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9];
5530 case 3:
5531 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9]
5532 + 1;
5533 case 4:
5534 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10] + p[2] * tshift_[11];
5535 case 5:
5536 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10] + p[2] * tshift_[11]
5537 + 1;
5538 }
5539 return -1;
5540}
5541
5542inline ttk::SimplexId
5543 ttk::ImplicitTriangulation::getEdgeLinkL(const SimplexId p[3],
5544 const int id) const {
5545 if(p[2] == 0 and p[1] == 0) {
5546 switch(id) {
5547 case 0:
5548 return esetshift_[1] + p[0] + eshift_[4]; // CG
5549 case 1:
5550 return esetshift_[0] + p[0] + eshift_[3]; // EG
5551 }
5552 } else if(p[2] == 0 and p[1] == nbvoxels_[1])
5553 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]; // BG
5554 else if(p[2] == nbvoxels_[2] and p[1] == 0)
5555 return esetshift_[5] + p[0] + (p[2] - 1) * eshift_[13]; // BG
5556 else if(p[2] == nbvoxels_[2] and p[1] == nbvoxels_[1]) {
5557 switch(id) {
5558 case 0:
5559 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4]
5560 + (p[2] - 1) * eshift_[5] + 1; // BF
5561 case 1:
5562 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
5563 + (p[2] - 1) * eshift_[3] + 1; // BD
5564 }
5565 } else if(p[2] == 0 and p[1] > 0 and p[1] < nbvoxels_[1]) {
5566 switch(id) {
5567 case 0:
5568 return esetshift_[1] + p[0] + (p[1] + 1) * eshift_[4]; // CG
5569 case 1:
5570 return esetshift_[0] + p[0] + p[1] * eshift_[2] + eshift_[3]; // EG
5571 case 2:
5572 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]; // BG
5573 }
5574 } else if(p[2] == nbvoxels_[2] and p[1] > 0 and p[1] < nbvoxels_[1]) {
5575 switch(id) {
5576 case 0:
5577 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4]
5578 + (p[2] - 1) * eshift_[5] + 1; // BF
5579 case 1:
5580 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
5581 + (p[2] - 1) * eshift_[3] + 1; // BD
5582 case 2:
5583 return esetshift_[5] + p[0] + p[1] * eshift_[12]
5584 + (p[2] - 1) * eshift_[13];
5585 // BG
5586 }
5587 } else if(p[2] > 0 and p[2] < nbvoxels_[2] and p[1] == 0) {
5588 switch(id) {
5589 case 0:
5590 return esetshift_[1] + p[0] + p[2] * eshift_[5] + eshift_[4]; // CG
5591 case 1:
5592 return esetshift_[0] + p[0] + (p[2] + 1) * eshift_[3]; // EG
5593 case 2:
5594 return esetshift_[5] + p[0] + (p[2] - 1) * eshift_[13]; // BG
5595 }
5596 } else if(p[2] > 0 and p[2] < nbvoxels_[2] and p[1] == nbvoxels_[1]) {
5597 switch(id) {
5598 case 0:
5599 return esetshift_[1] + p[0] + (p[1] - 1) * eshift_[4]
5600 + (p[2] - 1) * eshift_[5] + 1; // BF
5601 case 1:
5602 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
5603 + (p[2] - 1) * eshift_[3] + 1; // BD
5604 case 2:
5605 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
5606 + p[2] * eshift_[13];
5607 // BG
5608 }
5609 } else {
5610 switch(id) {
5611 case 0:
5612 return esetshift_[1] + p[0] + (p[1] + 1) * eshift_[4]
5613 + p[2] * eshift_[5];
5614 // CG
5615 case 1:
5616 return esetshift_[0] + p[0] + p[1] * eshift_[2]
5617 + (p[2] + 1) * eshift_[3];
5618 // EG
5619 case 2:
5620 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
5621 + p[2] * eshift_[13];
5622 case 3:
5623 return esetshift_[1] + p[0] + 1 + (p[1] - 1) * eshift_[4]
5624 + (p[2] - 1) * eshift_[5]; // CG
5625 case 4:
5626 return esetshift_[0] + p[0] + 1 + (p[1] - 1) * eshift_[2]
5627 + (p[2] - 1) * eshift_[3]; // EG
5628 case 5:
5629 return esetshift_[5] + p[0] + p[1] * eshift_[12]
5630 + (p[2] - 1) * eshift_[13];
5631 }
5632 }
5633 return -1;
5634}
5635
5636inline ttk::SimplexId
5637 ttk::ImplicitTriangulation::getEdgeLinkH(const SimplexId p[3],
5638 const int id) const {
5639 if(p[0] == 0 and p[2] == 0)
5640 return esetshift_[5] + p[1] * eshift_[12];
5641 else if(p[0] == nbvoxels_[0] and p[2] == 0) {
5642 switch(id) {
5643 case 0:
5644 return esetshift_[1] + p[0] + (p[1] + 1) * eshift_[4] - 1;
5645 case 1:
5646 return p[0] + (p[1] + 1) * eshift_[0] + eshift_[1] - 1;
5647 }
5648 } else if(p[0] == 0 and p[2] == nbvoxels_[2]) {
5649 switch(id) {
5650 case 0:
5651 return p[1] * eshift_[0] + (p[2] - 1) * eshift_[1];
5652 case 1:
5653 return esetshift_[1] + p[1] * eshift_[4] + (p[2] - 1) * eshift_[5] + 1;
5654 }
5655 } else if(p[0] == nbvoxels_[0] and p[2] == nbvoxels_[2])
5656 return esetshift_[5] + p[0] - 1 + p[1] * eshift_[12]
5657 + (p[2] - 1) * eshift_[13];
5658 else if(p[0] > 0 and p[0] < nbvoxels_[0] and p[2] == 0) {
5659 switch(id) {
5660 case 0:
5661 return p[0] - 1 + (p[1] + 1) * eshift_[0] + eshift_[1];
5662 case 1:
5663 return esetshift_[1] + p[0] - 1 + (p[1] + 1) * eshift_[4];
5664 case 2:
5665 return esetshift_[5] + p[0] + p[1] * eshift_[12];
5666 }
5667 } else if(p[0] > 0 and p[0] < nbvoxels_[0] and p[2] == nbvoxels_[2]) {
5668 switch(id) {
5669 case 0:
5670 return esetshift_[5] + p[0] - 1 + p[1] * eshift_[12]
5671 + (p[2] - 1) * eshift_[13];
5672 case 1:
5673 return p[0] + p[1] * eshift_[0] + (p[2] - 1) * eshift_[1];
5674 case 2:
5675 return esetshift_[1] + p[0] + 1 + p[1] * eshift_[4]
5676 + (p[2] - 1) * eshift_[5];
5677 }
5678 } else if(p[0] == 0 and p[2] > 0 and p[2] < nbvoxels_[2]) {
5679 switch(id) {
5680 case 0:
5681 return esetshift_[1] + p[1] * eshift_[4] + (p[2] - 1) * eshift_[5] + 1;
5682 case 1:
5683 return esetshift_[5] + p[1] * eshift_[12] + p[2] * eshift_[13];
5684 case 2:
5685 return p[1] * eshift_[0] + (p[2] - 1) * eshift_[1];
5686 }
5687 } else if(p[0] == nbvoxels_[0] and p[2] > 0 and p[2] < nbvoxels_[2]) {
5688 switch(id) {
5689 case 0:
5690 return esetshift_[5] + p[0] - 1 + p[1] * eshift_[12]
5691 + (p[2] - 1) * eshift_[13];
5692 case 1:
5693 return esetshift_[1] + p[0] - 1 + (p[1] + 1) * eshift_[4]
5694 + p[2] * eshift_[5];
5695 case 2:
5696 return p[0] - 1 + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1];
5697 }
5698 } else {
5699 switch(id) {
5700 case 0:
5701 return p[0] + p[1] * eshift_[0] + (p[2] - 1) * eshift_[1];
5702 case 1:
5703 return p[0] + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1] - 1;
5704 case 2:
5705 return esetshift_[1] + p[0] - 1 + (p[1] + 1) * eshift_[4]
5706 + p[2] * eshift_[5];
5707 case 3:
5708 return esetshift_[1] + p[0] + 1 + p[1] * eshift_[4]
5709 + (p[2] - 1) * eshift_[5];
5710 case 4:
5711 return esetshift_[5] + (p[0] - 1) + p[1] * eshift_[12]
5712 + (p[2] - 1) * eshift_[13];
5713 case 5:
5714 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13];
5715 }
5716 }
5717 return -1;
5718}
5719
5720inline ttk::SimplexId
5721 ttk::ImplicitTriangulation::getEdgeLinkP(const SimplexId p[3],
5722 const int id) const {
5723 if(p[0] == 0 and p[1] == 0)
5724 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13];
5725 else if(p[0] == 0 and p[1] == nbvoxels_[1]) {
5726 switch(id) {
5727 case 0:
5728 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
5729 + p[2] * eshift_[3] + 1;
5730 case 1:
5731 return p[0] + (p[1] - 1) * eshift_[0] + p[2] * eshift_[1];
5732 }
5733 } else if(p[0] == nbvoxels_[0] and p[1] == 0) {
5734 switch(id) {
5735 case 0:
5736 return esetshift_[0] + p[0] + p[1] * eshift_[2]
5737 + (p[2] + 1) * eshift_[3] - 1;
5738 case 1:
5739 return p[0] + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1] - 1;
5740 }
5741 } else if(p[0] == nbvoxels_[0] and p[1] == nbvoxels_[1])
5742 return esetshift_[5] + p[0] - 1 + (p[1] - 1) * eshift_[12]
5743 + p[2] * eshift_[13];
5744 else if(p[0] > 0 and p[0] < nbvoxels_[0] and p[1] == 0) {
5745 switch(id) {
5746 case 0:
5747 return p[0] + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1] - 1;
5748 case 1:
5749 return esetshift_[0] + p[0] + p[1] * eshift_[2]
5750 + (p[2] + 1) * eshift_[3] - 1;
5751 case 2:
5752 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13];
5753 }
5754 } else if(p[0] > 0 and p[0] < nbvoxels_[0] and p[1] == nbvoxels_[1]) {
5755 switch(id) {
5756 case 0:
5757 return p[0] + (p[1] - 1) * eshift_[0] + p[2] * eshift_[1];
5758 case 1:
5759 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
5760 + p[2] * eshift_[3] + 1;
5761 case 2:
5762 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
5763 + p[2] * eshift_[13] - 1;
5764 }
5765 } else if(p[0] == 0 and p[1] > 0 and p[1] < nbvoxels_[1]) {
5766 switch(id) {
5767 case 0:
5768 return p[0] + (p[1] - 1) * eshift_[0] + p[2] * eshift_[1];
5769 case 1:
5770 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
5771 + p[2] * eshift_[3] + 1;
5772 case 2:
5773 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13];
5774 }
5775 } else if(p[0] == nbvoxels_[0] and p[1] > 0 and p[1] < nbvoxels_[1]) {
5776 switch(id) {
5777 case 0:
5778 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
5779 + p[2] * eshift_[13] - 1;
5780 case 1:
5781 return esetshift_[0] + p[0] + p[1] * eshift_[2]
5782 + (p[2] + 1) * eshift_[3] - 1;
5783 case 2:
5784 return p[0] + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1] - 1;
5785 }
5786 } else {
5787 switch(id) {
5788 case 0:
5789 return p[0] + (p[1] - 1) * eshift_[0] + p[2] * eshift_[1];
5790 case 1:
5791 return p[0] + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1] - 1;
5792 case 2:
5793 return esetshift_[5] + p[0] + p[1] * eshift_[12] + p[2] * eshift_[13];
5794 case 3:
5795 return esetshift_[5] + p[0] + (p[1] - 1) * eshift_[12]
5796 + p[2] * eshift_[13] - 1;
5797 case 4:
5798 return esetshift_[0] + p[0] + p[1] * eshift_[2]
5799 + (p[2] + 1) * eshift_[3] - 1;
5800 case 5:
5801 return esetshift_[0] + p[0] + (p[1] - 1) * eshift_[2]
5802 + p[2] * eshift_[3] + 1;
5803 }
5804 }
5805 return -1;
5806}
5807
5808inline ttk::SimplexId
5809 ttk::ImplicitTriangulation::getEdgeLinkD1(const SimplexId p[3],
5810 const int id) const {
5811 if(p[2] > 0 and p[2] < nbvoxels_[2]) {
5812 switch(id) {
5813 case 0:
5814 return esetshift_[4] + p[0] + p[1] * eshift_[10]
5815 + (p[2] - 1) * eshift_[11];
5816 case 1:
5817 return esetshift_[4] + p[0] + (p[1] + 1) * eshift_[10]
5818 + p[2] * eshift_[11];
5819 case 2:
5820 return esetshift_[3] + p[0] + p[1] * eshift_[8] + p[2] * eshift_[9];
5821 case 3:
5822 return esetshift_[3] + p[0] + p[1] * eshift_[8]
5823 + (p[2] - 1) * eshift_[9] + 1;
5824 }
5825 } else if(p[2] == 0) {
5826 switch(id) {
5827 case 0:
5828 return esetshift_[3] + p[0] + p[1] * eshift_[8] + p[2] * eshift_[9];
5829 case 1:
5830 return esetshift_[4] + p[0] + (p[1] + 1) * eshift_[10]
5831 + p[2] * eshift_[11];
5832 }
5833 } else {
5834 switch(id) {
5835 case 0:
5836 return esetshift_[3] + p[0] + p[1] * eshift_[8]
5837 + (p[2] - 1) * eshift_[9] + 1;
5838 case 1:
5839 return esetshift_[4] + p[0] + p[1] * eshift_[10]
5840 + (p[2] - 1) * eshift_[11];
5841 }
5842 }
5843 return -1;
5844}
5845
5846inline ttk::SimplexId
5847 ttk::ImplicitTriangulation::getEdgeLinkD2(const SimplexId p[3],
5848 const int id) const {
5849 if(p[0] > 0 and p[0] < nbvoxels_[0]) {
5850 switch(id) {
5851 case 0:
5852 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11];
5853 case 1:
5854 return esetshift_[4] + p[0] + (p[1] + 1) * eshift_[10]
5855 + p[2] * eshift_[11] - 1;
5856 case 2:
5857 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7];
5858 case 3:
5859 return esetshift_[2] + p[0] + p[1] * eshift_[6]
5860 + (p[2] + 1) * eshift_[7] - 1;
5861 }
5862 } else if(p[0] == 0) {
5863 switch(id) {
5864 case 0:
5865 return esetshift_[2] + p[0] + p[1] * eshift_[6] + p[2] * eshift_[7];
5866 case 1:
5867 return esetshift_[4] + p[0] + p[1] * eshift_[10] + p[2] * eshift_[11];
5868 }
5869 } else {
5870 switch(id) {
5871 case 0:
5872 return esetshift_[2] + p[0] + p[1] * eshift_[6]
5873 + (p[2] + 1) * eshift_[7] - 1;
5874 case 1:
5875 return esetshift_[4] + p[0] + (p[1] + 1) * eshift_[10]
5876 + p[2] * eshift_[11] - 1;
5877 }
5878 }
5879 return -1;
5880}
5881
5882inline ttk::SimplexId
5883 ttk::ImplicitTriangulation::getEdgeLinkD3(const SimplexId p[3],
5884 const int id) const {
5885 if(p[1] > 0 and p[1] < nbvoxels_[1]) {
5886 switch(id) {
5887 case 0:
5888 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
5889 + p[2] * eshift_[7];
5890 case 1:
5891 return esetshift_[2] + p[0] + p[1] * eshift_[6]
5892 + (p[2] + 1) * eshift_[7];
5893 case 2:
5894 return esetshift_[3] + p[0] + p[1] * eshift_[8] + p[2] * eshift_[9];
5895 case 3:
5896 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
5897 + p[2] * eshift_[9] + 1;
5898 }
5899 } else if(p[1] == 0) {
5900 switch(id) {
5901 case 0:
5902 return esetshift_[2] + p[0] + p[1] * eshift_[6]
5903 + (p[2] + 1) * eshift_[7];
5904 case 1:
5905 return esetshift_[3] + p[0] + p[1] * eshift_[8] + p[2] * eshift_[9];
5906 }
5907 } else {
5908 switch(id) {
5909 case 0:
5910 return esetshift_[2] + p[0] + (p[1] - 1) * eshift_[6]
5911 + p[2] * eshift_[7];
5912 case 1:
5913 return esetshift_[3] + p[0] + (p[1] - 1) * eshift_[8]
5914 + p[2] * eshift_[9] + 1;
5915 }
5916 }
5917 return -1;
5918}
5919
5920inline ttk::SimplexId
5921 ttk::ImplicitTriangulation::getEdgeLinkD4(const SimplexId p[3],
5922 const int id) const {
5923 switch(id) {
5924 case 0:
5925 return p[0] + (p[1] + 1) * eshift_[0] + p[2] * eshift_[1];
5926 case 1:
5927 return p[0] + p[1] * eshift_[0] + (p[2] + 1) * eshift_[1];
5928 case 2:
5929 return esetshift_[1] + p[0] + p[1] * eshift_[4] + p[2] * eshift_[5];
5930 case 3:
5931 return esetshift_[1] + p[0] + 1 + (p[1] + 1) * eshift_[4]
5932 + p[2] * eshift_[5];
5933 case 4:
5934 return esetshift_[0] + p[0] + p[1] * eshift_[2] + p[2] * eshift_[3];
5935 case 5:
5936 return esetshift_[0] + p[0] + 1 + p[1] * eshift_[2]
5937 + (p[2] + 1) * eshift_[3];
5938 }
5939 return -1;
5940}
5941
5942inline ttk::SimplexId
5943 ttk::ImplicitTriangulation::getEdgeStarL(const SimplexId p[3],
5944 const int id) const {
5945 if(p[2] == 0 and p[1] == 0) {
5946 switch(id) {
5947 case 0:
5948 return p[0] * 6; // ABCG
5949 case 1:
5950 return p[0] * 6 + 2; // ABEG
5951 }
5952 } else if(p[2] == 0 and p[1] == nbvoxels_[1])
5953 return (p[1] - 1) * tetshift_[0] + p[0] * 6 + 1; // BCDG
5954 else if(p[2] == nbvoxels_[2] and p[1] == 0)
5955 return (p[2] - 1) * tetshift_[1] + p[0] * 6 + 3; // BEFG
5956 else if(p[2] == nbvoxels_[2] and p[1] == nbvoxels_[1]) {
5957 switch(id) {
5958 case 0:
5959 return (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1] + p[0] * 6
5960 + 4;
5961 // BFGH
5962 case 1:
5963 return (p[1] - 1) * tetshift_[0] + (p[2] - 1) * tetshift_[1] + p[0] * 6
5964 + 5;
5965 // BDGH
5966 }
5967 } else if(p[2] == 0 and p[1] > 0 and p[1] < nbvoxels_[1]) {
5968 switch(id) {
5969 case 0:
5970 return p[1] * tetshift_[0] + p[0] * 6; // ABCG
5971 case 1:
5972 return p[1] * tetshift_[0] + p[0] * 6 + 2; // ABEG
5973 case 2:
5974 return (p[1] - 1) * tetshift_[0] + p[0] * 6 + 1; // BCDG
5975 }
5976 } else if(p[2] == nbvoxels_[2] and p[1] > 0 and p[1] < nbvoxels_[1]) {
5977 switch(id) {
5978 case 0:
5979 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
5980 + 3; // BEFG
5981 case 1:
5982 return (p[2] - 1) * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
5983 + 4;
5984 // BFGH
5985 case 2:
5986 return (p[2] - 1) * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
5987 + 5;
5988 // BDGH
5989 }
5990 } else if(p[2] > 0 and p[2] < nbvoxels_[2] and p[1] == 0) {
5991 switch(id) {
5992 case 0:
5993 return p[2] * tetshift_[1] + p[0] * 6; // ABCG
5994 case 1:
5995 return p[2] * tetshift_[1] + p[0] * 6 + 2; // ABEG
5996 case 2:
5997 return (p[2] - 1) * tetshift_[1] + p[0] * 6 + 3; // BEFG
5998 }
5999 } else if(p[2] > 0 and p[2] < nbvoxels_[2] and p[1] == nbvoxels_[1]) {
6000 switch(id) {
6001 case 0:
6002 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6003 + 1; // BCDG
6004 case 1:
6005 return (p[2] - 1) * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6006 + 4;
6007 // BFGH
6008 case 2:
6009 return (p[2] - 1) * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6010 + 5;
6011 // BDGH
6012 }
6013 } else {
6014 switch(id) {
6015 case 0:
6016 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6; // ABCG
6017 case 1:
6018 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + 2; // ABEG
6019 case 2:
6020 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6021 + 1; // BCDG
6022 case 3:
6023 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6024 + 3; // BEFG
6025 case 4:
6026 return (p[2] - 1) * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6027 + 4;
6028 // BFGH
6029 case 5:
6030 return (p[2] - 1) * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6031 + 5;
6032 // BDGH
6033 }
6034 }
6035
6036 return -1;
6037}
6038
6039inline ttk::SimplexId
6040 ttk::ImplicitTriangulation::getEdgeStarH(const SimplexId p[3],
6041 const int id) const {
6042 if(p[0] == 0 and p[2] == 0)
6043 return p[1] * tetshift_[0]; // ABCG
6044 else if(p[0] == nbvoxels_[0] and p[2] == 0) {
6045 switch(id) {
6046 case 0:
6047 return p[1] * tetshift_[0] + (p[0] - 1) * 6 + 1; // BCDG
6048 case 1:
6049 return p[1] * tetshift_[0] + (p[0] - 1) * 6 + 5; // BDGH
6050 }
6051 } else if(p[0] == 0 and p[2] == nbvoxels_[2]) {
6052 switch(id) {
6053 case 0:
6054 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + 2; // ABEG
6055 case 1:
6056 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + 3; // BEFG
6057 }
6058 } else if(p[0] == nbvoxels_[0] and p[2] == nbvoxels_[2])
6059 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6060 + 4; // BFGH
6061 else if(p[0] > 0 and p[0] < nbvoxels_[0] and p[2] == 0) {
6062 switch(id) {
6063 case 0:
6064 return p[1] * tetshift_[0] + (p[0] - 1) * 6 + 1; // BCDG
6065 case 1:
6066 return p[1] * tetshift_[0] + (p[0] - 1) * 6 + 5; // BDGH
6067 case 2:
6068 return p[1] * tetshift_[0] + p[0] * 6; // ABCG
6069 }
6070 } else if(p[0] > 0 and p[0] < nbvoxels_[0] and p[2] == nbvoxels_[2]) {
6071 switch(id) {
6072 case 0:
6073 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6074 + 2; // ABEG
6075 case 1:
6076 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6077 + 3; // BEFG
6078 case 2:
6079 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6080 + 4;
6081 // BFGH
6082 }
6083 } else if(p[0] == 0 and p[2] > 0 and p[2] < nbvoxels_[2]) {
6084 switch(id) {
6085 case 0:
6086 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + 2; // ABEG
6087 case 1:
6088 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + 3; // BEFG
6089 case 2:
6090 return p[2] * tetshift_[1] + p[1] * tetshift_[0]; // ABCG
6091 }
6092 } else if(p[0] == nbvoxels_[0] and p[2] > 0 and p[2] < nbvoxels_[2]) {
6093 switch(id) {
6094 case 0:
6095 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6096 + 1; // BCDG
6097 case 1:
6098 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6099 + 5; // BDGH
6100 case 2:
6101 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6102 + 4;
6103 // BFGH
6104 }
6105 } else {
6106 switch(id) {
6107 case 0:
6108 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6; // ABCG
6109 case 1:
6110 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6111 + 2; // ABEG
6112 case 2:
6113 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6114 + 3; // BEFG
6115 case 3:
6116 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6117 + 4;
6118 // BFGH
6119 case 4:
6120 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6121 + 1; // BCDG
6122 case 5:
6123 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6124 + 5; // BDGH
6125 }
6126 }
6127 return -1;
6128}
6129
6130inline ttk::SimplexId
6131 ttk::ImplicitTriangulation::getEdgeStarP(const SimplexId p[3],
6132 const int id) const {
6133 if(p[0] == 0 and p[1] == 0)
6134 return p[2] * tetshift_[1] + 2; // ABEG
6135 else if(p[0] == 0 and p[1] == nbvoxels_[1]) {
6136 switch(id) {
6137 case 0:
6138 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0]; // ABCG
6139 case 1:
6140 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + 1; // BCDG
6141 }
6142 } else if(p[0] == nbvoxels_[0] and p[1] == 0) {
6143 switch(id) {
6144 case 0:
6145 return p[2] * tetshift_[1] + (p[0] - 1) * 6 + 3; // BEFG
6146 case 1:
6147 return p[2] * tetshift_[1] + (p[0] - 1) * 6 + 4; // BFGH
6148 }
6149 } else if(p[0] == nbvoxels_[0] and p[1] == nbvoxels_[1])
6150 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + (p[0] - 1) * 6
6151 + 5; // BDGH
6152 else if(p[0] > 0 and p[0] < nbvoxels_[0] and p[1] == 0) {
6153 switch(id) {
6154 case 0:
6155 return p[2] * tetshift_[1] + (p[0] - 1) * 6 + 3; // BEFG
6156 case 1:
6157 return p[2] * tetshift_[1] + (p[0] - 1) * 6 + 4; // BFGH
6158 case 2:
6159 return p[2] * tetshift_[1] + p[0] * 6 + 2; // ABEG
6160 }
6161 } else if(p[0] > 0 and p[0] < nbvoxels_[0] and p[1] == nbvoxels_[1]) {
6162 switch(id) {
6163 case 0:
6164 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0]
6165 + p[0] * 6; // ABCG
6166 case 1:
6167 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6168 + 1; // BCDG
6169 case 2:
6170 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + (p[0] - 1) * 6
6171 + 5;
6172 // BDGH
6173 }
6174 } else if(p[0] == 0 and p[1] > 0 and p[1] < nbvoxels_[1]) {
6175 switch(id) {
6176 case 0:
6177 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0]; // ABCG
6178 case 1:
6179 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + 1; // BCDG
6180 case 2:
6181 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + 2; // ABEG
6182 }
6183 } else if(p[0] == nbvoxels_[0] and p[1] > 0 and p[1] < nbvoxels_[1]) {
6184 switch(id) {
6185 case 0:
6186 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6187 + 3; // BEFG
6188 case 1:
6189 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6190 + 4; // BFGH
6191 case 2:
6192 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + (p[0] - 1) * 6
6193 + 5;
6194 // BDGH
6195 }
6196 } else {
6197 switch(id) {
6198 case 0:
6199 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + (p[0] - 1) * 6
6200 + 5;
6201 // BDGH
6202 case 1:
6203 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0]
6204 + p[0] * 6; // ABCG
6205 case 2:
6206 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6207 + 1; // BCDG
6208 case 3:
6209 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + 2; // ABEG
6210 case 4:
6211 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6212 + 3; // BEFG
6213 case 5:
6214 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6215 + 4; // BFGH
6216 }
6217 }
6218 return -1;
6219}
6220
6221inline ttk::SimplexId
6222 ttk::ImplicitTriangulation::getEdgeStarD1(const SimplexId p[3],
6223 const int id) const {
6224 if(p[2] > 0 and p[2] < nbvoxels_[2]) {
6225 switch(id) {
6226 case 0:
6227 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6; // ABCG
6228 case 1:
6229 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + 1; // BCDG
6230 case 2:
6231 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6232 + 3; // BEFG
6233 case 3:
6234 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6235 + 4; // BFGH
6236 }
6237 } else if(p[2] == 0) {
6238 switch(id) {
6239 case 0:
6240 return p[1] * tetshift_[0] + p[0] * 6; // ABCG
6241 case 1:
6242 return p[1] * tetshift_[0] + p[0] * 6 + 1; // BCDG
6243 }
6244 } else {
6245 switch(id) {
6246 case 0:
6247 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6248 + 3; // BEFG
6249 case 1:
6250 return (p[2] - 1) * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6
6251 + 4; // BFGH
6252 }
6253 }
6254 return -1;
6255}
6256
6257inline ttk::SimplexId
6258 ttk::ImplicitTriangulation::getEdgeStarD2(const SimplexId p[3],
6259 const int id) const {
6260 if(p[0] > 0 and p[0] < nbvoxels_[0]) {
6261 switch(id) {
6262 case 0:
6263 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6; // ABCG
6264 case 1:
6265 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + 2; // ABEG
6266 case 2:
6267 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6268 + 5; // BDGH
6269 case 3:
6270 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6271 + 4; // BFGH
6272 }
6273 } else if(p[0] == 0) {
6274 switch(id) {
6275 case 0:
6276 return p[2] * tetshift_[1] + p[1] * tetshift_[0]; // ABCG
6277 case 1:
6278 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + 2; // ABEG
6279 }
6280 } else {
6281 switch(id) {
6282 case 0:
6283 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6284 + 5; // BDGH
6285 case 1:
6286 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + (p[0] - 1) * 6
6287 + 4; // BFGH
6288 }
6289 }
6290 return -1;
6291}
6292
6293inline ttk::SimplexId
6294 ttk::ImplicitTriangulation::getEdgeStarD3(const SimplexId p[3],
6295 const int id) const {
6296 if(p[1] > 0 and p[1] < nbvoxels_[1]) {
6297 switch(id) {
6298 case 0:
6299 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + 2; // ABEG
6300 case 1:
6301 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + 3; // BEFG
6302 case 2:
6303 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6304 + 1; // BCDG
6305 case 3:
6306 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6307 + 5; // BDGH
6308 }
6309 } else if(p[1] == 0) {
6310 switch(id) {
6311 case 0:
6312 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + 2; // ABEG
6313 case 1:
6314 return p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + 3; // BEFG
6315 }
6316 } else {
6317 switch(id) {
6318 case 0:
6319 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6320 + 1; // BCDG
6321 case 1:
6322 return p[2] * tetshift_[1] + (p[1] - 1) * tetshift_[0] + p[0] * 6
6323 + 5; // BDGH
6324 }
6325 }
6326 return -1;
6327}
6328
6329inline ttk::SimplexId
6330 ttk::ImplicitTriangulation::getTriangleVertexF(const SimplexId p[3],
6331 const int id) const {
6332 if(p[0] % 2) {
6333 if(id == 0)
6334 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6335 else if(id == 1)
6336 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0];
6337 else
6338 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0] + 1;
6339 } else {
6340 if(id == 0)
6341 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1];
6342 else if(id == 1)
6343 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6344 else
6345 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0];
6346 }
6347}
6348
6349inline ttk::SimplexId
6350 ttk::ImplicitTriangulation::getTriangleVertexH(const SimplexId p[3],
6351 const int id) const {
6352 if(p[0] % 2) {
6353 if(id == 0)
6354 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6355 else if(id == 1)
6356 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1] + 1;
6357 else
6358 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1];
6359 } else {
6360 if(id == 0)
6361 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1];
6362 else if(id == 1)
6363 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6364 else
6365 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1];
6366 }
6367}
6368
6369inline ttk::SimplexId
6370 ttk::ImplicitTriangulation::getTriangleVertexC(const SimplexId p[3],
6371 const int id) const {
6372 if(p[0] % 2) {
6373 if(id == 0)
6374 return (p[0] / 2) + p[1] * vshift_[0] + p[2] * vshift_[1];
6375 else if(id == 1)
6376 return (p[0] / 2) + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1];
6377 else
6378 return (p[0] / 2) + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1]
6379 + vshift_[0];
6380 } else {
6381 if(id == 0)
6382 return (p[0] / 2) + p[1] * vshift_[0] + p[2] * vshift_[1];
6383 else if(id == 1)
6384 return (p[0] / 2) + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0];
6385 else
6386 return (p[0] / 2) + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1]
6387 + vshift_[0];
6388 }
6389}
6390
6391inline ttk::SimplexId
6392 ttk::ImplicitTriangulation::getTriangleVertexD1(const SimplexId p[3],
6393 const int id) const {
6394 if(p[0] % 2) {
6395 if(id == 0)
6396 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6397 else if(id == 1)
6398 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1];
6399 else
6400 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1]
6401 + vshift_[0];
6402 } else {
6403 if(id == 0)
6404 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6405 else if(id == 1)
6406 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0] + 1;
6407 else
6408 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1]
6409 + vshift_[0];
6410 }
6411}
6412
6413inline ttk::SimplexId
6414 ttk::ImplicitTriangulation::getTriangleVertexD2(const SimplexId p[3],
6415 const int id) const {
6416 if(p[0] % 2) {
6417 if(id == 0)
6418 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6419 else if(id == 1)
6420 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
6421 + vshift_[1] + 1;
6422 else
6423 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
6424 + vshift_[1];
6425 } else {
6426 if(id == 0)
6427 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1];
6428 else if(id == 1)
6429 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6430 else
6431 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
6432 + vshift_[1];
6433 }
6434}
6435
6436inline ttk::SimplexId
6437 ttk::ImplicitTriangulation::getTriangleVertexD3(const SimplexId p[3],
6438 const int id) const {
6439 if(p[0] % 2) {
6440 if(id == 0)
6441 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6442 else if(id == 1)
6443 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1] + 1;
6444 else
6445 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
6446 + vshift_[1];
6447 } else {
6448 if(id == 0)
6449 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6450 else if(id == 1)
6451 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0];
6452 else
6453 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
6454 + vshift_[1];
6455 }
6456}
6457
6458inline ttk::SimplexId
6459 ttk::ImplicitTriangulation::getTriangleEdgeF_0(const SimplexId p[3],
6460 const int id) const {
6461 switch(id) {
6462 case 0:
6463 return p[0] / 2 + p[1] * eshift_[0] + p[2] * eshift_[1];
6464 case 1:
6465 return esetshift_[0] + p[0] / 2 + p[1] * eshift_[2] + p[2] * eshift_[3];
6466 case 2:
6467 return esetshift_[2] + p[0] / 2 + p[1] * eshift_[6] + p[2] * eshift_[7];
6468 }
6469 return -1;
6470}
6471
6472inline ttk::SimplexId
6473 ttk::ImplicitTriangulation::getTriangleEdgeF_1(const SimplexId p[3],
6474 const int id) const {
6475 switch(id) {
6476 case 0:
6477 return p[0] / 2 + (p[1] + 1) * eshift_[0] + p[2] * eshift_[1];
6478 case 1:
6479 return esetshift_[0] + p[0] / 2 + p[1] * eshift_[2] + p[2] * eshift_[3]
6480 + 1;
6481 case 2:
6482 return esetshift_[2] + p[0] / 2 + p[1] * eshift_[6] + p[2] * eshift_[7];
6483 }
6484 return -1;
6485}
6486
6487inline ttk::SimplexId
6488 ttk::ImplicitTriangulation::getTriangleEdgeH_0(const SimplexId p[3],
6489 const int id) const {
6490 switch(id) {
6491 case 0:
6492 return p[0] / 2 + p[1] * eshift_[0] + p[2] * eshift_[1];
6493 case 1:
6494 return esetshift_[1] + p[0] / 2 + p[1] * eshift_[4] + p[2] * eshift_[5];
6495 case 2:
6496 return esetshift_[4] + p[0] / 2 + p[1] * eshift_[10] + p[2] * eshift_[11];
6497 }
6498 return -1;
6499}
6500
6501inline ttk::SimplexId
6502 ttk::ImplicitTriangulation::getTriangleEdgeH_1(const SimplexId p[3],
6503 const int id) const {
6504 switch(id) {
6505 case 0:
6506 return p[0] / 2 + p[1] * eshift_[0] + (p[2] + 1) * eshift_[1];
6507 case 1:
6508 return esetshift_[1] + p[0] / 2 + p[1] * eshift_[4] + p[2] * eshift_[5]
6509 + 1;
6510 case 2:
6511 return esetshift_[4] + p[0] / 2 + p[1] * eshift_[10] + p[2] * eshift_[11];
6512 }
6513 return -1;
6514}
6515
6516inline ttk::SimplexId
6517 ttk::ImplicitTriangulation::getTriangleEdgeC_0(const SimplexId p[3],
6518 const int id) const {
6519 switch(id) {
6520 case 0:
6521 return esetshift_[0] + p[0] / 2 + p[1] * eshift_[2] + p[2] * eshift_[3];
6522 case 1:
6523 return esetshift_[1] + p[0] / 2 + (p[1] + 1) * eshift_[4]
6524 + p[2] * eshift_[5];
6525 case 2:
6526 return esetshift_[3] + p[0] / 2 + p[1] * eshift_[8] + p[2] * eshift_[9];
6527 }
6528 return -1;
6529}
6530
6531inline ttk::SimplexId
6532 ttk::ImplicitTriangulation::getTriangleEdgeC_1(const SimplexId p[3],
6533 const int id) const {
6534 switch(id) {
6535 case 0:
6536 return esetshift_[0] + p[0] / 2 + p[1] * eshift_[2]
6537 + (p[2] + 1) * eshift_[3];
6538 case 1:
6539 return esetshift_[1] + p[0] / 2 + p[1] * eshift_[4] + p[2] * eshift_[5];
6540 case 2:
6541 return esetshift_[3] + p[0] / 2 + p[1] * eshift_[8] + p[2] * eshift_[9];
6542 }
6543 return -1;
6544}
6545
6546inline ttk::SimplexId
6547 ttk::ImplicitTriangulation::getTriangleEdgeD1_0(const SimplexId p[3],
6548 const int id) const {
6549 switch(id) {
6550 case 0:
6551 return esetshift_[0] + p[0] / 2 + p[1] * eshift_[2] + p[2] * eshift_[3]
6552 + 1;
6553 case 1:
6554 return esetshift_[4] + p[0] / 2 + (p[1] + 1) * eshift_[10]
6555 + p[2] * eshift_[11];
6556 case 2:
6557 return esetshift_[5] + p[0] / 2 + p[1] * eshift_[12] + p[2] * eshift_[13];
6558 }
6559 return -1;
6560}
6561
6562inline ttk::SimplexId
6563 ttk::ImplicitTriangulation::getTriangleEdgeD1_1(const SimplexId p[3],
6564 const int id) const {
6565 switch(id) {
6566 case 0:
6567 return esetshift_[0] + p[0] / 2 + p[1] * eshift_[2]
6568 + (p[2] + 1) * eshift_[3];
6569 case 1:
6570 return esetshift_[4] + p[0] / 2 + p[1] * eshift_[10] + p[2] * eshift_[11];
6571 case 2:
6572 return esetshift_[5] + p[0] / 2 + p[1] * eshift_[12] + p[2] * eshift_[13];
6573 }
6574 return -1;
6575}
6576
6577inline ttk::SimplexId
6578 ttk::ImplicitTriangulation::getTriangleEdgeD2_0(const SimplexId p[3],
6579 const int id) const {
6580 switch(id) {
6581 case 0:
6582 return p[0] / 2 + p[1] * eshift_[0] + p[2] * eshift_[1];
6583 case 1:
6584 return esetshift_[3] + p[0] / 2 + p[1] * eshift_[8] + p[2] * eshift_[9];
6585 case 2:
6586 return esetshift_[5] + p[0] / 2 + p[1] * eshift_[12] + p[2] * eshift_[13];
6587 }
6588 return -1;
6589}
6590
6591inline ttk::SimplexId
6592 ttk::ImplicitTriangulation::getTriangleEdgeD2_1(const SimplexId p[3],
6593 const int id) const {
6594 switch(id) {
6595 case 0:
6596 return p[0] / 2 + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1];
6597 case 1:
6598 return esetshift_[3] + p[0] / 2 + p[1] * eshift_[8] + p[2] * eshift_[9]
6599 + 1;
6600 case 2:
6601 return esetshift_[5] + p[0] / 2 + p[1] * eshift_[12] + p[2] * eshift_[13];
6602 }
6603 return -1;
6604}
6605
6606inline ttk::SimplexId
6607 ttk::ImplicitTriangulation::getTriangleEdgeD3_0(const SimplexId p[3],
6608 const int id) const {
6609 switch(id) {
6610 case 0:
6611 return esetshift_[1] + p[0] / 2 + (p[1] + 1) * eshift_[4]
6612 + p[2] * eshift_[5];
6613 case 1:
6614 return esetshift_[2] + p[0] / 2 + p[1] * eshift_[6] + p[2] * eshift_[7];
6615 case 2:
6616 return esetshift_[5] + p[0] / 2 + p[1] * eshift_[12] + p[2] * eshift_[13];
6617 }
6618 return -1;
6619}
6620
6621inline ttk::SimplexId
6622 ttk::ImplicitTriangulation::getTriangleEdgeD3_1(const SimplexId p[3],
6623 const int id) const {
6624 switch(id) {
6625 case 0:
6626 return esetshift_[1] + p[0] / 2 + p[1] * eshift_[4] + p[2] * eshift_[5]
6627 + 1;
6628 case 1:
6629 return esetshift_[2] + p[0] / 2 + p[1] * eshift_[6]
6630 + (p[2] + 1) * eshift_[7];
6631 case 2:
6632 return esetshift_[5] + p[0] / 2 + p[1] * eshift_[12] + p[2] * eshift_[13];
6633 }
6634 return -1;
6635}
6636
6637inline ttk::SimplexId
6638 ttk::ImplicitTriangulation::getTriangleLinkF(const SimplexId p[3],
6639 const int id) const {
6640 if(p[2] > 0 and p[2] < nbvoxels_[2]) {
6641 switch(id) {
6642 case 0:
6643 return p[0] / 2 + (p[1] + 1) * vshift_[0] + (p[2] + 1) * vshift_[1];
6644 case 1:
6645 return p[0] / 2 + p[1] * vshift_[0] + (p[2] - 1) * vshift_[1] + 1;
6646 }
6647 } else if(p[2] == 0)
6648 return p[0] / 2 + (p[1] + 1) * vshift_[0] + vshift_[1];
6649 else
6650 return p[0] / 2 + p[1] * vshift_[0] + (p[2] - 1) * vshift_[1] + 1;
6651
6652 return -1;
6653}
6654
6655inline ttk::SimplexId
6656 ttk::ImplicitTriangulation::getTriangleLinkH(const SimplexId p[3],
6657 const int id) const {
6658 if(p[1] > 0 and p[1] < nbvoxels_[1]) {
6659 switch(id) {
6660 case 0:
6661 return p[0] / 2 + (p[1] + 1) * vshift_[0] + (p[2] + 1) * vshift_[1];
6662 case 1:
6663 return p[0] / 2 + (p[1] - 1) * vshift_[0] + p[2] * vshift_[1] + 1;
6664 }
6665 } else if(p[1] == 0)
6666 return p[0] / 2 + (p[1] + 1) * vshift_[0] + (p[2] + 1) * vshift_[1];
6667 else
6668 return p[0] / 2 + (p[1] - 1) * vshift_[0] + p[2] * vshift_[1] + 1;
6669
6670 return -1;
6671}
6672
6673inline ttk::SimplexId
6674 ttk::ImplicitTriangulation::getTriangleLinkC(const SimplexId p[3],
6675 const int id) const {
6676 if(p[0] > 1 and p[0] < (dimensions_[0] * 2 - 2)) {
6677 switch(id) {
6678 case 0:
6679 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6680 case 1:
6681 return p[0] / 2 + (p[1] + 1) * vshift_[0] + (p[2] + 1) * vshift_[1] - 1;
6682 }
6683 } else if(p[0] < 2)
6684 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1] + 1;
6685 else
6686 return p[0] / 2 + (p[1] + 1) * vshift_[0] + (p[2] + 1) * vshift_[1] - 1;
6687
6688 return -1;
6689}
6690
6691inline ttk::SimplexId
6692 ttk::ImplicitTriangulation::getTriangleLinkD1(const SimplexId p[3],
6693 const int id) const {
6694 if(p[0] % 2) {
6695 switch(id) {
6696 case 0:
6697 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1];
6698 case 1:
6699 return p[0] / 2 + p[1] * vshift_[0] + (p[2] + 1) * vshift_[1] + 1;
6700 }
6701 } else {
6702 switch(id) {
6703 case 0:
6704 return p[0] / 2 + (p[1] + 1) * vshift_[0] + p[2] * vshift_[1];
6705 case 1:
6706 return p[0] / 2 + (p[1] + 1) * vshift_[0] + (p[2] + 1) * vshift_[1] + 1;
6707 }
6708 }
6709 return -1;
6710}
6711
6712inline ttk::SimplexId
6713 ttk::ImplicitTriangulation::getTriangleLinkD2(const SimplexId p[3],
6714 const int id) const {
6715 if(p[0] % 2) {
6716 switch(id) {
6717 case 0:
6718 return p[0] / 2 + (p[1] + 1) * vshift_[0] + p[2] * vshift_[1] + 1;
6719 case 1:
6720 return p[0] / 2 + p[1] * vshift_[0] + (p[2] + 1) * vshift_[1] + 1;
6721 }
6722 } else {
6723 switch(id) {
6724 case 0:
6725 return p[0] / 2 + (p[1] + 1) * vshift_[0] + p[2] * vshift_[1];
6726 case 1:
6727 return p[0] / 2 + p[1] * vshift_[0] + (p[2] + 1) * vshift_[1];
6728 }
6729 }
6730 return -1;
6731}
6732
6733inline ttk::SimplexId
6734 ttk::ImplicitTriangulation::getTriangleLinkD3(const SimplexId p[3],
6735 const int id) const {
6736 if(p[0] % 2) {
6737 switch(id) {
6738 case 0:
6739 return p[0] / 2 + p[1] * vshift_[0] + (p[2] + 1) * vshift_[1];
6740 case 1:
6741 return p[0] / 2 + (p[1] + 1) * vshift_[0] + (p[2] + 1) * vshift_[1] + 1;
6742 }
6743 } else {
6744 switch(id) {
6745 case 0:
6746 return p[0] / 2 + p[1] * vshift_[0] + p[2] * vshift_[1];
6747 case 1:
6748 return p[0] / 2 + (p[1] + 1) * vshift_[0] + p[2] * vshift_[1] + 1;
6749 }
6750 }
6751 return -1;
6752}
6753
6754inline ttk::SimplexId
6755 ttk::ImplicitTriangulation::getTriangleStarF(const SimplexId p[3],
6756 const int id) const {
6757 if(p[0] % 2) {
6758 if(p[2] > 0 and p[2] < nbvoxels_[2]) {
6759 switch(id) {
6760 case 0:
6761 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6762 + 1; // BCDG
6763 case 1:
6764 return (p[0] - 1) * 3 + p[1] * tetshift_[0]
6765 + (p[2] - 1) * tetshift_[1] + 4; // BFGH
6766 }
6767 } else if(p[2] == 0)
6768 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6769 + 1; // BCDG
6770 else
6771 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
6772 + 4; // BFGH
6773 } else {
6774 if(p[2] > 0 and p[2] < nbvoxels_[2]) {
6775 switch(id) {
6776 case 0:
6777 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]; // ABCG
6778 case 1:
6779 return p[0] * 3 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
6780 + 3; // BEFG
6781 }
6782 } else if(p[2] == 0)
6783 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]; // ABCG
6784 else
6785 return p[0] * 3 + p[1] * tetshift_[0] + (p[2] - 1) * tetshift_[1]
6786 + 3; // BEFG
6787 }
6788
6789 return -1;
6790}
6791
6792inline ttk::SimplexId
6793 ttk::ImplicitTriangulation::getTriangleStarH(const SimplexId p[3],
6794 const int id) const {
6795 if(p[0] % 2) {
6796 if(p[1] > 0 and p[1] < nbvoxels_[1]) {
6797 switch(id) {
6798 case 0:
6799 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6800 + 3; // BEFG
6801 case 1:
6802 return (p[0] - 1) * 3 + (p[1] - 1) * tetshift_[0]
6803 + p[2] * tetshift_[1] + 5; // BDGH
6804 }
6805 } else if(p[1] == 0)
6806 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6807 + 3; // BEFG
6808 else
6809 return (p[0] - 1) * 3 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
6810 + 5; // BDGH
6811 } else {
6812 if(p[1] > 0 and p[1] < nbvoxels_[1]) {
6813 switch(id) {
6814 case 0:
6815 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6816 + 2; // ABEG
6817 case 1:
6818 return p[0] * 3 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
6819 + 1; // BCDG
6820 }
6821 } else if(p[1] == 0)
6822 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1] + 2; // ABEG
6823 else
6824 return p[0] * 3 + (p[1] - 1) * tetshift_[0] + p[2] * tetshift_[1]
6825 + 1; // BCDG
6826 }
6827 return -1;
6828}
6829
6830inline ttk::SimplexId
6831 ttk::ImplicitTriangulation::getTriangleStarC(const SimplexId p[3],
6832 const int id) const {
6833 if(p[0] % 2) {
6834 if(p[0] > 1 and p[0] < (dimensions_[0] * 2 - 2)) {
6835 switch(id) {
6836 case 0:
6837 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6838 + 2; // ABEG
6839 case 1:
6840 return ((p[0] - 2) / 2) * 6 + p[1] * tetshift_[0]
6841 + p[2] * tetshift_[1] + 4; // BFGH
6842 }
6843 } else if(p[0] < 2)
6844 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6845 + 2; // ABEG
6846 else
6847 return ((p[0] - 2) / 2) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6848 + 4; // BFGH
6849 } else {
6850 if(p[0] > 1 and p[0] < (dimensions_[0] * 2 - 2)) {
6851 switch(id) {
6852 case 0:
6853 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]; // ABCG
6854 case 1:
6855 return ((p[0] - 1) / 2) * 6 + p[1] * tetshift_[0]
6856 + p[2] * tetshift_[1] + 5; // BDGH
6857 }
6858 } else if(p[0] < 2)
6859 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]; // ABCG
6860 else
6861 return ((p[0] - 1) / 2) * 6 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6862 + 5; // BDGH
6863 }
6864
6865 return -1;
6866}
6867
6868inline ttk::SimplexId
6869 ttk::ImplicitTriangulation::getTriangleStarD1(const SimplexId p[3],
6870 const int id) const {
6871 if(p[0] % 2) {
6872 switch(id) {
6873 case 0:
6874 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6875 + 2; // ABEG
6876 case 1:
6877 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6878 + 3; // BEFG
6879 }
6880 } else {
6881 switch(id) {
6882 case 0:
6883 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1] + 1; // BCDG
6884 case 1:
6885 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1] + 5; // BDGH
6886 }
6887 }
6888 return -1;
6889}
6890
6891inline ttk::SimplexId
6892 ttk::ImplicitTriangulation::getTriangleStarD2(const SimplexId p[3],
6893 const int id) const {
6894 if(p[0] % 2) {
6895 switch(id) {
6896 case 0:
6897 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6898 + 5; // BDGH
6899 case 1:
6900 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6901 + 4; // BFGH
6902 }
6903 } else {
6904 switch(id) {
6905 case 0:
6906 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]; // ABCG
6907 case 1:
6908 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1] + 2; // ABEG
6909 }
6910 }
6911 return -1;
6912}
6913
6914inline ttk::SimplexId
6915 ttk::ImplicitTriangulation::getTriangleStarD3(const SimplexId p[3],
6916 const int id) const {
6917 if(p[0] % 2) {
6918 switch(id) {
6919 case 0:
6920 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6921 + 3; // BEFG
6922 case 1:
6923 return (p[0] - 1) * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]
6924 + 4; // BFGH
6925 }
6926 } else {
6927 switch(id) {
6928 case 0:
6929 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1]; // ABCG
6930 case 1:
6931 return p[0] * 3 + p[1] * tetshift_[0] + p[2] * tetshift_[1] + 1; // BCDG
6932 }
6933 }
6934 return -1;
6935}
6936
6937inline ttk::SimplexId
6938 ttk::ImplicitTriangulation::getTetrahedronVertexABCG(const SimplexId p[3],
6939 const int id) const {
6940 switch(id) {
6941 case 0:
6942 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1]; // a
6943 case 1:
6944 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + 1; // b
6945 case 2:
6946 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]; // c
6947 case 3:
6948 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
6949 + vshift_[1]; // g
6950 }
6951 return -1;
6952}
6953
6954inline ttk::SimplexId
6955 ttk::ImplicitTriangulation::getTetrahedronVertexBCDG(const SimplexId p[3],
6956 const int id) const {
6957 switch(id) {
6958 case 0:
6959 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + 1; // b
6960 case 1:
6961 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]; // c
6962 case 2:
6963 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0] + 1; // d
6964 case 3:
6965 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
6966 + vshift_[1]; // g
6967 }
6968 return -1;
6969}
6970
6971inline ttk::SimplexId
6972 ttk::ImplicitTriangulation::getTetrahedronVertexABEG(const SimplexId p[3],
6973 const int id) const {
6974 switch(id) {
6975 case 0:
6976 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1]; // a
6977 case 1:
6978 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + 1; // b
6979 case 2:
6980 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1]; // e
6981 case 3:
6982 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
6983 + vshift_[1]; // g
6984 }
6985 return -1;
6986}
6987
6988inline ttk::SimplexId
6989 ttk::ImplicitTriangulation::getTetrahedronVertexBEFG(const SimplexId p[3],
6990 const int id) const {
6991 switch(id) {
6992 case 0:
6993 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + 1; // b
6994 case 1:
6995 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1]; // e
6996 case 2:
6997 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1] + 1; // f
6998 case 3:
6999 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
7000 + vshift_[1]; // g
7001 }
7002 return -1;
7003}
7004
7005inline ttk::SimplexId
7006 ttk::ImplicitTriangulation::getTetrahedronVertexBFGH(const SimplexId p[3],
7007 const int id) const {
7008 switch(id) {
7009 case 0:
7010 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + 1; // b
7011 case 1:
7012 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[1] + 1; // f
7013 case 2:
7014 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
7015 + vshift_[1]; // g
7016 case 3:
7017 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
7018 + vshift_[1] + 1; // h
7019 }
7020 return -1;
7021}
7022
7023inline ttk::SimplexId
7024 ttk::ImplicitTriangulation::getTetrahedronVertexBDGH(const SimplexId p[3],
7025 const int id) const {
7026 switch(id) {
7027 case 0:
7028 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + 1; // b
7029 case 1:
7030 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0] + 1; // d
7031 case 2:
7032 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
7033 + vshift_[1]; // g
7034 case 3:
7035 return p[0] + p[1] * vshift_[0] + p[2] * vshift_[1] + vshift_[0]
7036 + vshift_[1] + 1; // h
7037 }
7038 return -1;
7039}
7040
7041inline ttk::SimplexId
7042 ttk::ImplicitTriangulation::getTetrahedronEdgeABCG(const SimplexId p[3],
7043 const int id) const {
7044 switch(id) {
7045 case 0:
7046 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ab-L
7047 case 1:
7048 return esetshift_[0] + p[0] + p[1] * eshift_[2]
7049 + p[2] * eshift_[3]; // ac-H
7050 case 2:
7051 return esetshift_[1] + p[0] + (p[1] + 1) * eshift_[4]
7052 + p[2] * eshift_[5]; // ae-P
7053 case 3:
7054 return esetshift_[2] + p[0] + p[1] * eshift_[6]
7055 + p[2] * eshift_[7]; // bc-D1
7056 case 4:
7057 return esetshift_[3] + p[0] + p[1] * eshift_[8]
7058 + p[2] * eshift_[9]; // ag-D2
7059 case 5:
7060 return esetshift_[5] + p[0] + p[1] * eshift_[12]
7061 + p[2] * eshift_[13]; // bg-D4
7062 }
7063 return -1;
7064}
7065
7066inline ttk::SimplexId
7067 ttk::ImplicitTriangulation::getTetrahedronEdgeBCDG(const SimplexId p[3],
7068 const int id) const {
7069 switch(id) {
7070 case 0:
7071 return p[0] + (p[1] + 1) * eshift_[0] + p[2] * eshift_[1]; // ab-L
7072 case 1:
7073 return esetshift_[0] + (p[0] + 1) + p[1] * eshift_[2]
7074 + p[2] * eshift_[3]; // ac-H
7075 case 2:
7076 return esetshift_[1] + p[0] + (p[1] + 1) * eshift_[4]
7077 + p[2] * eshift_[5]; // ae-P
7078 case 3:
7079 return esetshift_[2] + p[0] + p[1] * eshift_[6]
7080 + p[2] * eshift_[7]; // bc-D1
7081 case 4:
7082 return esetshift_[4] + p[0] + (p[1] + 1) * eshift_[10]
7083 + p[2] * eshift_[11]; // be-D3
7084 case 5:
7085 return esetshift_[5] + p[0] + p[1] * eshift_[12]
7086 + p[2] * eshift_[13]; // bg-D4
7087 }
7088 return -1;
7089}
7090
7091inline ttk::SimplexId
7092 ttk::ImplicitTriangulation::getTetrahedronEdgeABEG(const SimplexId p[3],
7093 const int id) const {
7094 switch(id) {
7095 case 0:
7096 return p[0] + p[1] * eshift_[0] + p[2] * eshift_[1]; // ab-L
7097 case 1:
7098 return esetshift_[0] + p[0] + p[1] * eshift_[2]
7099 + (p[2] + 1) * eshift_[3]; // ac-H
7100 case 2:
7101 return esetshift_[1] + p[0] + p[1] * eshift_[4]
7102 + p[2] * eshift_[5]; // ae-P
7103 case 3:
7104 return esetshift_[3] + p[0] + p[1] * eshift_[8]
7105 + p[2] * eshift_[9]; // ag-D2
7106 case 4:
7107 return esetshift_[4] + p[0] + p[1] * eshift_[10]
7108 + p[2] * eshift_[11]; // be-D3
7109 case 5:
7110 return esetshift_[5] + p[0] + p[1] * eshift_[12]
7111 + p[2] * eshift_[13]; // bg-D4
7112 }
7113 return -1;
7114}
7115
7116inline ttk::SimplexId
7117 ttk::ImplicitTriangulation::getTetrahedronEdgeBEFG(const SimplexId p[3],
7118 const int id) const {
7119 switch(id) {
7120 case 0:
7121 return p[0] + p[1] * eshift_[0] + (p[2] + 1) * eshift_[1]; // ab-L
7122 case 1:
7123 return esetshift_[0] + p[0] + p[1] * eshift_[2]
7124 + (p[2] + 1) * eshift_[3]; // ac-H
7125 case 2:
7126 return esetshift_[1] + (p[0] + 1) + p[1] * eshift_[4]
7127 + p[2] * eshift_[5]; // ae-P
7128 case 3:
7129 return esetshift_[2] + p[0] + p[1] * eshift_[6]
7130 + (p[2] + 1) * eshift_[7]; // bc-D1
7131 case 4:
7132 return esetshift_[4] + p[0] + p[1] * eshift_[10]
7133 + p[2] * eshift_[11]; // be-D3
7134 case 5:
7135 return esetshift_[5] + p[0] + p[1] * eshift_[12]
7136 + p[2] * eshift_[13]; // bg-D4
7137 }
7138 return -1;
7139}
7140
7141inline ttk::SimplexId
7142 ttk::ImplicitTriangulation::getTetrahedronEdgeBFGH(const SimplexId p[3],
7143 const int id) const {
7144 switch(id) {
7145 case 0:
7146 return p[0] + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1]; // ab-L
7147 case 1:
7148 return esetshift_[0] + (p[0] + 1) + p[1] * eshift_[2]
7149 + (p[2] + 1) * eshift_[3]; // ac-H
7150 case 2:
7151 return esetshift_[1] + (p[0] + 1) + p[1] * eshift_[4]
7152 + p[2] * eshift_[5]; // ae-P
7153 case 3:
7154 return esetshift_[2] + p[0] + p[1] * eshift_[6]
7155 + (p[2] + 1) * eshift_[7]; // bc-D1
7156 case 4:
7157 return esetshift_[3] + (p[0] + 1) + p[1] * eshift_[8]
7158 + p[2] * eshift_[9]; // ag-D2
7159 case 5:
7160 return esetshift_[5] + p[0] + p[1] * eshift_[12]
7161 + p[2] * eshift_[13]; // bg-D4
7162 }
7163 return -1;
7164}
7165
7166inline ttk::SimplexId
7167 ttk::ImplicitTriangulation::getTetrahedronEdgeBDGH(const SimplexId p[3],
7168 const int id) const {
7169 switch(id) {
7170 case 0:
7171 return p[0] + (p[1] + 1) * eshift_[0] + (p[2] + 1) * eshift_[1]; // ab-L
7172 case 1:
7173 return esetshift_[0] + (p[0] + 1) + p[1] * eshift_[2]
7174 + p[2] * eshift_[3]; // ac-H
7175 case 2:
7176 return esetshift_[1] + (p[0] + 1) + (p[1] + 1) * eshift_[4]
7177 + p[2] * eshift_[5]; // ae-P
7178 case 3:
7179 return esetshift_[3] + (p[0] + 1) + p[1] * eshift_[8]
7180 + p[2] * eshift_[9]; // ag-D2
7181 case 4:
7182 return esetshift_[4] + p[0] + (p[1] + 1) * eshift_[10]
7183 + p[2] * eshift_[11]; // be-D3
7184 case 5:
7185 return esetshift_[5] + p[0] + p[1] * eshift_[12]
7186 + p[2] * eshift_[13]; // bg-D4
7187 }
7188 return -1;
7189}
7190
7191inline ttk::SimplexId
7192 ttk::ImplicitTriangulation::getTetrahedronTriangleABCG(const SimplexId p[3],
7193 const int id) const {
7194 switch(id) {
7195 case 0:
7196 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1];
7197 case 1:
7198 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5];
7199 case 2:
7200 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9];
7201 case 3:
7202 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10] + p[2] * tshift_[11];
7203 }
7204 return -1;
7205}
7206
7207inline ttk::SimplexId
7208 ttk::ImplicitTriangulation::getTetrahedronTriangleBCDG(const SimplexId p[3],
7209 const int id) const {
7210 switch(id) {
7211 case 0:
7212 return p[0] * 2 + p[1] * tshift_[0] + p[2] * tshift_[1] + 1;
7213 case 1:
7214 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10] + p[2] * tshift_[11];
7215 case 2:
7216 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7];
7217 case 3:
7218 return tsetshift_[0] + p[0] * 2 + (p[1] + 1) * tshift_[2]
7219 + p[2] * tshift_[3];
7220 }
7221 return -1;
7222}
7223
7224inline ttk::SimplexId
7225 ttk::ImplicitTriangulation::getTetrahedronTriangleABEG(const SimplexId p[3],
7226 const int id) const {
7227 switch(id) {
7228 case 0:
7229 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3];
7230 case 1:
7231 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9];
7232 case 2:
7233 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
7234 + 1;
7235 case 3:
7236 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
7237 + 1;
7238 }
7239 return -1;
7240}
7241
7242inline ttk::SimplexId
7243 ttk::ImplicitTriangulation::getTetrahedronTriangleBEFG(const SimplexId p[3],
7244 const int id) const {
7245 switch(id) {
7246 case 0:
7247 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7]
7248 + 1;
7249 case 1:
7250 return tsetshift_[0] + p[0] * 2 + p[1] * tshift_[2] + p[2] * tshift_[3]
7251 + 1;
7252 case 2:
7253 return p[0] * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1];
7254 case 3:
7255 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10] + p[2] * tshift_[11]
7256 + 1;
7257 }
7258 return -1;
7259}
7260
7261inline ttk::SimplexId
7262 ttk::ImplicitTriangulation::getTetrahedronTriangleBFGH(const SimplexId p[3],
7263 const int id) const {
7264 switch(id) {
7265 case 0:
7266 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9]
7267 + 1;
7268 case 1:
7269 return tsetshift_[4] + p[0] * 2 + p[1] * tshift_[10] + p[2] * tshift_[11]
7270 + 1;
7271 case 2:
7272 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
7273 + 3;
7274 case 3:
7275 return p[0] * 2 + p[1] * tshift_[0] + (p[2] + 1) * tshift_[1] + 1;
7276 }
7277 return -1;
7278}
7279
7280inline ttk::SimplexId
7281 ttk::ImplicitTriangulation::getTetrahedronTriangleBDGH(const SimplexId p[3],
7282 const int id) const {
7283 switch(id) {
7284 case 0:
7285 return tsetshift_[1] + p[0] * 2 + p[1] * tshift_[4] + p[2] * tshift_[5]
7286 + 2;
7287 case 1:
7288 return tsetshift_[2] + p[0] * 2 + p[1] * tshift_[6] + p[2] * tshift_[7];
7289 case 2:
7290 return tsetshift_[3] + p[0] * 2 + p[1] * tshift_[8] + p[2] * tshift_[9]
7291 + 1;
7292 case 3:
7293 return tsetshift_[0] + p[0] * 2 + (p[1] + 1) * tshift_[2]
7294 + p[2] * tshift_[3] + 1;
7295 }
7296 return -1;
7297}
7298
7299inline ttk::SimplexId ttk::ImplicitTriangulation::getTetrahedronNeighborABCG(
7300 const SimplexId t, const SimplexId p[3], const int id) const {
7301 switch(id) {
7302 case 0:
7303 return t + 1;
7304 case 1:
7305 return t + 2;
7306 case 2:
7307 if(p[0] > 0)
7308 return t - 1;
7309 else
7310 return t - tetshift_[1] + 3;
7311 case 3:
7312 return t - tetshift_[1] + 3;
7313 }
7314 return -1;
7315}
7316
7317inline ttk::SimplexId ttk::ImplicitTriangulation::getTetrahedronNeighborBCDG(
7318 const SimplexId t, const SimplexId p[3], const int id) const {
7319 switch(id) {
7320 case 0:
7321 return t - 1;
7322 case 1:
7323 return t + 4;
7324 case 2:
7325 if(p[2] > 0)
7326 return t - tetshift_[1] + 3;
7327 else
7328 return t + tetshift_[0] + 1;
7329 case 3:
7330 return t + tetshift_[0] + 1;
7331 }
7332 return -1;
7333}
7334
7335inline ttk::SimplexId ttk::ImplicitTriangulation::getTetrahedronNeighborABEG(
7336 const SimplexId t, const SimplexId p[3], const int id) const {
7337 switch(id) {
7338 case 0:
7339 return t - 2;
7340 case 1:
7341 return t + 1;
7342 case 2:
7343 if(p[0] > 0)
7344 return t - 4;
7345 else
7346 return t - tetshift_[0] - 1;
7347 case 3:
7348 return t - tetshift_[0] - 1;
7349 }
7350 return -1;
7351}
7352
7353inline ttk::SimplexId ttk::ImplicitTriangulation::getTetrahedronNeighborBEFG(
7354 const SimplexId t, const SimplexId p[3], const int id) const {
7355 switch(id) {
7356 case 0:
7357 return t - 1;
7358 case 1:
7359 return t + 1;
7360 case 2:
7361 if(p[1] > 0)
7362 return t - tetshift_[0] + 2;
7363 else
7364 return t + tetshift_[1] - 3;
7365 case 3:
7366 return t + tetshift_[1] - 3;
7367 }
7368 return -1;
7369}
7370
7371inline ttk::SimplexId ttk::ImplicitTriangulation::getTetrahedronNeighborBFGH(
7372 const SimplexId t, const SimplexId p[3], const int id) const {
7373 switch(id) {
7374 case 0:
7375 return t - 1;
7376 case 1:
7377 return t + 1;
7378 case 2:
7379 if(p[0] < nbvoxels_[0] - 1)
7380 return t + 4;
7381 else
7382 return t + tetshift_[1] - 3;
7383 case 3:
7384 return t + tetshift_[1] - 3;
7385 }
7386 return -1;
7387}
7388
7389inline ttk::SimplexId ttk::ImplicitTriangulation::getTetrahedronNeighborBDGH(
7390 const SimplexId t, const SimplexId p[3], const int id) const {
7391 switch(id) {
7392 case 0:
7393 return t - 1;
7394 case 1:
7395 return t - 4;
7396 case 2:
7397 if(p[0] < nbvoxels_[0] - 1)
7398 return t + 1;
7399 else
7400 return t + tetshift_[0] - 2;
7401 case 3:
7402 return t + tetshift_[0] - 2;
7403 }
7404 return -1;
7405}
7406
7407#include <ImplicitPreconditions.h>
7408
#define TTK_TRIANGULATION_INTERNAL(NAME)
int getTriangleVertexInternal(const SimplexId &triangleId, const int &localVertexId, SimplexId &vertexId) const override
SimplexId TTK_TRIANGULATION_INTERNAL() getVertexNeighborNumber(const SimplexId &vertexId) const final
int TTK_TRIANGULATION_INTERNAL() getVertexNeighbor(const SimplexId &vertexId, const int &localNeighborId, SimplexId &neighborId) const final
int getTetrahedronVertex(const SimplexId &tetId, const int &localVertexId, SimplexId &vertexId) const override
int TTK_TRIANGULATION_INTERNAL() getEdgeStar(const SimplexId &edgeId, const int &localStarId, SimplexId &starId) const override
int TTK_TRIANGULATION_INTERNAL() getVertexLink(const SimplexId &vertexId, const int &localLinkId, SimplexId &linkId) const override
int getTetrahedronTriangle(const SimplexId &tetId, const int &id, SimplexId &triangleId) const override
SimplexId getEdgeTriangleNumberInternal(const SimplexId &edgeId) const override
int TTK_TRIANGULATION_INTERNAL() getVertexStar(const SimplexId &vertexId, const int &localStarId, SimplexId &starId) const override
int TTK_TRIANGULATION_INTERNAL() getVertexPoint(const SimplexId &vertexId, float &x, float &y, float &z) const override
int getVertexEdgeInternal(const SimplexId &vertexId, const int &id, SimplexId &edgeId) const override
int getEdgeVertexInternal(const SimplexId &edgeId, const int &localVertexId, SimplexId &vertexId) const override
SimplexId TTK_TRIANGULATION_INTERNAL() getEdgeStarNumber(const SimplexId &edgeId) const override
int TTK_TRIANGULATION_INTERNAL() getTriangleStar(const SimplexId &triangleId, const int &localStarId, SimplexId &starId) const override
int TTK_TRIANGULATION_INTERNAL() getEdgeLink(const SimplexId &edgeId, const int &localLinkId, SimplexId &linkId) const override
bool TTK_TRIANGULATION_INTERNAL() isVertexOnBoundary(const SimplexId &vertexId) const override
bool TTK_TRIANGULATION_INTERNAL() isEdgeOnBoundary(const SimplexId &edgeId) const override
SimplexId getVertexTriangleNumberInternal(const SimplexId &vertexId) const override
SimplexId getTriangleNeighborNumber(const SimplexId &triangleId) const override
int getEdgeTriangleInternal(const SimplexId &edgeId, const int &id, SimplexId &triangleId) const override
SimplexId TTK_TRIANGULATION_INTERNAL() getVertexStarNumber(const SimplexId &vertexId) const override
int TTK_TRIANGULATION_INTERNAL() getTriangleLink(const SimplexId &triangleId, const int &localLinkId, SimplexId &linkId) const override
SimplexId TTK_TRIANGULATION_INTERNAL() getTriangleStarNumber(const SimplexId &triangleId) const override
int getTetrahedronNeighbor(const SimplexId &tetId, const int &localNeighborId, SimplexId &neighborId) const override
int getVertexTriangleInternal(const SimplexId &vertexId, const int &id, SimplexId &triangleId) const override
SimplexId getTetrahedronNeighborNumber(const SimplexId &tetId) const override
int getTriangleNeighbor(const SimplexId &triangleId, const int &localNeighborId, SimplexId &neighborId) const override
int getTriangleEdgeInternal(const SimplexId &triangleId, const int &id, SimplexId &edgeId) const override
int getTetrahedronEdge(const SimplexId &tetId, const int &id, SimplexId &edgeId) const override
ImplicitTriangulation is a class that provides time and memory efficient traversal methods on triangu...
std::array< SimplexId, 8 > vertexNeighborGH_
std::array< SimplexId, 4 > vertexNeighbor2dAC_
const std::vector< std::array< SimplexId, 3 > > *TTK_TRIANGULATION_INTERNAL() getTriangles() override
std::array< SimplexId, 8 > vertexNeighborBF_
ImplicitTriangulation & operator=(const ImplicitTriangulation &)=default
std::array< SimplexId, 8 > vertexNeighborBD_
std::array< SimplexId, 3 > vertexNeighbor2dB_
std::array< SimplexId, 7 > vertexNeighborB_
std::array< SimplexId, 6 > vertexNeighborEF_
SimplexId TTK_TRIANGULATION_INTERNAL() getCellVertexNumber(const SimplexId &cellId) const override
std::array< SimplexId, 14 > vertexNeighborABCDEFGH_
const std::vector< std::vector< SimplexId > > * getTriangleEdgesInternal() override
SimplexId getCellEdgeNumberInternal(const SimplexId &cellId) const override
int TTK_TRIANGULATION_INTERNAL() getDimensionality() const override
ImplicitTriangulation(const ImplicitTriangulation &)=default
std::array< SimplexId, 8 > vertexNeighborEG_
int preconditionEdgesInternal() override=0
int getCellTriangleInternal(const SimplexId &cellId, const int &id, SimplexId &triangleId) const override
std::array< SimplexId, 4 > vertexNeighborH_
std::array< SimplexId, 4 > vertexNeighborE_
std::array< SimplexId, 2 > vertexNeighbor2dD_
const std::vector< std::vector< SimplexId > > *TTK_TRIANGULATION_INTERNAL() getTriangleStars() override
int getCellVTKIDInternal(const int &ttkId, int &vtkId) const override
bool TTK_TRIANGULATION_INTERNAL() isTriangleOnBoundary(const SimplexId &triangleId) const override
SimplexId getTriangleEdgeNumberInternal(const SimplexId &) const override
const std::vector< std::vector< SimplexId > > *TTK_TRIANGULATION_INTERNAL() getEdgeLinks() override
const std::vector< std::vector< SimplexId > > * getVertexEdgesInternal() override
std::array< SimplexId, 10 > vertexNeighborAEFB_
virtual int getTriangleNeighbor(const SimplexId &triangleId, const int &localNeighborId, SimplexId &neighborId) const =0
std::array< SimplexId, 6 > vertexNeighbor2dABCD_
std::array< SimplexId, 6 > vertexNeighborFH_
SimplexId TTK_TRIANGULATION_INTERNAL() getNumberOfCells() const override
const std::vector< std::vector< SimplexId > > *TTK_TRIANGULATION_INTERNAL() getVertexStars() override
const std::vector< std::vector< SimplexId > > *TTK_TRIANGULATION_INTERNAL() getEdgeStars() override
std::array< SimplexId, 6 > vertexNeighborDH_
std::array< SimplexId, 6 > vertexNeighborCD_
const std::vector< std::vector< SimplexId > > * getCellEdgesInternal() override
std::array< SimplexId, 7 > vertexNeighborG_
int setInputGrid(const float &xOrigin, const float &yOrigin, const float &zOrigin, const float &xSpacing, const float &ySpacing, const float &zSpacing, const SimplexId &xDim, const SimplexId &yDim, const SimplexId &zDim) override
int getTetrahedronNeighbors(std::vector< std::vector< SimplexId > > &neighbors)
int TTK_TRIANGULATION_INTERNAL() getCellNeighbor(const SimplexId &cellId, const int &localNeighborId, SimplexId &neighborId) const override
const std::vector< std::vector< SimplexId > > * getVertexTrianglesInternal() override
virtual int preconditionTetrahedronsInternal()=0
virtual SimplexId getTetrahedronNeighborNumber(const SimplexId &tetId) const =0
virtual int getTetrahedronNeighbor(const SimplexId &tetId, const int &localNeighborId, SimplexId &neighborId) const =0
std::array< SimplexId, 10 > vertexNeighborAEGC_
virtual int getTetrahedronTriangle(const SimplexId &tetId, const int &id, SimplexId &triangleId) const =0
SimplexId getCellTriangleNumberInternal(const SimplexId &) const override
std::array< SimplexId, 10 > vertexNeighborEFGH_
ImplicitTriangulation & operator=(ImplicitTriangulation &&)=default
std::array< SimplexId, 2 > vertexNeighbor2dA_
bool isPowerOfTwo(unsigned long long int v, unsigned long long int &r)
SimplexId TTK_TRIANGULATION_INTERNAL() getNumberOfVertices() const override
SimplexId getVertexEdgeNumberInternal(const SimplexId &vertexId) const override
const std::vector< std::array< SimplexId, 2 > > *TTK_TRIANGULATION_INTERNAL() getEdges() override
const std::vector< std::vector< SimplexId > > *TTK_TRIANGULATION_INTERNAL() getCellNeighbors() override
const std::vector< std::vector< SimplexId > > *TTK_TRIANGULATION_INTERNAL() getVertexNeighbors() override
std::array< SimplexId, 4 > vertexNeighbor2dBD_
std::array< SimplexId, 10 > vertexNeighborBFHD_
int getTriangleNeighbors(std::vector< std::vector< SimplexId > > &neighbors)
virtual int getTetrahedronVertex(const SimplexId &tetId, const int &localVertexId, SimplexId &vertexId) const =0
std::array< SimplexId, 4 > vertexNeighborD_
SimplexId getNumberOfEdgesInternal() const override
std::array< SimplexId, 4 > vertexNeighborC_
virtual int getTetrahedronEdge(const SimplexId &tetId, const int &id, SimplexId &edgeId) const =0
virtual SimplexId getTriangleNeighborNumber(const SimplexId &triangleId) const =0
int getTetrahedronEdges(std::vector< std::vector< SimplexId > > &edges) const
std::array< SimplexId, 4 > vertexNeighbor2dCD_
std::array< SimplexId, 8 > vertexNeighborCG_
std::array< SimplexId, 3 > vertexNeighbor2dC_
std::array< SimplexId, 6 > vertexNeighborAC_
SimplexId TTK_TRIANGULATION_INTERNAL() getCellNeighborNumber(const SimplexId &cellId) const override
ImplicitTriangulation(ImplicitTriangulation &&)=default
int TTK_TRIANGULATION_INTERNAL() getCellVertex(const SimplexId &cellId, const int &localVertexId, SimplexId &vertexId) const override
const std::vector< std::vector< SimplexId > > * getEdgeTrianglesInternal() override
std::array< SimplexId, 10 > vertexNeighborABCD_
std::array< SimplexId, 10 > vertexNeighborGHDC_
const std::vector< std::vector< SimplexId > > *TTK_TRIANGULATION_INTERNAL() getTriangleLinks() override
std::array< SimplexId, 8 > vertexNeighborAB_
std::array< SimplexId, 6 > vertexNeighborAE_
int getCellEdgeInternal(const SimplexId &cellId, const int &id, SimplexId &edgeId) const override
std::array< SimplexId, 4 > vertexNeighborA_
SimplexId getNumberOfTrianglesInternal() const override
std::array< SimplexId, 4 > vertexNeighborF_
SimplexId TTK_TRIANGULATION_INTERNAL() getVertexLinkNumber(const SimplexId &vertexId) const override
const std::vector< std::vector< SimplexId > > * getCellTrianglesInternal() override
std::array< SimplexId, 4 > vertexNeighbor2dAB_
virtual int preconditionVerticesInternal()=0
SimplexId TTK_TRIANGULATION_INTERNAL() getTriangleLinkNumber(const SimplexId &triangleId) const override
SimplexId TTK_TRIANGULATION_INTERNAL() getEdgeLinkNumber(const SimplexId &edgeId) const override
const std::vector< std::vector< SimplexId > > *TTK_TRIANGULATION_INTERNAL() getVertexLinks() override
const std::array< SimplexId, 3 > & getGridDimensions() const override
int preconditionTrianglesInternal() override=0
int getTetrahedronTriangles(std::vector< std::vector< SimplexId > > &triangles) const
RegularGridTriangulation is an abstract subclass of ttk::AbstractTriangulation that exposes a common ...
virtual void tetrahedronToPosition(const SimplexId tetrahedron, SimplexId p[3]) const =0
virtual void vertexToPosition(const SimplexId vertex, SimplexId p[3]) const =0
virtual void triangleToPosition2d(const SimplexId triangle, SimplexId p[2]) const =0
std::array< SimplexId, 3 > dimensions_
virtual void vertexToPosition2d(const SimplexId vertex, SimplexId p[2]) const =0
virtual void triangleToPosition(const SimplexId triangle, const int k, SimplexId p[3]) const =0
The Topology ToolKit.
int SimplexId
Identifier type for simplices of any dimension.
Definition DataTypes.h:22