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/GridLayout.h>
37 #include <ogdf/planarity/PlanRep.h>
41 
42 namespace ogdf {
43 
45 public:
46  MixedModelBase(PlanRep& PG, GridLayout& gridLayout)
47  : m_PG(PG), m_gridLayout(gridLayout), m_iops(PG) { }
48 
49  virtual ~MixedModelBase() { }
50 
53  void computeOrder(AugmentationModule& augmenter, EmbedderModule* pEmbedder,
54  adjEntry adjExternal, ShellingOrderModule& compOrder);
55 
57  void assignIopCoords();
58 
60  void placeNodes();
61 
64  void computeXCoords();
65 
67  void computeYCoords();
68 
71  void setBends();
72 
74  void postprocessing1();
75 
77  void postprocessing2();
78 
79 
82  void printMMOrder(std::ostream& os);
83  void printInOutPoints(std::ostream& os);
84  void print(std::ostream& os, const InOutPoint& iop);
85  void printNodeCoords(std::ostream& os);
87 
88  MixedModelBase& operator=(const MixedModelBase&) = delete;
89 
90 private:
92 
94 
98 
103 
104  bool exists(adjEntry adj) { return !m_PG.isDummy(adj->theEdge()); }
105 
107  bool hasLeft(int k) const;
108 
110  bool hasRight(int k) const;
111 
113  void removeDeg1Nodes();
114 
115  void firstPoint(int& x, int& y, adjEntry adj);
116  bool isRedundant(int x1, int y1, int x2, int y2, int x3, int y3);
117 };
118 
119 }
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:46
ogdf::MixedModelBase::m_gridLayout
GridLayout & m_gridLayout
Definition: MixedModelBase.h:93
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ShellingOrderModule.h
Declares the base class ShellingOrderModule for modules that compute a shelling order of a graph.
ogdf::MixedModelBase::m_dyr
Array< int > m_dyr
Definition: MixedModelBase.h:99
ogdf::PlanRep
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:57
ogdf::MixedModelBase::m_iops
IOPoints m_iops
Definition: MixedModelBase.h:96
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:91
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:44
ogdf::GraphCopyBase::isDummy
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
Definition: GraphCopy.h:166
ogdf::MixedModelBase::print
void print(std::ostream &os, const InOutPoint &iop)
ogdf::MixedModelBase::m_dyl
Array< int > m_dyl
Definition: MixedModelBase.h:99
ogdf::MixedModelBase::exists
bool exists(adjEntry adj)
Definition: MixedModelBase.h:104
ogdf::InOutPoint
Representation of an in- or outpoint.
Definition: IOPoints.h:41
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:57
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:135
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:153
AugmentationModule.h
Declaration of interface for graph augmentation algorithms.
ogdf::MixedModelBase::~MixedModelBase
virtual ~MixedModelBase()
Definition: MixedModelBase.h:49
ogdf::Array< int >
ogdf::MixedModelBase::MixedModelBase
MixedModelBase(PlanRep &PG, GridLayout &gridLayout)
Definition: MixedModelBase.h:46
ogdf::MixedModelBase::m_deg1RestoreStack
ArrayBuffer< PlanRep::Deg1RestoreInfo > m_deg1RestoreStack
Definition: MixedModelBase.h:97
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::MixedModelBase::firstPoint
void firstPoint(int &x, int &y, adjEntry adj)
ogdf::AugmentationModule
The base class for graph augmentation algorithms.
Definition: AugmentationModule.h:53
ogdf::MMOrder
Definition: MMOrder.h:41
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:101
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:49
ogdf::MixedModelBase::setBends
void setBends()
Assigns polylines to edges of the original graph and computes the x- and y-coordinates of deg-1-nodes...
EmbedderModule.h
Defines ogdf::EmbedderModule.
ogdf::MixedModelBase
Definition: MixedModelBase.h:44
ogdf::MixedModelBase::m_dxra
NodeArray< int > m_dxra
Definition: MixedModelBase.h:102
ogdf::MixedModelBase::m_rightOp
Array< ListConstIterator< InOutPoint > > m_rightOp
Definition: MixedModelBase.h:100
ogdf::MixedModelBase::m_mmo
MMOrder m_mmo
Definition: MixedModelBase.h:95
ogdf::GridLayout
Representation of a graph's grid layout.
Definition: GridLayout.h:46
ogdf::MixedModelBase::m_leftOp
Array< ListConstIterator< InOutPoint > > m_leftOp
Definition: MixedModelBase.h:100
ogdf::MixedModelBase::m_dxla
NodeArray< int > m_dxla
Definition: MixedModelBase.h:102
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:101
GridLayout.h
Declaration of class GridLayout.
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.