Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
SvgPrinter.h
Go to the documentation of this file.
1
32#pragma once
33
35
37
38#include <list>
39#include <sstream>
40
41namespace ogdf {
42
53public:
62
71
77 bool draw(std::ostream& os);
78
79private:
82
85
88
91
98
105
114
128
136 void drawLine(std::stringstream& ss, const DPoint& p1, const DPoint& p2);
137
144 void drawBezierPath(std::stringstream& ss, List<DPoint>& points);
145
152 void drawRoundPath(std::stringstream& ss, List<DPoint>& points);
153
160 void drawLines(std::stringstream& ss, List<DPoint>& points);
161
171 void drawBezier(std::stringstream& ss, const DPoint& p1, const DPoint& p2, const DPoint& c1,
172 const DPoint& c2);
173
180
188
197
205
213
220 bool isCoveredBy(const DPoint& point, adjEntry adj);
221
232
239
247
255 void appendLineStyle(pugi::xml_node line, edge e, bool isArrowHead = false);
256
265};
266
267}
Declares class GraphIO which provides access to all graph read and write functionality.
Class for adjacency list elements.
Definition Graph_d.h:79
Representation of clusters in a clustered graph.
Stores additional attributes of a clustered graph (like layout information).
Rectangles with real coordinates.
Definition geometry.h:790
Class for the representation of edges.
Definition Graph_d.h:300
Stores additional attributes of a graph (like layout information).
Condensed settings for drawing SVGs.
Definition GraphIO.h:116
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
Class for the representation of nodes.
Definition Graph_d.h:177
SVG Writer.
Definition SvgPrinter.h:52
SvgPrinter(const GraphAttributes &attr, const GraphIO::SVGSettings &settings)
Creates a new SVG Printer for a ogdf::Graph.
Definition SvgPrinter.h:60
void drawLines(std::stringstream &ss, List< DPoint > &points)
Draws a list of points as straight lines.
bool isArrowEnabled(adjEntry adj)
Returns whether an edge arrow is to be drawn.
pugi::xml_node writeHeader(pugi::xml_document &doc)
Writes the header including the bounding box as the viewport.
void appendLineStyle(pugi::xml_node line, edge e, bool isArrowHead=false)
Writes the requested line style to the line's XML-node.
void drawBezierPath(std::stringstream &ss, List< DPoint > &points)
Draws a list of points using cubic Bézier interpolation.
void drawBezier(std::stringstream &ss, const DPoint &p1, const DPoint &p2, const DPoint &c1, const DPoint &c2)
Draws a cubic Bezíer path.
const ClusterGraphAttributes * m_clsAttr
attributes of the cluster graph (nullptr if no cluster graph)
Definition SvgPrinter.h:84
void writeDashArray(pugi::xml_node xmlNode, StrokeType lineStyle, double lineWidth)
Generates a string that describes the requested dash type.
DRect m_bbox
cached bounding box of the graph to be visualized
Definition SvgPrinter.h:87
double getArrowSize(adjEntry adj)
Returns the size of the arrow.
const GraphIO::SVGSettings & m_settings
SVG configuration.
Definition SvgPrinter.h:90
bool draw(std::ostream &os)
Prints the graph and attributes of this printer to the given output stream.
void drawEdge(pugi::xml_node xmlNode, edge e)
Draws a sequence of lines for an edge.
void drawRoundPath(std::stringstream &ss, List< DPoint > &points)
Draws a list of points as straight lines connected by circular arcs.
void drawEdges(pugi::xml_node xmlNode)
Draws a sequence of lines for each edge in the graph.
void drawArrowHead(pugi::xml_node xmlNode, const DPoint &start, DPoint &end, adjEntry adj)
Draws an arrow head at the end of the edge.
void drawClusters(pugi::xml_node xmlNode)
Draws a rectangle for each cluster in the ogdf::ClusterGraph.
void drawCluster(pugi::xml_node xmlNode, cluster c)
Draws a single cluster as a rectangle.
void drawNodes(pugi::xml_node xmlNode)
Draws all nodes of the graph.
const GraphAttributes & m_attr
attributes of the graph to be visualized
Definition SvgPrinter.h:81
void drawNode(pugi::xml_node xmlNode, node v)
Draws a single node.
SvgPrinter(const ClusterGraphAttributes &attr, const GraphIO::SVGSettings &settings)
Creates a new SVG Printer for a ogdf::ClusterGraph.
Definition SvgPrinter.h:69
pugi::xml_node drawPolygon(pugi::xml_node xmlNode, const std::list< double > points)
Draws a polygon with the respective points.
void drawLine(std::stringstream &ss, const DPoint &p1, const DPoint &p2)
Draws the path corresponding to a single line to the stream.
bool isCoveredBy(const DPoint &point, adjEntry adj)
Determines whether a candidate arrow tip lies inside the rectangle of the node.
pugi::xml_node drawCurve(pugi::xml_node xmlNode, edge e, List< DPoint > &points)
Draws the curve depicting a particular edge.
StrokeType
Line types of strokes.
Definition graphics.h:46
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.