diff --git a/Core/Code/Controllers/mitkVtkLayerController.h b/Core/Code/Controllers/mitkVtkLayerController.h index e66d9ad15e..c2b8d33d24 100644 --- a/Core/Code/Controllers/mitkVtkLayerController.h +++ b/Core/Code/Controllers/mitkVtkLayerController.h @@ -1,127 +1,135 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef MITKVTKLAYERCONTROLLER_H_HEADER_INCLUDED_C1EDO02D #define MITKVTKLAYERCONTROLLER_H_HEADER_INCLUDED_C1EDO02D #include #include #include class vtkRenderWindow; class vtkRenderer; namespace mitk { +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4251) +#endif /** * Manages the VTK layer hierarchy * of a vtkRenderWindow. * For simple access the layers are divided into three * main groups: background, scene and foreground layers. * Renderers can be registered via the insert... functions and * removed via the RemoveRenderer function. */ class MITK_CORE_EXPORT VtkLayerController { public: static VtkLayerController* GetInstance(vtkRenderWindow* renWin); static void AddInstance(vtkRenderWindow* renWin, vtkRenderer * mitkSceneRenderer); static void RemoveInstance(vtkRenderWindow* renWin); VtkLayerController(vtkRenderWindow* renderWindow); virtual ~VtkLayerController(); /** * Returns the current vtkRenderer of the Scene */ vtkRenderer* GetSceneRenderer(); /** * Connects a VTK renderer with a vtk renderwindow. The renderer will be rendered in the background. * With forceAbsoluteBackground set true a renderer can be placed at the absolute background of the scene. * Multiple calls with forceAbsoluteBackground set true will set the latest registered renderer as background. */ void InsertBackgroundRenderer(vtkRenderer* renderer, bool forceAbsoluteBackground); /** * Connects a VTK renderer with a vtk renderwindow. The renderer will be rendered in the foreground. * With forceAbsoluteBackground set true a renderer can be placed at the absolute foreground of the scene. * Multiple calls with forceAbsoluteForeground set true will set the latest registered renderer as foreground. */ void InsertForegroundRenderer(vtkRenderer* renderer, bool forceAbsoluteForeground); /** * Connects a VTK renderer with a vtk renderwindow. The renderer will be rendered between background renderers and * foreground renderers. */ void InsertSceneRenderer(vtkRenderer* renderer); /** * Connects a VtkRenderWindow with the layer controller. */ void SetRenderWindow(vtkRenderWindow* renwin); /** * A renderer which has been inserted via a insert... function can be removed from the vtkRenderWindow with * RemoveRenderer. */ void RemoveRenderer(vtkRenderer* renderer); /** * Returns true if a renderer has been inserted */ bool IsRendererInserted(vtkRenderer* renderer); /** * Returns the number of renderers in the renderwindow. */ unsigned int GetNumberOfRenderers(); void SetEraseForAllRenderers(int i); protected: vtkRenderWindow* m_RenderWindow; private: /** * Internally used to sort all registered renderers and to connect the with the vtkRenderWindow. * Mention that VTK Version 5 and above is rendering higher numbers in the background and VTK * Verison < 5 in the foreground. */ void UpdateLayers(); // Layer Management typedef std::vector RendererVectorType; RendererVectorType m_BackgroundRenderers; RendererVectorType m_SceneRenderers; RendererVectorType m_ForegroundRenderers; typedef std::map vtkLayerControllerMapType; static vtkLayerControllerMapType s_LayerControllerMap; }; +#ifdef _MSC_VER +# pragma warning(pop) +#endif + } // Namespace MITK #endif /* MITKVTKLAYERCONTROLLER_H_HEADER_INCLUDED_C1EDO02D */ diff --git a/Core/Code/Service/mitkServiceException.h b/Core/Code/Service/mitkServiceException.h index 2afb2090d3..c471fa114f 100644 --- a/Core/Code/Service/mitkServiceException.h +++ b/Core/Code/Service/mitkServiceException.h @@ -1,114 +1,123 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef MITKSERVICEEXCEPTION_H #define MITKSERVICEEXCEPTION_H #include #include namespace mitk { +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4275) +#endif + /** * \ingroup MicroServices * * A service exception used to indicate that a service problem occurred. * *

* A ServiceException object is created by the framework or * to denote an exception condition in the service. An enum * type is used to identify the exception type for future extendability. * *

* This exception conforms to the general purpose exception chaining mechanism. */ class MITK_CORE_EXPORT ServiceException : public std::runtime_error { public: enum Type { /** * No exception type is unspecified. */ UNSPECIFIED = 0, /** * The service has been unregistered. */ UNREGISTERED = 1, /** * The service factory produced an invalid service object. */ FACTORY_ERROR = 2, /** * The service factory threw an exception. */ FACTORY_EXCEPTION = 3, /** * An error occurred invoking a remote service. */ REMOTE = 5, /** * The service factory resulted in a recursive call to itself for the * requesting module. */ FACTORY_RECURSION = 6 }; /** * Creates a ServiceException with the specified message, * type and exception cause. * * @param msg The associated message. * @param type The type for this exception. * @param cause The cause of this exception. */ ServiceException(const std::string& msg, const Type& type = UNSPECIFIED); ServiceException(const ServiceException& o); ServiceException& operator=(const ServiceException& o); ~ServiceException() throw() { } /** * Returns the type for this exception or UNSPECIFIED if the * type was unspecified or unknown. * * @return The type of this exception. */ Type GetType() const; private: /** * Type of service exception. */ Type type; }; +#ifdef _MSC_VER +# pragma warning(pop) +#endif + } /** * \ingroup MicroServices * @{ */ MITK_CORE_EXPORT std::ostream& operator<<(std::ostream& os, const mitk::ServiceException& exc); /** @}*/ #endif // MITKSERVICEEXCEPTION_H