Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
orthogonal.cpp
Go to the documentation of this file.
8
9using namespace ogdf;
10
11int main()
12{
13 Graph G;
17
18 if (!GraphIO::read(GA, G, "ERDiagram.gml", GraphIO::readGML)) {
19 std::cerr << "Could not read ERDiagram.gml" << std::endl;
20 return 1;
21 }
22
23 for (node v : G.nodes)
24 {
25 GA.width(v) /= 2;
26 GA.height(v) /= 2;
27 }
28
30
33 ps->runs(100);
35 ves->removeReinsert(RemoveReinsertType::All);
36
37 crossMin->setSubgraph(ps);
38 crossMin->setInserter(ves);
39 pl.setCrossMin(crossMin);
40
42 pl.setEmbedder(emb);
43
45 ol->separation(20.0);
46 ol->cOverhang(0.4);
47 pl.setPlanarLayouter(ol);
48
49 pl.call(GA);
50
51 GraphIO::write(GA, "output-ERDiagram.gml", GraphIO::writeGML);
52 GraphIO::write(GA, "output-ERDiagram.svg", GraphIO::drawSVG);
53
54 return 0;
55}
Declares ogdf::EmbedderMinDepthMaxFaceLayers.
Declares class GraphIO which provides access to all graph read and write functionality.
Declaration of class OrthoLayout which represents an orthogonal planar drawing algorithm.
Declaration of the PlanarSubgraphFast.
Declaration of class PlanarizationLayout.
Declaration of class SubgraphPlanarizer.
Declaration of class VariablEmbeddingInserter.
Planar graph embedding that minimizes block-nesting depth and maximizes the external face and optimiz...
Stores additional attributes of a graph (like layout information).
static const long edgeType
Corresponds to edge attribute type(edge).
static const long nodeType
Corresponds to node attribute type(node).
static const long edgeGraphics
Corresponds to edge attribute bends(edge).
static const long nodeGraphics
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
static bool write(const Graph &G, const string &filename, WriterFunc writer=nullptr)
Writes graph G to a file with name filename and infers the format to use from the file's extension.
static bool writeGML(const Graph &G, std::ostream &os)
Writes graph G in GML format to output stream os.
static bool drawSVG(const GraphAttributes &A, std::ostream &os, const SVGSettings &settings)
static bool readGML(Graph &G, std::istream &is)
Reads graph G in GML format from input stream is.
static bool read(Graph &G, const string &filename, ReaderFunc reader=nullptr)
Reads graph G from a file with name filename and infers the used format from the file's extension.
Class for the representation of nodes.
Definition Graph_d.h:177
The Orthogonal layout algorithm for planar graphs.
Definition OrthoLayout.h:41
Computation of a planar subgraph using PQ-trees.
The planarization approach for drawing graphs.
The planarization approach for crossing minimization.
Optimal edge insertion module.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
int main()