TTK
Loading...
Searching...
No Matches
JacobiSet.h
Go to the documentation of this file.
1
27
28#pragma once
29
30// base code includes
31#include <Debug.h>
33#include <Triangulation.h>
34#include <UnionFind.h>
35#include <vector>
36
37namespace ttk {
38
39 class JacobiSet : virtual public Debug {
40 public:
41 JacobiSet();
42
43 template <class dataTypeU, class dataTypeV, typename triangulationType>
44 int execute(std::vector<std::pair<SimplexId, char>> &jacobiSet,
45 const dataTypeU *const uField,
46 const dataTypeV *const vField,
47 const triangulationType &triangulation,
48 std::vector<char> *isPareto = nullptr);
49
50 template <class dataTypeU, class dataTypeV, typename triangulationType>
51 char getCriticalType(const SimplexId &edgeId,
52 const dataTypeU *const uField,
53 const dataTypeV *const vField,
54 const triangulationType &triangulation);
55
56 template <class dataTypeU, class dataTypeV>
57 int perturb(const dataTypeU *const uField,
58 const dataTypeV *const vField,
59 const dataTypeU uEpsilon = Geometry::powIntTen(-DBL_DIG),
60 const dataTypeV vEpsilon = Geometry::powIntTen(-DBL_DIG)) const;
61
62 inline void
63 setEdgeFans(const std::vector<std::vector<SimplexId>> *edgeFans) {
64 edgeFans_ = edgeFans;
65 }
66
68 const std::vector<std::vector<std::pair<SimplexId, SimplexId>>>
69 *edgeFanLinkEdgeLists) {
70 edgeFanLinkEdgeLists_ = edgeFanLinkEdgeLists;
71 }
72
73 inline void setEdgeList(
74 const std::vector<std::pair<SimplexId, SimplexId>> *edgeList) {
75 edgeList_ = edgeList;
76 }
77
78 inline void setSosOffsets(std::vector<SimplexId> *sosOffsets) {
79 // legacy API
80 setSosOffsetsU(sosOffsets->data());
81 }
82
91 inline void setSosOffsetsU(const SimplexId *const sosOffsets) {
92 sosOffsetsU_ = sosOffsets;
93 }
94
103 inline void setSosOffsetsV(const SimplexId *const sosOffsets) {
104 sosOffsetsV_ = sosOffsets;
105 }
106
107 // NOTE: here it's not clear how vtk builds vtkIdType
108 // to check on bigger data-sets
109 inline void setTetList(const SimplexId *tetList) {
110 tetList_ = tetList;
111 }
112
113 inline void setVertexNumber(const SimplexId &vertexNumber) {
114 vertexNumber_ = vertexNumber;
115 }
116
117 inline void
119 if(triangulation) {
120 triangulation->preconditionEdges();
121 triangulation->preconditionEdgeStars();
122 }
123 }
124
125 protected:
126 template <class dataTypeU, class dataTypeV>
127 int executeLegacy(std::vector<std::pair<SimplexId, char>> &jacobiSet,
128 const dataTypeU *const uField,
129 const dataTypeV *const vField);
130
133 const std::vector<std::pair<SimplexId, SimplexId>> *edgeList_{};
134 // for each edge, one skeleton of its triangle fan
135 const std::vector<std::vector<std::pair<SimplexId, SimplexId>>>
137 // for each edge, the one skeleton of its triangle fan
138 const std::vector<std::vector<SimplexId>> *edgeFans_{};
140 };
141} // namespace ttk
142
143// if the package is not a template, comment the following line
144#include "JacobiSet_Template.h"
AbstractTriangulation is an interface class that defines an interface for efficient traversal methods...
Minimalist debugging class.
Definition Debug.h:88
TTK processing package for the computation of the Jacobi set of bivariate volumetric data.
Definition JacobiSet.h:39
void setSosOffsets(std::vector< SimplexId > *sosOffsets)
Definition JacobiSet.h:78
void setEdgeFanLinkEdgeList(const std::vector< std::vector< std::pair< SimplexId, SimplexId > > > *edgeFanLinkEdgeLists)
Definition JacobiSet.h:67
const SimplexId * sosOffsetsV_
Definition JacobiSet.h:139
const std::vector< std::pair< SimplexId, SimplexId > > * edgeList_
Definition JacobiSet.h:133
const SimplexId * sosOffsetsU_
Definition JacobiSet.h:139
void setEdgeList(const std::vector< std::pair< SimplexId, SimplexId > > *edgeList)
Definition JacobiSet.h:73
void setVertexNumber(const SimplexId &vertexNumber)
Definition JacobiSet.h:113
int executeLegacy(std::vector< std::pair< SimplexId, char > > &jacobiSet, const dataTypeU *const uField, const dataTypeV *const vField)
void setTetList(const SimplexId *tetList)
Definition JacobiSet.h:109
SimplexId vertexNumber_
Definition JacobiSet.h:131
const std::vector< std::vector< SimplexId > > * edgeFans_
Definition JacobiSet.h:138
void setSosOffsetsV(const SimplexId *const sosOffsets)
Definition JacobiSet.h:103
const SimplexId * tetList_
Definition JacobiSet.h:132
char getCriticalType(const SimplexId &edgeId, const dataTypeU *const uField, const dataTypeV *const vField, const triangulationType &triangulation)
void preconditionTriangulation(AbstractTriangulation *const triangulation)
Definition JacobiSet.h:118
int perturb(const dataTypeU *const uField, const dataTypeV *const vField, const dataTypeU uEpsilon=Geometry::powIntTen(-DBL_DIG), const dataTypeV vEpsilon=Geometry::powIntTen(-DBL_DIG)) const
void setEdgeFans(const std::vector< std::vector< SimplexId > > *edgeFans)
Definition JacobiSet.h:63
void setSosOffsetsU(const SimplexId *const sosOffsets)
Definition JacobiSet.h:91
const std::vector< std::vector< std::pair< SimplexId, SimplexId > > > * edgeFanLinkEdgeLists_
Definition JacobiSet.h:136
int execute(std::vector< std::pair< SimplexId, char > > &jacobiSet, const dataTypeU *const uField, const dataTypeV *const vField, const triangulationType &triangulation, std::vector< char > *isPareto=nullptr)
T powIntTen(const int n)
Compute the nth power of ten.
Definition Geometry.h:405
The Topology ToolKit.
int SimplexId
Identifier type for simplices of any dimension.
Definition DataTypes.h:22