-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.h
145 lines (114 loc) · 2.97 KB
/
window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QMap>
#include <QString>
#include <QDateTime>
#include <boost/smart_ptr.hpp>
// Other parts of the interface
#include "preferences.h"
#include "aboutdialog.h"
// For reading OMF files
#include "OMFContainer.h"
#include "OMFHeader.h"
#include <deque>
typedef boost::shared_ptr<OMFHeader> header_ptr;
// Forward Definitions
class QSlider;
//class GLWidget;
class QxtSpanSlider;
class QSignalMapper;
//class QGroupBox;
// Main Window Stuff
//class QAction;
class QActionGroup;
//class QLabel;
//class QMenu;
// Other
class QFileSystemWatcher;
namespace Ui {
class Window;
}
class Window : public QMainWindow
{
Q_OBJECT
public:
explicit Window(int argc, char *argv[]);
~Window();
protected:
void keyPressEvent(QKeyEvent *event);
//void contextMenuEvent(QContextMenuEvent *event);
private slots:
void openFiles();
void openDir();
void watchDir(const QString& str);
void toggleDisplay();
void updateWatchedFiles(const QString& str);
void openSettings();
void openAbout();
void updateDisplayData(int index);
void updatePrefs();
private:
// Main Window Stuff
Ui::Window *ui;
// void createActions();
// void createMenus();
void adjustAnimSlider(bool back);
// QMenu *fileMenu;
// QMenu *settingsMenu;
// QMenu *helpMenu;
// QAction *openFilesAct;
// QAction *openDirAct;
// QAction *attachToMumax;
// QAction *settingsAct;
// QAction *aboutAct;
// QAction *watchDirAct;
QActionGroup *displayType;
// QAction *conesAct;
// QAction *cubesAct;
// QAction *vectorsAct;
// QAction *scaleByMagnitude;
//QAction *webAct;
// Preferences window;
Preferences *prefs;
AboutDialog *about;
// Convenience Functions for Sliders
void initSlider(QSlider *slider);
void initSpanSlider(QxtSpanSlider *slider);
// QGroupBox *sliceGroupBox;
// QGroupBox *rotGroupBox;
// GLWidget *glWidget;
// QSlider *xSlider;
// QSlider *ySlider;
// QSlider *zSlider;
// QSlider *animSlider;
// QLabel *animLabel;
// QxtSpanSlider *xSpanSlider;
// QxtSpanSlider *ySpanSlider;
// QxtSpanSlider *zSpanSlider;
// ============================================================
// Storage and caching
// A finite number of files, as governed by cacheSize, will
// reside in memory at a given time, otherwise we will choke
// the system on large output directories.
// ============================================================
int cacheSize; // Maxmimum cache size
int cachePos; // Current location w.r.t list of all filenames
void clearOMFCache();
void clearHeaderCache();
void gotoBackOfCache();
void gotoFrontOfCache();
void processFilenames();
std::deque<array_ptr> omfCache;
std::deque<header_ptr> omfHeaderCache;
QStringList filenames;
QStringList displayNames;
QString dirString;
// Watch dirs
QSignalMapper* signalMapper;
QFileSystemWatcher *watcher;
QMap<QString, QDateTime> watchedFiles;
bool noFollowUpdate;
};
#endif