TTK
Loading...
Searching...
No Matches
ttkPersistenceDiagram.h
Go to the documentation of this file.
1
161
162#pragma once
163
164// VTK includes
165#include <vtkDataArray.h>
166#include <vtkUnstructuredGrid.h>
167
168// VTK Module
169#include <ttkPersistenceDiagramModule.h>
170
171// ttk code includes
172#include <PersistenceDiagram.h>
173#include <ttkAlgorithm.h>
174#include <ttkMacros.h>
175
176class TTKPERSISTENCEDIAGRAM_EXPORT ttkPersistenceDiagram
177 : public ttkAlgorithm,
178 protected ttk::PersistenceDiagram {
179
180public:
182
184
185 vtkSetMacro(ForceInputOffsetScalarField, bool);
186 vtkGetMacro(ForceInputOffsetScalarField, bool);
187
188 vtkSetMacro(ShowInsideDomain, bool);
189 vtkGetMacro(ShowInsideDomain, bool);
190
192 vtkGetEnumMacro(BackEnd, BACKEND);
193
194 vtkGetMacro(StartingResolutionLevel, int);
195 vtkSetMacro(StartingResolutionLevel, int);
196
197 vtkGetMacro(StoppingResolutionLevel, int);
198 vtkSetMacro(StoppingResolutionLevel, int);
199
200 vtkGetMacro(IsResumable, bool);
201 vtkSetMacro(IsResumable, bool);
202
203 vtkGetMacro(TimeLimit, double);
204 vtkSetMacro(TimeLimit, double);
205
206 vtkGetMacro(Epsilon, double);
207 vtkSetMacro(Epsilon, double);
208
209 vtkSetMacro(IgnoreBoundary, bool);
210 vtkGetMacro(IgnoreBoundary, bool);
211
212 inline void SetComputeMinSad(const bool data) {
213 this->setComputeMinSad(data);
214 this->dmsDimsCache[0] = data;
215 this->Modified();
216 }
217 inline void SetComputeSadSad(const bool data) {
218 this->setComputeSadSad(data);
219 this->dmsDimsCache[1] = data;
220 this->Modified();
221 }
222 inline void SetComputeSadMax(const bool data) {
223 this->setComputeSadMax(data);
224 this->dmsDimsCache[2] = data;
225 this->Modified();
226 }
227 inline void SetDMSDimensions(const int data) {
228 this->setComputeMinSad(data == 0 ? true : this->dmsDimsCache[0]);
229 this->setComputeSadSad(data == 0 ? true : this->dmsDimsCache[1]);
230 this->setComputeSadMax(data == 0 ? true : this->dmsDimsCache[2]);
231 this->Modified();
232 }
233
234 vtkSetMacro(ClearDGCache, bool);
235 vtkGetMacro(ClearDGCache, bool);
236
237protected:
239
240 int RequestData(vtkInformation *request,
241 vtkInformationVector **inputVector,
242 vtkInformationVector *outputVector) override;
243
244 int FillInputPortInformation(int port, vtkInformation *info) override;
245 int FillOutputPortInformation(int port, vtkInformation *info) override;
246
247private:
248 template <typename scalarType, typename triangulationType>
249 int dispatch(vtkUnstructuredGrid *outputCTPersistenceDiagram,
250 vtkDataArray *const inputScalarsArray,
251 const scalarType *const inputScalars,
252 scalarType *outputScalars,
253 SimplexId *outputOffsets,
254 int *outputMonotonyOffsets,
255 const SimplexId *const inputOrder,
256 const triangulationType *triangulation);
257
258 bool ForceInputOffsetScalarField{false};
259 bool ShowInsideDomain{false};
260 // stores the values of Compute[Min|Sad][Sad|Max] GUI checkboxes
261 // when "All Dimensions" is selected
262 std::array<bool, 3> dmsDimsCache{true, true, true};
263 // clear DiscreteGradient cache after computation
264 bool ClearDGCache{false};
265};
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 for the computation of persistence diagrams.
void SetComputeSadSad(const bool data)
void SetComputeMinSad(const bool data)
void SetDMSDimensions(const int data)
static ttkPersistenceDiagram * New()
void SetComputeSadMax(const bool data)
TTK processing package for the computation of persistence diagrams.
void setComputeSadSad(const bool data)
void setComputeMinSad(const bool data)
void setComputeSadMax(const bool data)
#define ttkSetEnumMacro(name, enumType)
Definition ttkMacros.h:38