diff --git a/Modules/QtOverlays/QmitkOverlay.h b/Modules/QtOverlays/QmitkOverlay.h index 8e3a83a524..635febcf58 100644 --- a/Modules/QtOverlays/QmitkOverlay.h +++ b/Modules/QtOverlays/QmitkOverlay.h @@ -1,133 +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 +#include /** \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 MitkOverlays_EXPORT QmitkOverlay : public QObject +class MitkQtOverlays_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/QtOverlays/QmitkOverlayController.h b/Modules/QtOverlays/QmitkOverlayController.h index c524d4e8bd..192b2adec9 100644 --- a/Modules/QtOverlays/QmitkOverlayController.h +++ b/Modules/QtOverlays/QmitkOverlayController.h @@ -1,168 +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 +#include 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 MitkOverlays_EXPORT QmitkOverlayController : public QObject +class MitkQtOverlays_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 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/QtOverlays/QmitkScalarBar.h b/Modules/QtOverlays/QmitkScalarBar.h index 4c37bd3321..a327a84aee 100644 --- a/Modules/QtOverlays/QmitkScalarBar.h +++ b/Modules/QtOverlays/QmitkScalarBar.h @@ -1,86 +1,86 @@ /*=================================================================== 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 MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB #define MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB #include -#include +#include #include #include -class MitkOverlays_EXPORT QmitkScalarBar : public QWidget +class MitkQtOverlays_EXPORT QmitkScalarBar : public QWidget { Q_OBJECT public: enum alignment { vertical = 0, horizontal = 1 }; /** * @brief Default Constructor **/ QmitkScalarBar( QWidget *parent = 0 ); /** * @brief Default Destructor **/ virtual ~QmitkScalarBar(); virtual void SetScaleFactor( double scale ); virtual void SetAlignment( alignment align ); void SetPen( const QPen& pen ); void SetNumberOfSubdivisions( unsigned int subs ); unsigned int GetNumberOfSubdivisions(); protected: void paintEvent(QPaintEvent* event); void SetupGeometry( alignment align ); void CleanUpLines(); //void moveEvent(QMoveEvent*); alignment m_Alignment; double m_ScaleFactor; QLine* m_MainLine; std::vector m_SubDivisionLines; QPen m_Pen; unsigned int m_NumberOfSubDivisions; }; #endif /* MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB */ diff --git a/Modules/QtOverlays/QmitkScalarBarOverlay.h b/Modules/QtOverlays/QmitkScalarBarOverlay.h index e514c8a4dc..506b28526f 100644 --- a/Modules/QtOverlays/QmitkScalarBarOverlay.h +++ b/Modules/QtOverlays/QmitkScalarBarOverlay.h @@ -1,94 +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 +#include // 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 MitkOverlays_EXPORT QmitkScalarBarOverlay : public QmitkOverlay + class MitkQtOverlays_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 */