graph_analysis
GraphvizGridStyle.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_IO_GRAPHVIZ_GRID_STYLE_HPP
2 #define GRAPH_ANALYSIS_IO_GRAPHVIZ_GRID_STYLE_HPP
3 
4 #include "GraphvizStyle.hpp"
5 #include "../SharedPtr.hpp"
6 
7 namespace graph_analysis {
8 namespace io {
9 
10 typedef function1<size_t, const Vertex::Ptr& > VertexRowMapper;
11 typedef function1<size_t, const Vertex::Ptr& > VertexColumnMapper;
12 
78 {
79 public:
80  GraphvizGridStyle(size_t rows, size_t columns,
81  VertexRowMapper rowMapperFunction,
82  VertexColumnMapper columnMapperFunction
83  );
84 
85  virtual ~GraphvizGridStyle();
86 
87  typedef shared_ptr<GraphvizGridStyle> Ptr;
88 
89  void setColumnScalingFactor(double f) { mColumnScalingFactor = f; }
90  double getColumnScalingFactor() const { return mColumnScalingFactor; }
91 
92  void setRowScalingFactor(double f) { mRowScalingFactor = f; }
93  double getRowScalingFactor() const { return mRowScalingFactor; }
94 
95  virtual void apply(const Edge::Ptr& edge, GVGraph* gvGraph, const BaseGraph::Ptr& graph) const {}
96  virtual void apply(const Vertex::Ptr& vertex, GVGraph* gvGraph, const BaseGraph::Ptr& graph) const;
97 
98 private:
99  size_t mRows;
100  size_t mColumns;
101 
102  double mRowScalingFactor;
103  double mColumnScalingFactor;
104 
105  VertexRowMapper mRowMapperFunction;
106  VertexColumnMapper mColumnMapperFunction;
107 };
108 
109 } // end namespace io
110 } // end namespace graph_analysis
111 #endif // GRAPH_ANALYSIS_IO_GRAPHVIZ_GRID_STYLE_HPP
function1< size_t, const Vertex::Ptr &> VertexRowMapper
Definition: GraphvizGridStyle.hpp:10
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
virtual void apply(const Edge::Ptr &edge, GVGraph *gvGraph, const BaseGraph::Ptr &graph) const
Definition: GraphvizGridStyle.hpp:95
GraphvizGridStyle(size_t rows, size_t columns, VertexRowMapper rowMapperFunction, VertexColumnMapper columnMapperFunction)
Definition: GraphvizGridStyle.cpp:9
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
Allows the alignment of nodes into a grid, i.e. perform some kind of prealignment using the pos attri...
Definition: GraphvizGridStyle.hpp:77
void setRowScalingFactor(double f)
Definition: GraphvizGridStyle.hpp:92
shared_ptr< GraphvizGridStyle > Ptr
Definition: GraphvizGridStyle.hpp:87
double getRowScalingFactor() const
Definition: GraphvizGridStyle.hpp:93
shared_ptr< BaseGraph > Ptr
Definition: BaseGraph.hpp:34
double getColumnScalingFactor() const
Definition: GraphvizGridStyle.hpp:90
An object containing a libgraph graph and its associated nodes and edges.
Definition: GVGraph.hpp:119
void setColumnScalingFactor(double f)
Definition: GraphvizGridStyle.hpp:89
A styling interface class for the GraphvizWriter.
Definition: GraphvizStyle.hpp:16
function1< size_t, const Vertex::Ptr &> VertexColumnMapper
Definition: GraphvizGridStyle.hpp:11
virtual ~GraphvizGridStyle()
Definition: GraphvizGridStyle.cpp:22