|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
45 class GraphAttributes;
91 bool draw(std::ostream& os);
103 void wrapHeaderFooter(std::ostream& os, std::string tikzPic,
bool uniformStyle,
104 bool uniformWidth,
bool uniformHeight)
const;
121 void drawAllNodes(std::ostream& os,
bool uniformStyle,
bool uniformWidth,
bool uniformHeight);
147 void drawNode(std::ostream& os,
node v,
bool uniformStyle,
bool uniformWidth,
bool uniformHeight);
Colors represented as RGBA values.
The namespace for all OGDF objects.
Stores additional attributes of a graph (like layout information).
Includes declaration of graph class.
Declaration of basic types for graphics.
StrokeType
Line types of strokes.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
void drawAllEdges(std::ostream &os)
Draws a sequence of lines for each edge in the graph.
void wrapHeaderFooter(std::ostream &os, std::string tikzPic, bool uniformStyle, bool uniformWidth, bool uniformHeight) const
Wrap LaTeX/TikZ header/footer around a tikzpicture and write to output stream.
LengthUnit m_unit
The LaTeX unit to use for all ocurring lengths.
double getTextWidth(node v) const
Get the total width the node text may occupy.
@ MU
math unit equal to 1/18 em, where em is taken from the math symbols family
std::vector< std::string > m_nodeStyles
to avoid as much redundancy as possible, any occurring node style will be predefined and reused
const ClusterGraphAttributes * m_clsAttr
attributes of the cluster graph (nullptr if no cluster graph given)
std::vector< std::string > m_edgeStyles
to avoid as much redundancy as possible, any occurring edge style will be predefined and reused
@ EM
roughly the width of an 'M' (uppercase) in the current font (it depends on the font used)
std::string getEdgeLabel(edge e, const DPoint &previousPoint, const DPoint &labelPoint) const
Get the label of an edge in TikZ syntax, positioned as a node on the edge path.
std::string getEdgeArrows(edge e) const
Get the arrows of an edge in TikZ syntax.
bool draw(std::ostream &os)
Output the member graph to an output stream in LaTeX+TikZ format.
void drawAllNodes(std::ostream &os, bool uniformStyle, bool uniformWidth, bool uniformHeight)
Draws each node of the graph.
std::string getNodeStyle(node v) const
Get the style of a node in TikZ syntax.
std::string texLength(double f) const
Mainly avoid scientific notation (not handled by LaTeX) and add length unit mm.
Representation of clusters in a clustered graph.
Stores additional attributes of a clustered graph (like layout information).
LengthUnit
Units of length available in LaTeX.
static std::string getColorString(Color c)
Convert an ogdf::Color to a string in TikZ syntax.
double calcArrowSize() const
Calculates the arrow size to be used for TikZ arrows.
void drawNode(std::ostream &os, node v, bool uniformStyle, bool uniformWidth, bool uniformHeight)
Draws a node using its shape, size and style properties.
TikzWriter(const GraphAttributes &attr, LengthUnit unit=LengthUnit::MM)
Construct a new writer for drawing graphs using graph attributes.
const GraphAttributes & m_attr
attributes of the graph to be visualized
TikzWriter(const ClusterGraphAttributes &attr, LengthUnit unit=LengthUnit::MM)
Construct a new writer for drawing cluster graphs using graph attributes.
std::string getNodeShape(node v) const
Get the shape of a node in TikZ syntax.
std::string getEdgeStyle(edge e) const
Get the style of an edge in TikZ syntax.
void drawAllClusters(std::ostream &os)
Draws a rectangle for each cluster in the ogdf::ClusterGraph.
void drawCluster(std::ostream &os, cluster c)
Draws a cluster as a rectangle, using its size and style properties.
@ EX
roughly the height of an 'x' (lowercase) in the current font (it depends on the font used)
std::string getLineStyle(StrokeType strokeType, double strokeWidth, Color strokeColor) const
Convert an ogdf::StrokeType, strokeWidth and ogdf::Color to a a line style string in TikZ syntax.
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
Class for the representation of edges.
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
std::string getClusterStyle(cluster c) const
Get the style of a cluster in TikZ syntax.
Class for the representation of nodes.
void drawEdge(std::ostream &os, edge e)
Draws a sequence of lines for each edge in the graph.
std::string getNodeLabel(node v) const
Get the label of a node in TikZ syntax.