GraphicView demonstrations porting.

This commit is contained in:
Aurélien Vialon 2014-07-09 16:31:29 +02:00
parent f6b77e522a
commit 520e791a99
31 changed files with 664 additions and 179 deletions

View File

@ -211,6 +211,18 @@ MainWindow::on_actionInsertRandomPoints_triggered()
Iso_rectangle_2 isor = convert(rect);
CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((isor.min)(), (isor.max)());
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
100,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -220,6 +232,8 @@ MainWindow::on_actionInsertRandomPoints_triggered()
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -299,9 +313,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Alpha_shape_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();

View File

@ -10,35 +10,59 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
find_package(Qt4)
include_directories (BEFORE ../../include)
include_directories (BEFORE ./include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
include(${QT_USE_FILE})
if ( CGAL_FOUND AND (QT4 OR QT5) )
#--------------------------------
# The "Delaunay" demo: Alpha_shapes_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Alpha_shapes_2.ui )
qt_wrap_ui( DT_UI_FILES Alpha_shapes_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Alpha_shapes_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Alpha_shapes_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( Alpha_shapes_2.cpp Alpha_shapes_2.moc )
qt_generate_moc( Alpha_shapes_2.cpp Alpha_shapes_2.moc )
# The executable itself.
add_executable ( Alpha_shapes_2 Alpha_shapes_2.cpp Alpha_shapes_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -435,6 +435,18 @@ MainWindow::on_actionInsertRandomPoints_triggered()
Iso_rectangle_2 isor = convert(rect);
CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((isor.min)(), (isor.max)());
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
100,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -444,6 +456,8 @@ MainWindow::on_actionInsertRandomPoints_triggered()
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -539,9 +553,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Bounding_volumes demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();

View File

@ -10,37 +10,63 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
find_package(Qt4)
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
include_directories (BEFORE ../../include)
include_directories (BEFORE ./include)
include_directories (BEFORE ../../../Matrix_search/include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
if ( CGAL_FOUND AND (QT4 OR QT5) )
include(${QT_USE_FILE})
#----------------------------------------------
# The "Bounding volumes" demo: Bounding_volumes
#----------------------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Bounding_volumes.ui )
qt_wrap_ui( DT_UI_FILES Bounding_volumes.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Bounding_volumes.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Bounding_volumes.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( "Bounding_volumes.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Bounding_volumes.moc" )
qt_generate_moc( "Bounding_volumes.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Bounding_volumes.moc" )
# The executable itself.
add_executable ( Bounding_volumes Bounding_volumes.cpp Bounding_volumes.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -10,35 +10,58 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
find_package(Qt4)
include_directories (BEFORE ../../include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
include(${QT_USE_FILE})
if ( CGAL_FOUND AND (QT4 OR QT5) )
#--------------------------------
# The demo: Circular_kernel_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Circular_kernel_2.ui )
qt_wrap_ui( DT_UI_FILES Circular_kernel_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Circular_kernel_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Circular_kernel_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( "Circular_kernel_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Circular_kernel_2.moc" )
qt_generate_moc( "Circular_kernel_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Circular_kernel_2.moc" )
# The executable itself.
add_executable ( Circular_kernel_2 Circular_kernel_2.cpp Circular_kernel_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -287,9 +287,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Circular_kernel_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();

View File

@ -10,33 +10,59 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
find_package(Qt4)
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
include_directories (BEFORE ../../include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
if ( CGAL_FOUND AND (QT4 OR QT5) )
include(${QT_USE_FILE})
#--------------------------------
# Demo: Generator_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Generator_2.ui )
qt_wrap_ui( DT_UI_FILES Generator_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Generator_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Generator_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( "Generator_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Generator_2.moc" )
qt_generate_moc( "Generator_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Generator_2.moc" )
# The executable itself.
add_executable ( Generator_2 Generator_2.cpp Generator_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -9,6 +9,7 @@
// Qt headers
#include <QtGui>
#include <QString>
#include <QInputDialog>
#include <QFileDialog>
#include <QGraphicsLineItem>
@ -61,6 +62,18 @@ private:
G pg(radius);
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
100,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -70,6 +83,8 @@ private:
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -281,9 +296,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Generator_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for QT5 version !
Q_INIT_RESOURCE(Generator_2);
MainWindow mainWindow;

View File

@ -9,22 +9,43 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
find_package(Qt4)
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
if(USE_QT5)
include(${QT_USE_FILE})
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
#include(QtChoice) not necessary here.
if ( CGAL_FOUND AND (QT4 OR QT5) )
add_executable ( min min.cpp )

View File

@ -5,6 +5,13 @@
#include <QLineF>
#include <QRectF>
//New for Qt5 version !
#if QT_VERSION >= 0x050000
#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsView>
#endif
int main(int argc, char **argv)
{
QApplication app(argc, argv);

View File

@ -10,36 +10,60 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
find_package(Qt4)
include_directories (BEFORE ../../include)
include_directories (BEFORE ./include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
include(${QT_USE_FILE})
if ( QT4 OR QT5 )
#--------------------------------
# The "L1 Voronoi diagram" demo: L1_voronoi_diagram_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES L1_voronoi_diagram_2.ui )
qt_wrap_ui( DT_UI_FILES L1_voronoi_diagram_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./L1_voronoi_diagram_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./L1_voronoi_diagram_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc )
qt_generate_moc( L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc )
# The executable itself.
add_executable ( L1_voronoi_diagram_2 L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -245,6 +245,18 @@ MainWindow::on_actionInsertRandomPoints_triggered()
Iso_rectangle_2 isor = convert(rect);
CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((isor.min)(), (isor.max)());
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
100,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -254,6 +266,8 @@ MainWindow::on_actionInsertRandomPoints_triggered()
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -385,9 +399,10 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("L1 Voronoi diagram_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();
return app.exec();

View File

@ -10,33 +10,58 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
find_package(Qt4)
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
include_directories (BEFORE ../../include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
if ( QT4 OR QT5 )
include(${QT_USE_FILE})
#--------------------------------
# Demo: Largest_empty_rectangle_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Largest_empty_rectangle_2.ui )
qt_wrap_ui( DT_UI_FILES Largest_empty_rectangle_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Largest_empty_rectangle_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Largest_empty_rectangle_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( Largest_empty_rectangle_2.cpp Largest_empty_rectangle_2.moc )
qt_generate_moc( Largest_empty_rectangle_2.cpp Largest_empty_rectangle_2.moc )
# The executable itself.
add_executable ( Largest_empty_rectangle_2 Largest_empty_rectangle_2.cpp Largest_empty_rectangle_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -8,6 +8,7 @@
#include <QtGui>
#include <QString>
#include <QFileDialog>
#include <QInputDialog>
#include <QGraphicsRectItem>
#include <QGraphicsLineItem>
@ -60,6 +61,18 @@ private:
G pg(radius);
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
100,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -69,6 +82,8 @@ private:
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -275,9 +290,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Largest_empty_rectangle_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
Q_INIT_RESOURCE(Largest_empty_rectangle_2);
MainWindow mainWindow;

View File

@ -8,9 +8,6 @@ if ( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
endif()
find_package(CGAL COMPONENTS Qt4 REQUIRED)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
@ -18,25 +15,53 @@ set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
find_package(Qt4)
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5 REQUIRED)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4 REQUIRED)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
include_directories (BEFORE ../../../include)
include_directories (BEFORE ./include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
include(${QT_USE_FILE})
if ( QT4 OR QT5 )
#--------------------------------
# The "2D Periodic triangulation" demo: Periodic_2_triangulation_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Periodic_2_triangulation_2.ui )
qt_wrap_ui( DT_UI_FILES Periodic_2_triangulation_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( Periodic_2_Delaunay_triangulation_2.cpp Periodic_2_triangulation_2.moc )
qt_generate_moc( Periodic_2_Delaunay_triangulation_2.cpp Periodic_2_triangulation_2.moc )
# find header files for projects that can show them
file(GLOB headers "*.h")
@ -60,6 +85,6 @@ target_link_libraries( Periodic_2_Delaunay_triangulation_2 ${QT_LIBRARIES} )
target_link_libraries( Periodic_2_Delaunay_triangulation_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
else()
message(STATUS "NOTICE: This demo requires CGAL and Qt4, and will not be compiled.")
message(STATUS "NOTICE: This demo requires CGAL and Qt4 or Qt5, and will not be compiled.")
endif()

View File

@ -294,6 +294,18 @@ MainWindow::on_actionInsertRandomPoints_triggered()
CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((triang.domain().min)(),
(triang.domain().max)());
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
250,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -303,6 +315,7 @@ MainWindow::on_actionInsertRandomPoints_triggered()
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -442,9 +455,9 @@ int main(int argc, char **argv)
app.setOrganizationName("Nico Kruithof");
app.setApplicationName("Periodic_2_Delaunay_triangulation_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();

View File

@ -10,37 +10,62 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4 Core GMP MPFR)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
#find_package(Qt4)
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5 Core GMP MPFR)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4 Core GMP MPFR)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
include_directories (BEFORE ../../include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
if ( CGAL_FOUND AND (Qt4 OR QT5) )
if( CGAL_Core_FOUND)
add_definitions(-DCGAL_USE_CORE)
endif()
include(${QT_USE_FILE})
#--------------------------------
# Demo: Polygon_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Polygon_2.ui )
qt_wrap_ui( DT_UI_FILES Polygon_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Polygon_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Polygon_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( Polygon_2.cpp "${CMAKE_CURRENT_BINARY_DIR}/Polygon_2.moc" )
qt_generate_moc( Polygon_2.cpp "${CMAKE_CURRENT_BINARY_DIR}/Polygon_2.moc" )
# add_library( CGAL SHARED IMPORTED )
# SET_PROPERTY(TARGET CGAL PROPERTY IMPORTED_LOCATION ${CGAL_LIBRARY} )

View File

@ -16,6 +16,7 @@
#include <QtGui>
#include <QString>
#include <QFileDialog>
#include <QInputDialog>
#include <QGraphicsLineItem>
// GraphicsView items and event filters (input classes)
@ -570,9 +571,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Polygon_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;
Q_INIT_RESOURCE(Polygon_2);
MainWindow mainWindow;

View File

@ -10,36 +10,59 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4 Core)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5 Core)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4 Core)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
find_package(Qt4)
include_directories (BEFORE ../../include)
include_directories (BEFORE ./include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
include(${QT_USE_FILE})
if ( CGAL_FOUND AND (QT4 OR QT5) )
#--------------------------------
# The "Segment Voronoi" demo: Segment_voronoi_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( CDT_UI_FILES Segment_voronoi_2.ui )
qt_wrap_ui( CDT_UI_FILES Segment_voronoi_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( CDT_RESOURCE_FILES ./Segment_voronoi_2.qrc )
qt_add_resources ( CDT_RESOURCE_FILES ./Segment_voronoi_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( "Segment_voronoi_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Segment_voronoi_2.moc" )
qt_generate_moc( "Segment_voronoi_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Segment_voronoi_2.moc" )
# The executable itself.
add_executable ( Segment_voronoi_2 Segment_voronoi_2.cpp Segment_voronoi_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} )

View File

@ -18,6 +18,11 @@
#include <QDragEnterEvent>
#include <QDropEvent>
#if QT_VERSION >= 0x050000
#include <QMessageBox>
#include <QGraphicsLineItem>
#endif
// GraphicsView items and event filters (input classes)
#include <CGAL/Qt/GraphicsViewPolylineInput.h>
#include <CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h>
@ -375,9 +380,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Segment Voronoi 2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();

View File

@ -10,34 +10,58 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
find_package(Qt4)
include_directories (BEFORE ../../include)
include_directories (BEFORE ../../../Snap_rounding_2/include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
include(${QT_USE_FILE})
if ( CGAL_FOUND AND (QT4 OR QT5) )
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Snap_rounding_2.ui )
qt_wrap_ui( DT_UI_FILES Snap_rounding_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Snap_rounding_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Snap_rounding_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( Snap_rounding_2.cpp Snap_rounding_2.moc )
qt_generate_moc( Snap_rounding_2.cpp Snap_rounding_2.moc )
# The executable itself.
add_executable ( Snap_rounding_2 Snap_rounding_2.cpp Snap_rounding_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -306,9 +306,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Snap_rounding_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
Q_INIT_RESOURCE(Snap_rounding_2);
MainWindow mainWindow;

View File

@ -10,34 +10,59 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
find_package(Qt4)
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
include_directories (BEFORE ../../include)
include_directories (BEFORE ../../../Spatial_searching/include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
if ( CGAL_FOUND AND (QT4 OR QT5))
include(${QT_USE_FILE})
#--------------------------------
# Demo: Spatial_searching_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Spatial_searching_2.ui )
qt_wrap_ui( DT_UI_FILES Spatial_searching_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Spatial_searching_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Spatial_searching_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( Spatial_searching_2.cpp Spatial_searching_2.moc )
qt_generate_moc( Spatial_searching_2.cpp Spatial_searching_2.moc )
# The executable itself.
add_executable ( Spatial_searching_2 Spatial_searching_2.cpp Spatial_searching_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -9,6 +9,7 @@
#include <QtGui>
#include <QString>
#include <QFileDialog>
#include <QInputDialog>
#include <QGraphicsLineItem>
// GraphicsView items and event filters (input classes)
@ -66,6 +67,18 @@ public:
G pg(radius);
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
100,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -75,6 +88,8 @@ public:
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -288,9 +303,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Spatial_searching_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
Q_INIT_RESOURCE(Spatial_searching_2);
MainWindow mainWindow;

View File

@ -10,33 +10,56 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
find_package(Qt4)
include_directories (BEFORE ../../include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
include(${QT_USE_FILE})
if ( CGAL_FOUND AND (QT4 OR QT5) )
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Stream_lines_2.ui )
qt_wrap_ui( DT_UI_FILES Stream_lines_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Stream_lines_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Stream_lines_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( Stream_lines_2.cpp Stream_lines_2.moc )
qt_generate_moc( Stream_lines_2.cpp Stream_lines_2.moc )
# The executable itself.
add_executable ( Stream_lines_2 Stream_lines_2.cpp Stream_lines_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -239,9 +239,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Stream_lines_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
Q_INIT_RESOURCE(Stream_lines_2);
MainWindow mainWindow;

View File

@ -10,17 +10,42 @@ else()
cmake_policy(VERSION 2.6)
endif()
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
#New for Qt5 version !
option (USE_QT5 "Use Qt5 version instead of Qt4" ON)
#find_package(Qt4)
if(USE_QT5)
find_package(CGAL COMPONENTS Qt5)
include(${CGAL_USE_FILE})
find_package(Qt5)
set(CMAKE_AUTOMOC OFF)
else (USE_QT5)
find_package(CGAL COMPONENTS Qt4)
include(${CGAL_USE_FILE})
find_package(Qt4)
if(CGAL_Qt4_FOUND AND QT4_FOUND)
include(${QT_USE_FILE})
message("Qt4 found")
set(QT4 TRUE)
endif()
endif (USE_QT5)
include(QtChoice)
include_directories (BEFORE ../../include)
include_directories (BEFORE ./include)
@ -28,21 +53,20 @@ include_directories (BEFORE ../../../Number_types/include)
include_directories (BEFORE ../../../Triangulation_2/include)
if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
if ( CGAL_FOUND AND (QT4 OR QT5) )
include(${QT_USE_FILE})
#--------------------------------
# The "constrained Delaunay" demo: Constrained_Delaunay_triangulation_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( CDT_UI_FILES Constrained_Delaunay_triangulation_2.ui )
qt_wrap_ui( CDT_UI_FILES Constrained_Delaunay_triangulation_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( CDT_RESOURCE_FILES ./Constrained_Delaunay_triangulation_2.qrc )
qt_add_resources ( CDT_RESOURCE_FILES ./Constrained_Delaunay_triangulation_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( "Constrained_Delaunay_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Constrained_Delaunay_triangulation_2.moc" )
qt_generate_moc( "Constrained_Delaunay_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Constrained_Delaunay_triangulation_2.moc" )
# The executable itself.
add_executable ( Constrained_Delaunay_triangulation_2 Constrained_Delaunay_triangulation_2.cpp Constrained_Delaunay_triangulation_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} )
@ -58,13 +82,13 @@ target_link_libraries( Constrained_Delaunay_triangulation_2 ${CGAL_LIBRARIES} $
# The "Delaunay" demo: Delaunay_triangulation_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Delaunay_triangulation_2.ui )
qt_wrap_ui( DT_UI_FILES Delaunay_triangulation_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Delaunay_triangulation_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Delaunay_triangulation_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( "Delaunay_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Delaunay_triangulation_2.moc" )
qt_generate_moc( "Delaunay_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Delaunay_triangulation_2.moc" )
# The executable itself.
add_executable ( Delaunay_triangulation_2 Delaunay_triangulation_2.cpp Delaunay_triangulation_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )
@ -80,13 +104,13 @@ target_link_libraries( Delaunay_triangulation_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PAR
# The "Regular" demo: Regular_triangulation_2
#--------------------------------
# UI files (Qt Designer files)
qt4_wrap_ui( DT_UI_FILES Regular_triangulation_2.ui )
qt_wrap_ui( DT_UI_FILES Regular_triangulation_2.ui )
# qrc files (resources files, that contain icons, at least)
qt4_add_resources ( DT_RESOURCE_FILES ./Regular_triangulation_2.qrc )
qt_add_resources ( DT_RESOURCE_FILES ./Regular_triangulation_2.qrc )
# use the Qt MOC preprocessor on classes that derives from QObject
qt4_generate_moc( "Regular_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Regular_triangulation_2.moc" )
qt_generate_moc( "Regular_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Regular_triangulation_2.moc" )
# The executable itself.
add_executable ( Regular_triangulation_2 Regular_triangulation_2.cpp Regular_triangulation_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} )

View File

@ -676,6 +676,18 @@ MainWindow::on_actionInsertRandomPoints_triggered()
Iso_rectangle_2 isor = convert(rect);
CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((isor.min)(), (isor.max)());
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
100,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -685,6 +697,7 @@ MainWindow::on_actionInsertRandomPoints_triggered()
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -714,9 +727,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Constrained_Delaunay_triangulation_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES; //New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();

View File

@ -280,6 +280,18 @@ MainWindow::on_actionInsertRandomPoints_triggered()
Iso_rectangle_2 isor = convert(rect);
CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((isor.min)(), (isor.max)());
bool ok = false;
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"),
100,
0,
(std::numeric_limits<int>::max)(),
1,
&ok);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
@ -289,6 +301,7 @@ MainWindow::on_actionInsertRandomPoints_triggered()
(std::numeric_limits<int>::max)(),
1,
&ok);
#endif
if(!ok) {
return;
@ -382,9 +395,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Delaunay_triangulation_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or QT5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();

View File

@ -215,11 +215,20 @@ MainWindow::on_actionInsertRandomPoints_triggered()
QRectF rect = CGAL::Qt::viewportsBbox(&scene);
CGAL::Qt::Converter<K> convert;
Iso_rectangle_2 isor = convert(rect);
CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((isor.min)(), (isor.max)());
CGAL::Random_points_in_iso_rectangle_2<Point_2> pg((isor.min)(), (isor.max)());
#if QT_VERSION >= 0x050000
const int number_of_points =
QInputDialog::getInt(this,
tr("Number of random points"),
tr("Enter number of random points"), 100, 0);
#else
const int number_of_points =
QInputDialog::getInteger(this,
tr("Number of random points"),
tr("Enter number of random points"), 100, 0);
#endif
// wait cursor
QApplication::setOverrideCursor(Qt::WaitCursor);
@ -295,9 +304,9 @@ int main(int argc, char **argv)
app.setOrganizationName("GeometryFactory");
app.setApplicationName("Regular_triangulation_2 demo");
// Import resources from libCGALQt4.
// Import resources from libCGAL (Qt4 or Qt5).
// See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE
CGAL_QT4_INIT_RESOURCES;
CGAL_QT_INIT_RESOURCES;//New for Qt5 version !
MainWindow mainWindow;
mainWindow.show();

View File

@ -329,8 +329,6 @@ Scene_item* cgal_code_mesh_3(const Polyhedron* pMesh,
}
}
#if QT_VERSION >= 0x050000
#include "Polyhedron_demo_mesh_3_plugin_cgal_code.moc"
#else
//#include "Scene_c3t3_item.moc" //Check this one, it's strange moc include.
#endif