qtgist.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef GECODE_GIST_QTGIST_HH
00039 #define GECODE_GIST_QTGIST_HH
00040
00041 #include <gecode/gist/treecanvas.hh>
00042 #include <gecode/gist/nodestats.hh>
00043
00044
00045
00046
00047
00048
00049 #if !defined(GIST_STATIC_LIBS) && \
00050 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
00051
00052 #ifdef GECODE_BUILD_GIST
00053 #define GECODE_GIST_EXPORT __declspec( dllexport )
00054 #else
00055 #define GECODE_GIST_EXPORT __declspec( dllimport )
00056 #endif
00057
00058 #else
00059
00060 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
00061 #define GECODE_GIST_EXPORT __attribute__ ((visibility("default")))
00062 #else
00063 #define GECODE_GIST_EXPORT
00064 #endif
00065
00066 #endif
00067
00068
00069 #ifndef GECODE_BUILD_GIST
00070 #define GECODE_LIBRARY_NAME "Gist"
00071 #include <gecode/support/auto-link.hpp>
00072 #endif
00073
00074 namespace Gecode { namespace Gist {
00075
00085 class GECODE_GIST_EXPORT Gist : public QWidget {
00086 Q_OBJECT
00087 private:
00089 TreeCanvas* canvas;
00091 QSlider* timeBar;
00093 QMenu* contextMenu;
00095 QAction* nullSolutionInspector;
00097 QMenu* solutionInspectorMenu;
00099 QAction* nullDoubleClickInspector;
00101 QMenu* doubleClickInspectorMenu;
00103 QAction* nullMoveInspector;
00105 QMenu* moveInspectorMenu;
00107 QAction* nullComparator;
00109 QMenu* comparatorMenu;
00111 QAction* nullBookmark;
00113 QMenu* bookmarksMenu;
00115 QMenu* inspectNodeMenu;
00117 QMenu* inspectNodeBeforeFPMenu;
00119 NodeStatInspector* nodeStatInspector;
00120 public:
00122 QAction* inspect;
00124 QAction* inspectBeforeFP;
00126 QAction* stop;
00128 QAction* reset;
00130 QAction* navUp;
00132 QAction* navDown;
00134 QAction* navLeft;
00136 QAction* navRight;
00138 QAction* navRoot;
00140 QAction* navNextSol;
00142 QAction* navPrevSol;
00144 QAction* searchNext;
00146 QAction* searchAll;
00148 QAction* toggleHidden;
00150 QAction* hideFailed;
00152 QAction* unhideAll;
00154 QAction* zoomToFit;
00156 QAction* center;
00158 QAction* exportPDF;
00160 QAction* exportWholeTreePDF;
00162 QAction* print;
00163
00165 QAction* bookmarkNode;
00167 QAction* compareNode;
00169 QAction* compareNodeBeforeFP;
00171 QAction* setPath;
00173 QAction* inspectPath;
00175 QAction* showNodeStats;
00177 QAction* toggleStop;
00179 QAction* unstopAll;
00180
00182 QActionGroup* solutionInspectorGroup;
00184 QActionGroup* doubleClickInspectorGroup;
00186 QActionGroup* moveInspectorGroup;
00188 QActionGroup* comparatorGroup;
00190 QActionGroup* bookmarksGroup;
00192 QActionGroup* inspectGroup;
00194 QActionGroup* inspectBeforeFPGroup;
00195 public:
00197 Gist(Space* root, bool bab, QWidget* parent, const Options& opt);
00199 ~Gist(void);
00200
00202 void addDoubleClickInspector(Inspector* i0);
00204 void addSolutionInspector(Inspector* i0);
00206 void addMoveInspector(Inspector* i0);
00208 void addComparator(Comparator* c0);
00209
00211 void setAutoHideFailed(bool b);
00213 void setAutoZoom(bool b);
00215 bool getAutoHideFailed(void);
00217 bool getAutoZoom(void);
00219 void setShowCopies(bool b);
00221 bool getShowCopies(void);
00222
00224 void setRefresh(int i);
00226 void setRefreshPause(int i);
00228 bool getSmoothScrollAndZoom(void);
00230 void setSmoothScrollAndZoom(bool b);
00231
00233 void setRecompDistances(int c_d, int a_d);
00235 int getCd(void);
00237 int getAd(void);
00238
00240 bool finish(void);
00241
00243 void resizeEvent(QResizeEvent*);
00244
00245 Q_SIGNALS:
00247 void statusChanged(const Statistics&, bool);
00248
00250 void solution(const Space*);
00251
00253 void searchFinished(void);
00254
00255 private Q_SLOTS:
00257 void on_canvas_contextMenu(QContextMenuEvent*);
00259 void on_canvas_statusChanged(VisualNode*, const Statistics&, bool);
00261 void selectDoubleClickInspector(QAction*);
00263 void selectSolutionInspector(QAction*);
00265 void selectMoveInspector(QAction*);
00267 void selectComparator(QAction*);
00269 void selectBookmark(QAction*);
00271 void addBookmark(const QString& id);
00273 void removeBookmark(int idx);
00275 void populateInspectors(void);
00277 void populateBookmarksMenu(void);
00279 void showStats(void);
00281 void inspectWithAction(QAction* a);
00283 void inspectBeforeFPWithAction(QAction* a);
00284 protected:
00286 void addInspector(Inspector* i, QAction*& nas, QAction*& nad,
00287 QAction*& nam);
00288 };
00289
00290 }}
00291
00292 #endif
00293
00294