1
/* This file is part of the Calligra libraries
2
Copyright (C) 2001 Werner Trobin <trobin@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
19
#ifndef KOFILTEREDGE_H
20
#define KOFILTEREDGE_H
22
#include "KoFilterChain.h"
23
#include "PriorityQueue_p.h"
25
namespace CalligraFilter {
27
* An internal class representing a filter (=edge) in the filter graph.
34
// creates a new edge to "vertex" with the given weight.
35
Edge(Vertex* vertex, KoFilterEntry::Ptr filterEntry);
38
unsigned int weight() const {
39
return m_filterEntry ? m_filterEntry->weight : 0;
41
KoFilterEntry::Ptr filterEntry() const {
44
const Vertex* vertex() const {
48
// Relaxes the "connected" vertex (i.e. the weight of the
49
// connected vertex = "predec.->key()" (parameter) + weight of this edge
50
// As this will only be called once we calculate the weight
51
// of the edge "on the fly"
52
// Note: We have to pass the queue as we have to call keyDecreased :}
53
void relax(const Vertex* predecessor, PriorityQueue<Vertex>& queue);
56
void dump(const QByteArray& indent) const;
59
Edge(const Edge& rhs);
60
Edge& operator=(const Edge& rhs);
63
KoFilterEntry::Ptr m_filterEntry;
70
#endif // KOFILTEREDGE_H