19 #include <QMouseEvent> 28 this->setObjectName(name);
30 popUp =
new QMenu(
this);
31 popUp->addAction(
"Axial");
32 popUp->addAction(
"Frontal");
33 popUp->addAction(
"Sagittal");
35 QObject::connect(popUp, SIGNAL(triggered(QAction *)),
this, SLOT(
ChangeView(QAction *)));
38 m_SlicedGeometry =
nullptr;
41 QHBoxLayout *hlayout =
new QHBoxLayout(container);
42 hlayout->setMargin(0);
45 QString composedName(
"QmitkSliceWidget::");
46 if (!this->objectName().isEmpty())
47 composedName += this->objectName();
49 composedName +=
"QmitkGLWidget";
66 return SelectionFrame;
71 m_DataStorage = storage;
72 m_Renderer->SetDataStorage(m_DataStorage);
95 if (m_DataStorage.IsNotNull())
97 m_DataStorage->Add(node);
112 MITK_WARN <<
"QmitkSliceWidget data is not an image!";
116 m_SlicedGeometry = image->GetSlicedGeometry();
140 if (m_SlicedGeometry.IsNull())
147 const mitk::BoundingBox::Pointer boundingbox = m_DataStorage->ComputeVisibleBoundingBox(
GetRenderer(),
nullptr);
149 if (boundingbox->GetPoints()->Size() > 0)
155 timeGeometry->Initialize(geometry, 1);
158 timeGeometry->SetFirstTimePoint(timebounds[0]);
159 timeGeometry->SetStepDuration(1.0);
162 if (timeGeometry->GetBoundingBoxInWorld()->GetDiagonalLength2() >=
mitk::eps)
181 if (e->button() == Qt::RightButton && popUpEnabled)
183 popUp->popup(QCursor::pos());
189 int val = m_NavigatorWidget->GetPos();
191 if (e->orientation() * e->delta() > 0)
193 m_NavigatorWidget->SetPos(val + 1);
198 m_NavigatorWidget->SetPos(val - 1);
204 if (val->text() ==
"Axial")
208 else if (val->text() ==
"Frontal")
212 else if (val->text() ==
"Sagittal")
225 return m_NavigatorWidget;
230 levelWindow->setEnabled(enable);
233 levelWindow->setMinimumWidth(0);
234 levelWindow->setMaximumWidth(0);
238 levelWindow->setMinimumWidth(28);
239 levelWindow->setMaximumWidth(28);
245 return levelWindow->isEnabled();
virtual mitk::CameraRotationController * GetCameraRotationController()
mitk::Stepper * GetSlice()
Get the Stepper through the slices.
Data management class that handles 'was created by' relations.
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
Baseclass for renderer slice-/camera-control.
void SetInputWorldTimeGeometry(const mitk::TimeGeometry *geometry)
Controls the selection of the slice the associated BaseRenderer will display.
Helper class to connect Qt-based navigators to instances of Stepper.
static RenderingManager * GetInstance()
virtual CameraController * GetCameraController()
ViewDirection
Possible view directions, Original will uses the PlaneGeometry instances in a SlicedGeometry3D provid...
Image class for storing images.
MITK implementation of the QVTKWidget.
virtual mitk::VtkPropRenderer * GetRenderer()
mitk::Image::Pointer image
void RequestUpdate(vtkRenderWindow *renderWindow)
MITKCORE_EXPORT const ScalarType eps
virtual mitk::SliceNavigationController * GetSliceNavigationController()
void Fit()
Fit Adjust the camera, so that the world bounding box is fully visible.
virtual void Update()
Do the actual creation and send it to the connected observers (renderers)
BaseGeometry Describes the geometry of a data object.
virtual mitk::BaseController * GetController()