Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

CliqueReplacer.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/SList.h>
36 
37 namespace ogdf {
38 namespace planarization_layout {
39 
41 
45 
46  double m_cliqueCenterSize; //default size of inserted clique replacement center nodes
47  SListPure<node> m_centerNodes; //center nodes introduced at clique replacement
48 
49  EdgeArray<bool> m_replacementEdge; //used to mark clique replacement edges may be we can join this with edge type
50 
51  NodeArray<DRect> m_cliqueCircleSize; //save the bounding box size of the circular drawing of the clique at center
52 
53  NodeArray<DPoint> m_cliqueCirclePos; //save the position of the node in the circular drawing of the clique
54 
55 public:
57 
58  // replace (dense) subgraphs given in list clique by
59  // inserting a center node connected to each node (=>star)
60  // and deleting all edges between nodes in clique
61  // returns center node
62  void replaceByStar(List<List<node>*> &cliques);
63 
64  // undo clique replacements
65  void undoStars();
66 
67  // boolean switches restore of all hidden edges in single clique call
68  void undoStar(node center, bool restoreAllEdges);
69 
70  //returns the size of a circular drawing for a clique around center v
72  {
73  return m_cliqueCircleSize[v];
74  }
76  {
77  return m_cliqueCirclePos[v];
78  }
79 
80  //compute circle positions for all nodes around center
81  //using the ordering given in this UMLGraph, calls
82  //ccP(List...)
83  //rectMin is a temporary solution until compaction with constraints allows stretching
84  //of rect to clique size, it gives the min(w,h) of the given fixed size rect around the clique
85 #if 1
86  void computeCliquePosition(node center, double rectMin);
87 #else
88  void computeCliquePosition(node center, double rectMin, const adjEntry &startAdj);
89 #endif
90 
91  //compute positions for the nodes in adjNodes on a circle
92  //tries to keep the relative placement of the nodes in the clique
93  //rectangle (left, right,...) to avoid clique crossings of outgoing edges
94  void computeCliquePosition(List<node> &adjNodes, node center, double rectMin = -1.0);
95 
96  const SListPure<node> &centerNodes() { return m_centerNodes; }
97 
98  //default size of inserted clique replacement center nodes
99  void setDefaultCliqueCenterSize(double i) { m_cliqueCenterSize = max(i, 1.0); }
100 
101  double getDefaultCliqueCenterSize() { return m_cliqueCenterSize; }
102 
105  {
106  // TODO: check here how to guarantee that value is defined,
107  // edgearray is only valid if there are cliques replaced
108  return m_replacementEdge[e];
109  }
110 
111 private:
112  node replaceByStar(List<node> &clique, NodeArray<int> &cliqueNum);
113  DRect circularBound(node center);
114 };
115 
116 }
117 }
Declaration of singly linked lists and iterators.
Functionality for temporarily hiding edges in constant time.
Definition: Graph_d.h:787
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Singly linked lists.
Definition: SList.h:38
Rectangles with real coordinates.
Definition: geometry.h:815
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
Stores additional attributes of a graph (like layout information).
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
no new dummy nodes are introduced, for every hyperedge e = (v_1, ..., v_l), we add a cliqie K_l conne...
Class for the representation of edges.
Definition: Graph_d.h:292
Class for the representation of nodes.
Definition: Graph_d.h:169
const SListPure< node > & centerNodes()
bool isReplacement(edge e)
returns true if edge was inserted during clique replacement
The namespace for all OGDF objects.
Class for adjacency list elements.
Definition: Graph_d.h:79