6 * $Date: 2012-07-10 17:25:20 +0200 (Di, 10. Jul 2012) $
7 ***************************************************************/
10 * \brief Base functionality of Mixed-Model layout algorithm
12 * \author Carsten Gutwenger
15 * This file is part of the Open Graph Drawing Framework (OGDF).
19 * See README.txt in the root directory of the OGDF installation for details.
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
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.
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 ***************************************************************/
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>
67 MixedModelBase(PlanRep
&PG
, GridLayout
&gridLayout
) :
68 m_PG(PG
), m_adjExternal(0), m_gridLayout(gridLayout
), m_iops(PG
) { }
70 virtual ~MixedModelBase() { }
73 AugmentationModule
&augmenter
,
74 EmbedderModule
*pEmbedder
,
76 ShellingOrderModule
&compOrder
);
78 void assignIopCoords();
81 void computeXCoords();
82 void computeYCoords();
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
&);
101 adjEntry m_adjExternal
;
103 GridLayout
&m_gridLayout
;
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