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