TTK
Loading...
Searching...
No Matches
MultiresTopology.h
Go to the documentation of this file.
1
14//
34
35#pragma once
36
37// base code includes
38#include <DynamicTree.h>
41
42#include <limits>
43#include <tuple>
44
45namespace ttk {
46
47 using triplet = std::tuple<ttk::SimplexId, ttk::SimplexId, ttk::SimplexId>;
48 using polarity = unsigned char;
49
50 class MultiresTopology : public Debug {
51
52 public:
60
61 PersistencePair() = default;
63 const SimplexId d,
64 const SimplexId pType)
65 : birth{b}, death{d}, pairType{pType} {
66 }
67 };
68
70 this->setDebugMsgPrefix("MultiresTopology");
71 }
72
73 inline void setupTriangulation(ImplicitTriangulation *const data) {
74 triangulation_ = data;
76 }
77
78 virtual void setStartingDecimationLevel(int data) {
79 startingDecimationLevel_ = std::max(data, 0);
80 }
81 virtual void setStoppingDecimationLevel(int data) {
82 stoppingDecimationLevel_ = std::max(data, 0);
83 }
84 virtual void setPreallocateMemory(const bool b) {
85 this->preallocateMemory_ = b;
86 }
88 return this->stoppingDecimationLevel_;
89 }
90
93 }
94
97 }
98
99 protected:
100 // maximum link size in 3D
101 static const size_t nLink_ = 27;
102
104 = std::array<std::vector<std::pair<SimplexId, SimplexId>>, nLink_>;
105
106 void buildVertexLinkByBoundary(const SimplexId vertexId,
107 VLBoundaryType &vlbt) const;
108
110 const std::vector<std::pair<polarity, polarity>> &vlp,
111 DynamicTree &link) const;
112
114 const SimplexId vertexId,
115 const std::vector<std::pair<polarity, polarity>> &vlp,
116 DynamicTree &link,
117 std::vector<polarity> &toPropagateMin,
118 std::vector<polarity> &toPropagateMax,
119 std::vector<std::vector<SimplexId>> &saddleCCMin,
120 std::vector<std::vector<SimplexId>> &saddleCCMax) const;
121
123 const SimplexId vertexId,
124 std::vector<triplet> &triplets,
125 const std::vector<std::vector<SimplexId>> &vertexReps) const;
126
128 std::vector<std::pair<polarity, polarity>> &vlp) const;
129
130 std::string resolutionInfoString();
131
133
135
136 // store the two global extrema extracted from the whole dataset vertices
137 // sorting operation
139
144 std::vector<PersistencePair> CTDiagram_{};
145 };
146} // namespace ttk
Minimalist debugging class.
Definition: Debug.h:88
void setDebugMsgPrefix(const std::string &prefix)
Definition: Debug.h:364
Implements the Dynamic Tree data-structure (or ST-Tree)
Definition: DynamicTree.h:66
ImplicitTriangulation is a class that provides time and memory efficient traversal methods on triangu...
TTK processing package for progressive Topological Data Analysis.
void setStoppingResolutionLevel(int rl)
void setupTriangulation(ImplicitTriangulation *const data)
void setStartingResolutionLevel(int rl)
std::string resolutionInfoString()
MultiresTriangulation multiresTriangulation_
std::vector< PersistencePair > CTDiagram_
void buildVertexLinkByBoundary(const SimplexId vertexId, VLBoundaryType &vlbt) const
ImplicitTriangulation * triangulation_
char getCriticalTypeFromLink(const std::vector< std::pair< polarity, polarity > > &vlp, DynamicTree &link) const
virtual void setPreallocateMemory(const bool b)
virtual void setStartingDecimationLevel(int data)
static const size_t nLink_
virtual void setStoppingDecimationLevel(int data)
void getValencesFromLink(const SimplexId vertexId, const std::vector< std::pair< polarity, polarity > > &vlp, DynamicTree &link, std::vector< polarity > &toPropagateMin, std::vector< polarity > &toPropagateMax, std::vector< std::vector< SimplexId > > &saddleCCMin, std::vector< std::vector< SimplexId > > &saddleCCMax) const
std::array< std::vector< std::pair< SimplexId, SimplexId > >, nLink_ > VLBoundaryType
void getTripletsFromSaddles(const SimplexId vertexId, std::vector< triplet > &triplets, const std::vector< std::vector< SimplexId > > &vertexReps) const
void updateLinkPolarityPonctual(std::vector< std::pair< polarity, polarity > > &vlp) const
void setTriangulation(ImplicitTriangulation *triangulation)
The Topology ToolKit.
std::tuple< ttk::SimplexId, ttk::SimplexId, ttk::SimplexId > triplet
Persistence pair type (with persistence in double)
unsigned char polarity
int SimplexId
Identifier type for simplices of any dimension.
Definition: DataTypes.h:22
PersistencePair(const SimplexId b, const SimplexId d, const SimplexId pType)