-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimpleView.h
164 lines (124 loc) · 3.99 KB
/
SimpleView.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#ifndef SimpleViewUI_H
#define SimpleViewUI_H
#define SIMPLEVIEW_NUM_ACTORS 4
#include <quat.h>
#include <vtkSmartPointer.h>
class vtkRenderer;
#include <QMainWindow>
class QTimer;
class QThread;
class QActionGroup;
#include <QString>
class SketchObject;
namespace SketchBio {
class Project;
class InputManager;
}
class ProjectToXML;
class vrpnServer;
class SubprocessRunner;
// Forward Qt class declaration (the view)
class Ui_SimpleView;
/*
* SimpleView is the main GUI class in the SketchBio project. It also manages
* the vrpn input to the program.
*/
class SimpleView : public QMainWindow
{
Q_OBJECT
public:
// Constructor/Destructor
SimpleView(QString projDir, bool load_example = false, const QString &deviceFile = "devices/razer_hydra.xml");
virtual ~SimpleView();
// Simplify an external object based on the root file name.
void simplifyObjectByName(const QString name);
public slots:
// Throw a dialog box to browse for an OBJ file to load
void openOBJFile();
// Throw a dialog box to type in the name of a PDB ID to import
// and the chains to remove
// Run an external Chimera script to download and surface the model
// Put the resulting model in the project directory.
void importPDBId();
// Use a file dialog to select a local PDB file to open and import
// Also gives a dialog for the chains to remove
// as a model. Runs an external Chimera script to surface the model
// and puts the result in the project folder
void openPDBFile();
// Use a file dialog to select a local VTK file to open. The file
// is assumed to be one of the VTK files generated by a previous SketchBio
// project and if filenames matching other VTK files that SketchBio would
// have generated with it are found, they are included in the resulting model.
// Filenames tested are:
// X.vtk
// X_isosurface.vtk
// X.decimated.5000.vtk
// X.decimated.2000.vtk
// X.decimated.1000.vtk
void openVTKFile();
// Export an animation to blender
// currently writes the test file so I can see if it is correct
void exportBlenderAnimation();
// Export current state as a Florosim simulation
void exportFlorosim();
// Throw a dialog box to browse for an OBJ file to
// simplify. Produce multiple simplifications, with smaller
// fractional polygon counts.
void simplifyOBJFile();
// Restarts the internal vrpn server if there is one.
void restartVRPNServer();
// Save the current project
void saveProjectAs();
void saveProject();
// Save a grouped object from clipboard, so it can be
// loaded into any other project
void saveCopiedObject();
// Load object that was saved with saveCopiedObject()
void loadObject();
// Add new ellipsoid to the project
void createEllipsoid();
// Add a measuring tape
void createMeasuringTape();
// Add a helical guide to the project
void createHelix();
// Collision modes (for testing)
void oldCollisionMode();
void poseModeTry1();
void binaryCollisionSearch();
void poseModePCA();
// Physics settings
void setWorldSpringsEnabled(bool enabled);
void setCollisionTestsOn(bool on);
// Full res display settings
void setFullResForGrabbed(bool on);
void setFullResForNearby(bool on);
// Luminance settings
void setLuminanceBounds();
// Load a project
void loadProject();
virtual void closeEvent(QCloseEvent *);
virtual void slotExit();
void slot_frameLoop();
void goToViewTime();
void createCameraForViewpoint();
void setCameraToViewpoint();
protected:
protected slots:
void addUndoStateIfSuccess(bool success);
private slots:
void updateStatusText();
private:
// Methods
void runSubprocessAndFreezeGUI(SubprocessRunner *runner,
bool needsUndoState = false);
class GUIStateHelper;
// Fields
Ui_SimpleView *ui;
QTimer *timer;
QActionGroup *collisionModeGroup;
vtkSmartPointer<vtkRenderer> renderer;
SketchBio::Project *project;
SketchBio::InputManager *inputManager;
GUIStateHelper *stateHelper;
};
#endif // SimpleViewUI_H