Commit 782d19dd authored by Emmanuel Promayon's avatar Emmanuel Promayon

NEW Bitmap viewer extension fo manage the bitmap viewer

parent 3a9b7f40
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2014 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#ifndef BITMAP_VIEWER_API_H
#define BITMAP_VIEWER_API_H
// -----------------------------------------------------------------------
//
// BITMAP_VIEWER_API
//
// -----------------------------------------------------------------------
// The following ifdef block is the standfard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the COMPILE_BITMAP_VIEWER_API
// flag defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// BITMAP_VIEWER_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#if defined(_WIN32) // MSVC and mingw
#ifdef COMPILE_BITMAP_VIEWER_API
#define BITMAP_VIEWER_API __declspec(dllexport)
#else
#define BITMAP_VIEWER_API __declspec(dllimport)
#endif
#else
// for all other platforms BITMAP_VIEWER_API is defined to be "nothing"
#ifndef BITMAP_VIEWER_API
#define BITMAP_VIEWER_API
#endif
#endif // MSVC and mingw
// -----------------------------------------------------------------------
// It seems that MSVC does not understand exception specification
// If I understand it well, when _declspec() is used, there is a default
// nothrow attribute.
// I did not find the throw attribute. It seems that msvc is therefore ignoring the
// specification of the type of the exception.
// The compiler therefore issues a warning.
// The following line is to avoid this particular warning.
// The best would be to ask msvc not only to take the exception into account, but also
// its type. Anyway, I did not find how to do that anywhere, and I am not sure this is
// possible...
#if defined(_WIN32) && !defined(__MINGW32__) // MSVC only
#pragma warning( disable : 4290 )
#endif // MSVC only
#endif // BITMAP_VIEWER_API_H
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#include "BitmapViewerExtension.h"
// include generated actions headers
#include "BitmapViewer.h"
// --------------- getActions -------------------
void BitmapViewerExtension::init() {
registerNewViewer(BitmapViewer);
}
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#ifndef BITMAP_VIEWER_EXTENSION_H
#define BITMAP_VIEWER_EXTENSION_H
#include <ViewerExtension.h>
class BitmapViewerExtension : public camitk::ViewerExtension {
Q_OBJECT
Q_INTERFACES(camitk::ViewerExtension);
Q_PLUGIN_METADATA(IID "fr.imag.camitk.tutorials.viewer.bitmapviewerextension")
public:
/// Constructor
BitmapViewerExtension() : ViewerExtension() {};
/// Destructor
virtual ~BitmapViewerExtension() = default;
/// Method returning the action extension name
virtual QString getName() {
return "BitmapViewer Extension";
};
/// Method returning the action extension descrption
virtual QString getDescription() {
return "This extension provides BitmapViewer, a simple 2D image viewer";
};
/// initialize all the actions
virtual void init();
};
#endif // BITMAP_VIEWER_EXTENSION_H
# Call CamiTK CMake Macro to define the action
camitk_extension(VIEWER_EXTENSION
DEFAULT
DEFINES COMPILE_BITMAP_VIEWER_API
DESCRIPTION "This extension provides a simple 2D image viewer"
INSTALL_ALL_HEADERS
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment