diff --git a/Documentation/Doxygen/4-API/Pages.dox b/Documentation/Doxygen/4-API/Pages.dox index 12d463fbad..da99c9f1bd 100644 --- a/Documentation/Doxygen/4-API/Pages.dox +++ b/Documentation/Doxygen/4-API/Pages.dox @@ -1,24 +1,27 @@ /** \defgroup MITKDeprecatedAPI Deprecated \page deprecatedSince2012_09 Deprecated as of 2012.09 \ingroup MITKDeprecatedAPI \page deprecatedSince2013_03 Deprecated as of 2013.03 \ingroup MITKDeprecatedAPI \page deprecatedSince2013_06 Deprecated as of 2013.06 \ingroup MITKDeprecatedAPI \page deprecatedSince2013_09 Deprecated as of 2013.09 \ingroup MITKDeprecatedAPI \page deprecatedSince2014_03 Deprecated as of 2014.03 \ingroup MITKDeprecatedAPI \page deprecatedSince2014_10 Deprecated as of 2014.10 \ingroup MITKDeprecatedAPI +\page deprecatedSince2015_05 Deprecated as of 2015.05 +\ingroup MITKDeprecatedAPI + */ diff --git a/Modules/Core/include/mitkGradientBackground.h b/Modules/Core/include/mitkGradientBackground.h index e24920760f..2d5110a1f0 100644 --- a/Modules/Core/include/mitkGradientBackground.h +++ b/Modules/Core/include/mitkGradientBackground.h @@ -1,108 +1,108 @@ /*=================================================================== 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 mitkGradientBackground_h #define mitkGradientBackground_h #include #include #include #include class vtkRenderer; class vtkRenderWindow; namespace mitk { class RenderWindow; /** * Displays a color gradient in the background * of a vtkRenderWindow. * The gradient ist faked by displaying a non-interactable * smoothly shaded plane in a separate layer behind the * scene. After setting the renderwindow, the gradient may be * activated by calling Enable() - * @deprecatedSince{next_release} not used in renderwindows + * @deprecatedSince{2015_05} not used in renderwindows */ class MITKCORE_EXPORT GradientBackground : public itk::Object { public: mitkClassMacroItkParent( GradientBackground, itk::Object ); itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** * Sets the renderwindow, in which the gradient background * will be shown. Make sure, you have called this function * before calling Enable() */ virtual void SetRenderWindow( vtkSmartPointer renderWindow ); /** * Returns the vtkRenderWindow, which is used * for displaying the gradient background */ virtual vtkSmartPointer GetRenderWindow(); /** * Returns the renderer responsible for * rendering the color gradient into the * vtkRenderWindow */ virtual vtkSmartPointer GetVtkRenderer(); /** * Sets the gradient colors. The gradient * will smoothly fade from color1 to color2 */ virtual void SetGradientColors(double r1, double g1, double b1, double r2, double g2, double b2); virtual void SetGradientColors(Color upper, Color lower); virtual void SetUpperColor(double r, double g, double b ); virtual void SetLowerColor(double r, double g, double b ); virtual void SetUpperColor(Color upper); virtual void SetLowerColor(Color lower); /** * Enables drawing of the color gradient background. * If you want to disable it, call the Disable() function. */ virtual void Enable(); /** * Disables drawing of the color gradient background. * If you want to enable it, call the Enable() function. */ virtual void Disable(); /** * Checks, if the gradient background is currently * enabled (visible) */ virtual bool IsEnabled(); protected: GradientBackground(); ~GradientBackground(); vtkSmartPointer m_RenderWindow; vtkSmartPointer m_Renderer; }; } //end of namespace mitk #endif //mitkGradientBackground_h diff --git a/Modules/Core/include/mitkManufacturerLogo.h b/Modules/Core/include/mitkManufacturerLogo.h index 2ec7e9bf78..4fc155e2ec 100644 --- a/Modules/Core/include/mitkManufacturerLogo.h +++ b/Modules/Core/include/mitkManufacturerLogo.h @@ -1,183 +1,183 @@ /*=================================================================== 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 _vtk_Logo_Rendering_h_ #define _vtk_Logo_Rendering_h_ #include class vtkRenderer; class vtkRenderWindow; class vtkMapper; class vtkCamera; class vtkImageActor; class vtkImageMapper; class vtkLookupTable; class vtkPolyData; class vtkPNGReader; class vtkImageImport; namespace mitk { class RenderWindow; /** * Renders a company logo in the foreground * of a vtkRenderWindow. - * @deprecatedSince{next_release} Use mitk::LogoOverlay instead + * @deprecatedSince{2015_05} Use mitk::LogoOverlay instead */ class MITKCORE_EXPORT ManufacturerLogo : public BaseData { public: mitkClassMacro( ManufacturerLogo, BaseData ); itkFactorylessNewMacro(Self) itkCloneMacro(Self) enum LogoPosition{ UpperLeft, UpperRight, LowerLeft, LowerRight, Middle }; /** * Sets the renderwindow, in which the logo * will be shown. Make sure, you have called this function * before calling Enable() */ virtual void SetRenderWindow( vtkRenderWindow* renderWindow ); /** * Sets the source file for the logo. */ virtual void SetLogoSource(const char* filename); /** * Sets the opacity level of the logo. */ virtual void SetOpacity(double opacity); /** * Specifies the logo size, values from 0...10, * where 1 is a nice little logo */ virtual void SetZoomFactor( double factor ); /** * Enables drawing of the logo. * If you want to disable it, call the Disable() function. */ virtual void Enable(); /** * Disables drawing of the logo. * If you want to enable it, call the Enable() function. */ virtual void Disable(); /** * Checks, if the logo is currently * enabled (visible) */ virtual bool IsEnabled(); /** * Empty implementation, since the ManufacturerLogo doesn't * support the requested region concept */ virtual void SetRequestedRegionToLargestPossibleRegion() override; /** * Empty implementation, since the ManufacturerLogo doesn't * support the requested region concept */ virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override; /** * Empty implementation, since the ManufacturerLogo doesn't * support the requested region concept */ virtual bool VerifyRequestedRegion() override; /** * Empty implementation, since the ManufacturerLogo doesn't * support the requested region concept */ virtual void SetRequestedRegion( const itk::DataObject*) override; /** * Returns the vtkRenderWindow, which is used * for displaying the logo */ virtual vtkRenderWindow* GetRenderWindow(); /** * Returns the renderer responsible for * rendering the logo into the * vtkRenderWindow */ virtual vtkRenderer* GetVtkRenderer(); /** * Returns the actor associated with the logo */ virtual vtkImageActor* GetActor(); /** * Returns the mapper associated with the logo */ virtual vtkImageMapper* GetMapper(); /** * If set true, this method forces the logo rendering mechanism that it always * renders the MBI department logo, independent from mainapp option settings. */ virtual void ForceMBILogoVisible(bool visible); protected: void SetupCamera(); void SetupPosition(); /** * Constructor */ ManufacturerLogo(); /** * Destructor */ ~ManufacturerLogo(); vtkRenderWindow* m_RenderWindow; vtkRenderer* m_Renderer; vtkImageActor* m_Actor; vtkImageMapper* m_Mapper; vtkPNGReader* m_PngReader; vtkCamera* m_Camera; vtkImageImport* m_VtkImageImport; std::string m_FileName; bool m_IsEnabled; bool m_ForceShowMBIDepartmentLogo; LogoPosition m_LogoPosition; double m_ZoomFactor; double m_Opacity; char * m_ImageData; }; } //end of namespace mitk #endif diff --git a/Modules/Core/include/mitkVtkPropRenderer.h b/Modules/Core/include/mitkVtkPropRenderer.h index 667d27be36..f469b9ab9d 100644 --- a/Modules/Core/include/mitkVtkPropRenderer.h +++ b/Modules/Core/include/mitkVtkPropRenderer.h @@ -1,268 +1,268 @@ /*=================================================================== 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 mitkVtkPropRenderer_h #define mitkVtkPropRenderer_h #include #include "mitkBaseRenderer.h" #include #include #include #include #include class vtkRenderWindow; class vtkLight; class vtkLightKit; class vtkWorldPointPicker; class vtkPointPicker; class vtkCellPicker; class vtkTextActor; class vtkTextProperty; class vtkAssemblyPath; namespace mitk { class Mapper; /*! \brief VtkPropRenderer VtkPropRenderer organizes the MITK rendering process. The MITK rendering process is completely integrated into the VTK rendering pipeline. The vtkMitkRenderProp is a custom vtkProp derived class, which implements the rendering interface between MITK and VTK. It redirects render() calls to the VtkPropRenderer, which is responsible for rendering of the datatreenodes. VtkPropRenderer replaces the old OpenGLRenderer. \sa rendering \ingroup rendering */ class MITKCORE_EXPORT VtkPropRenderer : public BaseRenderer { // Workaround for Displaylistbug private: bool didCount; void checkState(); // Workaround END public: mitkClassMacro(VtkPropRenderer,BaseRenderer); mitkNewMacro3Param(VtkPropRenderer, const char*, vtkRenderWindow *, mitk::RenderingManager* ); mitkNewMacro4Param(VtkPropRenderer, const char*, vtkRenderWindow *, mitk::RenderingManager*, mitk::BaseRenderer::RenderingMode::Type ); typedef std::map MappersMapType; // Render - called by vtkMitkRenderProp, returns the number of props rendered enum RenderType{Opaque,Translucent,Overlay,Volumetric}; int Render(RenderType type); /** \brief This methods contains all method neceassary before a VTK Render() call */ virtual void PrepareRender(); // Active current renderwindow virtual void MakeCurrent(); virtual void SetDataStorage( mitk::DataStorage* storage ) override; ///< set the datastorage that will be used for rendering virtual void InitRenderer(vtkRenderWindow* renderwindow) override; virtual void Update(mitk::DataNode* datatreenode); virtual void SetMapperID(const MapperSlotId mapperId) override; // Size virtual void InitSize(int w, int h) override; virtual void Resize(int w, int h) override; // Picking enum PickingMode{ WorldPointPicking, PointPicking, CellPicking}; /** \brief Set the picking mode. This method is used to set the picking mode for 3D object picking. The user can select one of the three options WorldPointPicking, PointPicking and CellPicking. The first option uses the zBuffer from graphics rendering, the second uses the 3D points from the closest surface mesh, and the third option uses the cells of that mesh. The last option is the slowest, the first one the fastest. However, the first option cannot use transparent data object and the tolerance of the picked position to the selected point should be considered. PointPicking also need a tolerance around the picking position to select the closest point in the mesh. The CellPicker performs very well, if the foreground surface part (i.e. the surfacepart that is closest to the scene's cameras) needs to be picked. */ itkSetEnumMacro( PickingMode, PickingMode ); itkGetEnumMacro( PickingMode, PickingMode ); virtual void PickWorldPoint(const Point2D& displayPoint, Point3D& worldPoint) const override; virtual mitk::DataNode *PickObject( const Point2D &displayPosition, Point3D &worldPosition ) const override; /** * @brief WriteSimpleText Write a text in a renderwindow. * * Writes some 2D text as overlay. Function returns an unique int Text_ID for each call, which can be used via the GetTextLabelProperty(int text_id) function in order to get a vtkTextProperty. This property enables the setup of font, font size, etc. * - * @deprecatedSince{next_release} Please use mitkTextOverlay2D instead. + * @deprecatedSince{2015_05} Please use mitkTextOverlay2D instead. * See mitkTextOverlay2DRenderingTest for an example. */ DEPRECATED(int WriteSimpleText(std::string text, double posX, double posY, double color1 = 0.0, double color2 = 1.0, double color3 = 0.0, float opacity = 1.0)); /** * @brief CGetTextLabelProperty an be used in order to get a vtkTextProperty for * a specific text_id. This property enables the setup of font, font size, etc. * @param text_id the id of the text property. - * @deprecatedSince{next_release} Please use mitkTextOverlay2D instead. + * @deprecatedSince{2015_05} Please use mitkTextOverlay2D instead. * See mitkTextOverlay2DRenderingTest for an example. */ DEPRECATED(vtkTextProperty* GetTextLabelProperty(int text_id)); /** This method calculates the bounds of the DataStorage (if it contains any * valid data), creates a geometry from these bounds and sets it as world * geometry of the renderer. * * Call this method to re-initialize the renderer to the current DataStorage * (e.g. after loading an additional dataset), to ensure that the view is * aligned correctly. */ virtual bool SetWorldGeometryToDataStorageBounds() override; /** * \brief Used by vtkPointPicker/vtkPicker. * This will query a list of all objects in MITK and provide every vtk based mapper to the picker. */ void InitPathTraversal(); /** * \brief Used by vtkPointPicker/vtkPicker. * This will query a list of all objects in MITK and provide every vtk based mapper to the picker. */ vtkAssemblyPath* GetNextPath(); int GetNumberOfPaths(); const vtkWorldPointPicker *GetWorldPointPicker() const; const vtkPointPicker *GetPointPicker() const; const vtkCellPicker *GetCellPicker() const; /** * \brief Release vtk-based graphics resources. Called by * vtkMitkRenderProp::ReleaseGraphicsResources. */ virtual void ReleaseGraphicsResources(vtkWindow *renWin); MappersMapType GetMappersMap() const; static bool useImmediateModeRendering(); protected: VtkPropRenderer( const char* name = "VtkPropRenderer", vtkRenderWindow * renWin = nullptr, mitk::RenderingManager* rm = nullptr, mitk::BaseRenderer::RenderingMode::Type renderingMode = mitk::BaseRenderer::RenderingMode::Standard ); virtual ~VtkPropRenderer(); virtual void Update() override; static void RenderingCallback( vtkObject *caller, unsigned long eid, void *clientdata, void *calldata ); /** \brief Convert display geometry coordinates to VTK coordinates. For use within WriteSimpleText: the input is display geometry coordinates but the text actor needs positions that fit in a specified viewport. Conversion is done in this method. */ mitk::Point2D TransformOpenGLPointToViewport( mitk::Point2D point ); private: /** \brief This method sets up the camera on the actor (e.g. an image) of all * 2D vtkRenderWindows. The view is centered; zooming and panning of VTK are called inside. * * \image html ImageMapperdisplayGeometry.png * * Similar to the textured plane of an image * (cf. void mitkImageVtkMapper2D::GeneratePlane(mitk::BaseRenderer* renderer, * double planeBounds[6])), the mitkDisplayGeometry defines a view plane (or * projection plane). This plane is used to set the camera parameters. The view plane * center (VC) is important for camera positioning (cf. the image above). * * The following figure shows the combination of the textured plane and the view plane. * * \image html cameraPositioning.png * * The view plane center (VC) is the center of the textured plane (C) and the focal point * (FP) at the same time. The FP defines the direction the camera faces. Since * the textured plane is always in the XY-plane and orthographic projection is applied, the * distance between camera and plane is theoretically irrelevant (because in the orthographic * projection the center of projection is at infinity and the size of objects depends only on * a scaling parameter). As a consequence, the direction of projection (DOP) is (0; 0; -1). * The camera up vector is always defined as (0; 1; 0). * * \warning Due to a VTK clipping bug the distance between textured plane and camera is really huge. * Otherwise, VTK would clip off some slices. Same applies for the clipping range size. * * \note The camera position is defined through the mitkDisplayGeometry. * This facilitates zooming and panning, because the display * geometry changes and the textured plane does not. * * \image html scaling.png * * The textured plane is scaled to fill the render window via * camera->SetParallelScale( imageHeightInMM / 2). In the orthographic projection all extends, * angles and sizes are preserved. Therefore, the image is scaled by one parameter which defines * the size of the rendered image. A higher value will result in smaller images. In order to render * just the whole image, the scale is set to half of the image height in worldcoordinates * (cf. the picture above). * * For zooming purposes, a factor is computed as follows: * factor = image height / display height (in worldcoordinates). * When the display geometry gets smaller (zoom in), the factor becomes bigger. When the display * geometry gets bigger (zoom out), the factor becomes smaller. The used VTK method * camera->Zoom( factor ) also works with an inverse scale. */ void AdjustCameraToScene(); // prepare all mitk::mappers for rendering void PrepareMapperQueue(); /** \brief Set parallel projection, remove the interactor and the lights of VTK. */ bool Initialize2DvtkCamera(); bool m_InitNeeded; bool m_ResizeNeeded; MapperSlotId m_CameraInitializedForMapperID; // Picking vtkWorldPointPicker * m_WorldPointPicker; vtkPointPicker * m_PointPicker; vtkCellPicker * m_CellPicker; PickingMode m_PickingMode; // Explicit use of SmartPointer to avoid circular #includes itk::SmartPointer< mitk::Mapper > m_CurrentWorldPlaneGeometryMapper; vtkLightKit* m_LightKit; // sorted list of mappers MappersMapType m_MappersMap; // rendering of text vtkRenderer * m_TextRenderer; typedef std::map TextMapType; TextMapType m_TextCollection; DataStorage::SetOfObjects::ConstPointer m_PickingObjects; DataStorage::SetOfObjects::const_iterator m_PickingObjectsIterator; }; } // namespace mitk #endif /* mitkVtkPropRenderer_h */ diff --git a/Modules/LegacyGL/CMakeLists.txt b/Modules/LegacyGL/CMakeLists.txt index 456bfcb0bb..d46b6d6717 100644 --- a/Modules/LegacyGL/CMakeLists.txt +++ b/Modules/LegacyGL/CMakeLists.txt @@ -1,7 +1,7 @@ #This module is deprecated. Please use VTK replacements instead. MITK_CREATE_MODULE( DEPENDS MitkCore PACKAGE_DEPENDS - DEPRECATED_SINCE next_release + DEPRECATED_SINCE 2015_05 ) diff --git a/Modules/LegacyGL/mitkGLMapper.h b/Modules/LegacyGL/mitkGLMapper.h index 0dd42b58f7..6f0cb64f27 100644 --- a/Modules/LegacyGL/mitkGLMapper.h +++ b/Modules/LegacyGL/mitkGLMapper.h @@ -1,108 +1,108 @@ /*=================================================================== 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 MITKGLMAPPER_H_HEADER_INCLUDED_C197C872 #define MITKGLMAPPER_H_HEADER_INCLUDED_C197C872 #include #include "mitkMapper.h" #include "mitkBaseRenderer.h" #include "mitkVtkPropRenderer.h" namespace mitk { /** \brief Base class of all OpenGL-based mappers. * * Those must implement the abstract method Paint(BaseRenderer), which is called by * method MitkRender(). * The Paint() method should be used to paint into a renderer via OpenGL-drawing commands. * The OpenGL context matrices (GL_MODELVIEWMATRIX/GL_PROJECTIONMATRIX) are preinitialized by * the mitkVtkPropRenderer so that the origin of the 2D-coordinate system of the 2D render * window is located in the lower left corner and has the width and height in display pixels * of the respective renderwindow. The x-axis is horizontally oriented, while the y-axis is * vertically oriented. The drawing commands are directly interpreted as display coordinates. * ApplyColorAndOpacity() can be used in the subclasses to apply color and opacity properties * read from the PropertyList. * -* @deprecatedSince{next_release} GLMappers are no longer supported in the rendering pipeline. +* @deprecatedSince{2015_05} GLMappers are no longer supported in the rendering pipeline. * Please use mitkVtkMapper instead or consider writing your own vtk classes, such as vtkActor * or vtkMapper * \ingroup Mapper */ class MITKLEGACYGL_EXPORT GLMapper : public Mapper { public: mitkClassMacro(GLMapper, Mapper); /** \brief Do the painting into the \a renderer */ virtual void Paint(mitk::BaseRenderer *renderer) = 0; /** \brief Apply color and opacity properties read from the PropertyList * \deprecatedSince{2013_03} Use ApplyColorAndOpacityProperties(...) instead */ DEPRECATED(inline virtual void ApplyProperties(mitk::BaseRenderer* renderer)) { ApplyColorAndOpacityProperties(renderer); } /** \brief Apply color and opacity properties read from the PropertyList. * The actor is not used in the GLMappers. Called by mapper subclasses. */ virtual void ApplyColorAndOpacityProperties(mitk::BaseRenderer* renderer, vtkActor* actor = NULL) override; /** \brief Checks visibility and calls the paint method * * Note: The enumeration is disregarded, since OpenGL rendering only needs a * single render pass. */ void MitkRender(mitk::BaseRenderer* renderer, mitk::VtkPropRenderer::RenderType type) override; /** \brief Returns whether this is a vtk-based mapper * \return false, since all mappers deriving from this class are OpenGL mappers * \deprecatedSince{2013_03} All mappers of superclass VTKMapper are vtk based, use a dynamic_cast instead */ DEPRECATED( virtual bool IsVtkBased() const override); /** \brief Returns whether this mapper allows picking in the renderwindow virtual bool IsPickable() const { return false; }*/ protected: /** constructor */ GLMapper(); /** virtual destructor in order to derive from this class */ virtual ~GLMapper(); private: /** copy constructor */ GLMapper( const GLMapper &); /** assignment operator */ GLMapper & operator=(const GLMapper &); }; } // namespace mitk #endif /* MITKGLMAPPER2D_H_HEADER_INCLUDED_C197C872 */ diff --git a/Plugins/org.blueberry.core.runtime/src/berryPlatform.h b/Plugins/org.blueberry.core.runtime/src/berryPlatform.h index 5a3ebd26fa..476c9abf7e 100644 --- a/Plugins/org.blueberry.core.runtime/src/berryPlatform.h +++ b/Plugins/org.blueberry.core.runtime/src/berryPlatform.h @@ -1,499 +1,499 @@ /*=================================================================== BlueBerry Platform 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 BERRY_Platform_INCLUDED #define BERRY_Platform_INCLUDED // // Platform Identification // #define BERRY_OS_FREE_BSD 0x0001 #define BERRY_OS_AIX 0x0002 #define BERRY_OS_HPUX 0x0003 #define BERRY_OS_TRU64 0x0004 #define BERRY_OS_LINUX 0x0005 #define BERRY_OS_MAC_OS_X 0x0006 #define BERRY_OS_NET_BSD 0x0007 #define BERRY_OS_OPEN_BSD 0x0008 #define BERRY_OS_IRIX 0x0009 #define BERRY_OS_SOLARIS 0x000a #define BERRY_OS_QNX 0x000b #define BERRY_OS_VXWORKS 0x000c #define BERRY_OS_CYGWIN 0x000d #define BERRY_OS_UNKNOWN_UNIX 0x00ff #define BERRY_OS_WINDOWS_NT 0x1001 #define BERRY_OS_WINDOWS_CE 0x1011 #define BERRY_OS_VMS 0x2001 #if defined(__FreeBSD__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS_FAMILY_BSD 1 #define BERRY_OS BERRY_OS_FREE_BSD #elif defined(_AIX) || defined(__TOS_AIX__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_AIX #elif defined(hpux) || defined(_hpux) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_HPUX #elif defined(__digital__) || defined(__osf__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_TRU64 #elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__TOS_LINUX__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_LINUX #elif defined(__APPLE__) || defined(__TOS_MACOS__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS_FAMILY_BSD 1 #define BERRY_OS BERRY_OS_MAC_OS_X #elif defined(__NetBSD__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS_FAMILY_BSD 1 #define BERRY_OS BERRY_OS_NET_BSD #elif defined(__OpenBSD__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS_FAMILY_BSD 1 #define BERRY_OS BERRY_OS_OPEN_BSD #elif defined(sgi) || defined(__sgi) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_IRIX #elif defined(sun) || defined(__sun) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_SOLARIS #elif defined(__QNX__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_QNX #elif defined(unix) || defined(__unix) || defined(__unix__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_UNKNOWN_UNIX #elif defined(_WIN32_WCE) #define BERRY_OS_FAMILY_WINDOWS 1 #define BERRY_OS BERRY_OS_WINDOWS_CE #elif defined(_WIN32) || defined(_WIN64) #define BERRY_OS_FAMILY_WINDOWS 1 #define BERRY_OS BERRY_OS_WINDOWS_NT #elif defined(__CYGWIN__) #define BERRY_OS_FAMILY_UNIX 1 #define BERRY_OS BERRY_OS_CYGWIN #elif defined(__VMS) #define BERRY_OS_FAMILY_VMS 1 #define BERRY_OS BERRY_OS_VMS #endif // // Hardware Architecture and Byte Order // #define BERRY_ARCH_ALPHA 0x01 #define BERRY_ARCH_IA32 0x02 #define BERRY_ARCH_IA64 0x03 #define BERRY_ARCH_MIPS 0x04 #define BERRY_ARCH_HPPA 0x05 #define BERRY_ARCH_PPC 0x06 #define BERRY_ARCH_POWER 0x07 #define BERRY_ARCH_SPARC 0x08 #define BERRY_ARCH_AMD64 0x09 #define BERRY_ARCH_ARM 0x0a #if defined(__ALPHA) || defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA) #define BERRY_ARCH BERRY_ARCH_ALPHA #define BERRY_ARCH_LITTLE_ENDIAN 1 #elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86) #define BERRY_ARCH BERRY_ARCH_IA32 #define BERRY_ARCH_LITTLE_ENDIAN 1 #elif defined(_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__ia64) || defined(_M_IA64) #define BERRY_ARCH BERRY_ARCH_IA64 #if defined(hpux) || defined(_hpux) #define BERRY_ARCH_BIG_ENDIAN 1 #else #define BERRY_ARCH_LITTLE_ENDIAN 1 #endif #elif defined(__x86_64__) #define BERRY_ARCH BERRY_ARCH_AMD64 #define BERRY_ARCH_LITTLE_ENDIAN 1 #elif defined(_M_X64) #define BERRY_ARCH BERRY_ARCH_AMD64 #define BERRY_ARCH_LITTLE_ENDIAN 1 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(_M_MRX000) #define BERRY_ARCH BERRY_ARCH_MIPS #define BERRY_ARCH_BIG_ENDIAN 1 #elif defined(__hppa) || defined(__hppa__) #define BERRY_ARCH BERRY_ARCH_HPPA #define BERRY_ARCH_BIG_ENDIAN 1 #elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \ defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC) || defined(_M_PPC) #define BERRY_ARCH BERRY_ARCH_PPC #define BERRY_ARCH_BIG_ENDIAN 1 #elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \ defined(_ARCH_PWR4) || defined(__THW_RS6000) #define BERRY_ARCH BERRY_ARCH_POWER #define BERRY_ARCH_BIG_ENDIAN 1 #elif defined(__sparc__) || defined(__sparc) || defined(sparc) #define BERRY_ARCH BERRY_ARCH_SPARC #define BERRY_ARCH_BIG_ENDIAN 1 #elif defined(__arm__) || defined(__arm) || defined(ARM) || defined(_ARM_) || defined(__ARM__) || defined(_M_ARM) #define BERRY_ARCH BERRY_ARCH_ARM #if defined(__ARMEB__) #define BERRY_ARCH_BIG_ENDIAN 1 #else #define BERRY_ARCH_LITTLE_ENDIAN 1 #endif #endif #include #include #include #include struct ctkLocation; class ctkPlugin; namespace Poco { class Path; } namespace berry { struct IAdapterManager; struct IBundle; struct IExtensionPointService; struct IExtensionRegistry; struct IPreferencesService; struct IProduct; /** * The central class of the BlueBerry Platform Runtime. This class cannot * be instantiated or subclassed by clients; all functionality is provided * by static methods. Features include: *
    *
  • the platform registry of installed plug-ins
  • *
  • the platform adapter manager
  • *
  • the platform log
  • *
*

* Most users don't have to worry about Platform's lifecycle. However, if your * code can call methods of this class when Platform is not running, it becomes * necessary to check {@link #IsRunning()} before making the call. A runtime * exception might be thrown or incorrect result might be returned if a method * from this class is called while Platform is not running. *

*/ class org_blueberry_core_runtime_EXPORT Platform { public: static const QString PI_RUNTIME; static const int OS_FREE_BSD; static const int OS_AIX; static const int OS_HPUX; static const int OS_TRU64; static const int OS_LINUX; static const int OS_MAC_OS_X; static const int OS_NET_BSD; static const int OS_OPEN_BSD; static const int OS_IRIX; static const int OS_SOLARIS; static const int OS_QNX; static const int OS_VXWORKS; static const int OS_CYGWIN; static const int OS_UNKNOWN_UNIX; static const int OS_WINDOWS_NT; static const int OS_WINDOWS_CE; static const int OS_VMS; static const int ARCH_ALPHA; static const int ARCH_IA32; static const int ARCH_IA64; static const int ARCH_MIPS; static const int ARCH_HPPA; static const int ARCH_PPC; static const int ARCH_POWER; static const int ARCH_SPARC; static const int ARCH_AMD64; static const int ARCH_ARM; static const QString PROP_QTPLUGIN_PATH; static const QString PROP_NEWINSTANCE; static const QString PROP_PLUGIN_DIRS; static const QString PROP_FORCE_PLUGIN_INSTALL; static const QString PROP_APPLICATION; static const QString PROP_IGNOREAPP; static const QString PROP_TESTPLUGIN; static const QString PROP_TESTAPPLICATION; static const QString PROP_XARGS; /** * Returns the adapter manager used for extending * IAdaptable objects. * * @return the adapter manager for this platform * @see IAdapterManager */ static IAdapterManager* GetAdapterManager(); /** * Returns the extension registry for this platform. * May return null if the registry has not been created yet. * * @return existing extension registry or null * @see IExtensionRegistry */ static IExtensionRegistry* GetExtensionRegistry(); /** * Return the interface into the preference mechanism. The returned * object can be used for such operations as searching for preference * values across multiple scopes and preference import/export. *

* Clients are also able to acquire the IPreferencesService service via * CTK mechanisms and use it for preference functions. *

* * @return an object to interface into the preference mechanism */ static IPreferencesService* GetPreferencesService(); /** * Returns the product which was selected when running this BlueBerry instance * or null if none * @return the current product or null if none */ static SmartPointer GetProduct(); /** * Returns the identified option. A null QString * is returned if no such option is found. Options are specified * in the general form <plug-in id>/<option-path>. * For example, org.blueberry.core.runtime/debug *

* Clients are also able to acquire the {@link DebugOptions} service * and query it for debug options. *

* @param option the name of the option to lookup * @return the value of the requested debug option or QString::null */ static QVariant GetDebugOption(const QString& option); /** * Returns the path of the configuration information * used to run this instance of the BlueBerry platform. * The configuration area typically * contains the list of plug-ins available for use, various settings * (those shared across different instances of the same configuration) * and any other such data needed by plug-ins. * An empty path is returned if the platform is running without a configuration location. * * @return the location of the platform's configuration data area - * @deprecatedSince{next_release} Use GetConfigurationLocation() instead. + * @deprecatedSince{2015_05} Use GetConfigurationLocation() instead. */ QT_DEPRECATED static QDir GetConfigurationPath(); /** * Returns the location of the configuration information * used to run this instance of BlueBerry. The configuration area typically * contains the list of plug-ins available for use, various settings * (those shared across different instances of the same configuration) * and any other such data needed by plug-ins. * null is returned if the platform is running without a configuration location. *

* This method is equivalent to acquiring the org.commontk.service.datalocation.Location * service with the property "type" equal to ctkLocation::CONFIGURATION_FILTER. *

* @return the location of the platform's configuration data area or null if none * @see ctkLocation::CONFIGURATION_FILTER */ static ctkLocation* GetConfigurationLocation(); /** * Returns the path of the base installation for the running platform * * @return the location of the platform's installation area or null if none - * @deprecatedSince{next_release} Use GetInstallLocation() instead. + * @deprecatedSince{2015_05} Use GetInstallLocation() instead. */ QT_DEPRECATED static QDir GetInstallPath(); /** * Returns the location of the base installation for the running platform * null is returned if the platform is running without a configuration location. *

* This method is equivalent to acquiring the org.commontk.service.datalocation.Location * service with the property "type" equal to ctkLocation::INSTALL_FILTER. *

* @return the location of the platform's installation area or null if none * @see ctkLocation::INSTALL_FILTER */ static ctkLocation* GetInstallLocation(); /** * Returns the path of the platform's working directory (also known as the instance data area). * An empty path is returned if the platform is running without an instance location. * * @return the location of the platform's instance data area or null if none - * @deprecatedSince{next_release} Use GetInstanceLocation() instead. + * @deprecatedSince{2015_05} Use GetInstanceLocation() instead. */ QT_DEPRECATED static QDir GetInstancePath(); /** * Returns the location of the platform's working directory (also known as the instance data area). * null is returned if the platform is running without an instance location. *

* This method is equivalent to acquiring the org.commontk.service.datalocation.Location * service with the property "type" equal to ctkLocation::INSTANCE_FILTER. *

* @return the location of the platform's instance data area or null if none * @see ctkLocation::INSTANCE_FILTER */ static ctkLocation* GetInstanceLocation(); /** * Returns the path in the local file system of the * plug-in state area for the given plug-in. * If the plug-in state area did not exist prior to this call, * it is created. *

* The plug-in state area is a file directory within the * platform's metadata area where a plug-in is free to create files. * The content and structure of this area is defined by the plug-in, * and the particular plug-in is solely responsible for any files * it puts there. It is recommended for plug-in preference settings and * other configuration parameters. *

* * @param plugin the plug-in whose state location is returned * @return a local file system path * TODO Investigate the usage of a service factory - * @deprecatedSince{next_release} Use GetStateLocation instead. + * @deprecatedSince{2015_05} Use GetStateLocation instead. */ QT_DEPRECATED static bool GetStatePath(QDir& statePath, const QSharedPointer& plugin, bool create = true); /** * Returns the location in the local file system of the * plug-in state area for the given plug-in. * If the plug-in state area did not exist prior to this call, * it is created. *

* The plug-in state area is a file directory within the * platform's metadata area where a plug-in is free to create files. * The content and structure of this area is defined by the plug-in, * and the particular plug-in is solely responsible for any files * it puts there. It is recommended for plug-in preference settings and * other configuration parameters. *

* * @param plugin the plugin whose state location if returned * @return a local file system path * @throws ctkIllegalStateException if no instance location was specified * @throws RuntimeException if the plug-in state area could not be created. */ static QDir GetStateLocation(const QSharedPointer& plugin); /** * Returns the path of the platform's user data area. The user data area is a location on the system * which is specific to the system's current user. By default it is located relative to the * location given by the System property "user.home". * An empty path is returned if the platform is running without an user location. * * @return the location of the platform's user data area or null if none - * @deprecatedSince{next_release} Use GetUserLocation() instead. + * @deprecatedSince{2015_05} Use GetUserLocation() instead. */ QT_DEPRECATED static QDir GetUserPath(); /** * Returns the location of the platform's user data area. The user data area is a location on the system * which is specific to the system's current user. By default it is located relative to the * location given by the system property "user.home". * null is returned if the platform is running without an user location. *

* This method is equivalent to acquiring the org.commontk.service.datalocation.Location * service with the property "type" equal to ctkLocation::USER_FILTER. *

* @return the location of the platform's user data area or null if none * @see ctkLocation::USER_FILTER */ static ctkLocation* GetUserLocation(); static int GetOS(); static int GetOSArch(); static bool IsUnix(); static bool IsWindows(); static bool IsBSD(); static bool IsLinux(); static bool IsVMS(); static bool IsRunning(); /** * Returns the applications command line arguments which * have not been consumed by the platform. */ static QStringList GetApplicationArgs(); /** * Returns the resolved plug-in with the specified symbolic name that has the * highest version. If no resolved plug-ins are installed that have the * specified symbolic name then null is returned. *

* Note that clients may want to filter * the results based on the state of the plug-ins. *

* @param symbolicName the symbolic name of the plug-in to be returned. * @return the plug-in that has the specified symbolic name with the * highest version, or null if no plug-in is found. */ static QSharedPointer GetPlugin(const QString& symbolicName); /** * Returns all plug-ins with the specified symbolic name. If no resolved plug-ins * with the specified symbolic name can be found, an empty list is returned. * If the version argument is not null then only the plug-ins that have * the specified symbolic name and a version greater than or equal to the * specified version are returned. The returned plug-ins are ordered in * descending plug-in version order. *

* Note that clients may want to filter * the results based on the state of the plug-ins. *

* @param symbolicName the symbolic name of the plug-ins that are to be returned. * @param version the version that the returned plug-in versions must match, * or QString() if no version matching is to be done. * @return the list of plug-ins with the specified name that match the * specified version and match rule, or null if no plug-ins are found. */ static QList > GetPlugins(const QString& symbolicName, const QString& version = QString()); private: Platform(); }; } // namespace #endif // BERRY_Platform_INCLUDED