From bf1c57bd30486ce1051d63a9e6bbde5ec0444ebb Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 5 Sep 2018 17:55:14 +0200 Subject: [PATCH 01/39] Add basic veiwer for point set. --- .../examples/Point_set_3/CMakeLists.txt | 12 +- .../examples/Point_set_3/draw_point_set_3.cpp | 29 +++++ Point_set_3/include/CGAL/draw_point_set_3.h | 110 ++++++++++++++++++ 3 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 Point_set_3/examples/Point_set_3/draw_point_set_3.cpp create mode 100644 Point_set_3/include/CGAL/draw_point_set_3.h diff --git a/Point_set_3/examples/Point_set_3/CMakeLists.txt b/Point_set_3/examples/Point_set_3/CMakeLists.txt index f80a868d040..e3910cbd4c5 100644 --- a/Point_set_3/examples/Point_set_3/CMakeLists.txt +++ b/Point_set_3/examples/Point_set_3/CMakeLists.txt @@ -7,7 +7,7 @@ project( Point_set_3_Examples ) cmake_minimum_required(VERSION 2.8.11) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) +find_package( CGAL QUIET COMPONENTS Qt5 ) if ( NOT CGAL_FOUND ) @@ -16,6 +16,10 @@ if ( NOT CGAL_FOUND ) endif() +if(CGAL_Qt5_FOUND) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) +endif() + # include helper file include( ${CGAL_USE_FILE} ) @@ -62,5 +66,7 @@ else() create_single_source_cgal_program( "point_set_algo.cpp" ) endif() - - +create_single_source_cgal_program("draw_point_set_3.cpp" ) +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_point_set_3 PUBLIC CGAL::CGAL_Qt5) +endif() diff --git a/Point_set_3/examples/Point_set_3/draw_point_set_3.cpp b/Point_set_3/examples/Point_set_3/draw_point_set_3.cpp new file mode 100644 index 00000000000..3e9cfae71b7 --- /dev/null +++ b/Point_set_3/examples/Point_set_3/draw_point_set_3.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::FT FT; +typedef Kernel::Point_3 Point; +typedef Kernel::Vector_3 Vector; +typedef CGAL::Point_set_3 Point_set; + +int main (int argc, char** argv) +{ + std::ifstream f (argc > 1 ? argv[1] : "data/oni.xyz"); + Point_set point_set; + + // Reading input in XYZ format + if (!f || !CGAL::read_xyz_point_set (f, point_set)) + { + std::cerr<<"Can't read input file " + <<(argc > 1 ? argv[1] : "data/oni.xyz")<< std::endl; + return EXIT_FAILURE; + } + + CGAL::draw(point_set); + + return EXIT_SUCCESS; +} diff --git a/Point_set_3/include/CGAL/draw_point_set_3.h b/Point_set_3/include/CGAL/draw_point_set_3.h new file mode 100644 index 00000000000..9511ee04c78 --- /dev/null +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -0,0 +1,110 @@ +// Copyright (c) 2016 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// +// Author(s) : Guillaume Damiand + +#ifndef CGAL_DRAW_POINT_SET_3_H +#define CGAL_DRAW_POINT_SET_3_H + +#include + +#ifdef CGAL_USE_BASIC_VIEWER + +#include + +namespace CGAL +{ + +// Viewer class for Point_set +template +class SimplePointSetViewerQt : public Basic_viewer_qt +{ + typedef Basic_viewer_qt Base; + typedef typename PointSet::Point_map::value_type Point; + +public: + /// Construct the viewer. + /// @param apointset the point set to view + /// @param title the title of the window + SimplePointSetViewerQt(QWidget* parent, + const PointSet& apointset, const char* title="") : + // First draw: vertices; no-edge, no-face; mono-color; no inverse normal + Base(parent, title, true, false, false, true, false), + pointset(apointset) + { + compute_elements(); + } + +protected: + void compute_vertex(const Point& p) + { + add_point(p); + // We can use add_point(p, c) with c a CGAL::Color to add a colored point + } + + void compute_elements() + { + clear(); + + for (typename PointSet::const_iterator it=pointset.begin(); + it!=pointset.end(); ++it) + { compute_vertex(pointset.point(*it)); } + } + + virtual void keyPressEvent(QKeyEvent *e) + { + // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + Base::keyPressEvent(e); + } + +protected: + const PointSet& pointset; +}; + +template +void draw(const PointSet& apointset, const char* title) +{ +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite=true; +#else + bool cgal_test_suite=false; +#endif + + if (!cgal_test_suite) + { + int argc=1; + const char* argv[2]={"point_set_viewer","\0"}; + QApplication app(argc,const_cast(argv)); + SimplePointSetViewerQt mainwindow(app.activeWindow(), + apointset, + title); + mainwindow.show(); + app.exec(); + } +} + +template +void draw(const PointSet& apointset) +{ draw(apointset, "Basic Point_set Viewer"); } + +} // End namespace CGAL + +#endif // CGAL_USE_BASIC_VIEWER + +#endif // CGAL_DRAW_POINT_SET_3_H From 6a6ea48789a829212a3b38a0bd21b8e1471e5c29 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 5 Sep 2018 18:29:14 +0200 Subject: [PATCH 02/39] Add doc for point set draw. --- Point_set_3/doc/Point_set_3/Point_set_3.txt | 12 ++++++++++++ Point_set_3/doc/Point_set_3/examples.txt | 1 + .../doc/Point_set_3/fig/draw_point_set.png | Bin 0 -> 15164 bytes 3 files changed, 13 insertions(+) create mode 100644 Point_set_3/doc/Point_set_3/fig/draw_point_set.png diff --git a/Point_set_3/doc/Point_set_3/Point_set_3.txt b/Point_set_3/doc/Point_set_3/Point_set_3.txt index 60a5ba36a3b..cd099fc87e9 100644 --- a/Point_set_3/doc/Point_set_3/Point_set_3.txt +++ b/Point_set_3/doc/Point_set_3/Point_set_3.txt @@ -163,6 +163,18 @@ overload provided for `CGAL::Point_set_3`: \cgalExample{Point_set_3/point_set_advanced.cpp} +\subsection Point_set_3_Draw Draw a Point Set + +A 3D point set can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given point set. The function is blocking, that is the program continues as soon as the user closes the window. + +\cgalExample{Point_set_3/draw_point_set_3.cpp} + +This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. + +\cgalFigureBegin{fig_draw_point_set,draw_point_set.png} +Result of the run of the draw_point_set_3 program. A window shows the 3D points and allows to navigate through the 3D scene. +\cgalFigureEnd + \section Point_set_3_History History This package has been created to fill the need for a practical data diff --git a/Point_set_3/doc/Point_set_3/examples.txt b/Point_set_3/doc/Point_set_3/examples.txt index 269700c266a..d8711deceed 100644 --- a/Point_set_3/doc/Point_set_3/examples.txt +++ b/Point_set_3/doc/Point_set_3/examples.txt @@ -5,4 +5,5 @@ \example Point_set_3/point_set_read_xyz.cpp \example Point_set_3/point_set_read_ply.cpp \example Point_set_3/point_set_advanced.cpp +\example Point_set_3/draw_point_set_3.cpp */ diff --git a/Point_set_3/doc/Point_set_3/fig/draw_point_set.png b/Point_set_3/doc/Point_set_3/fig/draw_point_set.png new file mode 100644 index 0000000000000000000000000000000000000000..21cec33e55d4e131022baceb078c9e5f8ef791df GIT binary patch literal 15164 zcmZv@1yodD^fo*&(nBa914<|$0t!RJ05X8mCEX$2HFUR<{^$;A5RmQ`5Rh(=5F}4xv(`_=zl?{Zz4xpQLg=R9Zc=bUrzCnW_*LVPNG5C}vlE%jCz1j1MYfiUH9v4K07 zpQr_aKiD5+CEtSX?*C=C7RCX0@EoMHoIxN0()$Yol$s6&ZsH)N<=^3~;$e{xbKc(B zr~$XAEmbv<;`X+-rgli+D+na+WNL&oHKB8}L|V{EO3N#mu$kh3Ky)DKx1y@<^Sg^~ z=?pFzcL#22o2dTkLF`$^SKnSy;t`-(!u|2y1$R3v-N=cIs2mF^3Ug$KVS1u7E{}er zGBP(Q6@2dm856Y~sf zNy;DpBnWY;MZ8GH0N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wzjj)Kez7v8Q>rVGzpL6I!{Ms;D%u;)e#&UjspVXM-kgUhXLo2(1aHq2iU;T z^F6v1ztg#Z{xik>0|F@e@Kb{JoR!KV5i{}Slvf6-wS7eErn82>2%CdnQI-=7yS>wmg@@Am(o z*Z+|#|2x0_2Wt0CWUCq3Ktmzj*^D5NMcm;|K9Ey@M+i88L+XE+v6B~;49P4%0D;N~ zmctV`C>$|BqiqPbA>D4+p$2e>?mw*7@62KxNC_OnYxMNAWC)wcno3e|dh;{QF^APl^77-EyC@c!QkIa6fBg`f_lGr%$b(~y5XfN%{}oCr}}Z=u5<^aJZo)x?8U8$PyLiLVA@Z5OKV5=9t> zt|&mD`XVGP3SUEXL|{q>vVfq2?Qf6o50yp&?>0_H^shT{LX10MY}gJLhq$J|i8WhK zdXV3qLCGL&P=j#tHr^jAmFe2HOg9XT{D-0_QniwggWyJG+HFwW_4cfkk#{}d0(HE`(0v_0*q-UkRECAwIKOrWE+`SB>veS2 R1cnkM{Z8R+xtL+#{{@wopq>B# literal 0 HcmV?d00001 From 2c8af2ebcc2fb67726211c31bac4343189675ecf Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 6 Sep 2018 18:43:32 +0200 Subject: [PATCH 03/39] Update all draw_XXX functions to use specialized version, allowing to use different draw in a same program. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 41 +++------------- .../include/CGAL/draw_linear_cell_complex.h | 48 +++++++++---------- Point_set_3/include/CGAL/draw_point_set_3.h | 21 ++++---- Polyhedron/include/CGAL/draw_polyhedron.h | 42 ++++++++-------- Surface_mesh/include/CGAL/draw_surface_mesh.h | 36 ++++---------- .../include/CGAL/draw_triangulation_2.h | 40 ++++++---------- .../include/CGAL/draw_triangulation_3.h | 41 ++++++---------- 7 files changed, 96 insertions(+), 173 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 18f76232f41..bccdc935a1e 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -1039,43 +1039,16 @@ private: QOpenGLShaderProgram rendering_program_p_l; }; -} // End namespace CGAL - #else // CGAL_USE_BASIC_VIEWER -namespace CGAL -{ - -template -void draw(const T&, const char*, bool, const ColorFunctor&) -{ - std::cerr<<"Impossible to draw because CGAL_USE_BASIC_VIEWER is not defined." - < -void draw(const T&, const char*, bool) -{ - std::cerr<<"Impossible to draw because CGAL_USE_BASIC_VIEWER is not defined." - < -void draw(const T&, const char*) -{ - std::cerr<<"Impossible to draw because CGAL_USE_BASIC_VIEWER is not defined." - < -void draw(const T&) -{ - std::cerr<<"Impossible to draw because CGAL_USE_BASIC_VIEWER is not defined." - < + void draw(const T& t, const char* ="", bool=false) + { + std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< #include namespace CGAL @@ -198,48 +199,43 @@ protected: const ColorFunctor& m_fcolor; }; -template -void draw(const LCC& alcc, - const char* title, - bool nofill, - const ColorFunctor& fcolor) +// Specialization of draw function. +#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_base \ + + +template < unsigned int d_, unsigned int ambient_dim, + class Traits_, + class Items_, + class Alloc_, + template + class Map, + class Refs, + class Storage_> +void draw(const CGAL_LCC_TYPE& alcc, + const char* title="LCC for CMap Basic Viewer", + bool nofill=false) { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else bool cgal_test_suite=false; #endif - + if (!cgal_test_suite) { int argc=1; const char* argv[2]={"lccviewer","\0"}; QApplication app(argc,const_cast(argv)); - SimpleLCCViewerQt mainwindow(app.activeWindow(), - alcc, - title, - nofill, - fcolor); + DefaultColorFunctorLCC fcolor; + SimpleLCCViewerQt + mainwindow(app.activeWindow(), alcc, title, nofill, fcolor); mainwindow.show(); app.exec(); } } -template -void draw(const LCC& alcc, const char* title, bool nofill) -{ - DefaultColorFunctorLCC c; - draw(alcc, title, nofill, c); -} - -template -void draw(const LCC& alcc, const char* title) -{ draw(alcc, title, false); } - -template -void draw(const LCC& alcc) -{ draw(alcc, "Basic LCC Viewer"); } - +#undef CGAL_LCC_TYPE + } // End namespace CGAL #endif // CGAL_USE_BASIC_VIEWER diff --git a/Point_set_3/include/CGAL/draw_point_set_3.h b/Point_set_3/include/CGAL/draw_point_set_3.h index 9511ee04c78..d6af8f862f2 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -26,6 +26,7 @@ #ifdef CGAL_USE_BASIC_VIEWER +#include #include namespace CGAL @@ -76,33 +77,31 @@ protected: protected: const PointSet& pointset; }; - -template -void draw(const PointSet& apointset, const char* title) + +// Specialization of draw function. +template +void draw(const Point_set_3& apointset, + const char* title="Point_set_3 Basic Viewer") { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else bool cgal_test_suite=false; #endif - + if (!cgal_test_suite) { int argc=1; const char* argv[2]={"point_set_viewer","\0"}; QApplication app(argc,const_cast(argv)); - SimplePointSetViewerQt mainwindow(app.activeWindow(), - apointset, - title); + SimplePointSetViewerQt > mainwindow(app.activeWindow(), + apointset, + title); mainwindow.show(); app.exec(); } } -template -void draw(const PointSet& apointset) -{ draw(apointset, "Basic Point_set Viewer"); } - } // End namespace CGAL #endif // CGAL_USE_BASIC_VIEWER diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index b8464757097..7a1781ced0c 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -26,6 +26,7 @@ #ifdef CGAL_USE_BASIC_VIEWER +#include #include namespace CGAL @@ -193,45 +194,40 @@ protected: bool m_nofaces; const ColorFunctor& m_fcolor; }; - -template -void draw(const Polyhedron& apoly, - const char* title, - bool nofill, - const ColorFunctor& fcolor) -{ + +// Specialization of draw function. +#define CGAL_POLY_TYPE CGAL::Polyhedron_3 \ + + +template + class T_HDS, + class Alloc> +void draw(const CGAL_POLY_TYPE& apoly, + const char* title="Polyhedron Basic Viewer", + bool nofill=false) +{ #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else bool cgal_test_suite=false; #endif - + if (!cgal_test_suite) { int argc=1; const char* argv[2]={"polyhedron_viewer","\0"}; QApplication app(argc,const_cast(argv)); - SimplePolyhedronViewerQt + DefaultColorFunctorPolyhedron fcolor; + SimplePolyhedronViewerQt mainwindow(app.activeWindow(), apoly, title, nofill, fcolor); mainwindow.show(); app.exec(); } } -template -void draw(const Polyhedron& apoly, const char* title, bool nofill) -{ - DefaultColorFunctorPolyhedron c; - draw(apoly, title, nofill, c); -} - -template -void draw(const Polyhedron& apoly, const char* title) -{ draw(apoly, title, false); } - -template -void draw(const Polyhedron& apoly) -{ draw(apoly, "Basic Polyhedron Viewer"); } +#undef CGAL_POLY_TYPE } // End namespace CGAL diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 3e5f602d94c..1710a19c814 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -41,6 +41,7 @@ void draw(const SM& asm); #ifdef CGAL_USE_BASIC_VIEWER +#include #include namespace CGAL @@ -201,48 +202,31 @@ protected: const ColorFunctor& m_fcolor; }; -template -void draw(const SM& amesh, - const char* title, - bool nofill, - const ColorFunctor& fcolor) +// Specialization of draw function. +template +void draw(const Surface_mesh& amesh, + const char* title="Surface_mesh Basic Viewer", + bool nofill=false) { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else bool cgal_test_suite=false; #endif - + if (!cgal_test_suite) { int argc=1; const char* argv[2]={"surface_mesh_viewer","\0"}; QApplication app(argc,const_cast(argv)); - SimpleSurfaceMeshViewerQt mainwindow(app.activeWindow(), - amesh, - title, - nofill, - fcolor); + DefaultColorFunctorSM fcolor; + SimpleSurfaceMeshViewerQt, DefaultColorFunctorSM> + mainwindow(app.activeWindow(), amesh, title, nofill, fcolor); mainwindow.show(); app.exec(); } } -template -void draw(const SM& amesh, const char* title, bool nofill) -{ - DefaultColorFunctorSM c; - draw(amesh, title, nofill, c); -} - -template -void draw(const SM& amesh, const char* title) -{ draw(amesh, title, false); } - -template -void draw(const SM& amesh) -{ draw(amesh, "Basic Surface_mesh Viewer"); } - } // End namespace CGAL #endif // CGAL_USE_BASIC_VIEWER diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index a1cfc460fdb..bc0e6a2a42f 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -26,6 +26,7 @@ #ifdef CGAL_USE_BASIC_VIEWER +#include #include namespace CGAL @@ -135,48 +136,35 @@ protected: bool m_nofaces; const ColorFunctor& m_fcolor; }; + +// Specialization of draw function. +#define CGAL_T2_TYPE CGAL::Triangulation_2 -template -void draw(const T2& at2, - const char* title, - bool nofill, - const ColorFunctor& fcolor) +template +void draw(const CGAL_T2_TYPE& at2, + const char* title="Triangulation_2 Basic Viewer", + bool nofill=false) { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else bool cgal_test_suite=false; #endif - + if (!cgal_test_suite) { int argc=1; const char* argv[2]={"t2_viewer","\0"}; - QApplication app(argc,const_cast(argv)); - SimpleTriangulation2ViewerQt mainwindow(app.activeWindow(), - at2, - title, - nofill, - fcolor); + QApplication app(argc,const_cast(argv)); + DefaultColorFunctorT2 fcolor; + SimpleTriangulation2ViewerQt + mainwindow(app.activeWindow(), at2, title, nofill, fcolor); mainwindow.show(); app.exec(); } } -template -void draw(const T2& at2, const char* title, bool nofill) -{ - DefaultColorFunctorT2 c; - draw(at2, title, nofill, c); -} - -template -void draw(const T2& at2, const char* title) -{ draw(at2, title, false); } - -template -void draw(const T2& at2) -{ draw(at2, "Basic T2 Viewer"); } +#undef CGAL_T2_TYPE } // End namespace CGAL diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 709bd15924f..4294339f2d0 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -26,6 +26,7 @@ #ifdef CGAL_USE_BASIC_VIEWER +#include #include namespace CGAL @@ -141,49 +142,35 @@ protected: bool m_nofaces; const ColorFunctor& m_fcolor; }; - -template -void draw(const T3& at3, - const char* title, - bool nofill, - const ColorFunctor& fcolor) -{ +// Specialization of draw function. +#define CGAL_T3_TYPE CGAL::Triangulation_3 + +template +void draw(const CGAL_T3_TYPE& at3, + const char* title="T3 Basic Viewer", + bool nofill=false) +{ #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else bool cgal_test_suite=false; #endif - + if (!cgal_test_suite) { int argc=1; const char* argv[2]={"t3_viewer","\0"}; QApplication app(argc,const_cast(argv)); - SimpleTriangulation3ViewerQt mainwindow(app.activeWindow(), - at3, - title, - nofill, - fcolor); + DefaultColorFunctorT3 fcolor; + SimpleTriangulation3ViewerQt + mainwindow(app.activeWindow(), at3, title, nofill, fcolor); mainwindow.show(); app.exec(); } } -template -void draw(const T3& at3, const char* title, bool nofill) -{ - DefaultColorFunctorT3 c; - draw(at3, title, nofill, c); -} - -template -void draw(const T3& at3, const char* title) -{ draw(at3, title, false); } - -template -void draw(const T3& at3) -{ draw(at3, "Basic T3 Viewer"); } +#undef CGAL_T3_TYPE } // End namespace CGAL From 71555b18cfea8835c25ab9dd5598e5978496240a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 6 Sep 2018 18:46:39 +0200 Subject: [PATCH 04/39] Update namespace --- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index bccdc935a1e..78376d06bce 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -1039,16 +1039,21 @@ private: QOpenGLShaderProgram rendering_program_p_l; }; +} // End namespace CGAL + #else // CGAL_USE_BASIC_VIEWER +namespace CGAL +{ + template void draw(const T& t, const char* ="", bool=false) { std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Fri, 7 Sep 2018 13:29:38 +0200 Subject: [PATCH 05/39] Add an option to disable viewer when running ctest. --- Installation/cmake/modules/CGAL_add_test.cmake | 7 +++++++ .../include/CGAL/draw_linear_cell_complex.h | 2 +- Point_set_3/include/CGAL/draw_point_set_3.h | 2 +- Polyhedron/include/CGAL/draw_polyhedron.h | 2 +- Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp | 2 +- Surface_mesh/include/CGAL/draw_surface_mesh.h | 4 +++- Triangulation_2/include/CGAL/draw_triangulation_2.h | 2 +- Triangulation_3/include/CGAL/draw_triangulation_3.h | 2 +- 8 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index 79bef011112..157daa6176c 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -91,6 +91,8 @@ function(cgal_add_compilation_test exe_name) APPEND PROPERTY LABELS "${PROJECT_NAME}") endfunction(cgal_add_compilation_test) +option(CGAL_TEST_DRAW_FUNCTIONS "If set, the ctest command will not skip the tests of the draw functions.") + function(cgal_setup_test_properties test_name) if(ARGC GREATER 1) set(exe_name ${ARGV1}) @@ -100,6 +102,11 @@ function(cgal_setup_test_properties test_name) # message(STATUS " working dir: ${CGAL_CURRENT_SOURCE_DIR}") set_property(TEST "${test_name}" PROPERTY WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + if(NOT CGAL_TEST_DRAW_FUNCTIONS) + set_property(TEST "${test_name}" + APPEND PROPERTY ENVIRONMENT CGAL_TEST_SUITE=1) + endif() + if(exe_name) set_property(TEST "${test_name}" APPEND PROPERTY DEPENDS "compilation_of__${exe_name}") diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h index bb00e58a5e4..9a4484577c1 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -218,7 +218,7 @@ void draw(const CGAL_LCC_TYPE& alcc, #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else - bool cgal_test_suite=false; + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif if (!cgal_test_suite) diff --git a/Point_set_3/include/CGAL/draw_point_set_3.h b/Point_set_3/include/CGAL/draw_point_set_3.h index d6af8f862f2..adf3afac861 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -86,7 +86,7 @@ void draw(const Point_set_3& apointset, #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else - bool cgal_test_suite=false; + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif if (!cgal_test_suite) diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 7a1781ced0c..cfb5c497c45 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -211,7 +211,7 @@ void draw(const CGAL_POLY_TYPE& apoly, #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else - bool cgal_test_suite=false; + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif if (!cgal_test_suite) diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp index 4735193c89f..a04a092fc5c 100644 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp @@ -10,7 +10,7 @@ typedef CGAL::Surface_mesh Mesh; int main(int argc, char* argv[]) { Mesh sm1; - std::ifstream in1((argc>1)?argv[1]:"data/triangle.off"); + std::ifstream in1((argc>1)?argv[1]:"data/elephant.off"); in1 >> sm1; CGAL::draw(sm1); diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 1710a19c814..39146d9e95b 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -211,8 +211,10 @@ void draw(const Surface_mesh& amesh, #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; #else - bool cgal_test_suite=false; + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif + + std::cout<<"cgal_test_suite="< Date: Fri, 7 Sep 2018 13:30:44 +0200 Subject: [PATCH 06/39] Add an example for surface mesh that allows to visualize small faces; this example will be used in a tutorial explaining how to define and modify one viewer. --- .../examples/Surface_mesh/CMakeLists.txt | 2 + .../draw_surface_mesh_small_faces.h | 285 ++++++++++++++++++ .../Surface_mesh/sm_draw_small_faces.cpp | 38 +++ 3 files changed, 325 insertions(+) create mode 100644 Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h create mode 100644 Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp diff --git a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt index 6170d1bb2b7..3d0781e990f 100644 --- a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt @@ -41,6 +41,8 @@ if ( CGAL_FOUND ) target_link_libraries(draw_surface_mesh PUBLIC CGAL::CGAL_Qt5) endif() + create_single_source_cgal_program("sm_draw_small_faces.cpp") + else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h new file mode 100644 index 00000000000..9e960be161a --- /dev/null +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h @@ -0,0 +1,285 @@ +// Copyright (c) 2018 GeometryFactory (France) +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// Author(s) : Guillaume Damiand + +#ifndef CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H +#define CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H + +#include + +#ifdef CGAL_USE_BASIC_VIEWER + +#include +#include + +template +class SimpleSurfaceMeshWithSmallFacesViewerQt : public CGAL::Basic_viewer_qt +{ + typedef CGAL::Basic_viewer_qt Base; + typedef typename SM::Point Point; + typedef typename CGAL::Kernel_traits::Kernel Kernel; + typedef typename SM::Vertex_index vertex_descriptor; + typedef typename SM::Face_index face_descriptor; + typedef typename SM::Edge_index edge_descriptor; + typedef typename SM::Halfedge_index halfedge_descriptor; + typedef typename Kernel::FT FT; + +public: + /// Construct the viewer. + /// @param amesh the surface mesh to view + SimpleSurfaceMeshWithSmallFacesViewerQt(QWidget* parent, + SM& amesh) : + // First draw: no vertex; no edge, faces; multi-color; inverse normal + Base(parent, "Surface mesh viewer with small faces", false, false, true, false, false), + sm(amesh), + m_threshold(85), + m_draw_small_faces(true), + m_draw_big_faces(true) + { + // Add custom key description (see keyPressEvent). + setKeyDescription(Qt::Key_I, "Increment threshold for small faces"); + setKeyDescription(Qt::Key_D, "Decrement threshold for small faces"); + setKeyDescription(Qt::Key_S, "Draw small faces only , big faces only, both"); + + if (sm.faces().begin()!=sm.faces().end()) + { + bool exist; + typename SM::template Property_map faces_size; + boost::tie(faces_size, exist)=sm.template property_map("f:size"); + CGAL_assertion(exist); + + m_min_size=faces_size[*(sm.faces().begin())]; + m_max_size=m_min_size; + FT cur_size; + + for (typename SM::Face_range::iterator f=sm.faces().begin(); f!=sm.faces().end(); ++f) + { + cur_size=faces_size[*f]; + if (cur_sizem_max_size) m_max_size=cur_size; + } + } + + compute_elements(); + } + +protected: + void compute_face(face_descriptor fh) + { + /// [Face creation] + bool small=false; + + // Default color of faces + CGAL::Color c(75,160,255); + + // Compare the size of the face with the % m_threshold + bool exist; + typename SM::template Property_map faces_size; + boost::tie(faces_size, exist)=sm.template property_map("f:size"); + CGAL_assertion(exist); + + // It it is smaller, color the face in red. + if (get(faces_size, fh)::null_face()) + { compute_face(*f); } + } + + for (typename SM::Edge_range::iterator e=sm.edges().begin(); + e!=sm.edges().end(); ++e) + { compute_edge(*e); } + + for (typename SM::Vertex_range::iterator v=sm.vertices().begin(); + v!=sm.vertices().end(); ++v) + { compute_vertex(*v); } + } + + // Call: * compute_elements() if the model changed, followed by + // * redraw() if some viewing parameters changed that implies some + // modifications of the buffers + // (eg. type of normal, color/mono) + // * update() just to update the drawing + virtual void keyPressEvent(QKeyEvent *e) + { + /// [Keypress] + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + if ((e->key()==Qt::Key_I) && (modifiers==Qt::NoButton)) + { + if (m_threshold<100) ++m_threshold; + displayMessage(QString("Threshold percent=%1 \%.").arg(m_threshold)); + compute_elements(); + redraw(); + } + else if ((e->key()==Qt::Key_D) && (modifiers==Qt::NoButton)) + { + if (m_threshold>0) --m_threshold; + displayMessage(QString("Threshold percent=%1 \%.").arg(m_threshold)); + compute_elements(); + redraw(); + } + else if ((e->key()==Qt::Key_S) && (modifiers==Qt::NoButton)) + { + QString msg; + if (m_draw_small_faces) + { + if (m_draw_big_faces) + { + m_draw_big_faces=false; + msg=QString("Draw small faces only."); + } + else + { + m_draw_big_faces=true; m_draw_small_faces=false; + msg=QString("Draw big faces only."); + } + } + else + { + assert(m_draw_big_faces); + m_draw_small_faces=true; + msg=QString("Draw small and big faces."); + } + + displayMessage(msg); + compute_elements(); + redraw(); + } + else + { + // Call the base method to process others/classicals key + Base::keyPressEvent(e); + } + /// [Keypress] + } + +protected: + typename Kernel::Vector_3 get_face_normal(halfedge_descriptor he) + { + typename Kernel::Vector_3 normal=CGAL::NULL_VECTOR; + halfedge_descriptor end=he; + unsigned int nb=0; + do + { + CGAL::internal::newell_single_step_3(sm.point(sm.source(he)), + sm.point(sm.target(he)), normal); + ++nb; + he=sm.next(he); + } + while (he!=end); + assert(nb>0); + return (typename Kernel::Construct_scaled_vector_3()(normal, 1.0/nb)); + } + + typename Kernel::Vector_3 get_vertex_normal(halfedge_descriptor he) + { + typename Kernel::Vector_3 normal=CGAL::NULL_VECTOR; + halfedge_descriptor end=he; + do + { + if (!sm.is_border(he)) + { + typename Kernel::Vector_3 n=get_face_normal(he); + normal=typename Kernel::Construct_sum_of_vectors_3()(normal, n); + } + he=sm.next(sm.opposite(he)); + } + while (he!=end); + + if (!typename Kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) + { normal=(typename Kernel::Construct_scaled_vector_3() + (normal, 1.0/CGAL::sqrt(normal.squared_length()))); } + + return normal; + } + +protected: + SM& sm; + unsigned int m_threshold; + FT m_min_size, m_max_size; + bool m_draw_small_faces; + bool m_draw_big_faces; +}; + +template +void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh) +{ +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite=true; +#else + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) + { + int argc=1; + const char* argv[2]={"surface_mesh_viewer","\0"}; + QApplication app(argc,const_cast(argv)); + SimpleSurfaceMeshWithSmallFacesViewerQt> + mainwindow(app.activeWindow(), amesh); + mainwindow.show(); + app.exec(); + } +} + +#endif // CGAL_USE_BASIC_VIEWER + +#endif // CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H diff --git a/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp b/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp new file mode 100644 index 00000000000..3ab87459e1d --- /dev/null +++ b/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include +#include +#include +#include "draw_surface_mesh_small_faces.h" + +typedef CGAL::Simple_cartesian K; +typedef CGAL::Surface_mesh Mesh; +typedef Mesh::Vertex_index vertex_descriptor; +typedef Mesh::Face_index face_descriptor; +typedef K::FT FT; + +int main(int argc, char* argv[]) +{ + Mesh sm; + std::ifstream input((argc>1)?argv[1]:"data/elephant.off"); + input>>sm; + + CGAL::Polygon_mesh_processing::triangulate_faces(sm); + + Mesh::Property_map faces_size; + bool created; + boost::tie(faces_size, created)=sm.add_property_map("f:size",0.); + CGAL_assertion(created); + + BOOST_FOREACH(face_descriptor fd, sm.faces()) + { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } + + draw_surface_mesh_with_small_faces(sm); + + sm.remove_property_map(faces_size); + + return EXIT_SUCCESS; +} + From eb6354425f1e7e67b72bfd6258d858ebaceecade Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 7 Sep 2018 14:23:14 +0200 Subject: [PATCH 07/39] Add basic viewer for polygon. --- Polygon/doc/Polygon/Polygon.txt | 12 ++ Polygon/doc/Polygon/examples.txt | 1 + Polygon/doc/Polygon/fig/draw_polygon.png | Bin 0 -> 12036 bytes Polygon/examples/Polygon/CMakeLists.txt | 10 +- Polygon/examples/Polygon/draw_polygon.cpp | 22 ++++ Polygon/include/CGAL/draw_polygon_2.h | 131 ++++++++++++++++++++++ 6 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 Polygon/doc/Polygon/fig/draw_polygon.png create mode 100644 Polygon/examples/Polygon/draw_polygon.cpp create mode 100644 Polygon/include/CGAL/draw_polygon_2.h diff --git a/Polygon/doc/Polygon/Polygon.txt b/Polygon/doc/Polygon/Polygon.txt index 44e90d92af8..a268bfac755 100644 --- a/Polygon/doc/Polygon/Polygon.txt +++ b/Polygon/doc/Polygon/Polygon.txt @@ -70,6 +70,18 @@ and 3D Linear Geometric %Kernel. \cgalExample{Polygon/projected_polygon.cpp} +\subsection subsecPolygonDraw Draw a Polygon + +A polygon can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given polygon. The function is blocking, that is the program continues as soon as the user closes the window. + +\cgalExample{Polygon/draw_polygon.cpp} + +This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. + +\cgalFigureBegin{fig_draw_polygon,draw_polygon.png} +Result of the run of the draw_polygon program. A window shows the polygon and allows to navigate through the scene. +\cgalFigureEnd + */ \section secPolygonWithHole Polygons with Holes diff --git a/Polygon/doc/Polygon/examples.txt b/Polygon/doc/Polygon/examples.txt index 57e9d79494f..9c85508b860 100644 --- a/Polygon/doc/Polygon/examples.txt +++ b/Polygon/doc/Polygon/examples.txt @@ -3,4 +3,5 @@ \example Polygon/polygon_algorithms.cpp \example Polygon/Polygon.cpp \example Polygon/projected_polygon.cpp +\example Polygon/draw_polygon.cpp */ diff --git a/Polygon/doc/Polygon/fig/draw_polygon.png b/Polygon/doc/Polygon/fig/draw_polygon.png new file mode 100644 index 0000000000000000000000000000000000000000..6da8e0ae0c97f9143313dbc78fa8a692ab274f9f GIT binary patch literal 12036 zcmd6NXH=72v}P0)L9u{z1e6+zG$~S5YN*m{M0)SN1h9aL2oic%2ql!zI|M!vF!YXq zfPjF6CV_zTdBcY~Yu5d7XV#sW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H%#z+H=gdYVao19=#p%W9vs>I9Oh=HXU^${rL0e7JcjYDa6p;Mt41d>Yap!6d4Iy%;1^r` z5m_bPj`Fe~+=nS|1$fj#>)^o1f?VVhhmvn09j~U)04?I%>I#CkIWO)5pZA62I`+*G z!}q**$zB6@-jXKZrBunVOO*AvFo0;ETRChwqGMHM1!sPXz;_e@pHYu{1^iFf`L%7=`(?hv>{qk3;TBFh&mD)BunU6S?5Gvh8uBIZ=G+WIqBHpM0(MY zvt|1Ww0(ACh-U_YzVI=$(|QNMJ8n9D)p{4J-Yaw5AlXYVwu_ee-mt!pgPFD^K8=dw zfXGUp1%>q6)dZ*N2mN}7Qh7%+I^vz2>AZTB6H;VmZV0!)ms|2>}yDd zC@~=A_H0wyU99|w5LD)B0e)?ZC@AlUaw^+PeSwj{?f<>vyi|_`>dmxZ)%@;col7wt z_ra6X_hX0r?`P|ZWN&8Ej7>1#k^?RW6=$tnJ|af)Q)hajYW8yOKB+Y4YBH;&g?I2H zsaWKI`@>7;Se@{~JKvQY8o+my`8`09yN=;+v5T0f&56;JLvKNKNFB41JrV~i4X=`B91LhOXQr+OkU zS67qK*PaEr+J-?Y)$ZlDVqDAFS)h7&F}C@MSQ?A47my{T;%pk^*HGUYTJnd4SE@xH zZF{vL##bOkoncbykX=Vbzr@%(1yn4RRkzHB$pGPNsu)+dGSS?QUo>`=-OVCw*+Oys znvAUbWn?74Zq)pRG^R04z^|xZi*E3y^996+H_LuqM;NdWo~(4m>x5yJN#bw<$1+~y WZqYMXSQ0P;K@fR$In=`^&;AE~2WL_M literal 0 HcmV?d00001 diff --git a/Polygon/examples/Polygon/CMakeLists.txt b/Polygon/examples/Polygon/CMakeLists.txt index 19bae0815b9..a3e75a199ff 100644 --- a/Polygon/examples/Polygon/CMakeLists.txt +++ b/Polygon/examples/Polygon/CMakeLists.txt @@ -6,7 +6,11 @@ project( Polygon_Examples ) cmake_minimum_required(VERSION 2.8.10) -find_package(CGAL QUIET) +find_package(CGAL QUIET COMPONENTS Qt5) + +if(CGAL_Qt5_FOUND) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) +endif() if ( CGAL_FOUND ) @@ -22,6 +26,10 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "${cppfile}" ) endforeach() + if(CGAL_Qt5_FOUND) + target_link_libraries(draw_polygon PUBLIC CGAL::CGAL_Qt5) + endif() + else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Polygon/examples/Polygon/draw_polygon.cpp b/Polygon/examples/Polygon/draw_polygon.cpp new file mode 100644 index 00000000000..072e41387e3 --- /dev/null +++ b/Polygon/examples/Polygon/draw_polygon.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Polygon_2 Polygon_2; +typedef CGAL::Point_2 Point; + +int main() +{ + // create a polygon and put some points in it + Polygon_2 p; + p.push_back(Point(0,0)); + p.push_back(Point(4,0)); + p.push_back(Point(4,4)); + p.push_back(Point(2,2)); + p.push_back(Point(0,4)); + + CGAL::draw(p); + + return EXIT_SUCCESS; +} diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h new file mode 100644 index 00000000000..0088deefd58 --- /dev/null +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -0,0 +1,131 @@ +// Copyright (c) 1997 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Guillaume Damiand + +#ifndef CGAL_DRAW_POLYGON_2_H +#define CGAL_DRAW_POLYGON_2_H + +#include + +#ifdef CGAL_USE_BASIC_VIEWER + +#include +#include + +namespace CGAL +{ + +// Viewer class for Polygon_2 +template +class SimplePolygon2ViewerQt : public Basic_viewer_qt +{ + typedef Basic_viewer_qt Base; + typedef typename P2::Point_2 Point; + +public: + /// Construct the viewer. + /// @param ap2 the polygon to view + /// @param title the title of the window + SimplePolygon2ViewerQt(QWidget* parent, const P2& ap2, + const char* title="Basic Polygon_2 Viewer") : + // First draw: vertices; edges, faces; multi-color; no inverse normal + Base(parent, title, true, true, true, false, false), + p2(ap2) + { + compute_elements(); + } + +protected: + void compute_elements() + { + clear(); + + if (p2.is_empty()) return; + + Point prev=p2.vertex(p2.size()-1); + + CGAL::Color c(75,160,255); + face_begin(c); + + for (typename P2::Vertex_const_iterator i=p2.vertices_begin(); + i!=p2.vertices_end(); ++i) + { + add_point(*i); // Add vertex + add_segment(prev, *i); // Add segment with previous point + add_point_in_face(*i); // Add point in face + prev=*i; + } + + face_end(); + } + + virtual void keyPressEvent(QKeyEvent *e) + { + // Test key pressed: + // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + // if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ... } + + // Call: * compute_elements() if the model changed, followed by + // * redraw() if some viewing parameters changed that implies some + // modifications of the buffers + // (eg. type of normal, color/mono) + // * update() just to update the drawing + + // Call the base method to process others/classicals key + Base::keyPressEvent(e); + } + +protected: + const P2& p2; +}; + +// Specialization of draw function. +template +void draw(const CGAL::Polygon_2& ap2, + const char* title="Polygon_2 Basic Viewer", + bool nofill=false) +{ +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite=true; +#else + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) + { + int argc=1; + const char* argv[2]={"t2_viewer","\0"}; + QApplication app(argc,const_cast(argv)); + SimplePolygon2ViewerQt > + mainwindow(app.activeWindow(), ap2, title); + mainwindow.show(); + app.exec(); + } +} + +} // End namespace CGAL + +#endif // CGAL_USE_BASIC_VIEWER + +#endif // CGAL_DRAW_POLYGON_2_H From fc6e3c6a5a81f81b84d94616c930fdce158fd9db Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 7 Sep 2018 19:19:40 +0200 Subject: [PATCH 08/39] Improve the face end for non convex face to allow to draw faces with holes. --- GraphicsView/include/CGAL/Buffer_for_vao.h | 33 +++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index b8ca1f752bb..0ff36cc96cd 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include namespace CGAL { @@ -606,8 +606,23 @@ protected: { P_traits cdt_traits(normal); CDT cdt(cdt_traits); - bool with_vertex_normal=(m_vertex_normals_for_face.size()==m_points_of_face.size()); + Local_point p1, p2; + + // For each point of the face, store the list of adjacent points and the number of time + // the edge is found in the face. For an edge p1, p2, store edge min(p1,p2)->max(p1,p2) + std::map > edges; + for (unsigned int i=0; i m; m[p2]=1; edges[p1]=m; } + else if (edges[p1].count(p2)==0) { edges[p1][p2]=1; } + else { ++(edges[p1][p2]); } + } // (1) We insert all the edges as contraint in the CDT. typename CDT::Vertex_handle previous=NULL, first=NULL; @@ -626,12 +641,22 @@ protected: { vh->info().index=m_indices_of_points_of_face[i]; } if(previous!=NULL && previous!=vh) - { cdt.insert_constraint(previous, vh); } + { + p1=m_points_of_face[i]; p2=m_points_of_face[i-1]; + if (p2 constraint + { cdt.insert_constraint(previous, vh); } + } previous=vh; } if (previous!=NULL && previous!=first) - { cdt.insert_constraint(previous, first); } + { + p1=m_points_of_face[m_points_of_face.size()-1]; p2=m_points_of_face[0]; + if (p2 constraint + { cdt.insert_constraint(previous, first); } + } // (2) We mark all external triangles // (2.1) We initialize is_external and is_process values From a36b79a7780d65d50c034d3a108db2607037c552 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 7 Sep 2018 19:20:13 +0200 Subject: [PATCH 09/39] Viewer for polygon with hole; plus doc. --- Polygon/doc/Polygon/examples.txt | 1 + Polygon/examples/Polygon/CMakeLists.txt | 1 + .../Polygon/draw_polygon_with_holes.cpp | 37 +++++ .../include/CGAL/draw_polygon_with_holes_2.h | 150 ++++++++++++++++++ 4 files changed, 189 insertions(+) create mode 100644 Polygon/examples/Polygon/draw_polygon_with_holes.cpp create mode 100644 Polygon/include/CGAL/draw_polygon_with_holes_2.h diff --git a/Polygon/doc/Polygon/examples.txt b/Polygon/doc/Polygon/examples.txt index 9c85508b860..7d609f531d9 100644 --- a/Polygon/doc/Polygon/examples.txt +++ b/Polygon/doc/Polygon/examples.txt @@ -4,4 +4,5 @@ \example Polygon/Polygon.cpp \example Polygon/projected_polygon.cpp \example Polygon/draw_polygon.cpp +\example Polygon/draw_polygon_with_holes.cpp */ diff --git a/Polygon/examples/Polygon/CMakeLists.txt b/Polygon/examples/Polygon/CMakeLists.txt index a3e75a199ff..147a70b493f 100644 --- a/Polygon/examples/Polygon/CMakeLists.txt +++ b/Polygon/examples/Polygon/CMakeLists.txt @@ -28,6 +28,7 @@ if ( CGAL_FOUND ) if(CGAL_Qt5_FOUND) target_link_libraries(draw_polygon PUBLIC CGAL::CGAL_Qt5) + target_link_libraries(draw_polygon_with_holes PUBLIC CGAL::CGAL_Qt5) endif() else() diff --git a/Polygon/examples/Polygon/draw_polygon_with_holes.cpp b/Polygon/examples/Polygon/draw_polygon_with_holes.cpp new file mode 100644 index 00000000000..b2a551b7f12 --- /dev/null +++ b/Polygon/examples/Polygon/draw_polygon_with_holes.cpp @@ -0,0 +1,37 @@ +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; +typedef CGAL::Polygon_2 Polygon_2; +typedef CGAL::Point_2 Point; + +int main() +{ + // create a polygon with three holes + Polygon_2 outer_polygon; + outer_polygon.push_back(Point(0,0)); outer_polygon.push_back(Point(9,0)); + outer_polygon.push_back(Point(6,8)); outer_polygon.push_back(Point(5,3)); + outer_polygon.push_back(Point(2,8)); outer_polygon.push_back(Point(0,8)); + + std::vector holes(3); + holes[0].push_back(Point(6,2)); holes[0].push_back(Point(7,1)); + holes[0].push_back(Point(7,3)); holes[0].push_back(Point(6,3)); + holes[0].push_back(Point(5,2)); + + holes[1].push_back(Point(2,1)); holes[1].push_back(Point(3,1)); + holes[1].push_back(Point(3,3)); holes[1].push_back(Point(2,2)); + holes[1].push_back(Point(1,2)); + + holes[2].push_back(Point(1,4)); holes[2].push_back(Point(2,4)); + holes[2].push_back(Point(2,5)); holes[2].push_back(Point(3,5)); + holes[2].push_back(Point(3,6)); holes[2].push_back(Point(1,6)); + + Polygon_with_holes_2 p(outer_polygon, holes.begin(), holes.end()); + + // And draw it. + CGAL::draw(p); + + return EXIT_SUCCESS; +} diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h new file mode 100644 index 00000000000..31cc91ee210 --- /dev/null +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -0,0 +1,150 @@ +// Copyright (c) 1997 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Guillaume Damiand + +#ifndef CGAL_DRAW_POLYGON_WITH_HOLES_2_H +#define CGAL_DRAW_POLYGON_WITH_HOLES_2_H + +#include + +#ifdef CGAL_USE_BASIC_VIEWER + +#include +#include + +namespace CGAL +{ + +// Viewer class for Polygon_2 +template +class SimplePolygonWithHoles2ViewerQt : public Basic_viewer_qt +{ + typedef Basic_viewer_qt Base; + typedef typename P2::General_polygon_2::Point_2 Point; + +public: + /// Construct the viewer. + /// @param ap2 the polygon to view + /// @param title the title of the window + SimplePolygonWithHoles2ViewerQt(QWidget* parent, const P2& ap2, + const char* title="Basic Polygon_with_holes_2 Viewer") : + // First draw: vertices; edges, faces; multi-color; no inverse normal + Base(parent, title, true, true, true, false, false), + p2(ap2) + { + compute_elements(); + } + +protected: + void compute_one_loop_elements(const typename P2::General_polygon_2& p, bool hole) + { + if (hole) + { add_point_in_face(p.vertex(p.size()-1)); } + + typename P2::General_polygon_2::Vertex_const_iterator prev; + for (typename P2::General_polygon_2::Vertex_const_iterator i=p.vertices_begin(); + i!=p.vertices_end(); ++i) + { + add_point(*i); // Add vertex + if (i!=p.vertices_begin()) + { add_segment(*prev, *i); } // Add segment with previous point + add_point_in_face(*i); // Add point in face + prev=i; + } + + // Add the last segment between the last point and the first one + add_segment(*prev, *(p.vertices_begin())); + } + + void compute_elements() + { + clear(); + + if (p2.outer_boundary().is_empty()) return; + + Point prev=p2.outer_boundary().vertex(p2.outer_boundary().size()-1); + + CGAL::Color c(75,160,255); + face_begin(c); + + compute_one_loop_elements(p2.outer_boundary(), false); + + for (typename P2::Hole_const_iterator it=p2.holes_begin(); it!=p2.holes_end(); ++it) + { + compute_one_loop_elements(*it, true); + add_point_in_face(p2.outer_boundary().vertex(p2.outer_boundary().size()-1)); + } + + face_end(); + } + + virtual void keyPressEvent(QKeyEvent *e) + { + // Test key pressed: + // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + // if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ... } + + // Call: * compute_elements() if the model changed, followed by + // * redraw() if some viewing parameters changed that implies some + // modifications of the buffers + // (eg. type of normal, color/mono) + // * update() just to update the drawing + + // Call the base method to process others/classicals key + Base::keyPressEvent(e); + } + +protected: + const P2& p2; +}; + +// Specialization of draw function. +template +void draw(const CGAL::Polygon_with_holes_2& ap2, + const char* title="Polygon_with_holes_2 Basic Viewer", + bool nofill=false) +{ +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite=true; +#else + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) + { + int argc=1; + const char* argv[2]={"t2_viewer","\0"}; + QApplication app(argc,const_cast(argv)); + SimplePolygonWithHoles2ViewerQt > + mainwindow(app.activeWindow(), ap2, title); + mainwindow.show(); + app.exec(); + } +} + +} // End namespace CGAL + +#endif // CGAL_USE_BASIC_VIEWER + +#endif // CGAL_DRAW_POLYGON_WITH_HOLES_2_H From bf20b43ea5a13788a50c8a9fe592f79c679d14f2 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 7 Sep 2018 20:19:41 +0200 Subject: [PATCH 10/39] Start to implement 2D mode for viewers; nyf. --- GraphicsView/include/CGAL/Buffer_for_vao.h | 24 ++++++++ .../include/CGAL/Qt/Basic_viewer_qt.h | 56 +++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index 0ff36cc96cd..ed1f819f71d 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -161,6 +161,9 @@ public: m_flat_normal_buffer(flat_normal), m_gouraud_normal_buffer(gouraud_normal), m_bb(bbox), + m_zero_x(true), + m_zero_y(true), + m_zero_z(true), m_face_started(false) {} @@ -171,6 +174,10 @@ public: if (m_index_buffer!=NULL) { m_index_buffer->clear(); } if (m_flat_normal_buffer!=NULL) { m_flat_normal_buffer->clear(); } if (m_gouraud_normal_buffer!=NULL) { m_gouraud_normal_buffer->clear(); } + + m_zero_x=true; + m_zero_y=true; + m_zero_z=true; } bool is_empty() const @@ -198,6 +205,15 @@ public: bool has_gouraud_normal() const { return m_gouraud_normal_buffer!=NULL; } + bool has_zero_x() const + { return m_zero_x; } + + bool has_zero_y() const + { return m_zero_y; } + + bool has_zero_z() const + { return m_zero_z; } + // 1.1) Add a point, without color. Return the index of the added point. template std::size_t add_point(const KPoint& kp) @@ -209,6 +225,10 @@ public: if (m_bb!=NULL) { (*m_bb)=(*m_bb)+p.bbox(); } + + if (m_zero_x && p.x()!=0) { m_zero_x=false; } + if (m_zero_y && p.y()!=0) { m_zero_y=false; } + if (m_zero_z && p.z()!=0) { m_zero_z=false; } return m_pos_buffer->size()-3; } @@ -808,6 +828,10 @@ protected: std::vector* m_gouraud_normal_buffer; CGAL::Bbox_3* m_bb; + + bool m_zero_x; /// True iff all points have x==0 + bool m_zero_y; /// True iff all points have y==0 + bool m_zero_z; /// True iff all points have z==0 // Local variables, used when we started a new face. bool m_face_started; diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 78376d06bce..c8bbd4c128e 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -42,6 +42,8 @@ #include #include +#include +#include #include namespace CGAL @@ -217,6 +219,8 @@ public: for (int i=0; i void add_point(const KPoint& p) { m_buffer_for_mono_points.add_point(p); } @@ -719,6 +756,19 @@ protected: rendering_program_face.release(); } + + if (!is_empty() && (has_zero_x() || has_zero_y() || has_zero_z())) + { + camera()->setType(CGAL::qglviewer::Camera::ORTHOGRAPHIC); + // Camera Constraint: + constraint.setRotationConstraintType(CGAL::qglviewer::AxisPlaneConstraint::FORBIDDEN); + constraint.setTranslationConstraintType(CGAL::qglviewer::AxisPlaneConstraint::FREE); + constraint.setRotationConstraintDirection(CGAL::qglviewer::Vec((has_zero_x()?1:0), + (has_zero_y()?1:0), + (has_zero_z()?1:0))); + + frame->setConstraint(&constraint); + } } virtual void redraw() @@ -763,6 +813,9 @@ protected: compile_shaders(); + frame = new qglviewer::ManipulatedFrame; + setManipulatedFrame(frame); + CGAL::Bbox_3 bb; if (bb==bounding_box()) // Case of "empty" bounding box { @@ -984,6 +1037,9 @@ private: bool m_are_buffers_initialized; CGAL::Bbox_3 m_bounding_box; + + qglviewer::ManipulatedFrame *frame; + CGAL::qglviewer::LocalConstraint constraint; // The following enum gives the indices of different elements of arrays vectors. enum From 243a12be43b23a213c2e3d875ede30f11300a2ad Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 10 Sep 2018 12:20:10 +0200 Subject: [PATCH 11/39] Fix viewer in 2D for 2D data sets. --- GraphicsView/include/CGAL/Buffer_for_vao.h | 10 ++++---- .../include/CGAL/Qt/Basic_viewer_qt.h | 23 +++++++------------ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index ed1f819f71d..32accbf9291 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -183,11 +183,11 @@ public: bool is_empty() const { return - (m_pos_buffer!=NULL && m_pos_buffer->empty()) && - (m_color_buffer!=NULL || m_color_buffer->empty()) && - (m_flat_normal_buffer!=NULL || m_flat_normal_buffer->empty()) && - (m_gouraud_normal_buffer!=NULL || m_gouraud_normal_buffer->empty()) && - (m_index_buffer!=NULL || m_index_buffer->empty()); + (m_pos_buffer==NULL || m_pos_buffer->empty()) && + (m_color_buffer==NULL || m_color_buffer->empty()) && + (m_flat_normal_buffer==NULL || m_flat_normal_buffer->empty()) && + (m_gouraud_normal_buffer==NULL || m_gouraud_normal_buffer->empty()) && + (m_index_buffer==NULL || m_index_buffer->empty()); } bool has_position() const diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index c8bbd4c128e..7ad6f3c9eb9 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -43,7 +43,6 @@ #include #include #include -#include #include namespace CGAL @@ -219,8 +218,6 @@ public: for (int i=0; isetType(CGAL::qglviewer::Camera::ORTHOGRAPHIC); // Camera Constraint: - constraint.setRotationConstraintType(CGAL::qglviewer::AxisPlaneConstraint::FORBIDDEN); + constraint.setRotationConstraintType(CGAL::qglviewer::AxisPlaneConstraint::AXIS); constraint.setTranslationConstraintType(CGAL::qglviewer::AxisPlaneConstraint::FREE); - constraint.setRotationConstraintDirection(CGAL::qglviewer::Vec((has_zero_x()?1:0), - (has_zero_y()?1:0), - (has_zero_z()?1:0))); - - frame->setConstraint(&constraint); + constraint.setRotationConstraintDirection(CGAL::qglviewer::Vec((has_zero_x()?1.:0.), + (has_zero_y()?1.:0.), + (has_zero_z()?1.:0.))); + camera()->frame()->setConstraint(&constraint); } } @@ -812,9 +808,6 @@ protected: glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST); compile_shaders(); - - frame = new qglviewer::ManipulatedFrame; - setManipulatedFrame(frame); CGAL::Bbox_3 bb; if (bb==bounding_box()) // Case of "empty" bounding box @@ -1038,9 +1031,9 @@ private: bool m_are_buffers_initialized; CGAL::Bbox_3 m_bounding_box; - qglviewer::ManipulatedFrame *frame; - CGAL::qglviewer::LocalConstraint constraint; - + // CGAL::qglviewer::LocalConstraint constraint; + CGAL::qglviewer::WorldConstraint constraint; + // The following enum gives the indices of different elements of arrays vectors. enum { From 2273762e7e98717d252d225719b2cb5f15d86a10 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 10 Sep 2018 14:11:36 +0200 Subject: [PATCH 12/39] Remove debug message --- Surface_mesh/include/CGAL/draw_surface_mesh.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 39146d9e95b..ed48b6c4be1 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -214,8 +214,6 @@ void draw(const Surface_mesh& amesh, bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif - std::cout<<"cgal_test_suite="< Date: Wed, 12 Sep 2018 18:22:34 +0200 Subject: [PATCH 13/39] Start viewer for arrangement --- .../include/CGAL/draw_arrangement_2.h | 186 ++++++++++++++++++ .../include/CGAL/draw_polygon_with_holes_2.h | 2 +- 2 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h diff --git a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h new file mode 100644 index 00000000000..d72f5ccee29 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -0,0 +1,186 @@ +// Copyright (c) 2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// +// Author(s) : Guillaume Damiand + +#ifndef CGAL_DRAW_ARRANGEMENT_2_H +#define CGAL_DRAW_ARRANGEMENT_2_H + +#include + +#ifdef CGAL_USE_BASIC_VIEWER + +#include +#include + +namespace CGAL +{ + +// Viewer class for Arr +template +class SimpleArrangementViewerQt : public Basic_viewer_qt +{ + typedef Basic_viewer_qt Base; + typedef typename Arr::Dart_const_handle Dart_const_handle; + typedef typename Arr::Traits Kernel; + typedef typename Kernel::Point Point; + typedef typename Kernel::Vector Vector; + +public: + /// Construct the viewer. + /// @param alcc the lcc to view + /// @param title the title of the window + /// @param anofaces if true, do not draw faces (faces are not computed; this can be + /// usefull for very big object where this time could be long) + SimpleLCCViewerQt(QWidget* parent, + const Arr& a_arr, + const char* title="Basic Arrangement Viewer", + bool anofaces=false) : + // First draw: vertices; edges, faces; multi-color; inverse normal + Base(parent, title, true, true, true, true, true), + arr(a_arr), + m_nofaces(anofaces) + { + compute_elements(); + } + +protected: + void compute_face(Dart_const_handle dh) + { + // We fill only closed faces. + Dart_const_handle cur=dh; + Dart_const_handle min=dh; + do + { + if (!lcc.is_next_exist(cur)) return; // open face=>not filled + if (cur::get_vertex_normal(lcc, cur)); + cur=lcc.next(cur); + } + while(cur!=dh); + + face_end(); + } + + void compute_edge(Dart_const_handle dh) + { + Point p1 = lcc.point(dh); + Dart_const_handle d2 = lcc.other_extremity(dh); + if (d2!=NULL) + { add_segment(p1, lcc.point(d2)); } + } + + void compute_vertex(Dart_const_handle dh) + { add_point(lcc.point(dh)); } + + void compute_elements() + { + clear(); + + typename LCC::size_type markfaces = lcc.get_new_mark(); + typename LCC::size_type markedges = lcc.get_new_mark(); + typename LCC::size_type markvertices = lcc.get_new_mark(); + + for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), + itend=lcc.darts().end(); it!=itend; ++it ) + { + if ( !m_nofaces && !lcc.is_marked(it, markfaces) ) + { + compute_face(it); + CGAL::mark_cell(lcc, it, markfaces); + } + + if ( !lcc.is_marked(it, markedges) ) + { + compute_edge(it); + CGAL::mark_cell(lcc, it, markedges); + } + + if ( !lcc.is_marked(it, markvertices) ) + { + compute_vertex(it); + CGAL::mark_cell(lcc, it, markvertices); + } + } + + lcc.free_mark(markfaces); + lcc.free_mark(markedges); + lcc.free_mark(markvertices); + } + + virtual void keyPressEvent(QKeyEvent *e) + { + // Test key pressed: + // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + // if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ... } + + // Call: * compute_elements() if the model changed, followed by + // * redraw() if some viewing parameters changed that implies some + // modifications of the buffers + // (eg. type of normal, color/mono) + // * update() just to update the drawing + + // Call the base method to process others/classicals key + Base::keyPressEvent(e); + } + +protected: + const Arr& arr; + bool m_nofaces; +}; + +template +void draw(const Arrangement_on_surface_2& a_arr, + const char* title, + bool nofill) +{ +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite=true; +#else + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) + { + int argc=1; + const char* argv[2]={"arr_viewer","\0"}; + QApplication app(argc,const_cast(argv)); + SimpleArrangementViewerQt > + mainwindow(app.activeWindow(), a_arr, title); + mainwindow.show(); + app.exec(); + } +} + +} // End namespace CGAL + +#endif // CGAL_DRAW_ARRANGEMENT_2_H + +#endif // CGAL_DRAW_LCC_H diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 31cc91ee210..0aa7c4ec8a7 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -130,7 +130,7 @@ void draw(const CGAL::Polygon_with_holes_2& ap2, #else bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif - + if (!cgal_test_suite) { int argc=1; From ee3ee2743200800cbfe71a0b4ec053689d8a3cb6 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 13 Sep 2018 16:15:17 +0200 Subject: [PATCH 14/39] Continue draw for arrangement --- .../Arrangement_on_surface_2/CMakeLists.txt | 10 +- .../draw_arrangement.cpp | 47 +++++++ .../include/CGAL/draw_arrangement_2.h | 127 +++++++++--------- .../Linear_cell_complex/CMakeLists.txt | 2 +- 4 files changed, 121 insertions(+), 65 deletions(-) create mode 100644 Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arrangement.cpp diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt index ff47bd7b67b..9b942a9fa00 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt @@ -6,7 +6,11 @@ project( Arrangement_on_surface_2_Examples ) cmake_minimum_required(VERSION 2.8.10) -find_package(CGAL QUIET COMPONENTS Core) +find_package(CGAL QUIET COMPONENTS Core Qt5) + +if(CGAL_Qt5_FOUND) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) +endif() if ( CGAL_FOUND ) @@ -22,6 +26,10 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "${cppfile}" ) endforeach() + if(CGAL_Qt5_FOUND) + target_link_libraries(draw_arrangement PUBLIC CGAL::CGAL_Qt5) + endif() + else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arrangement.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arrangement.cpp new file mode 100644 index 00000000000..d7d9e515812 --- /dev/null +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arrangement.cpp @@ -0,0 +1,47 @@ +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Quotient Number_type; +typedef CGAL::Cartesian Kernel; +typedef CGAL::Arr_segment_traits_2 Traits_2; +typedef Traits_2::Point_2 Point_2; +typedef Traits_2::X_monotone_curve_2 Segment_2; +typedef CGAL::Arrangement_2 Arrangement_2; + +int main () +{ + // Construct the arrangement of five intersecting segments. + Arrangement_2 arr; + Segment_2 S1 [5]; + + S1[0]=Segment_2(Point_2 (1, 2.5), Point_2 (4, 5)); + S1[1]=Segment_2(Point_2 (1, 2.5), Point_2 (6, 2.5)); + S1[2]=Segment_2(Point_2 (1, 2.5), Point_2 (4, 0)); + S1[3]=Segment_2(Point_2 (4, 5), Point_2 (6, 2.5)); + S1[4]=Segment_2(Point_2 (4, 0), Point_2 (6, 2.5)); + + insert_non_intersecting_curves(arr, S1, S1 + 5); + + // Perform an incremental insertion of a single overlapping segment. + insert(arr, Segment_2 (Point_2 (0, 2.5), Point_2 (4, 2.5))); + + // Aggregately insert an additional set of five segments. + Segment_2 S2 [5]; + S2[0]=Segment_2(Point_2 (0, 4), Point_2 (6, 5)); + S2[1]=Segment_2(Point_2 (0, 3), Point_2 (6, 4)); + S2[2]=Segment_2(Point_2 (0, 2), Point_2 (6, 1)); + S2[3]=Segment_2(Point_2 (0, 1), Point_2 (6, 0)); + S2[4]=Segment_2(Point_2 (6, 1), Point_2 (6, 4)); + + insert(arr, S2, S2 + 5); + + // Draw the arrangement. + CGAL::draw(arr); + + return EXIT_SUCCESS; +} diff --git a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h index d72f5ccee29..84cd084c4bb 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -26,7 +26,8 @@ #ifdef CGAL_USE_BASIC_VIEWER -#include +//#include +#include #include namespace CGAL @@ -37,21 +38,22 @@ template class SimpleArrangementViewerQt : public Basic_viewer_qt { typedef Basic_viewer_qt Base; - typedef typename Arr::Dart_const_handle Dart_const_handle; - typedef typename Arr::Traits Kernel; - typedef typename Kernel::Point Point; - typedef typename Kernel::Vector Vector; + typedef typename Arr::Halfedge_const_handle Halfedge_const_handle; + typedef typename Arr::Face_const_handle Face_const_handle; + typedef typename Arr::Geometry_traits_2 Kernel; + typedef typename Kernel::Point_2 Point; + typedef typename Kernel::Vector_2 Vector; public: /// Construct the viewer. - /// @param alcc the lcc to view + /// @param a_a the arrangement to view /// @param title the title of the window /// @param anofaces if true, do not draw faces (faces are not computed; this can be /// usefull for very big object where this time could be long) - SimpleLCCViewerQt(QWidget* parent, - const Arr& a_arr, - const char* title="Basic Arrangement Viewer", - bool anofaces=false) : + SimpleArrangementViewerQt(QWidget* parent, + const Arr& a_arr, + const char* title="Basic Arrangement Viewer", + bool anofaces=false) : // First draw: vertices; edges, faces; multi-color; inverse normal Base(parent, title, true, true, true, true, true), arr(a_arr), @@ -61,78 +63,77 @@ public: } protected: - void compute_face(Dart_const_handle dh) + void print_ccb (typename Arr::Ccb_halfedge_const_circulator circ) { - // We fill only closed faces. - Dart_const_handle cur=dh; - Dart_const_handle min=dh; + typename Arr::Ccb_halfedge_const_circulator curr = circ; + std::cout << "(" << curr->source()->point() << ")"; do { - if (!lcc.is_next_exist(cur)) return; // open face=>not filled - if (curcurve() << "] " + << "(" << he->target()->point() << ")";*/ } - while(cur!=dh); + while (++curr != circ); + } + void compute_face(Face_const_handle fh) + { + if (fh->is_unbounded()) + { return; } + + // // Print the isolated vertices. + // typename Arr_2::Isolated_vertex_const_iterator iv; + // for (iv = fh->isolated_vertices_begin(); + // iv != fh->isolated_vertices_end(); ++iv) + // { + // iv->point(); + // } + + CGAL::Random random((unsigned long)(&*fh)); + CGAL::Color c=get_random_color(random); - CGAL::Color c=m_fcolor.run(lcc, dh); face_begin(c); - cur=dh; + print_ccb (fh->outer_ccb()); + typename Arr::Hole_const_iterator hi; + for (hi=fh->holes_begin(); hi!=fh->holes_end(); ++hi) + { print_ccb (*hi); } + + /* cur=dh; do { - add_point_in_face(lcc.point(cur), - Geom_utils::get_vertex_normal(lcc, cur)); + add_point_in_face(lcc.point(cur)); cur=lcc.next(cur); } - while(cur!=dh); + while(cur!=dh);*/ face_end(); } - void compute_edge(Dart_const_handle dh) + /* void compute_edge(Dart_const_handle dh) { - Point p1 = lcc.point(dh); - Dart_const_handle d2 = lcc.other_extremity(dh); - if (d2!=NULL) - { add_segment(p1, lcc.point(d2)); } - } - - void compute_vertex(Dart_const_handle dh) - { add_point(lcc.point(dh)); } + add_segment(p1, p2); + } */ void compute_elements() { clear(); - - typename LCC::size_type markfaces = lcc.get_new_mark(); - typename LCC::size_type markedges = lcc.get_new_mark(); - typename LCC::size_type markvertices = lcc.get_new_mark(); - - for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), - itend=lcc.darts().end(); it!=itend; ++it ) + + // Draw the arrangement vertices. + typename Arr::Vertex_const_iterator vit; + for (vit=arr.vertices_begin(); vit!=arr.vertices_end(); ++vit) { - if ( !m_nofaces && !lcc.is_marked(it, markfaces) ) - { - compute_face(it); - CGAL::mark_cell(lcc, it, markfaces); - } - - if ( !lcc.is_marked(it, markedges) ) - { - compute_edge(it); - CGAL::mark_cell(lcc, it, markedges); - } - - if ( !lcc.is_marked(it, markvertices) ) - { - compute_vertex(it); - CGAL::mark_cell(lcc, it, markvertices); - } + add_point(vit->point()); } - lcc.free_mark(markfaces); - lcc.free_mark(markedges); - lcc.free_mark(markvertices); + // Draw the arrangement edges. + typename Arr::Edge_const_iterator eit; + for (eit=arr.edges_begin(); eit!=arr.edges_end(); ++eit) + { std::cout << "[" << eit->curve() << "]" << std::endl; } + + // Draw the arrangement faces. + typename Arr::Face_const_iterator fit; + for (fit=arr.faces_begin(); fit!=arr.faces_end(); ++fit) + { compute_face(fit); } } virtual void keyPressEvent(QKeyEvent *e) @@ -157,9 +158,9 @@ protected: }; template -void draw(const Arrangement_on_surface_2& a_arr, - const char* title, - bool nofill) +void draw(const Arrangement_2& a_arr, + const char* title="Basic Arrangement Viewer", + bool nofill=false) { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; @@ -172,7 +173,7 @@ void draw(const Arrangement_on_surface_2& a_arr, int argc=1; const char* argv[2]={"arr_viewer","\0"}; QApplication app(argc,const_cast(argv)); - SimpleArrangementViewerQt > + SimpleArrangementViewerQt > mainwindow(app.activeWindow(), a_arr, title); mainwindow.show(); app.exec(); diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 9c0372c277d..73202cbee23 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -12,7 +12,7 @@ endif() find_package(CGAL COMPONENTS Qt5) if(CGAL_Qt5_FOUND) - add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() # For Gprof. From b8dfd1c561f7c2425e62e626cd235423db8b74a8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 14 Sep 2018 16:44:00 +0200 Subject: [PATCH 15/39] Cont draw arrangement --- .../include/CGAL/draw_arrangement_2.h | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h index 84cd084c4bb..a9d10490be7 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -22,6 +22,7 @@ #ifndef CGAL_DRAW_ARRANGEMENT_2_H #define CGAL_DRAW_ARRANGEMENT_2_H +#include #include #ifdef CGAL_USE_BASIC_VIEWER @@ -54,8 +55,8 @@ public: const Arr& a_arr, const char* title="Basic Arrangement Viewer", bool anofaces=false) : - // First draw: vertices; edges, faces; multi-color; inverse normal - Base(parent, title, true, true, true, true, true), + // First draw: vertices; edges, faces; multi-color; no inverse normal + Base(parent, title, true, true, true, false, false), arr(a_arr), m_nofaces(anofaces) { @@ -91,13 +92,13 @@ protected: CGAL::Random random((unsigned long)(&*fh)); CGAL::Color c=get_random_color(random); - face_begin(c); + /* face_begin(c); print_ccb (fh->outer_ccb()); typename Arr::Hole_const_iterator hi; for (hi=fh->holes_begin(); hi!=fh->holes_end(); ++hi) { print_ccb (*hi); } - + */ /* cur=dh; do { @@ -106,7 +107,7 @@ protected: } while(cur!=dh);*/ - face_end(); + //face_end(); } /* void compute_edge(Dart_const_handle dh) @@ -117,12 +118,22 @@ protected: void compute_elements() { clear(); + + Exact_predicates_inexact_constructions_kernel::Point_3 p1(1, 0, 1); + Exact_predicates_inexact_constructions_kernel::Point_3 p2(2, 0, 2); + Exact_predicates_inexact_constructions_kernel::Point_3 p3(3, 0, 3); + add_point(p1); + add_point(p2); + add_point(p3); + + return; // Draw the arrangement vertices. typename Arr::Vertex_const_iterator vit; for (vit=arr.vertices_begin(); vit!=arr.vertices_end(); ++vit) { add_point(vit->point()); + // std::cout<<"Point "<point()<& a_arr, const char* argv[2]={"arr_viewer","\0"}; QApplication app(argc,const_cast(argv)); SimpleArrangementViewerQt > - mainwindow(app.activeWindow(), a_arr, title); + mainwindow(app.activeWindow(), a_arr, title, nofill); mainwindow.show(); app.exec(); } @@ -182,6 +193,6 @@ void draw(const Arrangement_2& a_arr, } // End namespace CGAL -#endif // CGAL_DRAW_ARRANGEMENT_2_H +#endif // CGAL_USE_BASIC_VIEWER -#endif // CGAL_DRAW_LCC_H +#endif // CGAL_DRAW_ARRANGEMENT_2_H From 7c01be1ad8e06120a48a6b80f49a4f631e66a16c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 10:01:39 +0200 Subject: [PATCH 16/39] Remove (for now) draw for arrangement which is not yet ready. --- .../Arrangement_on_surface_2/CMakeLists.txt | 10 +- .../draw_arrangement.cpp | 47 ----- .../include/CGAL/draw_arrangement_2.h | 198 ------------------ 3 files changed, 1 insertion(+), 254 deletions(-) delete mode 100644 Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arrangement.cpp delete mode 100644 Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt index 9b942a9fa00..ff47bd7b67b 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt @@ -6,11 +6,7 @@ project( Arrangement_on_surface_2_Examples ) cmake_minimum_required(VERSION 2.8.10) -find_package(CGAL QUIET COMPONENTS Core Qt5) - -if(CGAL_Qt5_FOUND) - add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) -endif() +find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND ) @@ -26,10 +22,6 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "${cppfile}" ) endforeach() - if(CGAL_Qt5_FOUND) - target_link_libraries(draw_arrangement PUBLIC CGAL::CGAL_Qt5) - endif() - else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arrangement.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arrangement.cpp deleted file mode 100644 index d7d9e515812..00000000000 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arrangement.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -typedef CGAL::Quotient Number_type; -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arrangement_2 Arrangement_2; - -int main () -{ - // Construct the arrangement of five intersecting segments. - Arrangement_2 arr; - Segment_2 S1 [5]; - - S1[0]=Segment_2(Point_2 (1, 2.5), Point_2 (4, 5)); - S1[1]=Segment_2(Point_2 (1, 2.5), Point_2 (6, 2.5)); - S1[2]=Segment_2(Point_2 (1, 2.5), Point_2 (4, 0)); - S1[3]=Segment_2(Point_2 (4, 5), Point_2 (6, 2.5)); - S1[4]=Segment_2(Point_2 (4, 0), Point_2 (6, 2.5)); - - insert_non_intersecting_curves(arr, S1, S1 + 5); - - // Perform an incremental insertion of a single overlapping segment. - insert(arr, Segment_2 (Point_2 (0, 2.5), Point_2 (4, 2.5))); - - // Aggregately insert an additional set of five segments. - Segment_2 S2 [5]; - S2[0]=Segment_2(Point_2 (0, 4), Point_2 (6, 5)); - S2[1]=Segment_2(Point_2 (0, 3), Point_2 (6, 4)); - S2[2]=Segment_2(Point_2 (0, 2), Point_2 (6, 1)); - S2[3]=Segment_2(Point_2 (0, 1), Point_2 (6, 0)); - S2[4]=Segment_2(Point_2 (6, 1), Point_2 (6, 4)); - - insert(arr, S2, S2 + 5); - - // Draw the arrangement. - CGAL::draw(arr); - - return EXIT_SUCCESS; -} diff --git a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h deleted file mode 100644 index a9d10490be7..00000000000 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) 2006,2007,2009,2010,2011 Tel-Aviv University (Israel). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Guillaume Damiand - -#ifndef CGAL_DRAW_ARRANGEMENT_2_H -#define CGAL_DRAW_ARRANGEMENT_2_H - -#include -#include - -#ifdef CGAL_USE_BASIC_VIEWER - -//#include -#include -#include - -namespace CGAL -{ - -// Viewer class for Arr -template -class SimpleArrangementViewerQt : public Basic_viewer_qt -{ - typedef Basic_viewer_qt Base; - typedef typename Arr::Halfedge_const_handle Halfedge_const_handle; - typedef typename Arr::Face_const_handle Face_const_handle; - typedef typename Arr::Geometry_traits_2 Kernel; - typedef typename Kernel::Point_2 Point; - typedef typename Kernel::Vector_2 Vector; - -public: - /// Construct the viewer. - /// @param a_a the arrangement to view - /// @param title the title of the window - /// @param anofaces if true, do not draw faces (faces are not computed; this can be - /// usefull for very big object where this time could be long) - SimpleArrangementViewerQt(QWidget* parent, - const Arr& a_arr, - const char* title="Basic Arrangement Viewer", - bool anofaces=false) : - // First draw: vertices; edges, faces; multi-color; no inverse normal - Base(parent, title, true, true, true, false, false), - arr(a_arr), - m_nofaces(anofaces) - { - compute_elements(); - } - -protected: - void print_ccb (typename Arr::Ccb_halfedge_const_circulator circ) - { - typename Arr::Ccb_halfedge_const_circulator curr = circ; - std::cout << "(" << curr->source()->point() << ")"; - do - { - Halfedge_const_handle he = curr; - /* std::cout << " [" << he->curve() << "] " - << "(" << he->target()->point() << ")";*/ - } - while (++curr != circ); - } - void compute_face(Face_const_handle fh) - { - if (fh->is_unbounded()) - { return; } - - // // Print the isolated vertices. - // typename Arr_2::Isolated_vertex_const_iterator iv; - // for (iv = fh->isolated_vertices_begin(); - // iv != fh->isolated_vertices_end(); ++iv) - // { - // iv->point(); - // } - - CGAL::Random random((unsigned long)(&*fh)); - CGAL::Color c=get_random_color(random); - - /* face_begin(c); - - print_ccb (fh->outer_ccb()); - typename Arr::Hole_const_iterator hi; - for (hi=fh->holes_begin(); hi!=fh->holes_end(); ++hi) - { print_ccb (*hi); } - */ - /* cur=dh; - do - { - add_point_in_face(lcc.point(cur)); - cur=lcc.next(cur); - } - while(cur!=dh);*/ - - //face_end(); - } - - /* void compute_edge(Dart_const_handle dh) - { - add_segment(p1, p2); - } */ - - void compute_elements() - { - clear(); - - Exact_predicates_inexact_constructions_kernel::Point_3 p1(1, 0, 1); - Exact_predicates_inexact_constructions_kernel::Point_3 p2(2, 0, 2); - Exact_predicates_inexact_constructions_kernel::Point_3 p3(3, 0, 3); - add_point(p1); - add_point(p2); - add_point(p3); - - return; - - // Draw the arrangement vertices. - typename Arr::Vertex_const_iterator vit; - for (vit=arr.vertices_begin(); vit!=arr.vertices_end(); ++vit) - { - add_point(vit->point()); - // std::cout<<"Point "<point()<curve() << "]" << std::endl; } - - // Draw the arrangement faces. - typename Arr::Face_const_iterator fit; - for (fit=arr.faces_begin(); fit!=arr.faces_end(); ++fit) - { compute_face(fit); } - } - - virtual void keyPressEvent(QKeyEvent *e) - { - // Test key pressed: - // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - // if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ... } - - // Call: * compute_elements() if the model changed, followed by - // * redraw() if some viewing parameters changed that implies some - // modifications of the buffers - // (eg. type of normal, color/mono) - // * update() just to update the drawing - - // Call the base method to process others/classicals key - Base::keyPressEvent(e); - } - -protected: - const Arr& arr; - bool m_nofaces; -}; - -template -void draw(const Arrangement_2& a_arr, - const char* title="Basic Arrangement Viewer", - bool nofill=false) -{ -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif - - if (!cgal_test_suite) - { - int argc=1; - const char* argv[2]={"arr_viewer","\0"}; - QApplication app(argc,const_cast(argv)); - SimpleArrangementViewerQt > - mainwindow(app.activeWindow(), a_arr, title, nofill); - mainwindow.show(); - app.exec(); - } -} - -} // End namespace CGAL - -#endif // CGAL_USE_BASIC_VIEWER - -#endif // CGAL_DRAW_ARRANGEMENT_2_H From cbdd2d536eb5aa42fc61739dc6b57eebc64d2f3c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 11:02:17 +0200 Subject: [PATCH 17/39] In 2D, the viewer should also fix the camera orientation (and not only contraint it) --- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 7ad6f3c9eb9..7cd27136134 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -760,9 +760,14 @@ protected: // Camera Constraint: constraint.setRotationConstraintType(CGAL::qglviewer::AxisPlaneConstraint::AXIS); constraint.setTranslationConstraintType(CGAL::qglviewer::AxisPlaneConstraint::FREE); - constraint.setRotationConstraintDirection(CGAL::qglviewer::Vec((has_zero_x()?1.:0.), - (has_zero_y()?1.:0.), - (has_zero_z()?1.:0.))); + + double cx=0., cy=0., cz=0.; + if (has_zero_x()) { cx=1.; } + else if (has_zero_y()) { cy=1.; } + else { cz=1.; } + + camera()->setViewDirection(CGAL::qglviewer::Vec(-cx,-cy,-cz)); + constraint.setRotationConstraintDirection(CGAL::qglviewer::Vec(cx, cy, cz)); camera()->frame()->setConstraint(&constraint); } } From 8a3cb666fd5b99651c31667aa487bb362ba38c84 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 13:10:08 +0200 Subject: [PATCH 18/39] Correct links to CGAL::draw functions. --- .../Linear_cell_complex.txt | 2 +- .../PackageDescription.txt | 4 ++-- .../doc/Point_set_3/PackageDescription.txt | 15 ++++++++++++- Point_set_3/doc/Point_set_3/Point_set_3.txt | 2 +- Polygon/doc/Polygon/PackageDescription.txt | 22 +++++++++++++++++++ Polygon/doc/Polygon/Polygon.txt | 2 +- .../doc/Polyhedron/PackageDescription.txt | 4 ++-- Polyhedron/doc/Polyhedron/Polyhedron.txt | 2 +- .../doc/Surface_mesh/PackageDescription.txt | 4 ++-- .../doc/Surface_mesh/Surface_mesh.txt | 2 +- .../Triangulation_2/PackageDescription.txt | 4 ++-- .../doc/Triangulation_2/Triangulation_2.txt | 2 +- .../Triangulation_3/PackageDescription.txt | 4 ++-- .../doc/Triangulation_3/Triangulation_3.txt | 2 +- 14 files changed, 53 insertions(+), 18 deletions(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index 30e3be293e6..a3cf2300633 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -253,7 +253,7 @@ We can observe that the second run is faster than the first one. Indeed, updatin \subsection Linear_cell_complexDraw Draw a Linear Cell Complex \anchor ssecDrawLCC -A linear cell complex can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given linear cell complex. The function is blocking, that is the program continues as soon as the user closes the window. +A linear cell complex can be visualized by calling the \link PkgDrawLinearCellComplex CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given linear cell complex. The function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Linear_cell_complex/draw_linear_cell_complex.cpp} diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index 8eb6f42e7dc..02753118ffb 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -19,7 +19,7 @@ /// \defgroup PkgLinearCellComplexOperations Operations for Linear Cell Complex /// \ingroup PkgLinearCellComplex -/*! Draw. +/*! \code #include \endcode @@ -75,7 +75,7 @@ - `CGAL::compute_normal_of_cell_2` ### Draw a Linear cell complex ### -- `CGAL::draw` +- \link PkgDrawLinearCellComplex CGAL::draw() \endlink */ diff --git a/Point_set_3/doc/Point_set_3/PackageDescription.txt b/Point_set_3/doc/Point_set_3/PackageDescription.txt index ba953ea5b1e..db72b49839c 100644 --- a/Point_set_3/doc/Point_set_3/PackageDescription.txt +++ b/Point_set_3/doc/Point_set_3/PackageDescription.txt @@ -1,5 +1,15 @@ +/// \defgroup PkgPointSet3 3D Point Set Reference + /*! -\defgroup PkgPointSet3 3D Point Set Reference + \code + #include + \endcode +*/ +/// \defgroup PkgDrawPointSet3D Draw a 3D Point Set +/// \ingroup PkgPointSet3 + +/*! +\addtogroup PkgPointSet3 \cgalPkgDescriptionBegin{3D Point Set, PkgPointSet3Summary} \cgalPkgPicture{point_set_3.png} @@ -21,6 +31,9 @@ ## Class ## - `CGAL::Point_set_3` +### Draw a 3D Point Set ### +- \link PkgDrawPointSet3D CGAL::draw() \endlink + \defgroup PkgPointSet3IO Input/Output \ingroup PkgPointSet3 diff --git a/Point_set_3/doc/Point_set_3/Point_set_3.txt b/Point_set_3/doc/Point_set_3/Point_set_3.txt index cd099fc87e9..f87ebe81bdc 100644 --- a/Point_set_3/doc/Point_set_3/Point_set_3.txt +++ b/Point_set_3/doc/Point_set_3/Point_set_3.txt @@ -165,7 +165,7 @@ overload provided for `CGAL::Point_set_3`: \subsection Point_set_3_Draw Draw a Point Set -A 3D point set can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given point set. The function is blocking, that is the program continues as soon as the user closes the window. +A 3D point set can be visualized by calling the \link PkgDrawPointSet3D CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given point set. The function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Point_set_3/draw_point_set_3.cpp} diff --git a/Polygon/doc/Polygon/PackageDescription.txt b/Polygon/doc/Polygon/PackageDescription.txt index 84e1a8d5c77..8b810799b72 100644 --- a/Polygon/doc/Polygon/PackageDescription.txt +++ b/Polygon/doc/Polygon/PackageDescription.txt @@ -6,6 +6,22 @@ /// \defgroup PkgPolygon2Functions Global Functions /// \ingroup PkgPolygon2 +/*! + \code + #include + \endcode +*/ +/// \defgroup PkgDrawPolygon2 Draw a 2D Polygon +/// \ingroup PkgPolygon2 + +/*! + \code + #include + \endcode +*/ +/// \defgroup PkgDrawPolygonWithHoles2 Draw a 2D Polygon with Holes +/// \ingroup PkgPolygon2 + /*! \addtogroup PkgPolygon2 @@ -53,5 +69,11 @@ The assertion flags for the polygons and polygon operations use - `CGAL::right_vertex_2()` - `CGAL::top_vertex_2()` +### Draw a Polygon_2 ### +- \link PkgDrawPolygon2 CGAL::draw

() \endlink + +### Draw a Polygon_with_holes_2 ### +- \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink + */ diff --git a/Polygon/doc/Polygon/Polygon.txt b/Polygon/doc/Polygon/Polygon.txt index a268bfac755..6d97399df28 100644 --- a/Polygon/doc/Polygon/Polygon.txt +++ b/Polygon/doc/Polygon/Polygon.txt @@ -72,7 +72,7 @@ and 3D Linear Geometric %Kernel. \subsection subsecPolygonDraw Draw a Polygon -A polygon can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given polygon. The function is blocking, that is the program continues as soon as the user closes the window. +A polygon can be visualized by calling the \link PkgDrawPolygon2 CGAL::draw

() \endlink function as shown in the following example. This function opens a new window showing the given polygon. The function is blocking, that is the program continues as soon as the user closes the window (a version exists for polygon with holes, cf. \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink). \cgalExample{Polygon/draw_polygon.cpp} diff --git a/Polyhedron/doc/Polyhedron/PackageDescription.txt b/Polyhedron/doc/Polyhedron/PackageDescription.txt index 05972f40034..51323547282 100644 --- a/Polyhedron/doc/Polyhedron/PackageDescription.txt +++ b/Polyhedron/doc/Polyhedron/PackageDescription.txt @@ -5,7 +5,7 @@ /// \defgroup PkgPolyhedronIOFunc I/O Functions /// \ingroup PkgPolyhedron -/*! Draw. +/*! \code #include \endcode @@ -73,7 +73,7 @@ surface can be used without knowing the halfedge data structure. - \link PkgPolyhedronIOFunc `read_off()` \endlink ### Draw a Polyhedron 3 ### -- `CGAL::draw` +- \link PkgDrawPolyhedron CGAL::draw() \endlink */ diff --git a/Polyhedron/doc/Polyhedron/Polyhedron.txt b/Polyhedron/doc/Polyhedron/Polyhedron.txt index b960089fa00..6a653042bbf 100644 --- a/Polyhedron/doc/Polyhedron/Polyhedron.txt +++ b/Polyhedron/doc/Polyhedron/Polyhedron.txt @@ -278,7 +278,7 @@ are also marked in the program code. \subsection PolyhedronDraw Draw a Polyhedron \anchor ssecDrawPolyhedron -A polyhedron can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given polyhedron. The function is blocking, that is the program continues as soon as the user closes the window. +A polyhedron can be visualized by calling the \link PkgDrawPolyhedron CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given polyhedron. The function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Polyhedron/draw_polyhedron.cpp} diff --git a/Surface_mesh/doc/Surface_mesh/PackageDescription.txt b/Surface_mesh/doc/Surface_mesh/PackageDescription.txt index 1707c8a7a3f..73a8dee3334 100644 --- a/Surface_mesh/doc/Surface_mesh/PackageDescription.txt +++ b/Surface_mesh/doc/Surface_mesh/PackageDescription.txt @@ -1,7 +1,7 @@ /// \defgroup PkgSurface_mesh Surface Mesh Reference -/*! Draw. +/*! \code #include \endcode @@ -40,7 +40,7 @@ and faces is much simpler and can be used at runtime and not at compile time.} - `CGAL::Surface_mesh

` ### Draw a Surface Mesh ### -- `CGAL::draw` +- \link PkgDrawSurfaceMesh CGAL::draw() \endlink */ diff --git a/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt b/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt index 06b7c0dc14d..3ff9d1cc280 100644 --- a/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt +++ b/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt @@ -347,7 +347,7 @@ refering to the right vertices. \section SurfaceMeshDraw Draw a Surface Mesh \anchor ssecDrawSurfaceMesh -A surface mesh can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given surface mesh. The function is blocking, that is the program continues as soon as the user closes the window. +A surface mesh can be visualized by calling the \link PkgDrawSurfaceMesh CGAL::draw() \endlink as shown in the following example. This function opens a new window showing the given surface mesh. The function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Surface_mesh/draw_surface_mesh.cpp} diff --git a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt index 0984fbd61b3..621dc20ede6 100644 --- a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt +++ b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt @@ -16,7 +16,7 @@ /// \defgroup PkgTriangulation2Miscellaneous Miscellaneous /// \ingroup PkgTriangulation2 -/*! Draw. +/*! \code #include \endcode @@ -113,7 +113,7 @@ are described in Chapter \ref PkgTDS2 "2D Triangulation Data Structure". - \link CGAL::Triangulation_2::Locate_type `CGAL::Triangulation_2::Locate_type` \endlink ### Draw a Triangulation 2 ### -- `CGAL::draw` +- \link PkgDrawTriangulation2 CGAL::draw() \endlink */ diff --git a/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt b/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt index 65688e950b0..5c2d98b9f3e 100644 --- a/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt +++ b/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt @@ -475,7 +475,7 @@ Finally points on the convex hull are written to cout. \subsection Triangulation2Draw Draw a 2D Triangulation \anchor ssecDrawT2 -A 2D triangulation can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given 2D triangulation. The function is blocking, that is the program continues as soon as the user closes the window. +A 2D triangulation can be visualized by calling the \link PkgDrawTriangulation2 CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given 2D triangulation. The function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Triangulation_2/draw_triangulation_2.cpp} diff --git a/Triangulation_3/doc/Triangulation_3/PackageDescription.txt b/Triangulation_3/doc/Triangulation_3/PackageDescription.txt index d24aa743c3b..d68619ba8bc 100644 --- a/Triangulation_3/doc/Triangulation_3/PackageDescription.txt +++ b/Triangulation_3/doc/Triangulation_3/PackageDescription.txt @@ -13,7 +13,7 @@ /// \defgroup PkgTriangulation3VertexCellClasses Vertex and Cell Classes /// \ingroup PkgTriangulation3 -/*! Draw. +/*! \code #include \endcode @@ -118,7 +118,7 @@ is opposite to the vertex with the same index. See - `CGAL::Triangulation_3::Locate_type` ### Draw a Triangulation 3 ### -- `CGAL::draw` +- \link PkgDrawTriangulation3 CGAL::draw() \endlink */ diff --git a/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt b/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt index 8a71624c432..b16ed23cce1 100644 --- a/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt +++ b/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt @@ -538,7 +538,7 @@ removal of the first 100,000 vertices. \subsection Triangulation3Draw Draw a 3D Triangulation \anchor ssecDrawT3 -A 3D triangulation can be visualized by calling the `CGAL::draw()` function as shown in the following example. This function opens a new window showing the given 3D triangulation. The function is blocking, that is the program continues as soon as the user closes the window. +A 3D triangulation can be visualized by calling the \link PkgDrawTriangulation3 CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given 3D triangulation. The function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Triangulation_3/draw_triangulation_3.cpp} From af32499a14958814a3c3e12c664c73b35915caf3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 13:11:04 +0200 Subject: [PATCH 19/39] Add doc for draw function, for point set 3 and polygon 2. --- .../doc/Point_set_3/CGAL/draw_point_set_3.h | 14 ++++++++++++++ Polygon/doc/Polygon/CGAL/draw_polygon_2.h | 14 ++++++++++++++ .../doc/Polygon/CGAL/draw_polygon_with_holes_2.h | 14 ++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h create mode 100644 Polygon/doc/Polygon/CGAL/draw_polygon_2.h create mode 100644 Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h diff --git a/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h b/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h new file mode 100644 index 00000000000..027470415db --- /dev/null +++ b/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h @@ -0,0 +1,14 @@ +namespace CGAL { + +/*! +\ingroup PkgDrawPointSet3D + +Open a new window and draw `aps`, an instance of the `CGAL::Point_set_3` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +\tparam PS an instance of the `CGAL::Point_set_3` class. +\param aps the point set to draw. + +*/ +template +void draw(const PS& aps); + +} /* namespace CGAL */ diff --git a/Polygon/doc/Polygon/CGAL/draw_polygon_2.h b/Polygon/doc/Polygon/CGAL/draw_polygon_2.h new file mode 100644 index 00000000000..90744145aae --- /dev/null +++ b/Polygon/doc/Polygon/CGAL/draw_polygon_2.h @@ -0,0 +1,14 @@ +namespace CGAL { + +/*! +\ingroup PkgDrawPolygon2 + +Open a new window and draw `ap`, an instance of the `CGAL::Polygon_2` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +\tparam P an instance of the `CGAL::Polygon_2` class. +\param ap the polygon to draw. + +*/ +template +void draw(const P& ap); + +} /* namespace CGAL */ diff --git a/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h b/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h new file mode 100644 index 00000000000..ebcc0c22f97 --- /dev/null +++ b/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h @@ -0,0 +1,14 @@ +namespace CGAL { + +/*! +\ingroup PkgDrawPolygonWithHoles2 + +Open a new window and draw `aph`, an instance of the `CGAL::Polygon_with_holes_2` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +\tparam PH an instance of the `CGAL::Polygon_with_holes_2` class. +\param aph the polygon with holes to draw. + +*/ +template +void draw(const PH& aph); + +} /* namespace CGAL */ From 37967344231d843b0fcc5ce68cc456bf04d06e59 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:25:44 +0200 Subject: [PATCH 20/39] Update Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h Co-Authored-By: Sebastien Loriot --- Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h b/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h index 027470415db..86abab8ca89 100644 --- a/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h +++ b/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h @@ -3,7 +3,7 @@ namespace CGAL { /*! \ingroup PkgDrawPointSet3D -Open a new window and draw `aps`, an instance of the `CGAL::Point_set_3` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +opens a new window and draws `aps`, an instance of the `CGAL::Point_set_3` class. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. \tparam PS an instance of the `CGAL::Point_set_3` class. \param aps the point set to draw. From 06d771bf967ffd6e682c95b1bc8768233daba08a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:26:59 +0200 Subject: [PATCH 21/39] Update Polygon/doc/Polygon/CGAL/draw_polygon_2.h Co-Authored-By: Sebastien Loriot --- Polygon/doc/Polygon/CGAL/draw_polygon_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon/doc/Polygon/CGAL/draw_polygon_2.h b/Polygon/doc/Polygon/CGAL/draw_polygon_2.h index 90744145aae..055fee08e86 100644 --- a/Polygon/doc/Polygon/CGAL/draw_polygon_2.h +++ b/Polygon/doc/Polygon/CGAL/draw_polygon_2.h @@ -3,7 +3,7 @@ namespace CGAL { /*! \ingroup PkgDrawPolygon2 -Open a new window and draw `ap`, an instance of the `CGAL::Polygon_2` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +opens a new window and draws `ap`, an instance of the `CGAL::Polygon_2` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. \tparam P an instance of the `CGAL::Polygon_2` class. \param ap the polygon to draw. From 0ad3d5cd3bfe539504e5948537acbebc0ba0134c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:27:11 +0200 Subject: [PATCH 22/39] Update Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h Co-Authored-By: Sebastien Loriot --- Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h b/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h index ebcc0c22f97..e853b18de84 100644 --- a/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h @@ -3,7 +3,7 @@ namespace CGAL { /*! \ingroup PkgDrawPolygonWithHoles2 -Open a new window and draw `aph`, an instance of the `CGAL::Polygon_with_holes_2` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +opens a new window and draws `aph`, an instance of the `CGAL::Polygon_with_holes_2` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. \tparam PH an instance of the `CGAL::Polygon_with_holes_2` class. \param aph the polygon with holes to draw. From 82682499b8555f28bd626f716e3176a1e17354f0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:27:46 +0200 Subject: [PATCH 23/39] Update Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt Co-Authored-By: Sebastien Loriot --- .../doc/Linear_cell_complex/Linear_cell_complex.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index a3cf2300633..fba0ac158e8 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -253,7 +253,7 @@ We can observe that the second run is faster than the first one. Indeed, updatin \subsection Linear_cell_complexDraw Draw a Linear Cell Complex \anchor ssecDrawLCC -A linear cell complex can be visualized by calling the \link PkgDrawLinearCellComplex CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given linear cell complex. The function is blocking, that is the program continues as soon as the user closes the window. +A linear cell complex can be visualized by calling the \link PkgDrawLinearCellComplex CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given linear cell complex. A call to this function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Linear_cell_complex/draw_linear_cell_complex.cpp} From 7cabd4c423cdd5bd5f97de97ce1c28e53f034048 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:28:00 +0200 Subject: [PATCH 24/39] Update Point_set_3/doc/Point_set_3/Point_set_3.txt Co-Authored-By: Sebastien Loriot --- Point_set_3/doc/Point_set_3/Point_set_3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Point_set_3/doc/Point_set_3/Point_set_3.txt b/Point_set_3/doc/Point_set_3/Point_set_3.txt index f87ebe81bdc..6087eb9f53e 100644 --- a/Point_set_3/doc/Point_set_3/Point_set_3.txt +++ b/Point_set_3/doc/Point_set_3/Point_set_3.txt @@ -165,7 +165,7 @@ overload provided for `CGAL::Point_set_3`: \subsection Point_set_3_Draw Draw a Point Set -A 3D point set can be visualized by calling the \link PkgDrawPointSet3D CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given point set. The function is blocking, that is the program continues as soon as the user closes the window. +A 3D point set can be visualized by calling the \link PkgDrawPointSet3D CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given point set. A call to this function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Point_set_3/draw_point_set_3.cpp} From 7c41e0d71e6aa091e8e9b8d7f21eb932de811d96 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:28:31 +0200 Subject: [PATCH 25/39] Update Polygon/doc/Polygon/Polygon.txt Co-Authored-By: Sebastien Loriot --- Polygon/doc/Polygon/Polygon.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon/doc/Polygon/Polygon.txt b/Polygon/doc/Polygon/Polygon.txt index 6d97399df28..ab66a638bc0 100644 --- a/Polygon/doc/Polygon/Polygon.txt +++ b/Polygon/doc/Polygon/Polygon.txt @@ -72,7 +72,7 @@ and 3D Linear Geometric %Kernel. \subsection subsecPolygonDraw Draw a Polygon -A polygon can be visualized by calling the \link PkgDrawPolygon2 CGAL::draw

() \endlink function as shown in the following example. This function opens a new window showing the given polygon. The function is blocking, that is the program continues as soon as the user closes the window (a version exists for polygon with holes, cf. \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink). +A polygon can be visualized by calling the \link PkgDrawPolygon2 CGAL::draw

() \endlink function as shown in the following example. This function opens a new window showing the given polygon. A call to this function is blocking, that is the program continues as soon as the user closes the window (a version exists for polygon with holes, cf. \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink). \cgalExample{Polygon/draw_polygon.cpp} From c89758cb3c59f2eb09126cf9d22f7852236a485f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:28:46 +0200 Subject: [PATCH 26/39] Update Polyhedron/doc/Polyhedron/Polyhedron.txt Co-Authored-By: Sebastien Loriot --- Polyhedron/doc/Polyhedron/Polyhedron.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/doc/Polyhedron/Polyhedron.txt b/Polyhedron/doc/Polyhedron/Polyhedron.txt index 6a653042bbf..c5ba15dd26b 100644 --- a/Polyhedron/doc/Polyhedron/Polyhedron.txt +++ b/Polyhedron/doc/Polyhedron/Polyhedron.txt @@ -278,7 +278,7 @@ are also marked in the program code. \subsection PolyhedronDraw Draw a Polyhedron \anchor ssecDrawPolyhedron -A polyhedron can be visualized by calling the \link PkgDrawPolyhedron CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given polyhedron. The function is blocking, that is the program continues as soon as the user closes the window. +A polyhedron can be visualized by calling the \link PkgDrawPolyhedron CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given polyhedron. A call to this function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Polyhedron/draw_polyhedron.cpp} From 1eeba523af35c20fc3c0379a6648e773146c6132 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:28:56 +0200 Subject: [PATCH 27/39] Update Surface_mesh/doc/Surface_mesh/Surface_mesh.txt Co-Authored-By: Sebastien Loriot --- Surface_mesh/doc/Surface_mesh/Surface_mesh.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt b/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt index 3ff9d1cc280..a2b45cf0ddd 100644 --- a/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt +++ b/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt @@ -347,7 +347,7 @@ refering to the right vertices. \section SurfaceMeshDraw Draw a Surface Mesh \anchor ssecDrawSurfaceMesh -A surface mesh can be visualized by calling the \link PkgDrawSurfaceMesh CGAL::draw() \endlink as shown in the following example. This function opens a new window showing the given surface mesh. The function is blocking, that is the program continues as soon as the user closes the window. +A surface mesh can be visualized by calling the \link PkgDrawSurfaceMesh CGAL::draw() \endlink as shown in the following example. This function opens a new window showing the given surface mesh. A call to this function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Surface_mesh/draw_surface_mesh.cpp} From 98c5b82cb30b8f8773b229f7d60696dced911789 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:30:31 +0200 Subject: [PATCH 28/39] Update Triangulation_2/doc/Triangulation_2/Triangulation_2.txt Co-Authored-By: Sebastien Loriot --- Triangulation_2/doc/Triangulation_2/Triangulation_2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt b/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt index 5c2d98b9f3e..14b999049d4 100644 --- a/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt +++ b/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt @@ -475,7 +475,7 @@ Finally points on the convex hull are written to cout. \subsection Triangulation2Draw Draw a 2D Triangulation \anchor ssecDrawT2 -A 2D triangulation can be visualized by calling the \link PkgDrawTriangulation2 CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given 2D triangulation. The function is blocking, that is the program continues as soon as the user closes the window. +A 2D triangulation can be visualized by calling the \link PkgDrawTriangulation2 CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given 2D triangulation. A call to this function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Triangulation_2/draw_triangulation_2.cpp} From 98d81361c2723c1e6c65b9e5c2ad1e80d8b51762 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Jun 2019 15:31:06 +0200 Subject: [PATCH 29/39] Update Triangulation_3/doc/Triangulation_3/Triangulation_3.txt Co-Authored-By: Sebastien Loriot --- Triangulation_3/doc/Triangulation_3/Triangulation_3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt b/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt index b16ed23cce1..5a2bd92c013 100644 --- a/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt +++ b/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt @@ -538,7 +538,7 @@ removal of the first 100,000 vertices. \subsection Triangulation3Draw Draw a 3D Triangulation \anchor ssecDrawT3 -A 3D triangulation can be visualized by calling the \link PkgDrawTriangulation3 CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given 3D triangulation. The function is blocking, that is the program continues as soon as the user closes the window. +A 3D triangulation can be visualized by calling the \link PkgDrawTriangulation3 CGAL::draw() \endlink function as shown in the following example. This function opens a new window showing the given 3D triangulation. A call to this function is blocking, that is the program continues as soon as the user closes the window. \cgalExample{Triangulation_3/draw_triangulation_3.cpp} From 5dac349b1314b630b61b28cc385fce84cea7c05e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 20 Jun 2019 12:33:37 +0200 Subject: [PATCH 30/39] Add licence check --- Point_set_3/include/CGAL/draw_point_set_3.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Point_set_3/include/CGAL/draw_point_set_3.h b/Point_set_3/include/CGAL/draw_point_set_3.h index adf3afac861..416d0363456 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -22,6 +22,7 @@ #ifndef CGAL_DRAW_POINT_SET_3_H #define CGAL_DRAW_POINT_SET_3_H +#include #include #ifdef CGAL_USE_BASIC_VIEWER From 5538543faf4b2b39de9be1e44b9678a0949444eb Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 21 Jun 2019 11:27:02 +0200 Subject: [PATCH 31/39] Update dependencies --- Point_set_3/package_info/Point_set_3/dependencies | 1 + Polygon/package_info/Polygon/dependencies | 1 + 2 files changed, 2 insertions(+) diff --git a/Point_set_3/package_info/Point_set_3/dependencies b/Point_set_3/package_info/Point_set_3/dependencies index d5ec00a4fea..cab851ef527 100644 --- a/Point_set_3/package_info/Point_set_3/dependencies +++ b/Point_set_3/package_info/Point_set_3/dependencies @@ -1,5 +1,6 @@ Algebraic_foundations BGL +GraphicsView Installation Interval_support Kernel_23 diff --git a/Polygon/package_info/Polygon/dependencies b/Polygon/package_info/Polygon/dependencies index ad435cca369..3312eb37e46 100644 --- a/Polygon/package_info/Polygon/dependencies +++ b/Polygon/package_info/Polygon/dependencies @@ -1,5 +1,6 @@ Algebraic_foundations Circulator +GraphicsView Installation Kernel_23 Number_types From 012d44398ff797676a937487296c80f058bdb88b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 24 Jun 2019 09:24:37 +0200 Subject: [PATCH 32/39] Remove 2 warnings. --- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 2 +- Polygon/include/CGAL/draw_polygon_with_holes_2.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 6253916a136..1d2fbd751e9 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -1117,7 +1117,7 @@ namespace CGAL { template - void draw(const T& t, const char* ="", bool=false) + void draw(const T&, const char* ="", bool=false) { std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Mon, 24 Jun 2019 10:54:41 +0200 Subject: [PATCH 33/39] Remove error in raw_surface_mesh_small_faces.h --- .../draw_surface_mesh_small_faces.h | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h index 9e960be161a..b50c3a36a27 100644 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h @@ -21,6 +21,7 @@ #ifndef CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H #define CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H +#include #include #ifdef CGAL_USE_BASIC_VIEWER @@ -82,8 +83,8 @@ public: protected: void compute_face(face_descriptor fh) { - /// [Face creation] - bool small=false; + // [Face creation] + bool issmall=false; // Default color of faces CGAL::Color c(75,160,255); @@ -98,10 +99,10 @@ protected: if (get(faces_size, fh)modifiers(); if ((e->key()==Qt::Key_I) && (modifiers==Qt::NoButton)) { - if (m_threshold<100) ++m_threshold; - displayMessage(QString("Threshold percent=%1 \%.").arg(m_threshold)); + if (m_threshold<100) { ++m_threshold; } + displayMessage(QString("Threshold percent=%1%.").arg(m_threshold)); compute_elements(); redraw(); } else if ((e->key()==Qt::Key_D) && (modifiers==Qt::NoButton)) { - if (m_threshold>0) --m_threshold; - displayMessage(QString("Threshold percent=%1 \%.").arg(m_threshold)); + if (m_threshold>0) { --m_threshold; } + displayMessage(QString("Threshold percent=%1%.").arg(m_threshold)); compute_elements(); redraw(); } @@ -280,6 +281,14 @@ void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh) } } +#else // CGAL_USE_BASIC_VIEWER + +template +void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh&) +{ + std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Tue, 25 Jun 2019 09:23:41 +0200 Subject: [PATCH 34/39] Remove an unused parameter in draw functions for polygons. --- Polygon/include/CGAL/draw_polygon_2.h | 3 +-- Polygon/include/CGAL/draw_polygon_with_holes_2.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 0088deefd58..349a213c380 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -103,8 +103,7 @@ protected: // Specialization of draw function. template void draw(const CGAL::Polygon_2& ap2, - const char* title="Polygon_2 Basic Viewer", - bool nofill=false) + const char* title="Polygon_2 Basic Viewer") { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 026ab1dee54..4b4c1bfd93f 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -120,8 +120,7 @@ protected: // Specialization of draw function. template void draw(const CGAL::Polygon_with_holes_2& ap2, - const char* title="Polygon_with_holes_2 Basic Viewer", - bool nofill=false) + const char* title="Polygon_with_holes_2 Basic Viewer") { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; From 29babbe4ad389b0e550adcad4e37d509cc904067 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 26 Jun 2019 13:04:32 +0200 Subject: [PATCH 35/39] Fix the documentation issue --- Polygon/doc/Polygon/Doxyfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon/doc/Polygon/Doxyfile.in b/Polygon/doc/Polygon/Doxyfile.in index f4a3edd012e..2102a8684cd 100644 --- a/Polygon/doc/Polygon/Doxyfile.in +++ b/Polygon/doc/Polygon/Doxyfile.in @@ -3,7 +3,7 @@ PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 2D Polygons" EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples \ ${CGAL_Stream_support_EXAMPLE_DIR} - +INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL EXTRACT_ALL = false HIDE_UNDOC_MEMBERS = true From 4b1d2c6b05fce0545202827f7611d622f52b8d11 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 27 Jun 2019 10:04:58 +0200 Subject: [PATCH 36/39] Fix my fix --- Polygon/doc/Polygon/Doxyfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon/doc/Polygon/Doxyfile.in b/Polygon/doc/Polygon/Doxyfile.in index 2102a8684cd..d45135738c6 100644 --- a/Polygon/doc/Polygon/Doxyfile.in +++ b/Polygon/doc/Polygon/Doxyfile.in @@ -3,7 +3,7 @@ PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 2D Polygons" EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples \ ${CGAL_Stream_support_EXAMPLE_DIR} -INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL +INPUT += ${CGAL_PACKAGE_INCLUDE_DIR} EXTRACT_ALL = false HIDE_UNDOC_MEMBERS = true From 14a59deda6e559017b3b08668a8b16225ad8d6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 28 Jun 2019 10:03:10 +0200 Subject: [PATCH 37/39] lazy doc fix --- Polygon/doc/Polygon/CGAL/draw_polygon_2.h | 14 -------------- .../Polygon/CGAL/draw_polygon_with_holes_2.h | 14 -------------- Polygon/doc/Polygon/Doxyfile.in | 1 - Polygon/include/CGAL/draw_polygon_2.h | 18 ++++++++++++++++++ .../include/CGAL/draw_polygon_with_holes_2.h | 17 +++++++++++++++++ 5 files changed, 35 insertions(+), 29 deletions(-) delete mode 100644 Polygon/doc/Polygon/CGAL/draw_polygon_2.h delete mode 100644 Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h diff --git a/Polygon/doc/Polygon/CGAL/draw_polygon_2.h b/Polygon/doc/Polygon/CGAL/draw_polygon_2.h deleted file mode 100644 index 16c902af6a7..00000000000 --- a/Polygon/doc/Polygon/CGAL/draw_polygon_2.h +++ /dev/null @@ -1,14 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgDrawPolygon2 - -opens a new window and draws `ap`, an instance of the `CGAL::Polygon_2` class. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. -\tparam P an instance of the `CGAL::Polygon_2` class. -\param ap the polygon to draw. - -*/ -template -void draw(const P& ap); - -} /* namespace CGAL */ diff --git a/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h b/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h deleted file mode 100644 index 2433bee3315..00000000000 --- a/Polygon/doc/Polygon/CGAL/draw_polygon_with_holes_2.h +++ /dev/null @@ -1,14 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgDrawPolygonWithHoles2 - -opens a new window and draws `aph`, an instance of the `CGAL::Polygon_with_holes_2` class. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. -\tparam PH an instance of the `CGAL::Polygon_with_holes_2` class. -\param aph the polygon with holes to draw. - -*/ -template -void draw(const PH& aph); - -} /* namespace CGAL */ diff --git a/Polygon/doc/Polygon/Doxyfile.in b/Polygon/doc/Polygon/Doxyfile.in index d45135738c6..8cfb32b528f 100644 --- a/Polygon/doc/Polygon/Doxyfile.in +++ b/Polygon/doc/Polygon/Doxyfile.in @@ -3,7 +3,6 @@ PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 2D Polygons" EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples \ ${CGAL_Stream_support_EXAMPLE_DIR} -INPUT += ${CGAL_PACKAGE_INCLUDE_DIR} EXTRACT_ALL = false HIDE_UNDOC_MEMBERS = true diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 349a213c380..8b7bdd296a6 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -28,6 +28,24 @@ #include +#ifdef DOXYGEN_RUNNING +namespace CGAL { + +/*! +\ingroup PkgDrawPolygon2 + +opens a new window and draws `ap`, an instance of the `CGAL::Polygon_2` class. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +\tparam P an instance of the `CGAL::Polygon_2` class. +\param ap the polygon to draw. + +*/ +template +void draw(const P& ap); + +} /* namespace CGAL */ + +#endif + #ifdef CGAL_USE_BASIC_VIEWER #include diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 4b4c1bfd93f..33806eb1b38 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -28,6 +28,23 @@ #include +#ifdef DOXYGEN_RUNNING +namespace CGAL { + +/*! +\ingroup PkgDrawPolygonWithHoles2 + +opens a new window and draws `aph`, an instance of the `CGAL::Polygon_with_holes_2` class. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +\tparam PH an instance of the `CGAL::Polygon_with_holes_2` class. +\param aph the polygon with holes to draw. + +*/ +template +void draw(const PH& aph); + +} /* namespace CGAL */ +#endif + #ifdef CGAL_USE_BASIC_VIEWER #include From 55bbb8e9e9faa93735ba8a3c81769fb75afce10b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 28 Jun 2019 10:07:40 +0200 Subject: [PATCH 38/39] lazy doc fix --- .../doc/Point_set_3/CGAL/draw_point_set_3.h | 14 -------------- Point_set_3/include/CGAL/draw_point_set_3.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 14 deletions(-) delete mode 100644 Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h diff --git a/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h b/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h deleted file mode 100644 index 86abab8ca89..00000000000 --- a/Point_set_3/doc/Point_set_3/CGAL/draw_point_set_3.h +++ /dev/null @@ -1,14 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgDrawPointSet3D - -opens a new window and draws `aps`, an instance of the `CGAL::Point_set_3` class. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. -\tparam PS an instance of the `CGAL::Point_set_3` class. -\param aps the point set to draw. - -*/ -template -void draw(const PS& aps); - -} /* namespace CGAL */ diff --git a/Point_set_3/include/CGAL/draw_point_set_3.h b/Point_set_3/include/CGAL/draw_point_set_3.h index 416d0363456..ca5d094b3a5 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -25,6 +25,23 @@ #include #include +#ifdef DOXYGEN_RUNNING +namespace CGAL { + +/*! +\ingroup PkgDrawPointSet3D + +opens a new window and draws `aps`, an instance of the `CGAL::Point_set_3` class. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt5, and is only available if the flag CGAL_USE_BASIC_VIEWER is defined at compile time. +\tparam PS an instance of the `CGAL::Point_set_3` class. +\param aps the point set to draw. + +*/ +template +void draw(const PS& aps); + +} /* namespace CGAL */ +#endif + #ifdef CGAL_USE_BASIC_VIEWER #include From bcc296932e7b84e232f0f4df56733fec5ebbafe6 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 1 Jul 2019 10:25:16 +0200 Subject: [PATCH 39/39] compute dependencies if missing --- .travis/test_package.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis/test_package.sh b/.travis/test_package.sh index c1c7ba238cc..f91f9982916 100644 --- a/.travis/test_package.sh +++ b/.travis/test_package.sh @@ -7,6 +7,9 @@ DO_IGNORE=FALSE cd $1 if [ ! -f "$2/package_info/$2/dependencies" ];then echo "No dependencies found for $2" + bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen + + exit 1 fi LIST_OF_FILES=$(git diff --name-only origin/master... |cut -d/ -f1 |uniq |sort)