Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

MixedModelBase.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/planarity/PlanRep.h>
35 #include <ogdf/basic/GridLayout.h>
41 
42 namespace ogdf {
43 
45 {
46 public:
47  MixedModelBase(PlanRep &PG, GridLayout &gridLayout) :
48  m_PG(PG), m_gridLayout(gridLayout), m_iops(PG) { }
49 
50  virtual ~MixedModelBase() { }
51 
54  void computeOrder(
55  AugmentationModule &augmenter,
56  EmbedderModule *pEmbedder,
57  adjEntry adjExternal,
58  ShellingOrderModule &compOrder);
59 
61  void assignIopCoords();
62 
64  void placeNodes();
65 
68  void computeXCoords();
69 
71  void computeYCoords();
72 
75  void setBends();
76 
78  void postprocessing1();
79 
81  void postprocessing2();
82 
83 
86  void printMMOrder(std::ostream &os);
87  void printInOutPoints(std::ostream &os);
88  void print(std::ostream &os, const InOutPoint &iop);
89  void printNodeCoords(std::ostream &os);
91 
92  MixedModelBase &operator=(const MixedModelBase &) = delete;
93 
94 private:
96 
98 
102 
107 
108 
109  bool exists(adjEntry adj) {
110  return !m_PG.isDummy(adj->theEdge());
111  }
112 
114  bool hasLeft (int k) const;
115 
117  bool hasRight(int k) const;
118 
120  void removeDeg1Nodes();
121 
122  void firstPoint(int &x, int &y, adjEntry adj);
123  bool isRedundant(int x1, int y1, int x2, int y2, int x3, int y3);
124 };
125 
126 }
MixedModelBase(PlanRep &PG, GridLayout &gridLayout)
Representation of a graph&#39;s grid layout.
Definition: GridLayout.h:46
edge theEdge() const
Returns the edge associated with this adjacency entry.
Definition: Graph_d.h:96
bool exists(adjEntry adj)
bool hasLeft(int k) const
Determine if the kth set in the ordered partition has a "real" left vertex.
void placeNodes()
Implements the placement step. Computes x[v] and y[v].
Base class for modules that compute a shelling order of a graph.
Representation of an in- or outpoint.
Definition: IOPoints.h:42
void setBends()
Assigns polylines to edges of the original graph and computes the x- and y-coordinates of deg-1-nodes...
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...
Declaration of a base class for planar representations of graphs and cluster graphs.
NodeArray< ListConstIterator< InOutPoint > > m_nextRight
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
Definition: Array.h:45
void removeDeg1Nodes()
Removes degree-1 nodes and store informations for restoring them.
NodeArray< ListConstIterator< InOutPoint > > m_nextLeft
NodeArray< int > m_dxra
Defines ogdf::EmbedderModule.
void print(std::ostream &os, const InOutPoint &iop)
void printInOutPoints(std::ostream &os)
Representation of in- and outpoint lists.
Definition: IOPoints.h:57
void firstPoint(int &x, int &y, adjEntry adj)
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
MixedModelBase & operator=(const MixedModelBase &)=delete
void postprocessing2()
Tries to reduce the number of bends by moving degree-2 nodes on bend points.
Declaration of class GridLayout.
GridLayout & m_gridLayout
void assignIopCoords()
Computes the relative coordinates of the in- and outpoints, incl. height(v), depth(v).
void printNodeCoords(std::ostream &os)
Declares the base class ShellingOrderModule for modules that compute a shelling order of a graph...
void postprocessing1()
Tries to reduce the number of bends by changing the outpoints of nodes with indeg and outdeg 2...
void computeXCoords()
Computes the absolute x-coordinates x[v] of all nodes in the ordering, furthermore dyla[k] and dyra[k...
Array< ListConstIterator< InOutPoint > > m_leftOp
Array< ListConstIterator< InOutPoint > > m_rightOp
Declaration of interface for graph augmentation algorithms.
Declaration of classes InOutPoint and IOPoints which implement the management of in-/out-points.
void computeYCoords()
Computes the absolute y-coordinates y[v] of all nodes in the ordering.
bool isRedundant(int x1, int y1, int x2, int y2, int x3, int y3)
ArrayBuffer< PlanRep::Deg1RestoreInfo > m_deg1RestoreStack
The base class for graph augmentation algorithms.
The namespace for all OGDF objects.
Base class for embedder algorithms.
Declaration of shelling order used by the Mixed-Model layout algorithm.
void printMMOrder(std::ostream &os)
Functions for debugging output.
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
Definition: GraphCopy.h:377
bool hasRight(int k) const
Determine if the kth set in the ordered partition has a "real" right vertex.
Class for adjacency list elements.
Definition: Graph_d.h:79
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:59
NodeArray< int > m_dxla