Add tests for UpdateCrypto
[TortoiseGit.git] / ext / OGDF / ogdf / module / TwoLayerCrossMin.h
blob384e97296e55c6b1a88a57762f8a7003650c5d32
1 /*
2 * $Revision: 2583 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-12 01:02:21 +0200 (Do, 12. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of interface for two-layer crossing
11 * minimization algorithms.
13 * \author Carsten Gutwenger
15 * \par License:
16 * This file is part of the Open Graph Drawing Framework (OGDF).
18 * \par
19 * Copyright (C)<br>
20 * See README.txt in the root directory of the OGDF installation for details.
22 * \par
23 * This program is free software; you can redistribute it and/or
24 * modify it under the terms of the GNU General Public License
25 * Version 2 or 3 as published by the Free Software Foundation;
26 * see the file LICENSE.txt included in the packaging of this file
27 * for details.
29 * \par
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
35 * \par
36 * You should have received a copy of the GNU General Public
37 * License along with this program; if not, write to the Free
38 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
39 * Boston, MA 02110-1301, USA.
41 * \see http://www.gnu.org/copyleft/gpl.html
42 ***************************************************************/
45 #ifdef _MSC_VER
46 #pragma once
47 #endif
49 #ifndef OGDF_TWO_LAYER_CROSS_MIN_H
50 #define OGDF_TWO_LAYER_CROSS_MIN_H
54 #include <ogdf/layered/Hierarchy.h>
57 namespace ogdf {
60 /**
61 * \brief Interface of two-layer crossing minimization algorithms.
63 * The interface of a two-layer crossing minimization algorithm consists of
64 * three methods:
65 * -# init(const Hierarchy & H) must be called first. This initializes the module
66 * for operating on hierarchy \a H.
67 * -# call(Level &L) (or operator()(Level &L)) performs two-layer crossing minimization,
68 * where \a L is the permutable level and the neighbor level of \a L (fixed
69 * level) is determined by the hierarchy (see documentation of class Hierarchy).
70 * Any number of call's may be performed once init() has been executed.
71 * -# cleanup() has to be called last and performs some final clean-up work.
73 class OGDF_EXPORT TwoLayerCrossMin {
74 public:
75 //! Initializes a two-layer crossing minimization module.
76 TwoLayerCrossMin() { }
78 virtual ~TwoLayerCrossMin() { }
80 /**
81 * \brief Initializes the crossing minimization module for hierarchy \a H.
83 * @param H is the hierarchy on which the module shall operate.
85 virtual void init(const Hierarchy & H) { }
87 /**
88 * \brief Performs crossing minimization for level \a L.
90 * @param L is the level in the hierarchy on which nodes are permuted; the
91 * neighbor level (fixed level) is determined by the hierarchy.
93 virtual void call(Level &L) = 0;
95 /**
96 * \brief Performs crossing minimization for level \a L.
98 * @param L is the level in the hierarchy on which nodes are permuted; the
99 * neighbor level (fixed level) is determined by the hierarchy.
101 void operator()(Level &L) {
102 call(L);
105 //! Performs clean-up.
106 virtual void cleanup() { }
108 OGDF_MALLOC_NEW_DELETE
112 } // end namespace ogdf
115 #endif