diff --git a/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.cpp b/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.cpp index 257b3fe1bc..4d382ebc84 100644 --- a/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.cpp +++ b/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.cpp @@ -1,94 +1,95 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkVirtualTrackerWidget.h" #include "mitkVirtualTrackingDevice.h" const std::string QmitkVirtualTrackerWidget::VIEW_ID = "org.mitk.views.VirtualTrackerWidget"; QmitkVirtualTrackerWidget::QmitkVirtualTrackerWidget(QWidget* parent, Qt::WindowFlags f) : QmitkAbstractTrackingDeviceWidget(parent, f) , m_Controls(nullptr) { } void QmitkVirtualTrackerWidget::Initialize() { InitializeSuperclassWidget(); CreateQtPartControl(this); CreateConnections(); } QmitkVirtualTrackerWidget::~QmitkVirtualTrackerWidget() { delete m_Controls; } void QmitkVirtualTrackerWidget::CreateQtPartControl(QWidget *parent) { if (!m_Controls) { // create GUI widgets m_Controls = new Ui::QmitkVirtualTrackerWidget; m_Controls->setupUi(parent); } } void QmitkVirtualTrackerWidget::CreateConnections() { if (m_Controls) { connect((QObject*)(m_Controls->m_EnableGaussianNoise), SIGNAL(clicked()), this, SLOT(EnableGaussianNoise())); } } mitk::TrackingDevice::Pointer QmitkVirtualTrackerWidget::GetTrackingDevice() { // Create the Virtual Tracking Device mitk::VirtualTrackingDevice::Pointer returnValue = mitk::VirtualTrackingDevice::New(); if (m_Controls->m_EnableGaussianNoise->isChecked()) { returnValue->EnableGaussianNoise(); returnValue->SetParamsForGaussianNoise(m_Controls->m_MeanDistributionParam->value(), m_Controls->m_DeviationDistributionParam->value()); } + returnValue->SetRefreshRate(m_Controls->m_refreshRate->value()); return static_cast<mitk::TrackingDevice::Pointer>(returnValue); //static_cast necessary for compiling with Linux } void QmitkVirtualTrackerWidget::EnableGaussianNoise() { if (m_Controls->m_EnableGaussianNoise->isChecked()) { m_Controls->m_MeanDistributionParam->setEnabled(true); m_Controls->m_DeviationDistributionParam->setEnabled(true); } else { m_Controls->m_MeanDistributionParam->setEnabled(false); m_Controls->m_DeviationDistributionParam->setEnabled(false); } } QmitkVirtualTrackerWidget* QmitkVirtualTrackerWidget::Clone(QWidget* parent) const { QmitkVirtualTrackerWidget* clonedWidget = new QmitkVirtualTrackerWidget(parent); clonedWidget->Initialize(); clonedWidget->m_Controls->m_EnableGaussianNoise->setEnabled(m_Controls->m_EnableGaussianNoise->isEnabled()); clonedWidget->m_Controls->m_MeanDistributionParam->setValue(m_Controls->m_MeanDistributionParam->value()); clonedWidget->m_Controls->m_DeviationDistributionParam->setValue(m_Controls->m_DeviationDistributionParam->value()); return clonedWidget; } diff --git a/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.ui b/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.ui index df33c99c8d..2e4dd1d6d7 100644 --- a/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.ui +++ b/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.ui @@ -1,121 +1,155 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>QmitkVirtualTrackerWidget</class> <widget class="QWidget" name="QmitkVirtualTrackerWidget"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>294</width> - <height>143</height> + <height>184</height> </rect> </property> - <layout class="QVBoxLayout" name="verticalLayout_22"> + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> <widget class="QLabel" name="Optitrack_label_2"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Virtual Tracker</span></p></body></html></string> </property> </widget> </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Update Rate / Speed [ms]</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QSpinBox" name="m_refreshRate"> + <property name="maximum"> + <number>999</number> + </property> + <property name="value"> + <number>100</number> + </property> + </widget> + </item> + </layout> + </item> <item> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QCheckBox" name="m_EnableGaussianNoise"> <property name="text"> <string>Simulate Jitter</string> </property> </widget> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_20"> <item> <widget class="QLabel" name="label_3"> <property name="text"> <string>Mean Distribution Parameter</string> </property> </widget> </item> <item> <spacer name="horizontalSpacer_14"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> <item> <widget class="QDoubleSpinBox" name="m_MeanDistributionParam"> <property name="enabled"> <bool>false</bool> </property> </widget> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_21"> <item> <widget class="QLabel" name="label_4"> <property name="text"> <string>Deviation Distribution Parameter</string> </property> </widget> </item> <item> <spacer name="horizontalSpacer_15"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> <item> <widget class="QDoubleSpinBox" name="m_DeviationDistributionParam"> <property name="enabled"> <bool>false</bool> </property> </widget> </item> </layout> </item> <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </item> </layout> </item> </layout> </widget> <resources/> <connections/> </ui>