Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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