diff --git a/Core/Code/Rendering/mitkSurfaceVtkMapper2D.cpp b/Core/Code/Rendering/mitkSurfaceVtkMapper2D.cpp
index fc838f4fb2..e7819c7bc6 100644
--- a/Core/Code/Rendering/mitkSurfaceVtkMapper2D.cpp
+++ b/Core/Code/Rendering/mitkSurfaceVtkMapper2D.cpp
@@ -1,336 +1,334 @@
 /*===================================================================
 
 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 "mitkSurfaceVtkMapper2D.h"
 
 //mitk includes
 #include <mitkDataNode.h>
 #include <mitkProperties.h>
 #include "mitkVtkPropRenderer.h"
 #include <mitkSurface.h>
 #include <mitkLookupTableProperty.h>
 #include <mitkVtkScalarModeProperty.h>
 #include <mitkCoreServices.h>
 #include <mitkIPropertyAliases.h>
 #include <mitkIPropertyDescriptions.h>
 
 //vtk includes
 #include <vtkActor.h>
 #include <vtkCutter.h>
 #include <vtkLookupTable.h>
 #include <vtkPlane.h>
 #include <vtkPolyData.h>
 #include <vtkPropAssembly.h>
 #include <vtkPointData.h>
-
 #include <vtkGlyph3D.h>
 #include <vtkReverseSense.h>
 #include <vtkArrowSource.h>
-#include <mitkIOUtil.h>
 
 // constructor LocalStorage
 mitk::SurfaceVtkMapper2D::LocalStorage::LocalStorage()
 {
   m_Mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
   m_Mapper->ScalarVisibilityOff();
   m_Actor = vtkSmartPointer<vtkActor>::New();
   m_Actor->SetMapper( m_Mapper );
   m_PropAssembly = vtkSmartPointer <vtkPropAssembly>::New();
   m_PropAssembly->AddPart( m_Actor );
   m_CuttingPlane = vtkSmartPointer<vtkPlane>::New();
   m_Cutter = vtkSmartPointer<vtkCutter>::New();
   m_Cutter->SetCutFunction(m_CuttingPlane);
   m_Mapper->SetInputConnection( m_Cutter->GetOutputPort() );
 
   m_NormalGlyph = vtkSmartPointer<vtkGlyph3D>::New();
 
   m_InverseNormalGlyph = vtkSmartPointer<vtkGlyph3D>::New();
 
   // Source for the glyph filter
   m_ArrowSource = vtkSmartPointer<vtkArrowSource>::New();
-  //set small default values for fast/fluent rendering
+  //set small default values for fast rendering
   m_ArrowSource->SetTipRadius(0.05);
   m_ArrowSource->SetTipLength(0.20);
   m_ArrowSource->SetTipResolution(5);
   m_ArrowSource->SetShaftResolution(5);
   m_ArrowSource->SetShaftRadius(0.01);
 
   m_NormalGlyph->SetSourceConnection(m_ArrowSource->GetOutputPort());
   m_NormalGlyph->SetVectorModeToUseNormal();
   m_NormalGlyph->OrientOn();
 
   m_InverseNormalGlyph->SetSourceConnection(m_ArrowSource->GetOutputPort());
   m_InverseNormalGlyph->SetVectorModeToUseNormal();
   m_InverseNormalGlyph->OrientOn();
 
   m_NormalMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
   m_NormalMapper->SetInputConnection(m_NormalGlyph->GetOutputPort());
   m_NormalMapper->ScalarVisibilityOff();
 
   m_InverseNormalMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
   m_InverseNormalMapper->SetInputConnection(m_NormalGlyph->GetOutputPort());
   m_InverseNormalMapper->ScalarVisibilityOff();
 
   m_NormalActor = vtkSmartPointer<vtkActor>::New();
   m_NormalActor->SetMapper(m_NormalMapper);
 
   m_InverseNormalActor = vtkSmartPointer<vtkActor>::New();
   m_InverseNormalActor->SetMapper(m_InverseNormalMapper);
 
   m_ReverseSense = vtkSmartPointer<vtkReverseSense>::New();
 
   m_PropAssembly->AddPart( m_NormalActor );
 }
 
 // destructor LocalStorage
 mitk::SurfaceVtkMapper2D::LocalStorage::~LocalStorage()
 {
 }
 
 const mitk::Surface* mitk::SurfaceVtkMapper2D::GetInput() const
 {
   return static_cast<const mitk::Surface * > ( GetDataNode()->GetData() );
 }
 
 // constructor PointSetVtkMapper2D
 mitk::SurfaceVtkMapper2D::SurfaceVtkMapper2D()
 {
 }
 
 mitk::SurfaceVtkMapper2D::~SurfaceVtkMapper2D()
 {
 }
 
 // reset mapper so that nothing is displayed e.g. toggle visiblity of the propassembly
 void mitk::SurfaceVtkMapper2D::ResetMapper( BaseRenderer* renderer )
 {
   LocalStorage *ls = m_LSH.GetLocalStorage(renderer);
   ls->m_PropAssembly->VisibilityOff();
 }
 
 vtkProp* mitk::SurfaceVtkMapper2D::GetVtkProp(mitk::BaseRenderer * renderer)
 {
   LocalStorage *ls = m_LSH.GetLocalStorage(renderer);
   return ls->m_PropAssembly;
 }
 
 void mitk::SurfaceVtkMapper2D::Update(mitk::BaseRenderer* renderer)
 {
   const mitk::DataNode* node = GetDataNode();
   if( node == NULL )
     return;
   bool visible = true;
   node->GetVisibility(visible, renderer, "visible");
   if ( !visible )
     return;
 
   mitk::Surface* surface  = static_cast<mitk::Surface *>( node->GetData() );
   if ( surface == NULL )
     return;
 
   // Calculate time step of the input data for the specified renderer (integer value)
   this->CalculateTimeStep( renderer );
 
   // Check if time step is valid
   const mitk::TimeGeometry *dataTimeGeometry = surface->GetTimeGeometry();
   if ( ( dataTimeGeometry == NULL )
        || ( dataTimeGeometry->CountTimeSteps() == 0 )
        || ( !dataTimeGeometry->IsValidTimeStep( this->GetTimestep() ) ) )
   {
     return;
   }
 
   surface->UpdateOutputInformation();
   LocalStorage* localStorage = m_LSH.GetLocalStorage(renderer);
 
   //check if something important has changed and we need to rerender
   if ( (localStorage->m_LastUpdateTime < node->GetMTime()) //was the node modified?
        || (localStorage->m_LastUpdateTime < surface->GetPipelineMTime()) //Was the data modified?
        || (localStorage->m_LastUpdateTime < renderer->GetCurrentWorldPlaneGeometryUpdateTime()) //was the geometry modified?
        || (localStorage->m_LastUpdateTime < renderer->GetCurrentWorldPlaneGeometry()->GetMTime())
        || (localStorage->m_LastUpdateTime < node->GetPropertyList()->GetMTime()) //was a property modified?
        || (localStorage->m_LastUpdateTime < node->GetPropertyList(renderer)->GetMTime()) )
   {
     this->GenerateDataForRenderer( renderer );
   }
 
   // since we have checked that nothing important has changed, we can set
   // m_LastUpdateTime to the current time
   localStorage->m_LastUpdateTime.Modified();
 }
 
 void mitk::SurfaceVtkMapper2D::GenerateDataForRenderer( mitk::BaseRenderer *renderer )
 {
   const DataNode* node = GetDataNode();
   Surface* surface  = static_cast<Surface *>( node->GetData() );
   const TimeGeometry *dataTimeGeometry = surface->GetTimeGeometry();
   LocalStorage* localStorage = m_LSH.GetLocalStorage(renderer);
 
   ScalarType time =renderer->GetTime();
   int timestep=0;
 
   if( time > itk::NumericTraits<ScalarType>::NonpositiveMin() )
     timestep = dataTimeGeometry->TimePointToTimeStep( time );
 
   vtkSmartPointer<vtkPolyData> inputPolyData = surface->GetVtkPolyData( timestep );
   if((inputPolyData==NULL) || (inputPolyData->GetNumberOfPoints() < 1 ))
     return;
 
   //apply color and opacity read from the PropertyList
   this->ApplyAllProperties(renderer);
 
   const PlaneGeometry* planeGeometry = renderer->GetCurrentWorldPlaneGeometry();
   if( ( planeGeometry == NULL ) || ( !planeGeometry->IsValid() ) || ( !planeGeometry->HasReferenceGeometry() ))
   {
     return;
   }
 
   double origin[3];
   origin[0] = planeGeometry->GetOrigin()[0];
   origin[1] = planeGeometry->GetOrigin()[1];
   origin[2] = planeGeometry->GetOrigin()[2];
 
   double normal[3];
   normal[0] = planeGeometry->GetNormal()[0];
   normal[1] = planeGeometry->GetNormal()[1];
   normal[2] = planeGeometry->GetNormal()[2];
 
   localStorage->m_CuttingPlane->SetOrigin(origin);
   localStorage->m_CuttingPlane->SetNormal(normal);
 
   localStorage->m_Cutter->SetInputData(inputPolyData);
   localStorage->m_Cutter->Update();
 
   bool generateNormals = false;
   node->GetBoolProperty("draw normals 2D", generateNormals);
   if(generateNormals)
   {
     localStorage->m_NormalGlyph->SetInputConnection( localStorage->m_Cutter->GetOutputPort() );
     localStorage->m_NormalGlyph->Update();
 
     localStorage->m_NormalMapper->SetInputConnection( localStorage->m_NormalGlyph->GetOutputPort() );
 
     localStorage->m_PropAssembly->AddPart( localStorage->m_NormalActor );
   }
   else
   {
     localStorage->m_NormalGlyph->SetInputConnection( NULL );
     localStorage->m_PropAssembly->RemovePart( localStorage->m_NormalActor );
   }
 
   bool generateInverseNormals = false;
   node->GetBoolProperty("invert normals", generateInverseNormals);
   if(generateInverseNormals)
   {
 
     localStorage->m_ReverseSense->SetInputConnection( localStorage->m_Cutter->GetOutputPort() );
     localStorage->m_ReverseSense->ReverseCellsOff();
     localStorage->m_ReverseSense->ReverseNormalsOn();
 
     localStorage->m_InverseNormalGlyph->SetInputConnection( localStorage->m_ReverseSense->GetOutputPort() );
     localStorage->m_InverseNormalGlyph->Update();
 
     localStorage->m_InverseNormalMapper->SetInputConnection( localStorage->m_InverseNormalGlyph->GetOutputPort() );
 
     localStorage->m_PropAssembly->AddPart( localStorage->m_InverseNormalActor );
   }
   else
   {
     localStorage->m_ReverseSense->SetInputConnection( NULL );
     localStorage->m_PropAssembly->RemovePart( localStorage->m_InverseNormalActor );
   }
 }
 
 void mitk::SurfaceVtkMapper2D::ApplyAllProperties(mitk::BaseRenderer* renderer)
 {
   const DataNode * node = GetDataNode();
 
   if(node == NULL)
   {
     return;
   }
 
   float lineWidth = 1.0f;
   node->GetFloatProperty("line width", lineWidth, renderer);
 
   LocalStorage* localStorage = m_LSH.GetLocalStorage(renderer);
 
   // check for color and opacity properties, use it for rendering if they exists
   float color[3]= { 1.0f, 1.0f, 1.0f };
   node->GetColor(color, renderer, "color");
   float opacity = 1.0f;
   node->GetOpacity(opacity, renderer, "opacity");
 
   //Pass properties to VTK
   localStorage->m_Actor->GetProperty()->SetColor(color[0], color[1], color[2]);
   localStorage->m_Actor->GetProperty()->SetOpacity(opacity);
   localStorage->m_NormalActor->GetProperty()->SetOpacity(opacity);
   localStorage->m_InverseNormalActor->GetProperty()->SetOpacity(opacity);
   localStorage->m_Actor->GetProperty()->SetLineWidth(lineWidth);
   //By default, the cutter will also copy/compute normals of the cut
   //to the output polydata. The normals will influence the
   //vtkPolyDataMapper lightning. To view a clean cut the lighting has
   //to be disabled.
   localStorage->m_Actor->GetProperty()->SetLighting(0);
 
   bool scalarVisibility = false;
   node->GetBoolProperty("scalar visibility", scalarVisibility);
   localStorage->m_Mapper->SetScalarVisibility(scalarVisibility);
 
   //color for inverse normals
   float inverseNormalsColor[3]= { 1.0f, 0.0f, 0.0f };
   node->GetColor(inverseNormalsColor, renderer, "back color");
   localStorage->m_InverseNormalActor->GetProperty()->SetColor(inverseNormalsColor[0],
       inverseNormalsColor[1], inverseNormalsColor[2]);
 
   //color for normals
   float normalsColor[3]= { 0.0f, 1.0f, 0.0f };
   node->GetColor(normalsColor, renderer, "front color");
   localStorage->m_NormalActor->GetProperty()->SetColor(normalsColor[0],
       normalsColor[1], normalsColor[2]);
 
   //normals scaling
   float normalScaleFactor = 10.0f;
   node->GetFloatProperty( "front normal lenth (px)", normalScaleFactor, renderer );
   localStorage->m_NormalGlyph->SetScaleFactor(normalScaleFactor);
 
   //inverse normals scaling
   float inverseNormalScaleFactor = 10.0f;
   node->GetFloatProperty( "back normal lenth (px)", inverseNormalScaleFactor, renderer );
   localStorage->m_InverseNormalGlyph->SetScaleFactor(inverseNormalScaleFactor);
 }
 
 void mitk::SurfaceVtkMapper2D::SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer, bool overwrite)
 {
   mitk::IPropertyAliases* aliases = mitk::CoreServices::GetPropertyAliases();
   node->AddProperty( "line width", FloatProperty::New(2.0f), renderer, overwrite );
   aliases->AddAlias( "line width", "Surface.2D.Line Width", "Surface");
   node->AddProperty( "scalar mode", VtkScalarModeProperty::New(), renderer, overwrite );
   node->AddProperty( "draw normals 2D", BoolProperty::New(false), renderer, overwrite );
   aliases->AddAlias( "draw normals 2D", "Surface.2D.Normals.Draw Normals", "Surface");
   node->AddProperty( "invert normals", BoolProperty::New(false), renderer, overwrite );
   aliases->AddAlias( "invert normals", "Surface.2D.Normals.Draw Inverse Normals", "Surface");
   node->AddProperty( "front color", ColorProperty::New(0.0, 1.0, 0.0), renderer, overwrite );
   aliases->AddAlias( "front color", "Surface.2D.Normals.Normals Color", "Surface");
   node->AddProperty( "back color", ColorProperty::New(1.0, 0.0, 0.0), renderer, overwrite );
   aliases->AddAlias( "back color", "Surface.2D.Normals.Inverse Normals Color", "Surface");
   node->AddProperty( "front normal lenth (px)", FloatProperty::New(10.0), renderer, overwrite );
   aliases->AddAlias( "front normal lenth (px)", "Surface.2D.Normals.Normals Scale Factor", "Surface");
   node->AddProperty( "back normal lenth (px)", FloatProperty::New(10.0), renderer, overwrite );
   aliases->AddAlias( "back normal lenth (px)", "Surface.2D.Normals.Inverse Normals Scale Factor", "Surface");
   node->AddProperty( "layer", IntProperty::New(100), renderer, overwrite);
   Superclass::SetDefaultProperties(node, renderer, overwrite);
 }
diff --git a/Core/Code/Rendering/mitkSurfaceVtkMapper2D.h b/Core/Code/Rendering/mitkSurfaceVtkMapper2D.h
index 2ddda46041..fb05ee37e5 100644
--- a/Core/Code/Rendering/mitkSurfaceVtkMapper2D.h
+++ b/Core/Code/Rendering/mitkSurfaceVtkMapper2D.h
@@ -1,181 +1,193 @@
 /*===================================================================
 
 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 mitkSurfaceVtkMapper2D_h
 #define mitkSurfaceVtkMapper2D_h
 
-
 #include <MitkCoreExports.h>
 #include "mitkVtkMapper.h"
 #include "mitkBaseRenderer.h"
 #include "mitkLocalStorageHandler.h"
 
 //VTK
 #include <vtkSmartPointer.h>
 class vtkPropAssembly;
 class vtkCutter;
 class vtkPlane;
 class vtkLookupTable;
 class vtkGlyph3D;
 class vtkArrowSource;
 class vtkReverseSense;
 
 namespace mitk {
 
 class Surface;
 
 /**
   * @brief Vtk-based mapper for cutting 2D slices out of Surfaces.
+  *
+  * The mapper uses a vtkCutter filter to cut out slices of the 3D
+  * volume and render these slices as vtkPolyData.
+  *
+  * Properties:
+  * \b Surface.2D.Line Width: Thickness of the rendered lines in 2D.
+  * \b Surface.2D.Normals.Draw Normals: enables drawing of normals as 3D arrows
+  * in the 2D render window. The normals are created with a vtkGlyph3D from
+  * the vtkPolyData.
+  * \b Surface.2D.Normals.Draw Inverse Normals: same as normals, but in the
+  * other direction. The inverse normals are computed with a vtkReverseSense
+  * filter.
+  * \b Surface.2D.Normals.(Inverse) Normals Color: Color of the (inverse) normals.
+  * \b Surface.2D.Normals.(Inverse) Normals Scale Factor: Regulates the size of the normals.
+  *
   * @ingroup Mapper
   */
 class MITK_CORE_EXPORT SurfaceVtkMapper2D : public VtkMapper
 {
 public:
   mitkClassMacro(SurfaceVtkMapper2D, VtkMapper);
 
   itkFactorylessNewMacro(Self)
   itkCloneMacro(Self)
 
   virtual const mitk::Surface* GetInput() const;
 
   /** \brief returns the prop assembly */
   virtual vtkProp* GetVtkProp(mitk::BaseRenderer* renderer);
 
   /** \brief set the default properties for this mapper */
   static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = NULL, bool overwrite = false);
 
   /** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
   class LocalStorage : public mitk::Mapper::BaseLocalStorage
   {
   public:
     /** \brief Timestamp of last update of stored data. */
     itk::TimeStamp m_LastUpdateTime;
     /**
        * @brief m_PropAssembly Contains all vtkProps for the final rendering.
        *
        * Consists of 3 actors:
        * The surface cut (the slice from the 3D surface).
        * The normals and the inverse normals.
        */
     vtkSmartPointer<vtkPropAssembly> m_PropAssembly;
 
     /**
      * @brief m_Actor actor for the surface cut.
      */
     vtkSmartPointer<vtkActor> m_Actor;
     /**
      * @brief m_NormalActor actor for the normals.
      */
     vtkSmartPointer<vtkActor> m_NormalActor;
     /**
      * @brief m_InverseNormalActor actor for the inverse normals.
      */
     vtkSmartPointer<vtkActor> m_InverseNormalActor;
     /**
        * @brief m_Mapper VTK mapper for all types of 2D polydata e.g. werewolves.
        */
     vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
     /**
        * @brief m_Cutter Filter to cut out the 2D slice.
        */
     vtkSmartPointer<vtkCutter> m_Cutter;
     /**
        * @brief m_CuttingPlane The plane where to cut off the 2D slice.
        */
     vtkSmartPointer<vtkPlane> m_CuttingPlane;
 
     /**
      * @brief m_NormalMapper Mapper for the normals.
      */
     vtkSmartPointer<vtkPolyDataMapper> m_NormalMapper;
 
     /**
      * @brief m_InverseNormalMapper Mapper for the inverse normals.
      */
     vtkSmartPointer<vtkPolyDataMapper> m_InverseNormalMapper;
 
     /**
      * @brief m_NormalGlyph Glyph for creating normals.
      */
     vtkSmartPointer<vtkGlyph3D> m_NormalGlyph;
 
     /**
      * @brief m_InverseNormalGlyph Glyph for creating inverse normals.
      */
     vtkSmartPointer<vtkGlyph3D> m_InverseNormalGlyph;
 
     /**
      * @brief m_ArrowSource Arrow representation of the normals.
      */
     vtkSmartPointer<vtkArrowSource> m_ArrowSource;
 
     /**
      * @brief m_ReverseSense Filter to invert the normals.
      */
     vtkSmartPointer<vtkReverseSense> m_ReverseSense;
 
     /** \brief Default constructor of the local storage. */
     LocalStorage();
     /** \brief Default deconstructor of the local storage. */
     ~LocalStorage();
   };
 
   /** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
   mitk::LocalStorageHandler<LocalStorage> m_LSH;
 
-
 protected:
   /**
      * @brief SurfaceVtkMapper2D default constructor.
      */
   SurfaceVtkMapper2D();
 
   /**
      * @brief ~SurfaceVtkMapper2D default destructor.
      */
   virtual ~SurfaceVtkMapper2D();
 
   /**
      * @brief GenerateDataForRenderer produces all the data.
      * @param renderer The respective renderer of the mitkRenderWindow.
      */
   virtual void GenerateDataForRenderer(mitk::BaseRenderer* renderer);
 
   /**
      * @brief ResetMapper Called in mitk::Mapper::Update to hide objects.
      * If TimeSlicedGeometry or time step is not valid, reset the mapper.
      * so that nothing is displayed e.g. toggle visiblity of the propassembly.
      *
      * @param renderer The respective renderer of the mitkRenderWindow.
      */
   virtual void ResetMapper( BaseRenderer* renderer );
 
   /**
      * @brief ApplyAllProperties Pass all the properties to VTK.
      * @param renderer The respective renderer of the mitkRenderWindow.
      */
   void ApplyAllProperties( BaseRenderer* renderer);
 
   /**
      * @brief Update Check if data should be generated.
      * @param renderer The respective renderer of the mitkRenderWindow.
      */
   void Update(BaseRenderer* renderer);
 };
 } // namespace mitk
-
 #endif /* mitkSurfaceVtkMapper2D_h */
diff --git a/Modules/QtWidgets/QmitkStdMultiWidget.h b/Modules/QtWidgets/QmitkStdMultiWidget.h
index b0731c97d2..d9f359fbb5 100644
--- a/Modules/QtWidgets/QmitkStdMultiWidget.h
+++ b/Modules/QtWidgets/QmitkStdMultiWidget.h
@@ -1,399 +1,396 @@
 /*===================================================================
 
 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 QmitkStdMultiWidget_h
 #define QmitkStdMultiWidget_h
 
 #include "MitkQtWidgetsExports.h"
 
 #include <mitkPositionTracker.h>
 #include <mitkSlicesRotator.h>
 #include <mitkSlicesSwiveller.h>
 #include <mitkRenderWindowFrame.h>
 #include <mitkLogoOverlay.h>
 #include <mitkGradientBackground.h>
 #include <mitkCoordinateSupplier.h>
 #include <mitkDataStorage.h>
 
 #include <mitkMouseModeSwitcher.h>
 
 #include <qwidget.h>
 #include <qsplitter.h>
 #include <QFrame>
 
 #include <QmitkRenderWindow.h>
 #include <QmitkLevelWindowWidget.h>
 
 #include <vtkTextProperty.h>
 #include <vtkCornerAnnotation.h>
 
 #include <mitkBaseRenderer.h>
 
 class QHBoxLayout;
 class QVBoxLayout;
 class QGridLayout;
 class QSpacerItem;
 class QmitkLevelWindowWidget;
 class QmitkRenderWindow;
 
 namespace mitk {
 class RenderingManager;
 }
 
 /// \ingroup QmitkModule
 class QMITK_EXPORT QmitkStdMultiWidget : public QWidget
 {
   Q_OBJECT
 
 public:
   QmitkStdMultiWidget(QWidget* parent = 0, Qt::WindowFlags f = 0, mitk::RenderingManager* renderingManager = 0, mitk::BaseRenderer::RenderingMode::Type renderingMode = mitk::BaseRenderer::RenderingMode::Standard, const QString& name = "stdmulti");
   virtual ~QmitkStdMultiWidget();
 
   mitk::SliceNavigationController*
   GetTimeNavigationController();
 
   void RequestUpdate();
 
   void ForceImmediateUpdate();
 
   mitk::MouseModeSwitcher* GetMouseModeSwitcher();
 
   QmitkRenderWindow* GetRenderWindow1() const;
 
   QmitkRenderWindow* GetRenderWindow2() const;
 
   QmitkRenderWindow* GetRenderWindow3() const;
 
   QmitkRenderWindow* GetRenderWindow4() const;
 
   const mitk::Point3D &
   GetLastLeftClickPosition() const;
 
   const mitk::Point3D
   GetCrossPosition() const;
 
   void EnablePositionTracking();
 
   void DisablePositionTracking();
 
   int GetLayout() const;
 
   mitk::SlicesRotator * GetSlicesRotator() const;
 
   mitk::SlicesSwiveller * GetSlicesSwiveller() const;
 
   bool GetGradientBackgroundFlag() const;
 
   /*!
   \brief Access node of widget plane 1
   \return DataNode holding widget plane 1
   */
   mitk::DataNode::Pointer GetWidgetPlane1();
   /*!
   \brief Access node of widget plane 2
   \return DataNode holding widget plane 2
   */
   mitk::DataNode::Pointer GetWidgetPlane2();
   /*!
   \brief Access node of widget plane 3
   \return DataNode holding widget plane 3
   */
   mitk::DataNode::Pointer GetWidgetPlane3();
   /*!
   \brief Convenience method to access node of widget planes
   \param id number of widget plane to be returned
   \return DataNode holding widget plane 3
   */
   mitk::DataNode::Pointer GetWidgetPlane(int id);
 
   bool IsColoredRectanglesEnabled() const;
 
   bool IsDepartmentLogoEnabled() const;
 
   bool IsCrosshairNavigationEnabled() const;
 
   void InitializeWidget();
 
   /// called when the StdMultiWidget is closed to remove the 3 widget planes and the helper node from the DataStorage
   void RemovePlanesFromDataStorage();
 
   void AddPlanesToDataStorage();
 
   void SetDataStorage( mitk::DataStorage* ds );
 
   /** \brief Listener to the CrosshairPositionEvent
 
     Ensures the CrosshairPositionEvent is handled only once and at the end of the Qt-Event loop
   */
   void HandleCrosshairPositionEvent();
 
   /// activate Menu Widget. true: activated, false: deactivated
   void ActivateMenuWidget( bool state );
 
   bool IsMenuWidgetEnabled() const;
 
   /**
    * @brief SetColorWidget4 Get/Set the color of the decoration of the widget 4.
    *
    * This is used to color the frame of the renderwindow and the corner annatation.
    * For the other 3 widgets, this color is a property of the helper object nodes
    * which contain the respective plane geometry. The color can be modified via:
    * GetWidgetPlane1()->SetColor();
    */
   void SetDecorationColorWidget4(mitk::Color color);
   mitk::Color GetDecorationColorWidget4();
 
 protected:
 
   void UpdateAllWidgets();
 
   void HideAllWidgetToolbars();
 
   mitk::DataNode::Pointer GetTopLayerNode(mitk::DataStorage::SetOfObjects::ConstPointer nodes);
 
 public slots:
 
   /// Receives the signal from HandleCrosshairPositionEvent, executes the StatusBar update
   void HandleCrosshairPositionEventDelayed();
 
   void changeLayoutTo2DImagesUp();
 
   void changeLayoutTo2DImagesLeft();
 
   void changeLayoutToDefault();
 
   void changeLayoutToBig3D();
 
   void changeLayoutToWidget1();
 
   void changeLayoutToWidget2();
 
   void changeLayoutToWidget3();
 
   void changeLayoutToRowWidget3And4();
 
   void changeLayoutToColumnWidget3And4();
 
   void changeLayoutToRowWidgetSmall3andBig4();
 
   void changeLayoutToSmallUpperWidget2Big3and4();
 
   void changeLayoutTo2x2Dand3DWidget();
 
   void changeLayoutToLeft2Dand3DRight2D();
 
   void changeLayoutTo2DUpAnd3DDown();
 
   void Fit();
 
   void InitPositionTracking();
 
   void AddDisplayPlaneSubTree();
 
   void EnableStandardLevelWindow();
 
   void DisableStandardLevelWindow();
 
   bool InitializeStandardViews( const mitk::Geometry3D * geometry );
 
   void wheelEvent( QWheelEvent * e );
 
   void mousePressEvent(QMouseEvent * e);
 
   void moveEvent( QMoveEvent* e );
 
   void leaveEvent ( QEvent * e  );
 
   void EnsureDisplayContainsPoint(
       mitk::DisplayGeometry* displayGeometry, const mitk::Point3D& p);
 
   void MoveCrossToPosition(const mitk::Point3D& newPosition);
 
   void EnableNavigationControllerEventListening();
 
   void DisableNavigationControllerEventListening();
 
   void EnableGradientBackground();
 
   void DisableGradientBackground();
 
   void EnableDepartmentLogo();
 
   void DisableDepartmentLogo();
 
   void EnableColoredRectangles();
 
   void DisableColoredRectangles();
 
   void SetWidgetPlaneVisibility(const char* widgetName, bool visible, mitk::BaseRenderer *renderer=NULL);
 
   void SetWidgetPlanesVisibility(bool visible, mitk::BaseRenderer *renderer=NULL);
 
   void SetWidgetPlanesLocked(bool locked);
 
   void SetWidgetPlanesRotationLocked(bool locked);
 
   void SetWidgetPlanesRotationLinked( bool link );
 
   void SetWidgetPlaneMode( int mode );
 
   void SetGradientBackgroundColors( const mitk::Color & upper, const mitk::Color & lower );
 
   void SetDepartmentLogoPath( const char * path );
 
   void SetWidgetPlaneModeToSlicing( bool activate );
 
   void SetWidgetPlaneModeToRotation( bool activate );
 
   void SetWidgetPlaneModeToSwivel( bool activate );
 
   void OnLayoutDesignChanged( int layoutDesignIndex );
 
   void ResetCrosshair();
 
   void MouseModeSelected( mitk::MouseModeSwitcher::MouseMode mouseMode );
 
 signals:
 
   void LeftMouseClicked(mitk::Point3D pointValue);
   void WheelMoved(QWheelEvent*);
   void WidgetPlanesRotationLinked(bool);
   void WidgetPlanesRotationEnabled(bool);
   void ViewsInitialized();
   void WidgetPlaneModeSlicing(bool);
   void WidgetPlaneModeRotation(bool);
   void WidgetPlaneModeSwivel(bool);
   void WidgetPlaneModeChange(int);
   void WidgetNotifyNewCrossHairMode(int);
   void Moved();
 
 public:
 
   /** Define RenderWindow (public)*/
   QmitkRenderWindow* mitkWidget1;
   QmitkRenderWindow* mitkWidget2;
   QmitkRenderWindow* mitkWidget3;
   QmitkRenderWindow* mitkWidget4;
   QmitkLevelWindowWidget* levelWindowWidget;
   /********************************/
 
   enum { PLANE_MODE_SLICING = 0, PLANE_MODE_ROTATION, PLANE_MODE_SWIVEL };
   enum { LAYOUT_DEFAULT = 0, LAYOUT_2D_IMAGES_UP, LAYOUT_2D_IMAGES_LEFT,
          LAYOUT_BIG_3D, LAYOUT_WIDGET1, LAYOUT_WIDGET2, LAYOUT_WIDGET3,
          LAYOUT_2X_2D_AND_3D_WIDGET, LAYOUT_ROW_WIDGET_3_AND_4,
          LAYOUT_COLUMN_WIDGET_3_AND_4, LAYOUT_ROW_WIDGET_SMALL3_AND_BIG4 ,
          LAYOUT_SMALL_UPPER_WIDGET2_BIG3_AND4,LAYOUT_2D_AND_3D_LEFT_2D_RIGHT_WIDGET,
          LAYOUT_2D_UP_AND_3D_DOWN};
 
   enum {
     AXIAL,
     SAGITTAL,
     CORONAL,
     THREE_D
   };
 
   void SetCornerAnnotation(std::string text, mitk::Color color, int widgetNumber);
   /**
    * @brief GetRenderWindow convinience method to get a widget.
    * @param number of the widget (0-3)
    * @return The renderwindow widget.
    */
   QmitkRenderWindow *GetRenderWindow(unsigned int number);
 
   void SetGradientBackgroundColorForRenderWindow(const mitk::Color &upper, const mitk::Color &lower, unsigned int widgetNumber);
 protected:
 
   QHBoxLayout* QmitkStdMultiWidgetLayout;
 
   int m_Layout;
   int m_PlaneMode;
 
   mitk::RenderingManager* m_RenderingManager;
 
   /**
    * @brief m_RectangleRendering1 the 4 frames of the renderwindow.
    */
   mitk::RenderWindowFrame::Pointer m_RectangleRendering[4];
-//  mitk::RenderWindowFrame::Pointer m_RectangleRendering;
-//  mitk::RenderWindowFrame::Pointer m_RectangleRendering;
-//  mitk::RenderWindowFrame::Pointer m_RectangleRendering;
 
   mitk::LogoOverlay::Pointer m_LogoRendering;
 
   mitk::GradientBackground::Pointer m_GradientBackground[4];
   bool m_GradientBackgroundFlag;
 
   mitk::MouseModeSwitcher::Pointer m_MouseModeSwitcher;
   mitk::CoordinateSupplier::Pointer m_LastLeftClickPositionSupplier;
   mitk::PositionTracker::Pointer m_PositionTracker;
   mitk::SliceNavigationController* m_TimeNavigationController;
   mitk::SlicesRotator::Pointer m_SlicesRotator;
   mitk::SlicesSwiveller::Pointer m_SlicesSwiveller;
 
   mitk::DataNode::Pointer m_PositionTrackerNode;
   mitk::DataStorage::Pointer m_DataStorage;
 
   /**
    * @brief m_PlaneNode1 the 3 helper objects which contain the plane geometry.
    */
   mitk::DataNode::Pointer m_PlaneNode1;
   mitk::DataNode::Pointer m_PlaneNode2;
   mitk::DataNode::Pointer m_PlaneNode3;
   /**
    * @brief m_ParentNodeForGeometryPlanes This helper object is added to the datastorage
    * and contains the 3 planes for displaying the image geometry (crosshair and 3D planes).
    */
   mitk::DataNode::Pointer m_ParentNodeForGeometryPlanes;
 
   /**
    * @brief m_DecorationColorWidget4 color for annotation and rectangle of widget 4.
    *
    * For other widgets1-3, the color is a property of the respective data node.
    * There is no node for widget 4, hence, we need an extra member.
    */
   mitk::Color m_DecorationColorWidget4;
 
   QSplitter *m_MainSplit;
   QSplitter *m_LayoutSplit;
   QSplitter *m_SubSplit1;
   QSplitter *m_SubSplit2;
 
   QWidget *mitkWidget1Container;
   QWidget *mitkWidget2Container;
   QWidget *mitkWidget3Container;
   QWidget *mitkWidget4Container;
 
   /**
    * @brief The CornerAnnotation struct to hold the 4 corner annotations.
    */
   struct CornerAnnotation
   {
     vtkSmartPointer<vtkCornerAnnotation> cornerText;
     vtkSmartPointer<vtkTextProperty> textProp;
     vtkSmartPointer<vtkRenderer> ren;
   } m_CornerAnnotations[4];
 
   bool m_PendingCrosshairPositionEvent;
   bool m_CrosshairNavigationEnabled;
   /**
    * @brief CreateCornerAnnotation helper method to create a corner annotation.
    * @param text of the annotation.
    * @param color of the annotation.
    * @return the complete struct.
    */
   CornerAnnotation CreateCornerAnnotation(std::string text, mitk::Color color);
 };
 #endif /*QmitkStdMultiWidget_h*/