diff --git a/SCHNApps/CMakeLists.txt b/SCHNApps/CMakeLists.txt
index e986e78606e4c592ef934d9e6053a6933e5471ac..220dd4aff456c28e18524a6f1b5952cc188214ce 100644
--- a/SCHNApps/CMakeLists.txt
+++ b/SCHNApps/CMakeLists.txt
@@ -16,7 +16,7 @@ find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
find_package(Qt4 REQUIRED)
find_package(QGLViewer REQUIRED)
-find_package(PythonLibs REQUIRED)
+find_package(PythonLibs 2.7 REQUIRED)
SET( QT_USE_QTOPENGL TRUE )
SET( QT_USE_QTXML TRUE )
@@ -102,6 +102,37 @@ SET(SCHNApps_ROOT_DIR ${CGoGN_ROOT_DIR}/SCHNApps)
SET(EXECUTABLE_OUTPUT_PATH ${SCHNApps_ROOT_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${SCHNApps_ROOT_DIR}/lib)
+
+file(
+ GLOB_RECURSE
+ SCHNApps_FILES
+ ${SCHNApps_ROOT_DIR}/src/*.cpp
+ ${SCHNApps_ROOT_DIR}/include/*.h
+)
+
+file(
+ GLOB_RECURSE
+ SCHNApps_UI_FILES
+ ${SCHNApps_ROOT_DIR}/forms/*.ui
+)
+
+SET(SCHNApps_QOBJECT_FILES
+ ${SCHNApps_ROOT_DIR}/include/camera.h
+ ${SCHNApps_ROOT_DIR}/include/mapHandler.h
+ ${SCHNApps_ROOT_DIR}/include/plugin.h
+ ${SCHNApps_ROOT_DIR}/include/view.h
+ ${SCHNApps_ROOT_DIR}/include/window.h
+ ${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
+ ${SCHNApps_ROOT_DIR}/include/dialogs/camerasDialog.h
+ ${SCHNApps_ROOT_DIR}/include/dialogs/pluginsDialog.h
+ ${SCHNApps_ROOT_DIR}/include/dialogs/mapsDialog.h
+ ${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
+ ${SCHNApps_ROOT_DIR}/include/dialogs/pluginsViewDialog.h
+ ${SCHNApps_ROOT_DIR}/include/dialogs/mapsViewDialog.h
+)
+
+
+
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/Release Release)
IF (NOT WIN32)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/Debug Debug)
diff --git a/SCHNApps/Debug/CMakeLists.txt b/SCHNApps/Debug/CMakeLists.txt
index f743602f9c1e5896b18e86f189acb16cf6e74ca6..3d9edd0c7b6c8339edce5c4f957b1de5ca85c59d 100644
--- a/SCHNApps/Debug/CMakeLists.txt
+++ b/SCHNApps/Debug/CMakeLists.txt
@@ -16,64 +16,21 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
)
-file(
- GLOB
- SCHNApps_SRC_FILES
- ${SCHNApps_ROOT_DIR}/src/main.cpp
- ${SCHNApps_ROOT_DIR}/src/camera.cpp
- ${SCHNApps_ROOT_DIR}/src/mapHandler.cpp
- ${SCHNApps_ROOT_DIR}/src/plugin.cpp
- ${SCHNApps_ROOT_DIR}/src/view.cpp
- ${SCHNApps_ROOT_DIR}/src/window.cpp
- ${SCHNApps_ROOT_DIR}/src/viewButtonArea.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/camerasDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/pluginsDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/mapsDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/cameraViewDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/pluginsViewDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/mapsViewDialog.cpp
+QT4_WRAP_UI( UIC_FILES
+ ${SCHNApps_UI_FILES}
)
-SET(SCHNApps_H_OBJECT_FILES
- ${SCHNApps_ROOT_DIR}/include/camera.h
- ${SCHNApps_ROOT_DIR}/include/mapHandler.h
- ${SCHNApps_ROOT_DIR}/include/plugin.h
- ${SCHNApps_ROOT_DIR}/include/view.h
- ${SCHNApps_ROOT_DIR}/include/window.h
- ${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/camerasDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/pluginsDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/mapsDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/pluginsViewDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/mapsViewDialog.h
-)
-
-file(
- GLOB
- SCHNApps_FORM_FILES
- ${SCHNApps_ROOT_DIR}/forms/window.ui
- ${SCHNApps_ROOT_DIR}/forms/camerasDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/pluginsDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/mapsDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/cameraViewDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/pluginsViewDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/mapsViewDialog.ui
-)
-
-QT4_WRAP_UI( UI_H_FILES
- ${SCHNApps_FORM_FILES}
-)
QT4_WRAP_CPP( MOC_FILES
- ${SCHNApps_H_OBJECT_FILES}
+ ${SCHNApps_QOBJECT_FILES}
)
+
QT4_ADD_RESOURCES( RCC_FILES
${SCHNApps_ROOT_DIR}/resources/resources.qrc
)
ADD_EXECUTABLE( SCHNAppsD
- ${SCHNApps_SRC_FILES}
- ${UI_H_FILES}
+ ${SCHNApps_FILES}
+ ${UIC_FILES}
${MOC_FILES}
${RCC_FILES}
)
diff --git a/SCHNApps/Plugins/CMakeLists.txt b/SCHNApps/Plugins/CMakeLists.txt
index aa9088d2d7d266d084721338abfae4db387d5be9..f5751cb6f2130dc2af1dc2afc5e2c9a02f4a589a 100644
--- a/SCHNApps/Plugins/CMakeLists.txt
+++ b/SCHNApps/Plugins/CMakeLists.txt
@@ -7,4 +7,4 @@ ADD_SUBDIRECTORY(render)
ADD_SUBDIRECTORY(renderVector)
ADD_SUBDIRECTORY(renderExplod)
ADD_SUBDIRECTORY(subdivideSurface)
-ADD_SUBDIRECTORY(surfaceDeformation)
+#ADD_SUBDIRECTORY(surfaceDeformation)
diff --git a/SCHNApps/Plugins/differentialProperties/CMakeLists.txt b/SCHNApps/Plugins/differentialProperties/CMakeLists.txt
index 01c8292294cb0ad5df1465a03c29cc5dc2aff806..e970512867c78122238c06f39985f2a0953a3c37 100644
--- a/SCHNApps/Plugins/differentialProperties/CMakeLists.txt
+++ b/SCHNApps/Plugins/differentialProperties/CMakeLists.txt
@@ -1,78 +1,33 @@
cmake_minimum_required(VERSION 2.8)
+SET( PLUGIN_NAME DifferentialProperties )
+
+SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties )
+
INCLUDE_DIRECTORIES(
- ${SCHNApps_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/include
+ ${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
-SET( PLUGIN_SRC
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/src/differentialProperties.cpp
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/src/computeNormalDialog.cpp
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
+file(
+ GLOB_RECURSE
+ PLUGIN_FILES
+ ${PLUGIN_ROOT_DIR}/src/*.cpp
+ ${PLUGIN_ROOT_DIR}/include/*.h
+ ${PLUGIN_ROOT_DIR}/include/*.hpp
)
-SET( PLUGIN_H
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/include/differentialProperties.h
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/include/computeNormalDialog.h
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/include/computeCurvatureDialog.h
+file(
+ GLOB_RECURSE
+ PLUGIN_UI_FILES
+ ${PLUGIN_ROOT_DIR}/forms/*.ui
)
-SET( PLUGIN_FORM
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/forms/computeNormalDialog.ui
- ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties/forms/computeCurvatureDialog.ui
+SET(
+ PLUGIN_QOBJECT_FILES
+ ${PLUGIN_ROOT_DIR}/include/differentialProperties.h
+ ${PLUGIN_ROOT_DIR}/include/computeNormalDialog.h
+ ${PLUGIN_ROOT_DIR}/include/computeCurvatureDialog.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( DifferentialPropertiesD SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( DifferentialPropertiesD
- ${CGoGN_LIBS_D}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( DifferentialPropertiesD SCHNAppsD )
-
- SET_TARGET_PROPERTIES( DifferentialPropertiesD 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( DifferentialProperties SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( DifferentialProperties
- ${CGoGN_LIBS_R}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( DifferentialProperties SCHNApps )
-
-ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps/Plugins/differentialProperties/include/differentialProperties.h b/SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
index ce1ebaa3cf14cb382da9746d048d3b722dc7741b..83efcfabe1a714649d585679ec997063391e3643 100644
--- a/SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
+++ b/SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
@@ -30,12 +30,12 @@ public:
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) {}
+ virtual void keyPress(View* view, QKeyEvent* event) {}
+ virtual void keyRelease(View* view, QKeyEvent* event) {}
+ virtual void mousePress(View* view, QMouseEvent* event) {}
+ virtual void mouseRelease(View* view, QMouseEvent* event) {}
+ virtual void mouseMove(View* view, QMouseEvent* event) {}
+ virtual void wheelEvent(View* view, QWheelEvent* event) {}
public slots:
void openComputeNormalDialog();
diff --git a/SCHNApps/Plugins/importSurface/CMakeLists.txt b/SCHNApps/Plugins/importSurface/CMakeLists.txt
index 17a6e888151d6a97790de0918cc23ec78c6cc6e5..55230abaccf0142a6572a5fcced390b25e5e182a 100644
--- a/SCHNApps/Plugins/importSurface/CMakeLists.txt
+++ b/SCHNApps/Plugins/importSurface/CMakeLists.txt
@@ -1,69 +1,31 @@
cmake_minimum_required(VERSION 2.8)
+SET( PLUGIN_NAME ImportSurface )
+
+SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/importSurface )
+
INCLUDE_DIRECTORIES(
- ${SCHNApps_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/Plugins/importSurface
+ ${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
-SET( PLUGIN_SRC
- ${SCHNApps_ROOT_DIR}/Plugins/importSurface/importSurface.cpp
+file(
+ GLOB_RECURSE
+ PLUGIN_FILES
+ ${PLUGIN_ROOT_DIR}/src/*.cpp
+ ${PLUGIN_ROOT_DIR}/include/*.h
+ ${PLUGIN_ROOT_DIR}/include/*.hpp
)
-SET( PLUGIN_H
- ${SCHNApps_ROOT_DIR}/Plugins/importSurface/importSurface.h
+file(
+ GLOB_RECURSE
+ PLUGIN_UI_FILES
+ ${PLUGIN_ROOT_DIR}/forms/*.ui
)
-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( ImportSurfaceD SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( ImportSurfaceD
- ${CGoGN_LIBS_D}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( ImportSurfaceD SCHNAppsD )
-
- SET_TARGET_PROPERTIES( ImportSurfaceD 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( ImportSurface SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( ImportSurface
- ${CGoGN_LIBS_R}
- ${COMMON_LIBS}
- )
+SET(
+ PLUGIN_QOBJECT_FILES
+ ${PLUGIN_ROOT_DIR}/include/importSurface.h
+)
- ADD_DEPENDENCIES( ImportSurface SCHNApps )
-
-ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps/Plugins/importSurface/importSurface.h b/SCHNApps/Plugins/importSurface/include/importSurface.h
similarity index 61%
rename from SCHNApps/Plugins/importSurface/importSurface.h
rename to SCHNApps/Plugins/importSurface/include/importSurface.h
index cdad51f20addfb3bd57abd8b277aa78d908f1a47..d7a08004475283e63d0d3369b906d8898a3f6e9e 100644
--- a/SCHNApps/Plugins/importSurface/importSurface.h
+++ b/SCHNApps/Plugins/importSurface/include/importSurface.h
@@ -27,12 +27,12 @@ public:
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) {}
+ virtual void keyPress(View* view, QKeyEvent* event) {}
+ virtual void keyRelease(View* view, QKeyEvent* event) {}
+ virtual void mousePress(View* view, QMouseEvent* event) {}
+ virtual void mouseRelease(View* view, QMouseEvent* event) {}
+ virtual void mouseMove(View* view, QMouseEvent* event) {}
+ virtual void wheelEvent(View* view, QWheelEvent* event) {}
public slots:
MapHandlerGen* importFromFile(const QString& fileName);
diff --git a/SCHNApps/Plugins/importSurface/importSurface.cpp b/SCHNApps/Plugins/importSurface/src/importSurface.cpp
similarity index 100%
rename from SCHNApps/Plugins/importSurface/importSurface.cpp
rename to SCHNApps/Plugins/importSurface/src/importSurface.cpp
diff --git a/SCHNApps/Plugins/importVolume/CMakeLists.txt b/SCHNApps/Plugins/importVolume/CMakeLists.txt
index 65f3f5ef753baf70d706f140a9e1eb9b439516f6..2786ef9bfe1beea231358605941da329300ec9a5 100644
--- a/SCHNApps/Plugins/importVolume/CMakeLists.txt
+++ b/SCHNApps/Plugins/importVolume/CMakeLists.txt
@@ -1,71 +1,31 @@
cmake_minimum_required(VERSION 2.8)
+SET( PLUGIN_NAME ImportVolume )
+
+SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/importVolume )
+
INCLUDE_DIRECTORIES(
- ${SCHNApps_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/Plugins/importVolume
+ ${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
-SET( PLUGIN_SRC
- ${SCHNApps_ROOT_DIR}/Plugins/importVolume/importVolume.cpp
+file(
+ GLOB_RECURSE
+ PLUGIN_FILES
+ ${PLUGIN_ROOT_DIR}/src/*.cpp
+ ${PLUGIN_ROOT_DIR}/include/*.h
+ ${PLUGIN_ROOT_DIR}/include/*.hpp
)
-SET( PLUGIN_H
- ${SCHNApps_ROOT_DIR}/Plugins/importVolume/importVolume.h
+file(
+ GLOB_RECURSE
+ PLUGIN_UI_FILES
+ ${PLUGIN_ROOT_DIR}/forms/*.ui
)
-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( ImportVolumeD SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( ImportVolumeD
- ${CGoGN_LIBS_D}
- ${COMMON_LIBS}
- ${QGLVIEWER_LIBRARIES}
- )
-
- ADD_DEPENDENCIES( ImportVolumeD SCHNAppsD )
-
- SET_TARGET_PROPERTIES( ImportVolumeD 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( ImportVolume SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( ImportVolume
- ${CGoGN_LIBS_R}
- ${COMMON_LIBS}
- ${QGLVIEWER_LIBRARIES}
- )
+SET(
+ PLUGIN_QOBJECT_FILES
+ ${PLUGIN_ROOT_DIR}/include/importVolume.h
+)
- ADD_DEPENDENCIES( ImportVolume SCHNApps )
-
-ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps/Plugins/importVolume/importVolume.h b/SCHNApps/Plugins/importVolume/include/importVolume.h
similarity index 60%
rename from SCHNApps/Plugins/importVolume/importVolume.h
rename to SCHNApps/Plugins/importVolume/include/importVolume.h
index 9a2a4eb8cbe7f0e26f3c9502efcb9caf07355a8f..0f5e3c90833b51ff7fec1217f1b2c7b56810f048 100644
--- a/SCHNApps/Plugins/importVolume/importVolume.h
+++ b/SCHNApps/Plugins/importVolume/include/importVolume.h
@@ -27,12 +27,12 @@ public:
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) {}
+ virtual void keyPress(View* view, QKeyEvent* event) {}
+ virtual void keyRelease(View* view, QKeyEvent* event) {}
+ virtual void mousePress(View* view, QMouseEvent* event) {}
+ virtual void mouseRelease(View* view, QMouseEvent* event) {}
+ virtual void mouseMove(View* view, QMouseEvent* event) {}
+ virtual void wheelEvent(View* view, QWheelEvent* event) {}
public slots:
MapHandlerGen* importFromFile(const QString& fileName);
diff --git a/SCHNApps/Plugins/importVolume/importVolume.cpp b/SCHNApps/Plugins/importVolume/src/importVolume.cpp
similarity index 100%
rename from SCHNApps/Plugins/importVolume/importVolume.cpp
rename to SCHNApps/Plugins/importVolume/src/importVolume.cpp
diff --git a/SCHNApps/Plugins/plugins_cmake.txt b/SCHNApps/Plugins/plugins_cmake.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4037e6e65656bc940b5438f0dbb32facf8a02e31
--- /dev/null
+++ b/SCHNApps/Plugins/plugins_cmake.txt
@@ -0,0 +1,52 @@
+
+QT4_WRAP_UI( PLUGIN_UIC_FILES ${PLUGIN_UI_FILES} )
+
+QT4_WRAP_CPP( PLUGIN_MOC_FILES ${PLUGIN_QOBJECT_FILES} )
+
+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)
+
+ ADD_LIBRARY( ${PLUGIN_NAME}D SHARED
+ ${PLUGIN_FILES}
+ ${PLUGIN_UIC_FILES}
+ ${PLUGIN_MOC_FILES}
+ )
+
+ TARGET_LINK_LIBRARIES( ${PLUGIN_NAME}D
+ ${CGoGN_LIBS_D}
+ ${EXT_LIBS}
+ )
+
+ ADD_DEPENDENCIES( ${PLUGIN_NAME}D SCHNAppsD )
+
+ SET_TARGET_PROPERTIES( ${PLUGIN_NAME}D 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)
+
+ ADD_LIBRARY( ${PLUGIN_NAME} SHARED
+ ${PLUGIN_FILES}
+ ${PLUGIN_UIC_FILES}
+ ${PLUGIN_MOC_FILES}
+ )
+
+ TARGET_LINK_LIBRARIES( ${PLUGIN_NAME}
+ ${CGoGN_LIBS_R}
+ ${EXT_LIBS}
+ )
+
+ ADD_DEPENDENCIES( ${PLUGIN_NAME} SCHNApps )
+
+ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
diff --git a/SCHNApps/Plugins/render/CMakeLists.txt b/SCHNApps/Plugins/render/CMakeLists.txt
index 9d7a345ddb420c72f3fa69b6b7a32b88b24aac42..5172a91031626364a4bfda0338b9e64a9cded352 100644
--- a/SCHNApps/Plugins/render/CMakeLists.txt
+++ b/SCHNApps/Plugins/render/CMakeLists.txt
@@ -1,73 +1,31 @@
cmake_minimum_required(VERSION 2.8)
+SET( PLUGIN_NAME Render )
+
+SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/render )
+
INCLUDE_DIRECTORIES(
- ${SCHNApps_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/Plugins/render
+ ${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
-SET( PLUGIN_SRC
- ${SCHNApps_ROOT_DIR}/Plugins/render/render.cpp
+file(
+ GLOB_RECURSE
+ PLUGIN_FILES
+ ${PLUGIN_ROOT_DIR}/src/*.cpp
+ ${PLUGIN_ROOT_DIR}/include/*.h
+ ${PLUGIN_ROOT_DIR}/include/*.hpp
)
-SET( PLUGIN_H
- ${SCHNApps_ROOT_DIR}/Plugins/render/render.h
+file(
+ GLOB_RECURSE
+ PLUGIN_UI_FILES
+ ${PLUGIN_ROOT_DIR}/forms/*.ui
)
-SET( PLUGIN_FORM
- ${SCHNApps_ROOT_DIR}/Plugins/render/render.ui
+SET(
+ PLUGIN_QOBJECT_FILES
+ ${PLUGIN_ROOT_DIR}/include/render.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( RenderD SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( RenderD
- ${CGoGN_LIBS_D}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( RenderD SCHNAppsD )
-
- SET_TARGET_PROPERTIES( RenderD 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( Render SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( Render
- ${CGoGN_LIBS_R}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( Render SCHNApps )
-
-ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps/Plugins/render/render.ui b/SCHNApps/Plugins/render/forms/render.ui
similarity index 100%
rename from SCHNApps/Plugins/render/render.ui
rename to SCHNApps/Plugins/render/forms/render.ui
diff --git a/SCHNApps/Plugins/render/render.h b/SCHNApps/Plugins/render/include/render.h
similarity index 89%
rename from SCHNApps/Plugins/render/render.h
rename to SCHNApps/Plugins/render/include/render.h
index b707b33794e4415c622754213d77db5e8d2410ef..c2c2e6b8ad394dad6c49d1f710b31ce65d6e13ab 100644
--- a/SCHNApps/Plugins/render/render.h
+++ b/SCHNApps/Plugins/render/include/render.h
@@ -89,12 +89,12 @@ public:
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) {}
+ virtual void keyPress(View* view, QKeyEvent* event) {}
+ virtual void keyRelease(View* view, QKeyEvent* event) {}
+ virtual void mousePress(View* view, QMouseEvent* event) {}
+ virtual void mouseRelease(View* view, QMouseEvent* event) {}
+ virtual void mouseMove(View* view, QMouseEvent* event) {}
+ virtual void wheelEvent(View* view, QWheelEvent* event) {}
void setRefreshingUI(bool b) { b_refreshingUI = b; }
diff --git a/SCHNApps/Plugins/render/render.cpp b/SCHNApps/Plugins/render/src/render.cpp
similarity index 100%
rename from SCHNApps/Plugins/render/render.cpp
rename to SCHNApps/Plugins/render/src/render.cpp
diff --git a/SCHNApps/Plugins/renderExplod/CMakeLists.txt b/SCHNApps/Plugins/renderExplod/CMakeLists.txt
index 25db605181fd1c9237494766ebd4cb9322c5d73b..bc5ec14965eed06e3f73986fd5d48b809dcfee4e 100644
--- a/SCHNApps/Plugins/renderExplod/CMakeLists.txt
+++ b/SCHNApps/Plugins/renderExplod/CMakeLists.txt
@@ -1,75 +1,31 @@
cmake_minimum_required(VERSION 2.8)
+SET( PLUGIN_NAME RenderExplod )
+
+SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/renderExplod )
+
INCLUDE_DIRECTORIES(
- ${SCHNApps_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/Plugins/renderExplod
+ ${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
-SET( PLUGIN_SRC
- ${SCHNApps_ROOT_DIR}/Plugins/renderExplod/renderExplod.cpp
+file(
+ GLOB_RECURSE
+ PLUGIN_FILES
+ ${PLUGIN_ROOT_DIR}/src/*.cpp
+ ${PLUGIN_ROOT_DIR}/include/*.h
+ ${PLUGIN_ROOT_DIR}/include/*.hpp
)
-SET( PLUGIN_H
- ${SCHNApps_ROOT_DIR}/Plugins/renderExplod/renderExplod.h
+file(
+ GLOB_RECURSE
+ PLUGIN_UI_FILES
+ ${PLUGIN_ROOT_DIR}/forms/*.ui
)
-SET( PLUGIN_FORM
- ${SCHNApps_ROOT_DIR}/Plugins/renderExplod/renderExplod.ui
+SET(
+ PLUGIN_QOBJECT_FILES
+ ${PLUGIN_ROOT_DIR}/include/renderExplod.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( RenderExplodD SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( RenderExplodD
- ${CGoGN_LIBS_D}
- ${COMMON_LIBS}
- ${QGLVIEWER_LIBRARIES}
- )
-
- ADD_DEPENDENCIES( RenderExplodD SCHNAppsD )
-
- SET_TARGET_PROPERTIES( RenderExplodD 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( RenderExplod SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( RenderExplod
- ${CGoGN_LIBS_R}
- ${COMMON_LIBS}
- ${QGLVIEWER_LIBRARIES}
- )
-
- ADD_DEPENDENCIES( RenderExplod SCHNApps )
-
-ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps/Plugins/renderExplod/renderExplod.ui b/SCHNApps/Plugins/renderExplod/forms/renderExplod.ui
similarity index 100%
rename from SCHNApps/Plugins/renderExplod/renderExplod.ui
rename to SCHNApps/Plugins/renderExplod/forms/renderExplod.ui
diff --git a/SCHNApps/Plugins/renderExplod/renderExplod.h b/SCHNApps/Plugins/renderExplod/include/renderExplod.h
similarity index 87%
rename from SCHNApps/Plugins/renderExplod/renderExplod.h
rename to SCHNApps/Plugins/renderExplod/include/renderExplod.h
index 3602f683870a86eefcf8c4dcc4a0e79cd0e0c748..a950d6578273a7ac1087523c11dc83d8393fd234 100644
--- a/SCHNApps/Plugins/renderExplod/renderExplod.h
+++ b/SCHNApps/Plugins/renderExplod/include/renderExplod.h
@@ -77,12 +77,12 @@ public:
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) {}
+ virtual void keyPress(View* view, QKeyEvent* event) {}
+ virtual void keyRelease(View* view, QKeyEvent* event) {}
+ virtual void mousePress(View* view, QMouseEvent* event) {}
+ virtual void mouseRelease(View* view, QMouseEvent* event) {}
+ virtual void mouseMove(View* view, QMouseEvent* event) {}
+ virtual void wheelEvent(View* view, QWheelEvent* event) {}
void setRefreshingUI(bool b) { b_refreshingUI = b; }
diff --git a/SCHNApps/Plugins/renderExplod/renderExplod.cpp b/SCHNApps/Plugins/renderExplod/src/renderExplod.cpp
similarity index 100%
rename from SCHNApps/Plugins/renderExplod/renderExplod.cpp
rename to SCHNApps/Plugins/renderExplod/src/renderExplod.cpp
diff --git a/SCHNApps/Plugins/renderVector/CMakeLists.txt b/SCHNApps/Plugins/renderVector/CMakeLists.txt
index 6e7be230f8265ee2caa1148dd0d926648dcc5a6b..1417f5f3f21bd9ee8b96bd4874db37f6bf398044 100644
--- a/SCHNApps/Plugins/renderVector/CMakeLists.txt
+++ b/SCHNApps/Plugins/renderVector/CMakeLists.txt
@@ -1,73 +1,31 @@
cmake_minimum_required(VERSION 2.8)
+SET( PLUGIN_NAME RenderVector )
+
+SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/renderVector )
+
INCLUDE_DIRECTORIES(
- ${SCHNApps_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/Plugins/renderVector
+ ${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
-SET( PLUGIN_SRC
- ${SCHNApps_ROOT_DIR}/Plugins/renderVector/renderVector.cpp
+file(
+ GLOB_RECURSE
+ PLUGIN_FILES
+ ${PLUGIN_ROOT_DIR}/src/*.cpp
+ ${PLUGIN_ROOT_DIR}/include/*.h
+ ${PLUGIN_ROOT_DIR}/include/*.hpp
)
-SET( PLUGIN_H
- ${SCHNApps_ROOT_DIR}/Plugins/renderVector/renderVector.h
+file(
+ GLOB_RECURSE
+ PLUGIN_UI_FILES
+ ${PLUGIN_ROOT_DIR}/forms/*.ui
)
-SET( PLUGIN_FORM
- ${SCHNApps_ROOT_DIR}/Plugins/renderVector/renderVector.ui
+SET(
+ PLUGIN_QOBJECT_FILES
+ ${PLUGIN_ROOT_DIR}/include/renderVector.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( RenderVectorD SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( RenderVectorD
- ${CGoGN_LIBS_D}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( RenderVectorD SCHNAppsD )
-
- SET_TARGET_PROPERTIES( RenderVectorD 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( RenderVector SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( RenderVector
- ${CGoGN_LIBS_R}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( RenderVector SCHNApps )
-
-ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps/Plugins/renderVector/renderVector.ui b/SCHNApps/Plugins/renderVector/forms/renderVector.ui
similarity index 92%
rename from SCHNApps/Plugins/renderVector/renderVector.ui
rename to SCHNApps/Plugins/renderVector/forms/renderVector.ui
index 3f83385356cfe6a4ef041e5c984d1992f8dc0302..a1f28d8f52311a7591b93e6696b21153673503b7 100644
--- a/SCHNApps/Plugins/renderVector/renderVector.ui
+++ b/SCHNApps/Plugins/renderVector/forms/renderVector.ui
@@ -83,6 +83,12 @@
+ mapList
+ label_3
+ list_vectorVBO
+ label
+ slider_vectorsScaleFactor
+ label_2
diff --git a/SCHNApps/Plugins/renderVector/renderVector.h b/SCHNApps/Plugins/renderVector/include/renderVector.h
similarity index 85%
rename from SCHNApps/Plugins/renderVector/renderVector.h
rename to SCHNApps/Plugins/renderVector/include/renderVector.h
index 4cf57f9cac085886fde94da63e97342f88be1476..d2fb726ef5159ff7632f64848ce0fa442dc47f32 100644
--- a/SCHNApps/Plugins/renderVector/renderVector.h
+++ b/SCHNApps/Plugins/renderVector/include/renderVector.h
@@ -71,12 +71,12 @@ public:
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) {}
+ virtual void keyPress(View* view, QKeyEvent* event) {}
+ virtual void keyRelease(View* view, QKeyEvent* event) {}
+ virtual void mousePress(View* view, QMouseEvent* event) {}
+ virtual void mouseRelease(View* view, QMouseEvent* event) {}
+ virtual void mouseMove(View* view, QMouseEvent* event) {}
+ virtual void wheelEvent(View* view, QWheelEvent* event) {}
void setRefreshingUI(bool b) { b_refreshingUI = b; }
diff --git a/SCHNApps/Plugins/renderVector/renderVector.cpp b/SCHNApps/Plugins/renderVector/src/renderVector.cpp
similarity index 100%
rename from SCHNApps/Plugins/renderVector/renderVector.cpp
rename to SCHNApps/Plugins/renderVector/src/renderVector.cpp
diff --git a/SCHNApps/Plugins/subdivideSurface/CMakeLists.txt b/SCHNApps/Plugins/subdivideSurface/CMakeLists.txt
index 9f6a3d22e9f62b5a1baa3d4074d8dcfe73a89088..030bbf60c5928e1c972aacbf12d9ac6b57c137aa 100644
--- a/SCHNApps/Plugins/subdivideSurface/CMakeLists.txt
+++ b/SCHNApps/Plugins/subdivideSurface/CMakeLists.txt
@@ -1,75 +1,32 @@
cmake_minimum_required(VERSION 2.8)
+SET( PLUGIN_NAME SubdivideSurface )
+
+SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/subdivideSurface )
+
INCLUDE_DIRECTORIES(
- ${SCHNApps_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/Plugins/subdivideSurface/include
+ ${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
-SET( PLUGIN_SRC
- ${SCHNApps_ROOT_DIR}/Plugins/subdivideSurface/src/subdivideSurface.cpp
- ${SCHNApps_ROOT_DIR}/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
+file(
+ GLOB_RECURSE
+ PLUGIN_FILES
+ ${PLUGIN_ROOT_DIR}/src/*.cpp
+ ${PLUGIN_ROOT_DIR}/include/*.h
+ ${PLUGIN_ROOT_DIR}/include/*.hpp
)
-SET( PLUGIN_H
- ${SCHNApps_ROOT_DIR}/Plugins/subdivideSurface/include/subdivideSurface.h
- ${SCHNApps_ROOT_DIR}/Plugins/subdivideSurface/include/subdivideSurfaceDialog.h
+file(
+ GLOB_RECURSE
+ PLUGIN_UI_FILES
+ ${PLUGIN_ROOT_DIR}/forms/*.ui
)
-SET( PLUGIN_FORM
- ${SCHNApps_ROOT_DIR}/Plugins/subdivideSurface/forms/subdivideSurfaceDialog.ui
+SET(
+ PLUGIN_QOBJECT_FILES
+ ${PLUGIN_ROOT_DIR}/include/subdivideSurface.h
+ ${PLUGIN_ROOT_DIR}/include/subdivideSurfaceDialog.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( SubdivideSurfaceD SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( SubdivideSurfaceD
- ${CGoGN_LIBS_D}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( SubdivideSurfaceD SCHNAppsD )
-
- SET_TARGET_PROPERTIES( SubdivideSurfaceD 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( SubdivideSurface SHARED
- ${PLUGIN_SRC}
- ${PLUGIN_UI}
- ${PLUGIN_MOC}
- )
-
- TARGET_LINK_LIBRARIES( SubdivideSurface
- ${CGoGN_LIBS_R}
- ${COMMON_LIBS}
- )
-
- ADD_DEPENDENCIES( SubdivideSurface SCHNApps )
-
-ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps/Plugins/subdivideSurface/include/subdivideSurface.h b/SCHNApps/Plugins/subdivideSurface/include/subdivideSurface.h
index c45dd6dd78b4a16d4c91ac3beb83850b72e45faa..ea6900db3907b0e8c35428e9f53315e680db4b02 100644
--- a/SCHNApps/Plugins/subdivideSurface/include/subdivideSurface.h
+++ b/SCHNApps/Plugins/subdivideSurface/include/subdivideSurface.h
@@ -29,12 +29,12 @@ public:
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) {}
+ virtual void keyPress(View* view, QKeyEvent* event) {}
+ virtual void keyRelease(View* view, QKeyEvent* event) {}
+ virtual void mousePress(View* view, QMouseEvent* event) {}
+ virtual void mouseRelease(View* view, QMouseEvent* event) {}
+ virtual void mouseMove(View* view, QMouseEvent* event) {}
+ virtual void wheelEvent(View* view, QWheelEvent* event) {}
public slots:
void openSubdivideSurfaceDialog();
diff --git a/SCHNApps/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp b/SCHNApps/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
index cb87e22eb8c22c9e4c01bc0c1acee9ec1b790b8a..b9dce0390dc479b9546dce51d9e26d5a26b923d7 100644
--- a/SCHNApps/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
+++ b/SCHNApps/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
@@ -19,7 +19,7 @@ SubdivideSurfaceDialog::SubdivideSurfaceDialog(Window* w) :
connect(m_window, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(addMapToList(MapHandlerGen*)));
connect(m_window, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(removeMapFromList(MapHandlerGen*)));
- connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
+ connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(refreshUI()));
const QList& maps = m_window->getMapsList();
foreach(MapHandlerGen* map, maps)
diff --git a/SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt b/SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt
index 5722715e6fb13d55a0ba93aa43726bd00ed9d8c6..6d8b111639b924864c0eae079efa03007c9b2132 100644
--- a/SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt
+++ b/SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt
@@ -1,69 +1,31 @@
cmake_minimum_required(VERSION 2.8)
+SET( PLUGIN_NAME SurfaceDeformation )
+
+SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/surfaceDeformation )
+
INCLUDE_DIRECTORIES(
- ${SCHNApps_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/Plugins/surfaceDeformation
+ ${PLUGIN_ROOT_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
-SET( PLUGIN_SRC
- ${SCHNApps_ROOT_DIR}/Plugins/surfaceDeformation/surfaceDeformation.cpp
+file(
+ GLOB_RECURSE
+ PLUGIN_FILES
+ ${PLUGIN_ROOT_DIR}/src/*.cpp
+ ${PLUGIN_ROOT_DIR}/include/*.h
+ ${PLUGIN_ROOT_DIR}/include/*.hpp
)
-SET( PLUGIN_H
- ${SCHNApps_ROOT_DIR}/Plugins/surfaceDeformation/surfaceDeformation.h
+file(
+ GLOB_RECURSE
+ PLUGIN_UI_FILES
+ ${PLUGIN_ROOT_DIR}/forms/*.ui
)
-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}
- )
+SET(
+ PLUGIN_QOBJECT_FILES
+ ${PLUGIN_ROOT_DIR}/include/surfaceDeformation.h
+)
- ADD_DEPENDENCIES( SurfaceDeformation SCHNApps )
-
-ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps/Plugins/surfaceDeformation/forms/surfaceDeformation.ui b/SCHNApps/Plugins/surfaceDeformation/forms/surfaceDeformation.ui
new file mode 100644
index 0000000000000000000000000000000000000000..f60d8a8980015ee7085f5ed41419971e774f2749
--- /dev/null
+++ b/SCHNApps/Plugins/surfaceDeformation/forms/surfaceDeformation.ui
@@ -0,0 +1,88 @@
+
+
+ SurfaceDeformationWidget
+
+
+
+ 0
+ 0
+ 189
+ 545
+
+
+
+ Form
+
+
+ -
+
+
+ -
+
+
-
+
+
+ Position :
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ -
+
+
+ Select Vertices
+
+
+
-
+
+
-
+
+
+ locked
+
+
+
+ -
+
+
+ handle
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 156
+ 161
+
+
+
+
+
+ mapList
+ label_2
+ groupBox
+
+
+
+
diff --git a/SCHNApps/Plugins/surfaceDeformation/include/surfaceDeformation.h b/SCHNApps/Plugins/surfaceDeformation/include/surfaceDeformation.h
new file mode 100644
index 0000000000000000000000000000000000000000..858c74d1c0e088afeca0fc28d5781e45b9658c99
--- /dev/null
+++ b/SCHNApps/Plugins/surfaceDeformation/include/surfaceDeformation.h
@@ -0,0 +1,111 @@
+#ifndef _SURFACEDEFORMATION_PLUGIN_H_
+#define _SURFACEDEFORMATION_PLUGIN_H_
+
+#include "plugin.h"
+
+
+using namespace CGoGN;
+using namespace SCHNApps;
+
+
+struct PerMapParameterSet
+{
+ PerMapParameterSet() {}
+
+ PerMapParameterSet(MapHandlerGen* mh);
+
+ VertexAttribute positionAttribute;
+ CellMarker lockingMarker;
+ bool setLockedVertices;
+ bool selecting;
+ PFP2::VEC3 selectionCenter;
+ PFP2::REAL selectionRadius;
+ bool dragging;
+ PFP2::REAL dragZ;
+ qglviewer::Vec dragPrevious;
+ std::vector locked_vertices;
+ std::vector handle_vertices;
+};
+
+struct ParameterSet
+{
+ ParameterSet() : selectedMap(NULL)
+ {}
+
+ PerMapParameterSet& getCurrentMapParameterSet()
+ {
+ return perMap[selectedMap->getName()];
+ }
+
+ QHash perMap;
+ MapHandlerGen* selectedMap;
+};
+
+
+class SurfaceDeformationPlugin;
+
+class SurfaceDeformationDockTab : public QWidget, public Ui::SurfaceDeformationWidget
+{
+public:
+ SurfaceDeformationDockTab(SurfaceDeformationPlugin* p) : plugin(p)
+ {
+ setupUi(this);
+ }
+
+ void refreshUI(ParameterSet* params);
+
+private:
+ SurfaceDeformationPlugin* plugin;
+};
+
+
+class SurfaceDeformationPlugin : public Plugin
+{
+ Q_OBJECT
+ Q_INTERFACES(CGoGN::SCHNApps::Plugin)
+
+public:
+ SurfaceDeformationPlugin() : b_refreshingUI(false)
+ {
+ setProvidesRendering(true);
+ }
+
+ ~SurfaceDeformationPlugin()
+ {}
+
+ virtual bool enable();
+ virtual void disable() {}
+
+ virtual void redraw(View *view);
+
+ virtual void keyPress(View* view, QKeyEvent* event);
+ virtual void keyRelease(View* view, QKeyEvent* event);
+ virtual void mousePress(View* view, QMouseEvent* event);
+ virtual void mouseRelease(View* view, QMouseEvent* event);
+ virtual void mouseMove(View* view, QMouseEvent* event);
+ virtual void wheelEvent(View* view, QWheelEvent* event);
+
+ void setRefreshingUI(bool b) { b_refreshingUI = b; }
+
+public slots:
+ void viewLinked(View* view, Plugin* plugin);
+ void viewUnlinked(View* view, Plugin* plugin);
+ void currentViewChanged(View* view);
+
+ void mapLinked(MapHandlerGen* m);
+ void mapUnlinked(MapHandlerGen* m);
+
+ void changeSelectedMap(View* view, MapHandlerGen* map);
+ void changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute);
+
+ void cb_selectedMapChanged();
+ void cb_positionAttributeChanged(int index);
+
+private:
+ RenderVectorDockTab* m_dockTab;
+ QHash h_viewParams;
+
+ bool b_refreshingUI;
+};
+
+#endif
diff --git a/SCHNApps/Plugins/surfaceDeformation/src/surfaceDeformation.cpp b/SCHNApps/Plugins/surfaceDeformation/src/surfaceDeformation.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d213044307bbed852c29d210035c42afaa1c8a81
--- /dev/null
+++ b/SCHNApps/Plugins/surfaceDeformation/src/surfaceDeformation.cpp
@@ -0,0 +1,349 @@
+#include "surfaceDeformation.h"
+
+#include "Algo/Selection/raySelector.h"
+#include "Algo/Selection/collector.h"
+
+
+PerMapParameterSet::PerMapParameterSet(MapHandlerGen* mh) :
+ setLockedVertices(true),
+ selecting(false),
+ selectionRadius(0.1f),
+ dragging(false)
+{
+ GenericMap* map = mh->getGenericMap();
+ AttributeContainer& cont = map->getAttributeContainer();
+
+ std::vector names;
+ std::vector types;
+ cont.getAttributesNames(names);
+ cont.getAttributesTypes(types);
+ std::string vec3TypeName = nameOfType(PFP2::VEC3());
+ for(unsigned int i = 0; i < names.size(); ++i)
+ {
+ if(types[i] == vec3TypeName)
+ {
+ if(names[i] == "position") // try to select a position attribute named "position"
+ positionAttribute = mh->getAttribute(names[i]);
+ }
+ }
+
+ if(!positionAttribute.isValid())
+ {
+ for(unsigned int i = 0; i < names.size(); ++i)
+ {
+ if(types[i] == vec3TypeName)
+ {
+ positionAttribute = mh->getAttribute(names[i]);
+ break;
+ }
+ }
+ }
+}
+
+
+bool SurfaceDeformationPlugin::enable()
+{
+ m_dockTab = new SurfaceDeformationDockTab(this);
+ addTabInDock(m_dockTab, "Surface Deformation");
+
+ connect(m_dockTab->mapList, SIGNAL(itemSelectionChanged()), this, SLOT(cb_selectedMapChanged()));
+ connect(m_dockTab->combo_positionAttribute, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_positionAttributeChanged(int)));
+
+ connect(m_window, SIGNAL(viewAndPluginLinked(View*, Plugin*)), this, SLOT(viewLinked(View*, Plugin*)));
+ connect(m_window, SIGNAL(viewAndPluginUnlinked(View*, Plugin*)), this, SLOT(viewUnlinked(View*, Plugin*)));
+ connect(m_window, SIGNAL(currentViewChanged(View*)), this, SLOT(currentViewChanged(View*)));
+
+ return true;
+}
+
+void SurfaceDeformationPlugin::keyPress(View* view, QKeyEvent* event)
+{
+ if(event->key() == Qt::Key_Shift)
+ {
+ view->setMouseTracking(true);
+ ParameterSet* params = h_viewParams[view];
+ PerMapParameterSet& perMap = params->getCurrentMapParameterSet();
+ perMap.selecting = true;
+ view->updateGL();
+ }
+}
+
+void SurfaceDeformationPlugin::keyRelease(View* view, QKeyEvent* event)
+{
+ if(event->key() == Qt::Key_Shift)
+ {
+ view->setMouseTracking(false);
+ ParameterSet* params = h_viewParams[view];
+ PerMapParameterSet& perMap = params->getCurrentMapParameterSet();
+ perMap.selecting = false;
+ view->updateGL();
+ }
+}
+
+void SurfaceDeformationPlugin::mousePress(View* view, QMouseEvent* event)
+{
+ if(event->button() == Qt::RightButton && event->modifiers() & Qt::ShiftModifier)
+ {
+ view->setMouseTracking(false) ;
+
+ ParameterSet* params = h_viewParams[view];
+ PerMapParameterSet& perMap = params->getCurrentMapParameterSet();
+
+ perMap.selecting = false ;
+ perMap.dragging = true ;
+
+ perMap.dragZ = 0;
+ for(unsigned int i = 0; i < perMap.handle_vertices.size(); ++i)
+ {
+ PFP::VEC3& p = perMap.positionAttribute[handle_vertices[i]] ;
+ qglviewer::Vec q = view->projectedCoordinatesOf(qglviewer::Vec(p[0],p[1],p[2]));
+ dragZ += q.z ;
+ }
+ dragZ /= handle_vertices.size() ;
+
+ qglviewer::Vec p(event->x(), event->y(), dragZ);
+ perMap.dragPrevious = view->unprojectedCoordinatesOf(p);
+ }
+ if(button == Qt::LeftButton && event->modifiers() & Qt::ShiftModifier)
+ {
+ ParameterSet* params = h_viewParams[view];
+ PerMapParameterSet& perMap = params->getCurrentMapParameterSet();
+
+ QPoint pixel(event->x(), event->y());
+ qglviewer::Vec orig;
+ qglviewer::Vec dir;
+ view->convertClickToLine(pixel, orig, dir);
+
+ PFP::VEC3 rayA(orig.x, orig.y, orig.z);
+ PFP::VEC3 AB(dir.x, dir.y, dir.z);
+
+ Dart d ;
+ PFP2::MAP map = static_cast*>(params->selectedMap)->getMap();
+ Algo::Selection::vertexRaySelection(*map, position, rayA, AB, d) ;
+
+ if(d != NIL)
+ {
+ Algo::Surface::Selection::Collector_WithinSphere neigh(*map, perMap.positionAttribute, perMap.selectionRadius) ;
+ neigh.collectAll(d) ;
+ const std::vector& insideV = neigh.getInsideVertices() ;
+
+ if(perMap.setLockedVertices)
+ {
+ for(unsigned int i = 0; i < insideV.size(); ++i)
+ {
+ unsigned int v = map->getEmbedding(insideV[i]) ;
+ if (!lockingMarker.isMarked(v))
+ {
+ locked_vertices.push_back(v) ;
+ lockingMarker.mark(v);
+ }
+ }
+ LinearSolving::resetSolver(solver, false) ;
+ }
+ else
+ {
+ for(unsigned int i = 0; i < insideV.size(); ++i)
+ {
+ unsigned int v = myMap.getEmbedding(insideV[i]) ;
+ if(!handleMarker.isMarked(v))
+ {
+ handle_vertices.push_back(v) ;
+ handleMarker.mark(v);
+ }
+ if(!lockingMarker.isMarked(v))
+ {
+ locked_vertices.push_back(v) ;
+ lockingMarker.mark(v) ;
+ }
+ }
+ LinearSolving::resetSolver(solver, false) ;
+ }
+ view->updateGL() ;
+ }
+ }
+}
+
+void SurfaceDeformationPlugin::mouseRelease(View* view, QMouseEvent* event)
+{
+ if(event->button() == Qt::RightButton)
+ {
+ ParameterSet* params = h_viewParams[view];
+ PerMapParameterSet& perMap = params->getCurrentMapParameterSet();
+ perMap.dragging = false ;
+ }
+}
+
+void SurfaceDeformationPlugin::mouseMove(View* view, QMouseEvent* event)
+{
+ ParameterSet* params = h_viewParams[view];
+ PerMapParameterSet& perMap = params->getCurrentMapParameterSet();
+ if(perMap.dragging)
+ {
+ qglviewer::Vec p(event->x(), event->y(), perMap.dragZ);
+ qglviewer::Vec q = view->unprojectedCoordinatesOf(p);
+
+ qglviewer::Vec vec = q - perMap.dragPrevious;
+ PFP::VEC3 t(vec.x, vec.y, vec.z);
+ for(unsigned int i = 0; i < handle_vertices.size(); ++i)
+ perMap.positionAttribute[handle_vertices[i]] += t ;
+
+ perMap.dragPrevious = q ;
+
+// matchDiffCoord() ;
+// for(unsigned int i = 0; i < 2; ++i)
+// asRigidAsPossible();
+
+ m_positionVBO->updateData(position);
+
+ view->updateGL();
+ }
+ else if(selecting)
+ {
+ QPoint pixel(event->x(), event->y());
+ qglviewer::Vec orig;
+ qglviewer::Vec dir;
+ view->convertClickToLine(pixel, orig, dir);
+
+ PFP::VEC3 rayA(orig.x, orig.y, orig.z);
+ PFP::VEC3 AB(dir.x, dir.y, dir.z);
+
+ Dart d ;
+ PFP2::MAP map = static_cast*>(params->selectedMap)->getMap();
+ Algo::Selection::vertexRaySelection(*map, position, rayA, AB, d) ;
+ if(d != NIL)
+ {
+ perMap.selectionCenter = perMap.positionAttribute[d] ;
+ view->updateGL() ;
+ }
+ }
+}
+
+void SurfaceDeformationPlugin::viewLinked(View* view, Plugin* plugin)
+{
+ if(plugin == this)
+ {
+ ParameterSet* params = new ParameterSet();
+ h_viewParams.insert(view, params);
+ const QList& maps = view->getLinkedMaps();
+ foreach(MapHandlerGen* map, maps)
+ {
+ PerMapParameterSet p(map);
+ params->perMap.insert(map->getName(), p);
+ }
+ if (!maps.empty())
+ changeSelectedMap(view, maps[0]);
+
+ connect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
+ connect(view, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(mapUnlinked(MapHandlerGen*)));
+
+ if(view->isCurrentView())
+ m_dockTab->refreshUI(params);
+ }
+}
+
+void SurfaceDeformationPlugin::viewUnlinked(View* view, Plugin* plugin)
+{
+ if(plugin == this)
+ {
+ h_viewParams.remove(view);
+
+ disconnect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
+ disconnect(view, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(mapUnlinked(MapHandlerGen*)));
+ }
+}
+
+void SurfaceDeformationPlugin::currentViewChanged(View* view)
+{
+ if(isLinkedToView(view))
+ m_dockTab->refreshUI(h_viewParams[view]);
+}
+
+void SurfaceDeformationPlugin::mapLinked(MapHandlerGen* m)
+{
+ View* view = static_cast(QObject::sender());
+ assert(isLinkedToView(view));
+
+ ParameterSet* params = h_viewParams[view];
+ PerMapParameterSet p(m);
+ params->perMap.insert(m->getName(), p);
+ if(params->selectedMap == NULL || params->perMap.count() == 1)
+ changeSelectedMap(view, m);
+ else
+ m_dockTab->refreshUI(params);
+}
+
+void SurfaceDeformationPlugin::mapUnlinked(MapHandlerGen* m)
+{
+ View* view = static_cast(QObject::sender());
+ assert(isLinkedToView(view));
+
+ ParameterSet* params = h_viewParams[view];
+ params->perMap.remove(m->getName());
+
+ if(params->selectedMap == m)
+ {
+ if(!params->perMap.empty())
+ changeSelectedMap(view, m_window->getMap(params->perMap.begin().key()));
+ else
+ changeSelectedMap(view, NULL);
+ }
+ else
+ m_dockTab->refreshUI(params);
+}
+
+void SurfaceDeformationPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
+{
+ ParameterSet* params = h_viewParams[view];
+
+ MapHandlerGen* prev = params->selectedMap;
+ params->selectedMap = map;
+
+ if(view->isCurrentView())
+ {
+ if(prev)
+ disconnect(map, SIGNAL(attributeAdded()), this, SLOT(attributeAdded()));
+ if(map)
+ connect(map, SIGNAL(attributeAdded()), this, SLOT(attributeAdded()));
+
+ m_dockTab->refreshUI(params);
+ view->updateGL();
+ }
+}
+
+void SurfaceDeformationPlugin::changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute)
+{
+ ParameterSet* params = h_viewParams[view];
+ params->perMap[map->getName()].positionAttribute = attribute;
+
+ if(view->isCurrentView())
+ {
+ m_dockTab->refreshUI(params);
+ view->updateGL();
+ }
+}
+
+void SurfaceDeformationPlugin::cb_selectedMapChanged()
+{
+ if(!b_refreshingUI)
+ {
+ QList currentItems = m_dockTab->mapList->selectedItems();
+ if(!currentItems.empty())
+ changeSelectedMap(m_window->getCurrentView(), m_window->getMap(currentItems[0]->text()));
+ }
+}
+
+void SurfaceDeformationPlugin::cb_positionAttributeChanged(int index)
+{
+ if(!b_refreshingUI)
+ {
+ View* view = m_window->getCurrentView();
+ MapHandlerGen* map = h_viewParams[view]->selectedMap;
+ changePositionAttribute(view, map, map->getAttribute(m_dockTab->combo_positionVBO->currentText()));
+ }
+}
+
+#ifndef DEBUG
+Q_EXPORT_PLUGIN2(SurfaceDeformationPlugin, SurfaceDeformationPlugin)
+#else
+Q_EXPORT_PLUGIN2(SurfaceDeformationPluginD, SurfaceDeformationPlugin)
+#endif
diff --git a/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.cpp b/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.cpp
deleted file mode 100644
index 4e0f7144756106a782f8f065f3977640c187d419..0000000000000000000000000000000000000000
--- a/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#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
deleted file mode 100644
index 238359445a3f6d517b7940fbee29908430478e66..0000000000000000000000000000000000000000
--- a/SCHNApps/Plugins/surfaceDeformation/surfaceDeformation.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#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
diff --git a/SCHNApps/Release/CMakeLists.txt b/SCHNApps/Release/CMakeLists.txt
index 5fe0471f2c86bf7d0d01aabb76a03720cb373249..98f8368b38615a40ec187b22b1c85a4d746c2684 100644
--- a/SCHNApps/Release/CMakeLists.txt
+++ b/SCHNApps/Release/CMakeLists.txt
@@ -16,64 +16,21 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
)
-file(
- GLOB
- SCHNApps_SRC_FILES
- ${SCHNApps_ROOT_DIR}/src/main.cpp
- ${SCHNApps_ROOT_DIR}/src/camera.cpp
- ${SCHNApps_ROOT_DIR}/src/mapHandler.cpp
- ${SCHNApps_ROOT_DIR}/src/plugin.cpp
- ${SCHNApps_ROOT_DIR}/src/view.cpp
- ${SCHNApps_ROOT_DIR}/src/window.cpp
- ${SCHNApps_ROOT_DIR}/src/viewButtonArea.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/camerasDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/pluginsDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/mapsDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/cameraViewDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/pluginsViewDialog.cpp
- ${SCHNApps_ROOT_DIR}/src/dialogs/mapsViewDialog.cpp
+QT4_WRAP_UI( UIC_FILES
+ ${SCHNApps_UI_FILES}
)
-SET(SCHNApps_H_OBJECT_FILES
- ${SCHNApps_ROOT_DIR}/include/camera.h
- ${SCHNApps_ROOT_DIR}/include/mapHandler.h
- ${SCHNApps_ROOT_DIR}/include/plugin.h
- ${SCHNApps_ROOT_DIR}/include/view.h
- ${SCHNApps_ROOT_DIR}/include/window.h
- ${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/camerasDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/pluginsDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/mapsDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/pluginsViewDialog.h
- ${SCHNApps_ROOT_DIR}/include/dialogs/mapsViewDialog.h
-)
-
-file(
- GLOB
- SCHNApps_FORM_FILES
- ${SCHNApps_ROOT_DIR}/forms/window.ui
- ${SCHNApps_ROOT_DIR}/forms/camerasDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/pluginsDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/mapsDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/cameraViewDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/pluginsViewDialog.ui
- ${SCHNApps_ROOT_DIR}/forms/mapsViewDialog.ui
-)
-
-QT4_WRAP_UI( UI_H_FILES
- ${SCHNApps_FORM_FILES}
-)
QT4_WRAP_CPP( MOC_FILES
- ${SCHNApps_H_OBJECT_FILES}
+ ${SCHNApps_QOBJECT_FILES}
)
+
QT4_ADD_RESOURCES( RCC_FILES
${SCHNApps_ROOT_DIR}/resources/resources.qrc
)
ADD_EXECUTABLE( SCHNApps
- ${SCHNApps_SRC_FILES}
- ${UI_H_FILES}
+ ${SCHNApps_FILES}
+ ${UIC_FILES}
${MOC_FILES}
${RCC_FILES}
)
diff --git a/SCHNApps/include/mapHandler.h b/SCHNApps/include/mapHandler.h
index 0ffdcd7c70ffb2a7b10ac97065d9235322ed59f2..2005dedf6e68db6e1dbfdbeb22f5f5bfe7b59160 100644
--- a/SCHNApps/include/mapHandler.h
+++ b/SCHNApps/include/mapHandler.h
@@ -56,8 +56,7 @@ public:
template
AttributeHandler getAttribute(const QString& nameAttr)
{
- AttributeHandler ah = static_cast(m_map)->getAttribute(nameAttr.toUtf8().constData());
- return ah;
+ return static_cast(m_map)->getAttribute(nameAttr.toUtf8().constData());
}
template
diff --git a/SCHNApps/include/plugin.h b/SCHNApps/include/plugin.h
index 1d7c5099e60c903b95327421b79e4f0d13545821..41e70fa5afc2dd64a818dfd10b90d4b9824a8d5b 100644
--- a/SCHNApps/include/plugin.h
+++ b/SCHNApps/include/plugin.h
@@ -45,12 +45,12 @@ public:
virtual void redraw(View* view) = 0;
- virtual void keyPress(View* view, int key) = 0;
- virtual void keyRelease(View* view, int key) = 0;
- virtual void mousePress(View* view, int button, int x, int y) = 0;
- virtual void mouseRelease(View* view, int button, int x, int y) = 0;
- virtual void mouseMove(View* view, int buttons, int x, int y) = 0;
- virtual void wheelEvent(View* view, int delta, int x, int y) = 0;
+ virtual void keyPress(View* view, QKeyEvent* event) = 0;
+ virtual void keyRelease(View* view, QKeyEvent* event) = 0;
+ virtual void mousePress(View* view, QMouseEvent* event) = 0;
+ virtual void mouseRelease(View* view, QMouseEvent* event) = 0;
+ virtual void mouseMove(View* view, QMouseEvent* event) = 0;
+ virtual void wheelEvent(View* view, QWheelEvent* event) = 0;
/*********************************************************
* MANAGE LINKED VIEWS
diff --git a/SCHNApps/src/view.cpp b/SCHNApps/src/view.cpp
index 65fecbf0b8e20fce722afc310a860863bbd5379e..fc3f1d25728b650cdb5003d839cfe5f3a5932a13 100644
--- a/SCHNApps/src/view.cpp
+++ b/SCHNApps/src/view.cpp
@@ -176,14 +176,14 @@ void View::drawFrame()
void View::keyPressEvent(QKeyEvent* event)
{
foreach(Plugin* plugin, l_plugins)
- plugin->keyPress(this, event->key());
+ plugin->keyPress(this, event);
QGLViewer::keyPressEvent(event);
}
void View::keyReleaseEvent(QKeyEvent *event)
{
foreach(Plugin* plugin, l_plugins)
- plugin->keyRelease(this, event->key());
+ plugin->keyRelease(this, event);
QGLViewer::keyReleaseEvent(event);
}
@@ -197,7 +197,7 @@ void View::mousePressEvent(QMouseEvent* event)
else
{
foreach(Plugin* plugin, l_plugins)
- plugin->mousePress(this, event->button(), event->pos().x(), event->pos().y());
+ plugin->mousePress(this, event);
QGLViewer::mousePressEvent(event);
}
}
@@ -205,14 +205,14 @@ void View::mousePressEvent(QMouseEvent* event)
void View::mouseReleaseEvent(QMouseEvent* event)
{
foreach(Plugin* plugin, l_plugins)
- plugin->mouseRelease(this, event->button(), event->pos().x(), event->pos().y());
+ plugin->mouseRelease(this, event);
QGLViewer::mouseReleaseEvent(event);
}
void View::mouseMoveEvent(QMouseEvent* event)
{
foreach(Plugin* plugin, l_plugins)
- plugin->mouseMove(this, event->button(), event->pos().x(), event->pos().y());
+ plugin->mouseMove(this, event);
QGLViewer::mouseMoveEvent(event);
QList views = m_window->getViewsList();
@@ -226,7 +226,7 @@ void View::mouseMoveEvent(QMouseEvent* event)
void View::wheelEvent(QWheelEvent* event)
{
foreach(Plugin* plugin, l_plugins)
- plugin->wheelEvent(this, event->delta(), event->pos().x(), event->pos().y());
+ plugin->wheelEvent(this, event);
QGLViewer::wheelEvent(event);
QList views = m_window->getViewsList();