Public Member Functions | Protected Slots | Protected Attributes

QmitkSegmentationPreferencePage Class Reference

#include <QmitkSegmentationPreferencePage.h>

Inheritance diagram for QmitkSegmentationPreferencePage:
Inheritance graph
[legend]
Collaboration diagram for QmitkSegmentationPreferencePage:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Definition at line 30 of file QmitkSegmentationPreferencePage.h.


Constructor & Destructor Documentation

QmitkSegmentationPreferencePage::QmitkSegmentationPreferencePage (  )

Definition at line 31 of file QmitkSegmentationPreferencePage.cpp.

: m_MainControl(0)
, m_Initializing(false)
{

}

Member Function Documentation

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]
See also:
IPreferencePage::PerformCancel()

Implements berry::IPreferencePage.

Definition at line 84 of file QmitkSegmentationPreferencePage.cpp.

{

}
bool QmitkSegmentationPreferencePage::PerformOk (  ) [virtual]
See also:
IPreferencePage::PerformOk()

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]
See also:
IPreferencePage::Update()

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) );
}

Member Data Documentation

Definition at line 65 of file QmitkSegmentationPreferencePage.h.

Referenced by CreateQtControl(), and GetQtControl().

Definition at line 66 of file QmitkSegmentationPreferencePage.h.

Referenced by CreateQtControl(), PerformOk(), and Update().

Definition at line 67 of file QmitkSegmentationPreferencePage.h.

Referenced by CreateQtControl(), and Update().

Definition at line 72 of file QmitkSegmentationPreferencePage.h.

Referenced by CreateQtControl(), PerformOk(), and Update().

Definition at line 68 of file QmitkSegmentationPreferencePage.h.

Referenced by CreateQtControl(), PerformOk(), and Update().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines