graph_analysis
GraphvizWriter.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_IO_GRAPHVIZWRITER_HPP
2 #define GRAPH_ANALYSIS_IO_GRAPHVIZWRITER_HPP
3 
4 #include "../GraphIO.hpp"
5 #include "GraphvizStyle.hpp"
6 
7 namespace graph_analysis {
8 namespace io {
9 
70 class GraphvizWriter : public Writer
71 {
73  std::string mLayout;
75  std::string mRenderer;
76  GraphvizStyle::Ptr mpStyle;
77 
78 public:
80  GraphvizWriter(const std::string& layout = "dot", const std::string& renderer = "dot");
83 
87  void setStyle(const GraphvizStyle::Ptr& style) { mpStyle = style; }
88 
94  void write(const std::string& filename, const BaseGraph& graph) const;
95 
101  void write(const std::string& filename, const BaseGraph::Ptr& graph) const;
102 };
103 
104 } // end namespace io
105 } // end namespace graph_analysis
106 #endif // GRAPH_ANALYSIS_IO_GRAPHVIZWRITER_HPP
~GraphvizWriter()
destructor
Definition: GraphvizWriter.cpp:14
graphviz based graph renderer
Definition: GraphvizWriter.hpp:70
General Graph template that should be implemented to wrap specific graph library functionality We ass...
Definition: BaseGraph.hpp:27
void write(const std::string &filename, const BaseGraph &graph) const
outputs the given graph to the given file
Definition: GraphvizWriter.cpp:17
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
void setStyle(const GraphvizStyle::Ptr &style)
Definition: GraphvizWriter.hpp:87
Interface for Writer implementations that perform custom graph serialization.
Definition: GraphIO.hpp:30
GraphvizWriter(const std::string &layout="dot", const std::string &renderer="dot")
constructor
Definition: GraphvizWriter.cpp:8
shared_ptr< GraphvizStyle > Ptr
Definition: GraphvizStyle.hpp:19
shared_ptr< BaseGraph > Ptr
Definition: BaseGraph.hpp:34