Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

MixedModelBase.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Array.h>
35 #include <ogdf/basic/ArrayBuffer.h>
36 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/List.h>
38 #include <ogdf/planarity/PlanRep.h>
41 
42 #include <iosfwd>
43 
44 namespace ogdf {
45 class AugmentationModule;
46 class EmbedderModule;
47 class GridLayout;
48 class ShellingOrderModule;
49 
51 public:
52  MixedModelBase(PlanRep& PG, GridLayout& gridLayout)
53  : m_PG(PG), m_gridLayout(gridLayout), m_iops(PG) { }
54 
55  virtual ~MixedModelBase() { }
56 
59  void computeOrder(AugmentationModule& augmenter, EmbedderModule* pEmbedder,
60  adjEntry adjExternal, ShellingOrderModule& compOrder);
61 
63  void assignIopCoords();
64 
66  void placeNodes();
67 
70  void computeXCoords();
71 
73  void computeYCoords();
74 
77  void setBends();
78 
80  void postprocessing1();
81 
83  void postprocessing2();
84 
85 
88  void printMMOrder(std::ostream& os);
89  void printInOutPoints(std::ostream& os);
90  void print(std::ostream& os, const InOutPoint& iop);
91  void printNodeCoords(std::ostream& os);
93 
94  MixedModelBase& operator=(const MixedModelBase&) = delete;
95 
96 private:
98 
100 
104 
109 
110  bool exists(adjEntry adj) { return !m_PG.isDummy(adj->theEdge()); }
111 
113  bool hasLeft(int k) const;
114 
116  bool hasRight(int k) const;
117 
119  void removeDeg1Nodes();
120 
121  void firstPoint(int& x, int& y, adjEntry adj);
122  bool isRedundant(int x1, int y1, int x2, int y2, int x3, int y3);
123 };
124 
125 }
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:53
ogdf::MixedModelBase::m_gridLayout
GridLayout & m_gridLayout
Definition: MixedModelBase.h:99
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ArrayBuffer.h
Declaration and implementation of ArrayBuffer class.
ogdf::MixedModelBase::m_dyr
Array< int > m_dyr
Definition: MixedModelBase.h:105
Graph.h
Includes declaration of graph class.
ogdf::PlanRep
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:69
ogdf::MixedModelBase::m_iops
IOPoints m_iops
Definition: MixedModelBase.h:102
ogdf::MixedModelBase::assignIopCoords
void assignIopCoords()
Computes the relative coordinates of the in- and outpoints, incl. height(v), depth(v).
ogdf::MixedModelBase::computeYCoords
void computeYCoords()
Computes the absolute y-coordinates y[v] of all nodes in the ordering.
ogdf::MixedModelBase::m_PG
PlanRep & m_PG
Definition: MixedModelBase.h:97
ogdf::MixedModelBase::removeDeg1Nodes
void removeDeg1Nodes()
Removes degree-1 nodes and store informations for restoring them.
ogdf::ShellingOrderModule
Base class for modules that compute a shelling order of a graph.
Definition: ShellingOrderModule.h:48
ogdf::GraphCopyBase::isDummy
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
Definition: GraphCopy.h:173
ogdf::MixedModelBase::print
void print(std::ostream &os, const InOutPoint &iop)
ogdf::MixedModelBase::m_dyl
Array< int > m_dyl
Definition: MixedModelBase.h:105
ogdf::MixedModelBase::exists
bool exists(adjEntry adj)
Definition: MixedModelBase.h:110
ogdf::InOutPoint
Representation of an in- or outpoint.
Definition: IOPoints.h:47
ogdf::MixedModelBase::isRedundant
bool isRedundant(int x1, int y1, int x2, int y2, int x3, int y3)
ogdf::IOPoints
Representation of in- and outpoint lists.
Definition: IOPoints.h:63
ogdf::MixedModelBase::operator=
MixedModelBase & operator=(const MixedModelBase &)=delete
ogdf::MixedModelBase::placeNodes
void placeNodes()
Implements the placement step. Computes x[v] and y[v].
ogdf::MixedModelBase::postprocessing1
void postprocessing1()
Tries to reduce the number of bends by changing the outpoints of nodes with indeg and outdeg 2.
PlanRep.h
Declaration of a base class for planar representations of graphs and cluster graphs.
ogdf::MixedModelBase::printInOutPoints
void printInOutPoints(std::ostream &os)
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
MMOrder.h
Declaration of shelling order used by the Mixed-Model layout algorithm.
ogdf::AdjElement::theEdge
edge theEdge() const
Returns the edge associated with this adjacency entry.
Definition: Graph_d.h:160
ogdf::MixedModelBase::~MixedModelBase
virtual ~MixedModelBase()
Definition: MixedModelBase.h:55
ogdf::Array< int >
ogdf::MixedModelBase::MixedModelBase
MixedModelBase(PlanRep &PG, GridLayout &gridLayout)
Definition: MixedModelBase.h:52
ogdf::MixedModelBase::m_deg1RestoreStack
ArrayBuffer< PlanRep::Deg1RestoreInfo > m_deg1RestoreStack
Definition: MixedModelBase.h:103
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::MixedModelBase::firstPoint
void firstPoint(int &x, int &y, adjEntry adj)
ogdf::AugmentationModule
The base class for graph augmentation algorithms.
Definition: AugmentationModule.h:56
ogdf::MMOrder
Definition: MMOrder.h:43
ogdf::MixedModelBase::hasRight
bool hasRight(int k) const
Determine if the kth set in the ordered partition has a "real" right vertex.
IOPoints.h
Declaration of classes InOutPoint and IOPoints which implement the management of in-/out-points.
ogdf::MixedModelBase::m_nextRight
NodeArray< ListConstIterator< InOutPoint > > m_nextRight
Definition: MixedModelBase.h:107
ogdf::MixedModelBase::postprocessing2
void postprocessing2()
Tries to reduce the number of bends by moving degree-2 nodes on bend points.
ogdf::EmbedderModule
Base class for embedder algorithms.
Definition: EmbedderModule.h:52
ogdf::MixedModelBase::setBends
void setBends()
Assigns polylines to edges of the original graph and computes the x- and y-coordinates of deg-1-nodes...
ogdf::MixedModelBase
Definition: MixedModelBase.h:50
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::MixedModelBase::m_dxra
NodeArray< int > m_dxra
Definition: MixedModelBase.h:108
List.h
Declaration of doubly linked lists and iterators.
ogdf::MixedModelBase::m_rightOp
Array< ListConstIterator< InOutPoint > > m_rightOp
Definition: MixedModelBase.h:106
ogdf::MixedModelBase::m_mmo
MMOrder m_mmo
Definition: MixedModelBase.h:101
ogdf::GridLayout
Representation of a graph's grid layout.
Definition: GridLayout.h:47
ogdf::MixedModelBase::m_leftOp
Array< ListConstIterator< InOutPoint > > m_leftOp
Definition: MixedModelBase.h:106
ogdf::MixedModelBase::m_dxla
NodeArray< int > m_dxla
Definition: MixedModelBase.h:108
ogdf::MixedModelBase::computeOrder
void computeOrder(AugmentationModule &augmenter, EmbedderModule *pEmbedder, adjEntry adjExternal, ShellingOrderModule &compOrder)
Computes the ordered partition (incl. m_leftOp[k], em_rightOp[k]) and constructs the in- and outpoint...
ogdf::MixedModelBase::printMMOrder
void printMMOrder(std::ostream &os)
Functions for debugging output.
ogdf::MixedModelBase::m_nextLeft
NodeArray< ListConstIterator< InOutPoint > > m_nextLeft
Definition: MixedModelBase.h:107
ogdf::MixedModelBase::printNodeCoords
void printNodeCoords(std::ostream &os)
ogdf::MixedModelBase::computeXCoords
void computeXCoords()
Computes the absolute x-coordinates x[v] of all nodes in the ordering, furthermore dyla[k] and dyra[k...
ogdf::MixedModelBase::hasLeft
bool hasLeft(int k) const
Determine if the kth set in the ordered partition has a "real" left vertex.