Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
QmitkRenderWindowWidget.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 QmitkRenderWindowWidget_h
14 #define QmitkRenderWindowWidget_h
15 
16 #include "MitkQtWidgetsExports.h"
17 
18 // qt widgets module
19 #include <QmitkRenderWindow.h>
20 
21 // mitk core
22 #include <mitkCrosshairManager.h>
23 #include <mitkDataStorage.h>
24 #include <mitkRenderWindow.h>
26 
27 // qt
28 #include <QFrame>
29 #include <QMouseEvent>
30 #include <QVBoxLayout>
31 
32 class vtkCornerAnnotation;
33 
44 {
45  Q_OBJECT
46 
47 public:
48 
50  QWidget* parent = nullptr,
51  const QString& widgetName = "",
52  mitk::DataStorage* dataStorage = nullptr);
53 
54  ~QmitkRenderWindowWidget() override;
55 
56  void SetDataStorage(mitk::DataStorage* dataStorage);
57 
58  const QString& GetWidgetName() const { return m_WidgetName; };
59  QmitkRenderWindow* GetRenderWindow() const { return m_RenderWindow; };
60 
61  mitk::SliceNavigationController* GetSliceNavigationController() const;
62 
63  void RequestUpdate();
64  void ForceImmediateUpdate();
65 
66  void AddUtilityWidget(QWidget* utilityWidget);
67  QmitkRenderWindowUtilityWidget* GetUtilityWidget();
68 
69  void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower);
70  void ShowGradientBackground(bool enable);
71  std::pair<mitk::Color, mitk::Color> GetGradientBackgroundColors() const { return m_GradientBackgroundColors; };
72  bool IsGradientBackgroundOn() const;
73 
74  void SetDecorationColor(const mitk::Color& color);
75  mitk::Color GetDecorationColor() const { return m_DecorationColor; };
76 
77  void ShowColoredRectangle(bool show);
78  bool IsColoredRectangleVisible() const;
79 
80  void ShowCornerAnnotation(bool show);
81  bool IsCornerAnnotationVisible() const;
82  void SetCornerAnnotationText(const std::string& cornerAnnotation);
83  std::string GetCornerAnnotationText() const;
84 
85  bool IsRenderWindowMenuActivated() const;
86 
87  void SetCrosshairVisibility(bool visible);
88  bool GetCrosshairVisibility();
89  void SetCrosshairGap(unsigned int gapSize);
90 
91  void EnableCrosshair();
92  void DisableCrosshair();
93 
94  void SetCrosshairPosition(const mitk::Point3D& newPosition);
95  mitk::Point3D GetCrosshairPosition() const;
96 
97  void SetGeometry(const itk::EventObject& event);
98  void SetGeometrySlice(const itk::EventObject& event);
99 
100 public Q_SLOTS:
101 
102  void OnResetGeometry();
103 
104 private:
105 
106  void InitializeGUI();
107  void InitializeDecorations();
108  void ResetGeometry(const mitk::TimeGeometry* referenceGeometry);
109 
110  QString m_WidgetName;
111  QVBoxLayout* m_Layout;
112 
113  mitk::DataStorage* m_DataStorage;
114 
115  QmitkRenderWindow* m_RenderWindow;
116 
117  mitk::CrosshairManager::Pointer m_CrosshairManager;
118 
119  std::pair<mitk::Color, mitk::Color> m_GradientBackgroundColors;
120  mitk::Color m_DecorationColor;
121  vtkSmartPointer<vtkCornerAnnotation> m_CornerAnnotation;
122 
123 };
124 
125 #endif
mitkRenderWindow.h
mitkCrosshairManager.h
mitk::TimeGeometry
Definition: mitkTimeGeometry.h:45
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
mitkDataStorage.h
vtkSmartPointer< vtkCornerAnnotation >
mitk::Color
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
Definition: mitkColorProperty.h:38
itk::SmartPointer< Self >
QmitkRenderWindow
MITK implementation of the QVTKWidget.
Definition: QmitkRenderWindow.h:38
QmitkRenderWindowWidget::GetGradientBackgroundColors
std::pair< mitk::Color, mitk::Color > GetGradientBackgroundColors() const
Definition: QmitkRenderWindowWidget.h:71
QmitkRenderWindowUtilityWidget.h
mitk::SliceNavigationController
Controls the selection of the slice the associated BaseRenderer will display.
Definition: mitkSliceNavigationController.h:130
QmitkRenderWindowUtilityWidget
Definition: QmitkRenderWindowUtilityWidget.h:38
mitk::Point< ScalarType, 3 >
QmitkRenderWindowWidget::GetWidgetName
const QString & GetWidgetName() const
Definition: QmitkRenderWindowWidget.h:58
MitkQtWidgetsExports.h
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
QmitkRenderWindowWidget::GetRenderWindow
QmitkRenderWindow * GetRenderWindow() const
Definition: QmitkRenderWindowWidget.h:59
QmitkRenderWindowWidget
The 'QmitkRenderWindowWidget' is a QFrame that holds a render window and some associates properties,...
Definition: QmitkRenderWindowWidget.h:43
QmitkRenderWindowWidget::GetDecorationColor
mitk::Color GetDecorationColor() const
Definition: QmitkRenderWindowWidget.h:75
QmitkRenderWindow.h