ImGraph
 All Classes Functions Variables Enumerations Pages
GuiReceiver.h
1 //IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
2 
3 // By downloading, copying, installing or using the software you agree to this license.
4 // If you do not agree to this license, do not download, install,
5 // copy or use the software.
6 
7 
8 // License Agreement
9 // For Open Source Computer Vision Library
10 
11 //Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
12 //Copyright (C) 2008-2010, Willow Garage Inc., all rights reserved.
13 //Third party copyrights are property of their respective owners.
14 
15 //Redistribution and use in source and binary forms, with or without modification,
16 //are permitted provided that the following conditions are met:
17 
18 // * Redistribution's of source code must retain the above copyright notice,
19 // this list of conditions and the following disclaimer.
20 
21 // * Redistribution's in binary form must reproduce the above copyright notice,
22 // this list of conditions and the following disclaimer in the documentation
23 // and/or other materials provided with the distribution.
24 
25 // * The name of the copyright holders may not be used to endorse or promote products
26 // derived from this software without specific prior written permission.
27 
28 //This software is provided by the copyright holders and contributors "as is" and
29 //any express or implied warranties, including, but not limited to, the implied
30 //warranties of merchantability and fitness for a particular purpose are disclaimed.
31 //In no event shall the Intel Corporation or contributors be liable for any direct,
32 //indirect, incidental, special, exemplary, or consequential damages
33 //(including, but not limited to, procurement of substitute goods or services;
34 //loss of use, data, or profits; or business interruption) however caused
35 //and on any theory of liability, whether in contract, strict liability,
36 //or tort (including negligence or otherwise) arising in any way out of
37 //the use of this software, even if advised of the possibility of such damage.
38 
39 //--------------------Google Code 2010 -- Yannick Verdie--------------------//
40 #ifndef __GUI_RECEIVER_QT_H__
41 #define __GUI_RECEIVER_QT_H__
42 
43 #ifdef _WIN32
44 #pragma warning(disable:4503)
45 #pragma warning(push)
46 #pragma warning(disable:4996 4244 4251 4275 4800)
47 #endif
48 #include "opencv2/core/utility.hpp"
49 #include "opencv2/highgui/highgui_c.h"
50 #include "opencv2/imgproc.hpp"
51 
52 #include <QAbstractEventDispatcher>
53 #include <QApplication>
54 #include <QFile>
55 #include <QPushButton>
56 #include <QGraphicsView>
57 #include <QSizePolicy>
58 #include <QInputDialog>
59 #include <QBoxLayout>
60 #include <QSettings>
61 #include <qtimer.h>
62 #include <QtConcurrent/QtConcurrentRun>
63 #include <QWaitCondition>
64 #include <QKeyEvent>
65 #include <QMetaObject>
66 #include <QPointer>
67 #include <QSlider>
68 #include <QLabel>
69 #include <QIODevice>
70 #include <QShortcut>
71 #include <QStatusBar>
72 #include <QVarLengthArray>
73 #include <QFileInfo>
74 #include <QDate>
75 #include <QFileDialog>
76 #include <QToolBar>
77 #include <QAction>
78 #include <QPushButton>
79 #include <QCheckBox>
80 #include <QRadioButton>
81 #include <QButtonGroup>
82 #include <QMenu>
83 #include <QDialog>
84 
85 #include <boost/thread/mutex.hpp>
86 #include <boost/thread/recursive_mutex.hpp>
87 #include <boost/thread/condition_variable.hpp>
88 #ifdef _WIN32
89 #pragma warning(pop)
90 #endif
91 
92 class MatrixViewer;
93 class GraphViewer;
94 
95 void imshow(cv::String name, cv::Mat im);
96 MatrixViewer* createWindow(cv::String name, int params = 0);
97 GraphViewer* createGraphView(cv::String name);
98 
99 class GuiReceiver : public QObject
100 {
101  Q_OBJECT;
102 
103  GuiReceiver();
104 public:
105  static GuiReceiver* getInstance();
106  bool bTimeOut;
107  QTimer* timer;
108 
109  public slots:
110  void createWindow(QString name, int flags = 0);
111  void createGraph(QString name);
112  void destroyWindow(QString name);
113  void moveWindow(QString name, int x, int y);
114  void resizeWindow(QString name, int width, int height);
115  void showImage(QString name, cv::Mat arr);
116  void displayInfo(QString name, QString text, int delayms);
117  void timeOut();
118  void toggleFullScreen(QString name, double flags);
119  double isFullScreen(QString name);
120  double getPropWindow(QString name);
121  void setPropWindow(QString name, double flags);
122  void saveWindowParameters(QString name);
123  void loadWindowParameters(QString name);
124  void enablePropertiesButtonEachWindow();
125 
126 private:
127  static GuiReceiver* guiMainThread;
128  int nb_windows;
129  bool doesExternalQAppExist;
130 };
131 
132 #endif
Definition: GuiReceiver.h:99
Definition: MatrixViewer.h:162
Definition: GraphViewer.h:67