TTK
Loading...
Searching...
No Matches
ttkHarmonicField.h
Go to the documentation of this file.
1
38
39#pragma once
40
41// VTK Module
42#include <ttkHarmonicFieldModule.h>
43
44// VTK Includes
45#include <ttkAlgorithm.h>
46class vtkPointSet;
47
48// ttk code includes
49#include <HarmonicField.h>
50
51class TTKHARMONICFIELD_EXPORT ttkHarmonicField : public ttkAlgorithm,
52 protected ttk::HarmonicField {
53
54public:
56
58
59 vtkSetMacro(OutputScalarFieldName, const std::string &);
60 vtkGetMacro(OutputScalarFieldName, std::string);
61
62 vtkSetMacro(ForceConstraintIdentifiers, bool);
63 vtkGetMacro(ForceConstraintIdentifiers, bool);
64
65 vtkSetMacro(UseCotanWeights, bool);
66 vtkGetMacro(UseCotanWeights, bool);
67
68 void SetSolvingMethod(const int arg_) {
69 if(arg_ == 0) {
70 this->SolvingMethod = SolvingMethodUserType::AUTO;
71 } else if(arg_ == 1) {
72 this->SolvingMethod = SolvingMethodUserType::CHOLESKY;
73 } else if(arg_ == 2) {
74 this->SolvingMethod = SolvingMethodUserType::ITERATIVE;
75 }
76 this->Modified();
77 }
78 virtual int GetSolvingMethod() {
79 switch(SolvingMethod) {
81 return 0;
83 return 1;
85 return 2;
86 }
87 return -1;
88 }
89
90 vtkSetMacro(LogAlpha, double);
91 vtkGetMacro(LogAlpha, double);
92
93protected:
95 ~ttkHarmonicField() override = default;
96
97 int FillInputPortInformation(int port, vtkInformation *info) override;
98 int FillOutputPortInformation(int port, vtkInformation *info) override;
99 int RequestData(vtkInformation *request,
100 vtkInformationVector **inputVector,
101 vtkInformationVector *outputVector) override;
102
103private:
104 // output scalar field
105 std::string OutputScalarFieldName{"OutputHarmonicField"};
106 // let the user choose a different identifier scalar field
107 bool ForceConstraintIdentifiers{false};
108 // graph laplacian variant
109 bool UseCotanWeights{true};
110 // user-selected solving method
111 SolvingMethodUserType SolvingMethod{SolvingMethodUserType::AUTO};
112 // penalty value
113 double LogAlpha{5.0};
114
115 // enum: float or double
116 enum class FieldType { FLOAT, DOUBLE };
117 FieldType OutputScalarFieldType{FieldType::FLOAT};
118};
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 harmonic field computations.
void SetSolvingMethod(const int arg_)
~ttkHarmonicField() override=default
static ttkHarmonicField * New()
virtual int GetSolvingMethod()
TTK processing package for the topological simplification of scalar data.