QmitkUSNavigationStepZoneMarking::QmitkUSNavigationStepZoneMarking(QWidget *parent) : QmitkUSAbstractNavigationStep(parent), m_ZoneDisplacementFilter(mitk::NodeDisplacementFilter::New()), m_ReferenceSensorIndex(1), m_CurrentlyAddingZone(false), ui(new Ui::QmitkUSNavigationStepZoneMarking) { ui->setupUi(this); connect( ui->freezeButton, SIGNAL(SignalFreezed(bool)), this, SLOT(OnFreeze(bool)) ); connect( ui->zonesWidget, SIGNAL(ZoneAdded()), this, SLOT(OnZoneAdded()) ); connect( ui->zonesWidget, SIGNAL(ZoneRemoved()), this, SLOT(OnZoneRemoved()) ); }
void USNavigation::CreateQtPartControl( QWidget *parent ) { m_Timer = new QTimer(this); m_RangeMeterTimer = new QTimer(this); // create GUI widgets from the Qt Designer's .ui file m_Controls.setupUi( parent ); m_Controls.m_ZonesWidget->SetDataStorage(this->GetDataStorage()); // Timer connect( m_Timer, SIGNAL(timeout()), this, SLOT(Update())); connect( m_RangeMeterTimer, SIGNAL(timeout()), this, SLOT(UpdateMeters())); connect( m_Controls.m_BtnSelectDevices, SIGNAL(clicked()), this, SLOT(OnSelectDevices()) ); connect( m_Controls.m_CombinedModalitySelectionWidget, SIGNAL(SignalReadyForNextStep()), this, SLOT(OnDeviceSelected()) ); connect( m_Controls.m_CombinedModalitySelectionWidget, SIGNAL(SignalNoLongerReadyForNextStep()), this, SLOT(OnDeviceDeselected()) ); connect( m_Controls.m_TabWidget, SIGNAL(currentChanged ( int )), this, SLOT(OnTabSwitch( int )) ); // Zones connect( m_Controls.m_BtnFreeze, SIGNAL(clicked()), this, SLOT(OnFreeze()) ); connect( m_Controls.m_ZonesWidget, SIGNAL(ZoneAdded()), this, SLOT(OnZoneAdded()) ); // Navigation connect( m_Controls.m_BtnStartIntervention, SIGNAL(clicked ()), this, SLOT(OnStartIntervention()) ); connect( m_Controls.m_BtnReset, SIGNAL(clicked ()), this, SLOT(OnReset()) ); connect( m_Controls.m_BtnNeedleView, SIGNAL(clicked ()), this, SLOT(OnNeedleViewToogle()) ); m_Freeze = false; m_IsNeedleViewActive = false; m_Controls.m_TabWidget->setTabEnabled(1, false); m_Controls.m_TabWidget->setTabEnabled(2, false); m_ZoneFilter = mitk::NodeDisplacementFilter::New(); m_NeedleProjectionFilter = mitk::NeedleProjectionFilter::New(); m_SmoothingFilter = mitk::NavigationDataSmoothingFilter::New(); m_CameraVis = mitk::CameraVisualization::New(); m_RangeMeterStyle = "QProgressBar:horizontal {\nborder: 1px solid gray;\nborder-radius: 3px;\nbackground: white;\npadding: 1px;\ntext-align: center;\n}\nQProgressBar::chunk:horizontal {\nbackground: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #StartColor#, stop: 0.8 #StartColor#, stop: 1 #StopColor#);\n}"; QBoxLayout * layout = new QBoxLayout(QBoxLayout::Down, m_Controls.m_RangeBox); // Pedal Support for Needle View QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_PageDown), parent); QObject::connect(shortcut, SIGNAL(activated()), m_Controls.m_BtnNeedleView, SLOT(animateClick()) ); m_Controls.m_CombinedModalitySelectionWidget->OnActivateStep(); }