Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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>
39 
42 
43 
44 namespace ogdf {
45 
46 
48 {
49 public:
50  MixedModelBase(PlanRep &PG, GridLayout &gridLayout) :
51  m_PG(PG), m_gridLayout(gridLayout), m_iops(PG) { }
52 
53  virtual ~MixedModelBase() { }
54 
57  void computeOrder(
58  AugmentationModule &augmenter,
59  EmbedderModule *pEmbedder,
60  adjEntry adjExternal,
61  ShellingOrderModule &compOrder);
62 
64  void assignIopCoords();
65 
67  void placeNodes();
68 
71  void computeXCoords();
72 
74  void computeYCoords();
75 
78  void setBends();
79 
81  void postprocessing1();
82 
84  void postprocessing2();
85 
86 
89  void printMMOrder(std::ostream &os);
90  void printInOutPoints(std::ostream &os);
91  void print(std::ostream &os, const InOutPoint &iop);
92  void printNodeCoords(std::ostream &os);
94 
95  MixedModelBase &operator=(const MixedModelBase &) = delete;
96 
97 private:
99 
101 
105 
110 
111 
112  bool exists(adjEntry adj) {
113  return !m_PG.isDummy(adj->theEdge());
114  }
115 
117  bool hasLeft (int k) const;
118 
120  bool hasRight(int k) const;
121 
123  void removeDeg1Nodes();
124 
125  void firstPoint(int &x, int &y, adjEntry adj);
126  bool isRedundant(int x1, int y1, int x2, int y2, int x3, int y3);
127 };
128 
129 
130 } // end namespace ogdf
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:95
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
void removeDeg1Nodes()
Removes degree-1 nodes and store informations for restoring them.
NodeArray< ListConstIterator< InOutPoint > > m_nextLeft
NodeArray< int > m_dxra
Declaration of interface for embedder for graphs.
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:423
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)
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.
Stack< PlanRep::Deg1RestoreInfo > m_deg1RestoreStack
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
Definition: GraphCopy.h:378
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:78
The parameterized class Stack<E> implements list-based stacks.
Definition: Stack.h:192
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:60
NodeArray< int > m_dxla