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) c