Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkStdMultiWidget.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkStdMultiWidget_h
14 #define QmitkStdMultiWidget_h
15 
16 // qt widgets module
17 #include "MitkQtWidgetsExports.h"
19 
25 {
26  Q_OBJECT
27 
28 public:
30  QWidget *parent = nullptr,
31  Qt::WindowFlags f = {},
32  const QString &name = "stdmulti");
33 
34  ~QmitkStdMultiWidget() override;
35 
36  virtual void InitializeMultiWidget() override;
37 
38  virtual QmitkRenderWindow* GetRenderWindow(const QString& widgetName) const override;
39  virtual QmitkRenderWindow* GetRenderWindow(const mitk::AnatomicalPlane& orientation) const override;
40 
51  void InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera) override;
52 
57  void SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry) override;
58 
64  bool HasCoupledRenderWindows() const override;
65 
66  virtual void SetSelectedPosition(const mitk::Point3D& newPosition, const QString& widgetName) override;
67  virtual const mitk::Point3D GetSelectedPosition(const QString& widgetName) const override;
68 
69  virtual void SetCrosshairVisibility(bool) override;
70  virtual bool GetCrosshairVisibility() const override;
71  void SetCrosshairGap(unsigned int gapSize) override;
72 
73  virtual void ResetCrosshair() override;
74 
75  virtual void SetWidgetPlaneMode(int mode) override;
76 
77 
78  void AddPlanesToDataStorage();
79  void RemovePlanesFromDataStorage();
80 
86  QmitkRenderWindow* GetRenderWindow(unsigned int number) const;
87  QmitkRenderWindow* GetRenderWindow1() const;
88  QmitkRenderWindow* GetRenderWindow2() const;
89  QmitkRenderWindow* GetRenderWindow3() const;
90  QmitkRenderWindow* GetRenderWindow4() const;
91 
97  mitk::DataNode::Pointer GetWidgetPlane(unsigned int number) const;
98  mitk::DataNode::Pointer GetWidgetPlane1() const;
99  mitk::DataNode::Pointer GetWidgetPlane2() const;
100  mitk::DataNode::Pointer GetWidgetPlane3() const;
101 
110  void SetDecorationColor(unsigned int widgetNumber, mitk::Color color);
116  mitk::Color GetDecorationColor(unsigned int widgetNumber);
117 
118 public Q_SLOTS:
119 
120  // mouse events
121  virtual void mousePressEvent(QMouseEvent*) override;
122  virtual void moveEvent(QMoveEvent* e) override;
123  virtual void wheelEvent(QWheelEvent* e) override;
124 
125  void Fit();
126 
127  void AddDisplayPlaneSubTree();
128 
129  void EnsureDisplayContainsPoint(mitk::BaseRenderer *renderer, const mitk::Point3D &p);
130 
131  void SetWidgetPlaneVisibility(const char *widgetName, bool visible, mitk::BaseRenderer *renderer = nullptr);
132 
133  void SetWidgetPlanesVisibility(bool visible, mitk::BaseRenderer *renderer = nullptr);
134 
135 Q_SIGNALS:
136 
137  void NotifyCrosshairVisibilityChanged(bool visible);
138  void NotifyCrosshairRotationModeChanged(int mode);
139 
140  void WheelMoved(QWheelEvent *);
141  void Moved();
142 
143 private:
144 
145  virtual void SetLayoutImpl() override;
146  virtual void SetInteractionSchemeImpl() override { }
147 
148  void CreateRenderWindowWidgets();
149 
153  mitk::DataNode::Pointer m_PlaneNode1;
154  mitk::DataNode::Pointer m_PlaneNode2;
155  mitk::DataNode::Pointer m_PlaneNode3;
156 
161  mitk::DataNode::Pointer m_ParentNodeForGeometryPlanes;
162 
169  mitk::Color m_DecorationColorWidget4;
170 
171 };
172 
173 #endif
QmitkStdMultiWidget
The 'QmitkStdMultiWidget' is a 'QmitkAbstractMultiWidget' that is used to display multiple render win...
Definition: QmitkStdMultiWidget.h:24
mitk::TimeGeometry
Definition: mitkTimeGeometry.h:45
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
QmitkAbstractMultiWidget::InitializeViews
virtual void InitializeViews(const mitk::TimeGeometry *geometry, bool resetCamera)=0
Initialize the render windows of the concrete multi widget to the given geometry.
QmitkAbstractMultiWidget::SetInteractionReferenceGeometry
virtual void SetInteractionReferenceGeometry(const mitk::TimeGeometry *referenceGeometry)=0
Define the reference geometry for interaction withing a render window.
QmitkAbstractMultiWidget::SetSelectedPosition
virtual void SetSelectedPosition(const mitk::Point3D &newPosition, const QString &widgetName)=0
QmitkAbstractMultiWidget::ResetCrosshair
virtual void ResetCrosshair()=0
mitk::Color
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
Definition: mitkColorProperty.h:38
QmitkAbstractMultiWidget::SetWidgetPlaneMode
virtual void SetWidgetPlaneMode(int mode)=0
itk::SmartPointer< Self >
QmitkRenderWindow
MITK implementation of the QVTKWidget.
Definition: QmitkRenderWindow.h:38
QmitkAbstractMultiWidget::SetCrosshairVisibility
virtual void SetCrosshairVisibility(bool visible)=0
QmitkAbstractMultiWidget::GetSelectedPosition
virtual const mitk::Point3D GetSelectedPosition(const QString &widgetName) const =0
QmitkAbstractMultiWidget::InitializeMultiWidget
virtual void InitializeMultiWidget()=0
QmitkAbstractMultiWidget::GetCrosshairVisibility
virtual bool GetCrosshairVisibility() const =0
QmitkAbstractMultiWidget::GetRenderWindow
QmitkRenderWindow * GetRenderWindow(int row, int column) const
QmitkAbstractMultiWidget.h
mitk::AnatomicalPlane
AnatomicalPlane
Definition: mitkAnatomicalPlanes.h:18
mitk::Point< ScalarType, 3 >
MitkQtWidgetsExports.h
QmitkAbstractMultiWidget::HasCoupledRenderWindows
virtual bool HasCoupledRenderWindows() const =0
Returns true if the render windows are coupled; false if not.
QmitkAbstractMultiWidget
The 'QmitkAbstractMultiWidget' is a 'QWidget' that can be subclassed to display multiple render windo...
Definition: QmitkAbstractMultiWidget.h:53
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
QmitkAbstractMultiWidget::SetCrosshairGap
virtual void SetCrosshairGap(unsigned int gapSize)=0