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