Commit 50592f12 authored by CGoGN's avatar CGoGN

delete old SCHNApps version

parent 55036cd1
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)
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)
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)
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 )
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ComputeNormalDialog</class>
<widget class="QDialog" name="ComputeNormalDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>472</width>
<height>276</height>
</rect>
</property>
<property name="windowTitle">
<string>Compute Normal</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QListWidget" name="mapList"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Position attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_positionAttribute">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Normal attribute</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Existing attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_normalAttribute">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>New attribute :</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="normalAttributeName"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="button_cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_apply">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_ok">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>button_ok</sender>
<signal>clicked()</signal>
<receiver>ComputeNormalDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>232</x>
<y>283</y>
</hint>
<hint type="destinationlabel">
<x>140</x>
<y>156</y>
</hint>
</hints>
</connection>
<connection>
<sender>button_cancel</sender>
<signal>clicked()</signal>
<receiver>ComputeNormalDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>52</x>
<y>283</y>
</hint>
<hint type="destinationlabel">
<x>140</x>
<y>156</y>
</hint>
</hints>
</connection>
</connections>
</ui>
#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
#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
#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<QString, ComputeNormalParameters> 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<QString, ComputeCurvatureParameters> computeCurvatureLastParameters;
};
#endif
#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<MapHandlerGen*>& 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<QListWidgetItem*> 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()));