Skip to content

Commit 8efe8b0

Browse files
committed
Camera locks and dev controls
1 parent cf1c027 commit 8efe8b0

9 files changed

+196
-135
lines changed

LICENSE.md

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2222
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2323
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2424
DEALINGS IN THE SOFTWARE.
25+
26+
<div>Icons made by <a href="https://www.flaticon.com/authors/dinosoftlabs" title="DinosoftLabs">DinosoftLabs</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>

src/Interface/Modules/Render/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ SET(Interface_Modules_Render_FORMS
4646
ScaleBar.ui
4747
ClippingPlanes.ui
4848
InputControls.ui
49+
CameraLocks.ui
50+
DevControls.ui
4951
)
5052

5153
SET(Interface_Modules_Render_HEADERS_TO_MOC
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>CameraLocks</class>
4+
<widget class="QWidget" name="CameraLocks">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>237</height>
11+
</rect>
12+
</property>
13+
<property name="minimumSize">
14+
<size>
15+
<width>400</width>
16+
<height>237</height>
17+
</size>
18+
</property>
19+
<property name="windowTitle">
20+
<string>Camera Locks</string>
21+
</property>
22+
<layout class="QVBoxLayout" name="verticalLayout">
23+
<item>
24+
<layout class="QHBoxLayout" name="horizontalLayout_3">
25+
<item>
26+
<widget class="QPushButton" name="addGroup_">
27+
<property name="text">
28+
<string>Add Group</string>
29+
</property>
30+
</widget>
31+
</item>
32+
<item>
33+
<widget class="QPushButton" name="removeGroup_">
34+
<property name="text">
35+
<string>Remove Group Number:</string>
36+
</property>
37+
</widget>
38+
</item>
39+
<item>
40+
<widget class="QSpinBox" name="groupRemoveSpinBox_"/>
41+
</item>
42+
</layout>
43+
</item>
44+
<item>
45+
<widget class="QTreeWidget" name="viewSceneTreeWidget_">
46+
<property name="columnCount">
47+
<number>1</number>
48+
</property>
49+
<column>
50+
<property name="text">
51+
<string>Groups</string>
52+
</property>
53+
</column>
54+
</widget>
55+
</item>
56+
</layout>
57+
</widget>
58+
<resources/>
59+
<connections/>
60+
</ui>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Developer</class>
4+
<widget class="QWidget" name="Developer">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>162</width>
10+
<height>78</height>
11+
</rect>
12+
</property>
13+
<property name="minimumSize">
14+
<size>
15+
<width>162</width>
16+
<height>78</height>
17+
</size>
18+
</property>
19+
<property name="windowTitle">
20+
<string>Developer</string>
21+
</property>
22+
<layout class="QVBoxLayout" name="verticalLayout">
23+
<item>
24+
<widget class="QPushButton" name="toStringButton_">
25+
<property name="sizePolicy">
26+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
27+
<horstretch>0</horstretch>
28+
<verstretch>0</verstretch>
29+
</sizepolicy>
30+
</property>
31+
<property name="minimumSize">
32+
<size>
33+
<width>150</width>
34+
<height>0</height>
35+
</size>
36+
</property>
37+
<property name="styleSheet">
38+
<string notr="true"/>
39+
</property>
40+
<property name="text">
41+
<string>Dump Core</string>
42+
</property>
43+
</widget>
44+
</item>
45+
<item>
46+
<widget class="QPushButton" name="bugReportButton_">
47+
<property name="text">
48+
<string>Send Bug Report</string>
49+
</property>
50+
</widget>
51+
</item>
52+
</layout>
53+
</widget>
54+
<resources/>
55+
<connections/>
56+
</ui>

src/Interface/Modules/Render/ViewScene.cc

+25
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ namespace Gui {
173173
ScaleBarControls* scaleBarControls_{nullptr};
174174
ClippingPlaneControls* clippingPlaneControls_{nullptr};
175175
InputControls* inputControls_{nullptr};
176+
CameraLockControls* cameraLockControls_{nullptr};
177+
DeveloperControls* developerControls_{nullptr};
178+
176179
SharedPointer<ScopedWidgetColorChanger> widgetColorChanger_ {};
177180
Render::PreviousWidgetSelectionInfo previousWidgetInfo_;
178181

@@ -620,6 +623,18 @@ void ViewSceneDialog::addScaleBarButton()
620623
impl_->scaleBarControls_->setScaleBarValues(impl_->scaleBar_);
621624
}
622625

626+
void ViewSceneDialog::addCameraLocksButton()
627+
{
628+
auto* cameraLocksButton = new QPushButton();
629+
//colorOptionsButton->setToolTip("Color settings");
630+
//cameraLocksButton->setIcon(QPixmap(":/general/Resources/ViewScene/scaleBar.png"));
631+
impl_->cameraLockControls_ = new CameraLockControls(this);
632+
fixSize(impl_->cameraLockControls_);
633+
addToolbarButton(cameraLocksButton, 2, impl_->cameraLockControls_);
634+
635+
//impl_->cameraLockControls_->setScaleBarValues(impl_->scaleBar_);
636+
}
637+
623638
void ViewSceneDialog::addToolbarButton(QWidget* widget, int which, QWidget* widgetToPopup)
624639
{
625640
static const auto buttonSize = 30;
@@ -895,6 +910,16 @@ void ViewSceneDialog::addInputControlButton()
895910
addToolbarButton(inputControlButton, 2, impl_->inputControls_);
896911
}
897912

913+
void ViewSceneDialog::addDeveloperControlButton()
914+
{
915+
auto* devControlButton = new QPushButton();
916+
//colorOptionsButton->setToolTip("Color settings");
917+
//inputControlButton->setIcon(QPixmap(":/general/Resources/ViewScene/input.png"));
918+
//connect(configurationButton, SIGNAL(clicked(bool)), this, SLOT(configurationButtonClicked()));
919+
impl_->developerControls_ = new DeveloperControls(this);
920+
addToolbarButton(devControlButton, 2, impl_->developerControls_);
921+
}
922+
898923
void ViewSceneDialog::pullCameraState()
899924
{
900925
pullCameraDistance();

src/Interface/Modules/Render/ViewScene.h

+2
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ namespace SCIRun {
249249
void addScaleBarButton();
250250
void addClippingPlaneButton();
251251
void addInputControlButton();
252+
void addCameraLocksButton();
253+
void addDeveloperControlButton();
252254
void addToolbarButton(QWidget* w, int which, QWidget* widgetToPopup = nullptr);
253255
void addViewBar();
254256
void addViewOptions();

src/Interface/Modules/Render/ViewSceneControls.ui

-115
Original file line numberDiff line numberDiff line change
@@ -41,46 +41,6 @@
4141
<property name="currentIndex">
4242
<number>0</number>
4343
</property>
44-
<widget class="QWidget" name="CameraLocks">
45-
<attribute name="title">
46-
<string>Camera Locks</string>
47-
</attribute>
48-
<layout class="QGridLayout" name="gridLayout_9">
49-
<item row="7" column="0">
50-
<widget class="QTreeWidget" name="viewSceneTreeWidget_">
51-
<property name="columnCount">
52-
<number>1</number>
53-
</property>
54-
<column>
55-
<property name="text">
56-
<string>Groups</string>
57-
</property>
58-
</column>
59-
</widget>
60-
</item>
61-
<item row="1" column="0">
62-
<layout class="QHBoxLayout" name="horizontalLayout_3">
63-
<item>
64-
<widget class="QPushButton" name="addGroup_">
65-
<property name="text">
66-
<string>Add Group</string>
67-
</property>
68-
</widget>
69-
</item>
70-
<item>
71-
<widget class="QPushButton" name="removeGroup_">
72-
<property name="text">
73-
<string>Remove Group Number:</string>
74-
</property>
75-
</widget>
76-
</item>
77-
<item>
78-
<widget class="QSpinBox" name="groupRemoveSpinBox_"/>
79-
</item>
80-
</layout>
81-
</item>
82-
</layout>
83-
</widget>
8444
<widget class="QWidget" name="LightsTab">
8545
<attribute name="title">
8646
<string>Lights</string>
@@ -428,81 +388,6 @@
428388
</item>
429389
</layout>
430390
</widget>
431-
<widget class="QWidget" name="DeveloperTab">
432-
<attribute name="title">
433-
<string>Developer</string>
434-
</attribute>
435-
<layout class="QGridLayout" name="gridLayout_8">
436-
<item row="0" column="0">
437-
<spacer name="horizontalSpacer_17">
438-
<property name="orientation">
439-
<enum>Qt::Horizontal</enum>
440-
</property>
441-
<property name="sizeHint" stdset="0">
442-
<size>
443-
<width>40</width>
444-
<height>20</height>
445-
</size>
446-
</property>
447-
</spacer>
448-
</item>
449-
<item row="0" column="1">
450-
<widget class="QPushButton" name="toStringButton_">
451-
<property name="sizePolicy">
452-
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
453-
<horstretch>0</horstretch>
454-
<verstretch>0</verstretch>
455-
</sizepolicy>
456-
</property>
457-
<property name="minimumSize">
458-
<size>
459-
<width>150</width>
460-
<height>0</height>
461-
</size>
462-
</property>
463-
<property name="styleSheet">
464-
<string notr="true"/>
465-
</property>
466-
<property name="text">
467-
<string>Dump Core</string>
468-
</property>
469-
</widget>
470-
</item>
471-
<item row="2" column="1">
472-
<spacer name="verticalSpacer_2">
473-
<property name="orientation">
474-
<enum>Qt::Vertical</enum>
475-
</property>
476-
<property name="sizeHint" stdset="0">
477-
<size>
478-
<width>20</width>
479-
<height>40</height>
480-
</size>
481-
</property>
482-
</spacer>
483-
</item>
484-
<item row="0" column="2">
485-
<spacer name="horizontalSpacer_18">
486-
<property name="orientation">
487-
<enum>Qt::Horizontal</enum>
488-
</property>
489-
<property name="sizeHint" stdset="0">
490-
<size>
491-
<width>40</width>
492-
<height>20</height>
493-
</size>
494-
</property>
495-
</spacer>
496-
</item>
497-
<item row="1" column="1">
498-
<widget class="QPushButton" name="bugReportButton_">
499-
<property name="text">
500-
<string>Send Bug Report</string>
501-
</property>
502-
</widget>
503-
</item>
504-
</layout>
505-
</widget>
506391
</widget>
507392
</item>
508393
</layout>

src/Interface/Modules/Render/ViewSceneControlsDock.cc

+24-15
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,6 @@ ViewSceneControlsDock::ViewSceneControlsDock(const QString& name, ViewSceneDialo
5858
setStyleSheet(parent->styleSheet());
5959

6060

61-
//----------- Developer Tab--------------//
62-
connect(toStringButton_, SIGNAL(clicked()), parent, SLOT(printToString()));
63-
connect(bugReportButton_, SIGNAL(clicked()), parent, SLOT(sendBugReport()));
64-
65-
66-
connect(addGroup_, SIGNAL(clicked()), this, SLOT(addGroup()));
67-
connect(removeGroup_, SIGNAL(clicked()), this, SLOT(removeGroup()));
68-
connect(viewSceneTreeWidget_, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(viewSceneTreeClicked(QTreeWidgetItem*, int)));
69-
connect(&ViewSceneDialog::viewSceneManager, SIGNAL(groupsUpdatedSignal()), this, SLOT(updateViewSceneTree()));
70-
updateViewSceneTree();
71-
groupRemoveSpinBox_->setRange(0, 0);
7261

7362
//-----------Lights Tab-----------------//
7463
connect(headlightCheckBox_, SIGNAL(clicked(bool)), parent, SLOT(toggleHeadLight(bool)));
@@ -107,7 +96,7 @@ static bool vsdPairComp(std::pair<ViewSceneDialog*, bool> a, std::pair<ViewScene
10796
return std::get<0>(a)->getName() < std::get<0>(b)->getName();
10897
}
10998

110-
void ViewSceneControlsDock::updateViewSceneTree()
99+
void CameraLockControls::updateViewSceneTree()
111100
{
112101
viewSceneTreeWidget_->clear();
113102

@@ -140,20 +129,20 @@ void ViewSceneControlsDock::updateViewSceneTree()
140129
viewSceneTreeWidget_->expandAll();
141130
}
142131

143-
void ViewSceneControlsDock::addGroup()
132+
void CameraLockControls::addGroup()
144133
{
145134
ViewSceneDialog::viewSceneManager.addGroup();
146135
groupRemoveSpinBox_->setRange(0, ViewSceneDialog::viewSceneManager.getGroupCount() - 1);
147136
}
148137

149-
void ViewSceneControlsDock::removeGroup()
138+
void CameraLockControls::removeGroup()
150139
{
151140
const uint32_t group = groupRemoveSpinBox_->value();
152141
ViewSceneDialog::viewSceneManager.removeGroup(group);
153142
groupRemoveSpinBox_->setRange(0, ViewSceneDialog::viewSceneManager.getGroupCount() - 1);
154143
}
155144

156-
void ViewSceneControlsDock::viewSceneTreeClicked(QTreeWidgetItem* widgetItem, int column)
145+
void CameraLockControls::viewSceneTreeClicked(QTreeWidgetItem* widgetItem, int column)
157146
{
158147
auto p = widgetItem->parent();
159148
if (!p) return;
@@ -705,3 +694,23 @@ InputControls::InputControls(ViewSceneDialog* parent) : QWidget(parent)
705694
connect(invertZoomCheckBox_, SIGNAL(clicked(bool)), parent, SLOT(invertZoomClicked(bool)));
706695
connect(zoomSpeedHorizontalSlider_, SIGNAL(valueChanged(int)), parent, SLOT(adjustZoomSpeed(int)));
707696
}
697+
698+
CameraLockControls::CameraLockControls(ViewSceneDialog* parent) : QWidget(parent)
699+
{
700+
setupUi(this);
701+
702+
connect(addGroup_, SIGNAL(clicked()), this, SLOT(addGroup()));
703+
connect(removeGroup_, SIGNAL(clicked()), this, SLOT(removeGroup()));
704+
connect(viewSceneTreeWidget_, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(viewSceneTreeClicked(QTreeWidgetItem*, int)));
705+
connect(&ViewSceneDialog::viewSceneManager, SIGNAL(groupsUpdatedSignal()), this, SLOT(updateViewSceneTree()));
706+
updateViewSceneTree();
707+
groupRemoveSpinBox_->setRange(0, 0);
708+
}
709+
710+
DeveloperControls::DeveloperControls(ViewSceneDialog* parent) : QWidget(parent)
711+
{
712+
setupUi(this);
713+
714+
connect(toStringButton_, SIGNAL(clicked()), parent, SLOT(printToString()));
715+
connect(bugReportButton_, SIGNAL(clicked()), parent, SLOT(sendBugReport()));
716+
}

0 commit comments

Comments
 (0)