diff options
Diffstat (limited to 'src/GudhUI')
-rw-r--r-- | src/GudhUI/CMakeLists.txt | 67 | ||||
-rw-r--r-- | src/GudhUI/gui/MainWindow.h | 3 | ||||
-rw-r--r-- | src/GudhUI/gui/Menu_edge_contraction.h | 5 | ||||
-rw-r--r-- | src/GudhUI/gui/Menu_k_nearest_neighbors.h | 2 | ||||
-rw-r--r-- | src/GudhUI/gui/Menu_persistence.h | 2 | ||||
-rw-r--r-- | src/GudhUI/gui/Menu_uniform_neighbors.h | 2 | ||||
-rw-r--r-- | src/GudhUI/utils/Persistence_compute.h | 17 | ||||
-rw-r--r-- | src/GudhUI/view/Viewer.h | 3 | ||||
-rw-r--r-- | src/GudhUI/view/Viewer_instructor.h | 3 |
9 files changed, 44 insertions, 60 deletions
diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt index a43294ea..d3a52b60 100644 --- a/src/GudhUI/CMakeLists.txt +++ b/src/GudhUI/CMakeLists.txt @@ -1,46 +1,40 @@ cmake_minimum_required(VERSION 2.8) project(GudhUI) -find_package(Qt4) +find_package(CGAL COMPONENTS Qt5) +find_package(Qt5 COMPONENTS Widgets Xml OpenGL) find_package(QGLViewer) find_package(OpenGL) -if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND ) - set( QT_USE_QTXML TRUE ) - set( QT_USE_QTMAIN TRUE ) - set( QT_USE_QTSCRIPT TRUE ) - set( QT_USE_QTOPENGL TRUE ) - SET(Boost_USE_STATIC_LIBS ON) - SET(Boost_USE_MULTITHREAD OFF) - include(${QT_USE_FILE}) +if (NOT CGAL_FOUND) + message(ERROR " GudhUI requires CGAL and will not be compiled.") +endif() + +if (NOT Qt5_FOUND) + message(ERROR " GudhUI requires Qt5 and will not be compiled.") +endif() + +if (NOT OPENGL_FOUND) + message(ERROR " GudhUI requires OpenGL and will not be compiled.") +endif() + +if (NOT QGLVIEWER_FOUND) + message(ERROR " GudhUI requires QGLViewer and will not be compiled.") +endif() + + +if ( CGAL_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND ) + + set(CMAKE_AUTOMOC ON) + set(CMAKE_AUTOUIC ON) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + + SET(Boost_USE_STATIC_LIBS ON) + SET(Boost_USE_MULTITHREAD OFF) include_directories (${QGLVIEWER_INCLUDE_DIR}) - include_directories(.) - # qt : ui file, created wih Qt Designer ############### - set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gui") - qt4_wrap_ui( uis - gui/main_window.ui - gui/MenuEdgeContraction.ui - gui/KNearestNeighborsMenu.ui - gui/UniformNeighborsMenu.ui - gui/PersistenceMenu.ui - ) - - set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gui") - qt4_automoc( - gui/MainWindow.cpp - gui/Menu_k_nearest_neighbors.cpp - gui/Menu_uniform_neighbors.cpp - gui/Menu_edge_contraction.cpp - gui/Menu_persistence.cpp - ) - - set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/view") - qt4_automoc(view/Viewer_instructor.cpp - view/Viewer.cpp - ) ##################################################################### add_executable ( GudhUI @@ -52,10 +46,9 @@ if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND ) gui/Menu_persistence.cpp view/Viewer_instructor.cpp view/Viewer.cpp - ${uis} ) - - target_link_libraries( GudhUI ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ) + target_link_libraries( GudhUI Qt5::Widgets Qt5::Xml Qt5::OpenGL ) + target_link_libraries( GudhUI ${QGLVIEWER_LIBRARIES} ) target_link_libraries( GudhUI ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) if (TBB_FOUND) target_link_libraries( GudhUI ${TBB_LIBRARIES}) @@ -64,5 +57,5 @@ endif() ############################################################################### else() - message(STATUS "NOTICE: GudhUI requires CGAL, the QGLViewer, OpenGL and Qt4, and will not be compiled.") + message(STATUS "NOTICE: GudhUI requires CGAL, the QGLViewer, OpenGL and Qt5, and will not be compiled.") endif() diff --git a/src/GudhUI/gui/MainWindow.h b/src/GudhUI/gui/MainWindow.h index 3fe0d720..15664dcb 100644 --- a/src/GudhUI/gui/MainWindow.h +++ b/src/GudhUI/gui/MainWindow.h @@ -23,9 +23,6 @@ #ifndef GUI_MAINWINDOW_H_ #define GUI_MAINWINDOW_H_ -// Workaround for moc-qt4 not parsing boost headers -#include <CGAL/config.h> - // Workaround https://svn.boost.org/trac/boost/ticket/12534 #include <boost/container/flat_map.hpp> diff --git a/src/GudhUI/gui/Menu_edge_contraction.h b/src/GudhUI/gui/Menu_edge_contraction.h index 08f0bf67..2d5640e8 100644 --- a/src/GudhUI/gui/Menu_edge_contraction.h +++ b/src/GudhUI/gui/Menu_edge_contraction.h @@ -23,11 +23,8 @@ #ifndef GUI_MENU_EDGE_CONTRACTION_H_ #define GUI_MENU_EDGE_CONTRACTION_H_ -// Workaround for moc-qt4 not parsing boost headers -#include <CGAL/config.h> - #include "gui/MainWindow.h" -#include "gui/ui_MenuEdgeContraction.h" +#include "ui_MenuEdgeContraction.h" #include "model/Model.h" diff --git a/src/GudhUI/gui/Menu_k_nearest_neighbors.h b/src/GudhUI/gui/Menu_k_nearest_neighbors.h index 8088b768..77303b67 100644 --- a/src/GudhUI/gui/Menu_k_nearest_neighbors.h +++ b/src/GudhUI/gui/Menu_k_nearest_neighbors.h @@ -24,7 +24,7 @@ #define GUI_MENU_K_NEAREST_NEIGHBORS_H_ #include <QMainWindow> -#include "gui/ui_KNearestNeighborsMenu.h" +#include "ui_KNearestNeighborsMenu.h" class QWidget; diff --git a/src/GudhUI/gui/Menu_persistence.h b/src/GudhUI/gui/Menu_persistence.h index 8c4df158..1a2a2408 100644 --- a/src/GudhUI/gui/Menu_persistence.h +++ b/src/GudhUI/gui/Menu_persistence.h @@ -25,7 +25,7 @@ #define GUI_MENU_PERSISTENCE_H_ #include <QMainWindow> -#include "gui/ui_PersistenceMenu.h" +#include "ui_PersistenceMenu.h" class QWidget; diff --git a/src/GudhUI/gui/Menu_uniform_neighbors.h b/src/GudhUI/gui/Menu_uniform_neighbors.h index 0b6f65fe..61316966 100644 --- a/src/GudhUI/gui/Menu_uniform_neighbors.h +++ b/src/GudhUI/gui/Menu_uniform_neighbors.h @@ -25,7 +25,7 @@ #define GUI_MENU_UNIFORM_NEIGHBORS_H_ #include <QMainWindow> -#include "gui/ui_UniformNeighborsMenu.h" +#include "ui_UniformNeighborsMenu.h" class Menu_uniform_neighbors : public QDialog, public Ui::UniformMenu { Q_OBJECT diff --git a/src/GudhUI/utils/Persistence_compute.h b/src/GudhUI/utils/Persistence_compute.h index 97165490..2dc03c8e 100644 --- a/src/GudhUI/utils/Persistence_compute.h +++ b/src/GudhUI/utils/Persistence_compute.h @@ -29,6 +29,7 @@ #include <gudhi/Simplex_tree.h> #include <gudhi/distance_functions.h> #include <gudhi/Persistent_cohomology.h> +#include <gudhi/Rips_complex.h> #include <vector> @@ -69,21 +70,23 @@ template<typename SkBlComplex> class Persistence_compute { points.emplace_back(std::move(pt_to_add)); } + using Simplex_tree = Gudhi::Simplex_tree<>; + using Filtration_value = Simplex_tree::Filtration_value; + using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>; + using Field_Zp = Gudhi::persistent_cohomology::Field_Zp; + using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>; - Graph_t prox_graph = compute_proximity_graph(points, params.threshold, euclidean_distance<Point_t>); - Gudhi::Simplex_tree<> st; - st.insert_graph(prox_graph); - st.expansion(params.max_dim); + Rips_complex rips_complex(points, params.threshold, Euclidean_distance()); - Gudhi::persistent_cohomology::Persistent_cohomology< Gudhi::Simplex_tree<>, - Gudhi::persistent_cohomology::Field_Zp > pcoh(st); + Simplex_tree st; + rips_complex.create_complex(st, params.max_dim); + Persistent_cohomology pcoh(st); // initializes the coefficient field for homology pcoh.init_coefficients(params.p); // put params.min_pers pcoh.compute_persistent_cohomology(params.min_pers); stream << "persistence: \n"; stream << "p dimension birth death: \n"; - pcoh.output_diagram(stream); } }; diff --git a/src/GudhUI/view/Viewer.h b/src/GudhUI/view/Viewer.h index 319c8e04..797ddc53 100644 --- a/src/GudhUI/view/Viewer.h +++ b/src/GudhUI/view/Viewer.h @@ -24,9 +24,6 @@ #ifndef VIEW_VIEWER_H_ #define VIEW_VIEWER_H_ -// Workaround for moc-qt4 not parsing boost headers -#include <CGAL/config.h> - #include <QGLViewer/qglviewer.h> #include <vector> diff --git a/src/GudhUI/view/Viewer_instructor.h b/src/GudhUI/view/Viewer_instructor.h index 1da28009..05c5c1fc 100644 --- a/src/GudhUI/view/Viewer_instructor.h +++ b/src/GudhUI/view/Viewer_instructor.h @@ -26,9 +26,6 @@ // todo do a viewer instructor that have directely a pointer to a QGLviewer and buffer ot not triangles -// Workaround for moc-qt4 not parsing boost headers -#include <CGAL/config.h> - #include <QFileDialog> #include <QKeyEvent> #include <QGLViewer/camera.h> |