TTK
Loading...
Searching...
No Matches
ttkMergeTreeDistanceMatrix.h
Go to the documentation of this file.
1
33
34#pragma once
35
36// VTK Module
37#include <ttkMergeTreeDistanceMatrixModule.h>
38
39// VTK Includes
40#include <ttkAlgorithm.h>
41#include <vtkMultiBlockDataSet.h>
42#include <vtkSmartPointer.h>
43#include <vtkUnstructuredGrid.h>
44
45// TTK Base Includes
47
48class TTKMERGETREEDISTANCEMATRIX_EXPORT ttkMergeTreeDistanceMatrix
49 : public ttkAlgorithm // we inherit from the generic ttkAlgorithm class
50 ,
51 protected ttk::MergeTreeDistanceMatrix // and we inherit from the base class
52{
53private:
58 // Execution Options
59 int Backend = 0;
60 bool oldBD = branchDecomposition_;
61 bool oldNW = normalizedWasserstein_;
62 bool oldKS = keepSubtree_;
63
64 bool UseFieldDataParameters = false;
65
66public:
71 // Input Options
72 void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle) {
73 epsilon1UseFarthestSaddle_ = epsilon1UseFarthestSaddle;
74 Modified();
75 }
79
80 void SetEpsilonTree1(double epsilonTree1) {
81 epsilonTree1_ = epsilonTree1;
82 Modified();
83 }
84 double SetEpsilonTree1() {
85 return epsilonTree1_;
86 }
87
88 void SetEpsilon2Tree1(double epsilon2Tree1) {
89 epsilon2Tree1_ = epsilon2Tree1;
90 Modified();
91 }
93 return epsilon2Tree1_;
94 }
95
96 void SetEpsilon3Tree1(double epsilon3Tree1) {
97 epsilon3Tree1_ = epsilon3Tree1;
98 Modified();
99 }
101 return epsilon3Tree1_;
102 }
103
104 void SetPersistenceThreshold(double persistenceThreshold) {
105 persistenceThreshold_ = persistenceThreshold;
106 Modified();
107 }
110 }
111
112 void SetDeleteMultiPersPairs(bool doDelete) {
113 deleteMultiPersPairs_ = doDelete;
114 Modified();
115 }
119
120 void SetBranchMetric(int m) {
121 branchMetric_ = m;
122 Modified();
123 }
124
125 void SetPathMetric(int m) {
126 pathMetric_ = m;
127 Modified();
128 }
129
130 // Execution Options
131 void SetBackend(int newBackend) {
132 if(Backend == 2) { // Custom
133 oldBD = branchDecomposition_;
135 oldKS = keepSubtree_;
136 }
137 if(newBackend == 2) { // Custom
138 branchDecomposition_ = oldBD;
139 normalizedWasserstein_ = oldNW;
140 keepSubtree_ = oldKS;
141 }
142 Backend = newBackend;
143 Modified();
144 }
145 vtkGetMacro(Backend, int);
146
147 void SetAssignmentSolver(int assignmentSolver) {
148 assignmentSolverID_ = assignmentSolver;
149 Modified();
150 }
152 return assignmentSolverID_;
153 }
154
155 void SetBranchDecomposition(bool branchDecomposition) {
156 branchDecomposition_ = branchDecomposition;
157 Modified();
158 }
162
163 void SetNormalizedWasserstein(bool normalizedWasserstein) {
164 normalizedWasserstein_ = normalizedWasserstein;
165 Modified();
166 }
170
171 void SetKeepSubtree(bool keepSubtree) {
172 keepSubtree_ = keepSubtree;
173 Modified();
174 }
176 return keepSubtree_;
177 }
178
179 void SetDistanceSquaredRoot(bool distanceSquaredRoot) {
180 distanceSquaredRoot_ = distanceSquaredRoot;
181 Modified();
182 }
186
187 vtkSetMacro(UseFieldDataParameters, bool);
188 vtkGetMacro(UseFieldDataParameters, bool);
189
190 vtkSetMacro(mixtureCoefficient_, double);
191 vtkGetMacro(mixtureCoefficient_, double);
192
199
200protected:
207
212 int FillInputPortInformation(int port, vtkInformation *info) override;
213
218 int FillOutputPortInformation(int port, vtkInformation *info) override;
219
224 int RequestData(vtkInformation *request,
225 vtkInformationVector **inputVector,
226 vtkInformationVector *outputVector) override;
227
228 template <class dataType>
229 int run(vtkInformationVector *outputVector,
230 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees,
231 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees2);
232};
Baseclass of all VTK filters that wrap ttk modules.
virtual int RequestData(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
int FillInputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
int FillOutputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
TTK VTK-filter that wraps the ttk::MergeTreeDistanceMatrix module.
void SetEpsilon2Tree1(double epsilon2Tree1)
void SetNormalizedWasserstein(bool normalizedWasserstein)
~ttkMergeTreeDistanceMatrix() override
void SetPersistenceThreshold(double persistenceThreshold)
void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle)
void SetAssignmentSolver(int assignmentSolver)
void SetBranchDecomposition(bool branchDecomposition)
void SetEpsilonTree1(double epsilonTree1)
void SetEpsilon3Tree1(double epsilon3Tree1)
static ttkMergeTreeDistanceMatrix * New()
void SetDistanceSquaredRoot(bool distanceSquaredRoot)