diff --git a/Plugins/org.mitk.gui.qt.common/files.cmake b/Plugins/org.mitk.gui.qt.common/files.cmake index e93dd9a7ff..1918fbecb3 100755 --- a/Plugins/org.mitk.gui.qt.common/files.cmake +++ b/Plugins/org.mitk.gui.qt.common/files.cmake @@ -1,65 +1,66 @@ set(SRC_CPP_FILES QmitkAbstractMultiWidgetEditor.cpp QmitkAbstractRenderEditor.cpp QmitkAbstractView.cpp QmitkDataNodeSelectionProvider.cpp QmitkDnDFrameWidget.cpp QmitkSelectionServiceConnector.cpp QmitkSliceNavigationListener.cpp QmitkSingleNodeSelectionWidget.cpp QmitkNodeSelectionDialog.cpp QmitkAbstractNodeSelectionWidget.cpp QmitkMultiNodeSelectionWidget.cpp + QmitkMultiWidgetDecorationManager.cpp QmitkNodeSelectionPreferenceHelper.cpp QmitkNodeSelectionButton.cpp ) set(INTERNAL_CPP_FILES QmitkCommonActivator.cpp QmitkDataNodeItemModel.cpp QmitkDataNodeSelection.cpp QmitkViewCoordinator.cpp QmitkNodeSelectionConstants.cpp QmitkNodeSelectionPreferencePage.cpp ) set(UI_FILES src/QmitkSingleNodeSelectionWidget.ui src/QmitkMultiNodeSelectionWidget.ui src/QmitkNodeSelectionDialog.ui src/internal/QmitkNodeSelectionPreferencePage.ui ) set(MOC_H_FILES src/QmitkAbstractMultiWidgetEditor.h src/QmitkAbstractRenderEditor.h src/QmitkDnDFrameWidget.h src/QmitkSelectionServiceConnector.h src/QmitkSliceNavigationListener.h src/ImporterUtil.h src/QmitkSingleNodeSelectionWidget.h src/QmitkNodeSelectionDialog.h src/QmitkAbstractNodeSelectionWidget.h src/QmitkMultiNodeSelectionWidget.h src/QmitkNodeSelectionButton.h src/internal/QmitkCommonActivator.h src/internal/QmitkNodeSelectionPreferencePage.h ) set(CACHED_RESOURCE_FILES plugin.xml resources/times.svg ) set(QRC_FILES ) set(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.custommultiwidgeteditor/src/QmitkMultiWidgetDecorationManager.cpp b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.cpp similarity index 87% rename from Plugins/org.mitk.gui.qt.custommultiwidgeteditor/src/QmitkMultiWidgetDecorationManager.cpp rename to Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.cpp index 6ef9f3d0c8..eb68c6eda7 100644 --- a/Plugins/org.mitk.gui.qt.custommultiwidgeteditor/src/QmitkMultiWidgetDecorationManager.cpp +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.cpp @@ -1,458 +1,461 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkMultiWidgetDecorationManager.h" // org_mitk_gui_common #include -// mitk annotation +// mitk annotation module #include +// mitk qt widgets module +#include "QmitkRenderWindowWidget.h" + // vtk #include // qt #include -QmitkMultiWidgetDecorationManager::QmitkMultiWidgetDecorationManager(QmitkCustomMultiWidget* customMultiWidget) - : m_CustomMultiWidget(customMultiWidget) +QmitkMultiWidgetDecorationManager::QmitkMultiWidgetDecorationManager(QmitkAbstractMultiWidget* multiWidget) + : m_MultiWidget(multiWidget) , m_LogoAnnotation(mitk::LogoAnnotation::New()) { // nothing here } void QmitkMultiWidgetDecorationManager::DecorationPreferencesChanged(const berry::IBerryPreferences* preferences) { // Enable change of logo. If no DepartmentLogo was set explicitly, MBILogo is used. // Set new department logo by prefs->Set("DepartmentLogo", "PathToImage"); // If no logo was set for this plug-in specifically, walk the parent preference nodes // and lookup a logo value there. // Disable the logo first, otherwise setting a new logo will have no effect due to how mitkManufacturerLogo works ShowLogo(false); SetupLogo(qPrintable(":/org.mitk.gui.qt.stdmultiwidgeteditor/defaultWatermark.png")); ShowLogo(true); const berry::IPreferences* currentNode = preferences; while (currentNode) { bool logoFound = false; foreach(const QString& key, currentNode->Keys()) { if (key == "DepartmentLogo") { ShowLogo(false); QString departmentLogoLocation = currentNode->Get("DepartmentLogo", ""); if (!departmentLogoLocation.isEmpty()) { SetupLogo(qPrintable(departmentLogoLocation)); ShowLogo(true); } logoFound = true; break; } } if (logoFound) { break; } currentNode = currentNode->Parent().GetPointer(); } QmitkMultiWidgetDecorationManager::Colormap colormap = static_cast(preferences->GetInt("Render window widget colormap", 0)); SetColormap(colormap); // show colored rectangle ShowAllColoredRectangles(true); // show corner annotations ShowAllCornerAnnotations(true); } void QmitkMultiWidgetDecorationManager::ShowDecorations(bool show, const QStringList& decorations) { - if (nullptr != m_CustomMultiWidget) + if (nullptr != m_MultiWidget) { return; } if (decorations.isEmpty() || decorations.contains(mitk::IRenderWindowPart::DECORATION_BORDER)) { ShowAllColoredRectangles(show); } if (decorations.isEmpty() || decorations.contains(mitk::IRenderWindowPart::DECORATION_LOGO)) { ShowLogo(show); } if (decorations.isEmpty() || decorations.contains(mitk::IRenderWindowPart::DECORATION_MENU)) { - //m_CustomMultiWidget->ActivateAllRenderWindowMenus(show); + //m_MultiWidget->ActivateAllRenderWindowMenus(show); } if (decorations.isEmpty() || decorations.contains(mitk::IRenderWindowPart::DECORATION_BACKGROUND)) { ShowAllGradientBackgrounds(show); } if (decorations.isEmpty() || decorations.contains(mitk::IRenderWindowPart::DECORATION_CORNER_ANNOTATION)) { ShowAllCornerAnnotations(show); } } bool QmitkMultiWidgetDecorationManager::IsDecorationVisible(const QString& decoration) const { if (mitk::IRenderWindowPart::DECORATION_BORDER == decoration) { return AreAllColoredRectanglesVisible(); } else if (mitk::IRenderWindowPart::DECORATION_LOGO == decoration) { return IsLogoVisible(); } else if (mitk::IRenderWindowPart::DECORATION_MENU == decoration) { //return IsMenuWidgetEnabled(); } else if (mitk::IRenderWindowPart::DECORATION_BACKGROUND == decoration) { return AreAllGradientBackgroundsOn(); } else if (mitk::IRenderWindowPart::DECORATION_CORNER_ANNOTATION == decoration) { return AreAllCornerAnnotationsVisible(); } return false; } QStringList QmitkMultiWidgetDecorationManager::GetDecorations() const { QStringList decorations; decorations << mitk::IRenderWindowPart::DECORATION_BORDER << mitk::IRenderWindowPart::DECORATION_LOGO << mitk::IRenderWindowPart::DECORATION_MENU << mitk::IRenderWindowPart::DECORATION_BACKGROUND << mitk::IRenderWindowPart::DECORATION_CORNER_ANNOTATION; return decorations; } ////////////////////////////////////////////////////////////////////////// // PRIVATE ////////////////////////////////////////////////////////////////////////// void QmitkMultiWidgetDecorationManager::SetupLogo(const char* path) { m_LogoAnnotation->SetOpacity(0.5); mitk::Point2D offset; offset.Fill(0.03); m_LogoAnnotation->SetOffsetVector(offset); m_LogoAnnotation->SetRelativeSize(0.25); m_LogoAnnotation->SetCornerPosition(1); vtkSmartPointer vtkLogo = GetVtkLogo(path); SetLogo(vtkLogo); } vtkSmartPointer QmitkMultiWidgetDecorationManager::GetVtkLogo(const char* path) { QImage* qimage = new QImage(path); vtkSmartPointer qImageToVtk; qImageToVtk = vtkSmartPointer::New(); qImageToVtk->SetQImage(qimage); qImageToVtk->Update(); vtkSmartPointer vtkLogo = qImageToVtk->GetOutput(); return vtkLogo; } void QmitkMultiWidgetDecorationManager::SetLogo(vtkSmartPointer vtkLogo) { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetLastRenderWindowWidget(); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetLastRenderWindowWidget(); if (nullptr != renderWindowWidget && m_LogoAnnotation.IsNotNull()) { mitk::ManualPlacementAnnotationRenderer::AddAnnotation(m_LogoAnnotation.GetPointer(), renderWindowWidget->GetRenderWindow()->GetRenderer()); m_LogoAnnotation->SetLogoImage(vtkLogo); mitk::BaseRenderer *renderer = mitk::BaseRenderer::GetInstance(renderWindowWidget->GetRenderWindow()->GetVtkRenderWindow()); m_LogoAnnotation->Update(renderer); renderWindowWidget->RequestUpdate(); return; } MITK_ERROR << "Logo can not be set for an unknown widget."; } void QmitkMultiWidgetDecorationManager::ShowLogo(bool show) { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetLastRenderWindowWidget(); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetLastRenderWindowWidget(); if (nullptr != renderWindowWidget) { m_LogoAnnotation->SetVisibility(show); renderWindowWidget->RequestUpdate(); return; } MITK_ERROR << "Logo can not be shown for an unknown widget."; } bool QmitkMultiWidgetDecorationManager::IsLogoVisible() const { return m_LogoAnnotation->IsVisible(); } void QmitkMultiWidgetDecorationManager::SetColormap(QmitkMultiWidgetDecorationManager::Colormap colormap) { switch (colormap) { case Colormap::BlackAndWhite: { FillAllGradientBackgroundColorsWithBlack(); float white[3] = { 1.0f, 1.0f, 1.0f }; SetAllDecorationColors(white); break; } } } void QmitkMultiWidgetDecorationManager::SetDecorationColor(const QString& widgetID, const mitk::Color& color) { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { renderWindowWidget->SetDecorationColor(color); return; } MITK_ERROR << "Decoration color can not be set for an unknown widget."; } void QmitkMultiWidgetDecorationManager::SetAllDecorationColors(const mitk::Color& color) { - QmitkCustomMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_CustomMultiWidget->GetRenderWindowWidgets(); + QmitkAbstractMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_MultiWidget->GetRenderWindowWidgets(); for (const auto& renderWindowWidget : renderWindowWidgets) { renderWindowWidget.second->SetDecorationColor(color); } } mitk::Color QmitkMultiWidgetDecorationManager::GetDecorationColor(const QString& widgetID) const { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { return renderWindowWidget->GetDecorationColor(); } MITK_ERROR << "Decoration color can not be retrieved for an unknown widget. Returning black color!"; float black[3] = { 0.0f, 0.0f, 0.0f }; return mitk::Color(black); } void QmitkMultiWidgetDecorationManager::ShowColoredRectangle(const QString& widgetID, bool show) { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { renderWindowWidget->ShowColoredRectangle(show); return; } MITK_ERROR << "Colored rectangle can not be set for an unknown widget."; } void QmitkMultiWidgetDecorationManager::ShowAllColoredRectangles(bool show) { - QmitkCustomMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_CustomMultiWidget->GetRenderWindowWidgets(); + QmitkAbstractMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_MultiWidget->GetRenderWindowWidgets(); for (const auto& renderWindowWidget : renderWindowWidgets) { renderWindowWidget.second->ShowColoredRectangle(show); } } bool QmitkMultiWidgetDecorationManager::IsColoredRectangleVisible(const QString& widgetID) const { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { return renderWindowWidget->IsColoredRectangleVisible(); } MITK_ERROR << "Colored rectangle visibility can not be retrieved for an unknown widget. Returning 'false'."; return false; } bool QmitkMultiWidgetDecorationManager::AreAllColoredRectanglesVisible() const { - QmitkCustomMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_CustomMultiWidget->GetRenderWindowWidgets(); + QmitkAbstractMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_MultiWidget->GetRenderWindowWidgets(); bool allTrue = true; for (const auto& renderWindowWidget : renderWindowWidgets) { allTrue = allTrue && renderWindowWidget.second->IsColoredRectangleVisible(); } return allTrue; } void QmitkMultiWidgetDecorationManager::SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower, const QString& widgetID) { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { renderWindowWidget->SetGradientBackgroundColors(upper, lower); return; } MITK_ERROR << "Background color gradient can not be set for an unknown widget."; } void QmitkMultiWidgetDecorationManager::SetAllGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower) { - QmitkCustomMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_CustomMultiWidget->GetRenderWindowWidgets(); + QmitkAbstractMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_MultiWidget->GetRenderWindowWidgets(); for (const auto& renderWindowWidget : renderWindowWidgets) { renderWindowWidget.second->SetGradientBackgroundColors(upper, lower); } } void QmitkMultiWidgetDecorationManager::FillAllGradientBackgroundColorsWithBlack() { float black[3] = { 0.0f, 0.0f, 0.0f }; SetAllGradientBackgroundColors(black, black); } void QmitkMultiWidgetDecorationManager::ShowGradientBackground(const QString& widgetID, bool show) { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { renderWindowWidget->ShowGradientBackground(show); return; } MITK_ERROR << "Background color gradient can not be shown for an unknown widget."; } void QmitkMultiWidgetDecorationManager::ShowAllGradientBackgrounds(bool show) { - QmitkCustomMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_CustomMultiWidget->GetRenderWindowWidgets(); + QmitkAbstractMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_MultiWidget->GetRenderWindowWidgets(); for (const auto& renderWindowWidget : renderWindowWidgets) { renderWindowWidget.second->ShowGradientBackground(show); } } std::pair QmitkMultiWidgetDecorationManager::GetGradientBackgroundColors(const QString& widgetID) const { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { return renderWindowWidget->GetGradientBackgroundColors(); } MITK_ERROR << "Background color gradient can not be retrieved for an unknown widget. Returning black color pair."; float black[3] = { 0.0f, 0.0f, 0.0f }; return std::make_pair(mitk::Color(black), mitk::Color(black)); } bool QmitkMultiWidgetDecorationManager::IsGradientBackgroundOn(const QString& widgetID) const { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { return renderWindowWidget->IsGradientBackgroundOn(); } MITK_ERROR << "Background color gradient flag can not be retrieved for an unknown widget. Returning 'false'."; return false; } bool QmitkMultiWidgetDecorationManager::AreAllGradientBackgroundsOn() const { - QmitkCustomMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_CustomMultiWidget->GetRenderWindowWidgets(); + QmitkAbstractMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_MultiWidget->GetRenderWindowWidgets(); bool allTrue = true; for (const auto& renderWindowWidget : renderWindowWidgets) { allTrue = allTrue && renderWindowWidget.second->IsGradientBackgroundOn(); } return allTrue; } void QmitkMultiWidgetDecorationManager::SetCornerAnnotationText(const QString& widgetID, const std::string& cornerAnnotation) { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { renderWindowWidget->SetCornerAnnotationText(cornerAnnotation); return; } MITK_ERROR << "Corner annotation text can not be retrieved for an unknown widget."; } std::string QmitkMultiWidgetDecorationManager::GetCornerAnnotationText(const QString& widgetID) const { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { return renderWindowWidget->GetCornerAnnotationText(); } MITK_ERROR << "Corner annotation text can not be retrieved for an unknown widget."; return ""; } void QmitkMultiWidgetDecorationManager::ShowCornerAnnotation(const QString& widgetID, bool show) { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { renderWindowWidget->ShowCornerAnnotation(show); return; } MITK_ERROR << "Corner annotation can not be set for an unknown widget."; } void QmitkMultiWidgetDecorationManager::ShowAllCornerAnnotations(bool show) { - QmitkCustomMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_CustomMultiWidget->GetRenderWindowWidgets(); + QmitkAbstractMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_MultiWidget->GetRenderWindowWidgets(); for (const auto& renderWindowWidget : renderWindowWidgets) { renderWindowWidget.second->ShowCornerAnnotation(show); } } bool QmitkMultiWidgetDecorationManager::IsCornerAnnotationVisible(const QString& widgetID) const { - std::shared_ptr renderWindowWidget = m_CustomMultiWidget->GetRenderWindowWidget(widgetID); + std::shared_ptr renderWindowWidget = m_MultiWidget->GetRenderWindowWidget(widgetID); if (nullptr != renderWindowWidget) { return renderWindowWidget->IsCornerAnnotationVisible(); } MITK_ERROR << "Corner annotation visibility can not be retrieved for an unknown widget. Returning 'false'."; return false; } bool QmitkMultiWidgetDecorationManager::AreAllCornerAnnotationsVisible() const { - QmitkCustomMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_CustomMultiWidget->GetRenderWindowWidgets(); + QmitkAbstractMultiWidget::RenderWindowWidgetMap renderWindowWidgets = m_MultiWidget->GetRenderWindowWidgets(); bool allTrue = true; for (const auto& renderWindowWidget : renderWindowWidgets) { allTrue = allTrue && renderWindowWidget.second->IsCornerAnnotationVisible(); } return allTrue; } diff --git a/Plugins/org.mitk.gui.qt.custommultiwidgeteditor/src/QmitkMultiWidgetDecorationManager.h b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.h similarity index 92% rename from Plugins/org.mitk.gui.qt.custommultiwidgeteditor/src/QmitkMultiWidgetDecorationManager.h rename to Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.h index 6b0637d29a..ab96b72465 100644 --- a/Plugins/org.mitk.gui.qt.custommultiwidgeteditor/src/QmitkMultiWidgetDecorationManager.h +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.h @@ -1,144 +1,143 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKMULTIWIDGETDECORATIONMANAGER_H #define QMITKMULTIWIDGETDECORATIONMANAGER_H -// custom multi widget editor -#include +#include // mitk core #include // mitk annotation #include -// mitk qtwidgets -#include +// mitk qt widgets +#include // berry #include // vtk #include #include // qt #include #include /** * @brief * * */ -class CUSTOMMULTIWIDGETEDITOR_EXPORT QmitkMultiWidgetDecorationManager +class MITK_QT_COMMON QmitkMultiWidgetDecorationManager { public: - QmitkMultiWidgetDecorationManager(QmitkCustomMultiWidget* customMultiWidget); + QmitkMultiWidgetDecorationManager(QmitkAbstractMultiWidget* multiWidget); enum class Colormap { BlackAndWhite = 0 // black background, white decoration }; void DecorationPreferencesChanged(const berry::IBerryPreferences* preferences); /** * @brief Show or hide decorations like like colored borders or background, logos, menu widgets, logos and * text annotations. * * \@par Show the decorations specified in decorations if true. Hide them, if not. * \@par A list of decoration names. If empty, all supported decorations are affected. */ void ShowDecorations(bool show, const QStringList& decorations); /** * @brief Return if a specific decoration is visible. * * \return True, if the specified decoration is shown, false if not. */ bool IsDecorationVisible(const QString &decoration) const; QStringList GetDecorations() const; private: void SetupLogo(const char* path); vtkSmartPointer GetVtkLogo(const char* path); void SetLogo(vtkSmartPointer vtkLogo); void ShowLogo(bool show); bool IsLogoVisible() const; void SetColormap(Colormap colormap); void SetDecorationColor(const QString& widgetID, const mitk::Color& color); void SetAllDecorationColors(const mitk::Color& color); mitk::Color GetDecorationColor(const QString& widgetID) const; void ShowColoredRectangle(const QString& widgetID, bool show); void ShowAllColoredRectangles(bool show); bool IsColoredRectangleVisible(const QString& widgetID) const; bool AreAllColoredRectanglesVisible() const; /** * @brief Set a background color gradient for a specific render window. * * If two different input colors are used, a gradient background is generated. * * @param upper The color of the gradient background. * @param lower The color of the gradient background. * @param widgetID The widget identifier. */ void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower, const QString& widgetID); /** * @brief Set a background color gradient for all available render windows. * * If two different input colors are used, a gradient background is generated. * * @param upper The color of the gradient background. * @param lower The color of the gradient background. */ void SetAllGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower); void FillAllGradientBackgroundColorsWithBlack(); void ShowGradientBackground(const QString& widgetID, bool show); void ShowAllGradientBackgrounds(bool show); /** * @rief Return a render window (widget) specific background color gradient * * @param widgetID The widget identifier. * * @return A color gradient as a pair of colors. * First entry: upper color value * Second entry: lower color value */ std::pair GetGradientBackgroundColors(const QString& widgetID) const; bool IsGradientBackgroundOn(const QString& widgetID) const; bool AreAllGradientBackgroundsOn() const; void SetCornerAnnotationText(const QString& widgetID, const std::string& cornerAnnotation); std::string GetCornerAnnotationText(const QString& widgetID) const; void ShowCornerAnnotation(const QString& widgetID, bool show); void ShowAllCornerAnnotations(bool show); bool IsCornerAnnotationVisible(const QString& widgetID) const; bool AreAllCornerAnnotationsVisible() const; - QmitkCustomMultiWidget* m_CustomMultiWidget; + QmitkAbstractMultiWidget* m_MultiWidget; mitk::LogoAnnotation::Pointer m_LogoAnnotation; }; #endif // QMITKMULTIWIDGETDECORATIONMANAGER_H diff --git a/Plugins/org.mitk.gui.qt.custommultiwidgeteditor/files.cmake b/Plugins/org.mitk.gui.qt.custommultiwidgeteditor/files.cmake index d42b6de6e5..8333348ca6 100644 --- a/Plugins/org.mitk.gui.qt.custommultiwidgeteditor/files.cmake +++ b/Plugins/org.mitk.gui.qt.custommultiwidgeteditor/files.cmake @@ -1,38 +1,37 @@ set(SRC_CPP_FILES QmitkCustomMultiWidget.cpp QmitkCustomMultiWidgetEditor.cpp - QmitkMultiWidgetDecorationManager.cpp ) set(INTERNAL_CPP_FILES mitkPluginActivator.cpp QmitkCustomMultiWidgetEditorPreferencePage.cpp ) set(UI_FILES src/internal/QmitkCustomMultiWidgetEditorPreferencePage.ui ) set(MOC_H_FILES src/QmitkCustomMultiWidget.h src/QmitkCustomMultiWidgetEditor.h src/internal/mitkPluginActivator.h src/internal/QmitkCustomMultiWidgetEditorPreferencePage.h ) set(CACHED_RESOURCE_FILES resources/CustomMultiWidgetEditor.svg plugin.xml ) set(QRC_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES})