main page
modules
namespaces
classes
files
Gecode home
Generated on Mon Sep 17 2012 22:20:33 for Gecode by
doxygen
1.8.1.1
gecode
gist
gist.cpp
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: 2011-08-25 18:43:31 +1000 (Thu, 25 Aug 2011) $ by $Author: tack $
11
* $Revision: 12352 $
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
#include <QtGui>
39
40
#include <
gecode/gist.hh
>
41
#include <
gecode/gist/textoutput.hh
>
42
#include <
gecode/gist/mainwindow.hh
>
43
#include <
gecode/gist/stopbrancher.hh
>
44
45
namespace
Gecode {
namespace
Gist {
46
47
std::string
48
Inspector::name
(
void
) {
return
"Inspector"
; }
49
50
void
51
Inspector::finalize
(
void
) {}
52
53
Inspector::~Inspector
(
void
) {}
54
55
std::string
56
Comparator::name
(
void
) {
return
"Comparator"
; }
57
58
void
59
Comparator::finalize
(
void
) {}
60
61
Comparator::~Comparator
(
void
) {}
62
63
TextOutput::TextOutput
(
const
std::string& name)
64
: t(NULL), n(name) {}
65
66
void
67
TextOutput::finalize
(
void
) {
68
delete
t;
69
t = NULL;
70
}
71
72
TextOutput::~TextOutput
(
void
) {
73
delete
t;
74
}
75
76
std::string
77
TextOutput::name
(
void
) {
return
n; }
78
79
void
80
TextOutput::init
(
void
) {
81
if
(t == NULL) {
82
t =
new
TextOutputI
(n);
83
}
84
t->setVisible(
true
);
85
}
86
87
std::ostream&
88
TextOutput::getStream
(
void
) {
89
return
t->
getStream
();
90
}
91
92
void
93
TextOutput::flush
(
void
) {
94
t->
flush
();
95
}
96
97
void
98
TextOutput::addHtml
(
const
char
* s) {
99
t->
insertHtml
(s);
100
}
101
102
const
Options
Options::def
;
103
104
int
105
explore
(
Space
* root,
bool
bab
,
const
Options
&
opt
) {
106
char
argv0=
'\0'
;
char
* argv1=&argv0;
107
int
argc=0;
108
QApplication app(argc, &argv1);
109
GistMainWindow
mw(root, bab, opt);
110
return
app.exec();
111
}
112
113
void
114
stopBranch
(
Space
& home) {
115
StopBrancher::post
(home);
116
}
117
118
}}
119
120
// STATISTICS: gist-any