From a160f39457e8dc0947dc5d6865c020a285a50df6 Mon Sep 17 00:00:00 2001 From: salinasd Date: Tue, 27 Jan 2015 11:44:49 +0000 Subject: compatibility vs2013 git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@429 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1ce2e6b9c85e603715e8f1f63715263f9bd09702 --- src/GudhUI/CMakeLists.txt | 12 ++++++++---- src/GudhUI/gui/MainWindow.cpp | 6 +++--- src/GudhUI/model/Model.h | 14 +++++++------- src/GudhUI/utils/Persistence_compute.h | 3 +-- 4 files changed, 19 insertions(+), 16 deletions(-) (limited to 'src/GudhUI') diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt index 4c0c2087..769e1d30 100644 --- a/src/GudhUI/CMakeLists.txt +++ b/src/GudhUI/CMakeLists.txt @@ -3,19 +3,23 @@ project(GudhUI) #Specify Gudhi's path here #for instance -SET(Gudhi_Path "/home/dsalinas/Documents/CodeSVN/gudhi/src/include") +set(Gudhi_Path "C:/Users/dsalinas/Documents/Recherche/Code/c++/Gudhi_library_1.1.0/include") +#set(Gudhi_Path "/home/dsalinas/Documents/CodeSVN/gudhi/src/include") +if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018 -frounding-math") +else() + list(APPEND CMAKE_CXX_FLAGS "-std=c++11 -Wall -pedantic -frounding-math") +endif() set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -frounding-math -Wall -pedantic") - find_package(Boost REQUIRED COMPONENTS) find_package(CGAL COMPONENTS Qt4) find_package(Qt4) find_package(OpenGL) find_package(QGLViewer) -if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND ) +if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND ) set( QT_USE_QTXML TRUE ) set( QT_USE_QTMAIN TRUE ) diff --git a/src/GudhUI/gui/MainWindow.cpp b/src/GudhUI/gui/MainWindow.cpp index 85745e93..f1dd8e83 100644 --- a/src/GudhUI/gui/MainWindow.cpp +++ b/src/GudhUI/gui/MainWindow.cpp @@ -19,9 +19,9 @@ menu_uniform_neighbors_(new Menu_uniform_neighbors(this)), menu_edge_contraction_(new Menu_edge_contraction(this,model_)), menu_persistence_(new Menu_persistence(this)) { -#ifndef NDEBUG // catch nan -feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); -#endif +//#ifndef NDEBUG // catch nan +//feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); +//#endif setupUi(this); diff --git a/src/GudhUI/model/Model.h b/src/GudhUI/model/Model.h index 0d0f91e6..abb2fd6a 100644 --- a/src/GudhUI/model/Model.h +++ b/src/GudhUI/model/Model.h @@ -68,8 +68,8 @@ class Model{ public: Complex complex_; - typedef typename Complex::Vertex_handle Vertex_handle; - typedef typename Complex::CVI CVI; + typedef Complex::Vertex_handle Vertex_handle; + typedef Complex::CVI CVI; Model():complex_(){ @@ -176,16 +176,16 @@ public: private: int min_degree() const{ - int res = std::numeric_limits::max(); + int res = (std::numeric_limits::max)(); for(auto v : complex_.vertex_range()) - res= std::min(res,complex_.degree(v)); + res= (std::min)(res,complex_.degree(v)); return res; } int max_degree() const{ int res = 0; for(auto v : complex_.vertex_range()) - res= std::max(res,complex_.degree(v)); + res= (std::max)(res,complex_.degree(v)); return res; } @@ -216,7 +216,7 @@ public: Clock clock; for(const auto &s : complex_.simplex_range()){ num_simplices++; - dimension = std::max(s.dimension(),dimension); + dimension = (std::max)(s.dimension(),dimension); if(s.dimension()%2==0) euler+=1; else @@ -245,7 +245,7 @@ public: int dimension = 0; for(const auto &s : complex_.simplex_range()){ num_simplices++; - dimension = std::max(s.dimension(),dimension); + dimension = (std::max)(s.dimension(),dimension); if(s.dimension()%2==0) euler+=1; else diff --git a/src/GudhUI/utils/Persistence_compute.h b/src/GudhUI/utils/Persistence_compute.h index f7974287..7b310e5c 100644 --- a/src/GudhUI/utils/Persistence_compute.h +++ b/src/GudhUI/utils/Persistence_compute.h @@ -33,7 +33,6 @@ #include "gudhi/Simplex_tree.h" #include "gudhi/distance_functions.h" #include "gudhi/Persistent_cohomology.h" -#include "gudhi/Persistent_cohomology/Multi_field.h" struct Persistence_params{ @@ -63,7 +62,7 @@ public: * parameters : * unsigned dim_max * double threshold - * int p for Z_p + * int p for coefficient Z_p */ Persistence_compute(SkBlComplex& complex,std::ostream& stream,const Persistence_params& params): // -- cgit v1.2.3