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>
41 
42 #include <functional>
43 #include <memory>
44 #include <utility>
45 
46 namespace ogdf::sync_plan {
47 class SyncPlan;
48 
50 OGDF_EXPORT void formatNode(node n, GraphAttributes* ga, int group);
51 
54  const ClusterGraph& CG, const EdgeArray<List<std::pair<adjEntry, cluster>>>& subdivisions,
55  GraphAttributes& GA,
56  const std::function<edge(edge)>& translate = [](edge e) -> edge { return e; });
57 
59 OGDF_EXPORT std::unique_ptr<std::pair<GraphCopy, GraphAttributes>> drawClusterGraph(ClusterGraph& CG,
60  GraphAttributes& GA, PlanarGridLayoutModule& layout, adjEntry adjExternal = nullptr);
61 
64  std::unique_ptr<LayoutModule> planar_layout;
65  std::unique_ptr<LayoutModule> non_planar_layout;
67 
74  std::unique_ptr<GraphAttributes> own_GA;
75 
76 public:
78 
79  virtual ~SyncPlanDrawer() { cleanUp(); }
80 
81  GraphAttributes& ensureGraphAttributes();
82 
83  [[nodiscard]] const GraphAttributes& getBC_GA() const { return BC_GA; }
84 
85  [[nodiscard]] const GraphIO::SVGSettings& getSvg() const { return svg; }
86 
87  void layout(bool format = true, bool components = true);
88 
89  void cleanUp();
90 };
91 }
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
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:73
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:738
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:63
ogdf::sync_plan::SyncPlanDrawer::getSvg
const GraphIO::SVGSettings & getSvg() const
Definition: SyncPlanDrawer.h:85
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:71
ogdf::sync_plan::SyncPlanDrawer::planar_layout
std::unique_ptr< LayoutModule > planar_layout
Definition: SyncPlanDrawer.h:64
ogdf::edge
EdgeElement * edge
The type of edges.
Definition: Graph_d.h:67
ogdf::sync_plan::SyncPlanDrawer::BC_GA
GraphAttributes BC_GA
Definition: SyncPlanDrawer.h:69
ogdf::sync_plan::SyncPlanDrawer::g_edges
List< edge > g_edges
Definition: SyncPlanDrawer.h:70
ogdf::GraphIO::SVGSettings
Condensed settings for drawing SVGs.
Definition: GraphIO.h:116
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:72
ogdf::sync_plan::SyncPlanDrawer::PQ
SyncPlan * PQ
Definition: SyncPlanDrawer.h:68
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:63
GraphCopy.h
Declaration of graph copy classes.
ogdf::List< edge >
ogdf::sync_plan::SyncPlanDrawer::getBC_GA
const GraphAttributes & getBC_GA() const
Definition: SyncPlanDrawer.h:83
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:79
ogdf::sync_plan::SyncPlanDrawer::svg
GraphIO::SVGSettings svg
Definition: SyncPlanDrawer.h:66
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:65
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:71
ogdf::sync_plan::SyncPlanDrawer::own_GA
std::unique_ptr< GraphAttributes > own_GA
Definition: SyncPlanDrawer.h:74
GridLayoutModule.h
Declaration of interface for grid layout algorithms.