LiveFit
Track and plot projectiles for in-class demonstration
LiveFitWindow.hpp
1 /*
2  * LiveFit
3  * Copyright (C) 2016 The University of Georgia
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef LIVEFITWINDOW_HPP
21 #define LIVEFITWINDOW_HPP
22 
23 #include "FrameConverter.hpp"
24 #include "TrackingStream.hpp"
25 
26 #include <QSize>
27 #include <QMainWindow>
28 #include <QThread>
29 
30 #include <ui_LiveFitWindow.h>
31 
35 class LiveFitWindow : public QMainWindow {
36  Q_OBJECT
37 private:
39  QSize mVideoSize;
40 
41  /* TODO: I'm not actually sure if any of these are called */
42  void createMenus();
43  void chooseVideoFile();
44  void setupUi();
45  void displayVideoStream();
46  /* ~~~~ */
47 
52  void setupCamera();
53 
57 
61  void populateCameraMenu();
62 public:
64  explicit LiveFitWindow(QWidget* parent = 0);
66  LiveFitWindow(char* videoFile);
68  LiveFitWindow(int cameraId);
69 
70 public slots:
72  void startStream(char *videoFile);
74  void startStream(int cameraId);
75 
77  void startCamera0();
79  void startCamera1();
81  void startCamera2();
82 
84  void sendCameraAction(QAction *);
85 
86 protected:
88  void writeSettings();
90  void readSettings();
91 
94  void closeEvent(QCloseEvent* ev);
95 private slots:
96 
101 
102  void on_actionFind_Projector_Window_triggered();
103 
104 private:
106  Ui::liveFitWindow ui;
107 
114 
116  QThread mStreamThread;
119 
120 };
121 
122 #endif // LIVEFITWINDOW_HPP
void on_action_Open_triggered()
Called when the Open action is triggered (ie file>open)
Definition: LiveFitWindow.cpp:360
void startCamera0()
Equivalent to startStream(0)
Definition: LiveFitWindow.cpp:193
void populateCameraMenu()
Populate the file>camera menu.
Definition: LiveFitWindow.cpp:136
void readSettings()
Read in this application&#39;s QSettings.
Definition: LiveFitWindow.cpp:270
void setupCamera()
Set up the video stream and the converter, as well as requisite signals.
Definition: LiveFitWindow.cpp:28
FrameConverter mFrameConverter
The FrameConverter which takes incoming frames from the stream and converts them into QImages to be s...
Definition: LiveFitWindow.hpp:113
void on_pauseButton_clicked()
Called when the pauseButton is clicked.
Definition: LiveFitWindow.cpp:355
void writeSettings()
Write this application&#39;s QSettings.
Definition: LiveFitWindow.cpp:220
QSize mVideoSize
Pixel size of the video stream.
Definition: LiveFitWindow.hpp:39
The window which manages all logic for the LiveFit application.
Definition: LiveFitWindow.hpp:35
void startStream(char *videoFile)
Start a new stream with video from videoFile.
Definition: LiveFitWindow.cpp:181
void closeEvent(QCloseEvent *ev)
Called when this window is closed; destruct all necessary objects and close streams, etc cleanly.
Definition: LiveFitWindow.cpp:342
TrackingStream mTrackingStream
The TrackingStream object which manages the current video stream and tracking.
Definition: LiveFitWindow.hpp:110
Ui::liveFitWindow ui
This window&#39;s QDesigner ui, LiveFitWindow.ui.
Definition: LiveFitWindow.hpp:106
LiveFitWindow(QWidget *parent=0)
Default constructor; default to webcam 0.
Definition: LiveFitWindow.cpp:159
QThread mStreamThread
A QThread for the video stream.
Definition: LiveFitWindow.hpp:116
void setupSignalConnections()
Set up the ProjectorWindow which displays information to the class.
Definition: LiveFitWindow.cpp:48
void sendCameraAction(QAction *)
Handle a camera-related QAction, like those in file>camera.
Definition: LiveFitWindow.cpp:206
An object which owns some sort of input video stream, manages running it (and any tracking...
Definition: TrackingStream.hpp:47
void startCamera2()
Equivalent to startStream(2)
Definition: LiveFitWindow.cpp:201
QThread mConverterThread
A QThread for the video converter.
Definition: LiveFitWindow.hpp:118
void startCamera1()
Equivalent to startStream(1)
Definition: LiveFitWindow.cpp:197
Recieves frames (as cv::Mat), processes them (ideally asynchronously) and emits them as a QImage (i...
Definition: FrameConverter.hpp:35