main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Jan 28 2020 00:00:00 for Gecode by
doxygen
1.8.17
gecode
gist
drawingcursor.hh
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Guido Tack <tack@gecode.org>
5
*
6
* Copyright:
7
* Guido Tack, 2006
8
*
9
* Last modified:
10
* $Date: 2010-08-12 09:48:30 +0200 (Thu, 12 Aug 2010) $ by $Author: tack $
11
* $Revision: 11345 $
12
*
13
* This file is part of Gecode, the generic constraint
14
* development environment:
15
* http://www.gecode.org
16
*
17
* Permission is hereby granted, free of charge, to any person obtaining
18
* a copy of this software and associated documentation files (the
19
* "Software"), to deal in the Software without restriction, including
20
* without limitation the rights to use, copy, modify, merge, publish,
21
* distribute, sublicense, and/or sell copies of the Software, and to
22
* permit persons to whom the Software is furnished to do so, subject to
23
* the following conditions:
24
*
25
* The above copyright notice and this permission notice shall be
26
* included in all copies or substantial portions of the Software.
27
*
28
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35
*
36
*/
37
38
#ifndef GECODE_GIST_QT_DRAWINGCURSOR_HH
39
#define GECODE_GIST_QT_DRAWINGCURSOR_HH
40
41
#include <
gecode/gist/nodecursor.hh
>
42
#include <
gecode/gist/layoutcursor.hh
>
43
#include <QtGui>
44
45
namespace
Gecode
{
namespace
Gist {
46
48
class
DrawingCursor
:
public
NodeCursor
<VisualNode> {
49
private
:
51
QPainter& painter;
53
QRect clippingRect;
55
BestNode
* curBest;
57
double
x, y;
58
59
bool
copies;
60
62
bool
isClipped(
void
);
63
public
:
65
static
const
QColor
red
;
67
static
const
QColor
green
;
69
static
const
QColor
blue
;
71
static
const
QColor
orange
;
73
static
const
QColor
white
;
74
76
static
const
QColor
lightRed
;
78
static
const
QColor
lightGreen
;
80
static
const
QColor
lightBlue
;
81
83
DrawingCursor
(
VisualNode
* root,
84
const
VisualNode::NodeAllocator
&
na
,
85
BestNode
* curBest0,
86
QPainter& painter0,
87
const
QRect& clippingRect0,
bool
showCopies);
88
90
91
void
moveUpwards
(
void
);
94
bool
mayMoveDownwards
(
void
);
96
void
moveDownwards
(
void
);
98
void
moveSidewards
(
void
);
100
void
processCurrentNode
(
void
);
102
};
103
104
}}
105
106
#include <
gecode/gist/drawingcursor.hpp
>
107
108
#endif
109
110
// STATISTICS: gist-any
Gecode::Gist::NodeCursor
A cursor that can be run over a tree.
Definition:
nodecursor.hh:47
Gecode::Gist::DrawingCursor::moveUpwards
void moveUpwards(void)
Move cursor to parent.
Definition:
drawingcursor.hpp:41
Gecode::Gist::VisualNode
Node class that supports visual layout
Definition:
visualnode.hh:129
Gecode::Gist::DrawingCursor::orange
static const QColor orange
The color for the best solution.
Definition:
drawingcursor.hh:71
Gecode::Gist::DrawingCursor::processCurrentNode
void processCurrentNode(void)
Draw the node.
Definition:
drawingcursor.cpp:84
Gecode::Gist::DrawingCursor::red
static const QColor red
The color for failed nodes.
Definition:
drawingcursor.hh:65
Gecode::Gist::DrawingCursor::mayMoveDownwards
bool mayMoveDownwards(void)
Test if cursor may move to child.
Definition:
drawingcursor.hpp:61
Gecode::Gist::DrawingCursor::moveSidewards
void moveSidewards(void)
Move cursor to sibling.
Definition:
drawingcursor.hpp:76
Gecode
Gecode toplevel namespace
Gecode::Gist::NodeCursor< VisualNode >::na
const VisualNode ::NodeAllocator & na
The node allocator.
Definition:
nodecursor.hh:57
Gecode::Gist::DrawingCursor
A cursor that draws a tree on a QWidget.
Definition:
drawingcursor.hh:48
drawingcursor.hpp
Gecode::Gist::NodeAllocatorBase
Node allocator.
Definition:
node.hh:52
Gecode::Gist::DrawingCursor::moveDownwards
void moveDownwards(void)
Move cursor to child.
Definition:
drawingcursor.hpp:69
Gecode::Gist::DrawingCursor::lightRed
static const QColor lightRed
The color for expanded failed nodes.
Definition:
drawingcursor.hh:76
Gecode::Gist::BestNode
Static reference to the currently best space.
Definition:
spacenode.hh:84
Gecode::Gist::DrawingCursor::lightBlue
static const QColor lightBlue
The color for expanded choice nodes.
Definition:
drawingcursor.hh:80
Gecode::Gist::DrawingCursor::blue
static const QColor blue
The color for choice nodes.
Definition:
drawingcursor.hh:69
nodecursor.hh
Gecode::Gist::DrawingCursor::DrawingCursor
DrawingCursor(VisualNode *root, const VisualNode::NodeAllocator &na, BestNode *curBest0, QPainter &painter0, const QRect &clippingRect0, bool showCopies)
Constructor.
Definition:
drawingcursor.cpp:70
layoutcursor.hh
Gecode::Gist::DrawingCursor::lightGreen
static const QColor lightGreen
The color for expanded solved nodes.
Definition:
drawingcursor.hh:78
Gecode::Gist::DrawingCursor::white
static const QColor white
White color.
Definition:
drawingcursor.hh:73
Gecode::Gist::DrawingCursor::green
static const QColor green
The color for solved nodes.
Definition:
drawingcursor.hh:67