-
Notifications
You must be signed in to change notification settings - Fork 0
/
VisualizeGraph.hpp
39 lines (32 loc) · 1.36 KB
/
VisualizeGraph.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _VISUALIZEGRAPH_HPP_
#define _VISUALIZEGRAPH_HPP_
#include <memory>
#include <fstream>
#include "MetagraphInterface.h"
class VisualizeGraph {
public:
VisualizeGraph(std::shared_ptr<MetagraphInterface const> graph_,
std::vector<MetagraphInterface::NodeID> nodeIDs,
unsigned length,
size_t binsize_,
bool drawIllegalEdges_) : graph{graph_}, binsize{binsize_}, drawIllegalEdges{drawIllegalEdges_}{
createGVFile(nodeIDs,length);
}
private:
void createGVFile(std::vector<MetagraphInterface::NodeID> nodeIDs, unsigned length);
void drawRecursive(std::ofstream & outf,
MetagraphInterface::NodeID nodeID,
unsigned length,
std::unordered_set<std::string>& edges,
bool drawIllegalEdges) const;
void drawRecursiveInDirection(std::ofstream & outf,
MetagraphInterface::NodeID nodeID,
unsigned length,
std::unordered_set<std::string>& edges,
bool upStream,
bool drawIllegalEdges) const;
std::shared_ptr<MetagraphInterface const> graph;
size_t binsize;
bool drawIllegalEdges;
};
#endif //_VISUALIZEGRAPH_HPP_