Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

CPlanarEdgeInserter.h
Go to the documentation of this file.
1 
37 #pragma once
38 
40 
41 namespace ogdf {
42 
44 
48 {
49  //postprocessing options
50  enum class PostProcessType {None, RemoveReinsert};
51 
52 public:
53 
55 
56  virtual ~CPlanarEdgeInserter() { }
57 
58  void call(
59  ClusterPlanRep& CPR,
61  Graph& G,
62  const List<NodePair>& origEdges,
63  List<edge>& newEdges);
64 
66  {
67  m_ppType = p;
68  }
69 
70  PostProcessType getPostProcessing() { return m_ppType; }
71 
72 protected:
73 
74  void constructDualGraph(
75  ClusterPlanRep& CPR,
77  EdgeArray<edge>& arcRightToLeft,
78  EdgeArray<edge>& arcLeftToRight,
79  FaceArray<node>& nodeOfFace,
80  //NodeArray<face>& faceOfNode,
81  EdgeArray<edge>& arcTwin);
82 
83  void findShortestPath(
84  const CombinatorialEmbedding &E,
85  node s, //edge startpoint
86  node t, //edge endpoint
87  node sDummy, //representing s in network
88  node tDummy, //representing t in network
89  SList<adjEntry> &crossed,
90  FaceArray<node>& nodeOfFace);
91 
92  edge insertEdge(
93  ClusterPlanRep &CPR,
95  const NodePair& np,
96  FaceArray<node>& nodeOfFace,
97  EdgeArray<edge>& arcRightToLeft,
98  EdgeArray<edge>& arcLeftToRight,
99  EdgeArray<edge>& arcTwin,
100  NodeArray<cluster>& clusterOfFaceNode,
101  const SList<adjEntry> &crossed);
102 
103  void setArcStatus(
104  edge eArc,
105  node oSrc,
106  node oTgt,
107  const ClusterGraph& CG,
108  NodeArray<cluster>& clusterOfFaceNode,
109  EdgeArray<edge>& arcTwin);
110 
111  //use heuristics to improve the result if possible
112  void postProcess();
113 
114 private:
115 
118  EdgeArray<int> m_eStatus; //status of dual graph arcs
119  EdgeArray<adjEntry> m_arcOrig; //original edges adj entry
120  PostProcessType m_ppType; //defines which kind of postprocessing to use
121 
122  //compute for every face the cluster that surrounds it
123  void deriveFaceCluster(
124  ClusterPlanRep& CPR,
126  const ClusterGraph& CG,
127  FaceArray<node>& nodeOfFace,
128  NodeArray<cluster>& clusterOfFaceNode);
129 
130 
131  //debug
132  void writeDual(const char *fileName);
133  void writeGML(ostream &os, const Layout &drawing);
134 };//class CPlanarEdgeInserter
135 
136 } // end namespace ogdf
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:472
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Edge insertion algorithm for clustered graphs.
PostProcessType getPostProcessing()
Declaration of ClusterPlanRep class, allowing cluster boundary insertion and shortest path edge inser...
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
Singly linked lists (maintaining the length of the list).
Definition: SList.h:777
void setPostProcessing(PostProcessType p)
Representation of clustered graphs.
Definition: ClusterGraph.h:291
Dynamic arrays indexed with faces of a combinatorial embedding.
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:423
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
EdgeArray< adjEntry > m_arcOrig
Class for the representation of edges.
Definition: Graph_d.h:291
Planarized representations for clustered graphs.
Class for the representation of nodes.
Definition: Graph_d.h:167
The namespace for all OGDF objects.
Combinatorial embeddings of planar graphs with modification functionality.
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition: Layout.h:46