#include <QmitkSegmentationPreferencePage.h>
Public Member Functions | |
QmitkSegmentationPreferencePage () | |
void | Init (berry::IWorkbench::Pointer workbench) |
void | CreateQtControl (QWidget *widget) |
QWidget * | GetQtControl () const |
virtual bool | PerformOk () |
virtual void | PerformCancel () |
virtual void | Update () |
Protected Slots | |
void | OnVolumeRenderingCheckboxChecked (int) |
Protected Attributes | |
QWidget * | m_MainControl |
QRadioButton * | m_RadioOutline |
QRadioButton * | m_RadioOverlay |
QCheckBox * | m_VolumeRenderingCheckBox |
bool | m_Initializing |
berry::IPreferences::Pointer | m_SegmentationPreferencesNode |
Definition at line 30 of file QmitkSegmentationPreferencePage.h.
QmitkSegmentationPreferencePage::QmitkSegmentationPreferencePage | ( | ) |
Definition at line 31 of file QmitkSegmentationPreferencePage.cpp.
: m_MainControl(0) , m_Initializing(false) { }
void QmitkSegmentationPreferencePage::CreateQtControl | ( | QWidget * | widget ) | [virtual] |
Implements berry::IQtPreferencePage.
Definition at line 43 of file QmitkSegmentationPreferencePage.cpp.
References berry::Platform::GetServiceRegistry(), ID, m_Initializing, m_MainControl, m_RadioOutline, m_RadioOverlay, m_SegmentationPreferencesNode, m_VolumeRenderingCheckBox, OnVolumeRenderingCheckboxChecked(), and Update().
{ m_Initializing = true; berry::IPreferencesService::Pointer prefService = berry::Platform::GetServiceRegistry() .GetServiceById<berry::IPreferencesService>(berry::IPreferencesService::ID); m_SegmentationPreferencesNode = prefService->GetSystemPreferences()->Node("/org.mitk.views.segmentation"); m_MainControl = new QWidget(parent); QVBoxLayout* displayOptionsLayout = new QVBoxLayout; m_RadioOutline = new QRadioButton( "Draw as outline", m_MainControl); displayOptionsLayout->addWidget( m_RadioOutline ); m_RadioOverlay = new QRadioButton( "Draw as transparent overlay", m_MainControl); displayOptionsLayout->addWidget( m_RadioOverlay ); QFormLayout *formLayout = new QFormLayout; formLayout->addRow( "2D display", displayOptionsLayout ); m_VolumeRenderingCheckBox = new QCheckBox( "Show as volume rendering", m_MainControl ); formLayout->addRow( "3D display", m_VolumeRenderingCheckBox ); connect( m_VolumeRenderingCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnVolumeRenderingCheckboxChecked(int)) ); m_MainControl->setLayout(formLayout); this->Update(); m_Initializing = false; }
QWidget * QmitkSegmentationPreferencePage::GetQtControl | ( | ) | const [virtual] |
Implements berry::IQtPreferencePage.
Definition at line 72 of file QmitkSegmentationPreferencePage.cpp.
References m_MainControl.
{ return m_MainControl; }
void QmitkSegmentationPreferencePage::Init | ( | berry::IWorkbench::Pointer | workbench ) | [virtual] |
Implements berry::IPreferencePage.
Definition at line 38 of file QmitkSegmentationPreferencePage.cpp.
{ }
void QmitkSegmentationPreferencePage::OnVolumeRenderingCheckboxChecked | ( | int | state ) | [protected, slot] |
Definition at line 104 of file QmitkSegmentationPreferencePage.cpp.
References m_Initializing.
Referenced by CreateQtControl().
{ if (m_Initializing) return; if ( state != Qt::Unchecked ) { QMessageBox::information(NULL, "Memory warning", "Turning on volume rendering of segmentations will make the application more memory intensive (and potentially prone to crashes).\n\n" "If you encounter out-of-memory problems, try turning off volume rendering again."); } }
void QmitkSegmentationPreferencePage::PerformCancel | ( | ) | [virtual] |
Implements berry::IPreferencePage.
Definition at line 84 of file QmitkSegmentationPreferencePage.cpp.
{ }
bool QmitkSegmentationPreferencePage::PerformOk | ( | ) | [virtual] |
Implements berry::IPreferencePage.
Definition at line 77 of file QmitkSegmentationPreferencePage.cpp.
References m_RadioOutline, m_SegmentationPreferencesNode, and m_VolumeRenderingCheckBox.
{ m_SegmentationPreferencesNode->PutBool("draw outline", m_RadioOutline->isChecked()); m_SegmentationPreferencesNode->PutBool("volume rendering", m_VolumeRenderingCheckBox->isChecked()); return true; }
void QmitkSegmentationPreferencePage::Update | ( | ) | [virtual] |
Implements berry::IPreferencePage.
Definition at line 89 of file QmitkSegmentationPreferencePage.cpp.
References m_RadioOutline, m_RadioOverlay, m_SegmentationPreferencesNode, and m_VolumeRenderingCheckBox.
Referenced by CreateQtControl().
{ //m_EnableSingleEditing->setChecked(m_SegmentationPreferencesNode->GetBool("Single click property editing", true)); if (m_SegmentationPreferencesNode->GetBool("draw outline", true) ) { m_RadioOutline->setChecked( true ); } else { m_RadioOverlay->setChecked( true ); } m_VolumeRenderingCheckBox->setChecked( m_SegmentationPreferencesNode->GetBool("volume rendering", false) ); }
bool QmitkSegmentationPreferencePage::m_Initializing [protected] |
Definition at line 70 of file QmitkSegmentationPreferencePage.h.
Referenced by CreateQtControl(), and OnVolumeRenderingCheckboxChecked().
QWidget* QmitkSegmentationPreferencePage::m_MainControl [protected] |
Definition at line 65 of file QmitkSegmentationPreferencePage.h.
Referenced by CreateQtControl(), and GetQtControl().
QRadioButton* QmitkSegmentationPreferencePage::m_RadioOutline [protected] |
Definition at line 66 of file QmitkSegmentationPreferencePage.h.
Referenced by CreateQtControl(), PerformOk(), and Update().
QRadioButton* QmitkSegmentationPreferencePage::m_RadioOverlay [protected] |
Definition at line 67 of file QmitkSegmentationPreferencePage.h.
Referenced by CreateQtControl(), and Update().
berry::IPreferences::Pointer QmitkSegmentationPreferencePage::m_SegmentationPreferencesNode [protected] |
Definition at line 72 of file QmitkSegmentationPreferencePage.h.
Referenced by CreateQtControl(), PerformOk(), and Update().
QCheckBox* QmitkSegmentationPreferencePage::m_VolumeRenderingCheckBox [protected] |
Definition at line 68 of file QmitkSegmentationPreferencePage.h.
Referenced by CreateQtControl(), PerformOk(), and Update().