Skip to content

Commit

Permalink
ENH: Create framework for registering VR modules
Browse files Browse the repository at this point in the history
Adds registerModule function to qMRMLVRView which can be called to create a new button for that module on the Modules bar in the VR home widget

KitwareMedical#43
  • Loading branch information
mohammadrashid0917 authored and cpinter committed Oct 28, 2019
1 parent b0fc67b commit 1d97551
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 116 deletions.
268 changes: 159 additions & 109 deletions VirtualReality/Widgets/Resources/UI/qMRMLVirtualRealityHomeWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,134 +6,184 @@
<rect>
<x>0</x>
<y>0</y>
<width>512</width>
<height>233</height>
<width>532</width>
<height>262</height>
</rect>
</property>
<property name="windowTitle">
<string>VR Home</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1">
<widget class="QPushButton" name="Magnification01xButton">
<property name="text">
<string>0.1x</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="Magnification10xButton">
<property name="text">
<string>10x</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="Magnification100xButton">
<property name="text">
<string>100x</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="Magnification1xButton">
<property name="text">
<string>1x</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="Magnification001xButton">
<property name="text">
<string>0.01x</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="LockMagnificationCheckBox">
<property name="text">
<string>Lock magnification</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" colspan="2">
<widget class="QPushButton" name="SyncViewToReferenceViewButton">
<property name="text">
<string>Sync view to reference view</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="ctkSliderWidget" name="FlySpeedSliderWidget">
<property name="decimals">
<number>1</number>
</property>
<property name="singleStep">
<double>0.500000000000000</double>
</property>
<property name="pageStep">
<double>2.000000000000000</double>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="value">
<double>1.660000000000000</double>
</property>
<property name="suffix">
<string>m/s</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="backButton">
<property name="text">
<string>Magnification:</string>
<string>Back</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Motion sensitivity:</string>
</property>
<item>
<widget class="QFrame" name="HomeWidgetFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0" colspan="2">
<widget class="QPushButton" name="SyncViewToReferenceViewButton">
<property name="text">
<string>Sync view to reference view</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Fly speed:</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="ctkSliderWidget" name="FlySpeedSliderWidget" native="true">
<property name="decimals" stdset="0">
<number>1</number>
</property>
<property name="singleStep" stdset="0">
<double>0.500000000000000</double>
</property>
<property name="pageStep" stdset="0">
<double>2.000000000000000</double>
</property>
<property name="minimum" stdset="0">
<double>0.100000000000000</double>
</property>
<property name="maximum" stdset="0">
<double>10.000000000000000</double>
</property>
<property name="value" stdset="0">
<double>1.660000000000000</double>
</property>
<property name="suffix" stdset="0">
<string>m/s</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Magnification:</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="3">
<widget class="QPushButton" name="Magnification10xButton">
<property name="text">
<string>10x</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="LockMagnificationCheckBox">
<property name="text">
<string>Lock magnification</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="Magnification001xButton">
<property name="text">
<string>0.01x</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="Magnification1xButton">
<property name="text">
<string>1x</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="Magnification01xButton">
<property name="text">
<string>0.1x</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="Magnification100xButton">
<property name="text">
<string>100x</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>13</height>
</size>
</property>
<property name="text">
<string>Motion sensitivity:</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="ctkSliderWidget" name="MotionSensitivitySliderWidget" native="true">
<property name="decimals" stdset="0">
<number>0</number>
</property>
<property name="maximum" stdset="0">
<double>100.000000000000000</double>
</property>
<property name="value" stdset="0">
<double>50.000000000000000</double>
</property>
<property name="suffix" stdset="0">
<string>%</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<widget class="ctkSliderWidget" name="MotionSensitivitySliderWidget">
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>100.000000000000000</double>
<item>
<widget class="QFrame" name="ModuleWidgetFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="value">
<double>50.000000000000000</double>
</property>
<property name="suffix">
<string>%</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Fly speed:</string>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QFormLayout" name="formLayout_3"/>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item>
<widget class="QGroupBox" name="ModulesGroupBox">
<property name="title">
<string>Modules</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QHBoxLayout" name="ModulesGroupBoxLayout"/>
</item>
</layout>
</widget>
</item>
</layout>
Expand Down
Loading

0 comments on commit 1d97551

Please sign in to comment.