Medical Imaging Interaction Toolkit  2021.10.99-9c07a326
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 // qt widgets module
17 #include "MitkQtWidgetsExports.h"
18 #include "QmitkRenderWindow.h"
19 
20 // mitk core
21 #include <mitkDataStorage.h>
22 #include <mitkPointSet.h>
23 #include <mitkRenderWindow.h>
24 
25 // qt
26 #include <QFrame>
27 #include <QHBoxLayout>
28 #include <QMouseEvent>
29 
30 class vtkCornerAnnotation;
31 
41 {
42  Q_OBJECT
43 
44 public:
45 
47  QWidget* parent = nullptr,
48  const QString& widgetName = "",
49  mitk::DataStorage* dataStorage = nullptr);
50 
51  ~QmitkRenderWindowWidget() override;
52 
53  void SetDataStorage(mitk::DataStorage* dataStorage);
54 
55  const QString& GetWidgetName() const { return m_WidgetName; };
56  QmitkRenderWindow* GetRenderWindow() const { return m_RenderWindow; };
57 
58  mitk::SliceNavigationController* GetSliceNavigationController() const;
59 
60  void RequestUpdate();
61  void ForceImmediateUpdate();
62 
63  void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower);
64  void ShowGradientBackground(bool enable);
65  std::pair<mitk::Color, mitk::Color> GetGradientBackgroundColors() const { return m_GradientBackgroundColors; };
66  bool IsGradientBackgroundOn() const;
67 
68  void SetDecorationColor(const mitk::Color& color);
69  mitk::Color GetDecorationColor() const { return m_DecorationColor; };
70 
71  void ShowColoredRectangle(bool show);
72  bool IsColoredRectangleVisible() const;
73 
74  void ShowCornerAnnotation(bool show);
75  bool IsCornerAnnotationVisible() const;
76  void SetCornerAnnotationText(const std::string& cornerAnnotation);
77  std::string GetCornerAnnotationText() const;
78 
79  bool IsRenderWindowMenuActivated() const;
80 
81  void ActivateCrosshair(bool activate);
82 
83 private:
84 
85  void InitializeGUI();
86  void InitializeDecorations();
87 
88  void SetCrosshair(mitk::Point3D selectedPoint);
89 
90  QString m_WidgetName;
91  QHBoxLayout* m_Layout;
92 
93  mitk::DataStorage* m_DataStorage;
94 
95  QmitkRenderWindow* m_RenderWindow;
96 
97  mitk::DataNode::Pointer m_PointSetNode;
98  mitk::PointSet::Pointer m_PointSet;
99 
100  std::pair<mitk::Color, mitk::Color> m_GradientBackgroundColors;
101  mitk::Color m_DecorationColor;
102  vtkSmartPointer<vtkCornerAnnotation> m_CornerAnnotation;
103 
104 };
105 
106 #endif // QMITKRENDERWINDOWWIDGET_H
Data management class that handles &#39;was created by&#39; relations.
#define MITKQTWIDGETS_EXPORT
The &#39;QmitkRenderWindowWidget&#39; is a QFrame that holds a render window and some associates properties...
Controls the selection of the slice the associated BaseRenderer will display.
std::pair< mitk::Color, mitk::Color > GetGradientBackgroundColors() const
const QString & GetWidgetName() const
MITK implementation of the QVTKWidget.
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
QmitkRenderWindow * GetRenderWindow() const
mitk::Color GetDecorationColor() const