TTK
Loading...
Searching...
No Matches
ttkMergeTree.h
Go to the documentation of this file.
1
73
74#pragma once
75
76// VTK includes
77#include <vtkSmartPointer.h>
78
79// VTK module
80#include <ttkMergeTreeModule.h>
81
82// ttk code includes
83#include <PathCompression.h>
84#include <ttkAlgorithm.h>
85#include <ttkMergeTreeBase.h>
87
88class vtkDataSet;
89
90class TTKMERGETREE_EXPORT ttkMergeTree : public ttkAlgorithm,
91 public ttkMergeTreeBase {
92
93public:
94 enum class BACKEND {
95 FTM = 0,
96 EXTREEM = 1,
97 };
98
99 static ttkMergeTree *New();
100
102
105 vtkGetMacro(ForceInputOffsetScalarField, bool);
106 vtkSetMacro(ForceInputOffsetScalarField, bool);
108
111 vtkGetMacro(Backend, int);
112 vtkSetMacro(Backend, int);
114
115 // Parameters uses a structure, we can't use vtkMacro on them
116
119 void SetTreeType(const int type) {
120 params_.treeType = (ttk::ftm::TreeType)type;
121 Modified();
122 }
124
127 void SetWithSegmentation(const bool segm) {
128 params_.segm = segm;
129 Modified();
130 }
131 bool GetWithSegmentation() const {
132 return params_.segm;
133 }
135
139 void SetWithNormalize(const bool norm) {
140 params_.normalize = norm;
141 Modified();
142 }
143 bool GetWithNormalize() const {
144 return params_.normalize;
145 }
147
151 void SetWithAdvStats(const bool adv) {
152 params_.advStats = adv;
153 Modified();
154 }
155 bool GetWithAdvStats() const {
156 return params_.advStats;
157 }
159
163 params_.samplingLvl = lvl;
164 Modified();
165 }
167 return params_.samplingLvl;
168 }
170
171protected:
172 ttkMergeTree();
173
174 int getOffsets();
175 int getScalars();
176
177 int preconditionTriangulation();
178
179 // vtkDataSetAlgorithm methods
180 int FillInputPortInformation(int port, vtkInformation *info) override;
181 int FillOutputPortInformation(int port, vtkInformation *info) override;
182 int RequestData(vtkInformation *request,
183 vtkInformationVector **inputVector,
184 vtkInformationVector *outputVector) override;
185
186private:
187 int Backend{(int)BACKEND::FTM};
188};
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...