Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / src / planarlayout / MixedModelBase.h
blob9a8f4890c9422a944952edaa6d1192fdd7eb6992
1 /*
2 * $Revision: 2571 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-10 17:25:20 +0200 (Di, 10. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Base functionality of Mixed-Model layout algorithm
12 * \author Carsten Gutwenger
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
43 #ifdef _MSC_VER
44 #pragma once
45 #endif
47 #ifndef OGDF_MIXED_MODEL_BASE_H
48 #define OGDF_MIXED_MODEL_BASE_H
51 #include <ogdf/planarity/PlanRep.h>
52 #include <ogdf/basic/GridLayout.h>
53 #include <ogdf/module/AugmentationModule.h>
54 #include <ogdf/module/ShellingOrderModule.h>
55 #include <ogdf/module/EmbedderModule.h>
57 #include "MMOrder.h"
58 #include "IOPoints.h"
61 namespace ogdf {
64 class MixedModelBase
66 public:
67 MixedModelBase(PlanRep &PG, GridLayout &gridLayout) :
68 m_PG(PG), m_adjExternal(0), m_gridLayout(gridLayout), m_iops(PG) { }
70 virtual ~MixedModelBase() { }
72 void computeOrder(
73 AugmentationModule &augmenter,
74 EmbedderModule *pEmbedder,
75 adjEntry adjExternal,
76 ShellingOrderModule &compOrder);
78 void assignIopCoords();
80 void placeNodes();
81 void computeXCoords();
82 void computeYCoords();
84 void setBends();
85 void postprocessing1();
86 void postprocessing2();
89 // functions for debugging output
91 void printMMOrder(std::ostream &os);
92 void printInOutPoints(std::ostream &os);
93 void print(std::ostream &os, const InOutPoint &iop);
94 void printNodeCoords(std::ostream &os);
96 // avoid creation of assignment operator
97 MixedModelBase &operator=(const MixedModelBase &);
99 private:
100 PlanRep &m_PG;
101 adjEntry m_adjExternal;
103 GridLayout &m_gridLayout;
105 MMOrder m_mmo;
106 IOPoints m_iops;
107 Stack<PlanRep::Deg1RestoreInfo> m_deg1RestoreStack;
109 Array<int> m_dyl, m_dyr;
110 Array<ListConstIterator<InOutPoint> > m_leftOp, m_rightOp;
111 NodeArray<ListConstIterator<InOutPoint> > m_nextLeft, m_nextRight;
112 NodeArray<int> m_dxla, m_dxra;
115 bool exists(adjEntry adj) {
116 return m_PG.isDummy(adj->theEdge()) == false;
119 bool hasLeft (int k) const;
120 bool hasRight(int k) const;
122 void removeDeg1Nodes();
124 void firstPoint(int &x, int &y, adjEntry adj);
125 bool isRedundant(int x1, int y1, int x2, int y2, int x3, int y3);
129 } // end namespace ogdf
132 #endif