Skip to content

Commit 081334f

Browse files
committed
GUI for ViewScene with Qt Creator Closes #772
1 parent 3d1ee44 commit 081334f

File tree

4 files changed

+344
-0
lines changed

4 files changed

+344
-0
lines changed

src/Interface/Modules/Render/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@
2929

3030
SET(Interface_Modules_Render_FORMS
3131
ViewScene.ui
32+
ViewSceneControls.ui
3233
)
3334

3435
SET(Interface_Modules_Render_HEADERS
3536
share.h
3637
ViewScene.h
38+
ViewSceneControlsDock.h
3739
GLWidget.h
3840
GLContext.h
3941
GLContextPlatformCompatibility.h
@@ -55,6 +57,7 @@ SET(Interface_Modules_Render_HEADERS
5557

5658
SET(Interface_Modules_Render_SOURCES
5759
ViewScene.cc
60+
ViewSceneControlsDock.cc
5861
GLWidget.cc
5962
GLContext.cc
6063
QtGLContext.cc
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>ViewSceneControls</class>
4+
<widget class="QDockWidget" name="ViewSceneControls">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>300</width>
10+
<height>350</height>
11+
</rect>
12+
</property>
13+
<property name="minimumSize">
14+
<size>
15+
<width>300</width>
16+
<height>350</height>
17+
</size>
18+
</property>
19+
<property name="windowTitle">
20+
<string>ViewScene Configuration</string>
21+
</property>
22+
<widget class="QWidget" name="dockWidgetContents">
23+
<property name="minimumSize">
24+
<size>
25+
<width>0</width>
26+
<height>0</height>
27+
</size>
28+
</property>
29+
<layout class="QGridLayout" name="gridLayout">
30+
<item row="0" column="0">
31+
<widget class="QTabWidget" name="tabWidget">
32+
<property name="currentIndex">
33+
<number>0</number>
34+
</property>
35+
<widget class="QWidget" name="tab">
36+
<attribute name="title">
37+
<string>View</string>
38+
</attribute>
39+
<widget class="QGroupBox" name="groupBox">
40+
<property name="enabled">
41+
<bool>false</bool>
42+
</property>
43+
<property name="geometry">
44+
<rect>
45+
<x>8</x>
46+
<y>10</y>
47+
<width>260</width>
48+
<height>140</height>
49+
</rect>
50+
</property>
51+
<property name="font">
52+
<font>
53+
<weight>75</weight>
54+
<bold>true</bold>
55+
</font>
56+
</property>
57+
<property name="title">
58+
<string>Auto Rotate Settings</string>
59+
</property>
60+
<widget class="QPushButton" name="rotateUpButton_">
61+
<property name="geometry">
62+
<rect>
63+
<x>88</x>
64+
<y>20</y>
65+
<width>75</width>
66+
<height>23</height>
67+
</rect>
68+
</property>
69+
<property name="toolTip">
70+
<string>Rotate Object Up</string>
71+
</property>
72+
<property name="text">
73+
<string>Up</string>
74+
</property>
75+
</widget>
76+
<widget class="QPushButton" name="rotateLeftButton_">
77+
<property name="geometry">
78+
<rect>
79+
<x>40</x>
80+
<y>50</y>
81+
<width>75</width>
82+
<height>23</height>
83+
</rect>
84+
</property>
85+
<property name="toolTip">
86+
<string>Rotate Object Left</string>
87+
</property>
88+
<property name="text">
89+
<string>Left</string>
90+
</property>
91+
</widget>
92+
<widget class="QPushButton" name="rotateRightButton_">
93+
<property name="geometry">
94+
<rect>
95+
<x>130</x>
96+
<y>50</y>
97+
<width>75</width>
98+
<height>23</height>
99+
</rect>
100+
</property>
101+
<property name="toolTip">
102+
<string>Rotate Object Right</string>
103+
</property>
104+
<property name="text">
105+
<string>Right</string>
106+
</property>
107+
</widget>
108+
<widget class="QPushButton" name="rotateDownButton_">
109+
<property name="geometry">
110+
<rect>
111+
<x>88</x>
112+
<y>80</y>
113+
<width>75</width>
114+
<height>23</height>
115+
</rect>
116+
</property>
117+
<property name="toolTip">
118+
<string>Rotate Object Down</string>
119+
</property>
120+
<property name="text">
121+
<string>Down</string>
122+
</property>
123+
</widget>
124+
<widget class="QCheckBox" name="autoRotateCheckBox_">
125+
<property name="geometry">
126+
<rect>
127+
<x>50</x>
128+
<y>110</y>
129+
<width>101</width>
130+
<height>17</height>
131+
</rect>
132+
</property>
133+
<property name="font">
134+
<font>
135+
<weight>75</weight>
136+
<bold>true</bold>
137+
</font>
138+
</property>
139+
<property name="toolTip">
140+
<string>Toggle Auto Rotate</string>
141+
</property>
142+
<property name="text">
143+
<string>Auto Rotate</string>
144+
</property>
145+
</widget>
146+
</widget>
147+
<widget class="QGroupBox" name="groupBox_2">
148+
<property name="geometry">
149+
<rect>
150+
<x>8</x>
151+
<y>160</y>
152+
<width>261</width>
153+
<height>80</height>
154+
</rect>
155+
</property>
156+
<property name="font">
157+
<font>
158+
<weight>75</weight>
159+
<bold>true</bold>
160+
</font>
161+
</property>
162+
<property name="title">
163+
<string>View Options</string>
164+
</property>
165+
<widget class="QCheckBox" name="orientationCheckBox_">
166+
<property name="geometry">
167+
<rect>
168+
<x>10</x>
169+
<y>20</y>
170+
<width>101</width>
171+
<height>17</height>
172+
</rect>
173+
</property>
174+
<property name="toolTip">
175+
<string>Toggle Orientation Axis</string>
176+
</property>
177+
<property name="text">
178+
<string>Orientation</string>
179+
</property>
180+
<property name="checked">
181+
<bool>true</bool>
182+
</property>
183+
</widget>
184+
</widget>
185+
</widget>
186+
<widget class="QWidget" name="tab_2">
187+
<attribute name="title">
188+
<string>Controls</string>
189+
</attribute>
190+
<widget class="QComboBox" name="mouseControlComboBox_">
191+
<property name="geometry">
192+
<rect>
193+
<x>10</x>
194+
<y>10</y>
195+
<width>141</width>
196+
<height>22</height>
197+
</rect>
198+
</property>
199+
<property name="currentIndex">
200+
<number>1</number>
201+
</property>
202+
<item>
203+
<property name="text">
204+
<string>Legacy Mouse Control</string>
205+
</property>
206+
</item>
207+
<item>
208+
<property name="text">
209+
<string>New Mouse Control</string>
210+
</property>
211+
</item>
212+
</widget>
213+
</widget>
214+
</widget>
215+
</item>
216+
</layout>
217+
</widget>
218+
</widget>
219+
<resources/>
220+
<connections/>
221+
</ui>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2015 Scientific Computing and Imaging Institute,
7+
University of Utah.
8+
9+
License for the specific language governing rights and limitations under
10+
Permission is hereby granted, free of charge, to any person obtaining a
11+
copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the
15+
Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
27+
*/
28+
29+
#include <Interface/Modules/Render/ViewSceneControlsDock.h>
30+
31+
using namespace SCIRun::Gui;
32+
using namespace SCIRun::Render;
33+
34+
35+
ViewSceneControlsDock::ViewSceneControlsDock(const QString& name, ViewSceneDialog* parent) : QDockWidget(parent)
36+
{
37+
setupUi(this);
38+
scene_ = parent;
39+
40+
close();
41+
setWindowTitle(name);
42+
setAllowedAreas(Qt::BottomDockWidgetArea);
43+
setFloating(true);
44+
setVisible(false);
45+
setEnabled(false);
46+
47+
scene_->menuMouseControlChanged(mouseControlComboBox_->currentIndex());
48+
49+
connect(orientationCheckBox_, SIGNAL(clicked(bool)), scene_, SLOT(showOrientationChecked(bool)));
50+
connect(mouseControlComboBox_, SIGNAL(currentIndexChanged(int)), scene_, SLOT(menuMouseControlChanged(int)));
51+
52+
}
53+
54+
ViewSceneControlsDock::~ViewSceneControlsDock()
55+
{
56+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2015 Scientific Computing and Imaging Institute,
7+
University of Utah.
8+
9+
License for the specific language governing rights and limitations under
10+
Permission is hereby granted, free of charge, to any person obtaining a
11+
copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the
15+
Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
27+
*/
28+
29+
#ifndef INTERFACE_MODULES_VIEW_SCENE_CONTROLS_H
30+
#define INTERFACE_MODULES_VIEW_SCENE_CONTROLS_H
31+
32+
#include "Interface/Modules/Render/ui_ViewSceneControls.h"
33+
34+
#include <boost/shared_ptr.hpp>
35+
36+
#include <Interface/Modules/Render/ViewScene.h>
37+
38+
//#include <Modules/Basic/SendScalarModuleState.h>
39+
//#include <Interface/Modules/Base/ModuleDialogGeneric.h>
40+
41+
#include <Interface/Modules/Render/namespaces.h>
42+
#include <Interface/Modules/Render/share.h>
43+
44+
namespace SCIRun {
45+
namespace Gui {
46+
class ViewSceneDialog;
47+
48+
class SCISHARE ViewSceneControlsDock : public QDockWidget, public Ui::ViewSceneControls
49+
{
50+
Q_OBJECT
51+
52+
public:
53+
ViewSceneControlsDock(const QString& name, ViewSceneDialog* parent);
54+
~ViewSceneControlsDock();
55+
56+
private:
57+
ViewSceneDialog* scene_;
58+
59+
};
60+
61+
}
62+
}
63+
64+
#endif //INTERFACE_MODULES_VIEW_SCENE_CONTROLS_H

0 commit comments

Comments
 (0)