Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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
50  //may be we can join this with edge type
51 
52  NodeArray<DRect> m_cliqueCircleSize; //save the bounding box size of the
53  //circular drawing of the clique at center
54 
55  NodeArray<DPoint> m_cliqueCirclePos; //save the position of the node in the
56  //circular drawing of the clique
57 
58 public:
60 
61  // replace (dense) subgraphs given in list clique by
62  // inserting a center node connected to each node (=>star)
63  // and deleting all edges between nodes in clique
64  // returns center node
65  void replaceByStar(List< List<node> > &cliques);
66 
67  // undo clique replacements
68  void undoStars();
69 
70  // boolean switches restore of all hidden edges in single clique call
71  void undoStar(node center, bool restoreAllEdges);
72 
73  //returns the size of a circular drawing for a clique around center v
75  {
76  return m_cliqueCircleSize[v];
77  }
79  {
80  return m_cliqueCirclePos[v];
81  }
82 
83  //compute circle positions for all nodes around center
84  //using the ordering given in this UMLGraph, calls
85  //ccP(List...)
86  //rectMin is a temporary solution until compaction with constraints allows stretching
87  //of rect to clique size, it gives the min(w,h) of the given fixed size rect around the clique
88 #if 1
89  void computeCliquePosition(node center, double rectMin);
90 #else
91  void computeCliquePosition(node center, double rectMin, const adjEntry &startAdj);
92 #endif
93 
94  //compute positions for the nodes in adjNodes on a circle
95  //tries to keep the relative placement of the nodes in the clique
96  //rectangle (left, right,...) to avoid clique crossings of outgoing edges
97  void computeCliquePosition(List<node> &adjNodes, node center, double rectMin = -1.0);
98 
99  const SListPure<node> &centerNodes() { return m_centerNodes; }
100 
101  //default size of inserted clique replacement center nodes
102  void setDefaultCliqueCenterSize(double i) { m_cliqueCenterSize = max(i, 1.0); }
103 
104  double getDefaultCliqueCenterSize() { return m_cliqueCenterSize; }
105 
108  {
109  // TODO: check here how to guarantee that value is defined,
110  // edgearray is only valid if there are cliques replaced
111  return m_replacementEdge[e];
112  }
113 
114 private:
115  node replaceByStar(List<node> &clique, NodeArray<int> &cliqueNum);
116  DRect circularBound(node center);
117 };
118 
119 }
120 }
Declaration of singly linked lists and iterators.
Functionality for temporarily hiding edges in constant time.
Definition: Graph_d.h:770
Declaration of class GraphAttributes which extends a Graph by additional attributes.
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
Singly linked lists.
Definition: SList.h:38
Rectangles with real coordinates.
Definition: geometry.h:515
Real points.
Definition: geometry.h:219
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:423
Stores additional attributes of a graph (like layout information).
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
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:291
Class for the representation of nodes.
Definition: Graph_d.h:167
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:78