Skip to content

Commit

Permalink
CGAL Lab
Browse files Browse the repository at this point in the history
  • Loading branch information
lrineau committed Mar 26, 2024
1 parent 3f434a2 commit 9e6433f
Show file tree
Hide file tree
Showing 559 changed files with 1,551 additions and 1,549 deletions.
4 changes: 2 additions & 2 deletions .github/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/usr/local/bin/cmake --version
FACTOR=$1
set -ex
cd Polyhedron/demo
/usr/local/bin/cmake -S Polyhedron -B build -DCGAL_DIR=$2
cd Lab/demo
/usr/local/bin/cmake -S Lab -B build -DCGAL_DIR=$2
LIST_OF_PLUGINS=$(/usr/local/bin/cmake --build build -t help | egrep 'plugin$' |& cut -d\ -f2)
PLUGINS_ARRAY=(${LIST_OF_PLUGINS});
NB_OF_PLUGINS=${#PLUGINS_ARRAY[@]}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Polyhedron Demo
name: Compile CGAL Lab

on: [push, pull_request,workflow_dispatch]

Expand Down
6 changes: 3 additions & 3 deletions Installation/cmake/modules/list_of_whitelisted_headers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ set(list_of_whitelisted_headers_txt [=[
CGAL/Three/Edge_container.h
CGAL/Three/exceptions.h
CGAL/Three/Point_container.h
CGAL/Three/Polyhedron_demo_io_plugin_interface.h
CGAL/Three/Polyhedron_demo_plugin_helper.h
CGAL/Three/Polyhedron_demo_plugin_interface.h
CGAL/Three/CGAL_Lab_io_plugin_interface.h
CGAL/Three/CGAL_Lab_plugin_helper.h
CGAL/Three/CGAL_Lab_plugin_interface.h
CGAL/Three/Primitive_container.h
CGAL/Three/Scene_draw_interface.h
CGAL/Three/Scene_group_item.h
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "config.h"
#include "Plugins/Mesh_3/config_mesh_3.h"
// as otherwise it gets set via inclusion of Polyhedron_3.h
// as otherwise it gets set via inclusion of cgallab.h
#include <CGAL/Default.h>

#include "SMesh_type.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Polyhedron_demo.h"
#include "cgallab.h"
#include "MainWindow.h"
#include <QMessageBox>
#include <CGAL/Qt/resources.h>
Expand All @@ -11,12 +11,12 @@
#include <clocale>


struct Polyhedron_demo_impl {
struct CGAL_Lab_impl {
bool catch_exceptions;
QScopedPointer<MainWindow> mainWindow;

Polyhedron_demo_impl() : catch_exceptions(true) {}
}; // end struct Polyhedron_demo_impl
CGAL_Lab_impl() : catch_exceptions(true) {}
}; // end struct CGAL_Lab_impl

int& code_to_call_before_creation_of_QCoreApplication(int& i) {
QSurfaceFormat fmt;
Expand All @@ -35,7 +35,7 @@ int& code_to_call_before_creation_of_QCoreApplication(int& i) {
return i;
}

Polyhedron_demo::Polyhedron_demo(int& argc, char **argv,
CGAL_Lab::CGAL_Lab(int& argc, char **argv,
QString application_name,
QString main_window_title,
QStringList input_keywords)
Expand All @@ -45,7 +45,7 @@ Polyhedron_demo::Polyhedron_demo(int& argc, char **argv,
// object.
argv)
, d_ptr_is_initialized(false)
, d_ptr(new Polyhedron_demo_impl)
, d_ptr(new CGAL_Lab_impl)
{
//We set the locale to avoid any trouble with VTK
std::setlocale(LC_ALL, "C");
Expand Down Expand Up @@ -129,7 +129,7 @@ Polyhedron_demo::Polyhedron_demo(int& argc, char **argv,
}
#endif

mainWindow.loadScript(":/cgal/Polyhedron_3/javascript/lib.js");
mainWindow.loadScript(":/cgal/Lab/javascript/lib.js");
QFileInfo autostart_js("autostart.js");
if(!parser.isSet(no_autostart) && autostart_js.exists()) {
mainWindow.loadScript(autostart_js);
Expand All @@ -140,14 +140,14 @@ Polyhedron_demo::Polyhedron_demo(int& argc, char **argv,

}

Polyhedron_demo::~Polyhedron_demo() {}
CGAL_Lab::~CGAL_Lab() {}

void Polyhedron_demo::do_not_catch_exceptions() {
void CGAL_Lab::do_not_catch_exceptions() {
d_ptr->catch_exceptions = false;
setProperty("no-try-catch", true);
}

bool Polyhedron_demo::notify(QObject* receiver, QEvent* event)
bool CGAL_Lab::notify(QObject* receiver, QEvent* event)
{
if(!d_ptr_is_initialized || !d_ptr->catch_exceptions)
return QApplication::notify(receiver, event);
Expand All @@ -171,7 +171,7 @@ bool Polyhedron_demo::notify(QObject* receiver, QEvent* event)
return false;
}

int Polyhedron_demo::try_exec()
int CGAL_Lab::try_exec()
{
// A Qt Script may have closed the main window.
// The following loop launch app.exec() only if the main window is visible.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef POLYHEDRON_DEMO_DETECT_SHARP_EDGES_H
#define POLYHEDRON_DEMO_DETECT_SHARP_EDGES_H
#ifndef LAB_DEMO_DETECT_SHARP_EDGES_H
#define LAB_DEMO_DETECT_SHARP_EDGES_H

#include <CGAL/Polygon_mesh_processing/detect_features.h>

Expand Down Expand Up @@ -29,4 +29,4 @@ namespace CGAL

}//end namespace CGAL

#endif //POLYHEDRON_DEMO_DETECT_SHARP_EDGES_H
#endif //LAB_DEMO_DETECT_SHARP_EDGES_H
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1...3.23)
project(Polyhedron_Demo)
project(CGAL_Lab)
include(FeatureSummary)


Expand Down Expand Up @@ -32,9 +32,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
include_directories(BEFORE ./ ./include ./CGAL_demo)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}")

option(POLYHEDRON_QTSCRIPT_DEBUGGER
"Activate the use of Qt Script Debugger in Polyhedron_3 demo" OFF)

# Find CGAL
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6 ImageIO)
set_package_properties(CGAL PROPERTIES TYPE REQUIRED)
Expand Down Expand Up @@ -73,8 +70,8 @@ set_package_properties(
PURPOSE "Required for the partition plugin.")

# Activate concurrency?
option(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY "Enable concurrency" ON)
if(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY)
option(LAB_DEMO_ACTIVATE_CONCURRENCY "Enable concurrency" ON)
if(LAB_DEMO_ACTIVATE_CONCURRENCY)
find_package(TBB QUIET)
include(CGAL_TBB_support)
if(NOT TARGET CGAL::TBB_support)
Expand Down Expand Up @@ -130,9 +127,9 @@ if(CGAL_Qt6_FOUND AND Qt6_FOUND)
qt6_generate_moc("File_loader_dialog.h"
"${CMAKE_CURRENT_BINARY_DIR}/File_loader_dialog_moc.cpp")

include(${CMAKE_CURRENT_SOURCE_DIR}/polyhedron_demo_macros.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cgallab_macros.cmake)

qt6_add_resources(CGAL_Qt6_RESOURCE_FILES Polyhedron_3.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES cgallab.qrc)
find_path(
CGAL_THREE_HEADERS_PATH
NAMES CGAL/Three/Scene_item.h
Expand Down Expand Up @@ -162,8 +159,8 @@ if(CGAL_Qt6_FOUND AND Qt6_FOUND)

# put plugins (which are shared libraries) at the same location as
# executable files
set(CGAL_POLYHEDRON_DEMO_PLUGINS_DIR "${RUNTIME_OUTPUT_PATH}")
set(LIBRARY_OUTPUT_PATH "${CGAL_POLYHEDRON_DEMO_PLUGINS_DIR}")
set(CGAL_LAB_DEMO_PLUGINS_DIR "${RUNTIME_OUTPUT_PATH}")
set(LIBRARY_OUTPUT_PATH "${CGAL_LAB_DEMO_PLUGINS_DIR}")

add_library(
demo_framework SHARED
Expand All @@ -187,7 +184,7 @@ if(CGAL_Qt6_FOUND AND Qt6_FOUND)
Scene_item_rendering_helper.cpp
Scene_item_rendering_helper_moc.cpp
Primitive_container.cpp
Polyhedron_demo_plugin_helper.cpp
cgallab_plugin_helper.cpp
CGAL_double_edit.cpp)
target_link_libraries(demo_framework PUBLIC Qt6::OpenGLWidgets Qt6::Widgets Qt6::Gui Qt6::Qml
CGAL::CGAL_Qt6)
Expand Down Expand Up @@ -350,9 +347,9 @@ if(CGAL_Qt6_FOUND AND Qt6_FOUND)

add_definitions(-DUSE_FORWARD_DECL)
add_library(
polyhedron_demo SHARED
cgal_lab SHARED
MainWindow.cpp
Polyhedron_demo.cpp
CGAL_Lab.cpp
File_loader_dialog_moc.cpp
Use_ssh.cpp
${CGAL_Qt6_RESOURCE_FILES}
Expand All @@ -363,30 +360,30 @@ if(CGAL_Qt6_FOUND AND Qt6_FOUND)
${statisticsUI_FILES}
${SubViewerUI_files})
target_link_libraries(
polyhedron_demo PUBLIC demo_framework point_dialog Qt6::Gui Qt6::OpenGLWidgets
cgal_lab PUBLIC demo_framework point_dialog Qt6::Gui Qt6::OpenGLWidgets
Qt6::Widgets )
if(LIBSSH_FOUND)
target_compile_definitions(polyhedron_demo PRIVATE -DCGAL_USE_SSH)
target_link_libraries(polyhedron_demo PRIVATE ${LIBSSH_LIBRARIES})
target_include_directories(polyhedron_demo SYSTEM PRIVATE ${LIBSSH_INCLUDE_DIR})
target_compile_definitions(cgal_lab PRIVATE -DCGAL_USE_SSH)
target_link_libraries(cgal_lab PRIVATE ${LIBSSH_LIBRARIES})
target_include_directories(cgal_lab SYSTEM PRIVATE ${LIBSSH_INCLUDE_DIR})
endif() #libssh
if(TARGET Qt6::WebSockets)
target_compile_definitions(polyhedron_demo PRIVATE -DCGAL_USE_WEBSOCKETS)
target_compile_definitions(cgal_lab PRIVATE -DCGAL_USE_WEBSOCKETS)
target_compile_definitions(demo_framework PRIVATE -DCGAL_USE_WEBSOCKETS)
target_link_libraries(polyhedron_demo PRIVATE Qt6::WebSockets)
target_link_libraries(cgal_lab PRIVATE Qt6::WebSockets)
endif()
cgal_add_compilation_test(polyhedron_demo)
add_executable(Polyhedron_3 Polyhedron_3.cpp)
target_link_libraries(Polyhedron_3 PRIVATE polyhedron_demo)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Polyhedron_3)
cgal_add_compilation_test(Polyhedron_3)
cgal_add_compilation_test(cgal_lab)
add_executable(cgallab cgallab.cpp)
target_link_libraries(cgallab PRIVATE cgal_lab)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS cgallab)
cgal_add_compilation_test(cgallab)

target_link_libraries(Polyhedron_3 PRIVATE demo_framework)
target_link_libraries(cgallab PRIVATE demo_framework)

# Link with CGAL
target_link_libraries(Polyhedron_3 PUBLIC CGAL::CGAL_Qt6)
target_link_libraries(cgallab PUBLIC CGAL::CGAL_Qt6)

add_to_cached_list(CGAL_EXECUTABLE_TARGETS Polyhedron_3)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS cgallab)

###########
# PLUGINS #
Expand All @@ -407,17 +404,17 @@ if(CGAL_Qt6_FOUND AND Qt6_FOUND)
#
add_executable(CGAL_Mesh_3 Mesh_3.cpp)
add_dependencies(CGAL_Mesh_3 Mesh_3)
target_link_libraries(CGAL_Mesh_3 PRIVATE polyhedron_demo)
target_link_libraries(CGAL_Mesh_3 PRIVATE cgal_lab)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_Mesh_3)

add_executable(CGAL_Classification Classification.cpp)
add_dependencies(CGAL_Classification Classification)
target_link_libraries(CGAL_Classification PRIVATE polyhedron_demo)
target_link_libraries(CGAL_Classification PRIVATE cgal_lab)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_Classification)

add_executable(CGAL_PMP PMP.cpp)
add_dependencies(CGAL_PMP PMP)
target_link_libraries(CGAL_PMP PRIVATE polyhedron_demo)
target_link_libraries(CGAL_PMP PRIVATE cgal_lab)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_PMP)

#WS Server
Expand All @@ -432,14 +429,14 @@ if(CGAL_Qt6_FOUND AND Qt6_FOUND)
if(TARGET CGAL_Qt6)
export(
TARGETS CGAL CGAL_Qt6 CGAL_ImageIO
FILE polyhedron_demo_targets.cmake
NAMESPACE Polyhedron_)
FILE cgal_lab_targets.cmake
NAMESPACE Lab_)
endif()
if(TARGET CGAL_Qt6_moc_and_resources)
export(
TARGETS CGAL_Qt6_moc_and_resources
NAMESPACE Polyhedron_ APPEND
FILE polyhedron_demo_targets.cmake)
NAMESPACE Lab_ APPEND
FILE cgal_lab_targets.cmake)
endif()
export(
TARGETS demo_framework
Expand All @@ -452,26 +449,26 @@ if(CGAL_Qt6_FOUND AND Qt6_FOUND)
scene_selection_item
scene_item_decorator
scene_k_ring_selection
NAMESPACE Polyhedron_ APPEND
FILE polyhedron_demo_targets.cmake)
NAMESPACE Lab_ APPEND
FILE cgal_lab_targets.cmake)

configure_file(CGAL_polyhedron_demoConfig.cmake.in
CGAL_polyhedron_demoConfig.cmake)
configure_file(cgallabConfig.cmake.in
cgallabConfig.cmake)
#TO DO script the activation of all the plugins.

else(CGAL_Qt6_FOUND AND Qt6_FOUND)

set(POLYHEDRON_MISSING_DEPS "")
set(Lab_MISSING_DEPS "")

if(NOT CGAL_Qt6_FOUND)
set(POLYHEDRON_MISSING_DEPS "the CGAL Qt6 library, ${POLYHEDRON_MISSING_DEPS}")
set(Lab_MISSING_DEPS "the CGAL Qt6 library, ${Lab_MISSING_DEPS}")
endif()

if(NOT Qt6_FOUND)
set(POLYHEDRON_MISSING_DEPS "Qt6, ${POLYHEDRON_MISSING_DEPS}")
set(Lab_MISSING_DEPS "Qt6, ${Lab_MISSING_DEPS}")
endif()

message("NOTICE: XX This demo requires ${POLYHEDRON_MISSING_DEPS} and will not be compiled.")
message("NOTICE: XX This demo requires ${Lab_MISSING_DEPS} and will not be compiled.")

endif(CGAL_Qt6_FOUND AND Qt6_FOUND)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Polyhedron_demo.h"
#include "CGAL_Lab.h"
#include <clocale>
#include <CGAL/Qt/resources.h>
#include <QSurfaceFormat>
Expand All @@ -10,7 +10,7 @@
*/
int main(int argc, char **argv)
{
Polyhedron_demo app(argc, argv,
CGAL_Lab app(argc, argv,
"Classification demo",
"CGAL Classification Demo",
QStringList() << "Classification");
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9e6433f

Please sign in to comment.