diff --git a/Modules/Overlays/QmitkCustomWidgetOverlay.cpp b/Modules/Overlays/QmitkCustomWidgetOverlay.cpp index d145dcede3..98641e9997 100644 --- a/Modules/Overlays/QmitkCustomWidgetOverlay.cpp +++ b/Modules/Overlays/QmitkCustomWidgetOverlay.cpp @@ -1,41 +1,44 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 "QmitkCustomWidgetOverlay.h" QmitkCustomWidgetOverlay::QmitkCustomWidgetOverlay( const char* id ) : QmitkOverlay(id) { QmitkOverlay::AddDropShadow( m_Widget ); } QmitkCustomWidgetOverlay::~QmitkCustomWidgetOverlay() { } void QmitkCustomWidgetOverlay::SetWidget( QWidget* widget ) { if ( widget != NULL ) { m_Widget = widget; m_WidgetIsCustom = true; } } - +QSize QmitkCustomWidgetOverlay::GetNeededSize() +{ + return m_Widget->size(); +} diff --git a/Modules/Overlays/QmitkCustomWidgetOverlay.h b/Modules/Overlays/QmitkCustomWidgetOverlay.h index ffe514034b..671394632f 100644 --- a/Modules/Overlays/QmitkCustomWidgetOverlay.h +++ b/Modules/Overlays/QmitkCustomWidgetOverlay.h @@ -1,64 +1,66 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB #define QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB // MITK #include "QmitkOverlay.h" #include "OverlaysExports.h" /** \class QmitkCustomWidgetOverlay * \brief object representing a custom widget that is handled and positioned * as an overlay. * * A QmitkCustomWidgetOverlay is a generic sub-class of QmitkOverlay. It * offers the possibility to set the internal m_Widget from the outside. * * This offers the possibility to position custom widgets 'on top of' other * widgets using the positioning mechanism of all overlays. * * \warn The custom widgets need to be configured and connected manually. * Properties cannot be set. * * \ingroup Overlays */ class Overlays_EXPORT QmitkCustomWidgetOverlay : public QmitkOverlay { public: /** * @brief Default Constructor **/ QmitkCustomWidgetOverlay( const char* id ); /** * @brief Default Destructor **/ virtual ~QmitkCustomWidgetOverlay(); void SetWidget( QWidget* widget ); + QSize GetNeededSize(); + }; #endif /* QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB */ diff --git a/Modules/Overlays/QmitkOverlay.cpp b/Modules/Overlays/QmitkOverlay.cpp index 1690813abd..d211e83cc3 100644 --- a/Modules/Overlays/QmitkOverlay.cpp +++ b/Modules/Overlays/QmitkOverlay.cpp @@ -1,82 +1,83 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 "QmitkOverlay.h" #include #include QmitkOverlay::QmitkOverlay( const char* id ) :QObject() , m_Id(id) , m_Position(top_Left) , m_Layer(-1) , m_Widget(NULL) , m_WidgetIsCustom(false) { } QmitkOverlay::~QmitkOverlay() { if ( m_Widget && !m_WidgetIsCustom ) { m_Widget->deleteLater(); m_Widget = NULL; } } QmitkOverlay::DisplayPosition QmitkOverlay::GetPosition() { return m_Position; } void QmitkOverlay::SetPosition( DisplayPosition pos ) { m_Position = pos; } unsigned int QmitkOverlay::GetLayer() { return m_Layer; } void QmitkOverlay::SetLayer( unsigned int layer ) { m_Layer = layer; } QWidget* QmitkOverlay::GetWidget() { return m_Widget; } void QmitkOverlay::AddDropShadow( QWidget* widget ) { if (m_Widget) { QGraphicsDropShadowEffect* effect = new QGraphicsDropShadowEffect(widget); effect->setOffset( QPointF( 1.0, 1.0 ) ); effect->setBlurRadius( 0 ); effect->setColor( Qt::black ); widget->setGraphicsEffect( effect ); } } + diff --git a/Modules/Overlays/QmitkOverlay.h b/Modules/Overlays/QmitkOverlay.h index 103b659758..cab56f63c7 100644 --- a/Modules/Overlays/QmitkOverlay.h +++ b/Modules/Overlays/QmitkOverlay.h @@ -1,131 +1,133 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 MITKOVERLAY_H_HEADER_INCLUDED_C10DC4EB #define MITKOVERLAY_H_HEADER_INCLUDED_C10DC4EB // MITK #include "mitkCommon.h" #include "mitkPropertyList.h" // Qt #include #include "OverlaysExports.h" /** \brief Abstract base class for all overlay-objects in MITK This class is the basis for all classes representing objects that can be visualized as overlays in MITK. It encapsulates an ID, as well as a display-position and a layer. The ID is used to access mitkProperties in a PropertyList that holds information that is needed for the visualization, e.g. text for TextOverlays or scaleFactor for ScalarBarOverlays ... The display-position encodes where on the screen the overlay will be positioned at (see and USE the constants defined by DisplayPosition): \verbatim 0 - 1 - 2 | | | 3 - - 4 | | | 5 - 6 - 7 \endverbatim The layer is needed if several overlays shall be put in the same position. In this case the layer defines the order in which the objects are layouted. \ingroup Qmitk */ class Overlays_EXPORT QmitkOverlay : public QObject { Q_OBJECT public: /** \brief enumeration of all possible display positions */ enum DisplayPosition { top_Left = 0, top_Center = 1, top_Right = 2, middle_Left = 3, middle_Right = 4, bottom_Left = 5, bottom_Center = 6, bottom_Right = 7 }; /** * @brief Constructor with string ID **/ QmitkOverlay(const char* id); /** * @brief Default Destructor **/ virtual ~QmitkOverlay(); /** \brief setter for the display-position */ virtual void SetPosition( DisplayPosition ); /** \brief getter for the display-position */ virtual DisplayPosition GetPosition(); /** \brief setter for the layer */ virtual void SetLayer( unsigned int ); /** \brief getter for the layer */ virtual unsigned int GetLayer(); /** * \brief abstract method to internally setup the overlay */ virtual void GenerateData( mitk::PropertyList::Pointer /*pl*/ ) {}; /** * \brief returns the internally handled QWidget */ virtual QWidget* GetWidget(); + virtual QSize GetNeededSize() = 0; + + protected: /** \brief Add drop shadow effect via QGraphicsEffect */ void AddDropShadow( QWidget* widget ); - /** \brief ID of the overlay */ const char* m_Id; /** \brief position of the overlay */ DisplayPosition m_Position; /** \brief layer of the overlay */ unsigned int m_Layer; /** \brief internal QWidget representing the overlay */ QWidget* m_Widget; bool m_WidgetIsCustom; }; #endif /* MITKOVERLAY_H_HEADER_INCLUDED_C10DC4EB */ diff --git a/Modules/Overlays/QmitkOverlayController.cpp b/Modules/Overlays/QmitkOverlayController.cpp index 5d0b5af458..2411ca4121 100644 --- a/Modules/Overlays/QmitkOverlayController.cpp +++ b/Modules/Overlays/QmitkOverlayController.cpp @@ -1,406 +1,513 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 "QmitkOverlayController.h" #include "QmitkRenderWindow.h" #include "QmitkOverlay.h" #include #include #include QmitkOverlayController::QmitkOverlayController( QmitkRenderWindow* rw, mitk::PropertyList* pl ) : QObject(), m_RenderWindow( rw ), m_PropertyList( pl ) { if ( m_RenderWindow == NULL ) { MITK_ERROR << "invalid QmitkRenderWindow"; return; } - connect( rw, SIGNAL( moved() ), this, SLOT( AdjustOverlayPosition() ) ); + connect( rw, SIGNAL( moved() ), this, SLOT( AdjustAllOverlayPosition() ) ); this->InitializeOverlayLayout(); - this->AdjustOverlayPosition(); + this->AdjustAllOverlayPosition(); this->SetOverlayVisibility( true ); if ( m_PropertyList.IsNull() ) m_PropertyList = mitk::PropertyList::New(); } QmitkOverlayController::~QmitkOverlayController() { } void QmitkOverlayController::InitializeOverlayLayout() { // setup widget for each position this->InitializeWidget( QmitkOverlay::top_Left ); this->InitializeWidget( QmitkOverlay::top_Center ); this->InitializeWidget( QmitkOverlay::top_Right ); this->InitializeWidget( QmitkOverlay::middle_Left ); this->InitializeWidget( QmitkOverlay::middle_Right ); this->InitializeWidget( QmitkOverlay::bottom_Left ); this->InitializeWidget( QmitkOverlay::bottom_Center ); this->InitializeWidget( QmitkOverlay::bottom_Right ); } void QmitkOverlayController::InitializeWidget( QmitkOverlay::DisplayPosition pos ) { // create a new QWidget as Tool & FramelessWindowHint m_PositionedOverlays[ pos ] = new QWidget( m_RenderWindow, Qt::Tool | Qt::FramelessWindowHint ); // autoFillBackGround(false) and WA_TranslucentBackground = true are needed to have a translucent background // transparency does NOT work under Win-XP 32-Bit --> paint black background #if !defined(_WIN32) || defined(_WIN64) m_PositionedOverlays[ pos ]->setAttribute( Qt::WA_TranslucentBackground, true ); #else m_PositionedOverlays[ pos ]->setStyleSheet( "QWidget { background: black }" ); m_PositionedOverlays[ pos ]->setAttribute( Qt::WA_TranslucentBackground, false ); #endif // X11 specific attributes m_PositionedOverlays[ pos ]->setAttribute( Qt::WA_X11NetWmWindowTypeUtility, true ); // mac-specific attributes: // making sure overlays are even visible if RenderWindow does not have the focus (not default for Qt::Tool on mac) m_PositionedOverlays[ pos ]->setAttribute( Qt::WA_MacAlwaysShowToolWindow, true ); // testing something m_PositionedOverlays[ pos ]->setAttribute( Qt::WA_MacShowFocusRect, false ); // overlays should not get the focus m_PositionedOverlays[ pos ]->setFocusPolicy( Qt::NoFocus ); // setting the color of the background to transparent - not sure it's needed after the attributes have been set above QPalette p = QPalette(); p.setColor( QPalette::Window, Qt::transparent ); m_PositionedOverlays[ pos ]->setPalette( p ); // setting position-specific properties switch ( pos ) { case QmitkOverlay::top_Left : { // adding left-aligned top-to-bottom layout QVBoxLayout* layout = new QVBoxLayout( m_PositionedOverlays[ pos ] ); layout->setDirection( QBoxLayout::TopToBottom ); layout->setAlignment( Qt::AlignLeft ); m_PositionedOverlays[ pos ]->layout()->setSpacing( 0 ); break; } case QmitkOverlay::top_Center : { // adding center-aligned top-to-bottom layout QVBoxLayout* layout = new QVBoxLayout( m_PositionedOverlays[ pos ] ); layout->setDirection( QBoxLayout::TopToBottom ); layout->setAlignment( Qt::AlignCenter ); layout->setAlignment( Qt::AlignLeft ); m_PositionedOverlays[ pos ]->layout()->setSpacing( 0 ); break; } case QmitkOverlay::top_Right : { // adding right-aligned top-to-bottom layout QVBoxLayout* layout = new QVBoxLayout( m_PositionedOverlays[ pos ] ); layout->setDirection( QBoxLayout::TopToBottom ); layout->setAlignment( Qt::AlignRight ); m_PositionedOverlays[ pos ]->layout()->setSpacing( 0 ); break; } case QmitkOverlay::middle_Left : { // adding left-aligned left-to-right layout QHBoxLayout* layout = new QHBoxLayout( m_PositionedOverlays[ pos ] ); layout->setDirection( QBoxLayout::LeftToRight ); layout->setAlignment( Qt::AlignLeft ); layout->setSpacing( 3 ); break; } case QmitkOverlay::middle_Right : { // adding right-aligned right-to-left layout QHBoxLayout* layout = new QHBoxLayout( m_PositionedOverlays[ pos ] ); layout->setDirection( QBoxLayout::RightToLeft ); layout->setAlignment( Qt::AlignRight ); layout->setSpacing( 3 ); break; } case QmitkOverlay::bottom_Left : { // adding left-aligned bottom-to-top layout QVBoxLayout* layout = new QVBoxLayout( m_PositionedOverlays[ pos ] ); layout->setDirection( QBoxLayout::BottomToTop ); layout->setAlignment( Qt::AlignLeft ); m_PositionedOverlays[ pos ]->layout()->setSpacing( 0 ); break; } case QmitkOverlay::bottom_Center : { QVBoxLayout* layout = new QVBoxLayout( m_PositionedOverlays[ pos ] ); layout->setDirection( QBoxLayout::BottomToTop ); layout->setAlignment( Qt::AlignCenter ); m_PositionedOverlays[ pos ]->layout()->setSpacing( 0 ); break; } case QmitkOverlay::bottom_Right : { QVBoxLayout* layout = new QVBoxLayout( m_PositionedOverlays[ pos ] ); layout->setDirection( QBoxLayout::BottomToTop ); layout->setAlignment( Qt::AlignRight ); m_PositionedOverlays[ pos ]->layout()->setSpacing( 0 ); break; } } } -void QmitkOverlayController::AdjustOverlayPosition() +void QmitkOverlayController::AdjustAllOverlayPosition() +{ + AdjustOverlayPosition( QmitkOverlay::top_Left ); + AdjustOverlayPosition( QmitkOverlay::top_Center ); + AdjustOverlayPosition( QmitkOverlay::top_Right ); + AdjustOverlayPosition( QmitkOverlay::middle_Left ); + AdjustOverlayPosition( QmitkOverlay::middle_Right ); + AdjustOverlayPosition( QmitkOverlay::bottom_Left ); + AdjustOverlayPosition( QmitkOverlay::bottom_Center ); + AdjustOverlayPosition( QmitkOverlay::bottom_Right ); +} + + +void QmitkOverlayController::AdjustOverlayPosition( QmitkOverlay::DisplayPosition displayPosition ) { QWidget* widget; QPoint pos; - // setting position of top-left overlay-container - pos = m_RenderWindow->mapToGlobal( QPoint(0,0) ); - m_PositionedOverlays[ QmitkOverlay::top_Left ]->move( pos.x(), pos.y() ); + switch (displayPosition) + { + case QmitkOverlay::top_Left: + { + // setting position of top-left overlay-container + pos = m_RenderWindow->mapToGlobal( QPoint(0,0) ); + m_PositionedOverlays[ QmitkOverlay::top_Left ]->move( pos.x(), pos.y() ); + break; + } - // setting position of top-center overlay-container - widget = m_PositionedOverlays[ QmitkOverlay::top_Center ]; - pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width()/2, 0 ) ) ; - widget->move( pos.x() - widget->size().width()/2, pos.y() ); + case QmitkOverlay::top_Center: + { + // setting position of top-center overlay-container + widget = m_PositionedOverlays[ QmitkOverlay::top_Center ]; + QSize size = GetMinimumSizeForWidget( displayPosition ); + widget->setMinimumWidth( size.width() ); + pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width()/2, 0 ) ) ; + widget->move( pos.x() - widget->size().width()/2, pos.y() ); - // setting position of top-right overlay-container - widget = m_PositionedOverlays[ QmitkOverlay::top_Right ]; - pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width(), 0 ) ) ; - widget->move( pos.x() - widget->size().width(), pos.y() ); + break; + } + case QmitkOverlay::top_Right: + { + // setting position of top-right overlay-container + widget = m_PositionedOverlays[ QmitkOverlay::top_Right ]; + QSize size = GetMinimumSizeForWidget( displayPosition ); + widget->setMinimumWidth( size.width() ); - // setting position of middle-left overlay-container - widget = m_PositionedOverlays[ QmitkOverlay::middle_Left ]; - pos = m_RenderWindow->mapToGlobal( QPoint( 0, m_RenderWindow->size().height()/2 ) ) ; - widget->move( pos.x(), pos.y() - widget->size().height()/2 ); + pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width(), 0 ) ) ; + widget->move( pos.x() - widget->size().width(), pos.y() ); + break; + } - // setting position of middle-right overlay-container - widget = m_PositionedOverlays[ QmitkOverlay::middle_Right ]; - pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width(), m_RenderWindow->size().height()/2 ) ) ; - widget->move( pos.x() - widget->size().width(), pos.y() - widget->size().height()/2 ); + case QmitkOverlay::middle_Left: + { + // setting position of middle-left overlay-container + widget = m_PositionedOverlays[ QmitkOverlay::middle_Left ]; + QSize size = GetMinimumSizeForWidget( displayPosition ); + widget->setMinimumWidth( size.width() ); + pos = m_RenderWindow->mapToGlobal( QPoint( 0, m_RenderWindow->size().height()/2 ) ) ; + widget->move( pos.x(), pos.y() - widget->size().height()/2 ); - // setting position of bottom-left overlay-container - widget = m_PositionedOverlays[ QmitkOverlay::bottom_Left ]; - pos = m_RenderWindow->mapToGlobal( QPoint( 0, m_RenderWindow->size().height() ) ) ; - widget->move( pos.x(), pos.y() - widget->size().height() ); + break; + } + + case QmitkOverlay::middle_Right: + { + // setting position of middle-right overlay-container + widget = m_PositionedOverlays[ QmitkOverlay::middle_Right ]; + QSize size = GetMinimumSizeForWidget( displayPosition ); + widget->setMinimumWidth( size.width() ); + + pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width(), m_RenderWindow->size().height()/2 ) ) ; + widget->move( pos.x() - widget->size().width(), pos.y() - widget->size().height()/2 ); + break; + } - // setting position of bottom-center overlay-container - widget = m_PositionedOverlays[ QmitkOverlay::bottom_Center ]; - pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width()/2, m_RenderWindow->size().height() ) ) ; - widget->move( pos.x() - widget->size().width()/2, pos.y() - widget->size().height() ); + case QmitkOverlay::bottom_Left: + { + // setting position of bottom-left overlay-container + widget = m_PositionedOverlays[ QmitkOverlay::bottom_Left ]; + QSize size = GetMinimumSizeForWidget( displayPosition ); + widget->setMinimumWidth( size.width() ); + pos = m_RenderWindow->mapToGlobal( QPoint( 0, m_RenderWindow->size().height() ) ) ; + widget->move( pos.x(), pos.y() - widget->size().height() ); - // setting position of bottom-right overlay-container - widget = m_PositionedOverlays[ QmitkOverlay::bottom_Right ]; - pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width(), m_RenderWindow->size().height() ) ) ; - widget->move( pos.x() - widget->size().width(), pos.y() - widget->size().height() ); + break; + } + + case QmitkOverlay::bottom_Center: + { + // setting position of bottom-center overlay-container + widget = m_PositionedOverlays[ QmitkOverlay::bottom_Center ]; + QSize size = GetMinimumSizeForWidget( displayPosition ); + widget->setMinimumWidth( size.width() ); + + pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width()/2, m_RenderWindow->size().height() ) ) ; + widget->move( pos.x() - widget->size().width()/2, pos.y() - widget->size().height() ); + + break; + } + + case QmitkOverlay::bottom_Right: + { + // setting position of bottom-right overlay-container + widget = m_PositionedOverlays[ QmitkOverlay::bottom_Right ]; + QSize size = GetMinimumSizeForWidget( displayPosition ); + widget->setMinimumWidth( size.width() ); + + pos = m_RenderWindow->mapToGlobal( QPoint( m_RenderWindow->size().width(), m_RenderWindow->size().height() ) ) ; + widget->move( pos.x() - widget->size().width(), pos.y() - widget->size().height() ); + + break; + } + } } void QmitkOverlayController::SetOverlayVisibility( bool visible ) { OverlayPositionMap::iterator overlayIter; for ( overlayIter=m_PositionedOverlays.begin(); overlayIter!=m_PositionedOverlays.end(); overlayIter++ ) { if ( visible ) { (overlayIter->second)->show(); } else { (overlayIter->second)->hide(); } } OverlayVector::iterator allOverlaysIter; for( allOverlaysIter=m_AllOverlays.begin(); allOverlaysIter!=m_AllOverlays.end(); allOverlaysIter++ ) { if ( visible ) { (*allOverlaysIter)->GetWidget()->show(); } else { (*allOverlaysIter)->GetWidget()->hide(); } } } void QmitkOverlayController::AddOverlay( QmitkOverlay* overlay ) { // if no renderwindow has been set, it's not possible to add overlays... if ( m_RenderWindow == NULL ) { MITK_ERROR << "invalid QmitkRenderWindow"; return; } if ( overlay != NULL ) { // get desired position and layer of the overlay QmitkOverlay::DisplayPosition pos = overlay->GetPosition(); // concatenate local propertyList and propertyList of the RenderingManager // local properties have priority as they are not overwritten if preset in both m_PropertyList->ConcatenatePropertyList( m_RenderWindow->GetRenderer()->GetRenderingManager()->GetPropertyList(), false ); // add the overlay to the OverlayContainer in the RenderWindow ... overlay->GetWidget()->setParent( m_PositionedOverlays[ pos ] ); // ... and set it up with the correct properties this->UpdateOverlayData( overlay ); // add overlay to list of all overlays and correctly put it into the layering m_AllOverlays.push_back( overlay ); this->RestackOverlays( pos ); // ... and reset the position of the widgets - this->AdjustOverlayPosition(); + this->AdjustOverlayPosition( pos ); } } void QmitkOverlayController::UpdateOverlayData( QmitkOverlay* overlay ) { if ( overlay != NULL) { overlay->GenerateData( m_PropertyList ); + AdjustOverlayPosition( overlay->GetPosition() ); + + } +} + +void QmitkOverlayController::RemoveAllOverlays() +{ + foreach( QmitkOverlay* overlay, m_AllOverlays ) + { + overlay->GetWidget()->setParent( NULL ); + overlay->GetWidget()->hide(); + overlay->deleteLater(); } + + m_AllOverlays.clear(); } + void QmitkOverlayController::RemoveOverlay( QmitkOverlay* overlay ) { if ( overlay != NULL ) { // get desired position and layer of the overlay QmitkOverlay::DisplayPosition pos = overlay->GetPosition(); OverlayVector::iterator iter = std::find( m_AllOverlays.begin(), m_AllOverlays.end(), overlay ); if ( iter != m_AllOverlays.end() ) { m_AllOverlays.erase( iter ); overlay->GetWidget()->setParent( NULL ); overlay->GetWidget()->hide(); if ( m_PositionedOverlays[ pos ]->layout()->isEmpty() ) { m_PositionedOverlays[ pos ]->hide(); } else { this->RestackOverlays( pos ); // reset the position of the widgets - this->AdjustOverlayPosition(); + this->AdjustOverlayPosition( pos ); } } overlay->deleteLater(); } + } void QmitkOverlayController::AlignOverlays() { //OverlayVector::iterator overlayIter; //for ( overlayIter=m_AllOverlays.begin(); overlayIter!=m_AllOverlays.end(); overlayIter++ ) //{ // int stackLayer = dynamic_cast( m_PositionedOverlays[ (*overlayIter)->GetPosition() ]->layout() )->isEmpty() ? 0 : layer; // dynamic_cast( m_PositionedOverlays[ (*overlayIter)->GetPosition() ]->layout() )->addWidget( (*overlayIter)->GetWidget(), stackLayer, Qt::AlignLeft ); //} } void QmitkOverlayController::RestackOverlays( QmitkOverlay::DisplayPosition pos ) { OverlayVector::iterator overlayIter; QBoxLayout* layout = dynamic_cast( m_PositionedOverlays[ pos ]->layout() ); std::sort( m_AllOverlays.begin(), m_AllOverlays.end() ); for ( overlayIter=m_AllOverlays.begin(); overlayIter!=m_AllOverlays.end(); overlayIter++ ) { // do nothing if the overlay is not in the right position if ( (*overlayIter)->GetPosition() != pos ) { continue; } // determine the desired stacking layer // if the overlay-container is empty, simply append the overlay to the list // if it's not empty, use the layer of the overlay unsigned int layer = (*overlayIter)->GetLayer(); int stackLayer = 0; if ( !layout->isEmpty() ) { stackLayer = layer; } switch ( pos ) { // same alignment for all lefts, ... case QmitkOverlay::top_Left : {} case QmitkOverlay::middle_Left : {} case QmitkOverlay::bottom_Left : { layout->insertWidget( stackLayer, (*overlayIter)->GetWidget(), 0, Qt::AlignLeft ); break; } // ... for all centers, ... case QmitkOverlay::top_Center : {} case QmitkOverlay::bottom_Center : { layout->insertWidget( stackLayer, (*overlayIter)->GetWidget(), 0, Qt::AlignCenter ); break; } // ... and for all rights case QmitkOverlay::top_Right : {} case QmitkOverlay::middle_Right : {} case QmitkOverlay::bottom_Right : { layout->insertWidget( stackLayer, (*overlayIter)->GetWidget(), 0, Qt::AlignRight ); break; } } } } void QmitkOverlayController::UpdateAllOverlays() { foreach( QmitkOverlay* overlay, m_AllOverlays ) { this->UpdateOverlayData( overlay ); } } + +QSize QmitkOverlayController::GetMinimumSizeForWidget( QmitkOverlay::DisplayPosition displayPosition ) +{ + int width = 0; + int height = 0; + + foreach( QmitkOverlay* overlay, m_AllOverlays ) + { + if ( overlay->GetPosition() == displayPosition ) + { + QSize overlaySize = overlay->GetNeededSize(); + width = std::max( width, overlaySize.width() ); + height = std::max( height, overlaySize.height() ); + } + } + + QSize result( width, height ); + return result; +} + + diff --git a/Modules/Overlays/QmitkOverlayController.h b/Modules/Overlays/QmitkOverlayController.h index 6bcf611ac4..e4a1a58f22 100644 --- a/Modules/Overlays/QmitkOverlayController.h +++ b/Modules/Overlays/QmitkOverlayController.h @@ -1,163 +1,168 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 MITKOVERLAYCONTROLLER_H_HEADER_INCLUDED_C1E77191 #define MITKOVERLAYCONTROLLER_H_HEADER_INCLUDED_C1E77191 // MITK-Stuff #include "mitkCommon.h" #include "mitkPropertyList.h" #include "QmitkOverlay.h" #include #include #include "OverlaysExports.h" class QmitkRenderWindow; /** \class QmitkOverlayController * \brief controller that manages the positioning and stacking of QmitkOverlays * * This controller manages all QmitkOverlays of one QmitkRenderWindow. * * When constructed, it creates one QWidget for each possible display-position and sets the * appropriate attributes and layouts. * * It is possible to add new Overlays using AddOverlay( QmitkOverlay ). * This overlay will be added to the correct Widget according to its destined position (stored in QmitkOverlay). * If this widget already holds an overlay, the layer-property is taken into account. If no layer has been set, * the overlay will be appended at the end. * * It is possible to set the visibility of all overlays at a time using SetOverlayVisibility(bool). * * RenderWindow specific properties can be set using the internal mitk::PropertyList. This propertyList and the * 'default' propertyList of the RenderingManager will be concatenated before the overlay is set up. * If one property exists in both propertyLists, the one in the QmitkOverlayController will be used! * * \sa QmitkOverlay * \sa QmitkRenderWindow * \ingroup Qmitk */ class Overlays_EXPORT QmitkOverlayController : public QObject { Q_OBJECT public: /** * \brief constructor with mandatory QmitkRenderWindow and optional mitk::PropertyList */ QmitkOverlayController( QmitkRenderWindow* rw, mitk::PropertyList* pl = NULL ); virtual ~QmitkOverlayController(); /** * \brief adds an instance of QmitkOverlay to the RenderWindow * * This method adds the given QmitkOverlay as a sub-widget to the registered RenderWindow. * It will be added to the correct position in the RenderWindow as it's defined by the overlays * position-variable. The layer-property will only be considered if necessary. */ void AddOverlay( QmitkOverlay* ); void RemoveOverlay( QmitkOverlay* ); + void RemoveAllOverlays(); + + /** * \brief setting the visibility of all overlays */ void SetOverlayVisibility( bool visible ); /** * \brief getter for the RenderWindow-specific PropertyList */ mitk::PropertyList* GetPropertyList(); /** * \brief setter for the RenderWindow-specific PropertyList */ void SetPropertyList( mitk::PropertyList* ); public slots : /** * \brief adjusts the position of all overlays to the position of the RenderWindow * * This method updates the position of all Widgets according to the position of the RenderWindow * and the extend of the overlays. */ - void AdjustOverlayPosition(); + void AdjustAllOverlayPosition(); + + void AdjustOverlayPosition( QmitkOverlay::DisplayPosition displayPosition ); void UpdateAllOverlays(); void UpdateOverlayData( QmitkOverlay* overlay ); - protected: /** * \brief setting up the widgets that will hold all overlays * * This method sets up the 8 QWidgets that will later hold all QmitkOverlays. * This includes the correct setting of layouts, alignments and the widget * attributes necessary to achieve a translucent background and correct rendering * on all platforms. */ void InitializeOverlayLayout(); /** * \brief re-aligning the overlays - not implemented yet */ virtual void AlignOverlays(); /** * \brief initializes one QWidget - internally used by InitializeOverlayLayout() */ void InitializeWidget( QmitkOverlay::DisplayPosition pos ); void RestackOverlays( QmitkOverlay::DisplayPosition pos ); + QSize GetMinimumSizeForWidget( QmitkOverlay::DisplayPosition displayPosition ); typedef std::map< QmitkOverlay::DisplayPosition, QWidget* > OverlayPositionMap; typedef std::vector< QmitkOverlay* > OverlayVector; /** * \brief all QmitkOverlays that are currently added */ OverlayVector m_AllOverlays; /** * \brief all possible positions and the QWidgets representing the corresponding QmitkOverlays */ OverlayPositionMap m_PositionedOverlays; /** * \brief RenderWindow that all Overlays will be added to */ QmitkRenderWindow* m_RenderWindow; /** * \brief PropertyList for RenderWindow-specific properties */ mitk::PropertyList::Pointer m_PropertyList; }; #endif /* MITKOVERLAYCONTROLLER_H_HEADER_INCLUDED_C1E77191 */ diff --git a/Modules/Overlays/QmitkScalarBarOverlay.cpp b/Modules/Overlays/QmitkScalarBarOverlay.cpp index c0d77b4016..710e315f63 100644 --- a/Modules/Overlays/QmitkScalarBarOverlay.cpp +++ b/Modules/Overlays/QmitkScalarBarOverlay.cpp @@ -1,126 +1,139 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 "QmitkScalarBarOverlay.h" #include "mitkProperties.h" #include "mitkColorProperty.h" #include "mitkPropertyList.h" #include #include QmitkScalarBarOverlay::QmitkScalarBarOverlay( const char* id ) :QmitkOverlay(id) , m_ScalarBar( NULL ) , m_ObserverTag(0) { m_Widget = m_ScalarBar = new QmitkScalarBar(); QmitkOverlay::AddDropShadow( m_ScalarBar ); } QmitkScalarBarOverlay::~QmitkScalarBarOverlay() { m_PropertyList->GetProperty( m_Id )->RemoveObserver(m_ObserverTag); m_PropertyList = NULL; } void QmitkScalarBarOverlay::GenerateData( mitk::PropertyList::Pointer pl ) { if ( pl.IsNull() ) return; m_PropertyList = pl->Clone(); if ( m_PropertyList.IsNotNull() ) { this->SetupCallback( m_PropertyList->GetProperty( m_Id ) ); this->GetProperties( pl ); this->SetScaleFactor(); } else { MITK_DEBUG << "invalid propList"; } } void QmitkScalarBarOverlay::SetScaleFactor() { float scale = 2; if ( m_PropertyList.IsNull() || !m_PropertyList->GetFloatProperty( m_Id, scale ) ) { MITK_DEBUG << "Property " << m_Id << " could not be found"; } if ( m_ScalarBar != NULL ) { m_ScalarBar->SetScaleFactor( scale ); } } void QmitkScalarBarOverlay::GetProperties( mitk::PropertyList::Pointer pl ) { if ( pl.IsNull() ) return; QPen pen = QPen(); mitk::PropertyList::Pointer propertyList = pl; QPalette palette = QPalette(); // get the desired color of the textOverlays mitk::ColorProperty::Pointer colorProp = dynamic_cast( propertyList->GetProperty( "overlay.color" ) ); if ( colorProp.IsNull() ) { MITK_DEBUG << "creating new colorProperty"; colorProp = mitk::ColorProperty::New( 127.0, 196.0, 232.0 ); } mitk::Color color = colorProp->GetColor(); pen.setColor( QColor( color[0],color[1],color[2],255 ) ); pen.setStyle( Qt::SolidLine ); pen.setCapStyle( Qt::FlatCap ); pen.setJoinStyle( Qt::MiterJoin ); m_ScalarBar->SetPen( pen ); } void QmitkScalarBarOverlay::SetupCallback( mitk::BaseProperty::Pointer prop ) { - if ( prop.IsNotNull() ) - { - prop->RemoveObserver(m_ObserverTag); - typedef itk::SimpleMemberCommand< QmitkScalarBarOverlay > MemberCommandType; - MemberCommandType::Pointer propModifiedCommand; - propModifiedCommand = MemberCommandType::New(); - propModifiedCommand->SetCallbackFunction( this, &QmitkScalarBarOverlay::SetScaleFactor ); - m_ObserverTag = prop->AddObserver( itk::ModifiedEvent(), propModifiedCommand ); + if ( m_ObservedProperty != prop && m_ObserverTag == 0 ) + { + if ( prop.IsNotNull() ) + { + if ( m_ObservedProperty.IsNotNull() ) + { + m_ObservedProperty->RemoveObserver( m_ObserverTag ); + } + + typedef itk::SimpleMemberCommand< QmitkScalarBarOverlay > MemberCommandType; + MemberCommandType::Pointer propModifiedCommand; + propModifiedCommand = MemberCommandType::New(); + propModifiedCommand->SetCallbackFunction( this, &QmitkScalarBarOverlay::SetScaleFactor ); + m_ObserverTag = prop->AddObserver( itk::ModifiedEvent(), propModifiedCommand ); + } + + m_ObservedProperty = prop; } else { MITK_DEBUG << "invalid property"; } } +QSize QmitkScalarBarOverlay::GetNeededSize() +{ + return m_Widget->size(); +} diff --git a/Modules/Overlays/QmitkScalarBarOverlay.h b/Modules/Overlays/QmitkScalarBarOverlay.h index 86506d198f..afe499575a 100644 --- a/Modules/Overlays/QmitkScalarBarOverlay.h +++ b/Modules/Overlays/QmitkScalarBarOverlay.h @@ -1,90 +1,94 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB #define MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB #include "OverlaysExports.h" // MITK-Stuff #include "mitkCommon.h" #include "mitkPropertyList.h" #include "QmitkOverlay.h" #include /** \class QmitkScalarBarOverlay * \brief object representing a text that is drawn as an overlay * * \ingroup Qmitk */ class Overlays_EXPORT QmitkScalarBarOverlay : public QmitkOverlay { Q_OBJECT public: /** * @brief Default Constructor **/ QmitkScalarBarOverlay( const char* id ); /** * @brief Default Destructor **/ virtual ~QmitkScalarBarOverlay(); /** * \brief Setup the QLabel with overlay specific information * * First, this method sets text-overlay specific properties as described in the class docu above. * Secondly, the actual text of the label is set. * * \WARNING No error will be issued if the property containing the text is not found, the TextOverlay * will show an empty string! */ virtual void GenerateData( mitk::PropertyList::Pointer ); + QSize GetNeededSize(); + + protected: /** * \brief internal helper class to determine text-properties * * This method is only used internally to apply the text specific properties that can be set * using a mitk::PropertyList. If a property cannot be found, a default value is used. * * The values of these properties are then attributed to the label using QFont and QPalette. */ void GetProperties( mitk::PropertyList::Pointer ); void SetupCallback( mitk::BaseProperty::Pointer prop ); void SetScaleFactor(); - /** \brief QWidget internally representing the TextOverlay */ QmitkScalarBar* m_ScalarBar; + mitk::BaseProperty::Pointer m_ObservedProperty; + mitk::PropertyList::Pointer m_PropertyList; unsigned long m_ObserverTag; }; #endif /* MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB */ diff --git a/Modules/Overlays/QmitkTextOverlay.cpp b/Modules/Overlays/QmitkTextOverlay.cpp index 48b14ade78..0df0542707 100644 --- a/Modules/Overlays/QmitkTextOverlay.cpp +++ b/Modules/Overlays/QmitkTextOverlay.cpp @@ -1,149 +1,169 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 "QmitkTextOverlay.h" #include "mitkProperties.h" #include "mitkColorProperty.h" #include "mitkPropertyList.h" #include QmitkTextOverlay::QmitkTextOverlay( const char* id ) : QmitkOverlay(id) +, m_ObservedProperty( NULL ) , m_ObserverTag(0) { m_Widget = m_Label = new QLabel(); QmitkOverlay::AddDropShadow( m_Widget ); } QmitkTextOverlay::~QmitkTextOverlay() { m_PropertyList->GetProperty( m_Id )->RemoveObserver(m_ObserverTag); } void QmitkTextOverlay::GenerateData( mitk::PropertyList::Pointer pl ) { if ( pl.IsNull() ) return; m_PropertyList = pl; if ( m_PropertyList.IsNotNull() ) { this->SetupCallback( m_PropertyList->GetProperty( m_Id ) ); this->UpdateFontProperties( pl ); this->UpdateDisplayedTextFromProperties(); } else { MITK_ERROR << "invalid propList"; } } void QmitkTextOverlay::UpdateDisplayedTextFromProperties() { std::string text; if ( m_PropertyList.IsNull() || !m_PropertyList->GetStringProperty( m_Id, text ) ) { MITK_DEBUG << "Property " << m_Id << " could not be found"; } - m_Label->setText( text.c_str() ); - m_Label->repaint(); + if ( text != m_Label->text().toStdString() ) + { + m_Label->setText( text.c_str() ); + m_Label->repaint(); + } } void QmitkTextOverlay::UpdateFontProperties( mitk::PropertyList::Pointer pl ) { if ( pl.IsNull() ) return; mitk::PropertyList::Pointer propertyList = pl; QPalette palette = QPalette(); QFont font = QFont(); // get the desired color of the textOverlays mitk::ColorProperty::Pointer colorProp = dynamic_cast( propertyList->GetProperty( "overlay.color" ) ); if ( colorProp.IsNull() ) { colorProp = mitk::ColorProperty::New( 127.0, 196.0, 232.0 ); } mitk::Color color = colorProp->GetColor(); palette.setColor( QPalette::Foreground, QColor( color[0],color[1],color[2],255 ) ); palette.setColor( QPalette::Window, Qt::transparent); m_Label->setPalette( palette ); // get the desired opacity of the overlays //mitk::FloatProperty::Pointer opacityProperty = // dynamic_cast( propertyList->GetProperty( "overlay.opacity" ) ); //if ( opacityProperty.IsNull() ) //{ // m_Label->setWindowOpacity( 1 ); //} //else //{ // m_Label->setWindowOpacity( opacityProperty->GetValue() ); //} //set the desired font-size of the overlays int fontSize = 0; if ( !propertyList->GetIntProperty( "overlay.fontSize", fontSize ) ) { fontSize = 9.5; } font.setPointSize( fontSize ); bool useKerning = false; if ( !propertyList->GetBoolProperty( "overlay.kerning", useKerning ) ) { useKerning = true; } font.setKerning( useKerning ); std::string fontFamily = ""; if ( !propertyList->GetStringProperty( "overlay.fontFamily", fontFamily ) ) { fontFamily = "Verdana"; } font.setFamily( QString(fontFamily.c_str()) ); m_Label->setFont( font ); } void QmitkTextOverlay::SetupCallback( mitk::BaseProperty::Pointer prop ) { - if ( prop.IsNotNull() ) + if ( m_ObservedProperty != prop && m_ObserverTag == 0 ) { - prop->RemoveObserver(m_ObserverTag); - - typedef itk::SimpleMemberCommand< QmitkTextOverlay > MemberCommandType; - MemberCommandType::Pointer propModifiedCommand; - propModifiedCommand = MemberCommandType::New(); - propModifiedCommand->SetCallbackFunction( this, &QmitkTextOverlay::UpdateDisplayedTextFromProperties ); - m_ObserverTag = prop->AddObserver( itk::ModifiedEvent(), propModifiedCommand ); + if ( prop.IsNotNull() ) + { + if ( m_ObservedProperty.IsNotNull() ) + { + m_ObservedProperty->RemoveObserver( m_ObserverTag ); + } + + typedef itk::SimpleMemberCommand< QmitkTextOverlay > MemberCommandType; + MemberCommandType::Pointer propModifiedCommand; + propModifiedCommand = MemberCommandType::New(); + propModifiedCommand->SetCallbackFunction( this, &QmitkTextOverlay::UpdateDisplayedTextFromProperties ); + m_ObserverTag = prop->AddObserver( itk::ModifiedEvent(), propModifiedCommand ); + } + + m_ObservedProperty = prop; } else { MITK_DEBUG << "invalid property"; } } +QSize QmitkTextOverlay::GetNeededSize() +{ + QFont font = m_Label->font(); + QFontMetrics fm(font); + + return fm.size( Qt::TextSingleLine, m_Label->text() ); +} + diff --git a/Modules/Overlays/QmitkTextOverlay.h b/Modules/Overlays/QmitkTextOverlay.h index 6348ea4711..78c9f91f91 100644 --- a/Modules/Overlays/QmitkTextOverlay.h +++ b/Modules/Overlays/QmitkTextOverlay.h @@ -1,114 +1,119 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. 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 MITKTEXTOVERLAY_H_HEADER_INCLUDED_C10DC4EB #define MITKTEXTOVERLAY_H_HEADER_INCLUDED_C10DC4EB // MITK #include "mitkCommon.h" #include "mitkPropertyList.h" #include "QmitkOverlay.h" // Qt #include #include "OverlaysExports.h" /** \class QmitkTextOverlay * \brief object representing a text that is drawn as an overlay * * A QmitkTextOverlay is a text-specific implementation of QmitkOverlay. * It can be used whenever a simple text is to be rendered as an overlay in * a QmitkRenderWindow. * * Instead of a QWidget (as in QmitkOverlay) a QmitkTextOverlay is internally * represented by a QLabel. You can access it via GetWidget(). * * Calling GenerateData( mitk::PropertyList::Pointer ) will setup the textoverlay. * This includes setting of the actual text (that must be stored in the property * with the name that is given the overlay as ID). * * e.g. mitk::StringProperty::Pointer nameProp = mitk::StringProperty::New( "overlay.text.patientName", "Max" ); * -- * QmitkTextOverlay* nameOverlay = new QmitkTextOverlay( "overlay.text.patientName" ); * * In order to customize the look of the textoverlays, a number of additional properties can be set * (default values in square brackets): * * overlay.color : defines the text-color (mitk::ColorProperty) * overlay.fontSize : defines the fontSize of the text (mitk::IntProperty) * overlay.kerning : defines if kerning is to be used (mitk::BoolProperty) * overlay.fontFamily : defines the fon family that is to be used (mitk::StringProperty) * * \ingroup Qmitk */ class Overlays_EXPORT QmitkTextOverlay : public QmitkOverlay { public: /** * @brief Default Constructor **/ QmitkTextOverlay( const char* id ); /** * @brief Default Destructor **/ virtual ~QmitkTextOverlay(); /** * \brief Setup the QLabel with overlay specific information * * First, this method sets text-overlay specific properties as described in the class docu above. * Secondly, the actual text of the label is set. * * \WARNING No error will be issued if the property containing the text is not found, the TextOverlay * will show an empty string! */ void GenerateData( mitk::PropertyList::Pointer ); + QSize GetNeededSize(); + + protected: /** * \brief internal helper class to determine text-properties * * This method is only used internally to apply the font specific properties that can be set * using a mitk::PropertyList. If a property cannot be found, a default value is used. * * The values of these properties are then attributed to the QLabel using QFont and QPalette. */ void UpdateFontProperties( mitk::PropertyList::Pointer ); void SetupCallback( mitk::BaseProperty::Pointer prop ); void UpdateDisplayedTextFromProperties(); /** \brief QLabel internally representing the TextOverlay */ QLabel* m_Label; mitk::PropertyList::Pointer m_PropertyList; + mitk::BaseProperty::Pointer m_ObservedProperty; + unsigned long m_ObserverTag; }; #endif /* MITKTEXTOVERLAY_H_HEADER_INCLUDED_C10DC4EB */