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