TTK
Loading...
Searching...
No Matches
ttkMergeTree.h
Go to the documentation of this file.
1
76
77#pragma once
78
79// VTK includes
80#include <vtkSmartPointer.h>
81
82// VTK module
83#include <ttkMergeTreeModule.h>
84
85// ttk code includes
86#include <PathCompression.h>
87#include <ttkAlgorithm.h>
88#include <ttkMergeTreeBase.h>
90
91class vtkDataSet;
92
93class TTKMERGETREE_EXPORT ttkMergeTree : public ttkAlgorithm,
94 public ttkMergeTreeBase {
95
96public:
97 enum class BACKEND {
98 FTM = 0,
99 EXTREEM = 1,
100 };
101
102 static ttkMergeTree *New();
103
105
108 vtkGetMacro(ForceInputOffsetScalarField, bool);
109 vtkSetMacro(ForceInputOffsetScalarField, bool);
111
114 vtkGetMacro(Backend, int);
115 vtkSetMacro(Backend, int);
117
118 // Parameters uses a structure, we can't use vtkMacro on them
119
122 void SetTreeType(const int type) {
123 params_.treeType = (ttk::ftm::TreeType)type;
124 Modified();
125 }
127
130 void SetWithSegmentation(const bool segm) {
131 params_.segm = segm;
132 Modified();
133 }
134 bool GetWithSegmentation() const {
135 return params_.segm;
136 }
138
142 void SetWithNormalize(const bool norm) {
143 params_.normalize = norm;
144 Modified();
145 }
146 bool GetWithNormalize() const {
147 return params_.normalize;
148 }
150
154 void SetWithAdvStats(const bool adv) {
155 params_.advStats = adv;
156 Modified();
157 }
158 bool GetWithAdvStats() const {
159 return params_.advStats;
160 }
162
166 params_.samplingLvl = lvl;
167 Modified();
168 }
170 return params_.samplingLvl;
171 }
173
174protected:
175 ttkMergeTree();
176
177 int getOffsets();
178 int getScalars();
179
180 int preconditionTriangulation();
181
182 // vtkDataSetAlgorithm methods
183 int FillInputPortInformation(int port, vtkInformation *info) override;
184 int FillOutputPortInformation(int port, vtkInformation *info) override;
185 int RequestData(vtkInformation *request,
186 vtkInformationVector **inputVector,
187 vtkInformationVector *outputVector) override;
188
189private:
190 int Backend{(int)BACKEND::FTM};
191};
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 filter for the computation of merge trees.
static ttkMergeTree * New()
void SetTreeType(const int type)
the type of tree to compute (Join, Split, Contour, JoinSplit)
int GetSuperArcSamplingLevel() const
void SetWithNormalize(const bool norm)
if true, a post process pass will ensure NodesId have a deterministic order
bool GetWithAdvStats() const
void SetWithSegmentation(const bool segm)
control if the output should contains the segmentation information
bool GetWithNormalize() const
bool GetWithSegmentation() const
void SetSuperArcSamplingLevel(int lvl)
control the sampling level of the superarc. By default: 0
void SetWithAdvStats(const bool adv)
Compute additional information on the segmentation like the span and size (in nb of vertex) of each r...