itom  4.1.0
userInteractionWatcher.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef USERINTERACTIONWATCHER_H
24 #define USERINTERACTIONWATCHER_H
25 
26 #include <qobject.h>
27 
28 #include "../global.h"
29 #include "common/sharedStructuresQt.h"
30 #include "DataObject/dataobj.h"
31 #include "common/shape.h"
32 
33 #include <qpolygon.h>
34 #include <qvector.h>
35 #include <qsharedpointer.h>
36 
37 namespace ito
38 {
39 
40 class UserInteractionWatcher : public QObject
41 {
42  Q_OBJECT
43 
44 public:
45  UserInteractionWatcher(QWidget *plotWidget, ito::Shape::ShapeType type, int maxNrOfPoints, QSharedPointer<QVector<ito::Shape> > shapes, ItomSharedSemaphore *semaphore, QObject *parent = 0); //constructor
46  virtual ~UserInteractionWatcher(); //destructor
47 
48 private:
49  const QWidget *m_pPlotWidget;
50  ItomSharedSemaphore *m_pSemaphore;
51  int m_maxNrOfPoints;
52  bool m_waiting;
53  QSharedPointer<QVector<ito::Shape> > m_shapes;
54 
55 private slots:
56  void plotWidgetDestroyed(QObject *obj);
57  void userInteractionDone(int type, bool aborted, QVector<ito::Shape> shapes);
58 
59  public slots:
60 
61 
62 signals:
63  void finished();
64  void userInteractionStart(int type, bool start, int maxNrOfPoints);
65 
66 };
67 
68 } //end namespace ito
69 
70 #endif
Definition: apiFunctionsGraph.cpp:39
void userInteractionDone(int type, bool aborted, QVector< ito::Shape > shapes)
shortdesc
Definition: userInteractionWatcher.cpp:137
semaphore which can be used for asychronous thread communication. By using this class it is possible ...
Definition: sharedStructuresQt.h:57
void plotWidgetDestroyed(QObject *obj)
shortdesc
Definition: userInteractionWatcher.cpp:110
ShapeType
Definition: shape.h:59
Definition: userInteractionWatcher.h:40