TTK
Loading...
Searching...
No Matches
ttkTriangulationFactory.h
Go to the documentation of this file.
1#pragma once
2
3#include <ttkAlgorithmModule.h>
4
5#include <Debug.h>
6#include <vtkType.h>
7
8#include <memory>
9#include <unordered_map>
10
11class vtkDataSet;
12class vtkImageData;
13class vtkPointSet;
14class vtkPoints;
15class vtkCellArray;
16namespace ttk {
17 class Triangulation;
18}
19
20using RegistryTriangulation = std::unique_ptr<ttk::Triangulation>;
21
24 vtkDataSet *owner;
25
26 vtkMTimeType cellModTime{0};
27
28 int extent[6];
29 double origin[3];
30 double spacing[3];
31 int dimensions[3];
32
33 RegistryValue(vtkDataSet *dataSet, ttk::Triangulation *triangulation_);
34 bool isValid(vtkDataSet *dataSet) const;
35};
36
37using RegistryKey = long long;
38using Registry = std::unordered_map<RegistryKey, RegistryValue>;
39
40class TTKALGORITHM_EXPORT ttkTriangulationFactory : public ttk::Debug {
41public:
42 static ttk::Triangulation *
43 GetTriangulation(int debugLevel, float cacheRatio, vtkDataSet *object);
44
45 static ttkTriangulationFactory Instance;
46 static RegistryKey GetKey(vtkDataSet *dataSet);
47
48#ifdef _WIN32
49 // to fix a weird MSVC warning about unique_ptr inside
50 // unordered_map, this dummy class member should be declared before
51 // the Registry
53#endif // _WIN32
55
56private:
57 RegistryTriangulation CreateImplicitTriangulation(vtkImageData *image);
58 RegistryTriangulation CreateExplicitTriangulation(vtkPointSet *pointSet);
59 RegistryTriangulation CreateTriangulation(vtkDataSet *dataSet);
60 int FindImplicitTriangulation(ttk::Triangulation *&triangulation,
61 vtkImageData *image);
62
64};
Minimalist debugging class.
Definition Debug.h:88
Triangulation is a class that provides time and memory efficient traversal methods on triangulations ...
The Topology ToolKit.
bool isValid(vtkDataSet *dataSet) const
RegistryTriangulation triangulation
std::unordered_map< RegistryKey, RegistryValue > Registry
long long RegistryKey
std::unique_ptr< ttk::Triangulation > RegistryTriangulation