TTK
Loading...
Searching...
No Matches
FTRGraphPrint_Template.h
Go to the documentation of this file.
1#pragma once
2
3#include "FTRGraph.h"
4
5namespace ttk {
6 namespace ftr {
7
8 template <typename ScalarType, typename triangulationType>
10 std::stringstream res;
11
12 res << "cells : " << mesh_.getNumberOfCells() << std::endl;
13 res << "triangles : " << mesh_.getNumberOfTriangles() << std::endl;
14 res << "edges : " << mesh_.getNumberOfEdges() << std::endl;
15 res << "vertices : " << mesh_.getNumberOfVertices() << std::endl;
16
17 return res.str();
18 }
19
20 template <typename ScalarType, typename triangulationType>
22 const idEdge edgeId, const Propagation *const localPropagation) const {
23 const orderedEdge oEdge
24 = mesh_.getOrderedEdge(edgeId, localPropagation->goUp());
25 std::stringstream res;
26 res << "e" << edgeId << ":";
27 res << "(";
28 res << std::get<0>(oEdge) << " - " << std::get<1>(oEdge);
29 res << ")";
30 return res.str();
31 }
32
33 template <typename ScalarType, typename triangulationType>
35 const idCell cellId, const Propagation *const localPropagation) const {
36 std::stringstream res;
37 const orderedTriangle oTriangle
38 = mesh_.getOrderedTriangle(cellId, localPropagation->goUp());
39 orderedEdge e0, e1, e2;
40
41 e0 = mesh_.getOrderedEdge(
42 std::get<0>(oTriangle), localPropagation->goUp());
43 e1 = mesh_.getOrderedEdge(
44 std::get<1>(oTriangle), localPropagation->goUp());
45 e2 = mesh_.getOrderedEdge(
46 std::get<2>(oTriangle), localPropagation->goUp());
47
48 res << "t" << cellId << ":";
49 res << "{";
50 res << " " << printEdge(std::get<0>(oTriangle), localPropagation);
51 res << " " << printEdge(std::get<1>(oTriangle), localPropagation);
52 res << " " << printEdge(std::get<2>(oTriangle), localPropagation);
53 res << " }";
54 return res.str();
55 }
56
57 template <typename ScalarType, typename triangulationType>
59 const int verbosity) const {
60 std::cout << graph_.print(verbosity) << std::endl;
61 }
62
63 template <typename ScalarType, typename triangulationType>
65 Timer &timer, const std::string &msg) const {
66 this->printMsg(msg, 1.0, timer.getElapsedTime(), this->threadNumber_);
67 }
68
69 } // namespace ftr
70} // namespace ttk
double getElapsedTime()
Definition: Timer.h:15
std::string printTriangle(const idCell cellId, const Propagation *const localProp) const
void printTime(Timer &timer, const std::string &msg) const
void printGraph(const int verbosity) const
std::string printMesh() const
std::string printEdge(const idEdge edgeId, const Propagation *const localProp) const
TTK fTRGraph propagation management with Fibonacci heaps.
std::tuple< idVertex, idVertex > orderedEdge
Edge represented by its 2 vertices, lower then upper.
Definition: FTRDataTypes.h:42
std::tuple< idEdge, idEdge, idEdge > orderedTriangle
Triangle represented by its 3 edges Edges are sorted by their starting vertex (see orderedEdge)
Definition: FTRDataTypes.h:46
SimplexId idCell
Cell index in vect_cellList_.
Definition: FTRDataTypes.h:33
SimplexId idEdge
Edge index in vect_edgeList_.
Definition: FTRDataTypes.h:31
The Topology ToolKit.
printMsg(debug::output::GREEN+"                           "+debug::output::ENDCOLOR+debug::output::GREEN+"▒"+debug::output::ENDCOLOR+debug::output::GREEN+"▒▒▒▒▒▒▒▒▒▒▒▒▒░"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)