TTK
Loading...
Searching...
No Matches
ttkSeparatrixStability.h
Go to the documentation of this file.
1
27
28#pragma once
29
30#include <vtkMultiBlockDataSet.h>
31#include <vtkUnstructuredGrid.h>
32
33#include <ttkSeparatrixStabilityModule.h>
34
35#include <SeparatrixStability.h>
36#include <ttkAlgorithm.h>
37
38class TTKSEPARATRIXSTABILITY_EXPORT ttkSeparatrixStability
39 : public ttkAlgorithm,
40 protected ttk::SeparatrixStability {
41
42private:
43 double PX{1};
44 double PY{1};
45 double PZ{1};
46 double PF{1};
47 bool MergeEdgesOnSaddles{true};
48 double CostDeathBirth{};
49
50public:
51 vtkSetMacro(PX, double);
52 vtkGetMacro(PX, double);
53
54 vtkSetMacro(PY, double);
55 vtkGetMacro(PY, double);
56
57 vtkSetMacro(PZ, double);
58 vtkGetMacro(PZ, double);
59
60 vtkSetMacro(PF, double);
61 vtkGetMacro(PF, double);
62
63 vtkSetMacro(MergeEdgesOnSaddles, bool);
64 vtkGetMacro(MergeEdgesOnSaddles, bool);
65
66 vtkSetMacro(CostDeathBirth, double);
67 vtkGetMacro(CostDeathBirth, double);
68
71
72protected:
74 ~ttkSeparatrixStability() override = default;
75
76 int FillInputPortInformation(int port, vtkInformation *info) override;
77 int FillOutputPortInformation(int port, vtkInformation *info) override;
78
79 int RequestData(vtkInformation *request,
80 vtkInformationVector **inputVector,
81 vtkInformationVector *outputVector) override;
82
83 int execute(vtkMultiBlockDataSet *&multiBlock1_Separatrices,
84 vtkMultiBlockDataSet *&output1_Separatrices);
85
86 bool updateVisitedVertices(const int &globalId,
87 std::vector<int> &localToGlobal,
88 int &localId);
89
90 void computePointIds(const int &cellId_1,
91 const int &cellId_2,
92 const int &sourceGlobalId,
93 const int &destinationGlobalId,
94 vtkDataSet *block,
95 vtkIdType &srcPointId,
96 vtkIdType &destPointId);
97
98 void updateAdjacencyMatrix(const int &sourceLocalId,
99 const int &destinationLocalId,
100 const int &separatrixLocalId,
101 GraphMatrixFull &adjacencyMatrix);
102
103 void appendPoint(vtkPoints *points,
104 const int &index,
105 const double &scalar,
106 std::vector<std::array<double, 3>> &coords,
107 std::vector<double> &scalars);
108
109 int prepareData(vtkDataSet *block,
110 std::vector<int> &localToGlobal,
111 GraphMatrixFull &adjacencyMatrixFull,
112 std::vector<std::array<double, 3>> &coordsSource,
113 std::vector<std::array<double, 3>> &coordsDestination,
114 std::vector<double> &scalarsSource,
115 std::vector<double> &scalarsDestinatoin,
116 int &n_separatrices,
117 std::vector<int> &globalSourcePointId,
118 std::vector<int> &globalDestinationPointId);
119};
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
static ttkSeparatrixStability * New()
int prepareData(vtkDataSet *block, std::vector< int > &localToGlobal, GraphMatrixFull &adjacencyMatrixFull, std::vector< std::array< double, 3 > > &coordsSource, std::vector< std::array< double, 3 > > &coordsDestination, std::vector< double > &scalarsSource, std::vector< double > &scalarsDestinatoin, int &n_separatrices, std::vector< int > &globalSourcePointId, std::vector< int > &globalDestinationPointId)
void computePointIds(const int &cellId_1, const int &cellId_2, const int &sourceGlobalId, const int &destinationGlobalId, vtkDataSet *block, vtkIdType &srcPointId, vtkIdType &destPointId)
void appendPoint(vtkPoints *points, const int &index, const double &scalar, std::vector< std::array< double, 3 > > &coords, std::vector< double > &scalars)
~ttkSeparatrixStability() override=default
int execute(vtkMultiBlockDataSet *&multiBlock1_Separatrices, vtkMultiBlockDataSet *&output1_Separatrices)
void updateAdjacencyMatrix(const int &sourceLocalId, const int &destinationLocalId, const int &separatrixLocalId, GraphMatrixFull &adjacencyMatrix)
bool updateVisitedVertices(const int &globalId, std::vector< int > &localToGlobal, int &localId)
Compute the occurrence rate of separatrices in an ensemble.
std::vector< std::vector< int > > GraphMatrixFull