diff --git a/SCHNApps_old/CMakeLists.txt b/SCHNApps_old/CMakeLists.txt
deleted file mode 100644
index 38d73d600b6db2b8dfdc68d8755136230d773879..0000000000000000000000000000000000000000
--- a/SCHNApps_old/CMakeLists.txt
+++ /dev/null
@@ -1,149 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-project(SCHNApps)
-
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC")
-
-
-SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. CACHE STRING "CGoGN root dir")
-SET(CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/)
-
-
-find_package(OpenGL REQUIRED)
-find_package(Boost COMPONENTS regex thread system REQUIRED)
-find_package(ZLIB REQUIRED)
-find_package(LibXml2 REQUIRED)
-find_package(GLEW REQUIRED)
-find_package(Qt4 REQUIRED)
-find_package(QGLViewer REQUIRED)
-find_package(PythonLibs 2.7 REQUIRED)
-find_package(SuiteSparse REQUIRED)
-#find_package(SuperLU REQUIRED)
-
-
-SET( QT_USE_QTOPENGL TRUE )
-SET( QT_USE_QTXML TRUE )
-SET( QT_USE_QTDESIGNER TRUE )
-SET( QT_USE_QTGUI TRUE )
-SET( QT_USE_QTPLUGIN TRUE )
-
-INCLUDE(${QT_USE_FILE})
-ADD_DEFINITIONS(${QT_DEFINITIONS})
-
-
-
-
-file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_mr.h FORCE_MR)
-IF (FORCE_MR EQUAL 1)
- add_definitions(-DCGoGN_FORCE_MR=1)
-ENDIF (FORCE_MR EQUAL 1)
-
-file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h ONELIB_STR)
-IF (ONELIB_STR EQUAL 1)
- SET(CGoGN_LIBS_D cgognD)
- SET(CGoGN_LIBS_R cgogn)
-ELSE (ONELIB_STR EQUAL 1)
- SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
- SET(CGoGN_LIBS_R topology algo container utils)
-ENDIF (ONELIB_STR EQUAL 1)
-
-IF (DEFINED ASSERTON)
- add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
-ELSE (DEFINED ASSERTON)
- add_definitions(-DCGOGN_ASSERT_BOOL=false)
-ENDIF (DEFINED ASSERTON)
-
-add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/")
-
-
-
-
-# define includes of external libs
-SET (EXT_INCLUDES
- ${CGoGN_ROOT_DIR}/ThirdParty/include
- ${OPENGL_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIRS}
- ${ZLIB_INCLUDE_DIRS}
- ${LIBXML2_INCLUDE_DIR}
- ${Boost_INCLUDE_DIRS}
- ${QT_INCLUDE_DIR}
- ${QGLVIEWER_INCLUDE_DIR}
- ${PYTHON_INCLUDE_DIRS}
- ${SUITESPARSE_INCLUDE_DIRS}
-# ${SUPERLU_INCLUDE_DIRS}
-)
-
-# define libs for external libs
-SET (EXT_LIBS
- PythonQt
- nl
- ${OPENGL_LIBRARY}
- ${GLEW_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${LIBXML2_LIBRARIES}
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_REGEX_LIBRARY}
- ${Boost_THREAD_LIBRARY}
- ${QT_LIBRARIES}
- ${QGLVIEWER_LIBRARIES}
- ${PYTHON_LIBRARIES}
- ${SUITESPARSE_LIBRARIES}
-# ${SUPERLU_LIBRARIES}
-)
-
-
-
-
-# qq definition specifiques pour mac
-IF(APPLE)
-# attention a changer pour chercher la bonne version automatiquement
- SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk" CACHE STRING "developer SDK")
- SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAC_OSX")
- SET(CMAKE_OSX_ARCHITECTURES x86_64)
-ENDIF(APPLE)
-
-
-
-
-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
- ${SCHNApps_ROOT_DIR}/include/*.hpp
-)
-
-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
- ${SCHNApps_ROOT_DIR}/include/colorComboBox.h
-)
-
-
-
-ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/Release Release)
-IF (NOT WIN32)
- ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/Debug Debug)
-ENDIF (NOT WIN32)
diff --git a/SCHNApps_old/Debug/CMakeLists.txt b/SCHNApps_old/Debug/CMakeLists.txt
deleted file mode 100644
index 3d9edd0c7b6c8339edce5c4f957b1de5ca85c59d..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Debug/CMakeLists.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET(CMAKE_BUILD_TYPE Debug)
-
-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)
-
-INCLUDE_DIRECTORIES(
- ${CGoGN_ROOT_DIR}/include
- ${SCHNApps_ROOT_DIR}/include
- ${EXT_INCLUDES}
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-QT4_WRAP_UI( UIC_FILES
- ${SCHNApps_UI_FILES}
-)
-
-QT4_WRAP_CPP( MOC_FILES
- ${SCHNApps_QOBJECT_FILES}
-)
-
-QT4_ADD_RESOURCES( RCC_FILES
- ${SCHNApps_ROOT_DIR}/resources/resources.qrc
-)
-
-ADD_EXECUTABLE( SCHNAppsD
- ${SCHNApps_FILES}
- ${UIC_FILES}
- ${MOC_FILES}
- ${RCC_FILES}
-)
-
-TARGET_LINK_LIBRARIES( SCHNAppsD
- ${CGoGN_LIBS_D}
- ${EXT_LIBS}
-)
-
-
-ADD_SUBDIRECTORY(${SCHNApps_ROOT_DIR}/Plugins PluginsD)
diff --git a/SCHNApps_old/Plugins/CMakeLists.txt b/SCHNApps_old/Plugins/CMakeLists.txt
deleted file mode 100644
index be703257c2ae1f175f7e0350a148ea804e9d690b..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-ADD_SUBDIRECTORY(importSurface)
-ADD_SUBDIRECTORY(importVolume)
-ADD_SUBDIRECTORY(differentialProperties)
-ADD_SUBDIRECTORY(render)
-ADD_SUBDIRECTORY(renderVector)
-ADD_SUBDIRECTORY(renderScalar)
-ADD_SUBDIRECTORY(renderExplod)
-ADD_SUBDIRECTORY(renderTopoSurface)
-ADD_SUBDIRECTORY(subdivideSurface)
-ADD_SUBDIRECTORY(surfaceDeformation)
-
diff --git a/SCHNApps_old/Plugins/differentialProperties/CMakeLists.txt b/SCHNApps_old/Plugins/differentialProperties/CMakeLists.txt
deleted file mode 100644
index e970512867c78122238c06f39985f2a0953a3c37..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/CMakeLists.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME DifferentialProperties )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/differentialProperties.h
- ${PLUGIN_ROOT_DIR}/include/computeNormalDialog.h
- ${PLUGIN_ROOT_DIR}/include/computeCurvatureDialog.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/differentialProperties/forms/computeCurvatureDialog.ui b/SCHNApps_old/Plugins/differentialProperties/forms/computeCurvatureDialog.ui
deleted file mode 100644
index bcfc9a1008228ffa9688bf31e70fd9746d7deb55..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/forms/computeCurvatureDialog.ui
+++ /dev/null
@@ -1,354 +0,0 @@
-
-
- ComputeCurvatureDialog
-
-
-
- 0
- 0
- 568
- 442
-
-
-
- Compute Curvature
-
-
- -
-
-
- -
-
-
-
-
-
- Position attribute :
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- Normal attribute :
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- -
-
-
- Computed attributes
-
-
-
-
-
-
-
- 75
- true
- true
-
-
-
- Kmax :
-
-
-
- -
-
-
- Existing attribute :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- New attribute :
-
-
-
- -
-
-
- -
-
-
-
- 75
- true
- true
-
-
-
- kmax :
-
-
-
- -
-
-
- Existing attribute :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- New attribute :
-
-
-
- -
-
-
- -
-
-
-
- 75
- true
- true
-
-
-
- Kmin :
-
-
-
- -
-
-
- Existing attribute :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- New attribute :
-
-
-
- -
-
-
- -
-
-
-
- 75
- true
- true
-
-
-
- kmin :
-
-
-
- -
-
-
- Existing attribute :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- New attribute :
-
-
-
- -
-
-
- -
-
-
-
- 75
- true
- true
-
-
-
- Knormal :
-
-
-
- -
-
-
- Existing attribute :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- New attribute :
-
-
-
- -
-
-
- -
-
-
- compute kmean
-
-
-
- -
-
-
- compute kgaussian
-
-
-
-
-
-
- -
-
-
-
-
-
- Cancel
-
-
-
- -
-
-
- Apply
-
-
-
- -
-
-
- OK
-
-
-
-
-
-
-
-
-
-
- button_ok
- clicked()
- ComputeCurvatureDialog
- accept()
-
-
- 232
- 283
-
-
- 140
- 156
-
-
-
-
- button_cancel
- clicked()
- ComputeCurvatureDialog
- reject()
-
-
- 52
- 283
-
-
- 140
- 156
-
-
-
-
-
diff --git a/SCHNApps_old/Plugins/differentialProperties/forms/computeNormalDialog.ui b/SCHNApps_old/Plugins/differentialProperties/forms/computeNormalDialog.ui
deleted file mode 100644
index 0afad975a6f0ff77b32af1ac259d8d93f5713fc1..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/forms/computeNormalDialog.ui
+++ /dev/null
@@ -1,143 +0,0 @@
-
-
- ComputeNormalDialog
-
-
-
- 0
- 0
- 472
- 276
-
-
-
- Compute Normal
-
-
- -
-
-
- -
-
-
-
-
-
- Position attribute :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- -
-
-
- Normal attribute
-
-
-
-
-
-
-
-
-
- Existing attribute :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- New attribute :
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
- Cancel
-
-
-
- -
-
-
- Apply
-
-
-
- -
-
-
- OK
-
-
-
-
-
-
-
-
-
-
- button_ok
- clicked()
- ComputeNormalDialog
- accept()
-
-
- 232
- 283
-
-
- 140
- 156
-
-
-
-
- button_cancel
- clicked()
- ComputeNormalDialog
- reject()
-
-
- 52
- 283
-
-
- 140
- 156
-
-
-
-
-
diff --git a/SCHNApps_old/Plugins/differentialProperties/include/computeCurvatureDialog.h b/SCHNApps_old/Plugins/differentialProperties/include/computeCurvatureDialog.h
deleted file mode 100644
index 19808a5cfe61e8eed62e1b625e27dd1834a90c37..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/include/computeCurvatureDialog.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _COMPUTECURVATURE_DIALOG_H_
-#define _COMPUTECURVATURE_DIALOG_H_
-
-#include "ui_computeCurvatureDialog.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class MapHandlerGen;
-
-class ComputeCurvatureDialog : public QDialog, public Ui::ComputeCurvatureDialog
-{
- Q_OBJECT
-
-public:
- ComputeCurvatureDialog(Window* w);
-
-private:
- Window* m_window;
- MapHandlerGen* m_selectedMap;
-
-public slots:
- void selectedMapChanged();
- void addMapToList(MapHandlerGen* m);
- void removeMapFromList(MapHandlerGen* m);
- void addAttributeToList(unsigned int orbit, const QString& nameAttr);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/differentialProperties/include/computeNormalDialog.h b/SCHNApps_old/Plugins/differentialProperties/include/computeNormalDialog.h
deleted file mode 100644
index 9a65c05f6abf4c2fcf6afd4a8db6fd99bc94bed5..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/include/computeNormalDialog.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _COMPUTENORMAL_DIALOG_H_
-#define _COMPUTENORMAL_DIALOG_H_
-
-#include "ui_computeNormalDialog.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class MapHandlerGen;
-
-class ComputeNormalDialog : public QDialog, public Ui::ComputeNormalDialog
-{
- Q_OBJECT
-
-public:
- ComputeNormalDialog(Window* w);
-
-private:
- Window* m_window;
- MapHandlerGen* m_selectedMap;
-
-public slots:
- void selectedMapChanged();
- void addMapToList(MapHandlerGen* m);
- void removeMapFromList(MapHandlerGen* m);
- void addAttributeToList(unsigned int orbit, const QString& nameAttr);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/differentialProperties/include/differentialProperties.h b/SCHNApps_old/Plugins/differentialProperties/include/differentialProperties.h
deleted file mode 100644
index dbb053ec1278e1e74602bf536bc89a2f301264d4..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/include/differentialProperties.h
+++ /dev/null
@@ -1,114 +0,0 @@
-#ifndef _DIFFERENTIALPROPERTIES_PLUGIN_H_
-#define _DIFFERENTIALPROPERTIES_PLUGIN_H_
-
-#include "plugin.h"
-
-#include "computeNormalDialog.h"
-#include "computeCurvatureDialog.h"
-
-
-using namespace CGoGN;
-using namespace SCHNApps;
-
-
-class DifferentialPropertiesPlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- DifferentialPropertiesPlugin()
- {
- setProvidesRendering(false);
- }
-
- ~DifferentialPropertiesPlugin()
- {}
-
- 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) {}
-
-public slots:
- void mapAdded(MapHandlerGen* map);
- void mapRemoved(MapHandlerGen* map);
- void attributeModified(unsigned int orbit, QString nameAttr);
-
- void openComputeNormalDialog();
- void openComputeCurvatureDialog();
-
- void computeNormalFromDialog();
- void computeCurvatureFromDialog();
-
- void computeNormal(const QString& mapName,
- const QString& positionAttributeName = "position",
- const QString& normalAttributeName = "normal",
- bool autoUpdate = true);
-
- void computeCurvature(
- const QString& mapName,
- const QString& positionAttributeName = "position",
- const QString& normalAttributeName = "normal",
- const QString& KmaxAttributeName = "Kmax",
- const QString& kmaxAttributeName = "kmax",
- const QString& KminAttributeName = "Kmin",
- const QString& kminAttributeName = "kmin",
- const QString& KnormalAttributeName = "Knormal",
- bool compute_kmean = true,
- bool compute_kgaussian = true,
- bool autoUpdate = true
- );
-
-private:
- ComputeNormalDialog* m_computeNormalDialog;
- ComputeCurvatureDialog* m_computeCurvatureDialog;
-
- QAction* m_computeNormalAction;
- QAction* m_computeCurvatureAction;
-
- struct ComputeNormalParameters
- {
- ComputeNormalParameters() {}
- ComputeNormalParameters(const QString& p, const QString& n, bool update) :
- positionName(p), normalName(n), autoUpdate(update)
- {}
- QString positionName;
- QString normalName;
- bool autoUpdate;
- };
- QHash computeNormalLastParameters;
-
- struct ComputeCurvatureParameters
- {
- ComputeCurvatureParameters() {}
- ComputeCurvatureParameters(
- const QString& p, const QString& n,
- const QString& Kmax, const QString& kmax, const QString& Kmin, const QString& kmin, const QString& Knormal,
- bool kmean, bool kgaussian, bool update) :
- positionName(p), normalName(n),
- KmaxName(Kmax), kmaxName(kmax), KminName(Kmin), kminName(kmin), KnormalName(Knormal),
- compute_kmean(kmean), compute_kgaussian(kgaussian), autoUpdate(update)
- {}
- QString positionName;
- QString normalName;
- QString KmaxName;
- QString kmaxName;
- QString KminName;
- QString kminName;
- QString KnormalName;
- bool compute_kmean;
- bool compute_kgaussian;
- bool autoUpdate;
- };
- QHash computeCurvatureLastParameters;
-};
-
-#endif
diff --git a/SCHNApps_old/Plugins/differentialProperties/src/computeCurvatureDialog.cpp b/SCHNApps_old/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
deleted file mode 100644
index 855dd5c7b615540364222a131df6f394bf8c37df..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-#include "computeCurvatureDialog.h"
-
-#include "differentialProperties.h"
-#include "window.h"
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-ComputeCurvatureDialog::ComputeCurvatureDialog(Window* w) :
- m_window(w),
- m_selectedMap(NULL)
-{
- setupUi(this);
-
- KmaxAttributeName->setText("Kmax");
- kmaxAttributeName->setText("kmax");
- KminAttributeName->setText("Kmin");
- kminAttributeName->setText("kmin");
- KnormalAttributeName->setText("Knormal");
-
- 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()));
-
- const QList& maps = m_window->getMapsList();
- foreach(MapHandlerGen* map, maps)
- {
- QListWidgetItem* item = new QListWidgetItem(map->getName(), mapList);
- item->setCheckState(Qt::Unchecked);
- }
-}
-
-void ComputeCurvatureDialog::selectedMapChanged()
-{
- if(m_selectedMap)
- disconnect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
-
- QList currentItems = mapList->selectedItems();
- if(!currentItems.empty())
- {
- combo_positionAttribute->clear();
- combo_normalAttribute->clear();
- combo_KmaxAttribute->clear();
- combo_KminAttribute->clear();
- combo_KnormalAttribute->clear();
- combo_kmaxAttribute->clear();
- combo_kminAttribute->clear();
-
- const QString& mapname = currentItems[0]->text();
- MapHandlerGen* mh = m_window->getMap(mapname);
-
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
- QString realTypeName = QString::fromStdString(nameOfType(PFP2::REAL()));
-
- unsigned int j = 0;
- unsigned int k = 0;
- const AttributeHash& attribs = mh->getAttributesList(VERTEX);
- for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
- {
- if(i.value() == vec3TypeName)
- {
- combo_positionAttribute->addItem(i.key());
- if(i.key() == "position") // try to select a position attribute named "position"
- combo_positionAttribute->setCurrentIndex(j);
-
- combo_normalAttribute->addItem(i.key());
- if(i.key() == "normal") // try to select a normal attribute named "normal"
- combo_normalAttribute->setCurrentIndex(j);
-
- combo_KmaxAttribute->addItem(i.key());
- if(i.key() == "Kmax") // try to select a normal attribute named "Kmax"
- combo_KmaxAttribute->setCurrentIndex(j);
-
- combo_KminAttribute->addItem(i.key());
- if(i.key() == "Kmin") // try to select a normal attribute named "Kmin"
- combo_KminAttribute->setCurrentIndex(j);
-
- combo_KnormalAttribute->addItem(i.key());
- if(i.key() == "Knormal") // try to select a normal attribute named "Knormal"
- combo_KnormalAttribute->setCurrentIndex(j);
-
- ++j;
- }
- else if(i.value() == realTypeName)
- {
- combo_kmaxAttribute->addItem(i.key());
- if(i.key() == "kmax") // try to select a normal attribute named "kmax"
- combo_kmaxAttribute->setCurrentIndex(k);
-
- combo_kminAttribute->addItem(i.key());
- if(i.key() == "kmin") // try to select a normal attribute named "kmin"
- combo_kminAttribute->setCurrentIndex(k);
-
- ++k;
- }
- }
-
- m_selectedMap = mh;
- connect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
- }
- else
- m_selectedMap = NULL;
-}
-
-void ComputeCurvatureDialog::addMapToList(MapHandlerGen* m)
-{
- QListWidgetItem* item = new QListWidgetItem(m->getName(), mapList);
- item->setCheckState(Qt::Unchecked);
-}
-
-void ComputeCurvatureDialog::removeMapFromList(MapHandlerGen* m)
-{
- QList items = mapList->findItems(m->getName(), Qt::MatchExactly);
- if(!items.empty())
- delete items[0];
-
- if(m_selectedMap == m)
- {
- disconnect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
- m_selectedMap = NULL;
- }
-}
-
-void ComputeCurvatureDialog::addAttributeToList(unsigned int orbit, const QString& nameAttr)
-{
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
- QString realTypeName = QString::fromStdString(nameOfType(PFP2::REAL()));
-
- const QString& typeAttr = m_selectedMap->getAttributeTypeName(orbit, nameAttr);
-
- if(typeAttr == vec3TypeName)
- {
- combo_positionAttribute->addItem(nameAttr);
- combo_normalAttribute->addItem(nameAttr);
- combo_KmaxAttribute->addItem(nameAttr);
- combo_KminAttribute->addItem(nameAttr);
- combo_KnormalAttribute->addItem(nameAttr);
- }
- else if(typeAttr == realTypeName)
- {
- combo_kmaxAttribute->addItem(nameAttr);
- combo_kminAttribute->addItem(nameAttr);
- }
-}
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/differentialProperties/src/computeNormalDialog.cpp b/SCHNApps_old/Plugins/differentialProperties/src/computeNormalDialog.cpp
deleted file mode 100644
index 83266fce54869d3ff2b1376c54017239036e6ae3..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/src/computeNormalDialog.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "computeNormalDialog.h"
-
-#include "differentialProperties.h"
-#include "window.h"
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-ComputeNormalDialog::ComputeNormalDialog(Window* w) :
- m_window(w),
- m_selectedMap(NULL)
-{
- setupUi(this);
-
- normalAttributeName->setText("normal");
-
- 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()));
-
- const QList& maps = m_window->getMapsList();
- foreach(MapHandlerGen* map, maps)
- {
- QListWidgetItem* item = new QListWidgetItem(map->getName(), mapList);
- item->setCheckState(Qt::Unchecked);
- }
-}
-
-void ComputeNormalDialog::selectedMapChanged()
-{
- if(m_selectedMap)
- disconnect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
-
- QList currentItems = mapList->selectedItems();
- if(!currentItems.empty())
- {
- combo_positionAttribute->clear();
- combo_normalAttribute->clear();
-
- const QString& mapname = currentItems[0]->text();
- MapHandlerGen* mh = m_window->getMap(mapname);
-
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- unsigned int j = 0;
- const AttributeHash& attribs = mh->getAttributesList(VERTEX);
- for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
- {
- if(i.value() == vec3TypeName)
- {
- combo_positionAttribute->addItem(i.key());
- if(i.key() == "position") // try to select a position attribute named "position"
- combo_positionAttribute->setCurrentIndex(j);
-
- combo_normalAttribute->addItem(i.key());
- if(i.key() == "normal") // try to select a normal attribute named "normal"
- combo_normalAttribute->setCurrentIndex(j);
-
- ++j;
- }
- }
-
- m_selectedMap = mh;
- connect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
- }
- else
- m_selectedMap = NULL;
-}
-
-void ComputeNormalDialog::addMapToList(MapHandlerGen* m)
-{
- QListWidgetItem* item = new QListWidgetItem(m->getName(), mapList);
- item->setCheckState(Qt::Unchecked);
-}
-
-void ComputeNormalDialog::removeMapFromList(MapHandlerGen* m)
-{
- QList items = mapList->findItems(m->getName(), Qt::MatchExactly);
- if(!items.empty())
- delete items[0];
-
- if(m_selectedMap == m)
- {
- disconnect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
- m_selectedMap = NULL;
- }
-}
-
-void ComputeNormalDialog::addAttributeToList(unsigned int orbit, const QString& nameAttr)
-{
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- const QString& typeAttr = m_selectedMap->getAttributeTypeName(orbit, nameAttr);
-
- if(typeAttr == vec3TypeName)
- {
- combo_positionAttribute->addItem(nameAttr);
- combo_normalAttribute->addItem(nameAttr);
- }
-}
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/differentialProperties/src/differentialProperties.cpp b/SCHNApps_old/Plugins/differentialProperties/src/differentialProperties.cpp
deleted file mode 100644
index 034473833a4165b515b1868a91b38272b24e36cf..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/differentialProperties/src/differentialProperties.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-#include "differentialProperties.h"
-
-#include "mapHandler.h"
-
-#include "Algo/Geometry/normal.h"
-#include "Algo/Geometry/curvature.h"
-
-bool DifferentialPropertiesPlugin::enable()
-{
- m_computeNormalDialog = new ComputeNormalDialog(m_window);
- m_computeCurvatureDialog = new ComputeCurvatureDialog(m_window);
-
- m_computeNormalAction = new QAction("Compute Normal", this);
- m_computeCurvatureAction = new QAction("Compute Curvature", this);
-
- addMenuAction("Surface;Differential Properties;Compute Normal", m_computeNormalAction);
- addMenuAction("Surface;Differential Properties;Compute Curvature", m_computeCurvatureAction);
-
- connect(m_computeNormalAction, SIGNAL(triggered()), this, SLOT(openComputeNormalDialog()));
- connect(m_computeCurvatureAction, SIGNAL(triggered()), this, SLOT(openComputeCurvatureDialog()));
-
- connect(m_computeNormalDialog, SIGNAL(accepted()), this, SLOT(computeNormalFromDialog()));
- connect(m_computeNormalDialog->button_apply, SIGNAL(clicked()), this, SLOT(computeNormalFromDialog()));
-
- connect(m_computeCurvatureDialog, SIGNAL(accepted()), this, SLOT(computeCurvatureFromDialog()));
- connect(m_computeCurvatureDialog->button_apply, SIGNAL(clicked()), this, SLOT(computeCurvatureFromDialog()));
-
- connect(m_window, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*)));
- connect(m_window, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
-
- return true;
-}
-
-void DifferentialPropertiesPlugin::mapAdded(MapHandlerGen *map)
-{
- connect(map, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-}
-
-void DifferentialPropertiesPlugin::mapRemoved(MapHandlerGen *map)
-{
- disconnect(map, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-}
-
-void DifferentialPropertiesPlugin::attributeModified(unsigned int orbit, QString nameAttr)
-{
- if(orbit == VERTEX)
- {
- MapHandlerGen* map = static_cast(QObject::sender());
- if(computeNormalLastParameters.contains(map->getName()))
- {
- ComputeNormalParameters& params = computeNormalLastParameters[map->getName()];
- if(params.autoUpdate && params.positionName == nameAttr)
- computeNormal(map->getName(), params.positionName, params.normalName, true);
- }
- if(computeCurvatureLastParameters.contains(map->getName()))
- {
- ComputeCurvatureParameters& params = computeCurvatureLastParameters[map->getName()];
- if(params.autoUpdate && (params.positionName == nameAttr || params.normalName == nameAttr))
- computeCurvature(
- map->getName(),
- params.positionName, params.normalName,
- params.KmaxName, params.kmaxName, params.KminName, params.kminName, params.KnormalName,
- true
- );
- }
- }
-}
-
-void DifferentialPropertiesPlugin::openComputeNormalDialog()
-{
- m_computeNormalDialog->show();
-}
-
-void DifferentialPropertiesPlugin::openComputeCurvatureDialog()
-{
- m_computeCurvatureDialog->show();
-}
-
-void DifferentialPropertiesPlugin::computeNormalFromDialog()
-{
- QList currentItems = m_computeNormalDialog->mapList->selectedItems();
- if(!currentItems.empty())
- {
- const QString& mapName = currentItems[0]->text();
-
- QString positionName = m_computeNormalDialog->combo_positionAttribute->currentText();
-
- QString normalName;
- if(m_computeNormalDialog->normalAttributeName->text().isEmpty())
- normalName = m_computeNormalDialog->combo_normalAttribute->currentText();
- else
- normalName = m_computeNormalDialog->normalAttributeName->text();
-
- bool autoUpdate = (currentItems[0]->checkState() == Qt::Checked);
-
- computeNormal(mapName, positionName, normalName, autoUpdate);
- }
-}
-
-void DifferentialPropertiesPlugin::computeCurvatureFromDialog()
-{
- QList currentItems = m_computeCurvatureDialog->mapList->selectedItems();
- if(!currentItems.empty())
- {
- const QString& mapName = currentItems[0]->text();
-
- QString positionName = m_computeCurvatureDialog->combo_positionAttribute->currentText();
- QString normalName = m_computeCurvatureDialog->combo_normalAttribute->currentText();
-
- QString KmaxName;
- if(m_computeCurvatureDialog->KmaxAttributeName->text().isEmpty())
- KmaxName = m_computeCurvatureDialog->combo_KmaxAttribute->currentText();
- else
- KmaxName = m_computeCurvatureDialog->KmaxAttributeName->text();
-
- QString kmaxName;
- if(m_computeCurvatureDialog->kmaxAttributeName->text().isEmpty())
- kmaxName = m_computeCurvatureDialog->combo_kmaxAttribute->currentText();
- else
- kmaxName = m_computeCurvatureDialog->kmaxAttributeName->text();
-
- QString KminName;
- if(m_computeCurvatureDialog->KminAttributeName->text().isEmpty())
- KminName = m_computeCurvatureDialog->combo_KminAttribute->currentText();
- else
- KminName = m_computeCurvatureDialog->KminAttributeName->text();
-
- QString kminName;
- if(m_computeCurvatureDialog->kminAttributeName->text().isEmpty())
- kminName = m_computeCurvatureDialog->combo_kminAttribute->currentText();
- else
- kminName = m_computeCurvatureDialog->kminAttributeName->text();
-
- QString KnormalName;
- if(m_computeCurvatureDialog->KnormalAttributeName->text().isEmpty())
- KnormalName = m_computeCurvatureDialog->combo_KnormalAttribute->currentText();
- else
- KnormalName = m_computeCurvatureDialog->KnormalAttributeName->text();
-
- bool compute_kmean = (m_computeCurvatureDialog->check_computeKmean->checkState() == Qt::Checked);
- bool compute_kgaussian = (m_computeCurvatureDialog->check_computeKgaussian->checkState() == Qt::Checked);
- bool autoUpdate = (currentItems[0]->checkState() == Qt::Checked);
-
- computeCurvature(
- mapName,
- positionName, normalName,
- KmaxName, kmaxName, KminName, kminName, KnormalName,
- compute_kmean, compute_kgaussian,
- autoUpdate
- );
- }
-}
-
-void DifferentialPropertiesPlugin::computeNormal(
- const QString& mapName,
- const QString& positionAttributeName,
- const QString& normalAttributeName,
- bool autoUpdate)
-{
- MapHandler* mh = static_cast*>(m_window->getMap(mapName));
- if(mh == NULL)
- return;
-
- VertexAttribute position = mh->getAttribute(positionAttributeName);
- if(!position.isValid())
- return;
-
- VertexAttribute normal = mh->getAttribute(normalAttributeName);
- if(!normal.isValid())
- normal = mh->addAttribute(normalAttributeName);
-
- PFP2::MAP* map = mh->getMap();
- Algo::Surface::Geometry::computeNormalVertices(*map, position, normal);
-
- computeNormalLastParameters[mapName] =
- ComputeNormalParameters(positionAttributeName, normalAttributeName, autoUpdate);
-
- mh->createVBO(normal);
-
- mh->notifyAttributeModification(normal);
-}
-
-void DifferentialPropertiesPlugin::computeCurvature(
- const QString& mapName,
- const QString& positionAttributeName,
- const QString& normalAttributeName,
- const QString& KmaxAttributeName,
- const QString& kmaxAttributeName,
- const QString& KminAttributeName,
- const QString& kminAttributeName,
- const QString& KnormalAttributeName,
- bool compute_kmean,
- bool compute_kgaussian,
- bool autoUpdate)
-{
- MapHandler* mh = static_cast*>(m_window->getMap(mapName));
- if(mh == NULL)
- return;
-
- VertexAttribute position = mh->getAttribute(positionAttributeName);
- if(!position.isValid())
- return;
-
- VertexAttribute normal = mh->getAttribute(normalAttributeName);
- if(!normal.isValid())
- return;
-
- VertexAttribute Kmax = mh->getAttribute(KmaxAttributeName);
- if(!Kmax.isValid())
- Kmax = mh->addAttribute(KmaxAttributeName);
-
- VertexAttribute kmax = mh->getAttribute(kmaxAttributeName);
- if(!kmax.isValid())
- kmax = mh->addAttribute(kmaxAttributeName);
-
- VertexAttribute Kmin = mh->getAttribute(KminAttributeName);
- if(!Kmin.isValid())
- Kmin = mh->addAttribute(KminAttributeName);
-
- VertexAttribute kmin = mh->getAttribute(kminAttributeName);
- if(!kmin.isValid())
- kmin = mh->addAttribute(kminAttributeName);
-
- VertexAttribute Knormal = mh->getAttribute(KnormalAttributeName);
- if(!Knormal.isValid())
- Knormal = mh->addAttribute(KnormalAttributeName);
-
- EdgeAttribute edgeAngle = mh->getAttribute("edgeAngle");
- if(!edgeAngle.isValid())
- edgeAngle = mh->addAttribute("edgeAngle");
-
- PFP2::MAP* map = mh->getMap();
- Algo::Surface::Geometry::computeAnglesBetweenNormalsOnEdges(*map, position, edgeAngle);
- Algo::Surface::Geometry::computeCurvatureVertices_NormalCycles_Projected(*map, 0.01f * mh->getBBdiagSize(), position, normal, edgeAngle, kmax, kmin, Kmax, Kmin, Knormal);
-
- computeCurvatureLastParameters[mapName] =
- ComputeCurvatureParameters(
- positionAttributeName, normalAttributeName,
- KmaxAttributeName, kmaxAttributeName, KminAttributeName, kminAttributeName, KnormalAttributeName,
- compute_kmean, compute_kgaussian, autoUpdate);
-
- mh->createVBO(Kmax);
- mh->createVBO(kmax);
- mh->createVBO(Kmin);
- mh->createVBO(kmin);
- mh->createVBO(Knormal);
-
- mh->notifyAttributeModification(Kmax);
- mh->notifyAttributeModification(kmax);
- mh->notifyAttributeModification(Kmin);
- mh->notifyAttributeModification(kmin);
- mh->notifyAttributeModification(Knormal);
-
- if(compute_kmean)
- {
- VertexAttribute kmean = mh->getAttribute("kmean");
- if(!kmean.isValid())
- kmean = mh->addAttribute("kmean");
-
- for(unsigned int i = kmin.begin(); i != kmin.end(); kmin.next(i))
- kmean[i] = (kmin[i] + kmax[i]) / 2.0;
-
- mh->createVBO(kmean);
- mh->notifyAttributeModification(kmean);
- }
-
- if(compute_kgaussian)
- {
- VertexAttribute kgaussian = mh->getAttribute("kgaussian");
- if(!kgaussian.isValid())
- kgaussian = mh->addAttribute("kgaussian");
-
- for(unsigned int i = kmin.begin(); i != kmin.end(); kmin.next(i))
- kgaussian[i] = kmin[i] * kmax[i];
-
- mh->createVBO(kgaussian);
- mh->notifyAttributeModification(kgaussian);
- }
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(DifferentialPropertiesPlugin, DifferentialPropertiesPlugin)
-#else
-Q_EXPORT_PLUGIN2(DifferentialPropertiesPluginD, DifferentialPropertiesPlugin)
-#endif
diff --git a/SCHNApps_old/Plugins/importSurface/CMakeLists.txt b/SCHNApps_old/Plugins/importSurface/CMakeLists.txt
deleted file mode 100644
index 55230abaccf0142a6572a5fcced390b25e5e182a..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/importSurface/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME ImportSurface )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/importSurface )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/importSurface.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/importSurface/include/importSurface.h b/SCHNApps_old/Plugins/importSurface/include/importSurface.h
deleted file mode 100644
index e9e2cbcb918a7e834a5bba05ea318ed61ea12e3d..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/importSurface/include/importSurface.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _IMPORTSURFACE_PLUGIN_H_
-#define _IMPORTSURFACE_PLUGIN_H_
-
-#include "plugin.h"
-
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class ImportSurfacePlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- ImportSurfacePlugin()
- {
- setProvidesRendering(false);
- }
-
- ~ImportSurfacePlugin()
- {}
-
- 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) {}
-
-public slots:
- MapHandlerGen* importFromFile(const QString& fileName);
- void importFromFileDialog();
-
-private:
- QAction* importAction;
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/importSurface/src/importSurface.cpp b/SCHNApps_old/Plugins/importSurface/src/importSurface.cpp
deleted file mode 100644
index 2719d6505529b4bf87d5b7670dd50a36aeef5037..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/importSurface/src/importSurface.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "importSurface.h"
-
-#include "mapHandler.h"
-
-#include "Algo/Import/import.h"
-
-#include
-#include
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-bool ImportSurfacePlugin::enable()
-{
- importAction = new QAction("import", this);
- addMenuAction("Surface;Import", importAction);
- connect(importAction, SIGNAL(triggered()), this, SLOT(importFromFileDialog()));
- return true;
-}
-
-MapHandlerGen* ImportSurfacePlugin::importFromFile(const QString& fileName)
-{
- QFileInfo fi(fileName);
- if(fi.exists())
- {
- MapHandlerGen* mhg = m_window->addMap(fi.baseName(), 2);
- if(mhg)
- {
- MapHandler* mh = static_cast*>(mhg);
- PFP2::MAP* map = mh->getMap();
-
- std::vector attrNames;
- Algo::Surface::Import::importMesh(*map, fileName.toStdString(), attrNames);
-
- // get vertex position attribute
- VertexAttribute position = map->getAttribute(attrNames[0]);
- mh->registerAttribute(position);
-
- // create position VBO
- mh->createVBO(position);
-
- // update corresponding VBO & emit attribute update signal
- mh->notifyAttributeModification(position);
-
- // compute map bounding box
- mh->updateBB(position);
- }
- return mhg;
- }
- else
- return NULL;
-}
-
-void ImportSurfacePlugin::importFromFileDialog()
-{
- QStringList fileNames = QFileDialog::getOpenFileNames(m_window, "Import surfaces", m_window->getAppPath(), "Surface mesh Files (*.ply *.off *.trian)");
- QStringList::Iterator it = fileNames.begin();
- while(it != fileNames.end()) {
- importFromFile(*it);
- ++it;
- }
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(ImportSurfacePlugin, ImportSurfacePlugin)
-#else
-Q_EXPORT_PLUGIN2(ImportSurfacePluginD, ImportSurfacePlugin)
-#endif
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/importVolume/CMakeLists.txt b/SCHNApps_old/Plugins/importVolume/CMakeLists.txt
deleted file mode 100644
index 2786ef9bfe1beea231358605941da329300ec9a5..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/importVolume/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME ImportVolume )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/importVolume )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/importVolume.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/importVolume/include/importVolume.h b/SCHNApps_old/Plugins/importVolume/include/importVolume.h
deleted file mode 100644
index d35c926f3efbeec162af5c49e7545b6c25f1c3c8..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/importVolume/include/importVolume.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _IMPORTVOLUME_PLUGIN_H_
-#define _IMPORTVOLUME_PLUGIN_H_
-
-#include "plugin.h"
-
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class ImportVolumePlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- ImportVolumePlugin()
- {
- setProvidesRendering(false);
- }
-
- ~ImportVolumePlugin()
- {}
-
- 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) {}
-
-public slots:
- MapHandlerGen* importFromFile(const QString& fileName);
- void importFromFileDialog();
-
-private:
- QAction* importAction;
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/importVolume/src/importVolume.cpp b/SCHNApps_old/Plugins/importVolume/src/importVolume.cpp
deleted file mode 100644
index 1fc52301c96b9e4a0e249113c6fc883843c5cc4b..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/importVolume/src/importVolume.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "importVolume.h"
-
-#include "mapHandler.h"
-
-#include "Algo/Import/import.h"
-
-#include
-#include
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-bool ImportVolumePlugin::enable()
-{
- importAction = new QAction("import", this);
- addMenuAction("Volume;Import", importAction);
- connect(importAction, SIGNAL(triggered()), this, SLOT(importFromFileDialog()));
- return true;
-}
-
-MapHandlerGen* ImportVolumePlugin::importFromFile(const QString& fileName)
-{
- QFileInfo fi(fileName);
- if(fi.exists())
- {
- MapHandlerGen* mhg = m_window->addMap(fi.baseName(), 3);
- if(mhg)
- {
- MapHandler* mh = static_cast*>(mhg);
- PFP3::MAP* map = mh->getMap();
-
- std::vector attrNames ;
- Algo::Volume::Import::importMesh(*map, fileName.toStdString(), attrNames);
-
- // get vertex position attribute
- VertexAttribute position = map->getAttribute(attrNames[0]);
- mh->registerAttribute(position);
-
- // create position VBO
- mh->createVBO(position);
-
- // update corresponding VBO & emit attribute update signal
- mh->notifyAttributeModification(position);
-
- // compute map bounding box
- mh->updateBB(position);
- }
- return mhg;
- }
- else
- return NULL;
-}
-
-void ImportVolumePlugin::importFromFileDialog()
-{
- QStringList fileNames = QFileDialog::getOpenFileNames(m_window, "Import volumes", m_window->getAppPath(), "Volume mesh Files (*.node *.ts *.off *.tet)");
- QStringList::Iterator it = fileNames.begin();
- while(it != fileNames.end()) {
- importFromFile(*it);
- ++it;
- }
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(ImportVolumePlugin, ImportVolumePlugin)
-#else
-Q_EXPORT_PLUGIN2(ImportVolumePluginD, ImportVolumePlugin)
-#endif
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/plugins_cmake.txt b/SCHNApps_old/Plugins/plugins_cmake.txt
deleted file mode 100644
index 4037e6e65656bc940b5438f0dbb32facf8a02e31..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/plugins_cmake.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-
-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_old/Plugins/render/CMakeLists.txt b/SCHNApps_old/Plugins/render/CMakeLists.txt
deleted file mode 100644
index 28f684407dbc5036be38fde447809e18377170de..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/render/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME Render )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/render )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/render.h
- ${PLUGIN_ROOT_DIR}/include/renderDockTab.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/render/forms/render.ui b/SCHNApps_old/Plugins/render/forms/render.ui
deleted file mode 100644
index 39f9b5c689ed6ef666555316da396c96790cbede..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/render/forms/render.ui
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
- RenderDockWidget
-
-
-
- 0
- 0
- 174
- 545
-
-
-
- Form
-
-
- -
-
-
- -
-
-
- QLayout::SetDefaultConstraint
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- Position :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- Normal :
-
-
-
-
-
- -
-
-
- -
-
-
- render vertices
-
-
-
- -
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- render edges
-
-
-
- -
-
-
- render faces
-
-
- true
-
-
-
- -
-
-
-
-
-
- Flat
-
-
- true
-
-
- group_faceShading
-
-
-
- -
-
-
- Phong
-
-
- group_faceShading
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 156
- 161
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SCHNApps_old/Plugins/render/include/render.h b/SCHNApps_old/Plugins/render/include/render.h
deleted file mode 100644
index 05031f0ac6f8ca71d4397bc30a392b169b0cb63d..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/render/include/render.h
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef _RENDER_PLUGIN_H_
-#define _RENDER_PLUGIN_H_
-
-#include "plugin.h"
-#include "renderDockTab.h"
-
-#include "Utils/Shaders/shaderFlat.h"
-#include "Utils/Shaders/shaderPhong.h"
-#include "Utils/Shaders/shaderSimpleColor.h"
-#include "Utils/pointSprite.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-enum FaceShadingStyle
-{
- FLAT = 0,
- PHONG = 1
-};
-
-struct PerMapParameterSet
-{
- PerMapParameterSet() :
- positionVBO(NULL),
- normalVBO(NULL),
- verticesScaleFactor(1.0f),
- renderVertices(false),
- renderEdges(false),
- renderFaces(true),
- faceStyle(FLAT)
- {}
-
- PerMapParameterSet(MapHandlerGen* map);
-
- Utils::VBO* positionVBO;
- Utils::VBO* normalVBO;
- float verticesScaleFactor;
- bool renderVertices;
- bool renderEdges;
- bool renderFaces;
- FaceShadingStyle faceStyle;
-};
-
-struct ParameterSet
-{
- ParameterSet() : selectedMap(NULL)
- {}
-
- QHash perMap;
- MapHandlerGen* selectedMap;
-};
-
-
-class RenderPlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- RenderPlugin()
- {
- setProvidesRendering(true);
- }
-
- ~RenderPlugin()
- {}
-
- 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) {}
-
-protected:
- RenderDockTab* m_dockTab;
- QHash h_viewParams;
-
- CGoGN::Utils::ShaderFlat* m_flatShader;
- CGoGN::Utils::ShaderPhong* m_phongShader;
- CGoGN::Utils::ShaderSimpleColor* m_simpleColorShader;
- CGoGN::Utils::PointSprite* m_pointSprite;
-
-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);
-
-protected:
- void addManagedMap(View *v, MapHandlerGen* m);
- void removeManagedMap(View *v, MapHandlerGen* m);
-
-public slots:
-
- void vboAdded(Utils::VBO* vbo);
- void vboRemoved(Utils::VBO* vbo);
-
- void changeSelectedMap(View* view, MapHandlerGen* map);
-
- void changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI = false);
- void changeNormalVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI = false);
- void changeRenderVertices(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
- void changeVerticesScaleFactor(View* view, MapHandlerGen* map, float f, bool fromUI = false);
- void changeRenderEdges(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
- void changeRenderFaces(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
- void changeFacesStyle(View* view, MapHandlerGen* map, FaceShadingStyle style, bool fromUI = false);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/render/include/renderDockTab.h b/SCHNApps_old/Plugins/render/include/renderDockTab.h
deleted file mode 100644
index c85911aaec4bf396f162f565494ef1756c25ef98..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/render/include/renderDockTab.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef _RENDER_DOCK_TAB_H_
-#define _RENDER_DOCK_TAB_H_
-
-#include "ui_render.h"
-#include "Utils/vbo.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class RenderPlugin;
-struct ParameterSet;
-
-class RenderDockTab : public QWidget, public Ui::RenderDockWidget
-{
- Q_OBJECT
-
-public:
- RenderDockTab(Window* w, RenderPlugin* p);
-
-private:
- Window* m_window;
- RenderPlugin* m_plugin;
- ParameterSet* m_currentParams;
- bool b_refreshingUI;
-
-public slots:
- void refreshUI(ParameterSet* params);
-
- void selectedMapChanged();
-
- void positionVBOChanged(int index);
- void normalVBOChanged(int index);
- void renderVerticesChanged(bool b);
- void verticesScaleFactorChanged(int i);
- void renderEdgesChanged(bool b);
- void renderFacesChanged(bool b);
- void faceStyleChanged(QAbstractButton* b);
-
- void addVBOToList(Utils::VBO* vbo);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/render/src/render.cpp b/SCHNApps_old/Plugins/render/src/render.cpp
deleted file mode 100644
index 86926324addc8cc5eb322e9db5c1ce1a0783485d..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/render/src/render.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-#include "render.h"
-
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-PerMapParameterSet::PerMapParameterSet(MapHandlerGen* map) :
- positionVBO(NULL),
- normalVBO(NULL),
- verticesScaleFactor(1.0f),
- renderVertices(false),
- renderEdges(false),
- renderFaces(true),
- faceStyle(FLAT)
-{
- bool positionFound = false;
- bool normalFound = false;
-
- QList vbos = map->getVBOList();
- for(int i = 0; i < vbos.count(); ++i)
- {
- if(vbos[i]->dataSize() == 3)
- {
- if(!positionFound) positionVBO = vbos[i];
- if(vbos[i]->name() == "position") // try to select a VBO named "position"
- {
- positionVBO = vbos[i];
- positionFound = true;
- }
-
- if(!normalFound) normalVBO = vbos[i];
- if(vbos[i]->name() == "normal") // try to select a VBO named "normal"
- {
- normalVBO = vbos[i];
- normalFound = true;
- }
- }
- }
-}
-
-
-bool RenderPlugin::enable()
-{
- m_dockTab = new RenderDockTab(m_window, this);
- addTabInDock(m_dockTab, "Render");
-
- m_flatShader = new CGoGN::Utils::ShaderFlat();
- m_flatShader->setAmbiant(CGoGN::Geom::Vec4f(0.2f, 0.2f, 0.2f, 0.1f));
- m_flatShader->setDiffuse(CGoGN::Geom::Vec4f(0.8f, 0.9f, 0.7f, 1.0f));
- m_flatShader->setExplode(1.0f);
-
- m_phongShader = new CGoGN::Utils::ShaderPhong() ;
- m_phongShader->setAmbiant(CGoGN::Geom::Vec4f(0.2f, 0.2f, 0.2f, 0.1f)) ;
- m_phongShader->setDiffuse(CGoGN::Geom::Vec4f(0.8f, 0.9f, 0.7f, 1.0f)) ;
- m_phongShader->setSpecular(CGoGN::Geom::Vec4f(0.9f, 0.9f, 0.9f, 1.0f)) ;
- m_phongShader->setShininess(80.0f) ;
-
- m_simpleColorShader = new CGoGN::Utils::ShaderSimpleColor();
- CGoGN::Geom::Vec4f c(0.1f, 0.1f, 0.1f, 1.0f);
- m_simpleColorShader->setColor(c);
-
- m_pointSprite = new CGoGN::Utils::PointSprite();
-
- registerShader(m_flatShader);
- registerShader(m_phongShader);
- registerShader(m_simpleColorShader);
- registerShader(m_pointSprite);
-
- 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 RenderPlugin::disable()
-{
- delete m_flatShader;
- delete m_phongShader;
- delete m_simpleColorShader;
- delete m_pointSprite;
-}
-
-void RenderPlugin::redraw(View* view)
-{
- ParameterSet* params = h_viewParams[view];
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* m, maps)
- {
- PerMapParameterSet* p = params->perMap[m->getName()];
- if(p->positionVBO != NULL)
- {
- if(p->renderVertices)
- {
- m_pointSprite->setSize(m->getBBdiagSize() / 200.0f * p->verticesScaleFactor);
- m_pointSprite->setAttributePosition(p->positionVBO);
- m_pointSprite->setColor(CGoGN::Geom::Vec4f(0.0f, 0.0f, 1.0f, 1.0f));
- m->draw(m_pointSprite, CGoGN::Algo::Render::GL2::POINTS);
- }
- if(p->renderEdges)
- {
- glLineWidth(1.0f);
- m_simpleColorShader->setAttributePosition(p->positionVBO);
- m->draw(m_simpleColorShader, CGoGN::Algo::Render::GL2::LINES);
- }
- if(p->renderFaces)
- {
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glEnable(GL_LIGHTING);
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(1.0f, 1.0f);
- switch(p->faceStyle)
- {
- case FLAT :
- m_flatShader->setAttributePosition(p->positionVBO);
- m->draw(m_flatShader, CGoGN::Algo::Render::GL2::TRIANGLES);
- break ;
- case PHONG :
- if(p->normalVBO != NULL)
- {
- m_phongShader->setAttributePosition(p->positionVBO) ;
- m_phongShader->setAttributeNormal(p->normalVBO) ;
- m->draw(m_phongShader, CGoGN::Algo::Render::GL2::TRIANGLES);
- }
- break ;
- }
- glDisable(GL_POLYGON_OFFSET_FILL);
- }
- }
- }
-}
-
-void RenderPlugin::viewLinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- ParameterSet* params = new ParameterSet();
- h_viewParams.insert(view, params);
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- addManagedMap(view, mh);
-
- 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 RenderPlugin::viewUnlinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- removeManagedMap(view, mh);
-
- ParameterSet* params = h_viewParams[view];
- delete params;
- h_viewParams.remove(view);
-
- disconnect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
- disconnect(view, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(mapUnlinked(MapHandlerGen*)));
- }
-}
-
-void RenderPlugin::currentViewChanged(View* view)
-{
- if(isLinkedToView(view))
- m_dockTab->refreshUI(h_viewParams[view]);
-}
-
-void RenderPlugin::mapLinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- addManagedMap(view, m);
-}
-
-void RenderPlugin::mapUnlinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- removeManagedMap(view, m);
-}
-
-void RenderPlugin::addManagedMap(View* v, MapHandlerGen *m)
-{
-// connect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-// connect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = new PerMapParameterSet(m);
-
- params->perMap.insert(m->getName(), perMap);
-
- if(params->selectedMap == NULL || params->perMap.count() == 1)
- changeSelectedMap(v, m);
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderPlugin::removeManagedMap(View *v, MapHandlerGen *m)
-{
-// disconnect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-// disconnect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = params->perMap[m->getName()];
-
- delete perMap;
- params->perMap.remove(m->getName());
-
- if(params->selectedMap == m)
- {
- if(!params->perMap.empty())
- changeSelectedMap(v, m_window->getMap(params->perMap.begin().key()));
- else
- changeSelectedMap(v, NULL);
- }
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
-{
- ParameterSet* params = h_viewParams[view];
-
- MapHandlerGen* prev = params->selectedMap;
- params->selectedMap = map;
-
- if(view->isCurrentView())
- {
- if(prev)
- disconnect(prev, SIGNAL(vboAdded(Utils::VBO*)), m_dockTab, SLOT(addVBOToList(Utils::VBO*)));
- if(map)
- connect(map, SIGNAL(vboAdded(Utils::VBO*)), m_dockTab, SLOT(addVBOToList(Utils::VBO*)));
-
- m_dockTab->refreshUI(params);
- }
-}
-
-void RenderPlugin::changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->positionVBO = vbo;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderPlugin::changeNormalVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->normalVBO = vbo;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderPlugin::changeRenderVertices(View* view, MapHandlerGen* map, bool b, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->renderVertices = b;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderPlugin::changeVerticesScaleFactor(View* view, MapHandlerGen* map, float f, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->verticesScaleFactor = f;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderPlugin::changeRenderEdges(View* view, MapHandlerGen* map, bool b, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->renderEdges = b;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderPlugin::changeRenderFaces(View* view, MapHandlerGen* map, bool b, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->renderFaces = b;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderPlugin::changeFacesStyle(View* view, MapHandlerGen* map, FaceShadingStyle style, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->faceStyle = style;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(RenderPlugin, RenderPlugin)
-#else
-Q_EXPORT_PLUGIN2(RenderPluginD, RenderPlugin)
-#endif
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/render/src/renderDockTab.cpp b/SCHNApps_old/Plugins/render/src/renderDockTab.cpp
deleted file mode 100644
index 469c15a2b497a31d778f2304c7a5b7d48de45fb6..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/render/src/renderDockTab.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-#include "renderDockTab.h"
-
-#include "render.h"
-#include "window.h"
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-RenderDockTab::RenderDockTab(Window* w, RenderPlugin* p) :
- m_window(w),
- m_plugin(p),
- b_refreshingUI(false)
-{
- setupUi(this);
-
- connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
- connect(combo_positionVBO, SIGNAL(currentIndexChanged(int)), this, SLOT(positionVBOChanged(int)));
- connect(combo_normalVBO, SIGNAL(currentIndexChanged(int)), this, SLOT(normalVBOChanged(int)));
- connect(check_renderVertices, SIGNAL(toggled(bool)), this, SLOT(renderVerticesChanged(bool)));
- connect(slider_verticesScaleFactor, SIGNAL(valueChanged(int)), this, SLOT(verticesScaleFactorChanged(int)));
- connect(check_renderEdges, SIGNAL(toggled(bool)), this, SLOT(renderEdgesChanged(bool)));
- connect(check_renderFaces, SIGNAL(toggled(bool)), this, SLOT(renderFacesChanged(bool)));
- connect(group_faceShading, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(faceStyleChanged(QAbstractButton*)));
-}
-
-void RenderDockTab::refreshUI(ParameterSet* params)
-{
- m_currentParams = params;
-
- b_refreshingUI = true;
-
- mapList->clear();
- combo_positionVBO->clear();
- combo_normalVBO->clear();
-
- MapHandlerGen* map = params->selectedMap;
-
- QHash::const_iterator i = params->perMap.constBegin();
- while (i != params->perMap.constEnd())
- {
- mapList->addItem(i.key());
- if(map != NULL && i.key() == map->getName())
- {
- QList item = mapList->findItems(map->getName(), Qt::MatchExactly);
- item[0]->setSelected(true);
-
- PerMapParameterSet* p = params->perMap[map->getName()];
-
- QList vbos = map->getVBOList();
- unsigned int j = 0;
- for(int i = 0; i < vbos.count(); ++i)
- {
- if(vbos[i]->dataSize() == 3)
- {
- combo_positionVBO->addItem(QString::fromStdString(vbos[i]->name()));
- if(vbos[i] == p->positionVBO)
- combo_positionVBO->setCurrentIndex(j);
-
- combo_normalVBO->addItem(QString::fromStdString(vbos[i]->name()));
- if(vbos[i] == p->normalVBO)
- combo_normalVBO->setCurrentIndex(j);
-
- ++j;
- }
- }
-
- check_renderVertices->setChecked(p->renderVertices);
- slider_verticesScaleFactor->setSliderPosition(p->verticesScaleFactor * 50.0);
- check_renderEdges->setChecked(p->renderEdges);
- check_renderFaces->setChecked(p->renderFaces);
- radio_flatShading->setChecked(p->faceStyle == FLAT);
- radio_phongShading->setChecked(p->faceStyle == PHONG);
- }
- ++i;
- }
-
- b_refreshingUI = false;
-}
-
-void RenderDockTab::selectedMapChanged()
-{
- if(!b_refreshingUI)
- {
- QList currentItems = mapList->selectedItems();
- if(!currentItems.empty())
- m_plugin->changeSelectedMap(m_window->getCurrentView(), m_window->getMap(currentItems[0]->text()));
- }
-}
-
-void RenderDockTab::positionVBOChanged(int index)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changePositionVBO(view, map, map->getVBO(combo_positionVBO->currentText()), true);
- }
-}
-
-void RenderDockTab::normalVBOChanged(int index)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeNormalVBO(view, map, map->getVBO(combo_normalVBO->currentText()), true);
- }
-}
-
-void RenderDockTab::renderVerticesChanged(bool b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeRenderVertices(view, map, b, true);
- }
-}
-
-void RenderDockTab::verticesScaleFactorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeVerticesScaleFactor(view, map, i / 50.0, true);
- }
-}
-
-void RenderDockTab::renderEdgesChanged(bool b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeRenderEdges(view, map, b, true);
- }
-}
-
-void RenderDockTab::renderFacesChanged(bool b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeRenderFaces(view, map, b, true);
- }
-}
-
-void RenderDockTab::faceStyleChanged(QAbstractButton* b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- {
- if(radio_flatShading->isChecked())
- m_plugin->changeFacesStyle(view, map, FLAT, true);
- else if(radio_phongShading->isChecked())
- m_plugin->changeFacesStyle(view, map, PHONG, true);
- }
- }
-}
-
-void RenderDockTab::addVBOToList(Utils::VBO* vbo)
-{
- if(vbo->dataSize() == 3)
- {
- QString name = QString::fromStdString(vbo->name());
- combo_positionVBO->addItem(name);
- combo_normalVBO->addItem(name);
- }
-}
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/renderExplod/CMakeLists.txt b/SCHNApps_old/Plugins/renderExplod/CMakeLists.txt
deleted file mode 100644
index 4843ef0ff26418494ecbac9f2872b324e741dd79..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderExplod/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME RenderExplod )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/renderExplod )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/renderExplod.h
- ${PLUGIN_ROOT_DIR}/include/renderExplodDockTab.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/renderExplod/forms/renderExplod.ui b/SCHNApps_old/Plugins/renderExplod/forms/renderExplod.ui
deleted file mode 100644
index ff88a12d96bd0a809de1d1af51279a58437d3c84..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderExplod/forms/renderExplod.ui
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
- RenderExplodDockWidget
-
-
-
- 0
- 0
- 174
- 545
-
-
-
- Form
-
-
- -
-
-
- -
-
-
- QLayout::SetDefaultConstraint
-
-
-
-
-
- Color :
-
-
-
- -
-
-
- Position :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- render edges
-
-
-
- -
-
-
- render faces
-
-
- true
-
-
-
- -
-
-
-
-
-
- Explod
-
-
-
- -
-
-
- faces :
-
-
-
- -
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- volumes :
-
-
-
- -
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 156
- 161
-
-
-
-
-
-
-
-
-
diff --git a/SCHNApps_old/Plugins/renderExplod/include/renderExplod.h b/SCHNApps_old/Plugins/renderExplod/include/renderExplod.h
deleted file mode 100644
index dfccae96c7a5fff17b1864372ee7b1f75d5f2096..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderExplod/include/renderExplod.h
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef _RENDER_PLUGIN_H_
-#define _RENDER_PLUGIN_H_
-
-#include "plugin.h"
-#include "renderExplodDockTab.h"
-
-#include "Algo/Render/GL2/explodeVolumeRender.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-enum FaceShadingStyle
-{
- FLAT = 0,
- SMOOTH = 1
-};
-
-struct PerMapParameterSet
-{
- PerMapParameterSet(MapHandlerGen* mh);
- ~PerMapParameterSet();
-
- void updateRender();
-
- MapHandlerGen* mh;
- Algo::Render::GL2::ExplodeVolumeRender* m_renderExplod;
- VertexAttribute positionAttribute;
- VolumeAttribute colorAttribute;
-
- float facesScaleFactor;
- float volumesScaleFactor;
- bool renderEdges;
- bool renderFaces;
- FaceShadingStyle faceStyle;
-};
-
-struct ParameterSet
-{
- ParameterSet() : selectedMap(NULL)
- {}
-
- QHash perMap;
- MapHandlerGen* selectedMap;
-};
-
-
-class RenderExplodPlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- RenderExplodPlugin()
- {
- setProvidesRendering(true);
- }
-
- ~RenderExplodPlugin()
- {}
-
- 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) {}
-
-protected:
- RenderExplodDockTab* m_dockTab;
- QHash h_viewParams;
-
-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);
-
-protected:
- void addManagedMap(View *v, MapHandlerGen* m);
- void removeManagedMap(View *v, MapHandlerGen* m);
-
-public slots:
- void changeSelectedMap(View* view, MapHandlerGen* map);
-
- void changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute, bool fromUI = false);
- void changeColorAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute, bool fromUI = false);
- void changeRenderEdges(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
- void changeRenderFaces(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
- void changeFacesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI = false);
- void changeVolumesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI = false);
-
- void attributeModified(unsigned int orbit, QString nameAttr);
- void connectivityModified();
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/renderExplod/include/renderExplodDockTab.h b/SCHNApps_old/Plugins/renderExplod/include/renderExplodDockTab.h
deleted file mode 100644
index da2fbd6362df1e3183055ad63d4920350776e89f..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderExplod/include/renderExplodDockTab.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _RENDER_EXPLOD_DOCK_TAB_H_
-#define _RENDER_EXPLOD_DOCK_TAB_H_
-
-#include "ui_renderExplod.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class RenderExplodPlugin;
-struct ParameterSet;
-
-class RenderExplodDockTab : public QWidget, public Ui::RenderExplodDockWidget
-{
- Q_OBJECT
-
-public:
- RenderExplodDockTab(Window* w, RenderExplodPlugin* p);
-
-private:
- Window* m_window;
- RenderExplodPlugin* m_plugin;
- ParameterSet* m_currentParams;
- bool b_refreshingUI;
-
-public slots:
- void refreshUI(ParameterSet* params);
-
- void selectedMapChanged();
- void positionAttributeChanged(int index);
- void colorAttributeChanged(int index);
- void renderEdgesChanged(bool b);
- void renderFacesChanged(bool b);
- void facesScaleFactorChanged(int i);
- void volumesScaleFactorChanged(int i);
-
- void addAttributeToList(unsigned int orbit, const QString& nameAttr);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/renderExplod/src/renderExplod.cpp b/SCHNApps_old/Plugins/renderExplod/src/renderExplod.cpp
deleted file mode 100644
index 7f4f70c36a480ba762a93bf30a97b805f0193d99..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderExplod/src/renderExplod.cpp
+++ /dev/null
@@ -1,383 +0,0 @@
-#include "renderExplod.h"
-
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-PerMapParameterSet::PerMapParameterSet(MapHandlerGen* m) :
- mh(m),
- facesScaleFactor(1.0f),
- volumesScaleFactor(1.0f),
- renderEdges(false),
- renderFaces(true),
- faceStyle(FLAT)
-{
- m_renderExplod = new Algo::Render::GL2::ExplodeVolumeRender(false, false, false);
-
- m_renderExplod->setNoClippingPlane();
- m_renderExplod->setExplodeVolumes(1.0f);
- m_renderExplod->setExplodeFaces(1.0f);
-
- QString positionName;
-
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP3::VEC3()));
-
- const AttributeHash& attribs = mh->getAttributesList(VERTEX);
- for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
- {
- if(i.value() == vec3TypeName)
- {
- if(positionName != "position") // try to select an attribute named "position"
- positionName = i.key(); // or anything else if not found
- }
- }
- positionAttribute = mh->getAttribute(positionName);
-
- colorAttribute = mh->getAttribute("color");
-
- updateRender();
-}
-
-PerMapParameterSet::~PerMapParameterSet()
-{
- delete m_renderExplod;
-}
-
-void PerMapParameterSet::updateRender()
-{
- PFP3::MAP* m = static_cast*>(mh)->getMap();
- //if(!color.isValid())
- m_renderExplod->updateData(*m, positionAttribute);
-}
-
-
-bool RenderExplodPlugin::enable()
-{
- m_dockTab = new RenderExplodDockTab(m_window, this);
- addTabInDock(m_dockTab, "RenderExplod");
-
- 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 RenderExplodPlugin::disable()
-{
-
-}
-
-void RenderExplodPlugin::redraw(View* view)
-{
- ParameterSet* params = h_viewParams[view];
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* m, maps)
- {
- PerMapParameterSet* p = params->perMap[m->getName()];
-
- p->m_renderExplod->setExplodeFaces(p->facesScaleFactor);
- p->m_renderExplod->setExplodeVolumes(p->volumesScaleFactor);
-
- if(p->renderEdges)
- {
- p->m_renderExplod->drawEdges();
- }
- if(p->renderFaces)
- {
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glEnable(GL_LIGHTING);
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(1.0f, 1.0f) ;
- p->m_renderExplod->drawFaces();
- glDisable(GL_POLYGON_OFFSET_FILL);
- }
- }
-}
-
-void RenderExplodPlugin::viewLinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- ParameterSet* params = new ParameterSet();
- h_viewParams.insert(view, params);
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- addManagedMap(view, mh);
-
- 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 RenderExplodPlugin::viewUnlinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- removeManagedMap(view, mh);
-
- ParameterSet* params = h_viewParams[view];
- delete params;
- h_viewParams.remove(view);
-
- disconnect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
- disconnect(view, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(mapUnlinked(MapHandlerGen*)));
- }
-}
-
-void RenderExplodPlugin::currentViewChanged(View* view)
-{
- if(isLinkedToView(view))
- m_dockTab->refreshUI(h_viewParams[view]);
-}
-
-void RenderExplodPlugin::mapLinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- addManagedMap(view, m);
-}
-
-void RenderExplodPlugin::mapUnlinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- removeManagedMap(view, m);
-}
-
-void RenderExplodPlugin::addManagedMap(View* v, MapHandlerGen *m)
-{
- connect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
- connect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = new PerMapParameterSet(m);
-
- registerShader(perMap->m_renderExplod->shaderFaces());
- registerShader(perMap->m_renderExplod->shaderLines());
-
- params->perMap.insert(m->getName(), perMap);
-
- if(params->selectedMap == NULL || params->perMap.count() == 1)
- changeSelectedMap(v, m);
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderExplodPlugin::removeManagedMap(View *v, MapHandlerGen *m)
-{
- disconnect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
- disconnect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = params->perMap[m->getName()];
-
- unregisterShader(perMap->m_renderExplod->shaderFaces());
- unregisterShader(perMap->m_renderExplod->shaderLines());
-
- delete perMap;
- params->perMap.remove(m->getName());
-
- if(params->selectedMap == m)
- {
- if(!params->perMap.empty())
- changeSelectedMap(v, m_window->getMap(params->perMap.begin().key()));
- else
- changeSelectedMap(v, NULL);
- }
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderExplodPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
-{
- ParameterSet* params = h_viewParams[view];
-
- MapHandlerGen* prev = params->selectedMap;
- params->selectedMap = map;
-
- if(view->isCurrentView())
- {
- if(prev)
- disconnect(prev, SIGNAL(attributeAdded(unsigned int, const QString&)), m_dockTab, SLOT(addAttributeToList(unsigned int, const QString&)));
- if(map)
- connect(map, SIGNAL(attributeAdded(unsigned int, const QString&)), m_dockTab, SLOT(addAttributeToList(unsigned int, const QString&)));
-
- m_dockTab->refreshUI(params);
- }
-}
-
-void RenderExplodPlugin::changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- perMap->positionAttribute = attribute;
- perMap->updateRender();
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderExplodPlugin::changeColorAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
-// params->perMap[map->getName()].colorAttribute = attribute;
- //perMap->colorAttribute = attribute;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderExplodPlugin::changeRenderEdges(View* view, MapHandlerGen* map, bool b, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->renderEdges = b;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderExplodPlugin::changeRenderFaces(View* view, MapHandlerGen* map, bool b, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->renderFaces = b;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderExplodPlugin::changeFacesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->facesScaleFactor = i / 50.0;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderExplodPlugin::changeVolumesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->volumesScaleFactor = i / 50.0;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-
-void RenderExplodPlugin::attributeModified(unsigned int orbit, QString nameAttr)
-{
- MapHandler* mh = static_cast*>(QObject::sender());
-
- //On cherche la carte et on la met a jour puis updateGL();
-
- //pour toutes les vues
- //on va mettre a jour la carte QObject::senter() si elle est enregistree dans le parameterSet de cette vue
-
-
-
-// if(orbit == VERTEX)
-// {
-// MapHandler* mh = static_cast*>(QObject::sender());
-// if(mh == NULL)
-// return;
-//
-// foreach(ParameterSet* params, h_viewParams)
-// {
-// QHash::const_iterator i = params->perMap.constBegin();
-// while (i != params->perMap.constEnd())
-// {
-// PerMapParameterSet* p = params->perMap[mh->getName()];
-//
-// p->updateRender();
-//
-// ++i;
-// }
-//
-// }
-
-
-
-// VertexAttribute position = mh->getAttribute(nameAttr);
-// if(!position.isValid())
-// return;
-//
-// PFP3::MAP* map = mh->getMap();
-//
-// m_renderExplod->updateData(*map,position);
-
-// if(computeNormalLastParameters.contains(map->getName()))
-// {
-// ComputeNormalParameters& params = computeNormalLastParameters[map->getName()];
-// if(params.positionName == nameAttr && params.autoUpdate)
-// computeNormal(map->getName(), params.positionName, params.normalName);
-// }
-// }
-}
-
-void RenderExplodPlugin::connectivityModified()
-{
- //On cherche la carte et on la met a jour puis updateGL();
-
- //pour toutes les vues
- //on va mettre a jour la carte QObject::senter() si elle est enregistree dans le parameterSet de cette vue
-
-
-// MapHandler* mh = static_cast*>(QObject::sender());
-// if(mh == NULL)
-// return;
-//
-// VertexAttribute position = mh->getAttribute("position");
-// if(!position.isValid())
-// return;
-//
-// PFP3::MAP* map = mh->getMap();
-//
-// m_renderExplod->updateData(*map,position);
-
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(RenderExplodPlugin, RenderExplodPlugin)
-#else
-Q_EXPORT_PLUGIN2(RenderExplodPluginD, RenderExplodPlugin)
-#endif
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/renderExplod/src/renderExplodDockTab.cpp b/SCHNApps_old/Plugins/renderExplod/src/renderExplodDockTab.cpp
deleted file mode 100644
index 4046a0d593e412eb3f39748be66d093208f6cd2c..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderExplod/src/renderExplodDockTab.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-#include "renderExplodDockTab.h"
-
-#include "renderExplod.h"
-#include "window.h"
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-RenderExplodDockTab::RenderExplodDockTab(Window* w, RenderExplodPlugin* p) :
- m_window(w),
- m_plugin(p),
- b_refreshingUI(false)
-{
- setupUi(this);
-
- connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
-
- connect(combo_positionAttribute, SIGNAL(currentIndexChanged(int)), this, SLOT(positionAttributeChanged(int)));
- connect(combo_colorAttribute, SIGNAL(currentIndexChanged(int)), this, SLOT(colorAttributeChanged(int)));
-
- connect(check_renderEdges, SIGNAL(toggled(bool)), this, SLOT(renderEdgesChanged(bool)));
- connect(check_renderFaces, SIGNAL(toggled(bool)), this, SLOT(renderFacesChanged(bool)));
-
- connect(slider_facesScaleFactor, SIGNAL(valueChanged(int)), this, SLOT(facesScaleFactorChanged(int)));
- connect(slider_volumesScaleFactor, SIGNAL(valueChanged(int)), this, SLOT(volumesScaleFactorChanged(int)));
-}
-
-void RenderExplodDockTab::refreshUI(ParameterSet* params)
-{
- m_currentParams = params;
-
- b_refreshingUI = true;
-
- mapList->clear();
- combo_positionAttribute->clear();
- combo_colorAttribute->clear();
-
- MapHandlerGen* mh = params->selectedMap;
-
- QHash::const_iterator i = params->perMap.constBegin();
- while (i != params->perMap.constEnd())
- {
- mapList->addItem(i.key());
- if(mh != NULL && i.key() == mh->getName())
- {
- QList item = mapList->findItems(mh->getName(), Qt::MatchExactly);
- item[0]->setSelected(true);
-
- PerMapParameterSet* p = params->perMap[mh->getName()];
-
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- unsigned int j = 0;
- const AttributeHash& attribs = mh->getAttributesList(VERTEX);
- for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
- {
- if(i.value() == vec3TypeName)
- {
- combo_positionAttribute->addItem(i.key());
- if(i.key() == QString::fromStdString(p->positionAttribute.name()))
- combo_positionAttribute->setCurrentIndex(j);
-
-// combo_colorAttribute->addItem(i.key());
-// if(i.key() == QString::fromStdString(p.colorAttribute.name()))
-// combo_colorAttribute->setCurrentIndex(j);
-
- ++j;
- }
- }
-
- check_renderEdges->setChecked(p->renderEdges);
- check_renderFaces->setChecked(p->renderFaces);
- slider_facesScaleFactor->setSliderPosition(p->facesScaleFactor * 50.0);
- slider_volumesScaleFactor->setSliderPosition(p->volumesScaleFactor * 50.0);
- }
- ++i;
- }
-
- b_refreshingUI = false;
-}
-
-void RenderExplodDockTab::selectedMapChanged()
-{
- if(!b_refreshingUI)
- {
- QList currentItems = mapList->selectedItems();
- if(!currentItems.empty())
- m_plugin->changeSelectedMap(m_window->getCurrentView(), m_window->getMap(currentItems[0]->text()));
- }
-}
-
-void RenderExplodDockTab::positionAttributeChanged(int index)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changePositionAttribute(view, map, map->getAttribute(combo_positionAttribute->currentText()), true);
- }
-}
-
-void RenderExplodDockTab::colorAttributeChanged(int index)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeColorAttribute(view, map, map->getAttribute(combo_colorAttribute->currentText()), true);
- }
-}
-
-void RenderExplodDockTab::renderEdgesChanged(bool b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeRenderEdges(view, map, b, true);
- }
-}
-
-void RenderExplodDockTab::renderFacesChanged(bool b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeRenderFaces(view, map, b, true);
- }
-}
-
-void RenderExplodDockTab::facesScaleFactorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeFacesScaleFactor(view, map, i, true);
- }
-}
-
-void RenderExplodDockTab::volumesScaleFactorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeVolumesScaleFactor(view, map, i, true);
- }
-}
-
-void RenderExplodDockTab::addAttributeToList(unsigned int orbit, const QString& nameAttr)
-{
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- const QString& typeAttr = m_currentParams->selectedMap->getAttributeTypeName(orbit, nameAttr);
-
- if(typeAttr == vec3TypeName)
- {
- combo_positionAttribute->addItem(nameAttr);
- combo_colorAttribute->addItem(nameAttr);
- }
-}
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/renderScalar/CMakeLists.txt b/SCHNApps_old/Plugins/renderScalar/CMakeLists.txt
deleted file mode 100644
index e65c0cbfbe8816290a7993d026d70360a3985a8d..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderScalar/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME RenderScalar )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/renderScalar )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/renderScalar.h
- ${PLUGIN_ROOT_DIR}/include/renderScalarDockTab.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/renderScalar/forms/renderScalar.ui b/SCHNApps_old/Plugins/renderScalar/forms/renderScalar.ui
deleted file mode 100644
index 595e93cd6246ef96cd7ad58dadb4decfeefb5243..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderScalar/forms/renderScalar.ui
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
- RenderScalarDockWidget
-
-
-
- 0
- 0
- 181
- 545
-
-
-
- Form
-
-
- -
-
-
- -
-
-
- Position :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- Scalar :
-
-
-
- -
-
-
- QAbstractItemView::MultiSelection
-
-
-
- -
-
-
- Expansion :
-
-
-
- -
-
-
- 10
-
-
- 1
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 156
- 161
-
-
-
-
- -
-
-
- Colormap :
-
-
-
- -
-
-
-
-
- BlueWhiteRed
-
-
- -
-
- CyanWhiteRed
-
-
- -
-
- BlueCyanGreenYellowRed
-
-
- -
-
- BlueGreenRed
-
-
-
-
-
-
-
-
-
diff --git a/SCHNApps_old/Plugins/renderScalar/include/renderScalar.h b/SCHNApps_old/Plugins/renderScalar/include/renderScalar.h
deleted file mode 100644
index c4abd6aa221342154557587937091bb394eed515..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderScalar/include/renderScalar.h
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef _RENDERSCALAR_PLUGIN_H_
-#define _RENDERSCALAR_PLUGIN_H_
-
-#include "plugin.h"
-#include "renderScalarDockTab.h"
-
-#include "Utils/Shaders/shaderScalarField.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-enum ColorMap {
- BlueWhiteRed = 0,
- CyanWhiteRed = 1,
- BlueCyanGreenYellowRed = 2,
- BlueGreenRed = 3
-};
-
-struct PerMapParameterSet
-{
- PerMapParameterSet() :
- positionVBO(NULL)
- {}
-
- PerMapParameterSet(MapHandlerGen* map);
-
- Utils::VBO* positionVBO;
- Utils::VBO* scalarVBO;
- float scalarMin, scalarMax;
- int colorMap;
- int expansion;
-};
-
-struct ParameterSet
-{
- ParameterSet() : selectedMap(NULL)
- {}
-
- QHash perMap;
- MapHandlerGen* selectedMap;
-};
-
-
-class RenderScalarPlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- RenderScalarPlugin()
- {
- setProvidesRendering(true);
- }
-
- ~RenderScalarPlugin()
- {}
-
- 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) {}
-
-protected:
- RenderScalarDockTab* m_dockTab;
- QHash h_viewParams;
-
- CGoGN::Utils::ShaderScalarField* m_scalarShader;
-
-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);
-
-protected:
- void addManagedMap(View *v, MapHandlerGen* m);
- void removeManagedMap(View *v, MapHandlerGen* m);
-
-public slots:
- void changeSelectedMap(View* view, MapHandlerGen* map);
-
- void changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI = false);
- void changeScalarVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI = false);
- void changeColorMap(View* view, MapHandlerGen* map, int c, bool fromUI = false);
- void changeExpansion(View* view, MapHandlerGen* map, int i, bool fromUI = false);
-
- void attributeModified(unsigned int orbit, QString nameAttr);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/renderScalar/include/renderScalarDockTab.h b/SCHNApps_old/Plugins/renderScalar/include/renderScalarDockTab.h
deleted file mode 100644
index 9749c99e7a2822410439aaee2465be36d5867002..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderScalar/include/renderScalarDockTab.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _RENDERSCALAR_DOCK_TAB_H_
-#define _RENDERSCALAR_DOCK_TAB_H_
-
-#include "ui_renderScalar.h"
-#include "Utils/vbo.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class RenderScalarPlugin;
-struct ParameterSet;
-
-class RenderScalarDockTab : public QWidget, public Ui::RenderScalarDockWidget
-{
- Q_OBJECT
-
-public:
- RenderScalarDockTab(Window* w, RenderScalarPlugin* p);
-
-private:
- Window* m_window;
- RenderScalarPlugin* m_plugin;
- ParameterSet* m_currentParams;
- bool b_refreshingUI;
-
-public slots:
- void refreshUI(ParameterSet* params);
-
- void selectedMapChanged();
-
- void positionVBOChanged(int index);
- void selectedScalarVBOChanged();
- void colorMapChanged(int index);
- void expansionChanged(int i);
-
- void addVBOToList(Utils::VBO* vbo);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/renderScalar/src/renderScalar.cpp b/SCHNApps_old/Plugins/renderScalar/src/renderScalar.cpp
deleted file mode 100644
index 7f69f1d0f204691d1bcedf884ef08142a9fc0b10..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderScalar/src/renderScalar.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-#include "renderScalar.h"
-
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-PerMapParameterSet::PerMapParameterSet(MapHandlerGen* map) :
- positionVBO(NULL),
- scalarVBO(NULL),
- colorMap(BlueWhiteRed),
- expansion(0)
-{
- bool positionFound = false;
-
- QList vbos = map->getVBOList();
- for(int i = 0; i < vbos.count(); ++i)
- {
- if(vbos[i]->dataSize() == 3)
- {
- if(!positionFound) positionVBO = vbos[i];
- if(vbos[i]->name() == "position") // try to select a VBO named "position"
- {
- positionVBO = vbos[i];
- positionFound = true;
- }
- }
- }
-}
-
-
-bool RenderScalarPlugin::enable()
-{
- m_dockTab = new RenderScalarDockTab(m_window, this);
- addTabInDock(m_dockTab, "RenderScalar");
-
- m_scalarShader = new Utils::ShaderScalarField();
- registerShader(m_scalarShader);
-
- 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 RenderScalarPlugin::disable()
-{
- delete m_scalarShader;
-}
-
-void RenderScalarPlugin::redraw(View* view)
-{
- ParameterSet* params = h_viewParams[view];
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* m, maps)
- {
- PerMapParameterSet* p = params->perMap[m->getName()];
- if(p->positionVBO && p->scalarVBO)
- {
- m_scalarShader->setAttributePosition(p->positionVBO);
- m_scalarShader->setAttributeScalar(p->scalarVBO);
- m_scalarShader->setMinValue(p->scalarMin);
- m_scalarShader->setMaxValue(p->scalarMax);
- m_scalarShader->setColorMap(p->colorMap);
- m_scalarShader->setExpansion(p->expansion);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(1.0f, 1.0f);
- m->draw(m_scalarShader, Algo::Render::GL2::TRIANGLES);
- glDisable(GL_POLYGON_OFFSET_FILL);
- }
- }
-}
-
-void RenderScalarPlugin::viewLinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- ParameterSet* params = new ParameterSet();
- h_viewParams.insert(view, params);
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- addManagedMap(view, mh);
-
- 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 RenderScalarPlugin::viewUnlinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- removeManagedMap(view, mh);
-
- ParameterSet* params = h_viewParams[view];
- delete params;
- h_viewParams.remove(view);
-
- disconnect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
- disconnect(view, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(mapUnlinked(MapHandlerGen*)));
- }
-}
-
-void RenderScalarPlugin::currentViewChanged(View* view)
-{
- if(isLinkedToView(view))
- m_dockTab->refreshUI(h_viewParams[view]);
-}
-
-void RenderScalarPlugin::mapLinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- addManagedMap(view, m);
-}
-
-void RenderScalarPlugin::mapUnlinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- removeManagedMap(view, m);
-}
-
-void RenderScalarPlugin::addManagedMap(View* v, MapHandlerGen *m)
-{
- connect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-// connect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = new PerMapParameterSet(m);
-
- params->perMap.insert(m->getName(), perMap);
-
- if(params->selectedMap == NULL || params->perMap.count() == 1)
- changeSelectedMap(v, m);
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderScalarPlugin::removeManagedMap(View *v, MapHandlerGen *m)
-{
- disconnect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-// disconnect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = params->perMap[m->getName()];
-
- delete perMap;
- params->perMap.remove(m->getName());
-
- if(params->selectedMap == m)
- {
- if(!params->perMap.empty())
- changeSelectedMap(v, m_window->getMap(params->perMap.begin().key()));
- else
- changeSelectedMap(v, NULL);
- }
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderScalarPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
-{
- ParameterSet* params = h_viewParams[view];
-
- MapHandlerGen* prev = params->selectedMap;
- params->selectedMap = map;
-
- if(view->isCurrentView())
- {
- if(prev)
- disconnect(prev, SIGNAL(vboAdded(Utils::VBO*)), m_dockTab, SLOT(addVBOToList(Utils::VBO*)));
- if(map)
- connect(map, SIGNAL(vboAdded(Utils::VBO*)), m_dockTab, SLOT(addVBOToList(Utils::VBO*)));
-
- m_dockTab->refreshUI(params);
- }
-}
-
-void RenderScalarPlugin::changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->positionVBO = vbo;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderScalarPlugin::changeScalarVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->perMap[map->getName()];
-
- perMap->scalarVBO = vbo;
-
- if(vbo != NULL)
- {
- const VertexAttribute& attr = map->getAttribute(QString::fromStdString(vbo->name()));
- perMap->scalarMin = 1e20;
- perMap->scalarMax = -1e20;
- for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i))
- {
- perMap->scalarMin = attr[i] < perMap->scalarMin ? attr[i] : perMap->scalarMin;
- perMap->scalarMax = attr[i] > perMap->scalarMax ? attr[i] : perMap->scalarMax;
- }
- }
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderScalarPlugin::changeColorMap(View* view, MapHandlerGen* map, int c, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->colorMap = c;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderScalarPlugin::changeExpansion(View* view, MapHandlerGen* map, int i, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->expansion = i;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderScalarPlugin::attributeModified(unsigned int orbit, QString nameAttr)
-{
- if(orbit == VERTEX)
- {
- MapHandlerGen* map = static_cast(QObject::sender());
- foreach(View* view, l_views)
- {
- ParameterSet* params = h_viewParams[view];
- if(params->perMap.contains(map->getName()))
- {
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- if(perMap->scalarVBO && nameAttr == QString::fromStdString(perMap->scalarVBO->name()))
- {
- const VertexAttribute& attr = map->getAttribute(nameAttr);
- perMap->scalarMin = std::numeric_limits::max();
- perMap->scalarMax = std::numeric_limits::min();
- for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i))
- {
- perMap->scalarMin = attr[i] < perMap->scalarMin ? attr[i] : perMap->scalarMin;
- perMap->scalarMax = attr[i] > perMap->scalarMax ? attr[i] : perMap->scalarMax;
- }
- }
- }
- }
- }
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(RenderScalarPlugin, RenderScalarPlugin)
-#else
-Q_EXPORT_PLUGIN2(RenderScalarPluginD, RenderScalarPlugin)
-#endif
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/renderScalar/src/renderScalarDockTab.cpp b/SCHNApps_old/Plugins/renderScalar/src/renderScalarDockTab.cpp
deleted file mode 100644
index dbddb4426c3ad3ebfc9c208cccb8f8086116dc50..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderScalar/src/renderScalarDockTab.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-#include "renderScalarDockTab.h"
-
-#include "renderScalar.h"
-#include "window.h"
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-RenderScalarDockTab::RenderScalarDockTab(Window* w, RenderScalarPlugin* p) :
- m_window(w),
- m_plugin(p),
- b_refreshingUI(false)
-{
- setupUi(this);
-
- connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
- connect(combo_positionVBO, SIGNAL(currentIndexChanged(int)), this, SLOT(positionVBOChanged(int)));
- connect(list_scalarVBO, SIGNAL(itemSelectionChanged()), this, SLOT(selectedScalarVBOChanged()));
- connect(combo_colorMap, SIGNAL(currentIndexChanged(int)), this, SLOT(colorMapChanged(int)));
- connect(slider_expansion, SIGNAL(valueChanged(int)), this, SLOT(expansionChanged(int)));
-}
-
-void RenderScalarDockTab::refreshUI(ParameterSet* params)
-{
- m_currentParams = params;
-
- b_refreshingUI = true;
-
- mapList->clear();
- combo_positionVBO->clear();
- list_scalarVBO->clear();
-
- MapHandlerGen* map = params->selectedMap;
-
- QHash::const_iterator i = params->perMap.constBegin();
- while (i != params->perMap.constEnd())
- {
- mapList->addItem(i.key());
- if(map != NULL && i.key() == map->getName())
- {
- QList item = mapList->findItems(map->getName(), Qt::MatchExactly);
- item[0]->setSelected(true);
-
- PerMapParameterSet* p = params->perMap[map->getName()];
-
- QList vbos = map->getVBOList();
- unsigned int j = 0;
- unsigned int k = 0;
- for(int i = 0; i < vbos.count(); ++i)
- {
- unsigned int dataSize = vbos[i]->dataSize();
- if(dataSize == 3)
- {
- combo_positionVBO->addItem(QString::fromStdString(vbos[i]->name()));
- if(vbos[i] == p->positionVBO)
- combo_positionVBO->setCurrentIndex(j);
- ++j;
- }
- else if(dataSize == 1)
- {
- list_scalarVBO->addItem(QString::fromStdString(vbos[i]->name()));
- if(vbos[i] == p->scalarVBO)
- list_scalarVBO->item(k)->setSelected(true);
- ++k;
- }
- }
-
- combo_colorMap->setCurrentIndex(p->colorMap);
- slider_expansion->setSliderPosition(p->expansion);
- }
- ++i;
- }
-
- b_refreshingUI = false;
-}
-
-void RenderScalarDockTab::selectedMapChanged()
-{
- if(!b_refreshingUI)
- {
- QList currentItems = mapList->selectedItems();
- if(!currentItems.empty())
- m_plugin->changeSelectedMap(m_window->getCurrentView(), m_window->getMap(currentItems[0]->text()));
- }
-}
-
-void RenderScalarDockTab::positionVBOChanged(int index)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changePositionVBO(view, map, map->getVBO(combo_positionVBO->currentText()), true);
- }
-}
-
-void RenderScalarDockTab::selectedScalarVBOChanged()
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- {
- QList selectedItems = list_scalarVBO->selectedItems();
- if(!selectedItems.empty())
- {
- foreach(QListWidgetItem* item, selectedItems)
- {
- if(item != list_scalarVBO->currentItem())
- item->setSelected(false);
- }
- m_plugin->changeScalarVBO(view, map, map->getVBO(list_scalarVBO->currentItem()->text()), true);
- }
- else
- m_plugin->changeScalarVBO(view, map, NULL, true);
- }
- }
-}
-
-void RenderScalarDockTab::colorMapChanged(int index)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeColorMap(view, map, index, true);
- }
-}
-
-void RenderScalarDockTab::expansionChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeExpansion(view, map, i, true);
- }
-}
-
-void RenderScalarDockTab::addVBOToList(Utils::VBO* vbo)
-{
- QString name = QString::fromStdString(vbo->name());
- unsigned int dataSize = vbo->dataSize();
- if(dataSize == 3)
- combo_positionVBO->addItem(name);
- else if(dataSize == 1)
- list_scalarVBO->addItem(name);
-}
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/renderTopoSurface/CMakeLists.txt b/SCHNApps_old/Plugins/renderTopoSurface/CMakeLists.txt
deleted file mode 100644
index fb3c5e4446a71615fc4677b817f242ed40c437d3..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderTopoSurface/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME RenderTopoSurface )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/renderTopoSurface )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/renderTopoSurface.h
- ${PLUGIN_ROOT_DIR}/include/renderTopoSurfaceDockTab.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/renderTopoSurface/forms/renderTopoSurface.ui b/SCHNApps_old/Plugins/renderTopoSurface/forms/renderTopoSurface.ui
deleted file mode 100644
index 434fbc7dfa1fd974c45796d0efb31f5ec04b5d5f..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderTopoSurface/forms/renderTopoSurface.ui
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
- RenderTopoSurfaceDockWidget
-
-
-
- 0
- 0
- 190
- 547
-
-
-
- Form
-
-
- -
-
-
- -
-
-
- Position :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- draw darts
-
-
- true
-
-
-
- -
-
-
- -
-
-
- draw phi1
-
-
- true
-
-
-
- -
-
-
- -
-
-
- draw phi2
-
-
- true
-
-
-
- -
-
-
- -
-
-
- explod edges
-
-
-
- -
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- explod faces
-
-
-
- -
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 156
- 161
-
-
-
-
-
-
-
-
- ColorComboBox
- QComboBox
-
-
-
-
-
-
diff --git a/SCHNApps_old/Plugins/renderTopoSurface/include/renderTopoSurface.h b/SCHNApps_old/Plugins/renderTopoSurface/include/renderTopoSurface.h
deleted file mode 100644
index 4071fe56aeb8ea5a46724257330d31f411556a3b..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderTopoSurface/include/renderTopoSurface.h
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef _RENDERTOPO_SURFACE_PLUGIN_H_
-#define _RENDERTOPO_SURFACE_PLUGIN_H_
-
-#include "plugin.h"
-#include "renderTopoSurfaceDockTab.h"
-
-#include "Algo/Render/GL2/topoRender.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-struct PerMapParameterSet
-{
- PerMapParameterSet(MapHandlerGen* mh);
- ~PerMapParameterSet();
-
- void updateRender();
-
- MapHandlerGen* mh;
- Algo::Render::GL2::TopoRender* m_renderTopo;
- VertexAttribute positionAttribute;
-
- bool drawDarts;
- QColor dartsColor;
- bool drawPhi1;
- QColor phi1Color;
- bool drawPhi2;
- QColor phi2Color;
- float edgesScaleFactor;
- float facesScaleFactor;
-};
-
-struct ParameterSet
-{
- ParameterSet() : selectedMap(NULL)
- {}
-
- QHash perMap;
- MapHandlerGen* selectedMap;
-};
-
-
-class RenderTopoSurfacePlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- RenderTopoSurfacePlugin()
- {
- setProvidesRendering(true);
- }
-
- ~RenderTopoSurfacePlugin()
- {}
-
- 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) {}
-
-protected:
- RenderTopoSurfaceDockTab* m_dockTab;
- QHash h_viewParams;
-
-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);
-
-protected:
- void addManagedMap(View *v, MapHandlerGen* m);
- void removeManagedMap(View *v, MapHandlerGen* m);
-
-public slots:
- void changeSelectedMap(View* view, MapHandlerGen* map);
-
- void changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute, bool fromUI = false);
- void changeDrawDarts(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
- void changeDartsColor(View* view, MapHandlerGen* map, QColor c, bool fromUI = false);
- void changeDrawPhi1(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
- void changePhi1Color(View* view, MapHandlerGen* map, QColor c, bool fromUI = false);
- void changeDrawPhi2(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
- void changePhi2Color(View* view, MapHandlerGen* map, QColor c, bool fromUI = false);
- void changeEdgesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI = false);
- void changeFacesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI = false);
-
- void attributeModified(unsigned int orbit, QString nameAttr);
- void connectivityModified();
-
-signals:
- void dartSelected(Dart d);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/renderTopoSurface/include/renderTopoSurfaceDockTab.h b/SCHNApps_old/Plugins/renderTopoSurface/include/renderTopoSurfaceDockTab.h
deleted file mode 100644
index 79ae75b47cc95a214efadcd0a980e1731d772fbe..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderTopoSurface/include/renderTopoSurfaceDockTab.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef _RENDER_TOPO_SURFACE_DOCK_TAB_H_
-#define _RENDER_TOPO_SURFACE_DOCK_TAB_H_
-
-#include "ui_renderTopoSurface.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class RenderTopoSurfacePlugin;
-struct ParameterSet;
-
-class RenderTopoSurfaceDockTab : public QWidget, public Ui::RenderTopoSurfaceDockWidget
-{
- Q_OBJECT
-
-public:
- RenderTopoSurfaceDockTab(Window* w, RenderTopoSurfacePlugin* p);
-
-private:
- Window* m_window;
- RenderTopoSurfacePlugin* m_plugin;
- ParameterSet* m_currentParams;
- bool b_refreshingUI;
-
-public slots:
- void refreshUI(ParameterSet* params);
-
- void selectedMapChanged();
- void positionAttributeChanged(int index);
- void drawDartsChanged(bool b);
- void dartsColorChanged(int);
- void drawPhi1Changed(bool b);
- void phi1ColorChanged(int);
- void drawPhi2Changed(bool b);
- void phi2ColorChanged(int);
- void edgesScaleFactorChanged(int i);
- void facesScaleFactorChanged(int i);
-
- void addAttributeToList(unsigned int orbit, const QString& nameAttr);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/renderTopoSurface/src/renderTopoSurface.cpp b/SCHNApps_old/Plugins/renderTopoSurface/src/renderTopoSurface.cpp
deleted file mode 100644
index 90e0c910bc4c243c3948e77f0c00070069327768..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderTopoSurface/src/renderTopoSurface.cpp
+++ /dev/null
@@ -1,380 +0,0 @@
-#include "renderTopoSurface.h"
-
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-PerMapParameterSet::PerMapParameterSet(MapHandlerGen* m) :
- mh(m),
- drawDarts(true),
- dartsColor("white"),
- drawPhi1(true),
- phi1Color("cyan"),
- drawPhi2(true),
- phi2Color("red"),
- edgesScaleFactor(1.0f),
- facesScaleFactor(1.0f)
-{
- m_renderTopo = new Algo::Render::GL2::TopoRender();
-
- QString positionName;
-
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- const AttributeHash& attribs = mh->getAttributesList(VERTEX);
- for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
- {
- if(i.value() == vec3TypeName)
- {
- if(positionName != "position") // try to select an attribute named "position"
- positionName = i.key(); // or anything else if not found
- }
- }
- positionAttribute = mh->getAttribute(positionName);
-
- updateRender();
-}
-
-PerMapParameterSet::~PerMapParameterSet()
-{
- delete m_renderTopo;
-}
-
-void PerMapParameterSet::updateRender()
-{
- PFP2::MAP* m = static_cast*>(mh)->getMap();
- m_renderTopo->updateData(*m, positionAttribute, edgesScaleFactor, facesScaleFactor);
-}
-
-
-bool RenderTopoSurfacePlugin::enable()
-{
- m_dockTab = new RenderTopoSurfaceDockTab(m_window, this);
- addTabInDock(m_dockTab, "RenderTopoSurface");
-
- 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 RenderTopoSurfacePlugin::disable()
-{
-
-}
-
-void RenderTopoSurfacePlugin::redraw(View* view)
-{
- ParameterSet* params = h_viewParams[view];
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* m, maps)
- {
- PerMapParameterSet* p = params->perMap[m->getName()];
-
- if(p->drawDarts)
- p->m_renderTopo->drawDarts();
- if(p->drawPhi1)
- p->m_renderTopo->drawRelation1();
- if(p->drawPhi2)
- p->m_renderTopo->drawRelation2();
- }
-}
-
-void RenderTopoSurfacePlugin::mousePress(View* view, QMouseEvent* event)
-{
-// if (Shift())
-// {
-// ParameterSet* params = h_viewParams[view];
-
-// m_renderTopo->updateData(myMap, position, m_coeff_topo_explod[0], m_coeff_topo_explod[1], m_coeff_topo_explod[2], *m_selNoBoundary) ;
-
-// Dart d = m_renderTopo->picking(myMap, x, y, *m_selNoBoundary);
-// if (d != Dart::nil())
-// {
-// emit(dartSelected(d);
-// }
-// }
-}
-
-void RenderTopoSurfacePlugin::viewLinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- ParameterSet* params = new ParameterSet();
- h_viewParams.insert(view, params);
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- addManagedMap(view, mh);
-
- 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 RenderTopoSurfacePlugin::viewUnlinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- removeManagedMap(view, mh);
-
- ParameterSet* params = h_viewParams[view];
- delete params;
- h_viewParams.remove(view);
-
- disconnect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
- disconnect(view, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(mapUnlinked(MapHandlerGen*)));
- }
-}
-
-void RenderTopoSurfacePlugin::currentViewChanged(View* view)
-{
- if(isLinkedToView(view))
- m_dockTab->refreshUI(h_viewParams[view]);
-}
-
-void RenderTopoSurfacePlugin::mapLinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- addManagedMap(view, m);
-}
-
-void RenderTopoSurfacePlugin::mapUnlinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- removeManagedMap(view, m);
-}
-
-void RenderTopoSurfacePlugin::addManagedMap(View* v, MapHandlerGen *m)
-{
- connect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
- connect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = new PerMapParameterSet(m);
-
- registerShader(perMap->m_renderTopo->shader1());
- registerShader(perMap->m_renderTopo->shader2());
-
- params->perMap.insert(m->getName(), perMap);
-
- if(params->selectedMap == NULL || params->perMap.count() == 1)
- changeSelectedMap(v, m);
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderTopoSurfacePlugin::removeManagedMap(View *v, MapHandlerGen *m)
-{
- disconnect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
- disconnect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = params->perMap[m->getName()];
-
- unregisterShader(perMap->m_renderTopo->shader1());
- unregisterShader(perMap->m_renderTopo->shader2());
-
- delete perMap;
- params->perMap.remove(m->getName());
-
- if(params->selectedMap == m)
- {
- if(!params->perMap.empty())
- changeSelectedMap(v, m_window->getMap(params->perMap.begin().key()));
- else
- changeSelectedMap(v, NULL);
- }
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderTopoSurfacePlugin::changeSelectedMap(View* view, MapHandlerGen* map)
-{
- ParameterSet* params = h_viewParams[view];
-
- MapHandlerGen* prev = params->selectedMap;
- params->selectedMap = map;
-
- if(view->isCurrentView())
- {
- if(prev)
- disconnect(prev, SIGNAL(attributeAdded(unsigned int, const QString&)), m_dockTab, SLOT(addAttributeToList(unsigned int, const QString&)));
- if(map)
- connect(map, SIGNAL(attributeAdded(unsigned int, const QString&)), m_dockTab, SLOT(addAttributeToList(unsigned int, const QString&)));
-
- m_dockTab->refreshUI(params);
- }
-}
-
-void RenderTopoSurfacePlugin::changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- perMap->positionAttribute = attribute;
- perMap->updateRender();
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::changeDrawDarts(View* view, MapHandlerGen* map, bool b, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->drawDarts = b;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::changeDartsColor(View* view, MapHandlerGen* map, QColor c, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- perMap->dartsColor = c;
- perMap->m_renderTopo->setInitialDartsColor(c.redF(), c.greenF(), c.blueF());
- perMap->m_renderTopo->setAllDartsColor(c.redF(), c.greenF(), c.blueF());
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::changeDrawPhi1(View* view, MapHandlerGen* map, bool b, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->drawPhi1 = b;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::changePhi1Color(View* view, MapHandlerGen* map, QColor c, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->phi1Color = c;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::changeDrawPhi2(View* view, MapHandlerGen* map, bool b, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->drawPhi2 = b;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::changePhi2Color(View* view, MapHandlerGen* map, QColor c, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->phi2Color = c;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::changeEdgesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- perMap->edgesScaleFactor = i / 100.0;
- perMap->updateRender();
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::changeFacesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- perMap->facesScaleFactor = i / 100.0;
- perMap->updateRender();
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderTopoSurfacePlugin::attributeModified(unsigned int orbit, QString nameAttr)
-{
- if(orbit == VERTEX)
- {
- MapHandlerGen* map = static_cast(QObject::sender());
- foreach(View* view, l_views)
- {
- ParameterSet* params = h_viewParams[view];
- if(params->perMap.contains(map->getName()))
- {
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- if(nameAttr == QString::fromStdString(perMap->positionAttribute.name()))
- perMap->updateRender();
- }
- }
- }
-}
-
-void RenderTopoSurfacePlugin::connectivityModified()
-{
-
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(RenderTopoSurfacePlugin, RenderTopoSurfacePlugin)
-#else
-Q_EXPORT_PLUGIN2(RenderTopoSurfacePluginD, RenderTopoSurfacePlugin)
-#endif
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/renderTopoSurface/src/renderTopoSurfaceDockTab.cpp b/SCHNApps_old/Plugins/renderTopoSurface/src/renderTopoSurfaceDockTab.cpp
deleted file mode 100644
index 946604bedcc3757d0d1acf6d0ac2229bf78545d3..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderTopoSurface/src/renderTopoSurfaceDockTab.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-#include "renderTopoSurfaceDockTab.h"
-
-#include "renderTopoSurface.h"
-#include "window.h"
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-RenderTopoSurfaceDockTab::RenderTopoSurfaceDockTab(Window* w, RenderTopoSurfacePlugin* p) :
- m_window(w),
- m_plugin(p),
- b_refreshingUI(false)
-{
- setupUi(this);
-
- connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
- connect(combo_positionAttribute, SIGNAL(currentIndexChanged(int)), this, SLOT(positionAttributeChanged(int)));
- connect(check_drawDarts, SIGNAL(toggled(bool)), this, SLOT(drawDartsChanged(bool)));
- connect(combo_dartsColor, SIGNAL(currentIndexChanged(int)), this, SLOT(dartsColorChanged(int)));
- connect(check_drawPhi1, SIGNAL(toggled(bool)), this, SLOT(drawPhi1Changed(bool)));
- connect(combo_phi1Color, SIGNAL(currentIndexChanged(int)), this, SLOT(phi1ColorChanged(int)));
- connect(check_drawPhi2, SIGNAL(toggled(bool)), this, SLOT(drawPhi2Changed(bool)));
- connect(combo_phi2Color, SIGNAL(currentIndexChanged(int)), this, SLOT(phi2ColorChanged(int)));
- connect(slider_edgesScaleFactor, SIGNAL(valueChanged(int)), this, SLOT(edgesScaleFactorChanged(int)));
- connect(slider_facesScaleFactor, SIGNAL(valueChanged(int)), this, SLOT(facesScaleFactorChanged(int)));
-}
-
-void RenderTopoSurfaceDockTab::refreshUI(ParameterSet* params)
-{
- m_currentParams = params;
-
- b_refreshingUI = true;
-
- mapList->clear();
- combo_positionAttribute->clear();
-
- MapHandlerGen* mh = params->selectedMap;
-
- QHash::const_iterator i = params->perMap.constBegin();
- while (i != params->perMap.constEnd())
- {
- mapList->addItem(i.key());
- if(mh != NULL && i.key() == mh->getName())
- {
- QList item = mapList->findItems(mh->getName(), Qt::MatchExactly);
- item[0]->setSelected(true);
-
- PerMapParameterSet* p = params->perMap[mh->getName()];
-
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- unsigned int j = 0;
- const AttributeHash& attribs = mh->getAttributesList(VERTEX);
- for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
- {
- if(i.value() == vec3TypeName)
- {
- combo_positionAttribute->addItem(i.key());
- if(i.key() == QString::fromStdString(p->positionAttribute.name()))
- combo_positionAttribute->setCurrentIndex(j);
-
- ++j;
- }
- }
-
- check_drawDarts->setChecked(p->drawDarts);
- combo_dartsColor->setColor(p->dartsColor);
- check_drawPhi1->setChecked(p->drawPhi1);
- combo_phi1Color->setColor(p->phi1Color);
- check_drawPhi2->setChecked(p->drawPhi2);
- combo_phi2Color->setColor(p->phi2Color);
- slider_edgesScaleFactor->setSliderPosition(p->edgesScaleFactor * 100.0);
- slider_facesScaleFactor->setSliderPosition(p->facesScaleFactor * 100.0);
- }
- ++i;
- }
-
- b_refreshingUI = false;
-}
-
-void RenderTopoSurfaceDockTab::selectedMapChanged()
-{
- if(!b_refreshingUI)
- {
- QList currentItems = mapList->selectedItems();
- if(!currentItems.empty())
- m_plugin->changeSelectedMap(m_window->getCurrentView(), m_window->getMap(currentItems[0]->text()));
- }
-}
-
-void RenderTopoSurfaceDockTab::positionAttributeChanged(int index)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changePositionAttribute(view, map, map->getAttribute(combo_positionAttribute->currentText()), true);
- }
-}
-
-void RenderTopoSurfaceDockTab::drawDartsChanged(bool b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeDrawDarts(view, map, b, true);
- }
-}
-
-void RenderTopoSurfaceDockTab::dartsColorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeDartsColor(view, map, combo_dartsColor->color(), true);
- }
-}
-
-void RenderTopoSurfaceDockTab::drawPhi1Changed(bool b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeDrawPhi1(view, map, b, true);
- }
-}
-
-void RenderTopoSurfaceDockTab::phi1ColorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changePhi1Color(view, map, combo_phi1Color->color(), true);
- }
-}
-
-void RenderTopoSurfaceDockTab::drawPhi2Changed(bool b)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeDrawPhi2(view, map, b, true);
- }
-}
-
-void RenderTopoSurfaceDockTab::phi2ColorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changePhi2Color(view, map, combo_phi2Color->color(), true);
- }
-}
-
-void RenderTopoSurfaceDockTab::facesScaleFactorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeEdgesScaleFactor(view, map, i, true);
- }
-}
-
-void RenderTopoSurfaceDockTab::edgesScaleFactorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeFacesScaleFactor(view, map, i, true);
- }
-}
-
-void RenderTopoSurfaceDockTab::addAttributeToList(unsigned int orbit, const QString& nameAttr)
-{
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- const QString& typeAttr = m_currentParams->selectedMap->getAttributeTypeName(orbit, nameAttr);
-
- if(typeAttr == vec3TypeName)
- {
- combo_positionAttribute->addItem(nameAttr);
- }
-}
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/renderVector/CMakeLists.txt b/SCHNApps_old/Plugins/renderVector/CMakeLists.txt
deleted file mode 100644
index de5e22201ff497f585d806c5b80d2d0cb18012ea..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderVector/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME RenderVector )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/renderVector )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/renderVector.h
- ${PLUGIN_ROOT_DIR}/include/renderVectorDockTab.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/renderVector/forms/renderVector.ui b/SCHNApps_old/Plugins/renderVector/forms/renderVector.ui
deleted file mode 100644
index cba7d87d907b6874c96ad665c42c6f54dd64fe3e..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderVector/forms/renderVector.ui
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
- RenderVectorDockWidget
-
-
-
- 0
- 0
- 174
- 545
-
-
-
- Form
-
-
- -
-
-
- -
-
-
-
-
-
- Position :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- -
-
-
- Vectors :
-
-
-
- -
-
-
- QAbstractItemView::MultiSelection
-
-
-
- -
-
-
- Vectors Size :
-
-
-
- -
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 156
- 161
-
-
-
-
-
-
-
-
-
diff --git a/SCHNApps_old/Plugins/renderVector/include/renderVector.h b/SCHNApps_old/Plugins/renderVector/include/renderVector.h
deleted file mode 100644
index d67b1a53c3b67454d816f771e594f7a3d85bdc4c..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderVector/include/renderVector.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef _RENDERVECTOR_PLUGIN_H_
-#define _RENDERVECTOR_PLUGIN_H_
-
-#include "plugin.h"
-#include "renderVectorDockTab.h"
-
-#include "Utils/Shaders/shaderVectorPerVertex.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-struct PerMapParameterSet
-{
- PerMapParameterSet() :
- positionVBO(NULL),
- vectorsScaleFactor(1.0f)
- {}
-
- PerMapParameterSet(MapHandlerGen* map);
-
- Utils::VBO* positionVBO;
- std::vector vectorVBO;
- float vectorsScaleFactor;
-};
-
-struct ParameterSet
-{
- ParameterSet() : selectedMap(NULL)
- {}
-
- QHash perMap;
- MapHandlerGen* selectedMap;
-};
-
-
-class RenderVectorPlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- RenderVectorPlugin()
- {
- setProvidesRendering(true);
- }
-
- ~RenderVectorPlugin()
- {}
-
- 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) {}
-
-protected:
- RenderVectorDockTab* m_dockTab;
- QHash h_viewParams;
-
- CGoGN::Utils::ShaderVectorPerVertex* m_vectorShader;
-
-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);
-
-protected:
- void addManagedMap(View *v, MapHandlerGen* m);
- void removeManagedMap(View *v, MapHandlerGen* m);
-
-public slots:
- void changeSelectedMap(View* view, MapHandlerGen* map);
-
- void changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI = false);
- void changeSelectedVectorsVBO(View* view, MapHandlerGen* map, const std::vector& vbos, bool fromUI = false);
- void changeVectorsScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI = false);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/renderVector/include/renderVectorDockTab.h b/SCHNApps_old/Plugins/renderVector/include/renderVectorDockTab.h
deleted file mode 100644
index b0f2e546669f65e8d807470076636331dd9a0e0f..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderVector/include/renderVectorDockTab.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef _RENDERVECTOR_DOCK_TAB_H_
-#define _RENDERVECTOR_DOCK_TAB_H_
-
-#include "ui_renderVector.h"
-#include "Utils/vbo.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class RenderVectorPlugin;
-struct ParameterSet;
-
-class RenderVectorDockTab : public QWidget, public Ui::RenderVectorDockWidget
-{
- Q_OBJECT
-
-public:
- RenderVectorDockTab(Window* w, RenderVectorPlugin* p);
-
-private:
- Window* m_window;
- RenderVectorPlugin* m_plugin;
- ParameterSet* m_currentParams;
- bool b_refreshingUI;
-
-public slots:
- void refreshUI(ParameterSet* params);
-
- void selectedMapChanged();
-
- void positionVBOChanged(int index);
- void selectedVectorsVBOChanged();
- void vectorsScaleFactorChanged(int i);
-
- void addVBOToList(Utils::VBO* vbo);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/renderVector/src/renderVector.cpp b/SCHNApps_old/Plugins/renderVector/src/renderVector.cpp
deleted file mode 100644
index cd0d241352f910f2bbab217023b585b3a2456675..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderVector/src/renderVector.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-#include "renderVector.h"
-
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-PerMapParameterSet::PerMapParameterSet(MapHandlerGen* map) :
- positionVBO(NULL),
- vectorsScaleFactor(1.0f)
-{
- bool positionFound = false;
-
- QList vbos = map->getVBOList();
- for(int i = 0; i < vbos.count(); ++i)
- {
- if(vbos[i]->dataSize() == 3)
- {
- if(!positionFound) positionVBO = vbos[i];
- if(vbos[i]->name() == "position") // try to select a VBO named "position"
- {
- positionVBO = vbos[i];
- positionFound = true;
- }
- }
- }
-}
-
-
-bool RenderVectorPlugin::enable()
-{
- m_dockTab = new RenderVectorDockTab(m_window, this);
- addTabInDock(m_dockTab, "RenderVector");
-
- m_vectorShader = new Utils::ShaderVectorPerVertex();
- m_vectorShader->setColor(Geom::Vec4f(1.0f, 0.0f, 0.0f, 1.0f));
-
- registerShader(m_vectorShader);
-
- 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 RenderVectorPlugin::disable()
-{
- delete m_vectorShader;
-}
-
-void RenderVectorPlugin::redraw(View* view)
-{
- ParameterSet* params = h_viewParams[view];
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* m, maps)
- {
- PerMapParameterSet* p = params->perMap[m->getName()];
- m_vectorShader->setScale(m->getBBdiagSize() / 100.0f * p->vectorsScaleFactor) ;
- if(p->positionVBO != NULL)
- {
- m_vectorShader->setAttributePosition(p->positionVBO) ;
- for(std::vector::const_iterator it = p->vectorVBO.begin(); it != p->vectorVBO.end(); ++it)
- {
- m_vectorShader->setAttributeVector(*it) ;
- glLineWidth(1.0f) ;
- m->draw(m_vectorShader, Algo::Render::GL2::POINTS) ;
- }
- }
- }
-}
-
-void RenderVectorPlugin::viewLinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- ParameterSet* params = new ParameterSet();
- h_viewParams.insert(view, params);
-
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- addManagedMap(view, mh);
-
- 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 RenderVectorPlugin::viewUnlinked(View* view, Plugin* plugin)
-{
- if(plugin == this)
- {
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- removeManagedMap(view, mh);
-
- ParameterSet* params = h_viewParams[view];
- delete params;
- h_viewParams.remove(view);
-
- disconnect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
- disconnect(view, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(mapUnlinked(MapHandlerGen*)));
- }
-}
-
-void RenderVectorPlugin::currentViewChanged(View* view)
-{
- if(isLinkedToView(view))
- m_dockTab->refreshUI(h_viewParams[view]);
-}
-
-void RenderVectorPlugin::mapLinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- addManagedMap(view, m);
-}
-
-void RenderVectorPlugin::mapUnlinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- removeManagedMap(view, m);
-}
-
-void RenderVectorPlugin::addManagedMap(View* v, MapHandlerGen *m)
-{
-// connect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-// connect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = new PerMapParameterSet(m);
-
- params->perMap.insert(m->getName(), perMap);
-
- if(params->selectedMap == NULL || params->perMap.count() == 1)
- changeSelectedMap(v, m);
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderVectorPlugin::removeManagedMap(View *v, MapHandlerGen *m)
-{
-// disconnect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-// disconnect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = params->perMap[m->getName()];
-
- delete perMap;
- params->perMap.remove(m->getName());
-
- if(params->selectedMap == m)
- {
- if(!params->perMap.empty())
- changeSelectedMap(v, m_window->getMap(params->perMap.begin().key()));
- else
- changeSelectedMap(v, NULL);
- }
- else
- m_dockTab->refreshUI(params);
-}
-
-void RenderVectorPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
-{
- ParameterSet* params = h_viewParams[view];
-
- MapHandlerGen* prev = params->selectedMap;
- params->selectedMap = map;
-
- if(view->isCurrentView())
- {
- if(prev)
- disconnect(prev, SIGNAL(vboAdded(Utils::VBO*)), m_dockTab, SLOT(addVBOToList(Utils::VBO*)));
- if(map)
- connect(map, SIGNAL(vboAdded(Utils::VBO*)), m_dockTab, SLOT(addVBOToList(Utils::VBO*)));
-
- m_dockTab->refreshUI(params);
- }
-}
-
-void RenderVectorPlugin::changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->positionVBO = vbo;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderVectorPlugin::changeSelectedVectorsVBO(View* view, MapHandlerGen* map, const std::vector& vbos, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->vectorVBO = vbos;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-void RenderVectorPlugin::changeVectorsScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->vectorsScaleFactor = i / 50.0;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- view->updateGL();
- }
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(RenderVectorPlugin, RenderVectorPlugin)
-#else
-Q_EXPORT_PLUGIN2(RenderVectorPluginD, RenderVectorPlugin)
-#endif
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/renderVector/src/renderVectorDockTab.cpp b/SCHNApps_old/Plugins/renderVector/src/renderVectorDockTab.cpp
deleted file mode 100644
index de91436c45386fb17fba32e10d4591ac6210af97..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/renderVector/src/renderVectorDockTab.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-#include "renderVectorDockTab.h"
-
-#include "renderVector.h"
-#include "window.h"
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-RenderVectorDockTab::RenderVectorDockTab(Window* w, RenderVectorPlugin* p) :
- m_window(w),
- m_plugin(p),
- b_refreshingUI(false)
-{
- setupUi(this);
-
- connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
- connect(combo_positionVBO, SIGNAL(currentIndexChanged(int)), this, SLOT(positionVBOChanged(int)));
- connect(list_vectorVBO, SIGNAL(itemSelectionChanged()), this, SLOT(selectedVectorsVBOChanged()));
- connect(slider_vectorsScaleFactor, SIGNAL(valueChanged(int)), this, SLOT(vectorsScaleFactorChanged(int)));
-}
-
-void RenderVectorDockTab::refreshUI(ParameterSet* params)
-{
- m_currentParams = params;
-
- b_refreshingUI = true;
-
- mapList->clear();
- combo_positionVBO->clear();
- list_vectorVBO->clear();
-
- MapHandlerGen* map = params->selectedMap;
-
- QHash::const_iterator i = params->perMap.constBegin();
- while (i != params->perMap.constEnd())
- {
- mapList->addItem(i.key());
- if(map != NULL && i.key() == map->getName())
- {
- QList item = mapList->findItems(map->getName(), Qt::MatchExactly);
- item[0]->setSelected(true);
-
- PerMapParameterSet* p = params->perMap[map->getName()];
-
- QList vbos = map->getVBOList();
- unsigned int j = 0;
- for(int i = 0; i < vbos.count(); ++i)
- {
- if(vbos[i]->dataSize() == 3)
- {
- combo_positionVBO->addItem(QString::fromStdString(vbos[i]->name()));
- if(vbos[i] == p->positionVBO)
- combo_positionVBO->setCurrentIndex(j);
-
- list_vectorVBO->addItem(QString::fromStdString(vbos[i]->name()));
- if(std::find(p->vectorVBO.begin(), p->vectorVBO.end(), vbos[i]) != p->vectorVBO.end())
- list_vectorVBO->item(j)->setSelected(true);
-
- ++j;
- }
- }
-
- slider_vectorsScaleFactor->setSliderPosition(p->vectorsScaleFactor * 50.0);
- }
- ++i;
- }
-
- b_refreshingUI = false;
-}
-
-void RenderVectorDockTab::selectedMapChanged()
-{
- if(!b_refreshingUI)
- {
- QList currentItems = mapList->selectedItems();
- if(!currentItems.empty())
- m_plugin->changeSelectedMap(m_window->getCurrentView(), m_window->getMap(currentItems[0]->text()));
- }
-}
-
-void RenderVectorDockTab::positionVBOChanged(int index)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changePositionVBO(view, map, map->getVBO(combo_positionVBO->currentText()), true);
- }
-}
-
-void RenderVectorDockTab::selectedVectorsVBOChanged()
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- {
- QList currentItems = list_vectorVBO->selectedItems();
- std::vector vbos;
- foreach(QListWidgetItem* item, currentItems)
- vbos.push_back(map->getVBO(item->text()));
- m_plugin->changeSelectedVectorsVBO(view, map, vbos, true);
- }
- }
-}
-
-void RenderVectorDockTab::vectorsScaleFactorChanged(int i)
-{
- if(!b_refreshingUI)
- {
- View* view = m_window->getCurrentView();
- MapHandlerGen* map = m_currentParams->selectedMap;
- if(map)
- m_plugin->changeVectorsScaleFactor(view, map, i, true);
- }
-}
-
-void RenderVectorDockTab::addVBOToList(Utils::VBO* vbo)
-{
- if(vbo->dataSize() == 3)
- {
- QString name = QString::fromStdString(vbo->name());
- combo_positionVBO->addItem(name);
- list_vectorVBO->addItem(name);
- }
-}
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/subdivideSurface/CMakeLists.txt b/SCHNApps_old/Plugins/subdivideSurface/CMakeLists.txt
deleted file mode 100644
index 030bbf60c5928e1c972aacbf12d9ac6b57c137aa..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/subdivideSurface/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME SubdivideSurface )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/subdivideSurface )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/subdivideSurface.h
- ${PLUGIN_ROOT_DIR}/include/subdivideSurfaceDialog.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/subdivideSurface/forms/subdivideSurfaceDialog.ui b/SCHNApps_old/Plugins/subdivideSurface/forms/subdivideSurfaceDialog.ui
deleted file mode 100644
index a7d65ba6317da88bad35f634ccd2497331df6a12..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/subdivideSurface/forms/subdivideSurfaceDialog.ui
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
- SubdivideSurfaceDialog
-
-
-
- 0
- 0
- 314
- 230
-
-
-
- Subdivide surface
-
-
- -
-
-
- -
-
-
-
-
-
- Position attribute :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- -
-
-
-
-
-
- Loop
-
-
-
- -
-
-
- Catmull-Clark
-
-
-
- -
-
-
- Triangule faces
-
-
-
-
-
- -
-
-
-
-
-
- Cancel
-
-
-
- -
-
-
- Apply
-
-
-
- -
-
-
- OK
-
-
-
-
-
-
-
-
-
-
diff --git a/SCHNApps_old/Plugins/subdivideSurface/include/subdivideSurface.h b/SCHNApps_old/Plugins/subdivideSurface/include/subdivideSurface.h
deleted file mode 100644
index 46147165ff7293b1c732966e15a75b28b685c5a7..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/subdivideSurface/include/subdivideSurface.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef _SUBDIVIDESURFACE_PLUGIN_H_
-#define _SUBDIVIDESURFACE_PLUGIN_H_
-
-#include "plugin.h"
-#include "subdivideSurfaceDialog.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class SubdivideSurfacePlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- SubdivideSurfacePlugin()
- {
- setProvidesRendering(false);
- }
-
- ~SubdivideSurfacePlugin()
- {}
-
- 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) {}
-
-public slots:
- void openSubdivideSurfaceDialog();
- void subdivideSurfaceFromDialog();
-
- void loopSubdivision(
- const QString& mapName,
- const QString& positionAttributeName = "position"
- );
- void CCSubdivision(
- const QString& mapName,
- const QString& positionAttributeName = "position"
- );
- void trianguleFaces(
- const QString& mapName,
- const QString& positionAttributeName = "position"
- );
-
-private:
- SubdivideSurfaceDialog* m_subdivideSurfaceDialog;
-
- QAction* m_subdivideSurfaceAction;
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/subdivideSurface/include/subdivideSurfaceDialog.h b/SCHNApps_old/Plugins/subdivideSurface/include/subdivideSurfaceDialog.h
deleted file mode 100644
index 69b3b81e04fae727a6d3bdbabefbe15a997b63a8..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/subdivideSurface/include/subdivideSurfaceDialog.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _SUBDIVIDESURFACE_DIALOG_H_
-#define _SUBDIVIDESURFACE_DIALOG_H_
-
-#include "ui_subdivideSurfaceDialog.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class MapHandlerGen;
-
-class SubdivideSurfaceDialog : public QDialog, public Ui::SubdivideSurfaceDialog
-{
- Q_OBJECT
-
-public:
- SubdivideSurfaceDialog(Window* w);
-
-private:
- Window* m_window;
- MapHandlerGen* m_selectedMap;
-
-public slots:
- void selectedMapChanged();
- void addMapToList(MapHandlerGen* m);
- void removeMapFromList(MapHandlerGen* m);
- void addAttributeToList(unsigned int orbit, const QString& name);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/subdivideSurface/src/subdivideSurface.cpp b/SCHNApps_old/Plugins/subdivideSurface/src/subdivideSurface.cpp
deleted file mode 100644
index 2328eb93485a4fa0f98d0bcff51ae2eb67399fa6..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/subdivideSurface/src/subdivideSurface.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-#include "subdivideSurface.h"
-
-#include "mapHandler.h"
-
-#include "Algo/Modelisation/subdivision.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-bool SubdivideSurfacePlugin::enable()
-{
- m_subdivideSurfaceDialog = new SubdivideSurfaceDialog(m_window);
-
- m_subdivideSurfaceAction = new QAction("Subdivide surface", this);
-
- addMenuAction("Surface;Subdivide", m_subdivideSurfaceAction);
-
- connect(m_subdivideSurfaceAction, SIGNAL(triggered()), this, SLOT(openSubdivideSurfaceDialog()));
-
- connect(m_subdivideSurfaceDialog, SIGNAL(accepted()), this, SLOT(subdivideSurfaceFromDialog()));
- connect(m_subdivideSurfaceDialog->button_apply, SIGNAL(clicked()), this, SLOT(subdivideSurfaceFromDialog()));
-
- return true;
-}
-
-void SubdivideSurfacePlugin::openSubdivideSurfaceDialog()
-{
- m_subdivideSurfaceDialog->show();
-}
-
-void SubdivideSurfacePlugin::subdivideSurfaceFromDialog()
-{
- QList currentItems = m_subdivideSurfaceDialog->mapList->selectedItems();
- if(!currentItems.empty())
- {
- const QString& mapName = currentItems[0]->text();
- const QString& positionName = m_subdivideSurfaceDialog->combo_positionAttribute->currentText();
-
- if(m_subdivideSurfaceDialog->radio_Loop->isChecked())
- loopSubdivision(mapName, positionName);
- else if(m_subdivideSurfaceDialog->radio_CC->isChecked())
- CCSubdivision(mapName, positionName);
- else if(m_subdivideSurfaceDialog->radio_trianguleFaces->isChecked())
- trianguleFaces(mapName, positionName);
- }
-}
-
-void SubdivideSurfacePlugin::loopSubdivision(
- const QString& mapName,
- const QString& positionAttributeName)
-{
- MapHandler* mh = static_cast*>(m_window->getMap(mapName));
- if(mh == NULL)
- return;
-
- VertexAttribute position = mh->getAttribute(positionAttributeName);
- if(!position.isValid())
- return;
-
- PFP2::MAP* map = mh->getMap();
- Algo::Surface::Modelisation::LoopSubdivision(*map, position);
-
- mh->notifyAttributeModification(position);
- mh->notifyConnectivityModification();
-
- QList views = mh->getLinkedViews();
- foreach(View* view, views)
- view->updateGL();
-}
-
-void SubdivideSurfacePlugin::CCSubdivision(
- const QString& mapName,
- const QString& positionAttributeName)
-{
- MapHandler* mh = static_cast*>(m_window->getMap(mapName));
- if(mh == NULL)
- return;
-
- VertexAttribute position = mh->getAttribute(positionAttributeName);
- if(!position.isValid())
- return;
-
- PFP2::MAP* map = mh->getMap();
- Algo::Surface::Modelisation::CatmullClarkSubdivision(*map, position);
-
- mh->notifyAttributeModification(position);
- mh->notifyConnectivityModification();
-
- QList views = mh->getLinkedViews();
- foreach(View* view, views)
- view->updateGL();
-}
-
-void SubdivideSurfacePlugin::trianguleFaces(
- const QString& mapName,
- const QString& positionAttributeName)
-{
- MapHandler* mh = static_cast*>(m_window->getMap(mapName));
- if(mh == NULL)
- return;
-
- VertexAttribute position = mh->getAttribute(positionAttributeName);
- if(!position.isValid())
- return;
-
- PFP2::MAP* map = mh->getMap();
- Algo::Surface::Modelisation::trianguleFaces(*map, position);
-
- mh->notifyAttributeModification(position);
- mh->notifyConnectivityModification();
-
- QList views = mh->getLinkedViews();
- foreach(View* view, views)
- view->updateGL();
-}
-
-#ifndef DEBUG
-Q_EXPORT_PLUGIN2(SubdivideSurfacePlugin, SubdivideSurfacePlugin)
-#else
-Q_EXPORT_PLUGIN2(SubdivideSurfacePluginD, SubdivideSurfacePlugin)
-#endif
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp b/SCHNApps_old/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
deleted file mode 100644
index 0f3aeacec99476ef50d8cdfb2ed4389695700a37..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "subdivideSurfaceDialog.h"
-
-#include "subdivideSurface.h"
-#include "window.h"
-#include "mapHandler.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-SubdivideSurfaceDialog::SubdivideSurfaceDialog(Window* w) :
- m_window(w),
- m_selectedMap(NULL)
-{
- setupUi(this);
-
- 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()));
-
- const QList& maps = m_window->getMapsList();
- foreach(MapHandlerGen* map, maps)
- mapList->addItem(map->getName());
-}
-
-void SubdivideSurfaceDialog::selectedMapChanged()
-{
- if(m_selectedMap)
- disconnect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
-
- QList currentItems = mapList->selectedItems();
- if(!currentItems.empty())
- {
- combo_positionAttribute->clear();
-
- const QString& mapname = currentItems[0]->text();
- MapHandlerGen* mh = m_window->getMap(mapname);
-
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- unsigned int j = 0;
- const AttributeHash& attribs = mh->getAttributesList(VERTEX);
- for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
- {
- if(i.value() == vec3TypeName)
- {
- combo_positionAttribute->addItem(i.key());
- if(i.key() == "position") // try to select a position attribute named "position"
- combo_positionAttribute->setCurrentIndex(j);
-
- ++j;
- }
- }
-
- m_selectedMap = mh;
- connect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
- }
- else
- m_selectedMap = NULL;
-}
-
-void SubdivideSurfaceDialog::addMapToList(MapHandlerGen* m)
-{
- mapList->addItem(m->getName());
-}
-
-void SubdivideSurfaceDialog::removeMapFromList(MapHandlerGen* m)
-{
- QList items = mapList->findItems(m->getName(), Qt::MatchExactly);
- if(!items.empty())
- delete items[0];
-
- if(m_selectedMap == m)
- {
- disconnect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
- m_selectedMap = NULL;
- }
-}
-
-void SubdivideSurfaceDialog::addAttributeToList(unsigned int orbit, const QString& nameAttr)
-{
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- const QString& typeAttr = m_selectedMap->getAttributeTypeName(orbit, nameAttr);
-
- if(typeAttr == vec3TypeName)
- {
- combo_positionAttribute->addItem(nameAttr);
- }
-}
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
diff --git a/SCHNApps_old/Plugins/surfaceDeformation/CMakeLists.txt b/SCHNApps_old/Plugins/surfaceDeformation/CMakeLists.txt
deleted file mode 100644
index c0bada3c479b675aa4eea0931a2b825ac18f899c..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/surfaceDeformation/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-SET( PLUGIN_NAME SurfaceDeformation )
-
-SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/surfaceDeformation )
-
-INCLUDE_DIRECTORIES(
- ${PLUGIN_ROOT_DIR}/include
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_FILES
- ${PLUGIN_ROOT_DIR}/src/*.cpp
- ${PLUGIN_ROOT_DIR}/include/*.h
- ${PLUGIN_ROOT_DIR}/include/*.hpp
-)
-
-file(
- GLOB_RECURSE
- PLUGIN_UI_FILES
- ${PLUGIN_ROOT_DIR}/forms/*.ui
-)
-
-SET(
- PLUGIN_QOBJECT_FILES
- ${PLUGIN_ROOT_DIR}/include/surfaceDeformation.h
- ${PLUGIN_ROOT_DIR}/include/surfaceDeformationDockTab.h
-)
-
-include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
diff --git a/SCHNApps_old/Plugins/surfaceDeformation/forms/surfaceDeformation.ui b/SCHNApps_old/Plugins/surfaceDeformation/forms/surfaceDeformation.ui
deleted file mode 100644
index 1d71cc82fa0838bd6357ba138cbbbb316e300f15..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/surfaceDeformation/forms/surfaceDeformation.ui
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
- 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_old/Plugins/surfaceDeformation/include/surfaceDeformation.h b/SCHNApps_old/Plugins/surfaceDeformation/include/surfaceDeformation.h
deleted file mode 100644
index 090d71d7f921ad1e140288042c3066319c139a76..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/surfaceDeformation/include/surfaceDeformation.h
+++ /dev/null
@@ -1,154 +0,0 @@
-#ifndef _SURFACEDEFORMATION_PLUGIN_H_
-#define _SURFACEDEFORMATION_PLUGIN_H_
-
-#include "plugin.h"
-#include "surfaceDeformationDockTab.h"
-
-#include "mapHandler.h"
-
-#include "Utils/pointSprite.h"
-
-#include "Container/fakeAttribute.h"
-
-#include "NL/nl.h"
-#include "Algo/LinearSolving/basic.h"
-#include "Eigen/Dense"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-
-enum SelectionMode
-{
- LOCKED,
- HANDLE
-};
-
-
-typedef NoNameIOAttribute Eigen_Matrix3f ;
-
-struct PerMapParameterSet
-{
- PerMapParameterSet(MapHandlerGen* mh);
- ~PerMapParameterSet();
-
- void initParameters();
-
- MapHandlerGen* mh;
-
- VertexAttribute positionAttribute;
- CellMarker* lockingMarker;
- CellMarker* handleMarker;
- SelectionMode verticesSelectionMode;
- std::vector lockedVertices;
- std::vector handleVertices;
- std::vector handleVerticesId;
- Utils::VBO* lockedVerticesVBO;
- Utils::VBO* handleVerticesVBO;
-
- VertexAttribute positionInit;
- VertexAttribute vertexNormal;
- EdgeAttribute edgeAngle;
- EdgeAttribute edgeWeight;
- VertexAttribute vertexArea;
- VertexAttribute diffCoord;
- VertexAttribute vertexRotationMatrix;
- VertexAttribute rotatedDiffCoord;
-
- VertexAttribute vIndex;
- unsigned int nb_vertices;
- NLContext nlContext;
-};
-
-struct ParameterSet
-{
- ParameterSet() : selectedMap(NULL)
- {}
-
- PerMapParameterSet* getCurrentMapParameterSet()
- {
- if(selectedMap)
- return perMap[selectedMap->getName()];
- else
- return NULL;
- }
-
- QHash perMap;
- MapHandlerGen* selectedMap;
-};
-
-
-class SurfaceDeformationPlugin : public Plugin
-{
- Q_OBJECT
- Q_INTERFACES(CGoGN::SCHNApps::Plugin)
-
-public:
- SurfaceDeformationPlugin() :
- selecting(false),
- dragging(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);
-
-protected:
- SurfaceDeformationDockTab* m_dockTab;
- QHash h_viewParams;
-
- Utils::PointSprite* m_pointSprite;
-
- Utils::VBO* selectionSphereVBO;
-
- bool selecting;
- PFP2::VEC3 selectionCenter;
- PFP2::REAL selectionRadius;
- bool dragging;
- PFP2::REAL dragZ;
- qglviewer::Vec dragPrevious;
-
-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);
-
-protected:
- void addManagedMap(View *v, MapHandlerGen* m);
- void removeManagedMap(View *v, MapHandlerGen* m);
-
-public slots:
- void changeSelectedMap(View* view, MapHandlerGen* map);
-
- void changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute, bool fromUI = false);
- void changeVerticesSelectionMode(View* view, MapHandlerGen* map, SelectionMode m, bool fromUI = false);
-
-protected:
- void matchDiffCoord(View* view, MapHandlerGen* map);
- void asRigidAsPossible(View* view, MapHandlerGen* map);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/surfaceDeformation/include/surfaceDeformationDockTab.h b/SCHNApps_old/Plugins/surfaceDeformation/include/surfaceDeformationDockTab.h
deleted file mode 100644
index 34bd3923b30a8d20cdf4aa6897184d5b4051c2d2..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/surfaceDeformation/include/surfaceDeformationDockTab.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _SURFACE_DEFORMATION_DOCK_TAB_H_
-#define _SURFACE_DEFORMATION_DOCK_TAB_H_
-
-#include "ui_surfaceDeformation.h"
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-class Window;
-class SurfaceDeformationPlugin;
-struct ParameterSet;
-
-class SurfaceDeformationDockTab : public QWidget, public Ui::SurfaceDeformationWidget
-{
- Q_OBJECT
-
-public:
- SurfaceDeformationDockTab(Window* w, SurfaceDeformationPlugin* p);
-
-private:
- Window* m_window;
- SurfaceDeformationPlugin* m_plugin;
- ParameterSet* m_currentParams;
- bool b_refreshingUI;
-
-public slots:
- void refreshUI(ParameterSet* params);
-
- void selectedMapChanged();
-
- void positionAttributeChanged(int index);
- void selectLockedVertices(bool b);
- void selectHandleVertices(bool b);
-
- void addAttributeToList(unsigned int orbit, const QString& nameAttr);
-};
-
-} // namespace SCHNApps
-
-} // namespace CGoGN
-
-#endif
diff --git a/SCHNApps_old/Plugins/surfaceDeformation/src/surfaceDeformation.cpp b/SCHNApps_old/Plugins/surfaceDeformation/src/surfaceDeformation.cpp
deleted file mode 100644
index 629a9ea9d48b51e16caa1d2da55bc230736c22d6..0000000000000000000000000000000000000000
--- a/SCHNApps_old/Plugins/surfaceDeformation/src/surfaceDeformation.cpp
+++ /dev/null
@@ -1,682 +0,0 @@
-#include "surfaceDeformation.h"
-
-#include "Algo/Selection/raySelector.h"
-#include "Algo/Selection/collector.h"
-
-#include "Algo/Geometry/normal.h"
-#include "Algo/Geometry/laplacian.h"
-
-#include
-#include
-
-namespace CGoGN
-{
-
-namespace SCHNApps
-{
-
-PerMapParameterSet::PerMapParameterSet(MapHandlerGen* m) :
- mh(m),
- verticesSelectionMode(LOCKED),
- nlContext(NULL)
-{
- QString positionName;
-
- QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
-
- const AttributeHash& attribs = mh->getAttributesList(VERTEX);
- for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
- {
- if(i.value() == vec3TypeName)
- {
- if(positionName != "position") // try to select an attribute named "position"
- positionName = i.key(); // or anything else if not found
- }
- }
- positionAttribute = mh->getAttribute(positionName);
-
- PFP2::MAP* map = static_cast*>(mh)->getMap();
- lockingMarker = new CellMarker(*map);
- handleMarker = new CellMarker(*map);
-
- lockedVerticesVBO = new Utils::VBO();
- handleVerticesVBO = new Utils::VBO();
-
- positionInit = mh->getAttribute("positionInit", false) ;
- if(!positionInit.isValid())
- positionInit = mh->addAttribute("positionInit", false) ;
-
- vIndex = mh->getAttribute("vIndex", false);
- if(!vIndex.isValid())
- vIndex = mh->addAttribute("vIndex", false);
-
-// edgeWeight = mh->getAttribute("edgeWeight", false);
-// if(!edgeWeight.isValid())
-// edgeWeight = mh->addAttribute("edgeWeight", false);
-
-// vertexArea = mh->getAttribute("vertexArea", false);
-// if(!vertexArea.isValid())
-// vertexArea = mh->addAttribute("vertexArea", false);
-
- diffCoord = mh->getAttribute("diffCoord", false);
- if(!diffCoord.isValid())
- diffCoord = mh->addAttribute("diffCoord", false);
-
- vertexRotationMatrix = mh->getAttribute("vertexRotationMatrix", false) ;
- if(!vertexRotationMatrix.isValid())
- vertexRotationMatrix = mh->addAttribute("vertexRotationMatrix", false);
-
- rotatedDiffCoord = mh->getAttribute("rotatedDiffCoord", false) ;
- if(!rotatedDiffCoord.isValid())
- rotatedDiffCoord = mh->addAttribute("rotatedDiffCoord", false);
-
- initParameters();
-}
-
-PerMapParameterSet::~PerMapParameterSet()
-{
- delete lockingMarker;
- delete handleMarker;
- delete lockedVerticesVBO;
- delete handleVerticesVBO;
- nlDeleteContext(nlContext);
-}
-
-void PerMapParameterSet::initParameters()
-{
- if(positionAttribute.isValid())
- {
- PFP2::MAP* map = static_cast*>(mh)->getMap();
-
- map->copyAttribute(positionInit, positionAttribute) ;
-
- nb_vertices = static_cast(map)->computeIndexCells(vIndex);
-
-// Algo::Surface::Geometry::computeCotanWeightEdges(*map, positionAttribute, edgeWeight) ;
-// Algo::Surface::Geometry::computeVoronoiAreaVertices(*map, positionAttribute, vertexArea) ;
-// Algo::Surface::Geometry::computeLaplacianCotanVertices(*map, edgeWeight, vertexArea, positionAttribute, diffCoord) ;
- Algo::Surface::Geometry::computeLaplacianTopoVertices(*map, positionAttribute, diffCoord) ;
-
- for(unsigned int i = vertexRotationMatrix.begin(); i != vertexRotationMatrix.end() ; vertexRotationMatrix.next(i))
- vertexRotationMatrix[i] = Eigen::Matrix3f::Identity();
-
- if(nlContext)
- nlDeleteContext(nlContext);
- nlContext = nlNewContext();
- nlSolverParameteri(NL_NB_VARIABLES, nb_vertices);
- nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
- nlSolverParameteri(NL_SOLVER, NL_CHOLMOD_EXT);
- }
-}
-
-
-bool SurfaceDeformationPlugin::enable()
-{
- m_dockTab = new SurfaceDeformationDockTab(m_window, this);
- addTabInDock(m_dockTab, "Surface Deformation");
-
- selectionSphereVBO = new Utils::VBO();
-
- m_pointSprite = new CGoGN::Utils::PointSprite();
- registerShader(m_pointSprite);
-
- 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::disable()
-{
- delete m_pointSprite;
-}
-
-void SurfaceDeformationPlugin::redraw(View* view)
-{
- ParameterSet* params = h_viewParams[view];
- MapHandlerGen* mh = params->selectedMap;
- if(mh)
- {
- PerMapParameterSet* perMap = params->perMap[mh->getName()];
-
- if(!perMap->lockedVertices.empty() || !perMap->handleVertices.empty())
- {
- m_pointSprite->setAttributePosition(perMap->lockedVerticesVBO);
- m_pointSprite->setSize(mh->getBBdiagSize() / 250.0f);
- m_pointSprite->setColor(CGoGN::Geom::Vec4f(1.0f, 0.0f, 0.0f, 0.75f));
- m_pointSprite->setLightPosition(CGoGN::Geom::Vec3f(0.0f, 0.0f, 1.0f));
-
- m_pointSprite->enableVertexAttribs();
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDrawArrays(GL_POINTS, 0, perMap->lockedVertices.size());
- glDisable(GL_BLEND);
- m_pointSprite->disableVertexAttribs();
-
- m_pointSprite->setAttributePosition(perMap->handleVerticesVBO);
- m_pointSprite->setSize(mh->getBBdiagSize() / 250.0f);
- m_pointSprite->setColor(CGoGN::Geom::Vec4f(0.0f, 1.0f, 0.0f, 0.75f));
- m_pointSprite->setLightPosition(CGoGN::Geom::Vec3f(0.0f, 0.0f, 1.0f));
-
- m_pointSprite->enableVertexAttribs();
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDrawArrays(GL_POINTS, 0, perMap->handleVertices.size());
- glDisable(GL_BLEND);
- m_pointSprite->disableVertexAttribs();
- }
- }
-
- if(selecting)
- {
- std::vector selectionPoint;
- selectionPoint.push_back(selectionCenter);
- selectionSphereVBO->updateData(selectionPoint);
-
- m_pointSprite->setAttributePosition(selectionSphereVBO);
- m_pointSprite->setSize(selectionRadius);
- m_pointSprite->setColor(CGoGN::Geom::Vec4f(0.0f, 0.0f, 1.0f, 0.5f));
- m_pointSprite->setLightPosition(CGoGN::Geom::Vec3f(0.0f, 0.0f, 1.0f));
-
- m_pointSprite->enableVertexAttribs();
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDrawArrays(GL_POINTS, 0, 1);
- glDisable(GL_BLEND);
- m_pointSprite->disableVertexAttribs();
- }
-}
-
-void SurfaceDeformationPlugin::keyPress(View* view, QKeyEvent* event)
-{
- if(event->key() == Qt::Key_Shift)
- {
- view->setMouseTracking(true);
- selecting = true;
- view->updateGL();
- }
- else if(event->key() == Qt::Key_R)
- {
- ParameterSet* params = h_viewParams[view];
- MapHandlerGen* map = params->selectedMap;
- if(map)
- {
- asRigidAsPossible(view, map);
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- params->selectedMap->notifyAttributeModification(perMap->positionAttribute);
- view->updateGL();
- }
- }
-}
-
-void SurfaceDeformationPlugin::keyRelease(View* view, QKeyEvent* event)
-{
- if(event->key() == Qt::Key_Shift)
- {
- view->setMouseTracking(false);
- selecting = false;
- view->updateGL();
- }
-}
-
-void SurfaceDeformationPlugin::mousePress(View* view, QMouseEvent* event)
-{
- if(event->button() == Qt::LeftButton && selecting)
- {
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->getCurrentMapParameterSet();
-
- if(perMap)
- {
- QPoint pixel(event->x(), event->y());
- qglviewer::Vec orig;
- qglviewer::Vec dir;
- view->camera()->convertClickToLine(pixel, orig, dir);
-
- PFP2::VEC3 rayA(orig.x, orig.y, orig.z);
- PFP2::VEC3 AB(dir.x, dir.y, dir.z);
-
- Dart d;
- PFP2::MAP* map = static_cast*>(params->selectedMap)->getMap();
- Algo::Selection::vertexRaySelection(*map, perMap->positionAttribute, rayA, AB, d);
-
- if(d != NIL)
- {
- Algo::Surface::Selection::Collector_WithinSphere neigh(*map, perMap->positionAttribute, selectionRadius);
- neigh.collectAll(d);
- const std::vector& insideV = neigh.getInsideVertices();
-
- for(unsigned int i = 0; i < insideV.size(); ++i)
- {
- unsigned int v = map->getEmbedding(insideV[i]);
- if (!perMap->lockingMarker->isMarked(v))
- {
- if(perMap->verticesSelectionMode == LOCKED)
- perMap->lockedVertices.push_back(perMap->positionAttribute[v]);
- perMap->lockingMarker->mark(v);
- }
- if(perMap->verticesSelectionMode == HANDLE)
- {
- if(!perMap->handleMarker->isMarked(v))
- {
- perMap->handleVertices.push_back(perMap->positionAttribute[v]);
- perMap->handleVerticesId.push_back(v);
- perMap->handleMarker->mark(v);
- }
- }
- }
-
- nlMakeCurrent(perMap->nlContext) ;
- nlReset(NL_FALSE) ;
-
- perMap->lockedVerticesVBO->updateData(perMap->lockedVertices);
- if(perMap->verticesSelectionMode == HANDLE)
- perMap->handleVerticesVBO->updateData(perMap->handleVertices);
-
- view->updateGL() ;
- }
- }
- }
- else if(event->button() == Qt::RightButton && event->modifiers() & Qt::ShiftModifier)
- {
- view->setMouseTracking(false) ;
-
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->getCurrentMapParameterSet();
-
- if(perMap)
- {
- selecting = false ;
- dragging = true ;
-
- dragZ = 0;
- for(unsigned int i = 0; i < perMap->handleVertices.size(); ++i)
- {
- const PFP2::VEC3& p = perMap->handleVertices[i] ;
- qglviewer::Vec q = view->camera()->projectedCoordinatesOf(qglviewer::Vec(p[0],p[1],p[2]));
- dragZ += q.z ;
- }
- dragZ /= perMap->handleVertices.size() ;
-
- qglviewer::Vec p(event->x(), event->y(), dragZ);
- dragPrevious = view->camera()->unprojectedCoordinatesOf(p);
- }
- }
-}
-
-void SurfaceDeformationPlugin::mouseRelease(View* view, QMouseEvent* event)
-{
- if(event->button() == Qt::RightButton)
- dragging = false;
-}
-
-void SurfaceDeformationPlugin::mouseMove(View* view, QMouseEvent* event)
-{
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->getCurrentMapParameterSet();
-
- if(perMap)
- {
- if(dragging)
- {
- qglviewer::Vec p(event->x(), event->y(), dragZ);
- qglviewer::Vec q = view->camera()->unprojectedCoordinatesOf(p);
-
- qglviewer::Vec vec = q - dragPrevious;
- PFP2::VEC3 t(vec.x, vec.y, vec.z);
- for(unsigned int i = 0; i < perMap->handleVertices.size(); ++i)
- {
- perMap->handleVertices[i] += t;
- perMap->positionAttribute[perMap->handleVerticesId[i]] += t;
- }
- perMap->handleVerticesVBO->updateData(perMap->handleVertices);
-
- dragPrevious = q;
-
-// matchDiffCoord(view, map);
- asRigidAsPossible(view, params->selectedMap);
-
- params->selectedMap->notifyAttributeModification(perMap->positionAttribute);
-
- view->updateGL();
- }
- else if(selecting)
- {
- QPoint pixel(event->x(), event->y());
- qglviewer::Vec orig;
- qglviewer::Vec dir;
- view->camera()->convertClickToLine(pixel, orig, dir);
-
- PFP2::VEC3 rayA(orig.x, orig.y, orig.z);
- PFP2::VEC3 AB(dir.x, dir.y, dir.z);
-
- Dart d;
- PFP2::MAP* map = static_cast*>(params->selectedMap)->getMap();
- Algo::Selection::vertexRaySelection(*map, perMap->positionAttribute, rayA, AB, d);
- if(d != NIL)
- {
- selectionCenter = perMap->positionAttribute[d];
- view->updateGL();
- }
- }
- }
-}
-
-void SurfaceDeformationPlugin::wheelEvent(View* view, QWheelEvent* event)
-{
- if(selecting)
- {
- if(event->delta() > 0)
- selectionRadius *= 0.9f ;
- else
- selectionRadius *= 1.1f ;
- 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* mh, maps)
- addManagedMap(view, mh);
-
- 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)
- {
- const QList& maps = view->getLinkedMaps();
- foreach(MapHandlerGen* mh, maps)
- removeManagedMap(view, mh);
-
- ParameterSet* params = h_viewParams[view];
- delete params;
- 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))
- {
- ParameterSet* params = h_viewParams[view];
- changeSelectedMap(view, params->selectedMap);
- m_dockTab->refreshUI(params);
- }
-}
-
-void SurfaceDeformationPlugin::mapLinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- addManagedMap(view, m);
-}
-
-void SurfaceDeformationPlugin::mapUnlinked(MapHandlerGen* m)
-{
- View* view = static_cast(QObject::sender());
- assert(isLinkedToView(view));
- removeManagedMap(view, m);
-}
-
-void SurfaceDeformationPlugin::addManagedMap(View* v, MapHandlerGen *m)
-{
-// connect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-// connect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = new PerMapParameterSet(m);
-
- params->perMap.insert(m->getName(), perMap);
-
- if(params->selectedMap == NULL || params->perMap.count() == 1)
- changeSelectedMap(v, m);
- else
- m_dockTab->refreshUI(params);
-}
-
-void SurfaceDeformationPlugin::removeManagedMap(View *v, MapHandlerGen *m)
-{
-// disconnect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
-// disconnect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
-
- ParameterSet* params = h_viewParams[v];
- PerMapParameterSet* perMap = params->perMap[m->getName()];
-
- delete perMap;
- params->perMap.remove(m->getName());
-
- if(params->selectedMap == m)
- {
- if(!params->perMap.empty())
- changeSelectedMap(v, m_window->getMap(params->perMap.begin().key()));
- else
- changeSelectedMap(v, 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(prev, SIGNAL(attributeAdded(unsigned int, const QString&)), m_dockTab, SLOT(addAttributeToList(unsigned int, const QString&)));
- if(map)
- {
- connect(map, SIGNAL(attributeAdded(unsigned int, const QString&)), m_dockTab, SLOT(addAttributeToList(unsigned int, const QString&)));
- selectionRadius = map->getBBdiagSize() / 50.0;
- }
-
- m_dockTab->refreshUI(params);
- }
-}
-
-void SurfaceDeformationPlugin::changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute attribute, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- PerMapParameterSet* perMap = params->perMap[map->getName()];
- perMap->positionAttribute = attribute;
- perMap->initParameters();
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- }
-}
-
-void SurfaceDeformationPlugin::changeVerticesSelectionMode(View* view, MapHandlerGen* map, SelectionMode m, bool fromUI)
-{
- ParameterSet* params = h_viewParams[view];
- params->perMap[map->getName()]->verticesSelectionMode = m;
-
- if(view->isCurrentView())
- {
- if(!fromUI)
- m_dockTab->refreshUI(params);
- }
-}
-
-void SurfaceDeformationPlugin::matchDiffCoord(View* view, MapHandlerGen* mh)
-{
- PFP2::MAP* map = static_cast*>(mh)->getMap();
- PerMapParameterSet* perMap = h_viewParams[view]->perMap[mh->getName()];
-
- nlMakeCurrent(perMap->nlContext);
- if(nlGetCurrentState() == NL_STATE_INITIAL)
- nlBegin(NL_SYSTEM) ;
- for(int coord = 0; coord < 3; ++coord)
- {
- LinearSolving::setupVariables