Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
QmitkMultiWidgetDecorationManager.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 QmitkMultiWidgetDecorationManager_h
14 #define QmitkMultiWidgetDecorationManager_h
15 
17 
18 // mitk core
19 #include <mitkColorProperty.h>
20 
21 // mitk annotation
22 #include <mitkLogoAnnotation.h>
23 
24 // mitk qt widgets
26 
27 // vtk
28 #include <vtkImageData.h>
29 #include <vtkSmartPointer.h>
30 
31 // qt
32 #include <QString>
33 #include <QStringList>
34 
35 namespace mitk
36 {
37  class IPreferences;
38 }
39 
46 {
47 
48 public:
49 
51 
52  enum class Colormap
53  {
54  BlackAndWhite = 0 // black background, white decoration
55  };
56 
58 
66  void ShowDecorations(bool show, const QStringList& decorations);
72  bool IsDecorationVisible(const QString &decoration) const;
73  QStringList GetDecorations() const;
74 
75  void SetupLogo(const char* path);
76  void ShowLogo(bool show);
77  bool IsLogoVisible() const;
78 
79  void SetColormap(Colormap colormap);
80 
81  void SetDecorationColor(const QString& widgetID, const mitk::Color& color);
82  void SetAllDecorationColors(const mitk::Color& color);
83  mitk::Color GetDecorationColor(const QString& widgetID) const;
84 
85  void ShowColoredRectangle(const QString& widgetID, bool show);
86  void ShowAllColoredRectangles(bool show);
87  bool IsColoredRectangleVisible(const QString& widgetID) const;
89 
99  void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower, const QString& widgetID);
108  void SetAllGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower);
110  void ShowGradientBackground(const QString& widgetID, bool show);
111  void ShowAllGradientBackgrounds(bool show);
121  std::pair<mitk::Color, mitk::Color> GetGradientBackgroundColors(const QString& widgetID) const;
122  bool IsGradientBackgroundOn(const QString& widgetID) const;
124 
125  void SetCornerAnnotationText(const QString& widgetID, const std::string& cornerAnnotation);
126  std::string GetCornerAnnotationText(const QString& widgetID) const;
127  void ShowCornerAnnotation(const QString& widgetID, bool show);
128  void ShowAllCornerAnnotations(bool show);
129  bool IsCornerAnnotationVisible(const QString& widgetID) const;
131 
132 private:
133 
134  vtkSmartPointer<vtkImageData> GetVtkLogo(const char* path);
135  void SetLogo(vtkSmartPointer<vtkImageData> vtkLogo);
136 
137  QmitkAbstractMultiWidget* m_MultiWidget;
138  mitk::LogoAnnotation::Pointer m_LogoAnnotation;
139 
140 };
141 
142 #endif
The 'QmitkAbstractMultiWidget' is a 'QWidget' that can be subclassed to display multiple render windo...
mitk::Color GetDecorationColor(const QString &widgetID) const
void ShowColoredRectangle(const QString &widgetID, bool show)
void ShowGradientBackground(const QString &widgetID, bool show)
bool IsGradientBackgroundOn(const QString &widgetID) const
void SetGradientBackgroundColors(const mitk::Color &upper, const mitk::Color &lower, const QString &widgetID)
Set a background color gradient for a specific render window.
void SetColormap(Colormap colormap)
void ShowDecorations(bool show, const QStringList &decorations)
Show or hide decorations like like colored borders or background, logos, menu widgets,...
void ShowCornerAnnotation(const QString &widgetID, bool show)
void SetupLogo(const char *path)
void DecorationPreferencesChanged(const mitk::IPreferences *preferences)
void SetAllGradientBackgroundColors(const mitk::Color &upper, const mitk::Color &lower)
Set a background color gradient for all available render windows.
bool IsColoredRectangleVisible(const QString &widgetID) const
void SetAllDecorationColors(const mitk::Color &color)
void ShowAllCornerAnnotations(bool show)
std::string GetCornerAnnotationText(const QString &widgetID) const
QmitkMultiWidgetDecorationManager(QmitkAbstractMultiWidget *multiWidget)
void ShowAllColoredRectangles(bool show)
bool IsCornerAnnotationVisible(const QString &widgetID) const
QStringList GetDecorations() const
bool IsDecorationVisible(const QString &decoration) const
Return if a specific decoration is visible.
std::pair< mitk::Color, mitk::Color > GetGradientBackgroundColors(const QString &widgetID) const
Return a render window (widget) specific background color gradient.
void SetDecorationColor(const QString &widgetID, const mitk::Color &color)
void ShowAllGradientBackgrounds(bool show)
void SetCornerAnnotationText(const QString &widgetID, const std::string &cornerAnnotation)
Interface to application preferences.
Find image slices visible on a given plane.
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
#define MITK_QT_COMMON