Commit 601d62f3 authored by Pierre Kraemer's avatar Pierre Kraemer

update FindSuiteSparse.cmake

parent ad2ac4e6
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
using namespace CGoGN; using namespace CGoGN;
using namespace SCHNApps; using namespace SCHNApps;
namespace CGoGN { namespace Utils { class Drawer; } } // namespace CGoGN { namespace Utils { class Drawer; } }
enum SelectionMode enum SelectionMode
...@@ -143,7 +143,7 @@ private: ...@@ -143,7 +143,7 @@ private:
SurfaceDeformationDockTab* m_dockTab; SurfaceDeformationDockTab* m_dockTab;
QHash<View*, ParameterSet*> h_viewParams; QHash<View*, ParameterSet*> h_viewParams;
Utils::Drawer* m_drawer; // Utils::Drawer* m_drawer;
bool b_refreshingUI; bool b_refreshingUI;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "Algo/Geometry/normal.h" #include "Algo/Geometry/normal.h"
#include "Algo/Geometry/laplacian.h" #include "Algo/Geometry/laplacian.h"
#include "Utils/drawer.h" //#include "Utils/drawer.h"
#include <QKeyEvent> #include <QKeyEvent>
#include <QMouseEvent> #include <QMouseEvent>
...@@ -95,25 +95,22 @@ bool SurfaceDeformationPlugin::enable() ...@@ -95,25 +95,22 @@ bool SurfaceDeformationPlugin::enable()
connect(m_window, SIGNAL(viewAndPluginUnlinked(View*, Plugin*)), this, SLOT(viewUnlinked(View*, Plugin*))); connect(m_window, SIGNAL(viewAndPluginUnlinked(View*, Plugin*)), this, SLOT(viewUnlinked(View*, Plugin*)));
connect(m_window, SIGNAL(currentViewChanged(View*)), this, SLOT(currentViewChanged(View*))); connect(m_window, SIGNAL(currentViewChanged(View*)), this, SLOT(currentViewChanged(View*)));
Utils::ShaderColorPerVertex* s = new Utils::ShaderColorPerVertex(); // m_drawer = new Utils::Drawer();
registerShader(s); // registerShader(m_drawer->getShader());
m_drawer = new Utils::Drawer();
registerShader(m_drawer->getShader());
return true; return true;
} }
void SurfaceDeformationPlugin::disable() void SurfaceDeformationPlugin::disable()
{ {
delete m_drawer; // delete m_drawer;
} }
void SurfaceDeformationPlugin::redraw(View* view) void SurfaceDeformationPlugin::redraw(View* view)
{ {
if(selecting) if(selecting)
{ {
glDisable(GL_LIGHTING) ; /* glDisable(GL_LIGHTING) ;
m_drawer->newList(GL_COMPILE_AND_EXECUTE) ; m_drawer->newList(GL_COMPILE_AND_EXECUTE) ;
m_drawer->lineWidth(2.0f) ; m_drawer->lineWidth(2.0f) ;
m_drawer->begin(GL_LINES) ; m_drawer->begin(GL_LINES) ;
...@@ -132,7 +129,7 @@ void SurfaceDeformationPlugin::redraw(View* view) ...@@ -132,7 +129,7 @@ void SurfaceDeformationPlugin::redraw(View* view)
m_drawer->vertex(selectionCenter + selectionRadius * PFP2::VEC3(0,0,-1)) ; m_drawer->vertex(selectionCenter + selectionRadius * PFP2::VEC3(0,0,-1)) ;
m_drawer->end() ; m_drawer->end() ;
m_drawer->endList() ; m_drawer->endList() ;
} */ }
ParameterSet* params = h_viewParams[view]; ParameterSet* params = h_viewParams[view];
MapHandlerGen* mh = params->selectedMap; MapHandlerGen* mh = params->selectedMap;
...@@ -142,7 +139,7 @@ void SurfaceDeformationPlugin::redraw(View* view) ...@@ -142,7 +139,7 @@ void SurfaceDeformationPlugin::redraw(View* view)
if(!perMap->locked_vertices.empty() || !perMap->handle_vertices.empty()) if(!perMap->locked_vertices.empty() || !perMap->handle_vertices.empty())
{ {
glDisable(GL_LIGHTING) ; /* glDisable(GL_LIGHTING) ;
m_drawer->newList(GL_COMPILE_AND_EXECUTE) ; m_drawer->newList(GL_COMPILE_AND_EXECUTE) ;
m_drawer->pointSize(4.0f) ; m_drawer->pointSize(4.0f) ;
m_drawer->begin(GL_POINTS) ; m_drawer->begin(GL_POINTS) ;
...@@ -157,7 +154,7 @@ void SurfaceDeformationPlugin::redraw(View* view) ...@@ -157,7 +154,7 @@ void SurfaceDeformationPlugin::redraw(View* view)
m_drawer->vertex(perMap->positionAttribute[perMap->handle_vertices[i]]) ; m_drawer->vertex(perMap->positionAttribute[perMap->handle_vertices[i]]) ;
m_drawer->end() ; m_drawer->end() ;
m_drawer->endList() ; m_drawer->endList() ;
} */ }
} }
} }
......
...@@ -5,15 +5,15 @@ differentialPropertiesPlugin = schnapps.loadPlugin("DifferentialProperties"); ...@@ -5,15 +5,15 @@ differentialPropertiesPlugin = schnapps.loadPlugin("DifferentialProperties");
subdivisionPlugin = schnapps.loadPlugin("SubdivideSurface"); subdivisionPlugin = schnapps.loadPlugin("SubdivideSurface");
surfaceDeformationPlugin = schnapps.loadPlugin("SurfaceDeformation"); surfaceDeformationPlugin = schnapps.loadPlugin("SurfaceDeformation");
obj = importPlugin.importFromFile("/home/kraemer/Media/Data/surface/lowRes/iphi_good_9k.off"); #obj = importPlugin.importFromFile("/home/kraemer/Media/Data/surface/lowRes/iphi_good_9k.off");
v = schnapps.getView("view_0"); #v = schnapps.getView("view_0");
schnapps.linkViewAndPlugin(v.getName(), renderPlugin.getName()); #schnapps.linkViewAndPlugin(v.getName(), renderPlugin.getName());
schnapps.linkViewAndPlugin(v.getName(), renderVectorPlugin.getName()); #schnapps.linkViewAndPlugin(v.getName(), renderVectorPlugin.getName());
schnapps.linkViewAndPlugin(v.getName(), surfaceDeformationPlugin.getName()); #schnapps.linkViewAndPlugin(v.getName(), surfaceDeformationPlugin.getName());
schnapps.linkViewAndMap(v.getName(), obj.getName()); #schnapps.linkViewAndMap(v.getName(), obj.getName());
#differentialPropertiesPlugin.computeNormal(obj.getName()); #differentialPropertiesPlugin.computeNormal(obj.getName());
#differentialPropertiesPlugin.computeCurvature(obj.getName()); #differentialPropertiesPlugin.computeCurvature(obj.getName());
...@@ -38,18 +38,15 @@ if( WIN32 ) ...@@ -38,18 +38,15 @@ if( WIN32 )
ENDIF( SUITESPARSE_LIBRARY_DIRS ) ENDIF( SUITESPARSE_LIBRARY_DIRS )
else( WIN32 ) else( WIN32 )
IF( APPLE) IF(APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /opt/local/include/ufsparse ) PATHS /opt/local/include/ufsparse
/usr/local/include )
FIND_PATH( SUITESPARSE_LIBRARY_DIR FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libSuiteSparse.dylib NAMES libcholmod.a
PATHS /opt/local/lib ) PATHS /opt/local/lib
/usr/local/lib )
list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_LIBRARY_DIR} )
list ( APPEND SUITESPARSE_LIBRARIES SuiteSparse)
ELSE(APPLE) ELSE(APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /usr/local/include PATHS /usr/local/include
...@@ -58,14 +55,11 @@ else( WIN32 ) ...@@ -58,14 +55,11 @@ else( WIN32 )
${CMAKE_SOURCE_DIR}/MacOS/Libs/cholmod ${CMAKE_SOURCE_DIR}/MacOS/Libs/cholmod
PATH_SUFFIXES cholmod/ CHOLMOD/ ) PATH_SUFFIXES cholmod/ CHOLMOD/ )
FIND_PATH( SUITESPARSE_LIBRARY_DIR FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libcholmod.so NAMES libcholmod.so
PATHS /usr/lib PATHS /usr/lib
/usr/lib64 /usr/lib64
/usr/local/lib ) /usr/local/lib )
ENDIF(APPLE) ENDIF(APPLE)
# Add cholmod include directory to collection include directories # Add cholmod include directory to collection include directories
...@@ -73,12 +67,9 @@ else( WIN32 ) ...@@ -73,12 +67,9 @@ else( WIN32 )
list ( APPEND SUITESPARSE_INCLUDE_DIRS ${CHOLMOD_INCLUDE_DIR} ) list ( APPEND SUITESPARSE_INCLUDE_DIRS ${CHOLMOD_INCLUDE_DIR} )
ENDIF( CHOLMOD_INCLUDE_DIR ) ENDIF( CHOLMOD_INCLUDE_DIR )
# if we found the library, add it to the defined libraries # if we found the library, add it to the defined libraries
IF ( SUITESPARSE_LIBRARY_DIR ) IF ( SUITESPARSE_LIBRARY_DIR )
# Skipped, as this is set for apple in the block above
if (NOT APPLE)
list ( APPEND SUITESPARSE_LIBRARIES amd) list ( APPEND SUITESPARSE_LIBRARIES amd)
list ( APPEND SUITESPARSE_LIBRARIES btf) list ( APPEND SUITESPARSE_LIBRARIES btf)
list ( APPEND SUITESPARSE_LIBRARIES camd) list ( APPEND SUITESPARSE_LIBRARIES camd)
...@@ -90,7 +81,10 @@ else( WIN32 ) ...@@ -90,7 +81,10 @@ else( WIN32 )
list ( APPEND SUITESPARSE_LIBRARIES klu) list ( APPEND SUITESPARSE_LIBRARIES klu)
# list ( APPEND SUITESPARSE_LIBRARIES spqr) # list ( APPEND SUITESPARSE_LIBRARIES spqr)
list ( APPEND SUITESPARSE_LIBRARIES umfpack) list ( APPEND SUITESPARSE_LIBRARIES umfpack)
endif()
IF (APPLE)
list ( APPEND SUITESPARSE_LIBRARIES suitesparseconfig)
ENDIF (APPLE)
# Metis and spqr are optional # Metis and spqr are optional
FIND_LIBRARY( SUITESPARSE_METIS_LIBRARY FIND_LIBRARY( SUITESPARSE_METIS_LIBRARY
...@@ -125,6 +119,7 @@ IF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES) ...@@ -125,6 +119,7 @@ IF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
list (APPEND SUITESPARSE_INCLUDE_DIRS ${CHOLMOD_INCLUDE_DIR}/../../UFconfig ) list (APPEND SUITESPARSE_INCLUDE_DIRS ${CHOLMOD_INCLUDE_DIR}/../../UFconfig )
ENDIF(WIN32) ENDIF(WIN32)
SET(SUITESPARSE_FOUND TRUE) SET(SUITESPARSE_FOUND TRUE)
MESSAGE(STATUS "Found SuiteSparse")
ELSE (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES) ELSE (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
SET( SUITESPARSE_FOUND FALSE ) SET( SUITESPARSE_FOUND FALSE )
ENDIF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES) ENDIF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment