Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

SyncPlanDrawer.h
Go to the documentation of this file.
1 
31 #pragma once
32 
33 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/GraphCopy.h>
37 #include <ogdf/basic/List.h>
38 #include <ogdf/basic/basic.h>
41 
42 #include <functional>
43 #include <memory>
44 #include <utility>
45 
46 namespace ogdf {
47 class PlanarGridLayoutModule;
48 } // namespace ogdf
49 
50 namespace ogdf::sync_plan {
51 class SyncPlan;
52 
54 OGDF_EXPORT void formatNode(node n, GraphAttributes* ga, int group);
55 
58  const ClusterGraph& CG, const EdgeArray<List<std::pair<adjEntry, cluster>>>& subdivisions,
59  GraphAttributes& GA,
60  const std::function<edge(edge)>& translate = [](edge e) -> edge { return e; });
61 
63 OGDF_EXPORT std::unique_ptr<std::pair<GraphCopy, GraphAttributes>> drawClusterGraph(ClusterGraph& CG,
64  GraphAttributes& GA, PlanarGridLayoutModule& layout, adjEntry adjExternal = nullptr);
65 
68  std::unique_ptr<LayoutModule> planar_layout;
69  std::unique_ptr<LayoutModule> non_planar_layout;
71 
78  std::unique_ptr<GraphAttributes> own_GA;
79 
80 public:
82 
83  virtual ~SyncPlanDrawer() { cleanUp(); }
84 
85  GraphAttributes& ensureGraphAttributes();
86 
87  [[nodiscard]] const GraphAttributes& getBC_GA() const { return BC_GA; }
88 
89  [[nodiscard]] const GraphIO::SVGSettings& getSvg() const { return svg; }
90 
91  void layout(bool format = true, bool components = true);
92 
93  void cleanUp();
94 };
95 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
GraphAttributes.h
Declaration of class GraphAttributes which extends a Graph by additional attributes.
ogdf::sync_plan::SyncPlanDrawer::reuse_bc_edge_idx
List< int > reuse_bc_edge_idx
Definition: SyncPlanDrawer.h:77
Graph.h
Includes declaration of graph class.
ogdf::sync_plan
Definition: clustering.h:44
ogdf::EdgeArray
internal::EdgeArrayBase2< Value, WithDefault > EdgeArray
RegisteredArray for labeling the edges in a Graph with an arbitrary Value.
Definition: Graph_d.h:745
LayoutModule.h
Declaration of interface for layout algorithms (class LayoutModule)
ogdf::sync_plan::SyncPlanDrawer
Utilities by dumping a drawing of the current state of a SyncPlan instance.
Definition: SyncPlanDrawer.h:67
ogdf::sync_plan::SyncPlanDrawer::getSvg
const GraphIO::SVGSettings & getSvg() const
Definition: SyncPlanDrawer.h:89
ogdf::sync_plan::SyncPlan
A class for modelling and solving Synchronized Planarity instances.
Definition: SyncPlan.h:123
ogdf::adjEntry
AdjElement * adjEntry
The type of adjacency entries.
Definition: Graph_d.h:78
ogdf::sync_plan::SyncPlanDrawer::planar_layout
std::unique_ptr< LayoutModule > planar_layout
Definition: SyncPlanDrawer.h:68
ogdf::edge
EdgeElement * edge
The type of edges.
Definition: Graph_d.h:74
ogdf::sync_plan::SyncPlanDrawer::BC_GA
GraphAttributes BC_GA
Definition: SyncPlanDrawer.h:73
ogdf::sync_plan::SyncPlanDrawer::g_edges
List< edge > g_edges
Definition: SyncPlanDrawer.h:74
ogdf::GraphIO::SVGSettings
Condensed settings for drawing SVGs.
Definition: GraphIO.h:128
ogdf::sync_plan::styleClusterBorder
void styleClusterBorder(const ClusterGraph &CG, const EdgeArray< List< std::pair< adjEntry, cluster >>> &subdivisions, GraphAttributes &GA, const std::function< edge(edge)> &translate=[](edge e) -> edge { return e;})
Properly style a cluster border inserted by planarizeClusterBorderCrossings()
ogdf::sync_plan::SyncPlanDrawer::reuse_g_edge_idx
List< int > reuse_g_edge_idx
Definition: SyncPlanDrawer.h:76
ogdf::sync_plan::SyncPlanDrawer::PQ
SyncPlan * PQ
Definition: SyncPlanDrawer.h:72
GraphIO.h
Declares class GraphIO which provides access to all graph read and write functionality.
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:70
GraphCopy.h
Declaration of graph copy classes.
ogdf::List< edge >
ogdf::sync_plan::SyncPlanDrawer::getBC_GA
const GraphAttributes & getBC_GA() const
Definition: SyncPlanDrawer.h:87
ogdf::sync_plan::drawClusterGraph
std::unique_ptr< std::pair< GraphCopy, GraphAttributes > > drawClusterGraph(ClusterGraph &CG, GraphAttributes &GA, PlanarGridLayoutModule &layout, adjEntry adjExternal=nullptr)
Draw a graph using a given planar layout by turning its cluster borders into edges via planarizeClust...
ogdf::sync_plan::SyncPlanDrawer::~SyncPlanDrawer
virtual ~SyncPlanDrawer()
Definition: SyncPlanDrawer.h:83
ogdf::sync_plan::SyncPlanDrawer::svg
GraphIO::SVGSettings svg
Definition: SyncPlanDrawer.h:70
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::sync_plan::SyncPlanDrawer::non_planar_layout
std::unique_ptr< LayoutModule > non_planar_layout
Definition: SyncPlanDrawer.h:69
ogdf::sync_plan::formatNode
void formatNode(node n, GraphAttributes *ga, int group)
Simple util for apply a default style to nodes, including a group-based coloring.
ClusterGraph.h
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
List.h
Declaration of doubly linked lists and iterators.
ogdf::sync_plan::SyncPlanDrawer::bc_edges
List< edge > bc_edges
Definition: SyncPlanDrawer.h:75
ogdf::sync_plan::SyncPlanDrawer::own_GA
std::unique_ptr< GraphAttributes > own_GA
Definition: SyncPlanDrawer.h:78