TTK
Loading...
Searching...
No Matches
FTMTreePPUtils.h
Go to the documentation of this file.
1
7
8#pragma once
9
10#include <FTMTree.h>
11#include <FTMTreePP.h>
12
13namespace ttk {
14 namespace ftm {
15
16 template <class dataType>
18 FTMTree_MT *tree,
19 std::vector<std::tuple<SimplexId, SimplexId, dataType>> &pairs) {
20 FTMTreePP pairsCompute;
21 pairsCompute.setCustomTree(tree);
22 pairsCompute.computePersistencePairs<dataType>(
23 pairs, tree->isJoinTree<dataType>());
24 }
25
26 template <class dataType>
27 std::vector<std::tuple<SimplexId, SimplexId, dataType>>
29 std::vector<std::tuple<SimplexId, SimplexId, dataType>> pairs;
30 getPersistencePairs<dataType>(tree, pairs);
31 for(auto pair : pairs) {
32 tree->getNode(std::get<0>(pair))->setOrigin(std::get<1>(pair));
33 tree->getNode(std::get<1>(pair))->setOrigin(std::get<0>(pair));
34 }
35 return pairs;
36 }
37
38 } // namespace ftm
39} // namespace ttk
void computePersistencePairs(std::vector< std::tuple< SimplexId, SimplexId, scalarType > > &pairs, const bool jt)
Definition FTMTreePP.h:128
void setCustomTree(ftm::FTMTree_MT *cTree)
Definition FTMTreePP.h:44
Node * getNode(idNode nodeId)
Definition FTMTree_MT.h:393
void getPersistencePairs(FTMTree_MT *tree, std::vector< std::tuple< SimplexId, SimplexId, dataType > > &pairs)
std::vector< std::tuple< SimplexId, SimplexId, dataType > > computePersistencePairs(FTMTree_MT *tree)
The Topology ToolKit.