TTK
Loading...
Searching...
No Matches
ttkRipsPersistenceGenerators.h
Go to the documentation of this file.
1
23
24#pragma once
25
26// VTK Module
27#include <ttkRipsPersistenceGeneratorsModule.h>
28
29// VTK Includes
30#include <vtkUnstructuredGrid.h>
31
32// TTK Base Includes
34#include <ttkAlgorithm.h>
35
45TTKRIPSPERSISTENCEGENERATORS_EXPORT void
46 GeneratorsToVTU(vtkUnstructuredGrid *vtu,
47 vtkPoints *inputPoints,
48 const std::vector<ttk::rpd::Generator1> &generators1,
49 bool parametrize = true);
50
51class TTKRIPSPERSISTENCEGENERATORS_EXPORT ttkRipsPersistenceGenerators
52 : public ttkAlgorithm // we inherit from the generic ttkAlgorithm class
53 ,
54 protected ttk::RipsPersistenceGenerators // and we inherit from the base
55 // class
56{
57private:
58 bool KeepAllDataArrays{true};
59 bool SelectFieldsWithRegexp{false};
60 std::string RegexpString{".*"};
61 std::vector<std::string> ScalarFields{};
62
63public:
66
67 void SetScalarFields(const std::string &s) {
68 ScalarFields.push_back(s);
69 Modified();
70 }
71
73 ScalarFields.clear();
74 Modified();
75 }
76
77 void SetSimplexMaximumDiameter(const std::string &data) {
78 SimplexMaximumDiameter = stod(data);
79 Modified();
80 }
82 return std::to_string(SimplexMaximumDiameter);
83 }
84
85 vtkSetMacro(KeepAllDataArrays, bool);
86 vtkGetMacro(KeepAllDataArrays, bool);
87
88 vtkSetMacro(SelectFieldsWithRegexp, bool);
89 vtkGetMacro(SelectFieldsWithRegexp, bool);
90
91 vtkSetMacro(RegexpString, const std::string &);
92 vtkGetMacro(RegexpString, std::string);
93
94 vtkSetMacro(InputIsDistanceMatrix, bool);
95 vtkGetMacro(InputIsDistanceMatrix, bool);
96
97 vtkSetMacro(OutputCascade, bool);
98 vtkGetMacro(OutputCascade, bool);
99
100protected:
102 ~ttkRipsPersistenceGenerators() override = default;
103
104 int FillInputPortInformation(int port, vtkInformation *info) override;
105
106 int FillOutputPortInformation(int port, vtkInformation *info) override;
107
108 int RequestData(vtkInformation *request,
109 vtkInformationVector **inputVector,
110 vtkInformationVector *outputVector) override;
111};
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
~ttkRipsPersistenceGenerators() override=default
void SetScalarFields(const std::string &s)
static ttkRipsPersistenceGenerators * New()
void SetSimplexMaximumDiameter(const std::string &data)
TTK base class that computes 1-dimensional persistence generators in a Rips filtration.
TTKRIPSPERSISTENCEGENERATORS_EXPORT void GeneratorsToVTU(vtkUnstructuredGrid *vtu, vtkPoints *inputPoints, const std::vector< ttk::rpd::Generator1 > &generators1, bool parametrize=true)
Converts a vector of 1-dimensional persistent generators in the ttk::rpd::Generator format to the VTK...