From 6065ae86950a987a3d2afb8e17aae03fbf5e8989 Mon Sep 17 00:00:00 2001 From: Pierre Kraemer Date: Wed, 30 Jan 2013 17:24:23 +0100 Subject: [PATCH] SCHNApps: create surface deformation plugin --- .../Plugins/surfaceDeformation/CMakeLists.txt | 69 +++++++++++++++++++ .../surfaceDeformation/surfaceDeformation.cpp | 12 ++++ .../surfaceDeformation/surfaceDeformation.h | 43 ++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt create mode 100644 SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.cpp create mode 100644 SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.h diff --git a/SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt b/SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt new file mode 100644 index 000000000..5722715e6 --- /dev/null +++ b/SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt @@ -0,0 +1,69 @@ +cmake_minimum_required(VERSION 2.8) + +INCLUDE_DIRECTORIES( + ${SCHNApps_ROOT_DIR}/include + ${SCHNApps_ROOT_DIR}/Plugins/surfaceDeformation + ${CMAKE_CURRENT_BINARY_DIR} +) + +SET( PLUGIN_SRC + ${SCHNApps_ROOT_DIR}/Plugins/surfaceDeformation/surfaceDeformation.cpp +) + +SET( PLUGIN_H + ${SCHNApps_ROOT_DIR}/Plugins/surfaceDeformation/surfaceDeformation.h +) + +IF( ${CMAKE_BUILD_TYPE} STREQUAL Debug ) + + ADD_DEFINITIONS(-DDEBUG) + + IF(WIN32) + link_directories( ${CGoGN_ROOT_DIR}/lib/Release ) + ELSE (WIN32) + link_directories( ${CGoGN_ROOT_DIR}/lib/Debug ${CGoGN_ROOT_DIR}/lib/Release ) + ENDIF (WIN32) + +# QT4_WRAP_UI( PLUGIN_UI ${PLUGIN_FORM} ) + QT4_WRAP_CPP( PLUGIN_MOC ${PLUGIN_H} ) + + ADD_LIBRARY( SurfaceDeformationD SHARED + ${PLUGIN_SRC} + ${PLUGIN_UI} + ${PLUGIN_MOC} + ) + + TARGET_LINK_LIBRARIES( SurfaceDeformationD + ${CGoGN_LIBS_D} + ${COMMON_LIBS} + ) + + ADD_DEPENDENCIES( SurfaceDeformationD SCHNAppsD ) + + SET_TARGET_PROPERTIES( SurfaceDeformationD PROPERTIES COMPILE_DEFINITIONS "DEBUG" ) + +ELSE ( ${CMAKE_BUILD_TYPE} STREQUAL Debug ) + + IF(WIN32) + link_directories( ${CGoGN_ROOT_DIR}/lib/Release ) + ELSE (WIN32) + link_directories( ${CGoGN_ROOT_DIR}/lib/Release ) + ENDIF (WIN32) + +# QT4_WRAP_UI( PLUGIN_UI ${PLUGIN_FORM} ) + QT4_WRAP_CPP( PLUGIN_MOC ${PLUGIN_H} ) + + ADD_LIBRARY( SurfaceDeformation SHARED + ${PLUGIN_SRC} + ${PLUGIN_UI} + ${PLUGIN_MOC} + ) + + TARGET_LINK_LIBRARIES( SurfaceDeformation + ${CGoGN_LIBS_R} + ${COMMON_LIBS} + ) + + ADD_DEPENDENCIES( SurfaceDeformation SCHNApps ) + +ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug ) diff --git a/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.cpp b/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.cpp new file mode 100644 index 000000000..4e0f71447 --- /dev/null +++ b/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.cpp @@ -0,0 +1,12 @@ +#include "surfaceDeformation.h" + +bool SurfaceDeformationPlugin::enable() +{ + return true; +} + +#ifndef DEBUG +Q_EXPORT_PLUGIN2(SurfaceDeformationPlugin, SurfaceDeformationPlugin) +#else +Q_EXPORT_PLUGIN2(SurfaceDeformationPluginD, SurfaceDeformationPlugin) +#endif diff --git a/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.h b/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.h new file mode 100644 index 000000000..238359445 --- /dev/null +++ b/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.h @@ -0,0 +1,43 @@ +#ifndef _SURFACEDEFORMATION_PLUGIN_H_ +#define _SURFACEDEFORMATION_PLUGIN_H_ + +#include "plugin.h" + + +using namespace CGoGN; +using namespace SCHNApps; + + +class SurfaceDeformationPlugin : public Plugin +{ + Q_OBJECT + Q_INTERFACES(CGoGN::SCHNApps::Plugin) + +public: + SurfaceDeformationPlugin() + { + setProvidesRendering(false); + } + + ~SurfaceDeformationPlugin() + {} + + virtual bool enable(); + virtual void disable() {} + + virtual void redraw(View *view) {} + + virtual void keyPress(View* view, int key) {} + virtual void keyRelease(View* view, int key) {} + virtual void mousePress(View* view, int button, int x, int y) {} + virtual void mouseRelease(View* view, int button, int x, int y) {} + virtual void mouseMove(View* view, int buttons, int x, int y) {} + virtual void wheelEvent(View* view, int delta, int x, int y) {} + +public slots: + +private: + +}; + +#endif -- GitLab