From 32ecb119475d911daf94f48b0ab08bd83de21c9e Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 4 Jul 2022 10:25:59 +0200 Subject: [PATCH 001/399] CGAL: Initial commit to handle GraphicBuffer with Basic viewers. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 230 +++++++----------- 1 file changed, 92 insertions(+), 138 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 111b70f0fd39..0e9d90441902 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -47,8 +47,8 @@ #include #include -#include #include +#include #include #include #include @@ -111,54 +111,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer m_faces_mono_color(60, 60, 200), m_ambient_color(0.6f, 0.5f, 0.5f, 0.5f), m_are_buffers_initialized(false), - m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], - nullptr, - &m_bounding_box, - nullptr, nullptr, nullptr), - m_buffer_for_colored_points(&arrays[POS_COLORED_POINTS], - nullptr, - &m_bounding_box, - &arrays[COLOR_POINTS], - nullptr, nullptr), - m_buffer_for_mono_segments(&arrays[POS_MONO_SEGMENTS], - nullptr, - &m_bounding_box, - nullptr, nullptr, nullptr), - m_buffer_for_colored_segments(&arrays[POS_COLORED_SEGMENTS], - nullptr, - &m_bounding_box, - &arrays[COLOR_SEGMENTS], - nullptr, nullptr), - m_buffer_for_mono_rays(&arrays[POS_MONO_RAYS], - nullptr, - &m_bounding_box, - nullptr, nullptr), - m_buffer_for_colored_rays(&arrays[POS_COLORED_RAYS], - nullptr, - &m_bounding_box, - &arrays[COLOR_RAYS], - nullptr, nullptr), - m_buffer_for_mono_lines(&arrays[POS_MONO_RAYS], - nullptr, - &m_bounding_box, - nullptr, nullptr), - m_buffer_for_colored_lines(&arrays[POS_COLORED_LINES], - nullptr, - &m_bounding_box, - &arrays[COLOR_LINES], - nullptr, nullptr), - m_buffer_for_mono_faces(&arrays[POS_MONO_FACES], - nullptr, - &m_bounding_box, - nullptr, - &arrays[FLAT_NORMAL_MONO_FACES], - &arrays[SMOOTH_NORMAL_MONO_FACES]), - m_buffer_for_colored_faces(&arrays[POS_COLORED_FACES], - nullptr, - &m_bounding_box, - &arrays[COLOR_FACES], - &arrays[FLAT_NORMAL_COLORED_FACES], - &arrays[SMOOTH_NORMAL_COLORED_FACES]) + gBuffer(arrays,m_bounding_box) { // Define 'Control+Q' as the new exit shortcut (default was 'Escape') setShortcut(qglviewer::EXIT_VIEWER, ::Qt::CTRL, ::Qt::Key_Q); @@ -257,16 +210,16 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool is_empty() const { - return (m_buffer_for_mono_points.is_empty() && - m_buffer_for_colored_points.is_empty() && - m_buffer_for_mono_segments.is_empty() && - m_buffer_for_colored_segments.is_empty() && - m_buffer_for_mono_rays.is_empty() && - m_buffer_for_colored_rays.is_empty() && - m_buffer_for_mono_lines.is_empty() && - m_buffer_for_colored_lines.is_empty() && - m_buffer_for_mono_faces.is_empty() && - m_buffer_for_colored_faces.is_empty()); + return (gBuffer.get_buffer_for_mono_points().is_empty() && + gBuffer.get_buffer_for_colored_points().is_empty() && + gBuffer.get_buffer_for_mono_segments().is_empty() && + gBuffer.get_buffer_for_colored_segments().is_empty() && + gBuffer.get_buffer_for_mono_rays().is_empty() && + gBuffer.get_buffer_for_colored_rays().is_empty() && + gBuffer.get_buffer_for_mono_lines().is_empty() && + gBuffer.get_buffer_for_colored_lines().is_empty() && + gBuffer.get_buffer_for_mono_faces().is_empty() && + gBuffer.get_buffer_for_colored_faces().is_empty()); } const CGAL::Bbox_3& bounding_box() const @@ -275,46 +228,46 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool has_zero_x() const { return - m_buffer_for_mono_points.has_zero_x() && - m_buffer_for_colored_points.has_zero_x() && - m_buffer_for_mono_segments.has_zero_x() && - m_buffer_for_colored_segments.has_zero_x() && - m_buffer_for_mono_faces.has_zero_x() && - m_buffer_for_colored_faces.has_zero_x() && - m_buffer_for_mono_rays.has_zero_x() && - m_buffer_for_colored_rays.has_zero_x() && - m_buffer_for_mono_lines.has_zero_x() && - m_buffer_for_colored_lines.has_zero_x(); + gBuffer.get_buffer_for_mono_points().has_zero_x() && + gBuffer.get_buffer_for_colored_points().has_zero_x() && + gBuffer.get_buffer_for_mono_segments().has_zero_x() && + gBuffer.get_buffer_for_colored_segments().has_zero_x() && + gBuffer.get_buffer_for_mono_faces().has_zero_x() && + gBuffer.get_buffer_for_colored_faces().has_zero_x() && + gBuffer.get_buffer_for_mono_rays().has_zero_x() && + gBuffer.get_buffer_for_colored_rays().has_zero_x() && + gBuffer.get_buffer_for_mono_lines().has_zero_x() && + gBuffer.get_buffer_for_colored_lines().has_zero_x(); } bool has_zero_y() const { return - m_buffer_for_mono_points.has_zero_y() && - m_buffer_for_colored_points.has_zero_y() && - m_buffer_for_mono_segments.has_zero_y() && - m_buffer_for_colored_segments.has_zero_y() && - m_buffer_for_mono_faces.has_zero_y() && - m_buffer_for_colored_faces.has_zero_y() && - m_buffer_for_mono_rays.has_zero_y() && - m_buffer_for_colored_rays.has_zero_y() && - m_buffer_for_mono_lines.has_zero_y() && - m_buffer_for_colored_lines.has_zero_y(); + gBuffer.get_buffer_for_mono_points().has_zero_y() && + gBuffer.get_buffer_for_colored_points().has_zero_y() && + gBuffer.get_buffer_for_mono_segments().has_zero_y() && + gBuffer.get_buffer_for_colored_segments().has_zero_y() && + gBuffer.get_buffer_for_mono_faces().has_zero_y() && + gBuffer.get_buffer_for_colored_faces().has_zero_y() && + gBuffer.get_buffer_for_mono_rays().has_zero_y() && + gBuffer.get_buffer_for_colored_rays().has_zero_y() && + gBuffer.get_buffer_for_mono_lines().has_zero_y() && + gBuffer.get_buffer_for_colored_lines().has_zero_y(); } bool has_zero_z() const { return - m_buffer_for_mono_points.has_zero_z() && - m_buffer_for_colored_points.has_zero_z() && - m_buffer_for_mono_segments.has_zero_z() && - m_buffer_for_colored_segments.has_zero_z() && - m_buffer_for_mono_faces.has_zero_z() && - m_buffer_for_colored_faces.has_zero_z() && - m_buffer_for_mono_rays.has_zero_z() && - m_buffer_for_colored_rays.has_zero_z() && - m_buffer_for_mono_lines.has_zero_z() && - m_buffer_for_colored_lines.has_zero_z(); + gBuffer.get_buffer_for_mono_points().has_zero_z() && + gBuffer.get_buffer_for_colored_points().has_zero_z() && + gBuffer.get_buffer_for_mono_segments().has_zero_z() && + gBuffer.get_buffer_for_colored_segments().has_zero_z() && + gBuffer.get_buffer_for_mono_faces().has_zero_z() && + gBuffer.get_buffer_for_colored_faces().has_zero_z() && + gBuffer.get_buffer_for_mono_rays().has_zero_z() && + gBuffer.get_buffer_for_colored_rays().has_zero_z() && + gBuffer.get_buffer_for_mono_lines().has_zero_z() && + gBuffer.get_buffer_for_colored_lines().has_zero_z(); } Local_kernel::Plane_3 clipping_plane() const @@ -330,20 +283,20 @@ class Basic_viewer_qt : public CGAL::QGLViewer template void add_point(const KPoint& p) - { m_buffer_for_mono_points.add_point(p); } + { gBuffer.add_point(p);} //get_buffer_for_mono_points().add_point(p); } template void add_point(const KPoint& p, const CGAL::IO::Color& acolor) - { m_buffer_for_colored_points.add_point(p, acolor); } + { gBuffer.get_buffer_for_colored_points().add_point(p, acolor); } template void add_segment(const KPoint& p1, const KPoint& p2) - { m_buffer_for_mono_segments.add_segment(p1, p2); } + { gBuffer.add_segment(p1, p2);}//get_buffer_for_mono_segments().add_segment(p1, p2); } template void add_segment(const KPoint& p1, const KPoint& p2, const CGAL::IO::Color& acolor) - { m_buffer_for_colored_segments.add_segment(p1, p2, acolor); } + { gBuffer.add_segment(p1, p2, acolor);}//get_buffer_for_colored_segments().add_segment(p1, p2, acolor); } template void update_bounding_box_for_ray(const KPoint &p, const KVector &v) @@ -370,29 +323,34 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_ray(const KPoint &p, const KVector &v) { double bigNumber = 1e30; - m_buffer_for_mono_rays.add_ray_segment(p, (p + (bigNumber)*v)); + gBuffer.get_buffer_for_mono_rays().add_ray_segment(p, (p + (bigNumber)*v)); + // gBuffer.get_buffer_for_mono_rays().add_ray(p, v); } template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) { - double bigNumber = 1e30; - m_buffer_for_colored_rays.add_ray_segment(p, (p + (bigNumber)*v), acolor); + // gBuffer.get_buffer_for_colored_rays().add_ray(p, v, acolor); + double bigNumber = 1e30; + gBuffer.get_buffer_for_colored_lines().add_ray_segment(p, (p + (bigNumber)*v), acolor); } template void add_line(const KPoint &p, const KVector &v) { - double bigNumber = 1e30; - m_buffer_for_mono_lines.add_line_segment((p - (bigNumber)*v), + // gBuffer.add_line(p,v); + double bigNumber = 1e30; + gBuffer.get_buffer_for_mono_lines().add_line_segment((p - (bigNumber)*v), (p + (bigNumber)*v)); } template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) { - double bigNumber = 1e30; - m_buffer_for_colored_lines.add_line_segment((p - (bigNumber)*v), + // gBuffer.add_line(p,v,acolor); + + double bigNumber = 1e30; + gBuffer.get_buffer_for_colored_lines().add_line_segment((p - (bigNumber)*v), (p + (bigNumber)*v), acolor); } @@ -413,8 +371,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool is_a_face_started() const { - return m_buffer_for_mono_faces.is_a_face_started() || - m_buffer_for_colored_faces.is_a_face_started(); + return gBuffer.get_buffer_for_mono_faces().is_a_face_started() || + gBuffer.get_buffer_for_colored_faces().is_a_face_started(); } void face_begin() @@ -424,7 +382,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer std::cerr<<"You cannot start a new face before to finish the previous one."< - bool add_point_in_face(const KPoint& kp) - { - if (m_buffer_for_mono_faces.is_a_face_started()) - { return m_buffer_for_mono_faces.add_point_in_face(kp); } - else if (m_buffer_for_colored_faces.is_a_face_started()) - { return m_buffer_for_colored_faces.add_point_in_face(kp); } - return false; + template + bool add_point_in_face(const KPoint &kp) { + return gBuffer.add_point_in_face(kp); } - template - bool add_point_in_face(const KPoint& kp, const KVector& p_normal) - { - if (m_buffer_for_mono_faces.is_a_face_started()) - { return m_buffer_for_mono_faces.add_point_in_face(kp, p_normal); } - else if (m_buffer_for_colored_faces.is_a_face_started()) - { return m_buffer_for_colored_faces.add_point_in_face(kp, p_normal); } - return false; + template + bool add_point_in_face(const KPoint &kp, const KVector &p_normal) { + return gBuffer.add_point_in_face(kp, p_normal); } void face_end() { - if (m_buffer_for_mono_faces.is_a_face_started()) - { m_buffer_for_mono_faces.face_end(); } - else if (m_buffer_for_colored_faces.is_a_face_started()) - { return m_buffer_for_colored_faces.face_end(); } + if (gBuffer.get_buffer_for_mono_faces().is_a_face_started()) + { + auto mono_faces = gBuffer.get_buffer_for_mono_faces(); + mono_faces.face_end(); + } + else if (gBuffer.get_buffer_for_colored_faces().is_a_face_started()) + { + auto colored_faces = gBuffer.get_buffer_for_colored_faces(); + return colored_faces.face_end(); + } } virtual void redraw() @@ -1422,8 +1382,11 @@ class Basic_viewer_qt : public CGAL::QGLViewer void negate_all_normals() { - m_buffer_for_mono_faces.negate_normals(); - m_buffer_for_colored_faces.negate_normals(); + auto mono_faces = gBuffer.get_buffer_for_mono_faces(); + mono_faces.negate_normals(); + + auto colored_faces = gBuffer.get_buffer_for_colored_faces(); + mono_faces.negate_normals(); } virtual void keyPressEvent(QKeyEvent *e) @@ -1682,6 +1645,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer } protected: + + GraphicBuffer gBuffer; + bool m_draw_vertices; bool m_draw_edges; bool m_draw_rays; @@ -1755,18 +1721,6 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; std::vector arrays[LAST_INDEX]; - Buffer_for_vao m_buffer_for_mono_points; - Buffer_for_vao m_buffer_for_colored_points; - Buffer_for_vao m_buffer_for_mono_segments; - Buffer_for_vao m_buffer_for_colored_segments; - Buffer_for_vao m_buffer_for_mono_rays; - Buffer_for_vao m_buffer_for_colored_rays; - Buffer_for_vao m_buffer_for_mono_lines; - Buffer_for_vao m_buffer_for_colored_lines; - Buffer_for_vao m_buffer_for_mono_faces; - Buffer_for_vao m_buffer_for_colored_faces; - Buffer_for_vao m_buffer_for_clipping_plane; - static const unsigned int NB_VBO_BUFFERS=(END_POS-BEGIN_POS)+ (END_COLOR-BEGIN_COLOR)+2; // +2 for 2 vectors of normals From 79a8ed3d245977a432fd679cc82befded5dcde4f Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 4 Jul 2022 10:28:18 +0200 Subject: [PATCH 002/399] CGAL: Initial commit for buffer dealing. --- GraphicsView/include/CGAL/GraphicBuffer.h | 225 ++++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 GraphicsView/include/CGAL/GraphicBuffer.h diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h new file mode 100644 index 000000000000..19dbc065977e --- /dev/null +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -0,0 +1,225 @@ +// Copyright (c) 2022 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s): Mostafa Ashraf + +#ifndef CGAL_GRAPHIC_BUFFER_H +#define CGAL_GRAPHIC_BUFFER_H + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +namespace CGAL { + +// This class is responsible to deal with CGAL data structures, +// filling mesh, and handling buffers. +template class GraphicBuffer { + +public: + GraphicBuffer(std::vector (&pos)[20], CGAL::Bbox_3 &bbox) + : m_buffer_for_mono_points(&pos[POS_MONO_POINTS], nullptr, &bbox, nullptr, + nullptr, nullptr), + m_buffer_for_colored_points(&pos[POS_COLORED_POINTS], nullptr, &bbox, + &pos[COLOR_POINTS], nullptr, nullptr), + m_buffer_for_mono_segments(&pos[POS_MONO_SEGMENTS], nullptr, &bbox, + nullptr, nullptr, nullptr), + m_buffer_for_colored_segments(&pos[POS_COLORED_SEGMENTS], nullptr, + &bbox, &pos[COLOR_SEGMENTS], nullptr, + nullptr), + m_buffer_for_mono_rays(&pos[POS_MONO_RAYS], nullptr, &bbox, nullptr, + nullptr), + m_buffer_for_colored_rays(&pos[POS_COLORED_RAYS], nullptr, &bbox, + &pos[COLOR_RAYS], nullptr, nullptr), + m_buffer_for_mono_lines(&pos[POS_MONO_RAYS], nullptr, &bbox, nullptr, + nullptr), + m_buffer_for_colored_lines(&pos[POS_COLORED_LINES], nullptr, &bbox, + &pos[COLOR_LINES], nullptr, nullptr), + m_buffer_for_mono_faces(&pos[POS_MONO_FACES], nullptr, &bbox, nullptr, + &pos[FLAT_NORMAL_MONO_FACES], + &pos[SMOOTH_NORMAL_MONO_FACES]), + m_buffer_for_colored_faces(&pos[POS_COLORED_FACES], nullptr, &bbox, + &pos[COLOR_FACES], + &pos[FLAT_NORMAL_COLORED_FACES], + &pos[SMOOTH_NORMAL_COLORED_FACES]) {} + + const Buffer_for_vao &get_buffer_for_mono_points() const { + return m_buffer_for_mono_points; + } + + const Buffer_for_vao &get_buffer_for_colored_points() const { + return m_buffer_for_colored_points; + } + + const Buffer_for_vao &get_buffer_for_mono_segments() const { + return m_buffer_for_mono_segments; + } + + const Buffer_for_vao &get_buffer_for_colored_segments() const { + return m_buffer_for_colored_segments; + } + + const Buffer_for_vao &get_buffer_for_mono_rays() const { + return m_buffer_for_mono_rays; + } + + const Buffer_for_vao &get_buffer_for_colored_rays() const { + return m_buffer_for_colored_rays; + } + + const Buffer_for_vao &get_buffer_for_mono_lines() const { + return m_buffer_for_mono_lines; + } + + const Buffer_for_vao &get_buffer_for_colored_lines() const { + return m_buffer_for_colored_lines; + } + + const Buffer_for_vao &get_buffer_for_mono_faces() const { + return m_buffer_for_mono_faces; + } + + const Buffer_for_vao &get_buffer_for_colored_faces() const { + return m_buffer_for_colored_faces; + } + + const Buffer_for_vao &get_buffer_for_clipping_plane() const { + return m_buffer_for_clipping_plane; + } + + template void add_point(const KPoint &p) { + m_buffer_for_mono_points.add_point(p); + } + + template + void add_point(const KPoint &p, const CGAL::IO::Color &acolor) { + m_buffer_for_colored_points.add_point(p, acolor); + } + + template + void add_segment(const KPoint &p1, const KPoint &p2) { + m_buffer_for_mono_segments.add_segment(p1, p2); + } + + template + void add_segment(const KPoint &p1, const KPoint &p2, + const CGAL::IO::Color &acolor) { + m_buffer_for_colored_segments.add_segment(p1, p2, acolor); + } + + template + void add_ray(const KPoint &p, const KVector &v) { + double bigNumber = 1e30; + m_buffer_for_mono_rays.add_ray_segment(p, (p + (bigNumber)*v)); + } + + template + void add_ray(const KPoint &p, const KVector &v, + const CGAL::IO::Color &acolor) { + double bigNumber = 1e30; + m_buffer_for_colored_rays.add_ray_segment(p, (p + (bigNumber)*v), acolor); + } + + template + void add_line(const KPoint &p, const KVector &v) { + double bigNumber = 1e30; + m_buffer_for_mono_lines.add_line_segment((p - (bigNumber)*v), + (p + (bigNumber)*v)); + } + + template + void add_line(const KPoint &p, const KVector &v, + const CGAL::IO::Color &acolor) { + double bigNumber = 1e30; + m_buffer_for_colored_lines.add_line_segment((p - (bigNumber)*v), + (p + (bigNumber)*v), acolor); + } + + template bool add_point_in_face(const KPoint &kp) { + if (m_buffer_for_mono_faces.is_a_face_started()) { + return m_buffer_for_mono_faces.add_point_in_face(kp); + } else if (m_buffer_for_colored_faces.is_a_face_started()) { + return m_buffer_for_colored_faces.add_point_in_face(kp); + } + return false; + } + + template + bool add_point_in_face(const KPoint &kp, const KVector &p_normal) { + if (m_buffer_for_mono_faces.is_a_face_started()) { + return m_buffer_for_mono_faces.add_point_in_face(kp, p_normal); + } else if (m_buffer_for_colored_faces.is_a_face_started()) { + return m_buffer_for_colored_faces.add_point_in_face(kp, p_normal); + } + return false; + } + +protected: + // The following enum gives the indices of different elements of arrays + // vectors. + enum { + BEGIN_POS = 0, + POS_MONO_POINTS = BEGIN_POS, + POS_COLORED_POINTS, + POS_MONO_SEGMENTS, + POS_COLORED_SEGMENTS, + POS_MONO_RAYS, + POS_COLORED_RAYS, + POS_MONO_LINES, + POS_COLORED_LINES, + POS_MONO_FACES, + POS_COLORED_FACES, + POS_CLIPPING_PLANE, + END_POS, + BEGIN_COLOR = END_POS, + COLOR_POINTS = BEGIN_COLOR, + COLOR_SEGMENTS, + COLOR_RAYS, + COLOR_LINES, + COLOR_FACES, + END_COLOR, + BEGIN_NORMAL = END_COLOR, + SMOOTH_NORMAL_MONO_FACES = BEGIN_NORMAL, + FLAT_NORMAL_MONO_FACES, + SMOOTH_NORMAL_COLORED_FACES, + FLAT_NORMAL_COLORED_FACES, + END_NORMAL, + LAST_INDEX = END_NORMAL + }; + + Buffer_for_vao m_buffer_for_mono_points; + Buffer_for_vao m_buffer_for_colored_points; + Buffer_for_vao m_buffer_for_mono_segments; + Buffer_for_vao m_buffer_for_colored_segments; + Buffer_for_vao m_buffer_for_mono_rays; + Buffer_for_vao m_buffer_for_colored_rays; + Buffer_for_vao m_buffer_for_mono_lines; + Buffer_for_vao m_buffer_for_colored_lines; + Buffer_for_vao m_buffer_for_mono_faces; + Buffer_for_vao m_buffer_for_colored_faces; + Buffer_for_vao m_buffer_for_clipping_plane; +}; + +} // namespace CGAL + +#endif // CGAL_GRAPHIC_BUFFER_H From a859f50716e67c0f84954aa5658e495b1e8c5c9f Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Tue, 19 Jul 2022 09:36:45 +0200 Subject: [PATCH 003/399] fixes bugs, WIP constructor --- .../include/CGAL/Qt/Basic_viewer_qt.h | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 0e9d90441902..46bc11e50d13 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -161,6 +161,20 @@ class Basic_viewer_qt : public CGAL::QGLViewer { negate_all_normals(); } } + Basic_viewer_qt(QWidget* parent, + const char* title="", + bool draw_vertices=false, + bool draw_edges=true, + bool draw_faces=true, + bool use_mono_color=false, + bool inverse_normal=false, + bool draw_rays=true, + bool draw_lines=true, + bool draw_text=true, + bool no_2D_mode=false, + GraphicBuffer& buf) : + gBuffer(buf) {} + ~Basic_viewer_qt() { makeCurrent(); @@ -283,15 +297,15 @@ class Basic_viewer_qt : public CGAL::QGLViewer template void add_point(const KPoint& p) - { gBuffer.add_point(p);} //get_buffer_for_mono_points().add_point(p); } + { gBuffer.add_point(p); } template void add_point(const KPoint& p, const CGAL::IO::Color& acolor) - { gBuffer.get_buffer_for_colored_points().add_point(p, acolor); } + { gBuffer.add_point(p, acolor); } template void add_segment(const KPoint& p1, const KPoint& p2) - { gBuffer.add_segment(p1, p2);}//get_buffer_for_mono_segments().add_segment(p1, p2); } + { gBuffer.add_segment(p1, p2);} template void add_segment(const KPoint& p1, const KPoint& p2, @@ -331,7 +345,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) { // gBuffer.get_buffer_for_colored_rays().add_ray(p, v, acolor); - double bigNumber = 1e30; + double bigNumber = 1e30; gBuffer.get_buffer_for_colored_lines().add_ray_segment(p, (p + (bigNumber)*v), acolor); } @@ -339,7 +353,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_line(const KPoint &p, const KVector &v) { // gBuffer.add_line(p,v); - double bigNumber = 1e30; + double bigNumber = 1e30; gBuffer.get_buffer_for_mono_lines().add_line_segment((p - (bigNumber)*v), (p + (bigNumber)*v)); } @@ -348,8 +362,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) { // gBuffer.add_line(p,v,acolor); - - double bigNumber = 1e30; + double bigNumber = 1e30; gBuffer.get_buffer_for_colored_lines().add_line_segment((p - (bigNumber)*v), (p + (bigNumber)*v), acolor); } From e51c41d7d638d7a54807ee2546fb62eae67efbab Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Tue, 19 Jul 2022 09:39:10 +0200 Subject: [PATCH 004/399] Handled buffers check. --- GraphicsView/include/CGAL/GraphicBuffer.h | 37 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 19dbc065977e..9405bd6a4d7c 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -32,8 +32,8 @@ namespace CGAL { -// This class is responsible to deal with CGAL data structures, -// filling mesh, and handling buffers. +// This class is responsible for dealing with available CGAL data structures and +// handling buffers. template class GraphicBuffer { public: @@ -174,6 +174,39 @@ template class GraphicBuffer { return false; } + bool is_a_face_started() const { + return m_buffer_for_mono_faces.is_a_face_started() || + m_buffer_for_colored_faces.is_a_face_started(); + } + + void face_begin() { + if (is_a_face_started()) { + std::cerr + << "You cannot start a new face before to finish the previous one." + << std::endl; + } else { + m_buffer_for_mono_faces.face_begin(); + } + } + + void face_begin(const CGAL::IO::Color &acolor) { + if (is_a_face_started()) { + std::cerr + << "You cannot start a new face before to finish the previous one." + << std::endl; + } else { + m_buffer_for_colored_faces.face_begin(acolor); + } + } + + void face_end() { + if (m_buffer_for_mono_faces.is_a_face_started()) { + m_buffer_for_mono_faces.face_end(); + } else if (m_buffer_for_colored_faces.is_a_face_started()) { + return m_buffer_for_colored_faces.face_end(); + } + } + protected: // The following enum gives the indices of different elements of arrays // vectors. From 81e42ffd733e2b4ae25627a5f391f4202518b947 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Tue, 19 Jul 2022 09:40:23 +0200 Subject: [PATCH 005/399] Initial commit handling basic viewers. The new version of dealing with CGAL basic viewers and data structures uses functions inserted of classes. --- ...aw_linear_cell_complex_functions_usage.cpp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex_functions_usage.cpp diff --git a/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex_functions_usage.cpp b/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex_functions_usage.cpp new file mode 100644 index 000000000000..5af105a84874 --- /dev/null +++ b/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex_functions_usage.cpp @@ -0,0 +1,29 @@ +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; +typedef LCC::Dart_handle Dart_handle; +typedef LCC::Point Point; + +int main() +{ + LCC lcc; + Dart_handle dh1= + lcc.make_hexahedron(Point(0,0,0), Point(5,0,0), + Point(5,5,0), Point(0,5,0), + Point(0,5,4), Point(0,0,4), + Point(5,0,4), Point(5,5,4)); + Dart_handle dh2= + lcc.make_hexahedron(Point(5,0,0), Point(10,0,0), + Point(10,5,0), Point(5,5,0), + Point(5,5,4), Point(5,0,4), + Point(10,0,4), Point(10,5,4)); + + lcc.sew<3>(lcc.beta(dh1, 1, 1, 2), lcc.beta(dh2, 2)); + + lcc.display_characteristics(std::cout)<<", valid=" + < Date: Tue, 19 Jul 2022 10:47:51 +0200 Subject: [PATCH 006/399] small correctioin --- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 46bc11e50d13..f8752bb45b86 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -162,6 +162,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer } Basic_viewer_qt(QWidget* parent, + GraphicBuffer<>& buf, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -171,8 +172,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool draw_rays=true, bool draw_lines=true, bool draw_text=true, - bool no_2D_mode=false, - GraphicBuffer& buf) : + bool no_2D_mode=false) : gBuffer(buf) {} ~Basic_viewer_qt() From c1a64ea90d74c8542e0844c4c91b0b2ecf64e3bd Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 02:08:40 +0200 Subject: [PATCH 007/399] Deleted, Redundant. --- ...aw_linear_cell_complex_functions_usage.cpp | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex_functions_usage.cpp diff --git a/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex_functions_usage.cpp b/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex_functions_usage.cpp deleted file mode 100644 index 5af105a84874..000000000000 --- a/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex_functions_usage.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; -typedef LCC::Dart_handle Dart_handle; -typedef LCC::Point Point; - -int main() -{ - LCC lcc; - Dart_handle dh1= - lcc.make_hexahedron(Point(0,0,0), Point(5,0,0), - Point(5,5,0), Point(0,5,0), - Point(0,5,4), Point(0,0,4), - Point(5,0,4), Point(5,5,4)); - Dart_handle dh2= - lcc.make_hexahedron(Point(5,0,0), Point(10,0,0), - Point(10,5,0), Point(5,5,0), - Point(5,5,4), Point(5,0,4), - Point(10,0,4), Point(10,5,4)); - - lcc.sew<3>(lcc.beta(dh1, 1, 1, 2), lcc.beta(dh2, 2)); - - lcc.display_characteristics(std::cout)<<", valid=" - < Date: Wed, 20 Jul 2022 09:40:17 +0200 Subject: [PATCH 008/399] Moved the graphical store elements, and used elements from the graphic buffer. Moved m_texts, arrays, m_bounding_box. Handled methods that use basic viewer arrays to use them from the graphic buffer. Moved a few methods. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 192 +++++++----------- 1 file changed, 77 insertions(+), 115 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index f8752bb45b86..affadf329221 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -215,7 +215,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer for (unsigned int i=0; i void add_text(const KPoint& kp, const QString& txt) { - Local_point p=get_local_point(kp); - m_texts.push_back(std::make_tuple(p, txt)); + gbuffer.add_text(kp, txt); } template void add_text(const KPoint& kp, const char* txt) - { add_text(kp, QString(txt)); } + { gbuffer.add_text(kp, txt); } template void add_text(const KPoint& kp, const std::string& txt) - { add_text(kp, txt.c_str()); } + { gbuffer.add_text(kp, txt.c_str()); } bool is_a_face_started() const { @@ -588,8 +548,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer unsigned int bufn = 0; CGAL_assertion(bufn(arrays[POS_MONO_POINTS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_MONO_POINTS).data(), + static_cast(gbuffer.get_array_of_index(POS_MONO_POINTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -605,8 +565,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_COLORED_POINTS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index.(POS_COLORED_POINTS).data(), + static_cast(gbuffer.get_array_of_index(POS_COLORED_POINTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); buffers[bufn].release(); @@ -614,8 +574,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[COLOR_POINTS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(COLOR_POINTS).data(), + static_cast(gbuffer.get_array_of_index(COLOR_POINTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -630,8 +590,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_MONO_SEGMENTS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_MONO_SEGMENTS).data(), + static_cast(gbuffer.get_array_of_index(POS_MONO_SEGMENTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -647,8 +607,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_COLORED_SEGMENTS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_COLORED_SEGMENTS).data(), + static_cast(gbuffer.get_array_of_index(POS_COLORED_SEGMENTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -657,8 +617,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[COLOR_SEGMENTS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(COLOR_SEGMENTS).data(), + static_cast(gbuffer.get_array_of_index(COLOR_SEGMENTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -675,8 +635,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_MONO_RAYS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_MONO_RAYS).data(), + static_cast(gbuffer.get_array_of_index(POS_MONO_RAYS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeArray("vertex",GL_FLOAT,0,3); @@ -693,8 +653,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_COLORED_RAYS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_COLORED_RAYS).data(), + static_cast(gbuffer.get_array_of_index(POS_COLORED_RAYS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -703,8 +663,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[COLOR_RAYS].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(COLOR_RAYS).data(), + static_cast(gbuffer.get_array_of_index(COLOR_RAYS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -720,8 +680,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_MONO_LINES].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_MONO_LINES).data(), + static_cast(gbuffer.get_array_of_index(POS_MONO_LINES).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeArray("vertex",GL_FLOAT,0,3); @@ -738,8 +698,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_COLORED_LINES].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_COLORED_LINES).data(), + static_cast(gbuffer.get_array_of_index(POS_COLORED_LINES).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -748,8 +708,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[COLOR_LINES].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(COLOR_LINES).data(), + static_cast(gbuffer.get_array_of_index(COLOR_LINES).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -768,8 +728,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_MONO_FACES].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_MONO_FACES).data(), + static_cast(gbuffer.get_array_of_index(POS_MONO_FACES).size()*sizeof(float))); rendering_program_face.enableAttributeArray("vertex"); rendering_program_face.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -781,14 +741,14 @@ class Basic_viewer_qt : public CGAL::QGLViewer buffers[bufn].bind(); if (m_flatShading) { - buffers[bufn].allocate(arrays[FLAT_NORMAL_MONO_FACES].data(), - static_cast(arrays[FLAT_NORMAL_MONO_FACES].size()* + buffers[bufn].allocate(gbuffer.get_array_of_index(FLAT_NORMAL_MONO_FACES).data(), + static_cast(gbuffer.get_array_of_index(FLAT_NORMAL_MONO_FACES).size()* sizeof(float))); } else { - buffers[bufn].allocate(arrays[SMOOTH_NORMAL_MONO_FACES].data(), - static_cast(arrays[SMOOTH_NORMAL_MONO_FACES].size()* + buffers[bufn].allocate(gbuffer.get_array_of_index(SMOOTH_NORMAL_MONO_FACES).data(), + static_cast(gbuffer.get_array_of_index(SMOOTH_NORMAL_MONO_FACES).size()* sizeof(float))); } rendering_program_face.enableAttributeArray("normal"); @@ -807,8 +767,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[POS_COLORED_FACES].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_COLORED_FACES).data(), + static_cast(gbuffer.get_array_of_index(POS_COLORED_FACES).size()*sizeof(float))); rendering_program_face.enableAttributeArray("vertex"); rendering_program_face.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -820,14 +780,14 @@ class Basic_viewer_qt : public CGAL::QGLViewer buffers[bufn].bind(); if (m_flatShading) { - buffers[bufn].allocate(arrays[FLAT_NORMAL_COLORED_FACES].data(), - static_cast(arrays[FLAT_NORMAL_COLORED_FACES].size()* + buffers[bufn].allocate(gbuffer.get_array_of_index(FLAT_NORMAL_COLORED_FACES).data(), + static_cast(gbuffer.get_array_of_index(FLAT_NORMAL_COLORED_FACES).size()* sizeof(float))); } else { - buffers[bufn].allocate(arrays[SMOOTH_NORMAL_COLORED_FACES].data(), - static_cast(arrays[SMOOTH_NORMAL_COLORED_FACES].size()* + buffers[bufn].allocate(gbuffer.get_array_of_index(SMOOTH_NORMAL_COLORED_FACES).data(), + static_cast(gbuffer.get_array_of_index(SMOOTH_NORMAL_COLORED_FACES).size()* sizeof(float))); } rendering_program_face.enableAttributeArray("normal"); @@ -839,8 +799,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(arrays[COLOR_FACES].size()*sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(COLOR_FACES).data(), + static_cast(gbuffer.get_array_of_index(COLOR_FACES).size()*sizeof(float))); rendering_program_face.enableAttributeArray("color"); rendering_program_face.setAttributeBuffer("color",GL_FLOAT,0,3); @@ -862,8 +822,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn < NB_VBO_BUFFERS); buffers[bufn].bind(); - buffers[bufn].allocate(arrays[POS_CLIPPING_PLANE].data(), - static_cast(arrays[POS_CLIPPING_PLANE].size() * sizeof(float))); + buffers[bufn].allocate(gbuffer.get_array_of_index(POS_CLIPPING_PLANE).data(), + static_cast(gbuffer.get_array_of_index(POS_CLIPPING_PLANE).size() * sizeof(float))); rendering_program_clipping_plane.enableAttributeArray("vertex"); rendering_program_clipping_plane.setAttributeBuffer("vertex", GL_FLOAT, 0, 3); @@ -1017,7 +977,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("clipPlane", clipPlane); rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(arrays[POS_MONO_POINTS].size()/3)); + glDrawArrays(GL_POINTS, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_POINTS).size()/3)); vao[VAO_MONO_POINTS].release(); vao[VAO_COLORED_POINTS].bind(); @@ -1037,7 +997,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("clipPlane", clipPlane); rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(arrays[POS_COLORED_POINTS].size()/3)); + glDrawArrays(GL_POINTS, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_POINTS).size()/3)); vao[VAO_COLORED_POINTS].release(); }; @@ -1076,7 +1036,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(arrays[POS_MONO_SEGMENTS].size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_SEGMENTS).size()/3)); vao[VAO_MONO_SEGMENTS].release(); vao[VAO_COLORED_SEGMENTS].bind(); @@ -1096,7 +1056,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(arrays[POS_COLORED_SEGMENTS].size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_SEGMENTS).size()/3)); vao[VAO_COLORED_SEGMENTS].release(); }; @@ -1128,7 +1088,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (double)m_rays_mono_color.blue()/(double)255); rendering_program_p_l.setAttributeValue("color",color); glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(arrays[POS_MONO_RAYS].size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_RAYS).size()/3)); vao[VAO_MONO_RAYS].release(); vao[VAO_COLORED_RAYS].bind(); @@ -1145,7 +1105,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.enableAttributeArray("color"); } glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(arrays[POS_COLORED_RAYS].size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_RAYS).size()/3)); vao[VAO_COLORED_RAYS].release(); rendering_program_p_l.release(); @@ -1161,7 +1121,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (double)m_lines_mono_color.blue()/(double)255); rendering_program_p_l.setAttributeValue("color",color); glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(arrays[POS_MONO_LINES].size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_LINES).size()/3)); vao[VAO_MONO_LINES].release(); rendering_program_p_l.release(); @@ -1180,7 +1140,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.enableAttributeArray("color"); } glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(arrays[POS_COLORED_LINES].size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_LINES).size()/3)); vao[VAO_COLORED_LINES].release(); rendering_program_p_l.release(); @@ -1214,7 +1174,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); rendering_program_face.setUniformValue("clipPlane", clipPlane); rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(arrays[POS_MONO_FACES].size()/3)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_FACES).size()/3)); vao[VAO_MONO_FACES].release(); vao[VAO_COLORED_FACES].bind(); @@ -1234,7 +1194,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); rendering_program_face.setUniformValue("clipPlane", clipPlane); rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(arrays[POS_COLORED_FACES].size()/3)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_FACES).size()/3)); vao[VAO_COLORED_FACES].release(); }; @@ -1245,7 +1205,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_clipping_plane.bind(); vao[VAO_CLIPPING_PLANE].bind(); glLineWidth(0.1f); - glDrawArrays(GL_LINES, 0, static_cast(arrays[POS_CLIPPING_PLANE].size() / 3)); + glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_CLIPPING_PLANE).size() / 3)); glLineWidth(1.0f); vao[VAO_CLIPPING_PLANE].release(); rendering_program_clipping_plane.release(); @@ -1371,25 +1331,26 @@ class Basic_viewer_qt : public CGAL::QGLViewer (bounding_box().zmax() - bounding_box().zmin())); const unsigned int nbSubdivisions=30; - arrays[POS_CLIPPING_PLANE].clear(); + gbuffer.get_array_of_index(POS_CLIPPING_PLANE).clear(); for (unsigned int i=0; i<=nbSubdivisions; ++i) { const float pos = float(size*(2.0*i/nbSubdivisions-1.0)); - arrays[POS_CLIPPING_PLANE].push_back(pos); - arrays[POS_CLIPPING_PLANE].push_back(float(-size)); - arrays[POS_CLIPPING_PLANE].push_back(0.f); - - arrays[POS_CLIPPING_PLANE].push_back(pos); - arrays[POS_CLIPPING_PLANE].push_back(float(+size)); - arrays[POS_CLIPPING_PLANE].push_back(0.f); - - arrays[POS_CLIPPING_PLANE].push_back(float(-size)); - arrays[POS_CLIPPING_PLANE].push_back(pos); - arrays[POS_CLIPPING_PLANE].push_back(0.f); - - arrays[POS_CLIPPING_PLANE].push_back(float(size)); - arrays[POS_CLIPPING_PLANE].push_back(pos); - arrays[POS_CLIPPING_PLANE].push_back(0.f); + auto array = gbuffer.get_array_of_index(POS_CLIPPING_PLANE); + array.push_back(pos); + array.push_back(float(-size)); + array.push_back(0.f); + + array.push_back(pos); + array.push_back(float(+size)); + array.push_back(0.f); + + array.push_back(float(-size)); + array.push_back(pos); + array.push_back(0.f); + + array.push_back(float(size)); + array.push_back(pos); + array.push_back(0.f); } } @@ -1732,6 +1693,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer END_NORMAL, LAST_INDEX=END_NORMAL }; + // TODO: deprecated, would remove! std::vector arrays[LAST_INDEX]; static const unsigned int NB_VBO_BUFFERS=(END_POS-BEGIN_POS)+ From 8778d1c4b4d6a45b69605454f1178d22697d4918 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 09:50:38 +0200 Subject: [PATCH 009/399] Handled constructor. --- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index affadf329221..a024e37295bc 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -79,6 +79,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer // Constructor/Destructor Basic_viewer_qt(QWidget* parent, + GraphicBuffer<>& buf, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -111,7 +112,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer m_faces_mono_color(60, 60, 200), m_ambient_color(0.6f, 0.5f, 0.5f, 0.5f), m_are_buffers_initialized(false), - gBuffer(arrays,m_bounding_box) + gBuffer(buf) { // Define 'Control+Q' as the new exit shortcut (default was 'Escape') setShortcut(qglviewer::EXIT_VIEWER, ::Qt::CTRL, ::Qt::Key_Q); @@ -161,20 +162,6 @@ class Basic_viewer_qt : public CGAL::QGLViewer { negate_all_normals(); } } - Basic_viewer_qt(QWidget* parent, - GraphicBuffer<>& buf, - const char* title="", - bool draw_vertices=false, - bool draw_edges=true, - bool draw_faces=true, - bool use_mono_color=false, - bool inverse_normal=false, - bool draw_rays=true, - bool draw_lines=true, - bool draw_text=true, - bool no_2D_mode=false) : - gBuffer(buf) {} - ~Basic_viewer_qt() { makeCurrent(); From 46e1bc7fcafd24d6684501a607e9b8a9dc4d8085 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 10:02:17 +0200 Subject: [PATCH 010/399] Got member elements of basic viewer. added needed methods to work externally. --- GraphicsView/include/CGAL/GraphicBuffer.h | 127 ++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 9405bd6a4d7c..1c9755c53518 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -37,6 +37,8 @@ namespace CGAL { template class GraphicBuffer { public: + typedef Local_kernel::Point_3 Local_point; + GraphicBuffer(std::vector (&pos)[20], CGAL::Bbox_3 &bbox) : m_buffer_for_mono_points(&pos[POS_MONO_POINTS], nullptr, &bbox, nullptr, nullptr, nullptr), @@ -63,6 +65,35 @@ template class GraphicBuffer { &pos[FLAT_NORMAL_COLORED_FACES], &pos[SMOOTH_NORMAL_COLORED_FACES]) {} + GraphicBuffer() + : m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr, + &m_bounding_box, nullptr, nullptr, nullptr), + m_buffer_for_colored_points(&arrays[POS_COLORED_POINTS], nullptr, + &m_bounding_box, &arrays[COLOR_POINTS], + nullptr, nullptr), + m_buffer_for_mono_segments(&arrays[POS_MONO_SEGMENTS], nullptr, + &m_bounding_box, nullptr, nullptr, nullptr), + m_buffer_for_colored_segments(&arrays[POS_COLORED_SEGMENTS], nullptr, + &m_bounding_box, &arrays[COLOR_SEGMENTS], + nullptr, nullptr), + m_buffer_for_mono_rays(&arrays[POS_MONO_RAYS], nullptr, &m_bounding_box, + nullptr, nullptr), + m_buffer_for_colored_rays(&arrays[POS_COLORED_RAYS], nullptr, + &m_bounding_box, &arrays[COLOR_RAYS], nullptr, + nullptr), + m_buffer_for_mono_lines(&arrays[POS_MONO_RAYS], nullptr, + &m_bounding_box, nullptr, nullptr), + m_buffer_for_colored_lines(&arrays[POS_COLORED_LINES], nullptr, + &m_bounding_box, &arrays[COLOR_LINES], + nullptr, nullptr), + m_buffer_for_mono_faces( + &arrays[POS_MONO_FACES], nullptr, &m_bounding_box, nullptr, + &arrays[FLAT_NORMAL_MONO_FACES], &arrays[SMOOTH_NORMAL_MONO_FACES]), + m_buffer_for_colored_faces(&arrays[POS_COLORED_FACES], nullptr, + &m_bounding_box, &arrays[COLOR_FACES], + &arrays[FLAT_NORMAL_COLORED_FACES], + &arrays[SMOOTH_NORMAL_COLORED_FACES]) {} + const Buffer_for_vao &get_buffer_for_mono_points() const { return m_buffer_for_mono_points; } @@ -107,6 +138,22 @@ template class GraphicBuffer { return m_buffer_for_clipping_plane; } + const CGAL::Bbox_3 &get_bounding_box() const { + return m_bounding_box; + } + + std::vector& get_array_of_index(int index) { + return arrays[index]; + } + + void update_bounding_box(CGAL::Bbox_3& box) { + m_bounding_box += box + } + + void initiate_bounding_box(CGAL::Bbox_3 new_bounding_box) { + m_bounding_box = new_bounding_box; + } + template void add_point(const KPoint &p) { m_buffer_for_mono_points.add_point(p); } @@ -207,6 +254,80 @@ template class GraphicBuffer { } } + bool is_empty() const { + return (gBuffer.get_buffer_for_mono_points().is_empty() && + gBuffer.get_buffer_for_colored_points().is_empty() && + gBuffer.get_buffer_for_mono_segments().is_empty() && + gBuffer.get_buffer_for_colored_segments().is_empty() && + gBuffer.get_buffer_for_mono_rays().is_empty() && + gBuffer.get_buffer_for_colored_rays().is_empty() && + gBuffer.get_buffer_for_mono_lines().is_empty() && + gBuffer.get_buffer_for_colored_lines().is_empty() && + gBuffer.get_buffer_for_mono_faces().is_empty() && + gBuffer.get_buffer_for_colored_faces().is_empty()); + } + + bool has_zero_x() const { + return gBuffer.get_buffer_for_mono_points().has_zero_x() && + gBuffer.get_buffer_for_colored_points().has_zero_x() && + gBuffer.get_buffer_for_mono_segments().has_zero_x() && + gBuffer.get_buffer_for_colored_segments().has_zero_x() && + gBuffer.get_buffer_for_mono_faces().has_zero_x() && + gBuffer.get_buffer_for_colored_faces().has_zero_x() && + gBuffer.get_buffer_for_mono_rays().has_zero_x() && + gBuffer.get_buffer_for_colored_rays().has_zero_x() && + gBuffer.get_buffer_for_mono_lines().has_zero_x() && + gBuffer.get_buffer_for_colored_lines().has_zero_x(); + } + + bool has_zero_y() const { + return gBuffer.get_buffer_for_mono_points().has_zero_y() && + gBuffer.get_buffer_for_colored_points().has_zero_y() && + gBuffer.get_buffer_for_mono_segments().has_zero_y() && + gBuffer.get_buffer_for_colored_segments().has_zero_y() && + gBuffer.get_buffer_for_mono_faces().has_zero_y() && + gBuffer.get_buffer_for_colored_faces().has_zero_y() && + gBuffer.get_buffer_for_mono_rays().has_zero_y() && + gBuffer.get_buffer_for_colored_rays().has_zero_y() && + gBuffer.get_buffer_for_mono_lines().has_zero_y() && + gBuffer.get_buffer_for_colored_lines().has_zero_y(); + } + + bool has_zero_z() const { + return gBuffer.get_buffer_for_mono_points().has_zero_z() && + gBuffer.get_buffer_for_colored_points().has_zero_z() && + gBuffer.get_buffer_for_mono_segments().has_zero_z() && + gBuffer.get_buffer_for_colored_segments().has_zero_z() && + gBuffer.get_buffer_for_mono_faces().has_zero_z() && + gBuffer.get_buffer_for_colored_faces().has_zero_z() && + gBuffer.get_buffer_for_mono_rays().has_zero_z() && + gBuffer.get_buffer_for_colored_rays().has_zero_z() && + gBuffer.get_buffer_for_mono_lines().has_zero_z() && + gBuffer.get_buffer_for_colored_lines().has_zero_z(); + } + + template + static Local_point get_local_point(const KPoint &p) { + return internal::Geom_utils::Kernel, + Local_kernel>::get_local_point(p); + } + + template + void add_text(const KPoint &kp, const QString &txt) { + Local_point p = get_local_point(kp); + m_texts.push_back(std::make_tuple(p, txt)); + } + + template void add_text(const KPoint &kp, const char *txt) { + add_text(kp, QString(txt)); + } + + template + void add_text(const KPoint &kp, const std::string &txt) { + add_text(kp, txt.c_str()); + } + + protected: // The following enum gives the indices of different elements of arrays // vectors. @@ -251,6 +372,12 @@ template class GraphicBuffer { Buffer_for_vao m_buffer_for_mono_faces; Buffer_for_vao m_buffer_for_colored_faces; Buffer_for_vao m_buffer_for_clipping_plane; + + std::vector> m_texts; + + std::vector arrays[LAST_INDEX]; + + CGAL::Bbox_3 m_bounding_box; }; } // namespace CGAL From 2a3144b7f308ff1b63e52ef285791ed5b7043c4e Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 10:04:47 +0200 Subject: [PATCH 011/399] Dealing bounding box from the graphic buffer. TODO for expected would remove --- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index a024e37295bc..7c5227702d0b 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -205,7 +205,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer { gbuffer.get_array_of_index(i).clear(); } } - m_bounding_box=CGAL::Bbox_3(); + gbuffer.initiate_bounding_box(CGAL::Bbox_3()); m_texts.clear(); } @@ -215,7 +215,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer } const CGAL::Bbox_3& bounding_box() const - { return m_bounding_box; } + { + auto bounding_box = gbuffer.get_bounding_box(); + return bounding_box; + } bool has_zero_x() const { @@ -266,7 +269,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer Local_point lp = get_local_point(p); Local_vector lv = get_local_vector(v); CGAL::Bbox_3 b = (lp + lv).bbox(); - m_bounding_box += b; + gbuffer.update_bounding_box(b); } template @@ -278,7 +281,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer Local_vector lpv = get_local_vector(pv); CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); - m_bounding_box += b; + gbuffer.update_bounding_box(b); } template @@ -1644,6 +1647,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer QVector4D m_ambient_color; bool m_are_buffers_initialized; + // TODO: deprecated, would remove! CGAL::Bbox_3 m_bounding_box; // CGAL::qglviewer::LocalConstraint constraint; @@ -1713,6 +1717,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool clipping_plane_rendering = true; // will be toggled when alt+c is pressed, which is used for indicating whether or not to render the clipping plane ; float clipping_plane_rendering_transparency = 0.5f; // to what extent the transparent part should be rendered; + // TODO: deprecated, would remove! std::vector > m_texts; }; From c3541b2c6f963c4c107026c4867cb3f400baa67b Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 10:06:10 +0200 Subject: [PATCH 012/399] Use the new version. --- .../examples/Linear_cell_complex/draw_linear_cell_complex.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex.cpp b/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex.cpp index 429d1c0a1c7b..48cc41de9d19 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex.cpp @@ -1,5 +1,7 @@ #include -#include +// NOTE: deprecated, would remove +// #include +#include typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; typedef LCC::Dart_handle Dart_handle; From 5d7bb6848051ee75425549d8115095c99793bf63 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 11:46:30 +0200 Subject: [PATCH 013/399] Fixed typo, added forward declaration at basic viewers. --- GraphicsView/include/CGAL/GraphicBuffer.h | 3 +- .../include/CGAL/Qt/Basic_viewer_qt.h | 139 +++++++++--------- 2 files changed, 74 insertions(+), 68 deletions(-) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 1c9755c53518..75e9a478da6f 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -147,7 +148,7 @@ template class GraphicBuffer { } void update_bounding_box(CGAL::Bbox_3& box) { - m_bounding_box += box + m_bounding_box += box; } void initiate_bounding_box(CGAL::Bbox_3 new_bounding_box) { diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 7c5227702d0b..75390e7ee24c 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -69,7 +69,11 @@ inline CGAL::IO::Color get_random_color(CGAL::Random& random) while(res.red()==255 && res.green()==255 && res.blue()==255); return res; } + +template +class GraphicBuffer; //------------------------------------------------------------------------------ +template class Basic_viewer_qt : public CGAL::QGLViewer { public: @@ -202,37 +206,37 @@ class Basic_viewer_qt : public CGAL::QGLViewer for (unsigned int i=0; i @@ -281,7 +285,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer Local_vector lpv = get_local_vector(pv); CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); - gbuffer.update_bounding_box(b); + gBuffer.update_bounding_box(b); } template @@ -321,16 +325,16 @@ class Basic_viewer_qt : public CGAL::QGLViewer template void add_text(const KPoint& kp, const QString& txt) { - gbuffer.add_text(kp, txt); + gBuffer.add_text(kp, txt); } template void add_text(const KPoint& kp, const char* txt) - { gbuffer.add_text(kp, txt); } + { gBuffer.add_text(kp, txt); } template void add_text(const KPoint& kp, const std::string& txt) - { gbuffer.add_text(kp, txt.c_str()); } + { gBuffer.add_text(kp, txt.c_str()); } bool is_a_face_started() const { @@ -384,7 +388,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer else if (gBuffer.get_buffer_for_colored_faces().is_a_face_started()) { auto colored_faces = gBuffer.get_buffer_for_colored_faces(); - return colored_faces.face_end(); + // return colored_faces.face_end(); + colored_faces.face_end(); } } @@ -538,8 +543,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer unsigned int bufn = 0; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_MONO_POINTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_MONO_POINTS).data(), + static_cast(gBuffer.get_array_of_index(POS_MONO_POINTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -555,8 +560,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_COLORED_POINTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_COLORED_POINTS).data(), + static_cast(gBuffer.get_array_of_index(POS_COLORED_POINTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); buffers[bufn].release(); @@ -564,8 +569,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(COLOR_POINTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(COLOR_POINTS).data(), + static_cast(gBuffer.get_array_of_index(COLOR_POINTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -580,8 +585,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_MONO_SEGMENTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_MONO_SEGMENTS).data(), + static_cast(gBuffer.get_array_of_index(POS_MONO_SEGMENTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -597,8 +602,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_COLORED_SEGMENTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_COLORED_SEGMENTS).data(), + static_cast(gBuffer.get_array_of_index(POS_COLORED_SEGMENTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -607,8 +612,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(COLOR_SEGMENTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(COLOR_SEGMENTS).data(), + static_cast(gBuffer.get_array_of_index(COLOR_SEGMENTS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -625,8 +630,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_MONO_RAYS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_MONO_RAYS).data(), + static_cast(gBuffer.get_array_of_index(POS_MONO_RAYS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeArray("vertex",GL_FLOAT,0,3); @@ -643,8 +648,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_COLORED_RAYS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_COLORED_RAYS).data(), + static_cast(gBuffer.get_array_of_index(POS_COLORED_RAYS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -653,8 +658,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(COLOR_RAYS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(COLOR_RAYS).data(), + static_cast(gBuffer.get_array_of_index(COLOR_RAYS).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -670,8 +675,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_MONO_LINES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_MONO_LINES).data(), + static_cast(gBuffer.get_array_of_index(POS_MONO_LINES).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeArray("vertex",GL_FLOAT,0,3); @@ -688,8 +693,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_COLORED_LINES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_COLORED_LINES).data(), + static_cast(gBuffer.get_array_of_index(POS_COLORED_LINES).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -698,8 +703,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(COLOR_LINES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(COLOR_LINES).data(), + static_cast(gBuffer.get_array_of_index(COLOR_LINES).size()*sizeof(float))); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -718,8 +723,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_MONO_FACES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_MONO_FACES).data(), + static_cast(gBuffer.get_array_of_index(POS_MONO_FACES).size()*sizeof(float))); rendering_program_face.enableAttributeArray("vertex"); rendering_program_face.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -731,14 +736,14 @@ class Basic_viewer_qt : public CGAL::QGLViewer buffers[bufn].bind(); if (m_flatShading) { - buffers[bufn].allocate(gbuffer.get_array_of_index(FLAT_NORMAL_MONO_FACES).data(), - static_cast(gbuffer.get_array_of_index(FLAT_NORMAL_MONO_FACES).size()* + buffers[bufn].allocate(gBuffer.get_array_of_index(FLAT_NORMAL_MONO_FACES).data(), + static_cast(gBuffer.get_array_of_index(FLAT_NORMAL_MONO_FACES).size()* sizeof(float))); } else { - buffers[bufn].allocate(gbuffer.get_array_of_index(SMOOTH_NORMAL_MONO_FACES).data(), - static_cast(gbuffer.get_array_of_index(SMOOTH_NORMAL_MONO_FACES).size()* + buffers[bufn].allocate(gBuffer.get_array_of_index(SMOOTH_NORMAL_MONO_FACES).data(), + static_cast(gBuffer.get_array_of_index(SMOOTH_NORMAL_MONO_FACES).size()* sizeof(float))); } rendering_program_face.enableAttributeArray("normal"); @@ -757,8 +762,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(POS_COLORED_FACES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_COLORED_FACES).data(), + static_cast(gBuffer.get_array_of_index(POS_COLORED_FACES).size()*sizeof(float))); rendering_program_face.enableAttributeArray("vertex"); rendering_program_face.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -770,14 +775,14 @@ class Basic_viewer_qt : public CGAL::QGLViewer buffers[bufn].bind(); if (m_flatShading) { - buffers[bufn].allocate(gbuffer.get_array_of_index(FLAT_NORMAL_COLORED_FACES).data(), - static_cast(gbuffer.get_array_of_index(FLAT_NORMAL_COLORED_FACES).size()* + buffers[bufn].allocate(gBuffer.get_array_of_index(FLAT_NORMAL_COLORED_FACES).data(), + static_cast(gBuffer.get_array_of_index(FLAT_NORMAL_COLORED_FACES).size()* sizeof(float))); } else { - buffers[bufn].allocate(gbuffer.get_array_of_index(SMOOTH_NORMAL_COLORED_FACES).data(), - static_cast(gbuffer.get_array_of_index(SMOOTH_NORMAL_COLORED_FACES).size()* + buffers[bufn].allocate(gBuffer.get_array_of_index(SMOOTH_NORMAL_COLORED_FACES).data(), + static_cast(gBuffer.get_array_of_index(SMOOTH_NORMAL_COLORED_FACES).size()* sizeof(float))); } rendering_program_face.enableAttributeArray("normal"); @@ -789,8 +794,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gbuffer.get_array_of_index(COLOR_FACES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(COLOR_FACES).data(), + static_cast(gBuffer.get_array_of_index(COLOR_FACES).size()*sizeof(float))); rendering_program_face.enableAttributeArray("color"); rendering_program_face.setAttributeBuffer("color",GL_FLOAT,0,3); @@ -812,8 +817,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn < NB_VBO_BUFFERS); buffers[bufn].bind(); - buffers[bufn].allocate(gbuffer.get_array_of_index(POS_CLIPPING_PLANE).data(), - static_cast(gbuffer.get_array_of_index(POS_CLIPPING_PLANE).size() * sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(POS_CLIPPING_PLANE).data(), + static_cast(gBuffer.get_array_of_index(POS_CLIPPING_PLANE).size() * sizeof(float))); rendering_program_clipping_plane.enableAttributeArray("vertex"); rendering_program_clipping_plane.setAttributeBuffer("vertex", GL_FLOAT, 0, 3); @@ -967,7 +972,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("clipPlane", clipPlane); rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_POINTS).size()/3)); + glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_POINTS).size()/3)); vao[VAO_MONO_POINTS].release(); vao[VAO_COLORED_POINTS].bind(); @@ -987,7 +992,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("clipPlane", clipPlane); rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_POINTS).size()/3)); + glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_POINTS).size()/3)); vao[VAO_COLORED_POINTS].release(); }; @@ -1026,7 +1031,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_SEGMENTS).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_SEGMENTS).size()/3)); vao[VAO_MONO_SEGMENTS].release(); vao[VAO_COLORED_SEGMENTS].bind(); @@ -1046,7 +1051,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_SEGMENTS).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_SEGMENTS).size()/3)); vao[VAO_COLORED_SEGMENTS].release(); }; @@ -1078,7 +1083,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (double)m_rays_mono_color.blue()/(double)255); rendering_program_p_l.setAttributeValue("color",color); glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_RAYS).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_RAYS).size()/3)); vao[VAO_MONO_RAYS].release(); vao[VAO_COLORED_RAYS].bind(); @@ -1095,7 +1100,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.enableAttributeArray("color"); } glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_RAYS).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_RAYS).size()/3)); vao[VAO_COLORED_RAYS].release(); rendering_program_p_l.release(); @@ -1111,7 +1116,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (double)m_lines_mono_color.blue()/(double)255); rendering_program_p_l.setAttributeValue("color",color); glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_LINES).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_LINES).size()/3)); vao[VAO_MONO_LINES].release(); rendering_program_p_l.release(); @@ -1130,7 +1135,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.enableAttributeArray("color"); } glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_LINES).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_LINES).size()/3)); vao[VAO_COLORED_LINES].release(); rendering_program_p_l.release(); @@ -1164,7 +1169,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); rendering_program_face.setUniformValue("clipPlane", clipPlane); rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(gbuffer.get_array_of_index(POS_MONO_FACES).size()/3)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_FACES).size()/3)); vao[VAO_MONO_FACES].release(); vao[VAO_COLORED_FACES].bind(); @@ -1184,7 +1189,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); rendering_program_face.setUniformValue("clipPlane", clipPlane); rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(gbuffer.get_array_of_index(POS_COLORED_FACES).size()/3)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_FACES).size()/3)); vao[VAO_COLORED_FACES].release(); }; @@ -1195,7 +1200,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_clipping_plane.bind(); vao[VAO_CLIPPING_PLANE].bind(); glLineWidth(0.1f); - glDrawArrays(GL_LINES, 0, static_cast(gbuffer.get_array_of_index(POS_CLIPPING_PLANE).size() / 3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_CLIPPING_PLANE).size() / 3)); glLineWidth(1.0f); vao[VAO_CLIPPING_PLANE].release(); rendering_program_clipping_plane.release(); @@ -1321,11 +1326,11 @@ class Basic_viewer_qt : public CGAL::QGLViewer (bounding_box().zmax() - bounding_box().zmin())); const unsigned int nbSubdivisions=30; - gbuffer.get_array_of_index(POS_CLIPPING_PLANE).clear(); + gBuffer.get_array_of_index(POS_CLIPPING_PLANE).clear(); for (unsigned int i=0; i<=nbSubdivisions; ++i) { const float pos = float(size*(2.0*i/nbSubdivisions-1.0)); - auto array = gbuffer.get_array_of_index(POS_CLIPPING_PLANE); + auto array = gBuffer.get_array_of_index(POS_CLIPPING_PLANE); array.push_back(pos); array.push_back(float(-size)); array.push_back(0.f); @@ -1610,7 +1615,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer protected: - GraphicBuffer gBuffer; + GraphicBuffer gBuffer; bool m_draw_vertices; bool m_draw_edges; From 2cc082e2ada1895975da867c8133716cae3e9928 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 12:13:04 +0200 Subject: [PATCH 014/399] Fixed typo, added local kernel. --- GraphicsView/include/CGAL/GraphicBuffer.h | 84 ++++++++++++----------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 75e9a478da6f..1a4ca391cacf 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -29,7 +29,7 @@ #include #include -#include +// #include namespace CGAL { @@ -38,6 +38,8 @@ namespace CGAL { template class GraphicBuffer { public: + + typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; GraphicBuffer(std::vector (&pos)[20], CGAL::Bbox_3 &bbox) @@ -256,55 +258,55 @@ template class GraphicBuffer { } bool is_empty() const { - return (gBuffer.get_buffer_for_mono_points().is_empty() && - gBuffer.get_buffer_for_colored_points().is_empty() && - gBuffer.get_buffer_for_mono_segments().is_empty() && - gBuffer.get_buffer_for_colored_segments().is_empty() && - gBuffer.get_buffer_for_mono_rays().is_empty() && - gBuffer.get_buffer_for_colored_rays().is_empty() && - gBuffer.get_buffer_for_mono_lines().is_empty() && - gBuffer.get_buffer_for_colored_lines().is_empty() && - gBuffer.get_buffer_for_mono_faces().is_empty() && - gBuffer.get_buffer_for_colored_faces().is_empty()); + return (m_buffer_for_mono_points.is_empty() && + m_buffer_for_colored_points.is_empty() && + m_buffer_for_mono_segments.is_empty() && + m_buffer_for_colored_segments.is_empty() && + m_buffer_for_mono_rays.is_empty() && + m_buffer_for_colored_rays.is_empty() && + m_buffer_for_mono_lines.is_empty() && + m_buffer_for_colored_lines.is_empty() && + m_buffer_for_mono_faces.is_empty() && + m_buffer_for_colored_faces.is_empty()); } bool has_zero_x() const { - return gBuffer.get_buffer_for_mono_points().has_zero_x() && - gBuffer.get_buffer_for_colored_points().has_zero_x() && - gBuffer.get_buffer_for_mono_segments().has_zero_x() && - gBuffer.get_buffer_for_colored_segments().has_zero_x() && - gBuffer.get_buffer_for_mono_faces().has_zero_x() && - gBuffer.get_buffer_for_colored_faces().has_zero_x() && - gBuffer.get_buffer_for_mono_rays().has_zero_x() && - gBuffer.get_buffer_for_colored_rays().has_zero_x() && - gBuffer.get_buffer_for_mono_lines().has_zero_x() && - gBuffer.get_buffer_for_colored_lines().has_zero_x(); + return m_buffer_for_mono_points.has_zero_x() && + m_buffer_for_colored_points.has_zero_x() && + m_buffer_for_mono_segments.has_zero_x() && + m_buffer_for_colored_segments.has_zero_x() && + m_buffer_for_mono_faces.has_zero_x() && + m_buffer_for_colored_faces.has_zero_x() && + m_buffer_for_mono_rays.has_zero_x() && + m_buffer_for_colored_rays.has_zero_x() && + m_buffer_for_mono_lines.has_zero_x() && + m_buffer_for_colored_lines.has_zero_x(); } bool has_zero_y() const { - return gBuffer.get_buffer_for_mono_points().has_zero_y() && - gBuffer.get_buffer_for_colored_points().has_zero_y() && - gBuffer.get_buffer_for_mono_segments().has_zero_y() && - gBuffer.get_buffer_for_colored_segments().has_zero_y() && - gBuffer.get_buffer_for_mono_faces().has_zero_y() && - gBuffer.get_buffer_for_colored_faces().has_zero_y() && - gBuffer.get_buffer_for_mono_rays().has_zero_y() && - gBuffer.get_buffer_for_colored_rays().has_zero_y() && - gBuffer.get_buffer_for_mono_lines().has_zero_y() && - gBuffer.get_buffer_for_colored_lines().has_zero_y(); + return m_buffer_for_mono_points.has_zero_y() && + m_buffer_for_colored_points.has_zero_y() && + m_buffer_for_mono_segments.has_zero_y() && + m_buffer_for_colored_segments.has_zero_y() && + m_buffer_for_mono_faces.has_zero_y() && + m_buffer_for_colored_faces.has_zero_y() && + m_buffer_for_mono_rays.has_zero_y() && + m_buffer_for_colored_rays.has_zero_y() && + m_buffer_for_mono_lines.has_zero_y() && + m_buffer_for_colored_lines.has_zero_y(); } bool has_zero_z() const { - return gBuffer.get_buffer_for_mono_points().has_zero_z() && - gBuffer.get_buffer_for_colored_points().has_zero_z() && - gBuffer.get_buffer_for_mono_segments().has_zero_z() && - gBuffer.get_buffer_for_colored_segments().has_zero_z() && - gBuffer.get_buffer_for_mono_faces().has_zero_z() && - gBuffer.get_buffer_for_colored_faces().has_zero_z() && - gBuffer.get_buffer_for_mono_rays().has_zero_z() && - gBuffer.get_buffer_for_colored_rays().has_zero_z() && - gBuffer.get_buffer_for_mono_lines().has_zero_z() && - gBuffer.get_buffer_for_colored_lines().has_zero_z(); + return m_buffer_for_mono_points.has_zero_z() && + m_buffer_for_colored_points.has_zero_z() && + m_buffer_for_mono_segments.has_zero_z() && + m_buffer_for_colored_segments.has_zero_z() && + m_buffer_for_mono_faces.has_zero_z() && + m_buffer_for_colored_faces.has_zero_z() && + m_buffer_for_mono_rays.has_zero_z() && + m_buffer_for_colored_rays.has_zero_z() && + m_buffer_for_mono_lines.has_zero_z() && + m_buffer_for_colored_lines.has_zero_z(); } template From 405b64edb75e26802f8356d5d8b5b7fd48357e11 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 12:46:29 +0200 Subject: [PATCH 015/399] Initial commit of filling buffers and drawing it for each data structure. --- .../CGAL/draw_linear_cell_complex_function.h | 381 ++++++++++++++++++ 1 file changed, 381 insertions(+) create mode 100644 Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h new file mode 100644 index 000000000000..984b4d2fe57b --- /dev/null +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -0,0 +1,381 @@ +// Copyright (c) 2022 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s): Mostafa Ashraf + +#ifndef CGAL_DRAW_LCC_H +#define CGAL_DRAW_LCC_H + +#include +#include + +#ifdef CGAL_USE_BASIC_VIEWER +#include + +#include +#include + +namespace CGAL { + +// Default color functor; user can change it to have its own face color +struct DefaultDrawingFunctorLCC { + /// @return true iff the volume containing dh is drawn. + template + bool draw_volume(const LCC &, typename LCC::Dart_const_handle) const { + return true; + } + /// @return true iff the face containing dh is drawn. + template + bool draw_face(const LCC &, typename LCC::Dart_const_handle) const { + return true; + } + /// @return true iff the edge containing dh is drawn. + template + bool draw_edge(const LCC &, typename LCC::Dart_const_handle) const { + return true; + } + /// @return true iff the vertex containing dh is drawn. + template + bool draw_vertex(const LCC &, typename LCC::Dart_const_handle) const { + return true; + } + + /// @return true iff the volume containing dh is drawn in wireframe. + template + bool volume_wireframe(const LCC &, typename LCC::Dart_const_handle) const { + return false; + } + /// @return true iff the face containing dh is drawn in wireframe. + template + bool face_wireframe(const LCC &, typename LCC::Dart_const_handle) const { + return false; + } + + /// @return true iff the volume containing dh is colored. + template + bool colored_volume(const LCC &, typename LCC::Dart_const_handle) const { + return true; + } + /// @return true iff the face containing dh is colored. + /// if we have also colored_volume(alcc, dh), the volume color is + /// ignored and only the face color is considered. + template + bool colored_face(const LCC &, typename LCC::Dart_const_handle) const { + return false; + } + /// @return true iff the edge containing dh is colored. + template + bool colored_edge(const LCC &, typename LCC::Dart_const_handle) const { + return false; + } + /// @return true iff the vertex containing dh is colored. + template + bool colored_vertex(const LCC &, typename LCC::Dart_const_handle) const { + return false; + } + + /// @return the color of the volume containing dh + /// used only if colored_volume(alcc, dh) and !colored_face(alcc, dh) + template + CGAL::IO::Color volume_color(const LCC &alcc, + typename LCC::Dart_const_handle dh) const { + CGAL::Random random((unsigned int)(alcc.darts().index(dh))); + return get_random_color(random); + } + /// @return the color of the face containing dh + /// used only if colored_face(alcc, dh) + template + CGAL::IO::Color face_color(const LCC &alcc, + typename LCC::Dart_const_handle dh) const { + CGAL::Random random((unsigned int)(alcc.darts().index(dh))); + return get_random_color(random); + } + /// @return the color of the edge containing dh + /// used only if colored_edge(alcc, dh) + template + CGAL::IO::Color edge_color(const LCC &alcc, + typename LCC::Dart_const_handle dh) const { + CGAL::Random random((unsigned int)(alcc.darts().index(dh))); + return get_random_color(random); + } + /// @return the color of the vertex containing dh + /// used only if colored_vertex(alcc, dh) + template + CGAL::IO::Color vertex_color(const LCC &alcc, + typename LCC::Dart_const_handle dh) const { + CGAL::Random random((unsigned int)(alcc.darts().index(dh))); + return get_random_color(random); + } +}; + +template +struct LCC_geom_utils; + +template +struct LCC_geom_utils { + static typename Local_kernel::Vector_3 + get_vertex_normal(const LCC &lcc, typename LCC::Dart_const_handle dh) { + typename Local_kernel::Vector_3 n = + internal::Geom_utils:: + get_local_vector(CGAL::compute_normal_of_cell_0(lcc, dh)); + n = n / (CGAL::sqrt(n * n)); + return n; + } +}; + +template +struct LCC_geom_utils { + static typename Local_kernel::Vector_3 + get_vertex_normal(const LCC &, typename LCC::Dart_const_handle) { + typename Local_kernel::Vector_3 n = CGAL::NULL_VECTOR; + return n; + } +}; + +// Specialization of draw function. +#define CGAL_LCC_TYPE \ + CGAL::Linear_cell_complex_base + +// #define LCC CGAL_LCC_TYPE + +// TODO? +typedef typename LCC::Dart_const_handle Dart_const_handle; +typedef typename LCC::Traits Kernel; +typedef typename Kernel::Point Point; +typedef typename Kernel::Vector Vector; + +template +void compute_face(Dart_const_handle dh, Dart_const_handle voldh, const LCC *lcc, + bool m_nofaces, bool m_random_face_color, + const DrawingFunctorLCC &m_drawing_functor, + GraphicBuffer &graphic_buffer) { + if (m_nofaces || !m_drawing_functor.draw_face(*lcc, dh)) + return; + + // 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 < min) + min = cur; + cur = lcc->next(cur); + } while (cur != dh); + + if (m_random_face_color) { + CGAL::Random random((unsigned int)(lcc->darts().index(dh))); + CGAL::IO::Color c = get_random_color(random); + graphic_buffer.face_begin(c); + } else if (m_drawing_functor.colored_face(*lcc, dh)) { + CGAL::IO::Color c = m_drawing_functor.face_color(*lcc, dh); + graphic_buffer.face_begin(c); + } else if (m_drawing_functor.colored_volume(*lcc, voldh)) { + CGAL::IO::Color c = m_drawing_functor.volume_color(*lcc, voldh); + graphic_buffer.face_begin(c); + } else { + graphic_buffer.face_begin(); + } + + cur = dh; + do { + graphic_buffer.add_point_in_face( + lcc->point(cur), + LCC_geom_utils::get_vertex_normal(*lcc, cur)); + cur = lcc->next(cur); + } while (cur != dh); + + graphic_buffer.face_end(); +} + +template +void compute_edge(Dart_const_handle dh, const LCC *lcc, + const DrawingFunctorLCC &m_drawing_functor, + GraphicBuffer &graphic_buffer) { + if (!m_drawing_functor.draw_edge(*lcc, dh)) + return; + + Point p1 = lcc->point(dh); + Dart_const_handle d2 = lcc->other_extremity(dh); + if (d2 != nullptr) { + if (m_drawing_functor.colored_edge(*lcc, dh)) { + graphic_buffer.add_segment(p1, lcc->point(d2), + m_drawing_functor.edge_color(*lcc, dh)); + } else { + graphic_buffer.add_segment(p1, lcc->point(d2)); + } + } +} + +template +void compute_vertex(Dart_const_handle dh, const LCC *lcc, + const DrawingFunctorLCC &m_drawing_functor, + GraphicBuffer &graphic_buffer) { + if (!m_drawing_functor.draw_vertex(*lcc, dh)) + return; + + if (m_drawing_functor.colored_vertex(*lcc, dh)) { + graphic_buffer.add_point(lcc->point(dh), + m_drawing_functor.vertex_color(*lcc, dh)); + } else { + graphic_buffer.add_point(lcc->point(dh)); + } +} + +template +void compute_elements(const LCC *lcc, + const DrawingFunctorLCC &m_drawing_functor, + bool m_nofaces, bool m_random_face_color, + GraphicBuffer &graphic_buffer) { + + if (lcc == nullptr) + return; + + typename LCC::size_type markvolumes = lcc->get_new_mark(); + 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(); + typename LCC::size_type oriented_mark = lcc->get_new_mark(); + + lcc->orient(oriented_mark); + + for (typename LCC::Dart_range::const_iterator it = lcc->darts().begin(), + itend = lcc->darts().end(); + it != itend; ++it) { + if (!lcc->is_marked(it, markvolumes) && + m_drawing_functor.draw_volume(*lcc, it)) { + for (typename LCC::template Dart_of_cell_basic_range<3>::const_iterator + itv = lcc->template darts_of_cell_basic<3>(it, markvolumes) + .begin(), + itvend = + lcc->template darts_of_cell_basic<3>(it, markvolumes).end(); + itv != itvend; ++itv) { + lcc->mark(itv, markvolumes); // To be sure that all darts of the basic + // iterator will be marked + if (!lcc->is_marked(itv, markfaces) && + lcc->is_marked(itv, oriented_mark) && + m_drawing_functor.draw_face(*lcc, itv)) { + if (!m_drawing_functor.volume_wireframe(*lcc, itv) && + !m_drawing_functor.face_wireframe(*lcc, itv)) { + compute_face(itv, it, lcc, m_nofaces, m_random_face_color, + m_drawing_functor, graphic_buffer); + } + for (typename LCC::template Dart_of_cell_basic_range< + 2>::const_iterator + itf = lcc->template darts_of_cell_basic<2>(itv, markfaces) + .begin(), + itfend = lcc->template darts_of_cell_basic<2>(itv, markfaces) + .end(); + itf != itfend; ++itf) { + if (!m_drawing_functor.volume_wireframe(*lcc, itv) && + !m_drawing_functor.face_wireframe(*lcc, itv)) { + lcc->mark(itf, markfaces); + } // To be sure that all darts of the basic iterator will be marked + if (!lcc->is_marked(itf, markedges) && + m_drawing_functor.draw_edge(*lcc, itf)) { + compute_edge(itf, lcc, m_drawing_functor, graphic_buffer); + for (typename LCC::template Dart_of_cell_basic_range< + 1>::const_iterator + ite = + lcc->template darts_of_cell_basic<1>(itf, markedges) + .begin(), + iteend = + lcc->template darts_of_cell_basic<1>(itf, markedges) + .end(); + ite != iteend; ++ite) { + lcc->mark(ite, markedges); // To be sure that all darts of the + // basic iterator will be marked + if (!lcc->is_marked(ite, markvertices) && + m_drawing_functor.draw_vertex(*lcc, ite)) { + compute_vertex(ite, lcc, m_drawing_functor, graphic_buffer); + CGAL::mark_cell(*lcc, ite, markvertices); + } + } + } + } + } + } + } + } + + for (typename LCC::Dart_range::const_iterator it = lcc->darts().begin(), + itend = lcc->darts().end(); + it != itend; ++it) { + lcc->unmark(it, markvertices); + lcc->unmark(it, markedges); + lcc->unmark(it, markfaces); + lcc->unmark(it, markvolumes); + lcc->unmark(it, oriented_mark); + } + + lcc->free_mark(markvolumes); + lcc->free_mark(markfaces); + lcc->free_mark(markedges); + lcc->free_mark(markvertices); + lcc->free_mark(oriented_mark); +} + +// This function is responsible for filling the buffer to allow visualization. +template +void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, + const DrawingFunctorLCC &m_drawing_functor, + const LCC *alcc = nullptr, bool nofill = false, + bool m_random_face_color = false + ) { + + if (alcc != nullptr) { + compute_elements(graphic_buffer, alcc, m_drawing_functor); + } +} + +template +void draw_buffer(GraphicBuffer &graphic_buffer) { + +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite = true; +#else + bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) { + CGAL::Qt::init_ogl_context(4, 3); + int argc = 1; + const char *argv[2] = {"lccviewer", nullptr}; + QApplication app(argc, const_cast(argv)); + + Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); + + basic_viewer.show(); + app.exec(); + } +} + +template class Map, + class Refs, class Storage_, + class DrawingFunctorLCC = DefaultDrawingFunctorLCC> +void draw(const CGAL_LCC_TYPE &alcc, + const char *title = "LCC for CMap Basic Viewer", bool nofill = false, + const DrawingFunctorLCC &drawing_functor = DrawingFunctorLCC()) { + GraphicBuffer buffer; + add_in_graphic_buffer_lcc(buffer, drawing_functor, &alcc, nofill, false); + draw_buffer(buffer); +} + +// Todo a function taking a const DrawingFunctorLCC& drawing_functor as +// parameter +#undef CGAL_LCC_TYPE + +} // End namespace CGAL + +#endif // CGAL_USE_BASIC_VIEWER + +#endif // CGAL_DRAW_LCC_H From e050176613818d03c8365a6c182b8f4791636daa Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 12:47:29 +0200 Subject: [PATCH 016/399] Removed forward declaration. --- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 75390e7ee24c..8e909e6fed87 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -70,8 +70,6 @@ inline CGAL::IO::Color get_random_color(CGAL::Random& random) return res; } -template -class GraphicBuffer; //------------------------------------------------------------------------------ template class Basic_viewer_qt : public CGAL::QGLViewer From 0bc2f1050f653eb4d7e9a9ab9791de1fbafe1bea Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 12:48:29 +0200 Subject: [PATCH 017/399] Small modifications --- GraphicsView/include/CGAL/GraphicBuffer.h | 28 +++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 1a4ca391cacf..82ff62e04e59 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -13,6 +13,14 @@ #define CGAL_GRAPHIC_BUFFER_H #include +#include + +#include +#include +#include +#include +#include +#include #include #include @@ -24,9 +32,6 @@ #include #include -#include -#include -#include #include // #include @@ -35,10 +40,10 @@ namespace CGAL { // This class is responsible for dealing with available CGAL data structures and // handling buffers. -template class GraphicBuffer { +template +class GraphicBuffer { public: - typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; @@ -141,17 +146,11 @@ template class GraphicBuffer { return m_buffer_for_clipping_plane; } - const CGAL::Bbox_3 &get_bounding_box() const { - return m_bounding_box; - } + const CGAL::Bbox_3 &get_bounding_box() const { return m_bounding_box; } - std::vector& get_array_of_index(int index) { - return arrays[index]; - } + std::vector &get_array_of_index(int index) { return arrays[index]; } - void update_bounding_box(CGAL::Bbox_3& box) { - m_bounding_box += box; - } + void update_bounding_box(CGAL::Bbox_3 &box) { m_bounding_box += box; } void initiate_bounding_box(CGAL::Bbox_3 new_bounding_box) { m_bounding_box = new_bounding_box; @@ -330,7 +329,6 @@ template class GraphicBuffer { add_text(kp, txt.c_str()); } - protected: // The following enum gives the indices of different elements of arrays // vectors. From 01289f62217a8f8a7a311c7302159b7505643e2b Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 17:59:37 +0200 Subject: [PATCH 018/399] Trying to solve warninggit add GraphicsView/include/CGAL/GraphicBuffer.h --- GraphicsView/include/CGAL/GraphicBuffer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 82ff62e04e59..65f9160b0c3d 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -13,6 +13,7 @@ #define CGAL_GRAPHIC_BUFFER_H #include +// BUG: Warning - TODO? #include #include From 02cf9a1999de156b5b75daf1ab98ab3b8d7c1599 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 18:00:40 +0200 Subject: [PATCH 019/399] Trying to solve warning --- GraphicsView/include/CGAL/GraphicBuffer.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 65f9160b0c3d..35c2e902215b 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -14,6 +14,11 @@ #include // BUG: Warning - TODO? +/* +#include errors detected. Please update your includePath. ' +Squiggles are disabled for this translation unit + +*/ #include #include From 0f7d0c5c9248a3bdce75d9b6232e21a27b5a4bed Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 18:03:52 +0200 Subject: [PATCH 020/399] Fixed Dart_const_handle error --- .../CGAL/draw_linear_cell_complex_function.h | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index 984b4d2fe57b..919e8f40208e 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -12,8 +12,8 @@ #ifndef CGAL_DRAW_LCC_H #define CGAL_DRAW_LCC_H -#include #include +#include #ifdef CGAL_USE_BASIC_VIEWER #include @@ -138,24 +138,22 @@ struct LCC_geom_utils { } }; -// Specialization of draw function. -#define CGAL_LCC_TYPE \ - CGAL::Linear_cell_complex_base - // #define LCC CGAL_LCC_TYPE // TODO? -typedef typename LCC::Dart_const_handle Dart_const_handle; -typedef typename LCC::Traits Kernel; -typedef typename Kernel::Point Point; -typedef typename Kernel::Vector Vector; -template -void compute_face(Dart_const_handle dh, Dart_const_handle voldh, const LCC *lcc, + +template +void compute_face(typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, const LCC *lcc, bool m_nofaces, bool m_random_face_color, const DrawingFunctorLCC &m_drawing_functor, GraphicBuffer &graphic_buffer) { + + typedef typename LCC::Dart_const_handle Dart_const_handle; + typedef typename LCC::Traits Kernel; + typedef typename Kernel::Point Point; + typedef typename Kernel::Vector Vector; + if (m_nofaces || !m_drawing_functor.draw_face(*lcc, dh)) return; @@ -196,9 +194,13 @@ void compute_face(Dart_const_handle dh, Dart_const_handle voldh, const LCC *lcc, } template -void compute_edge(Dart_const_handle dh, const LCC *lcc, +void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, GraphicBuffer &graphic_buffer) { + typedef typename LCC::Dart_const_handle Dart_const_handle; + typedef typename LCC::Traits Kernel; + typedef typename Kernel::Point Point; + if (!m_drawing_functor.draw_edge(*lcc, dh)) return; @@ -215,7 +217,7 @@ void compute_edge(Dart_const_handle dh, const LCC *lcc, } template -void compute_vertex(Dart_const_handle dh, const LCC *lcc, +void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, GraphicBuffer &graphic_buffer) { if (!m_drawing_functor.draw_vertex(*lcc, dh)) @@ -357,6 +359,11 @@ void draw_buffer(GraphicBuffer &graphic_buffer) { } } +// Specialization of draw function. +#define CGAL_LCC_TYPE \ + CGAL::Linear_cell_complex_base + template class Map, From c85f775651fe765ad2ab4e64354d0eacfcfce6c6 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 20 Jul 2022 18:05:42 +0200 Subject: [PATCH 021/399] TODO --- .../include/CGAL/draw_linear_cell_complex_function.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index 919e8f40208e..cace65d7e300 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -337,6 +337,7 @@ void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, } } +// TODO: Move to Basic_viewer_qt.h template void draw_buffer(GraphicBuffer &graphic_buffer) { From a68ad47df0f84fe6c9da2654156540737ab56f0c Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 22 Jul 2022 15:17:44 +0200 Subject: [PATCH 022/399] Local_Kernel error during compiling --- .../CGAL/draw_linear_cell_complex_function.h | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index cace65d7e300..afab1cf2f058 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -12,8 +12,8 @@ #ifndef CGAL_DRAW_LCC_H #define CGAL_DRAW_LCC_H -#include #include +#include #ifdef CGAL_USE_BASIC_VIEWER #include @@ -138,13 +138,10 @@ struct LCC_geom_utils { } }; -// #define LCC CGAL_LCC_TYPE - -// TODO? - -template -void compute_face(typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, const LCC *lcc, +template +void compute_face(typename LCC::Dart_const_handle dh, + typename LCC::Dart_const_handle voldh, const LCC *lcc, bool m_nofaces, bool m_random_face_color, const DrawingFunctorLCC &m_drawing_functor, GraphicBuffer &graphic_buffer) { @@ -232,10 +229,9 @@ void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, } template -void compute_elements(const LCC *lcc, +void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, - bool m_nofaces, bool m_random_face_color, - GraphicBuffer &graphic_buffer) { + bool m_nofaces, bool m_random_face_color) { if (lcc == nullptr) return; @@ -327,13 +323,13 @@ void compute_elements(const LCC *lcc, // This function is responsible for filling the buffer to allow visualization. template void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, - const DrawingFunctorLCC &m_drawing_functor, + const DrawingFunctorLCC &m_drawing_functor, const LCC *alcc = nullptr, bool nofill = false, - bool m_random_face_color = false - ) { + bool m_random_face_color = false) { if (alcc != nullptr) { - compute_elements(graphic_buffer, alcc, m_drawing_functor); + compute_elements(graphic_buffer, alcc, m_drawing_functor, nofill, + m_random_face_color); } } From 9d0fb1e2899db6f4645e7c8532f97752dbd0ea5f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 22 Jul 2022 18:27:58 +0200 Subject: [PATCH 023/399] Correction of draw_linear_cell_complex_function --- .../include/CGAL/draw_linear_cell_complex_function.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index afab1cf2f058..50e23994a069 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -114,6 +114,13 @@ struct DefaultDrawingFunctorLCC { } }; + namespace draw_function + { + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; +typedef Local_kernel::Point_3 Local_point; +typedef Local_kernel::Vector_3 Local_vector; + template struct LCC_geom_utils; @@ -320,6 +327,8 @@ void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, lcc->free_mark(oriented_mark); } +} // namespace draw_function + // This function is responsible for filling the buffer to allow visualization. template void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, @@ -328,7 +337,7 @@ void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, bool m_random_face_color = false) { if (alcc != nullptr) { - compute_elements(graphic_buffer, alcc, m_drawing_functor, nofill, + draw_function::compute_elements(graphic_buffer, alcc, m_drawing_functor, nofill, m_random_face_color); } } From 1dcca825bd506d245a0b857aa802677eae7459f0 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 25 Jul 2022 15:05:35 +0200 Subject: [PATCH 024/399] Move vector of texts --- GraphicsView/include/CGAL/GraphicBuffer.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 35c2e902215b..d2ff2d6e1df3 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -335,6 +335,18 @@ class GraphicBuffer { add_text(kp, txt.c_str()); } + void m_texts_clear() { + m_texts.clear(); + } + + int m_texts_size() { + return m_texts.size(); + } + + std::vector>& get_m_texts() { + return m_texts; + } + protected: // The following enum gives the indices of different elements of arrays // vectors. From b8509e4da1f6159dba9999ee0bbc118ff86bf309 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 25 Jul 2022 15:08:18 +0200 Subject: [PATCH 025/399] Fixed bugs, migrated variables to graphics buffer, and removes unneeded variables. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 8e909e6fed87..de94f6e40cfc 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -208,7 +208,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer } gBuffer.initiate_bounding_box(CGAL::Bbox_3()); - m_texts.clear(); + gBuffer.m_texts_clear(); } bool is_empty() const @@ -218,7 +218,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer const CGAL::Bbox_3& bounding_box() const { - auto bounding_box = gBuffer.get_bounding_box(); + const auto& bounding_box = gBuffer.get_bounding_box(); return bounding_box; } @@ -1260,14 +1260,15 @@ class Basic_viewer_qt : public CGAL::QGLViewer if (m_draw_text) { glDisable(GL_LIGHTING); - for (std::size_t i=0; iprojectedCoordinatesOf - (CGAL::qglviewer::Vec(std::get<0>(m_texts[i]).x(), - std::get<0>(m_texts[i]).y(), - std::get<0>(m_texts[i]).z())); + (CGAL::qglviewer::Vec(std::get<0>(m_texts_vec[i]).x(), + std::get<0>(m_texts_vec[i]).y(), + std::get<0>(m_texts_vec[i]).z())); - drawText((int)screenPos[0], (int)screenPos[1], std::get<1>(m_texts[i])); + drawText((int)screenPos[0], (int)screenPos[1], std::get<1>(m_texts_vec[i])); } glEnable(GL_LIGHTING); } @@ -1328,7 +1329,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer for (unsigned int i=0; i<=nbSubdivisions; ++i) { const float pos = float(size*(2.0*i/nbSubdivisions-1.0)); - auto array = gBuffer.get_array_of_index(POS_CLIPPING_PLANE); + auto& array = gBuffer.get_array_of_index(POS_CLIPPING_PLANE); array.push_back(pos); array.push_back(float(-size)); array.push_back(0.f); @@ -1650,8 +1651,6 @@ class Basic_viewer_qt : public CGAL::QGLViewer QVector4D m_ambient_color; bool m_are_buffers_initialized; - // TODO: deprecated, would remove! - CGAL::Bbox_3 m_bounding_box; // CGAL::qglviewer::LocalConstraint constraint; CGAL::qglviewer::WorldConstraint constraint; @@ -1687,8 +1686,6 @@ class Basic_viewer_qt : public CGAL::QGLViewer END_NORMAL, LAST_INDEX=END_NORMAL }; - // TODO: deprecated, would remove! - std::vector arrays[LAST_INDEX]; static const unsigned int NB_VBO_BUFFERS=(END_POS-BEGIN_POS)+ (END_COLOR-BEGIN_COLOR)+2; // +2 for 2 vectors of normals @@ -1720,8 +1717,6 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool clipping_plane_rendering = true; // will be toggled when alt+c is pressed, which is used for indicating whether or not to render the clipping plane ; float clipping_plane_rendering_transparency = 0.5f; // to what extent the transparent part should be rendered; - // TODO: deprecated, would remove! - std::vector > m_texts; }; } // End namespace CGAL From c8c068ecff0db9325624c0c2a4e97dbbfc8f1ff6 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 25 Jul 2022 19:45:45 +0200 Subject: [PATCH 026/399] Moved draw_buffer function. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 25 +++++++++++++++++++ .../CGAL/draw_linear_cell_complex_function.h | 24 ------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index de94f6e40cfc..f2943cc11dc0 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -53,6 +53,7 @@ #include #include #include +#include namespace CGAL { @@ -1719,6 +1720,30 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; +template +void draw_buffer(GraphicBuffer &graphic_buffer) { + +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite = true; +#else + bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) { + CGAL::Qt::init_ogl_context(4, 3); + // Qt::init_ogl_context(4, 3); + + int argc = 1; + const char *argv[2] = {"lccviewer", nullptr}; + QApplication app(argc, const_cast(argv)); + + Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); + + basic_viewer.show(); + app.exec(); + } +} + } // End namespace CGAL #else // CGAL_USE_BASIC_VIEWER diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index 50e23994a069..615eb3d6a4a1 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -16,7 +16,6 @@ #include #ifdef CGAL_USE_BASIC_VIEWER -#include #include #include @@ -342,29 +341,6 @@ void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, } } -// TODO: Move to Basic_viewer_qt.h -template -void draw_buffer(GraphicBuffer &graphic_buffer) { - -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite = true; -#else - bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif - - if (!cgal_test_suite) { - CGAL::Qt::init_ogl_context(4, 3); - int argc = 1; - const char *argv[2] = {"lccviewer", nullptr}; - QApplication app(argc, const_cast(argv)); - - Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); - - basic_viewer.show(); - app.exec(); - } -} - // Specialization of draw function. #define CGAL_LCC_TYPE \ CGAL::Linear_cell_complex_base Date: Wed, 31 Aug 2022 10:51:30 +0200 Subject: [PATCH 027/399] Removed nofill redundant, added formatting. --- .../CGAL/draw_linear_cell_complex_function.h | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index 615eb3d6a4a1..df8d313f7731 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -7,7 +7,8 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s): Mostafa Ashraf +// Author(s): Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_LCC_H #define CGAL_DRAW_LCC_H @@ -113,13 +114,12 @@ struct DefaultDrawingFunctorLCC { } }; - namespace draw_function - { - +namespace draw_function { + typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; -typedef Local_kernel::Point_3 Local_point; +typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; - + template struct LCC_geom_utils; @@ -144,7 +144,6 @@ struct LCC_geom_utils { } }; - template void compute_face(typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, const LCC *lcc, @@ -328,16 +327,23 @@ void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, } // namespace draw_function -// This function is responsible for filling the buffer to allow visualization. +/** + * @brief This function is responsible for filling the buffer to allow + * visualization. + * + * @param graphic_buffer + * @param m_drawing_functor + * @param alcc + */ template void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, const DrawingFunctorLCC &m_drawing_functor, - const LCC *alcc = nullptr, bool nofill = false, + const LCC *alcc = nullptr, bool m_random_face_color = false) { if (alcc != nullptr) { - draw_function::compute_elements(graphic_buffer, alcc, m_drawing_functor, nofill, - m_random_face_color); + draw_function::compute_elements(graphic_buffer, alcc, m_drawing_functor, + m_random_face_color); } } @@ -352,10 +358,10 @@ template void draw(const CGAL_LCC_TYPE &alcc, - const char *title = "LCC for CMap Basic Viewer", bool nofill = false, + const char *title = "LCC for CMap Basic Viewer", const DrawingFunctorLCC &drawing_functor = DrawingFunctorLCC()) { GraphicBuffer buffer; - add_in_graphic_buffer_lcc(buffer, drawing_functor, &alcc, nofill, false); + add_in_graphic_buffer_lcc(buffer, drawing_functor, &alcc, false); draw_buffer(buffer); } From 8e3b1bef758aa461908e227a4628567e23b4b34c Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Wed, 31 Aug 2022 11:06:07 +0200 Subject: [PATCH 028/399] Fix typo bug in the variable name. --- .../include/CGAL/draw_linear_cell_complex_function.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index df8d313f7731..2990c02778ce 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -334,16 +334,17 @@ void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, * @param graphic_buffer * @param m_drawing_functor * @param alcc + * @param anofaces if true, do not draw faces. */ template void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, const DrawingFunctorLCC &m_drawing_functor, - const LCC *alcc = nullptr, + const LCC *alcc = nullptr, bool nofaces = false, bool m_random_face_color = false) { if (alcc != nullptr) { draw_function::compute_elements(graphic_buffer, alcc, m_drawing_functor, - m_random_face_color); + nofaces, m_random_face_color); } } From ebc4b65607c61ad5a43e8b1f2fd88bd69b4401ce Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 5 Sep 2022 08:37:31 +0200 Subject: [PATCH 029/399] Initial commit for modifying demo. --- .../demo/Linear_cell_complex/Viewer.cpp | 58 +++++++++++-------- .../demo/Linear_cell_complex/Viewer.h | 11 +++- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index dafcccb16951..6187787bc19c 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -9,44 +9,54 @@ // // Author(s) : Guillaume Damiand // Contributor(s): Kumar Snehasish +// Mostafa Ashraf // #include "Viewer.h" #include -Viewer::Viewer(QWidget* parent) : - Base(parent, nullptr, ""), - m_previous_scene_empty(true) -{} +Viewer::Viewer(QWidget *parent) + // TODO: add a new constructor that does not take graphic buffer. + : Base(parent, ""), m_drawing_functor(MyDrawingFunctorLCC()), + m_nofaces(false), m_random_face_color(false), + m_previous_scene_empty(true) {} -void Viewer::setScene(Scene* scene_, bool doredraw) -{ +void Viewer::setScene(Scene *scene_, bool doredraw) { scene = scene_; - set_lcc(scene->lcc, doredraw); + + if (scene->lcc != nullptr) { + compute_elements(gBuffer, scene->lcc, m_drawing_functor, m_nofaces, + m_random_face_color); + } + + if (doredraw) { + Base::redraw(); + } } -void Viewer::sceneChanged() -{ - Base::compute_elements(); - this->camera()-> - setSceneBoundingBox(CGAL::qglviewer::Vec(m_bounding_box.xmin(), - m_bounding_box.ymin(), - m_bounding_box.zmin()), - CGAL::qglviewer::Vec(m_bounding_box.xmax(), - m_bounding_box.ymax(), - m_bounding_box.zmax())); +void Viewer::sceneChanged() { + compute_elements(gBuffer, scene->lcc, m_drawing_functor, m_nofaces, + m_random_face_color); + + this->camera()->setSceneBoundingBox( + CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(), + gBuffer.get_bounding_box().ymin(), + gBuffer.get_bounding_box().zmin()), + CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmax(), + gBuffer.get_bounding_box().ymax(), + gBuffer.get_bounding_box().zmax())); Base::redraw(); - if (m_previous_scene_empty) - { this->showEntireScene(); } + if (m_previous_scene_empty) { + this->showEntireScene(); + } - m_previous_scene_empty = scene->lcc->is_empty(); // for the next call to sceneChanged + m_previous_scene_empty = + scene->lcc->is_empty(); // for the next call to sceneChanged } -void Viewer::keyPressEvent(QKeyEvent *e) -{ +void Viewer::keyPressEvent(QKeyEvent *e) { // const Qt::KeyboardModifiers modifiers = e->modifiers(); Base::keyPressEvent(e); } -QString Viewer::helpString() const -{ return Base::helpString("LCC Demo"); } +QString Viewer::helpString() const { return Base::helpString("LCC Demo"); } diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 18e66603ef45..f25f73de78a3 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -9,12 +9,15 @@ // // Author(s) : Guillaume Damiand // Kumar Snehasish +// Mostafa Ashraf // #ifndef VIEWER_H #define VIEWER_H #include "typedefs.h" -#include + +#include +#include // Functor used by SimpleLCCViewerQt to colorize of not elements. struct MyDrawingFunctorLCC @@ -104,11 +107,11 @@ struct MyDrawingFunctorLCC }; -class Viewer : public CGAL::SimpleLCCViewerQt +class Viewer : public Basic_viewer_qt { Q_OBJECT - typedef CGAL::SimpleLCCViewerQt Base; + typedef CGAL::Basic_viewer_qt Base; public: Viewer(QWidget* parent); @@ -120,6 +123,8 @@ public Q_SLOTS: void sceneChanged(); private: + const DrawingFunctorLCC &m_drawing_functor; + bool m_nofaces, m_random_face_color; Scene* scene; bool m_previous_scene_empty; }; From ca7ae5f8789d2c4cbd6c774c047792b406926175 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 5 Sep 2022 09:22:36 +0200 Subject: [PATCH 030/399] Initial commit for generic functors with and without volume for faces, edges, and vertices. --- .../CGAL/draw_linear_cell_complex_function.h | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index 2990c02778ce..efd64ff4271e 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -23,6 +23,7 @@ namespace CGAL { +// This functor draws all faces, edges, and vertices. // Default color functor; user can change it to have its own face color struct DefaultDrawingFunctorLCC { /// @return true iff the volume containing dh is drawn. @@ -114,6 +115,91 @@ struct DefaultDrawingFunctorLCC { } }; +// TODO: these functors will modify a specific face, edge, and vertex. +struct DefaultDrawingFunctorX { + + template + bool draw_face(const DS &, typename DS::Dart_const_handle) const { + return true; + } + + template + bool draw_edge(const DS &, typename DS::Dart_const_handle) const { + return true; + } + + template + bool draw_vertex(const DS &, typename DS::Dart_const_handle) const { + return true; + } + + template + bool face_wireframe(const DS &, typename DS::Dart_const_handle) const { + return false; + } + + template + bool colored_face(const DS &, typename DS::Dart_const_handle) const { + return false; + } + + template + bool colored_edge(const DS &, typename DS::Dart_const_handle) const { + return false; + } + + template + bool colored_vertex(const DS &, typename DS::Dart_const_handle) const { + return false; + } + + template + CGAL::IO::Color face_color(const DS &aVal, + typename DS::Dart_const_handle dh) const { + CGAL::Random random((unsigned int)(aVal.darts().index(dh))); + return get_random_color(random); + } + + template + CGAL::IO::Color edge_color(const DS &aVal, + typename DS::Dart_const_handle dh) const { + CGAL::Random random((unsigned int)(aVal.darts().index(dh))); + return get_random_color(random); + } + + template + CGAL::IO::Color vertex_color(const DS &aVal, + typename DS::Dart_const_handle dh) const { + CGAL::Random random((unsigned int)(aVal.darts().index(dh))); + return get_random_color(random); + } +}; + +struct DefaultDrawingFunctorXWithVoulume : public DefaultDrawingFunctorX { + + template + bool draw_volume(const DS &, typename DS::Dart_const_handle) const { + return true; + } + + template + CGAL::IO::Color volume_color(const DS &aVal, + typename LCC::Dart_const_handle dh) const { + CGAL::Random random((unsigned int)(aVal.darts().index(dh))); + return get_random_color(random); + } + + template + bool volume_wireframe(const DS &, typename DS::Dart_const_handle) const { + return false; + } + + template + bool colored_volume(const DS &, typename DS::Dart_const_handle) const { + return true; + } +}; + namespace draw_function { typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; From 382aa602d7321d82384d91ee4be9c139ee7e2b53 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 10 Sep 2022 21:19:17 +0200 Subject: [PATCH 031/399] Error in build didn't see gBuffer, and add_in_graphic_buffer_lcc --- .../demo/Linear_cell_complex/Viewer.cpp | 14 +++++++------- .../demo/Linear_cell_complex/Viewer.h | 11 +++++++---- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index 6187787bc19c..75ce3dce7c2f 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -16,17 +16,16 @@ #include Viewer::Viewer(QWidget *parent) - // TODO: add a new constructor that does not take graphic buffer. - : Base(parent, ""), m_drawing_functor(MyDrawingFunctorLCC()), - m_nofaces(false), m_random_face_color(false), + : Base(parent, ""), m_drawing_functor_(MyDrawingFunctorLCC()), + m_nofaces_(false), m_random_face_color_(false), m_previous_scene_empty(true) {} void Viewer::setScene(Scene *scene_, bool doredraw) { scene = scene_; if (scene->lcc != nullptr) { - compute_elements(gBuffer, scene->lcc, m_drawing_functor, m_nofaces, - m_random_face_color); + CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor_, scene->lcc, m_nofaces_, + m_random_face_color_); } if (doredraw) { @@ -35,8 +34,9 @@ void Viewer::setScene(Scene *scene_, bool doredraw) { } void Viewer::sceneChanged() { - compute_elements(gBuffer, scene->lcc, m_drawing_functor, m_nofaces, - m_random_face_color); + + CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor_, scene->lcc, + m_nofaces_, m_random_face_color_); this->camera()->setSceneBoundingBox( CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(), diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index f25f73de78a3..cd86e1530838 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -16,7 +16,10 @@ #include "typedefs.h" -#include +// QUESTION: When I added this line compiler tell me "No such file or directory!" how? +// #include + +#include #include // Functor used by SimpleLCCViewerQt to colorize of not elements. @@ -107,7 +110,7 @@ struct MyDrawingFunctorLCC }; -class Viewer : public Basic_viewer_qt +class Viewer : public CGAL::Basic_viewer_qt { Q_OBJECT @@ -123,8 +126,8 @@ public Q_SLOTS: void sceneChanged(); private: - const DrawingFunctorLCC &m_drawing_functor; - bool m_nofaces, m_random_face_color; + const MyDrawingFunctorLCC &m_drawing_functor_; + bool m_nofaces_, m_random_face_color_; Scene* scene; bool m_previous_scene_empty; }; From b61722fb1c29b40be032a73d7256ff0e0a9ff754 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 10 Sep 2022 21:22:18 +0200 Subject: [PATCH 032/399] Added template inheritance. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index f2943cc11dc0..b2265ee32d14 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -9,6 +9,7 @@ // // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_BASIC_VIEWER_QT_H #define CGAL_BASIC_VIEWER_QT_H @@ -83,6 +84,28 @@ class Basic_viewer_qt : public CGAL::QGLViewer // Constructor/Destructor Basic_viewer_qt(QWidget* parent, GraphicBuffer<>& buf, + const char* title="", + bool draw_vertices=false, + bool draw_edges=true, + bool draw_faces=true, + bool use_mono_color=false, + bool inverse_normal=false, + bool draw_rays=true, + bool draw_lines=true, + bool draw_text=true, + bool no_2D_mode=false): + Basic_viewer_qt(parent, title, draw_vertices, + draw_edges, + draw_faces, + use_mono_color, + inverse_normal, + draw_rays, + draw_lines, + draw_text, + no_2D_mode), gBuffer(buf){} + + + Basic_viewer_qt(QWidget* parent, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -114,8 +137,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer m_lines_mono_color(0, 0, 0), m_faces_mono_color(60, 60, 200), m_ambient_color(0.6f, 0.5f, 0.5f, 0.5f), - m_are_buffers_initialized(false), - gBuffer(buf) + m_are_buffers_initialized(false) { // Define 'Control+Q' as the new exit shortcut (default was 'Escape') setShortcut(qglviewer::EXIT_VIEWER, ::Qt::CTRL, ::Qt::Key_Q); @@ -1720,6 +1742,12 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; +/** + * @brief + * + * @tparam BufferType + * @param graphic_buffer + */ template void draw_buffer(GraphicBuffer &graphic_buffer) { From 156ea1a1c94ebe71f1cb2a6ffb21caa4b46298f6 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 10 Sep 2022 21:52:39 +0200 Subject: [PATCH 033/399] Edit generic functor. --- .../CGAL/draw_linear_cell_complex_function.h | 75 +++++++++++-------- 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index efd64ff4271e..4b218c7431dd 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -118,58 +118,65 @@ struct DefaultDrawingFunctorLCC { // TODO: these functors will modify a specific face, edge, and vertex. struct DefaultDrawingFunctorX { - template - bool draw_face(const DS &, typename DS::Dart_const_handle) const { + template + bool draw_face(const DS &, face_handle handle) const { return true; } - template - bool draw_edge(const DS &, typename DS::Dart_const_handle) const { + template + bool draw_edge(const DS &, edge_handle handle) const { return true; } - template - bool draw_vertex(const DS &, typename DS::Dart_const_handle) const { + template + bool draw_vertex(const DS &, vertex_handle handle) const { return true; } - template + template bool face_wireframe(const DS &, typename DS::Dart_const_handle) const { return false; } - template - bool colored_face(const DS &, typename DS::Dart_const_handle) const { + template + bool colored_face(const DS &, face_handle handle) const { return false; } - template - bool colored_edge(const DS &, typename DS::Dart_const_handle) const { + template + bool colored_edge(const DS &, edge_handle handle) const { return false; } - template - bool colored_vertex(const DS &, typename DS::Dart_const_handle) const { + template + bool colored_vertex(const DS &, vertex_handle handle) const { return false; } - template - CGAL::IO::Color face_color(const DS &aVal, - typename DS::Dart_const_handle dh) const { + template + CGAL::IO::Color face_color(const DS &aVal, face_handle dh) const { CGAL::Random random((unsigned int)(aVal.darts().index(dh))); return get_random_color(random); } - template - CGAL::IO::Color edge_color(const DS &aVal, - typename DS::Dart_const_handle dh) const { + template + CGAL::IO::Color edge_color(const DS &aVal, edge_handle dh) const { CGAL::Random random((unsigned int)(aVal.darts().index(dh))); return get_random_color(random); } - template - CGAL::IO::Color vertex_color(const DS &aVal, - typename DS::Dart_const_handle dh) const { + template + CGAL::IO::Color vertex_color(const DS &aVal, vertex_handle dh) const { CGAL::Random random((unsigned int)(aVal.darts().index(dh))); return get_random_color(random); } @@ -177,25 +184,29 @@ struct DefaultDrawingFunctorX { struct DefaultDrawingFunctorXWithVoulume : public DefaultDrawingFunctorX { - template - bool draw_volume(const DS &, typename DS::Dart_const_handle) const { + template + bool draw_volume(const DS &, volume_handle) const { return true; } - template + template CGAL::IO::Color volume_color(const DS &aVal, - typename LCC::Dart_const_handle dh) const { + volume_handle dh) const { CGAL::Random random((unsigned int)(aVal.darts().index(dh))); return get_random_color(random); } - template - bool volume_wireframe(const DS &, typename DS::Dart_const_handle) const { + template + bool volume_wireframe(const DS &, volume_handle) const { return false; } - template - bool colored_volume(const DS &, typename DS::Dart_const_handle) const { + template + bool colored_volume(const DS &, volume_handle) const { return true; } }; @@ -444,9 +455,13 @@ template class Map, class Refs, class Storage_, class DrawingFunctorLCC = DefaultDrawingFunctorLCC> + // TODO: I'll add it again after done LCC demo. + // class DrawingFunctorLCC = DefaultDrawingFunctorXWithVoulume> void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer", const DrawingFunctorLCC &drawing_functor = DrawingFunctorLCC()) { + // TODO: I'll add it again after done LCC demo. + // const DrawingFunctorLCC &drawing_functor = DefaultDrawingFunctorXWithVoulume()) { GraphicBuffer buffer; add_in_graphic_buffer_lcc(buffer, drawing_functor, &alcc, false); draw_buffer(buffer); From 6076849ea5fa14b0d131a2f53eb085d7572950ce Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 12 Sep 2022 10:55:37 +0200 Subject: [PATCH 034/399] Update for basic viewer --- GraphicsView/include/CGAL/Buffer_for_vao.h | 3 ++- GraphicsView/include/CGAL/GraphicBuffer.h | 16 +++++++++++ .../include/CGAL/Qt/Basic_viewer_qt.h | 27 +++---------------- .../demo/Linear_cell_complex/Viewer.cpp | 8 +++--- .../demo/Linear_cell_complex/Viewer.h | 11 ++++---- .../include/CGAL/draw_linear_cell_complex.h | 8 +++--- 6 files changed, 34 insertions(+), 39 deletions(-) diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index 882bf7c98d7f..6847863fc64e 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -163,7 +163,8 @@ class Buffer_for_vao if (m_index_buffer!=nullptr) { m_index_buffer->clear(); } if (m_flat_normal_buffer!=nullptr) { m_flat_normal_buffer->clear(); } if (m_gouraud_normal_buffer!=nullptr) { m_gouraud_normal_buffer->clear(); } - + if (m_bb!=nullptr) { (*m_bb)=CGAL::Bbox_3(); } + m_zero_x=true; m_zero_y=true; m_zero_z=true; diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index d2ff2d6e1df3..1381eaf99b6b 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -314,6 +314,22 @@ class GraphicBuffer { m_buffer_for_colored_lines.has_zero_z(); } + void clear() + { + m_buffer_for_mono_points.clear(); + m_buffer_for_colored_points.clear(); + m_buffer_for_mono_segments.clear(); + m_buffer_for_colored_segments.clear(); + m_buffer_for_mono_rays.clear(); + m_buffer_for_colored_rays.clear(); + m_buffer_for_mono_lines.clear(); + m_buffer_for_colored_lines.clear(); + m_buffer_for_mono_faces.clear(); + m_buffer_for_colored_faces.clear(); + m_buffer_for_clipping_plane.clear(); + m_texts.clear(); + } + template static Local_point get_local_point(const KPoint &p) { return internal::Geom_utils::Kernel, diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index b2265ee32d14..98709c811f90 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -83,29 +83,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer // Constructor/Destructor Basic_viewer_qt(QWidget* parent, - GraphicBuffer<>& buf, - const char* title="", - bool draw_vertices=false, - bool draw_edges=true, - bool draw_faces=true, - bool use_mono_color=false, - bool inverse_normal=false, - bool draw_rays=true, - bool draw_lines=true, - bool draw_text=true, - bool no_2D_mode=false): - Basic_viewer_qt(parent, title, draw_vertices, - draw_edges, - draw_faces, - use_mono_color, - inverse_normal, - draw_rays, - draw_lines, - draw_text, - no_2D_mode), gBuffer(buf){} - - - Basic_viewer_qt(QWidget* parent, + GraphicBuffer& buf, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -117,6 +95,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool draw_text=true, bool no_2D_mode=false) : CGAL::QGLViewer(parent), + gBuffer(buf), m_draw_vertices(draw_vertices), m_draw_edges(draw_edges), m_draw_rays(draw_rays), @@ -1637,7 +1616,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer protected: - GraphicBuffer gBuffer; + GraphicBuffer& gBuffer; bool m_draw_vertices; bool m_draw_edges; diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index 75ce3dce7c2f..a41f174d92a5 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -16,9 +16,9 @@ #include Viewer::Viewer(QWidget *parent) - : Base(parent, ""), m_drawing_functor_(MyDrawingFunctorLCC()), - m_nofaces_(false), m_random_face_color_(false), - m_previous_scene_empty(true) {} + : Base(parent, m_graphic_buffer, ""), + m_nofaces_(false), m_random_face_color_(false), + m_previous_scene_empty(true) {} void Viewer::setScene(Scene *scene_, bool doredraw) { scene = scene_; @@ -34,7 +34,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) { } void Viewer::sceneChanged() { - + gBuffer.clear(); CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor_, scene->lcc, m_nofaces_, m_random_face_color_); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index cd86e1530838..f7473cff8d70 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -17,8 +17,7 @@ #include "typedefs.h" // QUESTION: When I added this line compiler tell me "No such file or directory!" how? -// #include - +#include #include #include @@ -109,12 +108,11 @@ struct MyDrawingFunctorLCC { return CGAL::IO::Color(0, 0, 0); } }; - -class Viewer : public CGAL::Basic_viewer_qt +class Viewer : public CGAL::Basic_viewer_qt { Q_OBJECT - typedef CGAL::Basic_viewer_qt Base; + typedef CGAL::Basic_viewer_qt Base; public: Viewer(QWidget* parent); @@ -126,7 +124,8 @@ public Q_SLOTS: void sceneChanged(); private: - const MyDrawingFunctorLCC &m_drawing_functor_; + MyDrawingFunctorLCC m_drawing_functor_; + CGAL::GraphicBuffer m_graphic_buffer; bool m_nofaces_, m_random_face_color_; Scene* scene; bool m_previous_scene_empty; 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 73f360debfa1..0480547ec5ed 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -148,7 +148,7 @@ struct LCC_geom_utils }; // Viewer class for LCC -template +/*template class SimpleLCCViewerQt : public Basic_viewer_qt { typedef Basic_viewer_qt Base; @@ -379,9 +379,9 @@ class SimpleLCCViewerQt : public Basic_viewer_qt bool m_random_face_color; const DrawingFunctorLCC& m_drawing_functor; }; - +*/ // Specialization of draw function. -#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_base \ +/*#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_base \ template < unsigned int d_, unsigned int ambient_dim, @@ -419,7 +419,7 @@ void draw(const CGAL_LCC_TYPE& alcc, // Todo a function taking a const DrawingFunctorLCC& drawing_functor as parameter #undef CGAL_LCC_TYPE - +*/ } // End namespace CGAL #endif // CGAL_USE_BASIC_VIEWER From 974a4accf10c7633843a013941111950571b6c5a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 12 Sep 2022 15:42:07 +0200 Subject: [PATCH 035/399] Update drawing functor and lcc demo --- .../demo/Linear_cell_complex/Viewer.cpp | 48 +- .../demo/Linear_cell_complex/Viewer.h | 94 +--- .../demo/Linear_cell_complex/typedefs.h | 5 +- .../CGAL/draw_linear_cell_complex_function.h | 526 +++++++----------- 4 files changed, 244 insertions(+), 429 deletions(-) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index a41f174d92a5..bd48145e3a4e 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -17,26 +17,37 @@ Viewer::Viewer(QWidget *parent) : Base(parent, m_graphic_buffer, ""), - m_nofaces_(false), m_random_face_color_(false), - m_previous_scene_empty(true) {} + m_previous_scene_empty(true) +{ + m_drawing_functor.volume_color=[](const LCC & alcc, + Dart_const_handle dh)->CGAL::IO::Color + { return alcc.template info<3>(dh).color(); }; -void Viewer::setScene(Scene *scene_, bool doredraw) { + m_drawing_functor.colored_volume=[](const LCC &, Dart_const_handle)->bool + { return true; }; + + m_drawing_functor.draw_volume=[](const LCC & alcc, Dart_const_handle dh)->bool + { return alcc.template info<3>(dh).is_visible(); }; + + m_drawing_functor.volume_wireframe=[](const LCC& alcc, Dart_const_handle dh)->bool + { return !(alcc.template info<3>(dh).is_filled()); }; +} + +void Viewer::setScene(Scene *scene_, bool doredraw) +{ scene = scene_; - if (scene->lcc != nullptr) { - CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor_, scene->lcc, m_nofaces_, - m_random_face_color_); - } + if (scene->lcc!=nullptr) + { CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor, scene->lcc); } - if (doredraw) { - Base::redraw(); - } + if (doredraw) + { Base::redraw(); } } -void Viewer::sceneChanged() { +void Viewer::sceneChanged() +{ gBuffer.clear(); - CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor_, scene->lcc, - m_nofaces_, m_random_face_color_); + CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor, scene->lcc); this->camera()->setSceneBoundingBox( CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(), @@ -46,15 +57,14 @@ void Viewer::sceneChanged() { gBuffer.get_bounding_box().ymax(), gBuffer.get_bounding_box().zmax())); Base::redraw(); - if (m_previous_scene_empty) { - this->showEntireScene(); - } + if (m_previous_scene_empty) + { this->showEntireScene(); } - m_previous_scene_empty = - scene->lcc->is_empty(); // for the next call to sceneChanged + m_previous_scene_empty=scene->lcc->is_empty(); // for the next call to sceneChanged } -void Viewer::keyPressEvent(QKeyEvent *e) { +void Viewer::keyPressEvent(QKeyEvent *e) +{ // const Qt::KeyboardModifiers modifiers = e->modifiers(); Base::keyPressEvent(e); } diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index f7473cff8d70..e4e834e0a7ec 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -21,93 +21,6 @@ #include #include -// Functor used by SimpleLCCViewerQt to colorize of not elements. -struct MyDrawingFunctorLCC -{ - /// @return true iff the volume containing dh is drawn. - template - bool draw_volume(const LCC& alcc, - typename LCC::Dart_const_handle dh) const - { return alcc.template info<3>(dh).is_visible(); } - /// @return true iff the face containing dh is drawn. - template - bool draw_face(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - /// @return true iff the edge containing dh is drawn. - template - bool draw_edge(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - /// @return true iff the vertex containing dh is drawn. - template - bool draw_vertex(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - - /// @return true iff the volume containing dh is drawn in wireframe. - template - bool volume_wireframe(const LCC& alcc, - typename LCC::Dart_const_handle dh) const - { return !(alcc.template info<3>(dh).is_filled()); } - /// @return true iff the face containing dh is drawn in wireframe. - template - bool face_wireframe(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - - /// @return true iff the volume containing dh is colored. - template - bool colored_volume(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - /// @return true iff the face containing dh is colored. - /// if we have also colored_volume(alcc, dh), the volume color is - /// ignored and only the face color is considered. - template - bool colored_face(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - /// @return true iff the edge containing dh is colored. - template - bool colored_edge(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - /// @return true iff the vertex containing dh is colored. - template - bool colored_vertex(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - - /// @return the color of the volume containing dh - /// used only if colored_volume(alcc, dh) and !colored_face(alcc, dh) - template - CGAL::IO::Color volume_color(const LCC& alcc, - typename LCC::Dart_const_handle dh) const - { return alcc.template info<3>(dh).color(); } - /// @return the color of the face containing dh - /// used only if colored_face(alcc, dh) - template - CGAL::IO::Color face_color(const LCC& alcc, - typename LCC::Dart_const_handle dh) const - { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } - /// @return the color of the edge containing dh - /// used only if colored_edge(alcc, dh) - template - CGAL::IO::Color edge_color(const LCC&, - typename LCC::Dart_const_handle) const - { return CGAL::IO::Color(0, 0, 0); } - /// @return the color of the vertex containing dh - /// used only if colored_vertex(alcc, dh) - template - CGAL::IO::Color vertex_color(const LCC&, - typename LCC::Dart_const_handle) const - { return CGAL::IO::Color(0, 0, 0); } -}; - class Viewer : public CGAL::Basic_viewer_qt { Q_OBJECT @@ -124,9 +37,12 @@ public Q_SLOTS: void sceneChanged(); private: - MyDrawingFunctorLCC m_drawing_functor_; + CGAL::DefaultDrawingFunctorXWithVolume m_drawing_functor; CGAL::GraphicBuffer m_graphic_buffer; - bool m_nofaces_, m_random_face_color_; Scene* scene; bool m_previous_scene_empty; }; diff --git a/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h b/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h index 787b5a48aac2..5955485c8e49 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h @@ -158,8 +158,9 @@ typedef CGAL::Linear_cell_complex_traits <3,CGAL::Exact_predicates_inexact_constructions_kernel> Mytraits; typedef CGAL::Linear_cell_complex_for_combinatorial_map<3,3,Mytraits,Myitems> LCC; -typedef LCC::Dart_handle Dart_handle; -typedef LCC::Vertex_attribute Vertex; +typedef LCC::Dart_handle Dart_handle; +typedef LCC::Dart_const_handle Dart_const_handle; +typedef LCC::Vertex_attribute Vertex; typedef LCC::Point Point_3; typedef LCC::Vector Vector_3; diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index 4b218c7431dd..856c5a8783be 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -15,6 +15,7 @@ #include #include +#include #ifdef CGAL_USE_BASIC_VIEWER @@ -23,195 +24,94 @@ namespace CGAL { -// This functor draws all faces, edges, and vertices. -// Default color functor; user can change it to have its own face color -struct DefaultDrawingFunctorLCC { - /// @return true iff the volume containing dh is drawn. - template - bool draw_volume(const LCC &, typename LCC::Dart_const_handle) const { - return true; - } - /// @return true iff the face containing dh is drawn. - template - bool draw_face(const LCC &, typename LCC::Dart_const_handle) const { - return true; - } - /// @return true iff the edge containing dh is drawn. - template - bool draw_edge(const LCC &, typename LCC::Dart_const_handle) const { - return true; - } - /// @return true iff the vertex containing dh is drawn. - template - bool draw_vertex(const LCC &, typename LCC::Dart_const_handle) const { - return true; - } - - /// @return true iff the volume containing dh is drawn in wireframe. - template - bool volume_wireframe(const LCC &, typename LCC::Dart_const_handle) const { - return false; - } - /// @return true iff the face containing dh is drawn in wireframe. - template - bool face_wireframe(const LCC &, typename LCC::Dart_const_handle) const { - return false; - } - - /// @return true iff the volume containing dh is colored. - template - bool colored_volume(const LCC &, typename LCC::Dart_const_handle) const { - return true; - } - /// @return true iff the face containing dh is colored. - /// if we have also colored_volume(alcc, dh), the volume color is - /// ignored and only the face color is considered. - template - bool colored_face(const LCC &, typename LCC::Dart_const_handle) const { - return false; - } - /// @return true iff the edge containing dh is colored. - template - bool colored_edge(const LCC &, typename LCC::Dart_const_handle) const { - return false; - } - /// @return true iff the vertex containing dh is colored. - template - bool colored_vertex(const LCC &, typename LCC::Dart_const_handle) const { - return false; - } - - /// @return the color of the volume containing dh - /// used only if colored_volume(alcc, dh) and !colored_face(alcc, dh) - template - CGAL::IO::Color volume_color(const LCC &alcc, - typename LCC::Dart_const_handle dh) const { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } - /// @return the color of the face containing dh - /// used only if colored_face(alcc, dh) - template - CGAL::IO::Color face_color(const LCC &alcc, - typename LCC::Dart_const_handle dh) const { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } - /// @return the color of the edge containing dh - /// used only if colored_edge(alcc, dh) - template - CGAL::IO::Color edge_color(const LCC &alcc, - typename LCC::Dart_const_handle dh) const { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } - /// @return the color of the vertex containing dh - /// used only if colored_vertex(alcc, dh) - template - CGAL::IO::Color vertex_color(const LCC &alcc, - typename LCC::Dart_const_handle dh) const { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } -}; - -// TODO: these functors will modify a specific face, edge, and vertex. -struct DefaultDrawingFunctorX { - - template - bool draw_face(const DS &, face_handle handle) const { - return true; - } - - template - bool draw_edge(const DS &, edge_handle handle) const { - return true; - } - - template - bool draw_vertex(const DS &, vertex_handle handle) const { - return true; - } - - template - bool face_wireframe(const DS &, typename DS::Dart_const_handle) const { - return false; - } - - template - bool colored_face(const DS &, face_handle handle) const { - return false; - } - - template - bool colored_edge(const DS &, edge_handle handle) const { - return false; - } - - template - bool colored_vertex(const DS &, vertex_handle handle) const { - return false; - } - - template - CGAL::IO::Color face_color(const DS &aVal, face_handle dh) const { - CGAL::Random random((unsigned int)(aVal.darts().index(dh))); - return get_random_color(random); - } - - template - CGAL::IO::Color edge_color(const DS &aVal, edge_handle dh) const { - CGAL::Random random((unsigned int)(aVal.darts().index(dh))); - return get_random_color(random); - } - - template - CGAL::IO::Color vertex_color(const DS &aVal, vertex_handle dh) const { - CGAL::Random random((unsigned int)(aVal.darts().index(dh))); - return get_random_color(random); - } + + // CGAL::IO::Color face_color(const DS &aVal, face_handle dh) const { + // CGAL::Random random((unsigned int)(aVal.darts().index(dh))); + // return get_random_color(random); + // } + + +template +struct DefaultDrawingFunctorX +{ + DefaultDrawingFunctorX(): m_enabled_vertices(true), + m_enabled_edges(true), + m_enabled_faces(true) + { + draw_vertex=[](const DS &, vertex_handle)->bool { return true; }; + draw_edge=[](const DS &, edge_handle)->bool { return true; }; + draw_face=[](const DS &, face_handle)->bool { return true; }; + + colored_vertex=[](const DS &, vertex_handle)->bool { return false; }; + colored_edge=[](const DS &, edge_handle)->bool { return false; }; + colored_face=[](const DS &, face_handle)->bool { return false; }; + + face_wireframe=[](const DS &, face_handle)->bool { return false; }; + } + + std::function draw_vertex; + std::function draw_edge; + std::function draw_face; + + std::function colored_vertex; + std::function colored_edge; + std::function colored_face; + + std::function face_wireframe; + + std::function vertex_color; + std::function edge_color; + std::function face_color; + + void disable_vertices() { m_enabled_vertices=false; } + void enable_vertices() { m_enabled_vertices=true; } + bool are_vertices_enabled() const { return m_enabled_vertices; } + + void disable_edges() { m_enabled_edges=false; } + void enable_edges() { m_enabled_edges=true; } + bool are_edges_enabled() const { return m_enabled_edges; } + + void disable_faces() { m_enabled_faces=false; } + void enable_faces() { m_enabled_faces=true; } + bool are_faces_enabled() const { return m_enabled_faces; } + +protected: + bool m_enabled_vertices, m_enabled_edges, m_enabled_faces; }; -struct DefaultDrawingFunctorXWithVoulume : public DefaultDrawingFunctorX { - - template - bool draw_volume(const DS &, volume_handle) const { - return true; - } - - template - CGAL::IO::Color volume_color(const DS &aVal, - volume_handle dh) const { - CGAL::Random random((unsigned int)(aVal.darts().index(dh))); - return get_random_color(random); - } - - template - bool volume_wireframe(const DS &, volume_handle) const { - return false; - } - - template - bool colored_volume(const DS &, volume_handle) const { - return true; - } +template +struct DefaultDrawingFunctorXWithVolume : + public DefaultDrawingFunctorX +{ + DefaultDrawingFunctorXWithVolume() : m_enabled_volumes(true) + { + draw_volume=[](const DS &, volume_handle)->bool { return true; }; + colored_volume=[](const DS &, volume_handle)->bool { return false; }; + volume_wireframe=[](const DS &, volume_handle)->bool { return false; }; + } + + std::function draw_volume; + std::function colored_volume; + std::function volume_wireframe; + std::function volume_color; + + void disable_volumes() { m_enabled_volumes=false; } + void enable_volumes() { m_enabled_volumes=true; } + bool are_volumes_enabled() const { return m_enabled_volumes; } + +protected: + bool m_enabled_volumes; }; -namespace draw_function { +namespace draw_function_for_lcc +{ typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; @@ -221,9 +121,11 @@ template struct LCC_geom_utils; template -struct LCC_geom_utils { +struct LCC_geom_utils +{ static typename Local_kernel::Vector_3 - get_vertex_normal(const LCC &lcc, typename LCC::Dart_const_handle dh) { + get_vertex_normal(const LCC &lcc, typename LCC::Dart_const_handle dh) + { typename Local_kernel::Vector_3 n = internal::Geom_utils:: get_local_vector(CGAL::compute_normal_of_cell_0(lcc, dh)); @@ -233,110 +135,109 @@ struct LCC_geom_utils { }; template -struct LCC_geom_utils { +struct LCC_geom_utils +{ static typename Local_kernel::Vector_3 - get_vertex_normal(const LCC &, typename LCC::Dart_const_handle) { - typename Local_kernel::Vector_3 n = CGAL::NULL_VECTOR; + get_vertex_normal(const LCC &, typename LCC::Dart_const_handle) + { + typename Local_kernel::Vector_3 n=CGAL::NULL_VECTOR; return n; } }; -template +template void compute_face(typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, const LCC *lcc, - bool m_nofaces, bool m_random_face_color, const DrawingFunctorLCC &m_drawing_functor, - GraphicBuffer &graphic_buffer) { - - typedef typename LCC::Dart_const_handle Dart_const_handle; - typedef typename LCC::Traits Kernel; - typedef typename Kernel::Point Point; - typedef typename Kernel::Vector Vector; - - if (m_nofaces || !m_drawing_functor.draw_face(*lcc, dh)) - return; + GraphicBuffer &graphic_buffer) +{ + if (!m_drawing_functor.are_faces_enabled() || + !m_drawing_functor.draw_face(*lcc, dh)) + { return; } // We fill only closed faces. - Dart_const_handle cur = dh; - Dart_const_handle min = dh; - do { + typename LCC::Dart_const_handle cur=dh; + do + { if (!lcc->is_next_exist(cur)) - return; // open face=>not filled - if (cur < min) - min = cur; + { return; } // open face=>not filled cur = lcc->next(cur); - } while (cur != dh); + } + while (cur!=dh); - if (m_random_face_color) { - CGAL::Random random((unsigned int)(lcc->darts().index(dh))); - CGAL::IO::Color c = get_random_color(random); - graphic_buffer.face_begin(c); - } else if (m_drawing_functor.colored_face(*lcc, dh)) { - CGAL::IO::Color c = m_drawing_functor.face_color(*lcc, dh); + if (m_drawing_functor.colored_volume(*lcc, voldh)) + { + CGAL::IO::Color c=m_drawing_functor.volume_color(*lcc, voldh); graphic_buffer.face_begin(c); - } else if (m_drawing_functor.colored_volume(*lcc, voldh)) { - CGAL::IO::Color c = m_drawing_functor.volume_color(*lcc, voldh); + } + else if (m_drawing_functor.colored_face(*lcc, dh)) + { + CGAL::IO::Color c=m_drawing_functor.face_color(*lcc, dh); graphic_buffer.face_begin(c); - } else { - graphic_buffer.face_begin(); } + else + { graphic_buffer.face_begin(); } - cur = dh; - do { - graphic_buffer.add_point_in_face( - lcc->point(cur), - LCC_geom_utils::get_vertex_normal(*lcc, cur)); - cur = lcc->next(cur); - } while (cur != dh); + cur=dh; + do + { + graphic_buffer.add_point_in_face + (lcc->point(cur), + LCC_geom_utils::get_vertex_normal(*lcc, cur)); + cur=lcc->next(cur); + } + while (cur!=dh); graphic_buffer.face_end(); } -template +template void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, - const DrawingFunctorLCC &m_drawing_functor, - GraphicBuffer &graphic_buffer) { - typedef typename LCC::Dart_const_handle Dart_const_handle; - typedef typename LCC::Traits Kernel; - typedef typename Kernel::Point Point; - - if (!m_drawing_functor.draw_edge(*lcc, dh)) - return; - - Point p1 = lcc->point(dh); - Dart_const_handle d2 = lcc->other_extremity(dh); - if (d2 != nullptr) { - if (m_drawing_functor.colored_edge(*lcc, dh)) { + const DrawingFunctor &m_drawing_functor, + GraphicBuffer &graphic_buffer) +{ + if (!m_drawing_functor.are_edges_enabled() || + !m_drawing_functor.draw_edge(*lcc, dh)) + { return; } + + const typename LCC::Point& p1=lcc->point(dh); + typename LCC::Dart_const_handle d2=lcc->other_extremity(dh); + if (d2!=nullptr) + { + if (m_drawing_functor.colored_edge(*lcc, dh)) + { graphic_buffer.add_segment(p1, lcc->point(d2), m_drawing_functor.edge_color(*lcc, dh)); - } else { - graphic_buffer.add_segment(p1, lcc->point(d2)); } + else + { graphic_buffer.add_segment(p1, lcc->point(d2)); } } } template void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, - GraphicBuffer &graphic_buffer) { - if (!m_drawing_functor.draw_vertex(*lcc, dh)) - return; - - if (m_drawing_functor.colored_vertex(*lcc, dh)) { + GraphicBuffer &graphic_buffer) +{ + if (!m_drawing_functor.are_vertices_enabled() || + !m_drawing_functor.draw_vertex(*lcc, dh)) + { return; } + + if (m_drawing_functor.colored_vertex(*lcc, dh)) + { graphic_buffer.add_point(lcc->point(dh), m_drawing_functor.vertex_color(*lcc, dh)); - } else { - graphic_buffer.add_point(lcc->point(dh)); } + else + { graphic_buffer.add_point(lcc->point(dh)); } } -template +template void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, - const DrawingFunctorLCC &m_drawing_functor, - bool m_nofaces, bool m_random_face_color) { - - if (lcc == nullptr) - return; + const DrawingFunctor &m_drawing_functor) +{ + if (lcc==nullptr) + { return; } typename LCC::size_type markvolumes = lcc->get_new_mark(); typename LCC::size_type markfaces = lcc->get_new_mark(); @@ -346,54 +247,44 @@ void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, lcc->orient(oriented_mark); - for (typename LCC::Dart_range::const_iterator it = lcc->darts().begin(), - itend = lcc->darts().end(); - it != itend; ++it) { + for(typename LCC::Dart_range::const_iterator it=lcc->darts().begin(), + itend=lcc->darts().end(); it!=itend; ++it) + { if (!lcc->is_marked(it, markvolumes) && - m_drawing_functor.draw_volume(*lcc, it)) { - for (typename LCC::template Dart_of_cell_basic_range<3>::const_iterator - itv = lcc->template darts_of_cell_basic<3>(it, markvolumes) - .begin(), - itvend = - lcc->template darts_of_cell_basic<3>(it, markvolumes).end(); - itv != itvend; ++itv) { - lcc->mark(itv, markvolumes); // To be sure that all darts of the basic - // iterator will be marked + m_drawing_functor.draw_volume(*lcc, it)) + { + for(typename LCC::template Dart_of_cell_basic_range<3>::const_iterator + itv=lcc->template darts_of_cell_basic<3>(it, markvolumes).begin(), + itvend=lcc->template darts_of_cell_basic<3>(it, markvolumes).end(); + itv!=itvend; ++itv) + { + lcc->mark(itv, markvolumes); if (!lcc->is_marked(itv, markfaces) && lcc->is_marked(itv, oriented_mark) && - m_drawing_functor.draw_face(*lcc, itv)) { + m_drawing_functor.draw_face(*lcc, itv)) + { if (!m_drawing_functor.volume_wireframe(*lcc, itv) && - !m_drawing_functor.face_wireframe(*lcc, itv)) { - compute_face(itv, it, lcc, m_nofaces, m_random_face_color, - m_drawing_functor, graphic_buffer); - } - for (typename LCC::template Dart_of_cell_basic_range< - 2>::const_iterator - itf = lcc->template darts_of_cell_basic<2>(itv, markfaces) - .begin(), - itfend = lcc->template darts_of_cell_basic<2>(itv, markfaces) - .end(); - itf != itfend; ++itf) { - if (!m_drawing_functor.volume_wireframe(*lcc, itv) && - !m_drawing_functor.face_wireframe(*lcc, itv)) { - lcc->mark(itf, markfaces); - } // To be sure that all darts of the basic iterator will be marked + !m_drawing_functor.face_wireframe(*lcc, itv)) + { compute_face(itv, it, lcc, m_drawing_functor, graphic_buffer); } + for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator + itf=lcc->template darts_of_cell_basic<2>(itv, markfaces).begin(), + itfend=lcc->template darts_of_cell_basic<2>(itv, markfaces).end(); + itf!=itfend; ++itf) + { + lcc->mark(itf, markfaces); if (!lcc->is_marked(itf, markedges) && - m_drawing_functor.draw_edge(*lcc, itf)) { + m_drawing_functor.draw_edge(*lcc, itf)) + { compute_edge(itf, lcc, m_drawing_functor, graphic_buffer); - for (typename LCC::template Dart_of_cell_basic_range< - 1>::const_iterator - ite = - lcc->template darts_of_cell_basic<1>(itf, markedges) - .begin(), - iteend = - lcc->template darts_of_cell_basic<1>(itf, markedges) - .end(); - ite != iteend; ++ite) { - lcc->mark(ite, markedges); // To be sure that all darts of the - // basic iterator will be marked + for(typename LCC::template Dart_of_cell_basic_range<1>::const_iterator + ite=lcc->template darts_of_cell_basic<1>(itf, markedges).begin(), + iteend=lcc->template darts_of_cell_basic<1>(itf, markedges).end(); + ite!=iteend; ++ite) + { + lcc->mark(ite, markedges); if (!lcc->is_marked(ite, markvertices) && - m_drawing_functor.draw_vertex(*lcc, ite)) { + m_drawing_functor.draw_vertex(*lcc, ite)) + { compute_vertex(ite, lcc, m_drawing_functor, graphic_buffer); CGAL::mark_cell(*lcc, ite, markvertices); } @@ -406,8 +297,8 @@ void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, } for (typename LCC::Dart_range::const_iterator it = lcc->darts().begin(), - itend = lcc->darts().end(); - it != itend; ++it) { + itend = lcc->darts().end(); it != itend; ++it) + { lcc->unmark(it, markvertices); lcc->unmark(it, markedges); lcc->unmark(it, markfaces); @@ -431,17 +322,15 @@ void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, * @param graphic_buffer * @param m_drawing_functor * @param alcc - * @param anofaces if true, do not draw faces. */ -template +template void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, - const DrawingFunctorLCC &m_drawing_functor, - const LCC *alcc = nullptr, bool nofaces = false, - bool m_random_face_color = false) { - - if (alcc != nullptr) { - draw_function::compute_elements(graphic_buffer, alcc, m_drawing_functor, - nofaces, m_random_face_color); + const DrawingFunctor &m_drawing_functor, + const LCC *alcc = nullptr) +{ + if (alcc!=nullptr) + { + draw_function_for_lcc::compute_elements(graphic_buffer, alcc, m_drawing_functor); } } @@ -450,25 +339,24 @@ void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, CGAL::Linear_cell_complex_base -template class Map, - class Refs, class Storage_, - class DrawingFunctorLCC = DefaultDrawingFunctorLCC> - // TODO: I'll add it again after done LCC demo. - // class DrawingFunctorLCC = DefaultDrawingFunctorXWithVoulume> +template class Map, + class Refs, class Storage_, + class DrawingFunctor=DefaultDrawingFunctorXWithVolume> void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer", - const DrawingFunctorLCC &drawing_functor = DrawingFunctorLCC()) { - // TODO: I'll add it again after done LCC demo. - // const DrawingFunctorLCC &drawing_functor = DefaultDrawingFunctorXWithVoulume()) { + const DrawingFunctor &drawing_functor=DrawingFunctor()) +{ GraphicBuffer buffer; - add_in_graphic_buffer_lcc(buffer, drawing_functor, &alcc, false); + add_in_graphic_buffer_lcc(buffer, drawing_functor, &alcc); draw_buffer(buffer); } -// Todo a function taking a const DrawingFunctorLCC& drawing_functor as -// parameter #undef CGAL_LCC_TYPE } // End namespace CGAL From 899b8eaa82134e283207242dadc2ca2a91ff07c7 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 12 Sep 2022 15:58:04 +0200 Subject: [PATCH 036/399] Bugfix for negate normal --- GraphicsView/include/CGAL/GraphicBuffer.h | 8 ++++++- .../include/CGAL/Qt/Basic_viewer_qt.h | 22 ++++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/GraphicBuffer.h index 1381eaf99b6b..bf3ec0aaac93 100644 --- a/GraphicsView/include/CGAL/GraphicBuffer.h +++ b/GraphicsView/include/CGAL/GraphicBuffer.h @@ -162,6 +162,12 @@ class GraphicBuffer { m_bounding_box = new_bounding_box; } + void negate_all_normals() + { + m_buffer_for_mono_faces.negate_normals(); + m_buffer_for_colored_faces.negate_normals(); + } + template void add_point(const KPoint &p) { m_buffer_for_mono_points.add_point(p); } @@ -329,7 +335,7 @@ class GraphicBuffer { m_buffer_for_clipping_plane.clear(); m_texts.clear(); } - + template static Local_point get_local_point(const KPoint &p) { return internal::Geom_utils::Kernel, diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 98709c811f90..2f0a0404cdaf 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -252,7 +252,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer template void add_point(const KPoint& p) - { gBuffer.add_point(p); } + { gBuffer.add_point(p); } template void add_point(const KPoint& p, const CGAL::IO::Color& acolor) @@ -349,9 +349,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer std::cerr<<"You cannot start a new face before to finish the previous one."< Date: Thu, 22 Sep 2022 17:31:50 +0200 Subject: [PATCH 037/399] Initial commit Generic functor. --- GraphicsView/include/CGAL/Generic_functors.h | 99 ++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 GraphicsView/include/CGAL/Generic_functors.h diff --git a/GraphicsView/include/CGAL/Generic_functors.h b/GraphicsView/include/CGAL/Generic_functors.h new file mode 100644 index 000000000000..e9deab53494c --- /dev/null +++ b/GraphicsView/include/CGAL/Generic_functors.h @@ -0,0 +1,99 @@ +// Copyright (c) 2022 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s): Guillaume Damiand +// Mostafa Ashraf + +#ifndef CGAL_GENERIC_FUNCTORS_H +#define CGAL_GENERIC_FUNCTORS_H + +namespace CGAL { + +template +struct GenericFunctor +{ + GenericFunctor(): m_enabled_vertices(true), + m_enabled_edges(true), + m_enabled_faces(true) + { + draw_vertex=[](const DS &, vertex_handle)->bool { return true; }; + draw_edge=[](const DS &, edge_handle)->bool { return true; }; + draw_face=[](const DS &, face_handle)->bool { return true; }; + + colored_vertex=[](const DS &, vertex_handle)->bool { return false; }; + colored_edge=[](const DS &, edge_handle)->bool { return false; }; + colored_face=[](const DS &, face_handle)->bool { return false; }; + + face_wireframe=[](const DS &, face_handle)->bool { return false; }; + } + + std::function draw_vertex; + std::function draw_edge; + std::function draw_face; + + std::function colored_vertex; + std::function colored_edge; + std::function colored_face; + + std::function face_wireframe; + + std::function vertex_color; + std::function edge_color; + std::function face_color; + + void disable_vertices() { m_enabled_vertices=false; } + void enable_vertices() { m_enabled_vertices=true; } + bool are_vertices_enabled() const { return m_enabled_vertices; } + + void disable_edges() { m_enabled_edges=false; } + void enable_edges() { m_enabled_edges=true; } + bool are_edges_enabled() const { return m_enabled_edges; } + + void disable_faces() { m_enabled_faces=false; } + void enable_faces() { m_enabled_faces=true; } + bool are_faces_enabled() const { return m_enabled_faces; } + +protected: + bool m_enabled_vertices, m_enabled_edges, m_enabled_faces; +}; + +template +struct GenericFunctorWithVolume : + public GenericFunctor +{ + GenericFunctorWithVolume() : m_enabled_volumes(true) + { + draw_volume=[](const DS &, volume_handle)->bool { return true; }; + colored_volume=[](const DS &, volume_handle)->bool { return false; }; + volume_wireframe=[](const DS &, volume_handle)->bool { return false; }; + } + + std::function draw_volume; + std::function colored_volume; + std::function volume_wireframe; + std::function volume_color; + + void disable_volumes() { m_enabled_volumes=false; } + void enable_volumes() { m_enabled_volumes=true; } + bool are_volumes_enabled() const { return m_enabled_volumes; } + +protected: + bool m_enabled_volumes; +}; + +} // End namespace CGAL + +#endif // CGAL_GENERIC_FUNCTORS_H \ No newline at end of file From 9db1695576c390605c49d24f0f17b5a9f0af475a Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 22 Sep 2022 17:34:46 +0200 Subject: [PATCH 038/399] Migrated generic functor to Generic_functor.h, changed functors name. --- .../demo/Linear_cell_complex/Viewer.h | 4 +- .../CGAL/draw_linear_cell_complex_function.h | 83 +------------------ 2 files changed, 4 insertions(+), 83 deletions(-) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index e4e834e0a7ec..7ca3c9d4f187 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -18,7 +18,7 @@ // QUESTION: When I added this line compiler tell me "No such file or directory!" how? #include -#include +// #include #include class Viewer : public CGAL::Basic_viewer_qt @@ -37,7 +37,7 @@ public Q_SLOTS: void sceneChanged(); private: - CGAL::DefaultDrawingFunctorXWithVolume +#include #include #include @@ -30,86 +31,6 @@ namespace CGAL { // return get_random_color(random); // } - -template -struct DefaultDrawingFunctorX -{ - DefaultDrawingFunctorX(): m_enabled_vertices(true), - m_enabled_edges(true), - m_enabled_faces(true) - { - draw_vertex=[](const DS &, vertex_handle)->bool { return true; }; - draw_edge=[](const DS &, edge_handle)->bool { return true; }; - draw_face=[](const DS &, face_handle)->bool { return true; }; - - colored_vertex=[](const DS &, vertex_handle)->bool { return false; }; - colored_edge=[](const DS &, edge_handle)->bool { return false; }; - colored_face=[](const DS &, face_handle)->bool { return false; }; - - face_wireframe=[](const DS &, face_handle)->bool { return false; }; - } - - std::function draw_vertex; - std::function draw_edge; - std::function draw_face; - - std::function colored_vertex; - std::function colored_edge; - std::function colored_face; - - std::function face_wireframe; - - std::function vertex_color; - std::function edge_color; - std::function face_color; - - void disable_vertices() { m_enabled_vertices=false; } - void enable_vertices() { m_enabled_vertices=true; } - bool are_vertices_enabled() const { return m_enabled_vertices; } - - void disable_edges() { m_enabled_edges=false; } - void enable_edges() { m_enabled_edges=true; } - bool are_edges_enabled() const { return m_enabled_edges; } - - void disable_faces() { m_enabled_faces=false; } - void enable_faces() { m_enabled_faces=true; } - bool are_faces_enabled() const { return m_enabled_faces; } - -protected: - bool m_enabled_vertices, m_enabled_edges, m_enabled_faces; -}; - -template -struct DefaultDrawingFunctorXWithVolume : - public DefaultDrawingFunctorX -{ - DefaultDrawingFunctorXWithVolume() : m_enabled_volumes(true) - { - draw_volume=[](const DS &, volume_handle)->bool { return true; }; - colored_volume=[](const DS &, volume_handle)->bool { return false; }; - volume_wireframe=[](const DS &, volume_handle)->bool { return false; }; - } - - std::function draw_volume; - std::function colored_volume; - std::function volume_wireframe; - std::function volume_color; - - void disable_volumes() { m_enabled_volumes=false; } - void enable_volumes() { m_enabled_volumes=true; } - bool are_volumes_enabled() const { return m_enabled_volumes; } - -protected: - bool m_enabled_volumes; -}; - namespace draw_function_for_lcc { @@ -343,7 +264,7 @@ template class Map, class Refs, class Storage_, - class DrawingFunctor=DefaultDrawingFunctorXWithVolume Date: Thu, 22 Sep 2022 23:07:54 +0200 Subject: [PATCH 039/399] Modified to use new APIs version. --- .../include/CGAL/draw_triangulation_3.h | 196 ++++++++---------- 1 file changed, 81 insertions(+), 115 deletions(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index d7b294fa1641..fbee023b4cce 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -8,159 +8,125 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_T3_H #define CGAL_DRAW_T3_H -#include +#include +#include #include +#include #ifdef CGAL_USE_BASIC_VIEWER #include -#include #include +#include -namespace CGAL -{ +namespace CGAL { // Default color functor; user can change it to have its own face color -struct DefaultColorFunctorT3 -{ - template - static CGAL::IO::Color run(const T3&, - const typename T3::Finite_facets_iterator* fh) - { - if (fh==nullptr) // use to get the mono color +struct DefaultColorFunctorT3 { + template + static CGAL::IO::Color run(const T3 &, + const typename T3::Finite_facets_iterator *fh) { + if (fh == nullptr) // use to get the mono color return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 - CGAL::Random random((unsigned int)((std::size_t)(&*((*fh)->first))+ + CGAL::Random random((unsigned int)((std::size_t)(&*((*fh)->first)) + (std::size_t)((*fh)->second))); return get_random_color(random); } }; -// Viewer class for T3 -template -class SimpleTriangulation3ViewerQt : public Basic_viewer_qt -{ - typedef Basic_viewer_qt Base; - typedef typename T3::Vertex_handle Vertex_const_handle; - typedef typename T3::Finite_edges_iterator Edge_const_handle; - typedef typename T3::Finite_facets_iterator Facet_const_handle; - typedef typename T3::Cell_handle Cell_handle; - typedef typename T3::Point Point; - -public: - /// Construct the viewer. - /// @param at3 the t3 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) - SimpleTriangulation3ViewerQt(QWidget* parent, - const T3& at3, - const char* title="Basic T3 Viewer", - bool anofaces=false, - const ColorFunctor& fcolor=ColorFunctor()) : - // First draw: vertices; edges, faces; multi-color; no inverse normal - Base(parent, title, true, true, true, false, false), - t3(at3), - m_nofaces(anofaces), - m_fcolor(fcolor) - { - compute_elements(); - } +namespace draw_function_for_t3 { -protected: - void compute_face(Facet_const_handle fh) - { - CGAL::IO::Color c=m_fcolor.run(t3, &fh); - face_begin(c); +template +void compute_face(typename T3::Finite_facets_iterator fh, + GraphicBuffer &graphic_buffer, const T3 *t3, + const ColorFunctor &m_fcolor) { - add_point_in_face(fh->first->vertex((fh->second+1)%4)->point()); - add_point_in_face(fh->first->vertex((fh->second+2)%4)->point()); - add_point_in_face(fh->first->vertex((fh->second+3)%4)->point()); + // TODO: change it to m_fcolor.face_color(*t3, fh) + CGAL::IO::Color c = m_fcolor.run(*t3, &fh); - face_end(); - } + graphic_buffer.face_begin(c); - void compute_edge(Edge_const_handle eh) - { - add_segment(eh->first->vertex(eh->second)->point(), - eh->first->vertex(eh->third)->point()); - } + graphic_buffer.add_point_in_face( + fh->first->vertex((fh->second + 1) % 4)->point()); + graphic_buffer.add_point_in_face( + fh->first->vertex((fh->second + 2) % 4)->point()); + graphic_buffer.add_point_in_face( + fh->first->vertex((fh->second + 3) % 4)->point()); - void compute_vertex(Vertex_const_handle vh) - { add_point(vh->point()); } + graphic_buffer.face_end(); +} - void compute_elements() - { - clear(); +template +void compute_edge(typename T3::Finite_edges_iterator eh, + GraphicBuffer &graphic_buffer) { + graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), + eh->first->vertex(eh->third)->point()); +} - if (!m_nofaces) - { - for (typename T3::Finite_facets_iterator it=t3.finite_facets_begin(); - it!=t3.finite_facets_end(); ++it) - { compute_face(it); } - } +template +void compute_vertex(typename T3::Vertex_handle vh, + GraphicBuffer &graphic_buffer) { + graphic_buffer.add_point(vh->point()); +} - for (typename T3::Finite_edges_iterator it=t3.finite_edges_begin(); - it!=t3.finite_edges_end(); ++it) - { compute_edge(it); } +template +void compute_elements(GraphicBuffer &graphic_buffer, const T3 *t3, + const ColorFunctor &m_color_functor, + bool m_nofaces = false) { - for (typename T3::Finite_vertices_iterator it=t3.finite_vertices_begin(); - it!=t3.finite_vertices_end(); ++it) - { compute_vertex(it); } + if (!m_nofaces) { + for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin(); + it != t3->finite_facets_end(); ++it) { + compute_face(it, graphic_buffer, t3, m_color_functor); + } } - 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 + for (typename T3::Finite_edges_iterator it = t3->finite_edges_begin(); + it != t3->finite_edges_end(); ++it) { + compute_edge(it, graphic_buffer); + } - // Call the base method to process others/classicals key - Base::keyPressEvent(e); + for (typename T3::Finite_vertices_iterator it = t3->finite_vertices_begin(); + it != t3->finite_vertices_end(); ++it) { + compute_vertex(it, graphic_buffer); } +} -protected: - const T3& t3; - bool m_nofaces; - const ColorFunctor& m_fcolor; -}; +} // namespace draw_function_for_t3 + +template +void add_in_graphic_buffer_t3(GraphicBuffer &graphic_buffer, + const ColorFunctor &m_color_functor, + const T3 *at3 = nullptr, bool m_nofaces = false) { + if (at3 != nullptr) { + draw_function_for_t3::compute_elements(graphic_buffer, at3, m_color_functor, + m_nofaces); + } +} // 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=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif - - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"t3_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - DefaultColorFunctorT3 fcolor; - SimpleTriangulation3ViewerQt - mainwindow(app.activeWindow(), at3, title, nofill, fcolor); - mainwindow.show(); - app.exec(); - } +template > +void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer", + const ColorFunctor &color_functor = ColorFunctor(), + bool nofill = false) { + + GraphicBuffer buffer; + // add_in_graphic_buffer_t3(buffer, color_functor, &at3, false); + add_in_graphic_buffer_t3(buffer, DefaultColorFunctorT3(), &at3, false); + + draw_buffer(buffer); } #undef CGAL_T3_TYPE From 642c055db009f04fc8ac97a4b4556f7d72cc81b2 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 22 Sep 2022 23:08:39 +0200 Subject: [PATCH 040/399] QUESTION --- .../include/CGAL/draw_triangulation_3.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index fbee023b4cce..ba1a3f707459 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -47,6 +47,34 @@ void compute_face(typename T3::Finite_facets_iterator fh, GraphicBuffer &graphic_buffer, const T3 *t3, const ColorFunctor &m_fcolor) { +/* + // QUESTION: I would like to assign custom color functor during run time, which one down is right? + + // Solution 1 to assign custom color functor. + // m_fcolor.face_color = DefaultColorFunctorT3::run; + + // Solution 2 to assign custom color functor. + // m_fcolor.face_color = + // [](const T3 &, + // const typename T3::Finite_facets_iterator *fh) -> CGAL::IO::Color { + // if (fh == nullptr) // use to get the mono color + // return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 + + // CGAL::Random random((unsigned int)((std::size_t)(&*((*fh)->first)) + + // (std::size_t)((*fh)->second))); + + // return get_random_color(random); + // }; + // CGAL::IO::Color c = m_fcolor.face_color(*t3, &fh); + + + // Solution 3 to assign custom color functor. + m_fcolor.test_m = []() -> void {std::cout << "Hello\n";}; + std::invoke(&ColorFunctor::test_m, m_fcolor); + + I tried the above solutions but they don't work. +*/ + // TODO: change it to m_fcolor.face_color(*t3, fh) CGAL::IO::Color c = m_fcolor.run(*t3, &fh); From 5fbaf4343478afa6d498f8973763d2a61cfa6fe0 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 00:23:39 +0200 Subject: [PATCH 041/399] Modified Triangulation 2 to use new APIs version. --- .../include/CGAL/draw_triangulation_2.h | 188 +++++++----------- 1 file changed, 77 insertions(+), 111 deletions(-) diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 9fabd0418339..85bb391481c5 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -8,153 +8,119 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_T2_H #define CGAL_DRAW_T2_H -#include +#include +#include #include +#include #ifdef CGAL_USE_BASIC_VIEWER #include -#include #include +#include -namespace CGAL -{ +namespace CGAL { // Default color functor; user can change it to have its own face color -struct DefaultColorFunctorT2 -{ - template - static CGAL::IO::Color run(const T2&, - const typename T2::Finite_faces_iterator fh) - { +struct DefaultColorFunctorT2 { + template + static CGAL::IO::Color run(const T2 &, + const typename T2::Finite_faces_iterator fh) { CGAL::Random random((unsigned int)(std::size_t)(&*fh)); return get_random_color(random); } }; -// Viewer class for T2 -template -class SimpleTriangulation2ViewerQt : public Basic_viewer_qt -{ - typedef Basic_viewer_qt Base; - typedef typename T2::Vertex_handle Vertex_const_handle; - typedef typename T2::Finite_edges_iterator Edge_const_handle; - typedef typename T2::Finite_faces_iterator Facet_const_handle; - typedef typename T2::Point Point; - -public: - /// Construct the viewer. - /// @param at2 the t2 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) - SimpleTriangulation2ViewerQt(QWidget* parent, const T2& at2, - const char* title="Basic T2 Viewer", - bool anofaces=false, - const ColorFunctor& fcolor=ColorFunctor()) : - // First draw: vertices; edges, faces; multi-color; no inverse normal - Base(parent, title, true, true, true, false, false), - t2(at2), - m_nofaces(anofaces), - m_fcolor(fcolor) - { - compute_elements(); - } +namespace draw_function_for_t2 { -protected: - void compute_face(Facet_const_handle fh) - { - CGAL::IO::Color c=m_fcolor.run(t2, fh); - face_begin(c); +template +void compute_face(typename T2::Finite_faces_iterator fh, + GraphicBuffer &graphic_buffer, const T2 *t2, + const ColorFunctor &m_fcolor) { - add_point_in_face(fh->vertex(0)->point()); - add_point_in_face(fh->vertex(1)->point()); - add_point_in_face(fh->vertex(2)->point()); + // TODO: change it to m_fcolor.face_color(*t2, fh) + CGAL::IO::Color c = m_fcolor.run(*t2, fh); + graphic_buffer.face_begin(c); - face_end(); - } + graphic_buffer.add_point_in_face(fh->vertex(0)->point()); + graphic_buffer.add_point_in_face(fh->vertex(1)->point()); + graphic_buffer.add_point_in_face(fh->vertex(2)->point()); - void compute_edge(Edge_const_handle eh) - { - add_segment(eh->first->vertex(eh->first->cw(eh->second))->point(), - eh->first->vertex(eh->first->ccw(eh->second))->point()); - } + graphic_buffer.face_end(); +} - void compute_vertex(Vertex_const_handle vh) - { add_point(vh->point()); } +template +void compute_edge(typename T2::Finite_edges_iterator eh, + GraphicBuffer &graphic_buffer) { + graphic_buffer.add_segment( + eh->first->vertex(eh->first->cw(eh->second))->point(), + eh->first->vertex(eh->first->ccw(eh->second))->point()); +} - void compute_elements() - { - clear(); +template +void compute_vertex(typename T2::Vertex_handle vh, + GraphicBuffer &graphic_buffer) { + graphic_buffer.add_point(vh->point()); +} - if (!m_nofaces) - { - for (typename T2::Finite_faces_iterator it=t2.finite_faces_begin(); - it!=t2.finite_faces_end(); ++it) - { compute_face(it); } - } +template +void compute_elements(GraphicBuffer &graphic_buffer, const T2 *t2, + const ColorFunctor &m_color_functor, + bool m_nofaces = false) { + // clear(); - for (typename T2::Finite_edges_iterator it=t2.finite_edges_begin(); - it!=t2.finite_edges_end(); ++it) - { compute_edge(it); } + if (!m_nofaces) { + for (typename T2::Finite_faces_iterator it = t2->finite_faces_begin(); + it != t2->finite_faces_end(); ++it) { + compute_face(it, graphic_buffer, t2, m_color_functor); + } + } - for (typename T2::Finite_vertices_iterator it=t2.finite_vertices_begin(); - it!=t2.finite_vertices_end(); ++it) - { compute_vertex(it); } + for (typename T2::Finite_edges_iterator it = t2->finite_edges_begin(); + it != t2->finite_edges_end(); ++it) { + compute_edge(it, graphic_buffer); } - virtual void keyPressEvent(QKeyEvent *e) - { - // Test key pressed: - // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - // if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ... } + for (typename T2::Finite_vertices_iterator it = t2->finite_vertices_begin(); + it != t2->finite_vertices_end(); ++it) { + compute_vertex(it, graphic_buffer); + } +} - // 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 +} // namespace draw_function_for_t2 - // Call the base method to process others/classicals key - Base::keyPressEvent(e); +template +void add_in_graphic_buffer_t2(GraphicBuffer &graphic_buffer, + const ColorFunctor &m_color_functor, + const T2 *at2 = nullptr, bool m_nofaces = false) { + if (at2 != nullptr) { + draw_function_for_t2::compute_elements(graphic_buffer, at2, m_color_functor, + m_nofaces); } - -protected: - const T2& t2; - bool m_nofaces; - const ColorFunctor& m_fcolor; -}; +} // Specialization of draw function. #define CGAL_T2_TYPE CGAL::Triangulation_2 -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=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif - - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"t2_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - DefaultColorFunctorT2 fcolor; - SimpleTriangulation2ViewerQt - mainwindow(app.activeWindow(), at2, title, nofill, fcolor); - mainwindow.show(); - app.exec(); - } +template > +void draw(const CGAL_T2_TYPE &at2, + const char *title = "Triangulation_2 Basic Viewer", + const ColorFunctor &color_functor = ColorFunctor(), + bool nofill = false) { + + GraphicBuffer buffer; + // add_in_graphic_buffer_t3(buffer, color_functor, &at3, false); + add_in_graphic_buffer_t2(buffer, DefaultColorFunctorT2(), &at2, false); + draw_buffer(buffer); } #undef CGAL_T2_TYPE From c1037f9040c29d4e2467ef43344219b0d8b9a3db Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 01:48:59 +0200 Subject: [PATCH 042/399] Modified Point_set_3 to use new APIs version. --- Point_set_3/include/CGAL/draw_point_set_3.h | 100 +++++++------------- 1 file changed, 34 insertions(+), 66 deletions(-) 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 f8d9000cfa3e..3c5c5cfb5ccd 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -9,12 +9,13 @@ // // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_POINT_SET_3_H #define CGAL_DRAW_POINT_SET_3_H -#include #include +#include #ifdef DOXYGEN_RUNNING namespace CGAL { @@ -36,84 +37,51 @@ void draw(const PS& aps); #ifdef CGAL_USE_BASIC_VIEWER -#include #include +#include #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(); - } +namespace CGAL { -protected: - void compute_vertex(const Point& p) - { - add_point(p); - // We can use add_point(p, c) with c a CGAL::IO::Color to add a colored point - } +namespace draw_function_for_PointSet { - void compute_elements() - { - clear(); +template +void compute_vertex(const typename PointSet::Point_map::value_type &p, + GraphicBuffer &graphic_buffer) { + graphic_buffer.add_point(p); - for (typename PointSet::const_iterator it=pointset.begin(); - it!=pointset.end(); ++it) - { compute_vertex(pointset.point(*it)); } - } + // We can use add_point(p, c) with c a CGAL::IO::Color to add a colored point + // E.g: graphic_buffer.add_point(p, CGAL::IO::Color(100, 125, 200)); +} - virtual void keyPressEvent(QKeyEvent *e) - { - // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - Base::keyPressEvent(e); +template +void compute_elements(const PointSet *pointset, + GraphicBuffer &graphic_buffer) { + for (typename PointSet::const_iterator it = pointset->begin(); + it != pointset->end(); ++it) { + compute_vertex(pointset->point(*it), graphic_buffer); } +} -protected: - const PointSet& pointset; -}; - -// 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=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif +} // namespace draw_function_for_PointSet - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"point_set_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimplePointSetViewerQt > mainwindow(app.activeWindow(), - apointset, - title); - mainwindow.show(); - app.exec(); +template +void add_in_graphic_buffer_point_set(GraphicBuffer &graphic_buffer, + const PointSet *aPointSet = nullptr) { + if (aPointSet != nullptr) { + draw_function_for_PointSet::compute_elements(aPointSet, graphic_buffer); } } +// Specialization of draw function. +template +void draw(const Point_set_3 &apointset, + const char *title = "Point_set_3 Basic Viewer") { + GraphicBuffer buffer; + add_in_graphic_buffer_point_set(buffer, &apointset); + draw_buffer(buffer); +} + } // End namespace CGAL #endif // CGAL_USE_BASIC_VIEWER From a569437a14142f9e5fed5cb0a5d4d5330d25a3dd Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 23 Sep 2022 09:04:58 +0200 Subject: [PATCH 043/399] Correction for draw triangulation 3 --- .../include/CGAL/draw_triangulation_3.h | 147 ++++++++---------- 1 file changed, 67 insertions(+), 80 deletions(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index ba1a3f707459..393044e3ce96 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -23,62 +23,25 @@ #include #include #include +#include namespace CGAL { -// Default color functor; user can change it to have its own face color -struct DefaultColorFunctorT3 { - template - static CGAL::IO::Color run(const T3 &, - const typename T3::Finite_facets_iterator *fh) { - if (fh == nullptr) // use to get the mono color - return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 - - CGAL::Random random((unsigned int)((std::size_t)(&*((*fh)->first)) + - (std::size_t)((*fh)->second))); - return get_random_color(random); - } -}; - -namespace draw_function_for_t3 { +namespace draw_function_for_t3 +{ -template +template void compute_face(typename T3::Finite_facets_iterator fh, - GraphicBuffer &graphic_buffer, const T3 *t3, - const ColorFunctor &m_fcolor) { - -/* - // QUESTION: I would like to assign custom color functor during run time, which one down is right? - - // Solution 1 to assign custom color functor. - // m_fcolor.face_color = DefaultColorFunctorT3::run; - - // Solution 2 to assign custom color functor. - // m_fcolor.face_color = - // [](const T3 &, - // const typename T3::Finite_facets_iterator *fh) -> CGAL::IO::Color { - // if (fh == nullptr) // use to get the mono color - // return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 - - // CGAL::Random random((unsigned int)((std::size_t)(&*((*fh)->first)) + - // (std::size_t)((*fh)->second))); - - // return get_random_color(random); - // }; - // CGAL::IO::Color c = m_fcolor.face_color(*t3, &fh); - - - // Solution 3 to assign custom color functor. - m_fcolor.test_m = []() -> void {std::cout << "Hello\n";}; - std::invoke(&ColorFunctor::test_m, m_fcolor); - - I tried the above solutions but they don't work. -*/ - - // TODO: change it to m_fcolor.face_color(*t3, fh) - CGAL::IO::Color c = m_fcolor.run(*t3, &fh); - - graphic_buffer.face_begin(c); + const DrawingFunctor &drawing_functor, + CGAL::GraphicBuffer &graphic_buffer, const T3 *t3) +{ + if(drawing_functor.face_color) + { + CGAL::IO::Color c = drawing_functor.face_color(*t3, fh); + graphic_buffer.face_begin(c); + } + else + { graphic_buffer.face_begin(); } graphic_buffer.add_point_in_face( fh->first->vertex((fh->second + 1) % 4)->point()); @@ -92,71 +55,95 @@ void compute_face(typename T3::Finite_facets_iterator fh, template void compute_edge(typename T3::Finite_edges_iterator eh, - GraphicBuffer &graphic_buffer) { + CGAL::GraphicBuffer &graphic_buffer) { graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), eh->first->vertex(eh->third)->point()); } template void compute_vertex(typename T3::Vertex_handle vh, - GraphicBuffer &graphic_buffer) { + CGAL::GraphicBuffer &graphic_buffer) { graphic_buffer.add_point(vh->point()); } -template -void compute_elements(GraphicBuffer &graphic_buffer, const T3 *t3, - const ColorFunctor &m_color_functor, +template +void compute_elements(CGAL::GraphicBuffer &graphic_buffer, const T3 *t3, + const DrawingFunctor &drawing_functor, bool m_nofaces = false) { if (!m_nofaces) { for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin(); - it != t3->finite_facets_end(); ++it) { - compute_face(it, graphic_buffer, t3, m_color_functor); + it != t3->finite_facets_end(); ++it) + { + // TODO TEST draw_face + compute_face(it, drawing_functor, graphic_buffer, t3); } } for (typename T3::Finite_edges_iterator it = t3->finite_edges_begin(); - it != t3->finite_edges_end(); ++it) { + it != t3->finite_edges_end(); ++it) + { // TODO TEST draw_edge + edge color compute_edge(it, graphic_buffer); } for (typename T3::Finite_vertices_iterator it = t3->finite_vertices_begin(); - it != t3->finite_vertices_end(); ++it) { + it != t3->finite_vertices_end(); ++it) + { // TODO TEST draw_vertex + vertex color compute_vertex(it, graphic_buffer); } } } // namespace draw_function_for_t3 -template -void add_in_graphic_buffer_t3(GraphicBuffer &graphic_buffer, - const ColorFunctor &m_color_functor, - const T3 *at3 = nullptr, bool m_nofaces = false) { - if (at3 != nullptr) { - draw_function_for_t3::compute_elements(graphic_buffer, at3, m_color_functor, - m_nofaces); +template +void add_in_graphic_buffer_t3(CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor, + const T3 *at3 = nullptr) +{ + if (at3 != nullptr) + { + draw_function_for_t3::compute_elements(graphic_buffer, at3, drawing_functor); } } // 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", - const ColorFunctor &color_functor = ColorFunctor(), - bool nofill = false) { - - GraphicBuffer buffer; - // add_in_graphic_buffer_t3(buffer, color_functor, &at3, false); - add_in_graphic_buffer_t3(buffer, DefaultColorFunctorT3(), &at3, false); - +template +void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, + const char *title = "T3 Basic Viewer") +{ + CGAL::GraphicBuffer buffer; + add_in_graphic_buffer_t3(buffer, drawingfunctor, &at3); draw_buffer(buffer); } +template +void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") +{ + CGAL::GraphicBuffer buffer; + CGAL::GenericFunctor + drawingfunctor; + + drawingfunctor.face_color = + [](const CGAL_T3_TYPE &at3, const typename CGAL_T3_TYPE::Finite_facets_iterator fh) + -> CGAL::IO::Color + { + if (fh==at3.finite_facets_end()) // use to get the mono color + return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 + + CGAL::Random random((unsigned int)((std::size_t)(&*(fh->first)) + + (std::size_t)(fh->second))); + + return get_random_color(random); + }; + + draw(at3, drawingfunctor, title); +} + #undef CGAL_T3_TYPE } // End namespace CGAL From d78819d54d444a34ec13db393e3fafd9e0c82699 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 17:50:44 +0200 Subject: [PATCH 044/399] GraphicBuffer.h renamed to Graphic_buffer.h --- GraphicsView/include/CGAL/{GraphicBuffer.h => Graphic_buffer.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename GraphicsView/include/CGAL/{GraphicBuffer.h => Graphic_buffer.h} (100%) diff --git a/GraphicsView/include/CGAL/GraphicBuffer.h b/GraphicsView/include/CGAL/Graphic_buffer.h similarity index 100% rename from GraphicsView/include/CGAL/GraphicBuffer.h rename to GraphicsView/include/CGAL/Graphic_buffer.h From 6c95908e6c74ce284f34888b9c1a1551324bfbc0 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 18:03:11 +0200 Subject: [PATCH 045/399] Renamed functors and GB, added handles to test functors. --- GraphicsView/include/CGAL/Generic_functors.h | 10 ++-- GraphicsView/include/CGAL/Graphic_buffer.h | 7 --- .../include/CGAL/Qt/Basic_viewer_qt.h | 2 +- .../demo/Linear_cell_complex/Viewer.h | 2 +- .../CGAL/draw_linear_cell_complex_function.h | 4 +- .../include/CGAL/draw_triangulation_2.h | 4 +- .../include/CGAL/draw_triangulation_3.h | 54 ++++++++++++++----- 7 files changed, 53 insertions(+), 30 deletions(-) diff --git a/GraphicsView/include/CGAL/Generic_functors.h b/GraphicsView/include/CGAL/Generic_functors.h index e9deab53494c..5c39b610d45d 100644 --- a/GraphicsView/include/CGAL/Generic_functors.h +++ b/GraphicsView/include/CGAL/Generic_functors.h @@ -19,9 +19,9 @@ template -struct GenericFunctor +struct DrawingFunctor { - GenericFunctor(): m_enabled_vertices(true), + DrawingFunctor(): m_enabled_vertices(true), m_enabled_edges(true), m_enabled_faces(true) { @@ -71,10 +71,10 @@ template -struct GenericFunctorWithVolume : - public GenericFunctor +struct DrawingFunctorWithVolume : + public DrawingFunctor { - GenericFunctorWithVolume() : m_enabled_volumes(true) + DrawingFunctorWithVolume() : m_enabled_volumes(true) { draw_volume=[](const DS &, volume_handle)->bool { return true; }; colored_volume=[](const DS &, volume_handle)->bool { return false; }; diff --git a/GraphicsView/include/CGAL/Graphic_buffer.h b/GraphicsView/include/CGAL/Graphic_buffer.h index bf3ec0aaac93..84456815b38f 100644 --- a/GraphicsView/include/CGAL/Graphic_buffer.h +++ b/GraphicsView/include/CGAL/Graphic_buffer.h @@ -13,12 +13,6 @@ #define CGAL_GRAPHIC_BUFFER_H #include -// BUG: Warning - TODO? -/* -#include errors detected. Please update your includePath. ' -Squiggles are disabled for this translation unit - -*/ #include #include @@ -40,7 +34,6 @@ Squiggles are disabled for this translation unit #include #include -// #include namespace CGAL { diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 2f0a0404cdaf..1337df046e1a 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include #include diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 7ca3c9d4f187..c16eb2420257 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -37,7 +37,7 @@ public Q_SLOTS: void sceneChanged(); private: - CGAL::GenericFunctorWithVolume +#include #include #include #include @@ -264,7 +264,7 @@ template class Map, class Refs, class Storage_, - class DrawingFunctor=GenericFunctorWithVolume -#include +#include #include #include @@ -109,7 +109,7 @@ void add_in_graphic_buffer_t2(GraphicBuffer &graphic_buffer, template > void draw(const CGAL_T2_TYPE &at2, diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 393044e3ce96..4f60bb5328f6 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_T3_H #include -#include +#include #include #include @@ -23,7 +23,6 @@ #include #include #include -#include namespace CGAL { @@ -35,6 +34,12 @@ void compute_face(typename T3::Finite_facets_iterator fh, const DrawingFunctor &drawing_functor, CGAL::GraphicBuffer &graphic_buffer, const T3 *t3) { + // DONE: TEST draw_face + if(!drawing_functor.draw_face(*t3, fh)) + { + return; + } + if(drawing_functor.face_color) { CGAL::IO::Color c = drawing_functor.face_color(*t3, fh); @@ -55,15 +60,41 @@ void compute_face(typename T3::Finite_facets_iterator fh, template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::GraphicBuffer &graphic_buffer) { - graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), - eh->first->vertex(eh->third)->point()); + CGAL::GraphicBuffer &graphic_buffer, const T3 *t3) { + // DONE: TEST draw_edge + edge color + if(!drawing_functor.draw_edge(*t3, eh)) { + return; + } + if( && drawing_functor.edge_color) { + + CGAL::IO::Color c = drawing_functor.edge_color(*t3, eh); + graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), + eh->first->vertex(eh->third)->point(), c); + } + else { + graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), + eh->first->vertex(eh->third)->point()); + } } template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::GraphicBuffer &graphic_buffer) { - graphic_buffer.add_point(vh->point()); + CGAL::GraphicBuffer &graphic_buffer, const T3 *t3) { + + // DONE TEST draw_vertex + vertex color + if(!drawing_functor.draw_vertex(*t3, vh)) + { + return; + } + + if(drawing_functor.vertex_color) + { + CGAL::IO::Color c = drawing_functor.vertex_color(*t3, vh); + graphic_buffer.add_point(vh->point(), c); + } + else + { graphic_buffer.add_point(vh->point()); } + } template @@ -75,20 +106,19 @@ void compute_elements(CGAL::GraphicBuffer &graphic_buffer, const T3 for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin(); it != t3->finite_facets_end(); ++it) { - // TODO TEST draw_face - compute_face(it, drawing_functor, graphic_buffer, t3); + compute_face(it, drawing_functor, graphic_buffer, t3); } } for (typename T3::Finite_edges_iterator it = t3->finite_edges_begin(); it != t3->finite_edges_end(); ++it) - { // TODO TEST draw_edge + edge color + { compute_edge(it, graphic_buffer); } for (typename T3::Finite_vertices_iterator it = t3->finite_vertices_begin(); it != t3->finite_vertices_end(); ++it) - { // TODO TEST draw_vertex + vertex color + { compute_vertex(it, graphic_buffer); } } @@ -122,7 +152,7 @@ template void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") { CGAL::GraphicBuffer buffer; - CGAL::GenericFunctor From 9c1b89c202189b5c50b88f74bbbe6f2c251c0ac3 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 18:22:51 +0200 Subject: [PATCH 046/399] Modified T3 templates to test functors --- .../include/CGAL/draw_triangulation_3.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 4f60bb5328f6..478340f7912e 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -58,14 +58,14 @@ void compute_face(typename T3::Finite_facets_iterator fh, graphic_buffer.face_end(); } -template +template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::GraphicBuffer &graphic_buffer, const T3 *t3) { + CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) { // DONE: TEST draw_edge + edge color if(!drawing_functor.draw_edge(*t3, eh)) { return; } - if( && drawing_functor.edge_color) { + if(drawing_functor.edge_color) { CGAL::IO::Color c = drawing_functor.edge_color(*t3, eh); graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), @@ -77,9 +77,9 @@ void compute_edge(typename T3::Finite_edges_iterator eh, } } -template +template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::GraphicBuffer &graphic_buffer, const T3 *t3) { + CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) { // DONE TEST draw_vertex + vertex color if(!drawing_functor.draw_vertex(*t3, vh)) @@ -113,13 +113,13 @@ void compute_elements(CGAL::GraphicBuffer &graphic_buffer, const T3 for (typename T3::Finite_edges_iterator it = t3->finite_edges_begin(); it != t3->finite_edges_end(); ++it) { - compute_edge(it, graphic_buffer); + compute_edge(it, graphic_buffer,drawing_functor , t3); } for (typename T3::Finite_vertices_iterator it = t3->finite_vertices_begin(); it != t3->finite_vertices_end(); ++it) { - compute_vertex(it, graphic_buffer); + compute_vertex(it, graphic_buffer, drawing_functor, t3); } } From cf51780c0ddc6adda9eabac32b937eb6af8946a8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 23 Sep 2022 19:48:07 +0200 Subject: [PATCH 047/399] small modifs --- .../include/CGAL/draw_triangulation_3.h | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 478340f7912e..c98b990d5de2 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -34,13 +34,10 @@ void compute_face(typename T3::Finite_facets_iterator fh, const DrawingFunctor &drawing_functor, CGAL::GraphicBuffer &graphic_buffer, const T3 *t3) { - // DONE: TEST draw_face if(!drawing_functor.draw_face(*t3, fh)) - { - return; - } + { return; } - if(drawing_functor.face_color) + if(drawing_functor.colored_face(*t3, fh) && drawing_functor.face_color) { CGAL::IO::Color c = drawing_functor.face_color(*t3, fh); graphic_buffer.face_begin(c); @@ -60,13 +57,13 @@ void compute_face(typename T3::Finite_facets_iterator fh, template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) { - // DONE: TEST draw_edge + edge color - if(!drawing_functor.draw_edge(*t3, eh)) { - return; - } - if(drawing_functor.edge_color) { + CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) +{ + if(!drawing_functor.draw_edge(*t3, eh)) + { return; } + if(drawing_functor.colored_edge(*t3, eh) && drawing_functor.edge_color) + { CGAL::IO::Color c = drawing_functor.edge_color(*t3, eh); graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), eh->first->vertex(eh->third)->point(), c); @@ -79,35 +76,28 @@ void compute_edge(typename T3::Finite_edges_iterator eh, template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) { - - // DONE TEST draw_vertex + vertex color + CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) +{ if(!drawing_functor.draw_vertex(*t3, vh)) - { - return; - } + { return; } - if(drawing_functor.vertex_color) + if(drawing_functor.colored_vertex(*t3, vh) && drawing_functor.vertex_color) { CGAL::IO::Color c = drawing_functor.vertex_color(*t3, vh); graphic_buffer.add_point(vh->point(), c); } else { graphic_buffer.add_point(vh->point()); } - } template void compute_elements(CGAL::GraphicBuffer &graphic_buffer, const T3 *t3, - const DrawingFunctor &drawing_functor, - bool m_nofaces = false) { - - if (!m_nofaces) { - for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin(); - it != t3->finite_facets_end(); ++it) - { - compute_face(it, drawing_functor, graphic_buffer, t3); - } + const DrawingFunctor &drawing_functor) +{ + for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin(); + it != t3->finite_facets_end(); ++it) + { + compute_face(it, drawing_functor, graphic_buffer, t3); } for (typename T3::Finite_edges_iterator it = t3->finite_edges_begin(); @@ -122,7 +112,7 @@ void compute_elements(CGAL::GraphicBuffer &graphic_buffer, const T3 compute_vertex(it, graphic_buffer, drawing_functor, t3); } } - + } // namespace draw_function_for_t3 template @@ -158,7 +148,12 @@ void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") typename CGAL_T3_TYPE::Finite_facets_iterator> drawingfunctor; - drawingfunctor.face_color = + drawingfunctor.colored_face = + [](const CGAL_T3_TYPE &at3, const typename CGAL_T3_TYPE::Finite_facets_iterator fh) + -> bool + { return true; }; + + drawingfunctor.face_color = [](const CGAL_T3_TYPE &at3, const typename CGAL_T3_TYPE::Finite_facets_iterator fh) -> CGAL::IO::Color { From bf59ef50030aa5cb4b3abe3e5044b2da03f88d6c Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 22:09:08 +0200 Subject: [PATCH 048/399] Generic_functor.h renamed to Drawing_functor.h --- .../include/CGAL/{Generic_functors.h => Drawing_functor.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename GraphicsView/include/CGAL/{Generic_functors.h => Drawing_functor.h} (100%) diff --git a/GraphicsView/include/CGAL/Generic_functors.h b/GraphicsView/include/CGAL/Drawing_functor.h similarity index 100% rename from GraphicsView/include/CGAL/Generic_functors.h rename to GraphicsView/include/CGAL/Drawing_functor.h From cb4c77f1eba2fad6effa8472a2df1249cccce0ee Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 22:21:01 +0200 Subject: [PATCH 049/399] changed functor names. --- GraphicsView/include/CGAL/Drawing_functor.h | 10 +++++----- Linear_cell_complex/demo/Linear_cell_complex/Viewer.h | 2 +- .../include/CGAL/draw_linear_cell_complex_function.h | 4 ++-- Triangulation_2/include/CGAL/draw_triangulation_2.h | 4 ++-- Triangulation_3/include/CGAL/draw_triangulation_3.h | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/GraphicsView/include/CGAL/Drawing_functor.h b/GraphicsView/include/CGAL/Drawing_functor.h index 5c39b610d45d..e0907cfc12fc 100644 --- a/GraphicsView/include/CGAL/Drawing_functor.h +++ b/GraphicsView/include/CGAL/Drawing_functor.h @@ -19,9 +19,9 @@ template -struct DrawingFunctor +struct Drawing_functor { - DrawingFunctor(): m_enabled_vertices(true), + Drawing_functor(): m_enabled_vertices(true), m_enabled_edges(true), m_enabled_faces(true) { @@ -71,10 +71,10 @@ template -struct DrawingFunctorWithVolume : - public DrawingFunctor +struct Drawing_functor_with_volume : + public Drawing_functor { - DrawingFunctorWithVolume() : m_enabled_volumes(true) + Drawing_functor_with_volume() : m_enabled_volumes(true) { draw_volume=[](const DS &, volume_handle)->bool { return true; }; colored_volume=[](const DS &, volume_handle)->bool { return false; }; diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index c16eb2420257..9d662e6e6a11 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -37,7 +37,7 @@ public Q_SLOTS: void sceneChanged(); private: - CGAL::DrawingFunctorWithVolume -#include +#include #include #include @@ -264,7 +264,7 @@ template class Map, class Refs, class Storage_, - class DrawingFunctor=DrawingFunctorWithVolume +#include #include #include #include @@ -109,7 +109,7 @@ void add_in_graphic_buffer_t2(GraphicBuffer &graphic_buffer, template > void draw(const CGAL_T2_TYPE &at2, diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index c98b990d5de2..7ca0cd35e609 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -13,7 +13,7 @@ #ifndef CGAL_DRAW_T3_H #define CGAL_DRAW_T3_H -#include +#include #include #include #include From e77c52b1964f8c2752abdbb85c47e88aa393151f Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 22:29:33 +0200 Subject: [PATCH 050/399] Changed functor name --- Triangulation_3/include/CGAL/draw_triangulation_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 7ca0cd35e609..5361701bda62 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -142,7 +142,7 @@ template void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") { CGAL::GraphicBuffer buffer; - CGAL::DrawingFunctor From 53f0952e0f13e221579ad85e84bd55817bcb9ef7 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 23:03:21 +0200 Subject: [PATCH 051/399] Modified T2. --- .../include/CGAL/draw_triangulation_2.h | 137 ++++++++++++------ 1 file changed, 92 insertions(+), 45 deletions(-) diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 9862fcd82334..a0635f428bc4 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -26,26 +26,25 @@ namespace CGAL { -// Default color functor; user can change it to have its own face color -struct DefaultColorFunctorT2 { - template - static CGAL::IO::Color run(const T2 &, - const typename T2::Finite_faces_iterator fh) { - CGAL::Random random((unsigned int)(std::size_t)(&*fh)); - return get_random_color(random); - } -}; - namespace draw_function_for_t2 { -template +template void compute_face(typename T2::Finite_faces_iterator fh, - GraphicBuffer &graphic_buffer, const T2 *t2, - const ColorFunctor &m_fcolor) { + const DrawingFunctor &drawing_functor, + CGAL::GraphicBuffer &graphic_buffer, + const T2 *t2) { - // TODO: change it to m_fcolor.face_color(*t2, fh) - CGAL::IO::Color c = m_fcolor.run(*t2, fh); - graphic_buffer.face_begin(c); + if (!drawing_functor.draw_face(*t2, fh)) { + return; + } + + if (drawing_functor.colored_face(*t2, fh) && drawing_functor.face_color) { + CGAL::IO::Color c = drawing_functor.face_color(*t2, fh); + graphic_buffer.face_begin(c); + + } else { + graphic_buffer.face_begin(); + } graphic_buffer.add_point_in_face(fh->vertex(0)->point()); graphic_buffer.add_point_in_face(fh->vertex(1)->point()); @@ -54,52 +53,78 @@ void compute_face(typename T2::Finite_faces_iterator fh, graphic_buffer.face_end(); } -template +template void compute_edge(typename T2::Finite_edges_iterator eh, - GraphicBuffer &graphic_buffer) { - graphic_buffer.add_segment( - eh->first->vertex(eh->first->cw(eh->second))->point(), - eh->first->vertex(eh->first->ccw(eh->second))->point()); + const DrawingFunctor &drawing_functor, const T2 *t2, + CGAL::GraphicBuffer &graphic_buffer) { + + if (!drawing_functor.draw_edge(*t2, eh)) { + return; + } + + if (drawing_functor.colored_edge(*t2, eh) && drawing_functor.edge_color) { + + CGAL::IO::Color c = drawing_functor.edge_color(*t2, eh); + graphic_buffer.add_segment( + eh->first->vertex(eh->first->cw(eh->second))->point(), + eh->first->vertex(eh->first->ccw(eh->second))->point(), c); + } + + else { + graphic_buffer.add_segment( + eh->first->vertex(eh->first->cw(eh->second))->point(), + eh->first->vertex(eh->first->ccw(eh->second))->point()); + } } -template +template void compute_vertex(typename T2::Vertex_handle vh, - GraphicBuffer &graphic_buffer) { - graphic_buffer.add_point(vh->point()); + CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor, const T2 *t2) { + + if (!drawing_functor.draw_vertex(*t2, vh)) { + return; + } + + if (drawing_functor.colored_vertex(*t2, vh) && drawing_functor.vertex_color) { + CGAL::IO::Color c = drawing_functor.vertex_color(*t2, vh); + graphic_buffer.add_point(vh->point(), c); + } else { + graphic_buffer.add_point(vh->point()); + } } -template -void compute_elements(GraphicBuffer &graphic_buffer, const T2 *t2, - const ColorFunctor &m_color_functor, +template +void compute_elements(CGAL::GraphicBuffer &graphic_buffer, + const T2 *t2, const DrawingFunctor &drawing_functor, bool m_nofaces = false) { - // clear(); if (!m_nofaces) { for (typename T2::Finite_faces_iterator it = t2->finite_faces_begin(); it != t2->finite_faces_end(); ++it) { - compute_face(it, graphic_buffer, t2, m_color_functor); + compute_face(it, drawing_functor, graphic_buffer, t2); } } for (typename T2::Finite_edges_iterator it = t2->finite_edges_begin(); it != t2->finite_edges_end(); ++it) { - compute_edge(it, graphic_buffer); + compute_edge(it, drawing_functor, t2, graphic_buffer); } for (typename T2::Finite_vertices_iterator it = t2->finite_vertices_begin(); it != t2->finite_vertices_end(); ++it) { - compute_vertex(it, graphic_buffer); + compute_vertex(it, graphic_buffer, drawing_functor, t2); } } } // namespace draw_function_for_t2 -template -void add_in_graphic_buffer_t2(GraphicBuffer &graphic_buffer, - const ColorFunctor &m_color_functor, +template +void add_in_graphic_buffer_t2(CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor, const T2 *at2 = nullptr, bool m_nofaces = false) { if (at2 != nullptr) { - draw_function_for_t2::compute_elements(graphic_buffer, at2, m_color_functor, + draw_function_for_t2::compute_elements(graphic_buffer, at2, drawing_functor, m_nofaces); } } @@ -107,22 +132,44 @@ void add_in_graphic_buffer_t2(GraphicBuffer &graphic_buffer, // Specialization of draw function. #define CGAL_T2_TYPE CGAL::Triangulation_2 -template > -void draw(const CGAL_T2_TYPE &at2, +template +void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, const char *title = "Triangulation_2 Basic Viewer", - const ColorFunctor &color_functor = ColorFunctor(), bool nofill = false) { - GraphicBuffer buffer; - // add_in_graphic_buffer_t3(buffer, color_functor, &at3, false); - add_in_graphic_buffer_t2(buffer, DefaultColorFunctorT2(), &at2, false); + CGAL::GraphicBuffer buffer; + add_in_graphic_buffer_t2(buffer, drawingfunctor, &at2, nofill); draw_buffer(buffer); } +template +void draw(const CGAL_T2_TYPE &at2, + const char *title = "Triangulation_2 Basic Viewer", + bool nofill = false) { + + CGAL::GraphicBuffer buffer; + Drawing_functor + drawingFunctor; + + drawingFunctor.colored_face = + [](const CGAL_T2_TYPE &at3, + const typename CGAL_T2_TYPE::Finite_faces_iterator fh) -> bool { + return true; + }; + + drawingFunctor.face_color = + [](const CGAL_T2_TYPE &at2, + const typename CGAL_T2_TYPE::Finite_faces_iterator fh) + -> CGAL::IO::Color { + CGAL::Random random((unsigned int)(std::size_t)(&*fh)); + return get_random_color(random); + }; + + draw(at2, drawingFunctor, title, nofill); +} + #undef CGAL_T2_TYPE } // End namespace CGAL From ac259bfc852a89085cefce66c5da844255940104 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 23 Sep 2022 23:05:45 +0200 Subject: [PATCH 052/399] Fixed typo --- Triangulation_2/include/CGAL/draw_triangulation_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index a0635f428bc4..5fd3dba9e24f 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -154,7 +154,7 @@ void draw(const CGAL_T2_TYPE &at2, drawingFunctor; drawingFunctor.colored_face = - [](const CGAL_T2_TYPE &at3, + [](const CGAL_T2_TYPE &at2, const typename CGAL_T2_TYPE::Finite_faces_iterator fh) -> bool { return true; }; From fcdad212b566b2560dfa4dc3cb581866465c1a12 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 24 Sep 2022 00:50:13 +0200 Subject: [PATCH 053/399] Applied new APIs version on Straight skeleton 2. --- .../include/CGAL/draw_straight_skeleton_2.h | 229 ++++++++---------- 1 file changed, 100 insertions(+), 129 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 60a631250a13..fcf32bed8a0f 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -8,168 +8,139 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_SS2_H #define CGAL_DRAW_SS2_H -#include +#include +#include #include +#include #ifdef CGAL_USE_BASIC_VIEWER -#include #include +#include #include namespace CGAL { -// Default color functor; user can change it to have its own face color -struct DefaultColorFunctorSS2 -{ - template - static CGAL::IO::Color run(const SS2&, - const typename SS2::Finite_faces_iterator fh) - { - CGAL::Random random((unsigned int)(std::size_t)(&*fh)); - return get_random_color(random); +namespace draw_function_for_ss2 { + +template +void compute_edge(typename SS2::Halfedge_const_handle eh, + const DrawingFunctor &drawing_functor, const SS2 *ss2, + CGAL::GraphicBuffer &graphic_buffer) { + + if (!drawing_functor.draw_edge(*ss2, eh)) { + return; } -}; - -// Viewer class for SS2 -template -class SimpleStraightSkeleton2ViewerQt : public Basic_viewer_qt -{ - typedef Basic_viewer_qt Base; - typedef typename SS2::Vertex_const_handle Vertex_const_handle; - typedef typename SS2::Halfedge_const_handle Halfedge_const_handle; - - // typedef typename SS2::Point Point; - -public: - /// Construct the viewer. - /// @param ass2 the ss2 to view - /// @param title the title of the window - SimpleStraightSkeleton2ViewerQt(QWidget* parent, const SS2& ass2, - const char* title="Basic SS2 Viewer", - const ColorFunctor& fcolor=ColorFunctor()) : - // First draw: vertices; edges, faces; multi-color; no inverse normal - Base(parent, title, true, true, true, false, false), - ss2(ass2), - m_fcolor(fcolor) - { - compute_elements(); + + if (drawing_functor.colored_edge(*ss2, eh)) { + if (eh->is_bisector()) + graphic_buffer.add_segment(eh->opposite()->vertex()->point(), + eh->vertex()->point(), CGAL::IO::red()); + else + graphic_buffer.add_segment(eh->opposite()->vertex()->point(), + eh->vertex()->point(), CGAL::IO::black()); } +} + +template +void print_halfedge_labels(typename SS2::Halfedge_const_handle h, + CGAL::GraphicBuffer &graphic_buffer) { + std::stringstream label; -protected: - /* - void compute_face(Facet_const_handle fh) - { - CGAL::IO::Color c=m_fcolor.run(ss2, fh); - face_begin(c); + label << "H" << h->id() << " (V" << h->vertex()->id() << ") "; + label << "H" << h->opposite()->id() << " (V" << h->opposite()->vertex()->id() + << ") "; + + graphic_buffer.add_text( + CGAL::midpoint(h->opposite()->vertex()->point(), h->vertex()->point()), + label.str()); +} - add_point_in_face(fh->vertex(0)->point()); - add_point_in_face(fh->vertex(1)->point()); - add_point_in_face(fh->vertex(2)->point()); +template +void compute_vertex(typename SS2::Vertex_const_handle vh, + const DrawingFunctor &drawing_functor, const SS2 *ss2, + CGAL::GraphicBuffer &graphic_buffer) { - face_end(); + if (!drawing_functor.draw_vertex(*ss2, vh)) { + return; } - */ - void compute_edge(Halfedge_const_handle eh) - { - if(eh->is_bisector()) - add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), CGAL::IO::red()); + if (drawing_functor.colored_vertex(*ss2, vh)) { + if (vh->is_split()) + graphic_buffer.add_point( + vh->point(), CGAL::IO::Color(10, 10, 180)); // blue, but not flashy + else if (vh->has_infinite_time()) + graphic_buffer.add_point(vh->point(), CGAL::IO::orange()); else - add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), CGAL::IO::black()); - } - void print_halfedge_labels(Halfedge_const_handle h) - { - std::stringstream label; - label << "H" << h->id() << " (V" << h->vertex()->id() << ") "; - label << "H" << h->opposite()->id() << " (V" << h->opposite()->vertex()->id() << ") "; - add_text(CGAL::midpoint(h->opposite()->vertex()->point(), h->vertex()->point()), label.str()); + graphic_buffer.add_point( + vh->point(), CGAL::IO::Color(10, 180, 10)); // green, but not flashy } +} - void compute_vertex(Vertex_const_handle vh) - { - if(vh->is_split()) - add_point(vh->point(), CGAL::IO::Color(10,10,180)); // blue, but not flashy - else if(vh->has_infinite_time()) - add_point(vh->point(), CGAL::IO::orange()); - else - add_point(vh->point(), CGAL::IO::Color(10,180,10)); // green, but not flashy - } - void print_vertex_label(Vertex_const_handle vh) - { - std::stringstream label; - label << "V" << vh->id() << std::ends; - add_text(vh->point(), label.str()); - } +template +void print_vertex_label(typename SS2::Vertex_const_handle vh, + CGAL::GraphicBuffer &graphic_buffer) { + std::stringstream label; + label << "V" << vh->id() << std::ends; + graphic_buffer.add_text(vh->point(), label.str()); +} - void compute_elements() - { - clear(); - - for (typename SS2::Halfedge_const_iterator it=ss2.halfedges_begin(); it!=ss2.halfedges_end(); ++it) - { - if(it->id() < it->opposite()->id()) - { - compute_edge(it); - print_halfedge_labels(it); - } - } - for (typename SS2::Vertex_const_iterator it=ss2.vertices_begin(); it!=ss2.vertices_end(); ++it) - { - compute_vertex(it); - print_vertex_label(it); +template +void compute_elements(CGAL::GraphicBuffer &graphic_buffer, + const SS2 *ss2, const DrawingFunctor &drawing_functor) { + + for (typename SS2::Halfedge_const_iterator it = ss2->halfedges_begin(); + it != ss2->halfedges_end(); ++it) { + if (it->id() < it->opposite()->id()) { + compute_edge(it, drawing_functor, ss2, graphic_buffer); + print_halfedge_labels(it, graphic_buffer); } } + for (typename SS2::Vertex_const_iterator it = ss2->vertices_begin(); + it != ss2->vertices_end(); ++it) { + compute_vertex(it, drawing_functor, ss2, graphic_buffer); + print_vertex_label(it, graphic_buffer); + } +} - 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 +} // namespace draw_function_for_ss2 - // Call the base method to process others/classicals key - Base::keyPressEvent(e); +template +void add_in_graphic_buffer_ss2(CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor, + const ss2 *ass2 = nullptr) { + if (ass2 != nullptr) { + draw_function_for_ss2::compute_elements(graphic_buffer, ass2, + drawing_functor); } - -protected: - const SS2& ss2; - const ColorFunctor& m_fcolor; -}; +} // Specialization of draw function. #define CGAL_SS_TYPE CGAL::Straight_skeleton_2 -template -void draw(const CGAL_SS_TYPE& ass2, - const char* title="Straight Skeleton Basic Viewer") -{ -#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]={"ss2_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - DefaultColorFunctorSS2 fcolor; - SimpleStraightSkeleton2ViewerQt - mainwindow(app.activeWindow(), ass2, title, fcolor); - mainwindow.show(); - app.exec(); - } +template +void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, + const char *title = "Straight Skeleton Basic Viewer") { + CGAL::GraphicBuffer buffer; + add_in_graphic_buffer_ss2(buffer, drawingfunctor, &ass2); + draw_buffer(buffer); +} + +template +void draw(const CGAL_SS_TYPE &ass2, + const char *title = "Straight Skeleton Basic Viewer") { + + Drawing_functor + drawingFunctor; + + draw(ass2, drawingFunctor, title); } #undef CGAL_SS_TYPE From a84a2eea083a241385f7644db8c187226b87e27c Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 24 Sep 2022 03:33:46 +0200 Subject: [PATCH 054/399] Applied new APIs version on Straight polygon 2. --- Polygon/include/CGAL/draw_polygon_2.h | 119 ++++++++++---------------- 1 file changed, 44 insertions(+), 75 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 1ab6ea142674..5173a7d5bb1c 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -13,10 +13,13 @@ // // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_POLYGON_2_H #define CGAL_DRAW_POLYGON_2_H +#include +#include #include #ifdef DOXYGEN_RUNNING @@ -39,99 +42,65 @@ void draw(const P& ap); #endif #ifdef CGAL_USE_BASIC_VIEWER -#include + #include +#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; +namespace CGAL { -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(); - } +namespace draw_function_for_p2 { -protected: - void compute_elements() - { - clear(); +template +void compute_elements(CGAL::GraphicBuffer &graphic_buffer, + const P2 *p2) { - if (p2.is_empty()) return; + typedef typename P2::Point_2 Point; - Point prev=p2.vertex(p2.size()-1); + if (p2->is_empty()) + return; - CGAL::IO::Color c(75,160,255); - face_begin(c); + Point prev = p2->vertex(p2->size() - 1); - 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; - } + CGAL::IO::Color c(75, 160, 255); + graphic_buffer.face_begin(c); - face_end(); + for (typename P2::Vertex_const_iterator i = p2->vertices_begin(); + i != p2->vertices_end(); ++i) { + graphic_buffer.add_point(*i); // Add vertex + graphic_buffer.add_segment(prev, *i); // Add segment with previous point + graphic_buffer.add_point_in_face(*i); // Add point in face + prev = *i; } - virtual void keyPressEvent(QKeyEvent *e) - { - // Test key pressed: - // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - // if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ... } + graphic_buffer.face_end(); +} - // 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 +} // namespace draw_function_for_p2 - // Call the base method to process others/classicals key - Base::keyPressEvent(e); +template +void add_in_graphic_buffer_p2(CGAL::GraphicBuffer &graphic_buffer, + const P2 *p2 = nullptr) { + if (p2 != nullptr) { + draw_function_for_p2::compute_elements(graphic_buffer, p2); } - -protected: - const P2& p2; -}; +} // Specialization of draw function. -template -void draw(const CGAL::Polygon_2& ap2, - const char* title="Polygon_2 Basic Viewer") -{ -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif +#define CGAL_P2_TYPE CGAL::Polygon_2 - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"t2_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimplePolygon2ViewerQt > - mainwindow(app.activeWindow(), ap2, title); - mainwindow.show(); - app.exec(); - } +template +void draw(const CGAL_P2_TYPE &ap2, + const char *title = "Polygon_2 Basic Viewer") { + + // Drawing_functor + // drawingFunctor; + + CGAL::GraphicBuffer buffer; + add_in_graphic_buffer_p2(buffer, &ap2); + draw_buffer(buffer); } } // End namespace CGAL From bc2158809f432cf05af605136cac3b8dccf8c6a2 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 26 Sep 2022 18:45:01 +0200 Subject: [PATCH 055/399] two versions of add --- .../include/CGAL/draw_triangulation_3.h | 57 +++++++++++-------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 5361701bda62..3b6e7901c2b2 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -57,7 +57,8 @@ void compute_face(typename T3::Finite_facets_iterator fh, template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) + CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor, const T3 *t3) { if(!drawing_functor.draw_edge(*t3, eh)) { return; } @@ -76,7 +77,8 @@ void compute_edge(typename T3::Finite_edges_iterator eh, template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) + CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor, const T3 *t3) { if(!drawing_functor.draw_vertex(*t3, vh)) { return; } @@ -116,32 +118,17 @@ void compute_elements(CGAL::GraphicBuffer &graphic_buffer, const T3 } // namespace draw_function_for_t3 template -void add_in_graphic_buffer_t3(CGAL::GraphicBuffer &graphic_buffer, - const DrawingFunctor &drawing_functor, - const T3 *at3 = nullptr) +void add_in_graphic_buffer_t3(const T3 &at3, + CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor) { - if (at3 != nullptr) - { - draw_function_for_t3::compute_elements(graphic_buffer, at3, drawing_functor); - } -} - -// Specialization of draw function. -#define CGAL_T3_TYPE CGAL::Triangulation_3 - -template -void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, - const char *title = "T3 Basic Viewer") -{ - CGAL::GraphicBuffer buffer; - add_in_graphic_buffer_t3(buffer, drawingfunctor, &at3); - draw_buffer(buffer); + draw_function_for_t3::compute_elements(at3, graphic_buffer, drawing_functor); } -template -void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") +template +void add_in_graphic_buffer_t3(const T3 &at3, + CGAL::GraphicBuffer &graphic_buffer) { - CGAL::GraphicBuffer buffer; CGAL::Drawing_functor + +template +void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, + const char *title = "T3 Basic Viewer") +{ + CGAL::GraphicBuffer buffer; + add_in_graphic_buffer_t3(buffer, drawingfunctor, &at3); + draw_buffer(buffer); +} - draw(at3, drawingfunctor, title); +template +void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") +{ + CGAL::GraphicBuffer buffer; + add_in_graphic_buffer_t3(buffer, &at3); + draw_buffer(buffer); } #undef CGAL_T3_TYPE From 1108403caf8e79f8b8db2d843630e211f0546cf7 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 1 Oct 2022 18:26:09 +0200 Subject: [PATCH 056/399] Modified T3 --- .../include/CGAL/draw_triangulation_3.h | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 3b6e7901c2b2..42697e9938ea 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -93,7 +93,7 @@ void compute_vertex(typename T3::Vertex_handle vh, } template -void compute_elements(CGAL::GraphicBuffer &graphic_buffer, const T3 *t3, +void compute_elements(const T3 *t3, CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor) { for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin(); @@ -122,26 +122,26 @@ void add_in_graphic_buffer_t3(const T3 &at3, CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor) { - draw_function_for_t3::compute_elements(at3, graphic_buffer, drawing_functor); + draw_function_for_t3::compute_elements(&at3, graphic_buffer, drawing_functor); } template void add_in_graphic_buffer_t3(const T3 &at3, CGAL::GraphicBuffer &graphic_buffer) { - CGAL::Drawing_functor - drawingfunctor; - - drawingfunctor.colored_face = - [](const CGAL_T3_TYPE &at3, const typename CGAL_T3_TYPE::Finite_facets_iterator fh) + CGAL::Drawing_functor + drawing_functor; + + drawing_functor.colored_face = + [](const T3 &at3, const typename T3::Finite_facets_iterator fh) -> bool { return true; }; - drawingfunctor.face_color = - [](const CGAL_T3_TYPE &at3, const typename CGAL_T3_TYPE::Finite_facets_iterator fh) + drawing_functor.face_color = + [](const T3 &at3, const typename T3::Finite_facets_iterator fh) -> CGAL::IO::Color { if (fh==at3.finite_facets_end()) // use to get the mono color @@ -164,7 +164,7 @@ void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, const char *title = "T3 Basic Viewer") { CGAL::GraphicBuffer buffer; - add_in_graphic_buffer_t3(buffer, drawingfunctor, &at3); + add_in_graphic_buffer_t3(at3, buffer, drawingfunctor); draw_buffer(buffer); } @@ -172,7 +172,7 @@ template void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") { CGAL::GraphicBuffer buffer; - add_in_graphic_buffer_t3(buffer, &at3); + add_in_graphic_buffer_t3(at3, buffer); draw_buffer(buffer); } From 88193459ba00e91b81055d94e29f77502a250889 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 1 Oct 2022 18:48:41 +0200 Subject: [PATCH 057/399] Added two versions of add in T2 --- .../include/CGAL/draw_triangulation_2.h | 68 ++++++++++--------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 5fd3dba9e24f..271b5b99057a 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -95,8 +95,9 @@ void compute_vertex(typename T2::Vertex_handle vh, } template -void compute_elements(CGAL::GraphicBuffer &graphic_buffer, - const T2 *t2, const DrawingFunctor &drawing_functor, +void compute_elements(const T2 *t2, + CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor, bool m_nofaces = false) { if (!m_nofaces) { @@ -120,13 +121,38 @@ void compute_elements(CGAL::GraphicBuffer &graphic_buffer, } // namespace draw_function_for_t2 template -void add_in_graphic_buffer_t2(CGAL::GraphicBuffer &graphic_buffer, +void add_in_graphic_buffer_t2(const T2 &at2, + CGAL::GraphicBuffer &graphic_buffer, const DrawingFunctor &drawing_functor, - const T2 *at2 = nullptr, bool m_nofaces = false) { - if (at2 != nullptr) { - draw_function_for_t2::compute_elements(graphic_buffer, at2, drawing_functor, - m_nofaces); - } + bool m_nofaces = false) { + draw_function_for_t2::compute_elements(&at2, graphic_buffer, drawing_functor, + m_nofaces); +} + +template +void add_in_graphic_buffer_t2(const T2 &at2, + CGAL::GraphicBuffer &graphic_buffer, + bool m_nofaces = false) { + + CGAL::GraphicBuffer buffer; + Drawing_functor + drawingFunctor; + + drawingFunctor.colored_face = + [](const T2 &at2, const typename T2::Finite_faces_iterator fh) -> bool { + return true; + }; + + drawingFunctor.face_color = + [](const T2 &at2, + const typename T2::Finite_faces_iterator fh) -> CGAL::IO::Color { + CGAL::Random random((unsigned int)(std::size_t)(&*fh)); + return get_random_color(random); + }; + + add_in_graphic_buffer_t2(at2, graphic_buffer, drawingFunctor, m_nofaces); } // Specialization of draw function. @@ -136,9 +162,8 @@ template void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, const char *title = "Triangulation_2 Basic Viewer", bool nofill = false) { - CGAL::GraphicBuffer buffer; - add_in_graphic_buffer_t2(buffer, drawingfunctor, &at2, nofill); + add_in_graphic_buffer_t2(at2, buffer, drawingfunctor, nofill); draw_buffer(buffer); } @@ -146,28 +171,9 @@ template void draw(const CGAL_T2_TYPE &at2, const char *title = "Triangulation_2 Basic Viewer", bool nofill = false) { - CGAL::GraphicBuffer buffer; - Drawing_functor - drawingFunctor; - - drawingFunctor.colored_face = - [](const CGAL_T2_TYPE &at2, - const typename CGAL_T2_TYPE::Finite_faces_iterator fh) -> bool { - return true; - }; - - drawingFunctor.face_color = - [](const CGAL_T2_TYPE &at2, - const typename CGAL_T2_TYPE::Finite_faces_iterator fh) - -> CGAL::IO::Color { - CGAL::Random random((unsigned int)(std::size_t)(&*fh)); - return get_random_color(random); - }; - - draw(at2, drawingFunctor, title, nofill); + add_in_graphic_buffer_t2(at2, buffer, nofill); + draw_buffer(buffer); } #undef CGAL_T2_TYPE From 273ead7ab4ba7b4951a1909cd9c932cfc6a8fcea Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 1 Oct 2022 19:07:09 +0200 Subject: [PATCH 058/399] Added two versions of add in SS2 --- .../include/CGAL/draw_straight_skeleton_2.h | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index fcf32bed8a0f..db4dfaac3ab2 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -91,8 +91,9 @@ void print_vertex_label(typename SS2::Vertex_const_handle vh, } template -void compute_elements(CGAL::GraphicBuffer &graphic_buffer, - const SS2 *ss2, const DrawingFunctor &drawing_functor) { +void compute_elements(const SS2 *ss2, + CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor) { for (typename SS2::Halfedge_const_iterator it = ss2->halfedges_begin(); it != ss2->halfedges_end(); ++it) { @@ -110,14 +111,23 @@ void compute_elements(CGAL::GraphicBuffer &graphic_buffer, } // namespace draw_function_for_ss2 -template -void add_in_graphic_buffer_ss2(CGAL::GraphicBuffer &graphic_buffer, - const DrawingFunctor &drawing_functor, - const ss2 *ass2 = nullptr) { - if (ass2 != nullptr) { - draw_function_for_ss2::compute_elements(graphic_buffer, ass2, - drawing_functor); - } +template +void add_in_graphic_buffer_ss2(const SS2 &ass2, + CGAL::GraphicBuffer &graphic_buffer, + const DrawingFunctor &drawing_functor) { + draw_function_for_ss2::compute_elements(&ass2, graphic_buffer, + drawing_functor); +} + +template +void add_in_graphic_buffer_ss2( + const SS2 &ass2, CGAL::GraphicBuffer &graphic_buffer) { + Drawing_functor + drawingFunctor; + + add_in_graphic_buffer_ss2(ass2, graphic_buffer, drawingFunctor); } // Specialization of draw function. @@ -127,20 +137,16 @@ template void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, const char *title = "Straight Skeleton Basic Viewer") { CGAL::GraphicBuffer buffer; - add_in_graphic_buffer_ss2(buffer, drawingfunctor, &ass2); + add_in_graphic_buffer_ss2(ass2, buffer, drawingfunctor); draw_buffer(buffer); } template void draw(const CGAL_SS_TYPE &ass2, const char *title = "Straight Skeleton Basic Viewer") { - - Drawing_functor - drawingFunctor; - - draw(ass2, drawingFunctor, title); + CGAL::GraphicBuffer buffer; + add_in_graphic_buffer_ss2(ass2, buffer); + draw_buffer(buffer); } #undef CGAL_SS_TYPE From 913f676b2290cb293ccd95f41d63255aca4fdeb3 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 1 Oct 2022 19:28:47 +0200 Subject: [PATCH 059/399] Added two versions of add in LCC --- .../CGAL/draw_linear_cell_complex_function.h | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index 4034d772014c..b97085018deb 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -154,7 +154,7 @@ void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, } template -void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, +void compute_elements(const LCC *lcc, GraphicBuffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { if (lcc==nullptr) @@ -245,14 +245,21 @@ void compute_elements(GraphicBuffer &graphic_buffer, const LCC *lcc, * @param alcc */ template -void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor, - const LCC *alcc = nullptr) +void add_in_graphic_buffer_lcc(const LCC &alcc, GraphicBuffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { - if (alcc!=nullptr) - { - draw_function_for_lcc::compute_elements(graphic_buffer, alcc, m_drawing_functor); - } + draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor); +} + +template +void add_in_graphic_buffer_lcc(const LCC &alcc, GraphicBuffer &graphic_buffer) +{ + Drawing_functor_with_volume drawing_functor_with_volume; + + add_in_graphic_buffer_lcc(alcc, graphic_buffer, drawing_functor_with_volume); } // Specialization of draw function. @@ -264,17 +271,23 @@ template class Map, class Refs, class Storage_, - class DrawingFunctor=Drawing_functor_with_volume> -void draw(const CGAL_LCC_TYPE &alcc, - const char *title = "LCC for CMap Basic Viewer", - const DrawingFunctor &drawing_functor=DrawingFunctor()) + class DrawingFunctor> +void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor, + const char *title = "LCC for CMap Basic Viewer") +{ + GraphicBuffer buffer; + add_in_graphic_buffer_lcc(alcc, buffer, drawing_functor); + draw_buffer(buffer); +} + +template class Map, + class Refs, class Storage_> +void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer") { GraphicBuffer buffer; - add_in_graphic_buffer_lcc(buffer, drawing_functor, &alcc); + add_in_graphic_buffer_lcc(alcc, buffer); draw_buffer(buffer); } From 796ec13391054f04e9be70bb4debd4e7d4108fdc Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 3 Oct 2022 13:27:22 +0200 Subject: [PATCH 060/399] Modified GraphicBuffer class name to snake case. --- GraphicsView/include/CGAL/Graphic_buffer.h | 6 +++--- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 6 +++--- .../demo/Linear_cell_complex/Viewer.h | 2 +- .../CGAL/draw_linear_cell_complex_function.h | 16 ++++++++-------- Point_set_3/include/CGAL/draw_point_set_3.h | 8 ++++---- Polygon/include/CGAL/draw_polygon_2.h | 6 +++--- .../include/CGAL/draw_straight_skeleton_2.h | 18 +++++++++--------- .../include/CGAL/draw_triangulation_2.h | 18 +++++++++--------- .../include/CGAL/draw_triangulation_3.h | 16 ++++++++-------- 9 files changed, 48 insertions(+), 48 deletions(-) diff --git a/GraphicsView/include/CGAL/Graphic_buffer.h b/GraphicsView/include/CGAL/Graphic_buffer.h index 84456815b38f..538898df76e2 100644 --- a/GraphicsView/include/CGAL/Graphic_buffer.h +++ b/GraphicsView/include/CGAL/Graphic_buffer.h @@ -40,13 +40,13 @@ namespace CGAL { // This class is responsible for dealing with available CGAL data structures and // handling buffers. template -class GraphicBuffer { +class Graphic_buffer { public: typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; - GraphicBuffer(std::vector (&pos)[20], CGAL::Bbox_3 &bbox) + Graphic_buffer(std::vector (&pos)[20], CGAL::Bbox_3 &bbox) : m_buffer_for_mono_points(&pos[POS_MONO_POINTS], nullptr, &bbox, nullptr, nullptr, nullptr), m_buffer_for_colored_points(&pos[POS_COLORED_POINTS], nullptr, &bbox, @@ -72,7 +72,7 @@ class GraphicBuffer { &pos[FLAT_NORMAL_COLORED_FACES], &pos[SMOOTH_NORMAL_COLORED_FACES]) {} - GraphicBuffer() + Graphic_buffer() : m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr, &m_bounding_box, nullptr, nullptr, nullptr), m_buffer_for_colored_points(&arrays[POS_COLORED_POINTS], nullptr, diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 1337df046e1a..ceae3cfd1c43 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -83,7 +83,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer // Constructor/Destructor Basic_viewer_qt(QWidget* parent, - GraphicBuffer& buf, + Graphic_buffer& buf, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -1612,7 +1612,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer protected: - GraphicBuffer& gBuffer; + Graphic_buffer& gBuffer; bool m_draw_vertices; bool m_draw_edges; @@ -1724,7 +1724,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer * @param graphic_buffer */ template -void draw_buffer(GraphicBuffer &graphic_buffer) { +void draw_buffer(Graphic_buffer &graphic_buffer) { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 9d662e6e6a11..1e314394d60c 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -42,7 +42,7 @@ public Q_SLOTS: Dart_const_handle, Dart_const_handle, Dart_const_handle> m_drawing_functor; - CGAL::GraphicBuffer m_graphic_buffer; + CGAL::Graphic_buffer m_graphic_buffer; Scene* scene; bool m_previous_scene_empty; }; diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index b97085018deb..e8753c5aa4d4 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -70,7 +70,7 @@ template void compute_face(typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, - GraphicBuffer &graphic_buffer) + Graphic_buffer &graphic_buffer) { if (!m_drawing_functor.are_faces_enabled() || !m_drawing_functor.draw_face(*lcc, dh)) @@ -115,7 +115,7 @@ void compute_face(typename LCC::Dart_const_handle dh, template void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, const DrawingFunctor &m_drawing_functor, - GraphicBuffer &graphic_buffer) + Graphic_buffer &graphic_buffer) { if (!m_drawing_functor.are_edges_enabled() || !m_drawing_functor.draw_edge(*lcc, dh)) @@ -138,7 +138,7 @@ void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, template void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, - GraphicBuffer &graphic_buffer) + Graphic_buffer &graphic_buffer) { if (!m_drawing_functor.are_vertices_enabled() || !m_drawing_functor.draw_vertex(*lcc, dh)) @@ -154,7 +154,7 @@ void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, } template -void compute_elements(const LCC *lcc, GraphicBuffer &graphic_buffer, +void compute_elements(const LCC *lcc, Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { if (lcc==nullptr) @@ -245,14 +245,14 @@ void compute_elements(const LCC *lcc, GraphicBuffer &graphic_buffer, * @param alcc */ template -void add_in_graphic_buffer_lcc(const LCC &alcc, GraphicBuffer &graphic_buffer, +void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor); } template -void add_in_graphic_buffer_lcc(const LCC &alcc, GraphicBuffer &graphic_buffer) +void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &graphic_buffer) { Drawing_functor_with_volume buffer; + Graphic_buffer buffer; add_in_graphic_buffer_lcc(alcc, buffer, drawing_functor); draw_buffer(buffer); } @@ -286,7 +286,7 @@ template void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer") { - GraphicBuffer buffer; + Graphic_buffer buffer; add_in_graphic_buffer_lcc(alcc, buffer); draw_buffer(buffer); } 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 3c5c5cfb5ccd..125ffe73862c 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -47,7 +47,7 @@ namespace draw_function_for_PointSet { template void compute_vertex(const typename PointSet::Point_map::value_type &p, - GraphicBuffer &graphic_buffer) { + Graphic_buffer &graphic_buffer) { graphic_buffer.add_point(p); // We can use add_point(p, c) with c a CGAL::IO::Color to add a colored point @@ -56,7 +56,7 @@ void compute_vertex(const typename PointSet::Point_map::value_type &p, template void compute_elements(const PointSet *pointset, - GraphicBuffer &graphic_buffer) { + Graphic_buffer &graphic_buffer) { for (typename PointSet::const_iterator it = pointset->begin(); it != pointset->end(); ++it) { compute_vertex(pointset->point(*it), graphic_buffer); @@ -66,7 +66,7 @@ void compute_elements(const PointSet *pointset, } // namespace draw_function_for_PointSet template -void add_in_graphic_buffer_point_set(GraphicBuffer &graphic_buffer, +void add_in_graphic_buffer_point_set(Graphic_buffer &graphic_buffer, const PointSet *aPointSet = nullptr) { if (aPointSet != nullptr) { draw_function_for_PointSet::compute_elements(aPointSet, graphic_buffer); @@ -77,7 +77,7 @@ void add_in_graphic_buffer_point_set(GraphicBuffer &graphic_buffer, template void draw(const Point_set_3 &apointset, const char *title = "Point_set_3 Basic Viewer") { - GraphicBuffer buffer; + Graphic_buffer buffer; add_in_graphic_buffer_point_set(buffer, &apointset); draw_buffer(buffer); } diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 5173a7d5bb1c..85c81cdafc90 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -52,7 +52,7 @@ namespace CGAL { namespace draw_function_for_p2 { template -void compute_elements(CGAL::GraphicBuffer &graphic_buffer, +void compute_elements(CGAL::Graphic_buffer &graphic_buffer, const P2 *p2) { typedef typename P2::Point_2 Point; @@ -79,7 +79,7 @@ void compute_elements(CGAL::GraphicBuffer &graphic_buffer, } // namespace draw_function_for_p2 template -void add_in_graphic_buffer_p2(CGAL::GraphicBuffer &graphic_buffer, +void add_in_graphic_buffer_p2(CGAL::Graphic_buffer &graphic_buffer, const P2 *p2 = nullptr) { if (p2 != nullptr) { draw_function_for_p2::compute_elements(graphic_buffer, p2); @@ -98,7 +98,7 @@ void draw(const CGAL_P2_TYPE &ap2, // typename CGAL_P2_TYPE::Face_const_handle> // drawingFunctor; - CGAL::GraphicBuffer buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer_p2(buffer, &ap2); draw_buffer(buffer); } diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index db4dfaac3ab2..6c977a0c4f74 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -32,7 +32,7 @@ namespace draw_function_for_ss2 { template void compute_edge(typename SS2::Halfedge_const_handle eh, const DrawingFunctor &drawing_functor, const SS2 *ss2, - CGAL::GraphicBuffer &graphic_buffer) { + CGAL::Graphic_buffer &graphic_buffer) { if (!drawing_functor.draw_edge(*ss2, eh)) { return; @@ -50,7 +50,7 @@ void compute_edge(typename SS2::Halfedge_const_handle eh, template void print_halfedge_labels(typename SS2::Halfedge_const_handle h, - CGAL::GraphicBuffer &graphic_buffer) { + CGAL::Graphic_buffer &graphic_buffer) { std::stringstream label; label << "H" << h->id() << " (V" << h->vertex()->id() << ") "; @@ -65,7 +65,7 @@ void print_halfedge_labels(typename SS2::Halfedge_const_handle h, template void compute_vertex(typename SS2::Vertex_const_handle vh, const DrawingFunctor &drawing_functor, const SS2 *ss2, - CGAL::GraphicBuffer &graphic_buffer) { + CGAL::Graphic_buffer &graphic_buffer) { if (!drawing_functor.draw_vertex(*ss2, vh)) { return; @@ -84,7 +84,7 @@ void compute_vertex(typename SS2::Vertex_const_handle vh, template void print_vertex_label(typename SS2::Vertex_const_handle vh, - CGAL::GraphicBuffer &graphic_buffer) { + CGAL::Graphic_buffer &graphic_buffer) { std::stringstream label; label << "V" << vh->id() << std::ends; graphic_buffer.add_text(vh->point(), label.str()); @@ -92,7 +92,7 @@ void print_vertex_label(typename SS2::Vertex_const_handle vh, template void compute_elements(const SS2 *ss2, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor) { for (typename SS2::Halfedge_const_iterator it = ss2->halfedges_begin(); @@ -113,7 +113,7 @@ void compute_elements(const SS2 *ss2, template void add_in_graphic_buffer_ss2(const SS2 &ass2, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor) { draw_function_for_ss2::compute_elements(&ass2, graphic_buffer, drawing_functor); @@ -121,7 +121,7 @@ void add_in_graphic_buffer_ss2(const SS2 &ass2, template void add_in_graphic_buffer_ss2( - const SS2 &ass2, CGAL::GraphicBuffer &graphic_buffer) { + const SS2 &ass2, CGAL::Graphic_buffer &graphic_buffer) { Drawing_functor @@ -136,7 +136,7 @@ void add_in_graphic_buffer_ss2( template void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, const char *title = "Straight Skeleton Basic Viewer") { - CGAL::GraphicBuffer buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer_ss2(ass2, buffer, drawingfunctor); draw_buffer(buffer); } @@ -144,7 +144,7 @@ void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, template void draw(const CGAL_SS_TYPE &ass2, const char *title = "Straight Skeleton Basic Viewer") { - CGAL::GraphicBuffer buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer_ss2(ass2, buffer); draw_buffer(buffer); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 271b5b99057a..3cb70e32b917 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -31,7 +31,7 @@ namespace draw_function_for_t2 { template void compute_face(typename T2::Finite_faces_iterator fh, const DrawingFunctor &drawing_functor, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const T2 *t2) { if (!drawing_functor.draw_face(*t2, fh)) { @@ -56,7 +56,7 @@ void compute_face(typename T2::Finite_faces_iterator fh, template void compute_edge(typename T2::Finite_edges_iterator eh, const DrawingFunctor &drawing_functor, const T2 *t2, - CGAL::GraphicBuffer &graphic_buffer) { + CGAL::Graphic_buffer &graphic_buffer) { if (!drawing_functor.draw_edge(*t2, eh)) { return; @@ -79,7 +79,7 @@ void compute_edge(typename T2::Finite_edges_iterator eh, template void compute_vertex(typename T2::Vertex_handle vh, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T2 *t2) { if (!drawing_functor.draw_vertex(*t2, vh)) { @@ -96,7 +96,7 @@ void compute_vertex(typename T2::Vertex_handle vh, template void compute_elements(const T2 *t2, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor, bool m_nofaces = false) { @@ -122,7 +122,7 @@ void compute_elements(const T2 *t2, template void add_in_graphic_buffer_t2(const T2 &at2, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor, bool m_nofaces = false) { draw_function_for_t2::compute_elements(&at2, graphic_buffer, drawing_functor, @@ -131,10 +131,10 @@ void add_in_graphic_buffer_t2(const T2 &at2, template void add_in_graphic_buffer_t2(const T2 &at2, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, bool m_nofaces = false) { - CGAL::GraphicBuffer buffer; + CGAL::Graphic_buffer buffer; Drawing_functor @@ -162,7 +162,7 @@ template void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, const char *title = "Triangulation_2 Basic Viewer", bool nofill = false) { - CGAL::GraphicBuffer buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer_t2(at2, buffer, drawingfunctor, nofill); draw_buffer(buffer); } @@ -171,7 +171,7 @@ template void draw(const CGAL_T2_TYPE &at2, const char *title = "Triangulation_2 Basic Viewer", bool nofill = false) { - CGAL::GraphicBuffer buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer_t2(at2, buffer, nofill); draw_buffer(buffer); } diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 42697e9938ea..a965fb878faa 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -32,7 +32,7 @@ namespace draw_function_for_t3 template void compute_face(typename T3::Finite_facets_iterator fh, const DrawingFunctor &drawing_functor, - CGAL::GraphicBuffer &graphic_buffer, const T3 *t3) + CGAL::Graphic_buffer &graphic_buffer, const T3 *t3) { if(!drawing_functor.draw_face(*t3, fh)) { return; } @@ -57,7 +57,7 @@ void compute_face(typename T3::Finite_facets_iterator fh, template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) { if(!drawing_functor.draw_edge(*t3, eh)) @@ -77,7 +77,7 @@ void compute_edge(typename T3::Finite_edges_iterator eh, template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor, const T3 *t3) { if(!drawing_functor.draw_vertex(*t3, vh)) @@ -93,7 +93,7 @@ void compute_vertex(typename T3::Vertex_handle vh, } template -void compute_elements(const T3 *t3, CGAL::GraphicBuffer &graphic_buffer, +void compute_elements(const T3 *t3, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor) { for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin(); @@ -119,7 +119,7 @@ void compute_elements(const T3 *t3, CGAL::GraphicBuffer &graphic_buf template void add_in_graphic_buffer_t3(const T3 &at3, - CGAL::GraphicBuffer &graphic_buffer, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor) { draw_function_for_t3::compute_elements(&at3, graphic_buffer, drawing_functor); @@ -127,7 +127,7 @@ void add_in_graphic_buffer_t3(const T3 &at3, template void add_in_graphic_buffer_t3(const T3 &at3, - CGAL::GraphicBuffer &graphic_buffer) + CGAL::Graphic_buffer &graphic_buffer) { CGAL::Drawing_functor void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, const char *title = "T3 Basic Viewer") { - CGAL::GraphicBuffer buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer_t3(at3, buffer, drawingfunctor); draw_buffer(buffer); } @@ -171,7 +171,7 @@ void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, template void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") { - CGAL::GraphicBuffer buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer_t3(at3, buffer); draw_buffer(buffer); } From 588b021d519d32d34118f9ad5d370e2835233f3f Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 3 Oct 2022 14:24:58 +0200 Subject: [PATCH 061/399] Migrated to original file. --- .../include/CGAL/draw_linear_cell_complex.h | 541 +++++++----------- 1 file changed, 207 insertions(+), 334 deletions(-) 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 0480547ec5ed..e8753c5aa4d4 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -1,327 +1,213 @@ -// Copyright (c) 2018 CNRS and LIRIS' Establishments (France). +// Copyright (c) 2022 GeometryFactory Sarl (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org) +// This file is part of CGAL (www.cgal.org). // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Guillaume Damiand +// Author(s): Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_LCC_H #define CGAL_DRAW_LCC_H +#include +#include #include +#include #ifdef CGAL_USE_BASIC_VIEWER -#include #include #include -namespace CGAL -{ +namespace CGAL { + + + // CGAL::IO::Color face_color(const DS &aVal, face_handle dh) const { + // CGAL::Random random((unsigned int)(aVal.darts().index(dh))); + // return get_random_color(random); + // } -// Default color functor; user can change it to have its own face color -struct DefaultDrawingFunctorLCC +namespace draw_function_for_lcc { - /// @return true iff the volume containing dh is drawn. - template - bool draw_volume(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - /// @return true iff the face containing dh is drawn. - template - bool draw_face(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - /// @return true iff the edge containing dh is drawn. - template - bool draw_edge(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - /// @return true iff the vertex containing dh is drawn. - template - bool draw_vertex(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - - /// @return true iff the volume containing dh is drawn in wireframe. - template - bool volume_wireframe(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - /// @return true iff the face containing dh is drawn in wireframe. - template - bool face_wireframe(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - - /// @return true iff the volume containing dh is colored. - template - bool colored_volume(const LCC&, - typename LCC::Dart_const_handle) const - { return true; } - /// @return true iff the face containing dh is colored. - /// if we have also colored_volume(alcc, dh), the volume color is - /// ignored and only the face color is considered. - template - bool colored_face(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - /// @return true iff the edge containing dh is colored. - template - bool colored_edge(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - /// @return true iff the vertex containing dh is colored. - template - bool colored_vertex(const LCC&, - typename LCC::Dart_const_handle) const - { return false; } - - /// @return the color of the volume containing dh - /// used only if colored_volume(alcc, dh) and !colored_face(alcc, dh) - template - CGAL::IO::Color volume_color(const LCC& alcc, - typename LCC::Dart_const_handle dh) const - { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } - /// @return the color of the face containing dh - /// used only if colored_face(alcc, dh) - template - CGAL::IO::Color face_color(const LCC& alcc, - typename LCC::Dart_const_handle dh) const - { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } - /// @return the color of the edge containing dh - /// used only if colored_edge(alcc, dh) - template - CGAL::IO::Color edge_color(const LCC& alcc, - typename LCC::Dart_const_handle dh) const - { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } - /// @return the color of the vertex containing dh - /// used only if colored_vertex(alcc, dh) - template - CGAL::IO::Color vertex_color(const LCC& alcc, - typename LCC::Dart_const_handle dh) const - { - CGAL::Random random((unsigned int)(alcc.darts().index(dh))); - return get_random_color(random); - } -}; -template +typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; +typedef Local_kernel::Point_3 Local_point; +typedef Local_kernel::Vector_3 Local_vector; + +template struct LCC_geom_utils; -template +template struct LCC_geom_utils { static typename Local_kernel::Vector_3 - get_vertex_normal(const LCC& lcc, typename LCC::Dart_const_handle dh) + get_vertex_normal(const LCC &lcc, typename LCC::Dart_const_handle dh) { - typename Local_kernel::Vector_3 n = internal::Geom_utils - :: - get_local_vector(CGAL::compute_normal_of_cell_0(lcc,dh)); - n = n/(CGAL::sqrt(n*n)); + typename Local_kernel::Vector_3 n = + internal::Geom_utils:: + get_local_vector(CGAL::compute_normal_of_cell_0(lcc, dh)); + n = n / (CGAL::sqrt(n * n)); return n; } }; -template +template struct LCC_geom_utils { static typename Local_kernel::Vector_3 - get_vertex_normal(const LCC&, typename LCC::Dart_const_handle) + get_vertex_normal(const LCC &, typename LCC::Dart_const_handle) { typename Local_kernel::Vector_3 n=CGAL::NULL_VECTOR; return n; } }; -// Viewer class for LCC -/*template -class SimpleLCCViewerQt : public Basic_viewer_qt +template +void compute_face(typename LCC::Dart_const_handle dh, + typename LCC::Dart_const_handle voldh, const LCC *lcc, + const DrawingFunctorLCC &m_drawing_functor, + Graphic_buffer &graphic_buffer) { - typedef Basic_viewer_qt Base; - typedef typename LCC::Dart_const_handle Dart_const_handle; - typedef typename LCC::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 LCC* alcc=nullptr, - const char* title="Basic LCC Viewer", - bool anofaces=false, - const DrawingFunctorLCC& drawing_functor=DrawingFunctorLCC()) : - // First draw: vertices; edges, faces; multi-color; inverse normal - Base(parent, title, true, true, true, false, false), - lcc(alcc), - m_nofaces(anofaces), - m_random_face_color(false), - m_drawing_functor(drawing_functor) + if (!m_drawing_functor.are_faces_enabled() || + !m_drawing_functor.draw_face(*lcc, dh)) + { return; } + + // We fill only closed faces. + typename LCC::Dart_const_handle cur=dh; + do { - if (lcc!=nullptr) - { compute_elements(); } + if (!lcc->is_next_exist(cur)) + { return; } // open face=>not filled + cur = lcc->next(cur); } + while (cur!=dh); - ~SimpleLCCViewerQt() - {} - -protected: - void set_lcc(const LCC* alcc, bool doredraw=true) + if (m_drawing_functor.colored_volume(*lcc, voldh)) { - if (lcc==alcc) - { return; } - - lcc=alcc; - if (lcc!=nullptr) - { compute_elements(); } - - if (doredraw) { redraw(); } + CGAL::IO::Color c=m_drawing_functor.volume_color(*lcc, voldh); + graphic_buffer.face_begin(c); } - - void compute_face(Dart_const_handle dh, Dart_const_handle voldh) + else if (m_drawing_functor.colored_face(*lcc, dh)) { - if (m_nofaces || !m_drawing_functor.draw_face(*lcc, dh)) return; - - // 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 (curnext(cur); - } - while(cur!=dh); + CGAL::IO::Color c=m_drawing_functor.face_color(*lcc, dh); + graphic_buffer.face_begin(c); + } + else + { graphic_buffer.face_begin(); } - if (m_random_face_color) - { - CGAL::Random random((unsigned int)(lcc->darts().index(dh))); - CGAL::IO::Color c=get_random_color(random); - face_begin(c); - } - else if (m_drawing_functor.colored_face(*lcc, dh)) - { - CGAL::IO::Color c=m_drawing_functor.face_color(*lcc, dh); - face_begin(c); - } - else if (m_drawing_functor.colored_volume(*lcc, voldh)) - { - CGAL::IO::Color c=m_drawing_functor.volume_color(*lcc, voldh); - face_begin(c); - } - else - { face_begin(); } + cur=dh; + do + { + graphic_buffer.add_point_in_face + (lcc->point(cur), + LCC_geom_utils::get_vertex_normal(*lcc, cur)); + cur=lcc->next(cur); + } + while (cur!=dh); - cur=dh; - do - { - add_point_in_face(lcc->point(cur), LCC_geom_utils:: - get_vertex_normal(*lcc, cur)); - cur=lcc->next(cur); - } - while(cur!=dh); + graphic_buffer.face_end(); +} - face_end(); - } +template +void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, + const DrawingFunctor &m_drawing_functor, + Graphic_buffer &graphic_buffer) +{ + if (!m_drawing_functor.are_edges_enabled() || + !m_drawing_functor.draw_edge(*lcc, dh)) + { return; } - void compute_edge(Dart_const_handle dh) + const typename LCC::Point& p1=lcc->point(dh); + typename LCC::Dart_const_handle d2=lcc->other_extremity(dh); + if (d2!=nullptr) { - if (!m_drawing_functor.draw_edge(*lcc, dh)) return; - - Point p1 = lcc->point(dh); - Dart_const_handle d2 = lcc->other_extremity(dh); - if (d2!=nullptr) + if (m_drawing_functor.colored_edge(*lcc, dh)) { - if (m_drawing_functor.colored_edge(*lcc, dh)) - { add_segment(p1, lcc->point(d2), m_drawing_functor.edge_color(*lcc, dh)); } - else - { add_segment(p1, lcc->point(d2)); } + graphic_buffer.add_segment(p1, lcc->point(d2), + m_drawing_functor.edge_color(*lcc, dh)); } + else + { graphic_buffer.add_segment(p1, lcc->point(d2)); } } +} - void compute_vertex(Dart_const_handle dh) - { - if (!m_drawing_functor.draw_vertex(*lcc, dh)) return; +template +void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, + const DrawingFunctorLCC &m_drawing_functor, + Graphic_buffer &graphic_buffer) +{ + if (!m_drawing_functor.are_vertices_enabled() || + !m_drawing_functor.draw_vertex(*lcc, dh)) + { return; } - if (m_drawing_functor.colored_vertex(*lcc, dh)) - { add_point(lcc->point(dh), m_drawing_functor.vertex_color(*lcc, dh)); } - else - { add_point(lcc->point(dh)); } + if (m_drawing_functor.colored_vertex(*lcc, dh)) + { + graphic_buffer.add_point(lcc->point(dh), + m_drawing_functor.vertex_color(*lcc, dh)); } + else + { graphic_buffer.add_point(lcc->point(dh)); } +} - void compute_elements() - { - clear(); - if (lcc==nullptr) return; +template +void compute_elements(const LCC *lcc, Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) +{ + if (lcc==nullptr) + { return; } - typename LCC::size_type markvolumes =lcc->get_new_mark(); - 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(); - typename LCC::size_type oriented_mark=lcc->get_new_mark(); + typename LCC::size_type markvolumes = lcc->get_new_mark(); + 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(); + typename LCC::size_type oriented_mark = lcc->get_new_mark(); - lcc->orient(oriented_mark); + lcc->orient(oriented_mark); - for (typename LCC::Dart_range::const_iterator it=lcc->darts().begin(), - itend=lcc->darts().end(); it!=itend; ++it ) + for(typename LCC::Dart_range::const_iterator it=lcc->darts().begin(), + itend=lcc->darts().end(); it!=itend; ++it) + { + if (!lcc->is_marked(it, markvolumes) && + m_drawing_functor.draw_volume(*lcc, it)) { - if (!lcc->is_marked(it, markvolumes) && - m_drawing_functor.draw_volume(*lcc, it)) + for(typename LCC::template Dart_of_cell_basic_range<3>::const_iterator + itv=lcc->template darts_of_cell_basic<3>(it, markvolumes).begin(), + itvend=lcc->template darts_of_cell_basic<3>(it, markvolumes).end(); + itv!=itvend; ++itv) { - for (typename LCC::template Dart_of_cell_basic_range<3>:: - const_iterator itv=lcc->template darts_of_cell_basic<3>(it, markvolumes).begin(), - itvend=lcc->template darts_of_cell_basic<3>(it, markvolumes).end(); - itv!=itvend; ++itv) + lcc->mark(itv, markvolumes); + if (!lcc->is_marked(itv, markfaces) && + lcc->is_marked(itv, oriented_mark) && + m_drawing_functor.draw_face(*lcc, itv)) { - lcc->mark(itv, markvolumes); // To be sure that all darts of the basic iterator will be marked - if (!lcc->is_marked(itv, markfaces) && - lcc->is_marked(itv, oriented_mark) && - m_drawing_functor.draw_face(*lcc, itv)) + if (!m_drawing_functor.volume_wireframe(*lcc, itv) && + !m_drawing_functor.face_wireframe(*lcc, itv)) + { compute_face(itv, it, lcc, m_drawing_functor, graphic_buffer); } + for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator + itf=lcc->template darts_of_cell_basic<2>(itv, markfaces).begin(), + itfend=lcc->template darts_of_cell_basic<2>(itv, markfaces).end(); + itf!=itfend; ++itf) { - if (!m_drawing_functor.volume_wireframe(*lcc, itv) && - !m_drawing_functor.face_wireframe(*lcc, itv)) - { compute_face(itv, it); } - for (typename LCC::template Dart_of_cell_basic_range<2>:: - const_iterator itf=lcc->template darts_of_cell_basic<2>(itv, markfaces).begin(), - itfend=lcc->template darts_of_cell_basic<2>(itv, markfaces).end(); - itf!=itfend; ++itf) + lcc->mark(itf, markfaces); + if (!lcc->is_marked(itf, markedges) && + m_drawing_functor.draw_edge(*lcc, itf)) { - if (!m_drawing_functor.volume_wireframe(*lcc, itv) && - !m_drawing_functor.face_wireframe(*lcc, itv)) - { lcc->mark(itf, markfaces); } // To be sure that all darts of the basic iterator will be marked - if ( !lcc->is_marked(itf, markedges) && - m_drawing_functor.draw_edge(*lcc, itf)) + compute_edge(itf, lcc, m_drawing_functor, graphic_buffer); + for(typename LCC::template Dart_of_cell_basic_range<1>::const_iterator + ite=lcc->template darts_of_cell_basic<1>(itf, markedges).begin(), + iteend=lcc->template darts_of_cell_basic<1>(itf, markedges).end(); + ite!=iteend; ++ite) { - compute_edge(itf); - for (typename LCC::template Dart_of_cell_basic_range<1>:: - const_iterator ite=lcc->template darts_of_cell_basic<1>(itf, markedges).begin(), - iteend=lcc->template darts_of_cell_basic<1>(itf, markedges).end(); - ite!=iteend; ++ite) + lcc->mark(ite, markedges); + if (!lcc->is_marked(ite, markvertices) && + m_drawing_functor.draw_vertex(*lcc, ite)) { - lcc->mark(ite, markedges); // To be sure that all darts of the basic iterator will be marked - if ( !lcc->is_marked(ite, markvertices) && - m_drawing_functor.draw_vertex(*lcc, ite)) - { - compute_vertex(ite); - CGAL::mark_cell(*lcc, ite, markvertices); - } + compute_vertex(ite, lcc, m_drawing_functor, graphic_buffer); + CGAL::mark_cell(*lcc, ite, markvertices); } } } @@ -329,97 +215,84 @@ class SimpleLCCViewerQt : public Basic_viewer_qt } } } - - for (typename LCC::Dart_range::const_iterator it=lcc->darts().begin(), - itend=lcc->darts().end(); it!=itend; ++it ) - { - lcc->unmark(it, markvertices); - lcc->unmark(it, markedges); - lcc->unmark(it, markfaces); - lcc->unmark(it, markvolumes); - lcc->unmark(it, oriented_mark); - } - - lcc->free_mark(markvolumes); - lcc->free_mark(markfaces); - lcc->free_mark(markedges); - lcc->free_mark(markvertices); - lcc->free_mark(oriented_mark); } - virtual void init() + for (typename LCC::Dart_range::const_iterator it = lcc->darts().begin(), + itend = lcc->darts().end(); it != itend; ++it) { - Base::init(); - setKeyDescription(::Qt::Key_R, "Toggles random face colors"); + lcc->unmark(it, markvertices); + lcc->unmark(it, markedges); + lcc->unmark(it, markfaces); + lcc->unmark(it, markvolumes); + lcc->unmark(it, oriented_mark); } - virtual void keyPressEvent(QKeyEvent *e) - { - const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - if ((e->key()==::Qt::Key_R) && (modifiers==::Qt::NoButton)) - { - m_random_face_color=!m_random_face_color; - displayMessage(QString("Random face color=%1.").arg(m_random_face_color?"true":"false")); - compute_elements(); - redraw(); - } - else - { Base::keyPressEvent(e); } // Call the base method to process others/classicals key + lcc->free_mark(markvolumes); + lcc->free_mark(markfaces); + lcc->free_mark(markedges); + lcc->free_mark(markvertices); + lcc->free_mark(oriented_mark); +} - // 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 - } +} // namespace draw_function + +/** + * @brief This function is responsible for filling the buffer to allow + * visualization. + * + * @param graphic_buffer + * @param m_drawing_functor + * @param alcc + */ +template +void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) +{ + draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor); +} + +template +void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &graphic_buffer) +{ + Drawing_functor_with_volume drawing_functor_with_volume; + + add_in_graphic_buffer_lcc(alcc, graphic_buffer, drawing_functor_with_volume); +} -protected: - const LCC* lcc; - bool m_nofaces; - bool m_random_face_color; - const DrawingFunctorLCC& m_drawing_functor; -}; -*/ // 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_, - class DrawingFunctorLCC=DefaultDrawingFunctorLCC> -void draw(const CGAL_LCC_TYPE& alcc, - const char* title="LCC for CMap Basic Viewer", - bool nofill=false, - const DrawingFunctorLCC& drawing_functor=DrawingFunctorLCC()) +#define CGAL_LCC_TYPE \ + CGAL::Linear_cell_complex_base + +template class Map, + class Refs, class Storage_, + class DrawingFunctor> +void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor, + const char *title = "LCC for CMap Basic Viewer") { -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif + Graphic_buffer buffer; + add_in_graphic_buffer_lcc(alcc, buffer, drawing_functor); + draw_buffer(buffer); +} - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"lccviewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimpleLCCViewerQt - mainwindow(app.activeWindow(), &alcc, title, nofill, drawing_functor); - mainwindow.show(); - app.exec(); - } +template class Map, + class Refs, class Storage_> +void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer") +{ + Graphic_buffer buffer; + add_in_graphic_buffer_lcc(alcc, buffer); + draw_buffer(buffer); } -// Todo a function taking a const DrawingFunctorLCC& drawing_functor as parameter #undef CGAL_LCC_TYPE -*/ + } // End namespace CGAL #endif // CGAL_USE_BASIC_VIEWER From 2b0969d10e596cf553e784cdfcb68e5bdbd2f67c Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 3 Oct 2022 14:26:26 +0200 Subject: [PATCH 062/399] Removed redundant --- .../CGAL/draw_linear_cell_complex_function.h | 300 ------------------ 1 file changed, 300 deletions(-) delete mode 100644 Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h deleted file mode 100644 index e8753c5aa4d4..000000000000 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) 2022 GeometryFactory Sarl (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// Author(s): Guillaume Damiand -// Mostafa Ashraf - -#ifndef CGAL_DRAW_LCC_H -#define CGAL_DRAW_LCC_H - -#include -#include -#include -#include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include -#include - -namespace CGAL { - - - // CGAL::IO::Color face_color(const DS &aVal, face_handle dh) const { - // CGAL::Random random((unsigned int)(aVal.darts().index(dh))); - // return get_random_color(random); - // } - -namespace draw_function_for_lcc -{ - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; -typedef Local_kernel::Point_3 Local_point; -typedef Local_kernel::Vector_3 Local_vector; - -template -struct LCC_geom_utils; - -template -struct LCC_geom_utils -{ - static typename Local_kernel::Vector_3 - get_vertex_normal(const LCC &lcc, typename LCC::Dart_const_handle dh) - { - typename Local_kernel::Vector_3 n = - internal::Geom_utils:: - get_local_vector(CGAL::compute_normal_of_cell_0(lcc, dh)); - n = n / (CGAL::sqrt(n * n)); - return n; - } -}; - -template -struct LCC_geom_utils -{ - static typename Local_kernel::Vector_3 - get_vertex_normal(const LCC &, typename LCC::Dart_const_handle) - { - typename Local_kernel::Vector_3 n=CGAL::NULL_VECTOR; - return n; - } -}; - -template -void compute_face(typename LCC::Dart_const_handle dh, - typename LCC::Dart_const_handle voldh, const LCC *lcc, - const DrawingFunctorLCC &m_drawing_functor, - Graphic_buffer &graphic_buffer) -{ - if (!m_drawing_functor.are_faces_enabled() || - !m_drawing_functor.draw_face(*lcc, dh)) - { return; } - - // We fill only closed faces. - typename LCC::Dart_const_handle cur=dh; - do - { - if (!lcc->is_next_exist(cur)) - { return; } // open face=>not filled - cur = lcc->next(cur); - } - while (cur!=dh); - - if (m_drawing_functor.colored_volume(*lcc, voldh)) - { - CGAL::IO::Color c=m_drawing_functor.volume_color(*lcc, voldh); - graphic_buffer.face_begin(c); - } - else if (m_drawing_functor.colored_face(*lcc, dh)) - { - CGAL::IO::Color c=m_drawing_functor.face_color(*lcc, dh); - graphic_buffer.face_begin(c); - } - else - { graphic_buffer.face_begin(); } - - cur=dh; - do - { - graphic_buffer.add_point_in_face - (lcc->point(cur), - LCC_geom_utils::get_vertex_normal(*lcc, cur)); - cur=lcc->next(cur); - } - while (cur!=dh); - - graphic_buffer.face_end(); -} - -template -void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, - const DrawingFunctor &m_drawing_functor, - Graphic_buffer &graphic_buffer) -{ - if (!m_drawing_functor.are_edges_enabled() || - !m_drawing_functor.draw_edge(*lcc, dh)) - { return; } - - const typename LCC::Point& p1=lcc->point(dh); - typename LCC::Dart_const_handle d2=lcc->other_extremity(dh); - if (d2!=nullptr) - { - if (m_drawing_functor.colored_edge(*lcc, dh)) - { - graphic_buffer.add_segment(p1, lcc->point(d2), - m_drawing_functor.edge_color(*lcc, dh)); - } - else - { graphic_buffer.add_segment(p1, lcc->point(d2)); } - } -} - -template -void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, - const DrawingFunctorLCC &m_drawing_functor, - Graphic_buffer &graphic_buffer) -{ - if (!m_drawing_functor.are_vertices_enabled() || - !m_drawing_functor.draw_vertex(*lcc, dh)) - { return; } - - if (m_drawing_functor.colored_vertex(*lcc, dh)) - { - graphic_buffer.add_point(lcc->point(dh), - m_drawing_functor.vertex_color(*lcc, dh)); - } - else - { graphic_buffer.add_point(lcc->point(dh)); } -} - -template -void compute_elements(const LCC *lcc, Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) -{ - if (lcc==nullptr) - { return; } - - typename LCC::size_type markvolumes = lcc->get_new_mark(); - 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(); - typename LCC::size_type oriented_mark = lcc->get_new_mark(); - - lcc->orient(oriented_mark); - - for(typename LCC::Dart_range::const_iterator it=lcc->darts().begin(), - itend=lcc->darts().end(); it!=itend; ++it) - { - if (!lcc->is_marked(it, markvolumes) && - m_drawing_functor.draw_volume(*lcc, it)) - { - for(typename LCC::template Dart_of_cell_basic_range<3>::const_iterator - itv=lcc->template darts_of_cell_basic<3>(it, markvolumes).begin(), - itvend=lcc->template darts_of_cell_basic<3>(it, markvolumes).end(); - itv!=itvend; ++itv) - { - lcc->mark(itv, markvolumes); - if (!lcc->is_marked(itv, markfaces) && - lcc->is_marked(itv, oriented_mark) && - m_drawing_functor.draw_face(*lcc, itv)) - { - if (!m_drawing_functor.volume_wireframe(*lcc, itv) && - !m_drawing_functor.face_wireframe(*lcc, itv)) - { compute_face(itv, it, lcc, m_drawing_functor, graphic_buffer); } - for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator - itf=lcc->template darts_of_cell_basic<2>(itv, markfaces).begin(), - itfend=lcc->template darts_of_cell_basic<2>(itv, markfaces).end(); - itf!=itfend; ++itf) - { - lcc->mark(itf, markfaces); - if (!lcc->is_marked(itf, markedges) && - m_drawing_functor.draw_edge(*lcc, itf)) - { - compute_edge(itf, lcc, m_drawing_functor, graphic_buffer); - for(typename LCC::template Dart_of_cell_basic_range<1>::const_iterator - ite=lcc->template darts_of_cell_basic<1>(itf, markedges).begin(), - iteend=lcc->template darts_of_cell_basic<1>(itf, markedges).end(); - ite!=iteend; ++ite) - { - lcc->mark(ite, markedges); - if (!lcc->is_marked(ite, markvertices) && - m_drawing_functor.draw_vertex(*lcc, ite)) - { - compute_vertex(ite, lcc, m_drawing_functor, graphic_buffer); - CGAL::mark_cell(*lcc, ite, markvertices); - } - } - } - } - } - } - } - } - - for (typename LCC::Dart_range::const_iterator it = lcc->darts().begin(), - itend = lcc->darts().end(); it != itend; ++it) - { - lcc->unmark(it, markvertices); - lcc->unmark(it, markedges); - lcc->unmark(it, markfaces); - lcc->unmark(it, markvolumes); - lcc->unmark(it, oriented_mark); - } - - lcc->free_mark(markvolumes); - lcc->free_mark(markfaces); - lcc->free_mark(markedges); - lcc->free_mark(markvertices); - lcc->free_mark(oriented_mark); -} - -} // namespace draw_function - -/** - * @brief This function is responsible for filling the buffer to allow - * visualization. - * - * @param graphic_buffer - * @param m_drawing_functor - * @param alcc - */ -template -void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) -{ - draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor); -} - -template -void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &graphic_buffer) -{ - Drawing_functor_with_volume drawing_functor_with_volume; - - add_in_graphic_buffer_lcc(alcc, graphic_buffer, drawing_functor_with_volume); -} - -// Specialization of draw function. -#define CGAL_LCC_TYPE \ - CGAL::Linear_cell_complex_base - -template class Map, - class Refs, class Storage_, - class DrawingFunctor> -void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor, - const char *title = "LCC for CMap Basic Viewer") -{ - Graphic_buffer buffer; - add_in_graphic_buffer_lcc(alcc, buffer, drawing_functor); - draw_buffer(buffer); -} - -template class Map, - class Refs, class Storage_> -void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer") -{ - Graphic_buffer buffer; - add_in_graphic_buffer_lcc(alcc, buffer); - draw_buffer(buffer); -} - -#undef CGAL_LCC_TYPE - -} // End namespace CGAL - -#endif // CGAL_USE_BASIC_VIEWER - -#endif // CGAL_DRAW_LCC_H From 788677599642cc2d669bf882d012b73dd7ad9245 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 3 Oct 2022 14:27:40 +0200 Subject: [PATCH 063/399] Changed Guard Name --- GraphicsView/include/CGAL/Drawing_functor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GraphicsView/include/CGAL/Drawing_functor.h b/GraphicsView/include/CGAL/Drawing_functor.h index e0907cfc12fc..561155ac0839 100644 --- a/GraphicsView/include/CGAL/Drawing_functor.h +++ b/GraphicsView/include/CGAL/Drawing_functor.h @@ -10,8 +10,8 @@ // Author(s): Guillaume Damiand // Mostafa Ashraf -#ifndef CGAL_GENERIC_FUNCTORS_H -#define CGAL_GENERIC_FUNCTORS_H +#ifndef CGAL_DRAWING_FUNCTORS_H +#define CGAL_DRAWING_FUNCTORS_H namespace CGAL { @@ -96,4 +96,4 @@ struct Drawing_functor_with_volume : } // End namespace CGAL -#endif // CGAL_GENERIC_FUNCTORS_H \ No newline at end of file +#endif // CGAL_DRAWING_FUNCTORS_H \ No newline at end of file From 6895b91795c6f3c28a885b4e98546605da20ad12 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 3 Oct 2022 14:28:42 +0200 Subject: [PATCH 064/399] Migrated to original file --- Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp | 4 ++-- Linear_cell_complex/demo/Linear_cell_complex/Viewer.h | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index bd48145e3a4e..fa8a55752fc9 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -38,7 +38,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) scene = scene_; if (scene->lcc!=nullptr) - { CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor, scene->lcc); } + { CGAL::add_in_graphic_buffer_lcc(*scene->lcc, gBuffer, m_drawing_functor); } if (doredraw) { Base::redraw(); } @@ -47,7 +47,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) void Viewer::sceneChanged() { gBuffer.clear(); - CGAL::add_in_graphic_buffer_lcc(gBuffer, m_drawing_functor, scene->lcc); + CGAL::add_in_graphic_buffer_lcc(*scene->lcc, gBuffer, m_drawing_functor); this->camera()->setSceneBoundingBox( CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(), diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 1e314394d60c..53aab0e629d3 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -16,9 +16,7 @@ #include "typedefs.h" -// QUESTION: When I added this line compiler tell me "No such file or directory!" how? -#include -// #include +#include #include class Viewer : public CGAL::Basic_viewer_qt From 00d0a9da4904e2e15215f28f2e14442670fda0b7 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 3 Oct 2022 14:29:11 +0200 Subject: [PATCH 065/399] Migrated to original file --- .../examples/Linear_cell_complex/draw_linear_cell_complex.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex.cpp b/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex.cpp index 48cc41de9d19..429d1c0a1c7b 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/draw_linear_cell_complex.cpp @@ -1,7 +1,5 @@ #include -// NOTE: deprecated, would remove -// #include -#include +#include typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; typedef LCC::Dart_handle Dart_handle; From c052c1f204edfdd9d2dc3229ce463638c24380bc Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 3 Oct 2022 14:50:54 +0200 Subject: [PATCH 066/399] Added custom functor for color volume. --- .../include/CGAL/draw_linear_cell_complex.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 e8753c5aa4d4..67bc251d68c8 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -259,6 +259,17 @@ void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &grap typename LCC::Dart_const_handle, typename LCC::Dart_const_handle> drawing_functor_with_volume; + drawing_functor_with_volume.colored_volume = [](const LCC&, + typename LCC::Dart_const_handle) -> bool + { return true; }; + + drawing_functor_with_volume.volume_color = [] (const LCC& alcc, + typename LCC::Dart_const_handle dh) -> CGAL::IO::Color + { + CGAL::Random random((unsigned int)(alcc.darts().index(dh))); + return get_random_color(random); + }; + add_in_graphic_buffer_lcc(alcc, graphic_buffer, drawing_functor_with_volume); } From 7a7f39f2e8836d73c7509485886bab8068d24df7 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Tue, 4 Oct 2022 11:19:31 +0200 Subject: [PATCH 067/399] Modified --- .../include/CGAL/draw_linear_cell_complex.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) 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 67bc251d68c8..3b4a0659f65e 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -1,14 +1,14 @@ -// Copyright (c) 2022 GeometryFactory Sarl (France). +// Copyright (c) 2018 CNRS and LIRIS' Establishments (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s): Guillaume Damiand -// Mostafa Ashraf +// Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_LCC_H #define CGAL_DRAW_LCC_H @@ -25,12 +25,6 @@ namespace CGAL { - - // CGAL::IO::Color face_color(const DS &aVal, face_handle dh) const { - // CGAL::Random random((unsigned int)(aVal.darts().index(dh))); - // return get_random_color(random); - // } - namespace draw_function_for_lcc { From 68b031e113aa7e7c15b3e94619c413bec26d134d Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Tue, 4 Oct 2022 18:43:14 +0200 Subject: [PATCH 068/399] Uses overloading functions instead of different fill_buffer names. --- .../demo/Linear_cell_complex/Viewer.cpp | 4 ++-- .../include/CGAL/draw_linear_cell_complex.h | 10 +++++----- Point_set_3/include/CGAL/draw_point_set_3.h | 4 ++-- Polygon/include/CGAL/draw_polygon_2.h | 4 ++-- .../include/CGAL/draw_straight_skeleton_2.h | 10 +++++----- Triangulation_2/include/CGAL/draw_triangulation_2.h | 10 +++++----- Triangulation_3/include/CGAL/draw_triangulation_3.h | 10 +++++----- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index fa8a55752fc9..9289ade4c088 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -38,7 +38,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) scene = scene_; if (scene->lcc!=nullptr) - { CGAL::add_in_graphic_buffer_lcc(*scene->lcc, gBuffer, m_drawing_functor); } + { CGAL::add_in_graphic_buffer(*scene->lcc, gBuffer, m_drawing_functor); } if (doredraw) { Base::redraw(); } @@ -47,7 +47,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) void Viewer::sceneChanged() { gBuffer.clear(); - CGAL::add_in_graphic_buffer_lcc(*scene->lcc, gBuffer, m_drawing_functor); + CGAL::add_in_graphic_buffer(*scene->lcc, gBuffer, m_drawing_functor); this->camera()->setSceneBoundingBox( CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(), 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 3b4a0659f65e..53cedfd11815 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -239,14 +239,14 @@ void compute_elements(const LCC *lcc, Graphic_buffer &graphic_buffer * @param alcc */ template -void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &graphic_buffer, +void add_in_graphic_buffer(const LCC &alcc, Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor); } template -void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer &graphic_buffer) +void add_in_graphic_buffer(const LCC &alcc, Graphic_buffer &graphic_buffer) { Drawing_functor_with_volume &grap return get_random_color(random); }; - add_in_graphic_buffer_lcc(alcc, graphic_buffer, drawing_functor_with_volume); + add_in_graphic_buffer(alcc, graphic_buffer, drawing_functor_with_volume); } // Specialization of draw function. @@ -281,7 +281,7 @@ void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor, const char *title = "LCC for CMap Basic Viewer") { Graphic_buffer buffer; - add_in_graphic_buffer_lcc(alcc, buffer, drawing_functor); + add_in_graphic_buffer(alcc, buffer, drawing_functor); draw_buffer(buffer); } @@ -292,7 +292,7 @@ template buffer; - add_in_graphic_buffer_lcc(alcc, buffer); + add_in_graphic_buffer(alcc, buffer); draw_buffer(buffer); } 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 125ffe73862c..087092a05623 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -66,7 +66,7 @@ void compute_elements(const PointSet *pointset, } // namespace draw_function_for_PointSet template -void add_in_graphic_buffer_point_set(Graphic_buffer &graphic_buffer, +void add_in_graphic_buffer(Graphic_buffer &graphic_buffer, const PointSet *aPointSet = nullptr) { if (aPointSet != nullptr) { draw_function_for_PointSet::compute_elements(aPointSet, graphic_buffer); @@ -78,7 +78,7 @@ template void draw(const Point_set_3 &apointset, const char *title = "Point_set_3 Basic Viewer") { Graphic_buffer buffer; - add_in_graphic_buffer_point_set(buffer, &apointset); + add_in_graphic_buffer(buffer, &apointset); draw_buffer(buffer); } diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 85c81cdafc90..2b29ee2dc4fd 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -79,7 +79,7 @@ void compute_elements(CGAL::Graphic_buffer &graphic_buffer, } // namespace draw_function_for_p2 template -void add_in_graphic_buffer_p2(CGAL::Graphic_buffer &graphic_buffer, +void add_in_graphic_buffer(CGAL::Graphic_buffer &graphic_buffer, const P2 *p2 = nullptr) { if (p2 != nullptr) { draw_function_for_p2::compute_elements(graphic_buffer, p2); @@ -99,7 +99,7 @@ void draw(const CGAL_P2_TYPE &ap2, // drawingFunctor; CGAL::Graphic_buffer buffer; - add_in_graphic_buffer_p2(buffer, &ap2); + add_in_graphic_buffer(buffer, &ap2); draw_buffer(buffer); } diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 6c977a0c4f74..c489126d3185 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -112,7 +112,7 @@ void compute_elements(const SS2 *ss2, } // namespace draw_function_for_ss2 template -void add_in_graphic_buffer_ss2(const SS2 &ass2, +void add_in_graphic_buffer(const SS2 &ass2, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor) { draw_function_for_ss2::compute_elements(&ass2, graphic_buffer, @@ -120,14 +120,14 @@ void add_in_graphic_buffer_ss2(const SS2 &ass2, } template -void add_in_graphic_buffer_ss2( +void add_in_graphic_buffer( const SS2 &ass2, CGAL::Graphic_buffer &graphic_buffer) { Drawing_functor drawingFunctor; - add_in_graphic_buffer_ss2(ass2, graphic_buffer, drawingFunctor); + add_in_graphic_buffer(ass2, graphic_buffer, drawingFunctor); } // Specialization of draw function. @@ -137,7 +137,7 @@ template void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, const char *title = "Straight Skeleton Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer_ss2(ass2, buffer, drawingfunctor); + add_in_graphic_buffer(ass2, buffer, drawingfunctor); draw_buffer(buffer); } @@ -145,7 +145,7 @@ template void draw(const CGAL_SS_TYPE &ass2, const char *title = "Straight Skeleton Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer_ss2(ass2, buffer); + add_in_graphic_buffer(ass2, buffer); draw_buffer(buffer); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 3cb70e32b917..b7f9a9956c73 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -121,7 +121,7 @@ void compute_elements(const T2 *t2, } // namespace draw_function_for_t2 template -void add_in_graphic_buffer_t2(const T2 &at2, +void add_in_graphic_buffer(const T2 &at2, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor, bool m_nofaces = false) { @@ -130,7 +130,7 @@ void add_in_graphic_buffer_t2(const T2 &at2, } template -void add_in_graphic_buffer_t2(const T2 &at2, +void add_in_graphic_buffer(const T2 &at2, CGAL::Graphic_buffer &graphic_buffer, bool m_nofaces = false) { @@ -152,7 +152,7 @@ void add_in_graphic_buffer_t2(const T2 &at2, return get_random_color(random); }; - add_in_graphic_buffer_t2(at2, graphic_buffer, drawingFunctor, m_nofaces); + add_in_graphic_buffer(at2, graphic_buffer, drawingFunctor, m_nofaces); } // Specialization of draw function. @@ -163,7 +163,7 @@ void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, const char *title = "Triangulation_2 Basic Viewer", bool nofill = false) { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer_t2(at2, buffer, drawingfunctor, nofill); + add_in_graphic_buffer(at2, buffer, drawingfunctor, nofill); draw_buffer(buffer); } @@ -172,7 +172,7 @@ void draw(const CGAL_T2_TYPE &at2, const char *title = "Triangulation_2 Basic Viewer", bool nofill = false) { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer_t2(at2, buffer, nofill); + add_in_graphic_buffer(at2, buffer, nofill); draw_buffer(buffer); } diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index a965fb878faa..8b24306806bf 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -118,7 +118,7 @@ void compute_elements(const T3 *t3, CGAL::Graphic_buffer &graphic_bu } // namespace draw_function_for_t3 template -void add_in_graphic_buffer_t3(const T3 &at3, +void add_in_graphic_buffer(const T3 &at3, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor) { @@ -126,7 +126,7 @@ void add_in_graphic_buffer_t3(const T3 &at3, } template -void add_in_graphic_buffer_t3(const T3 &at3, +void add_in_graphic_buffer(const T3 &at3, CGAL::Graphic_buffer &graphic_buffer) { CGAL::Drawing_functor buffer; - add_in_graphic_buffer_t3(at3, buffer, drawingfunctor); + add_in_graphic_buffer(at3, buffer, drawingfunctor); draw_buffer(buffer); } @@ -172,7 +172,7 @@ template void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer_t3(at3, buffer); + add_in_graphic_buffer(at3, buffer); draw_buffer(buffer); } From 5be8e30cfa1710330eda8dbbcba0281b38f9c489 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 6 Oct 2022 13:27:51 +0200 Subject: [PATCH 069/399] Applied new APIs version on Polygon with holes 2.y --- .../include/CGAL/draw_polygon_with_holes_2.h | 162 ++++++++---------- 1 file changed, 72 insertions(+), 90 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index be58464ebf89..560e8eaf4c30 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -13,10 +13,13 @@ // // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_POLYGON_WITH_HOLES_2_H #define CGAL_DRAW_POLYGON_WITH_HOLES_2_H +#include +#include #include #ifdef DOXYGEN_RUNNING @@ -45,113 +48,92 @@ void draw(const PH& aph); namespace CGAL { -// Viewer class for Polygon_with_holes_2 -template -class SimplePolygonWithHoles2ViewerQt : public Basic_viewer_qt +namespace draw_function_for_ph2_with_holes { + +template +void compute_one_loop_elements(const typename P2::General_polygon_2& p, Graphic_buffer &graphic_buffer, bool hole) { - typedef Basic_viewer_qt Base; - typedef typename P2::General_polygon_2::Point_2 Point; - -public: - /// Construct the viewer without drawing anything. - /// @param title the title of the window - SimplePolygonWithHoles2ViewerQt(QWidget* parent, - const char* title="Basic Polygon_with_holes_2 Viewer") : - Base(parent, title, true, true, true, false, false) - { - clear(); - } + + if (hole) + { graphic_buffer.add_point_in_face(p.vertex(p.size()-1)); } - /// 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) + 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) { - clear(); - compute_elements(ap2); + graphic_buffer.add_point(*i); // Add vertex + if (i!=p.vertices_begin()) + { graphic_buffer.add_segment(*prev, *i); } // Add segment with previous point + graphic_buffer.add_point_in_face(*i); // Add point in face + prev=i; } -protected: - void compute_one_loop_elements(const typename P2::General_polygon_2& p, bool hole) + // Add the last segment between the last point and the first one + graphic_buffer.add_segment(*prev, *(p.vertices_begin())); +} + +template +void compute_elements(const P2& p2, Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) +{ + + if (p2.outer_boundary().is_empty()) return; + + // TODO: use face_color after adding a handler if exists. + CGAL::IO::Color c(75,160,255); + graphic_buffer.face_begin(c); + + compute_one_loop_elements(p2.outer_boundary(), graphic_buffer, false); + + for (typename P2::Hole_const_iterator it=p2.holes_begin(); it!=p2.holes_end(); ++it) { - 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())); + compute_one_loop_elements(*it, graphic_buffer, true); + graphic_buffer.add_point_in_face(p2.outer_boundary().vertex(p2.outer_boundary().size()-1)); } - void compute_elements(const P2& p2) - { - if (p2.outer_boundary().is_empty()) return; + graphic_buffer.face_end(); +} - CGAL::IO::Color c(75,160,255); - face_begin(c); +} // draw_function_for_ph2 - 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)); - } +template +void add_in_graphic_buffer(const P2 &p2, CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor ) { + draw_function_for_ph2_with_holes::compute_elements(p2, graphic_buffer, m_drawing_functor); +} - face_end(); - } +template +void add_in_graphic_buffer(const P2 &p2, CGAL::Graphic_buffer &graphic_buffer) { - 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); - } -}; + // TODO: use colord_face and face_color if a handler exits. + Drawing_functor + drawing_functor; + + add_in_graphic_buffer(p2, graphic_buffer, drawing_functor); +} // Specialization of draw function. -template -void draw(const CGAL::Polygon_with_holes_2& ap2, - const char* title="Polygon_with_holes_2 Basic Viewer") +#define CGAL_P2_WITH_HOLES_TYPE CGAL::Polygon_with_holes_2 + + +template +void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const DrawingFunctor &drawing_functor) { -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(ap2, buffer, drawing_functor); + draw_buffer(buffer); +} - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"t2_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimplePolygonWithHoles2ViewerQt > - mainwindow(app.activeWindow(), ap2, title); - mainwindow.show(); - app.exec(); - } +template +void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, + const char* title="Polygon_with_holes_2 Basic Viewer") +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(ap2, buffer); + draw_buffer(buffer); } } // End namespace CGAL From 7a2f8902ff9d5c6cf5add853a524915e095aa41f Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 6 Oct 2022 15:13:21 +0200 Subject: [PATCH 070/399] Added CGAL namespace, new line at EOF. --- GraphicsView/include/CGAL/Drawing_functor.h | 2 +- .../include/CGAL/draw_linear_cell_complex.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/GraphicsView/include/CGAL/Drawing_functor.h b/GraphicsView/include/CGAL/Drawing_functor.h index 561155ac0839..cff52be172da 100644 --- a/GraphicsView/include/CGAL/Drawing_functor.h +++ b/GraphicsView/include/CGAL/Drawing_functor.h @@ -96,4 +96,4 @@ struct Drawing_functor_with_volume : } // End namespace CGAL -#endif // CGAL_DRAWING_FUNCTORS_H \ No newline at end of file +#endif // CGAL_DRAWING_FUNCTORS_H 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 53cedfd11815..daa202cf9628 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -64,7 +64,7 @@ template void compute_face(typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, - Graphic_buffer &graphic_buffer) + CGAL::Graphic_buffer &graphic_buffer) { if (!m_drawing_functor.are_faces_enabled() || !m_drawing_functor.draw_face(*lcc, dh)) @@ -109,7 +109,7 @@ void compute_face(typename LCC::Dart_const_handle dh, template void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, const DrawingFunctor &m_drawing_functor, - Graphic_buffer &graphic_buffer) + CGAL::Graphic_buffer &graphic_buffer) { if (!m_drawing_functor.are_edges_enabled() || !m_drawing_functor.draw_edge(*lcc, dh)) @@ -132,7 +132,7 @@ void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, template void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, - Graphic_buffer &graphic_buffer) + CGAL::Graphic_buffer &graphic_buffer) { if (!m_drawing_functor.are_vertices_enabled() || !m_drawing_functor.draw_vertex(*lcc, dh)) @@ -148,7 +148,7 @@ void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, } template -void compute_elements(const LCC *lcc, Graphic_buffer &graphic_buffer, +void compute_elements(const LCC *lcc, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { if (lcc==nullptr) @@ -239,14 +239,14 @@ void compute_elements(const LCC *lcc, Graphic_buffer &graphic_buffer * @param alcc */ template -void add_in_graphic_buffer(const LCC &alcc, Graphic_buffer &graphic_buffer, +void add_in_graphic_buffer(const LCC &alcc, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor); } template -void add_in_graphic_buffer(const LCC &alcc, Graphic_buffer &graphic_buffer) +void add_in_graphic_buffer(const LCC &alcc, CGAL::Graphic_buffer &graphic_buffer) { Drawing_functor_with_volume buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer(alcc, buffer, drawing_functor); draw_buffer(buffer); } @@ -291,7 +291,7 @@ template void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer") { - Graphic_buffer buffer; + CGAL::Graphic_buffer buffer; add_in_graphic_buffer(alcc, buffer); draw_buffer(buffer); } From 7404eb629fda75cefe6786c2ca625b05d036fe7c Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 6 Oct 2022 15:17:01 +0200 Subject: [PATCH 071/399] Applied new APIs version in periodic 2 triangulation 2. --- .../CGAL/draw_periodic_2_triangulation_2.h | 366 ++++++++---------- 1 file changed, 155 insertions(+), 211 deletions(-) diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 395edef7a122..41453f1cbcd8 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -8,10 +8,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Jasmeet Singh +// Mostafa Ashraf #ifndef DRAW_PERIODIC_2_TRIANGULATION_2_H #define DRAW_PERIODIC_2_TRIANGULATION_2_H +#include +#include #include #include @@ -23,255 +26,196 @@ namespace CGAL { -// Default color functor; user can change it to have its own face color -struct DefaultColorFunctorP2T2 { - template - static CGAL::IO::Color run(const P2T2 &, - const typename P2T2::Periodic_triangle_iterator /*ti*/) { - //CGAL::Random random((unsigned int)(std::size_t)(&*ti)); - //return get_random_color(random); - return CGAL::IO::Color(73, 250, 117); - } +namespace draw_function_for_P2T2 +{ + +enum Display_type +{ + STORED = 0, + UNIQUE, // 1 + STORED_COVER_DOMAIN, // 2 + UNIQUE_COVER_DOMAIN // 3 }; -// Viewer class for P2T2 -template -class SimplePeriodic2Triangulation2ViewerQt : public Basic_viewer_qt +template +void compute_vertex(typename P2T2::Periodic_point_iterator pi, const P2T2 &p2t2, + CGAL::Graphic_buffer &graphic_buffer) { - typedef Basic_viewer_qt Base; + // Construct the point in 9-sheeted covering space and add to viewer + graphic_buffer.add_point(p2t2.point(*pi)); +} - typedef typename P2T2::Iterator_type Iterator_type; +template +void compute_edge(typename P2T2::Periodic_segment_iterator si, const P2T2 &p2t2, + CGAL::Graphic_buffer &graphic_buffer) +{ + typedef typename P2T2::Segment Segment; - // Vertex iterators - typedef typename P2T2::Periodic_point_iterator Periodic_point_iterator; + // Construct the segment in 9-sheeted covering space and add to viewer + Segment s(p2t2.segment(*si)); + graphic_buffer.add_segment(s[0], s[1]); +} - // Edge iterators - typedef typename P2T2::Periodic_segment_iterator Periodic_segment_iterator; - typedef typename P2T2::Segment Segment; +template +void compute_face(typename P2T2::Periodic_triangle_iterator ti, const P2T2 &p2t2, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) +{ + typedef typename P2T2::Triangle Triangle; - // Face iterators - typedef typename P2T2::Periodic_triangle_iterator Periodic_triangle_iterator; - typedef typename P2T2::Triangle Triangle; + // Construct the triangle in 9-sheeted covering space and add to viewer + Triangle t(p2t2.triangle(*ti)); - typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; + if(m_drawing_functor.colored_face(p2t2, ti)) { -public: - /// Construct the viewer. - /// @param ap2t2 the p2t2 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) - SimplePeriodic2Triangulation2ViewerQt(QWidget* parent, const P2T2& ap2t2, - const char* title="Basic P2T2 Viewer", - bool anofaces=false, - const ColorFunctor& fcolor=ColorFunctor()) : - // First draw: vertices; edges, faces; multi-color; no inverse normal - Base(parent, title, true, true, true, false, false), - p2t2(ap2t2), - m_nofaces(anofaces), - m_fcolor(fcolor), - m_display_type(STORED_COVER_DOMAIN), - m_domain(true) - { - // Add custom key description (see keyPressEvent). - setKeyDescription(::Qt::Key_1, "STORED: Display all geometric primitives as they are stored in " - "Triangulation_data_structure_2"); - setKeyDescription(::Qt::Key_2, "UNIQUE: Display only one representative of each geometric primitive even " - "if the triangulation is computed in multiply sheeted covering space."); - setKeyDescription(::Qt::Key_3, "STORED_COVER_DOMAIN: Same as STORED but also display " - "all primitives whose intersection with the original " - "domain of the current covering space is non-empty"); - setKeyDescription(::Qt::Key_4, "UNIQUE_COVER_DOMAIN: Same as UNIQUE but also display " - "all primitives whose intersection with the original " - "domain of the current covering space is non-empty"); - setKeyDescription(::Qt::Key_D, "Toggle 9-sheeted domain display"); - - compute_elements(); + // Need CGAL::IO::Color(73, 250, 117); + CGAL::IO::Color c= m_drawing_functor.face_color(p2t2, ti); + graphic_buffer.face_begin(c); + graphic_buffer.add_point_in_face(t[0]); + graphic_buffer.add_point_in_face(t[1]); + graphic_buffer.add_point_in_face(t[2]); + graphic_buffer.face_end(); } -protected: - void compute_vertex(Periodic_point_iterator pi) - { - // Construct the point in 9-sheeted covering space and add to viewer - add_point(p2t2.point(*pi)); + + + // Display the edges of the faces as segments with a + // light gray color for better visualization + if(m_drawing_functor.colored_face(p2t2, ti)) { + + // Need CGAL::IO::Color(207, 213, 211); + CGAL::IO::Color c = m_drawing_functor.face_color(p2t2, ti); + + graphic_buffer.add_segment(t[0], t[1], c); + graphic_buffer.add_segment(t[1], t[2], c); + graphic_buffer.add_segment(t[2], t[0], c); + } +} + +template +void compute_domain(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer) +{ + typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; + + Kernel::Iso_rectangle_2 orig_domain = p2t2.domain(); + std::array covering_sheets = p2t2.number_of_sheets(); + + for(int i = 0; i < covering_sheets[0]; i++){ + for(int j = 0; j < covering_sheets[1]; j++){ + Kernel::Vector_2 shift(i * (orig_domain.xmax() - orig_domain.xmin()), + j * orig_domain.ymax() - orig_domain.ymin()); + Kernel::Point_2 p1((orig_domain.min)()); + Kernel::Point_2 p2(orig_domain.xmin(), orig_domain.ymax()); + Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin()); + Kernel::Point_2 p4((orig_domain.max)()); + + graphic_buffer.add_segment(p1 + shift, p2 + shift, CGAL::IO::Color(96, 104, 252)); + graphic_buffer.add_segment(p1 + shift, p3 + shift, CGAL::IO::Color(96, 104, 252)); + graphic_buffer.add_segment(p2 + shift, p4 + shift, CGAL::IO::Color(96, 104, 252)); + graphic_buffer.add_segment(p3 + shift, p4 + shift, CGAL::IO::Color(96, 104, 252)); + } } +} + +template +void compute_elements(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor, bool m_domain = true) { + + typedef typename P2T2::Iterator_type Iterator_type; - void compute_edge(Periodic_segment_iterator si) + Display_type m_display_type(Display_type::STORED_COVER_DOMAIN); + + // Get the display type, iterate through periodic elements according + // to the display type + Iterator_type it_type = (Iterator_type)m_display_type; + + // Iterate through vertices, edges and faces, add elements to buffer + for (typename P2T2::Periodic_point_iterator it = + p2t2.periodic_points_begin(it_type); + it != p2t2.periodic_points_end(it_type); it++) { - // Construct the segment in 9-sheeted covering space and add to viewer - Segment s(p2t2.segment(*si)); - add_segment(s[0], s[1]); + compute_vertex(it, p2t2, graphic_buffer); } - void compute_face(Periodic_triangle_iterator ti) + for (typename P2T2::Periodic_segment_iterator it = + p2t2.periodic_segments_begin(it_type); + it != p2t2.periodic_segments_end(it_type); it++) { - // Construct the triangle in 9-sheeted covering space and add to viewer - Triangle t(p2t2.triangle(*ti)); - - CGAL::IO::Color c=m_fcolor.run(p2t2, ti); - face_begin(c); - add_point_in_face(t[0]); - add_point_in_face(t[1]); - add_point_in_face(t[2]); - face_end(); - - // Display the edges of the faces as segments with a - // light gray color for better visualization - add_segment(t[0], t[1], CGAL::IO::Color(207, 213, 211)); - add_segment(t[1], t[2], CGAL::IO::Color(207, 213, 211)); - add_segment(t[2], t[0], CGAL::IO::Color(207, 213, 211)); + compute_edge(it, p2t2, graphic_buffer); } - void compute_domain() + for (typename P2T2::Periodic_triangle_iterator it = + p2t2.periodic_triangles_begin(it_type); + it != p2t2.periodic_triangles_end(it_type); it++) { - Kernel::Iso_rectangle_2 orig_domain = p2t2.domain(); - std::array covering_sheets = p2t2.number_of_sheets(); - - for(int i = 0; i < covering_sheets[0]; i++){ - for(int j = 0; j < covering_sheets[1]; j++){ - Kernel::Vector_2 shift(i * (orig_domain.xmax() - orig_domain.xmin()), - j * orig_domain.ymax() - orig_domain.ymin()); - Kernel::Point_2 p1((orig_domain.min)()); - Kernel::Point_2 p2(orig_domain.xmin(), orig_domain.ymax()); - Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin()); - Kernel::Point_2 p4((orig_domain.max)()); - - add_segment(p1 + shift, p2 + shift, CGAL::IO::Color(96, 104, 252)); - add_segment(p1 + shift, p3 + shift, CGAL::IO::Color(96, 104, 252)); - add_segment(p2 + shift, p4 + shift, CGAL::IO::Color(96, 104, 252)); - add_segment(p3 + shift, p4 + shift, CGAL::IO::Color(96, 104, 252)); - } - } + compute_face(it, p2t2, graphic_buffer, m_drawing_functor); } - void compute_elements() { - // Clear the buffers - clear(); + if(m_domain){ + // Compute the (9-sheet covering space) domain of the periodic triangulation + compute_domain(p2t2, graphic_buffer); + } +} - // Get the display type, iterate through periodic elements according - // to the display type - Iterator_type it_type = (Iterator_type)m_display_type; +} // namespace draw_function_for_P2T2 - // Iterate through vertices, edges and faces, add elements to buffer - for (Periodic_point_iterator it = - p2t2.periodic_points_begin(it_type); - it != p2t2.periodic_points_end(it_type); it++) - { - compute_vertex(it); - } +template +void add_in_graphic_buffer(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { + draw_function_for_P2T2::compute_elements(p2t2, graphic_buffer, m_drawing_functor); +} - for (Periodic_segment_iterator it = - p2t2.periodic_segments_begin(it_type); - it != p2t2.periodic_segments_end(it_type); it++) - { - compute_edge(it); - } +template +void add_in_graphic_buffer(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer) { - for (Periodic_triangle_iterator it = - p2t2.periodic_triangles_begin(it_type); - it != p2t2.periodic_triangles_end(it_type); it++) - { - compute_face(it); - } + Drawing_functor drawing_functor; - if(m_domain){ - // Compute the (9-sheet covering space) domain of the periodic triangulation - compute_domain(); - } - } + drawing_functor.colored_face = [](const P2T2&, + typename P2T2::Periodic_triangle_iterator) -> bool + { return true; }; - 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 - const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - if (e->text()=="1") - { - m_display_type = Display_type::UNIQUE; - displayMessage(QString("Display type= UNIQUE")); - compute_elements(); - redraw(); - } else if (e->text()=="2") - { - m_display_type = Display_type::UNIQUE_COVER_DOMAIN; - displayMessage(QString("Display type= UNIQUE_COVER_DOMAIN")); - compute_elements(); - redraw(); - } else if (e->text()=="3") - { - m_display_type = Display_type::STORED; - displayMessage(QString("Display type= STORED")); - compute_elements(); - redraw(); - } else if (e->text()=="4") - { - m_display_type = Display_type::STORED_COVER_DOMAIN; - displayMessage(QString("Display type= STORED_COVER_DOMAIN")); - compute_elements(); - redraw(); - } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) - { - m_domain=!m_domain; - displayMessage(QString("Draw domain=%1.").arg(m_domain?"true":"false")); - compute_elements(); - redraw(); - } else { - Base::keyPressEvent(e); - } - } + // TODO: I think we need to add std::function like this: + // drawing_functor.face_color = [] (const P2T2&, + // typename P2T2::Periodic_triangle_iterator, + // int R, int G, int B) -> CGAL::IO::Color + // { + // return CGAL::IO::Color(R, G, B); + // }; // What do you think? -protected: - const P2T2& p2t2; - bool m_nofaces; - const ColorFunctor& m_fcolor; - enum Display_type + drawing_functor.face_color = [] (const P2T2& alcc, + typename P2T2::Periodic_triangle_iterator dh) -> CGAL::IO::Color { - STORED = 0, - UNIQUE, // 1 - STORED_COVER_DOMAIN, // 2 - UNIQUE_COVER_DOMAIN // 3 + return CGAL::IO::Color(207, 213, 211); }; - Display_type m_display_type; - bool m_domain; -}; + + add_in_graphic_buffer(p2t2, graphic_buffer, drawing_functor); +} // Specialization of draw function -#define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 \ - +#define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 + +template < class Gt, + class Tds, + class BufferType = float, + class DrawingFunctor > +void draw(const CGAL_P2T2_TYPE& ap2t2, + const DrawingFunctor &drawing_functor) +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(ap2t2, buffer, drawing_functor); + draw_buffer(buffer); +} template < class Gt, - class Tds > + class Tds, + class BufferType = float > void draw(const CGAL_P2T2_TYPE& ap2t2, const char* title = "2D Periodic Triangulation 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) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"p2t2_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - DefaultColorFunctorP2T2 fcolor; - SimplePeriodic2Triangulation2ViewerQt - mainwindow(app.activeWindow(), ap2t2, title, nofill, fcolor); - mainwindow.show(); - app.exec(); - } + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(ap2t2, buffer); + draw_buffer(buffer); } } // namespace CGAL From cc4aa7cd9dea55dddf5e68f3cf17089a4a5ca2b8 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 6 Oct 2022 17:48:58 +0200 Subject: [PATCH 072/399] Applied new APIs version in Voronoi 2, with modifications in Basic_viewer_qt. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 2 +- .../include/CGAL/draw_voronoi_diagram_2.h | 494 +++++++++--------- 2 files changed, 247 insertions(+), 249 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index ceae3cfd1c43..728d1ed7bc1b 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -399,7 +399,6 @@ class Basic_viewer_qt : public CGAL::QGLViewer update(); } -protected: // Shortcuts to simplify function calls. template static Local_point get_local_point(const KPoint& p) @@ -414,6 +413,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer get_local_vector(v); } +protected: void compile_shaders() { rendering_program_face.removeAllShaders(); diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index f92e9af630ea..a16714badaf2 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -8,10 +8,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Jasmeet Singh +// Mostafa Ashraf #ifndef CGAL_DRAW_VORONOI_DIAGRAM_2_H #define CGAL_DRAW_VORONOI_DIAGRAM_2_H +#include +#include #include #include @@ -28,306 +31,301 @@ namespace CGAL { -// Default color functor; user can change it to have its own face color -struct DefaultColorFunctorV2 +namespace draw_function_for_v2 { - template - static CGAL::IO::Color run(const V2 &, const typename V2::Face_iterator /*fh*/) { - //CGAL::Random random((unsigned int)(std::size_t)(&*fh)); - //return get_random_color(random); - return CGAL::IO::Color(73, 250, 117); - } -}; -// Viewer for Voronoi diagram -template -class SimpleVoronoiDiagram2ViewerQt : public Basic_viewer_qt -{ - typedef Basic_viewer_qt Base; - typedef typename V2::Vertex_iterator Vertex_const_handle; - typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; - typedef typename V2::Delaunay_graph::Finite_vertices_iterator Dual_vertices_iterator; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; +typedef Local_kernel::Point_3 Local_point; +typedef Local_kernel::Vector_3 Local_vector; + +template +void compute_vertex(typename V2::Vertex_iterator vh, CGAL::Graphic_buffer &graphic_buffer) { + + graphic_buffer.add_point(vh->point()); - typedef typename V2::Halfedge_iterator Halfedge_const_handle; - typedef typename V2::Ccb_halfedge_circulator Ccb_halfedge_circulator; - typedef typename V2::Halfedge_handle Halfedge_handle; +} - typedef typename V2::Face_iterator Face_const_handle; +template +void compute_dual_vertex(typename V2::Delaunay_graph::Finite_vertices_iterator vi, CGAL::Graphic_buffer &graphic_buffer) +{ + graphic_buffer.add_point(vi->point(), CGAL::IO::Color(50, 100, 180)); +} +template +void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, CGAL::Graphic_buffer &graphic_buffer) +{ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; + typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; -public: - /// Construct the viewer. - /// @param av2 the voronoi diagram to view - /// @param title the title of the window - /// @param anofaces if true, do not draw faces (faces are not computed; this - /// can be useful for very big object where this time could be long) - SimpleVoronoiDiagram2ViewerQt(QWidget *parent, const V2 &av2, - const char *title = "Basic Voronoi Viewer", - bool anofaces = false, - bool draw_voronoi_vertices = true, - bool draw_delaunay_vertices = true, - const ColorFunctor &fcolor = ColorFunctor()) - : // First draw: vertices; half-edges; faces; multi-color; no inverse - // normal - Base(parent, title, true, true, true, false, false, true, true), - v2(av2), m_nofaces(anofaces), - m_draw_voronoi_vertices(draw_voronoi_vertices), - m_draw_dual_vertices(draw_delaunay_vertices), m_fcolor(fcolor) { - // Add custom key description (see keyPressEvent) - setKeyDescription(::Qt::Key_R, "Toggles rays display"); - setKeyDescription(::Qt::Key_D, "Toggles dual vertices display"); - setKeyDescription(::Qt::Key_V, "Toggles voronoi vertices display"); - - compute_elements(); - } + if (he->is_segment()) { + graphic_buffer.add_segment(he->source()->point(), he->target()->point()); + } else { + Delaunay_vertex_const_handle v1 = he->up(); + Delaunay_vertex_const_handle v2 = he->down(); -protected: + Kernel::Vector_2 direction(v1->point().y() - v2->point().y(), + v2->point().x() - v1->point().x()); + if (he->is_ray()) { + Kernel::Point_2 end_point; + if (he->has_source()) { + end_point = he->source()->point(); - void compute_vertex(Vertex_const_handle vh) { add_point(vh->point()); } + // update_bounding_box_for_ray(end_point, direction); - void compute_dual_vertex(Dual_vertices_iterator vi) - { - add_point(vi->point(), CGAL::IO::Color(50, 100, 180)); - } + // update_bounding_box_for_ray + Local_point lp = Basic_viewer_qt<>::get_local_point(end_point); + Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); + CGAL::Bbox_3 b = (lp + lv).bbox(); + graphic_buffer.update_bounding_box(b); + - void add_segments_and_update_bounding_box(Halfedge_handle he) - { - if (he->is_segment()) { - add_segment(he->source()->point(), he->target()->point()); - } else { - Delaunay_vertex_const_handle v1 = he->up(); - Delaunay_vertex_const_handle v2 = he->down(); - - Kernel::Vector_2 direction(v1->point().y() - v2->point().y(), - v2->point().x() - v1->point().x()); - if (he->is_ray()) { - Kernel::Point_2 end_point; - if (he->has_source()) { - end_point = he->source()->point(); - update_bounding_box_for_ray(end_point, direction); - } - } else if (he->is_bisector()) { - Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, - (v1->point().y() + v2->point().y()) / 2); - Kernel::Vector_2 perpendicularDirection( - v2->point().x() - v1->point().x(), - v2->point().y() - v1->point().y()); - update_bounding_box_for_line(pointOnLine, direction, - perpendicularDirection); } + } else if (he->is_bisector()) { + Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, + (v1->point().y() + v2->point().y()) / 2); + Kernel::Vector_2 perpendicularDirection( + v2->point().x() - v1->point().x(), + v2->point().y() - v1->point().y()); + + // update_bounding_box_for_line(pointOnLine, direction, + // perpendicularDirection); + + // update_bounding_box_for_line + Local_point lp = Basic_viewer_qt<>::get_local_point(pointOnLine); + Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); + Local_vector lpv = Basic_viewer_qt<>::get_local_vector(perpendicularDirection); + + CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); + graphic_buffer.update_bounding_box(b); + } } +} - Local_kernel::Point_2 get_second_point(Halfedge_handle ray) - { - Delaunay_vertex_const_handle v1 = ray->up(); - Delaunay_vertex_const_handle v2 = ray->down(); - - // calculate direction of ray and its inverse - Kernel::Vector_2 v(v1->point().y() - v2->point().y(), - v2->point().x() - v1->point().x()); - Local_kernel::Vector_2 inv(1 / v.x(), 1 / v.y()); - - // origin of the ray - Kernel::Point_2 p; - if (ray->has_source()) { - p = ray->source()->point(); - } else { - p = ray->target()->point(); - } +template +Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, const CGAL::Bbox_3 & m_bounding_box) +{ + typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; + typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; + + Delaunay_vertex_const_handle v1 = ray->up(); + Delaunay_vertex_const_handle v2 = ray->down(); + + // calculate direction of ray and its inverse + Kernel::Vector_2 v(v1->point().y() - v2->point().y(), + v2->point().x() - v1->point().x()); + Local_kernel::Vector_2 inv(1 / v.x(), 1 / v.y()); + + // origin of the ray + Kernel::Point_2 p; + if (ray->has_source()) { + p = ray->source()->point(); + } else { + p = ray->target()->point(); + } - // get the bounding box of the viewer - Local_kernel::Vector_2 boundsMin(m_bounding_box.xmin(), - m_bounding_box.zmin()); - Local_kernel::Vector_2 boundsMax(m_bounding_box.xmax(), - m_bounding_box.zmax()); - // calculate intersection - double txmax, txmin, tymax, tymin; - - if (inv.x() >= 0) { - txmax = (boundsMax.x() - p.x()) * inv.x(); - txmin = (boundsMin.x() - p.x()) * inv.x(); - } else { - txmax = (boundsMin.x() - p.x()) * inv.x(); - txmin = (boundsMax.x() - p.x()) * inv.x(); - } + // get the bounding box of the viewer + Local_kernel::Vector_2 boundsMin(m_bounding_box.xmin(), + m_bounding_box.zmin()); + Local_kernel::Vector_2 boundsMax(m_bounding_box.xmax(), + m_bounding_box.zmax()); + // calculate intersection + double txmax, txmin, tymax, tymin; + + if (inv.x() >= 0) { + txmax = (boundsMax.x() - p.x()) * inv.x(); + txmin = (boundsMin.x() - p.x()) * inv.x(); + } else { + txmax = (boundsMin.x() - p.x()) * inv.x(); + txmin = (boundsMax.x() - p.x()) * inv.x(); + } - if (inv.y() >= 0) { - tymax = (boundsMax.y() - p.y()) * inv.y(); - tymin = (boundsMin.y() - p.y()) * inv.y(); - } else { - tymax = (boundsMin.y() - p.y()) * inv.y(); - tymin = (boundsMax.y() - p.y()) * inv.y(); - } + if (inv.y() >= 0) { + tymax = (boundsMax.y() - p.y()) * inv.y(); + tymin = (boundsMin.y() - p.y()) * inv.y(); + } else { + tymax = (boundsMin.y() - p.y()) * inv.y(); + tymin = (boundsMax.y() - p.y()) * inv.y(); + } - if (tymin > txmin) - txmin = tymin; - if (tymax < txmax) - txmax = tymax; - - Local_kernel::Point_2 p1; - if (v.x() == 0) { - p1 = Local_kernel::Point_2(p.x(), p.y() + tymax * v.y()); - } else if (v.y() == 0) { - p1 = Local_kernel::Point_2(p.x() + txmax * v.x(), p.y()); - } else { - p1 = Local_kernel::Point_2(p.x() + txmax * v.x(), p.y() + tymax * v.y()); - } - return p1; + if (tymin > txmin) + txmin = tymin; + if (tymax < txmax) + txmax = tymax; + + Local_kernel::Point_2 p1; + if (v.x() == 0) { + p1 = Local_kernel::Point_2(p.x(), p.y() + tymax * v.y()); + } else if (v.y() == 0) { + p1 = Local_kernel::Point_2(p.x() + txmax * v.x(), p.y()); + } else { + p1 = Local_kernel::Point_2(p.x() + txmax * v.x(), p.y() + tymax * v.y()); } + return p1; +} - void compute_rays_and_bisectors(Halfedge_const_handle he) - { - Delaunay_vertex_const_handle v1 = he->up(); - Delaunay_vertex_const_handle v2 = he->down(); +// Halfedge_const_handle +template +void compute_rays_and_bisectors(typename V2::Halfedge_iterator he, CGAL::Graphic_buffer &graphic_buffer) +{ + typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; + typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; - Kernel::Vector_2 direction(v1->point().y() - v2->point().y(), - v2->point().x() - v1->point().x()); - if (he->is_ray()) { - if (he->has_source()) { - // add_ray_segment(he->source()->point(), get_second_point(he)); - add_ray(he->source()->point(), direction, CGAL::IO::Color(100, 0, 0)); - } - } else if (he->is_bisector()) { - Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, - (v1->point().y() + v2->point().y()) / 2); - add_line(pointOnLine, direction); + Delaunay_vertex_const_handle v1 = he->up(); + Delaunay_vertex_const_handle v2 = he->down(); + + Kernel::Vector_2 direction(v1->point().y() - v2->point().y(), + v2->point().x() - v1->point().x()); + if (he->is_ray()) { + if (he->has_source()) { + // add_ray_segment(he->source()->point(), get_second_point(he, graphic_buffer.get_bounding_box())); + graphic_buffer.add_ray(he->source()->point(), direction, CGAL::IO::Color(100, 0, 0)); } + } else if (he->is_bisector()) { + Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, + (v1->point().y() + v2->point().y()) / 2); + graphic_buffer.add_line(pointOnLine, direction); } +} - void compute_face(Face_const_handle fh) - { - CGAL::IO::Color c = m_fcolor.run(v2, fh); +template +void compute_face(typename V2::Face_iterator fh, const V2& v2, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) +{ + typedef typename V2::Ccb_halfedge_circulator Ccb_halfedge_circulator; - Ccb_halfedge_circulator ec_start = fh->ccb(); - Ccb_halfedge_circulator ec = ec_start; + if(m_drawing_functor.colored_face(v2, fh)) { - if (!fh->is_unbounded()) { - face_begin(c); - do { - add_point_in_face(ec->source()->point()); - } while (++ec != ec_start); - face_end(); - } - // Test: for unbounded faces - // else { - // do{ - // if( ec->has_source() ){ - // add_point_in_face(ec->source()->point()); - // } - // else{ - // add_point_in_face(get_second_point(ec->twin())); - // } - // } while(++ec != ec_start); - // } + CGAL::IO::Color c = m_drawing_functor.face_color(v2, fh); + + Ccb_halfedge_circulator ec_start = fh->ccb(); + Ccb_halfedge_circulator ec = ec_start; + + if (!fh->is_unbounded()) { + graphic_buffer.face_begin(c); + do { + graphic_buffer.add_point_in_face(ec->source()->point()); + } while (++ec != ec_start); + graphic_buffer.face_end(); } - void compute_elements() - { - clear(); + } + // Test: for unbounded faces + // else { + // do{ + // if( ec->has_source() ){ + // add_point_in_face(ec->source()->point()); + // } + // else{ + // add_point_in_face(get_second_point(ec->twin(), graphic_buffer.get_bounding_box())); + // } + // } while(++ec != ec_start); + // } +} - // Draw the voronoi vertices - if (m_draw_voronoi_vertices) { - for (typename V2::Vertex_iterator it = v2.vertices_begin(); - it != v2.vertices_end(); ++it) { - compute_vertex(it); - } - } +template +void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor , bool m_nofaces = false, bool m_draw_voronoi_vertices = true, bool m_draw_dual_vertices = true) +{ + typedef typename V2::Delaunay_graph::Finite_vertices_iterator Dual_vertices_iterator; - // Draw the dual vertices - if (m_draw_dual_vertices) { - for (Dual_vertices_iterator it = v2.dual().finite_vertices_begin(); - it != v2.dual().finite_vertices_end(); ++it) { - compute_dual_vertex(it); - } + // Draw the voronoi vertices + if (m_draw_voronoi_vertices) { + for (typename V2::Vertex_iterator it = v2.vertices_begin(); + it != v2.vertices_end(); ++it) { + compute_vertex(it, graphic_buffer); } + } - // Add segments and update bounding box - for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); - it != v2.halfedges_end(); ++it) { - add_segments_and_update_bounding_box(it); + // Draw the dual vertices + if (m_draw_dual_vertices) { + for (Dual_vertices_iterator it = v2.dual().finite_vertices_begin(); + it != v2.dual().finite_vertices_end(); ++it) { + compute_dual_vertex(it, graphic_buffer); } + } - for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); - it != v2.halfedges_end(); ++it) { - compute_rays_and_bisectors(it); - } + // Add segments and update bounding box + for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); + it != v2.halfedges_end(); ++it) { + add_segments_and_update_bounding_box(it, graphic_buffer); + } - if (!m_nofaces) { - for (typename V2::Face_iterator it = v2.faces_begin(); - it != v2.faces_end(); ++it) { - compute_face(it); - } - } + for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); + it != v2.halfedges_end(); ++it) { + compute_rays_and_bisectors(it, graphic_buffer); } - virtual void keyPressEvent(QKeyEvent *e) - { - /// [Keypress] - const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) { - m_draw_rays = !m_draw_rays; - displayMessage( - QString("Draw rays=%1.").arg(m_draw_rays ? "true" : "false")); - update(); - } else if ((e->key() == ::Qt::Key_V) && (modifiers == ::Qt::NoButton)) { - m_draw_voronoi_vertices = !m_draw_voronoi_vertices; - displayMessage( - QString("Voronoi vertices=%1.").arg(m_draw_voronoi_vertices? "true" : "false")); - compute_elements(); - redraw(); - } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { - m_draw_dual_vertices = !m_draw_dual_vertices; - displayMessage(QString("Dual vertices=%1.") - .arg(m_draw_dual_vertices ? "true" : "false")); - compute_elements(); - redraw(); - } else { - // Call the base method to process others/classicals key - Base::keyPressEvent(e); + if (!m_nofaces) { + for (typename V2::Face_iterator it = v2.faces_begin(); + it != v2.faces_end(); ++it) { + compute_face(it, v2, graphic_buffer, m_drawing_functor); } - /// [Keypress] } +} + +} // namespace draw_function_for_v2 + +template +void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor, bool m_nofaces = false, + bool m_draw_voronoi_vertices = true, bool m_draw_dual_vertices = true ) { + draw_function_for_v2::compute_elements(v2, graphic_buffer, m_drawing_functor, m_nofaces, m_draw_voronoi_vertices, m_draw_dual_vertices); +} + +template +void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graphic_buffer, + bool m_nofaces = false, bool m_draw_voronoi_vertices = true, + bool m_draw_dual_vertices = true ) { -protected: - const V2 &v2; - bool m_nofaces; - bool m_draw_voronoi_vertices; - bool m_draw_dual_vertices; - const ColorFunctor &m_fcolor; -}; + // Default functor; user can add his own functor. + Drawing_functor + drawing_functor; + + drawing_functor.colored_face = [](const V2&, + typename V2::Face_iterator fh) -> bool + { return true; }; + + + drawing_functor.face_color = [] (const V2& alcc, + typename V2::Face_iterator fh) -> CGAL::IO::Color + { + return CGAL::IO::Color(73, 250, 117); + }; + + add_in_graphic_buffer(v2, graphic_buffer, drawing_functor, m_nofaces, m_draw_voronoi_vertices, m_draw_dual_vertices); +} // Specialization of draw function. #define CGAL_VORONOI_TYPE CGAL::Voronoi_diagram_2 template + class AP, typename BufferType = float, class DrawingFunctor> +void draw(const CGAL_VORONOI_TYPE &av2, + const DrawingFunctor &drawing_functor, + bool nofill = false, + bool draw_voronoi_vertices = true, + bool draw_dual_vertices = true) +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(av2, buffer, drawing_functor, nofill, draw_voronoi_vertices, draw_dual_vertices); + draw_buffer(buffer); +} + +template void draw(const CGAL_VORONOI_TYPE &av2, const char *title="2D Voronoi Diagram Basic Viewer", bool nofill = false, bool draw_voronoi_vertices = true, bool draw_dual_vertices = true) { -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite = true; -#else - bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif - - if (!cgal_test_suite) { - CGAL::Qt::init_ogl_context(4,3); - int argc = 1; - const char *argv[2] = {"voronoi_2_viewer", nullptr}; - QApplication app(argc, const_cast(argv)); - DefaultColorFunctorV2 fcolor; - SimpleVoronoiDiagram2ViewerQt - mainwindow(app.activeWindow(), av2, title, nofill, - draw_voronoi_vertices, draw_dual_vertices, fcolor); - mainwindow.show(); - app.exec(); - } + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(av2, buffer, nofill, draw_voronoi_vertices, draw_dual_vertices); + draw_buffer(buffer); } } // End namespace CGAL From d7a513cfb6432a92cd01ba24aef09196b6ba81e4 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 6 Oct 2022 18:37:35 +0200 Subject: [PATCH 073/399] Modified --- .../CGAL/draw_periodic_2_triangulation_2.h | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 41453f1cbcd8..a1ade03cebda 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -68,7 +68,6 @@ void compute_face(typename P2T2::Periodic_triangle_iterator ti, const P2T2 &p2t2 if(m_drawing_functor.colored_face(p2t2, ti)) { - // Need CGAL::IO::Color(73, 250, 117); CGAL::IO::Color c= m_drawing_functor.face_color(p2t2, ti); graphic_buffer.face_begin(c); graphic_buffer.add_point_in_face(t[0]); @@ -80,15 +79,12 @@ void compute_face(typename P2T2::Periodic_triangle_iterator ti, const P2T2 &p2t2 // Display the edges of the faces as segments with a // light gray color for better visualization - if(m_drawing_functor.colored_face(p2t2, ti)) { + CGAL::IO::Color segment_color = CGAL::IO::Color(207, 213, 211); - // Need CGAL::IO::Color(207, 213, 211); - CGAL::IO::Color c = m_drawing_functor.face_color(p2t2, ti); + graphic_buffer.add_segment(t[0], t[1], segment_color); + graphic_buffer.add_segment(t[1], t[2], segment_color); + graphic_buffer.add_segment(t[2], t[0], segment_color); - graphic_buffer.add_segment(t[0], t[1], c); - graphic_buffer.add_segment(t[1], t[2], c); - graphic_buffer.add_segment(t[2], t[0], c); - } } template @@ -121,7 +117,7 @@ void compute_elements(const P2T2 &p2t2, CGAL::Graphic_buffer &graphi typedef typename P2T2::Iterator_type Iterator_type; - Display_type m_display_type(Display_type::STORED_COVER_DOMAIN); + draw_function_for_P2T2::Display_type m_display_type = draw_function_for_P2T2::Display_type::STORED_COVER_DOMAIN; // Get the display type, iterate through periodic elements according // to the display type @@ -160,13 +156,13 @@ void compute_elements(const P2T2 &p2t2, CGAL::Graphic_buffer &graphi template void add_in_graphic_buffer(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { - draw_function_for_P2T2::compute_elements(p2t2, graphic_buffer, m_drawing_functor); + draw_function_for_P2T2::compute_elements(p2t2, graphic_buffer, m_drawing_functor, true); } template void add_in_graphic_buffer(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer) { - Drawing_functor drawing_functor; @@ -174,18 +170,10 @@ void add_in_graphic_buffer(const P2T2 &p2t2, CGAL::Graphic_buffer &g typename P2T2::Periodic_triangle_iterator) -> bool { return true; }; - // TODO: I think we need to add std::function like this: - // drawing_functor.face_color = [] (const P2T2&, - // typename P2T2::Periodic_triangle_iterator, - // int R, int G, int B) -> CGAL::IO::Color - // { - // return CGAL::IO::Color(R, G, B); - // }; // What do you think? - drawing_functor.face_color = [] (const P2T2& alcc, typename P2T2::Periodic_triangle_iterator dh) -> CGAL::IO::Color { - return CGAL::IO::Color(207, 213, 211); + return CGAL::IO::Color(73, 250, 117); }; add_in_graphic_buffer(p2t2, graphic_buffer, drawing_functor); From 74a68d469434a3bb4c940ca79e58ecc552ea2db3 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 6 Oct 2022 21:22:05 +0200 Subject: [PATCH 074/399] Applied new APIs version in face graph. --- BGL/include/CGAL/draw_face_graph.h | 241 +++++++----------- Surface_mesh/include/CGAL/draw_surface_mesh.h | 34 +-- 2 files changed, 103 insertions(+), 172 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index 00e22278c7ba..e78016a56f15 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 GeometryFactory (France) +// Copyright (c) 2018-2022 GeometryFactory (France) // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -9,186 +9,117 @@ // // Author(s) : Guillaume Damiand // Laurent Rineau +// Mostafa Ashraf #ifndef CGAL_DRAW_FACE_GRAPH_H #define CGAL_DRAW_FACE_GRAPH_H +#include +#include +#include + #ifdef CGAL_USE_BASIC_VIEWER #include #include #include -namespace CGAL -{ - -// Default color functor; user can change it to have its own face color -struct DefaultColorFunctorFaceGraph -{ - template - CGAL::IO::Color operator()(const Graph&, - typename boost::graph_traits::face_descriptor fh) const - { - if (fh==boost::graph_traits::null_face()) // use to get the mono color - return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 - - return get_random_color(CGAL::get_default_random()); +namespace CGAL { + +namespace draw_function_for_SM { + +template +void compute_elements(const SM &sm, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor, bool anofaces = false) { + + using Point = + typename boost::property_map_value::type; + using Kernel = typename CGAL::Kernel_traits::Kernel; + using Vector = typename Kernel::Vector_3; + + auto vnormals = get(CGAL::dynamic_vertex_property_t(), sm); + auto point_pmap = get(CGAL::vertex_point, sm); + for (auto v : vertices(sm)) { + Vector n(NULL_VECTOR); + int i = 0; + for (auto h : halfedges_around_target(halfedge(v, sm), sm)) { + if (!is_border(h, sm)) { + Vector ni = CGAL::cross_product( + Vector(get(point_pmap, source(h, sm)), + get(point_pmap, target(h, sm))), + Vector(get(point_pmap, target(h, sm)), + get(point_pmap, target(next(h, sm), sm)))); + if (ni != NULL_VECTOR) { + n += ni; + ++i; + } + } + } + put(vnormals, v, n / i); } -}; -class SimpleFaceGraphViewerQt : public Basic_viewer_qt -{ - using Base = Basic_viewer_qt; - -public: - SimpleFaceGraphViewerQt(QWidget* parent) : - Base(parent, "", false, true, true, true, false), - m_compute_elements_impl([]{}) - { + if (!anofaces) { + for (auto fh : faces(sm)) { + if (fh != boost::graph_traits::null_face() && m_drawing_functor.colored_face(sm, fh)) { + CGAL::IO::Color c = m_drawing_functor.face_color(sm, fh); + graphic_buffer.face_begin(c); + auto hd = halfedge(fh, sm); + const auto first_hd = hd; + do { + auto v = source(hd, sm); + graphic_buffer.add_point_in_face(get(point_pmap, v), get(vnormals, v)); + hd = next(hd, sm); + } while (hd != first_hd); + graphic_buffer.face_end(); + } + } } - /// Construct the viewer. - /// @param amesh the surface mesh 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) - template - SimpleFaceGraphViewerQt(QWidget* parent, - const SM& amesh, - const char* title="Basic Surface_mesh Viewer", - bool anofaces=false) : - SimpleFaceGraphViewerQt(parent, amesh, title, anofaces, DefaultColorFunctorFaceGraph()) - { + for (auto e : edges(sm)) { + graphic_buffer.add_segment(get(point_pmap, source(halfedge(e, sm), sm)), + get(point_pmap, target(halfedge(e, sm), sm))); } - template - SimpleFaceGraphViewerQt(QWidget* parent, - const SM& amesh, - const char* title, - bool anofaces, - ColorFunctor fcolor) : - // First draw: no vertex; edges, faces; mono-color; inverse normal - Base(parent, title, false, true, true, true, false), - m_compute_elements_impl(compute_elements_functor(amesh, anofaces, fcolor)) - { + for (auto v : vertices(sm)) { + graphic_buffer.add_point(get(point_pmap, v)); } +} - void init() override { - compute_elements(); - Base::init(); - } +} // draw_function_for_SM - void compute_elements() { - m_compute_elements_impl(); - } +template +void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { + draw_function_for_SM::compute_elements(sm, graphic_buffer, m_drawing_functor); +} - template - void set_face_graph(const SM& amesh, - bool anofaces, - ColorFunctor fcolor) { - m_compute_elements_impl = compute_elements_functor(amesh, anofaces, fcolor); - } +template +void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer) { - template - void set_face_graph(const SM& amesh, - bool anofaces=false) { - set_mesh(amesh, anofaces, DefaultColorFunctorFaceGraph()); - } -protected: - template - std::function - compute_elements_functor(const SM& sm, - bool anofaces, - ColorFunctor fcolor) - { - using Point = - typename boost::property_map_value::type; - using Kernel = typename CGAL::Kernel_traits::Kernel; - using Vector = typename Kernel::Vector_3; - - auto vnormals = get(CGAL::dynamic_vertex_property_t(), sm); - auto point_pmap = get(CGAL::vertex_point, sm); - for (auto v : vertices(sm)) - { - Vector n(NULL_VECTOR); - int i=0; - for (auto h : halfedges_around_target(halfedge(v, sm), sm)) - { - if (!is_border(h, sm)) - { - Vector ni = CGAL::cross_product( - Vector(get(point_pmap, source(h, sm)), get(point_pmap, target(h, sm))), - Vector(get(point_pmap, target(h, sm)), get(point_pmap, target(next(h, sm), sm)))); - if (ni != NULL_VECTOR) - { - n+=ni; - ++i; - } - } - } - put(vnormals, v, n/i); - } + // Default functor; user can add his own functor. + Drawing_functor::face_descriptor, + typename boost::graph_traits::face_descriptor, + typename boost::graph_traits::face_descriptor> + drawing_functor; - // This function return a lambda expression, type-erased in a - // `std::function` object. - return [this, &sm, vnormals, anofaces, fcolor, point_pmap]() - { - this->clear(); - - if (!anofaces) - { - for (auto fh: faces(sm)) - { - if (fh!=boost::graph_traits::null_face()) - { - CGAL::IO::Color c=fcolor(sm, fh); - face_begin(c); - auto hd=halfedge(fh, sm); - const auto first_hd = hd; - do - { - auto v = source(hd, sm); - add_point_in_face(get(point_pmap, v), get(vnormals, v)); - hd=next(hd, sm); - } - while(hd!=first_hd); - face_end(); - } - } - } + drawing_functor.colored_face = [](const SM &, + typename boost::graph_traits::face_descriptor fh) -> bool + { return true; }; - for (auto e: edges(sm)) - { - add_segment(get(point_pmap, source(halfedge(e, sm), sm)), - get(point_pmap, target(halfedge(e, sm), sm))); - } - - for (auto v: vertices(sm)) - { - this->add_point(get(point_pmap, v)); - } - }; - } - void keyPressEvent(QKeyEvent *e) override + drawing_functor.face_color = [] (const SM &, + typename boost::graph_traits::face_descriptor fh) -> CGAL::IO::Color { - // 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); - } + if (fh == + boost::graph_traits::null_face()) // use to get the mono color + return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 + + return get_random_color(CGAL::get_default_random()); + }; -protected: - std::function m_compute_elements_impl; -}; + add_in_graphic_buffer(sm, graphic_buffer, drawing_functor); +} } // End namespace CGAL diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 3459392aec1c..e836ad6eb713 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -8,6 +8,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_SURFACE_MESH_H #define CGAL_DRAW_SURFACE_MESH_H @@ -28,6 +29,8 @@ void draw(const SM& asm); #else // DOXYGEN_RUNNING +#include +#include #include #include @@ -40,28 +43,25 @@ namespace CGAL { // Specialization of draw function. -template +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=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(amesh, buffer); + draw_buffer(buffer); +} - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"surface_mesh_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimpleFaceGraphViewerQt mainwindow(app.activeWindow(), amesh, title, - nofill); - mainwindow.show(); - app.exec(); - } +template +void draw(const Surface_mesh& amesh, + const DrawingFunctor &drawing_functor, + const char* title="Surface_mesh Basic Viewer", + bool nofill=false) +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(amesh, buffer, drawing_functor); + draw_buffer(buffer); } } // End namespace CGAL From 6469319870ee97b1a8094031faacfcfd4edbf315 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 6 Oct 2022 21:23:34 +0200 Subject: [PATCH 075/399] Surface mesh example. --- Surface_mesh/include/CGAL/draw_surface_mesh.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index e836ad6eb713..184d80c5a830 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -39,6 +39,7 @@ void draw(const SM& asm); #include #include #include + namespace CGAL { From f4b8db08372625ecedf4e6084152559fd4ad6fe2 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 6 Oct 2022 22:48:11 +0200 Subject: [PATCH 076/399] Used new face graph APIs in polyhedron. --- Polyhedron/include/CGAL/draw_polyhedron.h | 38 +++++++++++++---------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 0866e27ebc0b..b6d92c56b3ae 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -8,10 +8,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_POLYHEDRON_H #define CGAL_DRAW_POLYHEDRON_H +#include +#include #include #include @@ -32,28 +35,29 @@ template class T_HDS, - class Alloc> + class Alloc, typename BufferType = float> 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=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(apoly, buffer); + draw_buffer(buffer); +} - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"polyhedron_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimpleFaceGraphViewerQt - mainwindow(app.activeWindow(), apoly, title, nofill); - mainwindow.show(); - app.exec(); - } +template + class T_HDS, + class Alloc, typename BufferType = float, class DrawingFunctor> +void draw(const CGAL_POLY_TYPE& apoly, + const DrawingFunctor &drawing_functor, + const char* title="Polyhedron Basic Viewer", + bool nofill=false) +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(apoly, buffer, drawing_functor); + draw_buffer(buffer); } #undef CGAL_POLY_TYPE From c4d612c85e2b026da65b71aa41728ca5ff498c9e Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 7 Oct 2022 03:00:19 +0200 Subject: [PATCH 077/399] Uses new APIs version in Nef_3. --- Nef_3/include/CGAL/draw_nef_3.h | 402 +++++++++++++++----------------- 1 file changed, 193 insertions(+), 209 deletions(-) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index e654ea9aae7f..f211ecc380f4 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -9,10 +9,13 @@ // // // Author(s) : Jasmeet Singh +// Mostafa Ashraf #ifndef DRAW_NEF_3_H #define DRAW_NEF_3_H +#include +#include #include #include @@ -28,268 +31,249 @@ namespace CGAL { -// Default color functor; user can change it to have its own face color -struct DefaultColorFunctorNefPolyhedron +typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; +typedef Local_kernel::Vector_3 Local_vector; + +namespace draw_function_for_nef_polyhedron { - template - static CGAL::IO::Color run(const NefPolyhedron&, - typename NefPolyhedron::Halffacet_const_handle fh) - { - if (fh == nullptr) // use to get the mono color - return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 - CGAL::Random random((unsigned int)(std::size_t)(&(*fh))); - return get_random_color(random); +template +Local_vector get_face_normal(typename Nef_Polyhedron::SHalfedge_const_handle she) +{ + typedef typename Nef_Polyhedron::SHalfedge_around_facet_const_circulator SHalfedge_around_facet_const_circulator; + + SHalfedge_around_facet_const_circulator he(she); + Local_vector normal = CGAL::NULL_VECTOR; + SHalfedge_around_facet_const_circulator end = he; + unsigned int nb = 0; + + CGAL_For_all(he, end) + { + internal::newell_single_step_3(Basic_viewer_qt<>::get_local_point + (he->next()->source()->center_vertex()->point()), + Basic_viewer_qt<>::get_local_point(he->source()->center_vertex()-> + point()), normal); + ++nb; } -}; -// Viewer class for Nef Polyhedron -template -class SimpleNefPolyhedronViewerQt : public Basic_viewer_qt + CGAL_assertion(nb > 0); + return (typename Local_kernel::Construct_scaled_vector_3()(normal, 1.0 / nb)); +} + +template +Local_vector get_vertex_normal(typename Nef_Polyhedron::Vertex_const_handle vh) { - typedef Basic_viewer_qt Base; - typedef typename Nef_Polyhedron::Kernel Kernel; + typedef typename Nef_Polyhedron::SHalfedge_const_handle SHalfedge_const_handle; + typedef typename Nef_Polyhedron::SHalfedge_const_iterator SHalfedge_const_iterator; - typedef typename Nef_Polyhedron::Halffacet_cycle_const_iterator Halffacet_cycle_const_iterator; - typedef typename Nef_Polyhedron::SHalfedge_around_facet_const_circulator SHalfedge_around_facet_const_circulator; + Local_vector normal = CGAL::NULL_VECTOR; - typedef typename Nef_Polyhedron::Shell_entry_const_iterator Shell_entry_const_iterator; - typedef typename Nef_Polyhedron::SHalfedge_const_iterator SHalfedge_const_iterator; - typedef typename Nef_Polyhedron::Volume_const_iterator Volume_const_iterator; + SHalfedge_const_iterator it = vh->shalfedges_begin(); + SHalfedge_const_handle end = it; + do { + Local_vector n = get_face_normal(it); + normal = typename Local_kernel::Construct_sum_of_vectors_3()(normal, n); + it = it->snext(); + } while( it != end ); + + if (!typename Local_kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) + { + normal = (typename Local_kernel::Construct_scaled_vector_3()( + normal, 1.0 / CGAL::sqrt(normal.squared_length()))); + } + + return normal; +} + +// Visitor class to iterate through shell objects +template +class Nef_Visitor { - typedef typename Nef_Polyhedron::Vertex_const_handle Vertex_const_handle; - typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; typedef typename Nef_Polyhedron::Halfedge_const_handle Halfedge_const_handle; typedef typename Nef_Polyhedron::Halffacet_const_handle Halffacet_const_handle; typedef typename Nef_Polyhedron::SHalfedge_const_handle SHalfedge_const_handle; + typedef typename Nef_Polyhedron::SHalfedge_around_facet_const_circulator SHalfedge_around_facet_const_circulator; + typedef typename Nef_Polyhedron::Vertex_const_handle Vertex_const_handle; + typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; typedef typename Nef_Polyhedron::SHalfloop_const_handle SHalfloop_const_handle; + typedef typename Nef_Polyhedron::Halffacet_cycle_const_iterator Halffacet_cycle_const_iterator; public: - /// Construct the viewer - /// @param anef the nef polyhedron to view - /// @param title the title of the window - /// @param anofaces if true, do not draw faces (faces are not - /// computed: this can be useful for big objects) - SimpleNefPolyhedronViewerQt(QWidget* parent, - const Nef_Polyhedron& anef, - const char* title="Basic Nef Polyhedron Viewer", - bool anofaces=false, - const ColorFunctor& fcolor=ColorFunctor()) : - //First draw: vertex; edges, faces; mon-color; inverse normal - Base(parent, title, false, true, true, true, false), - nef(anef), - m_nofaces(anofaces), - m_fcolor(fcolor) - { - compute_elements(); + Nef_Visitor(const Nef_Polyhedron &_nef, + CGAL::Graphic_buffer & _graphic_buffer, + const DrawingFunctor &_drawing_functor) + : n_faces(0), n_edges(0), + nef(_nef), + graphic_buffer(_graphic_buffer), + drawing_functor(_drawing_functor) {} + + void visit(Vertex_const_handle vh) { + graphic_buffer.add_point(vh->point()); } -protected: - // Visitor class to iterate through shell objects - class Nef_Visitor { - public: - Nef_Visitor(SimpleNefPolyhedronViewerQt &v) - : n_faces(0), n_edges(0), viewer(v) {} - - void visit(Vertex_const_handle vh) { - viewer.add_point(vh->point()); - } - - void visit(Halffacet_const_handle opposite_facet) - { - Halffacet_const_handle f = opposite_facet->twin(); - if (facets_done.find(f) != facets_done.end() || - facets_done.find(opposite_facet) != facets_done.end()) { - return; - } + void visit(Halffacet_const_handle opposite_facet) + { + Halffacet_const_handle f = opposite_facet->twin(); + if (facets_done.find(f) != facets_done.end() || + facets_done.find(opposite_facet) != facets_done.end()) { + return; + } + SHalfedge_const_handle se; + Halffacet_cycle_const_iterator fc = f->facet_cycles_begin(); - SHalfedge_const_handle se; - Halffacet_cycle_const_iterator fc=f->facet_cycles_begin(); + se = SHalfedge_const_handle(fc); // non-zero if shalfedge is returned + if(se == 0) + { //return if not-shalfedge + return; + } - se = SHalfedge_const_handle(fc); // non-zero if shalfedge is returned - if(se == 0) - { //return if not-shalfedge - return; - } + if(drawing_functor.colored_face(nef, f)) { + CGAL::IO::Color c = drawing_functor.face_color(nef, f); + graphic_buffer.face_begin(c); + } - CGAL::IO::Color c = viewer.run_color(f); - viewer.face_begin(c); + SHalfedge_around_facet_const_circulator hc_start(se); + SHalfedge_around_facet_const_circulator hc_end(hc_start); + Vertex_const_handle lastvh; + CGAL_For_all(hc_start, hc_end) { + Vertex_const_handle vh=hc_start->source()->center_vertex(); + lastvh=vh; + graphic_buffer.add_point_in_face(vh->point(), draw_function_for_nef_polyhedron::get_vertex_normal(vh)); + } - SHalfedge_around_facet_const_circulator hc_start(se); - SHalfedge_around_facet_const_circulator hc_end(hc_start); - Vertex_const_handle lastvh; + // Now iterate through holes of the face + ++fc; + while(fc!=f->facet_cycles_end()) + { + se = SHalfedge_const_handle(fc); + hc_start=se; + hc_end=hc_start; CGAL_For_all(hc_start, hc_end) { Vertex_const_handle vh=hc_start->source()->center_vertex(); - lastvh=vh; - viewer.add_point_in_face(vh->point(), - viewer.get_vertex_normal(vh)); + graphic_buffer.add_point_in_face(vh->point(), draw_function_for_nef_polyhedron::get_vertex_normal(vh)); } - - // Now iterate through holes of the face + graphic_buffer.add_point_in_face(hc_start->source()->center_vertex()->point(), + draw_function_for_nef_polyhedron::get_vertex_normal(hc_start->source()->center_vertex())); + graphic_buffer.add_point_in_face(lastvh->point(), draw_function_for_nef_polyhedron::get_vertex_normal(lastvh)); ++fc; - while(fc!=f->facet_cycles_end()) - { - se = SHalfedge_const_handle(fc); - hc_start=se; - hc_end=hc_start; - CGAL_For_all(hc_start, hc_end) { - Vertex_const_handle vh=hc_start->source()->center_vertex(); - viewer.add_point_in_face(vh->point(), - viewer.get_vertex_normal(vh)); - } - viewer.add_point_in_face(hc_start->source()->center_vertex()->point(), - viewer.get_vertex_normal(hc_start->source()->center_vertex())); - viewer.add_point_in_face(lastvh->point(), - viewer.get_vertex_normal(lastvh)); - ++fc; - } - - viewer.face_end(); - facets_done[f]=true; - n_faces++; } - void visit(Halfedge_const_handle he) - { - Halfedge_const_handle twin = he->twin(); - if (edges_done.find(he) != edges_done.end() || - edges_done.find(twin) != edges_done.end()) - { - // Edge already added - return; - } + graphic_buffer.face_end(); + facets_done[f]=true; + n_faces++; + } - viewer.add_segment(he->source()->point(), he->target()->point()); - edges_done[he] = true; - n_edges++; + void visit(Halfedge_const_handle he) + { + Halfedge_const_handle twin = he->twin(); + if (edges_done.find(he) != edges_done.end() || + edges_done.find(twin) != edges_done.end()) + { + // Edge already added + return; } - void visit(SHalfedge_const_handle ) {} - void visit(SHalfloop_const_handle ) {} - void visit(SFace_const_handle ) {} - int n_faces; - int n_edges; - protected: - std::unordered_map facets_done; - std::unordered_map edges_done; - SimpleNefPolyhedronViewerQt& viewer; - }; + graphic_buffer.add_segment(he->source()->point(), he->target()->point()); + edges_done[he] = true; + n_edges++; + } - void compute_elements() - { - clear(); + void visit(SHalfedge_const_handle ) {} + void visit(SHalfloop_const_handle ) {} + void visit(SFace_const_handle ) {} + int n_faces; + int n_edges; +protected: + std::unordered_map facets_done; + std::unordered_map edges_done; + CGAL::Graphic_buffer& graphic_buffer; + const DrawingFunctor& drawing_functor; + const Nef_Polyhedron &nef; +}; - Volume_const_iterator c; +template +void compute_elements(const Nef_Polyhedron &nef, CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) +{ - Nef_Visitor V(*this); - CGAL_forall_volumes(c, nef) - { - Shell_entry_const_iterator it; - CGAL_forall_shells_of(it, c) - { - nef.visit_shell_objects(SFace_const_handle(it), V); - } - } + typedef typename Nef_Polyhedron::Volume_const_iterator Volume_const_iterator; + typedef typename Nef_Polyhedron::Shell_entry_const_iterator Shell_entry_const_iterator; + typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; - negate_all_normals(); - } + Volume_const_iterator c; - CGAL::IO::Color run_color(Halffacet_const_handle fh) + Nef_Visitor V(nef, graphic_buffer, m_drawing_functor); + CGAL_forall_volumes(c, nef) { - return m_fcolor.run(nef, fh); + Shell_entry_const_iterator it; + CGAL_forall_shells_of(it, c) + { + nef.visit_shell_objects(SFace_const_handle(it), V); + } } - 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); - } + graphic_buffer.negate_all_normals(); +} -protected: - Local_vector get_face_normal(SHalfedge_const_handle she) - { - SHalfedge_around_facet_const_circulator he(she); - Local_vector normal = CGAL::NULL_VECTOR; - SHalfedge_around_facet_const_circulator end = he; - unsigned int nb = 0; +} // namespace draw_function_for_nef_polyhedron - CGAL_For_all(he, end) - { - internal::newell_single_step_3(this->get_local_point - (he->next()->source()->center_vertex()->point()), - this->get_local_point(he->source()->center_vertex()-> - point()), normal); - ++nb; - } +template +void add_in_graphic_buffer(const Nef_Polyhedron &nef, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { + draw_function_for_nef_polyhedron::compute_elements(nef, graphic_buffer, m_drawing_functor); +} - CGAL_assertion(nb > 0); - return (typename Local_kernel::Construct_scaled_vector_3()(normal, 1.0 / nb)); - } +template +void add_in_graphic_buffer(const Nef_Polyhedron &nef, CGAL::Graphic_buffer &graphic_buffer) { - Local_vector get_vertex_normal(Vertex_const_handle vh) - { - Local_vector normal = CGAL::NULL_VECTOR; + // Default functor; user can add his own functor. + Drawing_functor + drawing_functor; - SHalfedge_const_iterator it = vh->shalfedges_begin(); - SHalfedge_const_handle end = it; - do { - Local_vector n = get_face_normal(it); - normal = typename Local_kernel::Construct_sum_of_vectors_3()(normal, n); - it = it->snext(); - } while( it != end ); + drawing_functor.colored_face = [] (const Nef_Polyhedron&, + typename Nef_Polyhedron::Halffacet_const_handle fh) -> bool + { + return true; + }; - if (!typename Local_kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) - { - normal = (typename Local_kernel::Construct_scaled_vector_3()( - normal, 1.0 / CGAL::sqrt(normal.squared_length()))); - } + drawing_functor.face_color = [] (const Nef_Polyhedron&, + typename Nef_Polyhedron::Halffacet_const_handle fh) -> CGAL::IO::Color + { + if (fh == nullptr) // use to get the mono color + return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 - return normal; - } + CGAL::Random random((unsigned int)(std::size_t)(&(*fh))); + return get_random_color(random); + }; -protected: - const Nef_Polyhedron &nef; - bool m_nofaces; - const ColorFunctor &m_fcolor; -}; + add_in_graphic_buffer(nef, graphic_buffer, drawing_functor); +} #define CGAL_NEF3_TYPE Nef_polyhedron_3 -template +template void draw(const CGAL_NEF3_TYPE &anef, - const char *title = "Nef Polyhedron Viewer", + const DrawingFunctor &drawing_functor, bool nofill = false) { -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite = true; -#else - bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(anef, buffer, drawing_functor); + draw_buffer(buffer); +} - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc = 1; - const char *argv[2] = {"nef_polyhedron_viewer", nullptr}; - QApplication app(argc, const_cast(argv)); - DefaultColorFunctorNefPolyhedron fcolor; - SimpleNefPolyhedronViewerQt - mainwindow(app.activeWindow(), anef, title, nofill, fcolor); - mainwindow.show(); - app.exec(); - } +template +void draw(const CGAL_NEF3_TYPE &anef, + const char *title = "Nef Polyhedron Viewer", + bool nofill = false) { + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(anef, buffer); + draw_buffer(buffer); } } // End namespace CGAL From 2f592577c1ee77c1fd81f807565d9aa2d5e5b2c4 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 7 Oct 2022 19:16:27 +0200 Subject: [PATCH 078/399] Scope changed. --- Nef_3/include/CGAL/draw_nef_3.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index f211ecc380f4..1c4e2ac1eb95 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -31,12 +31,12 @@ namespace CGAL { -typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; -typedef Local_kernel::Vector_3 Local_vector; - namespace draw_function_for_nef_polyhedron { +typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; +typedef Local_kernel::Vector_3 Local_vector; + template Local_vector get_face_normal(typename Nef_Polyhedron::SHalfedge_const_handle she) { From 455c1d3b75ba866f02db374e3bff897d5684b422 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 7 Oct 2022 19:19:01 +0200 Subject: [PATCH 079/399] Changed to new API version, Compilation error"incomplete type" at get_vertex_normal. --- .../include/CGAL/draw_face_graph_with_paths.h | 542 +++++++++--------- 1 file changed, 284 insertions(+), 258 deletions(-) diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 4187cd5ccc92..0e7a06bc8d22 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -8,12 +8,17 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand +// Mostafa Ashraf // #ifndef CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H #define CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H #include +#include +#include +#include + #include #include #include @@ -27,6 +32,16 @@ namespace CGAL { +namespace draw_function_for_face_graph_with_paths +{ + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; +typedef Local_kernel::Point_3 Local_point; +typedef Local_kernel::Vector_3 Local_vector; + +template +struct LCC_geom_utils; + // Specialisation for face graph; otherwise use the LCC_geom_utils of LCC. template struct LCC_geom_utils, Local_kernel, 3> @@ -84,316 +99,326 @@ struct LCC_geom_utils, Local_kernel, 3> } }; -// Viewer class for Face_graph with paths. -template -class Face_graph_with_path_viewer : public Basic_viewer_qt +// Destructor. +// lcc.free_mark(m_oriented_mark); + + + +template +const typename CGAL::Get_traits::Point& get_point(typename Get_map::type::Dart_const_handle dh, const Mesh &mesh) +{ + typedef typename CGAL::Get_traits::Kernel Kernel; + typedef typename CGAL::Get_traits::Point Point; + typedef typename CGAL::Get_traits::Vector Vector; + + return CGAL::Get_traits::get_point(mesh, dh); + +} + +template +void compute_face(typename Get_map::type::Dart_const_handle dh, + const Mesh &mesh, + CGAL::Graphic_buffer &graphic_buffer, + const typename Get_map::storage_type& lcc) { - typedef Basic_viewer_qt Base; typedef typename Get_map::type LCC; - typedef typename LCC::Dart_const_handle Dart_const_handle; + typedef typename LCC::size_type size_type; + + typedef typename LCC::Dart_const_handle Dart_const_handle; typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::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) - Face_graph_with_path_viewer(QWidget* parent, - const Mesh& amesh, - const std::vector - > - *paths=nullptr, - size_type amark=LCC::INVALID_MARK, - const char* title="", bool anofaces=false, - const DrawingFunctorLCC& - drawing_functor=DrawingFunctorLCC()) : - Base(parent, title, true, true, true, false, true), - mesh(amesh), - lcc(amesh), - m_oriented_mark(lcc.get_new_mark()), - m_nofaces(anofaces), - m_drawing_functor(drawing_functor), - m_paths(paths), - m_current_path(m_paths->size()), - m_current_dart(lcc.darts().end()), - m_draw_marked_darts(true), - m_amark(amark==(std::numeric_limits::max)()? - LCC::INVALID_MARK:amark) + // We fill only closed faces. + Dart_const_handle cur=dh; + Dart_const_handle min=dh; + do { - lcc.orient(m_oriented_mark); - compute_elements(); + 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); -protected: + graphic_buffer.face_end(); +} - const Point& get_point(Dart_const_handle dh) const - { return CGAL::Get_traits::get_point(mesh, dh); } - void compute_elements() - { - clear(); + // typename LCC::size_type m_amark; // If !=INVALID_MARK, show darts marked with this mark - 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(); - - if (m_current_dart!=lcc.darts().end()) - { // We want to draw only one dart - Dart_const_handle selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); - compute_edge(selected_dart, CGAL::IO::Color(255,0,0)); - lcc.template mark_cell<1>(selected_dart, markedges); - compute_vertex(selected_dart); +template +void compute_edge(typename Get_map::type::Dart_const_handle dh, + const Mesh &mesh, + CGAL::Graphic_buffer &graphic_buffer, + const typename Get_map::storage_type& lcc, + typename Get_map::type::size_type m_amark, + bool m_draw_marked_darts = true) +{ + typedef typename Get_map::type LCC; + typedef typename LCC::size_type size_type; - if ( !m_nofaces ) - { compute_face(selected_dart); } + typedef typename LCC::Dart_const_handle Dart_const_handle; + typedef typename CGAL::Get_traits::Kernel Kernel; + typedef typename CGAL::Get_traits::Point Point; + typedef typename CGAL::Get_traits::Vector Vector; - for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), - itend=lcc.darts().end(); it!=itend; ++it ) - { - if ( !lcc.is_marked(it, markedges) ) - { - compute_edge(it); - lcc.template mark_cell<1>(it, markedges); - } - } - } + Point p1 = get_point(dh, mesh); + Dart_const_handle d2 = lcc.other_extremity(dh); + if (d2!=LCC::null_handle) + { + if (m_draw_marked_darts && m_amark!=LCC::INVALID_MARK && + (lcc.is_marked(dh, m_amark) || lcc.is_marked(lcc.opposite2(dh), m_amark))) + { graphic_buffer.add_segment(p1, get_point(d2, mesh), CGAL::IO::Color(0, 0, 255)); } else - { - if (m_current_path==m_paths->size()) - { - for (std::size_t i=0; isize(); ++i) - { compute_path(i, markedges); } - } - else if (m_current_path!=m_paths->size()+1) - { compute_path(m_current_path, markedges); } + { graphic_buffer.add_segment(p1, get_point(d2, mesh)); } + } +} - 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) && - !lcc.is_perforated(it) && lcc.is_marked(it, m_oriented_mark)) - { - compute_face(it); - lcc.template mark_cell<2>(it, markfaces); - } - - if ( !lcc.is_marked(it, markedges) ) - { - compute_edge(it); - lcc.template mark_cell<1>(it, markedges); - } - - if ( !lcc.is_marked(it, markvertices) ) - { - compute_vertex(it); - lcc.template mark_cell<0>(it, markvertices); - } - } - } +template +void compute_edge(typename Get_map::type::Dart_const_handle dh, + const CGAL::IO::Color& color, + const Mesh &mesh, + CGAL::Graphic_buffer &graphic_buffer, + const typename Get_map::storage_type& lcc) +{ + typedef typename Get_map::type LCC; + typedef typename LCC::Dart_const_handle Dart_const_handle; + typedef typename CGAL::Get_traits::Kernel Kernel; + typedef typename CGAL::Get_traits::Point Point; + typedef typename CGAL::Get_traits::Vector Vector; - lcc.free_mark(markfaces); - lcc.free_mark(markedges); - lcc.free_mark(markvertices); - } + Point p1 = get_point(dh, mesh); + Dart_const_handle d2 = lcc.other_extremity(dh); + if (d2!=LCC::null_handle) + { graphic_buffer.add_segment(p1, get_point(d2, mesh), color); } +} - 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 +void compute_vertex(typename Get_map::type::Dart_const_handle dh, + const Mesh &mesh, + CGAL::Graphic_buffer &graphic_buffer) +{ + typedef typename CGAL::Get_traits::Kernel Kernel; + typedef typename CGAL::Get_traits::Point Point; + typedef typename CGAL::Get_traits::Vector Vector; + graphic_buffer.add_point(get_point(dh, mesh)); +} - // CGAL::IO::Color c=m_fcolor.run(*lcc, dh); - face_begin(); //c); +template +void compute_path(std::size_t i, + typename Get_map::type::size_type amark, + const Mesh &mesh, + CGAL::Graphic_buffer &graphic_buffer, + const std::vector>* m_paths, + const typename Get_map::storage_type& lcc) +{ - cur=dh; - do - { - add_point_in_face(get_point(cur), - LCC_geom_utils:: - get_vertex_normal(lcc, cur)); - cur=lcc.next(cur); - } - while(cur!=dh); + typedef typename CGAL::Get_traits::Kernel Kernel; + typedef typename CGAL::Get_traits::Point Point; + typedef typename CGAL::Get_traits::Vector Vector; - face_end(); - } + if ((*m_paths)[i].is_empty()) + { return; } + + CGAL::Random random(static_cast(i)); + CGAL::IO::Color color = get_random_color(random); - void compute_edge(Dart_const_handle dh) + graphic_buffer.add_point(get_point((*m_paths)[i].get_ith_dart(0), mesh), color); + for (std::size_t j=0; j<(*m_paths)[i].length(); ++j) { - Point p1 = get_point(dh); - Dart_const_handle d2 = lcc.other_extremity(dh); - if (d2!=LCC::null_handle) + if ( !lcc.is_marked( (*m_paths)[i].get_ith_dart(j), amark) ) { - if (m_draw_marked_darts && m_amark!=LCC::INVALID_MARK && - (lcc.is_marked(dh, m_amark) || lcc.is_marked(lcc.opposite2(dh), m_amark))) - { add_segment(p1, get_point(d2), CGAL::IO::Color(0, 0, 255)); } - else - { add_segment(p1, get_point(d2)); } + compute_edge((*m_paths)[i].get_ith_dart(j), color, mesh, graphic_buffer, lcc); + lcc.template mark_cell<1>((*m_paths)[i].get_ith_dart(j), amark); } } +} - void compute_edge(Dart_const_handle dh, const CGAL::IO::Color& color) - { - Point p1 = get_point(dh); - Dart_const_handle d2 = lcc.other_extremity(dh); - if (d2!=LCC::null_handle) - { add_segment(p1, get_point(d2), color); } - } +template +void compute_elements(const Mesh &mesh, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor, + // TODO: I think I need to use smart pointers with lcc, right? + const typename Get_map::storage_type& lcc, + const std::vector>* m_paths, + typename Get_map::type::size_type amark /*= typename Get_map::type::INVALID_MARK*/, + bool m_nofaces = false, + bool m_draw_marked_darts = true) +{ + typedef typename Get_map::type LCC; + typedef typename LCC::size_type size_type; - void compute_vertex(Dart_const_handle dh) - { add_point(get_point(dh)); } + typedef typename CGAL::Get_traits::Kernel Kernel; + typedef typename CGAL::Get_traits::Point Point; + typedef typename CGAL::Get_traits::Vector Vector; - virtual void init() - { - Base::init(); - setKeyDescription(::Qt::Key_D, "Increase current dart drawing"); - setKeyDescription(::Qt::ControlModifier, ::Qt::Key_D, "Decrease current dart drawing"); - setKeyDescription(::Qt::ShiftModifier, ::Qt::Key_D, "Draw all darts"); + typedef typename LCC::Dart_const_handle Dart_const_handle; - setKeyDescription(::Qt::Key_X, "Toggles marked darts display"); + typename LCC::Dart_range::const_iterator m_current_dart = lcc.darts().end(); + typename LCC::size_type m_oriented_mark = lcc.get_new_mark(); + std::size_t m_current_path = m_paths->size(); + typename LCC::size_type m_amark = amark==(std::numeric_limits::max)()? + LCC::INVALID_MARK:amark; // If !=INVALID_MARK, show darts marked with this mark - setKeyDescription(::Qt::Key_P, "Increase current path drawing"); - setKeyDescription(::Qt::ControlModifier, ::Qt::Key_P, "Decrease current path drawing"); - setKeyDescription(::Qt::ShiftModifier, ::Qt::Key_P, "Draw all paths"); - } + lcc.orient(m_oriented_mark); - virtual void keyPressEvent(QKeyEvent *e) - { - const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - if ((e->key()==::Qt::Key_D) && (modifiers==::Qt::NoButton)) - { - if (m_current_dart==lcc.darts().end()) - { m_current_dart=lcc.darts().begin(); } - else - { ++m_current_dart; } - if (m_current_dart==lcc.darts().end()) - { displayMessage(QString("Draw all darts.")); } - else - { displayMessage(QString("Draw dart=%1.").arg(lcc.darts().index(m_current_dart))); } - compute_elements(); - redraw(); - } - else if ((e->key()==::Qt::Key_D) && (modifiers==::Qt::ControlModifier)) - { - if (m_current_dart==lcc.darts().begin()) - { m_current_dart=lcc.darts().end(); } - else - { --m_current_dart; } - if (m_current_dart==lcc.darts().end()) - { displayMessage(QString("Draw all darts.")); } - else - { displayMessage(QString("Draw dart=%1.").arg(lcc.darts().index(m_current_dart))); } - compute_elements(); - redraw(); - } - else if ((e->key()==::Qt::Key_D) && (modifiers==::Qt::ShiftModifier)) - { - m_current_dart=lcc.darts().end(); - displayMessage(QString("Draw all darts.")); - compute_elements(); - redraw(); - } - else if ((e->key()==::Qt::Key_P) && (modifiers==::Qt::NoButton)) - { - m_current_path=(m_current_path+1)%(m_paths->size()+2); - if (m_current_path==m_paths->size()) - { displayMessage(QString("Draw all paths.")); } - else if (m_current_path==m_paths->size()+1) - { displayMessage(QString("Do not draw paths.")); } - else - { displayMessage(QString("Draw path=%1, nb_darts=%2."). - arg(m_current_path). - arg((*m_paths)[m_current_path].length())); } - compute_elements(); - redraw(); - } - else if ((e->key()==::Qt::Key_P) && (modifiers==::Qt::ControlModifier)) + 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(); + + if (m_current_dart!=lcc.darts().end()) + { // We want to draw only one dart + Dart_const_handle selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); + compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphic_buffer, lcc); + lcc.template mark_cell<1>(selected_dart, markedges); + compute_vertex(selected_dart, mesh, graphic_buffer); + + if ( !m_nofaces ) + { compute_face(selected_dart, mesh, graphic_buffer, lcc); } + + for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), + itend=lcc.darts().end(); it!=itend; ++it ) { - m_current_path=(m_current_path==0?m_paths->size()+1:m_current_path-1); - if (m_current_path==m_paths->size()) - { displayMessage(QString("Draw all paths.")); } - else if (m_current_path==m_paths->size()+1) - { displayMessage(QString("Do not draw paths.")); } - else - { displayMessage(QString("Draw path=%1, nb_darts=%2."). - arg(m_current_path). - arg((*m_paths)[m_current_path].length())); } - compute_elements(); - redraw(); + if ( !lcc.is_marked(it, markedges) ) + { + compute_edge(it, mesh, graphic_buffer, lcc, m_amark, m_draw_marked_darts); + lcc.template mark_cell<1>(it, markedges); + } } - else if ((e->key()==::Qt::Key_P) && (modifiers==::Qt::ShiftModifier)) + } + else + { + if (m_current_path==m_paths->size()) { - m_current_path=m_paths->size(); - displayMessage(QString("Draw all paths.")); - compute_elements(); - redraw(); + for (std::size_t i=0; isize(); ++i) + { compute_path(i, markedges, mesh, graphic_buffer, m_paths, lcc); } } - else if ((e->key()==::Qt::Key_X) && (modifiers==::Qt::NoButton)) - { - m_draw_marked_darts=!m_draw_marked_darts; + else if (m_current_path!=m_paths->size()+1) + { compute_path(m_current_path, markedges, mesh, graphic_buffer, m_paths, lcc); } - if (m_draw_marked_darts) - { displayMessage(QString("Draw marked darts in blue.")); } - else + 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) && + !lcc.is_perforated(it) && lcc.is_marked(it, m_oriented_mark)) { - displayMessage(QString("Do not draw marked darts in different color.")); + compute_face(it, mesh, graphic_buffer, lcc); + lcc.template mark_cell<2>(it, markfaces); } - compute_elements(); - redraw(); - } - else - { Base::keyPressEvent(e); } - } - void compute_path(std::size_t i, typename LCC::size_type amark) - { - if ((*m_paths)[i].is_empty()) - { return; } - - CGAL::Random random(static_cast(i)); - CGAL::IO::Color color=get_random_color(random); + if ( !lcc.is_marked(it, markedges) ) + { + compute_edge(it, mesh, graphic_buffer, lcc, m_amark, m_draw_marked_darts); + lcc.template mark_cell<1>(it, markedges); + } - add_point(get_point((*m_paths)[i].get_ith_dart(0)), color); - for (std::size_t j=0; j<(*m_paths)[i].length(); ++j) - { - if ( !lcc.is_marked( (*m_paths)[i].get_ith_dart(j), amark) ) + if ( !lcc.is_marked(it, markvertices) ) { - compute_edge((*m_paths)[i].get_ith_dart(j), color); - lcc.template mark_cell<1>((*m_paths)[i].get_ith_dart(j), amark); + compute_vertex(it, mesh, graphic_buffer); + lcc.template mark_cell<0>(it, markvertices); } } } -protected: - const Mesh& mesh; - const typename Get_map::storage_type lcc; - typename LCC::size_type m_oriented_mark; - bool m_nofaces; - const DrawingFunctorLCC& m_drawing_functor; - const std::vector >* m_paths; - std::size_t m_current_path; - typename LCC::Dart_range::const_iterator m_current_dart; - bool m_draw_marked_darts; - typename LCC::size_type m_amark; // If !=INVALID_MARK, show darts marked with this mark -}; + lcc.free_mark(markfaces); + lcc.free_mark(markedges); + lcc.free_mark(markvertices); +} + +} // namespace draw_function_for_face_graph_with_paths + +template +void add_in_graphic_buffer(const Mesh &mesh, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor, + // TODO: I think I need to use smart pointers with lcc, right? + const typename Get_map::storage_type& lcc, + const std::vector>* m_paths, + typename Get_map::type::size_type amark= /*typename*/ Get_map::type::INVALID_MARK, + bool m_nofaces = false) { + draw_function_for_face_graph_with_paths::compute_elements(mesh, graphic_buffer, m_drawing_functor, lcc, m_paths, amark, m_nofaces); +} + +template +void add_in_graphic_buffer(const Mesh &mesh, + CGAL::Graphic_buffer &graphic_buffer, + // TODO: I think I need to use smart pointers with lcc, right? + const typename Get_map::storage_type& lcc, + const std::vector>* m_paths, + typename Get_map::type::size_type amark= /*typename*/ Get_map::type::INVALID_MARK, + bool m_nofaces = false) { + + // Default functor; user can add his own functor. + Drawing_functor + drawing_functor; + + add_in_graphic_buffer(mesh, graphic_buffer, drawing_functor, lcc, m_paths, amark, m_nofaces); +} + + +template +void draw(const Mesh& alcc, + const std::vector >& paths, + typename Get_map::type::size_type amark= + (std::numeric_limits::type::size_type>::max)(), + const char* title="Mesh Viewer With Path", + bool nofill=false) { + + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(alcc, buffer, alcc, &paths, amark, nofill); + draw_buffer(buffer); +} + + +template +void draw(const Mesh& alcc, + const std::vector >& paths, + const DrawingFunctor& drawing_functor, + typename Get_map::type::size_type amark= + (std::numeric_limits::type::size_type>::max)(), + const char* title="Mesh Viewer With Path", + bool nofill=false) { + + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(alcc, buffer, drawing_functor, alcc, &paths, amark, nofill); + draw_buffer(buffer); +} + + +template +void draw(const Mesh& alcc, + std::initializer_list> l, + typename Get_map::type::size_type amark= + (std::numeric_limits::type::size_type>::max)(), + const char* title="Mesh Viewer With Path", + bool nofill=false) +{ + std::vector> paths=l; + + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(alcc, buffer, alcc, &paths, amark, nofill); + draw_buffer(buffer); +} +/* template void draw(const Mesh& alcc, const std::vector >& paths, @@ -447,6 +472,7 @@ void draw(const Mesh& alcc, std::vector > paths=l; draw(alcc, paths, title, amark, nofill); } +*/ } // End namespace CGAL From 9033e598ca81cf1f8973b4f3294d1b955478d031 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 7 Oct 2022 20:45:01 +0200 Subject: [PATCH 080/399] correct some errors --- .../Surface_mesh_topology/draw_facewidth.h | 2 +- .../include/CGAL/draw_face_graph_with_paths.h | 35 +++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index c23906f10b32..d08955e2622b 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -8,7 +8,7 @@ #include template -struct Facewidth_draw_functor : public CGAL::DefaultDrawingFunctorLCC +struct Facewidth_draw_functor //: public CGAL::DefaultDrawingFunctorLCC { Facewidth_draw_functor(typename ALCC::size_type amark1, typename ALCC::size_type amark2) : m_vertex_mark(amark1), m_face_mark(amark2) diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 0e7a06bc8d22..e448968ec622 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -32,15 +32,13 @@ namespace CGAL { -namespace draw_function_for_face_graph_with_paths + +namespace draw_function_for_lcc { - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; -typedef Local_kernel::Point_3 Local_point; -typedef Local_kernel::Vector_3 Local_vector; - -template -struct LCC_geom_utils; + // We need to re-use the namespace draw_function_for_lcc because we want to specialize + // the previous struct LCC_geom_utils +// template +// struct LCC_geom_utils; // Specialisation for face graph; otherwise use the LCC_geom_utils of LCC. template @@ -88,17 +86,26 @@ struct LCC_geom_utils, Local_kernel, 3> ++nb; } - if ( nb<2 ) return internal::Geom_utils + if ( nb<2 ) return draw_function_for_lcc::LCC_geom_utils ::Kernel, Local_kernel>:: get_local_vector(normal); - return internal::Geom_utils + return draw_function_for_lcc::LCC_geom_utils ::Kernel, Local_kernel>:: get_local_vector(typename Get_traits::Kernel:: Construct_scaled_vector_3()(normal, 1.0/nb)); } }; +} // namespace draw_function_for_lcc + +namespace draw_function_for_face_graph_with_paths +{ + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; +typedef Local_kernel::Point_3 Local_point; +typedef Local_kernel::Vector_3 Local_vector; + // Destructor. // lcc.free_mark(m_oriented_mark); @@ -148,7 +155,7 @@ void compute_face(typename Get_map::type::Dart_const_handle dh, do { graphic_buffer.add_point_in_face(draw_function_for_face_graph_with_paths::get_point(cur, mesh), - LCC_geom_utils:: + draw_function_for_lcc::LCC_geom_utils:: get_vertex_normal(lcc, cur)); cur=lcc.next(cur); } @@ -365,9 +372,9 @@ void add_in_graphic_buffer(const Mesh &mesh, // Default functor; user can add his own functor. Drawing_functor + typename CGAL::Face_graph_wrapper::Dart_const_handle /*vh*/, + typename CGAL::Face_graph_wrapper::Dart_const_handle /*eh*/, + typename CGAL::Face_graph_wrapper::Dart_const_handle /*fh*/> drawing_functor; add_in_graphic_buffer(mesh, graphic_buffer, drawing_functor, lcc, m_paths, amark, m_nofaces); From 7e1e6d52668d05ae54a2cde3ae871154b8f19b86 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 8 Oct 2022 12:33:24 +0200 Subject: [PATCH 081/399] Added custom drawing functor for Voronoi diagram. --- .../include/CGAL/draw_voronoi_diagram_2.h | 117 +++++++++++++----- 1 file changed, 83 insertions(+), 34 deletions(-) diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index a16714badaf2..638eed475281 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -34,25 +34,73 @@ namespace CGAL { namespace draw_function_for_v2 { +template +struct Drawing_functor_voronoi : + public CGAL::Drawing_functor +{ + Drawing_functor_voronoi() : m_draw_rays(true), + m_draw_voronoi_vertices(true), + m_draw_dual_vertices(true), + m_nofaces(false) + { + + draw_voronoi_vertices=[](const DS &, vertex_handle)->bool { return true; }; + draw_dual_vertices=[](const DS &, vertex_handle)->bool { return true; }; + draw_rays=[](const DS &, vertex_handle)->bool { return true; }; + + } + + std::function draw_voronoi_vertices; + std::function draw_dual_vertices; + std::function draw_rays; + + + void disable_voronoi_vertices() { m_draw_voronoi_vertices=false; } + void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; } + bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; } + + void disable_dual_vertices() { m_draw_dual_vertices=false; } + void enable_dual_vertices() { m_draw_dual_vertices=true; } + bool are_dual_vertices_enabled() const { return m_draw_dual_vertices; } + + void disable_rays() { m_draw_rays=false; } + void enable_rays() { m_draw_rays=true; } + bool are_rays_enabled() const { return m_draw_rays; } + + + void disable_nofaces() { m_nofaces=false; } + void enable_nofaces() { m_nofaces=true; } + bool are_nofaces_enabled() const { return m_nofaces; } + +protected: + bool m_draw_rays; + bool m_draw_voronoi_vertices; + bool m_draw_dual_vertices; + bool m_nofaces; +}; + typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; template -void compute_vertex(typename V2::Vertex_iterator vh, CGAL::Graphic_buffer &graphic_buffer) { - +void compute_vertex(typename V2::Vertex_iterator vh, + CGAL::Graphic_buffer &graphic_buffer) { graphic_buffer.add_point(vh->point()); - } template -void compute_dual_vertex(typename V2::Delaunay_graph::Finite_vertices_iterator vi, CGAL::Graphic_buffer &graphic_buffer) -{ +void compute_dual_vertex(typename V2::Delaunay_graph::Finite_vertices_iterator vi, + CGAL::Graphic_buffer &graphic_buffer) { graphic_buffer.add_point(vi->point(), CGAL::IO::Color(50, 100, 180)); } template -void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, CGAL::Graphic_buffer &graphic_buffer) +void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, + CGAL::Graphic_buffer &graphic_buffer) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; @@ -103,7 +151,8 @@ void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, CGAL: } template -Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, const CGAL::Bbox_3 & m_bounding_box) +Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, + const CGAL::Bbox_3 & m_bounding_box) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; @@ -166,7 +215,8 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, const C // Halfedge_const_handle template -void compute_rays_and_bisectors(typename V2::Halfedge_iterator he, CGAL::Graphic_buffer &graphic_buffer) +void compute_rays_and_bisectors(typename V2::Halfedge_iterator he, + CGAL::Graphic_buffer &graphic_buffer) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; @@ -189,7 +239,10 @@ void compute_rays_and_bisectors(typename V2::Halfedge_iterator he, CGAL::Graphic } template -void compute_face(typename V2::Face_iterator fh, const V2& v2, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) +void compute_face(typename V2::Face_iterator fh, + const V2& v2, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { typedef typename V2::Ccb_halfedge_circulator Ccb_halfedge_circulator; @@ -224,12 +277,12 @@ void compute_face(typename V2::Face_iterator fh, const V2& v2, CGAL::Graphic_buf template void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor , bool m_nofaces = false, bool m_draw_voronoi_vertices = true, bool m_draw_dual_vertices = true) + const DrawingFunctor &m_drawing_functor) { typedef typename V2::Delaunay_graph::Finite_vertices_iterator Dual_vertices_iterator; // Draw the voronoi vertices - if (m_draw_voronoi_vertices) { + if (m_drawing_functor.are_voronoi_vertices_enabled()) { for (typename V2::Vertex_iterator it = v2.vertices_begin(); it != v2.vertices_end(); ++it) { compute_vertex(it, graphic_buffer); @@ -237,7 +290,7 @@ void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_bu } // Draw the dual vertices - if (m_draw_dual_vertices) { + if (m_drawing_functor.are_dual_vertices_enabled()) { for (Dual_vertices_iterator it = v2.dual().finite_vertices_begin(); it != v2.dual().finite_vertices_end(); ++it) { compute_dual_vertex(it, graphic_buffer); @@ -250,12 +303,14 @@ void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_bu add_segments_and_update_bounding_box(it, graphic_buffer); } - for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); - it != v2.halfedges_end(); ++it) { - compute_rays_and_bisectors(it, graphic_buffer); + if(m_drawing_functor.are_rays_enabled()) { + for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); + it != v2.halfedges_end(); ++it) { + compute_rays_and_bisectors(it, graphic_buffer); + } } - if (!m_nofaces) { + if (!m_drawing_functor.are_nofaces_enabled()) { for (typename V2::Face_iterator it = v2.faces_begin(); it != v2.faces_end(); ++it) { compute_face(it, v2, graphic_buffer, m_drawing_functor); @@ -267,9 +322,9 @@ void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_bu template void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor, bool m_nofaces = false, - bool m_draw_voronoi_vertices = true, bool m_draw_dual_vertices = true ) { - draw_function_for_v2::compute_elements(v2, graphic_buffer, m_drawing_functor, m_nofaces, m_draw_voronoi_vertices, m_draw_dual_vertices); + const DrawingFunctor &m_drawing_functor) +{ + draw_function_for_v2::compute_elements(v2, graphic_buffer, m_drawing_functor); } template @@ -278,10 +333,10 @@ void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graph bool m_draw_dual_vertices = true ) { // Default functor; user can add his own functor. - Drawing_functor - drawing_functor; + CGAL::draw_function_for_v2::Drawing_functor_voronoi + drawing_functor; drawing_functor.colored_face = [](const V2&, typename V2::Face_iterator fh) -> bool @@ -294,7 +349,7 @@ void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graph return CGAL::IO::Color(73, 250, 117); }; - add_in_graphic_buffer(v2, graphic_buffer, drawing_functor, m_nofaces, m_draw_voronoi_vertices, m_draw_dual_vertices); + add_in_graphic_buffer(v2, graphic_buffer, drawing_functor); } // Specialization of draw function. @@ -304,13 +359,10 @@ template void draw(const CGAL_VORONOI_TYPE &av2, - const DrawingFunctor &drawing_functor, - bool nofill = false, - bool draw_voronoi_vertices = true, - bool draw_dual_vertices = true) + const DrawingFunctor &drawing_functor) { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(av2, buffer, drawing_functor, nofill, draw_voronoi_vertices, draw_dual_vertices); + add_in_graphic_buffer(av2, buffer, drawing_functor); draw_buffer(buffer); } @@ -318,13 +370,10 @@ template void draw(const CGAL_VORONOI_TYPE &av2, - const char *title="2D Voronoi Diagram Basic Viewer", - bool nofill = false, - bool draw_voronoi_vertices = true, - bool draw_dual_vertices = true) + const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(av2, buffer, nofill, draw_voronoi_vertices, draw_dual_vertices); + add_in_graphic_buffer(av2, buffer); draw_buffer(buffer); } From 0e2586f83dbc14fa11fcf9f27defb0640af79cbe Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 8 Oct 2022 12:34:46 +0200 Subject: [PATCH 082/399] Added template arg. --- GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 728d1ed7bc1b..205f08149d00 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -1740,7 +1740,7 @@ void draw_buffer(Graphic_buffer &graphic_buffer) { const char *argv[2] = {"lccviewer", nullptr}; QApplication app(argc, const_cast(argv)); - Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); + Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); basic_viewer.show(); app.exec(); From a00f1c490ec7deb1b08940c12b2351b1a53f647e Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 8 Oct 2022 14:58:27 +0200 Subject: [PATCH 083/399] Migrated to new viewer APIs version, SM small faces. --- .../draw_surface_mesh_small_faces.h | 397 ++++++++---------- 1 file changed, 186 insertions(+), 211 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 b8eeac5b008e..079b96fa8331 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 @@ -8,10 +8,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H #define CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H +#include +#include #include #include @@ -22,266 +25,238 @@ #include -template -class SimpleSurfaceMeshWithSmallFacesViewerQt : public CGAL::Basic_viewer_qt +namespace draw_function_for_surface_mesh { - typedef CGAL::Basic_viewer_qt Base; +template +typename CGAL::Kernel_traits::Kernel::Vector_3 get_face_normal(typename SM::Halfedge_index he, + const SM &sm) +{ + typedef typename SM::Halfedge_index halfedge_descriptor; 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) + typename Kernel::Vector_3 normal=CGAL::NULL_VECTOR; + + halfedge_descriptor end=he; + unsigned int nb=0; + do { - // 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"); + 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)); +} + +template +typename CGAL::Kernel_traits::Kernel::Vector_3 get_vertex_normal(typename SM::Halfedge_index he, + const SM &sm) +{ + typedef typename SM::Point Point; + typedef typename CGAL::Kernel_traits::Kernel Kernel; + typedef typename SM::Halfedge_index halfedge_descriptor; - if (sm.faces().begin()!=sm.faces().end()) + typename Kernel::Vector_3 normal=CGAL::NULL_VECTOR; + + halfedge_descriptor end=he; + do + { + if (!sm.is_border(he)) { - bool exist; - typename SM::template Property_map faces_size; - boost::tie(faces_size, exist)=sm.template property_map("f:size"); - assert(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; - } + typename Kernel::Vector_3 n=get_face_normal(he, sm); + normal=typename Kernel::Construct_sum_of_vectors_3()(normal, n); } - - compute_elements(); + he=sm.next(sm.opposite(he)); } + while (he!=end); -protected: - void compute_face(face_descriptor fh) - { - // [Face creation] - bool issmall=false; + if (!typename Kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) + { normal=(typename Kernel::Construct_scaled_vector_3() + (normal, 1.0/CGAL::sqrt(normal.squared_length()))); } - // Default color of faces - CGAL::IO::Color c(75,160,255); + return normal; +} - // 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"); - assert(exist); +template +void compute_face(typename SM::Face_index fh, + const SM &sm, + CGAL::Graphic_buffer &graphic_buffer, + typename CGAL::Kernel_traits::Kernel::FT & m_min_size, + typename CGAL::Kernel_traits::Kernel::FT & m_max_size) +{ - // It it is smaller, color the face in red. - if (get(faces_size, fh)::Kernel Kernel; + typedef typename SM::Face_index face_descriptor; + typedef typename SM::Halfedge_index halfedge_descriptor; + typedef typename Kernel::FT FT; - if ((issmall && !m_draw_small_faces) || (!issmall && !m_draw_big_faces)) - { return; } + // TODO: add custom functor, right? + bool m_draw_small_faces = true; + bool m_draw_big_faces = true; - // Add the color of the face, then all its points. - face_begin(c); - halfedge_descriptor hd=sm.halfedge(fh); - do - { - add_point_in_face(sm.point(sm.source(hd)), get_vertex_normal(hd)); - hd=sm.next(hd); - } - while(hd!=sm.halfedge(fh)); - face_end(); - /// [Face creation] - } + unsigned int m_threshold = 85; + + // [Face creation] + bool issmall=false; - // Copy from draw_surface_mesh.h - void compute_edge(edge_descriptor e) + // Default color of faces + CGAL::IO::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"); + assert(exist); + + // It it is smaller, color the face in red. + if (get(faces_size, fh) +void compute_edge(typename SM::Edge_index e, + const SM &sm, + CGAL::Graphic_buffer &graphic_buffer) +{ + /// [Edge creation] + graphic_buffer.add_segment(sm.point(sm.source(sm.halfedge(e))), + sm.point(sm.target(sm.halfedge(e)))); + /// [Edge creation] +} - for (typename SM::Face_range::iterator f=sm.faces().begin(); - f!=sm.faces().end(); ++f) - { - if (*f!=boost::graph_traits::null_face()) - { compute_face(*f); } - } +template +void compute_vertex(typename SM::Vertex_index vh, + const SM &sm, + CGAL::Graphic_buffer &graphic_buffer) +{ + /// [Vertex creation] + graphic_buffer.add_point(sm.point(vh)); + /// [Vertex creation] +} + +template +void compute_elements(const SM &sm, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) +{ - for (typename SM::Edge_range::iterator e=sm.edges().begin(); - e!=sm.edges().end(); ++e) - { compute_edge(*e); } + 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; - for (typename SM::Vertex_range::iterator v=sm.vertices().begin(); - v!=sm.vertices().end(); ++v) - { compute_vertex(*v); } - } + FT m_min_size, m_max_size; - // 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) + if (sm.faces().begin()!=sm.faces().end()) { - /// [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 + bool exist; + typename SM::template Property_map faces_size; + boost::tie(faces_size, exist)=sm.template property_map("f:size"); + assert(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) { - // Call the base method to process others/classicals key - Base::keyPressEvent(e); + cur_size=faces_size[*f]; + if (cur_sizem_max_size) m_max_size=cur_size; } - /// [Keypress] } -protected: - typename Kernel::Vector_3 get_face_normal(halfedge_descriptor he) + for (typename SM::Face_range::iterator f=sm.faces().begin(); + f!=sm.faces().end(); ++f) { - 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)); + if (*f!=boost::graph_traits::null_face()) + { compute_face(*f, sm, graphic_buffer, m_min_size, m_max_size); } } - 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); + for (typename SM::Edge_range::iterator e=sm.edges().begin(); + e!=sm.edges().end(); ++e) + { compute_edge(*e, sm, graphic_buffer); } - if (!typename Kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) - { normal=(typename Kernel::Construct_scaled_vector_3() - (normal, 1.0/CGAL::sqrt(normal.squared_length()))); } + for (typename SM::Vertex_range::iterator v=sm.vertices().begin(); + v!=sm.vertices().end(); ++v) + { compute_vertex(*v, sm, graphic_buffer); } +} - return normal; - } +} // draw_function_for_surface_mesh -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 add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { + draw_function_for_surface_mesh::compute_elements(sm, graphic_buffer, m_drawing_functor); +} -template -void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh) +template +void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer) { + + CGAL::Drawing_functor drawing_functor; + + add_in_graphic_buffer(sm, graphic_buffer, drawing_functor); +} + +template +void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh, + const DrawingFunctor &drawing_functor) { -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(amesh, buffer, drawing_functor); + draw_buffer(buffer); +} - if (!cgal_test_suite) - { - int argc=1; - const char* argv[2]={"surface_mesh_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimpleSurfaceMeshWithSmallFacesViewerQt> - mainwindow(app.activeWindow(), amesh); - mainwindow.show(); - app.exec(); - } +template +void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh) +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(amesh, buffer); + draw_buffer(buffer); } #else // CGAL_USE_BASIC_VIEWER -template +template void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh&) { std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< +void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh&, const DrawingFunctor &drawing_functor) +{ + std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Sun, 9 Oct 2022 01:49:45 +0200 Subject: [PATCH 084/399] Initial commit to adding custom KeyPressEvent. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 41 ++++++++++++- .../include/CGAL/draw_voronoi_diagram_2.h | 58 ++++++++++++++++++- 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 205f08149d00..d4a4550d04b1 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -1357,8 +1357,14 @@ class Basic_viewer_qt : public CGAL::QGLViewer virtual void keyPressEvent(QKeyEvent *e) { + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + if(_onPress) { + _onPress(e, this); + } +else { + if ((e->key()==::Qt::Key_C) && (modifiers==::Qt::NoButton)) { if (!isOpenGL_4_3()) return; @@ -1573,6 +1579,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer } else CGAL::QGLViewer::keyPressEvent(e); +} } virtual QString helpString() const @@ -1609,7 +1616,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer text += "Press Escape to exit the viewer."; return text; } - +public: + // std::function _onPress; + std::function *)> _onPress; protected: Graphic_buffer& gBuffer; @@ -1747,6 +1756,36 @@ void draw_buffer(Graphic_buffer &graphic_buffer) { } } + +template +void draw_buffer(Graphic_buffer &graphic_buffer,const std::function *)>& onPress) { + +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite = true; +#else + bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) { + CGAL::Qt::init_ogl_context(4, 3); + // Qt::init_ogl_context(4, 3); + + int argc = 1; + const char *argv[2] = {"lccviewer", nullptr}; + QApplication app(argc, const_cast(argv)); + + Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); + + basic_viewer._onPress = onPress; + + basic_viewer.show(); + app.exec(); + } +} + + + + } // End namespace CGAL #else // CGAL_USE_BASIC_VIEWER diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 638eed475281..4d79dc8362d7 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -352,6 +352,58 @@ void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graph add_in_graphic_buffer(v2, graphic_buffer, drawing_functor); } +// TODO: I'll add a description after idea verification +// Add custom key description (see keyPressEvent) +// setKeyDescription(::Qt::Key_R, "Toggles rays display"); +// setKeyDescription(::Qt::Key_D, "Toggles dual vertices display"); +// setKeyDescription(::Qt::Key_V, "Toggles voronoi vertices display"); + + +// TODO: Expected solution, I need to add reference to drawing_functor, OR, pass m_draw_rays, m_draw_voronoi_vertices, m_draw_dual_vertices +std::function *)> VoronoiKeyPressEvent = [] (QKeyEvent *e, CGAL::Basic_viewer_qt *_this) +{ + /// [Keypress] + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) { + // m_draw_rays = !m_draw_rays; + std::cout << "R Pressed\n"; + + _this->displayMessage( + QString("Draw rays=%1."));//.arg(m_draw_rays ? "true" : "false")); + // _this.update(); + } else if ((e->key() == ::Qt::Key_V) && (modifiers == ::Qt::NoButton)) { + + std::cout << "V Pressed\n"; + + // m_draw_voronoi_vertices = !m_draw_voronoi_vertices; + + _this->displayMessage( + QString("Voronoi vertices=%1."));//.arg(m_draw_voronoi_vertices? "true" : "false")); + + // TODO: What are the expected args? I think I need a kind of function wrapper to wrap drawing_functor, mesh, and buffer. + // draw_function_for_v2::compute_elements(); + + // _this->redraw(); + } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { + + std::cout << "D Pressed\n"; + + // m_draw_dual_vertices = !m_draw_dual_vertices; + + _this->displayMessage(QString("Dual vertices=%1.")); + //.arg(m_draw_dual_vertices ? "true" : "false")); + + // TODO: What are the expected args? I think I need a kind of function wrapper to wrap drawing_functor, mesh, and buffer. + // draw_function_for_v2::compute_elements(); + + // _this->redraw(); + } else { + // Call the base method to process others/classicals key + // Base::keyPressEvent(e); + } + /// [Keypress] +}; + // Specialization of draw function. #define CGAL_VORONOI_TYPE CGAL::Voronoi_diagram_2 @@ -374,7 +426,11 @@ void draw(const CGAL_VORONOI_TYPE &av2, { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(av2, buffer); - draw_buffer(buffer); + // draw_buffer(buffer); + + // Test + draw_buffer(buffer, VoronoiKeyPressEvent); + } } // End namespace CGAL From 56eeaa1134c80965935f0e40a7678ed078767d41 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 10 Oct 2022 16:42:29 +0200 Subject: [PATCH 085/399] error correction --- .../include/CGAL/draw_face_graph_with_paths.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index e448968ec622..925755f2d658 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -372,9 +372,9 @@ void add_in_graphic_buffer(const Mesh &mesh, // Default functor; user can add his own functor. Drawing_functor::Dart_const_handle /*vh*/, - typename CGAL::Face_graph_wrapper::Dart_const_handle /*eh*/, - typename CGAL::Face_graph_wrapper::Dart_const_handle /*fh*/> + typename Get_map::type::Dart_const_handle /*vh*/, + typename Get_map::type::Dart_const_handle /*eh*/, + typename Get_map::type::Dart_const_handle /*fh*/> drawing_functor; add_in_graphic_buffer(mesh, graphic_buffer, drawing_functor, lcc, m_paths, amark, m_nofaces); From f1274c637ca915541230e549dd002b400b788a79 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Tue, 11 Oct 2022 18:28:46 +0200 Subject: [PATCH 086/399] Solved custom KeyPressEvent callback. --- .../include/CGAL/Qt/Basic_viewer_qt.h | 17 ++- .../include/CGAL/draw_voronoi_diagram_2.h | 132 ++++++++++++------ 2 files changed, 96 insertions(+), 53 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index d4a4550d04b1..2eb5e9b62dd2 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -378,6 +378,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer return gBuffer.add_point_in_face(kp, p_normal); } + Graphic_buffer& get_graphic_buffer() { + return gBuffer; + } + void face_end() { if (gBuffer.get_buffer_for_mono_faces().is_a_face_started()) @@ -1361,9 +1365,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if(_onPress) { - _onPress(e, this); - } -else { + bool is_pressed = _onPress(e, this); + if(!is_pressed) { if ((e->key()==::Qt::Key_C) && (modifiers==::Qt::NoButton)) { @@ -1579,9 +1582,9 @@ else { } else CGAL::QGLViewer::keyPressEvent(e); -} } - + } + } virtual QString helpString() const { return helpString("CGAL Basic Viewer"); } @@ -1618,7 +1621,7 @@ else { } public: // std::function _onPress; - std::function *)> _onPress; + std::function *)> _onPress; protected: Graphic_buffer& gBuffer; @@ -1758,7 +1761,7 @@ void draw_buffer(Graphic_buffer &graphic_buffer) { template -void draw_buffer(Graphic_buffer &graphic_buffer,const std::function *)>& onPress) { +void draw_buffer(Graphic_buffer &graphic_buffer,const std::function *)>& onPress) { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 4d79dc8362d7..640a75b86c3e 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -359,50 +359,7 @@ void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graph // setKeyDescription(::Qt::Key_V, "Toggles voronoi vertices display"); -// TODO: Expected solution, I need to add reference to drawing_functor, OR, pass m_draw_rays, m_draw_voronoi_vertices, m_draw_dual_vertices -std::function *)> VoronoiKeyPressEvent = [] (QKeyEvent *e, CGAL::Basic_viewer_qt *_this) -{ - /// [Keypress] - const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) { - // m_draw_rays = !m_draw_rays; - std::cout << "R Pressed\n"; - - _this->displayMessage( - QString("Draw rays=%1."));//.arg(m_draw_rays ? "true" : "false")); - // _this.update(); - } else if ((e->key() == ::Qt::Key_V) && (modifiers == ::Qt::NoButton)) { - - std::cout << "V Pressed\n"; - - // m_draw_voronoi_vertices = !m_draw_voronoi_vertices; - - _this->displayMessage( - QString("Voronoi vertices=%1."));//.arg(m_draw_voronoi_vertices? "true" : "false")); - - // TODO: What are the expected args? I think I need a kind of function wrapper to wrap drawing_functor, mesh, and buffer. - // draw_function_for_v2::compute_elements(); - // _this->redraw(); - } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { - - std::cout << "D Pressed\n"; - - // m_draw_dual_vertices = !m_draw_dual_vertices; - - _this->displayMessage(QString("Dual vertices=%1.")); - //.arg(m_draw_dual_vertices ? "true" : "false")); - - // TODO: What are the expected args? I think I need a kind of function wrapper to wrap drawing_functor, mesh, and buffer. - // draw_function_for_v2::compute_elements(); - - // _this->redraw(); - } else { - // Call the base method to process others/classicals key - // Base::keyPressEvent(e); - } - /// [Keypress] -}; // Specialization of draw function. #define CGAL_VORONOI_TYPE CGAL::Voronoi_diagram_2 @@ -425,10 +382,93 @@ void draw(const CGAL_VORONOI_TYPE &av2, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(av2, buffer); - // draw_buffer(buffer); - // Test + CGAL::draw_function_for_v2::Drawing_functor_voronoi + drawing_functor; + + drawing_functor.colored_face = [](const CGAL_VORONOI_TYPE&, + typename CGAL_VORONOI_TYPE::Face_iterator fh) -> bool + { return true; }; + + + drawing_functor.face_color = [] (const CGAL_VORONOI_TYPE& alcc, + typename CGAL_VORONOI_TYPE::Face_iterator fh) -> CGAL::IO::Color + { + return CGAL::IO::Color(73, 250, 117); + }; + + add_in_graphic_buffer(av2, buffer, drawing_functor); + + std::function *)> VoronoiKeyPressEvent = + [&av2, &drawing_functor] (QKeyEvent *e, CGAL::Basic_viewer_qt *_this) -> bool + { + /// [Keypress] + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) { + + // This is like m_draw_rays = !m_draw_rays; + if(drawing_functor.are_rays_enabled()) + { + drawing_functor.disable_rays(); + } + else { + drawing_functor.enable_rays(); + } + + std::cout << "R Pressed\n"; + + _this->displayMessage( + QString("Draw rays=%1.").arg(drawing_functor.are_rays_enabled() ? "true" : "false")); + _this->update(); + + } else if ((e->key() == ::Qt::Key_V) && (modifiers == ::Qt::NoButton)) { + + std::cout << "V Pressed\n"; + + // This is like m_draw_voronoi_vertices = !m_draw_voronoi_vertices; + if(drawing_functor.are_voronoi_vertices_enabled()) + { + drawing_functor.disable_voronoi_vertices(); + } + else { + drawing_functor.enable_voronoi_vertices(); + } + + _this->displayMessage( + QString("Voronoi vertices=%1.").arg(drawing_functor.are_voronoi_vertices_enabled()? "true" : "false")); + + draw_function_for_v2::compute_elements(av2, _this->get_graphic_buffer(), drawing_functor); + + _this->redraw(); + } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { + + std::cout << "D Pressed\n"; + + // m_draw_dual_vertices = !m_draw_dual_vertices; + if(drawing_functor.are_dual_vertices_enabled()) + { + drawing_functor.disable_dual_vertices(); + } + else { + drawing_functor.enable_dual_vertices(); + } + + _this->displayMessage(QString("Dual vertices=%1.") + .arg(drawing_functor.are_dual_vertices_enabled() ? "true" : "false")); + + draw_function_for_v2::compute_elements(av2, _this->get_graphic_buffer(), drawing_functor); + + _this->redraw(); + } else { + // Return false will call the base method to process others/classicals key + return false; + } + /// [Keypress] + return true; + }; draw_buffer(buffer, VoronoiKeyPressEvent); } From c4a48f5094836b11249fd07e3f9bfb01ca59c990 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 12 Oct 2022 22:07:29 +0200 Subject: [PATCH 087/399] Correction of compilation error for draw_face_graph_with_paths --- .../examples/Surface_mesh_topology/draw_facewidth.h | 2 +- .../include/CGAL/draw_face_graph_with_paths.h | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index d08955e2622b..dd9d2ad0fcbc 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -5,7 +5,7 @@ #ifdef CGAL_USE_BASIC_VIEWER -#include +#include template struct Facewidth_draw_functor //: public CGAL::DefaultDrawingFunctorLCC diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 925755f2d658..864a33e89a55 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -86,11 +86,11 @@ struct LCC_geom_utils, Local_kernel, 3> ++nb; } - if ( nb<2 ) return draw_function_for_lcc::LCC_geom_utils + if ( nb<2 ) return internal::Geom_utils ::Kernel, Local_kernel>:: get_local_vector(normal); - return draw_function_for_lcc::LCC_geom_utils + return internal::Geom_utils ::Kernel, Local_kernel>:: get_local_vector(typename Get_traits::Kernel:: Construct_scaled_vector_3()(normal, 1.0/nb)); @@ -119,7 +119,6 @@ const typename CGAL::Get_traits::Point& get_point(typename Get_map::Vector Vector; return CGAL::Get_traits::get_point(mesh, dh); - } template @@ -259,7 +258,6 @@ template void compute_elements(const Mesh &mesh, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor, - // TODO: I think I need to use smart pointers with lcc, right? const typename Get_map::storage_type& lcc, const std::vector>* m_paths, typename Get_map::type::size_type amark /*= typename Get_map::type::INVALID_MARK*/, @@ -411,7 +409,7 @@ void draw(const Mesh& alcc, template -void draw(const Mesh& alcc, +void draw(const Mesh& mesh, std::initializer_list> l, typename Get_map::type::size_type amark= (std::numeric_limits::type::size_type>::max)(), @@ -421,7 +419,8 @@ void draw(const Mesh& alcc, std::vector> paths=l; CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(alcc, buffer, alcc, &paths, amark, nofill); + typename Get_map::storage_type alcc(mesh); + add_in_graphic_buffer(mesh, buffer, alcc, &paths, amark, nofill); draw_buffer(buffer); } From 6e06646825d2f1b93e971e6af214a3673a73d4dd Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 13 Oct 2022 01:12:40 +0200 Subject: [PATCH 088/399] Modified custom functors, uses new APIs. --- .../Surface_mesh_topology/draw_facewidth.h | 45 ++++++++++++++++++- .../unsew_edgewidth_repeatedly.cpp | 44 +++++++++++++++++- 2 files changed, 85 insertions(+), 4 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index dd9d2ad0fcbc..ca773a2fa7ff 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -6,9 +6,10 @@ #ifdef CGAL_USE_BASIC_VIEWER #include +#include template -struct Facewidth_draw_functor //: public CGAL::DefaultDrawingFunctorLCC +struct Facewidth_draw_functor { Facewidth_draw_functor(typename ALCC::size_type amark1, typename ALCC::size_type amark2) : m_vertex_mark(amark1), m_face_mark(amark2) @@ -47,6 +48,46 @@ struct Facewidth_draw_functor //: public CGAL::DefaultDrawingFunctorLCC typename LCC::Dart_const_handle /* dh */) const { return false; } + template + bool draw_volume (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + bool draw_face (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return true; } + + template + bool draw_edge (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return true; } + + template + bool volume_wireframe (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + bool face_wireframe (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + bool draw_vertex (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return true; } + + template + CGAL::IO::Color volume_color(const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const { + return CGAL::IO::Color(20, 10, 30); + } + + bool are_edges_enabled() const { return true; } + bool are_vertices_enabled() const { return true; } + bool are_faces_enabled() const { return true; } + typename ALCC::size_type m_vertex_mark, m_face_mark; }; @@ -68,7 +109,7 @@ void draw_facewidth(const LCC& lcc, } Facewidth_draw_functor df(vertex_mark, face_mark); - CGAL::draw(lcc, "Face width", false, df); + CGAL::draw(lcc, df, "Face width"); lcc.free_mark(vertex_mark); lcc.free_mark(face_mark); diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp index 5c18a4a0ec2a..e631d7e279b2 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp @@ -34,7 +34,7 @@ struct Weight_functor #ifdef CGAL_USE_BASIC_VIEWER -struct Draw_functor : public CGAL::DefaultDrawingFunctorLCC +struct Draw_functor { Draw_functor(LCC_3::size_type am1, LCC_3::size_type am2) : is_root(am1), belong_to_cycle(am2) @@ -71,6 +71,46 @@ struct Draw_functor : public CGAL::DefaultDrawingFunctorLCC bool colored_volume(const LCC& /* alcc */, typename LCC::Dart_const_handle /* dh */) const { return false; } + template + bool draw_volume (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + bool draw_face (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + bool draw_edge (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + bool volume_wireframe (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + bool face_wireframe (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + bool draw_vertex (const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const + { return false; } + + template + CGAL::IO::Color volume_color(const LCC& /* alcc */, + typename LCC::Dart_const_handle /* dh */) const { + return CGAL::IO::Color(10, 20, 20); + } + + bool are_edges_enabled() const { return true; } + bool are_vertices_enabled() const { return true; } + bool are_faces_enabled() const { return true; } + LCC_3::size_type is_root; LCC_3::size_type belong_to_cycle; }; @@ -159,7 +199,7 @@ int main(int argc, char* argv[]) if (draw) { Draw_functor df(is_root, belong_to_cycle); - CGAL::draw(lccoriginal, "Unsew edge width repeatdly", false, df); + CGAL::draw(lccoriginal, df, "Unsew edge width repeatdly"); } #endif // CGAL_USE_BASIC_VIEWER From 0cad38a50810407b7729c95c87af2c07fa01e951 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 13 Oct 2022 05:25:45 +0200 Subject: [PATCH 089/399] Doc initial commit. --- .../doc/CGAL_basic_viewers/CGAL_basic_viewers.txt | 13 +++++++++++++ .../doc/CGAL_basic_viewers/Doxyfile.in | 3 +++ .../doc/CGAL_basic_viewers/PackageDescription.txt | 0 .../doc/CGAL_basic_viewers/dependencies | 0 .../doc/CGAL_basic_viewers/examples.txt | 0 Documentation/doc/Documentation/packages.txt | 1 + 6 files changed, 17 insertions(+) create mode 100644 CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt create mode 100644 CGAL_basic_viewers/doc/CGAL_basic_viewers/Doxyfile.in create mode 100644 CGAL_basic_viewers/doc/CGAL_basic_viewers/PackageDescription.txt create mode 100644 CGAL_basic_viewers/doc/CGAL_basic_viewers/dependencies create mode 100644 CGAL_basic_viewers/doc/CGAL_basic_viewers/examples.txt diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt b/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt new file mode 100644 index 000000000000..3cf6e4188ae2 --- /dev/null +++ b/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt @@ -0,0 +1,13 @@ +namespace CGAL { +/*! + +\mainpage User Manual +\anchor Chapter_CGAL_Basic_viewers +\anchor +\cgalAutoToc +\author Guillaume Damiand, Mostafa Ashraf + + +*/ + +} /* namespace CGAL */ \ No newline at end of file diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/Doxyfile.in b/CGAL_basic_viewers/doc/CGAL_basic_viewers/Doxyfile.in new file mode 100644 index 000000000000..78014f4c59e4 --- /dev/null +++ b/CGAL_basic_viewers/doc/CGAL_basic_viewers/Doxyfile.in @@ -0,0 +1,3 @@ +@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} + +PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - CGAL and Basic Viewers" diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/PackageDescription.txt b/CGAL_basic_viewers/doc/CGAL_basic_viewers/PackageDescription.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/dependencies b/CGAL_basic_viewers/doc/CGAL_basic_viewers/dependencies new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/examples.txt b/CGAL_basic_viewers/doc/CGAL_basic_viewers/examples.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/Documentation/doc/Documentation/packages.txt b/Documentation/doc/Documentation/packages.txt index ae1d9c9ab0ba..e871abca7e98 100644 --- a/Documentation/doc/Documentation/packages.txt +++ b/Documentation/doc/Documentation/packages.txt @@ -166,5 +166,6 @@ \package_listing{GraphicsView} \package_listing{CGAL_ipelets} +\package_listing{CGAL_basic_viewers} */ From 61a3711c19e490401b96df14eba32985dd195999 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 13 Oct 2022 08:48:11 +0200 Subject: [PATCH 090/399] Review and indent. --- GraphicsView/include/CGAL/Graphic_buffer.h | 210 ++++++++++----------- 1 file changed, 104 insertions(+), 106 deletions(-) diff --git a/GraphicsView/include/CGAL/Graphic_buffer.h b/GraphicsView/include/CGAL/Graphic_buffer.h index 538898df76e2..33ab61b80b86 100644 --- a/GraphicsView/include/CGAL/Graphic_buffer.h +++ b/GraphicsView/include/CGAL/Graphic_buffer.h @@ -7,7 +7,8 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s): Mostafa Ashraf +// Author(s): Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_GRAPHIC_BUFFER_H #define CGAL_GRAPHIC_BUFFER_H @@ -40,8 +41,8 @@ namespace CGAL { // This class is responsible for dealing with available CGAL data structures and // handling buffers. template -class Graphic_buffer { - +class Graphic_buffer +{ public: typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; @@ -70,7 +71,8 @@ class Graphic_buffer { m_buffer_for_colored_faces(&pos[POS_COLORED_FACES], nullptr, &bbox, &pos[COLOR_FACES], &pos[FLAT_NORMAL_COLORED_FACES], - &pos[SMOOTH_NORMAL_COLORED_FACES]) {} + &pos[SMOOTH_NORMAL_COLORED_FACES]) + {} Graphic_buffer() : m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr, @@ -99,61 +101,50 @@ class Graphic_buffer { m_buffer_for_colored_faces(&arrays[POS_COLORED_FACES], nullptr, &m_bounding_box, &arrays[COLOR_FACES], &arrays[FLAT_NORMAL_COLORED_FACES], - &arrays[SMOOTH_NORMAL_COLORED_FACES]) {} + &arrays[SMOOTH_NORMAL_COLORED_FACES]) + {} - const Buffer_for_vao &get_buffer_for_mono_points() const { - return m_buffer_for_mono_points; - } + const Buffer_for_vao &get_buffer_for_mono_points() const + { return m_buffer_for_mono_points; } - const Buffer_for_vao &get_buffer_for_colored_points() const { - return m_buffer_for_colored_points; - } + const Buffer_for_vao &get_buffer_for_colored_points() const + { return m_buffer_for_colored_points; } - const Buffer_for_vao &get_buffer_for_mono_segments() const { - return m_buffer_for_mono_segments; - } + const Buffer_for_vao &get_buffer_for_mono_segments() const + { return m_buffer_for_mono_segments; } - const Buffer_for_vao &get_buffer_for_colored_segments() const { - return m_buffer_for_colored_segments; - } + const Buffer_for_vao &get_buffer_for_colored_segments() const + { return m_buffer_for_colored_segments; } - const Buffer_for_vao &get_buffer_for_mono_rays() const { - return m_buffer_for_mono_rays; - } + const Buffer_for_vao &get_buffer_for_mono_rays() const + { return m_buffer_for_mono_rays; } - const Buffer_for_vao &get_buffer_for_colored_rays() const { - return m_buffer_for_colored_rays; - } + const Buffer_for_vao &get_buffer_for_colored_rays() const + { return m_buffer_for_colored_rays; } - const Buffer_for_vao &get_buffer_for_mono_lines() const { - return m_buffer_for_mono_lines; - } + const Buffer_for_vao &get_buffer_for_mono_lines() const + { return m_buffer_for_mono_lines; } - const Buffer_for_vao &get_buffer_for_colored_lines() const { - return m_buffer_for_colored_lines; - } + const Buffer_for_vao &get_buffer_for_colored_lines() const + { return m_buffer_for_colored_lines; } - const Buffer_for_vao &get_buffer_for_mono_faces() const { - return m_buffer_for_mono_faces; - } + const Buffer_for_vao &get_buffer_for_mono_faces() const + { return m_buffer_for_mono_faces; } - const Buffer_for_vao &get_buffer_for_colored_faces() const { - return m_buffer_for_colored_faces; - } + const Buffer_for_vao &get_buffer_for_colored_faces() const + { return m_buffer_for_colored_faces; } - const Buffer_for_vao &get_buffer_for_clipping_plane() const { - return m_buffer_for_clipping_plane; - } + const Buffer_for_vao &get_buffer_for_clipping_plane() const + { return m_buffer_for_clipping_plane; } const CGAL::Bbox_3 &get_bounding_box() const { return m_bounding_box; } std::vector &get_array_of_index(int index) { return arrays[index]; } - void update_bounding_box(CGAL::Bbox_3 &box) { m_bounding_box += box; } + void update_bounding_box(const CGAL::Bbox_3 &box) { m_bounding_box+=box; } - void initiate_bounding_box(CGAL::Bbox_3 new_bounding_box) { - m_bounding_box = new_bounding_box; - } + void initiate_bounding_box(const CGAL::Bbox_3& new_bounding_box) + { m_bounding_box = new_bounding_box; } void negate_all_normals() { @@ -161,41 +152,40 @@ class Graphic_buffer { m_buffer_for_colored_faces.negate_normals(); } - template void add_point(const KPoint &p) { - m_buffer_for_mono_points.add_point(p); - } + template void add_point(const KPoint &p) + { m_buffer_for_mono_points.add_point(p); } template - void add_point(const KPoint &p, const CGAL::IO::Color &acolor) { - m_buffer_for_colored_points.add_point(p, acolor); - } + void add_point(const KPoint &p, const CGAL::IO::Color &acolor) + { m_buffer_for_colored_points.add_point(p, acolor); } template - void add_segment(const KPoint &p1, const KPoint &p2) { - m_buffer_for_mono_segments.add_segment(p1, p2); - } + void add_segment(const KPoint &p1, const KPoint &p2) + { m_buffer_for_mono_segments.add_segment(p1, p2); } template void add_segment(const KPoint &p1, const KPoint &p2, - const CGAL::IO::Color &acolor) { - m_buffer_for_colored_segments.add_segment(p1, p2, acolor); - } + const CGAL::IO::Color &acolor) + { m_buffer_for_colored_segments.add_segment(p1, p2, acolor); } template - void add_ray(const KPoint &p, const KVector &v) { + void add_ray(const KPoint &p, const KVector &v) + { double bigNumber = 1e30; m_buffer_for_mono_rays.add_ray_segment(p, (p + (bigNumber)*v)); } template void add_ray(const KPoint &p, const KVector &v, - const CGAL::IO::Color &acolor) { + const CGAL::IO::Color &acolor) + { double bigNumber = 1e30; m_buffer_for_colored_rays.add_ray_segment(p, (p + (bigNumber)*v), acolor); } template - void add_line(const KPoint &p, const KVector &v) { + void add_line(const KPoint &p, const KVector &v) + { double bigNumber = 1e30; m_buffer_for_mono_lines.add_line_segment((p - (bigNumber)*v), (p + (bigNumber)*v)); @@ -203,65 +193,72 @@ class Graphic_buffer { template void add_line(const KPoint &p, const KVector &v, - const CGAL::IO::Color &acolor) { + const CGAL::IO::Color &acolor) + { double bigNumber = 1e30; m_buffer_for_colored_lines.add_line_segment((p - (bigNumber)*v), (p + (bigNumber)*v), acolor); } - template bool add_point_in_face(const KPoint &kp) { - if (m_buffer_for_mono_faces.is_a_face_started()) { - return m_buffer_for_mono_faces.add_point_in_face(kp); - } else if (m_buffer_for_colored_faces.is_a_face_started()) { - return m_buffer_for_colored_faces.add_point_in_face(kp); - } + template bool add_point_in_face(const KPoint &kp) + { + if (m_buffer_for_mono_faces.is_a_face_started()) + { return m_buffer_for_mono_faces.add_point_in_face(kp); } + else if (m_buffer_for_colored_faces.is_a_face_started()) + { return m_buffer_for_colored_faces.add_point_in_face(kp); } return false; } template - bool add_point_in_face(const KPoint &kp, const KVector &p_normal) { - if (m_buffer_for_mono_faces.is_a_face_started()) { - return m_buffer_for_mono_faces.add_point_in_face(kp, p_normal); - } else if (m_buffer_for_colored_faces.is_a_face_started()) { - return m_buffer_for_colored_faces.add_point_in_face(kp, p_normal); - } + bool add_point_in_face(const KPoint &kp, const KVector &p_normal) + { + if (m_buffer_for_mono_faces.is_a_face_started()) + { return m_buffer_for_mono_faces.add_point_in_face(kp, p_normal); } + else if (m_buffer_for_colored_faces.is_a_face_started()) + { return m_buffer_for_colored_faces.add_point_in_face(kp, p_normal); } return false; } - bool is_a_face_started() const { + bool is_a_face_started() const + { return m_buffer_for_mono_faces.is_a_face_started() || m_buffer_for_colored_faces.is_a_face_started(); } - void face_begin() { - if (is_a_face_started()) { + void face_begin() + { + if (is_a_face_started()) + { std::cerr << "You cannot start a new face before to finish the previous one." << std::endl; - } else { - m_buffer_for_mono_faces.face_begin(); } + else + { m_buffer_for_mono_faces.face_begin(); } } - void face_begin(const CGAL::IO::Color &acolor) { - if (is_a_face_started()) { + void face_begin(const CGAL::IO::Color &acolor) + { + if (is_a_face_started()) + { std::cerr << "You cannot start a new face before to finish the previous one." << std::endl; - } else { - m_buffer_for_colored_faces.face_begin(acolor); } + else + { m_buffer_for_colored_faces.face_begin(acolor); } } - void face_end() { - if (m_buffer_for_mono_faces.is_a_face_started()) { - m_buffer_for_mono_faces.face_end(); - } else if (m_buffer_for_colored_faces.is_a_face_started()) { - return m_buffer_for_colored_faces.face_end(); - } + void face_end() + { + if (m_buffer_for_mono_faces.is_a_face_started()) + { m_buffer_for_mono_faces.face_end(); } + else if (m_buffer_for_colored_faces.is_a_face_started()) + { m_buffer_for_colored_faces.face_end(); } } - bool is_empty() const { + bool is_empty() const + { return (m_buffer_for_mono_points.is_empty() && m_buffer_for_colored_points.is_empty() && m_buffer_for_mono_segments.is_empty() && @@ -274,7 +271,8 @@ class Graphic_buffer { m_buffer_for_colored_faces.is_empty()); } - bool has_zero_x() const { + bool has_zero_x() const + { return m_buffer_for_mono_points.has_zero_x() && m_buffer_for_colored_points.has_zero_x() && m_buffer_for_mono_segments.has_zero_x() && @@ -287,7 +285,8 @@ class Graphic_buffer { m_buffer_for_colored_lines.has_zero_x(); } - bool has_zero_y() const { + bool has_zero_y() const + { return m_buffer_for_mono_points.has_zero_y() && m_buffer_for_colored_points.has_zero_y() && m_buffer_for_mono_segments.has_zero_y() && @@ -300,7 +299,8 @@ class Graphic_buffer { m_buffer_for_colored_lines.has_zero_y(); } - bool has_zero_z() const { + bool has_zero_z() const + { return m_buffer_for_mono_points.has_zero_z() && m_buffer_for_colored_points.has_zero_z() && m_buffer_for_mono_segments.has_zero_z() && @@ -327,40 +327,38 @@ class Graphic_buffer { m_buffer_for_colored_faces.clear(); m_buffer_for_clipping_plane.clear(); m_texts.clear(); + m_bounding_box=CGAL::Bbox_3(); } template - static Local_point get_local_point(const KPoint &p) { + static Local_point get_local_point(const KPoint &p) + { return internal::Geom_utils::Kernel, Local_kernel>::get_local_point(p); } template - void add_text(const KPoint &kp, const QString &txt) { + void add_text(const KPoint &kp, const QString &txt) + { Local_point p = get_local_point(kp); m_texts.push_back(std::make_tuple(p, txt)); } - template void add_text(const KPoint &kp, const char *txt) { - add_text(kp, QString(txt)); - } + template void add_text(const KPoint &kp, const char *txt) + { add_text(kp, QString(txt)); } template - void add_text(const KPoint &kp, const std::string &txt) { - add_text(kp, txt.c_str()); - } + void add_text(const KPoint &kp, const std::string &txt) + { add_text(kp, txt.c_str()); } - void m_texts_clear() { - m_texts.clear(); - } + void m_texts_clear() + { m_texts.clear(); } - int m_texts_size() { - return m_texts.size(); - } + int m_texts_size() + { return m_texts.size(); } - std::vector>& get_m_texts() { - return m_texts; - } + std::vector>& get_m_texts() + { return m_texts; } protected: // The following enum gives the indices of different elements of arrays From 733711384b79052cf8cf65891df1b6988e2ce7a2 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 13 Oct 2022 08:51:41 +0200 Subject: [PATCH 091/399] review + comment --- GraphicsView/include/CGAL/Drawing_functor.h | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/GraphicsView/include/CGAL/Drawing_functor.h b/GraphicsView/include/CGAL/Drawing_functor.h index cff52be172da..b5516a63afb0 100644 --- a/GraphicsView/include/CGAL/Drawing_functor.h +++ b/GraphicsView/include/CGAL/Drawing_functor.h @@ -15,37 +15,39 @@ namespace CGAL { +// Drawing functor for a 2D combinatorial data structure +// (with vertices, edges and faces) template + typename face_handle> struct Drawing_functor { Drawing_functor(): m_enabled_vertices(true), - m_enabled_edges(true), - m_enabled_faces(true) + m_enabled_edges(true), + m_enabled_faces(true) { draw_vertex=[](const DS &, vertex_handle)->bool { return true; }; draw_edge=[](const DS &, edge_handle)->bool { return true; }; draw_face=[](const DS &, face_handle)->bool { return true; }; - + colored_vertex=[](const DS &, vertex_handle)->bool { return false; }; colored_edge=[](const DS &, edge_handle)->bool { return false; }; colored_face=[](const DS &, face_handle)->bool { return false; }; face_wireframe=[](const DS &, face_handle)->bool { return false; }; } - + std::function draw_vertex; std::function draw_edge; std::function draw_face; - + std::function colored_vertex; std::function colored_edge; std::function colored_face; - + std::function face_wireframe; - + std::function vertex_color; std::function edge_color; std::function face_color; @@ -61,13 +63,15 @@ struct Drawing_functor void disable_faces() { m_enabled_faces=false; } void enable_faces() { m_enabled_faces=true; } bool are_faces_enabled() const { return m_enabled_faces; } - + protected: bool m_enabled_vertices, m_enabled_edges, m_enabled_faces; }; -template From 91016007cd6f6a562fd08dd117cbd00fe3446bbf Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 13 Oct 2022 11:11:57 +0200 Subject: [PATCH 092/399] Some cleanup --- .../include/CGAL/Qt/Basic_viewer_qt.h | 637 ++++++++---------- 1 file changed, 276 insertions(+), 361 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 2eb5e9b62dd2..2f702781ddb1 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -56,8 +56,12 @@ #include #include +#define CGAL_BASIC_VIEWER_INIT_SIZE_X 500 +#define CGAL_BASIC_VIEWER_INIT_SIZE_Y 450 + namespace CGAL { + //------------------------------------------------------------------------------ inline CGAL::IO::Color get_random_color(CGAL::Random& random) { @@ -71,7 +75,6 @@ inline CGAL::IO::Color get_random_color(CGAL::Random& random) while(res.red()==255 && res.green()==255 && res.blue()==255); return res; } - //------------------------------------------------------------------------------ template class Basic_viewer_qt : public CGAL::QGLViewer @@ -141,9 +144,12 @@ class Basic_viewer_qt : public CGAL::QGLViewer setKeyDescription(::Qt::Key_O, "Toggles 2D mode only"); // Add custom mouse description - setMouseBindingDescription(::Qt::Key_C, ::Qt::ControlModifier, ::Qt::LeftButton, "Rotate the clipping plane when enabled"); - setMouseBindingDescription(::Qt::Key_C, ::Qt::ControlModifier, ::Qt::RightButton, "Translate the clipping plane when enabled"); - setMouseBindingDescription(::Qt::Key_C, ::Qt::ControlModifier, ::Qt::MiddleButton, "Control the clipping plane transparency when enabled"); + setMouseBindingDescription(::Qt::Key_C, ::Qt::ControlModifier, ::Qt::LeftButton, + "Rotate the clipping plane when enabled"); + setMouseBindingDescription(::Qt::Key_C, ::Qt::ControlModifier, ::Qt::RightButton, + "Translate the clipping plane when enabled"); + setMouseBindingDescription(::Qt::Key_C, ::Qt::ControlModifier, ::Qt::MiddleButton, + "Control the clipping plane transparency when enabled"); setMouseBinding(::Qt::ControlModifier, ::Qt::LeftButton, qglviewer::FRAME, qglviewer::NO_MOUSE_ACTION); setMouseBinding(::Qt::ControlModifier, ::Qt::RightButton, qglviewer::FRAME, qglviewer::NO_MOUSE_ACTION); @@ -160,7 +166,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer else setWindowTitle(title); - resize(500, 450); + resize(CGAL_BASIC_VIEWER_INIT_SIZE_X, CGAL_BASIC_VIEWER_INIT_SIZE_Y); if (inverse_normal) { negate_all_normals(); } @@ -176,30 +182,22 @@ class Basic_viewer_qt : public CGAL::QGLViewer vao[i].destroy(); } - void set_draw_vertices(bool b) { - m_draw_vertices = b; - } - void set_draw_edges(bool b) { - m_draw_edges = b; - } - void set_draw_rays(bool b) { - m_draw_rays = b; - } - void set_draw_lines(bool b) { - m_draw_lines = b; - } - void set_draw_faces(bool b) { - m_draw_faces = b; - } - void set_use_mono_color(bool b) { - m_use_mono_color = b; - } - void set_inverse_normal(bool b) { - m_inverse_normal = b; - } - void set_draw_text(bool b) { - m_draw_text = b; - } + void set_draw_vertices(bool b) + { m_draw_vertices = b; } + void set_draw_edges(bool b) + { m_draw_edges = b; } + void set_draw_rays(bool b) + { m_draw_rays = b; } + void set_draw_lines(bool b) + { m_draw_lines = b; } + void set_draw_faces(bool b) + { m_draw_faces = b; } + void set_use_mono_color(bool b) + { m_use_mono_color = b; } + void set_inverse_normal(bool b) + { m_inverse_normal = b; } + void set_draw_text(bool b) + { m_draw_text = b; } void clear() { @@ -214,30 +212,19 @@ class Basic_viewer_qt : public CGAL::QGLViewer } bool is_empty() const - { - return gBuffer.is_empty(); - } + { return gBuffer.is_empty(); } const CGAL::Bbox_3& bounding_box() const - { - const auto& bounding_box = gBuffer.get_bounding_box(); - return bounding_box; - } + { return gBuffer.get_bounding_box(); } bool has_zero_x() const - { - return gBuffer.has_zero_x(); - } + { return gBuffer.has_zero_x(); } bool has_zero_y() const - { - return gBuffer.has_zero_y(); - } + { return gBuffer.has_zero_y(); } bool has_zero_z() const - { - return gBuffer.has_zero_z(); - } + { return gBuffer.has_zero_z(); } Local_kernel::Plane_3 clipping_plane() const { @@ -265,68 +252,27 @@ class Basic_viewer_qt : public CGAL::QGLViewer template void add_segment(const KPoint& p1, const KPoint& p2, const CGAL::IO::Color& acolor) - { gBuffer.add_segment(p1, p2, acolor);}//get_buffer_for_colored_segments().add_segment(p1, p2, acolor); } - - template - void update_bounding_box_for_ray(const KPoint &p, const KVector &v) - { - Local_point lp = get_local_point(p); - Local_vector lv = get_local_vector(v); - CGAL::Bbox_3 b = (lp + lv).bbox(); - gBuffer.update_bounding_box(b); - } - - template - void update_bounding_box_for_line(const KPoint &p, const KVector &v, - const KVector &pv) - { - Local_point lp = get_local_point(p); - Local_vector lv = get_local_vector(v); - Local_vector lpv = get_local_vector(pv); - - CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); - gBuffer.update_bounding_box(b); - } + { gBuffer.add_segment(p1, p2, acolor);} template void add_ray(const KPoint &p, const KVector &v) - { - double bigNumber = 1e30; - gBuffer.get_buffer_for_mono_rays().add_ray_segment(p, (p + (bigNumber)*v)); - // gBuffer.get_buffer_for_mono_rays().add_ray(p, v); - } + { gBuffer.add_ray(p, v); } template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) - { - // gBuffer.get_buffer_for_colored_rays().add_ray(p, v, acolor); - double bigNumber = 1e30; - gBuffer.get_buffer_for_colored_lines().add_ray_segment(p, (p + (bigNumber)*v), acolor); - } + { gBuffer.add_ray(p, v, acolor); } template void add_line(const KPoint &p, const KVector &v) - { - // gBuffer.add_line(p,v); - double bigNumber = 1e30; - gBuffer.get_buffer_for_mono_lines().add_line_segment((p - (bigNumber)*v), - (p + (bigNumber)*v)); - } + { gBuffer.add_line(p, v); } template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) - { - // gBuffer.add_line(p,v,acolor); - double bigNumber = 1e30; - gBuffer.get_buffer_for_colored_lines().add_line_segment((p - (bigNumber)*v), - (p + (bigNumber)*v), acolor); - } + { gBuffer.add_line(p, v, acolor); } template void add_text(const KPoint& kp, const QString& txt) - { - gBuffer.add_text(kp, txt); - } + { gBuffer.add_text(kp, txt); } template void add_text(const KPoint& kp, const char* txt) @@ -336,6 +282,27 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_text(const KPoint& kp, const std::string& txt) { gBuffer.add_text(kp, txt.c_str()); } + template + void update_bounding_box_for_ray(const KPoint &p, const KVector &v) + { + Local_point lp = get_local_point(p); + Local_vector lv = get_local_vector(v); + CGAL::Bbox_3 b = (lp + lv).bbox(); + gBuffer.update_bounding_box(b); + } + + template + void update_bounding_box_for_line(const KPoint &p, const KVector &v, + const KVector &pv) + { + Local_point lp = get_local_point(p); + Local_vector lv = get_local_vector(v); + Local_vector lpv = get_local_vector(pv); + + CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); + gBuffer.update_bounding_box(b); + } + bool is_a_face_started() const { return gBuffer.get_buffer_for_mono_faces().is_a_face_started() || @@ -343,59 +310,24 @@ class Basic_viewer_qt : public CGAL::QGLViewer } void face_begin() - { - if (is_a_face_started()) - { - std::cerr<<"You cannot start a new face before to finish the previous one."< - bool add_point_in_face(const KPoint &kp) { - return gBuffer.add_point_in_face(kp); - } + bool add_point_in_face(const KPoint &kp) + { return gBuffer.add_point_in_face(kp); } template - bool add_point_in_face(const KPoint &kp, const KVector &p_normal) { - return gBuffer.add_point_in_face(kp, p_normal); - } - - Graphic_buffer& get_graphic_buffer() { - return gBuffer; - } + bool add_point_in_face(const KPoint &kp, const KVector &p_normal) + { return gBuffer.add_point_in_face(kp, p_normal); } void face_end() - { - if (gBuffer.get_buffer_for_mono_faces().is_a_face_started()) - { - auto mono_faces = gBuffer.get_buffer_for_mono_faces(); - mono_faces.face_end(); - } - else if (gBuffer.get_buffer_for_colored_faces().is_a_face_started()) - { - auto colored_faces = gBuffer.get_buffer_for_colored_faces(); - // return colored_faces.face_end(); - colored_faces.face_end(); - } - } + { gBuffer.face_end(); } + + Graphic_buffer& get_graphic_buffer() + { return gBuffer; } virtual void redraw() { @@ -1355,93 +1287,87 @@ class Basic_viewer_qt : public CGAL::QGLViewer } void negate_all_normals() - { - gBuffer.negate_all_normals(); - } + { gBuffer.negate_all_normals(); } virtual void keyPressEvent(QKeyEvent *e) { - const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - - if(_onPress) { - bool is_pressed = _onPress(e, this); - if(!is_pressed) { - - if ((e->key()==::Qt::Key_C) && (modifiers==::Qt::NoButton)) + if(!_onPress || !_onPress(e, this)) { - if (!isOpenGL_4_3()) return; - if (!is_two_dimensional()) + if ((e->key()==::Qt::Key_C) && (modifiers==::Qt::NoButton)) { - // toggle clipping plane - m_use_clipping_plane = (m_use_clipping_plane + 1) % CLIPPING_PLANE_END_INDEX; - if (m_use_clipping_plane==CLIPPING_PLANE_OFF) - { setManipulatedFrame(nullptr); } - else - { setManipulatedFrame(m_frame_plane); } + if (!isOpenGL_4_3()) return; + if (!is_two_dimensional()) + { + // toggle clipping plane + m_use_clipping_plane = (m_use_clipping_plane + 1) % CLIPPING_PLANE_END_INDEX; + if (m_use_clipping_plane==CLIPPING_PLANE_OFF) + { setManipulatedFrame(nullptr); } + else + { setManipulatedFrame(m_frame_plane); } + + switch(m_use_clipping_plane) + { + case CLIPPING_PLANE_OFF: displayMessage(QString("Draw clipping = false")); break; + case CLIPPING_PLANE_SOLID_HALF_TRANSPARENT_HALF: clipping_plane_rendering=true; displayMessage(QString("Draw clipping = solid half & transparent half")); break; + case CLIPPING_PLANE_SOLID_HALF_WIRE_HALF: displayMessage(QString("Draw clipping = solid half & wireframe half")); break; + case CLIPPING_PLANE_SOLID_HALF_ONLY: displayMessage(QString("Draw clipping = solid half only")); break; + default: break; + } + update(); + } + } - switch(m_use_clipping_plane) + else if ((e->key()==::Qt::Key_C) && (modifiers==::Qt::AltModifier)) + { + if (!isOpenGL_4_3()) return; + if (m_use_clipping_plane!=CLIPPING_PLANE_OFF) { - case CLIPPING_PLANE_OFF: displayMessage(QString("Draw clipping = false")); break; - case CLIPPING_PLANE_SOLID_HALF_TRANSPARENT_HALF: clipping_plane_rendering=true; displayMessage(QString("Draw clipping = solid half & transparent half")); break; - case CLIPPING_PLANE_SOLID_HALF_WIRE_HALF: displayMessage(QString("Draw clipping = solid half & wireframe half")); break; - case CLIPPING_PLANE_SOLID_HALF_ONLY: displayMessage(QString("Draw clipping = solid half only")); break; - default: break; + clipping_plane_rendering = !clipping_plane_rendering; + displayMessage(QString("Draw clipping plane=%1.").arg(clipping_plane_rendering?"true":"false")); + update(); } + } + else if ((e->key()==::Qt::Key_E) && (modifiers==::Qt::NoButton)) + { + m_draw_edges=!m_draw_edges; + displayMessage(QString("Draw edges=%1.").arg(m_draw_edges?"true":"false")); update(); } - } - - else if ((e->key()==::Qt::Key_C) && (modifiers==::Qt::AltModifier)) - { - if (!isOpenGL_4_3()) return; - if (m_use_clipping_plane!=CLIPPING_PLANE_OFF) + else if ((e->key()==::Qt::Key_M) && (modifiers==::Qt::NoButton)) { - clipping_plane_rendering = !clipping_plane_rendering; - displayMessage(QString("Draw clipping plane=%1.").arg(clipping_plane_rendering?"true":"false")); + m_use_mono_color=!m_use_mono_color; + displayMessage(QString("Mono color=%1.").arg(m_use_mono_color?"true":"false")); update(); } - } - else if ((e->key()==::Qt::Key_E) && (modifiers==::Qt::NoButton)) - { - m_draw_edges=!m_draw_edges; - displayMessage(QString("Draw edges=%1.").arg(m_draw_edges?"true":"false")); - update(); - } - else if ((e->key()==::Qt::Key_M) && (modifiers==::Qt::NoButton)) - { - m_use_mono_color=!m_use_mono_color; - displayMessage(QString("Mono color=%1.").arg(m_use_mono_color?"true":"false")); - update(); - } - else if ((e->key()==::Qt::Key_N) && (modifiers==::Qt::NoButton)) - { - m_inverse_normal=!m_inverse_normal; - displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false")); - negate_all_normals(); - redraw(); - } - else if ((e->key()==::Qt::Key_S) && (modifiers==::Qt::NoButton)) - { - m_flatShading=!m_flatShading; - if (m_flatShading) - displayMessage("Flat shading."); - else - displayMessage("Gouraud shading."); - redraw(); - } - else if ((e->key()==::Qt::Key_T) && (modifiers==::Qt::NoButton)) - { - m_draw_text=!m_draw_text; - displayMessage(QString("Draw text=%1.").arg(m_draw_text?"true":"false")); - update(); - } - else if ((e->key()==::Qt::Key_U) && (modifiers==::Qt::NoButton)) - { - if (is_two_dimensional()) + else if ((e->key()==::Qt::Key_N) && (modifiers==::Qt::NoButton)) + { + m_inverse_normal=!m_inverse_normal; + displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false")); + negate_all_normals(); + redraw(); + } + else if ((e->key()==::Qt::Key_S) && (modifiers==::Qt::NoButton)) + { + m_flatShading=!m_flatShading; + if (m_flatShading) + displayMessage("Flat shading."); + else + displayMessage("Gouraud shading."); + redraw(); + } + else if ((e->key()==::Qt::Key_T) && (modifiers==::Qt::NoButton)) + { + m_draw_text=!m_draw_text; + displayMessage(QString("Draw text=%1.").arg(m_draw_text?"true":"false")); + update(); + } + else if ((e->key()==::Qt::Key_U) && (modifiers==::Qt::NoButton)) { - displayMessage(QString("Move camera direction upside down.")); - /* CGAL::qglviewer::Vec cur=camera()->viewDirection(); + if (is_two_dimensional()) + { + displayMessage(QString("Move camera direction upside down.")); + /* CGAL::qglviewer::Vec cur=camera()->viewDirection(); // TODO ! double cx=cur.x, cy=cur.y, cz=cur.z; if (has_zero_x()) { cx=-cx; } else if (has_zero_y()) { cy=-cy; } @@ -1451,140 +1377,140 @@ class Basic_viewer_qt : public CGAL::QGLViewer else if (has_zero_y()) { cy=(cur.y<0?-1.:1); } else { cz=(cur.z<0?-1.:1); }*/ - camera()->setUpVector(-camera()->upVector()); + camera()->setUpVector(-camera()->upVector()); //camera()->frame()->setConstraint(NULL); // camera()->setViewDirection(CGAL::qglviewer::Vec(-cx,-cy,-cz)); //constraint.setRotationConstraintDirection(CGAL::qglviewer::Vec(cx, cy, cz)); //camera()->frame()->setConstraint(&constraint); //update(); - redraw(); + redraw(); + } } - } - else if ((e->key()==::Qt::Key_V) && (modifiers==::Qt::NoButton)) - { - m_draw_vertices=!m_draw_vertices; - displayMessage(QString("Draw vertices=%1.").arg(m_draw_vertices?"true":"false")); - update(); - } - else if ((e->key()==::Qt::Key_W) && (modifiers==::Qt::NoButton)) - { - m_draw_faces=!m_draw_faces; - displayMessage(QString("Draw faces=%1.").arg(m_draw_faces?"true":"false")); - update(); - } - else if ((e->key()==::Qt::Key_Plus) && (!modifiers.testFlag(::Qt::ControlModifier))) // No ctrl - { - m_size_edges+=.5; - displayMessage(QString("Size of edges=%1.").arg(m_size_edges)); - update(); - } - else if ((e->key()==::Qt::Key_Minus) && (!modifiers.testFlag(::Qt::ControlModifier))) // No ctrl - { - if (m_size_edges>.5) m_size_edges-=.5; - displayMessage(QString("Size of edges=%1.").arg(m_size_edges)); - update(); - } - else if ((e->key()==::Qt::Key_Plus) && (modifiers.testFlag(::Qt::ControlModifier))) - { - m_size_points+=.5; - displayMessage(QString("Size of points=%1.").arg(m_size_points)); - update(); - } - else if ((e->key()==::Qt::Key_Minus) && (modifiers.testFlag(::Qt::ControlModifier))) - { - if (m_size_points>.5) m_size_points-=.5; - displayMessage(QString("Size of points=%1.").arg(m_size_points)); - update(); - } - else if ((e->key()==::Qt::Key_PageUp) && (modifiers==::Qt::NoButton)) - { - m_ambient_color.setX(m_ambient_color.x()+.1); - if (m_ambient_color.x()>1.) m_ambient_color.setX(1.); - m_ambient_color.setY(m_ambient_color.x()+.1); - if (m_ambient_color.y()>1.) m_ambient_color.setY(1.); - m_ambient_color.setZ(m_ambient_color.x()+.1); - if (m_ambient_color.z()>1.) m_ambient_color.setZ(1.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - update(); - } - else if ((e->key()==::Qt::Key_PageDown) && (modifiers==::Qt::NoButton)) - { - m_ambient_color.setX(m_ambient_color.x()-.1); - if (m_ambient_color.x()<0.) m_ambient_color.setX(0.); - m_ambient_color.setY(m_ambient_color.y()-.1); - if (m_ambient_color.y()<0.) m_ambient_color.setY(0.); - m_ambient_color.setZ(m_ambient_color.z()-.1); - if (m_ambient_color.z()<0.) m_ambient_color.setZ(0.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - update(); - } - else if ((e->key()==::Qt::Key_PageUp) && (modifiers==::Qt::ShiftModifier)) - { - m_ambient_color.setX(m_ambient_color.x()+.1); - if (m_ambient_color.x()>1.) m_ambient_color.setX(1.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - update(); - } - else if ((e->key()==::Qt::Key_PageUp) && (modifiers==::Qt::AltModifier)) - { - m_ambient_color.setY(m_ambient_color.y()+.1); - if (m_ambient_color.y()>1.) m_ambient_color.setY(1.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - update(); - } - else if ((e->key()==::Qt::Key_PageUp) && (modifiers==::Qt::ControlModifier)) - { - m_ambient_color.setZ(m_ambient_color.z()+.1); - if (m_ambient_color.z()>1.) m_ambient_color.setZ(1.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - update(); - } - else if ((e->key()==::Qt::Key_PageDown) && (modifiers==::Qt::ShiftModifier)) - { - m_ambient_color.setX(m_ambient_color.x()-.1); - if (m_ambient_color.x()<0.) m_ambient_color.setX(0.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - update(); - } - else if ((e->key()==::Qt::Key_PageDown) && (modifiers==::Qt::AltModifier)) - { - m_ambient_color.setY(m_ambient_color.y()-.1); - if (m_ambient_color.y()<0.) m_ambient_color.setY(0.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - update(); - } - else if ((e->key()==::Qt::Key_PageDown) && (modifiers==::Qt::ControlModifier)) - { - m_ambient_color.setZ(m_ambient_color.z()-.1); - if (m_ambient_color.z()<0.) m_ambient_color.setZ(0.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - update(); - } - else if ((e->key()==::Qt::Key_O) && (modifiers==::Qt::NoButton)) - { - bool old_2D=is_two_dimensional(); - m_no_2D_mode=!m_no_2D_mode; - if (old_2D!=is_two_dimensional()) + else if ((e->key()==::Qt::Key_V) && (modifiers==::Qt::NoButton)) { - if (is_two_dimensional()) - { displayMessage(QString("Viewer is in 2D mode.")); } - else { displayMessage(QString("Viewer is in 3D mode.")); } + m_draw_vertices=!m_draw_vertices; + displayMessage(QString("Draw vertices=%1.").arg(m_draw_vertices?"true":"false")); + update(); + } + else if ((e->key()==::Qt::Key_W) && (modifiers==::Qt::NoButton)) + { + m_draw_faces=!m_draw_faces; + displayMessage(QString("Draw faces=%1.").arg(m_draw_faces?"true":"false")); update(); } + else if ((e->key()==::Qt::Key_Plus) && (!modifiers.testFlag(::Qt::ControlModifier))) // No ctrl + { + m_size_edges+=.5; + displayMessage(QString("Size of edges=%1.").arg(m_size_edges)); + update(); + } + else if ((e->key()==::Qt::Key_Minus) && (!modifiers.testFlag(::Qt::ControlModifier))) // No ctrl + { + if (m_size_edges>.5) m_size_edges-=.5; + displayMessage(QString("Size of edges=%1.").arg(m_size_edges)); + update(); + } + else if ((e->key()==::Qt::Key_Plus) && (modifiers.testFlag(::Qt::ControlModifier))) + { + m_size_points+=.5; + displayMessage(QString("Size of points=%1.").arg(m_size_points)); + update(); + } + else if ((e->key()==::Qt::Key_Minus) && (modifiers.testFlag(::Qt::ControlModifier))) + { + if (m_size_points>.5) m_size_points-=.5; + displayMessage(QString("Size of points=%1.").arg(m_size_points)); + update(); + } + else if ((e->key()==::Qt::Key_PageUp) && (modifiers==::Qt::NoButton)) + { + m_ambient_color.setX(m_ambient_color.x()+.1); + if (m_ambient_color.x()>1.) m_ambient_color.setX(1.); + m_ambient_color.setY(m_ambient_color.x()+.1); + if (m_ambient_color.y()>1.) m_ambient_color.setY(1.); + m_ambient_color.setZ(m_ambient_color.x()+.1); + if (m_ambient_color.z()>1.) m_ambient_color.setZ(1.); + displayMessage(QString("Light color=(%1 %2 %3)."). + arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); + update(); + } + else if ((e->key()==::Qt::Key_PageDown) && (modifiers==::Qt::NoButton)) + { + m_ambient_color.setX(m_ambient_color.x()-.1); + if (m_ambient_color.x()<0.) m_ambient_color.setX(0.); + m_ambient_color.setY(m_ambient_color.y()-.1); + if (m_ambient_color.y()<0.) m_ambient_color.setY(0.); + m_ambient_color.setZ(m_ambient_color.z()-.1); + if (m_ambient_color.z()<0.) m_ambient_color.setZ(0.); + displayMessage(QString("Light color=(%1 %2 %3)."). + arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); + update(); + } + else if ((e->key()==::Qt::Key_PageUp) && (modifiers==::Qt::ShiftModifier)) + { + m_ambient_color.setX(m_ambient_color.x()+.1); + if (m_ambient_color.x()>1.) m_ambient_color.setX(1.); + displayMessage(QString("Light color=(%1 %2 %3)."). + arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); + update(); + } + else if ((e->key()==::Qt::Key_PageUp) && (modifiers==::Qt::AltModifier)) + { + m_ambient_color.setY(m_ambient_color.y()+.1); + if (m_ambient_color.y()>1.) m_ambient_color.setY(1.); + displayMessage(QString("Light color=(%1 %2 %3)."). + arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); + update(); + } + else if ((e->key()==::Qt::Key_PageUp) && (modifiers==::Qt::ControlModifier)) + { + m_ambient_color.setZ(m_ambient_color.z()+.1); + if (m_ambient_color.z()>1.) m_ambient_color.setZ(1.); + displayMessage(QString("Light color=(%1 %2 %3)."). + arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); + update(); + } + else if ((e->key()==::Qt::Key_PageDown) && (modifiers==::Qt::ShiftModifier)) + { + m_ambient_color.setX(m_ambient_color.x()-.1); + if (m_ambient_color.x()<0.) m_ambient_color.setX(0.); + displayMessage(QString("Light color=(%1 %2 %3)."). + arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); + update(); + } + else if ((e->key()==::Qt::Key_PageDown) && (modifiers==::Qt::AltModifier)) + { + m_ambient_color.setY(m_ambient_color.y()-.1); + if (m_ambient_color.y()<0.) m_ambient_color.setY(0.); + displayMessage(QString("Light color=(%1 %2 %3)."). + arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); + update(); + } + else if ((e->key()==::Qt::Key_PageDown) && (modifiers==::Qt::ControlModifier)) + { + m_ambient_color.setZ(m_ambient_color.z()-.1); + if (m_ambient_color.z()<0.) m_ambient_color.setZ(0.); + displayMessage(QString("Light color=(%1 %2 %3)."). + arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); + update(); + } + else if ((e->key()==::Qt::Key_O) && (modifiers==::Qt::NoButton)) + { + bool old_2D=is_two_dimensional(); + m_no_2D_mode=!m_no_2D_mode; + if (old_2D!=is_two_dimensional()) + { + if (is_two_dimensional()) + { displayMessage(QString("Viewer is in 2D mode.")); } + else { displayMessage(QString("Viewer is in 3D mode.")); } + update(); + } + } + else + { CGAL::QGLViewer::keyPressEvent(e); } // By default call QGLViewer key press } - else - CGAL::QGLViewer::keyPressEvent(e); - } - } } + virtual QString helpString() const { return helpString("CGAL Basic Viewer"); } @@ -1620,10 +1546,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer return text; } public: - // std::function _onPress; std::function *)> _onPress; -protected: +protected: Graphic_buffer& gBuffer; bool m_draw_vertices; @@ -1729,56 +1654,49 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; -/** - * @brief - * - * @tparam BufferType - * @param graphic_buffer - */ template -void draw_buffer(Graphic_buffer &graphic_buffer) { - +void draw_buffer(Graphic_buffer &graphic_buffer, + const char *title="CGAL Basic Viewer") +{ #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; #else bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif - if (!cgal_test_suite) { - CGAL::Qt::init_ogl_context(4, 3); - // Qt::init_ogl_context(4, 3); + if (!cgal_test_suite) + { + Qt::init_ogl_context(4, 3); int argc = 1; - const char *argv[2] = {"lccviewer", nullptr}; + const char *argv[2] = {title, nullptr}; QApplication app(argc, const_cast(argv)); - - Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); + Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer, title); basic_viewer.show(); app.exec(); } } - template -void draw_buffer(Graphic_buffer &graphic_buffer,const std::function *)>& onPress) { - +void draw_buffer(Graphic_buffer &graphic_buffer, + const std::function *)>& onPress, + const char *title="CGAL Basic Viewer") +{ #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; #else bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif - if (!cgal_test_suite) { - CGAL::Qt::init_ogl_context(4, 3); - // Qt::init_ogl_context(4, 3); + if (!cgal_test_suite) + { + Qt::init_ogl_context(4, 3); int argc = 1; - const char *argv[2] = {"lccviewer", nullptr}; + const char *argv[2] = {title, nullptr}; QApplication app(argc, const_cast(argv)); - - Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); - + Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer, title); basic_viewer._onPress = onPress; basic_viewer.show(); @@ -1786,9 +1704,6 @@ void draw_buffer(Graphic_buffer &graphic_buffer,const std::function< } } - - - } // End namespace CGAL #else // CGAL_USE_BASIC_VIEWER From 09ce35d9baa637943752bb85129cce5a11cf6aa9 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 13 Oct 2022 11:18:32 +0200 Subject: [PATCH 093/399] Correct template specialisation for add_in_graphic_buffer functions, lcc and voronoi 2 --- .../include/CGAL/Qt/Basic_viewer_qt.h | 4 +- .../include/CGAL/draw_linear_cell_complex.h | 83 ++++---- .../include/CGAL/draw_voronoi_diagram_2.h | 181 +++++++++--------- 3 files changed, 137 insertions(+), 131 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 2f702781ddb1..aca0bfc1c140 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -1305,7 +1305,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer { setManipulatedFrame(nullptr); } else { setManipulatedFrame(m_frame_plane); } - + switch(m_use_clipping_plane) { case CLIPPING_PLANE_OFF: displayMessage(QString("Draw clipping = false")); break; @@ -1510,7 +1510,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer { CGAL::QGLViewer::keyPressEvent(e); } // By default call QGLViewer key press } } - + virtual QString helpString() const { return helpString("CGAL Basic Viewer"); } 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 daa202cf9628..280d9e7cd080 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -13,13 +13,12 @@ #ifndef CGAL_DRAW_LCC_H #define CGAL_DRAW_LCC_H -#include -#include #include -#include #ifdef CGAL_USE_BASIC_VIEWER +#include +#include #include #include @@ -90,7 +89,7 @@ void compute_face(typename LCC::Dart_const_handle dh, CGAL::IO::Color c=m_drawing_functor.face_color(*lcc, dh); graphic_buffer.face_begin(c); } - else + else { graphic_buffer.face_begin(); } cur=dh; @@ -148,7 +147,7 @@ void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, } template -void compute_elements(const LCC *lcc, CGAL::Graphic_buffer &graphic_buffer, +void compute_elements(const LCC *lcc, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { if (lcc==nullptr) @@ -228,37 +227,48 @@ void compute_elements(const LCC *lcc, CGAL::Graphic_buffer &graphic_ lcc->free_mark(oriented_mark); } -} // namespace draw_function +} // namespace draw_function_for_lcc -/** - * @brief This function is responsible for filling the buffer to allow - * visualization. - * - * @param graphic_buffer - * @param m_drawing_functor - * @param alcc - */ -template -void add_in_graphic_buffer(const LCC &alcc, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) +#define CGAL_LCC_TYPE \ + CGAL::Linear_cell_complex_base + +// add_in_graphic_buffer: to add a LCC in the given graphic buffer, with a +// drawing functor. +template class Map, + class Refs, class Storage_, + typename BufferType=float, class DrawingFunctor> +void add_in_graphic_buffer(const CGAL_LCC_TYPE &alcc, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor); } -template -void add_in_graphic_buffer(const LCC &alcc, CGAL::Graphic_buffer &graphic_buffer) +// add_in_graphic_buffer: to add a LCC in the given graphic buffer, without a +// drawing functor. Use default drawing values. +template class Map, + class Refs, class Storage_, typename BufferType=float> +void add_in_graphic_buffer(const CGAL_LCC_TYPE &alcc, + CGAL::Graphic_buffer &graphic_buffer) { - Drawing_functor_with_volume drawing_functor_with_volume; - - drawing_functor_with_volume.colored_volume = [](const LCC&, - typename LCC::Dart_const_handle) -> bool + CGAL::Drawing_functor_with_volume + drawing_functor_with_volume; + + drawing_functor_with_volume.colored_volume = [](const CGAL_LCC_TYPE&, + typename CGAL_LCC_TYPE::Dart_const_handle) -> bool { return true; }; - drawing_functor_with_volume.volume_color = [] (const LCC& alcc, - typename LCC::Dart_const_handle dh) -> CGAL::IO::Color + drawing_functor_with_volume.volume_color = [] (const CGAL_LCC_TYPE& alcc, + typename CGAL_LCC_TYPE::Dart_const_handle dh) -> CGAL::IO::Color { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); return get_random_color(random); @@ -267,33 +277,30 @@ void add_in_graphic_buffer(const LCC &alcc, CGAL::Graphic_buffer &gr add_in_graphic_buffer(alcc, graphic_buffer, drawing_functor_with_volume); } -// Specialization of draw function. -#define CGAL_LCC_TYPE \ - CGAL::Linear_cell_complex_base - +// Specialization of draw function for a LCC, with a drawing functor. template class Map, class Refs, class Storage_, class DrawingFunctor> -void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor, - const char *title = "LCC for CMap Basic Viewer") +void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor, + const char *title="LCC Basic Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(alcc, buffer, drawing_functor); - draw_buffer(buffer); + draw_buffer(buffer, title); } +// Specialization of draw function for a LCC, without a drawing functor. template class Map, class Refs, class Storage_> -void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer") +void draw(const CGAL_LCC_TYPE &alcc, const char *title="LCC Basic Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(alcc, buffer); - draw_buffer(buffer); + draw_buffer(buffer, title); } #undef CGAL_LCC_TYPE diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 640a75b86c3e..662a261b27bf 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -57,7 +57,6 @@ struct Drawing_functor_voronoi : std::function draw_dual_vertices; std::function draw_rays; - void disable_voronoi_vertices() { m_draw_voronoi_vertices=false; } void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; } bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; } @@ -70,7 +69,6 @@ struct Drawing_functor_voronoi : void enable_rays() { m_draw_rays=true; } bool are_rays_enabled() const { return m_draw_rays; } - void disable_nofaces() { m_nofaces=false; } void enable_nofaces() { m_nofaces=true; } bool are_nofaces_enabled() const { return m_nofaces; } @@ -88,15 +86,13 @@ typedef Local_kernel::Vector_3 Local_vector; template void compute_vertex(typename V2::Vertex_iterator vh, - CGAL::Graphic_buffer &graphic_buffer) { - graphic_buffer.add_point(vh->point()); -} + CGAL::Graphic_buffer &graphic_buffer) +{ graphic_buffer.add_point(vh->point()); } template void compute_dual_vertex(typename V2::Delaunay_graph::Finite_vertices_iterator vi, - CGAL::Graphic_buffer &graphic_buffer) { - graphic_buffer.add_point(vi->point(), CGAL::IO::Color(50, 100, 180)); -} + CGAL::Graphic_buffer &graphic_buffer) +{ graphic_buffer.add_point(vi->point(), CGAL::IO::Color(50, 100, 180)); } template void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, @@ -105,30 +101,33 @@ void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; - if (he->is_segment()) { - graphic_buffer.add_segment(he->source()->point(), he->target()->point()); - } else { + if (he->is_segment()) + { graphic_buffer.add_segment(he->source()->point(), he->target()->point()); } + else + { Delaunay_vertex_const_handle v1 = he->up(); Delaunay_vertex_const_handle v2 = he->down(); Kernel::Vector_2 direction(v1->point().y() - v2->point().y(), - v2->point().x() - v1->point().x()); - if (he->is_ray()) { + v2->point().x() - v1->point().x()); + if (he->is_ray()) + { Kernel::Point_2 end_point; - if (he->has_source()) { + if (he->has_source()) + { end_point = he->source()->point(); - // update_bounding_box_for_ray(end_point, direction); - - // update_bounding_box_for_ray - Local_point lp = Basic_viewer_qt<>::get_local_point(end_point); - Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); - CGAL::Bbox_3 b = (lp + lv).bbox(); - graphic_buffer.update_bounding_box(b); - + // update_bounding_box_for_ray(end_point, direction); + // update_bounding_box_for_ray + Local_point lp = Basic_viewer_qt<>::get_local_point(end_point); + Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); + CGAL::Bbox_3 b = (lp + lv).bbox(); + graphic_buffer.update_bounding_box(b); } - } else if (he->is_bisector()) { + } + else if (he->is_bisector()) + { Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, (v1->point().y() + v2->point().y()) / 2); Kernel::Vector_2 perpendicularDirection( @@ -145,7 +144,6 @@ void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); graphic_buffer.update_bounding_box(b); - } } } @@ -167,32 +165,37 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, // origin of the ray Kernel::Point_2 p; - if (ray->has_source()) { - p = ray->source()->point(); - } else { - p = ray->target()->point(); - } + if (ray->has_source()) + { p = ray->source()->point(); } + else + { p = ray->target()->point(); } // get the bounding box of the viewer Local_kernel::Vector_2 boundsMin(m_bounding_box.xmin(), - m_bounding_box.zmin()); + m_bounding_box.zmin()); Local_kernel::Vector_2 boundsMax(m_bounding_box.xmax(), - m_bounding_box.zmax()); + m_bounding_box.zmax()); // calculate intersection double txmax, txmin, tymax, tymin; - if (inv.x() >= 0) { + if (inv.x() >= 0) + { txmax = (boundsMax.x() - p.x()) * inv.x(); txmin = (boundsMin.x() - p.x()) * inv.x(); - } else { + } + else + { txmax = (boundsMin.x() - p.x()) * inv.x(); txmin = (boundsMax.x() - p.x()) * inv.x(); } - if (inv.y() >= 0) { + if (inv.y() >= 0) + { tymax = (boundsMax.y() - p.y()) * inv.y(); tymin = (boundsMin.y() - p.y()) * inv.y(); - } else { + } + else + { tymax = (boundsMin.y() - p.y()) * inv.y(); tymin = (boundsMax.y() - p.y()) * inv.y(); } @@ -203,20 +206,19 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, txmax = tymax; Local_kernel::Point_2 p1; - if (v.x() == 0) { - p1 = Local_kernel::Point_2(p.x(), p.y() + tymax * v.y()); - } else if (v.y() == 0) { - p1 = Local_kernel::Point_2(p.x() + txmax * v.x(), p.y()); - } else { - p1 = Local_kernel::Point_2(p.x() + txmax * v.x(), p.y() + tymax * v.y()); - } + if (v.x() == 0) + { p1 = Local_kernel::Point_2(p.x(), p.y() + tymax * v.y()); } + else if (v.y() == 0) + { p1 = Local_kernel::Point_2(p.x() + txmax * v.x(), p.y()); } + else + { p1 = Local_kernel::Point_2(p.x() + txmax * v.x(), p.y() + tymax * v.y()); } return p1; } // Halfedge_const_handle template void compute_rays_and_bisectors(typename V2::Halfedge_iterator he, - CGAL::Graphic_buffer &graphic_buffer) + CGAL::Graphic_buffer &graphic_buffer) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; @@ -225,7 +227,7 @@ void compute_rays_and_bisectors(typename V2::Halfedge_iterator he, Delaunay_vertex_const_handle v2 = he->down(); Kernel::Vector_2 direction(v1->point().y() - v2->point().y(), - v2->point().x() - v1->point().x()); + v2->point().x() - v1->point().x()); if (he->is_ray()) { if (he->has_source()) { // add_ray_segment(he->source()->point(), get_second_point(he, graphic_buffer.get_bounding_box())); @@ -276,7 +278,7 @@ void compute_face(typename V2::Face_iterator fh, } template -void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_buffer, +void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { typedef typename V2::Delaunay_graph::Finite_vertices_iterator Dual_vertices_iterator; @@ -290,61 +292,65 @@ void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_bu } // Draw the dual vertices - if (m_drawing_functor.are_dual_vertices_enabled()) { + if (m_drawing_functor.are_dual_vertices_enabled()) + { for (Dual_vertices_iterator it = v2.dual().finite_vertices_begin(); - it != v2.dual().finite_vertices_end(); ++it) { - compute_dual_vertex(it, graphic_buffer); - } + it != v2.dual().finite_vertices_end(); ++it) + { compute_dual_vertex(it, graphic_buffer); } } // Add segments and update bounding box for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); - it != v2.halfedges_end(); ++it) { - add_segments_and_update_bounding_box(it, graphic_buffer); - } + it != v2.halfedges_end(); ++it) + { add_segments_and_update_bounding_box(it, graphic_buffer); } - if(m_drawing_functor.are_rays_enabled()) { + if(m_drawing_functor.are_rays_enabled()) + { for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); - it != v2.halfedges_end(); ++it) { - compute_rays_and_bisectors(it, graphic_buffer); - } + it != v2.halfedges_end(); ++it) + { compute_rays_and_bisectors(it, graphic_buffer); } } - if (!m_drawing_functor.are_nofaces_enabled()) { + if (!m_drawing_functor.are_nofaces_enabled()) + { for (typename V2::Face_iterator it = v2.faces_begin(); - it != v2.faces_end(); ++it) { - compute_face(it, v2, graphic_buffer, m_drawing_functor); - } + it != v2.faces_end(); ++it) + { compute_face(it, v2, graphic_buffer, m_drawing_functor); } } } } // namespace draw_function_for_v2 -template -void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) +#define CGAL_VORONOI_TYPE CGAL::Voronoi_diagram_2 + +template +void add_in_graphic_buffer(const CGAL_VORONOI_TYPE &v2, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { draw_function_for_v2::compute_elements(v2, graphic_buffer, m_drawing_functor); } -template -void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graphic_buffer, +template +void add_in_graphic_buffer(const CGAL_VORONOI_TYPE &v2, + CGAL::Graphic_buffer &graphic_buffer, bool m_nofaces = false, bool m_draw_voronoi_vertices = true, - bool m_draw_dual_vertices = true ) { - + bool m_draw_dual_vertices = true ) +{ // Default functor; user can add his own functor. - CGAL::draw_function_for_v2::Drawing_functor_voronoi + CGAL::draw_function_for_v2::Drawing_functor_voronoi drawing_functor; - drawing_functor.colored_face = [](const V2&, - typename V2::Face_iterator fh) -> bool + drawing_functor.colored_face = [](const CGAL_VORONOI_TYPE&, + typename CGAL_VORONOI_TYPE::Face_iterator fh) -> bool { return true; }; - - drawing_functor.face_color = [] (const V2& alcc, - typename V2::Face_iterator fh) -> CGAL::IO::Color + drawing_functor.face_color = [] (const CGAL_VORONOI_TYPE& alcc, + typename CGAL_VORONOI_TYPE::Face_iterator fh) -> CGAL::IO::Color { return CGAL::IO::Color(73, 250, 117); }; @@ -358,32 +364,25 @@ void add_in_graphic_buffer(const V2 &v2, CGAL::Graphic_buffer &graph // setKeyDescription(::Qt::Key_D, "Toggles dual vertices display"); // setKeyDescription(::Qt::Key_V, "Toggles voronoi vertices display"); - - - // Specialization of draw function. -#define CGAL_VORONOI_TYPE CGAL::Voronoi_diagram_2 - -template +template void draw(const CGAL_VORONOI_TYPE &av2, - const DrawingFunctor &drawing_functor) + const DrawingFunctor &drawing_functor, + const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(av2, buffer, drawing_functor); - draw_buffer(buffer); + draw_buffer(buffer, title); } -template +template void draw(const CGAL_VORONOI_TYPE &av2, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphic_buffer buffer; - CGAL::draw_function_for_v2::Drawing_functor_voronoi @@ -402,7 +401,7 @@ void draw(const CGAL_VORONOI_TYPE &av2, add_in_graphic_buffer(av2, buffer, drawing_functor); - std::function *)> VoronoiKeyPressEvent = + std::function *)> VoronoiKeyPressEvent = [&av2, &drawing_functor] (QKeyEvent *e, CGAL::Basic_viewer_qt *_this) -> bool { /// [Keypress] @@ -469,7 +468,7 @@ void draw(const CGAL_VORONOI_TYPE &av2, /// [Keypress] return true; }; - draw_buffer(buffer, VoronoiKeyPressEvent); + draw_buffer(buffer, VoronoiKeyPressEvent, title); } From 331bc5c305449d883bab3a974968a14d2f6937f2 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 14 Oct 2022 09:07:19 +0200 Subject: [PATCH 094/399] add missing licence header --- GraphicsView/include/CGAL/Drawing_functor.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GraphicsView/include/CGAL/Drawing_functor.h b/GraphicsView/include/CGAL/Drawing_functor.h index b5516a63afb0..139e93e76388 100644 --- a/GraphicsView/include/CGAL/Drawing_functor.h +++ b/GraphicsView/include/CGAL/Drawing_functor.h @@ -13,6 +13,9 @@ #ifndef CGAL_DRAWING_FUNCTORS_H #define CGAL_DRAWING_FUNCTORS_H +#include +#include + namespace CGAL { // Drawing functor for a 2D combinatorial data structure From 744986f2a119bfb34a47a6fda25cc6e768838a2c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 14 Oct 2022 09:34:51 +0200 Subject: [PATCH 095/399] spaces --- .../doc/CGAL_basic_viewers/CGAL_basic_viewers.txt | 2 +- GraphicsView/include/CGAL/Buffer_for_vao.h | 2 +- Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp | 2 +- .../include/CGAL/draw_periodic_2_triangulation_2.h | 8 ++++---- Polygon/include/CGAL/draw_polygon_with_holes_2.h | 4 ++-- .../include/CGAL/draw_face_graph_with_paths.h | 6 +++--- Triangulation_3/include/CGAL/draw_triangulation_3.h | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt b/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt index 3cf6e4188ae2..7f268458568a 100644 --- a/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt +++ b/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt @@ -3,7 +3,7 @@ namespace CGAL { \mainpage User Manual \anchor Chapter_CGAL_Basic_viewers -\anchor +\anchor \cgalAutoToc \author Guillaume Damiand, Mostafa Ashraf diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index 6847863fc64e..6589800a9a23 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -164,7 +164,7 @@ class Buffer_for_vao if (m_flat_normal_buffer!=nullptr) { m_flat_normal_buffer->clear(); } if (m_gouraud_normal_buffer!=nullptr) { m_gouraud_normal_buffer->clear(); } if (m_bb!=nullptr) { (*m_bb)=CGAL::Bbox_3(); } - + m_zero_x=true; m_zero_y=true; m_zero_z=true; diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index 9289ade4c088..a773ebdb3f18 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -16,7 +16,7 @@ #include Viewer::Viewer(QWidget *parent) - : Base(parent, m_graphic_buffer, ""), + : Base(parent, m_graphic_buffer, ""), m_previous_scene_empty(true) { m_drawing_functor.volume_color=[](const LCC & alcc, diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index a1ade03cebda..6818134aebf4 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -38,7 +38,7 @@ enum Display_type }; template -void compute_vertex(typename P2T2::Periodic_point_iterator pi, const P2T2 &p2t2, +void compute_vertex(typename P2T2::Periodic_point_iterator pi, const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer) { // Construct the point in 9-sheeted covering space and add to viewer @@ -46,7 +46,7 @@ void compute_vertex(typename P2T2::Periodic_point_iterator pi, const P2T2 &p2t2, } template -void compute_edge(typename P2T2::Periodic_segment_iterator si, const P2T2 &p2t2, +void compute_edge(typename P2T2::Periodic_segment_iterator si, const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer) { typedef typename P2T2::Segment Segment; @@ -57,8 +57,8 @@ void compute_edge(typename P2T2::Periodic_segment_iterator si, const P2T2 &p2t2, } template -void compute_face(typename P2T2::Periodic_triangle_iterator ti, const P2T2 &p2t2, - CGAL::Graphic_buffer &graphic_buffer, +void compute_face(typename P2T2::Periodic_triangle_iterator ti, const P2T2 &p2t2, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { typedef typename P2T2::Triangle Triangle; diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 560e8eaf4c30..8c8ca0c75c7b 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -53,7 +53,7 @@ namespace draw_function_for_ph2_with_holes { template void compute_one_loop_elements(const typename P2::General_polygon_2& p, Graphic_buffer &graphic_buffer, bool hole) { - + if (hole) { graphic_buffer.add_point_in_face(p.vertex(p.size()-1)); } @@ -73,7 +73,7 @@ void compute_one_loop_elements(const typename P2::General_polygon_2& p, Graphic_ } template -void compute_elements(const P2& p2, Graphic_buffer &graphic_buffer, +void compute_elements(const P2& p2, Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index c3fa6ea0b754..e27f4784b787 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -32,7 +32,7 @@ namespace CGAL { - + namespace draw_function_for_lcc { // We need to re-use the namespace draw_function_for_lcc because we want to specialize @@ -98,14 +98,14 @@ struct LCC_geom_utils, Local_kernel, 3> }; } // namespace draw_function_for_lcc - + namespace draw_function_for_face_graph_with_paths { typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; - + // Destructor. // lcc.free_mark(m_oriented_mark); diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 8b24306806bf..2f78eb6db50f 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -114,7 +114,7 @@ void compute_elements(const T3 *t3, CGAL::Graphic_buffer &graphic_bu compute_vertex(it, graphic_buffer, drawing_functor, t3); } } - + } // namespace draw_function_for_t3 template @@ -149,10 +149,10 @@ void add_in_graphic_buffer(const T3 &at3, CGAL::Random random((unsigned int)((std::size_t)(&*(fh->first)) + (std::size_t)(fh->second))); - + return get_random_color(random); }; - + add_in_graphic_buffer(at3, graphic_buffer, drawing_functor); } From 47f01c77bc7ee948975ad0a88de80cccff002dbc Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 14 Oct 2022 11:32:58 +0200 Subject: [PATCH 096/399] Remove enum duplication --- GraphicsView/include/CGAL/Graphic_buffer.h | 11 +- .../include/CGAL/Qt/Basic_viewer_qt.h | 153 +++++++----------- 2 files changed, 69 insertions(+), 95 deletions(-) diff --git a/GraphicsView/include/CGAL/Graphic_buffer.h b/GraphicsView/include/CGAL/Graphic_buffer.h index 33ab61b80b86..84c934f33748 100644 --- a/GraphicsView/include/CGAL/Graphic_buffer.h +++ b/GraphicsView/include/CGAL/Graphic_buffer.h @@ -141,6 +141,12 @@ class Graphic_buffer std::vector &get_array_of_index(int index) { return arrays[index]; } + int get_size_of_index(int index) const + { return static_cast(arrays[index].size()*sizeof(BufferType)); } + + unsigned int number_of_elements(int index) const + { return static_cast(arrays[index].size()/3); } + void update_bounding_box(const CGAL::Bbox_3 &box) { m_bounding_box+=box; } void initiate_bounding_box(const CGAL::Bbox_3& new_bounding_box) @@ -360,10 +366,10 @@ class Graphic_buffer std::vector>& get_m_texts() { return m_texts; } -protected: +public: // The following enum gives the indices of different elements of arrays // vectors. - enum { + enum Buffers { BEGIN_POS = 0, POS_MONO_POINTS = BEGIN_POS, POS_COLORED_POINTS, @@ -393,6 +399,7 @@ class Graphic_buffer LAST_INDEX = END_NORMAL }; +protected: Buffer_for_vao m_buffer_for_mono_points; Buffer_for_vao m_buffer_for_colored_points; Buffer_for_vao m_buffer_for_mono_segments; diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index bb0666e24bb5..96737de517b2 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -83,6 +83,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; + using GB=Graphic_buffer; // Constructor/Destructor Basic_viewer_qt(QWidget* parent, @@ -201,9 +202,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer void clear() { - for (unsigned int i=0; i(gBuffer.get_array_of_index(POS_MONO_POINTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_MONO_POINTS).data(), + gBuffer.get_size_of_index(GB::POS_MONO_POINTS)); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); + // TODO/QUESTION can we use double for BufferType? + // if not remove the template parameter and use float everywhere. buffers[bufn].release(); @@ -497,8 +500,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_COLORED_POINTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_COLORED_POINTS).data(), + gBuffer.get_size_of_index(GB::POS_COLORED_POINTS)); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); buffers[bufn].release(); @@ -506,8 +509,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(COLOR_POINTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::COLOR_POINTS).data(), + gBuffer.get_size_of_index(GB::COLOR_POINTS)); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -522,8 +525,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_MONO_SEGMENTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_MONO_SEGMENTS).data(), + gBuffer.get_size_of_index(GB::POS_MONO_SEGMENTS)); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -539,8 +542,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_COLORED_SEGMENTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_COLORED_SEGMENTS).data(), + gBuffer.get_size_of_index(GB::POS_COLORED_SEGMENTS)); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -549,8 +552,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(COLOR_SEGMENTS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::COLOR_SEGMENTS).data(), + gBuffer.get_size_of_index(GB::COLOR_SEGMENTS)); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -567,8 +570,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_MONO_RAYS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_MONO_RAYS).data(), + gBuffer.get_size_of_index(GB::POS_MONO_RAYS)); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeArray("vertex",GL_FLOAT,0,3); @@ -585,8 +588,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_COLORED_RAYS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_COLORED_RAYS).data(), + gBuffer.get_size_of_index(GB::POS_COLORED_RAYS)); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -595,8 +598,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(COLOR_RAYS).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::COLOR_RAYS).data(), + gBuffer.get_size_of_index(GB::COLOR_RAYS)); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -612,8 +615,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_MONO_LINES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_MONO_LINES).data(), + gBuffer.get_size_of_index(GB::POS_MONO_LINES)); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeArray("vertex",GL_FLOAT,0,3); @@ -630,8 +633,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_COLORED_LINES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_COLORED_LINES).data(), + gBuffer.get_size_of_index(GB::POS_COLORED_LINES)); rendering_program_p_l.enableAttributeArray("vertex"); rendering_program_p_l.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -640,8 +643,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(COLOR_LINES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::COLOR_LINES).data(), + gBuffer.get_size_of_index(GB::COLOR_LINES)); rendering_program_p_l.enableAttributeArray("color"); rendering_program_p_l.setAttributeBuffer("color",GL_FLOAT,0,3); buffers[bufn].release(); @@ -660,8 +663,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_MONO_FACES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_MONO_FACES).data(), + gBuffer.get_size_of_index(GB::POS_MONO_FACES)); rendering_program_face.enableAttributeArray("vertex"); rendering_program_face.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -673,15 +676,13 @@ class Basic_viewer_qt : public CGAL::QGLViewer buffers[bufn].bind(); if (m_flatShading) { - buffers[bufn].allocate(gBuffer.get_array_of_index(FLAT_NORMAL_MONO_FACES).data(), - static_cast(gBuffer.get_array_of_index(FLAT_NORMAL_MONO_FACES).size()* - sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::FLAT_NORMAL_MONO_FACES).data(), + gBuffer.get_size_of_index(GB::FLAT_NORMAL_MONO_FACES)); } else { - buffers[bufn].allocate(gBuffer.get_array_of_index(SMOOTH_NORMAL_MONO_FACES).data(), - static_cast(gBuffer.get_array_of_index(SMOOTH_NORMAL_MONO_FACES).size()* - sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::SMOOTH_NORMAL_MONO_FACES).data(), + gBuffer.get_size_of_index(GB::SMOOTH_NORMAL_MONO_FACES)); } rendering_program_face.enableAttributeArray("normal"); rendering_program_face.setAttributeBuffer("normal",GL_FLOAT,0,3); @@ -699,8 +700,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(POS_COLORED_FACES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_COLORED_FACES).data(), + gBuffer.get_size_of_index(GB::POS_COLORED_FACES)); rendering_program_face.enableAttributeArray("vertex"); rendering_program_face.setAttributeBuffer("vertex",GL_FLOAT,0,3); @@ -712,15 +713,13 @@ class Basic_viewer_qt : public CGAL::QGLViewer buffers[bufn].bind(); if (m_flatShading) { - buffers[bufn].allocate(gBuffer.get_array_of_index(FLAT_NORMAL_COLORED_FACES).data(), - static_cast(gBuffer.get_array_of_index(FLAT_NORMAL_COLORED_FACES).size()* - sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::FLAT_NORMAL_COLORED_FACES).data(), + gBuffer.get_size_of_index(GB::FLAT_NORMAL_COLORED_FACES)); } else { - buffers[bufn].allocate(gBuffer.get_array_of_index(SMOOTH_NORMAL_COLORED_FACES).data(), - static_cast(gBuffer.get_array_of_index(SMOOTH_NORMAL_COLORED_FACES).size()* - sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::SMOOTH_NORMAL_COLORED_FACES).data(), + gBuffer.get_size_of_index(GB::SMOOTH_NORMAL_COLORED_FACES)); } rendering_program_face.enableAttributeArray("normal"); rendering_program_face.setAttributeBuffer("normal",GL_FLOAT,0,3); @@ -731,8 +730,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn(gBuffer.get_array_of_index(COLOR_FACES).size()*sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::COLOR_FACES).data(), + gBuffer.get_size_of_index(GB::COLOR_FACES)); rendering_program_face.enableAttributeArray("color"); rendering_program_face.setAttributeBuffer("color",GL_FLOAT,0,3); @@ -754,8 +753,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer ++bufn; CGAL_assertion(bufn < NB_VBO_BUFFERS); buffers[bufn].bind(); - buffers[bufn].allocate(gBuffer.get_array_of_index(POS_CLIPPING_PLANE).data(), - static_cast(gBuffer.get_array_of_index(POS_CLIPPING_PLANE).size() * sizeof(float))); + buffers[bufn].allocate(gBuffer.get_array_of_index(GB::POS_CLIPPING_PLANE).data(), + gBuffer.get_size_of_index(GB::POS_CLIPPING_PLANE)); rendering_program_clipping_plane.enableAttributeArray("vertex"); rendering_program_clipping_plane.setAttributeBuffer("vertex", GL_FLOAT, 0, 3); @@ -912,7 +911,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("clipPlane", clipPlane); rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_POINTS).size()/3)); + glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_POINTS))); vao[VAO_MONO_POINTS].release(); vao[VAO_COLORED_POINTS].bind(); @@ -932,7 +931,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("clipPlane", clipPlane); rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_POINTS).size()/3)); + glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_POINTS))); vao[VAO_COLORED_POINTS].release(); }; @@ -971,7 +970,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_SEGMENTS).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_SEGMENTS))); vao[VAO_MONO_SEGMENTS].release(); vao[VAO_COLORED_SEGMENTS].bind(); @@ -991,7 +990,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_SEGMENTS).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_SEGMENTS))); vao[VAO_COLORED_SEGMENTS].release(); }; @@ -1023,7 +1022,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (double)m_rays_mono_color.blue()/(double)255); rendering_program_p_l.setAttributeValue("color",color); glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_RAYS).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_RAYS))); vao[VAO_MONO_RAYS].release(); vao[VAO_COLORED_RAYS].bind(); @@ -1040,7 +1039,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.enableAttributeArray("color"); } glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_RAYS).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_RAYS))); vao[VAO_COLORED_RAYS].release(); rendering_program_p_l.release(); @@ -1056,7 +1055,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (double)m_lines_mono_color.blue()/(double)255); rendering_program_p_l.setAttributeValue("color",color); glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_LINES).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_LINES))); vao[VAO_MONO_LINES].release(); rendering_program_p_l.release(); @@ -1075,7 +1074,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.enableAttributeArray("color"); } glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_LINES).size()/3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_LINES))); vao[VAO_COLORED_LINES].release(); rendering_program_p_l.release(); @@ -1109,7 +1108,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); rendering_program_face.setUniformValue("clipPlane", clipPlane); rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.get_array_of_index(POS_MONO_FACES).size()/3)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_FACES))); vao[VAO_MONO_FACES].release(); vao[VAO_COLORED_FACES].bind(); @@ -1129,7 +1128,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); rendering_program_face.setUniformValue("clipPlane", clipPlane); rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.get_array_of_index(POS_COLORED_FACES).size()/3)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_FACES))); vao[VAO_COLORED_FACES].release(); }; @@ -1140,7 +1139,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_clipping_plane.bind(); vao[VAO_CLIPPING_PLANE].bind(); glLineWidth(0.1f); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.get_array_of_index(POS_CLIPPING_PLANE).size() / 3)); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_CLIPPING_PLANE))); glLineWidth(1.0f); vao[VAO_CLIPPING_PLANE].release(); rendering_program_clipping_plane.release(); @@ -1268,11 +1267,11 @@ class Basic_viewer_qt : public CGAL::QGLViewer (bounding_box().zmax() - bounding_box().zmin())); const unsigned int nbSubdivisions=30; - gBuffer.get_array_of_index(POS_CLIPPING_PLANE).clear(); + auto& array = gBuffer.get_array_of_index(GB::POS_CLIPPING_PLANE); + array.clear(); for (unsigned int i=0; i<=nbSubdivisions; ++i) { const float pos = float(size*(2.0*i/nbSubdivisions-1.0)); - auto& array = gBuffer.get_array_of_index(POS_CLIPPING_PLANE); array.push_back(pos); array.push_back(float(-size)); array.push_back(0.f); @@ -1595,40 +1594,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer // CGAL::qglviewer::LocalConstraint constraint; CGAL::qglviewer::WorldConstraint constraint; - // The following enum gives the indices of different elements of arrays vectors. - enum - { - BEGIN_POS=0, - POS_MONO_POINTS=BEGIN_POS, - POS_COLORED_POINTS, - POS_MONO_SEGMENTS, - POS_COLORED_SEGMENTS, - POS_MONO_RAYS, - POS_COLORED_RAYS, - POS_MONO_LINES, - POS_COLORED_LINES, - POS_MONO_FACES, - POS_COLORED_FACES, - POS_CLIPPING_PLANE, - END_POS, - BEGIN_COLOR=END_POS, - COLOR_POINTS=BEGIN_COLOR, - COLOR_SEGMENTS, - COLOR_RAYS, - COLOR_LINES, - COLOR_FACES, - END_COLOR, - BEGIN_NORMAL=END_COLOR, - SMOOTH_NORMAL_MONO_FACES=BEGIN_NORMAL, - FLAT_NORMAL_MONO_FACES, - SMOOTH_NORMAL_COLORED_FACES, - FLAT_NORMAL_COLORED_FACES, - END_NORMAL, - LAST_INDEX=END_NORMAL - }; - - static const unsigned int NB_VBO_BUFFERS=(END_POS-BEGIN_POS)+ - (END_COLOR-BEGIN_COLOR)+2; // +2 for 2 vectors of normals + static const unsigned int NB_VBO_BUFFERS=(GB::END_POS-GB::BEGIN_POS)+ + (GB::END_COLOR-GB::BEGIN_COLOR)+2; // +2 for 2 vectors of normals QGLBuffer buffers[NB_VBO_BUFFERS]; From 9c77619fde20f3291a22e7433a3dfc586a87aeac Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 14 Oct 2022 15:08:05 +0200 Subject: [PATCH 097/399] Remove unused constructor; move function that does not depend on Qt --- GraphicsView/include/CGAL/Graphic_buffer.h | 42 +++++++------------ .../include/CGAL/Qt/Basic_viewer_qt.h | 14 ------- 2 files changed, 15 insertions(+), 41 deletions(-) diff --git a/GraphicsView/include/CGAL/Graphic_buffer.h b/GraphicsView/include/CGAL/Graphic_buffer.h index 84c934f33748..c12b5aaa1ab0 100644 --- a/GraphicsView/include/CGAL/Graphic_buffer.h +++ b/GraphicsView/include/CGAL/Graphic_buffer.h @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -38,6 +39,20 @@ namespace CGAL { +//------------------------------------------------------------------------------ +inline CGAL::IO::Color get_random_color(CGAL::Random& random) +{ + CGAL::IO::Color res; + do + { + res=CGAL::IO::Color(random.get_int(0,256), + random.get_int(0,256), + random.get_int(0,256)); + } + while(res.red()==255 && res.green()==255 && res.blue()==255); + return res; +} +//------------------------------------------------------------------------------ // This class is responsible for dealing with available CGAL data structures and // handling buffers. template @@ -47,33 +62,6 @@ class Graphic_buffer typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; - Graphic_buffer(std::vector (&pos)[20], CGAL::Bbox_3 &bbox) - : m_buffer_for_mono_points(&pos[POS_MONO_POINTS], nullptr, &bbox, nullptr, - nullptr, nullptr), - m_buffer_for_colored_points(&pos[POS_COLORED_POINTS], nullptr, &bbox, - &pos[COLOR_POINTS], nullptr, nullptr), - m_buffer_for_mono_segments(&pos[POS_MONO_SEGMENTS], nullptr, &bbox, - nullptr, nullptr, nullptr), - m_buffer_for_colored_segments(&pos[POS_COLORED_SEGMENTS], nullptr, - &bbox, &pos[COLOR_SEGMENTS], nullptr, - nullptr), - m_buffer_for_mono_rays(&pos[POS_MONO_RAYS], nullptr, &bbox, nullptr, - nullptr), - m_buffer_for_colored_rays(&pos[POS_COLORED_RAYS], nullptr, &bbox, - &pos[COLOR_RAYS], nullptr, nullptr), - m_buffer_for_mono_lines(&pos[POS_MONO_RAYS], nullptr, &bbox, nullptr, - nullptr), - m_buffer_for_colored_lines(&pos[POS_COLORED_LINES], nullptr, &bbox, - &pos[COLOR_LINES], nullptr, nullptr), - m_buffer_for_mono_faces(&pos[POS_MONO_FACES], nullptr, &bbox, nullptr, - &pos[FLAT_NORMAL_MONO_FACES], - &pos[SMOOTH_NORMAL_MONO_FACES]), - m_buffer_for_colored_faces(&pos[POS_COLORED_FACES], nullptr, &bbox, - &pos[COLOR_FACES], - &pos[FLAT_NORMAL_COLORED_FACES], - &pos[SMOOTH_NORMAL_COLORED_FACES]) - {} - Graphic_buffer() : m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr, &m_bounding_box, nullptr, nullptr, nullptr), diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 96737de517b2..2f11a7b7489b 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -52,7 +52,6 @@ #include #include #include -#include #include #include @@ -62,19 +61,6 @@ namespace CGAL { -//------------------------------------------------------------------------------ -inline CGAL::IO::Color get_random_color(CGAL::Random& random) -{ - CGAL::IO::Color res; - do - { - res=CGAL::IO::Color(random.get_int(0,256), - random.get_int(0,256), - random.get_int(0,256)); - } - while(res.red()==255 && res.green()==255 && res.blue()==255); - return res; -} //------------------------------------------------------------------------------ template class Basic_viewer_qt : public CGAL::QGLViewer From afc0eaedf5a00bc96f1fd33c69a19426b56219ad Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 14 Oct 2022 15:08:32 +0200 Subject: [PATCH 098/399] Review of draw for face graph, polyhedron and sm --- BGL/include/CGAL/draw_face_graph.h | 149 +++++++++++------- Polyhedron/include/CGAL/draw_polyhedron.h | 64 +++++--- Surface_mesh/include/CGAL/draw_surface_mesh.h | 48 +++--- 3 files changed, 164 insertions(+), 97 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index e78016a56f15..f5784dc2a794 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -16,41 +16,40 @@ #include #include -#include - -#ifdef CGAL_USE_BASIC_VIEWER - #include #include #include namespace CGAL { -namespace draw_function_for_SM { +namespace draw_function_for_FG { -template -void compute_elements(const SM &sm, +template +void compute_elements(const FG &fg, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor, bool anofaces = false) { - - using Point = - typename boost::property_map_value::type; + const DrawingFunctor &m_drawing_functor) +{ + using Point=typename boost::property_map_value::type; using Kernel = typename CGAL::Kernel_traits::Kernel; using Vector = typename Kernel::Vector_3; - auto vnormals = get(CGAL::dynamic_vertex_property_t(), sm); - auto point_pmap = get(CGAL::vertex_point, sm); - for (auto v : vertices(sm)) { + auto vnormals = get(CGAL::dynamic_vertex_property_t(), fg); + auto point_pmap = get(CGAL::vertex_point, fg); + for (auto v : vertices(fg)) + { Vector n(NULL_VECTOR); int i = 0; - for (auto h : halfedges_around_target(halfedge(v, sm), sm)) { - if (!is_border(h, sm)) { + for (auto h : halfedges_around_target(halfedge(v, fg), fg)) + { + if (!is_border(h, fg)) + { Vector ni = CGAL::cross_product( - Vector(get(point_pmap, source(h, sm)), - get(point_pmap, target(h, sm))), - Vector(get(point_pmap, target(h, sm)), - get(point_pmap, target(next(h, sm), sm)))); - if (ni != NULL_VECTOR) { + Vector(get(point_pmap, source(h, fg)), + get(point_pmap, target(h, fg))), + Vector(get(point_pmap, target(h, fg)), + get(point_pmap, target(next(h, fg), fg)))); + if (ni != NULL_VECTOR) + { n += ni; ++i; } @@ -59,70 +58,104 @@ void compute_elements(const SM &sm, put(vnormals, v, n / i); } - if (!anofaces) { - for (auto fh : faces(sm)) { - if (fh != boost::graph_traits::null_face() && m_drawing_functor.colored_face(sm, fh)) { - CGAL::IO::Color c = m_drawing_functor.face_color(sm, fh); - graphic_buffer.face_begin(c); - auto hd = halfedge(fh, sm); + if (m_drawing_functor.are_faces_enabled()) + { + for (auto fh : faces(fg)) + { + if (fh != boost::graph_traits::null_face() && // face exists + m_drawing_functor.colored_face && // std::function is not null + m_drawing_functor.colored_face(fg, fh)) // and face is colored + { + graphic_buffer.face_begin(m_drawing_functor.face_color(fg, fh)); + auto hd = halfedge(fh, fg); const auto first_hd = hd; - do { - auto v = source(hd, sm); + do + { + auto v = source(hd, fg); graphic_buffer.add_point_in_face(get(point_pmap, v), get(vnormals, v)); - hd = next(hd, sm); - } while (hd != first_hd); + hd = next(hd, fg); + } + while (hd != first_hd); graphic_buffer.face_end(); } } } - for (auto e : edges(sm)) { - graphic_buffer.add_segment(get(point_pmap, source(halfedge(e, sm), sm)), - get(point_pmap, target(halfedge(e, sm), sm))); + if(m_drawing_functor.are_edges_enabled()) + { + for (auto e : edges(fg)) + { + if(m_drawing_functor.colored_edge && // std::function is not null + m_drawing_functor.colored_edge(fg, e)) // and edge is colored + { + graphic_buffer.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), + get(point_pmap, target(halfedge(e, fg), fg)), + m_drawing_functor.edge_color(fg, e)); + } + else + { + graphic_buffer.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), + get(point_pmap, target(halfedge(e, fg), fg))); + } + } } - for (auto v : vertices(sm)) { - graphic_buffer.add_point(get(point_pmap, v)); + if(m_drawing_functor.are_vertices_enabled()) + { + for (auto v : vertices(fg)) + { + if(m_drawing_functor.colored_vertex && // std::function is not null + m_drawing_functor.colored_vertex(fg, v)) // and vertex is colored + { + graphic_buffer.add_point(get(point_pmap, v), + m_drawing_functor.vertex_color(fg, v)); + } + else + { + graphic_buffer.add_point(get(point_pmap, v)); + } + } } } -} // draw_function_for_SM +} // draw_function_for_FG -template -void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) { - draw_function_for_SM::compute_elements(sm, graphic_buffer, m_drawing_functor); +template +void add_in_graphic_buffer_for_fg(const FG &fg, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &drawing_functor) +{ + draw_function_for_FG::compute_elements(fg, graphic_buffer, drawing_functor); } -template -void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer) { - - // Default functor; user can add his own functor. - Drawing_functor::face_descriptor, - typename boost::graph_traits::face_descriptor, - typename boost::graph_traits::face_descriptor> +template +void add_in_graphic_buffer_for_fg(const FG &fg, + CGAL::Graphic_buffer &graphic_buffer) +{ + Drawing_functor::vertex_descriptor, + typename boost::graph_traits::edge_descriptor, + typename boost::graph_traits::face_descriptor> drawing_functor; - drawing_functor.colored_face = [](const SM &, - typename boost::graph_traits::face_descriptor fh) -> bool + drawing_functor.colored_face = [](const FG&, + typename boost::graph_traits::face_descriptor) -> bool { return true; }; - drawing_functor.face_color = [] (const SM &, - typename boost::graph_traits::face_descriptor fh) -> CGAL::IO::Color + drawing_functor.face_color = [] (const FG&, + typename boost::graph_traits::face_descriptor fh) -> CGAL::IO::Color { - if (fh == - boost::graph_traits::null_face()) // use to get the mono color - return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 + if (fh==boost::graph_traits::null_face()) + { return CGAL::IO::Color(100, 125, 200); } + // TODO (?) use a seed given fh (cannot directly cast because FG is either a polyhedron or a surface mesh) return get_random_color(CGAL::get_default_random()); }; - add_in_graphic_buffer(sm, graphic_buffer, drawing_functor); + add_in_graphic_buffer_for_fg(fg, graphic_buffer, drawing_functor); } } // End namespace CGAL -#endif // CGAL_USE_BASIC_VIEWER - #endif // CGAL_DRAW_SURFACE_MESH_H diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index b6d92c56b3ae..826a2b7a6e3c 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -13,57 +13,81 @@ #ifndef CGAL_DRAW_POLYHEDRON_H #define CGAL_DRAW_POLYHEDRON_H +#include #include #include -#include -#include - -#ifdef CGAL_USE_BASIC_VIEWER -#include #include #include -#include + +#ifdef CGAL_USE_BASIC_VIEWER +#include +#endif namespace CGAL { -// Specialization of draw function. #define CGAL_POLY_TYPE CGAL::Polyhedron_3 \ +// Specialization of add_in_graphic_buffer function. template class T_HDS, - class Alloc, typename BufferType = float> + class Alloc, + typename BufferType=float, + class DrawingFunctor> +void add_in_graphic_buffer(const CGAL_POLY_TYPE& apoly, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &drawing_functor) +{ add_in_graphic_buffer_for_fg(apoly, graphic_buffer, drawing_functor); } + +template + class T_HDS, + class Alloc, + typename BufferType=float> +void add_in_graphic_buffer(const CGAL_POLY_TYPE& apoly, + CGAL::Graphic_buffer &graphic_buffer) +{ add_in_graphic_buffer_for_fg(apoly, graphic_buffer); } + +// Specialization of draw function: require Qt and the CGAL basic viewer. +#ifdef CGAL_USE_BASIC_VIEWER + +template + class T_HDS, + class Alloc, + typename BufferType=float> void draw(const CGAL_POLY_TYPE& apoly, - const char* title="Polyhedron Basic Viewer", - bool nofill=false) + const char* title="Polyhedron Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(apoly, buffer); - draw_buffer(buffer); + add_in_graphic_buffer_for_fg(apoly, buffer); + draw_buffer(buffer, title); } template class T_HDS, - class Alloc, typename BufferType = float, class DrawingFunctor> + class Alloc, + typename BufferType=float, + class DrawingFunctor> void draw(const CGAL_POLY_TYPE& apoly, const DrawingFunctor &drawing_functor, - const char* title="Polyhedron Basic Viewer", - bool nofill=false) + const char* title="Polyhedron Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(apoly, buffer, drawing_functor); - draw_buffer(buffer); + add_in_graphic_buffer_for_fg(apoly, buffer, drawing_functor); + draw_buffer(buffer, title); } - +#endif // CGAL_USE_BASIC_VIEWER + #undef CGAL_POLY_TYPE } // End namespace CGAL -#endif // CGAL_USE_BASIC_VIEWER - #endif // CGAL_DRAW_POLYHEDRON_H diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 184d80c5a830..c6a545a5bf85 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -29,46 +29,56 @@ void draw(const SM& asm); #else // DOXYGEN_RUNNING +#include #include #include -#include -#include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include #include #include +#ifdef CGAL_USE_BASIC_VIEWER +#include +#endif + namespace CGAL { -// Specialization of draw function. -template +template +void add_in_graphic_buffer(const Surface_mesh& amesh, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &drawing_functor) +{ add_in_graphic_buffer_for_fg(amesh, graphic_buffer, drawing_functor); } + +template +void add_in_graphic_buffer(const Surface_mesh& amesh, + CGAL::Graphic_buffer &graphic_buffer) +{ add_in_graphic_buffer_for_fg(amesh, graphic_buffer); } + +#ifdef CGAL_USE_BASIC_VIEWER + + // Specialization of draw function. +template void draw(const Surface_mesh& amesh, - const char* title="Surface_mesh Basic Viewer", - bool nofill=false) + const char* title="Surface_mesh Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(amesh, buffer); - draw_buffer(buffer); + add_in_graphic_buffer_for_fg(amesh, buffer); + draw_buffer(buffer, title); } -template +template void draw(const Surface_mesh& amesh, const DrawingFunctor &drawing_functor, - const char* title="Surface_mesh Basic Viewer", - bool nofill=false) + const char* title="Surface_mesh Basic Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(amesh, buffer, drawing_functor); - draw_buffer(buffer); + add_in_graphic_buffer_for_fg(amesh, buffer, drawing_functor); + draw_buffer(buffer, title); } -} // End namespace CGAL - #endif // CGAL_USE_BASIC_VIEWER +} // End namespace CGAL + #endif // DOXYGEN_RUNNING #endif // CGAL_DRAW_SURFACE_MESH_H From 0db66d139c84fa187fa38fc29c394cae3c2a0555 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 14 Oct 2022 15:09:37 +0200 Subject: [PATCH 099/399] example draw sm --- Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp index cbd42788fcc5..c8010cc05875 100644 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp @@ -1,8 +1,6 @@ #include #include - #include - #include typedef CGAL::Simple_cartesian Kernel; From 549fe77b63bde7714bf7cb07787d5afdb1809d99 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 14 Oct 2022 15:16:19 +0200 Subject: [PATCH 100/399] create examples directory for basic viewer --- .../CGAL_basic_viewers/CMakeLists.txt | 21 ++ .../draw_surface_mesh_small_faces.cpp | 27 ++ .../draw_surface_mesh_small_faces.h | 262 ------------------ 3 files changed, 48 insertions(+), 262 deletions(-) create mode 100644 CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt create mode 100644 CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp delete mode 100644 Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h diff --git a/CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt b/CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt new file mode 100644 index 000000000000..acfeb6e89425 --- /dev/null +++ b/CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt @@ -0,0 +1,21 @@ +# Created by the script cgal_create_cmake_script +# This is the CMake script for compiling a CGAL application. + +#/!\ /!\ +#/!\ /!\ +# Used in /CGAL/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt. +# Careful when modifying + +cmake_minimum_required(VERSION 3.1...3.23) +project(CGAL_basic_viewers) + +#CGAL_Qt5 is needed for the drawing. +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) + +create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") +if(CGAL_Qt5_FOUND) + #link it with the required CGAL libraries + target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) +endif() + +#end of the file diff --git a/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp b/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp new file mode 100644 index 000000000000..2fb9ab9c7c8f --- /dev/null +++ b/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_3 Point; +typedef CGAL::Surface_mesh Mesh; + +int main(int argc, char* argv[]) +{ + const std::string filename = (argc>1) ? argv[1] : CGAL::data_file_path("meshes/elephant.off"); + + Mesh sm; + if(!CGAL::IO::read_polygon_mesh(filename, sm)) + { + std::cerr << "Invalid input file." << std::endl; + return EXIT_FAILURE; + } + + CGAL::draw(sm); + + return EXIT_SUCCESS; +} 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 deleted file mode 100644 index 079b96fa8331..000000000000 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) 2018 GeometryFactory (France) -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// Author(s) : Guillaume Damiand -// Mostafa Ashraf - -#ifndef CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H -#define CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H - -#include -#include -#include -#include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include -#include - -#include - -namespace draw_function_for_surface_mesh -{ -template -typename CGAL::Kernel_traits::Kernel::Vector_3 get_face_normal(typename SM::Halfedge_index he, - const SM &sm) -{ - typedef typename SM::Halfedge_index halfedge_descriptor; - typedef typename SM::Point Point; - typedef typename CGAL::Kernel_traits::Kernel Kernel; - - 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)); -} - -template -typename CGAL::Kernel_traits::Kernel::Vector_3 get_vertex_normal(typename SM::Halfedge_index he, - const SM &sm) -{ - typedef typename SM::Point Point; - typedef typename CGAL::Kernel_traits::Kernel Kernel; - typedef typename SM::Halfedge_index halfedge_descriptor; - - 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, sm); - 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; -} - -template -void compute_face(typename SM::Face_index fh, - const SM &sm, - CGAL::Graphic_buffer &graphic_buffer, - typename CGAL::Kernel_traits::Kernel::FT & m_min_size, - typename CGAL::Kernel_traits::Kernel::FT & m_max_size) -{ - - typedef typename SM::Point Point; - typedef typename CGAL::Kernel_traits::Kernel Kernel; - typedef typename SM::Face_index face_descriptor; - typedef typename SM::Halfedge_index halfedge_descriptor; - typedef typename Kernel::FT FT; - - // TODO: add custom functor, right? - bool m_draw_small_faces = true; - bool m_draw_big_faces = true; - - unsigned int m_threshold = 85; - - // [Face creation] - bool issmall=false; - - // Default color of faces - CGAL::IO::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"); - assert(exist); - - // It it is smaller, color the face in red. - if (get(faces_size, fh) -void compute_edge(typename SM::Edge_index e, - const SM &sm, - CGAL::Graphic_buffer &graphic_buffer) -{ - /// [Edge creation] - graphic_buffer.add_segment(sm.point(sm.source(sm.halfedge(e))), - sm.point(sm.target(sm.halfedge(e)))); - /// [Edge creation] -} - -template -void compute_vertex(typename SM::Vertex_index vh, - const SM &sm, - CGAL::Graphic_buffer &graphic_buffer) -{ - /// [Vertex creation] - graphic_buffer.add_point(sm.point(vh)); - /// [Vertex creation] -} - -template -void compute_elements(const SM &sm, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) -{ - - 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; - - FT m_min_size, m_max_size; - - 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"); - assert(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; - } - } - - for (typename SM::Face_range::iterator f=sm.faces().begin(); - f!=sm.faces().end(); ++f) - { - if (*f!=boost::graph_traits::null_face()) - { compute_face(*f, sm, graphic_buffer, m_min_size, m_max_size); } - } - - for (typename SM::Edge_range::iterator e=sm.edges().begin(); - e!=sm.edges().end(); ++e) - { compute_edge(*e, sm, graphic_buffer); } - - for (typename SM::Vertex_range::iterator v=sm.vertices().begin(); - v!=sm.vertices().end(); ++v) - { compute_vertex(*v, sm, graphic_buffer); } -} - -} // draw_function_for_surface_mesh - -template -void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) { - draw_function_for_surface_mesh::compute_elements(sm, graphic_buffer, m_drawing_functor); -} - -template -void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer) { - - CGAL::Drawing_functor drawing_functor; - - add_in_graphic_buffer(sm, graphic_buffer, drawing_functor); -} - -template -void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh, - const DrawingFunctor &drawing_functor) -{ - CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(amesh, buffer, drawing_functor); - draw_buffer(buffer); -} - -template -void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh) -{ - CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(amesh, buffer); - draw_buffer(buffer); -} - -#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."< -void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh&, const DrawingFunctor &drawing_functor) -{ - std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Fri, 14 Oct 2022 16:03:25 +0200 Subject: [PATCH 101/399] some drawing functor are necessary non null; review of draw for lcc. --- BGL/include/CGAL/draw_face_graph.h | 8 +++---- GraphicsView/include/CGAL/Drawing_functor.h | 3 +++ .../include/CGAL/Qt/Basic_viewer_qt.h | 8 ++++++- .../include/CGAL/draw_linear_cell_complex.h | 22 +++++++++---------- Polyhedron/include/CGAL/draw_polyhedron.h | 3 --- Surface_mesh/include/CGAL/draw_surface_mesh.h | 3 --- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index f5784dc2a794..b47de2b34ee5 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -63,7 +63,7 @@ void compute_elements(const FG &fg, for (auto fh : faces(fg)) { if (fh != boost::graph_traits::null_face() && // face exists - m_drawing_functor.colored_face && // std::function is not null + !m_drawing_functor.face_wireframe(fg, fh) && // face is not wireframe m_drawing_functor.colored_face(fg, fh)) // and face is colored { graphic_buffer.face_begin(m_drawing_functor.face_color(fg, fh)); @@ -85,8 +85,7 @@ void compute_elements(const FG &fg, { for (auto e : edges(fg)) { - if(m_drawing_functor.colored_edge && // std::function is not null - m_drawing_functor.colored_edge(fg, e)) // and edge is colored + if(m_drawing_functor.colored_edge(fg, e)) // edge is colored { graphic_buffer.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), get(point_pmap, target(halfedge(e, fg), fg)), @@ -104,8 +103,7 @@ void compute_elements(const FG &fg, { for (auto v : vertices(fg)) { - if(m_drawing_functor.colored_vertex && // std::function is not null - m_drawing_functor.colored_vertex(fg, v)) // and vertex is colored + if(m_drawing_functor.colored_vertex(fg, v)) // vertex is colored { graphic_buffer.add_point(get(point_pmap, v), m_drawing_functor.vertex_color(fg, v)); diff --git a/GraphicsView/include/CGAL/Drawing_functor.h b/GraphicsView/include/CGAL/Drawing_functor.h index 139e93e76388..0a9ff09cb1df 100644 --- a/GraphicsView/include/CGAL/Drawing_functor.h +++ b/GraphicsView/include/CGAL/Drawing_functor.h @@ -41,6 +41,7 @@ struct Drawing_functor face_wireframe=[](const DS &, face_handle)->bool { return false; }; } + // The seven following functions should not be null std::function draw_vertex; std::function draw_edge; std::function draw_face; @@ -51,6 +52,8 @@ struct Drawing_functor std::function face_wireframe; + // These functions must be non null if the corresponding colored_XXX function + // returns true. std::function vertex_color; std::function edge_color; std::function face_color; diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 2f11a7b7489b..9da5555e705d 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -1670,7 +1670,13 @@ namespace CGAL { template - void draw(const T&, const char* ="", bool=false) + void draw(const T&, const char* ="") + { + std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< + void draw(const T&, const DrawingFunctor &, const char* ="") { std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< - -#ifdef CGAL_USE_BASIC_VIEWER - #include #include #include @@ -81,13 +78,11 @@ void compute_face(typename LCC::Dart_const_handle dh, if (m_drawing_functor.colored_volume(*lcc, voldh)) { - CGAL::IO::Color c=m_drawing_functor.volume_color(*lcc, voldh); - graphic_buffer.face_begin(c); + graphic_buffer.face_begin(m_drawing_functor.volume_color(*lcc, voldh)); } else if (m_drawing_functor.colored_face(*lcc, dh)) { - CGAL::IO::Color c=m_drawing_functor.face_color(*lcc, dh); - graphic_buffer.face_begin(c); + graphic_buffer.face_begin(m_drawing_functor.face_color(*lcc, dh)); } else { graphic_buffer.face_begin(); } @@ -128,7 +123,7 @@ void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, } } -template +template void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, const DrawingFunctorLCC &m_drawing_functor, CGAL::Graphic_buffer &graphic_buffer) @@ -146,8 +141,9 @@ void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, { graphic_buffer.add_point(lcc->point(dh)); } } -template -void compute_elements(const LCC *lcc, CGAL::Graphic_buffer &graphic_buffer, +template +void compute_elements(const LCC *lcc, + CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { if (lcc==nullptr) @@ -277,6 +273,8 @@ void add_in_graphic_buffer(const CGAL_LCC_TYPE &alcc, add_in_graphic_buffer(alcc, graphic_buffer, drawing_functor_with_volume); } +#ifdef CGAL_USE_BASIC_VIEWER + // Specialization of draw function for a LCC, with a drawing functor. template #include #include - -#ifdef CGAL_USE_BASIC_VIEWER #include -#endif namespace CGAL { diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index c6a545a5bf85..06edfe14e63c 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -34,10 +34,7 @@ void draw(const SM& asm); #include #include #include - -#ifdef CGAL_USE_BASIC_VIEWER #include -#endif namespace CGAL { From 1e8ef8f05ad704ea73dc56a10ce1cff762ef5076 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 17 Oct 2022 16:21:02 +0200 Subject: [PATCH 102/399] Update LCC demo to use a 'better' color for faces. --- .../demo/Linear_cell_complex/MainWindow.ui | 52 +++++++++---------- .../demo/Linear_cell_complex/Viewer.cpp | 30 ++++++++--- .../demo/Linear_cell_complex/Viewer.h | 8 +-- .../include/CGAL/draw_linear_cell_complex.h | 9 ++-- 4 files changed, 59 insertions(+), 40 deletions(-) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui index d63b9d7c9b1e..6a9f06c68d25 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui @@ -38,7 +38,7 @@ - &File + File @@ -55,7 +55,7 @@ - &Operations + Operations @@ -75,7 +75,7 @@ - &Creations + Creations @@ -88,7 +88,7 @@ - &View + View @@ -103,67 +103,67 @@ - &Import OFF + Import OFF - &Quit + Quit - &Subdivide all volumes + Subdivide all volumes - &Subdivide all volumes - by Pqq + Subdivide all volumes - by Pqq - Create &3 cubes + Create 3 cubes - Import 3D&TS + Import 3DTS - &Clear + Clear - Create &2 volumes + Create 2 volumes - &Dual + Dual - &Close all volumes + Close all volumes - Create &cube + Create cube - S&ew3 all same facets + Sew3 all same facets - Create &mesh + Create mesh @@ -173,22 +173,22 @@ - &Remove volumes + Remove volumes - &Triangulate facets + Triangulate facets - &Unsew3 volumes + Unsew3 volumes - Reverse &orientation + Reverse orientation @@ -201,12 +201,12 @@ - Extend &filled volumes + Extend filled volumes - Extend &hidden volumes + Extend hidden volumes @@ -216,7 +216,7 @@ - &Merge volumes + Merge volumes @@ -231,12 +231,12 @@ - &Load + Load - &Save + Save diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index a773ebdb3f18..6a7ba68de51f 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -19,17 +19,32 @@ Viewer::Viewer(QWidget *parent) : Base(parent, m_graphic_buffer, ""), m_previous_scene_empty(true) { - m_drawing_functor.volume_color=[](const LCC & alcc, - Dart_const_handle dh)->CGAL::IO::Color - { return alcc.template info<3>(dh).color(); }; + m_drawing_functor.face_color=[](const LCC & alcc, + Dart_const_descriptor dh)->CGAL::IO::Color + { + if(alcc.template is_free<3>(dh)) + { return alcc.template info<3>(dh).color(); } - m_drawing_functor.colored_volume=[](const LCC &, Dart_const_handle)->bool + if(!alcc.template info<3>(dh).is_visible() || + !alcc.template info<3>(dh).is_filled()) + { return alcc.template info<3>(alcc.template beta<3>(dh)).color(); } + + if(!alcc.template info<3>(alcc.template beta<3>(dh)).is_visible() || + !alcc.template info<3>(alcc.template beta<3>(dh)).is_filled()) + { return alcc.template info<3>(dh).color(); } + + const CGAL::IO::Color& c1=alcc.template info<3>(dh).color(); + const CGAL::IO::Color& c2=alcc.template info<3>(alcc.template beta<3>(dh)).color(); + return CGAL::IO::Color((c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2); + }; + + m_drawing_functor.colored_face=[](const LCC &, Dart_const_descriptor)->bool { return true; }; - m_drawing_functor.draw_volume=[](const LCC & alcc, Dart_const_handle dh)->bool + m_drawing_functor.draw_volume=[](const LCC & alcc, Dart_const_descriptor dh)->bool { return alcc.template info<3>(dh).is_visible(); }; - m_drawing_functor.volume_wireframe=[](const LCC& alcc, Dart_const_handle dh)->bool + m_drawing_functor.volume_wireframe=[](const LCC& alcc, Dart_const_descriptor dh)->bool { return !(alcc.template info<3>(dh).is_filled()); }; } @@ -69,4 +84,5 @@ void Viewer::keyPressEvent(QKeyEvent *e) Base::keyPressEvent(e); } -QString Viewer::helpString() const { return Base::helpString("LCC Demo"); } +QString Viewer::helpString() const +{ return Base::helpString("LCC Demo"); } diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 3b782fe09a82..c72feee6f32b 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -35,10 +35,10 @@ public Q_SLOTS: private: CGAL::Drawing_functor_with_volume m_drawing_functor; + Dart_const_descriptor, + Dart_const_descriptor, + Dart_const_descriptor, + Dart_const_descriptor> m_drawing_functor; CGAL::Graphic_buffer m_graphic_buffer; Scene* scene; bool m_previous_scene_empty; 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 d3718681031a..add255dfa6e0 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -111,7 +111,7 @@ void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, const typename LCC::Point& p1=lcc->point(dh); typename LCC::Dart_const_handle d2=lcc->other_extremity(dh); - if (d2!=nullptr) + if (d2!=LCC::null_descriptor) { if (m_drawing_functor.colored_edge(*lcc, dh)) { @@ -173,7 +173,9 @@ void compute_elements(const LCC *lcc, lcc->is_marked(itv, oriented_mark) && m_drawing_functor.draw_face(*lcc, itv)) { - if (!m_drawing_functor.volume_wireframe(*lcc, itv) && + if ((!m_drawing_functor.volume_wireframe(*lcc, itv) || + (!lcc->template is_free<3>(itv) && + !m_drawing_functor.volume_wireframe(*lcc, lcc->template beta<3>(itv)))) && !m_drawing_functor.face_wireframe(*lcc, itv)) { compute_face(itv, it, lcc, m_drawing_functor, graphic_buffer); } for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator @@ -240,7 +242,8 @@ void add_in_graphic_buffer(const CGAL_LCC_TYPE &alcc, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor) { - draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor); + draw_function_for_lcc::compute_elements(static_cast(&alcc), + graphic_buffer, m_drawing_functor); } // add_in_graphic_buffer: to add a LCC in the given graphic buffer, without a From 58fead22b1c2a3ba40ec7e1f48b605bf9051e610 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 17 Oct 2022 17:53:56 +0200 Subject: [PATCH 103/399] draw nef3 review --- .../CGAL_basic_viewers/CMakeLists.txt | 2 +- Nef_3/include/CGAL/draw_nef_3.h | 252 ++++++++++-------- 2 files changed, 139 insertions(+), 115 deletions(-) diff --git a/CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt b/CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt index acfeb6e89425..e5a6aa07ad8b 100644 --- a/CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt +++ b/CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt @@ -7,7 +7,7 @@ # Careful when modifying cmake_minimum_required(VERSION 3.1...3.23) -project(CGAL_basic_viewers) +project(CGAL_basic_viewers_Examples) #CGAL_Qt5 is needed for the drawing. find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 1c4e2ac1eb95..ccff10a5ef7c 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -14,14 +14,10 @@ #ifndef DRAW_NEF_3_H #define DRAW_NEF_3_H -#include -#include #include #include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include +#include +#include #include #include #include @@ -40,46 +36,44 @@ typedef Local_kernel::Vector_3 Local_vector; template Local_vector get_face_normal(typename Nef_Polyhedron::SHalfedge_const_handle she) { - typedef typename Nef_Polyhedron::SHalfedge_around_facet_const_circulator SHalfedge_around_facet_const_circulator; - - SHalfedge_around_facet_const_circulator he(she); - Local_vector normal = CGAL::NULL_VECTOR; - SHalfedge_around_facet_const_circulator end = he; - unsigned int nb = 0; + typename Nef_Polyhedron::SHalfedge_around_facet_const_circulator he(she), end(he); + Local_vector normal=CGAL::NULL_VECTOR; + unsigned int nb=0; + using GU=internal::Geom_utils::Kernel, + Local_kernel>; CGAL_For_all(he, end) { - internal::newell_single_step_3(Basic_viewer_qt<>::get_local_point - (he->next()->source()->center_vertex()->point()), - Basic_viewer_qt<>::get_local_point(he->source()->center_vertex()-> - point()), normal); + internal::newell_single_step_3(GU::get_local_point(he->next()->source()-> + center_vertex()->point()), + GU::get_local_point(he->source()->center_vertex()-> + point()), normal); ++nb; } CGAL_assertion(nb > 0); - return (typename Local_kernel::Construct_scaled_vector_3()(normal, 1.0 / nb)); + return (typename Local_kernel::Construct_scaled_vector_3()(normal, 1.0/nb)); } template Local_vector get_vertex_normal(typename Nef_Polyhedron::Vertex_const_handle vh) { - typedef typename Nef_Polyhedron::SHalfedge_const_handle SHalfedge_const_handle; - typedef typename Nef_Polyhedron::SHalfedge_const_iterator SHalfedge_const_iterator; - - Local_vector normal = CGAL::NULL_VECTOR; - - SHalfedge_const_iterator it = vh->shalfedges_begin(); - SHalfedge_const_handle end = it; - do { - Local_vector n = get_face_normal(it); - normal = typename Local_kernel::Construct_sum_of_vectors_3()(normal, n); - it = it->snext(); - } while( it != end ); + typename Nef_Polyhedron::SHalfedge_const_iterator it=vh->shalfedges_begin(); + typename Nef_Polyhedron::SHalfedge_const_handle end=it; + Local_vector normal=CGAL::NULL_VECTOR; + do + { + Local_vector n=get_face_normal(it); + normal=typename Local_kernel::Construct_sum_of_vectors_3()(normal, n); + it=it->snext(); + } + while(it!=end); if (!typename Local_kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) { - normal = (typename Local_kernel::Construct_scaled_vector_3()( - normal, 1.0 / CGAL::sqrt(normal.squared_length()))); + normal=(typename Local_kernel::Construct_scaled_vector_3() + (normal, 1.0/CGAL::sqrt(normal.squared_length()))); } return normal; @@ -96,51 +90,63 @@ class Nef_Visitor { typedef typename Nef_Polyhedron::Vertex_const_handle Vertex_const_handle; typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; typedef typename Nef_Polyhedron::SHalfloop_const_handle SHalfloop_const_handle; - typedef typename Nef_Polyhedron::Halffacet_cycle_const_iterator Halffacet_cycle_const_iterator; + typedef typename Nef_Polyhedron::Halffacet_cycle_const_iterator Halffacet_cycle_const_iterator; public: - Nef_Visitor(const Nef_Polyhedron &_nef, - CGAL::Graphic_buffer & _graphic_buffer, - const DrawingFunctor &_drawing_functor) - : n_faces(0), n_edges(0), + Nef_Visitor(const Nef_Polyhedron&_nef, + CGAL::Graphic_buffer& _graphic_buffer, + const DrawingFunctor&_drawing_functor) : + n_faces(0), n_edges(0), nef(_nef), graphic_buffer(_graphic_buffer), - drawing_functor(_drawing_functor) {} + drawing_functor(_drawing_functor) + {} - void visit(Vertex_const_handle vh) { - graphic_buffer.add_point(vh->point()); + void visit(Vertex_const_handle vh) + { + if (!drawing_functor.are_vertices_enabled() || + !drawing_functor.draw_vertex(nef, vh)) + { return; } + + if(drawing_functor.colored_vertex(nef, vh)) + { graphic_buffer.add_point(vh->point(), + drawing_functor.vertex_color(nef, vh)); } + else + { graphic_buffer.add_point(vh->point()); } } void visit(Halffacet_const_handle opposite_facet) { - Halffacet_const_handle f = opposite_facet->twin(); + if (!drawing_functor.are_faces_enabled() || + !drawing_functor.draw_face(nef, opposite_facet)) + { return; } - if (facets_done.find(f) != facets_done.end() || - facets_done.find(opposite_facet) != facets_done.end()) { - return; - } + Halffacet_const_handle f=opposite_facet->twin(); + if (facets_done.find(f)!=facets_done.end() || + facets_done.find(opposite_facet)!=facets_done.end()) + { return; } SHalfedge_const_handle se; Halffacet_cycle_const_iterator fc = f->facet_cycles_begin(); se = SHalfedge_const_handle(fc); // non-zero if shalfedge is returned - if(se == 0) - { //return if not-shalfedge - return; - } + if(se==0) + { return; } //return if not-shalfedge - if(drawing_functor.colored_face(nef, f)) { - CGAL::IO::Color c = drawing_functor.face_color(nef, f); - graphic_buffer.face_begin(c); - } + if(drawing_functor.colored_face(nef, f)) + { graphic_buffer.face_begin(drawing_functor.face_color(nef, f)); } + else + { graphic_buffer.face_begin(); } SHalfedge_around_facet_const_circulator hc_start(se); SHalfedge_around_facet_const_circulator hc_end(hc_start); Vertex_const_handle lastvh; - CGAL_For_all(hc_start, hc_end) { + CGAL_For_all(hc_start, hc_end) + { Vertex_const_handle vh=hc_start->source()->center_vertex(); lastvh=vh; - graphic_buffer.add_point_in_face(vh->point(), draw_function_for_nef_polyhedron::get_vertex_normal(vh)); + graphic_buffer.add_point_in_face(vh->point(), + get_vertex_normal(vh)); } // Now iterate through holes of the face @@ -150,34 +156,43 @@ class Nef_Visitor { se = SHalfedge_const_handle(fc); hc_start=se; hc_end=hc_start; - CGAL_For_all(hc_start, hc_end) { + CGAL_For_all(hc_start, hc_end) + { Vertex_const_handle vh=hc_start->source()->center_vertex(); - graphic_buffer.add_point_in_face(vh->point(), draw_function_for_nef_polyhedron::get_vertex_normal(vh)); + graphic_buffer.add_point_in_face(vh->point(), + get_vertex_normal(vh)); } graphic_buffer.add_point_in_face(hc_start->source()->center_vertex()->point(), - draw_function_for_nef_polyhedron::get_vertex_normal(hc_start->source()->center_vertex())); - graphic_buffer.add_point_in_face(lastvh->point(), draw_function_for_nef_polyhedron::get_vertex_normal(lastvh)); + get_vertex_normal + (hc_start->source()->center_vertex())); + graphic_buffer.add_point_in_face(lastvh->point(), + get_vertex_normal(lastvh)); ++fc; } graphic_buffer.face_end(); facets_done[f]=true; - n_faces++; + ++n_faces; } void visit(Halfedge_const_handle he) { - Halfedge_const_handle twin = he->twin(); - if (edges_done.find(he) != edges_done.end() || - edges_done.find(twin) != edges_done.end()) - { - // Edge already added - return; - } - - graphic_buffer.add_segment(he->source()->point(), he->target()->point()); - edges_done[he] = true; - n_edges++; + if (!drawing_functor.are_edges_enabled() || + !drawing_functor.draw_edge(nef, he)) + { return; } + + Halfedge_const_handle twin=he->twin(); + if (edges_done.find(he)!=edges_done.end() || + edges_done.find(twin)!=edges_done.end()) + { return; } // Edge already added + + if(drawing_functor.colored_edge(nef, he)) + { graphic_buffer.add_segment(he->source()->point(), he->target()->point(), + drawing_functor.edge_color(nef, he)); } + else + { graphic_buffer.add_segment(he->source()->point(), he->target()->point()); } + edges_done[he]=true; + ++n_edges; } void visit(SHalfedge_const_handle ) {} @@ -190,28 +205,27 @@ class Nef_Visitor { std::unordered_map edges_done; CGAL::Graphic_buffer& graphic_buffer; const DrawingFunctor& drawing_functor; - const Nef_Polyhedron &nef; + const Nef_Polyhedron& nef; }; -template -void compute_elements(const Nef_Polyhedron &nef, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) +template +void compute_elements(const Nef_Polyhedron &nef, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &drawing_functor) { - typedef typename Nef_Polyhedron::Volume_const_iterator Volume_const_iterator; - typedef typename Nef_Polyhedron::Shell_entry_const_iterator Shell_entry_const_iterator; - typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; + typedef typename Nef_Polyhedron::Volume_const_iterator Volume_const_iterator; + typedef typename Nef_Polyhedron::Shell_entry_const_iterator Shell_entry_const_iterator; + typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; Volume_const_iterator c; - - Nef_Visitor V(nef, graphic_buffer, m_drawing_functor); + Nef_Visitor + V(nef, graphic_buffer, drawing_functor); CGAL_forall_volumes(c, nef) { Shell_entry_const_iterator it; CGAL_forall_shells_of(it, c) - { - nef.visit_shell_objects(SFace_const_handle(it), V); - } + { nef.visit_shell_objects(SFace_const_handle(it), V); } } graphic_buffer.negate_all_normals(); @@ -219,65 +233,75 @@ void compute_elements(const Nef_Polyhedron &nef, CGAL::Graphic_buffer -void add_in_graphic_buffer(const Nef_Polyhedron &nef, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) { - draw_function_for_nef_polyhedron::compute_elements(nef, graphic_buffer, m_drawing_functor); -} +#define CGAL_NEF3_TYPE Nef_polyhedron_3 -template -void add_in_graphic_buffer(const Nef_Polyhedron &nef, CGAL::Graphic_buffer &graphic_buffer) { +// add_in_graphic_buffer +template +void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &drawing_functor) +{ + draw_function_for_nef_polyhedron::compute_elements(anef, + graphic_buffer, + drawing_functor); +} +template +void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, + CGAL::Graphic_buffer &graphic_buffer) +{ // Default functor; user can add his own functor. - Drawing_functor + Drawing_functor drawing_functor; - drawing_functor.colored_face = [] (const Nef_Polyhedron&, - typename Nef_Polyhedron::Halffacet_const_handle fh) -> bool - { - return true; - }; + drawing_functor.colored_face = [] (const CGAL_NEF3_TYPE&, + typename CGAL_NEF3_TYPE::Halffacet_const_handle) -> bool + { return true; }; - drawing_functor.face_color = [] (const Nef_Polyhedron&, - typename Nef_Polyhedron::Halffacet_const_handle fh) -> CGAL::IO::Color + drawing_functor.face_color = [] (const CGAL_NEF3_TYPE&, + typename CGAL_NEF3_TYPE::Halffacet_const_handle fh) -> CGAL::IO::Color { - if (fh == nullptr) // use to get the mono color - return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 + if (fh==nullptr) // use to get the mono color + { return CGAL::IO::Color(100, 125, 200); } CGAL::Random random((unsigned int)(std::size_t)(&(*fh))); return get_random_color(random); }; - add_in_graphic_buffer(nef, graphic_buffer, drawing_functor); + add_in_graphic_buffer(anef, graphic_buffer, drawing_functor); } -#define CGAL_NEF3_TYPE Nef_polyhedron_3 +#ifdef CGAL_USE_BASIC_VIEWER +// Specialization of draw function template + typename BufferType=float, class DrawingFunctor> void draw(const CGAL_NEF3_TYPE &anef, const DrawingFunctor &drawing_functor, - bool nofill = false) { + const char *title="Nef Polyhedron Viewer") +{ CGAL::Graphic_buffer buffer; add_in_graphic_buffer(anef, buffer, drawing_functor); - draw_buffer(buffer); + draw_buffer(buffer, title); } -template +template void draw(const CGAL_NEF3_TYPE &anef, - const char *title = "Nef Polyhedron Viewer", - bool nofill = false) { + const char *title="Nef Polyhedron Viewer") +{ CGAL::Graphic_buffer buffer; add_in_graphic_buffer(anef, buffer); - draw_buffer(buffer); + draw_buffer(buffer, title); } -} // End namespace CGAL - #endif // CGAL_USE_BASIC_VIEWER +} // End namespace CGAL + #endif // DRAW_NEF_3_H From 8e93b8ccbc4c609cfd24543a3148e2ec2cafac23 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 17 Oct 2022 18:02:52 +0200 Subject: [PATCH 104/399] spaces --- BGL/include/CGAL/draw_face_graph.h | 6 +++--- Polyhedron/include/CGAL/draw_polyhedron.h | 4 ++-- Surface_mesh/include/CGAL/draw_surface_mesh.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index b47de2b34ee5..a691e0c2fcf7 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -86,7 +86,7 @@ void compute_elements(const FG &fg, for (auto e : edges(fg)) { if(m_drawing_functor.colored_edge(fg, e)) // edge is colored - { + { graphic_buffer.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), get(point_pmap, target(halfedge(e, fg), fg)), m_drawing_functor.edge_color(fg, e)); @@ -104,12 +104,12 @@ void compute_elements(const FG &fg, for (auto v : vertices(fg)) { if(m_drawing_functor.colored_vertex(fg, v)) // vertex is colored - { + { graphic_buffer.add_point(get(point_pmap, v), m_drawing_functor.vertex_color(fg, v)); } else - { + { graphic_buffer.add_point(get(point_pmap, v)); } } diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 85e3b363f086..81bbdb4370f2 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -51,7 +51,7 @@ void add_in_graphic_buffer(const CGAL_POLY_TYPE& apoly, // Specialization of draw function: require Qt and the CGAL basic viewer. #ifdef CGAL_USE_BASIC_VIEWER - + template @@ -82,7 +82,7 @@ void draw(const CGAL_POLY_TYPE& apoly, draw_buffer(buffer, title); } #endif // CGAL_USE_BASIC_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 06edfe14e63c..cad60c4e87d4 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -44,12 +44,12 @@ void add_in_graphic_buffer(const Surface_mesh& amesh, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &drawing_functor) { add_in_graphic_buffer_for_fg(amesh, graphic_buffer, drawing_functor); } - + template void add_in_graphic_buffer(const Surface_mesh& amesh, CGAL::Graphic_buffer &graphic_buffer) { add_in_graphic_buffer_for_fg(amesh, graphic_buffer); } - + #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. From 1b1e6999e1644ffb7a4bc9d2838dad19c1bafb9e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 17 Oct 2022 19:44:26 +0200 Subject: [PATCH 105/399] Review point set 3 --- Point_set_3/include/CGAL/draw_point_set_3.h | 96 +++++++++++++-------- 1 file changed, 62 insertions(+), 34 deletions(-) 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 087092a05623..80e372ca7446 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -14,8 +14,11 @@ #ifndef CGAL_DRAW_POINT_SET_3_H #define CGAL_DRAW_POINT_SET_3_H -#include #include +#include +#include +#include +#include #ifdef DOXYGEN_RUNNING namespace CGAL { @@ -35,55 +38,80 @@ void draw(const PS& aps); } /* namespace CGAL */ #endif -#ifdef CGAL_USE_BASIC_VIEWER - -#include -#include -#include - namespace CGAL { namespace draw_function_for_PointSet { -template -void compute_vertex(const typename PointSet::Point_map::value_type &p, - Graphic_buffer &graphic_buffer) { - graphic_buffer.add_point(p); - - // We can use add_point(p, c) with c a CGAL::IO::Color to add a colored point - // E.g: graphic_buffer.add_point(p, CGAL::IO::Color(100, 125, 200)); -} - -template -void compute_elements(const PointSet *pointset, - Graphic_buffer &graphic_buffer) { - for (typename PointSet::const_iterator it = pointset->begin(); - it != pointset->end(); ++it) { - compute_vertex(pointset->point(*it), graphic_buffer); +template +void compute_elements(const PointSet& pointset, + Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (!drawing_functor.are_vertices_enabled()) + { return; } + + for (typename PointSet::const_iterator it=pointset.begin(); + it!=pointset.end(); ++it) + { + if(drawing_functor.draw_vertex(pointset, it)) + { + if (drawing_functor.colored_vertex(pointset, it)) + { + graphic_buffer.add_point(pointset.point(*it), + drawing_functor.vertex_color(pointset, it)); + } + else + { graphic_buffer.add_point(pointset.point(*it)); } + } } } } // namespace draw_function_for_PointSet -template -void add_in_graphic_buffer(Graphic_buffer &graphic_buffer, - const PointSet *aPointSet = nullptr) { - if (aPointSet != nullptr) { - draw_function_for_PointSet::compute_elements(aPointSet, graphic_buffer); - } +template +void add_in_graphic_buffer(const Point_set_3& apointset, + Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + draw_function_for_PointSet::compute_elements(apointset, + graphic_buffer, + drawing_functor); } +template +void add_in_graphic_buffer(const Point_set_3& apointset, + Graphic_buffer& graphic_buffer) +{ + CGAL::Drawing_functor, + typename Point_set_3::const_iterator, + int, int> drawing_functor; + add_in_graphic_buffer(apointset, graphic_buffer, drawing_functor); +} + +#ifdef CGAL_USE_BASIC_VIEWER + // Specialization of draw function. -template -void draw(const Point_set_3 &apointset, - const char *title = "Point_set_3 Basic Viewer") { + template +void draw(const Point_set_3& apointset, + const DrawingFunctor& drawing_functor, + const char *title="Point_set_3 Basic Viewer") +{ Graphic_buffer buffer; - add_in_graphic_buffer(buffer, &apointset); - draw_buffer(buffer); + add_in_graphic_buffer(apointset, buffer, drawing_functor); + draw_buffer(buffer, title); } -} // End namespace CGAL +template +void draw(const Point_set_3& apointset, + const char *title="Point_set_3 Basic Viewer") +{ + Graphic_buffer buffer; + add_in_graphic_buffer(apointset, buffer); + draw_buffer(buffer, title); +} #endif // CGAL_USE_BASIC_VIEWER +} // End namespace CGAL + #endif // CGAL_DRAW_POINT_SET_3_H From 72c760845ae9866c475991a053eca0310a9ebdf2 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 18 Oct 2022 08:42:53 +0200 Subject: [PATCH 106/399] review draw polygon2 --- Polygon/include/CGAL/draw_polygon_2.h | 120 +++++++++++++++++--------- 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 2b29ee2dc4fd..e97a29bcd597 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -18,9 +18,10 @@ #ifndef CGAL_DRAW_POLYGON_2_H #define CGAL_DRAW_POLYGON_2_H -#include -#include #include +#include +#include +#include #ifdef DOXYGEN_RUNNING namespace CGAL { @@ -41,70 +42,107 @@ void draw(const P& ap); #endif -#ifdef CGAL_USE_BASIC_VIEWER - -#include -#include -#include - namespace CGAL { namespace draw_function_for_p2 { -template -void compute_elements(CGAL::Graphic_buffer &graphic_buffer, - const P2 *p2) { - - typedef typename P2::Point_2 Point; - - if (p2->is_empty()) +template +void compute_elements(const P2& p2, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (p2.is_empty()) return; - Point prev = p2->vertex(p2->size() - 1); + typename P2::Point_2 prev=p2.vertex(p2.size()-1); - CGAL::IO::Color c(75, 160, 255); - graphic_buffer.face_begin(c); + if (drawing_functor.are_faces_enabled()) + { + if(drawing_functor.colored_face(p2, nullptr)) + { graphic_buffer.face_begin(drawing_functor.face_color(p2, nullptr)); } + else + { graphic_buffer.face_begin(); } + } + + for (typename P2::Vertex_const_iterator i=p2.vertices_begin(); + i!=p2.vertices_end(); ++i) + { + if(drawing_functor.are_vertices_enabled() && + drawing_functor.draw_vertex(p2, i)) + { // Add vertex + if(drawing_functor.colored_vertex(p2, i)) + { graphic_buffer.add_point(*i, drawing_functor.vertex_color(p2, i)); } + else + { graphic_buffer.add_point(*i); } + } + + if(drawing_functor.are_edges_enabled() && + drawing_functor.draw_edge(p2, i)) + { // Add edge with previous point + if(drawing_functor.colored_vertex(p2, i)) + { graphic_buffer.add_segment(prev, *i, drawing_functor.edge_color(p2, i)); } + else + { graphic_buffer.add_segment(prev, *i); } + } + + if(drawing_functor.are_faces_enabled()) + { graphic_buffer.add_point_in_face(*i); } // Add point in face - for (typename P2::Vertex_const_iterator i = p2->vertices_begin(); - i != p2->vertices_end(); ++i) { - graphic_buffer.add_point(*i); // Add vertex - graphic_buffer.add_segment(prev, *i); // Add segment with previous point - graphic_buffer.add_point_in_face(*i); // Add point in face prev = *i; } - graphic_buffer.face_end(); + if (drawing_functor.are_faces_enabled()) + { graphic_buffer.face_end(); } } } // namespace draw_function_for_p2 -template -void add_in_graphic_buffer(CGAL::Graphic_buffer &graphic_buffer, - const P2 *p2 = nullptr) { - if (p2 != nullptr) { - draw_function_for_p2::compute_elements(graphic_buffer, p2); - } +#define CGAL_P2_TYPE CGAL::Polygon_2 + +// Specializations of add_in_graphic_buffer function + +template +void add_in_graphic_buffer(const CGAL_P2_TYPE& ap2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawingfunctor) +{ draw_function_for_p2::compute_elements(ap2, graphic_buffer, drawingfunctor); } + +template +void add_in_graphic_buffer(const CGAL_P2_TYPE& ap2, + CGAL::Graphic_buffer &graphic_buffer) +{ + CGAL::Drawing_functor drawingfunctor; + draw_function_for_p2::compute_elements(ap2, graphic_buffer, drawingfunctor); } // Specialization of draw function. -#define CGAL_P2_TYPE CGAL::Polygon_2 + +#ifdef CGAL_USE_BASIC_VIEWER template void draw(const CGAL_P2_TYPE &ap2, - const char *title = "Polygon_2 Basic Viewer") { - - // Drawing_functor - // drawingFunctor; - + const char *title="Polygon_2 Basic Viewer") +{ CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(buffer, &ap2); - draw_buffer(buffer); + add_in_graphic_buffer(ap2, buffer); + draw_buffer(buffer, title); } -} // End namespace CGAL +template +void draw(const CGAL_P2_TYPE &ap2, + const DrawingFunctor& drawingfunctor, + const char *title="Polygon_2 Basic Viewer") +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(ap2, buffer, drawingfunctor); + draw_buffer(buffer, title); +} #endif // CGAL_USE_BASIC_VIEWER +} // End namespace CGAL + #endif // CGAL_DRAW_POLYGON_2_H From 199499b1dcc195d4d7c1841056c10a738f0303ae Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 18 Oct 2022 09:23:18 +0200 Subject: [PATCH 107/399] Review draw polygon with holes --- .../include/CGAL/draw_polygon_with_holes_2.h | 136 +++++++++++------- 1 file changed, 84 insertions(+), 52 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 8c8ca0c75c7b..b90e2ba2d481 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -18,9 +18,10 @@ #ifndef CGAL_DRAW_POLYGON_WITH_HOLES_2_H #define CGAL_DRAW_POLYGON_WITH_HOLES_2_H -#include -#include #include +#include +#include +#include #ifdef DOXYGEN_RUNNING namespace CGAL { @@ -40,104 +41,135 @@ void draw(const PH& aph); } /* namespace CGAL */ #endif -#ifdef CGAL_USE_BASIC_VIEWER -#include -#include -#include - namespace CGAL { namespace draw_function_for_ph2_with_holes { -template -void compute_one_loop_elements(const typename P2::General_polygon_2& p, Graphic_buffer &graphic_buffer, bool hole) +template +void compute_one_loop_elements(const P2& ap2, + const typename P2::General_polygon_2& aloop, + Graphic_buffer &graphic_buffer, + bool hole, + const DrawingFunctor& drawing_functor) { - - if (hole) - { graphic_buffer.add_point_in_face(p.vertex(p.size()-1)); } + if (hole && drawing_functor.are_faces_enabled()) + { graphic_buffer.add_point_in_face(aloop.vertex(aloop.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) + for(typename P2::General_polygon_2::Vertex_const_iterator i=aloop.vertices_begin(); + i!=aloop.vertices_end(); ++i) { - graphic_buffer.add_point(*i); // Add vertex - if (i!=p.vertices_begin()) - { graphic_buffer.add_segment(*prev, *i); } // Add segment with previous point - graphic_buffer.add_point_in_face(*i); // Add point in face + if(drawing_functor.are_vertices_enabled() && + drawing_functor.draw_vertex(ap2, i)) + { // Add vertex + if(drawing_functor.colored_vertex(ap2, i)) + { graphic_buffer.add_point(*i, drawing_functor.vertex_color(ap2, i)); } + else + { graphic_buffer.add_point(*i); } + } + + if(i!=aloop.vertices_begin() && + drawing_functor.are_edges_enabled() && + drawing_functor.draw_edge(ap2, i)) + { // Add segment with previous point + if(drawing_functor.colored_vertex(ap2, i)) + { graphic_buffer.add_segment(*prev, *i, drawing_functor.edge_color(ap2, i)); } + else + { graphic_buffer.add_segment(*prev, *i); } + } + + if(drawing_functor.are_faces_enabled()) + { graphic_buffer.add_point_in_face(*i); } // Add point in face + prev=i; } // Add the last segment between the last point and the first one - graphic_buffer.add_segment(*prev, *(p.vertices_begin())); + if(drawing_functor.are_edges_enabled() && + drawing_functor.draw_edge(ap2, aloop.vertices_begin())) + { graphic_buffer.add_segment(*prev, *(aloop.vertices_begin())); } } -template +template void compute_elements(const P2& p2, Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) + const DrawingFunctor& drawing_functor) { - if (p2.outer_boundary().is_empty()) return; - // TODO: use face_color after adding a handler if exists. - CGAL::IO::Color c(75,160,255); - graphic_buffer.face_begin(c); + if (drawing_functor.are_faces_enabled()) + { + if(drawing_functor.colored_face(p2, nullptr)) + { graphic_buffer.face_begin(drawing_functor.face_color(p2, nullptr)); } + else + { graphic_buffer.face_begin(); } + } - compute_one_loop_elements(p2.outer_boundary(), graphic_buffer, false); + compute_one_loop_elements(p2, p2.outer_boundary(), graphic_buffer, + false, drawing_functor); for (typename P2::Hole_const_iterator it=p2.holes_begin(); it!=p2.holes_end(); ++it) { - compute_one_loop_elements(*it, graphic_buffer, true); - graphic_buffer.add_point_in_face(p2.outer_boundary().vertex(p2.outer_boundary().size()-1)); + compute_one_loop_elements(p2, *it, graphic_buffer, + true, drawing_functor); + if (drawing_functor.are_faces_enabled()) + { graphic_buffer.add_point_in_face(p2.outer_boundary().vertex + (p2.outer_boundary().size()-1)); + } } - graphic_buffer.face_end(); + if (drawing_functor.are_faces_enabled()) + { graphic_buffer.face_end(); } } } // draw_function_for_ph2 +#define CGAL_P2_WITH_HOLES_TYPE CGAL::Polygon_with_holes_2 -template -void add_in_graphic_buffer(const P2 &p2, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor ) { - draw_function_for_ph2_with_holes::compute_elements(p2, graphic_buffer, m_drawing_functor); +template +void add_in_graphic_buffer(const CGAL_P2_WITH_HOLES_TYPE& p2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor &drawing_functor) +{ + draw_function_for_ph2_with_holes::compute_elements(p2, graphic_buffer, + drawing_functor); } -template -void add_in_graphic_buffer(const P2 &p2, CGAL::Graphic_buffer &graphic_buffer) { - - // TODO: use colord_face and face_color if a handler exits. - Drawing_functor - drawing_functor; +template +void add_in_graphic_buffer(const CGAL_P2_WITH_HOLES_TYPE& p2, + CGAL::Graphic_buffer& graphic_buffer) +{ + Drawing_functor drawing_functor; add_in_graphic_buffer(p2, graphic_buffer, drawing_functor); } -// Specialization of draw function. -#define CGAL_P2_WITH_HOLES_TYPE CGAL::Polygon_with_holes_2 - +#ifdef CGAL_USE_BASIC_VIEWER -template -void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const DrawingFunctor &drawing_functor) +// Specialization of draw function. +template +void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const DrawingFunctor &drawing_functor, + const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(ap2, buffer, drawing_functor); - draw_buffer(buffer); + draw_buffer(buffer, title); } -template +template void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, - const char* title="Polygon_with_holes_2 Basic Viewer") + const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(ap2, buffer); - draw_buffer(buffer); + draw_buffer(buffer, title); } -} // End namespace CGAL - #endif // CGAL_USE_BASIC_VIEWER +} // End namespace CGAL + #endif // CGAL_DRAW_POLYGON_WITH_HOLES_2_H From 2970aa585b2e9ed64233d038261635c3d6f155f1 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 18 Oct 2022 11:23:34 +0200 Subject: [PATCH 108/399] review draw triangulation2 --- .../include/CGAL/draw_triangulation_2.h | 217 +++++++++--------- 1 file changed, 104 insertions(+), 113 deletions(-) diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 8d141854f148..2ae142e3d3f6 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -13,42 +13,30 @@ #ifndef CGAL_DRAW_T2_H #define CGAL_DRAW_T2_H -#include -#include -#include #include - -#include - +#include +#include +#include #include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include #include -#include namespace CGAL { namespace draw_function_for_t2 { -template -void compute_face(typename T2::Finite_faces_iterator fh, - const DrawingFunctor &drawing_functor, - CGAL::Graphic_buffer &graphic_buffer, - const T2 *t2) { - - if (!drawing_functor.draw_face(*t2, fh)) { - return; - } - - if (drawing_functor.colored_face(*t2, fh) && drawing_functor.face_color) { - CGAL::IO::Color c = drawing_functor.face_color(*t2, fh); - graphic_buffer.face_begin(c); +template +void compute_face(const T2& t2, + typename T2::Finite_faces_iterator fh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (!drawing_functor.draw_face(t2, fh)) + { return; } - } else { - graphic_buffer.face_begin(); - } + if (drawing_functor.colored_face(t2, fh)) + { graphic_buffer.face_begin(drawing_functor.face_color(t2, fh)); } + else + { graphic_buffer.face_begin(); } graphic_buffer.add_point_in_face(fh->vertex(0)->point()); graphic_buffer.add_point_in_face(fh->vertex(1)->point()); @@ -57,133 +45,136 @@ void compute_face(typename T2::Finite_faces_iterator fh, graphic_buffer.face_end(); } -template -void compute_edge(typename T2::Finite_edges_iterator eh, - const DrawingFunctor &drawing_functor, const T2 *t2, - CGAL::Graphic_buffer &graphic_buffer) { - - if (!drawing_functor.draw_edge(*t2, eh)) { - return; +template +void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (!drawing_functor.draw_edge(t2, eh)) + { return; } + + if (drawing_functor.colored_edge(t2, eh)) + { + graphic_buffer.add_segment + (eh->first->vertex(eh->first->cw(eh->second))->point(), + eh->first->vertex(eh->first->ccw(eh->second))->point(), + drawing_functor.edge_color(t2, eh)); } - - if (drawing_functor.colored_edge(*t2, eh) && drawing_functor.edge_color) { - - CGAL::IO::Color c = drawing_functor.edge_color(*t2, eh); - graphic_buffer.add_segment( - eh->first->vertex(eh->first->cw(eh->second))->point(), - eh->first->vertex(eh->first->ccw(eh->second))->point(), c); - } - - else { - graphic_buffer.add_segment( - eh->first->vertex(eh->first->cw(eh->second))->point(), - eh->first->vertex(eh->first->ccw(eh->second))->point()); + else + { + graphic_buffer.add_segment + (eh->first->vertex(eh->first->cw(eh->second))->point(), + eh->first->vertex(eh->first->ccw(eh->second))->point()); } } -template -void compute_vertex(typename T2::Vertex_handle vh, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor, const T2 *t2) { - - if (!drawing_functor.draw_vertex(*t2, vh)) { - return; +template +void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (!drawing_functor.draw_vertex(t2, vh)) + { return; } + + if (drawing_functor.colored_vertex(t2, vh)) + { + graphic_buffer.add_point(vh->point(), drawing_functor.vertex_color(t2, vh)); } - - if (drawing_functor.colored_vertex(*t2, vh) && drawing_functor.vertex_color) { - CGAL::IO::Color c = drawing_functor.vertex_color(*t2, vh); - graphic_buffer.add_point(vh->point(), c); - } else { + else + { graphic_buffer.add_point(vh->point()); } } -template -void compute_elements(const T2 *t2, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor, - bool m_nofaces = false) { - - if (!m_nofaces) { - for (typename T2::Finite_faces_iterator it = t2->finite_faces_begin(); - it != t2->finite_faces_end(); ++it) { - compute_face(it, drawing_functor, graphic_buffer, t2); - } +template +void compute_elements(const T2& t2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (drawing_functor.are_faces_enabled()) + { + for (typename T2::Finite_faces_iterator it=t2.finite_faces_begin(); + it!=t2.finite_faces_end(); ++it) + { compute_face(t2, it, graphic_buffer, drawing_functor); } } - for (typename T2::Finite_edges_iterator it = t2->finite_edges_begin(); - it != t2->finite_edges_end(); ++it) { - compute_edge(it, drawing_functor, t2, graphic_buffer); + if (drawing_functor.are_edges_enabled()) + { + for (typename T2::Finite_edges_iterator it=t2.finite_edges_begin(); + it!=t2.finite_edges_end(); ++it) + { compute_edge(t2, it, graphic_buffer, drawing_functor); } } - for (typename T2::Finite_vertices_iterator it = t2->finite_vertices_begin(); - it != t2->finite_vertices_end(); ++it) { - compute_vertex(it, graphic_buffer, drawing_functor, t2); + if (drawing_functor.are_vertices_enabled()) + { + for (typename T2::Finite_vertices_iterator it=t2.finite_vertices_begin(); + it!=t2.finite_vertices_end(); ++it) + { compute_vertex(t2, it, graphic_buffer, drawing_functor); } } } } // namespace draw_function_for_t2 -template -void add_in_graphic_buffer(const T2 &at2, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor, - bool m_nofaces = false) { - draw_function_for_t2::compute_elements(&at2, graphic_buffer, drawing_functor, - m_nofaces); -} +#define CGAL_T2_TYPE CGAL::Triangulation_2 -template -void add_in_graphic_buffer(const T2 &at2, - CGAL::Graphic_buffer &graphic_buffer, - bool m_nofaces = false) { +template +void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + draw_function_for_t2::compute_elements(at2, graphic_buffer, drawing_functor); +} +template +void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, + CGAL::Graphic_buffer& graphic_buffer) +{ CGAL::Graphic_buffer buffer; - Drawing_functor + Drawing_functor drawingFunctor; drawingFunctor.colored_face = - [](const T2 &at2, const typename T2::Finite_faces_iterator fh) -> bool { - return true; - }; + [](const CGAL_T2_TYPE&, const typename CGAL_T2_TYPE::Finite_faces_iterator) -> bool + { return true; }; drawingFunctor.face_color = - [](const T2 &at2, - const typename T2::Finite_faces_iterator fh) -> CGAL::IO::Color { - CGAL::Random random((unsigned int)(std::size_t)(&*fh)); - return get_random_color(random); - }; + [](const CGAL_T2_TYPE&, const typename CGAL_T2_TYPE::Finite_faces_iterator fh) -> CGAL::IO::Color + { + CGAL::Random random((unsigned int)(std::size_t)(&*fh)); + return get_random_color(random); + }; - add_in_graphic_buffer(at2, graphic_buffer, drawingFunctor, m_nofaces); + add_in_graphic_buffer(at2, graphic_buffer, drawingFunctor); } -// Specialization of draw function. -#define CGAL_T2_TYPE CGAL::Triangulation_2 +#ifdef CGAL_USE_BASIC_VIEWER +// Specialization of draw function. template void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, - const char *title = "Triangulation_2 Basic Viewer", - bool nofill = false) { + const char *title="Triangulation_2 Basic Viewer") +{ CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(at2, buffer, drawingfunctor, nofill); - draw_buffer(buffer); + add_in_graphic_buffer(at2, buffer, drawingfunctor); + draw_buffer(buffer, title); } template -void draw(const CGAL_T2_TYPE &at2, - const char *title = "Triangulation_2 Basic Viewer", - bool nofill = false) { +void draw(const CGAL_T2_TYPE& at2, + const char *title="Triangulation_2 Basic Viewer") +{ CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(at2, buffer, nofill); - draw_buffer(buffer); + add_in_graphic_buffer(at2, buffer); + draw_buffer(buffer, title); } +#endif // CGAL_USE_BASIC_VIEWER + #undef CGAL_T2_TYPE } // End namespace CGAL -#endif // CGAL_USE_BASIC_VIEWER - #endif // CGAL_DRAW_T2_H From 0d49e61847f2ed9e4508969076f01a88637e1288 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 18 Oct 2022 13:15:21 +0200 Subject: [PATCH 109/399] add missing include --- GraphicsView/include/CGAL/Drawing_functor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/GraphicsView/include/CGAL/Drawing_functor.h b/GraphicsView/include/CGAL/Drawing_functor.h index 0a9ff09cb1df..ce69a05a45fc 100644 --- a/GraphicsView/include/CGAL/Drawing_functor.h +++ b/GraphicsView/include/CGAL/Drawing_functor.h @@ -14,6 +14,7 @@ #define CGAL_DRAWING_FUNCTORS_H #include +#include #include namespace CGAL { From 999d496cdf5367b0dbcd727b8a3cdb5f0b715d39 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 18 Oct 2022 13:23:08 +0200 Subject: [PATCH 110/399] review draw triangulation3 --- .../include/CGAL/draw_triangulation_3.h | 150 +++++++++--------- 1 file changed, 74 insertions(+), 76 deletions(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 2f78eb6db50f..51a082dd43c7 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -13,14 +13,10 @@ #ifndef CGAL_DRAW_T3_H #define CGAL_DRAW_T3_H -#include -#include -#include #include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include +#include +#include +#include #include #include @@ -29,157 +25,159 @@ namespace CGAL { namespace draw_function_for_t3 { -template +template void compute_face(typename T3::Finite_facets_iterator fh, - const DrawingFunctor &drawing_functor, - CGAL::Graphic_buffer &graphic_buffer, const T3 *t3) + const DrawingFunctor& drawing_functor, + CGAL::Graphic_buffer& graphic_buffer, const T3 *t3) { if(!drawing_functor.draw_face(*t3, fh)) { return; } - if(drawing_functor.colored_face(*t3, fh) && drawing_functor.face_color) - { - CGAL::IO::Color c = drawing_functor.face_color(*t3, fh); - graphic_buffer.face_begin(c); - } + if(drawing_functor.colored_face(*t3, fh)) + { graphic_buffer.face_begin(drawing_functor.face_color(*t3, fh)); } else { graphic_buffer.face_begin(); } - graphic_buffer.add_point_in_face( - fh->first->vertex((fh->second + 1) % 4)->point()); - graphic_buffer.add_point_in_face( - fh->first->vertex((fh->second + 2) % 4)->point()); - graphic_buffer.add_point_in_face( - fh->first->vertex((fh->second + 3) % 4)->point()); + graphic_buffer.add_point_in_face(fh->first->vertex((fh->second + 1) % 4)-> + point()); + graphic_buffer.add_point_in_face(fh->first->vertex((fh->second + 2) % 4)-> + point()); + graphic_buffer.add_point_in_face(fh->first->vertex((fh->second + 3) % 4)-> + point()); graphic_buffer.face_end(); } -template +template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor, const T3 *t3) + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor, const T3* t3) { if(!drawing_functor.draw_edge(*t3, eh)) { return; } - if(drawing_functor.colored_edge(*t3, eh) && drawing_functor.edge_color) + if(drawing_functor.colored_edge(*t3, eh)) { - CGAL::IO::Color c = drawing_functor.edge_color(*t3, eh); graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), - eh->first->vertex(eh->third)->point(), c); + eh->first->vertex(eh->third)->point(), + drawing_functor.edge_color(*t3, eh)); } else { graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), - eh->first->vertex(eh->third)->point()); + eh->first->vertex(eh->third)->point()); } } -template +template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor, const T3 *t3) + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor, const T3* t3) { if(!drawing_functor.draw_vertex(*t3, vh)) { return; } - if(drawing_functor.colored_vertex(*t3, vh) && drawing_functor.vertex_color) + if(drawing_functor.colored_vertex(*t3, vh)) { - CGAL::IO::Color c = drawing_functor.vertex_color(*t3, vh); - graphic_buffer.add_point(vh->point(), c); + graphic_buffer.add_point(vh->point(), drawing_functor.vertex_color(*t3, vh)); } else { graphic_buffer.add_point(vh->point()); } } -template -void compute_elements(const T3 *t3, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor) +template +void compute_elements(const T3* t3, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { - for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin(); - it != t3->finite_facets_end(); ++it) + if (drawing_functor.are_faces_enabled()) { - compute_face(it, drawing_functor, graphic_buffer, t3); + for (typename T3::Finite_facets_iterator it=t3->finite_facets_begin(); + it!=t3->finite_facets_end(); ++it) + { compute_face(it, drawing_functor, graphic_buffer, t3); } } - for (typename T3::Finite_edges_iterator it = t3->finite_edges_begin(); - it != t3->finite_edges_end(); ++it) + if (drawing_functor.are_edges_enabled()) { - compute_edge(it, graphic_buffer,drawing_functor , t3); + for (typename T3::Finite_edges_iterator it=t3->finite_edges_begin(); + it!=t3->finite_edges_end(); ++it) + { compute_edge(it, graphic_buffer,drawing_functor, t3); } } - for (typename T3::Finite_vertices_iterator it = t3->finite_vertices_begin(); - it != t3->finite_vertices_end(); ++it) + if (drawing_functor.are_vertices_enabled()) { - compute_vertex(it, graphic_buffer, drawing_functor, t3); + for (typename T3::Finite_vertices_iterator it=t3->finite_vertices_begin(); + it!=t3->finite_vertices_end(); ++it) + { compute_vertex(it, graphic_buffer, drawing_functor, t3); } } } } // namespace draw_function_for_t3 -template -void add_in_graphic_buffer(const T3 &at3, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor) +#define CGAL_T3_TYPE CGAL::Triangulation_3 + +template +void add_in_graphic_buffer(const CGAL_T3_TYPE& at3, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { draw_function_for_t3::compute_elements(&at3, graphic_buffer, drawing_functor); } -template -void add_in_graphic_buffer(const T3 &at3, - CGAL::Graphic_buffer &graphic_buffer) +template +void add_in_graphic_buffer(const CGAL_T3_TYPE& at3, + CGAL::Graphic_buffer& graphic_buffer) { - CGAL::Drawing_functor + CGAL::Drawing_functor drawing_functor; drawing_functor.colored_face = - [](const T3 &at3, const typename T3::Finite_facets_iterator fh) - -> bool + [](const CGAL_T3_TYPE &, const typename CGAL_T3_TYPE::Finite_facets_iterator) -> bool { return true; }; - drawing_functor.face_color = - [](const T3 &at3, const typename T3::Finite_facets_iterator fh) - -> CGAL::IO::Color + drawing_functor.face_color = + [](const CGAL_T3_TYPE &at3, const typename CGAL_T3_TYPE::Finite_facets_iterator fh) -> CGAL::IO::Color { - if (fh==at3.finite_facets_end()) // use to get the mono color - return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 + if (fh==at3.finite_facets_end()) // use to get the mono color + return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 - CGAL::Random random((unsigned int)((std::size_t)(&*(fh->first)) + - (std::size_t)(fh->second))); + CGAL::Random random((unsigned int)((std::size_t)(&*(fh->first)) + + (std::size_t)(fh->second))); - return get_random_color(random); - }; + return get_random_color(random); + }; add_in_graphic_buffer(at3, graphic_buffer, drawing_functor); } -// Specialization of draw function. -#define CGAL_T3_TYPE CGAL::Triangulation_3 +#ifdef CGAL_USE_BASIC_VIEWER +// Specialization of draw function. template void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, - const char *title = "T3 Basic Viewer") + const char *title="T3 Basic Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(at3, buffer, drawingfunctor); - draw_buffer(buffer); + draw_buffer(buffer, title); } template -void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer") +void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(at3, buffer); - draw_buffer(buffer); + draw_buffer(buffer, title); } +#endif // CGAL_USE_BASIC_VIEWER + #undef CGAL_T3_TYPE } // End namespace CGAL -#endif // CGAL_USE_BASIC_VIEWER - #endif // CGAL_DRAW_T3_H From 8c546efe71b518a7a5fa02ea31e0ee9784e7beca Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 18 Oct 2022 15:28:19 +0200 Subject: [PATCH 111/399] code review for polygon triangulation --- .../Triangulation_2/polygon_triangulation.cpp | 6 +- .../polygon_triangulation_drawing_functor.h | 88 +++++++++ .../CGAL/draw_constrained_triangulation_2.h | 180 ------------------ 3 files changed, 92 insertions(+), 182 deletions(-) create mode 100644 Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h delete mode 100644 Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp b/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp index 405f7eb5516b..7d19420679d1 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp @@ -1,8 +1,9 @@ #include #include -#include #include #include +#include +#include "polygon_triangulation_drawing_functor.h" #include #include @@ -57,6 +58,7 @@ int main( ) assert(count > 0); assert(count < cdt.number_of_faces()); - CGAL::draw(cdt, in_domain); + CGAL::Polygon_triangulation_drawing_functor myfunctor(in_domain); + CGAL::draw(cdt, myfunctor); return 0; } diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h new file mode 100644 index 000000000000..983ae936a8dc --- /dev/null +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h @@ -0,0 +1,88 @@ +// Copyright(c) 2022 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_POLYGON_TRIANGULATION_DRAWING_FUNCTOR_H +#define CGAL_POLYGON_TRIANGULATION_DRAWING_FUNCTOR_H + +#include +#include +#include +#include +#include + +namespace CGAL +{ + +template +struct Polygon_triangulation_drawing_functor : + public CGAL::Drawing_functor +{ + template + Polygon_triangulation_drawing_functor(IPM ipm) + { + this->colored_face = + [](const PT&, const typename PT::Finite_faces_iterator) -> bool + { return true; }; + + this->face_color = + [](const PT&, const typename PT::Finite_faces_iterator fh) -> CGAL::IO::Color + { + CGAL::Random random((unsigned int)(std::size_t)(&*fh)); + return get_random_color(random); + }; + + this->draw_face= + [ipm](const PT&, const typename PT::Finite_faces_iterator fh) -> bool + { return get(ipm, fh); }; + + this->draw_edge= + [ipm](const PT& pt, const typename PT::Finite_edges_iterator eh) -> bool + { + typename PT::Face_handle fh1=eh->first; + typename PT::Face_handle fh2=pt.mirror_edge(*eh).first; + return get(ipm, fh1) || get(ipm, fh2); + }; + } +}; + +#define CGAL_CT2_TYPE CGAL::Constrained_Delaunay_triangulation_2 + +template +void add_in_graphic_buffer(const CGAL_CT2_TYPE& ct2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + draw_function_for_t2::compute_elements(ct2, graphic_buffer, drawing_functor); +} + +#ifdef CGAL_USE_BASIC_VIEWER + +// Specialization of draw function. +template +void draw(const CGAL_CT2_TYPE &ct2, const DrawingFunctor &drawingfunctor, + const char *title="Constrained Triangulation_2 Basic Viewer") +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(ct2, buffer, drawingfunctor); + draw_buffer(buffer, title); +} + +#endif // CGAL_USE_BASIC_VIEWER + +#undef CGAL_CT2_TYPE + +}; // end namespace CGAL + +#endif // CGAL_POLYGON_TRIANGULATION_DRAWING_FUNCTOR_H diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h deleted file mode 100644 index 7bc3856bc9de..000000000000 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright(c) 2022 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// Author(s) : Andreas Fabri - -#ifndef CGAL_DRAW_CT2_H -#define CGAL_DRAW_CT2_H - -#include -#include - -#include -#include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include - -namespace CGAL -{ - -// Viewer class for T2 - template -class SimpleConstrainedTriangulation2ViewerQt : public Basic_viewer_qt -{ - typedef Basic_viewer_qt Base; - typedef typename T2::Vertex_handle Vertex_const_handle; - typedef typename T2::Finite_edges_iterator Edge_const_handle; - typedef typename T2::Finite_faces_iterator Facet_const_handle; - typedef typename T2::Point Point; - -public: - /// Construct the viewer. - /// @param at2 the t2 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) - SimpleConstrainedTriangulation2ViewerQt(QWidget* parent, const T2& at2, - InDomainPmap ipm, - const char* title="Basic CDT2 Viewer", - bool anofaces=false) : - // First draw: vertices; edges, faces; multi-color; no inverse normal - Base(parent, title, true, true, true, false, false), - t2(at2), - ipm(ipm), - m_nofaces(anofaces) - { - compute_elements(); - } - -protected: - void compute_face(Facet_const_handle fh) - { - CGAL::IO::Color c = get(ipm, fh)? CGAL::yellow() : CGAL::white(); - face_begin(c); - - add_point_in_face(fh->vertex(0)->point()); - add_point_in_face(fh->vertex(1)->point()); - add_point_in_face(fh->vertex(2)->point()); - - face_end(); - } - - void compute_edge(Edge_const_handle eh) - { - CGAL::IO::Color c = t2.is_constrained(*eh)? CGAL::green() : CGAL::black(); - add_segment(eh->first->vertex(eh->first->cw(eh->second))->point(), - eh->first->vertex(eh->first->ccw(eh->second))->point(), - c); - } - - void compute_vertex(Vertex_const_handle vh) - { add_point(vh->point()); } - - void compute_elements() - { - clear(); - - if (!m_nofaces) - { - for (typename T2::Finite_faces_iterator it=t2.finite_faces_begin(); - it!=t2.finite_faces_end(); ++it) - { compute_face(it); } - } - - for (typename T2::Finite_edges_iterator it=t2.finite_edges_begin(); - it!=t2.finite_edges_end(); ++it) - { compute_edge(it); } - - for (typename T2::Finite_vertices_iterator it=t2.finite_vertices_begin(); - it!=t2.finite_vertices_end(); ++it) - { compute_vertex(it); } - } - - 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 T2& t2; - InDomainPmap ipm; - bool m_nofaces; -}; - -// Specialization of draw function. -#define CGAL_T2_TYPE CGAL::Constrained_triangulation_2 - -template -void draw(const CGAL_T2_TYPE& at2, - InDomainPmap ipm) -{ - const char* title="Constrained_triangulation_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) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"t2_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimpleConstrainedTriangulation2ViewerQt - mainwindow(app.activeWindow(), at2, ipm, title, nofill); - mainwindow.show(); - app.exec(); - } -} - - -template -void draw(const CGAL_T2_TYPE& at2) -{ - internal::In_domain in_domain; - draw(at2, in_domain); -} - -#undef CGAL_T2_TYPE - -} // End namespace CGAL - -#else - -namespace CGAL { -// Specialization of draw function. -#define CGAL_T2_TYPE CGAL::Constrained_triangulation_2 - -template -void draw(const CGAL_T2_TYPE& , - InDomainPmap ) -{} -#undef CGAL_T2_TYPE - -} // End namespace CGAL - -#endif // CGAL_USE_BASIC_VIEWER - -#endif // CGAL_DRAW_CT2_H From d1eed1dc0ff4897c44652d9b7aa133afc27114a3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 18 Oct 2022 16:14:23 +0200 Subject: [PATCH 112/399] start straight skeleton 2, NYF --- .../include/CGAL/draw_straight_skeleton_2.h | 209 +++++++++++------- 1 file changed, 130 insertions(+), 79 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index c489126d3185..3557378d6206 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -13,46 +13,49 @@ #ifndef CGAL_DRAW_SS2_H #define CGAL_DRAW_SS2_H -#include -#include -#include #include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include +#include +#include +#include #include - #include namespace CGAL { namespace draw_function_for_ss2 { -template -void compute_edge(typename SS2::Halfedge_const_handle eh, - const DrawingFunctor &drawing_functor, const SS2 *ss2, - CGAL::Graphic_buffer &graphic_buffer) { - - if (!drawing_functor.draw_edge(*ss2, eh)) { - return; +template +void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (!drawing_functor.draw_edge(ss2, eh)) + { return; } + + if (drawing_functor.colored_edge(ss2, eh)) + { + graphic_buffer.add_segment(eh->opposite()->vertex()->point(), + eh->vertex()->point(), + drawing_functor.edge_color(ss2, eh)); } - - if (drawing_functor.colored_edge(*ss2, eh)) { - if (eh->is_bisector()) - graphic_buffer.add_segment(eh->opposite()->vertex()->point(), - eh->vertex()->point(), CGAL::IO::red()); - else - graphic_buffer.add_segment(eh->opposite()->vertex()->point(), - eh->vertex()->point(), CGAL::IO::black()); + else + { + graphic_buffer.add_segment(eh->opposite()->vertex()->point(), + eh->vertex()->point()); } } -template -void print_halfedge_labels(typename SS2::Halfedge_const_handle h, - CGAL::Graphic_buffer &graphic_buffer) { - std::stringstream label; +template +void print_halfedge_labels(const SS2& ss2, + typename SS2::Halfedge_const_handle h, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + // TODO? a functor different from draw_edge to allow to show only some labels ?? + if(!drawing_functor.draw_edge(ss2, h)) + { return; } + std::stringstream label; label << "H" << h->id() << " (V" << h->vertex()->id() << ") "; label << "H" << h->opposite()->id() << " (V" << h->opposite()->vertex()->id() << ") "; @@ -63,96 +66,144 @@ void print_halfedge_labels(typename SS2::Halfedge_const_handle h, } template -void compute_vertex(typename SS2::Vertex_const_handle vh, - const DrawingFunctor &drawing_functor, const SS2 *ss2, - CGAL::Graphic_buffer &graphic_buffer) { - - if (!drawing_functor.draw_vertex(*ss2, vh)) { - return; - } - if (drawing_functor.colored_vertex(*ss2, vh)) { - if (vh->is_split()) - graphic_buffer.add_point( - vh->point(), CGAL::IO::Color(10, 10, 180)); // blue, but not flashy - else if (vh->has_infinite_time()) - graphic_buffer.add_point(vh->point(), CGAL::IO::orange()); - else - graphic_buffer.add_point( - vh->point(), CGAL::IO::Color(10, 180, 10)); // green, but not flashy +void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (!drawing_functor.draw_vertex(ss2, vh)) + { return; } + + if (drawing_functor.colored_vertex(ss2, vh)) + { + graphic_buffer.add_point(vh->point(), drawing_functor.vertex_color(ss2, vh)); } + else + { graphic_buffer.add_point(vh->point()); } } -template -void print_vertex_label(typename SS2::Vertex_const_handle vh, - CGAL::Graphic_buffer &graphic_buffer) { +template +void print_vertex_label(const SS2& ss2, + typename SS2::Vertex_const_handle vh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + // TODO? a functor different from draw_vertex to allow to show only some labels ?? + if (!drawing_functor.draw_vertex(ss2, vh)) + { return; } + std::stringstream label; label << "V" << vh->id() << std::ends; graphic_buffer.add_text(vh->point(), label.str()); } -template -void compute_elements(const SS2 *ss2, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor) { - - for (typename SS2::Halfedge_const_iterator it = ss2->halfedges_begin(); - it != ss2->halfedges_end(); ++it) { - if (it->id() < it->opposite()->id()) { - compute_edge(it, drawing_functor, ss2, graphic_buffer); - print_halfedge_labels(it, graphic_buffer); +template +void compute_elements(const SS2& ss2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if (!drawing_functor.are_edges_enabled()) + { + for (typename SS2::Halfedge_const_iterator it=ss2.halfedges_begin(); + it != ss2.halfedges_end(); ++it) + { + if (it->id()opposite()->id()) + { + compute_edge(ss2, it, graphic_buffer, drawing_functor); + print_halfedge_labels(ss2, it, graphic_buffer, drawing_functor); + } } } - for (typename SS2::Vertex_const_iterator it = ss2->vertices_begin(); - it != ss2->vertices_end(); ++it) { - compute_vertex(it, drawing_functor, ss2, graphic_buffer); - print_vertex_label(it, graphic_buffer); + + if (!drawing_functor.are_vertices_enabled()) + { + for (typename SS2::Vertex_const_iterator it=ss2.vertices_begin(); + it!=ss2.vertices_end(); ++it) + { + compute_vertex(ss2, it, graphic_buffer, drawing_functor); + print_vertex_label(ss2, it, graphic_buffer, drawing_functor); + } } } } // namespace draw_function_for_ss2 -template -void add_in_graphic_buffer(const SS2 &ass2, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &drawing_functor) { - draw_function_for_ss2::compute_elements(&ass2, graphic_buffer, +#define CGAL_SS_TYPE CGAL::Straight_skeleton_2 + +template +void add_in_graphic_buffer(const CGAL_SS_TYPE &ass2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + draw_function_for_ss2::compute_elements(ass2, graphic_buffer, drawing_functor); } -template -void add_in_graphic_buffer( - const SS2 &ass2, CGAL::Graphic_buffer &graphic_buffer) { - Drawing_functor - drawingFunctor; +template +void add_in_graphic_buffer(const CGAL_SS_TYPE& ass2, + CGAL::Graphic_buffer& graphic_buffer) +{ + Drawing_functor + drawingFunctor; + + drawingFunctor.colored_edge = [] + (const CGAL_SS_TYPE&, typename CGAL_SS_TYPE::Halfedge_const_handle) -> bool + { return true; }; + + drawingFunctor.colored_vertex = [] + (const CGAL_SS_TYPE&, typename CGAL_SS_TYPE::Vertex_const_handle) -> bool + { return true; }; + + drawingFunctor.edge_color = [] + (const CGAL_SS_TYPE&, typename CGAL_SS_TYPE::Halfedge_const_handle eh) -> CGAL::IO::Color + { + if (eh->is_bisector()) + { return CGAL::IO::red(); } + + return CGAL::IO::black(); + }; + + drawingFunctor.vertex_color = [] + (const CGAL_SS_TYPE&, typename CGAL_SS_TYPE::Vertex_const_handle vh) -> CGAL::IO::Color + { + if (vh->is_split()) + { return CGAL::IO::Color(10, 10, 180); } // blue, but not flashy + else if (vh->has_infinite_time()) + { return CGAL::IO::orange(); } + + return CGAL::IO::Color(10, 180, 10); // green, but not flashy + }; add_in_graphic_buffer(ass2, graphic_buffer, drawingFunctor); } // Specialization of draw function. -#define CGAL_SS_TYPE CGAL::Straight_skeleton_2 +#ifdef CGAL_USE_BASIC_VIEWER template void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, - const char *title = "Straight Skeleton Basic Viewer") { + const char *title="Straight Skeleton Basic Viewer") +{ CGAL::Graphic_buffer buffer; add_in_graphic_buffer(ass2, buffer, drawingfunctor); - draw_buffer(buffer); + draw_buffer(buffer, title); } template void draw(const CGAL_SS_TYPE &ass2, - const char *title = "Straight Skeleton Basic Viewer") { + const char *title="Straight Skeleton Basic Viewer") +{ CGAL::Graphic_buffer buffer; add_in_graphic_buffer(ass2, buffer); - draw_buffer(buffer); + draw_buffer(buffer, title); } +#endif // CGAL_USE_BASIC_VIEWER + #undef CGAL_SS_TYPE } // End namespace CGAL -#endif // CGAL_USE_BASIC_VIEWER - #endif // CGAL_DRAW_SS2_H From 14848d450869c7fe5e4d2737154fc6e8f83b65bb Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 13:44:36 +0200 Subject: [PATCH 113/399] Add a class allowing to create a qt application and a basic viewer, which can be ran latter. This allows modification of the viewer (for example add shortcuts description). --- .../include/CGAL/Qt/Basic_viewer_qt.h | 177 +++++++++++++++--- 1 file changed, 147 insertions(+), 30 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 9da5555e705d..50388985edb4 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -62,7 +62,7 @@ namespace CGAL { //------------------------------------------------------------------------------ -template +template class Basic_viewer_qt : public CGAL::QGLViewer { public: @@ -181,11 +181,63 @@ class Basic_viewer_qt : public CGAL::QGLViewer { m_draw_faces = b; } void set_use_mono_color(bool b) { m_use_mono_color = b; } - void set_inverse_normal(bool b) - { m_inverse_normal = b; } void set_draw_text(bool b) { m_draw_text = b; } + void set_vertices_mono_color(const CGAL::IO::Color& c) + { m_vertices_mono_color=c; } + void set_edges_mono_color(const CGAL::IO::Color& c) + { m_edges_mono_color=c; } + void set_rays_mono_color(const CGAL::IO::Color& c) + { m_rays_mono_color=c; } + void set_lines_mono_color(const CGAL::IO::Color& c) + { m_lines_mono_color=c; } + void set_faces_mono_color(const CGAL::IO::Color& c) + { m_faces_mono_color=c; } + + void negate_draw_vertices() + { m_draw_vertices = !m_draw_vertices; } + void negate_draw_edges() + { m_draw_edges = !m_draw_edges; } + void negate_draw_rays() + { m_draw_rays = !m_draw_rays; } + void negate_draw_lines() + { m_draw_lines = !m_draw_lines; } + void negate_draw_faces() + { m_draw_faces = !m_draw_faces; } + void negate_use_mono_color() + { m_use_mono_color = !m_use_mono_color; } + void negate_draw_text() + { m_draw_text = !m_draw_text; } + + bool get_draw_vertices() const + { return m_draw_vertices; } + bool get_draw_edges() const + { return m_draw_edges; } + bool get_draw_rays() const + { return m_draw_rays; } + bool get_draw_lines() const + { return m_draw_lines; } + bool get_draw_faces() const + { return m_draw_faces; } + bool get_use_mono_color() const + { return m_use_mono_color; } + bool get_inverse_normal() const + { return m_inverse_normal; } + bool get_draw_text() const + { return m_draw_text; } + + const CGAL::IO::Color& get_vertices_mono_color() const + { return m_vertices_mono_color; } + const CGAL::IO::Color& get_edges_mono_color() const + { return m_edges_mono_color; } + const CGAL::IO::Color& get_rays_mono_color() const + { return m_rays_mono_color; } + const CGAL::IO::Color& get_lines_mono_color() const + { return m_lines_mono_color; } + const CGAL::IO::Color& get_faces_mono_color() const + { return m_faces_mono_color; } + void clear() { for (unsigned int i=0; imodifiers(); - if(!_onPress || !_onPress(e, this)) + if(!on_key_pressed || !on_key_pressed(e, this)) { + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key()==::Qt::Key_C) && (modifiers==::Qt::NoButton)) { if (!isOpenGL_4_3()) return; @@ -1332,9 +1387,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer } else if ((e->key()==::Qt::Key_N) && (modifiers==::Qt::NoButton)) { - m_inverse_normal=!m_inverse_normal; - displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false")); negate_all_normals(); + displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false")); redraw(); } else if ((e->key()==::Qt::Key_S) && (modifiers==::Qt::NoButton)) @@ -1536,7 +1590,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer return text; } public: - std::function *)> _onPress; + std::function *)> on_key_pressed; protected: Graphic_buffer& gBuffer; @@ -1612,8 +1666,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; -template -void draw_buffer(Graphic_buffer &graphic_buffer, +template +void draw_buffer(Graphic_buffer& graphic_buffer, const char *title="CGAL Basic Viewer") { #if defined(CGAL_TEST_SUITE) @@ -1629,38 +1683,101 @@ void draw_buffer(Graphic_buffer &graphic_buffer, int argc = 1; const char *argv[2] = {title, nullptr}; QApplication app(argc, const_cast(argv)); - Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer, title); + Basic_viewer_qt basic_viewer(app.activeWindow(), + graphic_buffer, title); basic_viewer.show(); app.exec(); } } -template -void draw_buffer(Graphic_buffer &graphic_buffer, - const std::function *)>& onPress, - const char *title="CGAL Basic Viewer") +// template +// void draw_buffer(Graphic_buffer &graphic_buffer, +// const std::function *)>& onPress, +// const char *title="CGAL Basic Viewer") +// { +// #if defined(CGAL_TEST_SUITE) +// bool cgal_test_suite = true; +// #else +// bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +// #endif + +// if (!cgal_test_suite) +// { +// Qt::init_ogl_context(4, 3); + +// int argc = 1; +// const char *argv[2] = {title, nullptr}; +// QApplication app(argc, const_cast(argv)); +// Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer, title); +// basic_viewer._onPress = onPress; + +// basic_viewer.show(); +// app.exec(); +// } +// } + +//------------------------------------------------------------------------------ +template +class QApplication_and_basic_viewer { +public: + QApplication_and_basic_viewer(CGAL::Graphic_buffer& buffer, + const char* title="CGAL Basic Viewer"): + m_application(nullptr), + m_basic_viewer(nullptr), + m_argc(1) + { + m_argv[0]=new char[strlen(title)+1]; + strcpy(m_argv[0], title); + m_argv[1]=nullptr; + #if defined(CGAL_TEST_SUITE) - bool cgal_test_suite = true; + bool cgal_test_suite = true; #else - bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); + bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif - if (!cgal_test_suite) - { + if (cgal_test_suite) + { return; } + Qt::init_ogl_context(4, 3); + m_application=new QApplication(m_argc, const_cast(m_argv)); + m_basic_viewer=new Basic_viewer_qt(m_application->activeWindow(), + buffer, title); + } - int argc = 1; - const char *argv[2] = {title, nullptr}; - QApplication app(argc, const_cast(argv)); - Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer, title); - basic_viewer._onPress = onPress; + ~QApplication_and_basic_viewer() + { + delete[] m_argv[0]; + delete m_basic_viewer; + delete m_application; + } - basic_viewer.show(); - app.exec(); + operator bool() const + { return m_application!=nullptr; } + + void run() + { + if (m_application!=nullptr) + { + m_basic_viewer->show(); + m_application->exec(); + } } -} + + Basic_viewer_qt& basic_viewer() + { + CGAL_assertion(m_basic_viewer!=nullptr); + return *m_basic_viewer; + } + +protected: + QApplication* m_application; + Basic_viewer_qt* m_basic_viewer; + char *m_argv[2]; + int m_argc; +}; } // End namespace CGAL From 2f07ea2a1651aba14a051cb2ef8896d8bd31968c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 13:46:10 +0200 Subject: [PATCH 114/399] review draw voronoi 2 --- .../include/CGAL/draw_voronoi_diagram_2.h | 396 +++++++++--------- 1 file changed, 188 insertions(+), 208 deletions(-) diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 662a261b27bf..3f6e93a71721 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -13,15 +13,10 @@ #ifndef CGAL_DRAW_VORONOI_DIAGRAM_2_H #define CGAL_DRAW_VORONOI_DIAGRAM_2_H +#include +#include #include #include -#include -#include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include -#include #include #include #include @@ -34,6 +29,8 @@ namespace CGAL { namespace draw_function_for_v2 { +// We need a specific functor for voronoi2 in order to allow to differentiate +// voronoi and dual vertices, and to manage rays. template { - Drawing_functor_voronoi() : m_draw_rays(true), - m_draw_voronoi_vertices(true), + Drawing_functor_voronoi() : m_draw_voronoi_vertices(true), m_draw_dual_vertices(true), - m_nofaces(false) - { - - draw_voronoi_vertices=[](const DS &, vertex_handle)->bool { return true; }; - draw_dual_vertices=[](const DS &, vertex_handle)->bool { return true; }; - draw_rays=[](const DS &, vertex_handle)->bool { return true; }; - - } - - std::function draw_voronoi_vertices; - std::function draw_dual_vertices; - std::function draw_rays; + dual_vertex_color(CGAL::IO::Color(50, 100, 180)), + ray_color(CGAL::IO::Color(100, 0, 0)), + bisector_color(CGAL::IO::Color(0, 100, 0)) + {} void disable_voronoi_vertices() { m_draw_voronoi_vertices=false; } void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; } bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; } + void negate_draw_voronoi_vertices() { m_draw_voronoi_vertices=!m_draw_voronoi_vertices; } void disable_dual_vertices() { m_draw_dual_vertices=false; } void enable_dual_vertices() { m_draw_dual_vertices=true; } bool are_dual_vertices_enabled() const { return m_draw_dual_vertices; } + void negate_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; } - void disable_rays() { m_draw_rays=false; } - void enable_rays() { m_draw_rays=true; } - bool are_rays_enabled() const { return m_draw_rays; } - - void disable_nofaces() { m_nofaces=false; } - void enable_nofaces() { m_nofaces=true; } - bool are_nofaces_enabled() const { return m_nofaces; } + CGAL::IO::Color dual_vertex_color; + CGAL::IO::Color ray_color; + CGAL::IO::Color bisector_color; protected: - bool m_draw_rays; bool m_draw_voronoi_vertices; bool m_draw_dual_vertices; - bool m_nofaces; }; typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; -template -void compute_vertex(typename V2::Vertex_iterator vh, - CGAL::Graphic_buffer &graphic_buffer) -{ graphic_buffer.add_point(vh->point()); } +template +void compute_vertex(const V2& v2, + typename V2::Vertex_iterator vh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + if(!drawing_functor.draw_vertex(v2, vh)) + { return; } -template -void compute_dual_vertex(typename V2::Delaunay_graph::Finite_vertices_iterator vi, - CGAL::Graphic_buffer &graphic_buffer) -{ graphic_buffer.add_point(vi->point(), CGAL::IO::Color(50, 100, 180)); } + if(drawing_functor.colored_vertex(v2, vh)) + { graphic_buffer.add_point(vh->point(), drawing_functor.vertex_color(v2, vh)); } + else + { graphic_buffer.add_point(vh->point()); } +} -template -void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, - CGAL::Graphic_buffer &graphic_buffer) +template +void compute_dual_vertex(const V2& /*v2*/, + typename V2::Delaunay_graph::Finite_vertices_iterator vi, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor& drawing_functor) +{ graphic_buffer.add_point(vi->point(), drawing_functor.dual_vertex_color); } + +template +void add_segments_and_update_bounding_box(const V2& v2, + typename V2::Halfedge_iterator he, + CGAL::Graphic_buffer& graphic_buffer, + DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; if (he->is_segment()) - { graphic_buffer.add_segment(he->source()->point(), he->target()->point()); } + { + if(drawing_functor.colored_edge(v2, he)) + { + graphic_buffer.add_segment(he->source()->point(), he->target()->point(), + drawing_functor.edge_color(v2, he)); + } + else + { + graphic_buffer.add_segment(he->source()->point(), he->target()->point()); + } + } else { Delaunay_vertex_const_handle v1 = he->up(); @@ -118,8 +126,6 @@ void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, end_point = he->source()->point(); // update_bounding_box_for_ray(end_point, direction); - - // update_bounding_box_for_ray Local_point lp = Basic_viewer_qt<>::get_local_point(end_point); Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); CGAL::Bbox_3 b = (lp + lv).bbox(); @@ -136,8 +142,6 @@ void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, // update_bounding_box_for_line(pointOnLine, direction, // perpendicularDirection); - - // update_bounding_box_for_line Local_point lp = Basic_viewer_qt<>::get_local_point(pointOnLine); Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); Local_vector lpv = Basic_viewer_qt<>::get_local_vector(perpendicularDirection); @@ -150,7 +154,7 @@ void add_segments_and_update_bounding_box(typename V2::Halfedge_handle he, template Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, - const CGAL::Bbox_3 & m_bounding_box) + const CGAL::Bbox_3 & m_bounding_box) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; @@ -160,7 +164,7 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, // calculate direction of ray and its inverse Kernel::Vector_2 v(v1->point().y() - v2->point().y(), - v2->point().x() - v1->point().x()); + v2->point().x() - v1->point().x()); Local_kernel::Vector_2 inv(1 / v.x(), 1 / v.y()); // origin of the ray @@ -216,9 +220,11 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, } // Halfedge_const_handle -template -void compute_rays_and_bisectors(typename V2::Halfedge_iterator he, - CGAL::Graphic_buffer &graphic_buffer) +template +void compute_rays_and_bisectors(const V2&, + typename V2::Halfedge_iterator he, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; @@ -228,43 +234,45 @@ void compute_rays_and_bisectors(typename V2::Halfedge_iterator he, Kernel::Vector_2 direction(v1->point().y() - v2->point().y(), v2->point().x() - v1->point().x()); - if (he->is_ray()) { - if (he->has_source()) { + if (he->is_ray()) + { + if (he->has_source()) + { // add_ray_segment(he->source()->point(), get_second_point(he, graphic_buffer.get_bounding_box())); - graphic_buffer.add_ray(he->source()->point(), direction, CGAL::IO::Color(100, 0, 0)); + graphic_buffer.add_ray(he->source()->point(), direction, drawing_functor.ray_color); } - } else if (he->is_bisector()) { + } + else if (he->is_bisector()) + { Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, (v1->point().y() + v2->point().y()) / 2); - graphic_buffer.add_line(pointOnLine, direction); + graphic_buffer.add_line(pointOnLine, direction, drawing_functor.bisector_color); } } -template -void compute_face(typename V2::Face_iterator fh, - const V2& v2, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) +template +void compute_face(const V2& v2, + typename V2::Face_iterator fh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& m_drawing_functor) { - typedef typename V2::Ccb_halfedge_circulator Ccb_halfedge_circulator; - - if(m_drawing_functor.colored_face(v2, fh)) { + if(fh->is_unbounded() || !m_drawing_functor.draw_face(v2, fh)) + { return; } - CGAL::IO::Color c = m_drawing_functor.face_color(v2, fh); + if(m_drawing_functor.colored_face(v2, fh)) + { graphic_buffer.face_begin(m_drawing_functor.face_color(v2, fh)); } + else { graphic_buffer.face_begin(); } - Ccb_halfedge_circulator ec_start = fh->ccb(); - Ccb_halfedge_circulator ec = ec_start; - - if (!fh->is_unbounded()) { - graphic_buffer.face_begin(c); - do { - graphic_buffer.add_point_in_face(ec->source()->point()); - } while (++ec != ec_start); - graphic_buffer.face_end(); + typename V2::Ccb_halfedge_circulator ec_start=fh->ccb(); + typename V2::Ccb_halfedge_circulator ec=ec_start; + do + { + graphic_buffer.add_point_in_face(ec->source()->point()); } + while (++ec!=ec_start); + graphic_buffer.face_end(); - } - // Test: for unbounded faces + // Test: for unbounded faces (??) // else { // do{ // if( ec->has_source() ){ @@ -277,45 +285,48 @@ void compute_face(typename V2::Face_iterator fh, // } } -template -void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) +template +void compute_elements(const V2& v2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { - typedef typename V2::Delaunay_graph::Finite_vertices_iterator Dual_vertices_iterator; + if(drawing_functor.are_vertices_enabled()) + { + // Draw the voronoi vertices + if (drawing_functor.are_voronoi_vertices_enabled()) + { + for (typename V2::Vertex_iterator it=v2.vertices_begin(); + it!=v2.vertices_end(); ++it) + { compute_vertex(v2, it, graphic_buffer, drawing_functor); } + } - // Draw the voronoi vertices - if (m_drawing_functor.are_voronoi_vertices_enabled()) { - for (typename V2::Vertex_iterator it = v2.vertices_begin(); - it != v2.vertices_end(); ++it) { - compute_vertex(it, graphic_buffer); + // Draw the dual vertices + if (drawing_functor.are_dual_vertices_enabled()) + { + for (typename V2::Delaunay_graph::Finite_vertices_iterator + it=v2.dual().finite_vertices_begin(); + it!=v2.dual().finite_vertices_end(); ++it) + { compute_dual_vertex(v2, it, graphic_buffer, drawing_functor); } } } - // Draw the dual vertices - if (m_drawing_functor.are_dual_vertices_enabled()) + if(drawing_functor.are_edges_enabled()) { - for (Dual_vertices_iterator it = v2.dual().finite_vertices_begin(); - it != v2.dual().finite_vertices_end(); ++it) - { compute_dual_vertex(it, graphic_buffer); } + // Add segments and update bounding box + for (typename V2::Halfedge_iterator it=v2.halfedges_begin(); + it!=v2.halfedges_end(); ++it) + { add_segments_and_update_bounding_box(v2, it, + graphic_buffer, drawing_functor); } } - // Add segments and update bounding box - for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); - it != v2.halfedges_end(); ++it) - { add_segments_and_update_bounding_box(it, graphic_buffer); } - - if(m_drawing_functor.are_rays_enabled()) - { - for (typename V2::Halfedge_iterator it = v2.halfedges_begin(); - it != v2.halfedges_end(); ++it) - { compute_rays_and_bisectors(it, graphic_buffer); } - } + for (typename V2::Halfedge_iterator it=v2.halfedges_begin(); + it!=v2.halfedges_end(); ++it) + { compute_rays_and_bisectors(v2, it, graphic_buffer, drawing_functor); } - if (!m_drawing_functor.are_nofaces_enabled()) + if (drawing_functor.are_faces_enabled()) { - for (typename V2::Face_iterator it = v2.faces_begin(); - it != v2.faces_end(); ++it) - { compute_face(it, v2, graphic_buffer, m_drawing_functor); } + for (typename V2::Face_iterator it=v2.faces_begin(); it!=v2.faces_end(); ++it) + { compute_face(v2, it, graphic_buffer, drawing_functor); } } } @@ -326,17 +337,15 @@ void compute_elements(const V2& v2, CGAL::Graphic_buffer &graphic_bu template void add_in_graphic_buffer(const CGAL_VORONOI_TYPE &v2, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& m_drawing_functor) { draw_function_for_v2::compute_elements(v2, graphic_buffer, m_drawing_functor); } template -void add_in_graphic_buffer(const CGAL_VORONOI_TYPE &v2, - CGAL::Graphic_buffer &graphic_buffer, - bool m_nofaces = false, bool m_draw_voronoi_vertices = true, - bool m_draw_dual_vertices = true ) +void add_in_graphic_buffer(const CGAL_VORONOI_TYPE& v2, + CGAL::Graphic_buffer& graphic_buffer) { // Default functor; user can add his own functor. CGAL::draw_function_for_v2::Drawing_functor_voronoi drawing_functor; - drawing_functor.colored_face = [](const CGAL_VORONOI_TYPE&, - typename CGAL_VORONOI_TYPE::Face_iterator fh) -> bool - { return true; }; - - drawing_functor.face_color = [] (const CGAL_VORONOI_TYPE& alcc, - typename CGAL_VORONOI_TYPE::Face_iterator fh) -> CGAL::IO::Color - { - return CGAL::IO::Color(73, 250, 117); - }; - add_in_graphic_buffer(v2, graphic_buffer, drawing_functor); } -// TODO: I'll add a description after idea verification -// Add custom key description (see keyPressEvent) -// setKeyDescription(::Qt::Key_R, "Toggles rays display"); -// setKeyDescription(::Qt::Key_D, "Toggles dual vertices display"); -// setKeyDescription(::Qt::Key_V, "Toggles voronoi vertices display"); +#ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. template -void draw(const CGAL_VORONOI_TYPE &av2, - const DrawingFunctor &drawing_functor, +void draw(const CGAL_VORONOI_TYPE& av2, + const DrawingFunctor& drawing_functor, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphic_buffer buffer; @@ -377,7 +372,7 @@ void draw(const CGAL_VORONOI_TYPE &av2, } template -void draw(const CGAL_VORONOI_TYPE &av2, +void draw(const CGAL_VORONOI_TYPE& av2, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphic_buffer buffer; @@ -388,92 +383,77 @@ void draw(const CGAL_VORONOI_TYPE &av2, typename CGAL_VORONOI_TYPE::Face_iterator> drawing_functor; - drawing_functor.colored_face = [](const CGAL_VORONOI_TYPE&, - typename CGAL_VORONOI_TYPE::Face_iterator fh) -> bool - { return true; }; - - - drawing_functor.face_color = [] (const CGAL_VORONOI_TYPE& alcc, - typename CGAL_VORONOI_TYPE::Face_iterator fh) -> CGAL::IO::Color - { - return CGAL::IO::Color(73, 250, 117); - }; - add_in_graphic_buffer(av2, buffer, drawing_functor); - std::function *)> VoronoiKeyPressEvent = - [&av2, &drawing_functor] (QKeyEvent *e, CGAL::Basic_viewer_qt *_this) -> bool + QApplication_and_basic_viewer app(buffer, title); + if(app) { - /// [Keypress] - const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) { - - // This is like m_draw_rays = !m_draw_rays; - if(drawing_functor.are_rays_enabled()) - { - drawing_functor.disable_rays(); - } - else { - drawing_functor.enable_rays(); - } - - std::cout << "R Pressed\n"; - - _this->displayMessage( - QString("Draw rays=%1.").arg(drawing_functor.are_rays_enabled() ? "true" : "false")); - _this->update(); - - } else if ((e->key() == ::Qt::Key_V) && (modifiers == ::Qt::NoButton)) { - - std::cout << "V Pressed\n"; - - // This is like m_draw_voronoi_vertices = !m_draw_voronoi_vertices; - if(drawing_functor.are_voronoi_vertices_enabled()) + // Here we define the std::function to capture key pressed. + app.basic_viewer().on_key_pressed= + [&av2, &drawing_functor] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool { - drawing_functor.disable_voronoi_vertices(); - } - else { - drawing_functor.enable_voronoi_vertices(); - } - - _this->displayMessage( - QString("Voronoi vertices=%1.").arg(drawing_functor.are_voronoi_vertices_enabled()? "true" : "false")); - - draw_function_for_v2::compute_elements(av2, _this->get_graphic_buffer(), drawing_functor); - - _this->redraw(); - } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { - - std::cout << "D Pressed\n"; - - // m_draw_dual_vertices = !m_draw_dual_vertices; - if(drawing_functor.are_dual_vertices_enabled()) - { - drawing_functor.disable_dual_vertices(); - } - else { - drawing_functor.enable_dual_vertices(); - } - - _this->displayMessage(QString("Dual vertices=%1.") - .arg(drawing_functor.are_dual_vertices_enabled() ? "true" : "false")); - - draw_function_for_v2::compute_elements(av2, _this->get_graphic_buffer(), drawing_functor); + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) + { + basic_viewer->negate_draw_rays(); + basic_viewer->displayMessage + (QString("Draw rays=%1.").arg(basic_viewer->get_draw_rays()?"true":"false")); + + basic_viewer->redraw(); + } + else if ((e->key() == ::Qt::Key_V) && (modifiers == ::Qt::ShiftModifier)) + { + if(drawing_functor.are_voronoi_vertices_enabled()) + { drawing_functor.disable_voronoi_vertices(); } + else { drawing_functor.enable_voronoi_vertices(); } + + basic_viewer->displayMessage + (QString("Voronoi vertices=%1."). + arg(drawing_functor.are_voronoi_vertices_enabled()?"true":"false")); + + basic_viewer->clear(); + draw_function_for_v2::compute_elements(av2, + basic_viewer->get_graphic_buffer(), + drawing_functor); + basic_viewer->redraw(); + } + else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) + { + if(drawing_functor.are_dual_vertices_enabled()) + { drawing_functor.disable_dual_vertices(); } + else { drawing_functor.enable_dual_vertices(); } + + basic_viewer->displayMessage(QString("Dual vertices=%1."). + arg(drawing_functor.are_dual_vertices_enabled()?"true":"false")); + + basic_viewer->clear(); + draw_function_for_v2::compute_elements(av2, + basic_viewer->get_graphic_buffer(), + drawing_functor); + basic_viewer->redraw(); + } + else + { + // Return false will call the base method to process others/classicals key + return false; + } + return true; // the key was captured + }; + + // Here we add shortcut descriptions + app.basic_viewer().setKeyDescription(::Qt::Key_R, "Toggles rays display"); + app.basic_viewer().setKeyDescription(::Qt::Key_D, "Toggles dual vertices display"); + app.basic_viewer().setKeyDescription(::Qt::ShiftModifier, ::Qt::Key_V, "Toggles voronoi vertices display"); + + // Then we run the app + app.run(); + } +} - _this->redraw(); - } else { - // Return false will call the base method to process others/classicals key - return false; - } - /// [Keypress] - return true; - }; - draw_buffer(buffer, VoronoiKeyPressEvent, title); +#endif // CGAL_USE_BASIC_VIEWER -} +#undef CGAL_VORONOI_TYPE } // End namespace CGAL -#endif // CGAL_USE_BASIC_VIEWER - #endif // CGAL_DRAW_VORONOI_DIAGRAM_2_H From 09eaba29450d80b1bedc7d33e83f5a58d516676f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 14:10:48 +0200 Subject: [PATCH 115/399] move functor for voronoi --- .../include/CGAL/draw_voronoi_diagram_2.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 3f6e93a71721..139e37dc73e3 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -26,9 +26,6 @@ namespace CGAL { -namespace draw_function_for_v2 -{ - // We need a specific functor for voronoi2 in order to allow to differentiate // voronoi and dual vertices, and to manage rays. template & graphic_buffer) { // Default functor; user can add his own functor. - CGAL::draw_function_for_v2::Drawing_functor_voronoi + CGAL::Drawing_functor_voronoi drawing_functor; add_in_graphic_buffer(v2, graphic_buffer, drawing_functor); @@ -377,11 +377,11 @@ void draw(const CGAL_VORONOI_TYPE& av2, { CGAL::Graphic_buffer buffer; - CGAL::draw_function_for_v2::Drawing_functor_voronoi - drawing_functor; + CGAL::Drawing_functor_voronoi + drawing_functor; add_in_graphic_buffer(av2, buffer, drawing_functor); From 655b0c8064b223e69c2a9a555fd513f76859763d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 15:18:31 +0200 Subject: [PATCH 116/399] review draw periodic triangulation 2 --- .../CGAL/draw_periodic_2_triangulation_2.h | 305 +++++++++++------- 1 file changed, 190 insertions(+), 115 deletions(-) diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 6818134aebf4..8381cfad821e 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -13,201 +13,276 @@ #ifndef DRAW_PERIODIC_2_TRIANGULATION_2_H #define DRAW_PERIODIC_2_TRIANGULATION_2_H -#include -#include #include #include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include +#include +#include #include -#include namespace CGAL { -namespace draw_function_for_P2T2 +// We need a specific functor for periodic_2_triangulation_2 for the parameter +// of the domain. +template +struct Drawing_functor_periodic_2_triangulation_2 : + public CGAL::Drawing_functor { + Drawing_functor_periodic_2_triangulation_2(): + domain_color(CGAL::IO::Color(96, 104, 252)), + m_draw_domain(true), + m_current_display_type(DS::STORED) + {} + + bool get_draw_domain() const + { return m_draw_domain; } + void set_draw_domain(bool b) + { m_draw_domain=b; } + void negate_draw_domain() + { m_draw_domain=!m_draw_domain; } + + typename DS::Iterator_type current_display_type() const + { return m_current_display_type; } + + void increase_current_display_type() + { + if(m_current_display_type==DS::UNIQUE_COVER_DOMAIN) + { m_current_display_type=DS::STORED; } + else + { m_current_display_type=typename DS::Iterator_type(static_cast(m_current_display_type)+1); } + } -enum Display_type -{ - STORED = 0, - UNIQUE, // 1 - STORED_COVER_DOMAIN, // 2 - UNIQUE_COVER_DOMAIN // 3 +public: + CGAL::IO::Color domain_color; + +protected: + bool m_draw_domain; + typename DS::Iterator_type m_current_display_type; }; -template -void compute_vertex(typename P2T2::Periodic_point_iterator pi, const P2T2 &p2t2, - CGAL::Graphic_buffer &graphic_buffer) +namespace draw_function_for_P2T2 +{ + +template +void compute_vertex(const P2T2 &p2t2, + typename P2T2::Periodic_point_iterator pi, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { // Construct the point in 9-sheeted covering space and add to viewer - graphic_buffer.add_point(p2t2.point(*pi)); + if(!drawing_functor.draw_vertex(p2t2, pi)) + { return; } + + if(drawing_functor.colored_vertex(p2t2, pi)) + { graphic_buffer.add_point(p2t2.point(*pi), + drawing_functor.vertex_color(p2t2, pi)); } + else + { graphic_buffer.add_point(p2t2.point(*pi)); } } -template -void compute_edge(typename P2T2::Periodic_segment_iterator si, const P2T2 &p2t2, - CGAL::Graphic_buffer &graphic_buffer) +template +void compute_edge(const P2T2 &p2t2, + typename P2T2::Periodic_segment_iterator si, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { - typedef typename P2T2::Segment Segment; + if(!drawing_functor.draw_edge(p2t2, si)) + { return; } // Construct the segment in 9-sheeted covering space and add to viewer - Segment s(p2t2.segment(*si)); - graphic_buffer.add_segment(s[0], s[1]); + typename P2T2::Segment s(p2t2.segment(*si)); + if(drawing_functor.colored_edge(p2t2, si)) + { graphic_buffer.add_segment(s[0], s[1], + drawing_functor.edge_color(p2t2, si)); } + else + { graphic_buffer.add_segment(s[0], s[1]); } } -template -void compute_face(typename P2T2::Periodic_triangle_iterator ti, const P2T2 &p2t2, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) +template +void compute_face(const P2T2 &p2t2, + typename P2T2::Periodic_triangle_iterator ti, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { - typedef typename P2T2::Triangle Triangle; + if(!drawing_functor.draw_face(p2t2, ti)) + { return; } // Construct the triangle in 9-sheeted covering space and add to viewer - Triangle t(p2t2.triangle(*ti)); - - if(m_drawing_functor.colored_face(p2t2, ti)) { - - CGAL::IO::Color c= m_drawing_functor.face_color(p2t2, ti); - graphic_buffer.face_begin(c); - graphic_buffer.add_point_in_face(t[0]); - graphic_buffer.add_point_in_face(t[1]); - graphic_buffer.add_point_in_face(t[2]); - graphic_buffer.face_end(); - } + typename P2T2::Triangle t(p2t2.triangle(*ti)); + if(drawing_functor.colored_face(p2t2, ti)) + { graphic_buffer.face_begin(drawing_functor.face_color(p2t2, ti)); } + else + { graphic_buffer.face_begin(); } - // Display the edges of the faces as segments with a - // light gray color for better visualization - CGAL::IO::Color segment_color = CGAL::IO::Color(207, 213, 211); - - graphic_buffer.add_segment(t[0], t[1], segment_color); - graphic_buffer.add_segment(t[1], t[2], segment_color); - graphic_buffer.add_segment(t[2], t[0], segment_color); - + graphic_buffer.add_point_in_face(t[0]); + graphic_buffer.add_point_in_face(t[1]); + graphic_buffer.add_point_in_face(t[2]); + graphic_buffer.face_end(); } -template -void compute_domain(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer) +template +void compute_domain(const P2T2& p2t2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; Kernel::Iso_rectangle_2 orig_domain = p2t2.domain(); std::array covering_sheets = p2t2.number_of_sheets(); - for(int i = 0; i < covering_sheets[0]; i++){ - for(int j = 0; j < covering_sheets[1]; j++){ + for(int i = 0; i < covering_sheets[0]; i++) + { + for(int j = 0; j < covering_sheets[1]; j++) + { Kernel::Vector_2 shift(i * (orig_domain.xmax() - orig_domain.xmin()), - j * orig_domain.ymax() - orig_domain.ymin()); + j * orig_domain.ymax() - orig_domain.ymin()); Kernel::Point_2 p1((orig_domain.min)()); Kernel::Point_2 p2(orig_domain.xmin(), orig_domain.ymax()); Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin()); Kernel::Point_2 p4((orig_domain.max)()); - graphic_buffer.add_segment(p1 + shift, p2 + shift, CGAL::IO::Color(96, 104, 252)); - graphic_buffer.add_segment(p1 + shift, p3 + shift, CGAL::IO::Color(96, 104, 252)); - graphic_buffer.add_segment(p2 + shift, p4 + shift, CGAL::IO::Color(96, 104, 252)); - graphic_buffer.add_segment(p3 + shift, p4 + shift, CGAL::IO::Color(96, 104, 252)); + graphic_buffer.add_segment(p1 + shift, p2 + shift, drawing_functor.domain_color); + graphic_buffer.add_segment(p1 + shift, p3 + shift, drawing_functor.domain_color); + graphic_buffer.add_segment(p2 + shift, p4 + shift, drawing_functor.domain_color); + graphic_buffer.add_segment(p3 + shift, p4 + shift, drawing_functor.domain_color); } } } -template -void compute_elements(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor, bool m_domain = true) { - - typedef typename P2T2::Iterator_type Iterator_type; - - draw_function_for_P2T2::Display_type m_display_type = draw_function_for_P2T2::Display_type::STORED_COVER_DOMAIN; - +template +void compute_elements(const P2T2& p2t2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ // Get the display type, iterate through periodic elements according // to the display type - Iterator_type it_type = (Iterator_type)m_display_type; + typedef typename P2T2::Iterator_type Iterator_type; + Iterator_type it_type = (Iterator_type)drawing_functor.current_display_type(); // Iterate through vertices, edges and faces, add elements to buffer - for (typename P2T2::Periodic_point_iterator it = - p2t2.periodic_points_begin(it_type); - it != p2t2.periodic_points_end(it_type); it++) + if(drawing_functor.are_vertices_enabled()) { - compute_vertex(it, p2t2, graphic_buffer); + for (typename P2T2::Periodic_point_iterator it=p2t2.periodic_points_begin(it_type); + it!=p2t2.periodic_points_end(it_type); ++it) + { compute_vertex(p2t2, it, graphic_buffer, drawing_functor); } } - for (typename P2T2::Periodic_segment_iterator it = - p2t2.periodic_segments_begin(it_type); - it != p2t2.periodic_segments_end(it_type); it++) + if(drawing_functor.are_edges_enabled()) { - compute_edge(it, p2t2, graphic_buffer); + for (typename P2T2::Periodic_segment_iterator it=p2t2.periodic_segments_begin(it_type); + it!=p2t2.periodic_segments_end(it_type); ++it) + { compute_edge(p2t2, it, graphic_buffer, drawing_functor); } } - for (typename P2T2::Periodic_triangle_iterator it = - p2t2.periodic_triangles_begin(it_type); - it != p2t2.periodic_triangles_end(it_type); it++) + if (drawing_functor.are_faces_enabled()) { - compute_face(it, p2t2, graphic_buffer, m_drawing_functor); + for (typename P2T2::Periodic_triangle_iterator it=p2t2.periodic_triangles_begin(it_type); + it!=p2t2.periodic_triangles_end(it_type); ++it) + { compute_face(p2t2, it, graphic_buffer, drawing_functor); } } - if(m_domain){ + if(drawing_functor.get_draw_domain()) + { // Compute the (9-sheet covering space) domain of the periodic triangulation - compute_domain(p2t2, graphic_buffer); + compute_domain(p2t2, graphic_buffer, drawing_functor); } } } // namespace draw_function_for_P2T2 -template -void add_in_graphic_buffer(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) { - draw_function_for_P2T2::compute_elements(p2t2, graphic_buffer, m_drawing_functor, true); -} - -template -void add_in_graphic_buffer(const P2T2 &p2t2, CGAL::Graphic_buffer &graphic_buffer) { - - CGAL::Drawing_functor drawing_functor; +#define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 - drawing_functor.colored_face = [](const P2T2&, - typename P2T2::Periodic_triangle_iterator) -> bool - { return true; }; +template +void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) +{ + draw_function_for_P2T2::compute_elements(p2t2, graphic_buffer, drawing_functor); +} - drawing_functor.face_color = [] (const P2T2& alcc, - typename P2T2::Periodic_triangle_iterator dh) -> CGAL::IO::Color - { - return CGAL::IO::Color(73, 250, 117); - }; +template +void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, + CGAL::Graphic_buffer& graphic_buffer) +{ + CGAL::Drawing_functor_periodic_2_triangulation_2 + drawing_functor; add_in_graphic_buffer(p2t2, graphic_buffer, drawing_functor); } -// Specialization of draw function -#define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 +#ifdef CGAL_USE_BASIC_VIEWER -template < class Gt, - class Tds, - class BufferType = float, - class DrawingFunctor > +// Specialization of draw function +template void draw(const CGAL_P2T2_TYPE& ap2t2, - const DrawingFunctor &drawing_functor) + const DrawingFunctor& drawing_functor, + const char* title="2D Periodic Triangulation Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(ap2t2, buffer, drawing_functor); draw_buffer(buffer); } -template < class Gt, - class Tds, - class BufferType = float > +template void draw(const CGAL_P2T2_TYPE& ap2t2, - const char* title = "2D Periodic Triangulation Viewer", - bool nofill = false) + const char* title="2D Periodic Triangulation Viewer") { CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(ap2t2, buffer); - draw_buffer(buffer); -} + CGAL::Drawing_functor_periodic_2_triangulation_2 + drawing_functor; -} // namespace CGAL + add_in_graphic_buffer(ap2t2, buffer, drawing_functor); + QApplication_and_basic_viewer app(buffer, title); + if(app) + { + // Here we define the std::function to capture key pressed. + app.basic_viewer().on_key_pressed= + [&ap2t2, &drawing_functor] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + { + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) + { + drawing_functor.increase_current_display_type(); + basic_viewer->displayMessage + (QString("Display type=%1.").arg(drawing_functor.current_display_type()==0?"Stored": + (drawing_functor.current_display_type()==1?"Unique": + (drawing_functor.current_display_type()==2?"Stored cover": + "Unique cover")))); + basic_viewer->clear(); + draw_function_for_P2T2::compute_elements(ap2t2, + basic_viewer->get_graphic_buffer(), + drawing_functor); + basic_viewer->redraw(); + } + else + { + // Return false will call the base method to process others/classicals key + return false; + } + return true; // the key was captured + }; + + // Here we add shortcut descriptions + app.basic_viewer().setKeyDescription(::Qt::Key_D, "Next display type"); + + // Then we run the app + app.run(); + } +} #endif // CGAL_USE_BASIC_VIEWER +#undef CGAL_P2T2_TYPE + +} // namespace CGAL + #endif // DRAW_PERIODIC_2_TRIANGULATION_2_H From e18a573cc1de164347b218abb4e7354a7fbb069f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 15:22:09 +0200 Subject: [PATCH 117/399] add missing include --- Nef_3/include/CGAL/draw_nef_3.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index ccff10a5ef7c..96c1093ec4de 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include From 9da6a6d376a3dc82a9699401de660a21fc8e549a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 15:45:36 +0200 Subject: [PATCH 118/399] add missing include --- Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h | 1 + 1 file changed, 1 insertion(+) 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 add255dfa6e0..7d7f0785f01b 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include From 779fea48de1b6311d326da1a1289dea072a44647 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 16:01:37 +0200 Subject: [PATCH 119/399] use references --- .../include/CGAL/draw_linear_cell_complex.h | 192 +++++++++--------- 1 file changed, 96 insertions(+), 96 deletions(-) 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 7d7f0785f01b..f2934937c2c9 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -58,32 +58,33 @@ struct LCC_geom_utils }; template -void compute_face(typename LCC::Dart_const_handle dh, - typename LCC::Dart_const_handle voldh, const LCC *lcc, - const DrawingFunctorLCC &m_drawing_functor, - CGAL::Graphic_buffer &graphic_buffer) +void compute_face(const LCC& lcc, + typename LCC::Dart_const_handle dh, + typename LCC::Dart_const_handle voldh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctorLCC& drawing_functor) { - if (!m_drawing_functor.are_faces_enabled() || - !m_drawing_functor.draw_face(*lcc, dh)) + if (!drawing_functor.are_faces_enabled() || + !drawing_functor.draw_face(lcc, dh)) { return; } // We fill only closed faces. typename LCC::Dart_const_handle cur=dh; do { - if (!lcc->is_next_exist(cur)) + if (!lcc.is_next_exist(cur)) { return; } // open face=>not filled - cur = lcc->next(cur); + cur = lcc.next(cur); } while (cur!=dh); - if (m_drawing_functor.colored_volume(*lcc, voldh)) + if (drawing_functor.colored_volume(lcc, voldh)) { - graphic_buffer.face_begin(m_drawing_functor.volume_color(*lcc, voldh)); + graphic_buffer.face_begin(drawing_functor.volume_color(lcc, voldh)); } - else if (m_drawing_functor.colored_face(*lcc, dh)) + else if (drawing_functor.colored_face(lcc, dh)) { - graphic_buffer.face_begin(m_drawing_functor.face_color(*lcc, dh)); + graphic_buffer.face_begin(drawing_functor.face_color(lcc, dh)); } else { graphic_buffer.face_begin(); } @@ -92,9 +93,9 @@ void compute_face(typename LCC::Dart_const_handle dh, do { graphic_buffer.add_point_in_face - (lcc->point(cur), - LCC_geom_utils::get_vertex_normal(*lcc, cur)); - cur=lcc->next(cur); + (lcc.point(cur), + LCC_geom_utils::get_vertex_normal(lcc, cur)); + cur=lcc.next(cur); } while (cur!=dh); @@ -102,104 +103,103 @@ void compute_face(typename LCC::Dart_const_handle dh, } template -void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc, - const DrawingFunctor &m_drawing_functor, - CGAL::Graphic_buffer &graphic_buffer) +void compute_edge(const LCC& lcc, + typename LCC::Dart_const_handle dh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { - if (!m_drawing_functor.are_edges_enabled() || - !m_drawing_functor.draw_edge(*lcc, dh)) + if (!drawing_functor.are_edges_enabled() || + !drawing_functor.draw_edge(lcc, dh)) { return; } - const typename LCC::Point& p1=lcc->point(dh); - typename LCC::Dart_const_handle d2=lcc->other_extremity(dh); + const typename LCC::Point& p1=lcc.point(dh); + typename LCC::Dart_const_handle d2=lcc.other_extremity(dh); if (d2!=LCC::null_descriptor) { - if (m_drawing_functor.colored_edge(*lcc, dh)) + if (drawing_functor.colored_edge(lcc, dh)) { - graphic_buffer.add_segment(p1, lcc->point(d2), - m_drawing_functor.edge_color(*lcc, dh)); + graphic_buffer.add_segment(p1, lcc.point(d2), + drawing_functor.edge_color(lcc, dh)); } else - { graphic_buffer.add_segment(p1, lcc->point(d2)); } + { graphic_buffer.add_segment(p1, lcc.point(d2)); } } } template -void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc, - const DrawingFunctorLCC &m_drawing_functor, - CGAL::Graphic_buffer &graphic_buffer) +void compute_vertex(const LCC& lcc, + typename LCC::Dart_const_handle dh, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctorLCC& drawing_functor) { - if (!m_drawing_functor.are_vertices_enabled() || - !m_drawing_functor.draw_vertex(*lcc, dh)) + if (!drawing_functor.are_vertices_enabled() || + !drawing_functor.draw_vertex(lcc, dh)) { return; } - if (m_drawing_functor.colored_vertex(*lcc, dh)) + if (drawing_functor.colored_vertex(lcc, dh)) { - graphic_buffer.add_point(lcc->point(dh), - m_drawing_functor.vertex_color(*lcc, dh)); + graphic_buffer.add_point(lcc.point(dh), + drawing_functor.vertex_color(lcc, dh)); } else - { graphic_buffer.add_point(lcc->point(dh)); } + { graphic_buffer.add_point(lcc.point(dh)); } } template -void compute_elements(const LCC *lcc, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) +void compute_elements(const LCC& lcc, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { - if (lcc==nullptr) - { return; } - - typename LCC::size_type markvolumes = lcc->get_new_mark(); - 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(); - typename LCC::size_type oriented_mark = lcc->get_new_mark(); + typename LCC::size_type markvolumes = lcc.get_new_mark(); + 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(); + typename LCC::size_type oriented_mark = lcc.get_new_mark(); - lcc->orient(oriented_mark); + lcc.orient(oriented_mark); - for(typename LCC::Dart_range::const_iterator it=lcc->darts().begin(), - itend=lcc->darts().end(); it!=itend; ++it) + for(typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), + itend=lcc.darts().end(); it!=itend; ++it) { - if (!lcc->is_marked(it, markvolumes) && - m_drawing_functor.draw_volume(*lcc, it)) + if (!lcc.is_marked(it, markvolumes) && + drawing_functor.draw_volume(lcc, it)) { for(typename LCC::template Dart_of_cell_basic_range<3>::const_iterator - itv=lcc->template darts_of_cell_basic<3>(it, markvolumes).begin(), - itvend=lcc->template darts_of_cell_basic<3>(it, markvolumes).end(); + itv=lcc.template darts_of_cell_basic<3>(it, markvolumes).begin(), + itvend=lcc.template darts_of_cell_basic<3>(it, markvolumes).end(); itv!=itvend; ++itv) { - lcc->mark(itv, markvolumes); - if (!lcc->is_marked(itv, markfaces) && - lcc->is_marked(itv, oriented_mark) && - m_drawing_functor.draw_face(*lcc, itv)) + lcc.mark(itv, markvolumes); + if (!lcc.is_marked(itv, markfaces) && + lcc.is_marked(itv, oriented_mark) && + drawing_functor.draw_face(lcc, itv)) { - if ((!m_drawing_functor.volume_wireframe(*lcc, itv) || - (!lcc->template is_free<3>(itv) && - !m_drawing_functor.volume_wireframe(*lcc, lcc->template beta<3>(itv)))) && - !m_drawing_functor.face_wireframe(*lcc, itv)) - { compute_face(itv, it, lcc, m_drawing_functor, graphic_buffer); } + if ((!drawing_functor.volume_wireframe(lcc, itv) || + (!lcc.template is_free<3>(itv) && + !drawing_functor.volume_wireframe(lcc, lcc.template beta<3>(itv)))) && + !drawing_functor.face_wireframe(lcc, itv)) + { compute_face(lcc, itv, it, graphic_buffer, drawing_functor); } for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator - itf=lcc->template darts_of_cell_basic<2>(itv, markfaces).begin(), - itfend=lcc->template darts_of_cell_basic<2>(itv, markfaces).end(); + itf=lcc.template darts_of_cell_basic<2>(itv, markfaces).begin(), + itfend=lcc.template darts_of_cell_basic<2>(itv, markfaces).end(); itf!=itfend; ++itf) { - lcc->mark(itf, markfaces); - if (!lcc->is_marked(itf, markedges) && - m_drawing_functor.draw_edge(*lcc, itf)) + lcc.mark(itf, markfaces); + if (!lcc.is_marked(itf, markedges) && + drawing_functor.draw_edge(lcc, itf)) { - compute_edge(itf, lcc, m_drawing_functor, graphic_buffer); + compute_edge(lcc, itf, graphic_buffer, drawing_functor); for(typename LCC::template Dart_of_cell_basic_range<1>::const_iterator - ite=lcc->template darts_of_cell_basic<1>(itf, markedges).begin(), - iteend=lcc->template darts_of_cell_basic<1>(itf, markedges).end(); + ite=lcc.template darts_of_cell_basic<1>(itf, markedges).begin(), + iteend=lcc.template darts_of_cell_basic<1>(itf, markedges).end(); ite!=iteend; ++ite) { - lcc->mark(ite, markedges); - if (!lcc->is_marked(ite, markvertices) && - m_drawing_functor.draw_vertex(*lcc, ite)) + lcc.mark(ite, markedges); + if (!lcc.is_marked(ite, markvertices) && + drawing_functor.draw_vertex(lcc, ite)) { - compute_vertex(ite, lcc, m_drawing_functor, graphic_buffer); - CGAL::mark_cell(*lcc, ite, markvertices); + compute_vertex(lcc, ite, graphic_buffer, drawing_functor); + CGAL::mark_cell(lcc, ite, markvertices); } } } @@ -209,21 +209,21 @@ void compute_elements(const LCC *lcc, } } - for (typename LCC::Dart_range::const_iterator it = lcc->darts().begin(), - itend = lcc->darts().end(); it != itend; ++it) + for (typename LCC::Dart_range::const_iterator it = lcc.darts().begin(), + itend = lcc.darts().end(); it != itend; ++it) { - lcc->unmark(it, markvertices); - lcc->unmark(it, markedges); - lcc->unmark(it, markfaces); - lcc->unmark(it, markvolumes); - lcc->unmark(it, oriented_mark); + lcc.unmark(it, markvertices); + lcc.unmark(it, markedges); + lcc.unmark(it, markfaces); + lcc.unmark(it, markvolumes); + lcc.unmark(it, oriented_mark); } - lcc->free_mark(markvolumes); - lcc->free_mark(markfaces); - lcc->free_mark(markedges); - lcc->free_mark(markvertices); - lcc->free_mark(oriented_mark); + lcc.free_mark(markvolumes); + lcc.free_mark(markfaces); + lcc.free_mark(markedges); + lcc.free_mark(markvertices); + lcc.free_mark(oriented_mark); } } // namespace draw_function_for_lcc @@ -239,12 +239,12 @@ template class Map, class Refs, class Storage_, typename BufferType=float, class DrawingFunctor> -void add_in_graphic_buffer(const CGAL_LCC_TYPE &alcc, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) +void add_in_graphic_buffer(const CGAL_LCC_TYPE& alcc, + CGAL::Graphic_buffer& graphic_buffer, + const DrawingFunctor& drawing_functor) { - draw_function_for_lcc::compute_elements(static_cast(&alcc), - graphic_buffer, m_drawing_functor); + draw_function_for_lcc::compute_elements(static_cast(alcc), + graphic_buffer, drawing_functor); } // add_in_graphic_buffer: to add a LCC in the given graphic buffer, without a @@ -253,8 +253,8 @@ template class Map, class Refs, class Storage_, typename BufferType=float> -void add_in_graphic_buffer(const CGAL_LCC_TYPE &alcc, - CGAL::Graphic_buffer &graphic_buffer) +void add_in_graphic_buffer(const CGAL_LCC_TYPE& alcc, + CGAL::Graphic_buffer& graphic_buffer) { CGAL::Drawing_functor_with_volume class Map, class Refs, class Storage_, class DrawingFunctor> -void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor, +void draw(const CGAL_LCC_TYPE& alcc, const DrawingFunctor& drawing_functor, const char *title="LCC Basic Viewer") { CGAL::Graphic_buffer buffer; @@ -298,7 +298,7 @@ template class Map, class Refs, class Storage_> -void draw(const CGAL_LCC_TYPE &alcc, const char *title="LCC Basic Viewer") +void draw(const CGAL_LCC_TYPE& alcc, const char *title="LCC Basic Viewer") { CGAL::Graphic_buffer buffer; add_in_graphic_buffer(alcc, buffer); From fb80b2f3c44e5f261c5769551f984a406f858482 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 16:26:03 +0200 Subject: [PATCH 120/399] add missing include --- .../include/CGAL/draw_periodic_2_triangulation_2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 8381cfad821e..5ca4e9c4bb3f 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -18,6 +18,7 @@ #include #include #include +#include namespace CGAL { From 4377f527bc37a750d413636edb1b00ad00a67d0f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 16:27:11 +0200 Subject: [PATCH 121/399] add missing include --- Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 139e37dc73e3..d25ff88e78e6 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include From 534e7894b4bea359de436cdf1e02c03ee047d49f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 16:34:08 +0200 Subject: [PATCH 122/399] replace use of get_local_point --- GraphicsView/include/CGAL/Graphic_buffer.h | 8 ++++++++ .../include/CGAL/draw_voronoi_diagram_2.h | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/GraphicsView/include/CGAL/Graphic_buffer.h b/GraphicsView/include/CGAL/Graphic_buffer.h index c12b5aaa1ab0..425597cfcdb4 100644 --- a/GraphicsView/include/CGAL/Graphic_buffer.h +++ b/GraphicsView/include/CGAL/Graphic_buffer.h @@ -61,6 +61,7 @@ class Graphic_buffer public: typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; + typedef Local_kernel::Vector_3 Local_vector; Graphic_buffer() : m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr, @@ -331,6 +332,13 @@ class Graphic_buffer Local_kernel>::get_local_point(p); } + template + static Local_vector get_local_vector(const KVector &v) + { + return internal::Geom_utils::Kernel, + Local_kernel>::get_local_vector(v); + } + template void add_text(const KPoint &kp, const QString &txt) { diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index d25ff88e78e6..b1e4ad3de924 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -127,8 +127,8 @@ void add_segments_and_update_bounding_box(const V2& v2, end_point = he->source()->point(); // update_bounding_box_for_ray(end_point, direction); - Local_point lp = Basic_viewer_qt<>::get_local_point(end_point); - Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); + Local_point lp = graphic_buffer.get_local_point(end_point); + Local_vector lv = graphic_buffer.get_local_vector(direction); CGAL::Bbox_3 b = (lp + lv).bbox(); graphic_buffer.update_bounding_box(b); } @@ -143,9 +143,9 @@ void add_segments_and_update_bounding_box(const V2& v2, // update_bounding_box_for_line(pointOnLine, direction, // perpendicularDirection); - Local_point lp = Basic_viewer_qt<>::get_local_point(pointOnLine); - Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); - Local_vector lpv = Basic_viewer_qt<>::get_local_vector(perpendicularDirection); + Local_point lp = graphic_buffer.get_local_point(pointOnLine); + Local_vector lv = graphic_buffer.get_local_vector(direction); + Local_vector lpv = graphic_buffer.get_local_vector(perpendicularDirection); CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); graphic_buffer.update_bounding_box(b); From de846fc8d39d01ac43f24f02f897fdb88ec5f2bc Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 19 Oct 2022 17:19:37 +0200 Subject: [PATCH 123/399] do not use beta in lcc --- Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f2934937c2c9..d047aed5f3d7 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -176,7 +176,7 @@ void compute_elements(const LCC& lcc, { if ((!drawing_functor.volume_wireframe(lcc, itv) || (!lcc.template is_free<3>(itv) && - !drawing_functor.volume_wireframe(lcc, lcc.template beta<3>(itv)))) && + !drawing_functor.volume_wireframe(lcc, lcc.template opposite<3>(itv)))) && !drawing_functor.face_wireframe(lcc, itv)) { compute_face(lcc, itv, it, graphic_buffer, drawing_functor); } for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator From 8550ce6ec48b5736d444b56a6dceca61b7cf11a1 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Sat, 5 Nov 2022 17:27:15 +0100 Subject: [PATCH 124/399] draw_surface_mesh_small_faces and draw_face_graph_with_paths NYF --- .../draw_surface_mesh_small_faces.cpp | 24 +- .../include/CGAL/draw_face_graph_with_paths.h | 308 ++++++++---------- 2 files changed, 165 insertions(+), 167 deletions(-) diff --git a/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp b/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp index 2fb9ab9c7c8f..b24e54801b9d 100644 --- a/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp +++ b/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp @@ -10,6 +10,23 @@ typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; typedef CGAL::Surface_mesh Mesh; +struct Drawing_functor_small_face: public CGAL::Drawing_functor + +{ + drawing_functor.colored_face = [](const FG&, + typename boost::graph_traits::face_descriptor fg) -> bool + { return is_small(fg); }; + + drawing_functor.face_color = [] (const FG&, + typename boost::graph_traits::face_descriptor) -> CGAL::IO::Color + { return CGAL::IO::Color(200, 60, 60); }; // Red + + unsigned int m_threshold; + FT m_min_size, m_max_size; + bool m_draw_small_faces; + bool m_draw_big_faces; +}; + int main(int argc, char* argv[]) { const std::string filename = (argc>1) ? argv[1] : CGAL::data_file_path("meshes/elephant.off"); @@ -21,7 +38,12 @@ int main(int argc, char* argv[]) return EXIT_FAILURE; } - CGAL::draw(sm); + Drawing_functor_small_face drawing_functor; + CGAL::draw(sm, drawing_functor); + + // 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"); return EXIT_SUCCESS; } diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index e27f4784b787..e117e5b54a52 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -15,23 +15,47 @@ #include +#include #include #include -#include #include #include +#include + #include #include #include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include #include namespace CGAL { +// Specific drawing functor +template +struct Drawing_functor_face_graph_with_paths : + public CGAL::Drawing_functor +{ + Drawing_functor_face_graph_with_paths(std::size_t nbpaths): m_nbpaths(nbpaths) + { + color_of_path=[](std::size_t i)->CGAL::IO::Color + { + CGAL::Random random(static_cast(i)); + return get_random_color(random); + }; + + draw_path=[](std::size_t)->bool + { return true; } + } + + std::function color_of_path; + std::function draw_path; + +protected: + std::size_t m_nbpaths; +}; namespace draw_function_for_lcc { @@ -106,13 +130,9 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; -// Destructor. -// lcc.free_mark(m_oriented_mark); - - - template -const typename CGAL::Get_traits::Point& get_point(typename Get_map::type::Dart_const_handle dh, const Mesh &mesh) +const typename CGAL::Get_traits::Point& get_point +(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh) { typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; @@ -121,12 +141,16 @@ const typename CGAL::Get_traits::Point& get_point(typename Get_map::get_point(mesh, dh); } -template -void compute_face(typename Get_map::type::Dart_const_handle dh, - const Mesh &mesh, - CGAL::Graphic_buffer &graphic_buffer, - const typename Get_map::storage_type& lcc) +template +void compute_face(const Mesh& mesh, + const typename Get_map::storage_type& lcc, + typename Get_map::type::Dart_const_descriptor dh, + CGAL::Graphic_buffer& graphic_buffer, + DrawingFunctor& drawing_functor) { + if(!drawing_functor.draw_face(lcc, dh)) + { return; } + typedef typename Get_map::type LCC; typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; typedef typename LCC::size_type size_type; @@ -146,15 +170,17 @@ void compute_face(typename Get_map::type::Dart_const_handle dh, } while(cur!=dh); - // CGAL::IO::Color c=m_fcolor.run(*lcc, dh); - graphic_buffer.face_begin(); //c); + if(drawing_functor.colored_face(lcc, dh)) + { graphic_buffer.face_begin(drawing_functor.face_color(lcc, dh)); } + else + { graphic_buffer.face_begin(); } cur=dh; do { - graphic_buffer.add_point_in_face(draw_function_for_face_graph_with_paths::get_point(cur, mesh), + graphic_buffer.add_point_in_face(draw_function_for_face_graph_with_paths::get_point(mesh, cur), draw_function_for_lcc::LCC_geom_utils:: - get_vertex_normal(lcc, cur)); + get_vertex_normal(lcc, cur)); cur=lcc.next(cur); } while(cur!=dh); @@ -162,88 +188,93 @@ void compute_face(typename Get_map::type::Dart_const_handle dh, graphic_buffer.face_end(); } -template -void compute_edge(typename Get_map::type::Dart_const_handle dh, - const Mesh &mesh, - CGAL::Graphic_buffer &graphic_buffer, +template +void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, + typename Get_map::type::Dart_const_descriptor dh, typename Get_map::type::size_type m_amark, - bool m_draw_marked_darts = true) + CGAL::Graphic_buffer& graphic_buffer, + DrawingFunctor& drawing_functor, + bool draw_marked_darts=true) { + if(!drawing_functor.draw_edge(lcc, dh)) + { return; } + typedef typename Get_map::type LCC; typedef typename LCC::size_type size_type; - typedef typename LCC::Dart_const_handle Dart_const_handle; + typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - Point p1 = get_point(dh, mesh); - Dart_const_handle d2 = lcc.other_extremity(dh); - if (d2!=LCC::null_handle) + Point p1=get_point(mesh, dh); + Dart_const_descriptor d2 = lcc.other_extremity(dh); + if (d2!=LCC::null_descriptor) { if (m_draw_marked_darts && m_amark!=LCC::INVALID_MARK && (lcc.is_marked(dh, m_amark) || lcc.is_marked(lcc.opposite2(dh), m_amark))) - { graphic_buffer.add_segment(p1, get_point(d2, mesh), CGAL::IO::Color(0, 0, 255)); } + { graphic_buffer.add_segment(p1, get_point(mesh, d2), CGAL::IO::Color(0, 0, 255)); } else - { graphic_buffer.add_segment(p1, get_point(d2, mesh)); } + { graphic_buffer.add_segment(p1, get_point(mesh, d2)); } } } template -void compute_edge(typename Get_map::type::Dart_const_handle dh, +void compute_edge(const Mesh &mesh, + const typename Get_map::storage_type& lcc, + typename Get_map::type::Dart_const_descriptor dh, const CGAL::IO::Color& color, - const Mesh &mesh, - CGAL::Graphic_buffer &graphic_buffer, - const typename Get_map::storage_type& lcc) + CGAL::Graphic_buffer& graphic_buffer) { typedef typename Get_map::type LCC; - typedef typename LCC::Dart_const_handle Dart_const_handle; + typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - Point p1 = get_point(dh, mesh); - Dart_const_handle d2 = lcc.other_extremity(dh); - if (d2!=LCC::null_handle) - { graphic_buffer.add_segment(p1, get_point(d2, mesh), color); } + Point p1=get_point(mesh, dh); + Dart_const_descriptor d2=lcc.other_extremity(dh); + if (d2!=LCC::null_descriptor) + { graphic_buffer.add_segment(p1, get_point(mesh, d2), color); } } template -void compute_vertex(typename Get_map::type::Dart_const_handle dh, - const Mesh &mesh, - CGAL::Graphic_buffer &graphic_buffer) +void compute_vertex(const Mesh &mesh, + typename Get_map::type::Dart_const_descriptor dh, + CGAL::Graphic_buffer& graphic_buffer, + DrawingFunctor& drawing_functor) { typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - graphic_buffer.add_point(get_point(dh, mesh)); + graphic_buffer.add_point(get_point(mesh, dh)); } template -void compute_path(std::size_t i, - typename Get_map::type::size_type amark, - const Mesh &mesh, +void compute_path(const Mesh &mesh, + const typename Get_map::storage_type& lcc, CGAL::Graphic_buffer &graphic_buffer, const std::vector>* m_paths, - const typename Get_map::storage_type& lcc) + std::size_t i, + typename Get_map::type::size_type amark) { typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - if ((*m_paths)[i].is_empty()) + if ((*m_paths)[i].is_empty() || !drawing_functor.draw_path(i)) { return; } CGAL::Random random(static_cast(i)); CGAL::IO::Color color = get_random_color(random); - graphic_buffer.add_point(get_point((*m_paths)[i].get_ith_dart(0), mesh), color); + graphic_buffer.add_point(get_point(mesh, (*m_paths)[i].get_ith_dart(0)), color); for (std::size_t j=0; j<(*m_paths)[i].length(); ++j) { if ( !lcc.is_marked( (*m_paths)[i].get_ith_dart(j), amark) ) { - compute_edge((*m_paths)[i].get_ith_dart(j), color, mesh, graphic_buffer, lcc); + compute_edge(mesh, lcc, (*m_paths)[i].get_ith_dart(j), color, mesh, graphic_buffer, lcc); lcc.template mark_cell<1>((*m_paths)[i].get_ith_dart(j), amark); } } @@ -253,11 +284,8 @@ template void compute_elements(const Mesh &mesh, CGAL::Graphic_buffer &graphic_buffer, const DrawingFunctor &m_drawing_functor, - const typename Get_map::storage_type& lcc, const std::vector>* m_paths, - typename Get_map::type::size_type amark /*= typename Get_map::type::INVALID_MARK*/, - bool m_nofaces = false, - bool m_draw_marked_darts = true) + typename Get_map::type::size_type amark) { typedef typename Get_map::type LCC; typedef typename LCC::size_type size_type; @@ -265,24 +293,24 @@ void compute_elements(const Mesh &mesh, typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - typedef typename LCC::Dart_const_handle Dart_const_handle; + typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; + typename Get_map::storage_type alcc(mesh); typename LCC::Dart_range::const_iterator m_current_dart = lcc.darts().end(); typename LCC::size_type m_oriented_mark = lcc.get_new_mark(); std::size_t m_current_path = m_paths->size(); - typename LCC::size_type m_amark = amark==(std::numeric_limits::max)()? + typename LCC::size_type m_amark=amark==(std::numeric_limits::max)()? LCC::INVALID_MARK:amark; // If !=INVALID_MARK, show darts marked with this mark lcc.orient(m_oriented_mark); - 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(); if (m_current_dart!=lcc.darts().end()) { // We want to draw only one dart - Dart_const_handle selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); + Dart_const_descriptor selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphic_buffer, lcc); lcc.template mark_cell<1>(selected_dart, markedges); compute_vertex(selected_dart, mesh, graphic_buffer); @@ -341,139 +369,77 @@ void compute_elements(const Mesh &mesh, } // namespace draw_function_for_face_graph_with_paths -template -void add_in_graphic_buffer(const Mesh &mesh, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor, - // TODO: I think I need to use smart pointers with lcc, right? - const typename Get_map::storage_type& lcc, - const std::vector>* m_paths, - typename Get_map::type::size_type amark= /*typename*/ Get_map::type::INVALID_MARK, - bool m_nofaces = false) { - draw_function_for_face_graph_with_paths::compute_elements(mesh, graphic_buffer, m_drawing_functor, lcc, m_paths, amark, m_nofaces); +template +void add_in_graphic_buffer(const Mesh& mesh, + CGAL::Graphic_buffer& graphic_buffer, + const std::vector>* paths, + const DrawingFunctor& drawing_functor, + typename Get_map::type::size_type amark= + typename Get_map::type::INVALID_MARK) +{ + draw_function_for_face_graph_with_paths::compute_elements(mesh, + graphic_buffer, + drawing_functor, + paths, amark); } template -void add_in_graphic_buffer(const Mesh &mesh, - CGAL::Graphic_buffer &graphic_buffer, - // TODO: I think I need to use smart pointers with lcc, right? - const typename Get_map::storage_type& lcc, - const std::vector>* m_paths, - typename Get_map::type::size_type amark= /*typename*/ Get_map::type::INVALID_MARK, - bool m_nofaces = false) { - +void add_in_graphic_buffer(const Mesh& mesh, + CGAL::Graphic_buffer& graphic_buffer, + const std::vector>* paths, + typename Get_map::type::size_type amark= + typename Get_map::type::INVALID_MARK) +{ // Default functor; user can add his own functor. Drawing_functor::type::Dart_const_handle /*vh*/, - typename Get_map::type::Dart_const_handle /*eh*/, - typename Get_map::type::Dart_const_handle /*fh*/> + typename Get_map::type::Dart_const_descriptor /*vh*/, + typename Get_map::type::Dart_const_descriptor /*eh*/, + typename Get_map::type::Dart_const_descriptor /*fh*/> drawing_functor; - add_in_graphic_buffer(mesh, graphic_buffer, drawing_functor, lcc, m_paths, amark, m_nofaces); + add_in_graphic_buffer(mesh, graphic_buffer, drawing_functor, paths, amark); } +#ifdef CGAL_USE_BASIC_VIEWER -template -void draw(const Mesh& alcc, +template +void draw(const Mesh& mesh, const std::vector >& paths, typename Get_map::type::size_type amark= (std::numeric_limits::type::size_type>::max)(), - const char* title="Mesh Viewer With Path", - bool nofill=false) { - + const char* title="Mesh Viewer With Path") +{ CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(alcc, buffer, alcc, &paths, amark, nofill); - draw_buffer(buffer); + add_in_graphic_buffer(mesh, buffer, &paths, amark); + draw_buffer(buffer, title); } - -template -void draw(const Mesh& alcc, +template +void draw(const Mesh& mesh, const std::vector >& paths, const DrawingFunctor& drawing_functor, typename Get_map::type::size_type amark= (std::numeric_limits::type::size_type>::max)(), - const char* title="Mesh Viewer With Path", - bool nofill=false) { - + const char* title="Mesh Viewer With Path") +{ CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(alcc, buffer, drawing_functor, alcc, &paths, amark, nofill); - draw_buffer(buffer); + add_in_graphic_buffer(mesh, buffer, drawing_functor, &paths, amark); + draw_buffer(buffer, title); } - -template +template void draw(const Mesh& mesh, std::initializer_list> l, typename Get_map::type::size_type amark= (std::numeric_limits::type::size_type>::max)(), - const char* title="Mesh Viewer With Path", - bool nofill=false) + const char* title="Mesh Viewer With Path") { std::vector> paths=l; - CGAL::Graphic_buffer buffer; - typename Get_map::storage_type alcc(mesh); - add_in_graphic_buffer(mesh, buffer, alcc, &paths, amark, nofill); - draw_buffer(buffer); -} - -/* -template -void draw(const Mesh& alcc, - const std::vector >& paths, - const char* title="Mesh Viewer With Path", - typename Get_map::type::size_type amark= - (std::numeric_limits::type::size_type>::max)(), - bool nofill=false, - const DrawingFunctor& drawing_functor=DrawingFunctor()) -{ -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif - - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[1]={"lccviewer"}; - QApplication app(argc,const_cast(argv)); - Face_graph_with_path_viewer mainwindow(app.activeWindow(), - alcc, &paths, amark, - title, nofill, - drawing_functor); - mainwindow.show(); - app.exec(); - } + add_in_graphic_buffer(mesh, buffer, &paths, amark); + draw_buffer(buffer, title); } -template -void draw(const Mesh& alcc, - const std::vector >& paths, - const char* title="Mesh Viewer With Path", - typename Get_map::type::size_type amark= - (std::numeric_limits::type::size_type>::max)(), - bool nofill=false) -{ - DefaultDrawingFunctorLCC f; - draw(alcc, paths, title, amark, nofill, f); -} - -template -void draw(const Mesh& alcc, - std::initializer_list> l, - const char* title="Mesh Viewer With Path", - typename Get_map::type::size_type amark= - (std::numeric_limits::type::size_type>::max)(), - bool nofill=false) -{ - std::vector > paths=l; - draw(alcc, paths, title, amark, nofill); -} -*/ - } // End namespace CGAL #else // CGAL_USE_BASIC_VIEWER @@ -481,24 +447,34 @@ void draw(const Mesh& alcc, namespace CGAL { - template + template void draw(const Mesh&, - const std::vector >& , - const char* ="", + const std::vector >&, + typename Get_map::type::size_type= + (std::numeric_limits::type::size_type>::max)(), + const char* ="") + { + std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< + void draw(const Mesh&, + const std::vector >&, + const DrawingFunctor&, typename Get_map::type::size_type= (std::numeric_limits::type::size_type>::max)(), - bool=false) + const char* ="") { std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< + template void draw(const Mesh&, std::initializer_list>, const char* ="", typename Get_map::type::size_type= (std::numeric_limits::type::size_type>::max)(), - bool=false) + const char* ="") { std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Wed, 16 Nov 2022 16:49:54 +0200 Subject: [PATCH 125/399] Test push --- CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt b/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt index 7f268458568a..db97fdc64402 100644 --- a/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt +++ b/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt @@ -8,6 +8,7 @@ namespace CGAL { \author Guillaume Damiand, Mostafa Ashraf + */ } /* namespace CGAL */ \ No newline at end of file From 9fcd8f73d578506957bf4db7c59a75ccdde8c08b Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Thu, 8 Dec 2022 17:11:30 +0200 Subject: [PATCH 126/399] bugs fixed, added TODO --- .../draw_surface_mesh_small_faces.cpp | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp b/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp index b24e54801b9d..0037cfb34997 100644 --- a/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp +++ b/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp @@ -4,23 +4,40 @@ #include #include #include +#include "CGAL/draw_surface_mesh_small_faces.h" + #include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; typedef CGAL::Surface_mesh Mesh; +typedef Kernel::FT FT; struct Drawing_functor_small_face: public CGAL::Drawing_functor - + { - drawing_functor.colored_face = [](const FG&, - typename boost::graph_traits::face_descriptor fg) -> bool + Drawing_functor_small_face() { + + // TODO: change threshold in realtime. + m_threshold = 2000; + + // Return false if face value less than threshold. + is_small = [=] (typename boost::graph_traits::face_descriptor fg) -> bool { + return fg <= m_threshold; + }; + + colored_face = [=](const Mesh&, + typename boost::graph_traits::face_descriptor fg) -> bool { return is_small(fg); }; - drawing_functor.face_color = [] (const FG&, - typename boost::graph_traits::face_descriptor) -> CGAL::IO::Color + face_color = [] (const Mesh&, + typename boost::graph_traits::face_descriptor) -> CGAL::IO::Color { return CGAL::IO::Color(200, 60, 60); }; // Red + } + + std::function::face_descriptor)> is_small; + unsigned int m_threshold; FT m_min_size, m_max_size; bool m_draw_small_faces; From 5948fc19fef319559f5ed4016407354e94a6fccb Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 9 Dec 2022 14:05:38 +0200 Subject: [PATCH 127/399] Initial Commit --- .../CGAL/draw_surface_mesh_small_faces.h | 264 ++++++++++++++++++ 1 file changed, 264 insertions(+) create mode 100644 Surface_mesh/include/CGAL/draw_surface_mesh_small_faces.h diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh_small_faces.h b/Surface_mesh/include/CGAL/draw_surface_mesh_small_faces.h new file mode 100644 index 000000000000..dfbfc89f4307 --- /dev/null +++ b/Surface_mesh/include/CGAL/draw_surface_mesh_small_faces.h @@ -0,0 +1,264 @@ +// Copyright (c) 2018 GeometryFactory (France) +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Guillaume Damiand +// Mostafa Ashraf + +#ifndef CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H +#define CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H + +#include +#include +#include +#include + +#ifdef CGAL_USE_BASIC_VIEWER + +#include +#include + +#include + +namespace draw_function_for_surface_mesh +{ +template +typename CGAL::Kernel_traits::Kernel::Vector_3 get_face_normal(typename SM::Halfedge_index he, + const SM &sm) +{ + typedef typename SM::Halfedge_index halfedge_descriptor; + typedef typename SM::Point Point; + typedef typename CGAL::Kernel_traits::Kernel Kernel; + + 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)); +} + +template +typename CGAL::Kernel_traits::Kernel::Vector_3 get_vertex_normal(typename SM::Halfedge_index he, + const SM &sm) +{ + typedef typename SM::Point Point; + typedef typename CGAL::Kernel_traits::Kernel Kernel; + typedef typename SM::Halfedge_index halfedge_descriptor; + + 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, sm); + 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; +} + +template +void compute_face(typename SM::Face_index fh, + const SM &sm, + CGAL::Graphic_buffer &graphic_buffer, + typename CGAL::Kernel_traits::Kernel::FT & m_min_size, + typename CGAL::Kernel_traits::Kernel::FT & m_max_size) +{ + + typedef typename SM::Point Point; + typedef typename CGAL::Kernel_traits::Kernel Kernel; + typedef typename SM::Face_index face_descriptor; + typedef typename SM::Halfedge_index halfedge_descriptor; + typedef typename Kernel::FT FT; + + // TODO: add custom functor, right? + bool m_draw_small_faces = true; + bool m_draw_big_faces = true; + + unsigned int m_threshold = 85; + + // [Face creation] + bool issmall=false; + + // Default color of faces + CGAL::IO::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"); + assert(exist); + + // It it is smaller, color the face in red. + if (get(faces_size, fh) +void compute_edge(typename SM::Edge_index e, + const SM &sm, + CGAL::Graphic_buffer &graphic_buffer) +{ + /// [Edge creation] + graphic_buffer.add_segment(sm.point(sm.source(sm.halfedge(e))), + sm.point(sm.target(sm.halfedge(e)))); + /// [Edge creation] +} + +template +void compute_vertex(typename SM::Vertex_index vh, + const SM &sm, + CGAL::Graphic_buffer &graphic_buffer) +{ + /// [Vertex creation] + graphic_buffer.add_point(sm.point(vh)); + /// [Vertex creation] +} + +template +void compute_elements(const SM &sm, + CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) +{ + + 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; + + FT m_min_size, m_max_size; + + 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"); + assert(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; + } + } + + for (typename SM::Face_range::iterator f=sm.faces().begin(); + f!=sm.faces().end(); ++f) + { + if (*f!=boost::graph_traits::null_face()) + { compute_face(*f, sm, graphic_buffer, m_min_size, m_max_size); } + } + + for (typename SM::Edge_range::iterator e=sm.edges().begin(); + e!=sm.edges().end(); ++e) + { compute_edge(*e, sm, graphic_buffer); } + + for (typename SM::Vertex_range::iterator v=sm.vertices().begin(); + v!=sm.vertices().end(); ++v) + { compute_vertex(*v, sm, graphic_buffer); } +} + +} // draw_function_for_surface_mesh + +template +void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer, + const DrawingFunctor &m_drawing_functor) { + draw_function_for_surface_mesh::compute_elements(sm, graphic_buffer, m_drawing_functor); +} + +template +void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer) { + + CGAL::Drawing_functor drawing_functor; + + add_in_graphic_buffer(sm, graphic_buffer, drawing_functor); +} + +template +void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh, + const DrawingFunctor &drawing_functor) +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(amesh, buffer, drawing_functor); + draw_buffer(buffer); +} + +template +void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh) +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(amesh, buffer); + draw_buffer(buffer); +} + + + +#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."< +void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh&, const DrawingFunctor &drawing_functor) +{ + std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Fri, 9 Dec 2022 14:07:48 +0200 Subject: [PATCH 128/399] Path handled --- Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp b/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp index 5d6c3b3d54ee..3e81bd0bf67d 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "draw_surface_mesh_small_faces.h" +#include "CGAL/draw_surface_mesh_small_faces.h" typedef CGAL::Simple_cartesian K; typedef CGAL::Surface_mesh Mesh; From d780acb988361e7602dc3d079236ef5e220794d0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 25 Apr 2023 17:05:13 +0200 Subject: [PATCH 129/399] Example for basic viewer draw small faces --- .../Surface_mesh/sm_draw_small_faces.cpp | 116 +++++++- .../CGAL/draw_surface_mesh_small_faces.h | 264 ------------------ 2 files changed, 114 insertions(+), 266 deletions(-) delete mode 100644 Surface_mesh/include/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 index 3e81bd0bf67d..a8cd5ad72901 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "CGAL/draw_surface_mesh_small_faces.h" +#include typedef CGAL::Simple_cartesian K; typedef CGAL::Surface_mesh Mesh; @@ -13,6 +13,71 @@ typedef Mesh::Vertex_index vertex_descriptor; typedef Mesh::Face_index face_descriptor; typedef K::FT FT; +template +struct Drawing_functor_small_faces: + public CGAL::Drawing_functor::vertex_descriptor, + typename boost::graph_traits::edge_descriptor, + typename boost::graph_traits::face_descriptor> +{ + using Self=Drawing_functor_small_faces; + using Base=CGAL::Drawing_functor::vertex_descriptor, + typename boost::graph_traits::edge_descriptor, + typename boost::graph_traits::face_descriptor>; + + Drawing_functor_small_faces(const SM& sm): Base(), m_sm(sm) + { + typename SM::template Property_map faces_size; + boost::tie(faces_size, m_with_size)=sm.template property_map("f:size"); + if(!m_with_size) + { return; } + + 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; + } + + this->face_color=[=](const SM& sm, + typename boost::graph_traits::face_descriptor fh) -> CGAL::IO::Color + { return this->get_face_color(sm, fh); }; + + this->colored_face = [](const SM&, + typename boost::graph_traits::face_descriptor) -> bool + { return true; }; + } + + CGAL::IO::Color get_face_color(const SM& sm, + typename boost::graph_traits::face_descriptor fh) + { + // Default color of faces + CGAL::IO::Color c(75,160,255); + if(!m_with_size) { return c; } + + // 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"); + assert(exist); + + // If the face is small, color it in red. + if (get(faces_size, fh)1) ? argv[1] : CGAL::data_file_path("meshes/elephant.off"); @@ -34,8 +99,55 @@ int main(int argc, char* argv[]) for(face_descriptor fd : sm.faces()) { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } - draw_surface_mesh_with_small_faces(sm); + Drawing_functor_small_faces df(sm); + CGAL::Graphic_buffer buffer; + + add_in_graphic_buffer(sm, buffer, df); + CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); + if(app) + { + app.basic_viewer().on_key_pressed= + [&sm, &df, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + { + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) + { + df.m_threshold+=5; + if(df.m_threshold>100) { df.m_threshold=100; } + basic_viewer->displayMessage + (QString("Small faces threshold=%1.").arg(df.m_threshold)); + + basic_viewer->clear(); + add_in_graphic_buffer(sm, buffer, df); + basic_viewer->redraw(); + } + else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) + { + if(df.m_threshold<5) { df.m_threshold=0; } + else { df.m_threshold-=5; } + basic_viewer->displayMessage + (QString("Small faces threshold=%1.").arg(df.m_threshold)); + + basic_viewer->clear(); + add_in_graphic_buffer(sm, buffer, df); + basic_viewer->redraw(); + } + else + { + // Return false will call the base method to process others/classicals key + return false; + } + return true; + }; + // Here we add shortcut descriptions + app.basic_viewer().setKeyDescription(::Qt::Key_I, "Increase threshold for small faces"); + app.basic_viewer().setKeyDescription(::Qt::Key_D, "Decrease threshold for small faces"); + + // Then we run the app + app.run(); + } + sm.remove_property_map(faces_size); return EXIT_SUCCESS; diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh_small_faces.h b/Surface_mesh/include/CGAL/draw_surface_mesh_small_faces.h deleted file mode 100644 index dfbfc89f4307..000000000000 --- a/Surface_mesh/include/CGAL/draw_surface_mesh_small_faces.h +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) 2018 GeometryFactory (France) -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// Author(s) : Guillaume Damiand -// Mostafa Ashraf - -#ifndef CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H -#define CGAL_DRAW_SURFACE_MESH_SMALL_FACES_H - -#include -#include -#include -#include - -#ifdef CGAL_USE_BASIC_VIEWER - -#include -#include - -#include - -namespace draw_function_for_surface_mesh -{ -template -typename CGAL::Kernel_traits::Kernel::Vector_3 get_face_normal(typename SM::Halfedge_index he, - const SM &sm) -{ - typedef typename SM::Halfedge_index halfedge_descriptor; - typedef typename SM::Point Point; - typedef typename CGAL::Kernel_traits::Kernel Kernel; - - 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)); -} - -template -typename CGAL::Kernel_traits::Kernel::Vector_3 get_vertex_normal(typename SM::Halfedge_index he, - const SM &sm) -{ - typedef typename SM::Point Point; - typedef typename CGAL::Kernel_traits::Kernel Kernel; - typedef typename SM::Halfedge_index halfedge_descriptor; - - 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, sm); - 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; -} - -template -void compute_face(typename SM::Face_index fh, - const SM &sm, - CGAL::Graphic_buffer &graphic_buffer, - typename CGAL::Kernel_traits::Kernel::FT & m_min_size, - typename CGAL::Kernel_traits::Kernel::FT & m_max_size) -{ - - typedef typename SM::Point Point; - typedef typename CGAL::Kernel_traits::Kernel Kernel; - typedef typename SM::Face_index face_descriptor; - typedef typename SM::Halfedge_index halfedge_descriptor; - typedef typename Kernel::FT FT; - - // TODO: add custom functor, right? - bool m_draw_small_faces = true; - bool m_draw_big_faces = true; - - unsigned int m_threshold = 85; - - // [Face creation] - bool issmall=false; - - // Default color of faces - CGAL::IO::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"); - assert(exist); - - // It it is smaller, color the face in red. - if (get(faces_size, fh) -void compute_edge(typename SM::Edge_index e, - const SM &sm, - CGAL::Graphic_buffer &graphic_buffer) -{ - /// [Edge creation] - graphic_buffer.add_segment(sm.point(sm.source(sm.halfedge(e))), - sm.point(sm.target(sm.halfedge(e)))); - /// [Edge creation] -} - -template -void compute_vertex(typename SM::Vertex_index vh, - const SM &sm, - CGAL::Graphic_buffer &graphic_buffer) -{ - /// [Vertex creation] - graphic_buffer.add_point(sm.point(vh)); - /// [Vertex creation] -} - -template -void compute_elements(const SM &sm, - CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) -{ - - 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; - - FT m_min_size, m_max_size; - - 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"); - assert(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; - } - } - - for (typename SM::Face_range::iterator f=sm.faces().begin(); - f!=sm.faces().end(); ++f) - { - if (*f!=boost::graph_traits::null_face()) - { compute_face(*f, sm, graphic_buffer, m_min_size, m_max_size); } - } - - for (typename SM::Edge_range::iterator e=sm.edges().begin(); - e!=sm.edges().end(); ++e) - { compute_edge(*e, sm, graphic_buffer); } - - for (typename SM::Vertex_range::iterator v=sm.vertices().begin(); - v!=sm.vertices().end(); ++v) - { compute_vertex(*v, sm, graphic_buffer); } -} - -} // draw_function_for_surface_mesh - -template -void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer, - const DrawingFunctor &m_drawing_functor) { - draw_function_for_surface_mesh::compute_elements(sm, graphic_buffer, m_drawing_functor); -} - -template -void add_in_graphic_buffer(const SM &sm, CGAL::Graphic_buffer &graphic_buffer) { - - CGAL::Drawing_functor drawing_functor; - - add_in_graphic_buffer(sm, graphic_buffer, drawing_functor); -} - -template -void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh, - const DrawingFunctor &drawing_functor) -{ - CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(amesh, buffer, drawing_functor); - draw_buffer(buffer); -} - -template -void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh& amesh) -{ - CGAL::Graphic_buffer buffer; - add_in_graphic_buffer(amesh, buffer); - draw_buffer(buffer); -} - - - -#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."< -void draw_surface_mesh_with_small_faces(CGAL::Surface_mesh&, const DrawingFunctor &drawing_functor) -{ - std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Thu, 27 Apr 2023 12:25:56 +0200 Subject: [PATCH 130/399] Rename package basic viewer; move example --- .../doc/CGAL_basic_viewers/CGAL_basic_viewers.txt | 0 .../doc/CGAL_basic_viewers/Doxyfile.in | 0 .../doc/CGAL_basic_viewers/PackageDescription.txt | 0 .../doc/CGAL_basic_viewers/dependencies | 0 .../doc/CGAL_basic_viewers/examples.txt | 0 .../examples/Basic_viewer}/CMakeLists.txt | 0 .../examples/Basic_viewer}/draw_surface_mesh_small_faces.cpp | 0 .../examples/Basic_viewer}/sm_draw_small_faces.cpp | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {CGAL_basic_viewers => Basic_viewer}/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt (100%) rename {CGAL_basic_viewers => Basic_viewer}/doc/CGAL_basic_viewers/Doxyfile.in (100%) rename {CGAL_basic_viewers => Basic_viewer}/doc/CGAL_basic_viewers/PackageDescription.txt (100%) rename {CGAL_basic_viewers => Basic_viewer}/doc/CGAL_basic_viewers/dependencies (100%) rename {CGAL_basic_viewers => Basic_viewer}/doc/CGAL_basic_viewers/examples.txt (100%) rename {CGAL_basic_viewers/examples/CGAL_basic_viewers => Basic_viewer/examples/Basic_viewer}/CMakeLists.txt (100%) rename {CGAL_basic_viewers/examples/CGAL_basic_viewers => Basic_viewer/examples/Basic_viewer}/draw_surface_mesh_small_faces.cpp (100%) rename {Surface_mesh/examples/Surface_mesh => Basic_viewer/examples/Basic_viewer}/sm_draw_small_faces.cpp (100%) diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt b/Basic_viewer/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt similarity index 100% rename from CGAL_basic_viewers/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt rename to Basic_viewer/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/Doxyfile.in b/Basic_viewer/doc/CGAL_basic_viewers/Doxyfile.in similarity index 100% rename from CGAL_basic_viewers/doc/CGAL_basic_viewers/Doxyfile.in rename to Basic_viewer/doc/CGAL_basic_viewers/Doxyfile.in diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/PackageDescription.txt b/Basic_viewer/doc/CGAL_basic_viewers/PackageDescription.txt similarity index 100% rename from CGAL_basic_viewers/doc/CGAL_basic_viewers/PackageDescription.txt rename to Basic_viewer/doc/CGAL_basic_viewers/PackageDescription.txt diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/dependencies b/Basic_viewer/doc/CGAL_basic_viewers/dependencies similarity index 100% rename from CGAL_basic_viewers/doc/CGAL_basic_viewers/dependencies rename to Basic_viewer/doc/CGAL_basic_viewers/dependencies diff --git a/CGAL_basic_viewers/doc/CGAL_basic_viewers/examples.txt b/Basic_viewer/doc/CGAL_basic_viewers/examples.txt similarity index 100% rename from CGAL_basic_viewers/doc/CGAL_basic_viewers/examples.txt rename to Basic_viewer/doc/CGAL_basic_viewers/examples.txt diff --git a/CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt similarity index 100% rename from CGAL_basic_viewers/examples/CGAL_basic_viewers/CMakeLists.txt rename to Basic_viewer/examples/Basic_viewer/CMakeLists.txt diff --git a/CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp similarity index 100% rename from CGAL_basic_viewers/examples/CGAL_basic_viewers/draw_surface_mesh_small_faces.cpp rename to Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp diff --git a/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/sm_draw_small_faces.cpp similarity index 100% rename from Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp rename to Basic_viewer/examples/Basic_viewer/sm_draw_small_faces.cpp From 5709abc61c175723057ace0a9fc5f11f78542807 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 27 Apr 2023 14:53:48 +0200 Subject: [PATCH 131/399] example basic viewer --- .../examples/Basic_viewer/CMakeLists.txt | 11 +- .../Basic_viewer/draw_mesh_and_points.cpp | 67 ++++++++ .../draw_surface_mesh_small_faces.cpp | 162 ++++++++++++++---- .../Basic_viewer/sm_draw_small_faces.cpp | 154 ----------------- .../package_info/Basic_viewer/dependencies | 3 + .../package_info/Basic_viewer/description.txt | 1 + .../package_info/Basic_viewer/license.txt | 1 + .../Basic_viewer/long_description.txt | 3 + .../package_info/Basic_viewer/maintainer | 1 + .../examples/Surface_mesh/CMakeLists.txt | 2 - 10 files changed, 211 insertions(+), 194 deletions(-) create mode 100644 Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp delete mode 100644 Basic_viewer/examples/Basic_viewer/sm_draw_small_faces.cpp create mode 100644 Basic_viewer/package_info/Basic_viewer/dependencies create mode 100644 Basic_viewer/package_info/Basic_viewer/description.txt create mode 100644 Basic_viewer/package_info/Basic_viewer/license.txt create mode 100644 Basic_viewer/package_info/Basic_viewer/long_description.txt create mode 100644 Basic_viewer/package_info/Basic_viewer/maintainer diff --git a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt index e5a6aa07ad8b..03d5b03a22f6 100644 --- a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt +++ b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt @@ -7,15 +7,24 @@ # Careful when modifying cmake_minimum_required(VERSION 3.1...3.23) -project(CGAL_basic_viewers_Examples) +project(Basic_viewer_Examples) #CGAL_Qt5 is needed for the drawing. find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) +find_package(Eigen3 3.1.0) +include(CGAL_Eigen3_support) create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") +create_single_source_cgal_program("draw_mesh_and_points.cpp") + if(CGAL_Qt5_FOUND) #link it with the required CGAL libraries target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(draw_mesh_and_points PUBLIC CGAL::CGAL_Basic_viewer) +endif() + +if(TARGET CGAL::Eigen3_support) + target_link_libraries(draw_mesh_and_points PUBLIC CGAL::Eigen3_support) endif() #end of the file diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp new file mode 100644 index 000000000000..10a1afd9fe95 --- /dev/null +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// Types +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point; +typedef Kernel::Vector_3 Vector; +typedef std::pair Pwn; +typedef CGAL::Polyhedron_3 Polyhedron; +using PS3=CGAL::Point_set_3; + +struct Drawing_functor_green_points: + public CGAL::Drawing_functor +{ + bool colored_vertex(const PS3&, typename PS3::const_iterator) const + { return true; } + CGAL::IO::Color vertex_color(const PS3&, typename PS3::const_iterator) const + { return CGAL::IO::Color(0,220,0); } +}; + +int main(void) +{ + std::vector points; + + if(!CGAL::IO::read_points(CGAL::data_file_path("points_3/kitten.xyz"), std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()))) + { + std::cerr << "Error: cannot read input file!" << std::endl; + return EXIT_FAILURE; + } + + Polyhedron output_mesh; + + double average_spacing = CGAL::compute_average_spacing + (points, 6, CGAL::parameters::point_map(CGAL::First_of_pair_property_map())); + + if (CGAL::poisson_surface_reconstruction_delaunay + (points.begin(), points.end(), + CGAL::First_of_pair_property_map(), + CGAL::Second_of_pair_property_map(), + output_mesh, average_spacing)) + { + PS3 point_set; + for(Pwn& it: points) + { point_set.insert(it.first); } + + CGAL::Graphic_buffer graphic_buffer; + CGAL::add_in_graphic_buffer(point_set, graphic_buffer, Drawing_functor_green_points()); + CGAL::add_in_graphic_buffer(output_mesh, graphic_buffer); + CGAL::draw_buffer(graphic_buffer); + } + else + { return EXIT_FAILURE; } + + return EXIT_SUCCESS; +} diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 0037cfb34997..a8cd5ad72901 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -1,47 +1,81 @@ -#include -#include -#include -#include +#include #include -#include -#include "CGAL/draw_surface_mesh_small_faces.h" - +#include +#include #include +#include +#include +#include -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point; -typedef CGAL::Surface_mesh Mesh; -typedef Kernel::FT FT; +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; -struct Drawing_functor_small_face: public CGAL::Drawing_functor - +template +struct Drawing_functor_small_faces: + public CGAL::Drawing_functor::vertex_descriptor, + typename boost::graph_traits::edge_descriptor, + typename boost::graph_traits::face_descriptor> { - Drawing_functor_small_face() { + using Self=Drawing_functor_small_faces; + using Base=CGAL::Drawing_functor::vertex_descriptor, + typename boost::graph_traits::edge_descriptor, + typename boost::graph_traits::face_descriptor>; + + Drawing_functor_small_faces(const SM& sm): Base(), m_sm(sm) + { + typename SM::template Property_map faces_size; + boost::tie(faces_size, m_with_size)=sm.template property_map("f:size"); + if(!m_with_size) + { return; } + + 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; + } - // TODO: change threshold in realtime. - m_threshold = 2000; + this->face_color=[=](const SM& sm, + typename boost::graph_traits::face_descriptor fh) -> CGAL::IO::Color + { return this->get_face_color(sm, fh); }; - // Return false if face value less than threshold. - is_small = [=] (typename boost::graph_traits::face_descriptor fg) -> bool { - return fg <= m_threshold; - }; + this->colored_face = [](const SM&, + typename boost::graph_traits::face_descriptor) -> bool + { return true; }; + } - colored_face = [=](const Mesh&, - typename boost::graph_traits::face_descriptor fg) -> bool - { return is_small(fg); }; + CGAL::IO::Color get_face_color(const SM& sm, + typename boost::graph_traits::face_descriptor fh) + { + // Default color of faces + CGAL::IO::Color c(75,160,255); + if(!m_with_size) { return c; } + + // 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"); + assert(exist); - face_color = [] (const Mesh&, - typename boost::graph_traits::face_descriptor) -> CGAL::IO::Color - { return CGAL::IO::Color(200, 60, 60); }; // Red + // If the face is small, color it in red. + if (get(faces_size, fh)::face_descriptor)> is_small; - - unsigned int m_threshold; + + const SM& m_sm; + bool m_with_size; FT m_min_size, m_max_size; - bool m_draw_small_faces; - bool m_draw_big_faces; + unsigned int m_threshold=85; // 85% }; int main(int argc, char* argv[]) @@ -55,12 +89,66 @@ int main(int argc, char* argv[]) return EXIT_FAILURE; } - Drawing_functor_small_face drawing_functor; - CGAL::draw(sm, drawing_functor); + 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.); + assert(created); - // 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"); + for(face_descriptor fd : sm.faces()) + { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } + + Drawing_functor_small_faces df(sm); + CGAL::Graphic_buffer buffer; + + add_in_graphic_buffer(sm, buffer, df); + CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); + if(app) + { + app.basic_viewer().on_key_pressed= + [&sm, &df, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + { + const ::Qt::KeyboardModifiers modifiers = e->modifiers(); + if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) + { + df.m_threshold+=5; + if(df.m_threshold>100) { df.m_threshold=100; } + basic_viewer->displayMessage + (QString("Small faces threshold=%1.").arg(df.m_threshold)); + + basic_viewer->clear(); + add_in_graphic_buffer(sm, buffer, df); + basic_viewer->redraw(); + } + else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) + { + if(df.m_threshold<5) { df.m_threshold=0; } + else { df.m_threshold-=5; } + basic_viewer->displayMessage + (QString("Small faces threshold=%1.").arg(df.m_threshold)); + + basic_viewer->clear(); + add_in_graphic_buffer(sm, buffer, df); + basic_viewer->redraw(); + } + else + { + // Return false will call the base method to process others/classicals key + return false; + } + return true; + }; + + // Here we add shortcut descriptions + app.basic_viewer().setKeyDescription(::Qt::Key_I, "Increase threshold for small faces"); + app.basic_viewer().setKeyDescription(::Qt::Key_D, "Decrease threshold for small faces"); + + // Then we run the app + app.run(); + } + + sm.remove_property_map(faces_size); return EXIT_SUCCESS; } diff --git a/Basic_viewer/examples/Basic_viewer/sm_draw_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/sm_draw_small_faces.cpp deleted file mode 100644 index a8cd5ad72901..000000000000 --- a/Basic_viewer/examples/Basic_viewer/sm_draw_small_faces.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -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; - -template -struct Drawing_functor_small_faces: - public CGAL::Drawing_functor::vertex_descriptor, - typename boost::graph_traits::edge_descriptor, - typename boost::graph_traits::face_descriptor> -{ - using Self=Drawing_functor_small_faces; - using Base=CGAL::Drawing_functor::vertex_descriptor, - typename boost::graph_traits::edge_descriptor, - typename boost::graph_traits::face_descriptor>; - - Drawing_functor_small_faces(const SM& sm): Base(), m_sm(sm) - { - typename SM::template Property_map faces_size; - boost::tie(faces_size, m_with_size)=sm.template property_map("f:size"); - if(!m_with_size) - { return; } - - 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; - } - - this->face_color=[=](const SM& sm, - typename boost::graph_traits::face_descriptor fh) -> CGAL::IO::Color - { return this->get_face_color(sm, fh); }; - - this->colored_face = [](const SM&, - typename boost::graph_traits::face_descriptor) -> bool - { return true; }; - } - - CGAL::IO::Color get_face_color(const SM& sm, - typename boost::graph_traits::face_descriptor fh) - { - // Default color of faces - CGAL::IO::Color c(75,160,255); - if(!m_with_size) { return c; } - - // 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"); - assert(exist); - - // If the face is small, color it in red. - if (get(faces_size, fh)1) ? argv[1] : CGAL::data_file_path("meshes/elephant.off"); - - Mesh sm; - if(!CGAL::IO::read_polygon_mesh(filename, sm)) - { - std::cerr << "Invalid input file." << std::endl; - return EXIT_FAILURE; - } - - 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.); - assert(created); - - for(face_descriptor fd : sm.faces()) - { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } - - Drawing_functor_small_faces df(sm); - CGAL::Graphic_buffer buffer; - - add_in_graphic_buffer(sm, buffer, df); - CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); - if(app) - { - app.basic_viewer().on_key_pressed= - [&sm, &df, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool - { - const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) - { - df.m_threshold+=5; - if(df.m_threshold>100) { df.m_threshold=100; } - basic_viewer->displayMessage - (QString("Small faces threshold=%1.").arg(df.m_threshold)); - - basic_viewer->clear(); - add_in_graphic_buffer(sm, buffer, df); - basic_viewer->redraw(); - } - else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) - { - if(df.m_threshold<5) { df.m_threshold=0; } - else { df.m_threshold-=5; } - basic_viewer->displayMessage - (QString("Small faces threshold=%1.").arg(df.m_threshold)); - - basic_viewer->clear(); - add_in_graphic_buffer(sm, buffer, df); - basic_viewer->redraw(); - } - else - { - // Return false will call the base method to process others/classicals key - return false; - } - return true; - }; - - // Here we add shortcut descriptions - app.basic_viewer().setKeyDescription(::Qt::Key_I, "Increase threshold for small faces"); - app.basic_viewer().setKeyDescription(::Qt::Key_D, "Decrease threshold for small faces"); - - // Then we run the app - app.run(); - } - - sm.remove_property_map(faces_size); - - return EXIT_SUCCESS; -} diff --git a/Basic_viewer/package_info/Basic_viewer/dependencies b/Basic_viewer/package_info/Basic_viewer/dependencies new file mode 100644 index 000000000000..d2dd8a53bd84 --- /dev/null +++ b/Basic_viewer/package_info/Basic_viewer/dependencies @@ -0,0 +1,3 @@ +Poisson_surface_reconstruction_3 +Polyhedron +Surface_mesh diff --git a/Basic_viewer/package_info/Basic_viewer/description.txt b/Basic_viewer/package_info/Basic_viewer/description.txt new file mode 100644 index 000000000000..bf6b6a0aef80 --- /dev/null +++ b/Basic_viewer/package_info/Basic_viewer/description.txt @@ -0,0 +1 @@ +Basic viewer diff --git a/Basic_viewer/package_info/Basic_viewer/license.txt b/Basic_viewer/package_info/Basic_viewer/license.txt new file mode 100644 index 000000000000..5c1c5d8436f8 --- /dev/null +++ b/Basic_viewer/package_info/Basic_viewer/license.txt @@ -0,0 +1 @@ +LGPL (v3 or later) diff --git a/Basic_viewer/package_info/Basic_viewer/long_description.txt b/Basic_viewer/package_info/Basic_viewer/long_description.txt new file mode 100644 index 000000000000..12cc9c460fc7 --- /dev/null +++ b/Basic_viewer/package_info/Basic_viewer/long_description.txt @@ -0,0 +1,3 @@ +Implementation of basic viewers. + +A basic viewer allows to visualize a data structure of CGAL. diff --git a/Basic_viewer/package_info/Basic_viewer/maintainer b/Basic_viewer/package_info/Basic_viewer/maintainer new file mode 100644 index 000000000000..942352b9dc41 --- /dev/null +++ b/Basic_viewer/package_info/Basic_viewer/maintainer @@ -0,0 +1 @@ +Guillaume Damiand diff --git a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt index 9c693ffaa08d..80d9389a4ee4 100644 --- a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt @@ -22,7 +22,6 @@ create_single_source_cgal_program("sm_iterators.cpp") create_single_source_cgal_program("sm_kruskal.cpp") create_single_source_cgal_program("sm_memory.cpp") create_single_source_cgal_program("sm_properties.cpp") -create_single_source_cgal_program("sm_draw_small_faces.cpp") create_single_source_cgal_program("check_orientation.cpp") #create the executable of the application @@ -32,7 +31,6 @@ if(CGAL_Qt5_FOUND) #link it with the required CGAL libraries target_link_libraries(draw_surface_mesh PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(sm_draw_small_faces PUBLIC CGAL::CGAL_Basic_viewer) endif() #end of the file From fe92449d008086d3e8fb384cbe7a140f851d5d6f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 27 Apr 2023 15:04:02 +0200 Subject: [PATCH 132/399] doc --- .../CGAL_basic_viewers.txt => Basic_viewer/Basic_viewer.txt} | 4 ++-- Basic_viewer/doc/Basic_viewer/Doxyfile.in | 3 +++ .../PackageDescription.txt | 0 .../doc/{CGAL_basic_viewers => Basic_viewer}/dependencies | 0 Basic_viewer/doc/Basic_viewer/examples.txt | 4 ++++ Basic_viewer/doc/CGAL_basic_viewers/Doxyfile.in | 3 --- Basic_viewer/doc/CGAL_basic_viewers/examples.txt | 0 7 files changed, 9 insertions(+), 5 deletions(-) rename Basic_viewer/doc/{CGAL_basic_viewers/CGAL_basic_viewers.txt => Basic_viewer/Basic_viewer.txt} (66%) create mode 100644 Basic_viewer/doc/Basic_viewer/Doxyfile.in rename Basic_viewer/doc/{CGAL_basic_viewers => Basic_viewer}/PackageDescription.txt (100%) rename Basic_viewer/doc/{CGAL_basic_viewers => Basic_viewer}/dependencies (100%) create mode 100644 Basic_viewer/doc/Basic_viewer/examples.txt delete mode 100644 Basic_viewer/doc/CGAL_basic_viewers/Doxyfile.in delete mode 100644 Basic_viewer/doc/CGAL_basic_viewers/examples.txt diff --git a/Basic_viewer/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt similarity index 66% rename from Basic_viewer/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt rename to Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index db97fdc64402..f46fd36c5f4a 100644 --- a/Basic_viewer/doc/CGAL_basic_viewers/CGAL_basic_viewers.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -2,7 +2,7 @@ namespace CGAL { /*! \mainpage User Manual -\anchor Chapter_CGAL_Basic_viewers +\anchor Chapter_Basic_viewer \anchor \cgalAutoToc \author Guillaume Damiand, Mostafa Ashraf @@ -11,4 +11,4 @@ namespace CGAL { */ -} /* namespace CGAL */ \ No newline at end of file +} /* namespace CGAL */ diff --git a/Basic_viewer/doc/Basic_viewer/Doxyfile.in b/Basic_viewer/doc/Basic_viewer/Doxyfile.in new file mode 100644 index 000000000000..2082ff842dc1 --- /dev/null +++ b/Basic_viewer/doc/Basic_viewer/Doxyfile.in @@ -0,0 +1,3 @@ +@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} + +PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - CGAL Basic Viewer" diff --git a/Basic_viewer/doc/CGAL_basic_viewers/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt similarity index 100% rename from Basic_viewer/doc/CGAL_basic_viewers/PackageDescription.txt rename to Basic_viewer/doc/Basic_viewer/PackageDescription.txt diff --git a/Basic_viewer/doc/CGAL_basic_viewers/dependencies b/Basic_viewer/doc/Basic_viewer/dependencies similarity index 100% rename from Basic_viewer/doc/CGAL_basic_viewers/dependencies rename to Basic_viewer/doc/Basic_viewer/dependencies diff --git a/Basic_viewer/doc/Basic_viewer/examples.txt b/Basic_viewer/doc/Basic_viewer/examples.txt new file mode 100644 index 000000000000..9a6d5e6a3be7 --- /dev/null +++ b/Basic_viewer/doc/Basic_viewer/examples.txt @@ -0,0 +1,4 @@ +/*! +\example Basic_viewer/draw_mesh_and_points.cpp +\example Basic_viewer/draw_surface_mesh_small_faces.cpp +*/ diff --git a/Basic_viewer/doc/CGAL_basic_viewers/Doxyfile.in b/Basic_viewer/doc/CGAL_basic_viewers/Doxyfile.in deleted file mode 100644 index 78014f4c59e4..000000000000 --- a/Basic_viewer/doc/CGAL_basic_viewers/Doxyfile.in +++ /dev/null @@ -1,3 +0,0 @@ -@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} - -PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - CGAL and Basic Viewers" diff --git a/Basic_viewer/doc/CGAL_basic_viewers/examples.txt b/Basic_viewer/doc/CGAL_basic_viewers/examples.txt deleted file mode 100644 index e69de29bb2d1..000000000000 From 8f29e4d3232ebf9808aeadd934f7624ba2e546cc Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 27 Apr 2023 15:48:42 +0200 Subject: [PATCH 133/399] Rename class graphic buffer --- BGL/include/CGAL/draw_face_graph.h | 8 +++---- .../Basic_viewer/draw_mesh_and_points.cpp | 2 +- .../draw_surface_mesh_small_faces.cpp | 2 +- .../include/Basic_viewer}/Buffer_for_vao.h | 0 .../include/Basic_viewer}/Drawing_functor.h | 0 .../include/Basic_viewer}/Graphic_buffer.h | 4 ++-- .../include/CGAL/Qt/Basic_viewer_qt.h | 16 ++++++------- .../demo/Linear_cell_complex/Viewer.h | 2 +- .../include/CGAL/draw_linear_cell_complex.h | 18 +++++++------- Nef_3/include/CGAL/draw_nef_3.h | 16 ++++++------- .../CGAL/draw_periodic_2_triangulation_2.h | 20 ++++++++-------- Point_set_3/include/CGAL/draw_point_set_3.h | 12 +++++----- Polygon/include/CGAL/draw_polygon_2.h | 12 +++++----- .../include/CGAL/draw_polygon_with_holes_2.h | 14 +++++------ Polyhedron/include/CGAL/draw_polyhedron.h | 10 ++++---- .../include/CGAL/draw_straight_skeleton_2.h | 20 ++++++++-------- Surface_mesh/include/CGAL/draw_surface_mesh.h | 10 ++++---- .../include/CGAL/draw_face_graph_with_paths.h | 24 +++++++++---------- .../polygon_triangulation_drawing_functor.h | 4 ++-- .../include/CGAL/draw_triangulation_2.h | 20 ++++++++-------- .../include/CGAL/draw_triangulation_3.h | 18 +++++++------- .../include/CGAL/draw_voronoi_diagram_2.h | 22 ++++++++--------- 22 files changed, 127 insertions(+), 127 deletions(-) rename {GraphicsView/include/CGAL => Basic_viewer/include/Basic_viewer}/Buffer_for_vao.h (100%) rename {GraphicsView/include/CGAL => Basic_viewer/include/Basic_viewer}/Drawing_functor.h (100%) rename {GraphicsView/include/CGAL => Basic_viewer/include/Basic_viewer}/Graphic_buffer.h (99%) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index a691e0c2fcf7..04238fd633c7 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -14,7 +14,7 @@ #ifndef CGAL_DRAW_FACE_GRAPH_H #define CGAL_DRAW_FACE_GRAPH_H -#include +#include #include #include #include @@ -26,7 +26,7 @@ namespace draw_function_for_FG { template void compute_elements(const FG &fg, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &m_drawing_functor) { using Point=typename boost::property_map_value::type; @@ -120,7 +120,7 @@ void compute_elements(const FG &fg, template void add_in_graphic_buffer_for_fg(const FG &fg, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) { draw_function_for_FG::compute_elements(fg, graphic_buffer, drawing_functor); @@ -128,7 +128,7 @@ void add_in_graphic_buffer_for_fg(const FG &fg, template void add_in_graphic_buffer_for_fg(const FG &fg, - CGAL::Graphic_buffer &graphic_buffer) + CGAL::Graphic_storage &graphic_buffer) { Drawing_functor::vertex_descriptor, diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 10a1afd9fe95..744f98299888 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -55,7 +55,7 @@ int main(void) for(Pwn& it: points) { point_set.insert(it.first); } - CGAL::Graphic_buffer graphic_buffer; + CGAL::Graphic_storage graphic_buffer; CGAL::add_in_graphic_buffer(point_set, graphic_buffer, Drawing_functor_green_points()); CGAL::add_in_graphic_buffer(output_mesh, graphic_buffer); CGAL::draw_buffer(graphic_buffer); diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index a8cd5ad72901..56b15be2022e 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -100,7 +100,7 @@ int main(int argc, char* argv[]) { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } Drawing_functor_small_faces df(sm); - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(sm, buffer, df); CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/Basic_viewer/include/Basic_viewer/Buffer_for_vao.h similarity index 100% rename from GraphicsView/include/CGAL/Buffer_for_vao.h rename to Basic_viewer/include/Basic_viewer/Buffer_for_vao.h diff --git a/GraphicsView/include/CGAL/Drawing_functor.h b/Basic_viewer/include/Basic_viewer/Drawing_functor.h similarity index 100% rename from GraphicsView/include/CGAL/Drawing_functor.h rename to Basic_viewer/include/Basic_viewer/Drawing_functor.h diff --git a/GraphicsView/include/CGAL/Graphic_buffer.h b/Basic_viewer/include/Basic_viewer/Graphic_buffer.h similarity index 99% rename from GraphicsView/include/CGAL/Graphic_buffer.h rename to Basic_viewer/include/Basic_viewer/Graphic_buffer.h index 425597cfcdb4..c6cab7251fe2 100644 --- a/GraphicsView/include/CGAL/Graphic_buffer.h +++ b/Basic_viewer/include/Basic_viewer/Graphic_buffer.h @@ -56,14 +56,14 @@ inline CGAL::IO::Color get_random_color(CGAL::Random& random) // This class is responsible for dealing with available CGAL data structures and // handling buffers. template -class Graphic_buffer +class Graphic_storage { public: typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; - Graphic_buffer() + Graphic_storage() : m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr, &m_bounding_box, nullptr, nullptr, nullptr), m_buffer_for_colored_points(&arrays[POS_COLORED_POINTS], nullptr, diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 50388985edb4..4fa0c1ea583e 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include #include @@ -69,11 +69,11 @@ class Basic_viewer_qt : public CGAL::QGLViewer typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; - using GB=Graphic_buffer; + using GB=Graphic_storage; // Constructor/Destructor Basic_viewer_qt(QWidget* parent, - Graphic_buffer& buf, + Graphic_storage& buf, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -365,7 +365,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer void face_end() { gBuffer.face_end(); } - Graphic_buffer& get_graphic_buffer() + Graphic_storage& get_graphic_buffer() { return gBuffer; } virtual void redraw() @@ -1593,7 +1593,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer std::function *)> on_key_pressed; protected: - Graphic_buffer& gBuffer; + Graphic_storage& gBuffer; bool m_draw_vertices; bool m_draw_edges; @@ -1667,7 +1667,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; template -void draw_buffer(Graphic_buffer& graphic_buffer, +void draw_buffer(Graphic_storage& graphic_buffer, const char *title="CGAL Basic Viewer") { #if defined(CGAL_TEST_SUITE) @@ -1692,7 +1692,7 @@ void draw_buffer(Graphic_buffer& graphic_buffer, } // template -// void draw_buffer(Graphic_buffer &graphic_buffer, +// void draw_buffer(Graphic_storage &graphic_buffer, // const std::function *)>& onPress, // const char *title="CGAL Basic Viewer") // { @@ -1722,7 +1722,7 @@ template class QApplication_and_basic_viewer { public: - QApplication_and_basic_viewer(CGAL::Graphic_buffer& buffer, + QApplication_and_basic_viewer(CGAL::Graphic_storage& buffer, const char* title="CGAL Basic Viewer"): m_application(nullptr), m_basic_viewer(nullptr), diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index c72feee6f32b..4165c0fea9e9 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -39,7 +39,7 @@ public Q_SLOTS: Dart_const_descriptor, Dart_const_descriptor, Dart_const_descriptor> m_drawing_functor; - CGAL::Graphic_buffer m_graphic_buffer; + CGAL::Graphic_storage m_graphic_buffer; Scene* scene; bool m_previous_scene_empty; }; 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 d047aed5f3d7..8dc57de4cc04 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_LCC_H #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ template void compute_face(const LCC& lcc, typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctorLCC& drawing_functor) { if (!drawing_functor.are_faces_enabled() || @@ -105,7 +105,7 @@ void compute_face(const LCC& lcc, template void compute_edge(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (!drawing_functor.are_edges_enabled() || @@ -129,7 +129,7 @@ void compute_edge(const LCC& lcc, template void compute_vertex(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctorLCC& drawing_functor) { if (!drawing_functor.are_vertices_enabled() || @@ -147,7 +147,7 @@ void compute_vertex(const LCC& lcc, template void compute_elements(const LCC& lcc, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { typename LCC::size_type markvolumes = lcc.get_new_mark(); @@ -240,7 +240,7 @@ template void add_in_graphic_buffer(const CGAL_LCC_TYPE& alcc, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { draw_function_for_lcc::compute_elements(static_cast(alcc), @@ -254,7 +254,7 @@ template class Map, class Refs, class Storage_, typename BufferType=float> void add_in_graphic_buffer(const CGAL_LCC_TYPE& alcc, - CGAL::Graphic_buffer& graphic_buffer) + CGAL::Graphic_storage& graphic_buffer) { CGAL::Drawing_functor_with_volume buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(alcc, buffer, drawing_functor); draw_buffer(buffer, title); } @@ -300,7 +300,7 @@ template void draw(const CGAL_LCC_TYPE& alcc, const char *title="LCC Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(alcc, buffer); draw_buffer(buffer, title); } diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 96c1093ec4de..fd0ff0897775 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -95,7 +95,7 @@ class Nef_Visitor { public: Nef_Visitor(const Nef_Polyhedron&_nef, - CGAL::Graphic_buffer& _graphic_buffer, + CGAL::Graphic_storage& _graphic_buffer, const DrawingFunctor&_drawing_functor) : n_faces(0), n_edges(0), nef(_nef), @@ -204,14 +204,14 @@ class Nef_Visitor { protected: std::unordered_map facets_done; std::unordered_map edges_done; - CGAL::Graphic_buffer& graphic_buffer; + CGAL::Graphic_storage& graphic_buffer; const DrawingFunctor& drawing_functor; const Nef_Polyhedron& nef; }; template void compute_elements(const Nef_Polyhedron &nef, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) { @@ -240,7 +240,7 @@ void compute_elements(const Nef_Polyhedron &nef, template void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) { draw_function_for_nef_polyhedron::compute_elements(anef, @@ -251,7 +251,7 @@ void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, template void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, - CGAL::Graphic_buffer &graphic_buffer) + CGAL::Graphic_storage &graphic_buffer) { // Default functor; user can add his own functor. Drawing_functor buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(anef, buffer, drawing_functor); draw_buffer(buffer, title); } @@ -296,7 +296,7 @@ template buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(anef, buffer); draw_buffer(buffer, title); } diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 5ca4e9c4bb3f..7ed6f5058759 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -69,7 +69,7 @@ namespace draw_function_for_P2T2 template void compute_vertex(const P2T2 &p2t2, typename P2T2::Periodic_point_iterator pi, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { // Construct the point in 9-sheeted covering space and add to viewer @@ -86,7 +86,7 @@ void compute_vertex(const P2T2 &p2t2, template void compute_edge(const P2T2 &p2t2, typename P2T2::Periodic_segment_iterator si, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if(!drawing_functor.draw_edge(p2t2, si)) @@ -104,7 +104,7 @@ void compute_edge(const P2T2 &p2t2, template void compute_face(const P2T2 &p2t2, typename P2T2::Periodic_triangle_iterator ti, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if(!drawing_functor.draw_face(p2t2, ti)) @@ -126,7 +126,7 @@ void compute_face(const P2T2 &p2t2, template void compute_domain(const P2T2& p2t2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -155,7 +155,7 @@ void compute_domain(const P2T2& p2t2, template void compute_elements(const P2T2& p2t2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { // Get the display type, iterate through periodic elements according @@ -198,7 +198,7 @@ void compute_elements(const P2T2& p2t2, template void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { draw_function_for_P2T2::compute_elements(p2t2, graphic_buffer, drawing_functor); @@ -206,7 +206,7 @@ void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, template void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphic_buffer& graphic_buffer) + CGAL::Graphic_storage& graphic_buffer) { CGAL::Drawing_functor_periodic_2_triangulation_2 buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2t2, buffer, drawing_functor); draw_buffer(buffer); } @@ -234,7 +234,7 @@ template void draw(const CGAL_P2T2_TYPE& ap2t2, const char* title="2D Periodic Triangulation Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; CGAL::Drawing_functor_periodic_2_triangulation_2 #include -#include +#include #include #include @@ -44,7 +44,7 @@ namespace draw_function_for_PointSet { template void compute_elements(const PointSet& pointset, - Graphic_buffer& graphic_buffer, + Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (!drawing_functor.are_vertices_enabled()) @@ -70,7 +70,7 @@ void compute_elements(const PointSet& pointset, template void add_in_graphic_buffer(const Point_set_3& apointset, - Graphic_buffer& graphic_buffer, + Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { draw_function_for_PointSet::compute_elements(apointset, @@ -80,7 +80,7 @@ void add_in_graphic_buffer(const Point_set_3& apointset, template void add_in_graphic_buffer(const Point_set_3& apointset, - Graphic_buffer& graphic_buffer) + Graphic_storage& graphic_buffer) { CGAL::Drawing_functor, typename Point_set_3::const_iterator, @@ -96,7 +96,7 @@ void draw(const Point_set_3& apointset, const DrawingFunctor& drawing_functor, const char *title="Point_set_3 Basic Viewer") { - Graphic_buffer buffer; + Graphic_storage buffer; add_in_graphic_buffer(apointset, buffer, drawing_functor); draw_buffer(buffer, title); } @@ -105,7 +105,7 @@ template void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { - Graphic_buffer buffer; + Graphic_storage buffer; add_in_graphic_buffer(apointset, buffer); draw_buffer(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index e97a29bcd597..6ae50e0fe773 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -19,7 +19,7 @@ #define CGAL_DRAW_POLYGON_2_H #include -#include +#include #include #include @@ -48,7 +48,7 @@ namespace draw_function_for_p2 { template void compute_elements(const P2& p2, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor& drawing_functor) { if (p2.is_empty()) @@ -103,13 +103,13 @@ void compute_elements(const P2& p2, template void add_in_graphic_buffer(const CGAL_P2_TYPE& ap2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawingfunctor) { draw_function_for_p2::compute_elements(ap2, graphic_buffer, drawingfunctor); } template void add_in_graphic_buffer(const CGAL_P2_TYPE& ap2, - CGAL::Graphic_buffer &graphic_buffer) + CGAL::Graphic_storage &graphic_buffer) { CGAL::Drawing_functor void draw(const CGAL_P2_TYPE &ap2, const char *title="Polygon_2 Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2, buffer); draw_buffer(buffer, title); } @@ -136,7 +136,7 @@ void draw(const CGAL_P2_TYPE &ap2, const DrawingFunctor& drawingfunctor, const char *title="Polygon_2 Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2, buffer, drawingfunctor); draw_buffer(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index b90e2ba2d481..c94f39d7cb9d 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -19,7 +19,7 @@ #define CGAL_DRAW_POLYGON_WITH_HOLES_2_H #include -#include +#include #include #include @@ -49,7 +49,7 @@ namespace draw_function_for_ph2_with_holes { template void compute_one_loop_elements(const P2& ap2, const typename P2::General_polygon_2& aloop, - Graphic_buffer &graphic_buffer, + Graphic_storage &graphic_buffer, bool hole, const DrawingFunctor& drawing_functor) { @@ -92,7 +92,7 @@ void compute_one_loop_elements(const P2& ap2, } template -void compute_elements(const P2& p2, Graphic_buffer &graphic_buffer, +void compute_elements(const P2& p2, Graphic_storage &graphic_buffer, const DrawingFunctor& drawing_functor) { if (p2.outer_boundary().is_empty()) return; @@ -128,7 +128,7 @@ void compute_elements(const P2& p2, Graphic_buffer &graphic_buffer, template void add_in_graphic_buffer(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor &drawing_functor) { draw_function_for_ph2_with_holes::compute_elements(p2, graphic_buffer, @@ -137,7 +137,7 @@ void add_in_graphic_buffer(const CGAL_P2_WITH_HOLES_TYPE& p2, template void add_in_graphic_buffer(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphic_buffer& graphic_buffer) + CGAL::Graphic_storage& graphic_buffer) { Drawing_functor void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const DrawingFunctor &drawing_functor, const char* title="Polygon with Holes Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2, buffer, drawing_functor); draw_buffer(buffer, title); } @@ -163,7 +163,7 @@ template void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const char* title="Polygon with Holes Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2, buffer); draw_buffer(buffer, title); } diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 81bbdb4370f2..05ed00e25a5a 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_POLYHEDRON_H #include -#include +#include #include #include #include @@ -35,7 +35,7 @@ template void add_in_graphic_buffer(const CGAL_POLY_TYPE& apoly, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) { add_in_graphic_buffer_for_fg(apoly, graphic_buffer, drawing_functor); } @@ -46,7 +46,7 @@ template void add_in_graphic_buffer(const CGAL_POLY_TYPE& apoly, - CGAL::Graphic_buffer &graphic_buffer) + CGAL::Graphic_storage &graphic_buffer) { add_in_graphic_buffer_for_fg(apoly, graphic_buffer); } // Specialization of draw function: require Qt and the CGAL basic viewer. @@ -61,7 +61,7 @@ template buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer_for_fg(apoly, buffer); draw_buffer(buffer, title); } @@ -77,7 +77,7 @@ void draw(const CGAL_POLY_TYPE& apoly, const DrawingFunctor &drawing_functor, const char* title="Polyhedron Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer_for_fg(apoly, buffer, drawing_functor); draw_buffer(buffer, title); } diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 3557378d6206..80689e79dc58 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -26,7 +26,7 @@ namespace draw_function_for_ss2 { template void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_edge(ss2, eh)) @@ -48,7 +48,7 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, template void print_halfedge_labels(const SS2& ss2, typename SS2::Halfedge_const_handle h, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { // TODO? a functor different from draw_edge to allow to show only some labels ?? @@ -67,7 +67,7 @@ void print_halfedge_labels(const SS2& ss2, template void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_vertex(ss2, vh)) @@ -84,7 +84,7 @@ void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, template void print_vertex_label(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { // TODO? a functor different from draw_vertex to allow to show only some labels ?? @@ -98,7 +98,7 @@ void print_vertex_label(const SS2& ss2, template void compute_elements(const SS2& ss2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (!drawing_functor.are_edges_enabled()) @@ -131,7 +131,7 @@ void compute_elements(const SS2& ss2, template void add_in_graphic_buffer(const CGAL_SS_TYPE &ass2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { draw_function_for_ss2::compute_elements(ass2, graphic_buffer, @@ -140,7 +140,7 @@ void add_in_graphic_buffer(const CGAL_SS_TYPE &ass2, template void add_in_graphic_buffer(const CGAL_SS_TYPE& ass2, - CGAL::Graphic_buffer& graphic_buffer) + CGAL::Graphic_storage& graphic_buffer) { Drawing_functor void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, const char *title="Straight Skeleton Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(ass2, buffer, drawingfunctor); draw_buffer(buffer, title); } @@ -195,7 +195,7 @@ template void draw(const CGAL_SS_TYPE &ass2, const char *title="Straight Skeleton Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(ass2, buffer); draw_buffer(buffer, title); } diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index cad60c4e87d4..f630b8133374 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -30,7 +30,7 @@ void draw(const SM& asm); #else // DOXYGEN_RUNNING #include -#include +#include #include #include #include @@ -41,13 +41,13 @@ namespace CGAL template void add_in_graphic_buffer(const Surface_mesh& amesh, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) { add_in_graphic_buffer_for_fg(amesh, graphic_buffer, drawing_functor); } template void add_in_graphic_buffer(const Surface_mesh& amesh, - CGAL::Graphic_buffer &graphic_buffer) + CGAL::Graphic_storage &graphic_buffer) { add_in_graphic_buffer_for_fg(amesh, graphic_buffer); } #ifdef CGAL_USE_BASIC_VIEWER @@ -57,7 +57,7 @@ template void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer_for_fg(amesh, buffer); draw_buffer(buffer, title); } @@ -67,7 +67,7 @@ void draw(const Surface_mesh& amesh, const DrawingFunctor &drawing_functor, const char* title="Surface_mesh Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer_for_fg(amesh, buffer, drawing_functor); draw_buffer(buffer, title); } diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index e117e5b54a52..35d7495c8262 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -145,7 +145,7 @@ template void compute_face(const Mesh& mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, DrawingFunctor& drawing_functor) { if(!drawing_functor.draw_face(lcc, dh)) @@ -193,7 +193,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, typename Get_map::type::size_type m_amark, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, DrawingFunctor& drawing_functor, bool draw_marked_darts=true) { @@ -224,7 +224,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, const CGAL::IO::Color& color, - CGAL::Graphic_buffer& graphic_buffer) + CGAL::Graphic_storage& graphic_buffer) { typedef typename Get_map::type LCC; typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; @@ -241,7 +241,7 @@ void compute_edge(const Mesh &mesh, template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, DrawingFunctor& drawing_functor) { typedef typename CGAL::Get_traits::Kernel Kernel; @@ -253,7 +253,7 @@ void compute_vertex(const Mesh &mesh, template void compute_path(const Mesh &mesh, const typename Get_map::storage_type& lcc, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const std::vector>* m_paths, std::size_t i, typename Get_map::type::size_type amark) @@ -282,7 +282,7 @@ void compute_path(const Mesh &mesh, template void compute_elements(const Mesh &mesh, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &m_drawing_functor, const std::vector>* m_paths, typename Get_map::type::size_type amark) @@ -371,7 +371,7 @@ void compute_elements(const Mesh &mesh, template void add_in_graphic_buffer(const Mesh& mesh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const std::vector>* paths, const DrawingFunctor& drawing_functor, typename Get_map::type::size_type amark= @@ -385,7 +385,7 @@ void add_in_graphic_buffer(const Mesh& mesh, template void add_in_graphic_buffer(const Mesh& mesh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const std::vector>* paths, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) @@ -409,7 +409,7 @@ void draw(const Mesh& mesh, (std::numeric_limits::type::size_type>::max)(), const char* title="Mesh Viewer With Path") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(mesh, buffer, &paths, amark); draw_buffer(buffer, title); } @@ -422,7 +422,7 @@ void draw(const Mesh& mesh, (std::numeric_limits::type::size_type>::max)(), const char* title="Mesh Viewer With Path") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(mesh, buffer, drawing_functor, &paths, amark); draw_buffer(buffer, title); } @@ -435,7 +435,7 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { std::vector> paths=l; - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(mesh, buffer, &paths, amark); draw_buffer(buffer, title); } diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h index 983ae936a8dc..9c63c3bf8afd 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h @@ -61,7 +61,7 @@ struct Polygon_triangulation_drawing_functor : template void add_in_graphic_buffer(const CGAL_CT2_TYPE& ct2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { draw_function_for_t2::compute_elements(ct2, graphic_buffer, drawing_functor); @@ -74,7 +74,7 @@ template void draw(const CGAL_CT2_TYPE &ct2, const DrawingFunctor &drawingfunctor, const char *title="Constrained Triangulation_2 Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(ct2, buffer, drawingfunctor); draw_buffer(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 2ae142e3d3f6..e57a6e0a37fa 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -27,7 +27,7 @@ namespace draw_function_for_t2 { template void compute_face(const T2& t2, typename T2::Finite_faces_iterator fh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_face(t2, fh)) @@ -47,7 +47,7 @@ void compute_face(const T2& t2, template void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_edge(t2, eh)) @@ -70,7 +70,7 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, template void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_vertex(t2, vh)) @@ -88,7 +88,7 @@ void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, template void compute_elements(const T2& t2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (drawing_functor.are_faces_enabled()) @@ -119,7 +119,7 @@ void compute_elements(const T2& t2, template void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { draw_function_for_t2::compute_elements(at2, graphic_buffer, drawing_functor); @@ -127,9 +127,9 @@ void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, template void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, - CGAL::Graphic_buffer& graphic_buffer) + CGAL::Graphic_storage& graphic_buffer) { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; Drawing_functor void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, const char *title="Triangulation_2 Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(at2, buffer, drawingfunctor); draw_buffer(buffer, title); } @@ -166,7 +166,7 @@ template void draw(const CGAL_T2_TYPE& at2, const char *title="Triangulation_2 Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(at2, buffer); draw_buffer(buffer, title); } diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 51a082dd43c7..788763d4e328 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -28,7 +28,7 @@ namespace draw_function_for_t3 template void compute_face(typename T3::Finite_facets_iterator fh, const DrawingFunctor& drawing_functor, - CGAL::Graphic_buffer& graphic_buffer, const T3 *t3) + CGAL::Graphic_storage& graphic_buffer, const T3 *t3) { if(!drawing_functor.draw_face(*t3, fh)) { return; } @@ -50,7 +50,7 @@ void compute_face(typename T3::Finite_facets_iterator fh, template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor, const T3* t3) { if(!drawing_functor.draw_edge(*t3, eh)) @@ -70,7 +70,7 @@ void compute_edge(typename T3::Finite_edges_iterator eh, template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor, const T3* t3) { if(!drawing_functor.draw_vertex(*t3, vh)) @@ -86,7 +86,7 @@ void compute_vertex(typename T3::Vertex_handle vh, template void compute_elements(const T3* t3, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if (drawing_functor.are_faces_enabled()) @@ -118,7 +118,7 @@ void compute_elements(const T3* t3, template void add_in_graphic_buffer(const CGAL_T3_TYPE& at3, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { draw_function_for_t3::compute_elements(&at3, graphic_buffer, drawing_functor); @@ -127,7 +127,7 @@ void add_in_graphic_buffer(const CGAL_T3_TYPE& at3, template void add_in_graphic_buffer(const CGAL_T3_TYPE& at3, - CGAL::Graphic_buffer& graphic_buffer) + CGAL::Graphic_storage& graphic_buffer) { CGAL::Drawing_functor void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, const char *title="T3 Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(at3, buffer, drawingfunctor); draw_buffer(buffer, title); } @@ -169,7 +169,7 @@ void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, template void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(at3, buffer); draw_buffer(buffer, title); } diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index b1e4ad3de924..74a5687ed11e 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -72,7 +72,7 @@ typedef Local_kernel::Vector_3 Local_vector; template void compute_vertex(const V2& v2, typename V2::Vertex_iterator vh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if(!drawing_functor.draw_vertex(v2, vh)) @@ -87,14 +87,14 @@ void compute_vertex(const V2& v2, template void compute_dual_vertex(const V2& /*v2*/, typename V2::Delaunay_graph::Finite_vertices_iterator vi, - CGAL::Graphic_buffer &graphic_buffer, + CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor& drawing_functor) { graphic_buffer.add_point(vi->point(), drawing_functor.dual_vertex_color); } template void add_segments_and_update_bounding_box(const V2& v2, typename V2::Halfedge_iterator he, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -224,7 +224,7 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, template void compute_rays_and_bisectors(const V2&, typename V2::Halfedge_iterator he, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -254,7 +254,7 @@ void compute_rays_and_bisectors(const V2&, template void compute_face(const V2& v2, typename V2::Face_iterator fh, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& m_drawing_functor) { if(fh->is_unbounded() || !m_drawing_functor.draw_face(v2, fh)) @@ -288,7 +288,7 @@ void compute_face(const V2& v2, template void compute_elements(const V2& v2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { if(drawing_functor.are_vertices_enabled()) @@ -338,7 +338,7 @@ void compute_elements(const V2& v2, template void add_in_graphic_buffer(const CGAL_VORONOI_TYPE &v2, - CGAL::Graphic_buffer& graphic_buffer, + CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& m_drawing_functor) { draw_function_for_v2::compute_elements(v2, graphic_buffer, m_drawing_functor); @@ -346,7 +346,7 @@ void add_in_graphic_buffer(const CGAL_VORONOI_TYPE &v2, template void add_in_graphic_buffer(const CGAL_VORONOI_TYPE& v2, - CGAL::Graphic_buffer& graphic_buffer) + CGAL::Graphic_storage& graphic_buffer) { // Default functor; user can add his own functor. CGAL::Drawing_functor_voronoi buffer; + CGAL::Graphic_storage buffer; add_in_graphic_buffer(av2, buffer, drawing_functor); draw_buffer(buffer, title); } @@ -376,7 +376,7 @@ template void draw(const CGAL_VORONOI_TYPE& av2, const char *title="2D Voronoi Diagram Basic Viewer") { - CGAL::Graphic_buffer buffer; + CGAL::Graphic_storage buffer; CGAL::Drawing_functor_voronoi Date: Thu, 27 Apr 2023 17:31:33 +0200 Subject: [PATCH 134/399] move basic viewer files --- Basic_viewer/include/{Basic_viewer => CGAL}/Buffer_for_vao.h | 0 Basic_viewer/include/{Basic_viewer => CGAL}/Drawing_functor.h | 0 .../{Basic_viewer/Graphic_buffer.h => CGAL/Graphic_storage.h} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Basic_viewer/include/{Basic_viewer => CGAL}/Buffer_for_vao.h (100%) rename Basic_viewer/include/{Basic_viewer => CGAL}/Drawing_functor.h (100%) rename Basic_viewer/include/{Basic_viewer/Graphic_buffer.h => CGAL/Graphic_storage.h} (100%) diff --git a/Basic_viewer/include/Basic_viewer/Buffer_for_vao.h b/Basic_viewer/include/CGAL/Buffer_for_vao.h similarity index 100% rename from Basic_viewer/include/Basic_viewer/Buffer_for_vao.h rename to Basic_viewer/include/CGAL/Buffer_for_vao.h diff --git a/Basic_viewer/include/Basic_viewer/Drawing_functor.h b/Basic_viewer/include/CGAL/Drawing_functor.h similarity index 100% rename from Basic_viewer/include/Basic_viewer/Drawing_functor.h rename to Basic_viewer/include/CGAL/Drawing_functor.h diff --git a/Basic_viewer/include/Basic_viewer/Graphic_buffer.h b/Basic_viewer/include/CGAL/Graphic_storage.h similarity index 100% rename from Basic_viewer/include/Basic_viewer/Graphic_buffer.h rename to Basic_viewer/include/CGAL/Graphic_storage.h From 5ef4638a70233bcaed8c861ac1409b7c6dff6fe8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 27 Apr 2023 18:10:42 +0200 Subject: [PATCH 135/399] =?UTF-8?q?start=20doc=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doc/Basic_viewer/CGAL/Drawing_functor.h | 114 ++++++++++++++++++ .../doc/Basic_viewer/CGAL/Graphic_storage.h | 67 ++++++++++ 2 files changed, 181 insertions(+) create mode 100644 Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h create mode 100644 Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h new file mode 100644 index 000000000000..dacba4b84a40 --- /dev/null +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -0,0 +1,114 @@ + +namespace CGAL { + +/*! +\ingroup PkgBasicViewerClasses + +The class `Drawing_functor` is used to tune the way that a given data-structure of CGAL is drawn. +The different std::function can be modified to change the behavior of the drawing. + +\tparam DS a data structure of CGAL. +\tparam Vertex_descriptor a descriptor of vertices of DS. +\tparam Edge_descriptor a descriptor of edges of DS. +\tparam Face_descriptor a descriptor of faces of DS. + +*/ +template +struct Drawing_functor +{ + /// std::function that returns true if the given vertex must be drawn, false otherwise. + std::function draw_vertex; + + /// std::function that returns true if the given edge must be drawn, false otherwise. + std::function draw_edge; + + /// std::function that returns true if the given face must be drawn, false otherwise. + std::function draw_face; + + /// std::function that returns true if the given vertex is colored, false otherwise. + std::function colored_vertex; + + /// std::function that returns true if the given edge is colored, false otherwise. + std::function colored_edge; + + /// std::function that returns true if the given face is colored, false otherwise. + std::function colored_face; + + /// std::function that returns true if the given face is drawn in wireframe, false otherwise. + std::function face_wireframe; + + /// std::function that returns the color of the given vertex. + std::function vertex_color; + + /// std::function that returns the color of the given edge. + std::function edge_color; + + /// std::function that returns the color of the given face. + std::function face_color; + + /// Disable the drawing of vertices. + void disable_vertices(); + + /// Enable the drawing of vertices. + void enable_vertices(); + + /// Disable the drawing of edges. + void disable_edges(); + + /// Enable the drawing of edges. + void enable_edges(); + + /// Disable the drawing of faces. + void disable_faces(); + + /// Enable the drawing of faces. + void enable_faces(); +}; + +/*! +\ingroup PkgBasicViewerClasses + +The class `Drawing_functor_with_volume` is used to tune the way that a given data-structure of CGAL is drawn, for a data-structure that contains volumes. +The different std::function can be modified to change the behavior of the drawing. + +\tparam DS a data structure of CGAL. +\tparam Vertex_descriptor a descriptor of vertices of DS. +\tparam Edge_descriptor a descriptor of edges of DS. +\tparam Face_descriptor a descriptor of faces of DS. +\tparam Volume_descriptor a descriptor of volumes of DS. + +*/ + +// Drawing functor for a 3D data structure +// (with vertices, edges, faces and volumes) +template +struct Drawing_functor_with_volume : + public Drawing_functor +{ + /// std::function that returns true if the given volume must be drawn, false otherwise. + std::function draw_volume; + + /// std::function that returns the color of the given volume. + std::function colored_volume; + + /// std::function that returns true if the given volume is drawn in wireframe, false otherwise. + std::function volume_wireframe; + + /// std::function that returns the color of the given volume. + std::function volume_color; + + /// Disable the drawing of volumes. + void disable_volumes(); + + /// Enable the drawing of volumes. + void enable_volumes(); +}; + +} // End namespace CGAL diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h new file mode 100644 index 000000000000..de77b753e061 --- /dev/null +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h @@ -0,0 +1,67 @@ + +namespace CGAL { + +/*! + \ingroup PkgBasicViewerClasses + +The class `Graphic_storage` store points, segments and triangles. Elements can be added, possibly with associated colors. Non triangular faces can be directly added, and triangulated internally. + +\tparam BufferType the type used for point coordinates: float by default. + +*/ +template +class Graphic_storage +{ + template void add_point(const KPoint &p); + + template + void add_point(const KPoint &p, const CGAL::IO::Color &acolor); + + template + void add_segment(const KPoint &p1, const KPoint &p2); + + template + void add_segment(const KPoint &p1, const KPoint &p2, + const CGAL::IO::Color &acolor); + + template + void add_ray(const KPoint &p, const KVector &v); + + template + void add_ray(const KPoint &p, const KVector &v, + const CGAL::IO::Color &acolor); + + template + void add_line(const KPoint &p, const KVector &v); + + template + void add_line(const KPoint &p, const KVector &v, + const CGAL::IO::Color &acolor); + + template bool add_point_in_face(const KPoint &kp); + + template + bool add_point_in_face(const KPoint &kp, const KVector &p_normal); + + bool is_a_face_started() const; + + void face_begin(); + + void face_begin(const CGAL::IO::Color &acolor); + + void face_end(); + + bool is_empty() const; + + void clear(); + + template + void add_text(const KPoint &kp, const char *txt); + + template + void add_text(const KPoint &kp, const std::string &txt); + + void m_texts_clear(); +}; + +} // namespace CGAL From 48cfa7ad61f1336550b6fd65e2f3cd05d104849c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 27 Apr 2023 18:30:41 +0200 Subject: [PATCH 136/399] add default value in the doc --- .../doc/Basic_viewer/CGAL/Drawing_functor.h | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index dacba4b84a40..31c31e69561b 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -20,33 +20,43 @@ template draw_vertex; /// std::function that returns true if the given edge must be drawn, false otherwise. + /// Returns true by default. std::function draw_edge; /// std::function that returns true if the given face must be drawn, false otherwise. + /// Returns true by default. std::function draw_face; /// std::function that returns true if the given vertex is colored, false otherwise. + /// Returns false by default. std::function colored_vertex; /// std::function that returns true if the given edge is colored, false otherwise. + /// Returns false by default. std::function colored_edge; /// std::function that returns true if the given face is colored, false otherwise. + /// Returns false by default. std::function colored_face; /// std::function that returns true if the given face is drawn in wireframe, false otherwise. + /// Returns false by default. std::function face_wireframe; /// std::function that returns the color of the given vertex. + /// nullptr by default. std::function vertex_color; /// std::function that returns the color of the given edge. + /// nullptr by default. std::function edge_color; /// std::function that returns the color of the given face. + /// nullptr by default. std::function face_color; /// Disable the drawing of vertices. @@ -93,16 +103,20 @@ struct Drawing_functor_with_volume : public Drawing_functor { /// std::function that returns true if the given volume must be drawn, false otherwise. - std::function draw_volume; + /// Returns true by default. + std::function draw_volume; /// std::function that returns the color of the given volume. - std::function colored_volume; + /// Returns false by default. + std::function colored_volume; /// std::function that returns true if the given volume is drawn in wireframe, false otherwise. - std::function volume_wireframe; + /// Returns false by default. + std::function volume_wireframe; /// std::function that returns the color of the given volume. - std::function volume_color; + /// nullptr by default. + std::function volume_color; /// Disable the drawing of volumes. void disable_volumes(); From 4df2edd9c1248a72e92be81dd3a82e9a9557d5d5 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 12:26:31 +0200 Subject: [PATCH 137/399] Replace draw_buffer by draw_graphic_storage --- .../doc/Basic_viewer/CGAL/Graphic_storage.h | 34 +++++++++++++++---- .../Basic_viewer/draw_mesh_and_points.cpp | 2 +- .../include/CGAL/Qt/Basic_viewer_qt.h | 4 +-- .../include/CGAL/draw_linear_cell_complex.h | 4 +-- Nef_3/include/CGAL/draw_nef_3.h | 4 +-- .../CGAL/draw_periodic_2_triangulation_2.h | 2 +- Point_set_3/include/CGAL/draw_point_set_3.h | 4 +-- Polygon/include/CGAL/draw_polygon_2.h | 4 +-- .../include/CGAL/draw_polygon_with_holes_2.h | 4 +-- Polyhedron/include/CGAL/draw_polyhedron.h | 4 +-- .../include/CGAL/draw_straight_skeleton_2.h | 4 +-- Surface_mesh/include/CGAL/draw_surface_mesh.h | 4 +-- .../include/CGAL/draw_face_graph_with_paths.h | 6 ++-- .../polygon_triangulation_drawing_functor.h | 2 +- .../include/CGAL/draw_triangulation_2.h | 4 +-- .../include/CGAL/draw_triangulation_3.h | 4 +-- .../include/CGAL/draw_voronoi_diagram_2.h | 2 +- 17 files changed, 56 insertions(+), 36 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h index de77b753e061..2f0b5901cc67 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h @@ -4,7 +4,7 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Graphic_storage` store points, segments and triangles. Elements can be added, possibly with associated colors. Non triangular faces can be directly added, and triangulated internally. +The class `Graphic_storage` store points, segments and triangles. Elements can be added, possibly with associated colors. Non triangular faces can be directly added, and are triangulated internally. \tparam BufferType the type used for point coordinates: float by default. @@ -12,55 +12,75 @@ The class `Graphic_storage` store points, segments and triangles. Elements can b template class Graphic_storage { - template void add_point(const KPoint &p); + /// Add the given point in this storage. + template + void add_point(const KPoint &p); + /// Add the given colored point in this storage. template void add_point(const KPoint &p, const CGAL::IO::Color &acolor); + /// Add the given segment in this storage. template void add_segment(const KPoint &p1, const KPoint &p2); + /// Add the given colored segment in this storage. template void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); + /// Add the given ray in the storage: an half line starting from p and having v as direction. template void add_ray(const KPoint &p, const KVector &v); + /// Add the given colored ray in the storage: an half line starting from p and having v as direction. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); + /// Add the given line in the storage, defined by p and v as direction. template void add_line(const KPoint &p, const KVector &v); + /// Add the given colored line in the storage, defined by p and v as direction. template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - template bool add_point_in_face(const KPoint &kp); + /// start a new face. + void face_begin(); - template - bool add_point_in_face(const KPoint &kp, const KVector &p_normal); + /// start a new colored face. + void face_begin(const CGAL::IO::Color &acolor); + /// @return true iff a face is started. bool is_a_face_started() const; - void face_begin(); + /// add the given point in the current face. + template bool add_point_in_face(const KPoint &kp); - void face_begin(const CGAL::IO::Color &acolor); + /// add the given point in the current face, having the vertex normal. + template + bool add_point_in_face(const KPoint &kp, const KVector &p_normal); + /// end the current face. void face_end(); + /// @return true iff the storage has no element. bool is_empty() const; + /// clear the storage, i.e. remove all points, segments, triangles and text. void clear(); + /// add the given text at the given position in the storage. template void add_text(const KPoint &kp, const char *txt); + /// add the given text at the given position in the storage. template void add_text(const KPoint &kp, const std::string &txt); + /// clear all the texts. void m_texts_clear(); }; diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 744f98299888..7a2058b2d3a5 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -58,7 +58,7 @@ int main(void) CGAL::Graphic_storage graphic_buffer; CGAL::add_in_graphic_buffer(point_set, graphic_buffer, Drawing_functor_green_points()); CGAL::add_in_graphic_buffer(output_mesh, graphic_buffer); - CGAL::draw_buffer(graphic_buffer); + CGAL::draw_graphic_storage(graphic_buffer); } else { return EXIT_FAILURE; } diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 4fa0c1ea583e..254e9fb724df 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -1667,7 +1667,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; template -void draw_buffer(Graphic_storage& graphic_buffer, +void draw_graphic_storage(Graphic_storage& graphic_buffer, const char *title="CGAL Basic Viewer") { #if defined(CGAL_TEST_SUITE) @@ -1692,7 +1692,7 @@ void draw_buffer(Graphic_storage& graphic_buffer, } // template -// void draw_buffer(Graphic_storage &graphic_buffer, +// void draw_graphic_storage(Graphic_storage &graphic_buffer, // const std::function *)>& onPress, // const char *title="CGAL Basic Viewer") // { 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 8dc57de4cc04..25c697907077 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -290,7 +290,7 @@ void draw(const CGAL_LCC_TYPE& alcc, const DrawingFunctor& drawing_functor, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(alcc, buffer, drawing_functor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } // Specialization of draw function for a LCC, without a drawing functor. @@ -302,7 +302,7 @@ void draw(const CGAL_LCC_TYPE& alcc, const char *title="LCC Basic Viewer") { CGAL::Graphic_storage buffer; add_in_graphic_buffer(alcc, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index fd0ff0897775..f4242edd06ad 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -288,7 +288,7 @@ void draw(const CGAL_NEF3_TYPE &anef, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(anef, buffer, drawing_functor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template buffer; add_in_graphic_buffer(anef, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 7ed6f5058759..1b0c38a68f69 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -227,7 +227,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2t2, buffer, drawing_functor); - draw_buffer(buffer); + draw_graphic_storage(buffer); } template 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 447db4f7d785..4b8bd016bff4 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -98,7 +98,7 @@ void draw(const Point_set_3& apointset, { Graphic_storage buffer; add_in_graphic_buffer(apointset, buffer, drawing_functor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -107,7 +107,7 @@ void draw(const Point_set_3& apointset, { Graphic_storage buffer; add_in_graphic_buffer(apointset, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 6ae50e0fe773..2562d0efe35d 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -128,7 +128,7 @@ void draw(const CGAL_P2_TYPE &ap2, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -138,7 +138,7 @@ void draw(const CGAL_P2_TYPE &ap2, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2, buffer, drawingfunctor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index c94f39d7cb9d..33006449e794 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -156,7 +156,7 @@ void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const DrawingFunctor &drawing_func { CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2, buffer, drawing_functor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -165,7 +165,7 @@ void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(ap2, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 05ed00e25a5a..19c96d92188a 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -63,7 +63,7 @@ void draw(const CGAL_POLY_TYPE& apoly, { CGAL::Graphic_storage buffer; add_in_graphic_buffer_for_fg(apoly, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template buffer; add_in_graphic_buffer_for_fg(apoly, buffer, drawing_functor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 80689e79dc58..8736fd07080a 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -188,7 +188,7 @@ void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(ass2, buffer, drawingfunctor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -197,7 +197,7 @@ void draw(const CGAL_SS_TYPE &ass2, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(ass2, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index f630b8133374..f68fa485697a 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -59,7 +59,7 @@ void draw(const Surface_mesh& amesh, { CGAL::Graphic_storage buffer; add_in_graphic_buffer_for_fg(amesh, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -69,7 +69,7 @@ void draw(const Surface_mesh& amesh, { CGAL::Graphic_storage buffer; add_in_graphic_buffer_for_fg(amesh, buffer, drawing_functor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 35d7495c8262..486ad6490108 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -411,7 +411,7 @@ void draw(const Mesh& mesh, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(mesh, buffer, &paths, amark); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -424,7 +424,7 @@ void draw(const Mesh& mesh, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(mesh, buffer, drawing_functor, &paths, amark); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -437,7 +437,7 @@ void draw(const Mesh& mesh, std::vector> paths=l; CGAL::Graphic_storage buffer; add_in_graphic_buffer(mesh, buffer, &paths, amark); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } } // End namespace CGAL diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h index 9c63c3bf8afd..6880a4921b3e 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h @@ -76,7 +76,7 @@ void draw(const CGAL_CT2_TYPE &ct2, const DrawingFunctor &drawingfunctor, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(ct2, buffer, drawingfunctor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #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 e57a6e0a37fa..0e777ffdd435 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -159,7 +159,7 @@ void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(at2, buffer, drawingfunctor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -168,7 +168,7 @@ void draw(const CGAL_T2_TYPE& at2, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(at2, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 788763d4e328..0a171fc30df1 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -163,7 +163,7 @@ void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(at3, buffer, drawingfunctor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template @@ -171,7 +171,7 @@ void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer") { CGAL::Graphic_storage buffer; add_in_graphic_buffer(at3, buffer); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 74a5687ed11e..20bcffc914a4 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -369,7 +369,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, { CGAL::Graphic_storage buffer; add_in_graphic_buffer(av2, buffer, drawing_functor); - draw_buffer(buffer, title); + draw_graphic_storage(buffer, title); } template From b04d7a6b714d8cc0079f2fb631537ee94dde869a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 14:59:16 +0200 Subject: [PATCH 138/399] Rename --- Basic_viewer/include/CGAL/Buffer_for_vao.h | 6 +++--- Basic_viewer/include/CGAL/Graphic_storage.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Basic_viewer/include/CGAL/Buffer_for_vao.h b/Basic_viewer/include/CGAL/Buffer_for_vao.h index 6589800a9a23..04d5bd927827 100644 --- a/Basic_viewer/include/CGAL/Buffer_for_vao.h +++ b/Basic_viewer/include/CGAL/Buffer_for_vao.h @@ -10,8 +10,8 @@ // // Author(s) : Guillaume Damiand -#ifndef CGAL_VBO_BUFFER_FILLER_H -#define CGAL_VBO_BUFFER_FILLER_H +#ifndef CGAL_BUFFER_FOR_VAO_H +#define CGAL_BUFFER_FOR_VAO_H #include @@ -923,4 +923,4 @@ class Buffer_for_vao } // End namespace CGAL -#endif // CGAL_VBO_BUFFER_FILLER_H +#endif // CGAL_BUFFER_FOR_VAO_H diff --git a/Basic_viewer/include/CGAL/Graphic_storage.h b/Basic_viewer/include/CGAL/Graphic_storage.h index c6cab7251fe2..056078251ac0 100644 --- a/Basic_viewer/include/CGAL/Graphic_storage.h +++ b/Basic_viewer/include/CGAL/Graphic_storage.h @@ -10,8 +10,8 @@ // Author(s): Guillaume Damiand // Mostafa Ashraf -#ifndef CGAL_GRAPHIC_BUFFER_H -#define CGAL_GRAPHIC_BUFFER_H +#ifndef CGAL_GRAPHIC_STORAGE_H +#define CGAL_GRAPHIC_STORAGE_H #include #include @@ -417,4 +417,4 @@ class Graphic_storage } // namespace CGAL -#endif // CGAL_GRAPHIC_BUFFER_H +#endif // CGAL_GRAPHIC_STORAGE_H From 519c7cc1a55d62e35967c0dfb5cb86b781980be5 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 15:25:40 +0200 Subject: [PATCH 139/399] rename add_in_graphic_buffer into add_in_graphic_storage --- BGL/include/CGAL/draw_face_graph.h | 6 ++-- .../doc/Basic_viewer/Basic_viewer.txt | 31 +++++++++++++++++++ .../Basic_viewer/draw_mesh_and_points.cpp | 4 +-- .../draw_surface_mesh_small_faces.cpp | 6 ++-- .../demo/Linear_cell_complex/Viewer.cpp | 4 +-- .../include/CGAL/draw_linear_cell_complex.h | 14 ++++----- Nef_3/include/CGAL/draw_nef_3.h | 12 +++---- .../CGAL/draw_periodic_2_triangulation_2.h | 10 +++--- Point_set_3/include/CGAL/draw_point_set_3.h | 10 +++--- Polygon/include/CGAL/draw_polygon_2.h | 10 +++--- .../include/CGAL/draw_polygon_with_holes_2.h | 10 +++--- Polyhedron/include/CGAL/draw_polyhedron.h | 14 ++++----- .../include/CGAL/draw_straight_skeleton_2.h | 10 +++--- Surface_mesh/include/CGAL/draw_surface_mesh.h | 12 +++---- .../include/CGAL/draw_face_graph_with_paths.h | 12 +++---- .../polygon_triangulation_drawing_functor.h | 4 +-- .../include/CGAL/draw_triangulation_2.h | 10 +++--- .../include/CGAL/draw_triangulation_3.h | 10 +++--- .../include/CGAL/draw_voronoi_diagram_2.h | 10 +++--- 19 files changed, 115 insertions(+), 84 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index 04238fd633c7..9c28c5c4c090 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -119,7 +119,7 @@ void compute_elements(const FG &fg, } // draw_function_for_FG template -void add_in_graphic_buffer_for_fg(const FG &fg, +void add_in_graphic_storage_for_fg(const FG &fg, CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) { @@ -127,7 +127,7 @@ void add_in_graphic_buffer_for_fg(const FG &fg, } template -void add_in_graphic_buffer_for_fg(const FG &fg, +void add_in_graphic_storage_for_fg(const FG &fg, CGAL::Graphic_storage &graphic_buffer) { Drawing_functor graphic_buffer; - CGAL::add_in_graphic_buffer(point_set, graphic_buffer, Drawing_functor_green_points()); - CGAL::add_in_graphic_buffer(output_mesh, graphic_buffer); + CGAL::add_in_graphic_storage(point_set, graphic_buffer, Drawing_functor_green_points()); + CGAL::add_in_graphic_storage(output_mesh, graphic_buffer); CGAL::draw_graphic_storage(graphic_buffer); } else diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 56b15be2022e..115f96c9e982 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -102,7 +102,7 @@ int main(int argc, char* argv[]) Drawing_functor_small_faces df(sm); CGAL::Graphic_storage buffer; - add_in_graphic_buffer(sm, buffer, df); + add_in_graphic_storage(sm, buffer, df); CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); if(app) { @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) (QString("Small faces threshold=%1.").arg(df.m_threshold)); basic_viewer->clear(); - add_in_graphic_buffer(sm, buffer, df); + add_in_graphic_storage(sm, buffer, df); basic_viewer->redraw(); } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) @@ -129,7 +129,7 @@ int main(int argc, char* argv[]) (QString("Small faces threshold=%1.").arg(df.m_threshold)); basic_viewer->clear(); - add_in_graphic_buffer(sm, buffer, df); + add_in_graphic_storage(sm, buffer, df); basic_viewer->redraw(); } else diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index 6a7ba68de51f..8308b4c4a30c 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -53,7 +53,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) scene = scene_; if (scene->lcc!=nullptr) - { CGAL::add_in_graphic_buffer(*scene->lcc, gBuffer, m_drawing_functor); } + { CGAL::add_in_graphic_storage(*scene->lcc, gBuffer, m_drawing_functor); } if (doredraw) { Base::redraw(); } @@ -62,7 +62,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) void Viewer::sceneChanged() { gBuffer.clear(); - CGAL::add_in_graphic_buffer(*scene->lcc, gBuffer, m_drawing_functor); + CGAL::add_in_graphic_storage(*scene->lcc, gBuffer, m_drawing_functor); this->camera()->setSceneBoundingBox( CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(), 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 25c697907077..01cfb7fd5ffd 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -232,14 +232,14 @@ void compute_elements(const LCC& lcc, CGAL::Linear_cell_complex_base -// add_in_graphic_buffer: to add a LCC in the given graphic buffer, with a +// add_in_graphic_storage: to add a LCC in the given graphic buffer, with a // drawing functor. template class Map, class Refs, class Storage_, typename BufferType=float, class DrawingFunctor> -void add_in_graphic_buffer(const CGAL_LCC_TYPE& alcc, +void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { @@ -247,13 +247,13 @@ void add_in_graphic_buffer(const CGAL_LCC_TYPE& alcc, graphic_buffer, drawing_functor); } -// add_in_graphic_buffer: to add a LCC in the given graphic buffer, without a +// add_in_graphic_storage: to add a LCC in the given graphic buffer, without a // drawing functor. Use default drawing values. template class Map, class Refs, class Storage_, typename BufferType=float> -void add_in_graphic_buffer(const CGAL_LCC_TYPE& alcc, +void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, CGAL::Graphic_storage& graphic_buffer) { CGAL::Drawing_functor_with_volume buffer; - add_in_graphic_buffer(alcc, buffer, drawing_functor); + add_in_graphic_storage(alcc, buffer, drawing_functor); draw_graphic_storage(buffer, title); } @@ -301,7 +301,7 @@ template buffer; - add_in_graphic_buffer(alcc, buffer); + add_in_graphic_storage(alcc, buffer); draw_graphic_storage(buffer, title); } diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index f4242edd06ad..45b2f8488b66 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -236,10 +236,10 @@ void compute_elements(const Nef_Polyhedron &nef, #define CGAL_NEF3_TYPE Nef_polyhedron_3 -// add_in_graphic_buffer +// add_in_graphic_storage template -void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, +void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) { @@ -250,7 +250,7 @@ void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, template -void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, +void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, CGAL::Graphic_storage &graphic_buffer) { // Default functor; user can add his own functor. @@ -274,7 +274,7 @@ void add_in_graphic_buffer(const CGAL_NEF3_TYPE &anef, return get_random_color(random); }; - add_in_graphic_buffer(anef, graphic_buffer, drawing_functor); + add_in_graphic_storage(anef, graphic_buffer, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER @@ -287,7 +287,7 @@ void draw(const CGAL_NEF3_TYPE &anef, const char *title="Nef Polyhedron Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(anef, buffer, drawing_functor); + add_in_graphic_storage(anef, buffer, drawing_functor); draw_graphic_storage(buffer, title); } @@ -297,7 +297,7 @@ void draw(const CGAL_NEF3_TYPE &anef, const char *title="Nef Polyhedron Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(anef, buffer); + add_in_graphic_storage(anef, buffer); draw_graphic_storage(buffer, title); } diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 1b0c38a68f69..f9e734553422 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -197,7 +197,7 @@ void compute_elements(const P2T2& p2t2, #define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 template -void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, +void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { @@ -205,7 +205,7 @@ void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, } template -void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, +void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, CGAL::Graphic_storage& graphic_buffer) { CGAL::Drawing_functor_periodic_2_triangulation_2 @@ -214,7 +214,7 @@ void add_in_graphic_buffer(const CGAL_P2T2_TYPE& p2t2, typename CGAL_P2T2_TYPE::Periodic_segment_iterator, typename CGAL_P2T2_TYPE::Periodic_triangle_iterator> drawing_functor; - add_in_graphic_buffer(p2t2, graphic_buffer, drawing_functor); + add_in_graphic_storage(p2t2, graphic_buffer, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER @@ -226,7 +226,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, const char* title="2D Periodic Triangulation Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(ap2t2, buffer, drawing_functor); + add_in_graphic_storage(ap2t2, buffer, drawing_functor); draw_graphic_storage(buffer); } @@ -241,7 +241,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, typename CGAL_P2T2_TYPE::Periodic_segment_iterator, typename CGAL_P2T2_TYPE::Periodic_triangle_iterator> drawing_functor; - add_in_graphic_buffer(ap2t2, buffer, drawing_functor); + add_in_graphic_storage(ap2t2, buffer, drawing_functor); QApplication_and_basic_viewer app(buffer, title); if(app) { 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 4b8bd016bff4..144417fb1dcf 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -69,7 +69,7 @@ void compute_elements(const PointSet& pointset, } // namespace draw_function_for_PointSet template -void add_in_graphic_buffer(const Point_set_3& apointset, +void add_in_graphic_storage(const Point_set_3& apointset, Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { @@ -79,13 +79,13 @@ void add_in_graphic_buffer(const Point_set_3& apointset, } template -void add_in_graphic_buffer(const Point_set_3& apointset, +void add_in_graphic_storage(const Point_set_3& apointset, Graphic_storage& graphic_buffer) { CGAL::Drawing_functor, typename Point_set_3::const_iterator, int, int> drawing_functor; - add_in_graphic_buffer(apointset, graphic_buffer, drawing_functor); + add_in_graphic_storage(apointset, graphic_buffer, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER @@ -97,7 +97,7 @@ void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { Graphic_storage buffer; - add_in_graphic_buffer(apointset, buffer, drawing_functor); + add_in_graphic_storage(apointset, buffer, drawing_functor); draw_graphic_storage(buffer, title); } @@ -106,7 +106,7 @@ void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { Graphic_storage buffer; - add_in_graphic_buffer(apointset, buffer); + add_in_graphic_storage(apointset, buffer); draw_graphic_storage(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 2562d0efe35d..20897bdb9f86 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -99,16 +99,16 @@ void compute_elements(const P2& p2, #define CGAL_P2_TYPE CGAL::Polygon_2 -// Specializations of add_in_graphic_buffer function +// Specializations of add_in_graphic_storage function template -void add_in_graphic_buffer(const CGAL_P2_TYPE& ap2, +void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawingfunctor) { draw_function_for_p2::compute_elements(ap2, graphic_buffer, drawingfunctor); } template -void add_in_graphic_buffer(const CGAL_P2_TYPE& ap2, +void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, CGAL::Graphic_storage &graphic_buffer) { CGAL::Drawing_functor buffer; - add_in_graphic_buffer(ap2, buffer); + add_in_graphic_storage(ap2, buffer); draw_graphic_storage(buffer, title); } @@ -137,7 +137,7 @@ void draw(const CGAL_P2_TYPE &ap2, const char *title="Polygon_2 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(ap2, buffer, drawingfunctor); + add_in_graphic_storage(ap2, buffer, drawingfunctor); draw_graphic_storage(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 33006449e794..b04fd60ba0a6 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -127,7 +127,7 @@ void compute_elements(const P2& p2, Graphic_storage &graphic_buffer, #define CGAL_P2_WITH_HOLES_TYPE CGAL::Polygon_with_holes_2 template -void add_in_graphic_buffer(const CGAL_P2_WITH_HOLES_TYPE& p2, +void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor &drawing_functor) { @@ -136,7 +136,7 @@ void add_in_graphic_buffer(const CGAL_P2_WITH_HOLES_TYPE& p2, } template -void add_in_graphic_buffer(const CGAL_P2_WITH_HOLES_TYPE& p2, +void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, CGAL::Graphic_storage& graphic_buffer) { Drawing_functor drawing_functor; - add_in_graphic_buffer(p2, graphic_buffer, drawing_functor); + add_in_graphic_storage(p2, graphic_buffer, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER @@ -155,7 +155,7 @@ void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const DrawingFunctor &drawing_func const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(ap2, buffer, drawing_functor); + add_in_graphic_storage(ap2, buffer, drawing_functor); draw_graphic_storage(buffer, title); } @@ -164,7 +164,7 @@ void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(ap2, buffer); + add_in_graphic_storage(ap2, buffer); draw_graphic_storage(buffer, title); } diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 19c96d92188a..8e7b1788afeb 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -26,7 +26,7 @@ namespace CGAL #define CGAL_POLY_TYPE CGAL::Polyhedron_3 \ -// Specialization of add_in_graphic_buffer function. +// Specialization of add_in_graphic_storage function. template @@ -34,10 +34,10 @@ template -void add_in_graphic_buffer(const CGAL_POLY_TYPE& apoly, +void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) -{ add_in_graphic_buffer_for_fg(apoly, graphic_buffer, drawing_functor); } +{ add_in_graphic_storage_for_fg(apoly, graphic_buffer, drawing_functor); } template -void add_in_graphic_buffer(const CGAL_POLY_TYPE& apoly, +void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, CGAL::Graphic_storage &graphic_buffer) -{ add_in_graphic_buffer_for_fg(apoly, graphic_buffer); } +{ add_in_graphic_storage_for_fg(apoly, graphic_buffer); } // Specialization of draw function: require Qt and the CGAL basic viewer. #ifdef CGAL_USE_BASIC_VIEWER @@ -62,7 +62,7 @@ void draw(const CGAL_POLY_TYPE& apoly, const char* title="Polyhedron Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer_for_fg(apoly, buffer); + add_in_graphic_storage_for_fg(apoly, buffer); draw_graphic_storage(buffer, title); } @@ -78,7 +78,7 @@ void draw(const CGAL_POLY_TYPE& apoly, const char* title="Polyhedron Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer_for_fg(apoly, buffer, drawing_functor); + add_in_graphic_storage_for_fg(apoly, buffer, drawing_functor); draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 8736fd07080a..9b4fcddf3926 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -130,7 +130,7 @@ void compute_elements(const SS2& ss2, #define CGAL_SS_TYPE CGAL::Straight_skeleton_2 template -void add_in_graphic_buffer(const CGAL_SS_TYPE &ass2, +void add_in_graphic_storage(const CGAL_SS_TYPE &ass2, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { @@ -139,7 +139,7 @@ void add_in_graphic_buffer(const CGAL_SS_TYPE &ass2, } template -void add_in_graphic_buffer(const CGAL_SS_TYPE& ass2, +void add_in_graphic_storage(const CGAL_SS_TYPE& ass2, CGAL::Graphic_storage& graphic_buffer) { Drawing_functor buffer; - add_in_graphic_buffer(ass2, buffer, drawingfunctor); + add_in_graphic_storage(ass2, buffer, drawingfunctor); draw_graphic_storage(buffer, title); } @@ -196,7 +196,7 @@ void draw(const CGAL_SS_TYPE &ass2, const char *title="Straight Skeleton Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(ass2, buffer); + add_in_graphic_storage(ass2, buffer); draw_graphic_storage(buffer, title); } diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index f68fa485697a..3b2f9895c93f 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -40,15 +40,15 @@ namespace CGAL { template -void add_in_graphic_buffer(const Surface_mesh& amesh, +void add_in_graphic_storage(const Surface_mesh& amesh, CGAL::Graphic_storage &graphic_buffer, const DrawingFunctor &drawing_functor) -{ add_in_graphic_buffer_for_fg(amesh, graphic_buffer, drawing_functor); } +{ add_in_graphic_storage_for_fg(amesh, graphic_buffer, drawing_functor); } template -void add_in_graphic_buffer(const Surface_mesh& amesh, +void add_in_graphic_storage(const Surface_mesh& amesh, CGAL::Graphic_storage &graphic_buffer) -{ add_in_graphic_buffer_for_fg(amesh, graphic_buffer); } +{ add_in_graphic_storage_for_fg(amesh, graphic_buffer); } #ifdef CGAL_USE_BASIC_VIEWER @@ -58,7 +58,7 @@ void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer_for_fg(amesh, buffer); + add_in_graphic_storage_for_fg(amesh, buffer); draw_graphic_storage(buffer, title); } @@ -68,7 +68,7 @@ void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer_for_fg(amesh, buffer, drawing_functor); + add_in_graphic_storage_for_fg(amesh, buffer, drawing_functor); draw_graphic_storage(buffer, title); } diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 486ad6490108..8eecc3b4f0b0 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -370,7 +370,7 @@ void compute_elements(const Mesh &mesh, } // namespace draw_function_for_face_graph_with_paths template -void add_in_graphic_buffer(const Mesh& mesh, +void add_in_graphic_storage(const Mesh& mesh, CGAL::Graphic_storage& graphic_buffer, const std::vector>* paths, const DrawingFunctor& drawing_functor, @@ -384,7 +384,7 @@ void add_in_graphic_buffer(const Mesh& mesh, } template -void add_in_graphic_buffer(const Mesh& mesh, +void add_in_graphic_storage(const Mesh& mesh, CGAL::Graphic_storage& graphic_buffer, const std::vector>* paths, typename Get_map::type::size_type amark= @@ -397,7 +397,7 @@ void add_in_graphic_buffer(const Mesh& mesh, typename Get_map::type::Dart_const_descriptor /*fh*/> drawing_functor; - add_in_graphic_buffer(mesh, graphic_buffer, drawing_functor, paths, amark); + add_in_graphic_storage(mesh, graphic_buffer, drawing_functor, paths, amark); } #ifdef CGAL_USE_BASIC_VIEWER @@ -410,7 +410,7 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(mesh, buffer, &paths, amark); + add_in_graphic_storage(mesh, buffer, &paths, amark); draw_graphic_storage(buffer, title); } @@ -423,7 +423,7 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(mesh, buffer, drawing_functor, &paths, amark); + add_in_graphic_storage(mesh, buffer, drawing_functor, &paths, amark); draw_graphic_storage(buffer, title); } @@ -436,7 +436,7 @@ void draw(const Mesh& mesh, { std::vector> paths=l; CGAL::Graphic_storage buffer; - add_in_graphic_buffer(mesh, buffer, &paths, amark); + add_in_graphic_storage(mesh, buffer, &paths, amark); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h index 6880a4921b3e..b1750169c7d7 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h @@ -60,7 +60,7 @@ struct Polygon_triangulation_drawing_functor : template -void add_in_graphic_buffer(const CGAL_CT2_TYPE& ct2, +void add_in_graphic_storage(const CGAL_CT2_TYPE& ct2, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { @@ -75,7 +75,7 @@ void draw(const CGAL_CT2_TYPE &ct2, const DrawingFunctor &drawingfunctor, const char *title="Constrained Triangulation_2 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(ct2, buffer, drawingfunctor); + add_in_graphic_storage(ct2, buffer, drawingfunctor); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 0e777ffdd435..8d17d21accb0 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -118,7 +118,7 @@ void compute_elements(const T2& t2, #define CGAL_T2_TYPE CGAL::Triangulation_2 template -void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, +void add_in_graphic_storage(const CGAL_T2_TYPE& at2, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { @@ -126,7 +126,7 @@ void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, } template -void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, +void add_in_graphic_storage(const CGAL_T2_TYPE& at2, CGAL::Graphic_storage& graphic_buffer) { CGAL::Graphic_storage buffer; @@ -147,7 +147,7 @@ void add_in_graphic_buffer(const CGAL_T2_TYPE& at2, return get_random_color(random); }; - add_in_graphic_buffer(at2, graphic_buffer, drawingFunctor); + add_in_graphic_storage(at2, graphic_buffer, drawingFunctor); } #ifdef CGAL_USE_BASIC_VIEWER @@ -158,7 +158,7 @@ void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, const char *title="Triangulation_2 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(at2, buffer, drawingfunctor); + add_in_graphic_storage(at2, buffer, drawingfunctor); draw_graphic_storage(buffer, title); } @@ -167,7 +167,7 @@ void draw(const CGAL_T2_TYPE& at2, const char *title="Triangulation_2 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(at2, buffer); + add_in_graphic_storage(at2, buffer); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 0a171fc30df1..de8f06acd07b 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -117,7 +117,7 @@ void compute_elements(const T3* t3, template -void add_in_graphic_buffer(const CGAL_T3_TYPE& at3, +void add_in_graphic_storage(const CGAL_T3_TYPE& at3, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& drawing_functor) { @@ -126,7 +126,7 @@ void add_in_graphic_buffer(const CGAL_T3_TYPE& at3, template -void add_in_graphic_buffer(const CGAL_T3_TYPE& at3, +void add_in_graphic_storage(const CGAL_T3_TYPE& at3, CGAL::Graphic_storage& graphic_buffer) { CGAL::Drawing_functor buffer; - add_in_graphic_buffer(at3, buffer, drawingfunctor); + add_in_graphic_storage(at3, buffer, drawingfunctor); draw_graphic_storage(buffer, title); } @@ -170,7 +170,7 @@ template void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(at3, buffer); + add_in_graphic_storage(at3, buffer); draw_graphic_storage(buffer, title); } diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 20bcffc914a4..33218f901124 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -337,7 +337,7 @@ void compute_elements(const V2& v2, template -void add_in_graphic_buffer(const CGAL_VORONOI_TYPE &v2, +void add_in_graphic_storage(const CGAL_VORONOI_TYPE &v2, CGAL::Graphic_storage& graphic_buffer, const DrawingFunctor& m_drawing_functor) { @@ -345,7 +345,7 @@ void add_in_graphic_buffer(const CGAL_VORONOI_TYPE &v2, } template -void add_in_graphic_buffer(const CGAL_VORONOI_TYPE& v2, +void add_in_graphic_storage(const CGAL_VORONOI_TYPE& v2, CGAL::Graphic_storage& graphic_buffer) { // Default functor; user can add his own functor. @@ -355,7 +355,7 @@ void add_in_graphic_buffer(const CGAL_VORONOI_TYPE& v2, typename CGAL_VORONOI_TYPE::Face_iterator> drawing_functor; - add_in_graphic_buffer(v2, graphic_buffer, drawing_functor); + add_in_graphic_storage(v2, graphic_buffer, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER @@ -368,7 +368,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_buffer(av2, buffer, drawing_functor); + add_in_graphic_storage(av2, buffer, drawing_functor); draw_graphic_storage(buffer, title); } @@ -384,7 +384,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, typename CGAL_VORONOI_TYPE::Face_iterator> drawing_functor; - add_in_graphic_buffer(av2, buffer, drawing_functor); + add_in_graphic_storage(av2, buffer, drawing_functor); QApplication_and_basic_viewer app(buffer, title); if(app) From e2428902555593576e808f603b496449782d1282 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 15:53:39 +0200 Subject: [PATCH 140/399] doc --- .../doc/Basic_viewer/PackageDescription.txt | 30 +++++++++++++++++++ .../include/CGAL/Basic_shaders.h | 0 .../include/CGAL/Qt/Basic_viewer_qt.h | 0 Documentation/doc/Documentation/packages.txt | 2 +- 4 files changed, 31 insertions(+), 1 deletion(-) rename {GraphicsView => Basic_viewer}/include/CGAL/Basic_shaders.h (100%) rename {GraphicsView => Basic_viewer}/include/CGAL/Qt/Basic_viewer_qt.h (100%) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index e69de29bb2d1..019d185aa849 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -0,0 +1,30 @@ +/// \defgroup PkgBasicViewerRef Basic Viewer Reference + +/// \defgroup PkgBasicViewerClasses Classes +/// \ingroup PkgBasicViewerRef + +/*! +\addtogroup PkgBasicViewerRef +\cgalPkgDescriptionBegin{Basic Viewer,PkgBasicViewer} +\cgalPkgPicture{TODO.png} +\cgalPkgSummaryBegin +\cgalPkgAuthor{Guillaume Damiand} +\cgalPkgDesc{This package implements basic viewer class.} +\cgalPkgManuals{Chapter_Basic_Viewer,PkgBasicViewerRef} +\cgalPkgSummaryEnd +\cgalPkgShortInfoBegin +\cgalPkgSince{6.0} +\cgalPkgBib{cgal:XXX} +\cgalPkgLicense{\ref licensesLGPL "LGPL"} +\cgalPkgShortInfoEnd +\cgalPkgDescriptionEnd + +\cgalClassifedRefPages + +\cgalCRPSection{Classes} +- `CGAL::Drawing_functor` +- `CGAL::Drawing_functor_with_volume` +- `CGAL::Graphic_storage` + +*/ + diff --git a/GraphicsView/include/CGAL/Basic_shaders.h b/Basic_viewer/include/CGAL/Basic_shaders.h similarity index 100% rename from GraphicsView/include/CGAL/Basic_shaders.h rename to Basic_viewer/include/CGAL/Basic_shaders.h diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h similarity index 100% rename from GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h rename to Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h diff --git a/Documentation/doc/Documentation/packages.txt b/Documentation/doc/Documentation/packages.txt index efb62a8134e1..467098a1b84b 100644 --- a/Documentation/doc/Documentation/packages.txt +++ b/Documentation/doc/Documentation/packages.txt @@ -167,6 +167,6 @@ \package_listing{GraphicsView} \package_listing{CGAL_ipelets} -\package_listing{CGAL_basic_viewers} +\package_listing{Basic_viewer} */ From 43194fb5ef710b6d33406fffe93c6741b08f7153 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 17:13:49 +0200 Subject: [PATCH 141/399] Add new example of Basic viewer allowing to view several windows --- .../examples/Basic_viewer/CMakeLists.txt | 3 +++ .../Basic_viewer/draw_mesh_and_points.cpp | 1 - .../draw_surface_mesh_small_faces.cpp | 18 +++++++++--------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt index 03d5b03a22f6..44e79ffd565c 100644 --- a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt +++ b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt @@ -16,15 +16,18 @@ include(CGAL_Eigen3_support) create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") create_single_source_cgal_program("draw_mesh_and_points.cpp") +create_single_source_cgal_program("draw_several_windows.cpp") if(CGAL_Qt5_FOUND) #link it with the required CGAL libraries target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_mesh_and_points PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(draw_several_windows PUBLIC CGAL::CGAL_Basic_viewer) endif() if(TARGET CGAL::Eigen3_support) target_link_libraries(draw_mesh_and_points PUBLIC CGAL::Eigen3_support) + target_link_libraries(draw_several_windows PUBLIC CGAL::Eigen3_support) endif() #end of the file diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 68a59a7f4f16..d230becb9d9f 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -9,7 +9,6 @@ #include #include -// Types typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; typedef Kernel::Vector_3 Vector; diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 115f96c9e982..231290527076 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -25,14 +25,14 @@ struct Drawing_functor_small_faces: typename boost::graph_traits::vertex_descriptor, typename boost::graph_traits::edge_descriptor, typename boost::graph_traits::face_descriptor>; - + Drawing_functor_small_faces(const SM& sm): Base(), m_sm(sm) { typename SM::template Property_map faces_size; boost::tie(faces_size, m_with_size)=sm.template property_map("f:size"); - if(!m_with_size) + if(!m_with_size) { return; } - + m_min_size=faces_size[*(sm.faces().begin())]; m_max_size=m_min_size; FT cur_size; @@ -54,11 +54,11 @@ struct Drawing_functor_small_faces: CGAL::IO::Color get_face_color(const SM& sm, typename boost::graph_traits::face_descriptor fh) - { + { // Default color of faces CGAL::IO::Color c(75,160,255); if(!m_with_size) { return c; } - + // Compare the size of the face with the % m_threshold bool exist; typename SM::template Property_map faces_size; @@ -71,7 +71,7 @@ struct Drawing_functor_small_faces: return c; // Default color } - + const SM& m_sm; bool m_with_size; FT m_min_size, m_max_size; @@ -122,9 +122,9 @@ int main(int argc, char* argv[]) basic_viewer->redraw(); } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) - { + { if(df.m_threshold<5) { df.m_threshold=0; } - else { df.m_threshold-=5; } + else { df.m_threshold-=5; } basic_viewer->displayMessage (QString("Small faces threshold=%1.").arg(df.m_threshold)); @@ -147,7 +147,7 @@ int main(int argc, char* argv[]) // Then we run the app app.run(); } - + sm.remove_property_map(faces_size); return EXIT_SUCCESS; From e7acefdde3783414c901af477d2b9ee729d05dcb Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 17:14:05 +0200 Subject: [PATCH 142/399] clean --- .../include/CGAL/Qt/Basic_viewer_qt.h | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h index 254e9fb724df..5c77196d8cf0 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h @@ -1691,32 +1691,6 @@ void draw_graphic_storage(Graphic_storage& graphic_buffer, } } -// template -// void draw_graphic_storage(Graphic_storage &graphic_buffer, -// const std::function *)>& onPress, -// const char *title="CGAL Basic Viewer") -// { -// #if defined(CGAL_TEST_SUITE) -// bool cgal_test_suite = true; -// #else -// bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -// #endif - -// if (!cgal_test_suite) -// { -// Qt::init_ogl_context(4, 3); - -// int argc = 1; -// const char *argv[2] = {title, nullptr}; -// QApplication app(argc, const_cast(argv)); -// Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer, title); -// basic_viewer._onPress = onPress; - -// basic_viewer.show(); -// app.exec(); -// } -// } - //------------------------------------------------------------------------------ template class QApplication_and_basic_viewer From bde0a527307a77f65c917e08deab9de3a2f1c04f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 17:14:43 +0200 Subject: [PATCH 143/399] Add new example of Basic viewer allowing to view several windows --- .../Basic_viewer/draw_several_windows.cpp | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp new file mode 100644 index 000000000000..0fae3870c9d2 --- /dev/null +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point; +typedef Kernel::Vector_3 Vector; +typedef std::pair Pwn; +typedef CGAL::Polyhedron_3 Polyhedron; +using PS3=CGAL::Point_set_3; + +int main(void) +{ + /// (1) Some CGAL code that create data structure and fill Graphic_storage. + std::vector points; + + if(!CGAL::IO::read_points(CGAL::data_file_path("points_3/kitten.xyz"), std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()))) + { + std::cerr << "Error: cannot read input file!" << std::endl; + return EXIT_FAILURE; + } + + Polyhedron output_mesh; + + double average_spacing = CGAL::compute_average_spacing + (points, 6, CGAL::parameters::point_map(CGAL::First_of_pair_property_map())); + + if (!CGAL::poisson_surface_reconstruction_delaunay + (points.begin(), points.end(), + CGAL::First_of_pair_property_map(), + CGAL::Second_of_pair_property_map(), + output_mesh, average_spacing)) + { return EXIT_FAILURE; } + + PS3 point_set; + for(Pwn& it: points) + { point_set.insert(it.first); } + + CGAL::Graphic_storage graphic_buffer1, graphic_buffer2; + CGAL::add_in_graphic_storage(point_set, graphic_buffer1); + CGAL::add_in_graphic_storage(output_mesh, graphic_buffer2); + + /// (2) Qt code that create windows, add them in a layout, and create app. + +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite=true; +#else + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (cgal_test_suite) { return EXIT_SUCCESS; } + + int argc=1; + const char* argv[2]={"Draw several windows example","\0"}; + QApplication app(argc,const_cast(argv)); + + QMainWindow* mainWindow=new QMainWindow; + QWidget *centralWidget = new QWidget(mainWindow); + QHBoxLayout* layout = new QHBoxLayout(mainWindow); + + CGAL::Basic_viewer_qt bv1(mainWindow, graphic_buffer1); + CGAL::Basic_viewer_qt bv2(mainWindow, graphic_buffer2); + bv1.set_draw_vertices(true); + + layout->addWidget(&bv1); + layout->addWidget(&bv2); + + centralWidget->setLayout(layout); + mainWindow->setCentralWidget(centralWidget); + + mainWindow->show(); + app.exec(); + + return EXIT_SUCCESS; +} From d3acc0941e4c0af14e9f2d401a79cbf068feae7c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 18:19:09 +0200 Subject: [PATCH 144/399] add one example with custom color --- .../examples/Basic_viewer/CMakeLists.txt | 6 +- .../Basic_viewer/draw_surface_mesh_height.cpp | 67 +++++++++++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp diff --git a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt index 44e79ffd565c..2ba9f5b9dae8 100644 --- a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt +++ b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt @@ -14,15 +14,17 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Eigen3 3.1.0) include(CGAL_Eigen3_support) -create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") create_single_source_cgal_program("draw_mesh_and_points.cpp") create_single_source_cgal_program("draw_several_windows.cpp") +create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") +create_single_source_cgal_program("draw_surface_mesh_height.cpp") if(CGAL_Qt5_FOUND) #link it with the required CGAL libraries - target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_mesh_and_points PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_several_windows PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(draw_surface_mesh_height PUBLIC CGAL::CGAL_Basic_viewer) endif() if(TARGET CGAL::Eigen3_support) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp new file mode 100644 index 000000000000..9c72bf2feaf0 --- /dev/null +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_3 Point; +typedef CGAL::Surface_mesh Mesh; + +struct Colored_faces_given_height: public CGAL::Drawing_functor +{ + Colored_faces_given_height(const Mesh& sm) + { + double m_min_z, m_max_z; + if(!sm.is_empty()) + { + bool first=true; + for(typename Mesh::Vertex_index vi: sm.vertices()) + { + if(first) + { m_min_z=sm.point(vi).z(); m_max_z=m_min_z; first=false; } + else + { + m_min_z=std::min(m_min_z, sm.point(vi).z()); + m_max_z=std::max(m_max_z, sm.point(vi).z()); + } + } + } + + this->colored_face=[](const Mesh &, typename Mesh::Face_index)->bool { return true; }; + + this->face_color=[m_min_z, m_max_z] + (const Mesh& sm, typename Mesh::Face_index fi)->CGAL::IO::Color + { + double res; + std::size_t n=0; + for(typename Mesh::Vertex_index vi: vertices_around_face(sm.halfedge(fi), sm)) + { + res+=sm.point(vi).z(); + ++n; + } + // Random color depending on the "height" of the facet + CGAL::Random random(30*((res/n)-m_min_z)/(m_max_z-m_min_z)); + return CGAL::get_random_color(random); + }; + } +}; + +int main(int argc, char* argv[]) +{ + const std::string filename = (argc>1) ? argv[1] : CGAL::data_file_path("meshes/elephant.off"); + + Mesh sm; + if(!CGAL::IO::read_polygon_mesh(filename, sm)) + { + std::cerr << "Invalid input file." << std::endl; + return EXIT_FAILURE; + } + + CGAL::draw(sm, Colored_faces_given_height(sm)); + + return EXIT_SUCCESS; +} From f39254f738fb7c043540ae56866d944cfcb1ca78 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 28 Apr 2023 19:09:57 +0200 Subject: [PATCH 145/399] doc --- .../doc/Basic_viewer/Basic_viewer.txt | 48 ++++++++++++------- .../doc/Basic_viewer/PackageDescription.txt | 6 +++ Basic_viewer/doc/Basic_viewer/examples.txt | 3 ++ .../CGAL/draw_linear_cell_complex.h | 12 ++++- .../PackageDescription.txt | 1 + 5 files changed, 50 insertions(+), 20 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 92729ab1ab63..87f101bafea0 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -3,41 +3,53 @@ namespace CGAL { \mainpage User Manual \anchor Chapter_Basic_viewer -\anchor -\cgalAutoToc +\anchor ChapterBasicViewer + \author Guillaume Damiand, Mostafa Ashraf +\cgalAutoToc -Two main use: +\section Basic_viewerDoc + +\subsection Basic_viewerDoc_1 Direct Draw -1) draw draw(XXX) -2) through graphic storage +\subsection Basic_viewerDoc_2 Customize the drawing + +Drawing_functor + +\subsection Basic_viewerDoc_3 Graphic storage + +\subsection Basic_viewerDoc_4 Basic viewer Qt + +\subsection Basic_viewerDoc_5 Application and basic viewer + + +\section Basic_viewerExamples Examples + +\subsection Basic_viewerExamples_simple_draw Basic draw + +\cgalExample{Linear_cell_complex/draw_linear_cell_complex.cpp} -Graohic_storage gs; -add_in_graphic_storage(XXX, gs); -draw_graphic_storage(gs); -3) basic interactions +\subsection Basic_viewerExamples_custom_color Change Face Colors -introduce qapplication and basic viewer class +\cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} -4) advanced interactions -introduce basic viewer class +\subsection Basic_viewerExamples_two_ds Draw two different CGAL data-structures in a same viewer -5) examples +\cgalExample{Basic_viewer/draw_mesh_and_points.cpp} -5.1) simple draw -5.2) draw with drawing functor +\subsection Basic_viewerExamples_interact Interaction with the viewer -5.3) draw 2 different DS in a same viewer +\cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} -5.4) interaction with qapplication and basic viewer -5.5) mix different basic viewer in a same window (code laurent ?) +\subsection Basic_viewerExamples_several_window Draw several basic viewers +\cgalExample{Basic_viewer/draw_several_windows.cpp} */ diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 019d185aa849..1ad624dc5250 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -26,5 +26,11 @@ - `CGAL::Drawing_functor_with_volume` - `CGAL::Graphic_storage` +\cgalCRPSubsection{Draw functions} +- \link PkgDrawLinearCellComplex CGAL::draw() \endlink + +\cgalCRPSubsection{Fill graphic storage functions} +- \link PkgDrawLinearCellComplex CGAL::CGAL::add_in_graphic_storage() \endlink + */ diff --git a/Basic_viewer/doc/Basic_viewer/examples.txt b/Basic_viewer/doc/Basic_viewer/examples.txt index 9a6d5e6a3be7..1deef74b4f8f 100644 --- a/Basic_viewer/doc/Basic_viewer/examples.txt +++ b/Basic_viewer/doc/Basic_viewer/examples.txt @@ -1,4 +1,7 @@ /*! +\example Linear_cell_complex/draw_linear_cell_complex.cpp \example Basic_viewer/draw_mesh_and_points.cpp +\example Basic_viewer/draw_several_windows.cpp +\example Basic_viewer/draw_surface_mesh_height.cpp \example Basic_viewer/draw_surface_mesh_small_faces.cpp */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index 0e0d2f392b58..400697b9e9d9 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -9,8 +9,16 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5 \param alcc the linear cell complex to draw. */ -template -void draw(const LCC& alcc); + template + void draw(const LCC& alcc, const DrawingFunctor& afunctor); + +/*! +\ingroup PkgDrawLinearCellComplex + +*/ + template + void add_in_graphic_storage(const LCC& alcc, CGAL::Graphic_storage& graphic_buffer, + const DrawingFunctor& afunctor); } /* namespace CGAL */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index 42da9fd92769..02d4553862e8 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -76,6 +76,7 @@ \cgalCRPSubsection{Draw a Linear Cell Complex} - \link PkgDrawLinearCellComplex CGAL::draw() \endlink +- \link PkgDrawLinearCellComplex CGAL::add_in_graphic_storage() \endlink */ From 45e2d49fa5390032042fff116ad561f466244172 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 12:11:06 +0200 Subject: [PATCH 146/399] doc --- Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h index 2f0b5901cc67..0d87d6639240 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h @@ -10,8 +10,8 @@ The class `Graphic_storage` store points, segments and triangles. Elements can b */ template -class Graphic_storage -{ +class Graphic_storage { +public: /// Add the given point in this storage. template void add_point(const KPoint &p); From 03d7c1079badbeb56d150c09cf398df2c3b9e3a0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 12:29:35 +0200 Subject: [PATCH 147/399] doc --- .../doc/Basic_viewer/CGAL/Drawing_functor.h | 40 ++++++++++--------- .../doc/Basic_viewer/CGAL/Graphic_storage.h | 4 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index 31c31e69561b..a3241cba361e 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -19,32 +19,33 @@ template struct Drawing_functor { - /// std::function that returns true if the given vertex must be drawn, false otherwise. - /// Returns true by default. +public: + /// std::function that returns `true` if the given vertex must be drawn, `false` otherwise. + /// Returns `true` by default. std::function draw_vertex; - /// std::function that returns true if the given edge must be drawn, false otherwise. - /// Returns true by default. + /// std::function that returns `true` if the given edge must be drawn, `false` otherwise. + /// Returns `true` by default. std::function draw_edge; - /// std::function that returns true if the given face must be drawn, false otherwise. - /// Returns true by default. + /// std::function that returns `true` if the given face must be drawn, `false` otherwise. + /// Returns `true` by default. std::function draw_face; - /// std::function that returns true if the given vertex is colored, false otherwise. - /// Returns false by default. + /// std::function that returns `true` if the given vertex is colored, `false` otherwise. + /// Returns `false` by default. std::function colored_vertex; - /// std::function that returns true if the given edge is colored, false otherwise. - /// Returns false by default. + /// std::function that returns `true` if the given edge is colored, `false` otherwise. + /// Returns `false` by default. std::function colored_edge; - /// std::function that returns true if the given face is colored, false otherwise. - /// Returns false by default. + /// std::function that returns `true` if the given face is colored, `false` otherwise. + /// Returns `false` by default. std::function colored_face; - /// std::function that returns true if the given face is drawn in wireframe, false otherwise. - /// Returns false by default. + /// std::function that returns `true` if the given face is drawn in wireframe, `false` otherwise. + /// Returns `false` by default. std::function face_wireframe; /// std::function that returns the color of the given vertex. @@ -102,16 +103,17 @@ template { - /// std::function that returns true if the given volume must be drawn, false otherwise. - /// Returns true by default. +public: + /// std::function that returns `true` if the given volume must be drawn, `false` otherwise. + /// Returns `true` by default. std::function draw_volume; /// std::function that returns the color of the given volume. - /// Returns false by default. + /// Returns `false` by default. std::function colored_volume; - /// std::function that returns true if the given volume is drawn in wireframe, false otherwise. - /// Returns false by default. + /// std::function that returns `true` if the given volume is drawn in wireframe, `false` otherwise. + /// Returns `false` by default. std::function volume_wireframe; /// std::function that returns the color of the given volume. diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h index 0d87d6639240..6b59045bda1a 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h @@ -53,7 +53,7 @@ class Graphic_storage { /// start a new colored face. void face_begin(const CGAL::IO::Color &acolor); - /// @return true iff a face is started. + /// @return `true` iff a face is started. bool is_a_face_started() const; /// add the given point in the current face. @@ -66,7 +66,7 @@ class Graphic_storage { /// end the current face. void face_end(); - /// @return true iff the storage has no element. + /// @return `true` iff the storage has no element. bool is_empty() const; /// clear the storage, i.e. remove all points, segments, triangles and text. From 7da9812bda90a55c55f833462bd86cd32c7755b2 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 15:18:34 +0200 Subject: [PATCH 148/399] Rename graphic_buffer into graphic_storage. --- BGL/include/CGAL/draw_face_graph.h | 24 +-- .../include/CGAL/Qt/Basic_viewer_qt.h | 140 +++++++++--------- .../include/CGAL/draw_linear_cell_complex.h | 40 ++--- Nef_3/include/CGAL/draw_nef_3.h | 42 +++--- .../CGAL/draw_periodic_2_triangulation_2.h | 56 +++---- Point_set_3/include/CGAL/draw_point_set_3.h | 14 +- Polygon/include/CGAL/draw_polygon_2.h | 26 ++-- .../include/CGAL/draw_polygon_with_holes_2.h | 38 ++--- Polyhedron/include/CGAL/draw_polyhedron.h | 8 +- .../include/CGAL/draw_straight_skeleton_2.h | 38 ++--- Surface_mesh/include/CGAL/draw_surface_mesh.h | 8 +- .../include/CGAL/draw_face_graph_with_paths.h | 58 ++++---- .../include/CGAL/draw_triangulation_2.h | 42 +++--- .../include/CGAL/draw_triangulation_3.h | 42 +++--- .../include/CGAL/draw_voronoi_diagram_2.h | 74 ++++----- 15 files changed, 326 insertions(+), 324 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index 9c28c5c4c090..fd370e25c47b 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -26,7 +26,7 @@ namespace draw_function_for_FG { template void compute_elements(const FG &fg, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor &m_drawing_functor) { using Point=typename boost::property_map_value::type; @@ -66,17 +66,17 @@ void compute_elements(const FG &fg, !m_drawing_functor.face_wireframe(fg, fh) && // face is not wireframe m_drawing_functor.colored_face(fg, fh)) // and face is colored { - graphic_buffer.face_begin(m_drawing_functor.face_color(fg, fh)); + graphic_storage.face_begin(m_drawing_functor.face_color(fg, fh)); auto hd = halfedge(fh, fg); const auto first_hd = hd; do { auto v = source(hd, fg); - graphic_buffer.add_point_in_face(get(point_pmap, v), get(vnormals, v)); + graphic_storage.add_point_in_face(get(point_pmap, v), get(vnormals, v)); hd = next(hd, fg); } while (hd != first_hd); - graphic_buffer.face_end(); + graphic_storage.face_end(); } } } @@ -87,13 +87,13 @@ void compute_elements(const FG &fg, { if(m_drawing_functor.colored_edge(fg, e)) // edge is colored { - graphic_buffer.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), + graphic_storage.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), get(point_pmap, target(halfedge(e, fg), fg)), m_drawing_functor.edge_color(fg, e)); } else { - graphic_buffer.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), + graphic_storage.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), get(point_pmap, target(halfedge(e, fg), fg))); } } @@ -105,12 +105,12 @@ void compute_elements(const FG &fg, { if(m_drawing_functor.colored_vertex(fg, v)) // vertex is colored { - graphic_buffer.add_point(get(point_pmap, v), + graphic_storage.add_point(get(point_pmap, v), m_drawing_functor.vertex_color(fg, v)); } else { - graphic_buffer.add_point(get(point_pmap, v)); + graphic_storage.add_point(get(point_pmap, v)); } } } @@ -120,15 +120,15 @@ void compute_elements(const FG &fg, template void add_in_graphic_storage_for_fg(const FG &fg, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor &drawing_functor) { - draw_function_for_FG::compute_elements(fg, graphic_buffer, drawing_functor); + draw_function_for_FG::compute_elements(fg, graphic_storage, drawing_functor); } template void add_in_graphic_storage_for_fg(const FG &fg, - CGAL::Graphic_storage &graphic_buffer) + CGAL::Graphic_storage &graphic_storage) { Drawing_functor::vertex_descriptor, @@ -151,7 +151,7 @@ void add_in_graphic_storage_for_fg(const FG &fg, return get_random_color(CGAL::get_default_random()); }; - add_in_graphic_storage_for_fg(fg, graphic_buffer, drawing_functor); + add_in_graphic_storage_for_fg(fg, graphic_storage, drawing_functor); } } // End namespace CGAL diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h index 5c77196d8cf0..7ad04ad25e8f 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h @@ -58,8 +58,7 @@ #define CGAL_BASIC_VIEWER_INIT_SIZE_X 500 #define CGAL_BASIC_VIEWER_INIT_SIZE_Y 450 -namespace CGAL -{ +namespace CGAL { //------------------------------------------------------------------------------ template @@ -69,7 +68,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; - using GB=Graphic_storage; + using GS=Graphic_storage; // Constructor/Destructor Basic_viewer_qt(QWidget* parent, @@ -240,9 +239,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer void clear() { - for (unsigned int i=0; i& get_graphic_buffer() + Graphic_storage& get_graphic_storage() + { return gBuffer; } + const Graphic_storage& get_graphic_storage() const { return gBuffer; } virtual void redraw() @@ -394,6 +395,13 @@ class Basic_viewer_qt : public CGAL::QGLViewer gBuffer.negate_all_normals(); } + // Returns true if the data structure lies on a plane + bool is_two_dimensional() const + { + return (!is_empty() && !m_no_2D_mode && + (has_zero_x() || has_zero_y() || has_zero_z())); + } + protected: void compile_shaders() { @@ -525,8 +533,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer unsigned int bufn = 0; CGAL_assertion(bufn(gBuffer.number_of_elements(GB::POS_MONO_POINTS))); + glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_POINTS))); vao[VAO_MONO_POINTS].release(); vao[VAO_COLORED_POINTS].bind(); @@ -975,7 +977,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("clipPlane", clipPlane); rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_POINTS))); + glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_POINTS))); vao[VAO_COLORED_POINTS].release(); }; @@ -1014,7 +1016,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_SEGMENTS))); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_SEGMENTS))); vao[VAO_MONO_SEGMENTS].release(); vao[VAO_COLORED_SEGMENTS].bind(); @@ -1034,7 +1036,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.setUniformValue("pointPlane", plane_point); rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_SEGMENTS))); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_SEGMENTS))); vao[VAO_COLORED_SEGMENTS].release(); }; @@ -1066,7 +1068,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (double)m_rays_mono_color.blue()/(double)255); rendering_program_p_l.setAttributeValue("color",color); glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_RAYS))); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_RAYS))); vao[VAO_MONO_RAYS].release(); vao[VAO_COLORED_RAYS].bind(); @@ -1083,7 +1085,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.enableAttributeArray("color"); } glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_RAYS))); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_RAYS))); vao[VAO_COLORED_RAYS].release(); rendering_program_p_l.release(); @@ -1099,7 +1101,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (double)m_lines_mono_color.blue()/(double)255); rendering_program_p_l.setAttributeValue("color",color); glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_LINES))); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_LINES))); vao[VAO_MONO_LINES].release(); rendering_program_p_l.release(); @@ -1118,7 +1120,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_p_l.enableAttributeArray("color"); } glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_LINES))); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_LINES))); vao[VAO_COLORED_LINES].release(); rendering_program_p_l.release(); @@ -1152,7 +1154,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); rendering_program_face.setUniformValue("clipPlane", clipPlane); rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GB::POS_MONO_FACES))); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_FACES))); vao[VAO_MONO_FACES].release(); vao[VAO_COLORED_FACES].bind(); @@ -1172,7 +1174,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); rendering_program_face.setUniformValue("clipPlane", clipPlane); rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GB::POS_COLORED_FACES))); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_FACES))); vao[VAO_COLORED_FACES].release(); }; @@ -1183,7 +1185,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_clipping_plane.bind(); vao[VAO_CLIPPING_PLANE].bind(); glLineWidth(0.1f); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GB::POS_CLIPPING_PLANE))); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_CLIPPING_PLANE))); glLineWidth(1.0f); vao[VAO_CLIPPING_PLANE].release(); rendering_program_clipping_plane.release(); @@ -1311,7 +1313,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer (bounding_box().zmax() - bounding_box().zmin())); const unsigned int nbSubdivisions=30; - auto& array = gBuffer.get_array_of_index(GB::POS_CLIPPING_PLANE); + auto& array = gBuffer.get_array_of_index(GS::POS_CLIPPING_PLANE); array.clear(); for (unsigned int i=0; i<=nbSubdivisions; ++i) { @@ -1590,7 +1592,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer return text; } public: - std::function *)> on_key_pressed; + std::function *)> on_key_pressed; protected: Graphic_storage& gBuffer; @@ -1634,8 +1636,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer // CGAL::qglviewer::LocalConstraint constraint; CGAL::qglviewer::WorldConstraint constraint; - static const unsigned int NB_VBO_BUFFERS=(GB::END_POS-GB::BEGIN_POS)+ - (GB::END_COLOR-GB::BEGIN_COLOR)+2; // +2 for 2 vectors of normals + static const unsigned int NB_VBO_BUFFERS=(GS::END_POS-GS::BEGIN_POS)+ + (GS::END_COLOR-GS::BEGIN_COLOR)+2; // +2 for 2 vectors of normals QGLBuffer buffers[NB_VBO_BUFFERS]; @@ -1667,7 +1669,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; template -void draw_graphic_storage(Graphic_storage& graphic_buffer, +void draw_graphic_storage(Graphic_storage& graphic_storage, const char *title="CGAL Basic Viewer") { #if defined(CGAL_TEST_SUITE) @@ -1684,7 +1686,7 @@ void draw_graphic_storage(Graphic_storage& graphic_buffer, const char *argv[2] = {title, nullptr}; QApplication app(argc, const_cast(argv)); Basic_viewer_qt basic_viewer(app.activeWindow(), - graphic_buffer, title); + graphic_storage, title); basic_viewer.show(); app.exec(); 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 01cfb7fd5ffd..1334cf8e7537 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -61,7 +61,7 @@ template void compute_face(const LCC& lcc, typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctorLCC& drawing_functor) { if (!drawing_functor.are_faces_enabled() || @@ -80,32 +80,32 @@ void compute_face(const LCC& lcc, if (drawing_functor.colored_volume(lcc, voldh)) { - graphic_buffer.face_begin(drawing_functor.volume_color(lcc, voldh)); + graphic_storage.face_begin(drawing_functor.volume_color(lcc, voldh)); } else if (drawing_functor.colored_face(lcc, dh)) { - graphic_buffer.face_begin(drawing_functor.face_color(lcc, dh)); + graphic_storage.face_begin(drawing_functor.face_color(lcc, dh)); } else - { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(); } cur=dh; do { - graphic_buffer.add_point_in_face + graphic_storage.add_point_in_face (lcc.point(cur), LCC_geom_utils::get_vertex_normal(lcc, cur)); cur=lcc.next(cur); } while (cur!=dh); - graphic_buffer.face_end(); + graphic_storage.face_end(); } template void compute_edge(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (!drawing_functor.are_edges_enabled() || @@ -118,18 +118,18 @@ void compute_edge(const LCC& lcc, { if (drawing_functor.colored_edge(lcc, dh)) { - graphic_buffer.add_segment(p1, lcc.point(d2), + graphic_storage.add_segment(p1, lcc.point(d2), drawing_functor.edge_color(lcc, dh)); } else - { graphic_buffer.add_segment(p1, lcc.point(d2)); } + { graphic_storage.add_segment(p1, lcc.point(d2)); } } } template void compute_vertex(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctorLCC& drawing_functor) { if (!drawing_functor.are_vertices_enabled() || @@ -138,16 +138,16 @@ void compute_vertex(const LCC& lcc, if (drawing_functor.colored_vertex(lcc, dh)) { - graphic_buffer.add_point(lcc.point(dh), + graphic_storage.add_point(lcc.point(dh), drawing_functor.vertex_color(lcc, dh)); } else - { graphic_buffer.add_point(lcc.point(dh)); } + { graphic_storage.add_point(lcc.point(dh)); } } template void compute_elements(const LCC& lcc, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { typename LCC::size_type markvolumes = lcc.get_new_mark(); @@ -178,7 +178,7 @@ void compute_elements(const LCC& lcc, (!lcc.template is_free<3>(itv) && !drawing_functor.volume_wireframe(lcc, lcc.template opposite<3>(itv)))) && !drawing_functor.face_wireframe(lcc, itv)) - { compute_face(lcc, itv, it, graphic_buffer, drawing_functor); } + { compute_face(lcc, itv, it, graphic_storage, drawing_functor); } for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator itf=lcc.template darts_of_cell_basic<2>(itv, markfaces).begin(), itfend=lcc.template darts_of_cell_basic<2>(itv, markfaces).end(); @@ -188,7 +188,7 @@ void compute_elements(const LCC& lcc, if (!lcc.is_marked(itf, markedges) && drawing_functor.draw_edge(lcc, itf)) { - compute_edge(lcc, itf, graphic_buffer, drawing_functor); + compute_edge(lcc, itf, graphic_storage, drawing_functor); for(typename LCC::template Dart_of_cell_basic_range<1>::const_iterator ite=lcc.template darts_of_cell_basic<1>(itf, markedges).begin(), iteend=lcc.template darts_of_cell_basic<1>(itf, markedges).end(); @@ -198,7 +198,7 @@ void compute_elements(const LCC& lcc, if (!lcc.is_marked(ite, markvertices) && drawing_functor.draw_vertex(lcc, ite)) { - compute_vertex(lcc, ite, graphic_buffer, drawing_functor); + compute_vertex(lcc, ite, graphic_storage, drawing_functor); CGAL::mark_cell(lcc, ite, markvertices); } } @@ -240,11 +240,11 @@ template void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { draw_function_for_lcc::compute_elements(static_cast(alcc), - graphic_buffer, drawing_functor); + graphic_storage, drawing_functor); } // add_in_graphic_storage: to add a LCC in the given graphic buffer, without a @@ -254,7 +254,7 @@ template class Map, class Refs, class Storage_, typename BufferType=float> void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, - CGAL::Graphic_storage& graphic_buffer) + CGAL::Graphic_storage& graphic_storage) { CGAL::Drawing_functor_with_volume& _graphic_buffer, + CGAL::Graphic_storage& _graphic_storage, const DrawingFunctor&_drawing_functor) : n_faces(0), n_edges(0), nef(_nef), - graphic_buffer(_graphic_buffer), + graphic_storage(_graphic_storage), drawing_functor(_drawing_functor) {} @@ -110,10 +110,10 @@ class Nef_Visitor { { return; } if(drawing_functor.colored_vertex(nef, vh)) - { graphic_buffer.add_point(vh->point(), + { graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(nef, vh)); } else - { graphic_buffer.add_point(vh->point()); } + { graphic_storage.add_point(vh->point()); } } void visit(Halffacet_const_handle opposite_facet) @@ -135,9 +135,9 @@ class Nef_Visitor { { return; } //return if not-shalfedge if(drawing_functor.colored_face(nef, f)) - { graphic_buffer.face_begin(drawing_functor.face_color(nef, f)); } + { graphic_storage.face_begin(drawing_functor.face_color(nef, f)); } else - { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(); } SHalfedge_around_facet_const_circulator hc_start(se); SHalfedge_around_facet_const_circulator hc_end(hc_start); @@ -146,7 +146,7 @@ class Nef_Visitor { { Vertex_const_handle vh=hc_start->source()->center_vertex(); lastvh=vh; - graphic_buffer.add_point_in_face(vh->point(), + graphic_storage.add_point_in_face(vh->point(), get_vertex_normal(vh)); } @@ -160,18 +160,18 @@ class Nef_Visitor { CGAL_For_all(hc_start, hc_end) { Vertex_const_handle vh=hc_start->source()->center_vertex(); - graphic_buffer.add_point_in_face(vh->point(), + graphic_storage.add_point_in_face(vh->point(), get_vertex_normal(vh)); } - graphic_buffer.add_point_in_face(hc_start->source()->center_vertex()->point(), + graphic_storage.add_point_in_face(hc_start->source()->center_vertex()->point(), get_vertex_normal (hc_start->source()->center_vertex())); - graphic_buffer.add_point_in_face(lastvh->point(), + graphic_storage.add_point_in_face(lastvh->point(), get_vertex_normal(lastvh)); ++fc; } - graphic_buffer.face_end(); + graphic_storage.face_end(); facets_done[f]=true; ++n_faces; } @@ -188,10 +188,10 @@ class Nef_Visitor { { return; } // Edge already added if(drawing_functor.colored_edge(nef, he)) - { graphic_buffer.add_segment(he->source()->point(), he->target()->point(), + { graphic_storage.add_segment(he->source()->point(), he->target()->point(), drawing_functor.edge_color(nef, he)); } else - { graphic_buffer.add_segment(he->source()->point(), he->target()->point()); } + { graphic_storage.add_segment(he->source()->point(), he->target()->point()); } edges_done[he]=true; ++n_edges; } @@ -204,14 +204,14 @@ class Nef_Visitor { protected: std::unordered_map facets_done; std::unordered_map edges_done; - CGAL::Graphic_storage& graphic_buffer; + CGAL::Graphic_storage& graphic_storage; const DrawingFunctor& drawing_functor; const Nef_Polyhedron& nef; }; template void compute_elements(const Nef_Polyhedron &nef, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor &drawing_functor) { @@ -221,7 +221,7 @@ void compute_elements(const Nef_Polyhedron &nef, Volume_const_iterator c; Nef_Visitor - V(nef, graphic_buffer, drawing_functor); + V(nef, graphic_storage, drawing_functor); CGAL_forall_volumes(c, nef) { Shell_entry_const_iterator it; @@ -229,7 +229,7 @@ void compute_elements(const Nef_Polyhedron &nef, { nef.visit_shell_objects(SFace_const_handle(it), V); } } - graphic_buffer.negate_all_normals(); + graphic_storage.negate_all_normals(); } } // namespace draw_function_for_nef_polyhedron @@ -240,18 +240,18 @@ void compute_elements(const Nef_Polyhedron &nef, template void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor &drawing_functor) { draw_function_for_nef_polyhedron::compute_elements(anef, - graphic_buffer, + graphic_storage, drawing_functor); } template void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, - CGAL::Graphic_storage &graphic_buffer) + CGAL::Graphic_storage &graphic_storage) { // Default functor; user can add his own functor. Drawing_functor void compute_vertex(const P2T2 &p2t2, typename P2T2::Periodic_point_iterator pi, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { // Construct the point in 9-sheeted covering space and add to viewer @@ -77,16 +77,16 @@ void compute_vertex(const P2T2 &p2t2, { return; } if(drawing_functor.colored_vertex(p2t2, pi)) - { graphic_buffer.add_point(p2t2.point(*pi), + { graphic_storage.add_point(p2t2.point(*pi), drawing_functor.vertex_color(p2t2, pi)); } else - { graphic_buffer.add_point(p2t2.point(*pi)); } + { graphic_storage.add_point(p2t2.point(*pi)); } } template void compute_edge(const P2T2 &p2t2, typename P2T2::Periodic_segment_iterator si, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if(!drawing_functor.draw_edge(p2t2, si)) @@ -95,16 +95,16 @@ void compute_edge(const P2T2 &p2t2, // Construct the segment in 9-sheeted covering space and add to viewer typename P2T2::Segment s(p2t2.segment(*si)); if(drawing_functor.colored_edge(p2t2, si)) - { graphic_buffer.add_segment(s[0], s[1], + { graphic_storage.add_segment(s[0], s[1], drawing_functor.edge_color(p2t2, si)); } else - { graphic_buffer.add_segment(s[0], s[1]); } + { graphic_storage.add_segment(s[0], s[1]); } } template void compute_face(const P2T2 &p2t2, typename P2T2::Periodic_triangle_iterator ti, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if(!drawing_functor.draw_face(p2t2, ti)) @@ -114,19 +114,19 @@ void compute_face(const P2T2 &p2t2, typename P2T2::Triangle t(p2t2.triangle(*ti)); if(drawing_functor.colored_face(p2t2, ti)) - { graphic_buffer.face_begin(drawing_functor.face_color(p2t2, ti)); } + { graphic_storage.face_begin(drawing_functor.face_color(p2t2, ti)); } else - { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(); } - graphic_buffer.add_point_in_face(t[0]); - graphic_buffer.add_point_in_face(t[1]); - graphic_buffer.add_point_in_face(t[2]); - graphic_buffer.face_end(); + graphic_storage.add_point_in_face(t[0]); + graphic_storage.add_point_in_face(t[1]); + graphic_storage.add_point_in_face(t[2]); + graphic_storage.face_end(); } template void compute_domain(const P2T2& p2t2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -145,17 +145,17 @@ void compute_domain(const P2T2& p2t2, Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin()); Kernel::Point_2 p4((orig_domain.max)()); - graphic_buffer.add_segment(p1 + shift, p2 + shift, drawing_functor.domain_color); - graphic_buffer.add_segment(p1 + shift, p3 + shift, drawing_functor.domain_color); - graphic_buffer.add_segment(p2 + shift, p4 + shift, drawing_functor.domain_color); - graphic_buffer.add_segment(p3 + shift, p4 + shift, drawing_functor.domain_color); + graphic_storage.add_segment(p1 + shift, p2 + shift, drawing_functor.domain_color); + graphic_storage.add_segment(p1 + shift, p3 + shift, drawing_functor.domain_color); + graphic_storage.add_segment(p2 + shift, p4 + shift, drawing_functor.domain_color); + graphic_storage.add_segment(p3 + shift, p4 + shift, drawing_functor.domain_color); } } } template void compute_elements(const P2T2& p2t2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { // Get the display type, iterate through periodic elements according @@ -168,27 +168,27 @@ void compute_elements(const P2T2& p2t2, { for (typename P2T2::Periodic_point_iterator it=p2t2.periodic_points_begin(it_type); it!=p2t2.periodic_points_end(it_type); ++it) - { compute_vertex(p2t2, it, graphic_buffer, drawing_functor); } + { compute_vertex(p2t2, it, graphic_storage, drawing_functor); } } if(drawing_functor.are_edges_enabled()) { for (typename P2T2::Periodic_segment_iterator it=p2t2.periodic_segments_begin(it_type); it!=p2t2.periodic_segments_end(it_type); ++it) - { compute_edge(p2t2, it, graphic_buffer, drawing_functor); } + { compute_edge(p2t2, it, graphic_storage, drawing_functor); } } if (drawing_functor.are_faces_enabled()) { for (typename P2T2::Periodic_triangle_iterator it=p2t2.periodic_triangles_begin(it_type); it!=p2t2.periodic_triangles_end(it_type); ++it) - { compute_face(p2t2, it, graphic_buffer, drawing_functor); } + { compute_face(p2t2, it, graphic_storage, drawing_functor); } } if(drawing_functor.get_draw_domain()) { // Compute the (9-sheet covering space) domain of the periodic triangulation - compute_domain(p2t2, graphic_buffer, drawing_functor); + compute_domain(p2t2, graphic_storage, drawing_functor); } } @@ -198,15 +198,15 @@ void compute_elements(const P2T2& p2t2, template void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { - draw_function_for_P2T2::compute_elements(p2t2, graphic_buffer, drawing_functor); + draw_function_for_P2T2::compute_elements(p2t2, graphic_storage, drawing_functor); } template void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphic_storage& graphic_buffer) + CGAL::Graphic_storage& graphic_storage) { CGAL::Drawing_functor_periodic_2_triangulation_2 drawing_functor; - add_in_graphic_storage(p2t2, graphic_buffer, drawing_functor); + add_in_graphic_storage(p2t2, graphic_storage, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER @@ -260,7 +260,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, "Unique cover")))); basic_viewer->clear(); draw_function_for_P2T2::compute_elements(ap2t2, - basic_viewer->get_graphic_buffer(), + basic_viewer->get_graphic_storage(), drawing_functor); basic_viewer->redraw(); } 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 144417fb1dcf..32685b4b1acb 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -44,7 +44,7 @@ namespace draw_function_for_PointSet { template void compute_elements(const PointSet& pointset, - Graphic_storage& graphic_buffer, + Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (!drawing_functor.are_vertices_enabled()) @@ -57,11 +57,11 @@ void compute_elements(const PointSet& pointset, { if (drawing_functor.colored_vertex(pointset, it)) { - graphic_buffer.add_point(pointset.point(*it), + graphic_storage.add_point(pointset.point(*it), drawing_functor.vertex_color(pointset, it)); } else - { graphic_buffer.add_point(pointset.point(*it)); } + { graphic_storage.add_point(pointset.point(*it)); } } } } @@ -70,22 +70,22 @@ void compute_elements(const PointSet& pointset, template void add_in_graphic_storage(const Point_set_3& apointset, - Graphic_storage& graphic_buffer, + Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { draw_function_for_PointSet::compute_elements(apointset, - graphic_buffer, + graphic_storage, drawing_functor); } template void add_in_graphic_storage(const Point_set_3& apointset, - Graphic_storage& graphic_buffer) + Graphic_storage& graphic_storage) { CGAL::Drawing_functor, typename Point_set_3::const_iterator, int, int> drawing_functor; - add_in_graphic_storage(apointset, graphic_buffer, drawing_functor); + add_in_graphic_storage(apointset, graphic_storage, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 20897bdb9f86..cad954ab5df4 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -48,7 +48,7 @@ namespace draw_function_for_p2 { template void compute_elements(const P2& p2, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor& drawing_functor) { if (p2.is_empty()) @@ -59,9 +59,9 @@ void compute_elements(const P2& p2, if (drawing_functor.are_faces_enabled()) { if(drawing_functor.colored_face(p2, nullptr)) - { graphic_buffer.face_begin(drawing_functor.face_color(p2, nullptr)); } + { graphic_storage.face_begin(drawing_functor.face_color(p2, nullptr)); } else - { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(); } } for (typename P2::Vertex_const_iterator i=p2.vertices_begin(); @@ -71,28 +71,28 @@ void compute_elements(const P2& p2, drawing_functor.draw_vertex(p2, i)) { // Add vertex if(drawing_functor.colored_vertex(p2, i)) - { graphic_buffer.add_point(*i, drawing_functor.vertex_color(p2, i)); } + { graphic_storage.add_point(*i, drawing_functor.vertex_color(p2, i)); } else - { graphic_buffer.add_point(*i); } + { graphic_storage.add_point(*i); } } if(drawing_functor.are_edges_enabled() && drawing_functor.draw_edge(p2, i)) { // Add edge with previous point if(drawing_functor.colored_vertex(p2, i)) - { graphic_buffer.add_segment(prev, *i, drawing_functor.edge_color(p2, i)); } + { graphic_storage.add_segment(prev, *i, drawing_functor.edge_color(p2, i)); } else - { graphic_buffer.add_segment(prev, *i); } + { graphic_storage.add_segment(prev, *i); } } if(drawing_functor.are_faces_enabled()) - { graphic_buffer.add_point_in_face(*i); } // Add point in face + { graphic_storage.add_point_in_face(*i); } // Add point in face prev = *i; } if (drawing_functor.are_faces_enabled()) - { graphic_buffer.face_end(); } + { graphic_storage.face_end(); } } } // namespace draw_function_for_p2 @@ -103,19 +103,19 @@ void compute_elements(const P2& p2, template void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawingfunctor) -{ draw_function_for_p2::compute_elements(ap2, graphic_buffer, drawingfunctor); } +{ draw_function_for_p2::compute_elements(ap2, graphic_storage, drawingfunctor); } template void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, - CGAL::Graphic_storage &graphic_buffer) + CGAL::Graphic_storage &graphic_storage) { CGAL::Drawing_functor drawingfunctor; - draw_function_for_p2::compute_elements(ap2, graphic_buffer, drawingfunctor); + draw_function_for_p2::compute_elements(ap2, graphic_storage, drawingfunctor); } // Specialization of draw function. diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index b04fd60ba0a6..5f47eb710cc4 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -49,12 +49,12 @@ namespace draw_function_for_ph2_with_holes { template void compute_one_loop_elements(const P2& ap2, const typename P2::General_polygon_2& aloop, - Graphic_storage &graphic_buffer, + Graphic_storage &graphic_storage, bool hole, const DrawingFunctor& drawing_functor) { if (hole && drawing_functor.are_faces_enabled()) - { graphic_buffer.add_point_in_face(aloop.vertex(aloop.size()-1)); } + { graphic_storage.add_point_in_face(aloop.vertex(aloop.size()-1)); } typename P2::General_polygon_2::Vertex_const_iterator prev; for(typename P2::General_polygon_2::Vertex_const_iterator i=aloop.vertices_begin(); @@ -64,9 +64,9 @@ void compute_one_loop_elements(const P2& ap2, drawing_functor.draw_vertex(ap2, i)) { // Add vertex if(drawing_functor.colored_vertex(ap2, i)) - { graphic_buffer.add_point(*i, drawing_functor.vertex_color(ap2, i)); } + { graphic_storage.add_point(*i, drawing_functor.vertex_color(ap2, i)); } else - { graphic_buffer.add_point(*i); } + { graphic_storage.add_point(*i); } } if(i!=aloop.vertices_begin() && @@ -74,13 +74,13 @@ void compute_one_loop_elements(const P2& ap2, drawing_functor.draw_edge(ap2, i)) { // Add segment with previous point if(drawing_functor.colored_vertex(ap2, i)) - { graphic_buffer.add_segment(*prev, *i, drawing_functor.edge_color(ap2, i)); } + { graphic_storage.add_segment(*prev, *i, drawing_functor.edge_color(ap2, i)); } else - { graphic_buffer.add_segment(*prev, *i); } + { graphic_storage.add_segment(*prev, *i); } } if(drawing_functor.are_faces_enabled()) - { graphic_buffer.add_point_in_face(*i); } // Add point in face + { graphic_storage.add_point_in_face(*i); } // Add point in face prev=i; } @@ -88,11 +88,11 @@ void compute_one_loop_elements(const P2& ap2, // Add the last segment between the last point and the first one if(drawing_functor.are_edges_enabled() && drawing_functor.draw_edge(ap2, aloop.vertices_begin())) - { graphic_buffer.add_segment(*prev, *(aloop.vertices_begin())); } + { graphic_storage.add_segment(*prev, *(aloop.vertices_begin())); } } template -void compute_elements(const P2& p2, Graphic_storage &graphic_buffer, +void compute_elements(const P2& p2, Graphic_storage &graphic_storage, const DrawingFunctor& drawing_functor) { if (p2.outer_boundary().is_empty()) return; @@ -100,26 +100,26 @@ void compute_elements(const P2& p2, Graphic_storage &graphic_buffer, if (drawing_functor.are_faces_enabled()) { if(drawing_functor.colored_face(p2, nullptr)) - { graphic_buffer.face_begin(drawing_functor.face_color(p2, nullptr)); } + { graphic_storage.face_begin(drawing_functor.face_color(p2, nullptr)); } else - { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(); } } - compute_one_loop_elements(p2, p2.outer_boundary(), graphic_buffer, + compute_one_loop_elements(p2, p2.outer_boundary(), graphic_storage, false, drawing_functor); for (typename P2::Hole_const_iterator it=p2.holes_begin(); it!=p2.holes_end(); ++it) { - compute_one_loop_elements(p2, *it, graphic_buffer, + compute_one_loop_elements(p2, *it, graphic_storage, true, drawing_functor); if (drawing_functor.are_faces_enabled()) - { graphic_buffer.add_point_in_face(p2.outer_boundary().vertex + { graphic_storage.add_point_in_face(p2.outer_boundary().vertex (p2.outer_boundary().size()-1)); } } if (drawing_functor.are_faces_enabled()) - { graphic_buffer.face_end(); } + { graphic_storage.face_end(); } } } // draw_function_for_ph2 @@ -128,23 +128,23 @@ void compute_elements(const P2& p2, Graphic_storage &graphic_buffer, template void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor &drawing_functor) { - draw_function_for_ph2_with_holes::compute_elements(p2, graphic_buffer, + draw_function_for_ph2_with_holes::compute_elements(p2, graphic_storage, drawing_functor); } template void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphic_storage& graphic_buffer) + CGAL::Graphic_storage& graphic_storage) { Drawing_functor drawing_functor; - add_in_graphic_storage(p2, graphic_buffer, drawing_functor); + add_in_graphic_storage(p2, graphic_storage, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 8e7b1788afeb..5157e5d0fa6b 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -35,9 +35,9 @@ template void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor &drawing_functor) -{ add_in_graphic_storage_for_fg(apoly, graphic_buffer, drawing_functor); } +{ add_in_graphic_storage_for_fg(apoly, graphic_storage, drawing_functor); } template void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, - CGAL::Graphic_storage &graphic_buffer) -{ add_in_graphic_storage_for_fg(apoly, graphic_buffer); } + CGAL::Graphic_storage &graphic_storage) +{ add_in_graphic_storage_for_fg(apoly, graphic_storage); } // Specialization of draw function: require Qt and the CGAL basic viewer. #ifdef CGAL_USE_BASIC_VIEWER diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 9b4fcddf3926..a68fb77c38c4 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -26,7 +26,7 @@ namespace draw_function_for_ss2 { template void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_edge(ss2, eh)) @@ -34,13 +34,13 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, if (drawing_functor.colored_edge(ss2, eh)) { - graphic_buffer.add_segment(eh->opposite()->vertex()->point(), + graphic_storage.add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), drawing_functor.edge_color(ss2, eh)); } else { - graphic_buffer.add_segment(eh->opposite()->vertex()->point(), + graphic_storage.add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point()); } } @@ -48,7 +48,7 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, template void print_halfedge_labels(const SS2& ss2, typename SS2::Halfedge_const_handle h, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { // TODO? a functor different from draw_edge to allow to show only some labels ?? @@ -60,14 +60,14 @@ void print_halfedge_labels(const SS2& ss2, label << "H" << h->opposite()->id() << " (V" << h->opposite()->vertex()->id() << ") "; - graphic_buffer.add_text( + graphic_storage.add_text( CGAL::midpoint(h->opposite()->vertex()->point(), h->vertex()->point()), label.str()); } template void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_vertex(ss2, vh)) @@ -75,16 +75,16 @@ void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, if (drawing_functor.colored_vertex(ss2, vh)) { - graphic_buffer.add_point(vh->point(), drawing_functor.vertex_color(ss2, vh)); + graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(ss2, vh)); } else - { graphic_buffer.add_point(vh->point()); } + { graphic_storage.add_point(vh->point()); } } template void print_vertex_label(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { // TODO? a functor different from draw_vertex to allow to show only some labels ?? @@ -93,12 +93,12 @@ void print_vertex_label(const SS2& ss2, std::stringstream label; label << "V" << vh->id() << std::ends; - graphic_buffer.add_text(vh->point(), label.str()); + graphic_storage.add_text(vh->point(), label.str()); } template void compute_elements(const SS2& ss2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (!drawing_functor.are_edges_enabled()) @@ -108,8 +108,8 @@ void compute_elements(const SS2& ss2, { if (it->id()opposite()->id()) { - compute_edge(ss2, it, graphic_buffer, drawing_functor); - print_halfedge_labels(ss2, it, graphic_buffer, drawing_functor); + compute_edge(ss2, it, graphic_storage, drawing_functor); + print_halfedge_labels(ss2, it, graphic_storage, drawing_functor); } } } @@ -119,8 +119,8 @@ void compute_elements(const SS2& ss2, for (typename SS2::Vertex_const_iterator it=ss2.vertices_begin(); it!=ss2.vertices_end(); ++it) { - compute_vertex(ss2, it, graphic_buffer, drawing_functor); - print_vertex_label(ss2, it, graphic_buffer, drawing_functor); + compute_vertex(ss2, it, graphic_storage, drawing_functor); + print_vertex_label(ss2, it, graphic_storage, drawing_functor); } } } @@ -131,16 +131,16 @@ void compute_elements(const SS2& ss2, template void add_in_graphic_storage(const CGAL_SS_TYPE &ass2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { - draw_function_for_ss2::compute_elements(ass2, graphic_buffer, + draw_function_for_ss2::compute_elements(ass2, graphic_storage, drawing_functor); } template void add_in_graphic_storage(const CGAL_SS_TYPE& ass2, - CGAL::Graphic_storage& graphic_buffer) + CGAL::Graphic_storage& graphic_storage) { Drawing_functor void add_in_graphic_storage(const Surface_mesh& amesh, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor &drawing_functor) -{ add_in_graphic_storage_for_fg(amesh, graphic_buffer, drawing_functor); } +{ add_in_graphic_storage_for_fg(amesh, graphic_storage, drawing_functor); } template void add_in_graphic_storage(const Surface_mesh& amesh, - CGAL::Graphic_storage &graphic_buffer) -{ add_in_graphic_storage_for_fg(amesh, graphic_buffer); } + CGAL::Graphic_storage &graphic_storage) +{ add_in_graphic_storage_for_fg(amesh, graphic_storage); } #ifdef CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 8eecc3b4f0b0..9c557b81f6a0 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -145,7 +145,7 @@ template void compute_face(const Mesh& mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, DrawingFunctor& drawing_functor) { if(!drawing_functor.draw_face(lcc, dh)) @@ -171,21 +171,21 @@ void compute_face(const Mesh& mesh, while(cur!=dh); if(drawing_functor.colored_face(lcc, dh)) - { graphic_buffer.face_begin(drawing_functor.face_color(lcc, dh)); } + { graphic_storage.face_begin(drawing_functor.face_color(lcc, dh)); } else - { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(); } cur=dh; do { - graphic_buffer.add_point_in_face(draw_function_for_face_graph_with_paths::get_point(mesh, cur), + graphic_storage.add_point_in_face(draw_function_for_face_graph_with_paths::get_point(mesh, cur), draw_function_for_lcc::LCC_geom_utils:: get_vertex_normal(lcc, cur)); cur=lcc.next(cur); } while(cur!=dh); - graphic_buffer.face_end(); + graphic_storage.face_end(); } template @@ -193,7 +193,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, typename Get_map::type::size_type m_amark, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, DrawingFunctor& drawing_functor, bool draw_marked_darts=true) { @@ -213,9 +213,9 @@ void compute_edge(const Mesh &mesh, { if (m_draw_marked_darts && m_amark!=LCC::INVALID_MARK && (lcc.is_marked(dh, m_amark) || lcc.is_marked(lcc.opposite2(dh), m_amark))) - { graphic_buffer.add_segment(p1, get_point(mesh, d2), CGAL::IO::Color(0, 0, 255)); } + { graphic_storage.add_segment(p1, get_point(mesh, d2), CGAL::IO::Color(0, 0, 255)); } else - { graphic_buffer.add_segment(p1, get_point(mesh, d2)); } + { graphic_storage.add_segment(p1, get_point(mesh, d2)); } } } @@ -224,7 +224,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, const CGAL::IO::Color& color, - CGAL::Graphic_storage& graphic_buffer) + CGAL::Graphic_storage& graphic_storage) { typedef typename Get_map::type LCC; typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; @@ -235,25 +235,25 @@ void compute_edge(const Mesh &mesh, Point p1=get_point(mesh, dh); Dart_const_descriptor d2=lcc.other_extremity(dh); if (d2!=LCC::null_descriptor) - { graphic_buffer.add_segment(p1, get_point(mesh, d2), color); } + { graphic_storage.add_segment(p1, get_point(mesh, d2), color); } } template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, DrawingFunctor& drawing_functor) { typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - graphic_buffer.add_point(get_point(mesh, dh)); + graphic_storage.add_point(get_point(mesh, dh)); } template void compute_path(const Mesh &mesh, const typename Get_map::storage_type& lcc, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const std::vector>* m_paths, std::size_t i, typename Get_map::type::size_type amark) @@ -269,12 +269,12 @@ void compute_path(const Mesh &mesh, CGAL::Random random(static_cast(i)); CGAL::IO::Color color = get_random_color(random); - graphic_buffer.add_point(get_point(mesh, (*m_paths)[i].get_ith_dart(0)), color); + graphic_storage.add_point(get_point(mesh, (*m_paths)[i].get_ith_dart(0)), color); for (std::size_t j=0; j<(*m_paths)[i].length(); ++j) { if ( !lcc.is_marked( (*m_paths)[i].get_ith_dart(j), amark) ) { - compute_edge(mesh, lcc, (*m_paths)[i].get_ith_dart(j), color, mesh, graphic_buffer, lcc); + compute_edge(mesh, lcc, (*m_paths)[i].get_ith_dart(j), color, mesh, graphic_storage, lcc); lcc.template mark_cell<1>((*m_paths)[i].get_ith_dart(j), amark); } } @@ -282,7 +282,7 @@ void compute_path(const Mesh &mesh, template void compute_elements(const Mesh &mesh, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor &m_drawing_functor, const std::vector>* m_paths, typename Get_map::type::size_type amark) @@ -311,19 +311,19 @@ void compute_elements(const Mesh &mesh, if (m_current_dart!=lcc.darts().end()) { // We want to draw only one dart Dart_const_descriptor selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); - compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphic_buffer, lcc); + compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphic_storage, lcc); lcc.template mark_cell<1>(selected_dart, markedges); - compute_vertex(selected_dart, mesh, graphic_buffer); + compute_vertex(selected_dart, mesh, graphic_storage); if ( !m_nofaces ) - { compute_face(selected_dart, mesh, graphic_buffer, lcc); } + { compute_face(selected_dart, mesh, graphic_storage, lcc); } for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), itend=lcc.darts().end(); it!=itend; ++it ) { if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphic_buffer, lcc, m_amark, m_draw_marked_darts); + compute_edge(it, mesh, graphic_storage, lcc, m_amark, m_draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } } @@ -333,10 +333,10 @@ void compute_elements(const Mesh &mesh, if (m_current_path==m_paths->size()) { for (std::size_t i=0; isize(); ++i) - { compute_path(i, markedges, mesh, graphic_buffer, m_paths, lcc); } + { compute_path(i, markedges, mesh, graphic_storage, m_paths, lcc); } } else if (m_current_path!=m_paths->size()+1) - { compute_path(m_current_path, markedges, mesh, graphic_buffer, m_paths, lcc); } + { compute_path(m_current_path, markedges, mesh, graphic_storage, m_paths, lcc); } for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), itend=lcc.darts().end(); it!=itend; ++it ) @@ -344,19 +344,19 @@ void compute_elements(const Mesh &mesh, if (!m_nofaces && !lcc.is_marked(it, markfaces) && !lcc.is_perforated(it) && lcc.is_marked(it, m_oriented_mark)) { - compute_face(it, mesh, graphic_buffer, lcc); + compute_face(it, mesh, graphic_storage, lcc); lcc.template mark_cell<2>(it, markfaces); } if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphic_buffer, lcc, m_amark, m_draw_marked_darts); + compute_edge(it, mesh, graphic_storage, lcc, m_amark, m_draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } if ( !lcc.is_marked(it, markvertices) ) { - compute_vertex(it, mesh, graphic_buffer); + compute_vertex(it, mesh, graphic_storage); lcc.template mark_cell<0>(it, markvertices); } } @@ -371,21 +371,21 @@ void compute_elements(const Mesh &mesh, template void add_in_graphic_storage(const Mesh& mesh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const std::vector>* paths, const DrawingFunctor& drawing_functor, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) { draw_function_for_face_graph_with_paths::compute_elements(mesh, - graphic_buffer, + graphic_storage, drawing_functor, paths, amark); } template void add_in_graphic_storage(const Mesh& mesh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const std::vector>* paths, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) @@ -397,7 +397,7 @@ void add_in_graphic_storage(const Mesh& mesh, typename Get_map::type::Dart_const_descriptor /*fh*/> drawing_functor; - add_in_graphic_storage(mesh, graphic_buffer, drawing_functor, paths, amark); + add_in_graphic_storage(mesh, graphic_storage, drawing_functor, paths, amark); } #ifdef 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 8d17d21accb0..9a4166eebc67 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -27,27 +27,27 @@ namespace draw_function_for_t2 { template void compute_face(const T2& t2, typename T2::Finite_faces_iterator fh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_face(t2, fh)) { return; } if (drawing_functor.colored_face(t2, fh)) - { graphic_buffer.face_begin(drawing_functor.face_color(t2, fh)); } + { graphic_storage.face_begin(drawing_functor.face_color(t2, fh)); } else - { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(); } - graphic_buffer.add_point_in_face(fh->vertex(0)->point()); - graphic_buffer.add_point_in_face(fh->vertex(1)->point()); - graphic_buffer.add_point_in_face(fh->vertex(2)->point()); + graphic_storage.add_point_in_face(fh->vertex(0)->point()); + graphic_storage.add_point_in_face(fh->vertex(1)->point()); + graphic_storage.add_point_in_face(fh->vertex(2)->point()); - graphic_buffer.face_end(); + graphic_storage.face_end(); } template void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_edge(t2, eh)) @@ -55,14 +55,14 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, if (drawing_functor.colored_edge(t2, eh)) { - graphic_buffer.add_segment + graphic_storage.add_segment (eh->first->vertex(eh->first->cw(eh->second))->point(), eh->first->vertex(eh->first->ccw(eh->second))->point(), drawing_functor.edge_color(t2, eh)); } else { - graphic_buffer.add_segment + graphic_storage.add_segment (eh->first->vertex(eh->first->cw(eh->second))->point(), eh->first->vertex(eh->first->ccw(eh->second))->point()); } @@ -70,7 +70,7 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, template void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (!drawing_functor.draw_vertex(t2, vh)) @@ -78,38 +78,38 @@ void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, if (drawing_functor.colored_vertex(t2, vh)) { - graphic_buffer.add_point(vh->point(), drawing_functor.vertex_color(t2, vh)); + graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(t2, vh)); } else { - graphic_buffer.add_point(vh->point()); + graphic_storage.add_point(vh->point()); } } template void compute_elements(const T2& t2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (drawing_functor.are_faces_enabled()) { for (typename T2::Finite_faces_iterator it=t2.finite_faces_begin(); it!=t2.finite_faces_end(); ++it) - { compute_face(t2, it, graphic_buffer, drawing_functor); } + { compute_face(t2, it, graphic_storage, drawing_functor); } } if (drawing_functor.are_edges_enabled()) { for (typename T2::Finite_edges_iterator it=t2.finite_edges_begin(); it!=t2.finite_edges_end(); ++it) - { compute_edge(t2, it, graphic_buffer, drawing_functor); } + { compute_edge(t2, it, graphic_storage, drawing_functor); } } if (drawing_functor.are_vertices_enabled()) { for (typename T2::Finite_vertices_iterator it=t2.finite_vertices_begin(); it!=t2.finite_vertices_end(); ++it) - { compute_vertex(t2, it, graphic_buffer, drawing_functor); } + { compute_vertex(t2, it, graphic_storage, drawing_functor); } } } @@ -119,15 +119,15 @@ void compute_elements(const T2& t2, template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { - draw_function_for_t2::compute_elements(at2, graphic_buffer, drawing_functor); + draw_function_for_t2::compute_elements(at2, graphic_storage, drawing_functor); } template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, - CGAL::Graphic_storage& graphic_buffer) + CGAL::Graphic_storage& graphic_storage) { CGAL::Graphic_storage buffer; Drawing_functor void compute_face(typename T3::Finite_facets_iterator fh, const DrawingFunctor& drawing_functor, - CGAL::Graphic_storage& graphic_buffer, const T3 *t3) + CGAL::Graphic_storage& graphic_storage, const T3 *t3) { if(!drawing_functor.draw_face(*t3, fh)) { return; } if(drawing_functor.colored_face(*t3, fh)) - { graphic_buffer.face_begin(drawing_functor.face_color(*t3, fh)); } + { graphic_storage.face_begin(drawing_functor.face_color(*t3, fh)); } else - { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(); } - graphic_buffer.add_point_in_face(fh->first->vertex((fh->second + 1) % 4)-> + graphic_storage.add_point_in_face(fh->first->vertex((fh->second + 1) % 4)-> point()); - graphic_buffer.add_point_in_face(fh->first->vertex((fh->second + 2) % 4)-> + graphic_storage.add_point_in_face(fh->first->vertex((fh->second + 2) % 4)-> point()); - graphic_buffer.add_point_in_face(fh->first->vertex((fh->second + 3) % 4)-> + graphic_storage.add_point_in_face(fh->first->vertex((fh->second + 3) % 4)-> point()); - graphic_buffer.face_end(); + graphic_storage.face_end(); } template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor, const T3* t3) { if(!drawing_functor.draw_edge(*t3, eh)) @@ -58,19 +58,19 @@ void compute_edge(typename T3::Finite_edges_iterator eh, if(drawing_functor.colored_edge(*t3, eh)) { - graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), + graphic_storage.add_segment(eh->first->vertex(eh->second)->point(), eh->first->vertex(eh->third)->point(), drawing_functor.edge_color(*t3, eh)); } else { - graphic_buffer.add_segment(eh->first->vertex(eh->second)->point(), + graphic_storage.add_segment(eh->first->vertex(eh->second)->point(), eh->first->vertex(eh->third)->point()); } } template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor, const T3* t3) { if(!drawing_functor.draw_vertex(*t3, vh)) @@ -78,36 +78,36 @@ void compute_vertex(typename T3::Vertex_handle vh, if(drawing_functor.colored_vertex(*t3, vh)) { - graphic_buffer.add_point(vh->point(), drawing_functor.vertex_color(*t3, vh)); + graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(*t3, vh)); } else - { graphic_buffer.add_point(vh->point()); } + { graphic_storage.add_point(vh->point()); } } template void compute_elements(const T3* t3, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if (drawing_functor.are_faces_enabled()) { for (typename T3::Finite_facets_iterator it=t3->finite_facets_begin(); it!=t3->finite_facets_end(); ++it) - { compute_face(it, drawing_functor, graphic_buffer, t3); } + { compute_face(it, drawing_functor, graphic_storage, t3); } } if (drawing_functor.are_edges_enabled()) { for (typename T3::Finite_edges_iterator it=t3->finite_edges_begin(); it!=t3->finite_edges_end(); ++it) - { compute_edge(it, graphic_buffer,drawing_functor, t3); } + { compute_edge(it, graphic_storage,drawing_functor, t3); } } if (drawing_functor.are_vertices_enabled()) { for (typename T3::Finite_vertices_iterator it=t3->finite_vertices_begin(); it!=t3->finite_vertices_end(); ++it) - { compute_vertex(it, graphic_buffer, drawing_functor, t3); } + { compute_vertex(it, graphic_storage, drawing_functor, t3); } } } @@ -118,16 +118,16 @@ void compute_elements(const T3* t3, template void add_in_graphic_storage(const CGAL_T3_TYPE& at3, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { - draw_function_for_t3::compute_elements(&at3, graphic_buffer, drawing_functor); + draw_function_for_t3::compute_elements(&at3, graphic_storage, drawing_functor); } template void add_in_graphic_storage(const CGAL_T3_TYPE& at3, - CGAL::Graphic_storage& graphic_buffer) + CGAL::Graphic_storage& graphic_storage) { CGAL::Drawing_functor void compute_vertex(const V2& v2, typename V2::Vertex_iterator vh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if(!drawing_functor.draw_vertex(v2, vh)) { return; } if(drawing_functor.colored_vertex(v2, vh)) - { graphic_buffer.add_point(vh->point(), drawing_functor.vertex_color(v2, vh)); } + { graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(v2, vh)); } else - { graphic_buffer.add_point(vh->point()); } + { graphic_storage.add_point(vh->point()); } } template void compute_dual_vertex(const V2& /*v2*/, typename V2::Delaunay_graph::Finite_vertices_iterator vi, - CGAL::Graphic_storage &graphic_buffer, + CGAL::Graphic_storage &graphic_storage, const DrawingFunctor& drawing_functor) -{ graphic_buffer.add_point(vi->point(), drawing_functor.dual_vertex_color); } +{ graphic_storage.add_point(vi->point(), drawing_functor.dual_vertex_color); } template void add_segments_and_update_bounding_box(const V2& v2, typename V2::Halfedge_iterator he, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -104,12 +104,12 @@ void add_segments_and_update_bounding_box(const V2& v2, { if(drawing_functor.colored_edge(v2, he)) { - graphic_buffer.add_segment(he->source()->point(), he->target()->point(), + graphic_storage.add_segment(he->source()->point(), he->target()->point(), drawing_functor.edge_color(v2, he)); } else { - graphic_buffer.add_segment(he->source()->point(), he->target()->point()); + graphic_storage.add_segment(he->source()->point(), he->target()->point()); } } else @@ -127,10 +127,10 @@ void add_segments_and_update_bounding_box(const V2& v2, end_point = he->source()->point(); // update_bounding_box_for_ray(end_point, direction); - Local_point lp = graphic_buffer.get_local_point(end_point); - Local_vector lv = graphic_buffer.get_local_vector(direction); + Local_point lp = graphic_storage.get_local_point(end_point); + Local_vector lv = graphic_storage.get_local_vector(direction); CGAL::Bbox_3 b = (lp + lv).bbox(); - graphic_buffer.update_bounding_box(b); + graphic_storage.update_bounding_box(b); } } else if (he->is_bisector()) @@ -143,12 +143,12 @@ void add_segments_and_update_bounding_box(const V2& v2, // update_bounding_box_for_line(pointOnLine, direction, // perpendicularDirection); - Local_point lp = graphic_buffer.get_local_point(pointOnLine); - Local_vector lv = graphic_buffer.get_local_vector(direction); - Local_vector lpv = graphic_buffer.get_local_vector(perpendicularDirection); + Local_point lp = graphic_storage.get_local_point(pointOnLine); + Local_vector lv = graphic_storage.get_local_vector(direction); + Local_vector lpv = graphic_storage.get_local_vector(perpendicularDirection); CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); - graphic_buffer.update_bounding_box(b); + graphic_storage.update_bounding_box(b); } } } @@ -224,7 +224,7 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, template void compute_rays_and_bisectors(const V2&, typename V2::Halfedge_iterator he, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -239,39 +239,39 @@ void compute_rays_and_bisectors(const V2&, { if (he->has_source()) { - // add_ray_segment(he->source()->point(), get_second_point(he, graphic_buffer.get_bounding_box())); - graphic_buffer.add_ray(he->source()->point(), direction, drawing_functor.ray_color); + // add_ray_segment(he->source()->point(), get_second_point(he, graphic_storage.get_bounding_box())); + graphic_storage.add_ray(he->source()->point(), direction, drawing_functor.ray_color); } } else if (he->is_bisector()) { Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, (v1->point().y() + v2->point().y()) / 2); - graphic_buffer.add_line(pointOnLine, direction, drawing_functor.bisector_color); + graphic_storage.add_line(pointOnLine, direction, drawing_functor.bisector_color); } } template void compute_face(const V2& v2, typename V2::Face_iterator fh, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& m_drawing_functor) { if(fh->is_unbounded() || !m_drawing_functor.draw_face(v2, fh)) { return; } if(m_drawing_functor.colored_face(v2, fh)) - { graphic_buffer.face_begin(m_drawing_functor.face_color(v2, fh)); } - else { graphic_buffer.face_begin(); } + { graphic_storage.face_begin(m_drawing_functor.face_color(v2, fh)); } + else { graphic_storage.face_begin(); } typename V2::Ccb_halfedge_circulator ec_start=fh->ccb(); typename V2::Ccb_halfedge_circulator ec=ec_start; do { - graphic_buffer.add_point_in_face(ec->source()->point()); + graphic_storage.add_point_in_face(ec->source()->point()); } while (++ec!=ec_start); - graphic_buffer.face_end(); + graphic_storage.face_end(); // Test: for unbounded faces (??) // else { @@ -280,7 +280,7 @@ void compute_face(const V2& v2, // add_point_in_face(ec->source()->point()); // } // else{ - // add_point_in_face(get_second_point(ec->twin(), graphic_buffer.get_bounding_box())); + // add_point_in_face(get_second_point(ec->twin(), graphic_storage.get_bounding_box())); // } // } while(++ec != ec_start); // } @@ -288,7 +288,7 @@ void compute_face(const V2& v2, template void compute_elements(const V2& v2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& drawing_functor) { if(drawing_functor.are_vertices_enabled()) @@ -298,7 +298,7 @@ void compute_elements(const V2& v2, { for (typename V2::Vertex_iterator it=v2.vertices_begin(); it!=v2.vertices_end(); ++it) - { compute_vertex(v2, it, graphic_buffer, drawing_functor); } + { compute_vertex(v2, it, graphic_storage, drawing_functor); } } // Draw the dual vertices @@ -307,7 +307,7 @@ void compute_elements(const V2& v2, for (typename V2::Delaunay_graph::Finite_vertices_iterator it=v2.dual().finite_vertices_begin(); it!=v2.dual().finite_vertices_end(); ++it) - { compute_dual_vertex(v2, it, graphic_buffer, drawing_functor); } + { compute_dual_vertex(v2, it, graphic_storage, drawing_functor); } } } @@ -317,17 +317,17 @@ void compute_elements(const V2& v2, for (typename V2::Halfedge_iterator it=v2.halfedges_begin(); it!=v2.halfedges_end(); ++it) { add_segments_and_update_bounding_box(v2, it, - graphic_buffer, drawing_functor); } + graphic_storage, drawing_functor); } } for (typename V2::Halfedge_iterator it=v2.halfedges_begin(); it!=v2.halfedges_end(); ++it) - { compute_rays_and_bisectors(v2, it, graphic_buffer, drawing_functor); } + { compute_rays_and_bisectors(v2, it, graphic_storage, drawing_functor); } if (drawing_functor.are_faces_enabled()) { for (typename V2::Face_iterator it=v2.faces_begin(); it!=v2.faces_end(); ++it) - { compute_face(v2, it, graphic_buffer, drawing_functor); } + { compute_face(v2, it, graphic_storage, drawing_functor); } } } @@ -338,15 +338,15 @@ void compute_elements(const V2& v2, template void add_in_graphic_storage(const CGAL_VORONOI_TYPE &v2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& m_drawing_functor) { - draw_function_for_v2::compute_elements(v2, graphic_buffer, m_drawing_functor); + draw_function_for_v2::compute_elements(v2, graphic_storage, m_drawing_functor); } template void add_in_graphic_storage(const CGAL_VORONOI_TYPE& v2, - CGAL::Graphic_storage& graphic_buffer) + CGAL::Graphic_storage& graphic_storage) { // Default functor; user can add his own functor. CGAL::Drawing_functor_voronoi drawing_functor; - add_in_graphic_storage(v2, graphic_buffer, drawing_functor); + add_in_graphic_storage(v2, graphic_storage, drawing_functor); } #ifdef CGAL_USE_BASIC_VIEWER @@ -414,7 +414,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, basic_viewer->clear(); draw_function_for_v2::compute_elements(av2, - basic_viewer->get_graphic_buffer(), + basic_viewer->get_graphic_storage(), drawing_functor); basic_viewer->redraw(); } @@ -429,7 +429,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, basic_viewer->clear(); draw_function_for_v2::compute_elements(av2, - basic_viewer->get_graphic_buffer(), + basic_viewer->get_graphic_storage(), drawing_functor); basic_viewer->redraw(); } From 7e99eac60d3f0b1316559c1c4c4453a0a0b23a08 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 15:20:06 +0200 Subject: [PATCH 149/399] Rename graphic_buffer into graphic_storage --- .../doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index 400697b9e9d9..aee6357e36ef 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -17,7 +17,7 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5 */ template - void add_in_graphic_storage(const LCC& alcc, CGAL::Graphic_storage& graphic_buffer, + void add_in_graphic_storage(const LCC& alcc, CGAL::Graphic_storage& graphic_storage, const DrawingFunctor& afunctor); } /* namespace CGAL */ From 10a87486cf0e38832be8c4237b208112d742ff3c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 16:08:35 +0200 Subject: [PATCH 150/399] Basic viewer doc (cont) --- .../doc/Basic_viewer/CGAL/Graphic_storage.h | 33 ++- .../Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 252 ++++++++++++++++++ .../doc/Basic_viewer/PackageDescription.txt | 3 + 3 files changed, 270 insertions(+), 18 deletions(-) create mode 100644 Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h index 6b59045bda1a..bba0e545a23c 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h @@ -4,45 +4,45 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Graphic_storage` store points, segments and triangles. Elements can be added, possibly with associated colors. Non triangular faces can be directly added, and are triangulated internally. +The class `Graphic_storage` store points, segments, triangles, rays and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added, and are triangulated internally. \tparam BufferType the type used for point coordinates: float by default. -*/ +*/ template class Graphic_storage { public: - /// Add the given point in this storage. + /// add the given point in the storage. template void add_point(const KPoint &p); - /// Add the given colored point in this storage. + /// add the given colored point in the storage. template void add_point(const KPoint &p, const CGAL::IO::Color &acolor); - /// Add the given segment in this storage. + /// add the given segment in the storage. template void add_segment(const KPoint &p1, const KPoint &p2); - /// Add the given colored segment in this storage. + /// add the given colored segment in the storage. template void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); - /// Add the given ray in the storage: an half line starting from p and having v as direction. + /// add the given ray in the storage: an half line starting from p and having v as direction. template void add_ray(const KPoint &p, const KVector &v); - /// Add the given colored ray in the storage: an half line starting from p and having v as direction. + /// add the given colored ray in the storage: an half line starting from p and having v as direction. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - /// Add the given line in the storage, defined by p and v as direction. + /// add the given line in the storage, defined by p and v as direction. template void add_line(const KPoint &p, const KVector &v); - /// Add the given colored line in the storage, defined by p and v as direction. + /// add the given colored line in the storage, defined by p and v as direction. template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); @@ -66,12 +66,6 @@ class Graphic_storage { /// end the current face. void face_end(); - /// @return `true` iff the storage has no element. - bool is_empty() const; - - /// clear the storage, i.e. remove all points, segments, triangles and text. - void clear(); - /// add the given text at the given position in the storage. template void add_text(const KPoint &kp, const char *txt); @@ -80,8 +74,11 @@ class Graphic_storage { template void add_text(const KPoint &kp, const std::string &txt); - /// clear all the texts. - void m_texts_clear(); + /// @return `true` iff the storage has no element. + bool is_empty() const; + + /// clear the storage, i.e. remove all points, segments, triangles and text. + void clear(); }; } // namespace CGAL diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h new file mode 100644 index 000000000000..c97f041b54bd --- /dev/null +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -0,0 +1,252 @@ +namespace CGAL { + +//------------------------------------------------------------------------------ +/*! + \ingroup PkgBasicViewerClasses + +The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphic_storage`. Elements can either be added directly in the viewer or through the storage. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. + +\tparam BufferType the type used for point coordinates: float by default. + +*/ +template +class Basic_viewer_qt : public CGAL::QGLViewer +{ +public: + /// constructor given a pointer on a QWidget (can be a nullptr) and a Graphic_storage. + /// title will be the title of the window. + Basic_viewer_qt(QWidget* parent, + Graphic_storage& buf, + const char* title=""); + + /// enable or disable the drawing of vertices. + void set_draw_vertices(bool b); + + /// enable or disable the drawing of edges. + void set_draw_edges(bool b); + + /// enable or disable the drawing of rays. + void set_draw_rays(bool b); + + /// enable or disable the drawing of lines. + void set_draw_lines(bool b); + + /// enable or disable the drawing of faces. + void set_draw_faces(bool b); + + /// enable or disable the use of only one color (if `b` is `true`) or the use of multiple colors (if `b` is `false`). + void set_use_mono_color(bool b); + + /// enable or disable the drawing of texts. + void set_draw_text(bool b); + + /// set the color used for vertices in mono_color mode. + void set_vertices_mono_color(const CGAL::IO::Color& c); + + /// set the color used for edges in mono_color mode. + void set_edges_mono_color(const CGAL::IO::Color& c); + + /// set the color used for rays in mono_color mode. + void set_rays_mono_color(const CGAL::IO::Color& c); + + /// set the color used for lines in mono_color mode. + void set_lines_mono_color(const CGAL::IO::Color& c); + + /// set the color used for faces in mono_color mode. + void set_faces_mono_color(const CGAL::IO::Color& c); + + /// negate the drawing of vertices (becomes `true` if it was `false` and reciprocally). + void negate_draw_vertices(); + + /// negate the drawing of edges (becomes `true` if it was `false` and reciprocally). + void negate_draw_edges(); + + /// negate the drawing of rays (becomes `true` if it was `false` and reciprocally). + void negate_draw_rays(); + + /// negate the drawing of lines (becomes `true` if it was `false` and reciprocally). + void negate_draw_lines(); + + /// negate the drawing of faces (becomes `true` if it was `false` and reciprocally). + void negate_draw_faces(); + + /// negate the use of mono color mode (becomes `true` if it was `false` and reciprocally). + void negate_use_mono_color(); + + /// negate the drawing of text (becomes `true` if it was `false` and reciprocally). + void negate_draw_text(); + + /// @return `true` if vertices are drawn. + bool get_draw_vertices() const; + + /// @return `true` if edges are drawn. + bool get_draw_edges() const; + + /// @return `true` if rays are drawn. + bool get_draw_rays() const; + + /// @return `true` if lines are drawn. + bool get_draw_lines() const; + + /// @return `true` if faces are drawn. + bool get_draw_faces() const; + + /// @return `true` if mono color mode is used. + bool get_use_mono_color() const; + + /// @return `true` if normal are reversed. + bool get_inverse_normal() const; + + /// @return `true` if text are drawn. + bool get_draw_text() const; + + /// @return the mono color used for vertices. + const CGAL::IO::Color& get_vertices_mono_color() const; + + /// @return the mono color used for edges. + const CGAL::IO::Color& get_edges_mono_color() const; + + /// @return the mono color used for rays. + const CGAL::IO::Color& get_rays_mono_color() const; + + /// @return the mono color used for lines. + const CGAL::IO::Color& get_lines_mono_color() const; + + /// @return the mono color used for faces. + const CGAL::IO::Color& get_faces_mono_color() const; + + /// clear the basic viewer, i.e. remove all its elements. + void clear(); + + /// @return `true` if the viewer is empty. + bool is_empty() const; + + /// @return the bounding box of all the elements in the viewer. + const CGAL::Bbox_3& bounding_box() const; + + /// @return `true` if the clipping plane is enabled. + bool is_clipping_plane_enabled() const; + + /// @return the clipping plane when it is enabled. + Local_kernel::Plane_3 clipping_plane() const; + + /// add the given point in the viewer. + template + void add_point(const KPoint &p); + + /// add the given colored point in the viewer. + template + void add_point(const KPoint &p, const CGAL::IO::Color &acolor); + + /// add the given segment in the viewer. + template + void add_segment(const KPoint &p1, const KPoint &p2); + + /// add the given colored segment in the viewer. + template + void add_segment(const KPoint &p1, const KPoint &p2, + const CGAL::IO::Color &acolor); + + /// add the given ray in the viewer: an half line starting from p and having v as direction. + template + void add_ray(const KPoint &p, const KVector &v); + + /// add the given colored ray in the viewer: an half line starting from p and having v as direction. + template + void add_ray(const KPoint &p, const KVector &v, + const CGAL::IO::Color &acolor); + + /// add the given line in the viewer, defined by p and v as direction. + template + void add_line(const KPoint &p, const KVector &v); + + /// add the given colored line in the viewer, defined by p and v as direction. + template + void add_line(const KPoint &p, const KVector &v, + const CGAL::IO::Color &acolor); + + /// start a new face. + void face_begin(); + + /// start a new colored face. + void face_begin(const CGAL::IO::Color &acolor); + + /// @return `true` iff a face is started. + bool is_a_face_started() const; + + /// add the given point in the current face. + template bool add_point_in_face(const KPoint &kp); + + /// add the given point in the current face, having the vertex normal. + template + bool add_point_in_face(const KPoint &kp, const KVector &p_normal); + + /// end the current face. + void face_end(); + + /// add the given text at the given position in the viewer. + template + void add_text(const KPoint &kp, const char *txt); + + /// add the given text at the given position in the viewer. + template + void add_text(const KPoint &kp, const std::string &txt); + + /// @return the graphic storage of the viewer. + Graphic_storage& get_graphic_storage(); + + /// @return the graphic storage of the viewer, const version. + const Graphic_storage& get_graphic_storage() const; + + /// negate all normal of vertices and faces. + void negate_all_normals(); + + // \return true if the data structure in in 2D, i.e. lies on a plane. + bool is_two_dimensional() const; + + /// draw the viewer without recomputing all internal buffers. + virtual void draw(); + + /// redraw the viewer, i.e. recompute all internal buffers and update the window. + virtual void redraw(); + + /// function called when a key is pressed. Users can define their own function in order + /// to add specific behavior. + std::function *)> on_key_pressed; +}; + + +//------------------------------------------------------------------------------ +/*! + \ingroup PkgBasicViewerClasses + +The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The QApplication is created in the constructor, but ran by the run method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. + +\tparam BufferType the type used for point coordinates: float by default. + +*/ +template +class QApplication_and_basic_viewer +{ +public: + /// Constructor given a Graphic_storage and possibly a title. + QApplication_and_basic_viewer(CGAL::Graphic_storage& buffer, + const char* title="CGAL Basic Viewer"); + + /// run the QApplication, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. + void run(); + + /// @return a reference to the Basic_viewer_qt associated with this. + Basic_viewer_qt& basic_viewer(); +}; + +//------------------------------------------------------------------------------ +/*! + opens a new window and draws the given `Graphic_storage` (which must be have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. +*/ +template +void draw_graphic_storage(Graphic_storage& graphic_buffer, + const char *title="CGAL Basic Viewer"); + +} // End namespace CGAL + diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 1ad624dc5250..ffa349ec68de 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -25,9 +25,12 @@ - `CGAL::Drawing_functor` - `CGAL::Drawing_functor_with_volume` - `CGAL::Graphic_storage` +- `CGAL::Basic_viewer_qt` +- `CGAL::QApplication_and_basic_viewer` \cgalCRPSubsection{Draw functions} - \link PkgDrawLinearCellComplex CGAL::draw() \endlink +- CGAL::draw_graphic_storage() \cgalCRPSubsection{Fill graphic storage functions} - \link PkgDrawLinearCellComplex CGAL::CGAL::add_in_graphic_storage() \endlink From 1acb0e67665e6c0195c638c7b0646f02158be85b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 16:20:20 +0200 Subject: [PATCH 151/399] typo --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index c97f041b54bd..51e3f4ecfc84 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -242,7 +242,7 @@ class QApplication_and_basic_viewer //------------------------------------------------------------------------------ /*! - opens a new window and draws the given `Graphic_storage` (which must be have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. + opens a new window and draws the given `Graphic_storage` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. */ template void draw_graphic_storage(Graphic_storage& graphic_buffer, From 2f3d0c1029649f3f2aa4dcf4e722d8d352349ed9 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 16:55:35 +0200 Subject: [PATCH 152/399] add lcc in dependencies --- Basic_viewer/doc/Basic_viewer/dependencies | 1 + 1 file changed, 1 insertion(+) diff --git a/Basic_viewer/doc/Basic_viewer/dependencies b/Basic_viewer/doc/Basic_viewer/dependencies index e69de29bb2d1..f0abb4c7ced1 100644 --- a/Basic_viewer/doc/Basic_viewer/dependencies +++ b/Basic_viewer/doc/Basic_viewer/dependencies @@ -0,0 +1 @@ +Linear_cell_complex From 5e420b1e3fa994e20cb7f65f1f8cddda777334a3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 17:08:39 +0200 Subject: [PATCH 153/399] doc --- Basic_viewer/doc/Basic_viewer/dependencies | 1 + 1 file changed, 1 insertion(+) diff --git a/Basic_viewer/doc/Basic_viewer/dependencies b/Basic_viewer/doc/Basic_viewer/dependencies index f0abb4c7ced1..f4dccf527f1e 100644 --- a/Basic_viewer/doc/Basic_viewer/dependencies +++ b/Basic_viewer/doc/Basic_viewer/dependencies @@ -1 +1,2 @@ Linear_cell_complex +Manual From 0fe120ba2046938639464b9650c10df71b56fe94 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 22 Jun 2023 18:57:28 +0200 Subject: [PATCH 154/399] add links to draw functions --- .../doc/Basic_viewer/PackageDescription.txt | 24 ++++++++++++++++--- Basic_viewer/doc/Basic_viewer/dependencies | 14 ++++++++++- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index ffa349ec68de..c250d939dd20 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -28,9 +28,27 @@ - `CGAL::Basic_viewer_qt` - `CGAL::QApplication_and_basic_viewer` -\cgalCRPSubsection{Draw functions} -- \link PkgDrawLinearCellComplex CGAL::draw() \endlink -- CGAL::draw_graphic_storage() +\cgalCRPSubsection{Draw functions of a graphic storage} + +- `CGAL::draw_graphic_storage()` + + +\cgalCRPSubsection{Draw functions for different packages} + +- \link PkgDrawTriangulation2 Constrained_triangulation_2 CGAL::draw() \endlink +- \link PkgDrawLinearCellComplex Linear_cell_complex CGAL::draw() \endlink +- \link PkgDrawNef3 Nef_polyhedron_3 CGAL::draw() \endlink +- \link PkgDrawPeriodic2Triangulation2 Periodic_2_Triangulation_2 CGAL::draw() \endlink +- \link PkgDrawPointSet3D Point_set_3 CGAL::draw() \endlink +- \link PkgDrawPolygon2 Polygon_2 CGAL::draw() \endlink +- \link PkgDrawPolygonSet2 Polygon_set_2 CGAL::draw() \endlink +- \link PkgDrawPolygonWithHoles2 Polygon_with_holes_2 CGAL::draw() \endlink +- \link PkgDrawPolyhedron Polyhedron_3 CGAL::draw() \endlink +- \link PkgDrawSurfaceMesh Surface_mesh CGAL::draw() \endlink +- \link PkgDrawFaceGraphWithPaths Surface_mesh_topology CGAL::draw() \endlink +- \link PkgDrawTriangulation2 Triangulation_2 CGAL::draw() \endlink +- \link PkgDrawTriangulation3 Triangulation_3 CGAL::draw() \endlink +- \link PkgDrawVoronoiDiagram2 Voronoi_diagram_2 CGAL::draw() \endlink \cgalCRPSubsection{Fill graphic storage functions} - \link PkgDrawLinearCellComplex CGAL::CGAL::add_in_graphic_storage() \endlink diff --git a/Basic_viewer/doc/Basic_viewer/dependencies b/Basic_viewer/doc/Basic_viewer/dependencies index f4dccf527f1e..5e5f8885e7bc 100644 --- a/Basic_viewer/doc/Basic_viewer/dependencies +++ b/Basic_viewer/doc/Basic_viewer/dependencies @@ -1,2 +1,14 @@ -Linear_cell_complex Manual +Boolean_set_operations_2 +Constrained_triangulation_2 +Linear_cell_complex +Nef_polyhedron_3 +Periodic_2_Triangulation_2 +Point_set_3 +Polygon_2 +Polyhedron_3 +Surface_mesh +Surface_mesh_topology +Triangulation_2 +Triangulation_3 +Voronoi_diagram_2 From b9a4f86dbc132ee6b387321d83164f17d43eb24e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 23 Jun 2023 13:24:38 +0200 Subject: [PATCH 155/399] doc --- .../doc/Basic_viewer/Basic_viewer.txt | 2 +- .../Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 3 ++- Basic_viewer/doc/Basic_viewer/Doxyfile.in | 2 ++ .../doc/Basic_viewer/PackageDescription.txt | 24 +++++++++++++++---- Basic_viewer/doc/Basic_viewer/dependencies | 9 ++++--- Basic_viewer/doc/Basic_viewer/examples.txt | 2 +- 6 files changed, 29 insertions(+), 13 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 87f101bafea0..ff81f476c0b7 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -29,7 +29,7 @@ Drawing_functor \subsection Basic_viewerExamples_simple_draw Basic draw -\cgalExample{Linear_cell_complex/draw_linear_cell_complex.cpp} +\cgalExample{Surface_mesh/draw_surface_mesh.cpp} \subsection Basic_viewerExamples_custom_color Change Face Colors diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index 51e3f4ecfc84..3bfad55352d1 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -246,7 +246,8 @@ class QApplication_and_basic_viewer */ template void draw_graphic_storage(Graphic_storage& graphic_buffer, - const char *title="CGAL Basic Viewer"); + const char *title="CGAL Basic Viewer") +{} } // End namespace CGAL diff --git a/Basic_viewer/doc/Basic_viewer/Doxyfile.in b/Basic_viewer/doc/Basic_viewer/Doxyfile.in index 2082ff842dc1..8b325940a193 100644 --- a/Basic_viewer/doc/Basic_viewer/Doxyfile.in +++ b/Basic_viewer/doc/Basic_viewer/Doxyfile.in @@ -1,3 +1,5 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - CGAL Basic Viewer" + +EXAMPLE_PATH += ${CGAL_Surface_mesh_EXAMPLE_DIR} \ No newline at end of file diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index c250d939dd20..2c77cc1aac4b 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -10,7 +10,7 @@ \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand} \cgalPkgDesc{This package implements basic viewer class.} -\cgalPkgManuals{Chapter_Basic_Viewer,PkgBasicViewerRef} +\cgalPkgManuals{Chapter_Basic_viewer,PkgBasicViewerRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{6.0} @@ -28,12 +28,12 @@ - `CGAL::Basic_viewer_qt` - `CGAL::QApplication_and_basic_viewer` -\cgalCRPSubsection{Draw functions of a graphic storage} +\cgalCRPSubsection{Draw a Graphic Storage} - `CGAL::draw_graphic_storage()` -\cgalCRPSubsection{Draw functions for different packages} +\cgalCRPSubsection{Draw for Different Packages} - \link PkgDrawTriangulation2 Constrained_triangulation_2 CGAL::draw() \endlink - \link PkgDrawLinearCellComplex Linear_cell_complex CGAL::draw() \endlink @@ -50,8 +50,22 @@ - \link PkgDrawTriangulation3 Triangulation_3 CGAL::draw() \endlink - \link PkgDrawVoronoiDiagram2 Voronoi_diagram_2 CGAL::draw() \endlink -\cgalCRPSubsection{Fill graphic storage functions} -- \link PkgDrawLinearCellComplex CGAL::CGAL::add_in_graphic_storage() \endlink +\cgalCRPSubsection{Fill Graphic Storage for Different Packages} + +- \link PkgDrawTriangulation2 Constrained_triangulation_2 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawLinearCellComplex Linear_cell_complex CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawNef3 Nef_polyhedron_3 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawPeriodic2Triangulation2 Periodic_2_Triangulation_2 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawPointSet3D Point_set_3 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawPolygon2 Polygon_2 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawPolygonSet2 Polygon_set_2 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawPolygonWithHoles2 Polygon_with_holes_2 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawPolyhedron Polyhedron_3 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawSurfaceMesh Surface_mesh CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawFaceGraphWithPaths Surface_mesh_topology CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawTriangulation2 Triangulation_2 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawTriangulation3 Triangulation_3 CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawVoronoiDiagram2 Voronoi_diagram_2 CGAL::add_in_graphic_storage() \endlink */ diff --git a/Basic_viewer/doc/Basic_viewer/dependencies b/Basic_viewer/doc/Basic_viewer/dependencies index 5e5f8885e7bc..67a91f218f5e 100644 --- a/Basic_viewer/doc/Basic_viewer/dependencies +++ b/Basic_viewer/doc/Basic_viewer/dependencies @@ -1,12 +1,11 @@ Manual Boolean_set_operations_2 -Constrained_triangulation_2 Linear_cell_complex -Nef_polyhedron_3 -Periodic_2_Triangulation_2 +Nef_3 +Periodic_2_triangulation_2 Point_set_3 -Polygon_2 -Polyhedron_3 +Polygon +Polyhedron Surface_mesh Surface_mesh_topology Triangulation_2 diff --git a/Basic_viewer/doc/Basic_viewer/examples.txt b/Basic_viewer/doc/Basic_viewer/examples.txt index 1deef74b4f8f..0a13e1c0f6fd 100644 --- a/Basic_viewer/doc/Basic_viewer/examples.txt +++ b/Basic_viewer/doc/Basic_viewer/examples.txt @@ -1,5 +1,5 @@ /*! -\example Linear_cell_complex/draw_linear_cell_complex.cpp +\example Surface_mesh/draw_surface_mesh.cpp \example Basic_viewer/draw_mesh_and_points.cpp \example Basic_viewer/draw_several_windows.cpp \example Basic_viewer/draw_surface_mesh_height.cpp From 980241e7cdf45abf140a1cbc18b7b8c7d2b1290b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 23 Jun 2023 15:05:43 +0200 Subject: [PATCH 156/399] author --- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 2c77cc1aac4b..0cd5d9e62b3c 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -8,7 +8,7 @@ \cgalPkgDescriptionBegin{Basic Viewer,PkgBasicViewer} \cgalPkgPicture{TODO.png} \cgalPkgSummaryBegin -\cgalPkgAuthor{Guillaume Damiand} +\cgalPkgAuthor{Guillaume Damiand, Mostafa Ashraf} \cgalPkgDesc{This package implements basic viewer class.} \cgalPkgManuals{Chapter_Basic_viewer,PkgBasicViewerRef} \cgalPkgSummaryEnd From 157558a0888b6a43e47ab29321f89a76f040d9fe Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 26 Jun 2023 11:12:39 +0200 Subject: [PATCH 157/399] update doc --- .../Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 253 ------------------ .../doc/Basic_viewer/PackageDescription.txt | 56 ++-- 2 files changed, 28 insertions(+), 281 deletions(-) delete mode 100644 Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h deleted file mode 100644 index 3bfad55352d1..000000000000 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ /dev/null @@ -1,253 +0,0 @@ -namespace CGAL { - -//------------------------------------------------------------------------------ -/*! - \ingroup PkgBasicViewerClasses - -The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphic_storage`. Elements can either be added directly in the viewer or through the storage. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. - -\tparam BufferType the type used for point coordinates: float by default. - -*/ -template -class Basic_viewer_qt : public CGAL::QGLViewer -{ -public: - /// constructor given a pointer on a QWidget (can be a nullptr) and a Graphic_storage. - /// title will be the title of the window. - Basic_viewer_qt(QWidget* parent, - Graphic_storage& buf, - const char* title=""); - - /// enable or disable the drawing of vertices. - void set_draw_vertices(bool b); - - /// enable or disable the drawing of edges. - void set_draw_edges(bool b); - - /// enable or disable the drawing of rays. - void set_draw_rays(bool b); - - /// enable or disable the drawing of lines. - void set_draw_lines(bool b); - - /// enable or disable the drawing of faces. - void set_draw_faces(bool b); - - /// enable or disable the use of only one color (if `b` is `true`) or the use of multiple colors (if `b` is `false`). - void set_use_mono_color(bool b); - - /// enable or disable the drawing of texts. - void set_draw_text(bool b); - - /// set the color used for vertices in mono_color mode. - void set_vertices_mono_color(const CGAL::IO::Color& c); - - /// set the color used for edges in mono_color mode. - void set_edges_mono_color(const CGAL::IO::Color& c); - - /// set the color used for rays in mono_color mode. - void set_rays_mono_color(const CGAL::IO::Color& c); - - /// set the color used for lines in mono_color mode. - void set_lines_mono_color(const CGAL::IO::Color& c); - - /// set the color used for faces in mono_color mode. - void set_faces_mono_color(const CGAL::IO::Color& c); - - /// negate the drawing of vertices (becomes `true` if it was `false` and reciprocally). - void negate_draw_vertices(); - - /// negate the drawing of edges (becomes `true` if it was `false` and reciprocally). - void negate_draw_edges(); - - /// negate the drawing of rays (becomes `true` if it was `false` and reciprocally). - void negate_draw_rays(); - - /// negate the drawing of lines (becomes `true` if it was `false` and reciprocally). - void negate_draw_lines(); - - /// negate the drawing of faces (becomes `true` if it was `false` and reciprocally). - void negate_draw_faces(); - - /// negate the use of mono color mode (becomes `true` if it was `false` and reciprocally). - void negate_use_mono_color(); - - /// negate the drawing of text (becomes `true` if it was `false` and reciprocally). - void negate_draw_text(); - - /// @return `true` if vertices are drawn. - bool get_draw_vertices() const; - - /// @return `true` if edges are drawn. - bool get_draw_edges() const; - - /// @return `true` if rays are drawn. - bool get_draw_rays() const; - - /// @return `true` if lines are drawn. - bool get_draw_lines() const; - - /// @return `true` if faces are drawn. - bool get_draw_faces() const; - - /// @return `true` if mono color mode is used. - bool get_use_mono_color() const; - - /// @return `true` if normal are reversed. - bool get_inverse_normal() const; - - /// @return `true` if text are drawn. - bool get_draw_text() const; - - /// @return the mono color used for vertices. - const CGAL::IO::Color& get_vertices_mono_color() const; - - /// @return the mono color used for edges. - const CGAL::IO::Color& get_edges_mono_color() const; - - /// @return the mono color used for rays. - const CGAL::IO::Color& get_rays_mono_color() const; - - /// @return the mono color used for lines. - const CGAL::IO::Color& get_lines_mono_color() const; - - /// @return the mono color used for faces. - const CGAL::IO::Color& get_faces_mono_color() const; - - /// clear the basic viewer, i.e. remove all its elements. - void clear(); - - /// @return `true` if the viewer is empty. - bool is_empty() const; - - /// @return the bounding box of all the elements in the viewer. - const CGAL::Bbox_3& bounding_box() const; - - /// @return `true` if the clipping plane is enabled. - bool is_clipping_plane_enabled() const; - - /// @return the clipping plane when it is enabled. - Local_kernel::Plane_3 clipping_plane() const; - - /// add the given point in the viewer. - template - void add_point(const KPoint &p); - - /// add the given colored point in the viewer. - template - void add_point(const KPoint &p, const CGAL::IO::Color &acolor); - - /// add the given segment in the viewer. - template - void add_segment(const KPoint &p1, const KPoint &p2); - - /// add the given colored segment in the viewer. - template - void add_segment(const KPoint &p1, const KPoint &p2, - const CGAL::IO::Color &acolor); - - /// add the given ray in the viewer: an half line starting from p and having v as direction. - template - void add_ray(const KPoint &p, const KVector &v); - - /// add the given colored ray in the viewer: an half line starting from p and having v as direction. - template - void add_ray(const KPoint &p, const KVector &v, - const CGAL::IO::Color &acolor); - - /// add the given line in the viewer, defined by p and v as direction. - template - void add_line(const KPoint &p, const KVector &v); - - /// add the given colored line in the viewer, defined by p and v as direction. - template - void add_line(const KPoint &p, const KVector &v, - const CGAL::IO::Color &acolor); - - /// start a new face. - void face_begin(); - - /// start a new colored face. - void face_begin(const CGAL::IO::Color &acolor); - - /// @return `true` iff a face is started. - bool is_a_face_started() const; - - /// add the given point in the current face. - template bool add_point_in_face(const KPoint &kp); - - /// add the given point in the current face, having the vertex normal. - template - bool add_point_in_face(const KPoint &kp, const KVector &p_normal); - - /// end the current face. - void face_end(); - - /// add the given text at the given position in the viewer. - template - void add_text(const KPoint &kp, const char *txt); - - /// add the given text at the given position in the viewer. - template - void add_text(const KPoint &kp, const std::string &txt); - - /// @return the graphic storage of the viewer. - Graphic_storage& get_graphic_storage(); - - /// @return the graphic storage of the viewer, const version. - const Graphic_storage& get_graphic_storage() const; - - /// negate all normal of vertices and faces. - void negate_all_normals(); - - // \return true if the data structure in in 2D, i.e. lies on a plane. - bool is_two_dimensional() const; - - /// draw the viewer without recomputing all internal buffers. - virtual void draw(); - - /// redraw the viewer, i.e. recompute all internal buffers and update the window. - virtual void redraw(); - - /// function called when a key is pressed. Users can define their own function in order - /// to add specific behavior. - std::function *)> on_key_pressed; -}; - - -//------------------------------------------------------------------------------ -/*! - \ingroup PkgBasicViewerClasses - -The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The QApplication is created in the constructor, but ran by the run method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. - -\tparam BufferType the type used for point coordinates: float by default. - -*/ -template -class QApplication_and_basic_viewer -{ -public: - /// Constructor given a Graphic_storage and possibly a title. - QApplication_and_basic_viewer(CGAL::Graphic_storage& buffer, - const char* title="CGAL Basic Viewer"); - - /// run the QApplication, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. - void run(); - - /// @return a reference to the Basic_viewer_qt associated with this. - Basic_viewer_qt& basic_viewer(); -}; - -//------------------------------------------------------------------------------ -/*! - opens a new window and draws the given `Graphic_storage` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. -*/ -template -void draw_graphic_storage(Graphic_storage& graphic_buffer, - const char *title="CGAL Basic Viewer") -{} - -} // End namespace CGAL - diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 0cd5d9e62b3c..d5a338e9ebbb 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -35,37 +35,37 @@ \cgalCRPSubsection{Draw for Different Packages} -- \link PkgDrawTriangulation2 Constrained_triangulation_2 CGAL::draw() \endlink -- \link PkgDrawLinearCellComplex Linear_cell_complex CGAL::draw() \endlink -- \link PkgDrawNef3 Nef_polyhedron_3 CGAL::draw() \endlink -- \link PkgDrawPeriodic2Triangulation2 Periodic_2_Triangulation_2 CGAL::draw() \endlink -- \link PkgDrawPointSet3D Point_set_3 CGAL::draw() \endlink -- \link PkgDrawPolygon2 Polygon_2 CGAL::draw() \endlink -- \link PkgDrawPolygonSet2 Polygon_set_2 CGAL::draw() \endlink -- \link PkgDrawPolygonWithHoles2 Polygon_with_holes_2 CGAL::draw() \endlink -- \link PkgDrawPolyhedron Polyhedron_3 CGAL::draw() \endlink -- \link PkgDrawSurfaceMesh Surface_mesh CGAL::draw() \endlink -- \link PkgDrawFaceGraphWithPaths Surface_mesh_topology CGAL::draw() \endlink -- \link PkgDrawTriangulation2 Triangulation_2 CGAL::draw() \endlink -- \link PkgDrawTriangulation3 Triangulation_3 CGAL::draw() \endlink -- \link PkgDrawVoronoiDiagram2 Voronoi_diagram_2 CGAL::draw() \endlink +- Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::draw() \endlink +- Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::draw() \endlink +- Nef_polyhedron_3 \link PkgDrawNef3 CGAL::draw() \endlink +- Periodic_2_Triangulation_2 \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink +- Point_set_3 \link PkgDrawPointSet3D CGAL::draw() \endlink +- Polygon_2 \link PkgDrawPolygon2 CGAL::draw() \endlink +- Polygon_set_2 \link PkgDrawPolygonSet2 CGAL::draw() \endlink +- Polygon_with_holes_2 \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink +- Polyhedron_3 \link PkgDrawPolyhedron CGAL::draw() \endlink +- Surface_mesh \link PkgDrawSurfaceMesh CGAL::draw() \endlink +- Surface_mesh_topology \link PkgDrawFaceGraphWithPaths CGAL::draw() \endlink +- Triangulation_2 \link PkgDrawTriangulation2 CGAL::draw() \endlink +- Triangulation_3 \link PkgDrawTriangulation3 CGAL::draw() \endlink +- Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::draw() \endlink \cgalCRPSubsection{Fill Graphic Storage for Different Packages} -- \link PkgDrawTriangulation2 Constrained_triangulation_2 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawLinearCellComplex Linear_cell_complex CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawNef3 Nef_polyhedron_3 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawPeriodic2Triangulation2 Periodic_2_Triangulation_2 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawPointSet3D Point_set_3 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawPolygon2 Polygon_2 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawPolygonSet2 Polygon_set_2 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawPolygonWithHoles2 Polygon_with_holes_2 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawPolyhedron Polyhedron_3 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawSurfaceMesh Surface_mesh CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawFaceGraphWithPaths Surface_mesh_topology CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawTriangulation2 Triangulation_2 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawTriangulation3 Triangulation_3 CGAL::add_in_graphic_storage() \endlink -- \link PkgDrawVoronoiDiagram2 Voronoi_diagram_2 CGAL::add_in_graphic_storage() \endlink +- Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphic_storage() \endlink +- Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::add_in_graphic_storage() \endlink +- Nef_polyhedron_3 \link PkgDrawNef3 CGAL::add_in_graphic_storage() \endlink +- Periodic_2_Triangulation_2 \link PkgDrawPeriodic2Triangulation2 CGAL::add_in_graphic_storage() \endlink +- Point_set_3 \link PkgDrawPointSet3D CGAL::add_in_graphic_storage() \endlink +- Polygon_2 \link PkgDrawPolygon2 CGAL::add_in_graphic_storage() \endlink +- Polygon_set_2 \link PkgDrawPolygonSet2 CGAL::add_in_graphic_storage() \endlink +- Polygon_with_holes_2 \link PkgDrawPolygonWithHoles2 CGAL::add_in_graphic_storage() \endlink +- Polyhedron_3 \link PkgDrawPolyhedron CGAL::add_in_graphic_storage() \endlink +- Surface_mesh \link PkgDrawSurfaceMesh CGAL::add_in_graphic_storage() \endlink +- Surface_mesh_topology \link PkgDrawFaceGraphWithPaths CGAL::add_in_graphic_storage() \endlink +- Triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphic_storage() \endlink +- Triangulation_3 \link PkgDrawTriangulation3 CGAL::add_in_graphic_storage() \endlink +- Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::add_in_graphic_storage() \endlink */ From 11c7e4415e22eac42194bf2973e5666ebc556e2e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 26 Jun 2023 11:12:53 +0200 Subject: [PATCH 158/399] move file --- .../doc/Basic_viewer/CGAL/Basic_viewer_qt.h | 253 ++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h new file mode 100644 index 000000000000..3bfad55352d1 --- /dev/null +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h @@ -0,0 +1,253 @@ +namespace CGAL { + +//------------------------------------------------------------------------------ +/*! + \ingroup PkgBasicViewerClasses + +The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphic_storage`. Elements can either be added directly in the viewer or through the storage. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. + +\tparam BufferType the type used for point coordinates: float by default. + +*/ +template +class Basic_viewer_qt : public CGAL::QGLViewer +{ +public: + /// constructor given a pointer on a QWidget (can be a nullptr) and a Graphic_storage. + /// title will be the title of the window. + Basic_viewer_qt(QWidget* parent, + Graphic_storage& buf, + const char* title=""); + + /// enable or disable the drawing of vertices. + void set_draw_vertices(bool b); + + /// enable or disable the drawing of edges. + void set_draw_edges(bool b); + + /// enable or disable the drawing of rays. + void set_draw_rays(bool b); + + /// enable or disable the drawing of lines. + void set_draw_lines(bool b); + + /// enable or disable the drawing of faces. + void set_draw_faces(bool b); + + /// enable or disable the use of only one color (if `b` is `true`) or the use of multiple colors (if `b` is `false`). + void set_use_mono_color(bool b); + + /// enable or disable the drawing of texts. + void set_draw_text(bool b); + + /// set the color used for vertices in mono_color mode. + void set_vertices_mono_color(const CGAL::IO::Color& c); + + /// set the color used for edges in mono_color mode. + void set_edges_mono_color(const CGAL::IO::Color& c); + + /// set the color used for rays in mono_color mode. + void set_rays_mono_color(const CGAL::IO::Color& c); + + /// set the color used for lines in mono_color mode. + void set_lines_mono_color(const CGAL::IO::Color& c); + + /// set the color used for faces in mono_color mode. + void set_faces_mono_color(const CGAL::IO::Color& c); + + /// negate the drawing of vertices (becomes `true` if it was `false` and reciprocally). + void negate_draw_vertices(); + + /// negate the drawing of edges (becomes `true` if it was `false` and reciprocally). + void negate_draw_edges(); + + /// negate the drawing of rays (becomes `true` if it was `false` and reciprocally). + void negate_draw_rays(); + + /// negate the drawing of lines (becomes `true` if it was `false` and reciprocally). + void negate_draw_lines(); + + /// negate the drawing of faces (becomes `true` if it was `false` and reciprocally). + void negate_draw_faces(); + + /// negate the use of mono color mode (becomes `true` if it was `false` and reciprocally). + void negate_use_mono_color(); + + /// negate the drawing of text (becomes `true` if it was `false` and reciprocally). + void negate_draw_text(); + + /// @return `true` if vertices are drawn. + bool get_draw_vertices() const; + + /// @return `true` if edges are drawn. + bool get_draw_edges() const; + + /// @return `true` if rays are drawn. + bool get_draw_rays() const; + + /// @return `true` if lines are drawn. + bool get_draw_lines() const; + + /// @return `true` if faces are drawn. + bool get_draw_faces() const; + + /// @return `true` if mono color mode is used. + bool get_use_mono_color() const; + + /// @return `true` if normal are reversed. + bool get_inverse_normal() const; + + /// @return `true` if text are drawn. + bool get_draw_text() const; + + /// @return the mono color used for vertices. + const CGAL::IO::Color& get_vertices_mono_color() const; + + /// @return the mono color used for edges. + const CGAL::IO::Color& get_edges_mono_color() const; + + /// @return the mono color used for rays. + const CGAL::IO::Color& get_rays_mono_color() const; + + /// @return the mono color used for lines. + const CGAL::IO::Color& get_lines_mono_color() const; + + /// @return the mono color used for faces. + const CGAL::IO::Color& get_faces_mono_color() const; + + /// clear the basic viewer, i.e. remove all its elements. + void clear(); + + /// @return `true` if the viewer is empty. + bool is_empty() const; + + /// @return the bounding box of all the elements in the viewer. + const CGAL::Bbox_3& bounding_box() const; + + /// @return `true` if the clipping plane is enabled. + bool is_clipping_plane_enabled() const; + + /// @return the clipping plane when it is enabled. + Local_kernel::Plane_3 clipping_plane() const; + + /// add the given point in the viewer. + template + void add_point(const KPoint &p); + + /// add the given colored point in the viewer. + template + void add_point(const KPoint &p, const CGAL::IO::Color &acolor); + + /// add the given segment in the viewer. + template + void add_segment(const KPoint &p1, const KPoint &p2); + + /// add the given colored segment in the viewer. + template + void add_segment(const KPoint &p1, const KPoint &p2, + const CGAL::IO::Color &acolor); + + /// add the given ray in the viewer: an half line starting from p and having v as direction. + template + void add_ray(const KPoint &p, const KVector &v); + + /// add the given colored ray in the viewer: an half line starting from p and having v as direction. + template + void add_ray(const KPoint &p, const KVector &v, + const CGAL::IO::Color &acolor); + + /// add the given line in the viewer, defined by p and v as direction. + template + void add_line(const KPoint &p, const KVector &v); + + /// add the given colored line in the viewer, defined by p and v as direction. + template + void add_line(const KPoint &p, const KVector &v, + const CGAL::IO::Color &acolor); + + /// start a new face. + void face_begin(); + + /// start a new colored face. + void face_begin(const CGAL::IO::Color &acolor); + + /// @return `true` iff a face is started. + bool is_a_face_started() const; + + /// add the given point in the current face. + template bool add_point_in_face(const KPoint &kp); + + /// add the given point in the current face, having the vertex normal. + template + bool add_point_in_face(const KPoint &kp, const KVector &p_normal); + + /// end the current face. + void face_end(); + + /// add the given text at the given position in the viewer. + template + void add_text(const KPoint &kp, const char *txt); + + /// add the given text at the given position in the viewer. + template + void add_text(const KPoint &kp, const std::string &txt); + + /// @return the graphic storage of the viewer. + Graphic_storage& get_graphic_storage(); + + /// @return the graphic storage of the viewer, const version. + const Graphic_storage& get_graphic_storage() const; + + /// negate all normal of vertices and faces. + void negate_all_normals(); + + // \return true if the data structure in in 2D, i.e. lies on a plane. + bool is_two_dimensional() const; + + /// draw the viewer without recomputing all internal buffers. + virtual void draw(); + + /// redraw the viewer, i.e. recompute all internal buffers and update the window. + virtual void redraw(); + + /// function called when a key is pressed. Users can define their own function in order + /// to add specific behavior. + std::function *)> on_key_pressed; +}; + + +//------------------------------------------------------------------------------ +/*! + \ingroup PkgBasicViewerClasses + +The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The QApplication is created in the constructor, but ran by the run method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. + +\tparam BufferType the type used for point coordinates: float by default. + +*/ +template +class QApplication_and_basic_viewer +{ +public: + /// Constructor given a Graphic_storage and possibly a title. + QApplication_and_basic_viewer(CGAL::Graphic_storage& buffer, + const char* title="CGAL Basic Viewer"); + + /// run the QApplication, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. + void run(); + + /// @return a reference to the Basic_viewer_qt associated with this. + Basic_viewer_qt& basic_viewer(); +}; + +//------------------------------------------------------------------------------ +/*! + opens a new window and draws the given `Graphic_storage` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. +*/ +template +void draw_graphic_storage(Graphic_storage& graphic_buffer, + const char *title="CGAL Basic Viewer") +{} + +} // End namespace CGAL + From ef602d7aa0dd96a46a8c8f121b92da105764b070 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 26 Jun 2023 16:13:49 +0200 Subject: [PATCH 159/399] draw constrained triangulation can reuse draw triangulation --- .../CGAL/draw_constrained_triangulation_2.h | 72 ++++++++++++------- .../include/CGAL/draw_triangulation_2.h | 1 - 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index 2f8edf0f0c2c..36f413b20a74 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -13,60 +13,80 @@ #define CGAL_DRAW_CT2_H #include -#include #include #include #ifdef CGAL_USE_BASIC_VIEWER -#include +#include namespace CGAL { +// Specialization of draw function. +#define CGAL_T2_TYPE CGAL::Constrained_triangulation_2 + +template +void add_in_graphic_storage(const CGAL_T2_TYPE& at2, InDomainPmap ipm, + CGAL::Graphic_storage& graphic_storage) +{ + using BASET2=CGAL::Triangulation_2; - template - CGAL::IO::Color color_of_face(Facet_const_handle fh, InDomainPmap ipm) - { return get(ipm, fh)? CGAL::IO::yellow() : CGAL::IO::white(); } + Drawing_functor + drawingFunctor; - CGAL::IO::Color color_of_edge(Edge_const_handle eh) - { return t2.is_constrained(*eh)? CGAL::IO::green() : CGAL::IO::black(); } + drawingFunctor.colored_edge = + [](const BASET2& t2, typename CGAL_T2_TYPE::Finite_edges_iterator eh) -> bool + { return static_cast(t2).is_constrained(*eh); }; + drawingFunctor.edge_color = + [](const BASET2& t2, typename CGAL_T2_TYPE::Finite_edges_iterator eh) -> CGAL::IO::Color + { return static_cast(t2).is_constrained(*eh)? CGAL::IO::green() : CGAL::IO::black(); }; -// Specialization of draw function. -#define CGAL_T2_TYPE CGAL::Constrained_triangulation_2 + drawingFunctor.colored_face = + [](const BASET2&, typename CGAL_T2_TYPE::Finite_faces_iterator) -> bool + { return true; }; + + drawingFunctor.face_color = + [&ipm](const BASET2&, typename CGAL_T2_TYPE::Finite_faces_iterator fh) -> CGAL::IO::Color + { return get(ipm, fh)? CGAL::IO::yellow() : CGAL::IO::white(); }; + + add_in_graphic_storage(at2, graphic_storage, drawingFunctor); +} + +template +void add_in_graphic_storage(const CGAL_T2_TYPE& at2, + CGAL::Graphic_storage& graphic_storage) +{ + internal::In_domain in_domain; + add_in_graphic_storage(at2, in_domain, graphic_storage); +} template -void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm) +void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm, + const char *title="Constrained Triangulation_2 Basic Viewer") { + CGAL::Graphic_storage buffer; + add_in_graphic_storage(at2, ipm, buffer); + draw_graphic_storage(buffer, title); } template -void draw(const CGAL_T2_TYPE& at2) +void draw(const CGAL_T2_TYPE& at2, + const char *title="Constrained Triangulation_2 Basic Viewer") { internal::In_domain in_domain; - draw(at2, in_domain); + draw(at2, in_domain, title); } #undef CGAL_T2_TYPE } // End namespace CGAL -#else - -namespace CGAL { -// Specialization of draw function. -#define CGAL_T2_TYPE CGAL::Constrained_triangulation_2 - -template -void draw(const CGAL_T2_TYPE& , - InDomainPmap ) -{} -#undef CGAL_T2_TYPE - -} // End namespace CGAL - #endif // CGAL_USE_BASIC_VIEWER #endif // CGAL_DRAW_CT2_H diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 8b4cc946c6bc..aa04b819889e 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -129,7 +129,6 @@ template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, CGAL::Graphic_storage& graphic_storage) { - CGAL::Graphic_storage buffer; Drawing_functor Date: Mon, 26 Jun 2023 16:14:07 +0200 Subject: [PATCH 160/399] draw constrained triangulation instead of triangulation --- Mesh_2/examples/Mesh_2/mesh_marked_domain.cpp | 2 +- Mesh_2/examples/Mesh_2/mesh_with_seeds.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_2/examples/Mesh_2/mesh_marked_domain.cpp b/Mesh_2/examples/Mesh_2/mesh_marked_domain.cpp index 5313871f5271..9649f2076e50 100644 --- a/Mesh_2/examples/Mesh_2/mesh_marked_domain.cpp +++ b/Mesh_2/examples/Mesh_2/mesh_marked_domain.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include diff --git a/Mesh_2/examples/Mesh_2/mesh_with_seeds.cpp b/Mesh_2/examples/Mesh_2/mesh_with_seeds.cpp index 2b30e7920149..79a52e9034c8 100644 --- a/Mesh_2/examples/Mesh_2/mesh_with_seeds.cpp +++ b/Mesh_2/examples/Mesh_2/mesh_with_seeds.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include From 6664339b3f45f7741c045e3b9894714a3b7a9340 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 27 Jun 2023 09:56:06 +0200 Subject: [PATCH 161/399] Update drawing functor for surface mesh --- .../Surface_mesh/draw_surface_mesh.cpp | 10 +-- Surface_mesh/include/CGAL/draw_surface_mesh.h | 80 ++++++++++--------- 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp index cc83ca90fc0e..21f7bf4e51ce 100644 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp @@ -14,7 +14,7 @@ int main(int argc, char* argv[]) Mesh sm; if(!CGAL::IO::read_polygon_mesh(filename, sm)) { - std::cerr << "Invalid input file." << std::endl; + std::cerr << "Invalid input file: " << filename << std::endl; return EXIT_FAILURE; } @@ -26,15 +26,15 @@ int main(int argc, char* argv[]) for(auto v : vertices(sm)) { if(v.idx()%2) - put(vcm, v, CGAL::IO::black()); + { put(vcm, v, CGAL::IO::black()); } else - put(vcm, v, CGAL::IO::blue()); + { put(vcm, v, CGAL::IO::blue()); } } for(auto e : edges(sm)) - put(ecm, e, CGAL::IO::gray()); + { put(ecm, e, CGAL::IO::gray()); } - CGAL_USE(fcm); + put(fcm, *(sm.faces().begin()), CGAL::IO::red()); // Draw! CGAL::draw(sm); diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index f9c69aba440c..72b83eff6ea9 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -38,9 +38,9 @@ void draw(const SM& asm); namespace CGAL { -// Check if there are any color maps that could be used, random otherwise +// Check if there are any color maps that could be used template -struct Surface_mesh_basic_viewer_color_map +struct Drawing_functor_surface_mesh : public Drawing_functor, typename boost::graph_traits<::CGAL::Surface_mesh>::vertex_descriptor, typename boost::graph_traits<::CGAL::Surface_mesh>::edge_descriptor, @@ -51,43 +51,47 @@ struct Surface_mesh_basic_viewer_color_map using edge_descriptor = typename boost::graph_traits::edge_descriptor; using face_descriptor = typename boost::graph_traits::face_descriptor; - using Base=Drawing_functor; - - using vertex_colors = typename SM::template Property_map; - using edge_colors = typename SM::template Property_map; - using face_colors = typename SM::template Property_map; - - Surface_mesh_basic_viewer_color_map(const SM& amesh) - { - bool found = false; - std::tie(vcolors, found) = amesh.template property_map("v:color"); - std::tie(ecolors, found) = amesh.template property_map("e:color"); - std::tie(fcolors, found) = amesh.template property_map("f:color"); - CGAL_USE(found); - } - - CGAL::IO::Color operator()(const Surface_mesh& amesh, - const vertex_descriptor v) const - { - return vcolors ? get(vcolors, v) : Base::operator()(amesh, v); - } - - CGAL::IO::Color operator()(const Surface_mesh& amesh, - const edge_descriptor e) const - { - return ecolors ? get(ecolors, e) : Base::operator()(amesh, e); - } - - CGAL::IO::Color operator()(const Surface_mesh& amesh, - const face_descriptor f) const + Drawing_functor_surface_mesh(const SM& amesh) { - return fcolors ? get(fcolors, f) : Base::operator()(amesh, f); + bool found=false; + std::tie(vcolors, found)= + amesh.template property_map("v:color"); + if(found) + { + this->colored_vertex=[](const SM &, vertex_descriptor)->bool { return true; }; + this->vertex_color=[this](const SM &, vertex_descriptor v)->CGAL::IO::Color + { return get(vcolors, v); }; + } + else + { this->colored_vertex=[](const SM &, vertex_descriptor)->bool { return false; }; } + + std::tie(ecolors, found)= + amesh.template property_map("e:color"); + if(found) + { + this->colored_edge=[](const SM &, edge_descriptor)->bool { return true; }; + this->edge_color=[this](const SM &, edge_descriptor e)->CGAL::IO::Color + { return get(ecolors, e); }; + } + else + { this->colored_edge=[](const SM &, edge_descriptor)->bool { return false; }; } + + std::tie(fcolors, found)= + amesh.template property_map("f:color"); + if(found) + { + this->colored_face=[](const SM &, face_descriptor)->bool { return true; }; + this->face_color=[this](const SM &, face_descriptor f)->CGAL::IO::Color + { return get(fcolors, f); }; + } + else + { this->colored_face=[](const SM &, face_descriptor)->bool { return false; }; } } private: - vertex_colors vcolors; - edge_colors ecolors; - face_colors fcolors; + typename SM::template Property_map vcolors; + typename SM::template Property_map ecolors; + typename SM::template Property_map fcolors; }; template @@ -100,7 +104,7 @@ template void add_in_graphic_storage(const Surface_mesh& amesh, CGAL::Graphic_storage &graphic_storage) { add_in_graphic_storage_for_fg(amesh, graphic_storage, - Surface_mesh_basic_viewer_color_map(amesh)); } + Drawing_functor_surface_mesh(amesh)); } #ifdef CGAL_USE_BASIC_VIEWER @@ -110,7 +114,7 @@ void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage_for_fg(amesh, buffer); + add_in_graphic_storage(amesh, buffer); draw_graphic_storage(buffer, title); } @@ -120,7 +124,7 @@ void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage_for_fg(amesh, buffer, drawing_functor); + add_in_graphic_storage(amesh, buffer, drawing_functor); draw_graphic_storage(buffer, title); } From 367b2d3815ea2d8f74f2387e701f7720bd0de662 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 27 Jun 2023 16:04:18 +0200 Subject: [PATCH 162/399] Update doc --- .../CGAL/draw_triangulation_2.h | 41 +++++++++---------- .../Triangulation_2/PackageDescription.txt | 8 ++++ 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 4b63d19a344d..2eee9d5810d8 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -3,41 +3,40 @@ namespace CGAL { /*! \ingroup PkgDrawTriangulation2 -opens a new window and draws a triangulation. If the triangulation -has constraints they are drawn. If the face type has a member -function `bool is_in_domain()` the faces inside and outside of the -domain are drawn in different colors. +opens a new window and draws a triangulation. Parameters of the drawing are taken from the optional drawing functor parameter. 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam T2 a triangulation class derived from `Triangulation_2` or `Constrained_triangulation_2` +\tparam T2 a triangulation class derived from `Triangulation_2` \param at2 the triangulation to draw. +\param df the drawing functor. */ template -void draw(const T2& at2); +void draw(const T2& at2, const CGAL::Drawing_functor& df=default); - /*! +/*! \ingroup PkgDrawTriangulation2 -opens a new window and draws a constrained triangulation. If the triangulation -has constraints they are drawn. The faces inside and outside of the -domain, based on the property map, are drawn in different colors. - -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 macro `CGAL_USE_BASIC_VIEWER` is defined. -Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. - -\tparam CT2 a triangulation class derived from `Constrained_triangulation_2` -\tparam InDomainPMap a class model of `ReadWritePropertyMap` with -`CT::Face_handle` as key type and `bool` as value type. +adds the vertices, edges and faces of at2 into the given graphic storage gs. Parameters of the cells are taken from the optional drawing functor parameter. Note that gs is not clear before to be filled (to enable to draw several data structures in a same basic viewer). -\param act2 the constrained triangulation to draw. -\param ipm the property map defining the faces which are in the domain. +\tparam T2 a triangulation class derived from `Triangulation_2` +\param at2 the triangulation to draw. +\param gs the graphic storage to fill. +\param df the drawing functor. */ - template - void draw(const CT2& act2, InDomainPMap ipm); +template +void add_in_graphic_storage(const T2& at2, + CGAL::Graphic_storage& gs, + const CGAL::Drawing_functor& df=default); } /* namespace CGAL */ diff --git a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt index 65b8c9137e4b..61ecd53769e4 100644 --- a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt +++ b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt @@ -21,6 +21,14 @@ /// \defgroup PkgDrawTriangulation2 Draw a Triangulation 2 /// \ingroup PkgTriangulation2Ref +/*! + \code + #include + \endcode +*/ +/// \defgroup PkgDrawConstrainedTriangulation2 Draw a Constrained Triangulation 2 +/// \ingroup PkgTriangulation2Ref + /*! \addtogroup PkgTriangulation2Ref \todo check generated documentation From 8b556137b58d9cff39a764b8908927237b4effb8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 27 Jun 2023 16:26:13 +0200 Subject: [PATCH 163/399] split draw triangulation in two for the doc (without and with constrained), similarly to the code --- .../CGAL/draw_constrained_triangulation_2.h | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h new file mode 100644 index 000000000000..87c085b92135 --- /dev/null +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h @@ -0,0 +1,43 @@ +namespace CGAL { + +/*! +\ingroup PkgDrawConstrainedTriangulation2 + +opens a new window and draws a triangulation. If the triangulation +has constraints they are drawn. If the face type has a member +function `bool is_in_domain()` the faces inside and outside of the +domain are drawn in different colors. + +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 macro `CGAL_USE_BASIC_VIEWER` is defined. +Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with +`CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. + +\tparam T2 a triangulation class derived from `Triangulation_2` or `Constrained_triangulation_2` +\param at2 the triangulation to draw. + +*/ +template +void draw(const T2& at2); + + /*! +\ingroup PkgDrawConstrainedTriangulation2 + +opens a new window and draws a constrained triangulation. If the triangulation +has constraints they are drawn. The faces inside and outside of the +domain, based on the property map, are drawn in different colors. + +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 macro `CGAL_USE_BASIC_VIEWER` is defined. +Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. + +\tparam CT2 a triangulation class derived from `Constrained_triangulation_2` +\tparam InDomainPMap a class model of `ReadWritePropertyMap` with +`CT::Face_handle` as key type and `bool` as value type. + +\param act2 the constrained triangulation to draw. +\param ipm the property map defining the faces which are in the domain. + +*/ + template + void draw(const CT2& act2, InDomainPMap ipm); + +} /* namespace CGAL */ From 44fd0bcb0b526b7bd8e648523e86412b6f7e2334 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 27 Jun 2023 19:14:09 +0200 Subject: [PATCH 164/399] camel case --- .../doc/Basic_viewer/CGAL/Drawing_functor.h | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index a3241cba361e..221dc76f398c 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -8,57 +8,57 @@ The class `Drawing_functor` is used to tune the way that a given data-structure The different std::function can be modified to change the behavior of the drawing. \tparam DS a data structure of CGAL. -\tparam Vertex_descriptor a descriptor of vertices of DS. -\tparam Edge_descriptor a descriptor of edges of DS. -\tparam Face_descriptor a descriptor of faces of DS. +\tparam VertexDescriptor a descriptor of vertices of DS. +\tparam EdgeDescriptor a descriptor of edges of DS. +\tparam FaceDescriptor a descriptor of faces of DS. */ template + typename VertexDescriptor, + typename EdgeDescriptor, + typename FaceDescriptor> struct Drawing_functor { public: /// std::function that returns `true` if the given vertex must be drawn, `false` otherwise. /// Returns `true` by default. - std::function draw_vertex; + std::function draw_vertex; /// std::function that returns `true` if the given edge must be drawn, `false` otherwise. /// Returns `true` by default. - std::function draw_edge; + std::function draw_edge; /// std::function that returns `true` if the given face must be drawn, `false` otherwise. /// Returns `true` by default. - std::function draw_face; + std::function draw_face; /// std::function that returns `true` if the given vertex is colored, `false` otherwise. /// Returns `false` by default. - std::function colored_vertex; + std::function colored_vertex; /// std::function that returns `true` if the given edge is colored, `false` otherwise. /// Returns `false` by default. - std::function colored_edge; + std::function colored_edge; /// std::function that returns `true` if the given face is colored, `false` otherwise. /// Returns `false` by default. - std::function colored_face; + std::function colored_face; /// std::function that returns `true` if the given face is drawn in wireframe, `false` otherwise. /// Returns `false` by default. - std::function face_wireframe; + std::function face_wireframe; /// std::function that returns the color of the given vertex. /// nullptr by default. - std::function vertex_color; + std::function vertex_color; /// std::function that returns the color of the given edge. /// nullptr by default. - std::function edge_color; + std::function edge_color; /// std::function that returns the color of the given face. /// nullptr by default. - std::function face_color; + std::function face_color; /// Disable the drawing of vertices. void disable_vertices(); @@ -86,39 +86,39 @@ The class `Drawing_functor_with_volume` is used to tune the way that a given dat The different std::function can be modified to change the behavior of the drawing. \tparam DS a data structure of CGAL. -\tparam Vertex_descriptor a descriptor of vertices of DS. -\tparam Edge_descriptor a descriptor of edges of DS. -\tparam Face_descriptor a descriptor of faces of DS. -\tparam Volume_descriptor a descriptor of volumes of DS. +\tparam VertexDescriptor a descriptor of vertices of DS. +\tparam EdgeDescriptor a descriptor of edges of DS. +\tparam FaceDescriptor a descriptor of faces of DS. +\tparam VolumeDescriptor a descriptor of volumes of DS. */ // Drawing functor for a 3D data structure // (with vertices, edges, faces and volumes) template + typename VertexDescriptor, + typename EdgeDescriptor, + typename FaceDescriptor, + typename VolumeDescriptor> struct Drawing_functor_with_volume : - public Drawing_functor + public Drawing_functor { public: /// std::function that returns `true` if the given volume must be drawn, `false` otherwise. /// Returns `true` by default. - std::function draw_volume; + std::function draw_volume; /// std::function that returns the color of the given volume. /// Returns `false` by default. - std::function colored_volume; + std::function colored_volume; /// std::function that returns `true` if the given volume is drawn in wireframe, `false` otherwise. /// Returns `false` by default. - std::function volume_wireframe; + std::function volume_wireframe; /// std::function that returns the color of the given volume. /// nullptr by default. - std::function volume_color; + std::function volume_color; /// Disable the drawing of volumes. void disable_volumes(); From df33c70be5300e9015cf8c7252ff5d028d6dc383 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 3 Jul 2023 09:40:01 +0200 Subject: [PATCH 165/399] Update doc --- .../doc/Basic_viewer/CGAL/Drawing_functor.h | 73 ++++++++----------- .../CGAL/draw_triangulation_2.h | 18 ++--- 2 files changed, 39 insertions(+), 52 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index 221dc76f398c..215d8aebd2c7 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -4,8 +4,8 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Drawing_functor` is used to tune the way that a given data-structure of CGAL is drawn. -The different std::function can be modified to change the behavior of the drawing. +The class `Cell_parameters` is used to tune the way that the cells of a given data-structure of CGAL are considered. +The different std::function can be modified to change for example the behavior of the drawing. \tparam DS a data structure of CGAL. \tparam VertexDescriptor a descriptor of vertices of DS. @@ -17,20 +17,20 @@ template -struct Drawing_functor +struct Cell_parameters { public: - /// std::function that returns `true` if the given vertex must be drawn, `false` otherwise. - /// Returns `true` by default. - std::function draw_vertex; + /// std::function that returns `true` if the given vertex must be ignored, `false` otherwise. + /// Returns `false` by default. + std::function ignore_vertex; - /// std::function that returns `true` if the given edge must be drawn, `false` otherwise. + /// std::function that returns `true` if the given edge must be ignored, `false` otherwise. /// Returns `true` by default. - std::function draw_edge; + std::function ignore_edge; - /// std::function that returns `true` if the given face must be drawn, `false` otherwise. + /// std::function that returns `true` if the given face must be ignored, `false` otherwise. /// Returns `true` by default. - std::function draw_face; + std::function ignore_face; /// std::function that returns `true` if the given vertex is colored, `false` otherwise. /// Returns `false` by default. @@ -44,7 +44,7 @@ struct Drawing_functor /// Returns `false` by default. std::function colored_face; - /// std::function that returns `true` if the given face is drawn in wireframe, `false` otherwise. + /// std::function that returns `true` if the given face is in wireframe, `false` otherwise. /// Returns `false` by default. std::function face_wireframe; @@ -60,30 +60,21 @@ struct Drawing_functor /// nullptr by default. std::function face_color; - /// Disable the drawing of vertices. - void disable_vertices(); - - /// Enable the drawing of vertices. - void enable_vertices(); - - /// Disable the drawing of edges. - void disable_edges(); - - /// Enable the drawing of edges. - void enable_edges(); + /// Ignore all vertices when `b` is `true`; otherwise ignore only vertices for which `ignore_vertex` returns `true`. + void ignore_all_vertices(bool b); - /// Disable the drawing of faces. - void disable_faces(); - - /// Enable the drawing of faces. - void enable_faces(); + /// Ignore all edges when `b` is `true`; otherwise ignore only edges for which `ignore_edge` returns `true`. + void ignore_all_vertices(bool b); + + /// Ignore all faces when `b` is `true`; otherwise ignore only faces for which `ignore_face` returns `true`. + void ignore_all_vertices(bool b); }; /*! \ingroup PkgBasicViewerClasses -The class `Drawing_functor_with_volume` is used to tune the way that a given data-structure of CGAL is drawn, for a data-structure that contains volumes. -The different std::function can be modified to change the behavior of the drawing. +The class `Cell_parameters_with_volume` is used to tune the way that the cells of a given data-structure of CGAL are considered, for a data-structure that contains volumes. +The different std::function can be modified to change for example the behavior of the drawing. \tparam DS a data structure of CGAL. \tparam VertexDescriptor a descriptor of vertices of DS. @@ -93,26 +84,25 @@ The different std::function can be modified to change the behavior of the drawin */ -// Drawing functor for a 3D data structure -// (with vertices, edges, faces and volumes) +// Cell parameters for a 3D data structure (with vertices, edges, faces and volumes) template -struct Drawing_functor_with_volume : - public Drawing_functor +struct Cell_parameters_with_volume : + public Cell_parameters { public: - /// std::function that returns `true` if the given volume must be drawn, `false` otherwise. - /// Returns `true` by default. - std::function draw_volume; + /// std::function that returns `true` if the given volume must be ignored, `false` otherwise. + /// Returns `false` by default. + std::function ignore_volume; - /// std::function that returns the color of the given volume. + /// std::function that returns `true` if the given volume is colored, `false` otherwise. /// Returns `false` by default. std::function colored_volume; - /// std::function that returns `true` if the given volume is drawn in wireframe, `false` otherwise. + /// std::function that returns `true` if the given volume is in wireframe, `false` otherwise. /// Returns `false` by default. std::function volume_wireframe; @@ -120,11 +110,8 @@ struct Drawing_functor_with_volume : /// nullptr by default. std::function volume_color; - /// Disable the drawing of volumes. - void disable_volumes(); - - /// Enable the drawing of volumes. - void enable_volumes(); + /// Ignore all volumes when `b` is `true`; otherwise ignore only volumes for which `ignore_volume` returns `true`. + void ignore_all_volumes(bool b); }; } // End namespace CGAL diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 2eee9d5810d8..5d3b5faf1ec7 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -3,40 +3,40 @@ namespace CGAL { /*! \ingroup PkgDrawTriangulation2 -opens a new window and draws a triangulation. Parameters of the drawing are taken from the optional drawing functor parameter. +opens a new window and draws a triangulation. Parameters of the drawing are taken from the optional cell parameter. -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 macro `CGAL_USE_BASIC_VIEWER` is defined. +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. \tparam T2 a triangulation class derived from `Triangulation_2` \param at2 the triangulation to draw. -\param df the drawing functor. +\param cp the cell parameters. */ template -void draw(const T2& at2, const CGAL::Drawing_functor& df=default); + typename T2::Finite_faces_iterator>& cp=default); /*! \ingroup PkgDrawTriangulation2 -adds the vertices, edges and faces of at2 into the given graphic storage gs. Parameters of the cells are taken from the optional drawing functor parameter. Note that gs is not clear before to be filled (to enable to draw several data structures in a same basic viewer). +adds the vertices, edges and faces of `at2` into the given graphic storage `gs`. Parameters of the cells are taken from the optional cell parameters `cp` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam T2 a triangulation class derived from `Triangulation_2` \param at2 the triangulation to draw. \param gs the graphic storage to fill. -\param df the drawing functor. +\param cp the cell parameters. */ template void add_in_graphic_storage(const T2& at2, CGAL::Graphic_storage& gs, - const CGAL::Drawing_functor& df=default); + typename T2::Finite_faces_iterator>& cp=default); } /* namespace CGAL */ From 3e71ba95a425aea0a2bc2658bdeb997ccead8126 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 24 Aug 2023 16:58:34 +0200 Subject: [PATCH 166/399] update doc --- .../doc/Basic_viewer/CGAL/Basic_viewer_qt.h | 23 ++++---- .../doc/Basic_viewer/CGAL/Drawing_functor.h | 56 +++++++++---------- .../doc/Basic_viewer/CGAL/Graphic_storage.h | 13 +++-- 3 files changed, 49 insertions(+), 43 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h index 3bfad55352d1..f5ed49c43526 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h @@ -6,15 +6,15 @@ namespace CGAL { The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphic_storage`. Elements can either be added directly in the viewer or through the storage. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. -\tparam BufferType the type used for point coordinates: float by default. +\tparam BufferType the type used for point coordinates: `float` by default. */ template class Basic_viewer_qt : public CGAL::QGLViewer { public: - /// constructor given a pointer on a QWidget (can be a nullptr) and a Graphic_storage. - /// title will be the title of the window. + /// constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphic_storage`. + /// `title` will be the title of the window. Basic_viewer_qt(QWidget* parent, Graphic_storage& buf, const char* title=""); @@ -147,20 +147,20 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); - /// add the given ray in the viewer: an half line starting from p and having v as direction. + /// add the given ray in the viewer: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v); - /// add the given colored ray in the viewer: an half line starting from p and having v as direction. + /// add the given colored ray in the viewer: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - /// add the given line in the viewer, defined by p and v as direction. + /// add the given line in the viewer, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v); - /// add the given colored line in the viewer, defined by p and v as direction. + /// add the given colored line in the viewer, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); @@ -175,13 +175,16 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool is_a_face_started() const; /// add the given point in the current face. + /// @pre `is_a_face_started()` template bool add_point_in_face(const KPoint &kp); /// add the given point in the current face, having the vertex normal. + /// @pre `is_a_face_started()` template bool add_point_in_face(const KPoint &kp, const KVector &p_normal); /// end the current face. + /// @pre `is_a_face_started()` void face_end(); /// add the given text at the given position in the viewer. @@ -220,9 +223,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer /*! \ingroup PkgBasicViewerClasses -The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The QApplication is created in the constructor, but ran by the run method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. +The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The `QApplication` is created in the constructor, but ran by the run method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. -\tparam BufferType the type used for point coordinates: float by default. +\tparam BufferType the type used for point coordinates: `float` by default. */ template @@ -236,7 +239,7 @@ class QApplication_and_basic_viewer /// run the QApplication, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. void run(); - /// @return a reference to the Basic_viewer_qt associated with this. + /// @return a reference to the `Basic_viewer_qt` associated with this. Basic_viewer_qt& basic_viewer(); }; diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index 215d8aebd2c7..1a7435f152b6 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -4,13 +4,13 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Cell_parameters` is used to tune the way that the cells of a given data-structure of CGAL are considered. -The different std::function can be modified to change for example the behavior of the drawing. +The class `Cell_parameters` is used to tune the way that the cells of a given data-structure of \cgal are considered. +The different `std::function` can be modified to change for example the behavior of the drawing. -\tparam DS a data structure of CGAL. -\tparam VertexDescriptor a descriptor of vertices of DS. -\tparam EdgeDescriptor a descriptor of edges of DS. -\tparam FaceDescriptor a descriptor of faces of DS. +\tparam DS a data structure of \cgal. +\tparam VertexDescriptor a descriptor of vertices of `DS`. +\tparam EdgeDescriptor a descriptor of edges of `DS`. +\tparam FaceDescriptor a descriptor of faces of `DS`. */ template ignore_vertex; - /// std::function that returns `true` if the given edge must be ignored, `false` otherwise. + /// `std::function` that returns `true` if the given edge must be ignored, `false` otherwise. /// Returns `true` by default. std::function ignore_edge; - /// std::function that returns `true` if the given face must be ignored, `false` otherwise. + /// `std::function` that returns `true` if the given face must be ignored, `false` otherwise. /// Returns `true` by default. std::function ignore_face; - /// std::function that returns `true` if the given vertex is colored, `false` otherwise. + /// `std::function` that returns `true` if the given vertex is colored, `false` otherwise. /// Returns `false` by default. std::function colored_vertex; - /// std::function that returns `true` if the given edge is colored, `false` otherwise. + /// `std::function` that returns `true` if the given edge is colored, `false` otherwise. /// Returns `false` by default. std::function colored_edge; - /// std::function that returns `true` if the given face is colored, `false` otherwise. + /// `std::function` that returns `true` if the given face is colored, `false` otherwise. /// Returns `false` by default. std::function colored_face; - /// std::function that returns `true` if the given face is in wireframe, `false` otherwise. + /// `std::function` that returns `true` if the given face is in wireframe, `false` otherwise. /// Returns `false` by default. std::function face_wireframe; - /// std::function that returns the color of the given vertex. + /// `std::function` that returns the color of the given vertex. /// nullptr by default. std::function vertex_color; - /// std::function that returns the color of the given edge. + /// `std::function` that returns the color of the given edge. /// nullptr by default. std::function edge_color; - /// std::function that returns the color of the given face. + /// `std::function` that returns the color of the given face. /// nullptr by default. std::function face_color; @@ -65,7 +65,7 @@ struct Cell_parameters /// Ignore all edges when `b` is `true`; otherwise ignore only edges for which `ignore_edge` returns `true`. void ignore_all_vertices(bool b); - + /// Ignore all faces when `b` is `true`; otherwise ignore only faces for which `ignore_face` returns `true`. void ignore_all_vertices(bool b); }; @@ -73,14 +73,14 @@ struct Cell_parameters /*! \ingroup PkgBasicViewerClasses -The class `Cell_parameters_with_volume` is used to tune the way that the cells of a given data-structure of CGAL are considered, for a data-structure that contains volumes. -The different std::function can be modified to change for example the behavior of the drawing. +The class `Cell_parameters_with_volume` is used to tune the way that the cells of a given data-structure of \cgal are considered, for a data-structure that contains volumes. +The different `std::function` can be modified to change for example the behavior of the drawing. -\tparam DS a data structure of CGAL. -\tparam VertexDescriptor a descriptor of vertices of DS. -\tparam EdgeDescriptor a descriptor of edges of DS. -\tparam FaceDescriptor a descriptor of faces of DS. -\tparam VolumeDescriptor a descriptor of volumes of DS. +\tparam DS a data structure of \cgal. +\tparam VertexDescriptor a descriptor of vertices of `DS`. +\tparam EdgeDescriptor a descriptor of edges of `DS`. +\tparam FaceDescriptor a descriptor of faces of `DS`. +\tparam VolumeDescriptor a descriptor of volumes of `DS`. */ @@ -94,19 +94,19 @@ struct Cell_parameters_with_volume : public Cell_parameters { public: - /// std::function that returns `true` if the given volume must be ignored, `false` otherwise. + /// `std::function` that returns `true` if the given volume must be ignored, `false` otherwise. /// Returns `false` by default. std::function ignore_volume; - /// std::function that returns `true` if the given volume is colored, `false` otherwise. + /// `std::function` that returns `true` if the given volume is colored, `false` otherwise. /// Returns `false` by default. std::function colored_volume; - /// std::function that returns `true` if the given volume is in wireframe, `false` otherwise. + /// `std::function` that returns `true` if the given volume is in wireframe, `false` otherwise. /// Returns `false` by default. std::function volume_wireframe; - /// std::function that returns the color of the given volume. + /// `std::function` that returns the color of the given volume. /// nullptr by default. std::function volume_color; diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h index bba0e545a23c..4043357754ac 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h @@ -6,7 +6,7 @@ namespace CGAL { The class `Graphic_storage` store points, segments, triangles, rays and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added, and are triangulated internally. -\tparam BufferType the type used for point coordinates: float by default. +\tparam BufferType the type used for point coordinates: `float` by default. */ template @@ -29,20 +29,20 @@ class Graphic_storage { void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); - /// add the given ray in the storage: an half line starting from p and having v as direction. + /// add the given ray in the storage: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v); - /// add the given colored ray in the storage: an half line starting from p and having v as direction. + /// add the given colored ray in the storage: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - /// add the given line in the storage, defined by p and v as direction. + /// add the given line in the storage, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v); - /// add the given colored line in the storage, defined by p and v as direction. + /// add the given colored line in the storage, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); @@ -57,13 +57,16 @@ class Graphic_storage { bool is_a_face_started() const; /// add the given point in the current face. + /// @pre `is_a_face_started()` template bool add_point_in_face(const KPoint &kp); /// add the given point in the current face, having the vertex normal. + /// @pre `is_a_face_started()` template bool add_point_in_face(const KPoint &kp, const KVector &p_normal); /// end the current face. + /// @pre `is_a_face_started()` void face_end(); /// add the given text at the given position in the storage. From cc03d2ccb3ec2b84e1344cb6de2921a323e7d1fb Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 24 Aug 2023 17:07:30 +0200 Subject: [PATCH 167/399] verbs with s --- .../doc/Basic_viewer/CGAL/Basic_viewer_qt.h | 46 +++++++++---------- .../doc/Basic_viewer/CGAL/Drawing_functor.h | 8 ++-- .../doc/Basic_viewer/CGAL/Graphic_storage.h | 36 +++++++-------- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h index f5ed49c43526..9e4784823523 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h @@ -76,58 +76,58 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// negate the drawing of text (becomes `true` if it was `false` and reciprocally). void negate_draw_text(); - /// @return `true` if vertices are drawn. + /// return `true` if vertices are drawn. bool get_draw_vertices() const; - /// @return `true` if edges are drawn. + /// return `true` if edges are drawn. bool get_draw_edges() const; - /// @return `true` if rays are drawn. + /// return `true` if rays are drawn. bool get_draw_rays() const; - /// @return `true` if lines are drawn. + /// return `true` if lines are drawn. bool get_draw_lines() const; - /// @return `true` if faces are drawn. + /// return `true` if faces are drawn. bool get_draw_faces() const; - /// @return `true` if mono color mode is used. + /// return `true` if mono color mode is used. bool get_use_mono_color() const; - /// @return `true` if normal are reversed. + /// return `true` if normal are reversed. bool get_inverse_normal() const; - /// @return `true` if text are drawn. + /// return `true` if text are drawn. bool get_draw_text() const; - /// @return the mono color used for vertices. + /// return the mono color used for vertices. const CGAL::IO::Color& get_vertices_mono_color() const; - /// @return the mono color used for edges. + /// return the mono color used for edges. const CGAL::IO::Color& get_edges_mono_color() const; - /// @return the mono color used for rays. + /// return the mono color used for rays. const CGAL::IO::Color& get_rays_mono_color() const; - /// @return the mono color used for lines. + /// return the mono color used for lines. const CGAL::IO::Color& get_lines_mono_color() const; - /// @return the mono color used for faces. + /// return the mono color used for faces. const CGAL::IO::Color& get_faces_mono_color() const; /// clear the basic viewer, i.e. remove all its elements. void clear(); - /// @return `true` if the viewer is empty. + /// return `true` if the viewer is empty. bool is_empty() const; - /// @return the bounding box of all the elements in the viewer. + /// return the bounding box of all the elements in the viewer. const CGAL::Bbox_3& bounding_box() const; - /// @return `true` if the clipping plane is enabled. + /// return `true` if the clipping plane is enabled. bool is_clipping_plane_enabled() const; - /// @return the clipping plane when it is enabled. + /// return the clipping plane when it is enabled. Local_kernel::Plane_3 clipping_plane() const; /// add the given point in the viewer. @@ -171,7 +171,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// start a new colored face. void face_begin(const CGAL::IO::Color &acolor); - /// @return `true` iff a face is started. + /// return `true` iff a face is started. bool is_a_face_started() const; /// add the given point in the current face. @@ -195,10 +195,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer template void add_text(const KPoint &kp, const std::string &txt); - /// @return the graphic storage of the viewer. + /// return the graphic storage of the viewer. Graphic_storage& get_graphic_storage(); - /// @return the graphic storage of the viewer, const version. + /// return the graphic storage of the viewer, const version. const Graphic_storage& get_graphic_storage() const; /// negate all normal of vertices and faces. @@ -232,14 +232,14 @@ template class QApplication_and_basic_viewer { public: - /// Constructor given a Graphic_storage and possibly a title. + /// constructs given a Graphic_storage and possibly a title. QApplication_and_basic_viewer(CGAL::Graphic_storage& buffer, const char* title="CGAL Basic Viewer"); - /// run the QApplication, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. + /// runs the QApplication, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. void run(); - /// @return a reference to the `Basic_viewer_qt` associated with this. + /// returns a reference to the `Basic_viewer_qt` associated with this. Basic_viewer_qt& basic_viewer(); }; diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index 1a7435f152b6..8e456f3cc947 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -60,13 +60,13 @@ struct Cell_parameters /// nullptr by default. std::function face_color; - /// Ignore all vertices when `b` is `true`; otherwise ignore only vertices for which `ignore_vertex` returns `true`. + /// ignores all vertices when `b` is `true`; otherwise ignore only vertices for which `ignore_vertex` returns `true`. void ignore_all_vertices(bool b); - /// Ignore all edges when `b` is `true`; otherwise ignore only edges for which `ignore_edge` returns `true`. + /// ignores all edges when `b` is `true`; otherwise ignore only edges for which `ignore_edge` returns `true`. void ignore_all_vertices(bool b); - /// Ignore all faces when `b` is `true`; otherwise ignore only faces for which `ignore_face` returns `true`. + /// ignores all faces when `b` is `true`; otherwise ignore only faces for which `ignore_face` returns `true`. void ignore_all_vertices(bool b); }; @@ -110,7 +110,7 @@ struct Cell_parameters_with_volume : /// nullptr by default. std::function volume_color; - /// Ignore all volumes when `b` is `true`; otherwise ignore only volumes for which `ignore_volume` returns `true`. + /// ignores all volumes when `b` is `true`; otherwise ignore only volumes for which `ignore_volume` returns `true`. void ignore_all_volumes(bool b); }; diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h index 4043357754ac..8eb01c754cb8 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h @@ -4,7 +4,7 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Graphic_storage` store points, segments, triangles, rays and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added, and are triangulated internally. +The class `Graphic_storage` stores points, segments, triangles, rays and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added and are triangulated internally. \tparam BufferType the type used for point coordinates: `float` by default. @@ -12,55 +12,55 @@ The class `Graphic_storage` store points, segments, triangles, rays and lines. E template class Graphic_storage { public: - /// add the given point in the storage. + /// adds the given point in the storage. template void add_point(const KPoint &p); - /// add the given colored point in the storage. + /// adds the given colored point in the storage. template void add_point(const KPoint &p, const CGAL::IO::Color &acolor); - /// add the given segment in the storage. + /// adds the given segment in the storage. template void add_segment(const KPoint &p1, const KPoint &p2); - /// add the given colored segment in the storage. + /// adds the given colored segment in the storage. template void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); - /// add the given ray in the storage: an half line starting from `p` and having `v` as direction. + /// adds the given ray in the storage: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v); - /// add the given colored ray in the storage: an half line starting from `p` and having `v` as direction. + /// adds the given colored ray in the storage: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - /// add the given line in the storage, defined by `p` and `v` as direction. + /// adds the given line in the storage, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v); - /// add the given colored line in the storage, defined by `p` and `v` as direction. + /// adds the given colored line in the storage, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - /// start a new face. + /// starts a new face. void face_begin(); - /// start a new colored face. + /// starts a new colored face. void face_begin(const CGAL::IO::Color &acolor); - /// @return `true` iff a face is started. + /// return `true` iff a face is started. bool is_a_face_started() const; - /// add the given point in the current face. + /// adds the given point in the current face. /// @pre `is_a_face_started()` template bool add_point_in_face(const KPoint &kp); - /// add the given point in the current face, having the vertex normal. + /// adds the given point in the current face, having the vertex normal. /// @pre `is_a_face_started()` template bool add_point_in_face(const KPoint &kp, const KVector &p_normal); @@ -69,18 +69,18 @@ class Graphic_storage { /// @pre `is_a_face_started()` void face_end(); - /// add the given text at the given position in the storage. + /// adds the given text at the given position in the storage. template void add_text(const KPoint &kp, const char *txt); - /// add the given text at the given position in the storage. + /// adds the given text at the given position in the storage. template void add_text(const KPoint &kp, const std::string &txt); - /// @return `true` iff the storage has no element. + /// returns `true` iff the storage has no element. bool is_empty() const; - /// clear the storage, i.e. remove all points, segments, triangles and text. + /// clears the storage, i.e. remove all points, segments, triangles and text. void clear(); }; From f3e3fcd84a3e16762283db5e6b91116fc66e945f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 24 Aug 2023 17:08:58 +0200 Subject: [PATCH 168/399] data structure --- Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index 8e456f3cc947..a66210b8dfae 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -4,7 +4,7 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Cell_parameters` is used to tune the way that the cells of a given data-structure of \cgal are considered. +The class `Cell_parameters` is used to tune the way that the cells of a given data structure of \cgal are considered. The different `std::function` can be modified to change for example the behavior of the drawing. \tparam DS a data structure of \cgal. @@ -73,7 +73,7 @@ struct Cell_parameters /*! \ingroup PkgBasicViewerClasses -The class `Cell_parameters_with_volume` is used to tune the way that the cells of a given data-structure of \cgal are considered, for a data-structure that contains volumes. +The class `Cell_parameters_with_volume` is used to tune the way that the cells of a given data structure of \cgal are considered, for a data structure that contains volumes. The different `std::function` can be modified to change for example the behavior of the drawing. \tparam DS a data structure of \cgal. From b0691143fd12bbe25e988905d558d8d03040ce67 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 24 Aug 2023 17:24:15 +0200 Subject: [PATCH 169/399] more s --- .../doc/Basic_viewer/CGAL/Basic_viewer_qt.h | 132 +++++++++--------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h index 9e4784823523..aa9fc1d13310 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h @@ -13,207 +13,207 @@ template class Basic_viewer_qt : public CGAL::QGLViewer { public: - /// constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphic_storage`. + /// Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphic_storage`. /// `title` will be the title of the window. Basic_viewer_qt(QWidget* parent, Graphic_storage& buf, const char* title=""); - /// enable or disable the drawing of vertices. + /// enables or disables the drawing of vertices. void set_draw_vertices(bool b); - /// enable or disable the drawing of edges. + /// enables or disables the drawing of edges. void set_draw_edges(bool b); - /// enable or disable the drawing of rays. + /// enables or disables the drawing of rays. void set_draw_rays(bool b); - /// enable or disable the drawing of lines. + /// enables or disables the drawing of lines. void set_draw_lines(bool b); - /// enable or disable the drawing of faces. + /// enables or disables the drawing of faces. void set_draw_faces(bool b); - /// enable or disable the use of only one color (if `b` is `true`) or the use of multiple colors (if `b` is `false`). + /// enables or disables the use of only one color (if `b` is `true`) or the use of multiple colors (if `b` is `false`). void set_use_mono_color(bool b); - /// enable or disable the drawing of texts. + /// enables or disables the drawing of texts. void set_draw_text(bool b); - /// set the color used for vertices in mono_color mode. + /// sets the color used for vertices in mono_color mode. void set_vertices_mono_color(const CGAL::IO::Color& c); - /// set the color used for edges in mono_color mode. + /// sets the color used for edges in mono_color mode. void set_edges_mono_color(const CGAL::IO::Color& c); - /// set the color used for rays in mono_color mode. + /// sets the color used for rays in mono_color mode. void set_rays_mono_color(const CGAL::IO::Color& c); - /// set the color used for lines in mono_color mode. + /// sets the color used for lines in mono_color mode. void set_lines_mono_color(const CGAL::IO::Color& c); - /// set the color used for faces in mono_color mode. + /// sets the color used for faces in mono_color mode. void set_faces_mono_color(const CGAL::IO::Color& c); - /// negate the drawing of vertices (becomes `true` if it was `false` and reciprocally). + /// negates the drawing of vertices (becomes `true` if it was `false` and reciprocally). void negate_draw_vertices(); - /// negate the drawing of edges (becomes `true` if it was `false` and reciprocally). + /// negates the drawing of edges (becomes `true` if it was `false` and reciprocally). void negate_draw_edges(); - /// negate the drawing of rays (becomes `true` if it was `false` and reciprocally). + /// negates the drawing of rays (becomes `true` if it was `false` and reciprocally). void negate_draw_rays(); - /// negate the drawing of lines (becomes `true` if it was `false` and reciprocally). + /// negates the drawing of lines (becomes `true` if it was `false` and reciprocally). void negate_draw_lines(); - /// negate the drawing of faces (becomes `true` if it was `false` and reciprocally). + /// negates the drawing of faces (becomes `true` if it was `false` and reciprocally). void negate_draw_faces(); - /// negate the use of mono color mode (becomes `true` if it was `false` and reciprocally). + /// negates the use of mono color mode (becomes `true` if it was `false` and reciprocally). void negate_use_mono_color(); - /// negate the drawing of text (becomes `true` if it was `false` and reciprocally). + /// negates the drawing of text (becomes `true` if it was `false` and reciprocally). void negate_draw_text(); - /// return `true` if vertices are drawn. + /// returns `true` if vertices are drawn. bool get_draw_vertices() const; - /// return `true` if edges are drawn. + /// returns `true` if edges are drawn. bool get_draw_edges() const; - /// return `true` if rays are drawn. + /// returns `true` if rays are drawn. bool get_draw_rays() const; - /// return `true` if lines are drawn. + /// returns `true` if lines are drawn. bool get_draw_lines() const; - /// return `true` if faces are drawn. + /// returns `true` if faces are drawn. bool get_draw_faces() const; - /// return `true` if mono color mode is used. + /// returns `true` if mono color mode is used. bool get_use_mono_color() const; - /// return `true` if normal are reversed. + /// returns `true` if normal are reversed. bool get_inverse_normal() const; - /// return `true` if text are drawn. + /// returns `true` if text are drawn. bool get_draw_text() const; - /// return the mono color used for vertices. + /// returns the mono color used for vertices. const CGAL::IO::Color& get_vertices_mono_color() const; - /// return the mono color used for edges. + /// returns the mono color used for edges. const CGAL::IO::Color& get_edges_mono_color() const; - /// return the mono color used for rays. + /// returns the mono color used for rays. const CGAL::IO::Color& get_rays_mono_color() const; - /// return the mono color used for lines. + /// returns the mono color used for lines. const CGAL::IO::Color& get_lines_mono_color() const; - /// return the mono color used for faces. + /// returns the mono color used for faces. const CGAL::IO::Color& get_faces_mono_color() const; - /// clear the basic viewer, i.e. remove all its elements. + /// clears the basic viewer, i.e. remove all its elements. void clear(); - /// return `true` if the viewer is empty. + /// returns `true` if the viewer is empty. bool is_empty() const; - /// return the bounding box of all the elements in the viewer. + /// returns the bounding box of all the elements in the viewer. const CGAL::Bbox_3& bounding_box() const; - /// return `true` if the clipping plane is enabled. + /// returns `true` if the clipping plane is enabled. bool is_clipping_plane_enabled() const; - /// return the clipping plane when it is enabled. + /// returns the clipping plane when it is enabled. Local_kernel::Plane_3 clipping_plane() const; - /// add the given point in the viewer. + /// adds the given point in the viewer. template void add_point(const KPoint &p); - /// add the given colored point in the viewer. + /// adds the given colored point in the viewer. template void add_point(const KPoint &p, const CGAL::IO::Color &acolor); - /// add the given segment in the viewer. + /// adds the given segment in the viewer. template void add_segment(const KPoint &p1, const KPoint &p2); - /// add the given colored segment in the viewer. + /// adds the given colored segment in the viewer. template void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); - /// add the given ray in the viewer: an half line starting from `p` and having `v` as direction. + /// adds the given ray in the viewer: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v); - /// add the given colored ray in the viewer: an half line starting from `p` and having `v` as direction. + /// adds the given colored ray in the viewer: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - /// add the given line in the viewer, defined by `p` and `v` as direction. + /// adds the given line in the viewer, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v); - /// add the given colored line in the viewer, defined by `p` and `v` as direction. + /// adds the given colored line in the viewer, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - /// start a new face. + /// starts a new face. void face_begin(); - /// start a new colored face. + /// starts a new colored face. void face_begin(const CGAL::IO::Color &acolor); - /// return `true` iff a face is started. + /// returns `true` iff a face is started. bool is_a_face_started() const; - /// add the given point in the current face. - /// @pre `is_a_face_started()` + /// adds the given point in the current face. + /// @pre `is_a_face_started()` template bool add_point_in_face(const KPoint &kp); - /// add the given point in the current face, having the vertex normal. - /// @pre `is_a_face_started()` + /// adds the given point in the current face, having the vertex normal. + /// @pre `is_a_face_started()` template bool add_point_in_face(const KPoint &kp, const KVector &p_normal); - /// end the current face. - /// @pre `is_a_face_started()` + /// ends the current face. + /// @pre `is_a_face_started()` void face_end(); - /// add the given text at the given position in the viewer. + /// adds the given text at the given position in the viewer. template void add_text(const KPoint &kp, const char *txt); - /// add the given text at the given position in the viewer. + /// adds the given text at the given position in the viewer. template void add_text(const KPoint &kp, const std::string &txt); - /// return the graphic storage of the viewer. + /// returns the graphic storage of the viewer. Graphic_storage& get_graphic_storage(); - /// return the graphic storage of the viewer, const version. + /// returns the graphic storage of the viewer, const version. const Graphic_storage& get_graphic_storage() const; - /// negate all normal of vertices and faces. + /// negates all normal of vertices and faces. void negate_all_normals(); - // \return true if the data structure in in 2D, i.e. lies on a plane. + /// returns true if the data structure in in 2D, i.e. lies on a plane. bool is_two_dimensional() const; - /// draw the viewer without recomputing all internal buffers. + /// draws the viewer without recomputing all internal buffers. virtual void draw(); - /// redraw the viewer, i.e. recompute all internal buffers and update the window. + /// redraws the viewer, i.e. recompute all internal buffers and update the window. virtual void redraw(); - /// function called when a key is pressed. Users can define their own function in order + /// Function called when a key is pressed. Users can define their own function in order /// to add specific behavior. std::function *)> on_key_pressed; }; @@ -232,11 +232,11 @@ template class QApplication_and_basic_viewer { public: - /// constructs given a Graphic_storage and possibly a title. + /// Constructor given a `Graphic_storage` and possibly a title. QApplication_and_basic_viewer(CGAL::Graphic_storage& buffer, const char* title="CGAL Basic Viewer"); - /// runs the QApplication, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. + /// runs the `QApplication`, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. void run(); /// returns a reference to the `Basic_viewer_qt` associated with this. From 1b651f14885537fa0e86214351938884d9bcc0b5 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 11 Sep 2023 16:30:44 +0200 Subject: [PATCH 170/399] Doc following Sebastien remarks --- .../doc/Basic_viewer/CGAL/Drawing_functor.h | 2 +- .../doc/Basic_viewer/CGAL/Graphic_storage.h | 2 +- .../doc/Basic_viewer/PackageDescription.txt | 28 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index a66210b8dfae..631cf2c14657 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -84,7 +84,7 @@ The different `std::function` can be modified to change for example the behavior */ -// Cell parameters for a 3D data structure (with vertices, edges, faces and volumes) +// Cell parameters for a volumic data structure (with vertices, edges, faces and volumes) template diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index d5a338e9ebbb..d002f4186e6e 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -35,20 +35,20 @@ \cgalCRPSubsection{Draw for Different Packages} -- Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::draw() \endlink -- Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::draw() \endlink -- Nef_polyhedron_3 \link PkgDrawNef3 CGAL::draw() \endlink -- Periodic_2_Triangulation_2 \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink -- Point_set_3 \link PkgDrawPointSet3D CGAL::draw() \endlink -- Polygon_2 \link PkgDrawPolygon2 CGAL::draw() \endlink -- Polygon_set_2 \link PkgDrawPolygonSet2 CGAL::draw() \endlink -- Polygon_with_holes_2 \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink -- Polyhedron_3 \link PkgDrawPolyhedron CGAL::draw() \endlink -- Surface_mesh \link PkgDrawSurfaceMesh CGAL::draw() \endlink -- Surface_mesh_topology \link PkgDrawFaceGraphWithPaths CGAL::draw() \endlink -- Triangulation_2 \link PkgDrawTriangulation2 CGAL::draw() \endlink -- Triangulation_3 \link PkgDrawTriangulation3 CGAL::draw() \endlink -- Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::draw() \endlink +- `Constrained_triangulation_2` \link PkgDrawTriangulation2 CGAL::draw() \endlink +- `Linear_cell_complex` \link PkgDrawLinearCellComplex CGAL::draw() \endlink +- `Nef_polyhedron_3` \link PkgDrawNef3 CGAL::draw() \endlink +- `Periodic_2_Triangulation_2` \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink +- `Point_set_3` \link PkgDrawPointSet3D CGAL::draw() \endlink +- `Polygon_2` \link PkgDrawPolygon2 CGAL::draw() \endlink +- `Polygon_set_2` \link PkgDrawPolygonSet2 CGAL::draw() \endlink +- `Polygon_with_holes_2` \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink +- `Polyhedron_3` \link PkgDrawPolyhedron CGAL::draw() \endlink +- `Surface_mesh` \link PkgDrawSurfaceMesh CGAL::draw() \endlink +- `Surface_mesh_topology` \link PkgDrawFaceGraphWithPaths CGAL::draw() \endlink +- `Triangulation_2` \link PkgDrawTriangulation2 CGAL::draw() \endlink +- `Triangulation_3` \link PkgDrawTriangulation3 CGAL::draw() \endlink +- `Voronoi_diagram_2` \link PkgDrawVoronoiDiagram2 CGAL::draw() \endlink \cgalCRPSubsection{Fill Graphic Storage for Different Packages} From a54e024a32c7008a5af4f22ee6c618f5a0b95615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 13 Sep 2023 17:59:52 +0200 Subject: [PATCH 171/399] start adding dynamic property maps with default WIP: need updates in all models of face graph --- .../boost/graph/properties_HalfedgeDS_base.h | 8 ++--- .../Non_manifold_feature_map.h | 1 + .../include/CGAL/Dynamic_property_map.h | 20 ++++++------ .../boost/graph/properties_Surface_mesh.h | 32 +++++++++---------- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h index d2a1f11653bb..489caf5e3c75 100644 --- a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h +++ b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h @@ -139,13 +139,13 @@ get(PropertyTag p,CGAL_HDS_CLASS const& g, const Key& key) -#define DECLARE_HDS_DYNAMIC_PM(TAG, DESCRIPTOR) \ +#define DECLARE_HDS_DYNAMIC_PM(TAG, DESCRIPTOR) \ template \ typename boost::property_map::const_type \ -get(const TAG&, const CGAL_HDS_CLASS&) \ -{ \ +get(const TAG&, const CGAL_HDS_CLASS&, const T& dv = T()) \ +{ \ typedef typename boost::graph_traits< CGAL_HDS_CLASS >::DESCRIPTOR descriptor; \ - return internal::Dynamic_property_map(); \ + return internal::Dynamic_property_map(dv); \ } DECLARE_HDS_DYNAMIC_PM(dynamic_vertex_property_t, vertex_descriptor) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Non_manifold_feature_map.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Non_manifold_feature_map.h index 8177a02d178b..51ca7e6587c5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Non_manifold_feature_map.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Non_manifold_feature_map.h @@ -75,6 +75,7 @@ struct Non_manifold_feature_map halfedge_descriptor hd = halfedge(ed, pm); // an edge can be non-manifold only if both its vertices are non-manifold + // THIS IS NOT TRUE! if ( get(v_nm_id, source(hd, pm))==std::size_t(-1) || get(v_nm_id, target(hd, pm))==std::size_t(-1) ) continue; diff --git a/Property_map/include/CGAL/Dynamic_property_map.h b/Property_map/include/CGAL/Dynamic_property_map.h index a7dc48b5354a..818d5e274fe3 100644 --- a/Property_map/include/CGAL/Dynamic_property_map.h +++ b/Property_map/include/CGAL/Dynamic_property_map.h @@ -136,8 +136,8 @@ struct Dynamic_with_index : m_values() {} - Dynamic_with_index(std::size_t num_features) - : m_values( new std::vector(num_features) ) + Dynamic_with_index(std::size_t num_features, Value default_value = Value()) + : m_values( new std::vector(num_features, default_value) ) {} friend reference get(const Dynamic_with_index& m, const key_type& k) @@ -229,34 +229,34 @@ namespace CGAL { template typename boost::property_map >::const_type -get(const CGAL::dynamic_vertex_property_t&, const G&) +get(const CGAL::dynamic_vertex_property_t&, const G&, const T& default_value = T()) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - return internal::Dynamic_property_map(); + return internal::Dynamic_property_map(default_value); } template typename boost::property_map >::const_type -get(const CGAL::dynamic_halfedge_property_t&, const G&) +get(const CGAL::dynamic_halfedge_property_t&, const G&, const T& default_value = T()) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - return internal::Dynamic_property_map(); + return internal::Dynamic_property_map(default_value); } template typename boost::property_map >::const_type -get(const CGAL::dynamic_edge_property_t&, const G&) +get(const CGAL::dynamic_edge_property_t&, const G&, const T& default_value = T()) { typedef typename boost::graph_traits::edge_descriptor edge_descriptor; - return internal::Dynamic_property_map(); + return internal::Dynamic_property_map(default_value); } template typename boost::property_map >::const_type -get(const CGAL::dynamic_face_property_t&, const G&) +get(const CGAL::dynamic_face_property_t&, const G&, const T& default_value = T()) { typedef typename boost::graph_traits::face_descriptor face_descriptor; - return internal::Dynamic_property_map(); + return internal::Dynamic_property_map(default_value); } template diff --git a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h index 281c2b37093e..43fc21f10b3a 100644 --- a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h +++ b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h @@ -353,67 +353,67 @@ namespace CGAL { // get functions for dynamic properties of mutable Surface_mesh template typename boost::property_map, dynamic_vertex_property_t >::type -get(dynamic_vertex_property_t, Surface_mesh& sm) +get(dynamic_vertex_property_t, Surface_mesh& sm, const T& default_value = T()) { typedef typename boost::property_map, dynamic_vertex_property_t >::SMPM SMPM; typedef typename boost::property_map, dynamic_vertex_property_t >::type DPM; - return DPM(sm, new SMPM(sm.template add_property_map::Vertex_index, T>(std::string()).first)); + return DPM(sm, new SMPM(sm.template add_property_map::Vertex_index, T>(std::string(), default_value).first)); } template typename boost::property_map, dynamic_face_property_t >::type -get(dynamic_face_property_t, Surface_mesh& sm) +get(dynamic_face_property_t, Surface_mesh& sm, const T& default_value = T()) { typedef typename boost::property_map, dynamic_face_property_t >::SMPM SMPM; typedef typename boost::property_map, dynamic_face_property_t >::type DPM; - return DPM(sm, new SMPM(sm.template add_property_map::Face_index, T>(std::string()).first)); + return DPM(sm, new SMPM(sm.template add_property_map::Face_index, T>(std::string(), default_value).first)); } template typename boost::property_map, dynamic_edge_property_t >::type -get(dynamic_edge_property_t, Surface_mesh& sm) +get(dynamic_edge_property_t, Surface_mesh& sm, const T& default_value = T()) { typedef typename boost::property_map, dynamic_edge_property_t >::SMPM SMPM; typedef typename boost::property_map, dynamic_edge_property_t >::type DPM; - return DPM(sm, new SMPM(sm.template add_property_map::Edge_index, T>(std::string()).first)); + return DPM(sm, new SMPM(sm.template add_property_map::Edge_index, T>(std::string(), default_value).first)); } template typename boost::property_map, dynamic_halfedge_property_t >::type -get(dynamic_halfedge_property_t, Surface_mesh& sm) +get(dynamic_halfedge_property_t, Surface_mesh& sm, const T& default_value = T()) { typedef typename boost::property_map, dynamic_halfedge_property_t >::SMPM SMPM; typedef typename boost::property_map, dynamic_halfedge_property_t >::type DPM; - return DPM(sm, new SMPM(sm.template add_property_map::Halfedge_index, T>(std::string()).first)); + return DPM(sm, new SMPM(sm.template add_property_map::Halfedge_index, T>(std::string(), default_value).first)); } // get functions for dynamic properties of const Surface_mesh template typename boost::property_map, dynamic_vertex_property_t >::const_type -get(dynamic_vertex_property_t, const Surface_mesh& sm) +get(dynamic_vertex_property_t, const Surface_mesh& sm, const T& default_value = T()) { - return CGAL::internal::Dynamic_with_index::Vertex_index, T>(num_vertices(sm)); + return CGAL::internal::Dynamic_with_index::Vertex_index, T>(num_vertices(sm), default_value); } template typename boost::property_map, dynamic_face_property_t >::const_type -get(dynamic_face_property_t, const Surface_mesh& sm) +get(dynamic_face_property_t, const Surface_mesh& sm, const T& default_value = T()) { - return CGAL::internal::Dynamic_with_index::Face_index, T>(num_faces(sm)); + return CGAL::internal::Dynamic_with_index::Face_index, T>(num_faces(sm), default_value); } template typename boost::property_map, dynamic_halfedge_property_t >::const_type -get(dynamic_halfedge_property_t, const Surface_mesh& sm) +get(dynamic_halfedge_property_t, const Surface_mesh& sm, const T& default_value = T()) { - return CGAL::internal::Dynamic_with_index::Halfedge_index, T>(num_halfedges(sm)); + return CGAL::internal::Dynamic_with_index::Halfedge_index, T>(num_halfedges(sm), default_value); } template typename boost::property_map, dynamic_edge_property_t >::const_type -get(dynamic_edge_property_t, const Surface_mesh& sm) +get(dynamic_edge_property_t, const Surface_mesh& sm, const T& default_value = T()) { - return CGAL::internal::Dynamic_with_index::Edge_index, T>(num_edges(sm)); + return CGAL::internal::Dynamic_with_index::Edge_index, T>(num_edges(sm), default_value); } // implementation detail: required by Dynamic_property_map_deleter From 0ee25cd11c347054764cb828fc63bbb8b7504395 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 25 Sep 2023 08:51:49 +0200 Subject: [PATCH 172/399] After Andreas review --- Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h | 6 +++--- Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h index 631cf2c14657..79fa49f64c9f 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h @@ -60,13 +60,13 @@ struct Cell_parameters /// nullptr by default. std::function face_color; - /// ignores all vertices when `b` is `true`; otherwise ignore only vertices for which `ignore_vertex` returns `true`. + /// ignores all vertices when `b` is `true`; otherwise ignores only vertices for which `ignore_vertex` returns `true`. void ignore_all_vertices(bool b); - /// ignores all edges when `b` is `true`; otherwise ignore only edges for which `ignore_edge` returns `true`. + /// ignores all edges when `b` is `true`; otherwise ignores only edges for which `ignore_edge` returns `true`. void ignore_all_vertices(bool b); - /// ignores all faces when `b` is `true`; otherwise ignore only faces for which `ignore_face` returns `true`. + /// ignores all faces when `b` is `true`; otherwise ignores only faces for which `ignore_face` returns `true`. void ignore_all_vertices(bool b); }; diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h index d15eefe94248..7c1a7e5bdfa2 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h @@ -80,7 +80,7 @@ class Graphic_storage { /// returns `true` iff the storage has no element. bool is_empty() const; - /// clears the storage, i.e. remove all points, segments, triangles and text. + /// clears the storage, i.e. removes all points, segments, triangles and text. void clear(); }; From ebd13c85515cd594a08398418ed729ce5a40288e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Sep 2023 09:13:44 +0200 Subject: [PATCH 173/399] Rename Drawing_functor in Graphics_scene_options (following Andreas and Sebastien review) --- BGL/include/CGAL/draw_face_graph.h | 55 +++++++++---------- .../Basic_viewer/draw_mesh_and_points.cpp | 8 +-- .../Basic_viewer/draw_several_windows.cpp | 2 +- .../Basic_viewer/draw_surface_mesh_height.cpp | 17 +++--- .../draw_surface_mesh_small_faces.cpp | 37 ++++++------- ...ing_functor.h => Graphics_scene_options.h} | 21 ++++--- Point_set_3/include/CGAL/draw_point_set_3.h | 38 ++++++------- Polyhedron/include/CGAL/draw_polyhedron.h | 14 ++--- Surface_mesh/include/CGAL/draw_surface_mesh.h | 24 ++++---- 9 files changed, 111 insertions(+), 105 deletions(-) rename Basic_viewer/include/CGAL/{Drawing_functor.h => Graphics_scene_options.h} (86%) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index fd370e25c47b..f7b9efb4abb9 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -15,7 +15,7 @@ #define CGAL_DRAW_FACE_GRAPH_H #include -#include +#include #include #include #include @@ -24,10 +24,10 @@ namespace CGAL { namespace draw_function_for_FG { -template +template void compute_elements(const FG &fg, CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor &m_drawing_functor) + const GSOptions &m_gs_options) { using Point=typename boost::property_map_value::type; using Kernel = typename CGAL::Kernel_traits::Kernel; @@ -48,7 +48,7 @@ void compute_elements(const FG &fg, get(point_pmap, target(h, fg))), Vector(get(point_pmap, target(h, fg)), get(point_pmap, target(next(h, fg), fg)))); - if (ni != NULL_VECTOR) + if (ni!=NULL_VECTOR) { n += ni; ++i; @@ -58,15 +58,15 @@ void compute_elements(const FG &fg, put(vnormals, v, n / i); } - if (m_drawing_functor.are_faces_enabled()) + if (m_gs_options.are_faces_enabled()) { for (auto fh : faces(fg)) { if (fh != boost::graph_traits::null_face() && // face exists - !m_drawing_functor.face_wireframe(fg, fh) && // face is not wireframe - m_drawing_functor.colored_face(fg, fh)) // and face is colored + !m_gs_options.face_wireframe(fg, fh) && // face is not wireframe + m_gs_options.colored_face(fg, fh)) // and face is colored { - graphic_storage.face_begin(m_drawing_functor.face_color(fg, fh)); + graphic_storage.face_begin(m_gs_options.face_color(fg, fh)); auto hd = halfedge(fh, fg); const auto first_hd = hd; do @@ -81,15 +81,15 @@ void compute_elements(const FG &fg, } } - if(m_drawing_functor.are_edges_enabled()) + if(m_gs_options.are_edges_enabled()) { for (auto e : edges(fg)) { - if(m_drawing_functor.colored_edge(fg, e)) // edge is colored + if(m_gs_options.colored_edge(fg, e)) // edge is colored { graphic_storage.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), get(point_pmap, target(halfedge(e, fg), fg)), - m_drawing_functor.edge_color(fg, e)); + m_gs_options.edge_color(fg, e)); } else { @@ -99,14 +99,14 @@ void compute_elements(const FG &fg, } } - if(m_drawing_functor.are_vertices_enabled()) + if(m_gs_options.are_vertices_enabled()) { for (auto v : vertices(fg)) { - if(m_drawing_functor.colored_vertex(fg, v)) // vertex is colored + if(m_gs_options.colored_vertex(fg, v)) // vertex is colored { graphic_storage.add_point(get(point_pmap, v), - m_drawing_functor.vertex_color(fg, v)); + m_gs_options.vertex_color(fg, v)); } else { @@ -118,30 +118,29 @@ void compute_elements(const FG &fg, } // draw_function_for_FG -template +template void add_in_graphic_storage_for_fg(const FG &fg, - CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor &drawing_functor) + CGAL::Graphic_storage &graphic_storage, + const GSOptions &gs_options) { - draw_function_for_FG::compute_elements(fg, graphic_storage, drawing_functor); + draw_function_for_FG::compute_elements(fg, graphic_storage, gs_options); } template void add_in_graphic_storage_for_fg(const FG &fg, - CGAL::Graphic_storage &graphic_storage) + CGAL::Graphic_storage &graphic_storage) { - Drawing_functor::vertex_descriptor, - typename boost::graph_traits::edge_descriptor, - typename boost::graph_traits::face_descriptor> - drawing_functor; + Graphics_scene_options::vertex_descriptor, + typename boost::graph_traits::edge_descriptor, + typename boost::graph_traits::face_descriptor> + gs_options; - drawing_functor.colored_face = [](const FG&, + gs_options.colored_face = [](const FG&, typename boost::graph_traits::face_descriptor) -> bool { return true; }; - - drawing_functor.face_color = [] (const FG&, + gs_options.face_color = [] (const FG&, typename boost::graph_traits::face_descriptor fh) -> CGAL::IO::Color { if (fh==boost::graph_traits::null_face()) @@ -151,7 +150,7 @@ void add_in_graphic_storage_for_fg(const FG &fg, return get_random_color(CGAL::get_default_random()); }; - add_in_graphic_storage_for_fg(fg, graphic_storage, drawing_functor); + add_in_graphic_storage_for_fg(fg, graphic_storage, gs_options); } } // End namespace CGAL diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index d230becb9d9f..200f4b0928b7 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -17,9 +17,9 @@ typedef CGAL::Polyhedron_3 Polyhedron; using PS3=CGAL::Point_set_3; struct Drawing_functor_green_points: - public CGAL::Drawing_functor + public CGAL::Graphics_scene_options { bool colored_vertex(const PS3&, typename PS3::const_iterator) const { return true; } diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index 0fae3870c9d2..7a6a3497996e 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp index 9c72bf2feaf0..851518b2e861 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -1,17 +1,18 @@ #include #include #include -#include +#include #include -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point; -typedef CGAL::Surface_mesh Mesh; +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_3 Point; +typedef CGAL::Surface_mesh Mesh; -struct Colored_faces_given_height: public CGAL::Drawing_functor +struct Colored_faces_given_height: + public CGAL::Graphics_scene_options { Colored_faces_given_height(const Mesh& sm) { diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 231290527076..d22cd1287062 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -14,19 +14,18 @@ typedef Mesh::Face_index face_descriptor; typedef K::FT FT; template -struct Drawing_functor_small_faces: - public CGAL::Drawing_functor::vertex_descriptor, typename boost::graph_traits::edge_descriptor, typename boost::graph_traits::face_descriptor> { - using Self=Drawing_functor_small_faces; - using Base=CGAL::Drawing_functor::vertex_descriptor, - typename boost::graph_traits::edge_descriptor, - typename boost::graph_traits::face_descriptor>; + using Base=CGAL::Graphics_scene_options::vertex_descriptor, + typename boost::graph_traits::edge_descriptor, + typename boost::graph_traits::face_descriptor>; - Drawing_functor_small_faces(const SM& sm): Base(), m_sm(sm) + Graphics_scene_options_small_faces(const SM& sm): Base(), m_sm(sm) { typename SM::template Property_map faces_size; boost::tie(faces_size, m_with_size)=sm.template property_map("f:size"); @@ -99,37 +98,37 @@ int main(int argc, char* argv[]) for(face_descriptor fd : sm.faces()) { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } - Drawing_functor_small_faces df(sm); + Graphics_scene_options_small_faces gsosm(sm); CGAL::Graphic_storage buffer; - add_in_graphic_storage(sm, buffer, df); + add_in_graphic_storage(sm, buffer, gsosm); CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); if(app) { app.basic_viewer().on_key_pressed= - [&sm, &df, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) { - df.m_threshold+=5; - if(df.m_threshold>100) { df.m_threshold=100; } + gsosm.m_threshold+=5; + if(gsosm.m_threshold>100) { gsosm.m_threshold=100; } basic_viewer->displayMessage - (QString("Small faces threshold=%1.").arg(df.m_threshold)); + (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); basic_viewer->clear(); - add_in_graphic_storage(sm, buffer, df); + add_in_graphic_storage(sm, buffer, gsosm); basic_viewer->redraw(); } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { - if(df.m_threshold<5) { df.m_threshold=0; } - else { df.m_threshold-=5; } + if(gsosm.m_threshold<5) { gsosm.m_threshold=0; } + else { gsosm.m_threshold-=5; } basic_viewer->displayMessage - (QString("Small faces threshold=%1.").arg(df.m_threshold)); + (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); basic_viewer->clear(); - add_in_graphic_storage(sm, buffer, df); + add_in_graphic_storage(sm, buffer, gsosm); basic_viewer->redraw(); } else diff --git a/Basic_viewer/include/CGAL/Drawing_functor.h b/Basic_viewer/include/CGAL/Graphics_scene_options.h similarity index 86% rename from Basic_viewer/include/CGAL/Drawing_functor.h rename to Basic_viewer/include/CGAL/Graphics_scene_options.h index ce69a05a45fc..37f9d39c6560 100644 --- a/Basic_viewer/include/CGAL/Drawing_functor.h +++ b/Basic_viewer/include/CGAL/Graphics_scene_options.h @@ -19,17 +19,24 @@ namespace CGAL { +template +struct Graphics_scene_options; + // Drawing functor for a 2D combinatorial data structure // (with vertices, edges and faces) template -struct Drawing_functor +struct Graphics_scene_options { - Drawing_functor(): m_enabled_vertices(true), - m_enabled_edges(true), - m_enabled_faces(true) + Graphics_scene_options(): m_enabled_vertices(true), + m_enabled_edges(true), + m_enabled_faces(true) { draw_vertex=[](const DS &, vertex_handle)->bool { return true; }; draw_edge=[](const DS &, edge_handle)->bool { return true; }; @@ -82,10 +89,10 @@ template -struct Drawing_functor_with_volume : - public Drawing_functor +struct Graphics_scene_options: + public Graphics_scene_options { - Drawing_functor_with_volume() : m_enabled_volumes(true) + Graphics_scene_options() : m_enabled_volumes(true) { draw_volume=[](const DS &, volume_handle)->bool { return true; }; colored_volume=[](const DS &, volume_handle)->bool { return false; }; 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 32685b4b1acb..05ab50b83a73 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #ifdef DOXYGEN_RUNNING @@ -42,23 +42,23 @@ namespace CGAL { namespace draw_function_for_PointSet { -template +template void compute_elements(const PointSet& pointset, Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (!drawing_functor.are_vertices_enabled()) + if (!gs_options.are_vertices_enabled()) { return; } for (typename PointSet::const_iterator it=pointset.begin(); it!=pointset.end(); ++it) { - if(drawing_functor.draw_vertex(pointset, it)) + if(gs_options.draw_vertex(pointset, it)) { - if (drawing_functor.colored_vertex(pointset, it)) + if (gs_options.colored_vertex(pointset, it)) { graphic_storage.add_point(pointset.point(*it), - drawing_functor.vertex_color(pointset, it)); + gs_options.vertex_color(pointset, it)); } else { graphic_storage.add_point(pointset.point(*it)); } @@ -68,36 +68,36 @@ void compute_elements(const PointSet& pointset, } // namespace draw_function_for_PointSet -template +template void add_in_graphic_storage(const Point_set_3& apointset, - Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + Graphic_storage& graphic_storage, + const GSOptions& gs_options) { draw_function_for_PointSet::compute_elements(apointset, graphic_storage, - drawing_functor); + gs_options); } template void add_in_graphic_storage(const Point_set_3& apointset, - Graphic_storage& graphic_storage) + Graphic_storage& graphic_storage) { - CGAL::Drawing_functor, - typename Point_set_3::const_iterator, - int, int> drawing_functor; - add_in_graphic_storage(apointset, graphic_storage, drawing_functor); + CGAL::Graphics_scene_options, + typename Point_set_3::const_iterator, + int, int> gs_options; + add_in_graphic_storage(apointset, graphic_storage, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. - template + template void draw(const Point_set_3& apointset, - const DrawingFunctor& drawing_functor, + const GSOptions& gs_options, const char *title="Point_set_3 Basic Viewer") { Graphic_storage buffer; - add_in_graphic_storage(apointset, buffer, drawing_functor); + add_in_graphic_storage(apointset, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 5157e5d0fa6b..59f087f6179f 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -33,11 +33,11 @@ template + class GSOptions> void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor &drawing_functor) -{ add_in_graphic_storage_for_fg(apoly, graphic_storage, drawing_functor); } + const GSOptions &gs_options) +{ add_in_graphic_storage_for_fg(apoly, graphic_storage, gs_options); } template + class GSOptions> void draw(const CGAL_POLY_TYPE& apoly, - const DrawingFunctor &drawing_functor, + const GSOptions &gs_options, const char* title="Polyhedron Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage_for_fg(apoly, buffer, drawing_functor); + add_in_graphic_storage_for_fg(apoly, buffer, gs_options); draw_graphic_storage(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 72b83eff6ea9..dbcd8f86c732 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -31,7 +31,7 @@ void draw(const SM& asm); #include #include -#include +#include #include #include #include @@ -40,8 +40,8 @@ namespace CGAL { // Check if there are any color maps that could be used template -struct Drawing_functor_surface_mesh - : public Drawing_functor, +struct Graphics_scene_options_surface_mesh + : public Graphics_scene_options, typename boost::graph_traits<::CGAL::Surface_mesh>::vertex_descriptor, typename boost::graph_traits<::CGAL::Surface_mesh>::edge_descriptor, typename boost::graph_traits<::CGAL::Surface_mesh>::face_descriptor> @@ -51,7 +51,7 @@ struct Drawing_functor_surface_mesh using edge_descriptor = typename boost::graph_traits::edge_descriptor; using face_descriptor = typename boost::graph_traits::face_descriptor; - Drawing_functor_surface_mesh(const SM& amesh) + Graphics_scene_options_surface_mesh(const SM& amesh) { bool found=false; std::tie(vcolors, found)= @@ -94,17 +94,17 @@ struct Drawing_functor_surface_mesh typename SM::template Property_map fcolors; }; -template +template void add_in_graphic_storage(const Surface_mesh& amesh, - CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor &drawing_functor) -{ add_in_graphic_storage_for_fg(amesh, graphic_storage, drawing_functor); } + CGAL::Graphic_storage &graphic_storage, + const GSOptions &gs_options) +{ add_in_graphic_storage_for_fg(amesh, graphic_storage, gs_options); } template void add_in_graphic_storage(const Surface_mesh& amesh, CGAL::Graphic_storage &graphic_storage) { add_in_graphic_storage_for_fg(amesh, graphic_storage, - Drawing_functor_surface_mesh(amesh)); } + Graphics_scene_options_surface_mesh(amesh)); } #ifdef CGAL_USE_BASIC_VIEWER @@ -118,13 +118,13 @@ void draw(const Surface_mesh& amesh, draw_graphic_storage(buffer, title); } -template +template void draw(const Surface_mesh& amesh, - const DrawingFunctor &drawing_functor, + const GSOptions &gs_options, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(amesh, buffer, drawing_functor); + add_in_graphic_storage(amesh, buffer, gs_options); draw_graphic_storage(buffer, title); } From 5cf89dadd9bc539849205fe29ac23ee3b20c9c45 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Sep 2023 09:51:12 +0200 Subject: [PATCH 174/399] Rename Drawing_functor in Graphics_scene_options (following Andreas and Sebastien review) --- .../Basic_viewer/draw_mesh_and_points.cpp | 4 +- .../CGAL/draw_linear_cell_complex.h | 8 +- .../include/CGAL/draw_linear_cell_complex.h | 110 +++++++-------- Nef_3/include/CGAL/draw_nef_3.h | 66 ++++----- .../CGAL/draw_periodic_2_triangulation_2.h | 110 +++++++-------- Polygon/include/CGAL/draw_polygon_2.h | 50 +++---- .../include/CGAL/draw_polygon_with_holes_2.h | 66 ++++----- .../include/CGAL/draw_straight_skeleton_2.h | 68 +++++----- .../Surface_mesh_topology/draw_facewidth.h | 8 +- .../include/CGAL/draw_face_graph_with_paths.h | 58 ++++---- .../polygon_triangulation_drawing_functor.h | 20 +-- .../CGAL/draw_constrained_triangulation_2.h | 2 +- .../include/CGAL/draw_triangulation_2.h | 62 ++++----- .../include/CGAL/draw_triangulation_3.h | 70 +++++----- .../include/CGAL/draw_voronoi_diagram_2.h | 126 +++++++++--------- 15 files changed, 414 insertions(+), 414 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 200f4b0928b7..efb13259a371 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -16,7 +16,7 @@ typedef std::pair Pwn; typedef CGAL::Polyhedron_3 Polyhedron; using PS3=CGAL::Point_set_3; -struct Drawing_functor_green_points: +struct Graphics_scene_options_green_points: public CGAL::Graphics_scene_options @@ -55,7 +55,7 @@ int main(void) { point_set.insert(it.first); } CGAL::Graphic_storage graphic_buffer; - CGAL::add_in_graphic_storage(point_set, graphic_buffer, Drawing_functor_green_points()); + CGAL::add_in_graphic_storage(point_set, graphic_buffer, Graphics_scene_options_green_points()); CGAL::add_in_graphic_storage(output_mesh, graphic_buffer); CGAL::draw_graphic_storage(graphic_buffer); } diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index aee6357e36ef..7d5ccbad9cc6 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -9,16 +9,16 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5 \param alcc the linear cell complex to draw. */ - template - void draw(const LCC& alcc, const DrawingFunctor& afunctor); + template + void draw(const LCC& alcc, const GSOptions& gs_options); /*! \ingroup PkgDrawLinearCellComplex */ - template + template void add_in_graphic_storage(const LCC& alcc, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& afunctor); + const GSOptions& gs_options); } /* namespace CGAL */ 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 1334cf8e7537..4942bef58143 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -57,15 +57,15 @@ struct LCC_geom_utils } }; -template +template void compute_face(const LCC& lcc, typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctorLCC& drawing_functor) + const GSOptionsLCC& gs_options) { - if (!drawing_functor.are_faces_enabled() || - !drawing_functor.draw_face(lcc, dh)) + if (!gs_options.are_faces_enabled() || + !gs_options.draw_face(lcc, dh)) { return; } // We fill only closed faces. @@ -78,13 +78,13 @@ void compute_face(const LCC& lcc, } while (cur!=dh); - if (drawing_functor.colored_volume(lcc, voldh)) + if (gs_options.colored_volume(lcc, voldh)) { - graphic_storage.face_begin(drawing_functor.volume_color(lcc, voldh)); + graphic_storage.face_begin(gs_options.volume_color(lcc, voldh)); } - else if (drawing_functor.colored_face(lcc, dh)) + else if (gs_options.colored_face(lcc, dh)) { - graphic_storage.face_begin(drawing_functor.face_color(lcc, dh)); + graphic_storage.face_begin(gs_options.face_color(lcc, dh)); } else { graphic_storage.face_begin(); } @@ -102,53 +102,53 @@ void compute_face(const LCC& lcc, graphic_storage.face_end(); } -template +template void compute_edge(const LCC& lcc, typename LCC::Dart_const_handle dh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (!drawing_functor.are_edges_enabled() || - !drawing_functor.draw_edge(lcc, dh)) + if (!gs_options.are_edges_enabled() || + !gs_options.draw_edge(lcc, dh)) { return; } const typename LCC::Point& p1=lcc.point(dh); typename LCC::Dart_const_handle d2=lcc.other_extremity(dh); if (d2!=LCC::null_descriptor) { - if (drawing_functor.colored_edge(lcc, dh)) + if (gs_options.colored_edge(lcc, dh)) { graphic_storage.add_segment(p1, lcc.point(d2), - drawing_functor.edge_color(lcc, dh)); + gs_options.edge_color(lcc, dh)); } else { graphic_storage.add_segment(p1, lcc.point(d2)); } } } -template +template void compute_vertex(const LCC& lcc, typename LCC::Dart_const_handle dh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctorLCC& drawing_functor) + const GSOptionsLCC& gs_options) { - if (!drawing_functor.are_vertices_enabled() || - !drawing_functor.draw_vertex(lcc, dh)) + if (!gs_options.are_vertices_enabled() || + !gs_options.draw_vertex(lcc, dh)) { return; } - if (drawing_functor.colored_vertex(lcc, dh)) + if (gs_options.colored_vertex(lcc, dh)) { graphic_storage.add_point(lcc.point(dh), - drawing_functor.vertex_color(lcc, dh)); + gs_options.vertex_color(lcc, dh)); } else { graphic_storage.add_point(lcc.point(dh)); } } -template +template void compute_elements(const LCC& lcc, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { typename LCC::size_type markvolumes = lcc.get_new_mark(); typename LCC::size_type markfaces = lcc.get_new_mark(); @@ -162,7 +162,7 @@ void compute_elements(const LCC& lcc, itend=lcc.darts().end(); it!=itend; ++it) { if (!lcc.is_marked(it, markvolumes) && - drawing_functor.draw_volume(lcc, it)) + gs_options.draw_volume(lcc, it)) { for(typename LCC::template Dart_of_cell_basic_range<3>::const_iterator itv=lcc.template darts_of_cell_basic<3>(it, markvolumes).begin(), @@ -172,13 +172,13 @@ void compute_elements(const LCC& lcc, lcc.mark(itv, markvolumes); if (!lcc.is_marked(itv, markfaces) && lcc.is_marked(itv, oriented_mark) && - drawing_functor.draw_face(lcc, itv)) + gs_options.draw_face(lcc, itv)) { - if ((!drawing_functor.volume_wireframe(lcc, itv) || + if ((!gs_options.volume_wireframe(lcc, itv) || (!lcc.template is_free<3>(itv) && - !drawing_functor.volume_wireframe(lcc, lcc.template opposite<3>(itv)))) && - !drawing_functor.face_wireframe(lcc, itv)) - { compute_face(lcc, itv, it, graphic_storage, drawing_functor); } + !gs_options.volume_wireframe(lcc, lcc.template opposite<3>(itv)))) && + !gs_options.face_wireframe(lcc, itv)) + { compute_face(lcc, itv, it, graphic_storage, gs_options); } for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator itf=lcc.template darts_of_cell_basic<2>(itv, markfaces).begin(), itfend=lcc.template darts_of_cell_basic<2>(itv, markfaces).end(); @@ -186,9 +186,9 @@ void compute_elements(const LCC& lcc, { lcc.mark(itf, markfaces); if (!lcc.is_marked(itf, markedges) && - drawing_functor.draw_edge(lcc, itf)) + gs_options.draw_edge(lcc, itf)) { - compute_edge(lcc, itf, graphic_storage, drawing_functor); + compute_edge(lcc, itf, graphic_storage, gs_options); for(typename LCC::template Dart_of_cell_basic_range<1>::const_iterator ite=lcc.template darts_of_cell_basic<1>(itf, markedges).begin(), iteend=lcc.template darts_of_cell_basic<1>(itf, markedges).end(); @@ -196,9 +196,9 @@ void compute_elements(const LCC& lcc, { lcc.mark(ite, markedges); if (!lcc.is_marked(ite, markvertices) && - drawing_functor.draw_vertex(lcc, ite)) + gs_options.draw_vertex(lcc, ite)) { - compute_vertex(lcc, ite, graphic_storage, drawing_functor); + compute_vertex(lcc, ite, graphic_storage, gs_options); CGAL::mark_cell(lcc, ite, markvertices); } } @@ -233,22 +233,22 @@ void compute_elements(const LCC& lcc, Map, Refs, Storage_> // add_in_graphic_storage: to add a LCC in the given graphic buffer, with a -// drawing functor. +// graphics scene options. template class Map, class Refs, class Storage_, - typename BufferType=float, class DrawingFunctor> + typename BufferType=float, class GSOptions> void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { draw_function_for_lcc::compute_elements(static_cast(alcc), - graphic_storage, drawing_functor); + graphic_storage, gs_options); } // add_in_graphic_storage: to add a LCC in the given graphic buffer, without a -// drawing functor. Use default drawing values. +// graphics scene options. Use default drawing values. template class Map, @@ -256,44 +256,44 @@ template& graphic_storage) { - CGAL::Drawing_functor_with_volume - drawing_functor_with_volume; - - drawing_functor_with_volume.colored_volume = [](const CGAL_LCC_TYPE&, - typename CGAL_LCC_TYPE::Dart_const_handle) -> bool + CGAL::Graphics_scene_options + gs_options; + + gs_options.colored_volume = [](const CGAL_LCC_TYPE&, + typename CGAL_LCC_TYPE::Dart_const_handle) -> bool { return true; }; - drawing_functor_with_volume.volume_color = [] (const CGAL_LCC_TYPE& alcc, - typename CGAL_LCC_TYPE::Dart_const_handle dh) -> CGAL::IO::Color + gs_options.volume_color = [] (const CGAL_LCC_TYPE& alcc, + typename CGAL_LCC_TYPE::Dart_const_handle dh) -> CGAL::IO::Color { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); return get_random_color(random); }; - add_in_graphic_storage(alcc, graphic_storage, drawing_functor_with_volume); + add_in_graphic_storage(alcc, graphic_storage, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER -// Specialization of draw function for a LCC, with a drawing functor. +// Specialization of draw function for a LCC, with a drawing graphics scene options. template class Map, class Refs, class Storage_, - class DrawingFunctor> -void draw(const CGAL_LCC_TYPE& alcc, const DrawingFunctor& drawing_functor, + class GSOptions> +void draw(const CGAL_LCC_TYPE& alcc, const GSOptions& gs_options, const char *title="LCC Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(alcc, buffer, drawing_functor); + add_in_graphic_storage(alcc, buffer, gs_options); draw_graphic_storage(buffer, title); } -// Specialization of draw function for a LCC, without a drawing functor. +// Specialization of draw function for a LCC, without a graphics scene options. template class Map, diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 945f485ae0e1..29a142ede127 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -81,7 +81,7 @@ Local_vector get_vertex_normal(typename Nef_Polyhedron::Vertex_const_handle vh) } // Visitor class to iterate through shell objects -template +template class Nef_Visitor { typedef typename Nef_Polyhedron::Halfedge_const_handle Halfedge_const_handle; @@ -96,30 +96,30 @@ class Nef_Visitor { public: Nef_Visitor(const Nef_Polyhedron&_nef, CGAL::Graphic_storage& _graphic_storage, - const DrawingFunctor&_drawing_functor) : + const GSOptions&_gs_options) : n_faces(0), n_edges(0), nef(_nef), graphic_storage(_graphic_storage), - drawing_functor(_drawing_functor) + gs_options(_gs_options) {} void visit(Vertex_const_handle vh) { - if (!drawing_functor.are_vertices_enabled() || - !drawing_functor.draw_vertex(nef, vh)) + if (!gs_options.are_vertices_enabled() || + !gs_options.draw_vertex(nef, vh)) { return; } - if(drawing_functor.colored_vertex(nef, vh)) + if(gs_options.colored_vertex(nef, vh)) { graphic_storage.add_point(vh->point(), - drawing_functor.vertex_color(nef, vh)); } + gs_options.vertex_color(nef, vh)); } else { graphic_storage.add_point(vh->point()); } } void visit(Halffacet_const_handle opposite_facet) { - if (!drawing_functor.are_faces_enabled() || - !drawing_functor.draw_face(nef, opposite_facet)) + if (!gs_options.are_faces_enabled() || + !gs_options.draw_face(nef, opposite_facet)) { return; } Halffacet_const_handle f=opposite_facet->twin(); @@ -134,8 +134,8 @@ class Nef_Visitor { if(se==0) { return; } //return if not-shalfedge - if(drawing_functor.colored_face(nef, f)) - { graphic_storage.face_begin(drawing_functor.face_color(nef, f)); } + if(gs_options.colored_face(nef, f)) + { graphic_storage.face_begin(gs_options.face_color(nef, f)); } else { graphic_storage.face_begin(); } @@ -181,8 +181,8 @@ class Nef_Visitor { void visit(Halfedge_const_handle he) { - if (!drawing_functor.are_edges_enabled() || - !drawing_functor.draw_edge(nef, he)) + if (!gs_options.are_edges_enabled() || + !gs_options.draw_edge(nef, he)) { return; } Halfedge_const_handle twin=he->twin(); @@ -190,9 +190,9 @@ class Nef_Visitor { edges_done.find(twin)!=edges_done.end()) { return; } // Edge already added - if(drawing_functor.colored_edge(nef, he)) + if(gs_options.colored_edge(nef, he)) { graphic_storage.add_segment(he->source()->point(), he->target()->point(), - drawing_functor.edge_color(nef, he)); } + gs_options.edge_color(nef, he)); } else { graphic_storage.add_segment(he->source()->point(), he->target()->point()); } edges_done[he]=true; @@ -208,14 +208,14 @@ class Nef_Visitor { std::unordered_map facets_done; std::unordered_map edges_done; CGAL::Graphic_storage& graphic_storage; - const DrawingFunctor& drawing_functor; + const GSOptions& gs_options; const Nef_Polyhedron& nef; }; -template +template void compute_elements(const Nef_Polyhedron &nef, CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor &drawing_functor) + const GSOptions &gs_options) { typedef typename Nef_Polyhedron::Volume_const_iterator Volume_const_iterator; @@ -223,8 +223,8 @@ void compute_elements(const Nef_Polyhedron &nef, typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; Volume_const_iterator c; - Nef_Visitor - V(nef, graphic_storage, drawing_functor); + Nef_Visitor + V(nef, graphic_storage, gs_options); CGAL_forall_volumes(c, nef) { Shell_entry_const_iterator it; @@ -241,14 +241,14 @@ void compute_elements(const Nef_Polyhedron &nef, // add_in_graphic_storage template + typename BufferType=float, class GSOptions> void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor &drawing_functor) + const GSOptions &gs_options) { draw_function_for_nef_polyhedron::compute_elements(anef, graphic_storage, - drawing_functor); + gs_options); } template &graphic_storage) { - // Default functor; user can add his own functor. - Drawing_functor - drawing_functor; + gs_options; - drawing_functor.colored_face = [] (const CGAL_NEF3_TYPE&, + gs_options.colored_face = [] (const CGAL_NEF3_TYPE&, typename CGAL_NEF3_TYPE::Halffacet_const_handle) -> bool { return true; }; - drawing_functor.face_color = [] (const CGAL_NEF3_TYPE&, + gs_options.face_color = [] (const CGAL_NEF3_TYPE&, typename CGAL_NEF3_TYPE::Halffacet_const_handle fh) -> CGAL::IO::Color { if (fh==nullptr) // use to get the mono color @@ -277,20 +277,20 @@ void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, return get_random_color(random); }; - add_in_graphic_storage(anef, graphic_storage, drawing_functor); + add_in_graphic_storage(anef, graphic_storage, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function template + typename BufferType=float, class GSOptions> void draw(const CGAL_NEF3_TYPE &anef, - const DrawingFunctor &drawing_functor, + const GSOptions &gs_options, const char *title="Nef Polyhedron Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(anef, buffer, drawing_functor); + add_in_graphic_storage(anef, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 2e8b5410fad8..ca9d7ec52c3a 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -16,22 +16,22 @@ #include #include #include -#include +#include #include #include namespace CGAL { -// We need a specific functor for periodic_2_triangulation_2 for the parameter +// We need a specific graphics view options for periodic_2_triangulation_2 for the parameters // of the domain. template -struct Drawing_functor_periodic_2_triangulation_2 : - public CGAL::Drawing_functor +struct Graphics_scene_options_periodic_2_triangulation_2 : + public CGAL::Graphics_scene_options { - Drawing_functor_periodic_2_triangulation_2(): + Graphics_scene_options_periodic_2_triangulation_2(): domain_color(CGAL::IO::Color(96, 104, 252)), m_draw_domain(true), m_current_display_type(DS::STORED) @@ -66,55 +66,55 @@ struct Drawing_functor_periodic_2_triangulation_2 : namespace draw_function_for_P2T2 { -template +template void compute_vertex(const P2T2 &p2t2, typename P2T2::Periodic_point_iterator pi, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { // Construct the point in 9-sheeted covering space and add to viewer - if(!drawing_functor.draw_vertex(p2t2, pi)) + if(!gs_options.draw_vertex(p2t2, pi)) { return; } - if(drawing_functor.colored_vertex(p2t2, pi)) + if(gs_options.colored_vertex(p2t2, pi)) { graphic_storage.add_point(p2t2.point(*pi), - drawing_functor.vertex_color(p2t2, pi)); } + gs_options.vertex_color(p2t2, pi)); } else { graphic_storage.add_point(p2t2.point(*pi)); } } -template +template void compute_edge(const P2T2 &p2t2, typename P2T2::Periodic_segment_iterator si, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if(!drawing_functor.draw_edge(p2t2, si)) + if(!gs_options.draw_edge(p2t2, si)) { return; } // Construct the segment in 9-sheeted covering space and add to viewer typename P2T2::Segment s(p2t2.segment(*si)); - if(drawing_functor.colored_edge(p2t2, si)) + if(gs_options.colored_edge(p2t2, si)) { graphic_storage.add_segment(s[0], s[1], - drawing_functor.edge_color(p2t2, si)); } + gs_options.edge_color(p2t2, si)); } else { graphic_storage.add_segment(s[0], s[1]); } } -template +template void compute_face(const P2T2 &p2t2, typename P2T2::Periodic_triangle_iterator ti, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if(!drawing_functor.draw_face(p2t2, ti)) + if(!gs_options.draw_face(p2t2, ti)) { return; } // Construct the triangle in 9-sheeted covering space and add to viewer typename P2T2::Triangle t(p2t2.triangle(*ti)); - if(drawing_functor.colored_face(p2t2, ti)) - { graphic_storage.face_begin(drawing_functor.face_color(p2t2, ti)); } + if(gs_options.colored_face(p2t2, ti)) + { graphic_storage.face_begin(gs_options.face_color(p2t2, ti)); } else { graphic_storage.face_begin(); } @@ -124,10 +124,10 @@ void compute_face(const P2T2 &p2t2, graphic_storage.face_end(); } -template +template void compute_domain(const P2T2& p2t2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -145,50 +145,50 @@ void compute_domain(const P2T2& p2t2, Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin()); Kernel::Point_2 p4((orig_domain.max)()); - graphic_storage.add_segment(p1 + shift, p2 + shift, drawing_functor.domain_color); - graphic_storage.add_segment(p1 + shift, p3 + shift, drawing_functor.domain_color); - graphic_storage.add_segment(p2 + shift, p4 + shift, drawing_functor.domain_color); - graphic_storage.add_segment(p3 + shift, p4 + shift, drawing_functor.domain_color); + graphic_storage.add_segment(p1 + shift, p2 + shift, gs_options.domain_color); + graphic_storage.add_segment(p1 + shift, p3 + shift, gs_options.domain_color); + graphic_storage.add_segment(p2 + shift, p4 + shift, gs_options.domain_color); + graphic_storage.add_segment(p3 + shift, p4 + shift, gs_options.domain_color); } } } -template +template void compute_elements(const P2T2& p2t2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { // Get the display type, iterate through periodic elements according // to the display type typedef typename P2T2::Iterator_type Iterator_type; - Iterator_type it_type = (Iterator_type)drawing_functor.current_display_type(); + Iterator_type it_type = (Iterator_type)gs_options.current_display_type(); // Iterate through vertices, edges and faces, add elements to buffer - if(drawing_functor.are_vertices_enabled()) + if(gs_options.are_vertices_enabled()) { for (typename P2T2::Periodic_point_iterator it=p2t2.periodic_points_begin(it_type); it!=p2t2.periodic_points_end(it_type); ++it) - { compute_vertex(p2t2, it, graphic_storage, drawing_functor); } + { compute_vertex(p2t2, it, graphic_storage, gs_options); } } - if(drawing_functor.are_edges_enabled()) + if(gs_options.are_edges_enabled()) { for (typename P2T2::Periodic_segment_iterator it=p2t2.periodic_segments_begin(it_type); it!=p2t2.periodic_segments_end(it_type); ++it) - { compute_edge(p2t2, it, graphic_storage, drawing_functor); } + { compute_edge(p2t2, it, graphic_storage, gs_options); } } - if (drawing_functor.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { for (typename P2T2::Periodic_triangle_iterator it=p2t2.periodic_triangles_begin(it_type); it!=p2t2.periodic_triangles_end(it_type); ++it) - { compute_face(p2t2, it, graphic_storage, drawing_functor); } + { compute_face(p2t2, it, graphic_storage, gs_options); } } - if(drawing_functor.get_draw_domain()) + if(gs_options.get_draw_domain()) { // Compute the (9-sheet covering space) domain of the periodic triangulation - compute_domain(p2t2, graphic_storage, drawing_functor); + compute_domain(p2t2, graphic_storage, gs_options); } } @@ -196,37 +196,37 @@ void compute_elements(const P2T2& p2t2, #define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 -template +template void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - draw_function_for_P2T2::compute_elements(p2t2, graphic_storage, drawing_functor); + draw_function_for_P2T2::compute_elements(p2t2, graphic_storage, gs_options); } template void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, CGAL::Graphic_storage& graphic_storage) { - CGAL::Drawing_functor_periodic_2_triangulation_2 + CGAL::Graphics_scene_options_periodic_2_triangulation_2 drawing_functor; + typename CGAL_P2T2_TYPE::Periodic_triangle_iterator> gs_options; - add_in_graphic_storage(p2t2, graphic_storage, drawing_functor); + add_in_graphic_storage(p2t2, graphic_storage, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function -template +template void draw(const CGAL_P2T2_TYPE& ap2t2, - const DrawingFunctor& drawing_functor, + const GSOptions& gs_options, const char* title="2D Periodic Triangulation Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(ap2t2, buffer, drawing_functor); + add_in_graphic_storage(ap2t2, buffer, gs_options); draw_graphic_storage(buffer); } @@ -235,33 +235,33 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, const char* title="2D Periodic Triangulation Viewer") { CGAL::Graphic_storage buffer; - CGAL::Drawing_functor_periodic_2_triangulation_2 + CGAL::Graphics_scene_options_periodic_2_triangulation_2 drawing_functor; + typename CGAL_P2T2_TYPE::Periodic_triangle_iterator> gs_options; - add_in_graphic_storage(ap2t2, buffer, drawing_functor); + add_in_graphic_storage(ap2t2, buffer, gs_options); QApplication_and_basic_viewer app(buffer, title); if(app) { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&ap2t2, &drawing_functor] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&ap2t2, &gs_options] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { - drawing_functor.increase_current_display_type(); + gs_options.increase_current_display_type(); basic_viewer->displayMessage - (QString("Display type=%1.").arg(drawing_functor.current_display_type()==0?"Stored": - (drawing_functor.current_display_type()==1?"Unique": - (drawing_functor.current_display_type()==2?"Stored cover": + (QString("Display type=%1.").arg(gs_options.current_display_type()==0?"Stored": + (gs_options.current_display_type()==1?"Unique": + (gs_options.current_display_type()==2?"Stored cover": "Unique cover")))); basic_viewer->clear(); draw_function_for_P2T2::compute_elements(ap2t2, basic_viewer->get_graphic_storage(), - drawing_functor); + gs_options); basic_viewer->redraw(); } else diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index cad954ab5df4..9a9c7d2f9139 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #ifdef DOXYGEN_RUNNING @@ -46,20 +46,20 @@ namespace CGAL { namespace draw_function_for_p2 { -template +template void compute_elements(const P2& p2, CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { if (p2.is_empty()) return; typename P2::Point_2 prev=p2.vertex(p2.size()-1); - if (drawing_functor.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { - if(drawing_functor.colored_face(p2, nullptr)) - { graphic_storage.face_begin(drawing_functor.face_color(p2, nullptr)); } + if(gs_options.colored_face(p2, nullptr)) + { graphic_storage.face_begin(gs_options.face_color(p2, nullptr)); } else { graphic_storage.face_begin(); } } @@ -67,31 +67,31 @@ void compute_elements(const P2& p2, for (typename P2::Vertex_const_iterator i=p2.vertices_begin(); i!=p2.vertices_end(); ++i) { - if(drawing_functor.are_vertices_enabled() && - drawing_functor.draw_vertex(p2, i)) + if(gs_options.are_vertices_enabled() && + gs_options.draw_vertex(p2, i)) { // Add vertex - if(drawing_functor.colored_vertex(p2, i)) - { graphic_storage.add_point(*i, drawing_functor.vertex_color(p2, i)); } + if(gs_options.colored_vertex(p2, i)) + { graphic_storage.add_point(*i, gs_options.vertex_color(p2, i)); } else { graphic_storage.add_point(*i); } } - if(drawing_functor.are_edges_enabled() && - drawing_functor.draw_edge(p2, i)) + if(gs_options.are_edges_enabled() && + gs_options.draw_edge(p2, i)) { // Add edge with previous point - if(drawing_functor.colored_vertex(p2, i)) - { graphic_storage.add_segment(prev, *i, drawing_functor.edge_color(p2, i)); } + if(gs_options.colored_vertex(p2, i)) + { graphic_storage.add_segment(prev, *i, gs_options.edge_color(p2, i)); } else { graphic_storage.add_segment(prev, *i); } } - if(drawing_functor.are_faces_enabled()) + if(gs_options.are_faces_enabled()) { graphic_storage.add_point_in_face(*i); } // Add point in face prev = *i; } - if (drawing_functor.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { graphic_storage.face_end(); } } @@ -101,21 +101,21 @@ void compute_elements(const P2& p2, // Specializations of add_in_graphic_storage function -template +template void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawingfunctor) -{ draw_function_for_p2::compute_elements(ap2, graphic_storage, drawingfunctor); } + const GSOptions& gs_options) +{ draw_function_for_p2::compute_elements(ap2, graphic_storage, gs_options); } template void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, CGAL::Graphic_storage &graphic_storage) { - CGAL::Drawing_functor drawingfunctor; - draw_function_for_p2::compute_elements(ap2, graphic_storage, drawingfunctor); + void*> gs_options; + draw_function_for_p2::compute_elements(ap2, graphic_storage, gs_options); } // Specialization of draw function. @@ -131,13 +131,13 @@ void draw(const CGAL_P2_TYPE &ap2, draw_graphic_storage(buffer, title); } -template +template void draw(const CGAL_P2_TYPE &ap2, - const DrawingFunctor& drawingfunctor, + const GSOptions& gs_options, const char *title="Polygon_2 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(ap2, buffer, drawingfunctor); + add_in_graphic_storage(ap2, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 5196b09081e9..1c0683080e5e 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #ifdef DOXYGEN_RUNNING @@ -52,79 +52,79 @@ namespace CGAL namespace draw_function_for_ph2_with_holes { -template +template void compute_one_loop_elements(const P2& ap2, const typename P2::General_polygon_2& aloop, Graphic_storage &graphic_storage, bool hole, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (hole && drawing_functor.are_faces_enabled()) + if (hole && gs_options.are_faces_enabled()) { graphic_storage.add_point_in_face(aloop.vertex(aloop.size()-1)); } typename P2::General_polygon_2::Vertex_const_iterator prev; for(typename P2::General_polygon_2::Vertex_const_iterator i=aloop.vertices_begin(); i!=aloop.vertices_end(); ++i) { - if(drawing_functor.are_vertices_enabled() && - drawing_functor.draw_vertex(ap2, i)) + if(gs_options.are_vertices_enabled() && + gs_options.draw_vertex(ap2, i)) { // Add vertex - if(drawing_functor.colored_vertex(ap2, i)) - { graphic_storage.add_point(*i, drawing_functor.vertex_color(ap2, i)); } + if(gs_options.colored_vertex(ap2, i)) + { graphic_storage.add_point(*i, gs_options.vertex_color(ap2, i)); } else { graphic_storage.add_point(*i); } } if(i!=aloop.vertices_begin() && - drawing_functor.are_edges_enabled() && - drawing_functor.draw_edge(ap2, i)) + gs_options.are_edges_enabled() && + gs_options.draw_edge(ap2, i)) { // Add segment with previous point - if(drawing_functor.colored_vertex(ap2, i)) - { graphic_storage.add_segment(*prev, *i, drawing_functor.edge_color(ap2, i)); } + if(gs_options.colored_vertex(ap2, i)) + { graphic_storage.add_segment(*prev, *i, gs_options.edge_color(ap2, i)); } else { graphic_storage.add_segment(*prev, *i); } } - if(drawing_functor.are_faces_enabled()) + if(gs_options.are_faces_enabled()) { graphic_storage.add_point_in_face(*i); } // Add point in face prev=i; } // Add the last segment between the last point and the first one - if(drawing_functor.are_edges_enabled() && - drawing_functor.draw_edge(ap2, aloop.vertices_begin())) + if(gs_options.are_edges_enabled() && + gs_options.draw_edge(ap2, aloop.vertices_begin())) { graphic_storage.add_segment(*prev, *(aloop.vertices_begin())); } } -template +template void compute_elements(const P2& p2, Graphic_storage &graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { if (p2.outer_boundary().is_empty()) return; - if (drawing_functor.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { - if(drawing_functor.colored_face(p2, nullptr)) - { graphic_storage.face_begin(drawing_functor.face_color(p2, nullptr)); } + if(gs_options.colored_face(p2, nullptr)) + { graphic_storage.face_begin(gs_options.face_color(p2, nullptr)); } else { graphic_storage.face_begin(); } } compute_one_loop_elements(p2, p2.outer_boundary(), graphic_storage, - false, drawing_functor); + false, gs_options); for (typename P2::Hole_const_iterator it=p2.holes_begin(); it!=p2.holes_end(); ++it) { compute_one_loop_elements(p2, *it, graphic_storage, - true, drawing_functor); - if (drawing_functor.are_faces_enabled()) + true, gs_options); + if (gs_options.are_faces_enabled()) { graphic_storage.add_point_in_face(p2.outer_boundary().vertex (p2.outer_boundary().size()-1)); } } - if (drawing_functor.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { graphic_storage.face_end(); } } @@ -132,36 +132,36 @@ void compute_elements(const P2& p2, Graphic_storage &graphic_storage #define CGAL_P2_WITH_HOLES_TYPE CGAL::Polygon_with_holes_2 -template +template void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor &drawing_functor) + const GSOptions &gs_options) { draw_function_for_ph2_with_holes::compute_elements(p2, graphic_storage, - drawing_functor); + gs_options); } template void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, CGAL::Graphic_storage& graphic_storage) { - Drawing_functor drawing_functor; + void*> gs_options; - add_in_graphic_storage(p2, graphic_storage, drawing_functor); + add_in_graphic_storage(p2, graphic_storage, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. -template -void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const DrawingFunctor &drawing_functor, +template +void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const GSOptions &gs_options, const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(ap2, buffer, drawing_functor); + add_in_graphic_storage(ap2, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index a68fb77c38c4..e47cd8a778c3 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -24,19 +24,19 @@ namespace CGAL { namespace draw_function_for_ss2 { -template +template void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (!drawing_functor.draw_edge(ss2, eh)) + if (!gs_options.draw_edge(ss2, eh)) { return; } - if (drawing_functor.colored_edge(ss2, eh)) + if (gs_options.colored_edge(ss2, eh)) { graphic_storage.add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), - drawing_functor.edge_color(ss2, eh)); + gs_options.edge_color(ss2, eh)); } else { @@ -45,14 +45,14 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, } } -template +template void print_halfedge_labels(const SS2& ss2, typename SS2::Halfedge_const_handle h, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - // TODO? a functor different from draw_edge to allow to show only some labels ?? - if(!drawing_functor.draw_edge(ss2, h)) + // TODO? an option different from draw_edge to allow to show only some labels ?? + if(!gs_options.draw_edge(ss2, h)) { return; } std::stringstream label; @@ -65,30 +65,30 @@ void print_halfedge_labels(const SS2& ss2, label.str()); } -template +template void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (!drawing_functor.draw_vertex(ss2, vh)) + if (!gs_options.draw_vertex(ss2, vh)) { return; } - if (drawing_functor.colored_vertex(ss2, vh)) + if (gs_options.colored_vertex(ss2, vh)) { - graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(ss2, vh)); + graphic_storage.add_point(vh->point(), gs_options.vertex_color(ss2, vh)); } else { graphic_storage.add_point(vh->point()); } } -template +template void print_vertex_label(const SS2& ss2, typename SS2::Vertex_const_handle vh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - // TODO? a functor different from draw_vertex to allow to show only some labels ?? - if (!drawing_functor.draw_vertex(ss2, vh)) + // TODO? an option different from draw_vertex to allow to show only some labels ?? + if (!gs_options.draw_vertex(ss2, vh)) { return; } std::stringstream label; @@ -96,31 +96,31 @@ void print_vertex_label(const SS2& ss2, graphic_storage.add_text(vh->point(), label.str()); } -template +template void compute_elements(const SS2& ss2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (!drawing_functor.are_edges_enabled()) + if (!gs_options.are_edges_enabled()) { for (typename SS2::Halfedge_const_iterator it=ss2.halfedges_begin(); it != ss2.halfedges_end(); ++it) { if (it->id()opposite()->id()) { - compute_edge(ss2, it, graphic_storage, drawing_functor); - print_halfedge_labels(ss2, it, graphic_storage, drawing_functor); + compute_edge(ss2, it, graphic_storage, gs_options); + print_halfedge_labels(ss2, it, graphic_storage, gs_options); } } } - if (!drawing_functor.are_vertices_enabled()) + if (!gs_options.are_vertices_enabled()) { for (typename SS2::Vertex_const_iterator it=ss2.vertices_begin(); it!=ss2.vertices_end(); ++it) { - compute_vertex(ss2, it, graphic_storage, drawing_functor); - print_vertex_label(ss2, it, graphic_storage, drawing_functor); + compute_vertex(ss2, it, graphic_storage, gs_options); + print_vertex_label(ss2, it, graphic_storage, gs_options); } } } @@ -129,20 +129,20 @@ void compute_elements(const SS2& ss2, #define CGAL_SS_TYPE CGAL::Straight_skeleton_2 -template +template void add_in_graphic_storage(const CGAL_SS_TYPE &ass2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { draw_function_for_ss2::compute_elements(ass2, graphic_storage, - drawing_functor); + gs_options); } template void add_in_graphic_storage(const CGAL_SS_TYPE& ass2, CGAL::Graphic_storage& graphic_storage) { - Drawing_functor @@ -182,12 +182,12 @@ void add_in_graphic_storage(const CGAL_SS_TYPE& ass2, // Specialization of draw function. #ifdef CGAL_USE_BASIC_VIEWER -template -void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor, +template +void draw(const CGAL_SS_TYPE &ass2, const GSOptions &gs_options, const char *title="Straight Skeleton Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(ass2, buffer, drawingfunctor); + add_in_graphic_storage(ass2, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index 00f35a792bba..e49b3a93f026 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -6,12 +6,12 @@ #ifdef CGAL_USE_BASIC_VIEWER #include -#include +#include template -struct Facewidth_draw_functor +struct Facewidth_graphics_scene_options { - Facewidth_draw_functor(typename ALCC::size_type amark1, typename ALCC::size_type amark2) : + Facewidth_graphics_scene_options(typename ALCC::size_type amark1, typename ALCC::size_type amark2) : m_vertex_mark(amark1), m_face_mark(amark2) {} @@ -107,7 +107,7 @@ void draw_facewidth(const LCC& lcc, { lcc.template mark_cell<2>(cycle[i], face_mark); } } - Facewidth_draw_functor df(vertex_mark, face_mark); + Facewidth_graphics_scene_options df(vertex_mark, face_mark); CGAL::draw(lcc, df, "Face width"); lcc.free_mark(vertex_mark); diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 9c557b81f6a0..454316d4c3ab 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -30,15 +30,15 @@ namespace CGAL { -// Specific drawing functor +// Specific graphics scene options template -struct Drawing_functor_face_graph_with_paths : - public CGAL::Drawing_functor +struct Graphics_scene_options_face_graph_with_paths : + public CGAL::Graphics_scene_options { - Drawing_functor_face_graph_with_paths(std::size_t nbpaths): m_nbpaths(nbpaths) + Graphics_scene_options_face_graph_with_paths(std::size_t nbpaths): m_nbpaths(nbpaths) { color_of_path=[](std::size_t i)->CGAL::IO::Color { @@ -141,14 +141,14 @@ const typename CGAL::Get_traits::Point& get_point return CGAL::Get_traits::get_point(mesh, dh); } -template +template void compute_face(const Mesh& mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, CGAL::Graphic_storage& graphic_storage, - DrawingFunctor& drawing_functor) + GSOptions& gs_options) { - if(!drawing_functor.draw_face(lcc, dh)) + if(!gs_options.draw_face(lcc, dh)) { return; } typedef typename Get_map::type LCC; @@ -170,8 +170,8 @@ void compute_face(const Mesh& mesh, } while(cur!=dh); - if(drawing_functor.colored_face(lcc, dh)) - { graphic_storage.face_begin(drawing_functor.face_color(lcc, dh)); } + if(gs_options.colored_face(lcc, dh)) + { graphic_storage.face_begin(gs_options.face_color(lcc, dh)); } else { graphic_storage.face_begin(); } @@ -188,16 +188,16 @@ void compute_face(const Mesh& mesh, graphic_storage.face_end(); } -template +template void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, typename Get_map::type::size_type m_amark, CGAL::Graphic_storage& graphic_storage, - DrawingFunctor& drawing_functor, + GSOptions& gs_options, bool draw_marked_darts=true) { - if(!drawing_functor.draw_edge(lcc, dh)) + if(!gs_options.draw_edge(lcc, dh)) { return; } typedef typename Get_map::type LCC; @@ -242,7 +242,7 @@ template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, CGAL::Graphic_storage& graphic_storage, - DrawingFunctor& drawing_functor) + GSOptions& gs_options) { typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; @@ -263,7 +263,7 @@ void compute_path(const Mesh &mesh, typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - if ((*m_paths)[i].is_empty() || !drawing_functor.draw_path(i)) + if ((*m_paths)[i].is_empty() || !gs_options.draw_path(i)) { return; } CGAL::Random random(static_cast(i)); @@ -280,10 +280,10 @@ void compute_path(const Mesh &mesh, } } -template +template void compute_elements(const Mesh &mesh, CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor &m_drawing_functor, + const GSOptions &m_gs_options, const std::vector>* m_paths, typename Get_map::type::size_type amark) { @@ -369,17 +369,17 @@ void compute_elements(const Mesh &mesh, } // namespace draw_function_for_face_graph_with_paths -template +template void add_in_graphic_storage(const Mesh& mesh, CGAL::Graphic_storage& graphic_storage, const std::vector>* paths, - const DrawingFunctor& drawing_functor, + const GSOptions& gs_options, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) { draw_function_for_face_graph_with_paths::compute_elements(mesh, graphic_storage, - drawing_functor, + gs_options, paths, amark); } @@ -390,14 +390,14 @@ void add_in_graphic_storage(const Mesh& mesh, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) { - // Default functor; user can add his own functor. - Drawing_functor::type::Dart_const_descriptor /*vh*/, typename Get_map::type::Dart_const_descriptor /*eh*/, typename Get_map::type::Dart_const_descriptor /*fh*/> - drawing_functor; + gs_options; - add_in_graphic_storage(mesh, graphic_storage, drawing_functor, paths, amark); + add_in_graphic_storage(mesh, graphic_storage, gs_options, paths, amark); } #ifdef CGAL_USE_BASIC_VIEWER @@ -414,16 +414,16 @@ void draw(const Mesh& mesh, draw_graphic_storage(buffer, title); } -template +template void draw(const Mesh& mesh, const std::vector >& paths, - const DrawingFunctor& drawing_functor, + const GSOptions& gs_options, typename Get_map::type::size_type amark= (std::numeric_limits::type::size_type>::max)(), const char* title="Mesh Viewer With Path") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(mesh, buffer, drawing_functor, &paths, amark); + add_in_graphic_storage(mesh, buffer, gs_options, &paths, amark); draw_graphic_storage(buffer, title); } @@ -457,10 +457,10 @@ namespace CGAL std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< + template void draw(const Mesh&, const std::vector >&, - const DrawingFunctor&, + const GSOptions&, typename Get_map::type::size_type= (std::numeric_limits::type::size_type>::max)(), const char* ="") diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h index b1750169c7d7..85a70dc23f82 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h @@ -13,7 +13,7 @@ #define CGAL_POLYGON_TRIANGULATION_DRAWING_FUNCTOR_H #include -#include +#include #include #include #include @@ -22,14 +22,14 @@ namespace CGAL { template -struct Polygon_triangulation_drawing_functor : - public CGAL::Drawing_functor { template - Polygon_triangulation_drawing_functor(IPM ipm) + Polygon_triangulation_gs_options(IPM ipm) { this->colored_face = [](const PT&, const typename PT::Finite_faces_iterator) -> bool @@ -59,23 +59,23 @@ struct Polygon_triangulation_drawing_functor : #define CGAL_CT2_TYPE CGAL::Constrained_Delaunay_triangulation_2 template + typename BufferType=float, class GSOptions> void add_in_graphic_storage(const CGAL_CT2_TYPE& ct2, CGAL::Graphic_storage& graphic_buffer, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - draw_function_for_t2::compute_elements(ct2, graphic_buffer, drawing_functor); + draw_function_for_t2::compute_elements(ct2, graphic_buffer, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. -template -void draw(const CGAL_CT2_TYPE &ct2, const DrawingFunctor &drawingfunctor, +template +void draw(const CGAL_CT2_TYPE &ct2, const GSOptions &gs_options, const char *title="Constrained Triangulation_2 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(ct2, buffer, drawingfunctor); + add_in_graphic_storage(ct2, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index 36f413b20a74..fb1a912addbc 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -32,7 +32,7 @@ void add_in_graphic_storage(const CGAL_T2_TYPE& at2, InDomainPmap ipm, { using BASET2=CGAL::Triangulation_2; - Drawing_functor diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index aa04b819889e..84134c0cde0b 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -24,17 +24,17 @@ namespace CGAL { namespace draw_function_for_t2 { -template +template void compute_face(const T2& t2, typename T2::Finite_faces_iterator fh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (!drawing_functor.draw_face(t2, fh)) + if (!gs_options.draw_face(t2, fh)) { return; } - if (drawing_functor.colored_face(t2, fh)) - { graphic_storage.face_begin(drawing_functor.face_color(t2, fh)); } + if (gs_options.colored_face(t2, fh)) + { graphic_storage.face_begin(gs_options.face_color(t2, fh)); } else { graphic_storage.face_begin(); } @@ -45,20 +45,20 @@ void compute_face(const T2& t2, graphic_storage.face_end(); } -template +template void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (!drawing_functor.draw_edge(t2, eh)) + if (!gs_options.draw_edge(t2, eh)) { return; } - if (drawing_functor.colored_edge(t2, eh)) + if (gs_options.colored_edge(t2, eh)) { graphic_storage.add_segment (eh->first->vertex(eh->first->cw(eh->second))->point(), eh->first->vertex(eh->first->ccw(eh->second))->point(), - drawing_functor.edge_color(t2, eh)); + gs_options.edge_color(t2, eh)); } else { @@ -68,17 +68,17 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, } } -template +template void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (!drawing_functor.draw_vertex(t2, vh)) + if (!gs_options.draw_vertex(t2, vh)) { return; } - if (drawing_functor.colored_vertex(t2, vh)) + if (gs_options.colored_vertex(t2, vh)) { - graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(t2, vh)); + graphic_storage.add_point(vh->point(), gs_options.vertex_color(t2, vh)); } else { @@ -86,30 +86,30 @@ void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, } } -template +template void compute_elements(const T2& t2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (drawing_functor.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { for (typename T2::Finite_faces_iterator it=t2.finite_faces_begin(); it!=t2.finite_faces_end(); ++it) - { compute_face(t2, it, graphic_storage, drawing_functor); } + { compute_face(t2, it, graphic_storage, gs_options); } } - if (drawing_functor.are_edges_enabled()) + if (gs_options.are_edges_enabled()) { for (typename T2::Finite_edges_iterator it=t2.finite_edges_begin(); it!=t2.finite_edges_end(); ++it) - { compute_edge(t2, it, graphic_storage, drawing_functor); } + { compute_edge(t2, it, graphic_storage, gs_options); } } - if (drawing_functor.are_vertices_enabled()) + if (gs_options.are_vertices_enabled()) { for (typename T2::Finite_vertices_iterator it=t2.finite_vertices_begin(); it!=t2.finite_vertices_end(); ++it) - { compute_vertex(t2, it, graphic_storage, drawing_functor); } + { compute_vertex(t2, it, graphic_storage, gs_options); } } } @@ -117,19 +117,19 @@ void compute_elements(const T2& t2, #define CGAL_T2_TYPE CGAL::Triangulation_2 -template +template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - draw_function_for_t2::compute_elements(at2, graphic_storage, drawing_functor); + draw_function_for_t2::compute_elements(at2, graphic_storage, gs_options); } template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, CGAL::Graphic_storage& graphic_storage) { - Drawing_functor @@ -152,12 +152,12 @@ void add_in_graphic_storage(const CGAL_T2_TYPE& at2, #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. -template -void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor, +template +void draw(const CGAL_T2_TYPE &at2, const GSOptions &gs_options, const char *title="Triangulation_2 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(at2, buffer, drawingfunctor); + add_in_graphic_storage(at2, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 7c2d080d9541..32a4e93eb9ff 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -25,16 +25,16 @@ namespace CGAL { namespace draw_function_for_t3 { -template +template void compute_face(typename T3::Finite_facets_iterator fh, - const DrawingFunctor& drawing_functor, + const GSOptions& gs_options, CGAL::Graphic_storage& graphic_storage, const T3 *t3) { - if(!drawing_functor.draw_face(*t3, fh)) + if(!gs_options.draw_face(*t3, fh)) { return; } - if(drawing_functor.colored_face(*t3, fh)) - { graphic_storage.face_begin(drawing_functor.face_color(*t3, fh)); } + if(gs_options.colored_face(*t3, fh)) + { graphic_storage.face_begin(gs_options.face_color(*t3, fh)); } else { graphic_storage.face_begin(); } @@ -48,19 +48,19 @@ void compute_face(typename T3::Finite_facets_iterator fh, graphic_storage.face_end(); } -template +template void compute_edge(typename T3::Finite_edges_iterator eh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor, const T3* t3) + const GSOptions& gs_options, const T3* t3) { - if(!drawing_functor.draw_edge(*t3, eh)) + if(!gs_options.draw_edge(*t3, eh)) { return; } - if(drawing_functor.colored_edge(*t3, eh)) + if(gs_options.colored_edge(*t3, eh)) { graphic_storage.add_segment(eh->first->vertex(eh->second)->point(), eh->first->vertex(eh->third)->point(), - drawing_functor.edge_color(*t3, eh)); + gs_options.edge_color(*t3, eh)); } else { graphic_storage.add_segment(eh->first->vertex(eh->second)->point(), @@ -68,46 +68,46 @@ void compute_edge(typename T3::Finite_edges_iterator eh, } } -template +template void compute_vertex(typename T3::Vertex_handle vh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor, const T3* t3) + const GSOptions& gs_options, const T3* t3) { - if(!drawing_functor.draw_vertex(*t3, vh)) + if(!gs_options.draw_vertex(*t3, vh)) { return; } - if(drawing_functor.colored_vertex(*t3, vh)) + if(gs_options.colored_vertex(*t3, vh)) { - graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(*t3, vh)); + graphic_storage.add_point(vh->point(), gs_options.vertex_color(*t3, vh)); } else { graphic_storage.add_point(vh->point()); } } -template +template void compute_elements(const T3* t3, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if (drawing_functor.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { for (typename T3::Finite_facets_iterator it=t3->finite_facets_begin(); it!=t3->finite_facets_end(); ++it) - { compute_face(it, drawing_functor, graphic_storage, t3); } + { compute_face(it, gs_options, graphic_storage, t3); } } - if (drawing_functor.are_edges_enabled()) + if (gs_options.are_edges_enabled()) { for (typename T3::Finite_edges_iterator it=t3->finite_edges_begin(); it!=t3->finite_edges_end(); ++it) - { compute_edge(it, graphic_storage,drawing_functor, t3); } + { compute_edge(it, graphic_storage,gs_options, t3); } } - if (drawing_functor.are_vertices_enabled()) + if (gs_options.are_vertices_enabled()) { for (typename T3::Finite_vertices_iterator it=t3->finite_vertices_begin(); it!=t3->finite_vertices_end(); ++it) - { compute_vertex(it, graphic_storage, drawing_functor, t3); } + { compute_vertex(it, graphic_storage, gs_options, t3); } } } @@ -116,12 +116,12 @@ void compute_elements(const T3* t3, #define CGAL_T3_TYPE CGAL::Triangulation_3 template + typename BufferType=float, class GSOptions> void add_in_graphic_storage(const CGAL_T3_TYPE& at3, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - draw_function_for_t3::compute_elements(&at3, graphic_storage, drawing_functor); + draw_function_for_t3::compute_elements(&at3, graphic_storage, gs_options); } template & graphic_storage) { - CGAL::Drawing_functor - drawing_functor; + gs_options; - drawing_functor.colored_face = + gs_options.colored_face = [](const CGAL_T3_TYPE &, const typename CGAL_T3_TYPE::Finite_facets_iterator) -> bool { return true; }; - drawing_functor.face_color = + gs_options.face_color = [](const CGAL_T3_TYPE &at3, const typename CGAL_T3_TYPE::Finite_facets_iterator fh) -> CGAL::IO::Color { if (fh==at3.finite_facets_end()) // use to get the mono color @@ -151,18 +151,18 @@ void add_in_graphic_storage(const CGAL_T3_TYPE& at3, return get_random_color(random); }; - add_in_graphic_storage(at3, graphic_storage, drawing_functor); + add_in_graphic_storage(at3, graphic_storage, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. -template -void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor, +template +void draw(const CGAL_T3_TYPE &at3, const GSOptions &gs_options, const char *title="T3 Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(at3, buffer, drawingfunctor); + add_in_graphic_storage(at3, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 60ff01d36b35..6d6ed974f8b9 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -27,16 +27,16 @@ namespace CGAL { -// We need a specific functor for voronoi2 in order to allow to differentiate -// voronoi and dual vertices, and to manage rays. +// We need a specific graphics scene option for voronoi2 in order to allow +// to differentiate voronoi and dual vertices, and to manage rays. template -struct Drawing_functor_voronoi : - public CGAL::Drawing_functor +struct Graphics_scene_options_voronoi : + public CGAL::Graphics_scene_options { - Drawing_functor_voronoi() : m_draw_voronoi_vertices(true), + Graphics_scene_options_voronoi() : m_draw_voronoi_vertices(true), m_draw_dual_vertices(true), dual_vertex_color(CGAL::IO::Color(50, 100, 180)), ray_color(CGAL::IO::Color(100, 0, 0)), @@ -69,43 +69,43 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; -template +template void compute_vertex(const V2& v2, typename V2::Vertex_iterator vh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if(!drawing_functor.draw_vertex(v2, vh)) + if(!gs_options.draw_vertex(v2, vh)) { return; } - if(drawing_functor.colored_vertex(v2, vh)) - { graphic_storage.add_point(vh->point(), drawing_functor.vertex_color(v2, vh)); } + if(gs_options.colored_vertex(v2, vh)) + { graphic_storage.add_point(vh->point(), gs_options.vertex_color(v2, vh)); } else { graphic_storage.add_point(vh->point()); } } -template +template void compute_dual_vertex(const V2& /*v2*/, typename V2::Delaunay_graph::Finite_vertices_iterator vi, CGAL::Graphic_storage &graphic_storage, - const DrawingFunctor& drawing_functor) -{ graphic_storage.add_point(vi->point(), drawing_functor.dual_vertex_color); } + const GSOptions& gs_options) +{ graphic_storage.add_point(vi->point(), gs_options.dual_vertex_color); } -template +template void add_segments_and_update_bounding_box(const V2& v2, typename V2::Halfedge_iterator he, CGAL::Graphic_storage& graphic_storage, - DrawingFunctor& drawing_functor) + GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; if (he->is_segment()) { - if(drawing_functor.colored_edge(v2, he)) + if(gs_options.colored_edge(v2, he)) { graphic_storage.add_segment(he->source()->point(), he->target()->point(), - drawing_functor.edge_color(v2, he)); + gs_options.edge_color(v2, he)); } else { @@ -221,11 +221,11 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, } // Halfedge_const_handle -template +template void compute_rays_and_bisectors(const V2&, typename V2::Halfedge_iterator he, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef typename V2::Delaunay_vertex_handle Delaunay_vertex_const_handle; @@ -240,28 +240,28 @@ void compute_rays_and_bisectors(const V2&, if (he->has_source()) { // add_ray_segment(he->source()->point(), get_second_point(he, graphic_storage.get_bounding_box())); - graphic_storage.add_ray(he->source()->point(), direction, drawing_functor.ray_color); + graphic_storage.add_ray(he->source()->point(), direction, gs_options.ray_color); } } else if (he->is_bisector()) { Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, (v1->point().y() + v2->point().y()) / 2); - graphic_storage.add_line(pointOnLine, direction, drawing_functor.bisector_color); + graphic_storage.add_line(pointOnLine, direction, gs_options.bisector_color); } } -template +template void compute_face(const V2& v2, typename V2::Face_iterator fh, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& m_drawing_functor) + const GSOptions& m_gs_options) { - if(fh->is_unbounded() || !m_drawing_functor.draw_face(v2, fh)) + if(fh->is_unbounded() || !m_gs_options.draw_face(v2, fh)) { return; } - if(m_drawing_functor.colored_face(v2, fh)) - { graphic_storage.face_begin(m_drawing_functor.face_color(v2, fh)); } + if(m_gs_options.colored_face(v2, fh)) + { graphic_storage.face_begin(m_gs_options.face_color(v2, fh)); } else { graphic_storage.face_begin(); } typename V2::Ccb_halfedge_circulator ec_start=fh->ccb(); @@ -286,48 +286,48 @@ void compute_face(const V2& v2, // } } -template +template void compute_elements(const V2& v2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& drawing_functor) + const GSOptions& gs_options) { - if(drawing_functor.are_vertices_enabled()) + if(gs_options.are_vertices_enabled()) { // Draw the voronoi vertices - if (drawing_functor.are_voronoi_vertices_enabled()) + if (gs_options.are_voronoi_vertices_enabled()) { for (typename V2::Vertex_iterator it=v2.vertices_begin(); it!=v2.vertices_end(); ++it) - { compute_vertex(v2, it, graphic_storage, drawing_functor); } + { compute_vertex(v2, it, graphic_storage, gs_options); } } // Draw the dual vertices - if (drawing_functor.are_dual_vertices_enabled()) + if (gs_options.are_dual_vertices_enabled()) { for (typename V2::Delaunay_graph::Finite_vertices_iterator it=v2.dual().finite_vertices_begin(); it!=v2.dual().finite_vertices_end(); ++it) - { compute_dual_vertex(v2, it, graphic_storage, drawing_functor); } + { compute_dual_vertex(v2, it, graphic_storage, gs_options); } } } - if(drawing_functor.are_edges_enabled()) + if(gs_options.are_edges_enabled()) { // Add segments and update bounding box for (typename V2::Halfedge_iterator it=v2.halfedges_begin(); it!=v2.halfedges_end(); ++it) { add_segments_and_update_bounding_box(v2, it, - graphic_storage, drawing_functor); } + graphic_storage, gs_options); } } for (typename V2::Halfedge_iterator it=v2.halfedges_begin(); it!=v2.halfedges_end(); ++it) - { compute_rays_and_bisectors(v2, it, graphic_storage, drawing_functor); } + { compute_rays_and_bisectors(v2, it, graphic_storage, gs_options); } - if (drawing_functor.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { for (typename V2::Face_iterator it=v2.faces_begin(); it!=v2.faces_end(); ++it) - { compute_face(v2, it, graphic_storage, drawing_functor); } + { compute_face(v2, it, graphic_storage, gs_options); } } } @@ -336,39 +336,39 @@ void compute_elements(const V2& v2, #define CGAL_VORONOI_TYPE CGAL::Voronoi_diagram_2 template + typename BufferType=float, class GSOptions> void add_in_graphic_storage(const CGAL_VORONOI_TYPE &v2, CGAL::Graphic_storage& graphic_storage, - const DrawingFunctor& m_drawing_functor) + const GSOptions& m_gs_options) { - draw_function_for_v2::compute_elements(v2, graphic_storage, m_drawing_functor); + draw_function_for_v2::compute_elements(v2, graphic_storage, m_gs_options); } template void add_in_graphic_storage(const CGAL_VORONOI_TYPE& v2, CGAL::Graphic_storage& graphic_storage) { - // Default functor; user can add his own functor. - CGAL::Drawing_functor_voronoi - drawing_functor; + gs_options; - add_in_graphic_storage(v2, graphic_storage, drawing_functor); + add_in_graphic_storage(v2, graphic_storage, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. template + typename BufferType=float, class GSOptions> void draw(const CGAL_VORONOI_TYPE& av2, - const DrawingFunctor& drawing_functor, + const GSOptions& gs_options, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphic_storage buffer; - add_in_graphic_storage(av2, buffer, drawing_functor); + add_in_graphic_storage(av2, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -378,20 +378,20 @@ void draw(const CGAL_VORONOI_TYPE& av2, { CGAL::Graphic_storage buffer; - CGAL::Drawing_functor_voronoi - drawing_functor; + gs_options; - add_in_graphic_storage(av2, buffer, drawing_functor); + add_in_graphic_storage(av2, buffer, gs_options); QApplication_and_basic_viewer app(buffer, title); if(app) { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&av2, &drawing_functor] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&av2, &gs_options] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) @@ -404,33 +404,33 @@ void draw(const CGAL_VORONOI_TYPE& av2, } else if ((e->key() == ::Qt::Key_V) && (modifiers == ::Qt::ShiftModifier)) { - if(drawing_functor.are_voronoi_vertices_enabled()) - { drawing_functor.disable_voronoi_vertices(); } - else { drawing_functor.enable_voronoi_vertices(); } + if(gs_options.are_voronoi_vertices_enabled()) + { gs_options.disable_voronoi_vertices(); } + else { gs_options.enable_voronoi_vertices(); } basic_viewer->displayMessage (QString("Voronoi vertices=%1."). - arg(drawing_functor.are_voronoi_vertices_enabled()?"true":"false")); + arg(gs_options.are_voronoi_vertices_enabled()?"true":"false")); basic_viewer->clear(); draw_function_for_v2::compute_elements(av2, basic_viewer->get_graphic_storage(), - drawing_functor); + gs_options); basic_viewer->redraw(); } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { - if(drawing_functor.are_dual_vertices_enabled()) - { drawing_functor.disable_dual_vertices(); } - else { drawing_functor.enable_dual_vertices(); } + if(gs_options.are_dual_vertices_enabled()) + { gs_options.disable_dual_vertices(); } + else { gs_options.enable_dual_vertices(); } basic_viewer->displayMessage(QString("Dual vertices=%1."). - arg(drawing_functor.are_dual_vertices_enabled()?"true":"false")); + arg(gs_options.are_dual_vertices_enabled()?"true":"false")); basic_viewer->clear(); draw_function_for_v2::compute_elements(av2, basic_viewer->get_graphic_storage(), - drawing_functor); + gs_options); basic_viewer->redraw(); } else From e5a8a0d006f05ae412600a445d0c3e124458b9ae Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Sep 2023 09:55:20 +0200 Subject: [PATCH 175/399] Pmap readable --- .../doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h index 87c085b92135..e67670bcbc9c 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h @@ -30,7 +30,7 @@ A call to this function is blocking, that is the program continues as soon as th Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. \tparam CT2 a triangulation class derived from `Constrained_triangulation_2` -\tparam InDomainPMap a class model of `ReadWritePropertyMap` with +\tparam InDomainPMap a class model of `ReadablePropertyMap` with `CT::Face_handle` as key type and `bool` as value type. \param act2 the constrained triangulation to draw. From fd115bd32129f216a391fa5754a0ec815ca84717 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Sep 2023 11:06:53 +0200 Subject: [PATCH 176/399] Rename Graphic_storare into Graphics_scene (Andreas and Sebastien review) --- .../include/CGAL/draw_arrangement_2.h | 2 +- BGL/include/CGAL/draw_face_graph.h | 8 +++---- .../doc/Basic_viewer/Basic_viewer.txt | 2 +- .../doc/Basic_viewer/CGAL/Basic_viewer_qt.h | 18 +++++++------- .../{Graphic_storage.h => Graphics_scene.h} | 4 ++-- ...ing_functor.h => Graphics_scene_options.h} | 10 ++++---- .../doc/Basic_viewer/PackageDescription.txt | 6 ++--- .../Basic_viewer/draw_mesh_and_points.cpp | 2 +- .../Basic_viewer/draw_several_windows.cpp | 4 ++-- .../draw_surface_mesh_small_faces.cpp | 2 +- .../{Graphic_storage.h => Graphics_scene.h} | 10 ++++---- .../include/CGAL/Graphics_scene_options.h | 6 ++--- .../include/CGAL/Qt/Basic_viewer_qt.h | 16 ++++++------- .../include/CGAL/draw_polygon_set_2.h | 2 +- .../demo/Linear_cell_complex/Viewer.h | 4 ++-- .../CGAL/draw_linear_cell_complex.h | 2 +- .../include/CGAL/draw_linear_cell_complex.h | 18 +++++++------- Nef_3/include/CGAL/draw_nef_3.h | 16 ++++++------- .../CGAL/draw_periodic_2_triangulation_2.h | 20 ++++++++-------- Point_set_3/include/CGAL/draw_point_set_3.h | 12 +++++----- Polygon/include/CGAL/draw_polygon_2.h | 12 +++++----- .../include/CGAL/draw_polygon_with_holes_2.h | 14 +++++------ Polyhedron/include/CGAL/draw_polyhedron.h | 10 ++++---- .../include/CGAL/draw_straight_skeleton_2.h | 20 ++++++++-------- Surface_mesh/include/CGAL/draw_surface_mesh.h | 10 ++++---- .../include/CGAL/draw_face_graph_with_paths.h | 24 +++++++++---------- .../CGAL/draw_triangulation_2.h | 6 ++--- .../polygon_triangulation_drawing_functor.h | 4 ++-- .../CGAL/draw_constrained_triangulation_2.h | 6 ++--- .../include/CGAL/draw_triangulation_2.h | 18 +++++++------- .../include/CGAL/draw_triangulation_3.h | 18 +++++++------- .../include/CGAL/draw_voronoi_diagram_2.h | 22 ++++++++--------- 32 files changed, 164 insertions(+), 164 deletions(-) rename Basic_viewer/doc/Basic_viewer/CGAL/{Graphic_storage.h => Graphics_scene.h} (92%) rename Basic_viewer/doc/Basic_viewer/CGAL/{Drawing_functor.h => Graphics_scene_options.h} (90%) rename Basic_viewer/include/CGAL/{Graphic_storage.h => Graphics_scene.h} (99%) 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 ad19e55bff0a..f03f133c3588 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -511,7 +511,7 @@ class Arr_2_basic_viewer_qt : public Basic_viewer_qt { Color_generator m_color_generator; std::unordered_map m_visited; - CGAL::Graphic_storage m_graphic_storage; + CGAL::Graphics_scene m_graphic_storage; }; //! Basic viewer of a 2D arrangement. diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index f7b9efb4abb9..4c30d6b2a5f4 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -14,7 +14,7 @@ #ifndef CGAL_DRAW_FACE_GRAPH_H #define CGAL_DRAW_FACE_GRAPH_H -#include +#include #include #include #include @@ -26,7 +26,7 @@ namespace draw_function_for_FG { template void compute_elements(const FG &fg, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions &m_gs_options) { using Point=typename boost::property_map_value::type; @@ -120,7 +120,7 @@ void compute_elements(const FG &fg, template void add_in_graphic_storage_for_fg(const FG &fg, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions &gs_options) { draw_function_for_FG::compute_elements(fg, graphic_storage, gs_options); @@ -128,7 +128,7 @@ void add_in_graphic_storage_for_fg(const FG &fg, template void add_in_graphic_storage_for_fg(const FG &fg, - CGAL::Graphic_storage &graphic_storage) + CGAL::Graphics_scene &graphic_storage) { Graphics_scene_options::vertex_descriptor, diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index ff81f476c0b7..766ccf8c7798 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -16,7 +16,7 @@ draw(XXX) \subsection Basic_viewerDoc_2 Customize the drawing -Drawing_functor +Graphics_scene_options \subsection Basic_viewerDoc_3 Graphic storage diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h index aa9fc1d13310..d771cdcd5947 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h @@ -4,7 +4,7 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphic_storage`. Elements can either be added directly in the viewer or through the storage. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. +The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements can either be added directly in the viewer or through the storage. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. \tparam BufferType the type used for point coordinates: `float` by default. @@ -13,10 +13,10 @@ template class Basic_viewer_qt : public CGAL::QGLViewer { public: - /// Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphic_storage`. + /// Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphics_scene`. /// `title` will be the title of the window. Basic_viewer_qt(QWidget* parent, - Graphic_storage& buf, + Graphics_scene& buf, const char* title=""); /// enables or disables the drawing of vertices. @@ -196,10 +196,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_text(const KPoint &kp, const std::string &txt); /// returns the graphic storage of the viewer. - Graphic_storage& get_graphic_storage(); + Graphics_scene& get_graphic_storage(); /// returns the graphic storage of the viewer, const version. - const Graphic_storage& get_graphic_storage() const; + const Graphics_scene& get_graphic_storage() const; /// negates all normal of vertices and faces. void negate_all_normals(); @@ -232,8 +232,8 @@ template class QApplication_and_basic_viewer { public: - /// Constructor given a `Graphic_storage` and possibly a title. - QApplication_and_basic_viewer(CGAL::Graphic_storage& buffer, + /// Constructor given a `Graphics_scene` and possibly a title. + QApplication_and_basic_viewer(CGAL::Graphics_scene& buffer, const char* title="CGAL Basic Viewer"); /// runs the `QApplication`, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. @@ -245,10 +245,10 @@ class QApplication_and_basic_viewer //------------------------------------------------------------------------------ /*! - opens a new window and draws the given `Graphic_storage` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. + opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. */ template -void draw_graphic_storage(Graphic_storage& graphic_buffer, +void draw_graphic_storage(Graphics_scene& graphic_buffer, const char *title="CGAL Basic Viewer") {} diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h similarity index 92% rename from Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h rename to Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index 7c1a7e5bdfa2..e9cef86e6d94 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphic_storage.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -4,13 +4,13 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Graphic_storage` stores points, segments, triangles, rays and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added and are triangulated internally. +The class `Graphics_scene` stores points, segments, triangles, rays and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added and are triangulated internally. \tparam BufferType the number type used for point coordinates: `float` by default. */ template -class Graphic_storage { +class Graphics_scene { public: /// adds the given point in the storage. template diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h similarity index 90% rename from Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h rename to Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h index 79fa49f64c9f..3b0408f3f841 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Drawing_functor.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h @@ -4,7 +4,7 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Cell_parameters` is used to tune the way that the cells of a given data structure of \cgal are considered. +The class `Graphics_scene_options` is used to tune the way that the cells of a given data structure of \cgal are considered. The different `std::function` can be modified to change for example the behavior of the drawing. \tparam DS a data structure of \cgal. @@ -17,7 +17,7 @@ template -struct Cell_parameters +struct Graphics_scene_options { public: /// `std::function` that returns `true` if the given vertex must be ignored, `false` otherwise. @@ -73,7 +73,7 @@ struct Cell_parameters /*! \ingroup PkgBasicViewerClasses -The class `Cell_parameters_with_volume` is used to tune the way that the cells of a given data structure of \cgal are considered, for a data structure that contains volumes. +The class `Graphics_scene_options` is used to tune the way that the cells of a given data structure of \cgal are considered, for a data structure that contains volumes. The different `std::function` can be modified to change for example the behavior of the drawing. \tparam DS a data structure of \cgal. @@ -90,8 +90,8 @@ template -struct Cell_parameters_with_volume : - public Cell_parameters +struct Graphics_scene_options : + public Graphics_scene_options { public: /// `std::function` that returns `true` if the given volume must be ignored, `false` otherwise. diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index d002f4186e6e..569246d4dfb1 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -22,9 +22,9 @@ \cgalClassifedRefPages \cgalCRPSection{Classes} -- `CGAL::Drawing_functor` -- `CGAL::Drawing_functor_with_volume` -- `CGAL::Graphic_storage` +- `CGAL::Graphics_scene_options` +- `CGAL::Graphics_scene_options` +- `CGAL::Graphics_scene` - `CGAL::Basic_viewer_qt` - `CGAL::QApplication_and_basic_viewer` diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index efb13259a371..bd843f8c1ad2 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -54,7 +54,7 @@ int main(void) for(Pwn& it: points) { point_set.insert(it.first); } - CGAL::Graphic_storage graphic_buffer; + CGAL::Graphics_scene graphic_buffer; CGAL::add_in_graphic_storage(point_set, graphic_buffer, Graphics_scene_options_green_points()); CGAL::add_in_graphic_storage(output_mesh, graphic_buffer); CGAL::draw_graphic_storage(graphic_buffer); diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index 7a6a3497996e..4fb8bd75892c 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -20,7 +20,7 @@ using PS3=CGAL::Point_set_3; int main(void) { - /// (1) Some CGAL code that create data structure and fill Graphic_storage. + /// (1) Some CGAL code that create data structure and fill Graphics_scene. std::vector points; if(!CGAL::IO::read_points(CGAL::data_file_path("points_3/kitten.xyz"), std::back_inserter(points), @@ -47,7 +47,7 @@ int main(void) for(Pwn& it: points) { point_set.insert(it.first); } - CGAL::Graphic_storage graphic_buffer1, graphic_buffer2; + CGAL::Graphics_scene graphic_buffer1, graphic_buffer2; CGAL::add_in_graphic_storage(point_set, graphic_buffer1); CGAL::add_in_graphic_storage(output_mesh, graphic_buffer2); diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index d22cd1287062..a2f617d34487 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -99,7 +99,7 @@ int main(int argc, char* argv[]) { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } Graphics_scene_options_small_faces gsosm(sm); - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(sm, buffer, gsosm); CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); diff --git a/Basic_viewer/include/CGAL/Graphic_storage.h b/Basic_viewer/include/CGAL/Graphics_scene.h similarity index 99% rename from Basic_viewer/include/CGAL/Graphic_storage.h rename to Basic_viewer/include/CGAL/Graphics_scene.h index 056078251ac0..fd5fcc4cde18 100644 --- a/Basic_viewer/include/CGAL/Graphic_storage.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -10,8 +10,8 @@ // Author(s): Guillaume Damiand // Mostafa Ashraf -#ifndef CGAL_GRAPHIC_STORAGE_H -#define CGAL_GRAPHIC_STORAGE_H +#ifndef CGAL_GRAPHICS_SCENE_H +#define CGAL_GRAPHICS_SCENE_H #include #include @@ -56,14 +56,14 @@ inline CGAL::IO::Color get_random_color(CGAL::Random& random) // This class is responsible for dealing with available CGAL data structures and // handling buffers. template -class Graphic_storage +class Graphics_scene { public: typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; - Graphic_storage() + Graphics_scene() : m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr, &m_bounding_box, nullptr, nullptr, nullptr), m_buffer_for_colored_points(&arrays[POS_COLORED_POINTS], nullptr, @@ -417,4 +417,4 @@ class Graphic_storage } // namespace CGAL -#endif // CGAL_GRAPHIC_STORAGE_H +#endif // CGAL_GRAPHICS_SCENE_H diff --git a/Basic_viewer/include/CGAL/Graphics_scene_options.h b/Basic_viewer/include/CGAL/Graphics_scene_options.h index 37f9d39c6560..5728dfbb2913 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/include/CGAL/Graphics_scene_options.h @@ -10,8 +10,8 @@ // Author(s): Guillaume Damiand // Mostafa Ashraf -#ifndef CGAL_DRAWING_FUNCTORS_H -#define CGAL_DRAWING_FUNCTORS_H +#ifndef CGAL_GRAPHICS_SCENE_OPTIONS_H +#define CGAL_GRAPHICS_SCENE_OPTIONS_H #include #include @@ -114,4 +114,4 @@ struct Graphics_scene_options: } // End namespace CGAL -#endif // CGAL_DRAWING_FUNCTORS_H +#endif // CGAL_GRAPHICS_SCENE_OPTIONS_H diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h index 0410edfb0d0f..5d8ecbcf83e9 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include #include @@ -68,11 +68,11 @@ class Basic_viewer_qt : public CGAL::QGLViewer typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; - using GS=Graphic_storage; + using GS=Graphics_scene; // Constructor/Destructor Basic_viewer_qt(QWidget* parent, - Graphic_storage& buf, + Graphics_scene& buf, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -364,9 +364,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer void face_end() { gBuffer.face_end(); } - Graphic_storage& get_graphic_storage() + Graphics_scene& get_graphic_storage() { return gBuffer; } - const Graphic_storage& get_graphic_storage() const + const Graphics_scene& get_graphic_storage() const { return gBuffer; } virtual void redraw() @@ -1595,7 +1595,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer std::function *)> on_key_pressed; protected: - Graphic_storage& gBuffer; + Graphics_scene& gBuffer; bool m_draw_vertices; bool m_draw_edges; @@ -1669,7 +1669,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; template -void draw_graphic_storage(Graphic_storage& graphic_storage, +void draw_graphic_storage(Graphics_scene& graphic_storage, const char *title="CGAL Basic Viewer") { #if defined(CGAL_TEST_SUITE) @@ -1698,7 +1698,7 @@ template class QApplication_and_basic_viewer { public: - QApplication_and_basic_viewer(CGAL::Graphic_storage& buffer, + QApplication_and_basic_viewer(CGAL::Graphics_scene& buffer, const char* title="CGAL Basic Viewer"): m_application(nullptr), m_basic_viewer(nullptr), diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index 5da2ad7cee27..cc4452f99c63 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -186,7 +186,7 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt { //! Indicates whether to draw unbounded polygons with holes. bool m_draw_unbounded = false; - Graphic_storage gs; + Graphics_scene gs; }; // Specialization of draw function. diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 4165c0fea9e9..85b8d6591ac6 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -34,12 +34,12 @@ public Q_SLOTS: void sceneChanged(); private: - CGAL::Drawing_functor_with_volume m_drawing_functor; - CGAL::Graphic_storage m_graphic_buffer; + CGAL::Graphics_scene m_graphic_buffer; Scene* scene; bool m_previous_scene_empty; }; diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index 7d5ccbad9cc6..59b25e2371f3 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -17,7 +17,7 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5 */ template - void add_in_graphic_storage(const LCC& alcc, CGAL::Graphic_storage& graphic_storage, + void add_in_graphic_storage(const LCC& alcc, CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options); } /* namespace CGAL */ 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 4942bef58143..6ef9c4ada70e 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_LCC_H #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ template void compute_face(const LCC& lcc, typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptionsLCC& gs_options) { if (!gs_options.are_faces_enabled() || @@ -105,7 +105,7 @@ void compute_face(const LCC& lcc, template void compute_edge(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (!gs_options.are_edges_enabled() || @@ -129,7 +129,7 @@ void compute_edge(const LCC& lcc, template void compute_vertex(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptionsLCC& gs_options) { if (!gs_options.are_vertices_enabled() || @@ -147,7 +147,7 @@ void compute_vertex(const LCC& lcc, template void compute_elements(const LCC& lcc, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { typename LCC::size_type markvolumes = lcc.get_new_mark(); @@ -240,7 +240,7 @@ template void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { draw_function_for_lcc::compute_elements(static_cast(alcc), @@ -254,7 +254,7 @@ template class Map, class Refs, class Storage_, typename BufferType=float> void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { CGAL::Graphics_scene_options buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(alcc, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -300,7 +300,7 @@ template void draw(const CGAL_LCC_TYPE& alcc, const char *title="LCC Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(alcc, buffer); draw_graphic_storage(buffer, title); } diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 29a142ede127..49a56e023d13 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -95,7 +95,7 @@ class Nef_Visitor { public: Nef_Visitor(const Nef_Polyhedron&_nef, - CGAL::Graphic_storage& _graphic_storage, + CGAL::Graphics_scene& _graphic_storage, const GSOptions&_gs_options) : n_faces(0), n_edges(0), nef(_nef), @@ -207,14 +207,14 @@ class Nef_Visitor { protected: std::unordered_map facets_done; std::unordered_map edges_done; - CGAL::Graphic_storage& graphic_storage; + CGAL::Graphics_scene& graphic_storage; const GSOptions& gs_options; const Nef_Polyhedron& nef; }; template void compute_elements(const Nef_Polyhedron &nef, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions &gs_options) { @@ -243,7 +243,7 @@ void compute_elements(const Nef_Polyhedron &nef, template void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions &gs_options) { draw_function_for_nef_polyhedron::compute_elements(anef, @@ -254,7 +254,7 @@ void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, template void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, - CGAL::Graphic_storage &graphic_storage) + CGAL::Graphics_scene &graphic_storage) { // Default graphics view options. Graphics_scene_options buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(anef, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -299,7 +299,7 @@ template buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(anef, buffer); draw_graphic_storage(buffer, title); } diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index ca9d7ec52c3a..3fcf78387c53 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -69,7 +69,7 @@ namespace draw_function_for_P2T2 template void compute_vertex(const P2T2 &p2t2, typename P2T2::Periodic_point_iterator pi, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { // Construct the point in 9-sheeted covering space and add to viewer @@ -86,7 +86,7 @@ void compute_vertex(const P2T2 &p2t2, template void compute_edge(const P2T2 &p2t2, typename P2T2::Periodic_segment_iterator si, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if(!gs_options.draw_edge(p2t2, si)) @@ -104,7 +104,7 @@ void compute_edge(const P2T2 &p2t2, template void compute_face(const P2T2 &p2t2, typename P2T2::Periodic_triangle_iterator ti, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if(!gs_options.draw_face(p2t2, ti)) @@ -126,7 +126,7 @@ void compute_face(const P2T2 &p2t2, template void compute_domain(const P2T2& p2t2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -155,7 +155,7 @@ void compute_domain(const P2T2& p2t2, template void compute_elements(const P2T2& p2t2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { // Get the display type, iterate through periodic elements according @@ -198,7 +198,7 @@ void compute_elements(const P2T2& p2t2, template void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { draw_function_for_P2T2::compute_elements(p2t2, graphic_storage, gs_options); @@ -206,7 +206,7 @@ void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, template void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { CGAL::Graphics_scene_options_periodic_2_triangulation_2 buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(ap2t2, buffer, gs_options); draw_graphic_storage(buffer); } @@ -234,7 +234,7 @@ template void draw(const CGAL_P2T2_TYPE& ap2t2, const char* title="2D Periodic Triangulation Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; CGAL::Graphics_scene_options_periodic_2_triangulation_2 #include -#include +#include #include #include @@ -44,7 +44,7 @@ namespace draw_function_for_PointSet { template void compute_elements(const PointSet& pointset, - Graphic_storage& graphic_storage, + Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (!gs_options.are_vertices_enabled()) @@ -70,7 +70,7 @@ void compute_elements(const PointSet& pointset, template void add_in_graphic_storage(const Point_set_3& apointset, - Graphic_storage& graphic_storage, + Graphics_scene& graphic_storage, const GSOptions& gs_options) { draw_function_for_PointSet::compute_elements(apointset, @@ -80,7 +80,7 @@ void add_in_graphic_storage(const Point_set_3& apointset, template void add_in_graphic_storage(const Point_set_3& apointset, - Graphic_storage& graphic_storage) + Graphics_scene& graphic_storage) { CGAL::Graphics_scene_options, typename Point_set_3::const_iterator, @@ -96,7 +96,7 @@ void draw(const Point_set_3& apointset, const GSOptions& gs_options, const char *title="Point_set_3 Basic Viewer") { - Graphic_storage buffer; + Graphics_scene buffer; add_in_graphic_storage(apointset, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -105,7 +105,7 @@ template void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { - Graphic_storage buffer; + Graphics_scene buffer; add_in_graphic_storage(apointset, buffer); draw_graphic_storage(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 9a9c7d2f9139..89ae5f70c689 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -19,7 +19,7 @@ #define CGAL_DRAW_POLYGON_2_H #include -#include +#include #include #include @@ -48,7 +48,7 @@ namespace draw_function_for_p2 { template void compute_elements(const P2& p2, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions& gs_options) { if (p2.is_empty()) @@ -103,13 +103,13 @@ void compute_elements(const P2& p2, template void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { draw_function_for_p2::compute_elements(ap2, graphic_storage, gs_options); } template void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, - CGAL::Graphic_storage &graphic_storage) + CGAL::Graphics_scene &graphic_storage) { CGAL::Graphics_scene_options void draw(const CGAL_P2_TYPE &ap2, const char *title="Polygon_2 Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(ap2, buffer); draw_graphic_storage(buffer, title); } @@ -136,7 +136,7 @@ void draw(const CGAL_P2_TYPE &ap2, const GSOptions& gs_options, const char *title="Polygon_2 Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(ap2, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 1c0683080e5e..03a428f40091 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -19,7 +19,7 @@ #define CGAL_DRAW_POLYGON_WITH_HOLES_2_H #include -#include +#include #include #include @@ -55,7 +55,7 @@ namespace draw_function_for_ph2_with_holes { template void compute_one_loop_elements(const P2& ap2, const typename P2::General_polygon_2& aloop, - Graphic_storage &graphic_storage, + Graphics_scene &graphic_storage, bool hole, const GSOptions& gs_options) { @@ -98,7 +98,7 @@ void compute_one_loop_elements(const P2& ap2, } template -void compute_elements(const P2& p2, Graphic_storage &graphic_storage, +void compute_elements(const P2& p2, Graphics_scene &graphic_storage, const GSOptions& gs_options) { if (p2.outer_boundary().is_empty()) return; @@ -134,7 +134,7 @@ void compute_elements(const P2& p2, Graphic_storage &graphic_storage template void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions &gs_options) { draw_function_for_ph2_with_holes::compute_elements(p2, graphic_storage, @@ -143,7 +143,7 @@ void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, template void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { Graphics_scene_options void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const GSOptions &gs_options, const char* title="Polygon with Holes Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(ap2, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -169,7 +169,7 @@ template void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const char* title="Polygon with Holes Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(ap2, buffer); draw_graphic_storage(buffer, title); } diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 59f087f6179f..c9f7cb47f099 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_POLYHEDRON_H #include -#include +#include #include #include #include @@ -35,7 +35,7 @@ template void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions &gs_options) { add_in_graphic_storage_for_fg(apoly, graphic_storage, gs_options); } @@ -46,7 +46,7 @@ template void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, - CGAL::Graphic_storage &graphic_storage) + CGAL::Graphics_scene &graphic_storage) { add_in_graphic_storage_for_fg(apoly, graphic_storage); } // Specialization of draw function: require Qt and the CGAL basic viewer. @@ -61,7 +61,7 @@ template buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage_for_fg(apoly, buffer); draw_graphic_storage(buffer, title); } @@ -77,7 +77,7 @@ void draw(const CGAL_POLY_TYPE& apoly, const GSOptions &gs_options, const char* title="Polyhedron Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage_for_fg(apoly, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index e47cd8a778c3..7552a10469f3 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -26,7 +26,7 @@ namespace draw_function_for_ss2 { template void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (!gs_options.draw_edge(ss2, eh)) @@ -48,7 +48,7 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, template void print_halfedge_labels(const SS2& ss2, typename SS2::Halfedge_const_handle h, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { // TODO? an option different from draw_edge to allow to show only some labels ?? @@ -67,7 +67,7 @@ void print_halfedge_labels(const SS2& ss2, template void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (!gs_options.draw_vertex(ss2, vh)) @@ -84,7 +84,7 @@ void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, template void print_vertex_label(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { // TODO? an option different from draw_vertex to allow to show only some labels ?? @@ -98,7 +98,7 @@ void print_vertex_label(const SS2& ss2, template void compute_elements(const SS2& ss2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (!gs_options.are_edges_enabled()) @@ -131,7 +131,7 @@ void compute_elements(const SS2& ss2, template void add_in_graphic_storage(const CGAL_SS_TYPE &ass2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { draw_function_for_ss2::compute_elements(ass2, graphic_storage, @@ -140,7 +140,7 @@ void add_in_graphic_storage(const CGAL_SS_TYPE &ass2, template void add_in_graphic_storage(const CGAL_SS_TYPE& ass2, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { Graphics_scene_options void draw(const CGAL_SS_TYPE &ass2, const GSOptions &gs_options, const char *title="Straight Skeleton Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(ass2, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -195,7 +195,7 @@ template void draw(const CGAL_SS_TYPE &ass2, const char *title="Straight Skeleton Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(ass2, buffer); draw_graphic_storage(buffer, title); } diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index dbcd8f86c732..e41050d297cb 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -30,7 +30,7 @@ void draw(const SM& asm); #else // DOXYGEN_RUNNING #include -#include +#include #include #include #include @@ -96,13 +96,13 @@ struct Graphics_scene_options_surface_mesh template void add_in_graphic_storage(const Surface_mesh& amesh, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions &gs_options) { add_in_graphic_storage_for_fg(amesh, graphic_storage, gs_options); } template void add_in_graphic_storage(const Surface_mesh& amesh, - CGAL::Graphic_storage &graphic_storage) + CGAL::Graphics_scene &graphic_storage) { add_in_graphic_storage_for_fg(amesh, graphic_storage, Graphics_scene_options_surface_mesh(amesh)); } @@ -113,7 +113,7 @@ template void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(amesh, buffer); draw_graphic_storage(buffer, title); } @@ -123,7 +123,7 @@ void draw(const Surface_mesh& amesh, const GSOptions &gs_options, const char* title="Surface_mesh Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(amesh, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 454316d4c3ab..698eab17e1e4 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -145,7 +145,7 @@ template void compute_face(const Mesh& mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, GSOptions& gs_options) { if(!gs_options.draw_face(lcc, dh)) @@ -193,7 +193,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, typename Get_map::type::size_type m_amark, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, GSOptions& gs_options, bool draw_marked_darts=true) { @@ -224,7 +224,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, const CGAL::IO::Color& color, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { typedef typename Get_map::type LCC; typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; @@ -241,7 +241,7 @@ void compute_edge(const Mesh &mesh, template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, GSOptions& gs_options) { typedef typename CGAL::Get_traits::Kernel Kernel; @@ -253,7 +253,7 @@ void compute_vertex(const Mesh &mesh, template void compute_path(const Mesh &mesh, const typename Get_map::storage_type& lcc, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const std::vector>* m_paths, std::size_t i, typename Get_map::type::size_type amark) @@ -282,7 +282,7 @@ void compute_path(const Mesh &mesh, template void compute_elements(const Mesh &mesh, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions &m_gs_options, const std::vector>* m_paths, typename Get_map::type::size_type amark) @@ -371,7 +371,7 @@ void compute_elements(const Mesh &mesh, template void add_in_graphic_storage(const Mesh& mesh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const std::vector>* paths, const GSOptions& gs_options, typename Get_map::type::size_type amark= @@ -385,7 +385,7 @@ void add_in_graphic_storage(const Mesh& mesh, template void add_in_graphic_storage(const Mesh& mesh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const std::vector>* paths, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) @@ -409,7 +409,7 @@ void draw(const Mesh& mesh, (std::numeric_limits::type::size_type>::max)(), const char* title="Mesh Viewer With Path") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(mesh, buffer, &paths, amark); draw_graphic_storage(buffer, title); } @@ -422,7 +422,7 @@ void draw(const Mesh& mesh, (std::numeric_limits::type::size_type>::max)(), const char* title="Mesh Viewer With Path") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(mesh, buffer, gs_options, &paths, amark); draw_graphic_storage(buffer, title); } @@ -435,7 +435,7 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { std::vector> paths=l; - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(mesh, buffer, &paths, amark); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 5d3b5faf1ec7..857d8db8b2a5 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -15,7 +15,7 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with */ template -void draw(const T2& at2, const CGAL::Cell_parameters& cp=default); @@ -33,8 +33,8 @@ adds the vertices, edges and faces of `at2` into the given graphic storage `gs`. */ template void add_in_graphic_storage(const T2& at2, - CGAL::Graphic_storage& gs, - const CGAL::Cell_parameters& gs, + const CGAL::Graphics_scene_options& cp=default); diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h index 85a70dc23f82..7cca28a1948f 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h @@ -61,7 +61,7 @@ struct Polygon_triangulation_gs_options : template void add_in_graphic_storage(const CGAL_CT2_TYPE& ct2, - CGAL::Graphic_storage& graphic_buffer, + CGAL::Graphics_scene& graphic_buffer, const GSOptions& gs_options) { draw_function_for_t2::compute_elements(ct2, graphic_buffer, gs_options); @@ -74,7 +74,7 @@ template void draw(const CGAL_CT2_TYPE &ct2, const GSOptions &gs_options, const char *title="Constrained Triangulation_2 Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(ct2, buffer, gs_options); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index fb1a912addbc..c56938f8eecf 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -28,7 +28,7 @@ namespace CGAL template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, InDomainPmap ipm, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { using BASET2=CGAL::Triangulation_2; @@ -59,7 +59,7 @@ void add_in_graphic_storage(const CGAL_T2_TYPE& at2, InDomainPmap ipm, template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { internal::In_domain in_domain; add_in_graphic_storage(at2, in_domain, graphic_storage); @@ -69,7 +69,7 @@ template void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm, const char *title="Constrained Triangulation_2 Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(at2, ipm, buffer); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 84134c0cde0b..56b0c8b9b337 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -27,7 +27,7 @@ namespace draw_function_for_t2 { template void compute_face(const T2& t2, typename T2::Finite_faces_iterator fh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (!gs_options.draw_face(t2, fh)) @@ -47,7 +47,7 @@ void compute_face(const T2& t2, template void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (!gs_options.draw_edge(t2, eh)) @@ -70,7 +70,7 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, template void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (!gs_options.draw_vertex(t2, vh)) @@ -88,7 +88,7 @@ void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, template void compute_elements(const T2& t2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (gs_options.are_faces_enabled()) @@ -119,7 +119,7 @@ void compute_elements(const T2& t2, template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { draw_function_for_t2::compute_elements(at2, graphic_storage, gs_options); @@ -127,7 +127,7 @@ void add_in_graphic_storage(const CGAL_T2_TYPE& at2, template void add_in_graphic_storage(const CGAL_T2_TYPE& at2, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { Graphics_scene_options void draw(const CGAL_T2_TYPE &at2, const GSOptions &gs_options, const char *title="Triangulation_2 Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(at2, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -165,7 +165,7 @@ template void draw(const CGAL_T2_TYPE& at2, const char *title="Triangulation_2 Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(at2, buffer); draw_graphic_storage(buffer, title); } diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 32a4e93eb9ff..e9fca016eda0 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -28,7 +28,7 @@ namespace draw_function_for_t3 template void compute_face(typename T3::Finite_facets_iterator fh, const GSOptions& gs_options, - CGAL::Graphic_storage& graphic_storage, const T3 *t3) + CGAL::Graphics_scene& graphic_storage, const T3 *t3) { if(!gs_options.draw_face(*t3, fh)) { return; } @@ -50,7 +50,7 @@ void compute_face(typename T3::Finite_facets_iterator fh, template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options, const T3* t3) { if(!gs_options.draw_edge(*t3, eh)) @@ -70,7 +70,7 @@ void compute_edge(typename T3::Finite_edges_iterator eh, template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options, const T3* t3) { if(!gs_options.draw_vertex(*t3, vh)) @@ -86,7 +86,7 @@ void compute_vertex(typename T3::Vertex_handle vh, template void compute_elements(const T3* t3, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if (gs_options.are_faces_enabled()) @@ -118,7 +118,7 @@ void compute_elements(const T3* t3, template void add_in_graphic_storage(const CGAL_T3_TYPE& at3, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { draw_function_for_t3::compute_elements(&at3, graphic_storage, gs_options); @@ -127,7 +127,7 @@ void add_in_graphic_storage(const CGAL_T3_TYPE& at3, template void add_in_graphic_storage(const CGAL_T3_TYPE& at3, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { CGAL::Graphics_scene_options void draw(const CGAL_T3_TYPE &at3, const GSOptions &gs_options, const char *title="T3 Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(at3, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -169,7 +169,7 @@ void draw(const CGAL_T3_TYPE &at3, const GSOptions &gs_options, template void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(at3, buffer); draw_graphic_storage(buffer, title); } diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 6d6ed974f8b9..48e5065ee8ef 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -72,7 +72,7 @@ typedef Local_kernel::Vector_3 Local_vector; template void compute_vertex(const V2& v2, typename V2::Vertex_iterator vh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if(!gs_options.draw_vertex(v2, vh)) @@ -87,14 +87,14 @@ void compute_vertex(const V2& v2, template void compute_dual_vertex(const V2& /*v2*/, typename V2::Delaunay_graph::Finite_vertices_iterator vi, - CGAL::Graphic_storage &graphic_storage, + CGAL::Graphics_scene &graphic_storage, const GSOptions& gs_options) { graphic_storage.add_point(vi->point(), gs_options.dual_vertex_color); } template void add_segments_and_update_bounding_box(const V2& v2, typename V2::Halfedge_iterator he, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -224,7 +224,7 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, template void compute_rays_and_bisectors(const V2&, typename V2::Halfedge_iterator he, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -254,7 +254,7 @@ void compute_rays_and_bisectors(const V2&, template void compute_face(const V2& v2, typename V2::Face_iterator fh, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& m_gs_options) { if(fh->is_unbounded() || !m_gs_options.draw_face(v2, fh)) @@ -288,7 +288,7 @@ void compute_face(const V2& v2, template void compute_elements(const V2& v2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& gs_options) { if(gs_options.are_vertices_enabled()) @@ -338,7 +338,7 @@ void compute_elements(const V2& v2, template void add_in_graphic_storage(const CGAL_VORONOI_TYPE &v2, - CGAL::Graphic_storage& graphic_storage, + CGAL::Graphics_scene& graphic_storage, const GSOptions& m_gs_options) { draw_function_for_v2::compute_elements(v2, graphic_storage, m_gs_options); @@ -346,7 +346,7 @@ void add_in_graphic_storage(const CGAL_VORONOI_TYPE &v2, template void add_in_graphic_storage(const CGAL_VORONOI_TYPE& v2, - CGAL::Graphic_storage& graphic_storage) + CGAL::Graphics_scene& graphic_storage) { // Default graphics view options. CGAL::Graphics_scene_options_voronoi buffer; + CGAL::Graphics_scene buffer; add_in_graphic_storage(av2, buffer, gs_options); draw_graphic_storage(buffer, title); } @@ -376,7 +376,7 @@ template void draw(const CGAL_VORONOI_TYPE& av2, const char *title="2D Voronoi Diagram Basic Viewer") { - CGAL::Graphic_storage buffer; + CGAL::Graphics_scene buffer; CGAL::Graphics_scene_options_voronoi Date: Thu, 28 Sep 2023 11:10:24 +0200 Subject: [PATCH 177/399] Camel case (Andreas review) --- .../include/CGAL/Graphics_scene_options.h | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Basic_viewer/include/CGAL/Graphics_scene_options.h b/Basic_viewer/include/CGAL/Graphics_scene_options.h index 5728dfbb2913..6a085c2397f3 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/include/CGAL/Graphics_scene_options.h @@ -20,51 +20,51 @@ namespace CGAL { template + typename VertexHandle, + typename EdgeHandle, + typename FaceHandle, + typename VolumeHandle=void> struct Graphics_scene_options; // Drawing functor for a 2D combinatorial data structure // (with vertices, edges and faces) template -struct Graphics_scene_options + typename VertexHandle, + typename EdgeHandle, + typename FaceHandle> +struct Graphics_scene_options { Graphics_scene_options(): m_enabled_vertices(true), m_enabled_edges(true), m_enabled_faces(true) { - draw_vertex=[](const DS &, vertex_handle)->bool { return true; }; - draw_edge=[](const DS &, edge_handle)->bool { return true; }; - draw_face=[](const DS &, face_handle)->bool { return true; }; + draw_vertex=[](const DS &, VertexHandle)->bool { return true; }; + draw_edge=[](const DS &, EdgeHandle)->bool { return true; }; + draw_face=[](const DS &, FaceHandle)->bool { return true; }; - colored_vertex=[](const DS &, vertex_handle)->bool { return false; }; - colored_edge=[](const DS &, edge_handle)->bool { return false; }; - colored_face=[](const DS &, face_handle)->bool { return false; }; + colored_vertex=[](const DS &, VertexHandle)->bool { return false; }; + colored_edge=[](const DS &, EdgeHandle)->bool { return false; }; + colored_face=[](const DS &, FaceHandle)->bool { return false; }; - face_wireframe=[](const DS &, face_handle)->bool { return false; }; + face_wireframe=[](const DS &, FaceHandle)->bool { return false; }; } // The seven following functions should not be null - std::function draw_vertex; - std::function draw_edge; - std::function draw_face; + std::function draw_vertex; + std::function draw_edge; + std::function draw_face; - std::function colored_vertex; - std::function colored_edge; - std::function colored_face; + std::function colored_vertex; + std::function colored_edge; + std::function colored_face; - std::function face_wireframe; + std::function face_wireframe; // These functions must be non null if the corresponding colored_XXX function // returns true. - std::function vertex_color; - std::function edge_color; - std::function face_color; + std::function vertex_color; + std::function edge_color; + std::function face_color; void disable_vertices() { m_enabled_vertices=false; } void enable_vertices() { m_enabled_vertices=true; } @@ -85,24 +85,24 @@ struct Graphics_scene_options // Drawing functor for a 3D combinatorial data structure // (with vertices, edges, faces and volumes) template + typename VertexHandle, + typename EdgeHandle, + typename FaceHandle, + typename VolumeHandle> struct Graphics_scene_options: - public Graphics_scene_options + public Graphics_scene_options { Graphics_scene_options() : m_enabled_volumes(true) { - draw_volume=[](const DS &, volume_handle)->bool { return true; }; - colored_volume=[](const DS &, volume_handle)->bool { return false; }; - volume_wireframe=[](const DS &, volume_handle)->bool { return false; }; + draw_volume=[](const DS &, VolumeHandle)->bool { return true; }; + colored_volume=[](const DS &, VolumeHandle)->bool { return false; }; + volume_wireframe=[](const DS &, VolumeHandle)->bool { return false; }; } - std::function draw_volume; - std::function colored_volume; - std::function volume_wireframe; - std::function volume_color; + std::function draw_volume; + std::function colored_volume; + std::function volume_wireframe; + std::function volume_color; void disable_volumes() { m_enabled_volumes=false; } void enable_volumes() { m_enabled_volumes=true; } From 9f22d67ed082c215d6708e58a9685ab2eb01f197 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Sep 2023 12:49:00 +0200 Subject: [PATCH 178/399] Rename Graphic_storage in Graphics_scene (Andreas and Sebastien review) --- .../include/CGAL/draw_arrangement_2.h | 4 +- BGL/include/CGAL/draw_face_graph.h | 28 +++---- .../doc/Basic_viewer/CGAL/Basic_viewer_qt.h | 6 +- .../doc/Basic_viewer/PackageDescription.txt | 30 +++---- .../Basic_viewer/draw_mesh_and_points.cpp | 6 +- .../Basic_viewer/draw_several_windows.cpp | 4 +- .../draw_surface_mesh_small_faces.cpp | 6 +- .../include/CGAL/Qt/Basic_viewer_qt.h | 8 +- .../demo/Linear_cell_complex/Viewer.cpp | 12 +-- .../demo/Linear_cell_complex/Viewer.h | 2 +- .../CGAL/draw_linear_cell_complex.h | 2 +- .../PackageDescription.txt | 2 +- .../include/CGAL/draw_linear_cell_complex.h | 56 ++++++------- Nef_3/include/CGAL/draw_nef_3.h | 56 ++++++------- .../CGAL/draw_periodic_2_triangulation_2.h | 66 +++++++-------- Point_set_3/include/CGAL/draw_point_set_3.h | 26 +++--- Polygon/include/CGAL/draw_polygon_2.h | 40 ++++----- .../include/CGAL/draw_polygon_with_holes_2.h | 50 +++++------ Polyhedron/include/CGAL/draw_polyhedron.h | 22 ++--- .../include/CGAL/draw_straight_skeleton_2.h | 50 +++++------ Surface_mesh/include/CGAL/draw_surface_mesh.h | 20 ++--- .../include/CGAL/draw_face_graph_with_paths.h | 74 ++++++++-------- .../CGAL/draw_triangulation_2.h | 2 +- .../Triangulation_2/polygon_triangulation.cpp | 4 +- ...on_triangulation_graphics_scene_options.h} | 12 +-- .../CGAL/draw_constrained_triangulation_2.h | 16 ++-- .../include/CGAL/draw_triangulation_2.h | 54 ++++++------ .../include/CGAL/draw_triangulation_3.h | 54 ++++++------ .../include/CGAL/draw_voronoi_diagram_2.h | 84 +++++++++---------- 29 files changed, 398 insertions(+), 398 deletions(-) rename Triangulation_2/examples/Triangulation_2/{polygon_triangulation_drawing_functor.h => polygon_triangulation_graphics_scene_options.h} (88%) 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 f03f133c3588..62b7ece09c46 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -70,7 +70,7 @@ class Arr_2_basic_viewer_qt : public Basic_viewer_qt { const char* title = "2D Arrangement Basic Viewer", bool draw_vertices = false) : // First draw: vertices; edges, faces; multi-color; no inverse normal - Base(parent, m_graphic_storage, title, draw_vertices, true, true, false, false), + Base(parent, m_graphics_scene, title, draw_vertices, true, true, false, false), m_arr(arr), m_color_generator(color_generator) { @@ -511,7 +511,7 @@ class Arr_2_basic_viewer_qt : public Basic_viewer_qt { Color_generator m_color_generator; std::unordered_map m_visited; - CGAL::Graphics_scene m_graphic_storage; + CGAL::Graphics_scene m_graphics_scene; }; //! Basic viewer of a 2D arrangement. diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index 4c30d6b2a5f4..4172b25fcb71 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -26,7 +26,7 @@ namespace draw_function_for_FG { template void compute_elements(const FG &fg, - CGAL::Graphics_scene &graphic_storage, + CGAL::Graphics_scene &graphics_scene, const GSOptions &m_gs_options) { using Point=typename boost::property_map_value::type; @@ -66,17 +66,17 @@ void compute_elements(const FG &fg, !m_gs_options.face_wireframe(fg, fh) && // face is not wireframe m_gs_options.colored_face(fg, fh)) // and face is colored { - graphic_storage.face_begin(m_gs_options.face_color(fg, fh)); + graphics_scene.face_begin(m_gs_options.face_color(fg, fh)); auto hd = halfedge(fh, fg); const auto first_hd = hd; do { auto v = source(hd, fg); - graphic_storage.add_point_in_face(get(point_pmap, v), get(vnormals, v)); + graphics_scene.add_point_in_face(get(point_pmap, v), get(vnormals, v)); hd = next(hd, fg); } while (hd != first_hd); - graphic_storage.face_end(); + graphics_scene.face_end(); } } } @@ -87,13 +87,13 @@ void compute_elements(const FG &fg, { if(m_gs_options.colored_edge(fg, e)) // edge is colored { - graphic_storage.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), + graphics_scene.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), get(point_pmap, target(halfedge(e, fg), fg)), m_gs_options.edge_color(fg, e)); } else { - graphic_storage.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), + graphics_scene.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), get(point_pmap, target(halfedge(e, fg), fg))); } } @@ -105,12 +105,12 @@ void compute_elements(const FG &fg, { if(m_gs_options.colored_vertex(fg, v)) // vertex is colored { - graphic_storage.add_point(get(point_pmap, v), + graphics_scene.add_point(get(point_pmap, v), m_gs_options.vertex_color(fg, v)); } else { - graphic_storage.add_point(get(point_pmap, v)); + graphics_scene.add_point(get(point_pmap, v)); } } } @@ -119,16 +119,16 @@ void compute_elements(const FG &fg, } // draw_function_for_FG template -void add_in_graphic_storage_for_fg(const FG &fg, - CGAL::Graphics_scene &graphic_storage, +void add_in_graphics_scene_for_fg(const FG &fg, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { - draw_function_for_FG::compute_elements(fg, graphic_storage, gs_options); + draw_function_for_FG::compute_elements(fg, graphics_scene, gs_options); } template -void add_in_graphic_storage_for_fg(const FG &fg, - CGAL::Graphics_scene &graphic_storage) +void add_in_graphics_scene_for_fg(const FG &fg, + CGAL::Graphics_scene &graphics_scene) { Graphics_scene_options::vertex_descriptor, @@ -150,7 +150,7 @@ void add_in_graphic_storage_for_fg(const FG &fg, return get_random_color(CGAL::get_default_random()); }; - add_in_graphic_storage_for_fg(fg, graphic_storage, gs_options); + add_in_graphics_scene_for_fg(fg, graphics_scene, gs_options); } } // End namespace CGAL diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h index d771cdcd5947..9c6388c6698b 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h @@ -196,10 +196,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_text(const KPoint &kp, const std::string &txt); /// returns the graphic storage of the viewer. - Graphics_scene& get_graphic_storage(); + Graphics_scene& get_graphics_scene(); /// returns the graphic storage of the viewer, const version. - const Graphics_scene& get_graphic_storage() const; + const Graphics_scene& get_graphics_scene() const; /// negates all normal of vertices and faces. void negate_all_normals(); @@ -248,7 +248,7 @@ class QApplication_and_basic_viewer opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. */ template -void draw_graphic_storage(Graphics_scene& graphic_buffer, +void draw_graphics_scene(Graphics_scene& graphic_buffer, const char *title="CGAL Basic Viewer") {} diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 569246d4dfb1..a9e27a2cd74b 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -30,7 +30,7 @@ \cgalCRPSubsection{Draw a Graphic Storage} -- `CGAL::draw_graphic_storage()` +- `CGAL::draw_graphics_scene()` \cgalCRPSubsection{Draw for Different Packages} @@ -52,20 +52,20 @@ \cgalCRPSubsection{Fill Graphic Storage for Different Packages} -- Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphic_storage() \endlink -- Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::add_in_graphic_storage() \endlink -- Nef_polyhedron_3 \link PkgDrawNef3 CGAL::add_in_graphic_storage() \endlink -- Periodic_2_Triangulation_2 \link PkgDrawPeriodic2Triangulation2 CGAL::add_in_graphic_storage() \endlink -- Point_set_3 \link PkgDrawPointSet3D CGAL::add_in_graphic_storage() \endlink -- Polygon_2 \link PkgDrawPolygon2 CGAL::add_in_graphic_storage() \endlink -- Polygon_set_2 \link PkgDrawPolygonSet2 CGAL::add_in_graphic_storage() \endlink -- Polygon_with_holes_2 \link PkgDrawPolygonWithHoles2 CGAL::add_in_graphic_storage() \endlink -- Polyhedron_3 \link PkgDrawPolyhedron CGAL::add_in_graphic_storage() \endlink -- Surface_mesh \link PkgDrawSurfaceMesh CGAL::add_in_graphic_storage() \endlink -- Surface_mesh_topology \link PkgDrawFaceGraphWithPaths CGAL::add_in_graphic_storage() \endlink -- Triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphic_storage() \endlink -- Triangulation_3 \link PkgDrawTriangulation3 CGAL::add_in_graphic_storage() \endlink -- Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::add_in_graphic_storage() \endlink +- Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphics_scene() \endlink +- Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::add_in_graphics_scene() \endlink +- Nef_polyhedron_3 \link PkgDrawNef3 CGAL::add_in_graphics_scene() \endlink +- Periodic_2_Triangulation_2 \link PkgDrawPeriodic2Triangulation2 CGAL::add_in_graphics_scene() \endlink +- Point_set_3 \link PkgDrawPointSet3D CGAL::add_in_graphics_scene() \endlink +- Polygon_2 \link PkgDrawPolygon2 CGAL::add_in_graphics_scene() \endlink +- Polygon_set_2 \link PkgDrawPolygonSet2 CGAL::add_in_graphics_scene() \endlink +- Polygon_with_holes_2 \link PkgDrawPolygonWithHoles2 CGAL::add_in_graphics_scene() \endlink +- Polyhedron_3 \link PkgDrawPolyhedron CGAL::add_in_graphics_scene() \endlink +- Surface_mesh \link PkgDrawSurfaceMesh CGAL::add_in_graphics_scene() \endlink +- Surface_mesh_topology \link PkgDrawFaceGraphWithPaths CGAL::add_in_graphics_scene() \endlink +- Triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphics_scene() \endlink +- Triangulation_3 \link PkgDrawTriangulation3 CGAL::add_in_graphics_scene() \endlink +- Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::add_in_graphics_scene() \endlink */ diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index bd843f8c1ad2..1c7bfbb1a157 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -55,9 +55,9 @@ int main(void) { point_set.insert(it.first); } CGAL::Graphics_scene graphic_buffer; - CGAL::add_in_graphic_storage(point_set, graphic_buffer, Graphics_scene_options_green_points()); - CGAL::add_in_graphic_storage(output_mesh, graphic_buffer); - CGAL::draw_graphic_storage(graphic_buffer); + CGAL::add_in_graphics_scene(point_set, graphic_buffer, Graphics_scene_options_green_points()); + CGAL::add_in_graphics_scene(output_mesh, graphic_buffer); + CGAL::draw_graphics_scene(graphic_buffer); } else { return EXIT_FAILURE; } diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index 4fb8bd75892c..7d90b5344b89 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -48,8 +48,8 @@ int main(void) { point_set.insert(it.first); } CGAL::Graphics_scene graphic_buffer1, graphic_buffer2; - CGAL::add_in_graphic_storage(point_set, graphic_buffer1); - CGAL::add_in_graphic_storage(output_mesh, graphic_buffer2); + CGAL::add_in_graphics_scene(point_set, graphic_buffer1); + CGAL::add_in_graphics_scene(output_mesh, graphic_buffer2); /// (2) Qt code that create windows, add them in a layout, and create app. diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index a2f617d34487..80af57cb3e9b 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -101,7 +101,7 @@ int main(int argc, char* argv[]) Graphics_scene_options_small_faces gsosm(sm); CGAL::Graphics_scene buffer; - add_in_graphic_storage(sm, buffer, gsosm); + add_in_graphics_scene(sm, buffer, gsosm); CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); if(app) { @@ -117,7 +117,7 @@ int main(int argc, char* argv[]) (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); basic_viewer->clear(); - add_in_graphic_storage(sm, buffer, gsosm); + add_in_graphics_scene(sm, buffer, gsosm); basic_viewer->redraw(); } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) @@ -128,7 +128,7 @@ int main(int argc, char* argv[]) (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); basic_viewer->clear(); - add_in_graphic_storage(sm, buffer, gsosm); + add_in_graphics_scene(sm, buffer, gsosm); basic_viewer->redraw(); } else diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h index 5d8ecbcf83e9..a98fadbbf46f 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h @@ -364,9 +364,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer void face_end() { gBuffer.face_end(); } - Graphics_scene& get_graphic_storage() + Graphics_scene& get_graphics_scene() { return gBuffer; } - const Graphics_scene& get_graphic_storage() const + const Graphics_scene& get_graphics_scene() const { return gBuffer; } virtual void redraw() @@ -1669,7 +1669,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; template -void draw_graphic_storage(Graphics_scene& graphic_storage, +void draw_graphics_scene(Graphics_scene& graphics_scene, const char *title="CGAL Basic Viewer") { #if defined(CGAL_TEST_SUITE) @@ -1686,7 +1686,7 @@ void draw_graphic_storage(Graphics_scene& graphic_storage, const char *argv[2] = {title, nullptr}; QApplication app(argc, const_cast(argv)); Basic_viewer_qt basic_viewer(app.activeWindow(), - graphic_storage, title); + graphics_scene, title); basic_viewer.show(); app.exec(); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index 8308b4c4a30c..41ac6f489685 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -19,7 +19,7 @@ Viewer::Viewer(QWidget *parent) : Base(parent, m_graphic_buffer, ""), m_previous_scene_empty(true) { - m_drawing_functor.face_color=[](const LCC & alcc, + m_gs_options.face_color=[](const LCC & alcc, Dart_const_descriptor dh)->CGAL::IO::Color { if(alcc.template is_free<3>(dh)) @@ -38,13 +38,13 @@ Viewer::Viewer(QWidget *parent) return CGAL::IO::Color((c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2); }; - m_drawing_functor.colored_face=[](const LCC &, Dart_const_descriptor)->bool + m_gs_options.colored_face=[](const LCC &, Dart_const_descriptor)->bool { return true; }; - m_drawing_functor.draw_volume=[](const LCC & alcc, Dart_const_descriptor dh)->bool + m_gs_options.draw_volume=[](const LCC & alcc, Dart_const_descriptor dh)->bool { return alcc.template info<3>(dh).is_visible(); }; - m_drawing_functor.volume_wireframe=[](const LCC& alcc, Dart_const_descriptor dh)->bool + m_gs_options.volume_wireframe=[](const LCC& alcc, Dart_const_descriptor dh)->bool { return !(alcc.template info<3>(dh).is_filled()); }; } @@ -53,7 +53,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) scene = scene_; if (scene->lcc!=nullptr) - { CGAL::add_in_graphic_storage(*scene->lcc, gBuffer, m_drawing_functor); } + { CGAL::add_in_graphics_scene(*scene->lcc, gBuffer, m_gs_options); } if (doredraw) { Base::redraw(); } @@ -62,7 +62,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) void Viewer::sceneChanged() { gBuffer.clear(); - CGAL::add_in_graphic_storage(*scene->lcc, gBuffer, m_drawing_functor); + CGAL::add_in_graphics_scene(*scene->lcc, gBuffer, m_gs_options); this->camera()->setSceneBoundingBox( CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(), diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 85b8d6591ac6..a4df8965ff20 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -38,7 +38,7 @@ public Q_SLOTS: Dart_const_descriptor, Dart_const_descriptor, Dart_const_descriptor, - Dart_const_descriptor> m_drawing_functor; + Dart_const_descriptor> m_gs_options; CGAL::Graphics_scene m_graphic_buffer; Scene* scene; bool m_previous_scene_empty; diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index 59b25e2371f3..36d6af07625b 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -17,7 +17,7 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5 */ template - void add_in_graphic_storage(const LCC& alcc, CGAL::Graphics_scene& graphic_storage, + void add_in_graphics_scene(const LCC& alcc, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options); } /* namespace CGAL */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index a66536220767..58c4d068dfbb 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -76,6 +76,6 @@ \cgalCRPSubsection{Draw a Linear Cell Complex} - \link PkgDrawLinearCellComplex CGAL::draw() \endlink -- \link PkgDrawLinearCellComplex CGAL::add_in_graphic_storage() \endlink +- \link PkgDrawLinearCellComplex CGAL::add_in_graphics_scene() \endlink */ 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 6ef9c4ada70e..a288dc68b5c7 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -61,7 +61,7 @@ template void compute_face(const LCC& lcc, typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptionsLCC& gs_options) { if (!gs_options.are_faces_enabled() || @@ -80,32 +80,32 @@ void compute_face(const LCC& lcc, if (gs_options.colored_volume(lcc, voldh)) { - graphic_storage.face_begin(gs_options.volume_color(lcc, voldh)); + graphics_scene.face_begin(gs_options.volume_color(lcc, voldh)); } else if (gs_options.colored_face(lcc, dh)) { - graphic_storage.face_begin(gs_options.face_color(lcc, dh)); + graphics_scene.face_begin(gs_options.face_color(lcc, dh)); } else - { graphic_storage.face_begin(); } + { graphics_scene.face_begin(); } cur=dh; do { - graphic_storage.add_point_in_face + graphics_scene.add_point_in_face (lcc.point(cur), LCC_geom_utils::get_vertex_normal(lcc, cur)); cur=lcc.next(cur); } while (cur!=dh); - graphic_storage.face_end(); + graphics_scene.face_end(); } template void compute_edge(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.are_edges_enabled() || @@ -118,18 +118,18 @@ void compute_edge(const LCC& lcc, { if (gs_options.colored_edge(lcc, dh)) { - graphic_storage.add_segment(p1, lcc.point(d2), + graphics_scene.add_segment(p1, lcc.point(d2), gs_options.edge_color(lcc, dh)); } else - { graphic_storage.add_segment(p1, lcc.point(d2)); } + { graphics_scene.add_segment(p1, lcc.point(d2)); } } } template void compute_vertex(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptionsLCC& gs_options) { if (!gs_options.are_vertices_enabled() || @@ -138,16 +138,16 @@ void compute_vertex(const LCC& lcc, if (gs_options.colored_vertex(lcc, dh)) { - graphic_storage.add_point(lcc.point(dh), + graphics_scene.add_point(lcc.point(dh), gs_options.vertex_color(lcc, dh)); } else - { graphic_storage.add_point(lcc.point(dh)); } + { graphics_scene.add_point(lcc.point(dh)); } } template void compute_elements(const LCC& lcc, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { typename LCC::size_type markvolumes = lcc.get_new_mark(); @@ -178,7 +178,7 @@ void compute_elements(const LCC& lcc, (!lcc.template is_free<3>(itv) && !gs_options.volume_wireframe(lcc, lcc.template opposite<3>(itv)))) && !gs_options.face_wireframe(lcc, itv)) - { compute_face(lcc, itv, it, graphic_storage, gs_options); } + { compute_face(lcc, itv, it, graphics_scene, gs_options); } for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator itf=lcc.template darts_of_cell_basic<2>(itv, markfaces).begin(), itfend=lcc.template darts_of_cell_basic<2>(itv, markfaces).end(); @@ -188,7 +188,7 @@ void compute_elements(const LCC& lcc, if (!lcc.is_marked(itf, markedges) && gs_options.draw_edge(lcc, itf)) { - compute_edge(lcc, itf, graphic_storage, gs_options); + compute_edge(lcc, itf, graphics_scene, gs_options); for(typename LCC::template Dart_of_cell_basic_range<1>::const_iterator ite=lcc.template darts_of_cell_basic<1>(itf, markedges).begin(), iteend=lcc.template darts_of_cell_basic<1>(itf, markedges).end(); @@ -198,7 +198,7 @@ void compute_elements(const LCC& lcc, if (!lcc.is_marked(ite, markvertices) && gs_options.draw_vertex(lcc, ite)) { - compute_vertex(lcc, ite, graphic_storage, gs_options); + compute_vertex(lcc, ite, graphics_scene, gs_options); CGAL::mark_cell(lcc, ite, markvertices); } } @@ -232,29 +232,29 @@ void compute_elements(const LCC& lcc, CGAL::Linear_cell_complex_base -// add_in_graphic_storage: to add a LCC in the given graphic buffer, with a +// add_in_graphics_scene: to add a LCC in the given graphic buffer, with a // graphics scene options. template class Map, class Refs, class Storage_, typename BufferType=float, class GSOptions> -void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const CGAL_LCC_TYPE& alcc, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_lcc::compute_elements(static_cast(alcc), - graphic_storage, gs_options); + graphics_scene, gs_options); } -// add_in_graphic_storage: to add a LCC in the given graphic buffer, without a +// add_in_graphics_scene: to add a LCC in the given graphic buffer, without a // graphics scene options. Use default drawing values. template class Map, class Refs, class Storage_, typename BufferType=float> -void add_in_graphic_storage(const CGAL_LCC_TYPE& alcc, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_LCC_TYPE& alcc, + CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options buffer; - add_in_graphic_storage(alcc, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(alcc, buffer, gs_options); + draw_graphics_scene(buffer, title); } // Specialization of draw function for a LCC, without a graphics scene options. @@ -301,8 +301,8 @@ template buffer; - add_in_graphic_storage(alcc, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(alcc, buffer); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 49a56e023d13..594f48b4d4d9 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -95,11 +95,11 @@ class Nef_Visitor { public: Nef_Visitor(const Nef_Polyhedron&_nef, - CGAL::Graphics_scene& _graphic_storage, + CGAL::Graphics_scene& _graphics_scene, const GSOptions&_gs_options) : n_faces(0), n_edges(0), nef(_nef), - graphic_storage(_graphic_storage), + graphics_scene(_graphics_scene), gs_options(_gs_options) {} @@ -110,10 +110,10 @@ class Nef_Visitor { { return; } if(gs_options.colored_vertex(nef, vh)) - { graphic_storage.add_point(vh->point(), + { graphics_scene.add_point(vh->point(), gs_options.vertex_color(nef, vh)); } else - { graphic_storage.add_point(vh->point()); } + { graphics_scene.add_point(vh->point()); } } void visit(Halffacet_const_handle opposite_facet) @@ -135,9 +135,9 @@ class Nef_Visitor { { return; } //return if not-shalfedge if(gs_options.colored_face(nef, f)) - { graphic_storage.face_begin(gs_options.face_color(nef, f)); } + { graphics_scene.face_begin(gs_options.face_color(nef, f)); } else - { graphic_storage.face_begin(); } + { graphics_scene.face_begin(); } SHalfedge_around_facet_const_circulator hc_start(se); SHalfedge_around_facet_const_circulator hc_end(hc_start); @@ -146,7 +146,7 @@ class Nef_Visitor { { Vertex_const_handle vh=hc_start->source()->center_vertex(); lastvh=vh; - graphic_storage.add_point_in_face(vh->point(), + graphics_scene.add_point_in_face(vh->point(), get_vertex_normal(vh)); } @@ -162,19 +162,19 @@ class Nef_Visitor { CGAL_For_all(hc_start, hc_end) { Vertex_const_handle vh=hc_start->source()->center_vertex(); - graphic_storage.add_point_in_face(vh->point(), + graphics_scene.add_point_in_face(vh->point(), get_vertex_normal(vh)); } - graphic_storage.add_point_in_face(hc_start->source()->center_vertex()->point(), + graphics_scene.add_point_in_face(hc_start->source()->center_vertex()->point(), get_vertex_normal (hc_start->source()->center_vertex())); - graphic_storage.add_point_in_face(lastvh->point(), + graphics_scene.add_point_in_face(lastvh->point(), get_vertex_normal(lastvh)); } ++fc; } - graphic_storage.face_end(); + graphics_scene.face_end(); facets_done[f]=true; ++n_faces; } @@ -191,10 +191,10 @@ class Nef_Visitor { { return; } // Edge already added if(gs_options.colored_edge(nef, he)) - { graphic_storage.add_segment(he->source()->point(), he->target()->point(), + { graphics_scene.add_segment(he->source()->point(), he->target()->point(), gs_options.edge_color(nef, he)); } else - { graphic_storage.add_segment(he->source()->point(), he->target()->point()); } + { graphics_scene.add_segment(he->source()->point(), he->target()->point()); } edges_done[he]=true; ++n_edges; } @@ -207,14 +207,14 @@ class Nef_Visitor { protected: std::unordered_map facets_done; std::unordered_map edges_done; - CGAL::Graphics_scene& graphic_storage; + CGAL::Graphics_scene& graphics_scene; const GSOptions& gs_options; const Nef_Polyhedron& nef; }; template void compute_elements(const Nef_Polyhedron &nef, - CGAL::Graphics_scene &graphic_storage, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { @@ -224,7 +224,7 @@ void compute_elements(const Nef_Polyhedron &nef, Volume_const_iterator c; Nef_Visitor - V(nef, graphic_storage, gs_options); + V(nef, graphics_scene, gs_options); CGAL_forall_volumes(c, nef) { Shell_entry_const_iterator it; @@ -232,29 +232,29 @@ void compute_elements(const Nef_Polyhedron &nef, { nef.visit_shell_objects(SFace_const_handle(it), V); } } - graphic_storage.negate_all_normals(); + graphics_scene.negate_all_normals(); } } // namespace draw_function_for_nef_polyhedron #define CGAL_NEF3_TYPE Nef_polyhedron_3 -// add_in_graphic_storage +// add_in_graphics_scene template -void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, - CGAL::Graphics_scene &graphic_storage, +void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { draw_function_for_nef_polyhedron::compute_elements(anef, - graphic_storage, + graphics_scene, gs_options); } template -void add_in_graphic_storage(const CGAL_NEF3_TYPE &anef, - CGAL::Graphics_scene &graphic_storage) +void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, + CGAL::Graphics_scene &graphics_scene) { // Default graphics view options. Graphics_scene_options buffer; - add_in_graphic_storage(anef, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(anef, buffer, gs_options); + draw_graphics_scene(buffer, title); } template buffer; - add_in_graphic_storage(anef, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(anef, buffer); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 3fcf78387c53..756ecdd24ba0 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -69,7 +69,7 @@ namespace draw_function_for_P2T2 template void compute_vertex(const P2T2 &p2t2, typename P2T2::Periodic_point_iterator pi, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { // Construct the point in 9-sheeted covering space and add to viewer @@ -77,16 +77,16 @@ void compute_vertex(const P2T2 &p2t2, { return; } if(gs_options.colored_vertex(p2t2, pi)) - { graphic_storage.add_point(p2t2.point(*pi), + { graphics_scene.add_point(p2t2.point(*pi), gs_options.vertex_color(p2t2, pi)); } else - { graphic_storage.add_point(p2t2.point(*pi)); } + { graphics_scene.add_point(p2t2.point(*pi)); } } template void compute_edge(const P2T2 &p2t2, typename P2T2::Periodic_segment_iterator si, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if(!gs_options.draw_edge(p2t2, si)) @@ -95,16 +95,16 @@ void compute_edge(const P2T2 &p2t2, // Construct the segment in 9-sheeted covering space and add to viewer typename P2T2::Segment s(p2t2.segment(*si)); if(gs_options.colored_edge(p2t2, si)) - { graphic_storage.add_segment(s[0], s[1], + { graphics_scene.add_segment(s[0], s[1], gs_options.edge_color(p2t2, si)); } else - { graphic_storage.add_segment(s[0], s[1]); } + { graphics_scene.add_segment(s[0], s[1]); } } template void compute_face(const P2T2 &p2t2, typename P2T2::Periodic_triangle_iterator ti, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if(!gs_options.draw_face(p2t2, ti)) @@ -114,19 +114,19 @@ void compute_face(const P2T2 &p2t2, typename P2T2::Triangle t(p2t2.triangle(*ti)); if(gs_options.colored_face(p2t2, ti)) - { graphic_storage.face_begin(gs_options.face_color(p2t2, ti)); } + { graphics_scene.face_begin(gs_options.face_color(p2t2, ti)); } else - { graphic_storage.face_begin(); } + { graphics_scene.face_begin(); } - graphic_storage.add_point_in_face(t[0]); - graphic_storage.add_point_in_face(t[1]); - graphic_storage.add_point_in_face(t[2]); - graphic_storage.face_end(); + graphics_scene.add_point_in_face(t[0]); + graphics_scene.add_point_in_face(t[1]); + graphics_scene.add_point_in_face(t[2]); + graphics_scene.face_end(); } template void compute_domain(const P2T2& p2t2, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -145,17 +145,17 @@ void compute_domain(const P2T2& p2t2, Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin()); Kernel::Point_2 p4((orig_domain.max)()); - graphic_storage.add_segment(p1 + shift, p2 + shift, gs_options.domain_color); - graphic_storage.add_segment(p1 + shift, p3 + shift, gs_options.domain_color); - graphic_storage.add_segment(p2 + shift, p4 + shift, gs_options.domain_color); - graphic_storage.add_segment(p3 + shift, p4 + shift, gs_options.domain_color); + graphics_scene.add_segment(p1 + shift, p2 + shift, gs_options.domain_color); + graphics_scene.add_segment(p1 + shift, p3 + shift, gs_options.domain_color); + graphics_scene.add_segment(p2 + shift, p4 + shift, gs_options.domain_color); + graphics_scene.add_segment(p3 + shift, p4 + shift, gs_options.domain_color); } } } template void compute_elements(const P2T2& p2t2, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { // Get the display type, iterate through periodic elements according @@ -168,27 +168,27 @@ void compute_elements(const P2T2& p2t2, { for (typename P2T2::Periodic_point_iterator it=p2t2.periodic_points_begin(it_type); it!=p2t2.periodic_points_end(it_type); ++it) - { compute_vertex(p2t2, it, graphic_storage, gs_options); } + { compute_vertex(p2t2, it, graphics_scene, gs_options); } } if(gs_options.are_edges_enabled()) { for (typename P2T2::Periodic_segment_iterator it=p2t2.periodic_segments_begin(it_type); it!=p2t2.periodic_segments_end(it_type); ++it) - { compute_edge(p2t2, it, graphic_storage, gs_options); } + { compute_edge(p2t2, it, graphics_scene, gs_options); } } if (gs_options.are_faces_enabled()) { for (typename P2T2::Periodic_triangle_iterator it=p2t2.periodic_triangles_begin(it_type); it!=p2t2.periodic_triangles_end(it_type); ++it) - { compute_face(p2t2, it, graphic_storage, gs_options); } + { compute_face(p2t2, it, graphics_scene, gs_options); } } if(gs_options.get_draw_domain()) { // Compute the (9-sheet covering space) domain of the periodic triangulation - compute_domain(p2t2, graphic_storage, gs_options); + compute_domain(p2t2, graphics_scene, gs_options); } } @@ -197,16 +197,16 @@ void compute_elements(const P2T2& p2t2, #define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 template -void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const CGAL_P2T2_TYPE& p2t2, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { - draw_function_for_P2T2::compute_elements(p2t2, graphic_storage, gs_options); + draw_function_for_P2T2::compute_elements(p2t2, graphics_scene, gs_options); } template -void add_in_graphic_storage(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_P2T2_TYPE& p2t2, + CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options_periodic_2_triangulation_2 gs_options; - add_in_graphic_storage(p2t2, graphic_storage, gs_options); + add_in_graphics_scene(p2t2, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER @@ -226,8 +226,8 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, const char* title="2D Periodic Triangulation Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(ap2t2, buffer, gs_options); - draw_graphic_storage(buffer); + add_in_graphics_scene(ap2t2, buffer, gs_options); + draw_graphics_scene(buffer); } template @@ -241,7 +241,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, typename CGAL_P2T2_TYPE::Periodic_segment_iterator, typename CGAL_P2T2_TYPE::Periodic_triangle_iterator> gs_options; - add_in_graphic_storage(ap2t2, buffer, gs_options); + add_in_graphics_scene(ap2t2, buffer, gs_options); QApplication_and_basic_viewer app(buffer, title); if(app) { @@ -260,7 +260,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, "Unique cover")))); basic_viewer->clear(); draw_function_for_P2T2::compute_elements(ap2t2, - basic_viewer->get_graphic_storage(), + basic_viewer->get_graphics_scene(), gs_options); basic_viewer->redraw(); } 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 5560909c3782..72365c6e40c5 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -44,7 +44,7 @@ namespace draw_function_for_PointSet { template void compute_elements(const PointSet& pointset, - Graphics_scene& graphic_storage, + Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.are_vertices_enabled()) @@ -57,11 +57,11 @@ void compute_elements(const PointSet& pointset, { if (gs_options.colored_vertex(pointset, it)) { - graphic_storage.add_point(pointset.point(*it), + graphics_scene.add_point(pointset.point(*it), gs_options.vertex_color(pointset, it)); } else - { graphic_storage.add_point(pointset.point(*it)); } + { graphics_scene.add_point(pointset.point(*it)); } } } } @@ -69,23 +69,23 @@ void compute_elements(const PointSet& pointset, } // namespace draw_function_for_PointSet template -void add_in_graphic_storage(const Point_set_3& apointset, - Graphics_scene& graphic_storage, +void add_in_graphics_scene(const Point_set_3& apointset, + Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_PointSet::compute_elements(apointset, - graphic_storage, + graphics_scene, gs_options); } template -void add_in_graphic_storage(const Point_set_3& apointset, - Graphics_scene& graphic_storage) +void add_in_graphics_scene(const Point_set_3& apointset, + Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options, typename Point_set_3::const_iterator, int, int> gs_options; - add_in_graphic_storage(apointset, graphic_storage, gs_options); + add_in_graphics_scene(apointset, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER @@ -97,8 +97,8 @@ void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { Graphics_scene buffer; - add_in_graphic_storage(apointset, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(apointset, buffer, gs_options); + draw_graphics_scene(buffer, title); } template @@ -106,8 +106,8 @@ void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { Graphics_scene buffer; - add_in_graphic_storage(apointset, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(apointset, buffer); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 89ae5f70c689..eb670966aa9c 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -48,7 +48,7 @@ namespace draw_function_for_p2 { template void compute_elements(const P2& p2, - CGAL::Graphics_scene &graphic_storage, + CGAL::Graphics_scene &graphics_scene, const GSOptions& gs_options) { if (p2.is_empty()) @@ -59,9 +59,9 @@ void compute_elements(const P2& p2, if (gs_options.are_faces_enabled()) { if(gs_options.colored_face(p2, nullptr)) - { graphic_storage.face_begin(gs_options.face_color(p2, nullptr)); } + { graphics_scene.face_begin(gs_options.face_color(p2, nullptr)); } else - { graphic_storage.face_begin(); } + { graphics_scene.face_begin(); } } for (typename P2::Vertex_const_iterator i=p2.vertices_begin(); @@ -71,51 +71,51 @@ void compute_elements(const P2& p2, gs_options.draw_vertex(p2, i)) { // Add vertex if(gs_options.colored_vertex(p2, i)) - { graphic_storage.add_point(*i, gs_options.vertex_color(p2, i)); } + { graphics_scene.add_point(*i, gs_options.vertex_color(p2, i)); } else - { graphic_storage.add_point(*i); } + { graphics_scene.add_point(*i); } } if(gs_options.are_edges_enabled() && gs_options.draw_edge(p2, i)) { // Add edge with previous point if(gs_options.colored_vertex(p2, i)) - { graphic_storage.add_segment(prev, *i, gs_options.edge_color(p2, i)); } + { graphics_scene.add_segment(prev, *i, gs_options.edge_color(p2, i)); } else - { graphic_storage.add_segment(prev, *i); } + { graphics_scene.add_segment(prev, *i); } } if(gs_options.are_faces_enabled()) - { graphic_storage.add_point_in_face(*i); } // Add point in face + { graphics_scene.add_point_in_face(*i); } // Add point in face prev = *i; } if (gs_options.are_faces_enabled()) - { graphic_storage.face_end(); } + { graphics_scene.face_end(); } } } // namespace draw_function_for_p2 #define CGAL_P2_TYPE CGAL::Polygon_2 -// Specializations of add_in_graphic_storage function +// Specializations of add_in_graphics_scene function template -void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const CGAL_P2_TYPE& ap2, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) -{ draw_function_for_p2::compute_elements(ap2, graphic_storage, gs_options); } +{ draw_function_for_p2::compute_elements(ap2, graphics_scene, gs_options); } template -void add_in_graphic_storage(const CGAL_P2_TYPE& ap2, - CGAL::Graphics_scene &graphic_storage) +void add_in_graphics_scene(const CGAL_P2_TYPE& ap2, + CGAL::Graphics_scene &graphics_scene) { CGAL::Graphics_scene_options gs_options; - draw_function_for_p2::compute_elements(ap2, graphic_storage, gs_options); + draw_function_for_p2::compute_elements(ap2, graphics_scene, gs_options); } // Specialization of draw function. @@ -127,8 +127,8 @@ void draw(const CGAL_P2_TYPE &ap2, const char *title="Polygon_2 Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(ap2, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(ap2, buffer); + draw_graphics_scene(buffer, title); } template @@ -137,8 +137,8 @@ void draw(const CGAL_P2_TYPE &ap2, const char *title="Polygon_2 Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(ap2, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(ap2, buffer, gs_options); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 03a428f40091..9889a0639547 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -55,12 +55,12 @@ namespace draw_function_for_ph2_with_holes { template void compute_one_loop_elements(const P2& ap2, const typename P2::General_polygon_2& aloop, - Graphics_scene &graphic_storage, + Graphics_scene &graphics_scene, bool hole, const GSOptions& gs_options) { if (hole && gs_options.are_faces_enabled()) - { graphic_storage.add_point_in_face(aloop.vertex(aloop.size()-1)); } + { graphics_scene.add_point_in_face(aloop.vertex(aloop.size()-1)); } typename P2::General_polygon_2::Vertex_const_iterator prev; for(typename P2::General_polygon_2::Vertex_const_iterator i=aloop.vertices_begin(); @@ -70,9 +70,9 @@ void compute_one_loop_elements(const P2& ap2, gs_options.draw_vertex(ap2, i)) { // Add vertex if(gs_options.colored_vertex(ap2, i)) - { graphic_storage.add_point(*i, gs_options.vertex_color(ap2, i)); } + { graphics_scene.add_point(*i, gs_options.vertex_color(ap2, i)); } else - { graphic_storage.add_point(*i); } + { graphics_scene.add_point(*i); } } if(i!=aloop.vertices_begin() && @@ -80,13 +80,13 @@ void compute_one_loop_elements(const P2& ap2, gs_options.draw_edge(ap2, i)) { // Add segment with previous point if(gs_options.colored_vertex(ap2, i)) - { graphic_storage.add_segment(*prev, *i, gs_options.edge_color(ap2, i)); } + { graphics_scene.add_segment(*prev, *i, gs_options.edge_color(ap2, i)); } else - { graphic_storage.add_segment(*prev, *i); } + { graphics_scene.add_segment(*prev, *i); } } if(gs_options.are_faces_enabled()) - { graphic_storage.add_point_in_face(*i); } // Add point in face + { graphics_scene.add_point_in_face(*i); } // Add point in face prev=i; } @@ -94,11 +94,11 @@ void compute_one_loop_elements(const P2& ap2, // Add the last segment between the last point and the first one if(gs_options.are_edges_enabled() && gs_options.draw_edge(ap2, aloop.vertices_begin())) - { graphic_storage.add_segment(*prev, *(aloop.vertices_begin())); } + { graphics_scene.add_segment(*prev, *(aloop.vertices_begin())); } } template -void compute_elements(const P2& p2, Graphics_scene &graphic_storage, +void compute_elements(const P2& p2, Graphics_scene &graphics_scene, const GSOptions& gs_options) { if (p2.outer_boundary().is_empty()) return; @@ -106,26 +106,26 @@ void compute_elements(const P2& p2, Graphics_scene &graphic_storage, if (gs_options.are_faces_enabled()) { if(gs_options.colored_face(p2, nullptr)) - { graphic_storage.face_begin(gs_options.face_color(p2, nullptr)); } + { graphics_scene.face_begin(gs_options.face_color(p2, nullptr)); } else - { graphic_storage.face_begin(); } + { graphics_scene.face_begin(); } } - compute_one_loop_elements(p2, p2.outer_boundary(), graphic_storage, + compute_one_loop_elements(p2, p2.outer_boundary(), graphics_scene, false, gs_options); for (typename P2::Hole_const_iterator it=p2.holes_begin(); it!=p2.holes_end(); ++it) { - compute_one_loop_elements(p2, *it, graphic_storage, + compute_one_loop_elements(p2, *it, graphics_scene, true, gs_options); if (gs_options.are_faces_enabled()) - { graphic_storage.add_point_in_face(p2.outer_boundary().vertex + { graphics_scene.add_point_in_face(p2.outer_boundary().vertex (p2.outer_boundary().size()-1)); } } if (gs_options.are_faces_enabled()) - { graphic_storage.face_end(); } + { graphics_scene.face_end(); } } } // draw_function_for_ph2 @@ -133,24 +133,24 @@ void compute_elements(const P2& p2, Graphics_scene &graphic_storage, #define CGAL_P2_WITH_HOLES_TYPE CGAL::Polygon_with_holes_2 template -void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, + CGAL::Graphics_scene& graphics_scene, const GSOptions &gs_options) { - draw_function_for_ph2_with_holes::compute_elements(p2, graphic_storage, + draw_function_for_ph2_with_holes::compute_elements(p2, graphics_scene, gs_options); } template -void add_in_graphic_storage(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, + CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options gs_options; - add_in_graphic_storage(p2, graphic_storage, gs_options); + add_in_graphics_scene(p2, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER @@ -161,8 +161,8 @@ void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const GSOptions &gs_options, const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(ap2, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(ap2, buffer, gs_options); + draw_graphics_scene(buffer, title); } template @@ -170,8 +170,8 @@ void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(ap2, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(ap2, buffer); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index c9f7cb47f099..5694e9a0b50d 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -26,7 +26,7 @@ namespace CGAL #define CGAL_POLY_TYPE CGAL::Polyhedron_3 \ -// Specialization of add_in_graphic_storage function. +// Specialization of add_in_graphics_scene function. template @@ -34,10 +34,10 @@ template -void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, - CGAL::Graphics_scene &graphic_storage, +void add_in_graphics_scene(const CGAL_POLY_TYPE& apoly, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) -{ add_in_graphic_storage_for_fg(apoly, graphic_storage, gs_options); } +{ add_in_graphics_scene_for_fg(apoly, graphics_scene, gs_options); } template -void add_in_graphic_storage(const CGAL_POLY_TYPE& apoly, - CGAL::Graphics_scene &graphic_storage) -{ add_in_graphic_storage_for_fg(apoly, graphic_storage); } +void add_in_graphics_scene(const CGAL_POLY_TYPE& apoly, + CGAL::Graphics_scene &graphics_scene) +{ add_in_graphics_scene_for_fg(apoly, graphics_scene); } // Specialization of draw function: require Qt and the CGAL basic viewer. #ifdef CGAL_USE_BASIC_VIEWER @@ -62,8 +62,8 @@ void draw(const CGAL_POLY_TYPE& apoly, const char* title="Polyhedron Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage_for_fg(apoly, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene_for_fg(apoly, buffer); + draw_graphics_scene(buffer, title); } template buffer; - add_in_graphic_storage_for_fg(apoly, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene_for_fg(apoly, buffer, gs_options); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 7552a10469f3..4be05c54ba9f 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -26,7 +26,7 @@ namespace draw_function_for_ss2 { template void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_edge(ss2, eh)) @@ -34,13 +34,13 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, if (gs_options.colored_edge(ss2, eh)) { - graphic_storage.add_segment(eh->opposite()->vertex()->point(), + graphics_scene.add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), gs_options.edge_color(ss2, eh)); } else { - graphic_storage.add_segment(eh->opposite()->vertex()->point(), + graphics_scene.add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point()); } } @@ -48,7 +48,7 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, template void print_halfedge_labels(const SS2& ss2, typename SS2::Halfedge_const_handle h, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { // TODO? an option different from draw_edge to allow to show only some labels ?? @@ -60,14 +60,14 @@ void print_halfedge_labels(const SS2& ss2, label << "H" << h->opposite()->id() << " (V" << h->opposite()->vertex()->id() << ") "; - graphic_storage.add_text( + graphics_scene.add_text( CGAL::midpoint(h->opposite()->vertex()->point(), h->vertex()->point()), label.str()); } template void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_vertex(ss2, vh)) @@ -75,16 +75,16 @@ void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, if (gs_options.colored_vertex(ss2, vh)) { - graphic_storage.add_point(vh->point(), gs_options.vertex_color(ss2, vh)); + graphics_scene.add_point(vh->point(), gs_options.vertex_color(ss2, vh)); } else - { graphic_storage.add_point(vh->point()); } + { graphics_scene.add_point(vh->point()); } } template void print_vertex_label(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { // TODO? an option different from draw_vertex to allow to show only some labels ?? @@ -93,12 +93,12 @@ void print_vertex_label(const SS2& ss2, std::stringstream label; label << "V" << vh->id() << std::ends; - graphic_storage.add_text(vh->point(), label.str()); + graphics_scene.add_text(vh->point(), label.str()); } template void compute_elements(const SS2& ss2, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.are_edges_enabled()) @@ -108,8 +108,8 @@ void compute_elements(const SS2& ss2, { if (it->id()opposite()->id()) { - compute_edge(ss2, it, graphic_storage, gs_options); - print_halfedge_labels(ss2, it, graphic_storage, gs_options); + compute_edge(ss2, it, graphics_scene, gs_options); + print_halfedge_labels(ss2, it, graphics_scene, gs_options); } } } @@ -119,8 +119,8 @@ void compute_elements(const SS2& ss2, for (typename SS2::Vertex_const_iterator it=ss2.vertices_begin(); it!=ss2.vertices_end(); ++it) { - compute_vertex(ss2, it, graphic_storage, gs_options); - print_vertex_label(ss2, it, graphic_storage, gs_options); + compute_vertex(ss2, it, graphics_scene, gs_options); + print_vertex_label(ss2, it, graphics_scene, gs_options); } } } @@ -130,17 +130,17 @@ void compute_elements(const SS2& ss2, #define CGAL_SS_TYPE CGAL::Straight_skeleton_2 template -void add_in_graphic_storage(const CGAL_SS_TYPE &ass2, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const CGAL_SS_TYPE &ass2, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { - draw_function_for_ss2::compute_elements(ass2, graphic_storage, + draw_function_for_ss2::compute_elements(ass2, graphics_scene, gs_options); } template -void add_in_graphic_storage(const CGAL_SS_TYPE& ass2, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_SS_TYPE& ass2, + CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options buffer; - add_in_graphic_storage(ass2, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(ass2, buffer, gs_options); + draw_graphics_scene(buffer, title); } template @@ -196,8 +196,8 @@ void draw(const CGAL_SS_TYPE &ass2, const char *title="Straight Skeleton Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(ass2, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(ass2, buffer); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index e41050d297cb..e7180663c98d 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -95,15 +95,15 @@ struct Graphics_scene_options_surface_mesh }; template -void add_in_graphic_storage(const Surface_mesh& amesh, - CGAL::Graphics_scene &graphic_storage, +void add_in_graphics_scene(const Surface_mesh& amesh, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) -{ add_in_graphic_storage_for_fg(amesh, graphic_storage, gs_options); } +{ add_in_graphics_scene_for_fg(amesh, graphics_scene, gs_options); } template -void add_in_graphic_storage(const Surface_mesh& amesh, - CGAL::Graphics_scene &graphic_storage) -{ add_in_graphic_storage_for_fg(amesh, graphic_storage, +void add_in_graphics_scene(const Surface_mesh& amesh, + CGAL::Graphics_scene &graphics_scene) +{ add_in_graphics_scene_for_fg(amesh, graphics_scene, Graphics_scene_options_surface_mesh(amesh)); } #ifdef CGAL_USE_BASIC_VIEWER @@ -114,8 +114,8 @@ void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(amesh, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(amesh, buffer); + draw_graphics_scene(buffer, title); } template @@ -124,8 +124,8 @@ void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(amesh, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(amesh, buffer, gs_options); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 698eab17e1e4..76135c4e682a 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -145,7 +145,7 @@ template void compute_face(const Mesh& mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options) { if(!gs_options.draw_face(lcc, dh)) @@ -171,21 +171,21 @@ void compute_face(const Mesh& mesh, while(cur!=dh); if(gs_options.colored_face(lcc, dh)) - { graphic_storage.face_begin(gs_options.face_color(lcc, dh)); } + { graphics_scene.face_begin(gs_options.face_color(lcc, dh)); } else - { graphic_storage.face_begin(); } + { graphics_scene.face_begin(); } cur=dh; do { - graphic_storage.add_point_in_face(draw_function_for_face_graph_with_paths::get_point(mesh, cur), + graphics_scene.add_point_in_face(draw_function_for_face_graph_with_paths::get_point(mesh, cur), draw_function_for_lcc::LCC_geom_utils:: get_vertex_normal(lcc, cur)); cur=lcc.next(cur); } while(cur!=dh); - graphic_storage.face_end(); + graphics_scene.face_end(); } template @@ -193,7 +193,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, typename Get_map::type::size_type m_amark, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options, bool draw_marked_darts=true) { @@ -213,9 +213,9 @@ void compute_edge(const Mesh &mesh, { if (m_draw_marked_darts && m_amark!=LCC::INVALID_MARK && (lcc.is_marked(dh, m_amark) || lcc.is_marked(lcc.opposite2(dh), m_amark))) - { graphic_storage.add_segment(p1, get_point(mesh, d2), CGAL::IO::Color(0, 0, 255)); } + { graphics_scene.add_segment(p1, get_point(mesh, d2), CGAL::IO::Color(0, 0, 255)); } else - { graphic_storage.add_segment(p1, get_point(mesh, d2)); } + { graphics_scene.add_segment(p1, get_point(mesh, d2)); } } } @@ -224,7 +224,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, const CGAL::IO::Color& color, - CGAL::Graphics_scene& graphic_storage) + CGAL::Graphics_scene& graphics_scene) { typedef typename Get_map::type LCC; typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; @@ -235,25 +235,25 @@ void compute_edge(const Mesh &mesh, Point p1=get_point(mesh, dh); Dart_const_descriptor d2=lcc.other_extremity(dh); if (d2!=LCC::null_descriptor) - { graphic_storage.add_segment(p1, get_point(mesh, d2), color); } + { graphics_scene.add_segment(p1, get_point(mesh, d2), color); } } template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options) { typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - graphic_storage.add_point(get_point(mesh, dh)); + graphics_scene.add_point(get_point(mesh, dh)); } template void compute_path(const Mesh &mesh, const typename Get_map::storage_type& lcc, - CGAL::Graphics_scene &graphic_storage, + CGAL::Graphics_scene &graphics_scene, const std::vector>* m_paths, std::size_t i, typename Get_map::type::size_type amark) @@ -269,12 +269,12 @@ void compute_path(const Mesh &mesh, CGAL::Random random(static_cast(i)); CGAL::IO::Color color = get_random_color(random); - graphic_storage.add_point(get_point(mesh, (*m_paths)[i].get_ith_dart(0)), color); + graphics_scene.add_point(get_point(mesh, (*m_paths)[i].get_ith_dart(0)), color); for (std::size_t j=0; j<(*m_paths)[i].length(); ++j) { if ( !lcc.is_marked( (*m_paths)[i].get_ith_dart(j), amark) ) { - compute_edge(mesh, lcc, (*m_paths)[i].get_ith_dart(j), color, mesh, graphic_storage, lcc); + compute_edge(mesh, lcc, (*m_paths)[i].get_ith_dart(j), color, mesh, graphics_scene, lcc); lcc.template mark_cell<1>((*m_paths)[i].get_ith_dart(j), amark); } } @@ -282,7 +282,7 @@ void compute_path(const Mesh &mesh, template void compute_elements(const Mesh &mesh, - CGAL::Graphics_scene &graphic_storage, + CGAL::Graphics_scene &graphics_scene, const GSOptions &m_gs_options, const std::vector>* m_paths, typename Get_map::type::size_type amark) @@ -311,19 +311,19 @@ void compute_elements(const Mesh &mesh, if (m_current_dart!=lcc.darts().end()) { // We want to draw only one dart Dart_const_descriptor selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); - compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphic_storage, lcc); + compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphics_scene, lcc); lcc.template mark_cell<1>(selected_dart, markedges); - compute_vertex(selected_dart, mesh, graphic_storage); + compute_vertex(selected_dart, mesh, graphics_scene); if ( !m_nofaces ) - { compute_face(selected_dart, mesh, graphic_storage, lcc); } + { compute_face(selected_dart, mesh, graphics_scene, lcc); } for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), itend=lcc.darts().end(); it!=itend; ++it ) { if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphic_storage, lcc, m_amark, m_draw_marked_darts); + compute_edge(it, mesh, graphics_scene, lcc, m_amark, m_draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } } @@ -333,10 +333,10 @@ void compute_elements(const Mesh &mesh, if (m_current_path==m_paths->size()) { for (std::size_t i=0; isize(); ++i) - { compute_path(i, markedges, mesh, graphic_storage, m_paths, lcc); } + { compute_path(i, markedges, mesh, graphics_scene, m_paths, lcc); } } else if (m_current_path!=m_paths->size()+1) - { compute_path(m_current_path, markedges, mesh, graphic_storage, m_paths, lcc); } + { compute_path(m_current_path, markedges, mesh, graphics_scene, m_paths, lcc); } for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), itend=lcc.darts().end(); it!=itend; ++it ) @@ -344,19 +344,19 @@ void compute_elements(const Mesh &mesh, if (!m_nofaces && !lcc.is_marked(it, markfaces) && !lcc.is_perforated(it) && lcc.is_marked(it, m_oriented_mark)) { - compute_face(it, mesh, graphic_storage, lcc); + compute_face(it, mesh, graphics_scene, lcc); lcc.template mark_cell<2>(it, markfaces); } if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphic_storage, lcc, m_amark, m_draw_marked_darts); + compute_edge(it, mesh, graphics_scene, lcc, m_amark, m_draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } if ( !lcc.is_marked(it, markvertices) ) { - compute_vertex(it, mesh, graphic_storage); + compute_vertex(it, mesh, graphics_scene); lcc.template mark_cell<0>(it, markvertices); } } @@ -370,22 +370,22 @@ void compute_elements(const Mesh &mesh, } // namespace draw_function_for_face_graph_with_paths template -void add_in_graphic_storage(const Mesh& mesh, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const Mesh& mesh, + CGAL::Graphics_scene& graphics_scene, const std::vector>* paths, const GSOptions& gs_options, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) { draw_function_for_face_graph_with_paths::compute_elements(mesh, - graphic_storage, + graphics_scene, gs_options, paths, amark); } template -void add_in_graphic_storage(const Mesh& mesh, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const Mesh& mesh, + CGAL::Graphics_scene& graphics_scene, const std::vector>* paths, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) @@ -397,7 +397,7 @@ void add_in_graphic_storage(const Mesh& mesh, typename Get_map::type::Dart_const_descriptor /*fh*/> gs_options; - add_in_graphic_storage(mesh, graphic_storage, gs_options, paths, amark); + add_in_graphics_scene(mesh, graphics_scene, gs_options, paths, amark); } #ifdef CGAL_USE_BASIC_VIEWER @@ -410,8 +410,8 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(mesh, buffer, &paths, amark); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(mesh, buffer, &paths, amark); + draw_graphics_scene(buffer, title); } template @@ -423,8 +423,8 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(mesh, buffer, gs_options, &paths, amark); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(mesh, buffer, gs_options, &paths, amark); + draw_graphics_scene(buffer, title); } template @@ -436,8 +436,8 @@ void draw(const Mesh& mesh, { std::vector> paths=l; CGAL::Graphics_scene buffer; - add_in_graphic_storage(mesh, buffer, &paths, amark); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(mesh, buffer, &paths, amark); + draw_graphics_scene(buffer, title); } } // End namespace CGAL diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 857d8db8b2a5..5f42a8463acd 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -32,7 +32,7 @@ adds the vertices, edges and faces of `at2` into the given graphic storage `gs`. */ template -void add_in_graphic_storage(const T2& at2, +void add_in_graphics_scene(const T2& at2, CGAL::Graphics_scene& gs, const CGAL::Graphics_scene_options #include #include -#include "polygon_triangulation_drawing_functor.h" +#include "polygon_triangulation_graphics_scene_options.h" #include #include @@ -58,7 +58,7 @@ int main( ) assert(count > 0); assert(count < cdt.number_of_faces()); - CGAL::Polygon_triangulation_drawing_functor myfunctor(in_domain); + CGAL::Polygon_triangulation_gs_options myfunctor(in_domain); CGAL::draw(cdt, myfunctor); return 0; } diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_graphics_scene_options.h similarity index 88% rename from Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h rename to Triangulation_2/examples/Triangulation_2/polygon_triangulation_graphics_scene_options.h index 7cca28a1948f..02f467dcb58b 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_drawing_functor.h +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_graphics_scene_options.h @@ -9,8 +9,8 @@ // // Author(s) : Andreas Fabri -#ifndef CGAL_POLYGON_TRIANGULATION_DRAWING_FUNCTOR_H -#define CGAL_POLYGON_TRIANGULATION_DRAWING_FUNCTOR_H +#ifndef CGAL_POLYGON_TRIANGULATION_GRAPHICS_SCENE_OPTIONS_H +#define CGAL_POLYGON_TRIANGULATION_GRAPHICS_SCENE_OPTIONS_H #include #include @@ -60,7 +60,7 @@ struct Polygon_triangulation_gs_options : template -void add_in_graphic_storage(const CGAL_CT2_TYPE& ct2, +void add_in_graphics_scene(const CGAL_CT2_TYPE& ct2, CGAL::Graphics_scene& graphic_buffer, const GSOptions& gs_options) { @@ -75,8 +75,8 @@ void draw(const CGAL_CT2_TYPE &ct2, const GSOptions &gs_options, const char *title="Constrained Triangulation_2 Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(ct2, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(ct2, buffer, gs_options); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER @@ -85,4 +85,4 @@ void draw(const CGAL_CT2_TYPE &ct2, const GSOptions &gs_options, }; // end namespace CGAL -#endif // CGAL_POLYGON_TRIANGULATION_DRAWING_FUNCTOR_H +#endif // CGAL_POLYGON_TRIANGULATION_GRAPHICS_SCENE_OPTIONS_H diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index c56938f8eecf..eb7b4e8d72f1 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -27,8 +27,8 @@ namespace CGAL #define CGAL_T2_TYPE CGAL::Constrained_triangulation_2 template -void add_in_graphic_storage(const CGAL_T2_TYPE& at2, InDomainPmap ipm, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_T2_TYPE& at2, InDomainPmap ipm, + CGAL::Graphics_scene& graphics_scene) { using BASET2=CGAL::Triangulation_2; @@ -54,15 +54,15 @@ void add_in_graphic_storage(const CGAL_T2_TYPE& at2, InDomainPmap ipm, [&ipm](const BASET2&, typename CGAL_T2_TYPE::Finite_faces_iterator fh) -> CGAL::IO::Color { return get(ipm, fh)? CGAL::IO::yellow() : CGAL::IO::white(); }; - add_in_graphic_storage(at2, graphic_storage, drawingFunctor); + add_in_graphics_scene(at2, graphics_scene, drawingFunctor); } template -void add_in_graphic_storage(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_T2_TYPE& at2, + CGAL::Graphics_scene& graphics_scene) { internal::In_domain in_domain; - add_in_graphic_storage(at2, in_domain, graphic_storage); + add_in_graphics_scene(at2, in_domain, graphics_scene); } template @@ -70,8 +70,8 @@ void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm, const char *title="Constrained Triangulation_2 Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(at2, ipm, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(at2, ipm, buffer); + draw_graphics_scene(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 56b0c8b9b337..c214b01ab0d2 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -27,27 +27,27 @@ namespace draw_function_for_t2 { template void compute_face(const T2& t2, typename T2::Finite_faces_iterator fh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_face(t2, fh)) { return; } if (gs_options.colored_face(t2, fh)) - { graphic_storage.face_begin(gs_options.face_color(t2, fh)); } + { graphics_scene.face_begin(gs_options.face_color(t2, fh)); } else - { graphic_storage.face_begin(); } + { graphics_scene.face_begin(); } - graphic_storage.add_point_in_face(fh->vertex(0)->point()); - graphic_storage.add_point_in_face(fh->vertex(1)->point()); - graphic_storage.add_point_in_face(fh->vertex(2)->point()); + graphics_scene.add_point_in_face(fh->vertex(0)->point()); + graphics_scene.add_point_in_face(fh->vertex(1)->point()); + graphics_scene.add_point_in_face(fh->vertex(2)->point()); - graphic_storage.face_end(); + graphics_scene.face_end(); } template void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_edge(t2, eh)) @@ -55,14 +55,14 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, if (gs_options.colored_edge(t2, eh)) { - graphic_storage.add_segment + graphics_scene.add_segment (eh->first->vertex(eh->first->cw(eh->second))->point(), eh->first->vertex(eh->first->ccw(eh->second))->point(), gs_options.edge_color(t2, eh)); } else { - graphic_storage.add_segment + graphics_scene.add_segment (eh->first->vertex(eh->first->cw(eh->second))->point(), eh->first->vertex(eh->first->ccw(eh->second))->point()); } @@ -70,7 +70,7 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, template void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_vertex(t2, vh)) @@ -78,38 +78,38 @@ void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, if (gs_options.colored_vertex(t2, vh)) { - graphic_storage.add_point(vh->point(), gs_options.vertex_color(t2, vh)); + graphics_scene.add_point(vh->point(), gs_options.vertex_color(t2, vh)); } else { - graphic_storage.add_point(vh->point()); + graphics_scene.add_point(vh->point()); } } template void compute_elements(const T2& t2, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (gs_options.are_faces_enabled()) { for (typename T2::Finite_faces_iterator it=t2.finite_faces_begin(); it!=t2.finite_faces_end(); ++it) - { compute_face(t2, it, graphic_storage, gs_options); } + { compute_face(t2, it, graphics_scene, gs_options); } } if (gs_options.are_edges_enabled()) { for (typename T2::Finite_edges_iterator it=t2.finite_edges_begin(); it!=t2.finite_edges_end(); ++it) - { compute_edge(t2, it, graphic_storage, gs_options); } + { compute_edge(t2, it, graphics_scene, gs_options); } } if (gs_options.are_vertices_enabled()) { for (typename T2::Finite_vertices_iterator it=t2.finite_vertices_begin(); it!=t2.finite_vertices_end(); ++it) - { compute_vertex(t2, it, graphic_storage, gs_options); } + { compute_vertex(t2, it, graphics_scene, gs_options); } } } @@ -118,16 +118,16 @@ void compute_elements(const T2& t2, #define CGAL_T2_TYPE CGAL::Triangulation_2 template -void add_in_graphic_storage(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const CGAL_T2_TYPE& at2, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { - draw_function_for_t2::compute_elements(at2, graphic_storage, gs_options); + draw_function_for_t2::compute_elements(at2, graphics_scene, gs_options); } template -void add_in_graphic_storage(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_T2_TYPE& at2, + CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options buffer; - add_in_graphic_storage(at2, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(at2, buffer, gs_options); + draw_graphics_scene(buffer, title); } template @@ -166,8 +166,8 @@ void draw(const CGAL_T2_TYPE& at2, const char *title="Triangulation_2 Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(at2, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(at2, buffer); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index e9fca016eda0..7d59f696eb8e 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -28,29 +28,29 @@ namespace draw_function_for_t3 template void compute_face(typename T3::Finite_facets_iterator fh, const GSOptions& gs_options, - CGAL::Graphics_scene& graphic_storage, const T3 *t3) + CGAL::Graphics_scene& graphics_scene, const T3 *t3) { if(!gs_options.draw_face(*t3, fh)) { return; } if(gs_options.colored_face(*t3, fh)) - { graphic_storage.face_begin(gs_options.face_color(*t3, fh)); } + { graphics_scene.face_begin(gs_options.face_color(*t3, fh)); } else - { graphic_storage.face_begin(); } + { graphics_scene.face_begin(); } - graphic_storage.add_point_in_face(fh->first->vertex((fh->second + 1) % 4)-> + graphics_scene.add_point_in_face(fh->first->vertex((fh->second + 1) % 4)-> point()); - graphic_storage.add_point_in_face(fh->first->vertex((fh->second + 2) % 4)-> + graphics_scene.add_point_in_face(fh->first->vertex((fh->second + 2) % 4)-> point()); - graphic_storage.add_point_in_face(fh->first->vertex((fh->second + 3) % 4)-> + graphics_scene.add_point_in_face(fh->first->vertex((fh->second + 3) % 4)-> point()); - graphic_storage.face_end(); + graphics_scene.face_end(); } template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options, const T3* t3) { if(!gs_options.draw_edge(*t3, eh)) @@ -58,19 +58,19 @@ void compute_edge(typename T3::Finite_edges_iterator eh, if(gs_options.colored_edge(*t3, eh)) { - graphic_storage.add_segment(eh->first->vertex(eh->second)->point(), + graphics_scene.add_segment(eh->first->vertex(eh->second)->point(), eh->first->vertex(eh->third)->point(), gs_options.edge_color(*t3, eh)); } else { - graphic_storage.add_segment(eh->first->vertex(eh->second)->point(), + graphics_scene.add_segment(eh->first->vertex(eh->second)->point(), eh->first->vertex(eh->third)->point()); } } template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options, const T3* t3) { if(!gs_options.draw_vertex(*t3, vh)) @@ -78,36 +78,36 @@ void compute_vertex(typename T3::Vertex_handle vh, if(gs_options.colored_vertex(*t3, vh)) { - graphic_storage.add_point(vh->point(), gs_options.vertex_color(*t3, vh)); + graphics_scene.add_point(vh->point(), gs_options.vertex_color(*t3, vh)); } else - { graphic_storage.add_point(vh->point()); } + { graphics_scene.add_point(vh->point()); } } template void compute_elements(const T3* t3, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (gs_options.are_faces_enabled()) { for (typename T3::Finite_facets_iterator it=t3->finite_facets_begin(); it!=t3->finite_facets_end(); ++it) - { compute_face(it, gs_options, graphic_storage, t3); } + { compute_face(it, gs_options, graphics_scene, t3); } } if (gs_options.are_edges_enabled()) { for (typename T3::Finite_edges_iterator it=t3->finite_edges_begin(); it!=t3->finite_edges_end(); ++it) - { compute_edge(it, graphic_storage,gs_options, t3); } + { compute_edge(it, graphics_scene,gs_options, t3); } } if (gs_options.are_vertices_enabled()) { for (typename T3::Finite_vertices_iterator it=t3->finite_vertices_begin(); it!=t3->finite_vertices_end(); ++it) - { compute_vertex(it, graphic_storage, gs_options, t3); } + { compute_vertex(it, graphics_scene, gs_options, t3); } } } @@ -117,17 +117,17 @@ void compute_elements(const T3* t3, template -void add_in_graphic_storage(const CGAL_T3_TYPE& at3, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const CGAL_T3_TYPE& at3, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { - draw_function_for_t3::compute_elements(&at3, graphic_storage, gs_options); + draw_function_for_t3::compute_elements(&at3, graphics_scene, gs_options); } template -void add_in_graphic_storage(const CGAL_T3_TYPE& at3, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_T3_TYPE& at3, + CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options buffer; - add_in_graphic_storage(at3, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(at3, buffer, gs_options); + draw_graphics_scene(buffer, title); } template void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(at3, buffer); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(at3, buffer); + draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 48e5065ee8ef..e7286b0c0d93 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -72,29 +72,29 @@ typedef Local_kernel::Vector_3 Local_vector; template void compute_vertex(const V2& v2, typename V2::Vertex_iterator vh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if(!gs_options.draw_vertex(v2, vh)) { return; } if(gs_options.colored_vertex(v2, vh)) - { graphic_storage.add_point(vh->point(), gs_options.vertex_color(v2, vh)); } + { graphics_scene.add_point(vh->point(), gs_options.vertex_color(v2, vh)); } else - { graphic_storage.add_point(vh->point()); } + { graphics_scene.add_point(vh->point()); } } template void compute_dual_vertex(const V2& /*v2*/, typename V2::Delaunay_graph::Finite_vertices_iterator vi, - CGAL::Graphics_scene &graphic_storage, + CGAL::Graphics_scene &graphics_scene, const GSOptions& gs_options) -{ graphic_storage.add_point(vi->point(), gs_options.dual_vertex_color); } +{ graphics_scene.add_point(vi->point(), gs_options.dual_vertex_color); } template void add_segments_and_update_bounding_box(const V2& v2, typename V2::Halfedge_iterator he, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -104,12 +104,12 @@ void add_segments_and_update_bounding_box(const V2& v2, { if(gs_options.colored_edge(v2, he)) { - graphic_storage.add_segment(he->source()->point(), he->target()->point(), + graphics_scene.add_segment(he->source()->point(), he->target()->point(), gs_options.edge_color(v2, he)); } else { - graphic_storage.add_segment(he->source()->point(), he->target()->point()); + graphics_scene.add_segment(he->source()->point(), he->target()->point()); } } else @@ -127,10 +127,10 @@ void add_segments_and_update_bounding_box(const V2& v2, end_point = he->source()->point(); // update_bounding_box_for_ray(end_point, direction); - Local_point lp = graphic_storage.get_local_point(end_point); - Local_vector lv = graphic_storage.get_local_vector(direction); + Local_point lp = graphics_scene.get_local_point(end_point); + Local_vector lv = graphics_scene.get_local_vector(direction); CGAL::Bbox_3 b = (lp + lv).bbox(); - graphic_storage.update_bounding_box(b); + graphics_scene.update_bounding_box(b); } } else if (he->is_bisector()) @@ -143,12 +143,12 @@ void add_segments_and_update_bounding_box(const V2& v2, // update_bounding_box_for_line(pointOnLine, direction, // perpendicularDirection); - Local_point lp = graphic_storage.get_local_point(pointOnLine); - Local_vector lv = graphic_storage.get_local_vector(direction); - Local_vector lpv = graphic_storage.get_local_vector(perpendicularDirection); + Local_point lp = graphics_scene.get_local_point(pointOnLine); + Local_vector lv = graphics_scene.get_local_vector(direction); + Local_vector lpv = graphics_scene.get_local_vector(perpendicularDirection); CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); - graphic_storage.update_bounding_box(b); + graphics_scene.update_bounding_box(b); } } } @@ -224,7 +224,7 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, template void compute_rays_and_bisectors(const V2&, typename V2::Halfedge_iterator he, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -239,39 +239,39 @@ void compute_rays_and_bisectors(const V2&, { if (he->has_source()) { - // add_ray_segment(he->source()->point(), get_second_point(he, graphic_storage.get_bounding_box())); - graphic_storage.add_ray(he->source()->point(), direction, gs_options.ray_color); + // add_ray_segment(he->source()->point(), get_second_point(he, graphics_scene.get_bounding_box())); + graphics_scene.add_ray(he->source()->point(), direction, gs_options.ray_color); } } else if (he->is_bisector()) { Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, (v1->point().y() + v2->point().y()) / 2); - graphic_storage.add_line(pointOnLine, direction, gs_options.bisector_color); + graphics_scene.add_line(pointOnLine, direction, gs_options.bisector_color); } } template void compute_face(const V2& v2, typename V2::Face_iterator fh, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& m_gs_options) { if(fh->is_unbounded() || !m_gs_options.draw_face(v2, fh)) { return; } if(m_gs_options.colored_face(v2, fh)) - { graphic_storage.face_begin(m_gs_options.face_color(v2, fh)); } - else { graphic_storage.face_begin(); } + { graphics_scene.face_begin(m_gs_options.face_color(v2, fh)); } + else { graphics_scene.face_begin(); } typename V2::Ccb_halfedge_circulator ec_start=fh->ccb(); typename V2::Ccb_halfedge_circulator ec=ec_start; do { - graphic_storage.add_point_in_face(ec->source()->point()); + graphics_scene.add_point_in_face(ec->source()->point()); } while (++ec!=ec_start); - graphic_storage.face_end(); + graphics_scene.face_end(); // Test: for unbounded faces (??) // else { @@ -280,7 +280,7 @@ void compute_face(const V2& v2, // add_point_in_face(ec->source()->point()); // } // else{ - // add_point_in_face(get_second_point(ec->twin(), graphic_storage.get_bounding_box())); + // add_point_in_face(get_second_point(ec->twin(), graphics_scene.get_bounding_box())); // } // } while(++ec != ec_start); // } @@ -288,7 +288,7 @@ void compute_face(const V2& v2, template void compute_elements(const V2& v2, - CGAL::Graphics_scene& graphic_storage, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if(gs_options.are_vertices_enabled()) @@ -298,7 +298,7 @@ void compute_elements(const V2& v2, { for (typename V2::Vertex_iterator it=v2.vertices_begin(); it!=v2.vertices_end(); ++it) - { compute_vertex(v2, it, graphic_storage, gs_options); } + { compute_vertex(v2, it, graphics_scene, gs_options); } } // Draw the dual vertices @@ -307,7 +307,7 @@ void compute_elements(const V2& v2, for (typename V2::Delaunay_graph::Finite_vertices_iterator it=v2.dual().finite_vertices_begin(); it!=v2.dual().finite_vertices_end(); ++it) - { compute_dual_vertex(v2, it, graphic_storage, gs_options); } + { compute_dual_vertex(v2, it, graphics_scene, gs_options); } } } @@ -317,17 +317,17 @@ void compute_elements(const V2& v2, for (typename V2::Halfedge_iterator it=v2.halfedges_begin(); it!=v2.halfedges_end(); ++it) { add_segments_and_update_bounding_box(v2, it, - graphic_storage, gs_options); } + graphics_scene, gs_options); } } for (typename V2::Halfedge_iterator it=v2.halfedges_begin(); it!=v2.halfedges_end(); ++it) - { compute_rays_and_bisectors(v2, it, graphic_storage, gs_options); } + { compute_rays_and_bisectors(v2, it, graphics_scene, gs_options); } if (gs_options.are_faces_enabled()) { for (typename V2::Face_iterator it=v2.faces_begin(); it!=v2.faces_end(); ++it) - { compute_face(v2, it, graphic_storage, gs_options); } + { compute_face(v2, it, graphics_scene, gs_options); } } } @@ -337,16 +337,16 @@ void compute_elements(const V2& v2, template -void add_in_graphic_storage(const CGAL_VORONOI_TYPE &v2, - CGAL::Graphics_scene& graphic_storage, +void add_in_graphics_scene(const CGAL_VORONOI_TYPE &v2, + CGAL::Graphics_scene& graphics_scene, const GSOptions& m_gs_options) { - draw_function_for_v2::compute_elements(v2, graphic_storage, m_gs_options); + draw_function_for_v2::compute_elements(v2, graphics_scene, m_gs_options); } template -void add_in_graphic_storage(const CGAL_VORONOI_TYPE& v2, - CGAL::Graphics_scene& graphic_storage) +void add_in_graphics_scene(const CGAL_VORONOI_TYPE& v2, + CGAL::Graphics_scene& graphics_scene) { // Default graphics view options. CGAL::Graphics_scene_options_voronoi gs_options; - add_in_graphic_storage(v2, graphic_storage, gs_options); + add_in_graphics_scene(v2, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER @@ -368,8 +368,8 @@ void draw(const CGAL_VORONOI_TYPE& av2, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphic_storage(av2, buffer, gs_options); - draw_graphic_storage(buffer, title); + add_in_graphics_scene(av2, buffer, gs_options); + draw_graphics_scene(buffer, title); } template @@ -384,7 +384,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, typename CGAL_VORONOI_TYPE::Face_iterator> gs_options; - add_in_graphic_storage(av2, buffer, gs_options); + add_in_graphics_scene(av2, buffer, gs_options); QApplication_and_basic_viewer app(buffer, title); if(app) @@ -414,7 +414,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, basic_viewer->clear(); draw_function_for_v2::compute_elements(av2, - basic_viewer->get_graphic_storage(), + basic_viewer->get_graphics_scene(), gs_options); basic_viewer->redraw(); } @@ -429,7 +429,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, basic_viewer->clear(); draw_function_for_v2::compute_elements(av2, - basic_viewer->get_graphic_storage(), + basic_viewer->get_graphics_scene(), gs_options); basic_viewer->redraw(); } From da7da48aeac62d9691cc867b8b34b18d4e58acb0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Sep 2023 13:44:40 +0200 Subject: [PATCH 179/399] Basic viewer doc --- .../doc/Basic_viewer/CGAL/Basic_viewer_qt.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h index 9c6388c6698b..468eb1f59dde 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h @@ -4,7 +4,7 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements can either be added directly in the viewer or through the storage. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. +The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements can either be added directly in the viewer or through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. \tparam BufferType the type used for point coordinates: `float` by default. @@ -115,7 +115,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// returns the mono color used for faces. const CGAL::IO::Color& get_faces_mono_color() const; - /// clears the basic viewer, i.e. remove all its elements. + /// clears the basic viewer, i.e., remove all its elements. void clear(); /// returns `true` if the viewer is empty. @@ -195,22 +195,22 @@ class Basic_viewer_qt : public CGAL::QGLViewer template void add_text(const KPoint &kp, const std::string &txt); - /// returns the graphic storage of the viewer. + /// returns the graphics scene of the viewer. Graphics_scene& get_graphics_scene(); - /// returns the graphic storage of the viewer, const version. + /// returns the graphics scene of the viewer, const version. const Graphics_scene& get_graphics_scene() const; - /// negates all normal of vertices and faces. + /// negates all normals of vertices and faces. void negate_all_normals(); - /// returns true if the data structure in in 2D, i.e. lies on a plane. + /// returns `true` if the data structure in in 2D, i.e., lies on a plane. bool is_two_dimensional() const; /// draws the viewer without recomputing all internal buffers. virtual void draw(); - /// redraws the viewer, i.e. recompute all internal buffers and update the window. + /// redraws the viewer, i.e., recompute all internal buffers and update the window. virtual void redraw(); /// Function called when a key is pressed. Users can define their own function in order @@ -223,7 +223,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /*! \ingroup PkgBasicViewerClasses -The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The `QApplication` is created in the constructor, but ran by the run method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires CGAL_Qt5, and is only available if the macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. +The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The `QApplication` is created in the constructor, but started by the `run()` method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. \tparam BufferType the type used for point coordinates: `float` by default. @@ -236,7 +236,7 @@ class QApplication_and_basic_viewer QApplication_and_basic_viewer(CGAL::Graphics_scene& buffer, const char* title="CGAL Basic Viewer"); - /// runs the `QApplication`, i.e. open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. + /// runs the `QApplication`, i.e., open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. void run(); /// returns a reference to the `Basic_viewer_qt` associated with this. @@ -245,11 +245,11 @@ class QApplication_and_basic_viewer //------------------------------------------------------------------------------ /*! - opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro CGAL_USE_BASIC_VIEWER is defined. Linking with the cmake target CGAL::CGAL_Basic_viewer will link with CGAL_Qt5 and add the definition CGAL_USE_BASIC_VIEWER. + opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition CGAL_USE_BASIC_VIEWER. */ template void draw_graphics_scene(Graphics_scene& graphic_buffer, - const char *title="CGAL Basic Viewer") + const char *title="CGAL Basic Viewer") {} } // End namespace CGAL From c999b12ac26a62d031a345d75e6112cb615575f3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 29 Sep 2023 07:22:43 +0200 Subject: [PATCH 180/399] Basic viewer doc --- .../doc/Basic_viewer/CGAL/Basic_viewer_qt.h | 6 +- .../doc/Basic_viewer/CGAL/Graphics_scene.h | 2 +- .../CGAL/Graphics_scene_options.h | 86 ++++++++----------- 3 files changed, 39 insertions(+), 55 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h index 468eb1f59dde..4ca7cf8925ac 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h @@ -6,7 +6,7 @@ namespace CGAL { The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements can either be added directly in the viewer or through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam BufferType the type used for point coordinates: `float` by default. +\tparam BufferType the number type used for point coordinates: `float` by default. */ template @@ -128,7 +128,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool is_clipping_plane_enabled() const; /// returns the clipping plane when it is enabled. - Local_kernel::Plane_3 clipping_plane() const; + CGAL::Exact_predicates_inexact_constructions_kernel::Plane_3 clipping_plane() const; /// adds the given point in the viewer. template @@ -225,7 +225,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The `QApplication` is created in the constructor, but started by the `run()` method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam BufferType the type used for point coordinates: `float` by default. +\tparam BufferType the number type used for point coordinates: `float` by default. */ template diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index e9cef86e6d94..750b8c492c94 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -80,7 +80,7 @@ class Graphics_scene { /// returns `true` iff the storage has no element. bool is_empty() const; - /// clears the storage, i.e. removes all points, segments, triangles and text. + /// clears the storage, i.e., removes all points, segments, triangles and text. void clear(); }; diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h index 3b0408f3f841..fe574bef90c8 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h @@ -6,17 +6,21 @@ namespace CGAL { The class `Graphics_scene_options` is used to tune the way that the cells of a given data structure of \cgal are considered. The different `std::function` can be modified to change for example the behavior of the drawing. +`VolumeDescriptor` can be `void` for data structures that do not represent volumes. In such a case, all methods about volumes do not exist. \tparam DS a data structure of \cgal. \tparam VertexDescriptor a descriptor of vertices of `DS`. \tparam EdgeDescriptor a descriptor of edges of `DS`. \tparam FaceDescriptor a descriptor of faces of `DS`. +\tparam VolumeDescriptor a descriptor of volumes of `DS`. `void` by default. */ + template + typename FaceDescriptor, + typename VolumeDescriptor=void> struct Graphics_scene_options { public: @@ -32,85 +36,65 @@ struct Graphics_scene_options /// Returns `true` by default. std::function ignore_face; + /// `std::function` that returns `true` if the given volume must be ignored, `false` otherwise. + /// Exists only if `VolumeDescriptor` is not `void`. + /// Returns `false` by default. + std::function ignore_volume; + /// `std::function` that returns `true` if the given vertex is colored, `false` otherwise. /// Returns `false` by default. std::function colored_vertex; /// `std::function` that returns `true` if the given edge is colored, `false` otherwise. /// Returns `false` by default. - std::function colored_edge; + std::function colored_edge; /// `std::function` that returns `true` if the given face is colored, `false` otherwise. /// Returns `false` by default. - std::function colored_face; + std::function colored_face; + + /// `std::function` that returns `true` if the given volume is colored, `false` otherwise. + /// Returns `false` by default. + /// Exists only if `VolumeDescriptor` is not `void`. + std::function colored_volume; /// `std::function` that returns `true` if the given face is in wireframe, `false` otherwise. /// Returns `false` by default. std::function face_wireframe; + /// `std::function` that returns `true` if the given volume is in wireframe, `false` otherwise. + /// Returns `false` by default. + /// Exists only if `VolumeDescriptor` is not `void`. + std::function volume_wireframe; + /// `std::function` that returns the color of the given vertex. /// nullptr by default. std::function vertex_color; /// `std::function` that returns the color of the given edge. /// nullptr by default. - std::function edge_color; + std::function edge_color; /// `std::function` that returns the color of the given face. /// nullptr by default. - std::function face_color; + std::function face_color; - /// ignores all vertices when `b` is `true`; otherwise ignores only vertices for which `ignore_vertex` returns `true`. - void ignore_all_vertices(bool b); + /// `std::function` that returns the color of the given volume. + /// nullptr by default. + /// Exists only if `VolumeDescriptor` is not `void`. + std::function volume_color; - /// ignores all edges when `b` is `true`; otherwise ignores only edges for which `ignore_edge` returns `true`. + /// ignores all vertices when `b` is `true`; otherwise ignores only vertices for which `ignore_vertex()` returns `true`. void ignore_all_vertices(bool b); - /// ignores all faces when `b` is `true`; otherwise ignores only faces for which `ignore_face` returns `true`. - void ignore_all_vertices(bool b); -}; + /// ignores all edges when `b` is `true`; otherwise ignores only edges for which `ignore_edge()` returns `true`. + void ignore_all_edges(bool b); -/*! -\ingroup PkgBasicViewerClasses - -The class `Graphics_scene_options` is used to tune the way that the cells of a given data structure of \cgal are considered, for a data structure that contains volumes. -The different `std::function` can be modified to change for example the behavior of the drawing. - -\tparam DS a data structure of \cgal. -\tparam VertexDescriptor a descriptor of vertices of `DS`. -\tparam EdgeDescriptor a descriptor of edges of `DS`. -\tparam FaceDescriptor a descriptor of faces of `DS`. -\tparam VolumeDescriptor a descriptor of volumes of `DS`. - -*/ - -// Cell parameters for a volumic data structure (with vertices, edges, faces and volumes) -template -struct Graphics_scene_options : - public Graphics_scene_options -{ -public: - /// `std::function` that returns `true` if the given volume must be ignored, `false` otherwise. - /// Returns `false` by default. - std::function ignore_volume; - - /// `std::function` that returns `true` if the given volume is colored, `false` otherwise. - /// Returns `false` by default. - std::function colored_volume; - - /// `std::function` that returns `true` if the given volume is in wireframe, `false` otherwise. - /// Returns `false` by default. - std::function volume_wireframe; - - /// `std::function` that returns the color of the given volume. - /// nullptr by default. - std::function volume_color; + /// ignores all faces when `b` is `true`; otherwise ignores only faces for which `ignore_face()` returns `true`. + void ignore_all_faces(bool b); - /// ignores all volumes when `b` is `true`; otherwise ignore only volumes for which `ignore_volume` returns `true`. + /// ignores all volumes when `b` is `true`; otherwise ignore only volumes for which `ignore_volume()` returns `true`. + /// Exists only if `VolumeDescriptor` is not `void`. void ignore_all_volumes(bool b); }; From 218be312d4394f0ad1b7500cc7e0ef8bed4f8f2f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 29 Sep 2023 07:22:58 +0200 Subject: [PATCH 181/399] Basic viewer examples --- Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp | 2 +- Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp | 2 +- Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp | 2 +- .../examples/Basic_viewer/draw_surface_mesh_small_faces.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 1c7bfbb1a157..9704e39bc78c 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -35,7 +35,7 @@ int main(void) CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) .normal_map(CGAL::Second_of_pair_property_map()))) { - std::cerr << "Error: cannot read input file!" << std::endl; + std::cerr << "Error: cannot read input file " << CGAL::data_file_path("points_3/kitten.xyz") << std::endl; return EXIT_FAILURE; } diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index 7d90b5344b89..0db6619d3194 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -27,7 +27,7 @@ int main(void) CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) .normal_map(CGAL::Second_of_pair_property_map()))) { - std::cerr << "Error: cannot read input file!" << std::endl; + std::cerr << "Error: cannot read input file " << CGAL::data_file_path("points_3/kitten.xyz") << std::endl; return EXIT_FAILURE; } diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp index 851518b2e861..15a82026f97e 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) Mesh sm; if(!CGAL::IO::read_polygon_mesh(filename, sm)) { - std::cerr << "Invalid input file." << std::endl; + std::cerr << "Invalid input file: " << filename << std::endl; return EXIT_FAILURE; } diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 80af57cb3e9b..d478d910c82a 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -84,7 +84,7 @@ int main(int argc, char* argv[]) Mesh sm; if(!CGAL::IO::read_polygon_mesh(filename, sm)) { - std::cerr << "Invalid input file." << std::endl; + std::cerr << "Invalid input file: " << filename << std::endl; return EXIT_FAILURE; } From 55509a64ff4b66557458d8312aaff6818729ef8b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 29 Sep 2023 08:44:03 +0200 Subject: [PATCH 182/399] GPL instead of LGPL (?) --- Basic_viewer/package_info/Basic_viewer/license.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/package_info/Basic_viewer/license.txt b/Basic_viewer/package_info/Basic_viewer/license.txt index 5c1c5d8436f8..8bb8efcb72b0 100644 --- a/Basic_viewer/package_info/Basic_viewer/license.txt +++ b/Basic_viewer/package_info/Basic_viewer/license.txt @@ -1 +1 @@ -LGPL (v3 or later) +GPL (v3 or later) From 2755f2c427b097f5cad349bafa4ab948c8b1aeee Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 29 Sep 2023 08:57:33 +0200 Subject: [PATCH 183/399] Basic viewer logo + move include file --- .../CGAL/{ => Qt}/Basic_viewer_qt.h | 0 .../doc/Basic_viewer/PackageDescription.txt | 2 +- .../fig/basic_viewer_diagramme_class.svg | 530 ++++++++++++++++++ .../Basic_viewer/fig/basic_viewer_logo.png | Bin 0 -> 19274 bytes .../Basic_viewer/fig/draw_mesh_and_points.png | Bin 0 -> 70311 bytes .../Basic_viewer/fig/draw_several_windows.png | Bin 0 -> 45882 bytes .../Basic_viewer/fig/draw_surface_height.png | Bin 0 -> 97895 bytes .../fig/draw_surface_mesh_small_faces.png | Bin 0 -> 60389 bytes .../fig/draw_surface_mesh_vcolor.png | Bin 0 -> 47798 bytes .../doc/Basic_viewer/fig/lcc_draw.png | Bin 0 -> 9961 bytes 10 files changed, 531 insertions(+), 1 deletion(-) rename Basic_viewer/doc/Basic_viewer/CGAL/{ => Qt}/Basic_viewer_qt.h (100%) create mode 100644 Basic_viewer/doc/Basic_viewer/fig/basic_viewer_diagramme_class.svg create mode 100644 Basic_viewer/doc/Basic_viewer/fig/basic_viewer_logo.png create mode 100644 Basic_viewer/doc/Basic_viewer/fig/draw_mesh_and_points.png create mode 100644 Basic_viewer/doc/Basic_viewer/fig/draw_several_windows.png create mode 100644 Basic_viewer/doc/Basic_viewer/fig/draw_surface_height.png create mode 100644 Basic_viewer/doc/Basic_viewer/fig/draw_surface_mesh_small_faces.png create mode 100644 Basic_viewer/doc/Basic_viewer/fig/draw_surface_mesh_vcolor.png create mode 100644 Basic_viewer/doc/Basic_viewer/fig/lcc_draw.png diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h similarity index 100% rename from Basic_viewer/doc/Basic_viewer/CGAL/Basic_viewer_qt.h rename to Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index a9e27a2cd74b..6687dd8140e0 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -6,7 +6,7 @@ /*! \addtogroup PkgBasicViewerRef \cgalPkgDescriptionBegin{Basic Viewer,PkgBasicViewer} -\cgalPkgPicture{TODO.png} +\cgalPkgPicture{basic_viewer_logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand, Mostafa Ashraf} \cgalPkgDesc{This package implements basic viewer class.} diff --git a/Basic_viewer/doc/Basic_viewer/fig/basic_viewer_diagramme_class.svg b/Basic_viewer/doc/Basic_viewer/fig/basic_viewer_diagramme_class.svg new file mode 100644 index 000000000000..3ec94e9d1af8 --- /dev/null +++ b/Basic_viewer/doc/Basic_viewer/fig/basic_viewer_diagramme_class.svg @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Basic_viewer + + + + + Graphics_scene + + + void add_point(apoint) + + + void add_point(apoint, acolor) + + + + + + + + void add_segment(apoint1, apoint2, acolor) + + void add_segment(apoint1, apoint2) + + void face_begin(acolor) + + void add_point_in_face(apoint) + + void face_begin() + + void face_end() + ... + + Basic_viewer (QWidget *parent, const Graphics_scene &scene)+ void draw()+ void redraw()... + + + 1 + + + + QApplication_and_basic_viewer + + QApplication_and_basic_viewer (const Graphics_scene &scene)+ void run()+ Basic_viewer & basic_viewer () + + + 1 + void draw_graphics_scene(const Graphics_scene& gs) + void draw(const DS& ds) + + void draw(const DS& ds, const Graphics_scene_option& gso) + void add_to_graphics_scene(const DS& ds, Graphics_scene& gs) + void add_to_graphics_scene(const DS& ds, Graphics_scene& gs, const Graphics_scene_option& gso) + + diff --git a/Basic_viewer/doc/Basic_viewer/fig/basic_viewer_logo.png b/Basic_viewer/doc/Basic_viewer/fig/basic_viewer_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..05df4ad850c7835e769ef61288cefc78f5a7b392 GIT binary patch literal 19274 zcmeHvbx>T-wk`oeaCdiicY;H34Uz!EAcMPGf;+)of(CcD;K3odySoH}zn$NadrrMu z_3Bo=``>|qVS0D3-MxBs_gdfjHessDvM7jzh)_^aDDrYr>cG4EpC5QQ;J1JY?@!>Z z$5T_sSsmm?ZtrMkW?^kg?(AW2N^a_IVFpxOv{4mD?IA~Q-NW&M?tRtmw7)3-(3REs zHpj9^w>t%&08>!(3{OOmA5oq$&1$TRT#Jzpi;&pH9+}fUhna2l$eGZZW*$|{GVAue zNY<+k9*qOc{Ba9wx4fZ|x$K-f^!u3kUeSO|~+v{hxlnnMg)YLvUz_z!>Dt!$;CC<^AI4q?f}6v!KgG8G4un1@$V> zLQ+yyUQ+TO!vO}7;S(z&*Yg%Xc&#uoypDffJX|vP&;*ZVQ>Rol5b>)vWTtETrx@gC zTz(TjV#Vt>ez>KmtYa;LO^E*MXrZ+M@wpKRzdx!&Ft$hrMA~lK+1%D%NwoHJbA5s3 zUg4}cNJwET3-5Xl3kk-MmM}8|E5~u36C2*1Up%pn)wUfy6NBm@oZsm%>2!OlLis|? zdCTGUd^X`re=uGMT;z-6QTuMUY+e%W)$~A*N8&dh3p)hrFyB`H94Iq}^dfAglpG|m zZGY4juydHTRGMw4^8|y?Ig9^Orx%ktRCPiMhes!Lsv_Q)Qelq)&2RcbVO#x& z)@!N(=)(zeA>VVc-z)mH+#)-)LF(VXN7(p9!gPJinW{NC123IsKs}qUzdO4-vN5`e zzt&cXAbHiZ^u5nTMdRkvFp1H1F$GZ#)tv=G0p_`{%$g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5+48q&`*qtKFUByD@<`8n&k(0k@3@Vr7DeK8THt z>0lg<@cn+?p#XxJh{gb#>G9D^2WOuerMWu3Wi;}mHii>3 zmMTJsJ&UHHLg3?KChF$qOpr$r=iZ=h2v7L4cuewZmt7BZ7Vw`*Y9W)9yQAp?!6-x>HxEGI8XF#tSkZPlq-b?HNSAHW3#zDmS%>md z8kXjWA7?yxH;+aU^6+WjU3hG@-Rt1+u=~K7(|KPNfP@7zqji{rmriKe*v@ifR9^C4 zJ$J_SpqzKcU+bn#v%Ne6kLdmTgL?n++#c}s-Xmn&DrjAf`m#Jk=&@+{{W#7&#~R%i v1`S`B^^Rqfi!K82SGnKnXMg literal 0 HcmV?d00001 diff --git a/Basic_viewer/doc/Basic_viewer/fig/draw_mesh_and_points.png b/Basic_viewer/doc/Basic_viewer/fig/draw_mesh_and_points.png new file mode 100644 index 0000000000000000000000000000000000000000..4fd65f7d50215d427ad22dd5e936b45a09c75f4d GIT binary patch literal 70311 zcmYg&1z6K>)b=Rpl2lS!Nu?X4rMp|YySrOaLAnH_n*n2_gwh>jjF1r6=&pDA|K9KW zc3r<~*M9NrJm)@fpYuFhf`*y`KF)I-004lmq$sNe0H9nVk3Fm>$TQExF|Ckq=w5G? zbg+=GV66A?e@}bM8F*{E*?Rj~dfEW&T-{u3IK8YrZEReIc*&pc|%PAfF7VE zE3M<7dywZBOfL5@BuVmiSJADA_4AA<5g!r1w6xf{m^8R4GX7zFReb_Au#k1DUbDK~ zPwPiuIVl+!jX3`4x1~vCV_Uyg@rh6GS37A>#6V3=rw2`-g8R@N zQP>Met839`tshpe?Zedb#S&C)N{5|c*asa~LAwPg=i(cOOWhp4BTP>dWEm>Bh~Bo1 zoORR3+Wf**R92pmbV6P|xb;@8Ut0KRPO!P#u(?=oiAF#p61_Q;R#Lq2jREl)wXma& zJ+LNGfbnWi0c{yAT$bUZBGVi(YDrs@kvf(oIa_3Hg0R$wvMzP?x`^atJU;tLfNGAw zz{~R7Vkb`{qvrs6D93>$ok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zdc#Cp2P8-4`@7X-`0KA6NH^o2qvy&9`O?Bld0Tz#)P`!YTS4fK6yZY;NTkvg5QRt-yz;k&A zdHq?SO_&-CqAWERa&wpX4Vmb^1I9(jyPN#v?WqL!+~lM?1xd+>;HfnaM69qsI|3wY;4?6fuR@j!JdZ)M@G9}q zLeE3kU^Jx$W?C2b>mewbNAhu#OG6Kd2h1ry6@sgjC;Ml7HKF|3oYdSrn0GwtWiL5q z=o^}pw!Ci5(TLuXOI3>1AYL^1hep%wRZf$r9frQm)0&eJ<1)T}d^P1lfE3x|#!?F# z*>fLT1DN+4J=fblweNu1y8+Ng_WRKI*<*s*fvz3zi{OA!R*e;|EesRaAfdNuhOehd z!3`H6VRKBQ9cJfmgMO!7TKwew6a?UBRl=sDG7N|LcDp#aMl1!aE-T&4!0jdYS-h7h$?=6l0Dob)L+x$lb(&!)mDJ|R3LEotX|JuRSY%{UeU>4hB zv(E03O*MV@x4oKoI^pVdcK`bD)z?|zhVmp82ms{jfn4=w-v_lhB^ay|*PH1_9P({q d_C?n};Uif=sTL~Ht^lBql$g9|weZit{{br56g~g| literal 0 HcmV?d00001 diff --git a/Basic_viewer/doc/Basic_viewer/fig/draw_surface_mesh_small_faces.png b/Basic_viewer/doc/Basic_viewer/fig/draw_surface_mesh_small_faces.png new file mode 100644 index 0000000000000000000000000000000000000000..d6b4066ca7fbf1388c3134311fa291f148044647 GIT binary patch literal 60389 zcmeFZc{tSV`#(I|REm&PvP4oCDlyqBWJ@GVXt*t731goz#-N>4vWJjLvX^BhW{h_G zQg&m8WM^g=%h>&{(f!$;=X)H_@jZ^`_ut1|hrH){pVxJr*SWmT*LAw1%&zF~-FXrOBjfoz?IK)5D$?f_3-JV&@w3Bx)PEEcghq*9F!+!>t!zNtd49Hy!nQJuH3vmqfxbOq;ne*By)8 zc6qa%Werlb!-~%#8YRYB^C}n5EF`&ag?>6W`}?!Y9CqpW>z1qCT^AGo`l)zyw^L^A zZ|9vIN5Agheq;-jyghpYwegwec<;V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ear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index 36d6af07625b..2b5e7b939c0b 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -7,6 +7,7 @@ opens a new window and draws `alcc`, a model of the `LinearCellComplex` concept. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. \tparam LCC a model of the `LinearCellComplex` concept. \param alcc the linear cell complex to draw. +\param gs_options graphics scene options. */ template @@ -15,6 +16,12 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5 /*! \ingroup PkgDrawLinearCellComplex +Add in the given graphics scene the elements of alcc. + +\param alcc the linear cell complex to draw. +\param graphics_scene the graphics scene. +\param gs_options graphics scene options. + */ template void add_in_graphics_scene(const LCC& alcc, CGAL::Graphics_scene& graphics_scene, From 823392af852d45ca1dbeaa031b65e3da0431a3ed Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 3 Oct 2023 21:27:17 +0200 Subject: [PATCH 185/399] Update Basic_viewer/doc/Basic_viewer/PackageDescription.txt Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 6687dd8140e0..3f98ea413dd5 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -22,8 +22,8 @@ \cgalClassifedRefPages \cgalCRPSection{Classes} -- `CGAL::Graphics_scene_options` -- `CGAL::Graphics_scene_options` +- `CGAL::Graphics_scene_options` +- `CGAL::Graphics_scene_options` - `CGAL::Graphics_scene` - `CGAL::Basic_viewer_qt` - `CGAL::QApplication_and_basic_viewer` From a8e68cabfcfa11e3f51fb84a52199946a19a423e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 3 Oct 2023 21:27:28 +0200 Subject: [PATCH 186/399] Update Basic_viewer/doc/Basic_viewer/PackageDescription.txt Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 3f98ea413dd5..682dd327600b 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -50,7 +50,7 @@ - `Triangulation_3` \link PkgDrawTriangulation3 CGAL::draw() \endlink - `Voronoi_diagram_2` \link PkgDrawVoronoiDiagram2 CGAL::draw() \endlink -\cgalCRPSubsection{Fill Graphic Storage for Different Packages} +\cgalCRPSubsection{Fill Graphics Scene for Different Packages} - Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphics_scene() \endlink - Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::add_in_graphics_scene() \endlink From 5d1ae463fd238b1c465d93992ab41124de663430 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 3 Oct 2023 21:27:38 +0200 Subject: [PATCH 187/399] Update Basic_viewer/doc/Basic_viewer/PackageDescription.txt Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 682dd327600b..44c977044b8d 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -28,7 +28,7 @@ - `CGAL::Basic_viewer_qt` - `CGAL::QApplication_and_basic_viewer` -\cgalCRPSubsection{Draw a Graphic Storage} +\cgalCRPSubsection{Draw a Graphics Scene} - `CGAL::draw_graphics_scene()` From ac1c4896eeea2ec0b4dd82353829c2be864f20c1 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 6 Oct 2023 07:46:16 +0200 Subject: [PATCH 188/399] Update names following Andreas remarks --- .../doc/Basic_viewer/CGAL/Graphics_scene.h | 10 +- .../Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 100 +++++++++--------- .../doc/Basic_viewer/PackageDescription.txt | 1 - 3 files changed, 55 insertions(+), 56 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index 750b8c492c94..e21da6ec2509 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -54,19 +54,19 @@ class Graphics_scene { void face_begin(const CGAL::IO::Color &acolor); /// return `true` iff a face is started. - bool is_a_face_started() const; + bool a_face_started() const; /// adds the given point in the current face. - /// @pre `is_a_face_started()` + /// @pre `a_face_started()` template bool add_point_in_face(const KPoint &kp); /// adds the given point in the current face, having the vertex normal. - /// @pre `is_a_face_started()` + /// @pre `a_face_started()` template bool add_point_in_face(const KPoint &kp, const KVector &p_normal); /// end the current face. - /// @pre `is_a_face_started()` + /// @pre `a_face_started()` void face_end(); /// adds the given text at the given position in the storage. @@ -78,7 +78,7 @@ class Graphics_scene { void add_text(const KPoint &kp, const std::string &txt); /// returns `true` iff the storage has no element. - bool is_empty() const; + bool empty() const; /// clears the storage, i.e., removes all points, segments, triangles and text. void clear(); diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index 4ca7cf8925ac..478467909afa 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -20,112 +20,112 @@ class Basic_viewer_qt : public CGAL::QGLViewer const char* title=""); /// enables or disables the drawing of vertices. - void set_draw_vertices(bool b); + void draw_vertices(bool b); /// enables or disables the drawing of edges. - void set_draw_edges(bool b); + void draw_edges(bool b); /// enables or disables the drawing of rays. - void set_draw_rays(bool b); + void draw_rays(bool b); /// enables or disables the drawing of lines. - void set_draw_lines(bool b); + void draw_lines(bool b); /// enables or disables the drawing of faces. - void set_draw_faces(bool b); + void draw_faces(bool b); /// enables or disables the use of only one color (if `b` is `true`) or the use of multiple colors (if `b` is `false`). - void set_use_mono_color(bool b); + void use_mono_color(bool b); /// enables or disables the drawing of texts. - void set_draw_text(bool b); + void draw_text(bool b); /// sets the color used for vertices in mono_color mode. - void set_vertices_mono_color(const CGAL::IO::Color& c); + void vertices_mono_color(const CGAL::IO::Color& c); /// sets the color used for edges in mono_color mode. - void set_edges_mono_color(const CGAL::IO::Color& c); + void edges_mono_color(const CGAL::IO::Color& c); /// sets the color used for rays in mono_color mode. - void set_rays_mono_color(const CGAL::IO::Color& c); + void rays_mono_color(const CGAL::IO::Color& c); /// sets the color used for lines in mono_color mode. - void set_lines_mono_color(const CGAL::IO::Color& c); + void lines_mono_color(const CGAL::IO::Color& c); /// sets the color used for faces in mono_color mode. - void set_faces_mono_color(const CGAL::IO::Color& c); + void faces_mono_color(const CGAL::IO::Color& c); - /// negates the drawing of vertices (becomes `true` if it was `false` and reciprocally). - void negate_draw_vertices(); + /// toggles the drawing of vertices. + void toggle_draw_vertices(); - /// negates the drawing of edges (becomes `true` if it was `false` and reciprocally). - void negate_draw_edges(); + /// toggles the drawing of edges. + void toggle_draw_edges(); - /// negates the drawing of rays (becomes `true` if it was `false` and reciprocally). - void negate_draw_rays(); + /// toggles the drawing of rays. + void toggle_draw_rays(); - /// negates the drawing of lines (becomes `true` if it was `false` and reciprocally). - void negate_draw_lines(); + /// toggles the drawing of lines. + void toggle_draw_lines(); - /// negates the drawing of faces (becomes `true` if it was `false` and reciprocally). - void negate_draw_faces(); + /// toggles the drawing of faces. + void toggle_draw_faces(); - /// negates the use of mono color mode (becomes `true` if it was `false` and reciprocally). - void negate_use_mono_color(); + /// toggles the use of mono color mode. + void toggle_use_mono_color(); - /// negates the drawing of text (becomes `true` if it was `false` and reciprocally). - void negate_draw_text(); + /// toggles the drawing of text. + void toggle_draw_text(); /// returns `true` if vertices are drawn. - bool get_draw_vertices() const; + bool draw_vertices() const; /// returns `true` if edges are drawn. - bool get_draw_edges() const; + bool draw_edges() const; /// returns `true` if rays are drawn. - bool get_draw_rays() const; + bool draw_rays() const; /// returns `true` if lines are drawn. - bool get_draw_lines() const; + bool draw_lines() const; /// returns `true` if faces are drawn. - bool get_draw_faces() const; + bool draw_faces() const; /// returns `true` if mono color mode is used. - bool get_use_mono_color() const; + bool use_mono_color() const; /// returns `true` if normal are reversed. - bool get_inverse_normal() const; + bool reverse_normal() const; /// returns `true` if text are drawn. - bool get_draw_text() const; + bool draw_text() const; /// returns the mono color used for vertices. - const CGAL::IO::Color& get_vertices_mono_color() const; + const CGAL::IO::Color& vertices_mono_color() const; /// returns the mono color used for edges. - const CGAL::IO::Color& get_edges_mono_color() const; + const CGAL::IO::Color& edges_mono_color() const; /// returns the mono color used for rays. - const CGAL::IO::Color& get_rays_mono_color() const; + const CGAL::IO::Color& rays_mono_color() const; /// returns the mono color used for lines. - const CGAL::IO::Color& get_lines_mono_color() const; + const CGAL::IO::Color& lines_mono_color() const; /// returns the mono color used for faces. - const CGAL::IO::Color& get_faces_mono_color() const; + const CGAL::IO::Color& faces_mono_color() const; /// clears the basic viewer, i.e., remove all its elements. void clear(); /// returns `true` if the viewer is empty. - bool is_empty() const; + bool empty() const; /// returns the bounding box of all the elements in the viewer. const CGAL::Bbox_3& bounding_box() const; /// returns `true` if the clipping plane is enabled. - bool is_clipping_plane_enabled() const; + bool clipping_plane_enabled() const; /// returns the clipping plane when it is enabled. CGAL::Exact_predicates_inexact_constructions_kernel::Plane_3 clipping_plane() const; @@ -172,19 +172,19 @@ class Basic_viewer_qt : public CGAL::QGLViewer void face_begin(const CGAL::IO::Color &acolor); /// returns `true` iff a face is started. - bool is_a_face_started() const; + bool a_face_started() const; /// adds the given point in the current face. - /// @pre `is_a_face_started()` + /// @pre `a_face_started()` template bool add_point_in_face(const KPoint &kp); /// adds the given point in the current face, having the vertex normal. - /// @pre `is_a_face_started()` + /// @pre `a_face_started()` template bool add_point_in_face(const KPoint &kp, const KVector &p_normal); /// ends the current face. - /// @pre `is_a_face_started()` + /// @pre `a_face_started()` void face_end(); /// adds the given text at the given position in the viewer. @@ -196,16 +196,16 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_text(const KPoint &kp, const std::string &txt); /// returns the graphics scene of the viewer. - Graphics_scene& get_graphics_scene(); + Graphics_scene& graphics_scene(); /// returns the graphics scene of the viewer, const version. - const Graphics_scene& get_graphics_scene() const; + const Graphics_scene& graphics_scene() const; - /// negates all normals of vertices and faces. - void negate_all_normals(); + /// reverses all normals of vertices and faces. + void reverse_all_normals(); /// returns `true` if the data structure in in 2D, i.e., lies on a plane. - bool is_two_dimensional() const; + bool two_dimensional() const; /// draws the viewer without recomputing all internal buffers. virtual void draw(); diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 44c977044b8d..47970d7f5234 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -22,7 +22,6 @@ \cgalClassifedRefPages \cgalCRPSection{Classes} -- `CGAL::Graphics_scene_options` - `CGAL::Graphics_scene_options` - `CGAL::Graphics_scene` - `CGAL::Basic_viewer_qt` From 93183fc2b7a2b5ad40438599392ba7c63272db86 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 6 Oct 2023 07:52:15 +0200 Subject: [PATCH 189/399] document draw and add_in_graphics_scene for lcc (for validation) --- .../CGAL/draw_linear_cell_complex.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index 2b5e7b939c0b..38a33ace8013 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -6,18 +6,24 @@ namespace CGAL { opens a new window and draws `alcc`, a model of the `LinearCellComplex` concept. 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. \tparam LCC a model of the `LinearCellComplex` concept. +\tparam GSOptions a class having the same methods than `Graphics_scene_options`: `Graphics_scene_options` by default. + \param alcc the linear cell complex to draw. \param gs_options graphics scene options. */ template - void draw(const LCC& alcc, const GSOptions& gs_options); + void draw(const LCC& alcc, const GSOptions& gs_options=GSOptions()); /*! \ingroup PkgDrawLinearCellComplex Add in the given graphics scene the elements of alcc. +\tparam LCC a model of the `LinearCellComplex` concept. +\tparam BufferType the number type used for point coordinates: `float` by default. +\tparam GSOptions a class having the same methods than `Graphics_scene_options`: `Graphics_scene_options` by default. + \param alcc the linear cell complex to draw. \param graphics_scene the graphics scene. \param gs_options graphics scene options. @@ -25,7 +31,7 @@ Add in the given graphics scene the elements of alcc. */ template void add_in_graphics_scene(const LCC& alcc, CGAL::Graphics_scene& graphics_scene, - const GSOptions& gs_options); + const GSOptions& gs_options=GSOptions()); } /* namespace CGAL */ From 163e8ae2b3b3d28de634c15219ab5feeb8ce0fda Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 13 Oct 2023 10:50:04 +0200 Subject: [PATCH 190/399] Doc basic viewer --- .../doc/Basic_viewer/Basic_viewer.txt | 2 +- .../doc/Basic_viewer/CGAL/Graphics_scene.h | 24 +++++++------- .../CGAL/draw_triangulation_2.h | 33 ++++++++++--------- 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 766ccf8c7798..0ec0627a8106 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -18,7 +18,7 @@ draw(XXX) Graphics_scene_options -\subsection Basic_viewerDoc_3 Graphic storage +\subsection Basic_viewerDoc_3 Graphic Scene \subsection Basic_viewerDoc_4 Basic viewer Qt diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index e21da6ec2509..1a799c850cc2 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -12,37 +12,37 @@ The class `Graphics_scene` stores points, segments, triangles, rays and lines. E template class Graphics_scene { public: - /// adds the given point in the storage. + /// adds the given point in the scene. template void add_point(const KPoint &p); - /// adds the given colored point in the storage. + /// adds the given colored point in the scene. template void add_point(const KPoint &p, const CGAL::IO::Color &acolor); - /// adds the given segment in the storage. + /// adds the given segment in the scene. template void add_segment(const KPoint &p1, const KPoint &p2); - /// adds the given colored segment in the storage. + /// adds the given colored segment in the scene. template void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); - /// adds the given ray in the storage: an half line starting from `p` and having `v` as direction. + /// adds the given ray in the scene: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v); - /// adds the given colored ray in the storage: an half line starting from `p` and having `v` as direction. + /// adds the given colored ray in the scene: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); - /// adds the given line in the storage, defined by `p` and `v` as direction. + /// adds the given line in the scene, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v); - /// adds the given colored line in the storage, defined by `p` and `v` as direction. + /// adds the given colored line in the scene, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); @@ -69,18 +69,18 @@ class Graphics_scene { /// @pre `a_face_started()` void face_end(); - /// adds the given text at the given position in the storage. + /// adds the given text at the given position in the scene. template void add_text(const KPoint &kp, const char *txt); - /// adds the given text at the given position in the storage. + /// adds the given text at the given position in the scene. template void add_text(const KPoint &kp, const std::string &txt); - /// returns `true` iff the storage has no element. + /// returns `true` iff the scene has no element. bool empty() const; - /// clears the storage, i.e., removes all points, segments, triangles and text. + /// clears the scene, i.e., removes all points, segments, triangles and text. void clear(); }; diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 5f42a8463acd..a47d2628461a 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -3,7 +3,7 @@ namespace CGAL { /*! \ingroup PkgDrawTriangulation2 -opens a new window and draws a triangulation. Parameters of the drawing are taken from the optional cell parameter. +opens a new window and draws a triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter. A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with @@ -11,32 +11,35 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with \tparam T2 a triangulation class derived from `Triangulation_2` \param at2 the triangulation to draw. -\param cp the cell parameters. +\param gso the graphics scene options parameter, `Graphics_scene_options()` by default. */ template -void draw(const T2& at2, const CGAL::Graphics_scene_options& cp=default); +void draw(const T2& at2, + const CGAL::Graphics_scene_options& gso=default); /*! \ingroup PkgDrawTriangulation2 -adds the vertices, edges and faces of `at2` into the given graphic storage `gs`. Parameters of the cells are taken from the optional cell parameters `cp` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam T2 a triangulation class derived from `Triangulation_2` +\tparam BufferType the number type used for point coordinates: `float` by default. + \param at2 the triangulation to draw. -\param gs the graphic storage to fill. -\param cp the cell parameters. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter, `Graphics_scene_options()` by default. */ -template +template void add_in_graphics_scene(const T2& at2, - CGAL::Graphics_scene& gs, - const CGAL::Graphics_scene_options& cp=default); + CGAL::Graphics_scene& gs, + const CGAL::Graphics_scene_options& gso=default); } /* namespace CGAL */ From 40b9b1046f31865019b0cbf68c158d6d6f2acb64 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:02:29 +0200 Subject: [PATCH 191/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index 1a799c850cc2..8c6b3a41f36f 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -29,7 +29,7 @@ class Graphics_scene { void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); - /// adds the given ray in the scene: an half line starting from `p` and having `v` as direction. + /// adds the given ray in the scene: a half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v); From b47694cd80970cbac841e3dd9c21ed3210ab044d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:02:41 +0200 Subject: [PATCH 192/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index 8c6b3a41f36f..e5c8c039533d 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -33,7 +33,7 @@ class Graphics_scene { template void add_ray(const KPoint &p, const KVector &v); - /// adds the given colored ray in the scene: an half line starting from `p` and having `v` as direction. + /// adds the given colored ray in the scene: a half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor); From 12365d7cf966019bc997a3c89e6e630562e0639d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:02:48 +0200 Subject: [PATCH 193/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index e5c8c039533d..9bcf7ede97c9 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -65,7 +65,7 @@ class Graphics_scene { template bool add_point_in_face(const KPoint &kp, const KVector &p_normal); - /// end the current face. + /// ends the current face. /// @pre `a_face_started()` void face_end(); From eca66e9682d327ae5377cf9e4e8aeb9e9cda7b7b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:02:55 +0200 Subject: [PATCH 194/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index 9bcf7ede97c9..ab690cf88de7 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -80,7 +80,7 @@ class Graphics_scene { /// returns `true` iff the scene has no element. bool empty() const; - /// clears the scene, i.e., removes all points, segments, triangles and text. + /// clears the scene, i.e., removes all points, segments, triangles, and text. void clear(); }; From a33b4e33560180baec60d9ec0f2ac2cb71a7fd50 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:22:55 +0200 Subject: [PATCH 195/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index 478467909afa..dd69acc75770 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -40,7 +40,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// enables or disables the drawing of texts. void draw_text(bool b); - /// sets the color used for vertices in mono_color mode. + /// sets the color used for vertices in mono color mode. void vertices_mono_color(const CGAL::IO::Color& c); /// sets the color used for edges in mono_color mode. From 67b41d91a2defa3a700977fe1100e199e54ab91d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:23:05 +0200 Subject: [PATCH 196/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index dd69acc75770..fd214d701b85 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -49,7 +49,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// sets the color used for rays in mono_color mode. void rays_mono_color(const CGAL::IO::Color& c); - /// sets the color used for lines in mono_color mode. + /// sets the color used for lines in mono color mode. void lines_mono_color(const CGAL::IO::Color& c); /// sets the color used for faces in mono_color mode. From bfa138dfeda93c95586841a2140c937e47d31bce Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:23:24 +0200 Subject: [PATCH 197/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index fd214d701b85..0de667741ab7 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -147,7 +147,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &acolor); - /// adds the given ray in the viewer: an half line starting from `p` and having `v` as direction. + /// adds the given ray in the viewer: a half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v); From c551b6cd40e060d77252e622f119f73f15a13968 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:23:50 +0200 Subject: [PATCH 198/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index 0de667741ab7..d53538e9e818 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -16,7 +16,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphics_scene`. /// `title` will be the title of the window. Basic_viewer_qt(QWidget* parent, - Graphics_scene& buf, + Graphics_scene& scene, const char* title=""); /// enables or disables the drawing of vertices. From dfb32ba6c349cb8313ce6ee734070ca6c87925cb Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:24:02 +0200 Subject: [PATCH 199/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index d53538e9e818..d940320c62ff 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -94,7 +94,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// returns `true` if mono color mode is used. bool use_mono_color() const; - /// returns `true` if normal are reversed. + /// returns `true` if normals are reversed. bool reverse_normal() const; /// returns `true` if text are drawn. From 46ddf990fcf36dd97abd886b96ce7a5ead4a8b73 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:24:14 +0200 Subject: [PATCH 200/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index d940320c62ff..0aa2ca098104 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -52,7 +52,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// sets the color used for lines in mono color mode. void lines_mono_color(const CGAL::IO::Color& c); - /// sets the color used for faces in mono_color mode. + /// sets the color used for faces in mono color mode. void faces_mono_color(const CGAL::IO::Color& c); /// toggles the drawing of vertices. From 66eba9f2dbd813aea4c43d653daaf6e99c972b83 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:24:26 +0200 Subject: [PATCH 201/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index 0aa2ca098104..b7caa43e7e98 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -46,7 +46,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// sets the color used for edges in mono_color mode. void edges_mono_color(const CGAL::IO::Color& c); - /// sets the color used for rays in mono_color mode. + /// sets the color used for rays in mono color mode. void rays_mono_color(const CGAL::IO::Color& c); /// sets the color used for lines in mono color mode. From cb2ab73e3da28743c01826a0fac96d8319f35b31 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:24:33 +0200 Subject: [PATCH 202/399] Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index b7caa43e7e98..69425636fed2 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -43,7 +43,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// sets the color used for vertices in mono color mode. void vertices_mono_color(const CGAL::IO::Color& c); - /// sets the color used for edges in mono_color mode. + /// sets the color used for edges in mono color mode. void edges_mono_color(const CGAL::IO::Color& c); /// sets the color used for rays in mono color mode. From ef73057d540a1ccffc27d7d6c1ec5b1fd53bbd20 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 09:29:40 +0200 Subject: [PATCH 203/399] acolor -> color --- Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h | 10 +++++----- .../doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index ab690cf88de7..d92e4a497126 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -18,7 +18,7 @@ class Graphics_scene { /// adds the given colored point in the scene. template - void add_point(const KPoint &p, const CGAL::IO::Color &acolor); + void add_point(const KPoint &p, const CGAL::IO::Color &color); /// adds the given segment in the scene. template @@ -27,7 +27,7 @@ class Graphics_scene { /// adds the given colored segment in the scene. template void add_segment(const KPoint &p1, const KPoint &p2, - const CGAL::IO::Color &acolor); + const CGAL::IO::Color &color); /// adds the given ray in the scene: a half line starting from `p` and having `v` as direction. template @@ -36,7 +36,7 @@ class Graphics_scene { /// adds the given colored ray in the scene: a half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v, - const CGAL::IO::Color &acolor); + const CGAL::IO::Color &color); /// adds the given line in the scene, defined by `p` and `v` as direction. template @@ -45,13 +45,13 @@ class Graphics_scene { /// adds the given colored line in the scene, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v, - const CGAL::IO::Color &acolor); + const CGAL::IO::Color &color); /// starts a new face. void face_begin(); /// starts a new colored face. - void face_begin(const CGAL::IO::Color &acolor); + void face_begin(const CGAL::IO::Color &color); /// return `true` iff a face is started. bool a_face_started() const; diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index 69425636fed2..4529095e2542 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -136,7 +136,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// adds the given colored point in the viewer. template - void add_point(const KPoint &p, const CGAL::IO::Color &acolor); + void add_point(const KPoint &p, const CGAL::IO::Color &color); /// adds the given segment in the viewer. template @@ -145,7 +145,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// adds the given colored segment in the viewer. template void add_segment(const KPoint &p1, const KPoint &p2, - const CGAL::IO::Color &acolor); + const CGAL::IO::Color &color); /// adds the given ray in the viewer: a half line starting from `p` and having `v` as direction. template @@ -154,7 +154,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// adds the given colored ray in the viewer: an half line starting from `p` and having `v` as direction. template void add_ray(const KPoint &p, const KVector &v, - const CGAL::IO::Color &acolor); + const CGAL::IO::Color &color); /// adds the given line in the viewer, defined by `p` and `v` as direction. template @@ -163,13 +163,13 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// adds the given colored line in the viewer, defined by `p` and `v` as direction. template void add_line(const KPoint &p, const KVector &v, - const CGAL::IO::Color &acolor); + const CGAL::IO::Color &color); /// starts a new face. void face_begin(); /// starts a new colored face. - void face_begin(const CGAL::IO::Color &acolor); + void face_begin(const CGAL::IO::Color &color); /// returns `true` iff a face is started. bool a_face_started() const; From d213747c80df186a58c052565ff16647902160d5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Oct 2023 15:55:43 +0200 Subject: [PATCH 204/399] nullptr must be quoted --- .../doc/Basic_viewer/CGAL/Graphics_scene_options.h | 8 ++++---- .../include/CGAL/Linear_cell_complex_base.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h index fe574bef90c8..27bb711ab496 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h @@ -68,19 +68,19 @@ struct Graphics_scene_options std::function volume_wireframe; /// `std::function` that returns the color of the given vertex. - /// nullptr by default. + /// `nullptr` by default. std::function vertex_color; /// `std::function` that returns the color of the given edge. - /// nullptr by default. + /// `nullptr` by default. std::function edge_color; /// `std::function` that returns the color of the given face. - /// nullptr by default. + /// `nullptr` by default. std::function face_color; /// `std::function` that returns the color of the given volume. - /// nullptr by default. + /// `nullptr` by default. /// Exists only if `VolumeDescriptor` is not `void`. std::function volume_color; diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h index 4669765f4935..6681a4bb8b3c 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h @@ -806,7 +806,7 @@ namespace CGAL { /** Compute the dual of a Linear_cell_complex. * @param alcc the lcc in which we build the dual of this lcc. - * @param adart a dart of the initial lcc, nullptr by default. + * @param adart a dart of the initial lcc, `nullptr` by default. * @return adart of the dual lcc, the dual of adart if adart!=nullptr, * any dart otherwise. * As soon as we don't modify this lcc and alcc lcc, we can iterate From 31d79bdae582a3786a731965f844edbc4561167c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Oct 2023 15:55:56 +0200 Subject: [PATCH 205/399] fix a copy-paste typo --- Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h index a98fadbbf46f..cbd3355700c7 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h @@ -1109,9 +1109,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer vao[VAO_COLORED_LINES].bind(); if (m_use_mono_color) { - color.setRgbF((double)m_rays_mono_color.red()/(double)255, - (double)m_rays_mono_color.green()/(double)255, - (double)m_rays_mono_color.blue()/(double)255); + color.setRgbF((double)m_lines_mono_color.red()/(double)255, + (double)m_lines_mono_color.green()/(double)255, + (double)m_lines_mono_color.blue()/(double)255); rendering_program_p_l.disableAttributeArray("color"); rendering_program_p_l.setAttributeValue("color",color); } From 136962824460c204e508700623259eb8838b3d7b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 16:24:32 +0200 Subject: [PATCH 206/399] Update Basic_viewer/doc/Basic_viewer/PackageDescription.txt Co-authored-by: Andreas Fabri --- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 47970d7f5234..dd222f1997a8 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -9,7 +9,7 @@ \cgalPkgPicture{basic_viewer_logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand, Mostafa Ashraf} -\cgalPkgDesc{This package implements basic viewer class.} +\cgalPkgDesc{This package provides a basic viewer class.} \cgalPkgManuals{Chapter_Basic_viewer,PkgBasicViewerRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin From eea01ce5fed7613c88df23ee81b027efbd940f36 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 16:23:09 +0200 Subject: [PATCH 207/399] Replace some flot by BufferType --- Basic_viewer/include/CGAL/Buffer_for_vao.h | 24 +++++++++++----------- Basic_viewer/include/CGAL/Graphics_scene.h | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Basic_viewer/include/CGAL/Buffer_for_vao.h b/Basic_viewer/include/CGAL/Buffer_for_vao.h index 438b15153547..c161c009d4e9 100644 --- a/Basic_viewer/include/CGAL/Buffer_for_vao.h +++ b/Basic_viewer/include/CGAL/Buffer_for_vao.h @@ -459,31 +459,31 @@ class Buffer_for_vao /// adds `kp` coordinates to `buffer` template - static void add_point_in_buffer(const KPoint& kp, std::vector& buffer) + static void add_point_in_buffer(const KPoint& kp, std::vector& buffer) { Local_point p=get_local_point(kp); - buffer.push_back(static_cast(p.x())); - buffer.push_back(static_cast(p.y())); - buffer.push_back(static_cast(p.z())); + buffer.push_back(static_cast(p.x())); + buffer.push_back(static_cast(p.y())); + buffer.push_back(static_cast(p.z())); } /// adds `kv` coordinates to `buffer` template - static void add_normal_in_buffer(const KVector& kv, std::vector& buffer, + static void add_normal_in_buffer(const KVector& kv, std::vector& buffer, bool inverse_normal=false) { Local_vector n=(inverse_normal?-get_local_vector(kv):get_local_vector(kv)); - buffer.push_back(static_cast(n.x())); - buffer.push_back(static_cast(n.y())); - buffer.push_back(static_cast(n.z())); + buffer.push_back(static_cast(n.x())); + buffer.push_back(static_cast(n.y())); + buffer.push_back(static_cast(n.z())); } ///adds `acolor` RGB components to `buffer` - static void add_color_in_buffer(const CGAL::IO::Color& acolor, std::vector& buffer) + static void add_color_in_buffer(const CGAL::IO::Color& acolor, std::vector& buffer) { - buffer.push_back((float)acolor.red()/(float)255); - buffer.push_back((float)acolor.green()/(float)255); - buffer.push_back((float)acolor.blue()/(float)255); + buffer.push_back((BufferType)acolor.red()/(BufferType)255); + buffer.push_back((BufferType)acolor.green()/(BufferType)255); + buffer.push_back((BufferType)acolor.blue()/(BufferType)255); } /// @return true iff the points of 'facet' form a convex face diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index fd5fcc4cde18..ed5a256daa36 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -128,7 +128,7 @@ class Graphics_scene const CGAL::Bbox_3 &get_bounding_box() const { return m_bounding_box; } - std::vector &get_array_of_index(int index) { return arrays[index]; } + std::vector &get_array_of_index(int index) { return arrays[index]; } int get_size_of_index(int index) const { return static_cast(arrays[index].size()*sizeof(BufferType)); } @@ -410,7 +410,7 @@ class Graphics_scene std::vector> m_texts; - std::vector arrays[LAST_INDEX]; + std::vector arrays[LAST_INDEX]; CGAL::Bbox_3 m_bounding_box; }; From e3f1772037d3a615c7ec76065aa79c92b2c33dd7 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 18 Oct 2023 16:54:16 +0200 Subject: [PATCH 208/399] Rename add_in_graphics_scene -> add_to_graphics_scene --- .../doc/Basic_viewer/PackageDescription.txt | 28 +++++++++---------- .../CGAL/draw_triangulation_2.h | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index dd222f1997a8..a6dae494221b 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -51,20 +51,20 @@ \cgalCRPSubsection{Fill Graphics Scene for Different Packages} -- Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphics_scene() \endlink -- Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::add_in_graphics_scene() \endlink -- Nef_polyhedron_3 \link PkgDrawNef3 CGAL::add_in_graphics_scene() \endlink -- Periodic_2_Triangulation_2 \link PkgDrawPeriodic2Triangulation2 CGAL::add_in_graphics_scene() \endlink -- Point_set_3 \link PkgDrawPointSet3D CGAL::add_in_graphics_scene() \endlink -- Polygon_2 \link PkgDrawPolygon2 CGAL::add_in_graphics_scene() \endlink -- Polygon_set_2 \link PkgDrawPolygonSet2 CGAL::add_in_graphics_scene() \endlink -- Polygon_with_holes_2 \link PkgDrawPolygonWithHoles2 CGAL::add_in_graphics_scene() \endlink -- Polyhedron_3 \link PkgDrawPolyhedron CGAL::add_in_graphics_scene() \endlink -- Surface_mesh \link PkgDrawSurfaceMesh CGAL::add_in_graphics_scene() \endlink -- Surface_mesh_topology \link PkgDrawFaceGraphWithPaths CGAL::add_in_graphics_scene() \endlink -- Triangulation_2 \link PkgDrawTriangulation2 CGAL::add_in_graphics_scene() \endlink -- Triangulation_3 \link PkgDrawTriangulation3 CGAL::add_in_graphics_scene() \endlink -- Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::add_in_graphics_scene() \endlink +- Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::add_to_graphics_scene() \endlink +- Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::add_to_graphics_scene() \endlink +- Nef_polyhedron_3 \link PkgDrawNef3 CGAL::add_to_graphics_scene() \endlink +- Periodic_2_Triangulation_2 \link PkgDrawPeriodic2Triangulation2 CGAL::add_to_graphics_scene() \endlink +- Point_set_3 \link PkgDrawPointSet3D CGAL::add_to_graphics_scene() \endlink +- Polygon_2 \link PkgDrawPolygon2 CGAL::add_to_graphics_scene() \endlink +- Polygon_set_2 \link PkgDrawPolygonSet2 CGAL::add_to_graphics_scene() \endlink +- Polygon_with_holes_2 \link PkgDrawPolygonWithHoles2 CGAL::add_to_graphics_scene() \endlink +- Polyhedron_3 \link PkgDrawPolyhedron CGAL::add_to_graphics_scene() \endlink +- Surface_mesh \link PkgDrawSurfaceMesh CGAL::add_to_graphics_scene() \endlink +- Surface_mesh_topology \link PkgDrawFaceGraphWithPaths CGAL::add_to_graphics_scene() \endlink +- Triangulation_2 \link PkgDrawTriangulation2 CGAL::add_to_graphics_scene() \endlink +- Triangulation_3 \link PkgDrawTriangulation3 CGAL::add_to_graphics_scene() \endlink +- Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::add_to_graphics_scene() \endlink */ diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index a47d2628461a..fb5b68ce026c 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -35,7 +35,7 @@ adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. P */ template -void add_in_graphics_scene(const T2& at2, +void add_to_graphics_scene(const T2& at2, CGAL::Graphics_scene& gs, const CGAL::Graphics_scene_options Date: Wed, 18 Oct 2023 17:03:12 +0200 Subject: [PATCH 209/399] Start to rewrite draw_polygon_set_2.h (NYF) --- .../include/CGAL/draw_polygon_set_2.h | 164 ++++++++++-------- 1 file changed, 92 insertions(+), 72 deletions(-) diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index cc4452f99c63..6b0a117217f8 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -40,16 +40,82 @@ void draw(const PS& aps); } /* namespace CGAL */ #endif -#ifdef CGAL_USE_BASIC_VIEWER - -#include #include namespace CGAL { -template -class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt { - using Base = Basic_viewer_qt; +namespace draw_function_for_boolean_set_2 { + +template +void compute_loop(const typename PS2::Polygon_2& p, bool hole, + CGAL::Graphics_scene& gs, + const GSOptions& gso) +{ + if (hole) + { gs.add_point_in_face(p.vertex(p.size()-1)); } + + auto prev = p.vertices_begin(); + auto it = prev; + gs.add_point(*it); + gs.add_point_in_face(*it); + for (++it; it != p.vertices_end(); ++it) + { + gs.add_point(*it); // add vertex + gs.add_segment(*prev, *it); // add segment with previous point + gs.add_point_in_face(*it); // add point in face + prev = it; + } + + // Add the last segment between the last point and the first one + gs.add_segment(*prev, *(p.vertices_begin())); +} + +/// Compute the elements of a polygon with holes. +template +void compute_elements(const PWH& pwh, + CGAL::Graphics_scene& gs, + const GSOptions& gso) +{ + if (!gso.draw_unbounded() && pwh.outer_boundary().is_empty()) return; + + CGAL::IO::Color c(75,160,255); + gs.face_begin(c); + + const typename PWH::Point_2* point_in_face; + if (pwh.outer_boundary().is_empty()) + { + typename PWH::Polygon_2 pgn; + pgn.push_back(Pnt(-gso.width(), -gso.height())); + pgn.push_back(Pnt(gso.width(), -gso.height())); + pgn.push_back(Pnt(gso.width(), gso.height())); + pgn.push_back(Pnt(-gso.width(), gso.height())); + compute_loop(pgn, false, gs); + point_in_face = &(pgn.vertex(pgn.size()-1)); + } + else + { + const auto& outer_boundary = pwh.outer_boundary(); + compute_loop(outer_boundary, false, gs); + point_in_face = &(outer_boundary.vertex(outer_boundary.size()-1)); + } + + for (auto it = pwh.holes_begin(); it != pwh.holes_end(); ++it) + { + compute_loop(*it, true, gs); + gs.add_point_in_face(*point_in_face); + } + + gs.face_end(); +} + +} // End namespace draw_function_for_boolean_set_2 + +#ifdef CGAL_USE_BASIC_VIEWER + +template +class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt +{ + using Base = Basic_viewer_qt; using Ps = PolygonSet_2; using Pwh = typename Ps::Polygon_with_holes_2; using Pgn = typename Ps::Polygon_2; @@ -57,6 +123,8 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt { public: Polygon_set_2_basic_viewer_qt(QWidget* parent, const Ps& ps, + Graphics_scene& gs, + GSOptions& gs_options, const char* title = "Basic Polygon_set_2 Viewer", bool draw_unbounded = false, bool draw_vertices = false) : @@ -81,27 +149,28 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt { m_width = width; m_height = height; CGAL::qglviewer::Vec p; - auto ratio = camera()->pixelGLRatio(p); + auto ratio = this->camera()->pixelGLRatio(p); if (ratio != m_pixel_ratio) { m_pixel_ratio = ratio; add_elements(); } } - /*! Compute the elements of a polygon set. + /*! Obtain the pixel ratio. */ - virtual void add_elements() { - clear(); + double pixel_ratio() const { return m_pixel_ratio; } + /*! Compute the elements of a polygon set. + */ + virtual void add_elements() + { + this->clear(); std::vector pwhs; m_ps.polygons_with_holes(std::back_inserter(pwhs)); - for (const auto& pwh : pwhs) add_elements(pwh); + for (const auto& pwh : pwhs) + { compute_elements(pwh, graphics_scene, graphics_scene_options); } } - /*! Obtain the pixel ratio. - */ - double pixel_ratio() const { return m_pixel_ratio; } - /*! Compute the bounding box. */ CGAL::Bbox_2 bounding_box() { @@ -119,57 +188,6 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt { return bbox; } -protected: - /*! Compute the elements of a polygon with holes. - */ - void add_elements(const Pwh& pwh) { - if (! m_draw_unbounded && pwh.outer_boundary().is_empty()) return; - - CGAL::IO::Color c(75,160,255); - face_begin(c); - - const Pnt* point_in_face; - if (pwh.outer_boundary().is_empty()) { - Pgn pgn; - pgn.push_back(Pnt(-m_width, -m_height)); - pgn.push_back(Pnt(m_width, -m_height)); - pgn.push_back(Pnt(m_width, m_height)); - pgn.push_back(Pnt(-m_width, m_height)); - compute_loop(pgn, false); - point_in_face = &(pgn.vertex(pgn.size()-1)); - } - else { - const auto& outer_boundary = pwh.outer_boundary(); - compute_loop(outer_boundary, false); - point_in_face = &(outer_boundary.vertex(outer_boundary.size()-1)); - } - - for (auto it = pwh.holes_begin(); it != pwh.holes_end(); ++it) { - compute_loop(*it, true); - add_point_in_face(*point_in_face); - } - - face_end(); - } - - void compute_loop(const Pgn& p, bool hole) { - if (hole) add_point_in_face(p.vertex(p.size()-1)); - - auto prev = p.vertices_begin(); - auto it = prev; - add_point(*it); - add_point_in_face(*it); - for (++it; it != p.vertices_end(); ++it) { - add_point(*it); // add vertex - add_segment(*prev, *it); // add segment with previous point - add_point_in_face(*it); // add point in face - prev = it; - } - - // Add the last segment between the last point and the first one - add_segment(*prev, *(p.vertices_begin())); - } - private: //! The window width in pixels. int m_width = CGAL_BASIC_VIEWER_INIT_SIZE_X; @@ -185,8 +203,6 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt { //! Indicates whether to draw unbounded polygons with holes. bool m_draw_unbounded = false; - - Graphics_scene gs; }; // Specialization of draw function. @@ -202,16 +218,20 @@ void draw(const CGAL::Polygon_set_2& ps, bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif - if (! cgal_test_suite) { + if (! cgal_test_suite) + { using Ps = CGAL::Polygon_set_2; using Viewer = Polygon_set_2_basic_viewer_qt; CGAL::Qt::init_ogl_context(4,3); int argc = 1; const char* argv[2] = {"t2_viewer", nullptr}; QApplication app(argc, const_cast(argv)); - Viewer mainwindow(app.activeWindow(), ps, title, draw_unbounded, draw_vertices); - mainwindow.add_elements(); - mainwindow.show(); + Graphics_scene gs; + Graphics_scene_options gs; + Viewer basic_viewer(app.activeWindow(), ps, gs, gso, + title, draw_unbounded, draw_vertices); + basic_viewer.add_elements(); + basic_viewer.show(); app.exec(); } } From 175166d43e06e3bc83f5c7b0a23ee7876001e38d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 20 Oct 2023 11:58:37 +0200 Subject: [PATCH 210/399] Remove all methods to add elements from Basic_viewer_qt. --- Basic_viewer/include/CGAL/Buffer_for_vao.h | 11 +- Basic_viewer/include/CGAL/Graphics_scene.h | 45 +++- .../include/CGAL/Qt/Basic_viewer_qt.h | 225 ++++-------------- .../demo/Linear_cell_complex/Viewer.cpp | 18 +- 4 files changed, 93 insertions(+), 206 deletions(-) diff --git a/Basic_viewer/include/CGAL/Buffer_for_vao.h b/Basic_viewer/include/CGAL/Buffer_for_vao.h index c161c009d4e9..7b44bbc7b6b3 100644 --- a/Basic_viewer/include/CGAL/Buffer_for_vao.h +++ b/Basic_viewer/include/CGAL/Buffer_for_vao.h @@ -204,11 +204,10 @@ class Buffer_for_vao bool has_zero_z() const { return m_zero_z; } - void negate_normals() + void negate_normals() const { m_inverse_normal=!m_inverse_normal; - for (std::vector*array=m_flat_normal_buffer; array!=nullptr; - array=(array==m_gouraud_normal_buffer?nullptr:m_gouraud_normal_buffer)) + for (std::vector*array: {m_flat_normal_buffer, m_gouraud_normal_buffer}) { for (std::size_t i=0; isize(); ++i) { (*array)[i]=-(*array)[i]; } @@ -899,8 +898,8 @@ class Buffer_for_vao std::vector* m_pos_buffer; std::vector* m_index_buffer; std::vector* m_color_buffer; - std::vector* m_flat_normal_buffer; - std::vector* m_gouraud_normal_buffer; + mutable std::vector* m_flat_normal_buffer; + mutable std::vector* m_gouraud_normal_buffer; CGAL::Bbox_3* m_bb; @@ -908,7 +907,7 @@ class Buffer_for_vao bool m_zero_y; /// True iff all points have y==0 bool m_zero_z; /// True iff all points have z==0 - bool m_inverse_normal; + mutable bool m_inverse_normal; // Local variables, used when we started a new face.g bool m_face_started; diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index ed5a256daa36..47feac4dab7e 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -123,12 +123,10 @@ class Graphics_scene const Buffer_for_vao &get_buffer_for_colored_faces() const { return m_buffer_for_colored_faces; } - const Buffer_for_vao &get_buffer_for_clipping_plane() const - { return m_buffer_for_clipping_plane; } + const CGAL::Bbox_3 &bounding_box() const { return m_bounding_box; } - const CGAL::Bbox_3 &get_bounding_box() const { return m_bounding_box; } - - std::vector &get_array_of_index(int index) { return arrays[index]; } + const std::vector &get_array_of_index(int index) const + { assert(index(arrays[index].size()*sizeof(BufferType)); } @@ -136,12 +134,30 @@ class Graphics_scene unsigned int number_of_elements(int index) const { return static_cast(arrays[index].size()/3); } - void update_bounding_box(const CGAL::Bbox_3 &box) { m_bounding_box+=box; } - void initiate_bounding_box(const CGAL::Bbox_3& new_bounding_box) { m_bounding_box = new_bounding_box; } - void negate_all_normals() + void update_bounding_box(const CGAL::Bbox_3 &box) { m_bounding_box+=box; } + + template + void update_bounding_box_for_ray(const KPoint &p, const KVector &v) + { + Local_point lp = get_local_point(p); + Local_vector lv = get_local_vector(v); + update_bounding_box((lp + lv).bbox()); + } + + template + void update_bounding_box_for_line(const KPoint &p, const KVector &v, + const KVector &pv) + { + Local_point lp = get_local_point(p); + Local_vector lv = get_local_vector(v); + Local_vector lpv = get_local_vector(pv); + update_bounding_box(lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox()); + } + + void negate_all_normals() const { m_buffer_for_mono_faces.negate_normals(); m_buffer_for_colored_faces.negate_normals(); @@ -308,6 +324,12 @@ class Graphics_scene m_buffer_for_colored_lines.has_zero_z(); } + // Returns true if the data structure lies on a XY or XZ or YZ plane + bool is_two_dimensional() const + { + return (!is_empty() && (has_zero_x() || has_zero_y() || has_zero_z())); + } + void clear() { m_buffer_for_mono_points.clear(); @@ -320,7 +342,6 @@ class Graphics_scene m_buffer_for_colored_lines.clear(); m_buffer_for_mono_faces.clear(); m_buffer_for_colored_faces.clear(); - m_buffer_for_clipping_plane.clear(); m_texts.clear(); m_bounding_box=CGAL::Bbox_3(); } @@ -356,10 +377,10 @@ class Graphics_scene void m_texts_clear() { m_texts.clear(); } - int m_texts_size() + int m_texts_size() const { return m_texts.size(); } - std::vector>& get_m_texts() + const std::vector>& get_m_texts() const { return m_texts; } public: @@ -377,7 +398,6 @@ class Graphics_scene POS_COLORED_LINES, POS_MONO_FACES, POS_COLORED_FACES, - POS_CLIPPING_PLANE, END_POS, BEGIN_COLOR = END_POS, COLOR_POINTS = BEGIN_COLOR, @@ -406,7 +426,6 @@ class Graphics_scene Buffer_for_vao m_buffer_for_colored_lines; Buffer_for_vao m_buffer_for_mono_faces; Buffer_for_vao m_buffer_for_colored_faces; - Buffer_for_vao m_buffer_for_clipping_plane; std::vector> m_texts; diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h index cbd3355700c7..738a99a25c06 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h @@ -72,7 +72,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer // Constructor/Destructor Basic_viewer_qt(QWidget* parent, - Graphics_scene& buf, + const Graphics_scene& buf, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -161,7 +161,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer ~Basic_viewer_qt() { makeCurrent(); - for (unsigned int i=0; iinverseTransformOf @@ -275,97 +248,6 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool is_clipping_plane_enabled() const { return (m_use_clipping_plane!=CLIPPING_PLANE_OFF); } - template - void add_point(const KPoint& p) - { gBuffer.add_point(p); } - - template - void add_point(const KPoint& p, const CGAL::IO::Color& acolor) - { gBuffer.add_point(p, acolor); } - - template - void add_segment(const KPoint& p1, const KPoint& p2) - { gBuffer.add_segment(p1, p2);} - - template - void add_segment(const KPoint& p1, const KPoint& p2, - const CGAL::IO::Color& acolor) - { gBuffer.add_segment(p1, p2, acolor);} - - template - void add_ray(const KPoint &p, const KVector &v) - { gBuffer.add_ray(p, v); } - - template - void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) - { gBuffer.add_ray(p, v, acolor); } - - template - void add_line(const KPoint &p, const KVector &v) - { gBuffer.add_line(p, v); } - - template - void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) - { gBuffer.add_line(p, v, acolor); } - - template - void add_text(const KPoint& kp, const QString& txt) - { gBuffer.add_text(kp, txt); } - - template - void add_text(const KPoint& kp, const char* txt) - { gBuffer.add_text(kp, txt); } - - template - void add_text(const KPoint& kp, const std::string& txt) - { gBuffer.add_text(kp, txt.c_str()); } - - template - void update_bounding_box_for_ray(const KPoint &p, const KVector &v) - { - Local_point lp = get_local_point(p); - Local_vector lv = get_local_vector(v); - CGAL::Bbox_3 b = (lp + lv).bbox(); - gBuffer.update_bounding_box(b); - } - - template - void update_bounding_box_for_line(const KPoint &p, const KVector &v, - const KVector &pv) - { - Local_point lp = get_local_point(p); - Local_vector lv = get_local_vector(v); - Local_vector lpv = get_local_vector(pv); - - CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); - gBuffer.update_bounding_box(b); - } - - bool is_a_face_started() const - { - return gBuffer.get_buffer_for_mono_faces().is_a_face_started() || - gBuffer.get_buffer_for_colored_faces().is_a_face_started(); - } - - void face_begin() - { gBuffer.face_begin(); } - - void face_begin(const CGAL::IO::Color& acolor) - { gBuffer.face_begin(acolor); } - - template - bool add_point_in_face(const KPoint &kp) - { return gBuffer.add_point_in_face(kp); } - - template - bool add_point_in_face(const KPoint &kp, const KVector &p_normal) - { return gBuffer.add_point_in_face(kp, p_normal); } - - void face_end() - { gBuffer.face_end(); } - - Graphics_scene& get_graphics_scene() - { return gBuffer; } const Graphics_scene& get_graphics_scene() const { return gBuffer; } @@ -375,20 +257,6 @@ class Basic_viewer_qt : public CGAL::QGLViewer update(); } - // Shortcuts to simplify function calls. - template - static Local_point get_local_point(const KPoint& p) - { - return internal::Geom_utils::Kernel, Local_kernel>:: - get_local_point(p); - } - template - static Local_vector get_local_vector(const KVector& v) - { - return internal::Geom_utils::Kernel, Local_kernel>:: - get_local_vector(v); - } - void negate_all_normals() { m_inverse_normal=!m_inverse_normal; @@ -397,10 +265,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer // Returns true if the data structure lies on a plane bool is_two_dimensional() const - { - return (!is_empty() && !m_no_2D_mode && - (has_zero_x() || has_zero_y() || has_zero_z())); - } + { return !m_no_2D_mode && gBuffer.is_two_dimensional(); } protected: void compile_shaders() @@ -410,7 +275,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_clipping_plane.removeAllShaders(); // Create the buffers - for (unsigned int i=0; i(m_array_for_clipping_plane.size()*sizeof(BufferType))); rendering_program_clipping_plane.enableAttributeArray("vertex"); rendering_program_clipping_plane.setAttributeBuffer("vertex", GL_FLOAT, 0, 3); @@ -845,13 +710,13 @@ class Basic_viewer_qt : public CGAL::QGLViewer 1.0f ); CGAL::Bbox_3 bb; - if (bb==bounding_box()) // Case of "empty" bounding box + if (bb==gBuffer.bounding_box()) // Case of "empty" bounding box { bb=Local_point(CGAL::ORIGIN).bbox(); bb=bb + Local_point(1,1,1).bbox(); // To avoid a warning from Qglviewer } else - { bb=bounding_box(); } + { bb=gBuffer.bounding_box(); } QVector4D position((bb.xmax()-bb.xmin())/2, (bb.ymax()-bb.ymin())/2, @@ -909,9 +774,9 @@ class Basic_viewer_qt : public CGAL::QGLViewer constraint.setTranslationConstraintType(CGAL::qglviewer::AxisPlaneConstraint::FREE); double cx=0., cy=0., cz=0.; - if (has_zero_x()) { cx=1.; } - else if (has_zero_y()) { cy=1.; } - else { cz=1.; } + if (gBuffer.has_zero_x()) { cx=1.; } + else if (gBuffer.has_zero_y()) { cy=1.; } + else { cz=1.; } camera()->setViewDirection(CGAL::qglviewer::Vec(-cx,-cy,-cz)); constraint.setRotationConstraintDirection(CGAL::qglviewer::Vec(cx, cy, cz)); @@ -1185,7 +1050,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer rendering_program_clipping_plane.bind(); vao[VAO_CLIPPING_PLANE].bind(); glLineWidth(0.1f); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_CLIPPING_PLANE))); + glDrawArrays(GL_LINES, 0, static_cast((m_array_for_clipping_plane.size()/3))); glLineWidth(1.0f); vao[VAO_CLIPPING_PLANE].release(); rendering_program_clipping_plane.release(); @@ -1287,13 +1152,13 @@ class Basic_viewer_qt : public CGAL::QGLViewer compile_shaders(); CGAL::Bbox_3 bb; - if (bb==bounding_box()) // Case of "empty" bounding box + if (bb==gBuffer.bounding_box()) // Case of "empty" bounding box { bb=Local_point(CGAL::ORIGIN).bbox(); bb=bb + Local_point(1,1,1).bbox(); // To avoid a warning from Qglviewer } else - { bb=bounding_box(); } + { bb=gBuffer.bounding_box(); } this->camera()->setSceneBoundingBox(CGAL::qglviewer::Vec(bb.xmin(), bb.ymin(), bb.zmin()), @@ -1308,12 +1173,12 @@ class Basic_viewer_qt : public CGAL::QGLViewer void generate_clipping_plane() { - qreal size=((bounding_box().xmax() - bounding_box().xmin()) + - (bounding_box().ymax() - bounding_box().ymin()) + - (bounding_box().zmax() - bounding_box().zmin())); + qreal size=((gBuffer.bounding_box().xmax()-gBuffer.bounding_box().xmin()) + + (gBuffer.bounding_box().ymax()-gBuffer.bounding_box().ymin()) + + (gBuffer.bounding_box().zmax()-gBuffer.bounding_box().zmin())); const unsigned int nbSubdivisions=30; - auto& array = gBuffer.get_array_of_index(GS::POS_CLIPPING_PLANE); + auto& array = m_array_for_clipping_plane; array.clear(); for (unsigned int i=0; i<=nbSubdivisions; ++i) { @@ -1595,7 +1460,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer std::function *)> on_key_pressed; protected: - Graphics_scene& gBuffer; + const Graphics_scene& gBuffer; bool m_draw_vertices; bool m_draw_edges; @@ -1619,6 +1484,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer int m_use_clipping_plane=CLIPPING_PLANE_OFF; CGAL::qglviewer::ManipulatedFrame* m_frame_plane=nullptr; + // Buffer for clipping plane is not stored in the scene because it is not + // filled by users but by the basic viewer. + std::vector m_array_for_clipping_plane; + double m_size_points; double m_size_edges; double m_size_rays; @@ -1636,10 +1505,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer // CGAL::qglviewer::LocalConstraint constraint; CGAL::qglviewer::WorldConstraint constraint; - static const unsigned int NB_VBO_BUFFERS=(GS::END_POS-GS::BEGIN_POS)+ - (GS::END_COLOR-GS::BEGIN_COLOR)+2; // +2 for 2 vectors of normals + static const unsigned int NB_GL_BUFFERS=(GS::END_POS-GS::BEGIN_POS)+ + (GS::END_COLOR-GS::BEGIN_COLOR)+3; // +2 for normals (mono and color), +1 for clipping plane - QGLBuffer buffers[NB_VBO_BUFFERS]; + QGLBuffer buffers[NB_GL_BUFFERS]; // +1 for the vbo buffer of clipping plane // The following enum gives the indices of the different vao. enum @@ -1669,8 +1538,8 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; template -void draw_graphics_scene(Graphics_scene& graphics_scene, - const char *title="CGAL Basic Viewer") +void draw_graphics_scene(const Graphics_scene& graphics_scene, + const char *title="CGAL Basic Viewer") { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; @@ -1698,7 +1567,7 @@ template class QApplication_and_basic_viewer { public: - QApplication_and_basic_viewer(CGAL::Graphics_scene& buffer, + QApplication_and_basic_viewer(const CGAL::Graphics_scene& buffer, const char* title="CGAL Basic Viewer"): m_application(nullptr), m_basic_viewer(nullptr), diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index 41ac6f489685..4039bb460fcf 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -53,7 +53,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) scene = scene_; if (scene->lcc!=nullptr) - { CGAL::add_in_graphics_scene(*scene->lcc, gBuffer, m_gs_options); } + { CGAL::add_in_graphics_scene(*scene->lcc, m_graphic_buffer, m_gs_options); } if (doredraw) { Base::redraw(); } @@ -61,16 +61,16 @@ void Viewer::setScene(Scene *scene_, bool doredraw) void Viewer::sceneChanged() { - gBuffer.clear(); - CGAL::add_in_graphics_scene(*scene->lcc, gBuffer, m_gs_options); + m_graphic_buffer.clear(); + CGAL::add_in_graphics_scene(*scene->lcc, m_graphic_buffer, m_gs_options); this->camera()->setSceneBoundingBox( - CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(), - gBuffer.get_bounding_box().ymin(), - gBuffer.get_bounding_box().zmin()), - CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmax(), - gBuffer.get_bounding_box().ymax(), - gBuffer.get_bounding_box().zmax())); + CGAL::qglviewer::Vec(gBuffer.bounding_box().xmin(), + gBuffer.bounding_box().ymin(), + gBuffer.bounding_box().zmin()), + CGAL::qglviewer::Vec(gBuffer.bounding_box().xmax(), + gBuffer.bounding_box().ymax(), + gBuffer.bounding_box().zmax())); Base::redraw(); if (m_previous_scene_empty) { this->showEntireScene(); } From d8e190c9e9136924228bc84a5e6d34c8b777298d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 20 Oct 2023 12:07:52 +0200 Subject: [PATCH 211/399] Basic viewer doc --- .../doc/Basic_viewer/CGAL/Graphics_scene.h | 7 ++ .../Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 86 +------------------ 2 files changed, 10 insertions(+), 83 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index d92e4a497126..96d40e589991 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -82,6 +82,13 @@ class Graphics_scene { /// clears the scene, i.e., removes all points, segments, triangles, and text. void clear(); + + /// returns the bounding box of all the elements in the scene. + const CGAL::Bbox_3& bounding_box() const; + + /// returns `true` if the data structure in in 2D, i.e., lies on XY or XZ or YZ plane. + bool two_dimensional() const; + }; } // namespace CGAL diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index 4529095e2542..d81fcab0d5c7 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -16,7 +16,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphics_scene`. /// `title` will be the title of the window. Basic_viewer_qt(QWidget* parent, - Graphics_scene& scene, + const Graphics_scene& scene, const char* title=""); /// enables or disables the drawing of vertices. @@ -115,98 +115,18 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// returns the mono color used for faces. const CGAL::IO::Color& faces_mono_color() const; - /// clears the basic viewer, i.e., remove all its elements. - void clear(); - - /// returns `true` if the viewer is empty. - bool empty() const; - - /// returns the bounding box of all the elements in the viewer. - const CGAL::Bbox_3& bounding_box() const; - /// returns `true` if the clipping plane is enabled. bool clipping_plane_enabled() const; /// returns the clipping plane when it is enabled. CGAL::Exact_predicates_inexact_constructions_kernel::Plane_3 clipping_plane() const; - /// adds the given point in the viewer. - template - void add_point(const KPoint &p); - - /// adds the given colored point in the viewer. - template - void add_point(const KPoint &p, const CGAL::IO::Color &color); - - /// adds the given segment in the viewer. - template - void add_segment(const KPoint &p1, const KPoint &p2); - - /// adds the given colored segment in the viewer. - template - void add_segment(const KPoint &p1, const KPoint &p2, - const CGAL::IO::Color &color); - - /// adds the given ray in the viewer: a half line starting from `p` and having `v` as direction. - template - void add_ray(const KPoint &p, const KVector &v); - - /// adds the given colored ray in the viewer: an half line starting from `p` and having `v` as direction. - template - void add_ray(const KPoint &p, const KVector &v, - const CGAL::IO::Color &color); - - /// adds the given line in the viewer, defined by `p` and `v` as direction. - template - void add_line(const KPoint &p, const KVector &v); - - /// adds the given colored line in the viewer, defined by `p` and `v` as direction. - template - void add_line(const KPoint &p, const KVector &v, - const CGAL::IO::Color &color); - - /// starts a new face. - void face_begin(); - - /// starts a new colored face. - void face_begin(const CGAL::IO::Color &color); - - /// returns `true` iff a face is started. - bool a_face_started() const; - - /// adds the given point in the current face. - /// @pre `a_face_started()` - template bool add_point_in_face(const KPoint &kp); - - /// adds the given point in the current face, having the vertex normal. - /// @pre `a_face_started()` - template - bool add_point_in_face(const KPoint &kp, const KVector &p_normal); - - /// ends the current face. - /// @pre `a_face_started()` - void face_end(); - - /// adds the given text at the given position in the viewer. - template - void add_text(const KPoint &kp, const char *txt); - - /// adds the given text at the given position in the viewer. - template - void add_text(const KPoint &kp, const std::string &txt); - /// returns the graphics scene of the viewer. - Graphics_scene& graphics_scene(); - - /// returns the graphics scene of the viewer, const version. const Graphics_scene& graphics_scene() const; /// reverses all normals of vertices and faces. void reverse_all_normals(); - /// returns `true` if the data structure in in 2D, i.e., lies on a plane. - bool two_dimensional() const; - /// draws the viewer without recomputing all internal buffers. virtual void draw(); @@ -233,7 +153,7 @@ class QApplication_and_basic_viewer { public: /// Constructor given a `Graphics_scene` and possibly a title. - QApplication_and_basic_viewer(CGAL::Graphics_scene& buffer, + QApplication_and_basic_viewer(const CGAL::Graphics_scene& buffer, const char* title="CGAL Basic Viewer"); /// runs the `QApplication`, i.e., open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. @@ -248,7 +168,7 @@ class QApplication_and_basic_viewer opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition CGAL_USE_BASIC_VIEWER. */ template -void draw_graphics_scene(Graphics_scene& graphic_buffer, +void draw_graphics_scene(const Graphics_scene& graphic_buffer, const char *title="CGAL Basic Viewer") {} From e1cd107698632cdd61c78b4a8963872fa0b575fc Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 20 Oct 2023 12:10:01 +0200 Subject: [PATCH 212/399] typo --- Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index 96d40e589991..f1b9636093b7 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -86,9 +86,8 @@ class Graphics_scene { /// returns the bounding box of all the elements in the scene. const CGAL::Bbox_3& bounding_box() const; - /// returns `true` if the data structure in in 2D, i.e., lies on XY or XZ or YZ plane. + /// returns `true` if the scene is in 2D, i.e., lies on XY or XZ or YZ plane. bool two_dimensional() const; - }; } // namespace CGAL From 0c8704f1efaea4fda3457a664109bc2017d8cab9 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 20 Oct 2023 12:12:51 +0200 Subject: [PATCH 213/399] Basic viewer doc: variable name --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index d81fcab0d5c7..d1fab4746648 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -168,7 +168,7 @@ class QApplication_and_basic_viewer opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition CGAL_USE_BASIC_VIEWER. */ template -void draw_graphics_scene(const Graphics_scene& graphic_buffer, +void draw_graphics_scene(const Graphics_scene& graphic_scene, const char *title="CGAL Basic Viewer") {} From 3fa4c703249d6c5478e23719419a33982c6889df Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 20 Oct 2023 12:15:53 +0200 Subject: [PATCH 214/399] Basic viewer doc typo --- Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index f1b9636093b7..47056f7d79f5 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -86,7 +86,7 @@ class Graphics_scene { /// returns the bounding box of all the elements in the scene. const CGAL::Bbox_3& bounding_box() const; - /// returns `true` if the scene is in 2D, i.e., lies on XY or XZ or YZ plane. + /// returns `true` if the scene is in 2D, i.e., lies on the XY or XZ or YZ plane. bool two_dimensional() const; }; From 45d9708f0799a26a82073132799d2206cecdc20e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 20 Oct 2023 14:53:26 +0200 Subject: [PATCH 215/399] Basic viewer names in doc --- .../doc/Basic_viewer/CGAL/Graphics_scene_options.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h index 27bb711ab496..1f142ee0b369 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h @@ -43,29 +43,29 @@ struct Graphics_scene_options /// `std::function` that returns `true` if the given vertex is colored, `false` otherwise. /// Returns `false` by default. - std::function colored_vertex; + std::function is_vertex_colored; /// `std::function` that returns `true` if the given edge is colored, `false` otherwise. /// Returns `false` by default. - std::function colored_edge; + std::function is_edge_colored; /// `std::function` that returns `true` if the given face is colored, `false` otherwise. /// Returns `false` by default. - std::function colored_face; + std::function is_face_colored; /// `std::function` that returns `true` if the given volume is colored, `false` otherwise. /// Returns `false` by default. /// Exists only if `VolumeDescriptor` is not `void`. - std::function colored_volume; + std::function is_volume_colored; /// `std::function` that returns `true` if the given face is in wireframe, `false` otherwise. /// Returns `false` by default. - std::function face_wireframe; + std::function is_face_wireframe; /// `std::function` that returns `true` if the given volume is in wireframe, `false` otherwise. /// Returns `false` by default. /// Exists only if `VolumeDescriptor` is not `void`. - std::function volume_wireframe; + std::function is_volume_wireframe; /// `std::function` that returns the color of the given vertex. /// `nullptr` by default. From cf797a5d31afcf2e9f42bf0c17f8bf24e6c325f1 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 20 Oct 2023 14:53:48 +0200 Subject: [PATCH 216/399] basic viewer does not have clear anymore --- .../examples/Basic_viewer/draw_surface_mesh_small_faces.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index d478d910c82a..10f85c6d85e7 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -116,7 +116,7 @@ int main(int argc, char* argv[]) basic_viewer->displayMessage (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); - basic_viewer->clear(); + buffer.clear(); add_in_graphics_scene(sm, buffer, gsosm); basic_viewer->redraw(); } @@ -127,7 +127,7 @@ int main(int argc, char* argv[]) basic_viewer->displayMessage (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); - basic_viewer->clear(); + buffer.clear(); add_in_graphics_scene(sm, buffer, gsosm); basic_viewer->redraw(); } From d74a3dbeacf29438d03635be1b4a32778f7e0d36 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Sun, 22 Oct 2023 17:12:21 +0200 Subject: [PATCH 217/399] Remove template parameter for graphics scene --- BGL/include/CGAL/draw_face_graph.h | 12 +++--- .../Basic_viewer/draw_mesh_and_points.cpp | 2 +- .../Basic_viewer/draw_several_windows.cpp | 2 +- .../draw_surface_mesh_small_faces.cpp | 4 +- Basic_viewer/include/CGAL/Buffer_for_vao.h | 3 +- Basic_viewer/include/CGAL/Graphics_scene.h | 43 ++++++++++--------- .../include/CGAL/Qt/Basic_viewer_qt.h | 30 ++++++------- Point_set_3/include/CGAL/draw_point_set_3.h | 16 +++---- Polyhedron/include/CGAL/draw_polyhedron.h | 16 +++---- Surface_mesh/include/CGAL/draw_surface_mesh.h | 18 ++++---- .../include/CGAL/draw_triangulation_2.h | 9 ++-- 11 files changed, 77 insertions(+), 78 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index 4172b25fcb71..20f4cf12899f 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -24,9 +24,9 @@ namespace CGAL { namespace draw_function_for_FG { -template +template void compute_elements(const FG &fg, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const GSOptions &m_gs_options) { using Point=typename boost::property_map_value::type; @@ -118,17 +118,17 @@ void compute_elements(const FG &fg, } // draw_function_for_FG -template +template void add_in_graphics_scene_for_fg(const FG &fg, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { draw_function_for_FG::compute_elements(fg, graphics_scene, gs_options); } -template +template void add_in_graphics_scene_for_fg(const FG &fg, - CGAL::Graphics_scene &graphics_scene) + CGAL::Graphics_scene &graphics_scene) { Graphics_scene_options::vertex_descriptor, diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 9704e39bc78c..e378696c071f 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -54,7 +54,7 @@ int main(void) for(Pwn& it: points) { point_set.insert(it.first); } - CGAL::Graphics_scene graphic_buffer; + CGAL::Graphics_scene graphic_buffer; CGAL::add_in_graphics_scene(point_set, graphic_buffer, Graphics_scene_options_green_points()); CGAL::add_in_graphics_scene(output_mesh, graphic_buffer); CGAL::draw_graphics_scene(graphic_buffer); diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index 0db6619d3194..a84472e51838 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -47,7 +47,7 @@ int main(void) for(Pwn& it: points) { point_set.insert(it.first); } - CGAL::Graphics_scene graphic_buffer1, graphic_buffer2; + CGAL::Graphics_scene graphic_buffer1, graphic_buffer2; CGAL::add_in_graphics_scene(point_set, graphic_buffer1); CGAL::add_in_graphics_scene(output_mesh, graphic_buffer2); diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 10f85c6d85e7..2bc04da399be 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -99,14 +99,14 @@ int main(int argc, char* argv[]) { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } Graphics_scene_options_small_faces gsosm(sm); - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(sm, buffer, gsosm); CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); if(app) { app.basic_viewer().on_key_pressed= - [&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) diff --git a/Basic_viewer/include/CGAL/Buffer_for_vao.h b/Basic_viewer/include/CGAL/Buffer_for_vao.h index 7b44bbc7b6b3..3209ec93b0a1 100644 --- a/Basic_viewer/include/CGAL/Buffer_for_vao.h +++ b/Basic_viewer/include/CGAL/Buffer_for_vao.h @@ -128,10 +128,11 @@ namespace internal } // End namespace internal //------------------------------------------------------------------------------ -template class Buffer_for_vao { public: + using BufferType=float; + using IndexType=std::size_t; typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index 47feac4dab7e..5c8101b1fadf 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -55,10 +55,11 @@ inline CGAL::IO::Color get_random_color(CGAL::Random& random) //------------------------------------------------------------------------------ // This class is responsible for dealing with available CGAL data structures and // handling buffers. -template class Graphics_scene { public: + using BufferType=float; + typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; @@ -93,34 +94,34 @@ class Graphics_scene &arrays[SMOOTH_NORMAL_COLORED_FACES]) {} - const Buffer_for_vao &get_buffer_for_mono_points() const + const Buffer_for_vao &get_buffer_for_mono_points() const { return m_buffer_for_mono_points; } - const Buffer_for_vao &get_buffer_for_colored_points() const + const Buffer_for_vao &get_buffer_for_colored_points() const { return m_buffer_for_colored_points; } - const Buffer_for_vao &get_buffer_for_mono_segments() const + const Buffer_for_vao &get_buffer_for_mono_segments() const { return m_buffer_for_mono_segments; } - const Buffer_for_vao &get_buffer_for_colored_segments() const + const Buffer_for_vao &get_buffer_for_colored_segments() const { return m_buffer_for_colored_segments; } - const Buffer_for_vao &get_buffer_for_mono_rays() const + const Buffer_for_vao &get_buffer_for_mono_rays() const { return m_buffer_for_mono_rays; } - const Buffer_for_vao &get_buffer_for_colored_rays() const + const Buffer_for_vao &get_buffer_for_colored_rays() const { return m_buffer_for_colored_rays; } - const Buffer_for_vao &get_buffer_for_mono_lines() const + const Buffer_for_vao &get_buffer_for_mono_lines() const { return m_buffer_for_mono_lines; } - const Buffer_for_vao &get_buffer_for_colored_lines() const + const Buffer_for_vao &get_buffer_for_colored_lines() const { return m_buffer_for_colored_lines; } - const Buffer_for_vao &get_buffer_for_mono_faces() const + const Buffer_for_vao &get_buffer_for_mono_faces() const { return m_buffer_for_mono_faces; } - const Buffer_for_vao &get_buffer_for_colored_faces() const + const Buffer_for_vao &get_buffer_for_colored_faces() const { return m_buffer_for_colored_faces; } const CGAL::Bbox_3 &bounding_box() const { return m_bounding_box; } @@ -416,16 +417,16 @@ class Graphics_scene }; protected: - Buffer_for_vao m_buffer_for_mono_points; - Buffer_for_vao m_buffer_for_colored_points; - Buffer_for_vao m_buffer_for_mono_segments; - Buffer_for_vao m_buffer_for_colored_segments; - Buffer_for_vao m_buffer_for_mono_rays; - Buffer_for_vao m_buffer_for_colored_rays; - Buffer_for_vao m_buffer_for_mono_lines; - Buffer_for_vao m_buffer_for_colored_lines; - Buffer_for_vao m_buffer_for_mono_faces; - Buffer_for_vao m_buffer_for_colored_faces; + Buffer_for_vao m_buffer_for_mono_points; + Buffer_for_vao m_buffer_for_colored_points; + Buffer_for_vao m_buffer_for_mono_segments; + Buffer_for_vao m_buffer_for_colored_segments; + Buffer_for_vao m_buffer_for_mono_rays; + Buffer_for_vao m_buffer_for_colored_rays; + Buffer_for_vao m_buffer_for_mono_lines; + Buffer_for_vao m_buffer_for_colored_lines; + Buffer_for_vao m_buffer_for_mono_faces; + Buffer_for_vao m_buffer_for_colored_faces; std::vector> m_texts; diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h index 738a99a25c06..0d107922a75c 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h @@ -61,18 +61,18 @@ namespace CGAL { //------------------------------------------------------------------------------ -template class Basic_viewer_qt : public CGAL::QGLViewer { public: + using BufferType=float; typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; - using GS=Graphics_scene; + using GS=Graphics_scene; // Constructor/Destructor Basic_viewer_qt(QWidget* parent, - const Graphics_scene& buf, + const Graphics_scene& buf, const char* title="", bool draw_vertices=false, bool draw_edges=true, @@ -248,7 +248,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer bool is_clipping_plane_enabled() const { return (m_use_clipping_plane!=CLIPPING_PLANE_OFF); } - const Graphics_scene& get_graphics_scene() const + const Graphics_scene& get_graphics_scene() const { return gBuffer; } virtual void redraw() @@ -1457,10 +1457,10 @@ class Basic_viewer_qt : public CGAL::QGLViewer return text; } public: - std::function *)> on_key_pressed; + std::function on_key_pressed; protected: - const Graphics_scene& gBuffer; + const Graphics_scene& gBuffer; bool m_draw_vertices; bool m_draw_edges; @@ -1537,8 +1537,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer }; -template -void draw_graphics_scene(const Graphics_scene& graphics_scene, +void draw_graphics_scene(const Graphics_scene& graphics_scene, const char *title="CGAL Basic Viewer") { #if defined(CGAL_TEST_SUITE) @@ -1554,8 +1553,8 @@ void draw_graphics_scene(const Graphics_scene& graphics_scene, int argc = 1; const char *argv[2] = {title, nullptr}; QApplication app(argc, const_cast(argv)); - Basic_viewer_qt basic_viewer(app.activeWindow(), - graphics_scene, title); + Basic_viewer_qt basic_viewer(app.activeWindow(), + graphics_scene, title); basic_viewer.show(); app.exec(); @@ -1563,11 +1562,10 @@ void draw_graphics_scene(const Graphics_scene& graphics_scene, } //------------------------------------------------------------------------------ -template class QApplication_and_basic_viewer { public: - QApplication_and_basic_viewer(const CGAL::Graphics_scene& buffer, + QApplication_and_basic_viewer(const CGAL::Graphics_scene& buffer, const char* title="CGAL Basic Viewer"): m_application(nullptr), m_basic_viewer(nullptr), @@ -1588,8 +1586,8 @@ class QApplication_and_basic_viewer Qt::init_ogl_context(4, 3); m_application=new QApplication(m_argc, const_cast(m_argv)); - m_basic_viewer=new Basic_viewer_qt(m_application->activeWindow(), - buffer, title); + m_basic_viewer=new Basic_viewer_qt(m_application->activeWindow(), + buffer, title); } ~QApplication_and_basic_viewer() @@ -1611,7 +1609,7 @@ class QApplication_and_basic_viewer } } - Basic_viewer_qt& basic_viewer() + Basic_viewer_qt& basic_viewer() { CGAL_assertion(m_basic_viewer!=nullptr); return *m_basic_viewer; @@ -1619,7 +1617,7 @@ class QApplication_and_basic_viewer protected: QApplication* m_application; - Basic_viewer_qt* m_basic_viewer; + Basic_viewer_qt* m_basic_viewer; char *m_argv[2]; int m_argc; }; 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 72365c6e40c5..c1f9ccbcca61 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -42,9 +42,9 @@ namespace CGAL { namespace draw_function_for_PointSet { -template +template void compute_elements(const PointSet& pointset, - Graphics_scene& graphics_scene, + Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.are_vertices_enabled()) @@ -68,9 +68,9 @@ void compute_elements(const PointSet& pointset, } // namespace draw_function_for_PointSet -template +template void add_in_graphics_scene(const Point_set_3& apointset, - Graphics_scene& graphics_scene, + Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_PointSet::compute_elements(apointset, @@ -78,9 +78,9 @@ void add_in_graphics_scene(const Point_set_3& apointset, gs_options); } -template +template void add_in_graphics_scene(const Point_set_3& apointset, - Graphics_scene& graphics_scene) + Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options, typename Point_set_3::const_iterator, @@ -96,7 +96,7 @@ void draw(const Point_set_3& apointset, const GSOptions& gs_options, const char *title="Point_set_3 Basic Viewer") { - Graphics_scene buffer; + Graphics_scene buffer; add_in_graphics_scene(apointset, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -105,7 +105,7 @@ template void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { - Graphics_scene buffer; + Graphics_scene buffer; add_in_graphics_scene(apointset, buffer); draw_graphics_scene(buffer, title); } diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 5694e9a0b50d..5043f0d7ef7b 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -32,10 +32,9 @@ template class T_HDS, class Alloc, - typename BufferType=float, class GSOptions> void add_in_graphics_scene(const CGAL_POLY_TYPE& apoly, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { add_in_graphics_scene_for_fg(apoly, graphics_scene, gs_options); } @@ -43,10 +42,9 @@ template class T_HDS, - class Alloc, - typename BufferType=float> + class Alloc> void add_in_graphics_scene(const CGAL_POLY_TYPE& apoly, - CGAL::Graphics_scene &graphics_scene) + CGAL::Graphics_scene &graphics_scene) { add_in_graphics_scene_for_fg(apoly, graphics_scene); } // Specialization of draw function: require Qt and the CGAL basic viewer. @@ -56,12 +54,11 @@ template class T_HDS, - class Alloc, - typename BufferType=float> + class Alloc> void draw(const CGAL_POLY_TYPE& apoly, const char* title="Polyhedron Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene_for_fg(apoly, buffer); draw_graphics_scene(buffer, title); } @@ -71,13 +68,12 @@ template class T_HDS, class Alloc, - typename BufferType=float, class GSOptions> void draw(const CGAL_POLY_TYPE& apoly, const GSOptions &gs_options, const char* title="Polyhedron Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene_for_fg(apoly, buffer, gs_options); draw_graphics_scene(buffer, title); } diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index e7180663c98d..af41ce4abcf2 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -94,36 +94,36 @@ struct Graphics_scene_options_surface_mesh typename SM::template Property_map fcolors; }; -template +template void add_in_graphics_scene(const Surface_mesh& amesh, - CGAL::Graphics_scene &graphics_scene, - const GSOptions &gs_options) + CGAL::Graphics_scene &graphics_scene, + const GSOptions &gs_options) { add_in_graphics_scene_for_fg(amesh, graphics_scene, gs_options); } -template +template void add_in_graphics_scene(const Surface_mesh& amesh, - CGAL::Graphics_scene &graphics_scene) + CGAL::Graphics_scene &graphics_scene) { add_in_graphics_scene_for_fg(amesh, graphics_scene, Graphics_scene_options_surface_mesh(amesh)); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. -template +template void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(amesh, buffer); draw_graphics_scene(buffer, title); } -template +template void draw(const Surface_mesh& amesh, const GSOptions &gs_options, const char* title="Surface_mesh Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(amesh, buffer, gs_options); draw_graphics_scene(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index c214b01ab0d2..6865cc54f436 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -117,10 +117,13 @@ void compute_elements(const T2& t2, #define CGAL_T2_TYPE CGAL::Triangulation_2 -template +template void add_in_graphics_scene(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphics_scene, - const GSOptions& gs_options) + CGAL::Graphics_scene& graphics_scene, + const CGAL::Graphics_scene_options& & gs_options) { draw_function_for_t2::compute_elements(at2, graphics_scene, gs_options); } From c9d93bac3b87eb444ac2713bdf59a6b65b2af01a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Sun, 22 Oct 2023 17:14:18 +0200 Subject: [PATCH 218/399] Add GraphicsSceneOptions concept; use it to document draw(T2); waiting @Laurent remarks... --- .../doc/Basic_viewer/CGAL/Graphics_scene.h | 3 - .../CGAL/Graphics_scene_options.h | 75 +---------- .../Basic_viewer/CGAL/Qt/Basic_viewer_qt.h | 19 +-- .../Concepts/GraphicsSceneOptions.h | 124 ++++++++++++++++++ .../doc/Basic_viewer/PackageDescription.txt | 7 + .../CGAL/draw_triangulation_2.h | 33 +++-- 6 files changed, 155 insertions(+), 106 deletions(-) create mode 100644 Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index 47056f7d79f5..5bc9d40f5a29 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -6,10 +6,7 @@ namespace CGAL { The class `Graphics_scene` stores points, segments, triangles, rays and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added and are triangulated internally. -\tparam BufferType the number type used for point coordinates: `float` by default. - */ -template class Graphics_scene { public: /// adds the given point in the scene. diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h index 1f142ee0b369..5461da7ecb47 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h @@ -8,12 +8,15 @@ The class `Graphics_scene_options` is used to tune the way that the cells of a g The different `std::function` can be modified to change for example the behavior of the drawing. `VolumeDescriptor` can be `void` for data structures that do not represent volumes. In such a case, all methods about volumes do not exist. +This class is a model of `GraphicsSceneOptions` when `VolumeDescriptor` is `void`, or a model of `GraphicsSceneOptionsWithVolumes` otherwise (`VolumeDescriptor` non `void`). + \tparam DS a data structure of \cgal. \tparam VertexDescriptor a descriptor of vertices of `DS`. \tparam EdgeDescriptor a descriptor of edges of `DS`. \tparam FaceDescriptor a descriptor of faces of `DS`. \tparam VolumeDescriptor a descriptor of volumes of `DS`. `void` by default. +\cgalModels{GraphicsSceneOptions or GraphicsSceneOptionsWithVolumes} */ template ignore_vertex; - - /// `std::function` that returns `true` if the given edge must be ignored, `false` otherwise. - /// Returns `true` by default. - std::function ignore_edge; - - /// `std::function` that returns `true` if the given face must be ignored, `false` otherwise. - /// Returns `true` by default. - std::function ignore_face; - - /// `std::function` that returns `true` if the given volume must be ignored, `false` otherwise. - /// Exists only if `VolumeDescriptor` is not `void`. - /// Returns `false` by default. - std::function ignore_volume; - - /// `std::function` that returns `true` if the given vertex is colored, `false` otherwise. - /// Returns `false` by default. - std::function is_vertex_colored; - - /// `std::function` that returns `true` if the given edge is colored, `false` otherwise. - /// Returns `false` by default. - std::function is_edge_colored; - - /// `std::function` that returns `true` if the given face is colored, `false` otherwise. - /// Returns `false` by default. - std::function is_face_colored; - - /// `std::function` that returns `true` if the given volume is colored, `false` otherwise. - /// Returns `false` by default. - /// Exists only if `VolumeDescriptor` is not `void`. - std::function is_volume_colored; - - /// `std::function` that returns `true` if the given face is in wireframe, `false` otherwise. - /// Returns `false` by default. - std::function is_face_wireframe; - - /// `std::function` that returns `true` if the given volume is in wireframe, `false` otherwise. - /// Returns `false` by default. - /// Exists only if `VolumeDescriptor` is not `void`. - std::function is_volume_wireframe; - - /// `std::function` that returns the color of the given vertex. - /// `nullptr` by default. - std::function vertex_color; - - /// `std::function` that returns the color of the given edge. - /// `nullptr` by default. - std::function edge_color; - - /// `std::function` that returns the color of the given face. - /// `nullptr` by default. - std::function face_color; - - /// `std::function` that returns the color of the given volume. - /// `nullptr` by default. - /// Exists only if `VolumeDescriptor` is not `void`. - std::function volume_color; - - /// ignores all vertices when `b` is `true`; otherwise ignores only vertices for which `ignore_vertex()` returns `true`. - void ignore_all_vertices(bool b); - - /// ignores all edges when `b` is `true`; otherwise ignores only edges for which `ignore_edge()` returns `true`. - void ignore_all_edges(bool b); - - /// ignores all faces when `b` is `true`; otherwise ignores only faces for which `ignore_face()` returns `true`. - void ignore_all_faces(bool b); - - /// ignores all volumes when `b` is `true`; otherwise ignore only volumes for which `ignore_volume()` returns `true`. - /// Exists only if `VolumeDescriptor` is not `void`. - void ignore_all_volumes(bool b); }; } // End namespace CGAL diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h index d1fab4746648..d33a29c49ce2 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h @@ -6,17 +6,14 @@ namespace CGAL { The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements can either be added directly in the viewer or through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam BufferType the number type used for point coordinates: `float` by default. - */ -template class Basic_viewer_qt : public CGAL::QGLViewer { public: /// Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphics_scene`. /// `title` will be the title of the window. Basic_viewer_qt(QWidget* parent, - const Graphics_scene& scene, + const Graphics_scene& scene, const char* title=""); /// enables or disables the drawing of vertices. @@ -122,7 +119,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer CGAL::Exact_predicates_inexact_constructions_kernel::Plane_3 clipping_plane() const; /// returns the graphics scene of the viewer. - const Graphics_scene& graphics_scene() const; + const Graphics_scene& graphics_scene() const; /// reverses all normals of vertices and faces. void reverse_all_normals(); @@ -135,7 +132,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// Function called when a key is pressed. Users can define their own function in order /// to add specific behavior. - std::function *)> on_key_pressed; + std::function on_key_pressed; }; @@ -145,30 +142,26 @@ class Basic_viewer_qt : public CGAL::QGLViewer The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The `QApplication` is created in the constructor, but started by the `run()` method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam BufferType the number type used for point coordinates: `float` by default. - */ -template class QApplication_and_basic_viewer { public: /// Constructor given a `Graphics_scene` and possibly a title. - QApplication_and_basic_viewer(const CGAL::Graphics_scene& buffer, + QApplication_and_basic_viewer(const CGAL::Graphics_scene& buffer, const char* title="CGAL Basic Viewer"); /// runs the `QApplication`, i.e., open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. void run(); /// returns a reference to the `Basic_viewer_qt` associated with this. - Basic_viewer_qt& basic_viewer(); + Basic_viewer_qt& basic_viewer(); }; //------------------------------------------------------------------------------ /*! opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition CGAL_USE_BASIC_VIEWER. */ -template -void draw_graphics_scene(const Graphics_scene& graphic_scene, +void draw_graphics_scene(const Graphics_scene& graphic_scene, const char *title="CGAL Basic Viewer") {} diff --git a/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h b/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h new file mode 100644 index 000000000000..edca770142ea --- /dev/null +++ b/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h @@ -0,0 +1,124 @@ +/*! +\ingroup PkgBasicViewerConcepts + +The concept `GraphicsSceneOptions` defines data and methods used to tune the way that the cells of a given data structure of \cgal are considered for drawing or to be added into a graphics scene. +The different `std::function` can be modified to change for example the behavior of the drawing. + +\cgalHasModelsBegin +\cgalHasModelsBare{\link CGAL::Graphics_scene_options `CGAL::Graphics_scene_options`\endlink} +\cgalHasModelsEnd + +*/ +class GraphicsSceneOptions +{ +public: + /*! + A data structure of \cgal. + */ + typedef unspecified_type DS; + + /*! + A descriptor of vertices of `DS` + */ + typedef unspecified_type VertexDescriptor; + + /*! + A descriptor of edges of `DS` + */ + typedef unspecified_type EdgeDescriptor; + + /*! + A descriptor of faces of `DS` + */ + typedef unspecified_type FaceDescriptor; + + /// `std::function` that returns `true` if the given vertex must be ignored, `false` otherwise. + /// Returns `false` by default. + std::function ignore_vertex; + + /// `std::function` that returns `true` if the given edge must be ignored, `false` otherwise. + /// Returns `true` by default. + std::function ignore_edge; + + /// `std::function` that returns `true` if the given face must be ignored, `false` otherwise. + /// Returns `true` by default. + std::function ignore_face; + + /// `std::function` that returns `true` if the given vertex is colored, `false` otherwise. + /// Returns `false` by default. + std::function is_vertex_colored; + + /// `std::function` that returns `true` if the given edge is colored, `false` otherwise. + /// Returns `false` by default. + std::function is_edge_colored; + + /// `std::function` that returns `true` if the given face is colored, `false` otherwise. + /// Returns `false` by default. + std::function is_face_colored; + + /// `std::function` that returns `true` if the given face is in wireframe, `false` otherwise. + /// Returns `false` by default. + std::function is_face_wireframe; + + /// `std::function` that returns the color of the given vertex. + /// `nullptr` by default. + std::function vertex_color; + + /// `std::function` that returns the color of the given edge. + /// `nullptr` by default. + std::function edge_color; + + /// `std::function` that returns the color of the given face. + /// `nullptr` by default. + std::function face_color; + + /// ignores all vertices when `b` is `true`; otherwise ignores only vertices for which `ignore_vertex()` returns `true`. + void ignore_all_vertices(bool b); + + /// ignores all edges when `b` is `true`; otherwise ignores only edges for which `ignore_edge()` returns `true`. + void ignore_all_edges(bool b); + + /// ignores all faces when `b` is `true`; otherwise ignores only faces for which `ignore_face()` returns `true`. + void ignore_all_faces(bool b); +}; + +/*! +\ingroup PkgBasicViewerConcepts +\cgalConcept + +The concept `GraphicsSceneOptionsWithVolumes` extends the concept `GraphicsSceneOptions` to deal with data structures that represent volumes. + +\cgalRefines{GraphicsSceneOptions} + +\cgalHasModelsBegin +\cgalHasModelsBare{\link CGAL::Graphics_scene_options `CGAL::Graphics_scene_options`\endlink} +\cgalHasModelsEnd + +*/ +class GraphicsSceneOptionsWithVolumes +{ +public: + /*! + %A descriptor of volumes of `DS`. + */ + typedef unspecified_type VolumeDescriptor; + + /// `std::function` that returns `true` if the given volume must be ignored, `false` otherwise. + /// Returns `false` by default. + std::function ignore_volume; + + /// `std::function` that returns `true` if the given volume is colored, `false` otherwise. + /// Returns `false` by default. + std::function is_volume_colored; + + /// `std::function` that returns `true` if the given volume is in wireframe, `false` otherwise. + /// Returns `false` by default. + std::function is_volume_wireframe; + + /// `std::function` that returns the color of the given volume. + /// `nullptr` by default. + std::function volume_color; + + /// ignores all volumes when `b` is `true`; otherwise ignore only volumes for which `ignore_volume()` returns `true`. + void ignore_all_volumes(bool b); +}; diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index a6dae494221b..500c9f32dfbf 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -1,5 +1,8 @@ /// \defgroup PkgBasicViewerRef Basic Viewer Reference +/// \defgroup PkgBasicViewerConcepts Concepts +/// \ingroup PkgBasicViewerRef + /// \defgroup PkgBasicViewerClasses Classes /// \ingroup PkgBasicViewerRef @@ -21,6 +24,10 @@ \cgalClassifedRefPages +\cgalCRPSection{Concepts} +- `GraphicsSceneOptions` +- `GraphicsSceneOptionsWithVolumes` + \cgalCRPSection{Classes} - `CGAL::Graphics_scene_options` - `CGAL::Graphics_scene` diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index fb5b68ce026c..cc14573bfbb2 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -9,37 +9,34 @@ A call to this function blocks the execution of the program until the drawing wi Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam T2 a triangulation class derived from `Triangulation_2` +\tparam Gt +\tparam Tds +\tparam GSOptions a model of `GraphicsSceneOptions` concept, `Graphics_scene_options` by defafult. + \param at2 the triangulation to draw. -\param gso the graphics scene options parameter, `Graphics_scene_options()` by default. +\param gso the graphics scene options parameter, `GSOptions()` by default. */ -template -void draw(const T2& at2, - const CGAL::Graphics_scene_options& gso=default); + template + void draw(const CGAL::Triangulation_2& at2, + const GSOptions& gso={}); /*! \ingroup PkgDrawTriangulation2 adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). -\tparam T2 a triangulation class derived from `Triangulation_2` -\tparam BufferType the number type used for point coordinates: `float` by default. +\tparam Gt +\tparam Tds +\tparam GSOptions a model of `GraphicsSceneOptions` concept, `Graphics_scene_options` by defafult. \param at2 the triangulation to draw. \param gs the graphic scene to fill. -\param gso the graphics scene options parameter, `Graphics_scene_options()` by default. - +\param gso the graphics scene options parameter, `GSOptions()` by default. */ -template -void add_to_graphics_scene(const T2& at2, +template +void add_to_graphics_scene(const CGAL::Triangulation_2& at2, CGAL::Graphics_scene& gs, - const CGAL::Graphics_scene_options& gso=default); + const GSOptions& gso={}); } /* namespace CGAL */ From 6daa2a0c3be5bb4800b688f200e3fc42bab1b5a8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 23 Oct 2023 01:30:57 +0200 Subject: [PATCH 219/399] Graphics_scene is no more templated --- .../include/CGAL/draw_arrangement_2.h | 2 +- .../include/CGAL/draw_polygon_set_2.h | 8 +++---- .../CGAL/draw_linear_cell_complex.h | 2 +- .../include/CGAL/draw_linear_cell_complex.h | 16 +++++++------- Nef_3/include/CGAL/draw_nef_3.h | 14 ++++++------ .../CGAL/draw_periodic_2_triangulation_2.h | 18 +++++++-------- Polygon/include/CGAL/draw_polygon_2.h | 10 ++++----- .../include/CGAL/draw_polygon_with_holes_2.h | 12 +++++----- .../include/CGAL/draw_straight_skeleton_2.h | 18 +++++++-------- .../include/CGAL/draw_face_graph_with_paths.h | 22 +++++++++---------- .../CGAL/draw_triangulation_2.h | 2 +- .../CGAL/draw_constrained_triangulation_2.h | 6 ++--- .../include/CGAL/draw_triangulation_2.h | 16 +++++++------- .../include/CGAL/draw_triangulation_3.h | 16 +++++++------- .../include/CGAL/draw_voronoi_diagram_2.h | 20 ++++++++--------- 15 files changed, 91 insertions(+), 91 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 ef3fcbcf9995..86edc7fa9e02 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -626,7 +626,7 @@ class Aos_2_basic_viewer_qt : public Basic_viewer_qt { Color_generator m_color_generator; std::unordered_map m_visited; - CGAL::Graphics_scene m_graphics_scene; + CGAL::Graphics_scene m_graphics_scene; }; //! Basic viewer of a 2D arrangement. diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index 6b0a117217f8..dae70337aea6 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -48,7 +48,7 @@ namespace draw_function_for_boolean_set_2 { template void compute_loop(const typename PS2::Polygon_2& p, bool hole, - CGAL::Graphics_scene& gs, + CGAL::Graphics_scene& gs, const GSOptions& gso) { if (hole) @@ -73,7 +73,7 @@ void compute_loop(const typename PS2::Polygon_2& p, bool hole, /// Compute the elements of a polygon with holes. template void compute_elements(const PWH& pwh, - CGAL::Graphics_scene& gs, + CGAL::Graphics_scene& gs, const GSOptions& gso) { if (!gso.draw_unbounded() && pwh.outer_boundary().is_empty()) return; @@ -123,7 +123,7 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt public: Polygon_set_2_basic_viewer_qt(QWidget* parent, const Ps& ps, - Graphics_scene& gs, + Graphics_scene& gs, GSOptions& gs_options, const char* title = "Basic Polygon_set_2 Viewer", bool draw_unbounded = false, @@ -226,7 +226,7 @@ void draw(const CGAL::Polygon_set_2& ps, int argc = 1; const char* argv[2] = {"t2_viewer", nullptr}; QApplication app(argc, const_cast(argv)); - Graphics_scene gs; + Graphics_scene gs; Graphics_scene_options gs; Viewer basic_viewer(app.activeWindow(), ps, gs, gso, title, draw_unbounded, draw_vertices); diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index 38a33ace8013..f42aa4256d0e 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -30,7 +30,7 @@ Add in the given graphics scene the elements of alcc. */ template - void add_in_graphics_scene(const LCC& alcc, CGAL::Graphics_scene& graphics_scene, + void add_in_graphics_scene(const LCC& alcc, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options=GSOptions()); } /* namespace CGAL */ 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 a288dc68b5c7..b80d10549b8a 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -61,7 +61,7 @@ template void compute_face(const LCC& lcc, typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptionsLCC& gs_options) { if (!gs_options.are_faces_enabled() || @@ -105,7 +105,7 @@ void compute_face(const LCC& lcc, template void compute_edge(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.are_edges_enabled() || @@ -129,7 +129,7 @@ void compute_edge(const LCC& lcc, template void compute_vertex(const LCC& lcc, typename LCC::Dart_const_handle dh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptionsLCC& gs_options) { if (!gs_options.are_vertices_enabled() || @@ -147,7 +147,7 @@ void compute_vertex(const LCC& lcc, template void compute_elements(const LCC& lcc, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { typename LCC::size_type markvolumes = lcc.get_new_mark(); @@ -240,7 +240,7 @@ template void add_in_graphics_scene(const CGAL_LCC_TYPE& alcc, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_lcc::compute_elements(static_cast(alcc), @@ -254,7 +254,7 @@ template class Map, class Refs, class Storage_, typename BufferType=float> void add_in_graphics_scene(const CGAL_LCC_TYPE& alcc, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(alcc, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -300,7 +300,7 @@ template void draw(const CGAL_LCC_TYPE& alcc, const char *title="LCC Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(alcc, buffer); draw_graphics_scene(buffer, title); } diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 594f48b4d4d9..e05a94081a35 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -95,7 +95,7 @@ class Nef_Visitor { public: Nef_Visitor(const Nef_Polyhedron&_nef, - CGAL::Graphics_scene& _graphics_scene, + CGAL::Graphics_scene& _graphics_scene, const GSOptions&_gs_options) : n_faces(0), n_edges(0), nef(_nef), @@ -207,14 +207,14 @@ class Nef_Visitor { protected: std::unordered_map facets_done; std::unordered_map edges_done; - CGAL::Graphics_scene& graphics_scene; + CGAL::Graphics_scene& graphics_scene; const GSOptions& gs_options; const Nef_Polyhedron& nef; }; template void compute_elements(const Nef_Polyhedron &nef, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { @@ -243,7 +243,7 @@ void compute_elements(const Nef_Polyhedron &nef, template void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { draw_function_for_nef_polyhedron::compute_elements(anef, @@ -254,7 +254,7 @@ void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, template void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, - CGAL::Graphics_scene &graphics_scene) + CGAL::Graphics_scene &graphics_scene) { // Default graphics view options. Graphics_scene_options buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(anef, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -299,7 +299,7 @@ template buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(anef, buffer); draw_graphics_scene(buffer, title); } diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 756ecdd24ba0..381031c47b71 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -69,7 +69,7 @@ namespace draw_function_for_P2T2 template void compute_vertex(const P2T2 &p2t2, typename P2T2::Periodic_point_iterator pi, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { // Construct the point in 9-sheeted covering space and add to viewer @@ -86,7 +86,7 @@ void compute_vertex(const P2T2 &p2t2, template void compute_edge(const P2T2 &p2t2, typename P2T2::Periodic_segment_iterator si, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if(!gs_options.draw_edge(p2t2, si)) @@ -104,7 +104,7 @@ void compute_edge(const P2T2 &p2t2, template void compute_face(const P2T2 &p2t2, typename P2T2::Periodic_triangle_iterator ti, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if(!gs_options.draw_face(p2t2, ti)) @@ -126,7 +126,7 @@ void compute_face(const P2T2 &p2t2, template void compute_domain(const P2T2& p2t2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -155,7 +155,7 @@ void compute_domain(const P2T2& p2t2, template void compute_elements(const P2T2& p2t2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { // Get the display type, iterate through periodic elements according @@ -198,7 +198,7 @@ void compute_elements(const P2T2& p2t2, template void add_in_graphics_scene(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_P2T2::compute_elements(p2t2, graphics_scene, gs_options); @@ -206,7 +206,7 @@ void add_in_graphics_scene(const CGAL_P2T2_TYPE& p2t2, template void add_in_graphics_scene(const CGAL_P2T2_TYPE& p2t2, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options_periodic_2_triangulation_2 buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(ap2t2, buffer, gs_options); draw_graphics_scene(buffer); } @@ -234,7 +234,7 @@ template void draw(const CGAL_P2T2_TYPE& ap2t2, const char* title="2D Periodic Triangulation Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; CGAL::Graphics_scene_options_periodic_2_triangulation_2 void compute_elements(const P2& p2, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const GSOptions& gs_options) { if (p2.is_empty()) @@ -103,13 +103,13 @@ void compute_elements(const P2& p2, template void add_in_graphics_scene(const CGAL_P2_TYPE& ap2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_p2::compute_elements(ap2, graphics_scene, gs_options); } template void add_in_graphics_scene(const CGAL_P2_TYPE& ap2, - CGAL::Graphics_scene &graphics_scene) + CGAL::Graphics_scene &graphics_scene) { CGAL::Graphics_scene_options void draw(const CGAL_P2_TYPE &ap2, const char *title="Polygon_2 Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(ap2, buffer); draw_graphics_scene(buffer, title); } @@ -136,7 +136,7 @@ void draw(const CGAL_P2_TYPE &ap2, const GSOptions& gs_options, const char *title="Polygon_2 Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(ap2, buffer, gs_options); draw_graphics_scene(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 9889a0639547..75faaf8c6c79 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -55,7 +55,7 @@ namespace draw_function_for_ph2_with_holes { template void compute_one_loop_elements(const P2& ap2, const typename P2::General_polygon_2& aloop, - Graphics_scene &graphics_scene, + Graphics_scene &graphics_scene, bool hole, const GSOptions& gs_options) { @@ -98,7 +98,7 @@ void compute_one_loop_elements(const P2& ap2, } template -void compute_elements(const P2& p2, Graphics_scene &graphics_scene, +void compute_elements(const P2& p2, Graphics_scene &graphics_scene, const GSOptions& gs_options) { if (p2.outer_boundary().is_empty()) return; @@ -134,7 +134,7 @@ void compute_elements(const P2& p2, Graphics_scene &graphics_scene, template void add_in_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions &gs_options) { draw_function_for_ph2_with_holes::compute_elements(p2, graphics_scene, @@ -143,7 +143,7 @@ void add_in_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, template void add_in_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const GSOptions &gs_options, const char* title="Polygon with Holes Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(ap2, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -169,7 +169,7 @@ template void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const char* title="Polygon with Holes Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(ap2, buffer); draw_graphics_scene(buffer, title); } diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 4be05c54ba9f..104a4fa52cb7 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -26,7 +26,7 @@ namespace draw_function_for_ss2 { template void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_edge(ss2, eh)) @@ -48,7 +48,7 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, template void print_halfedge_labels(const SS2& ss2, typename SS2::Halfedge_const_handle h, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { // TODO? an option different from draw_edge to allow to show only some labels ?? @@ -67,7 +67,7 @@ void print_halfedge_labels(const SS2& ss2, template void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_vertex(ss2, vh)) @@ -84,7 +84,7 @@ void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, template void print_vertex_label(const SS2& ss2, typename SS2::Vertex_const_handle vh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { // TODO? an option different from draw_vertex to allow to show only some labels ?? @@ -98,7 +98,7 @@ void print_vertex_label(const SS2& ss2, template void compute_elements(const SS2& ss2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.are_edges_enabled()) @@ -131,7 +131,7 @@ void compute_elements(const SS2& ss2, template void add_in_graphics_scene(const CGAL_SS_TYPE &ass2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_ss2::compute_elements(ass2, graphics_scene, @@ -140,7 +140,7 @@ void add_in_graphics_scene(const CGAL_SS_TYPE &ass2, template void add_in_graphics_scene(const CGAL_SS_TYPE& ass2, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options void draw(const CGAL_SS_TYPE &ass2, const GSOptions &gs_options, const char *title="Straight Skeleton Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(ass2, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -195,7 +195,7 @@ template void draw(const CGAL_SS_TYPE &ass2, const char *title="Straight Skeleton Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(ass2, buffer); draw_graphics_scene(buffer, title); } diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 76135c4e682a..d354ab745319 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -145,7 +145,7 @@ template void compute_face(const Mesh& mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options) { if(!gs_options.draw_face(lcc, dh)) @@ -193,7 +193,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, typename Get_map::type::size_type m_amark, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options, bool draw_marked_darts=true) { @@ -224,7 +224,7 @@ void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, const CGAL::IO::Color& color, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { typedef typename Get_map::type LCC; typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; @@ -241,7 +241,7 @@ void compute_edge(const Mesh &mesh, template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options) { typedef typename CGAL::Get_traits::Kernel Kernel; @@ -253,7 +253,7 @@ void compute_vertex(const Mesh &mesh, template void compute_path(const Mesh &mesh, const typename Get_map::storage_type& lcc, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const std::vector>* m_paths, std::size_t i, typename Get_map::type::size_type amark) @@ -282,7 +282,7 @@ void compute_path(const Mesh &mesh, template void compute_elements(const Mesh &mesh, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const GSOptions &m_gs_options, const std::vector>* m_paths, typename Get_map::type::size_type amark) @@ -371,7 +371,7 @@ void compute_elements(const Mesh &mesh, template void add_in_graphics_scene(const Mesh& mesh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const std::vector>* paths, const GSOptions& gs_options, typename Get_map::type::size_type amark= @@ -385,7 +385,7 @@ void add_in_graphics_scene(const Mesh& mesh, template void add_in_graphics_scene(const Mesh& mesh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const std::vector>* paths, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) @@ -409,7 +409,7 @@ void draw(const Mesh& mesh, (std::numeric_limits::type::size_type>::max)(), const char* title="Mesh Viewer With Path") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(mesh, buffer, &paths, amark); draw_graphics_scene(buffer, title); } @@ -422,7 +422,7 @@ void draw(const Mesh& mesh, (std::numeric_limits::type::size_type>::max)(), const char* title="Mesh Viewer With Path") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(mesh, buffer, gs_options, &paths, amark); draw_graphics_scene(buffer, title); } @@ -435,7 +435,7 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { std::vector> paths=l; - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(mesh, buffer, &paths, amark); draw_graphics_scene(buffer, title); } diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index cc14573bfbb2..e46d9faebae1 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -36,7 +36,7 @@ adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. P */ template void add_to_graphics_scene(const CGAL::Triangulation_2& at2, - CGAL::Graphics_scene& gs, + CGAL::Graphics_scene& gs, const GSOptions& gso={}); } /* namespace CGAL */ diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index eb7b4e8d72f1..99e6aee57278 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -28,7 +28,7 @@ namespace CGAL template void add_in_graphics_scene(const CGAL_T2_TYPE& at2, InDomainPmap ipm, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { using BASET2=CGAL::Triangulation_2; @@ -59,7 +59,7 @@ void add_in_graphics_scene(const CGAL_T2_TYPE& at2, InDomainPmap ipm, template void add_in_graphics_scene(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { internal::In_domain in_domain; add_in_graphics_scene(at2, in_domain, graphics_scene); @@ -69,7 +69,7 @@ template void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm, const char *title="Constrained Triangulation_2 Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(at2, ipm, buffer); draw_graphics_scene(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 6865cc54f436..747c2348e1fb 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -27,7 +27,7 @@ namespace draw_function_for_t2 { template void compute_face(const T2& t2, typename T2::Finite_faces_iterator fh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_face(t2, fh)) @@ -47,7 +47,7 @@ void compute_face(const T2& t2, template void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_edge(t2, eh)) @@ -70,7 +70,7 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, template void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (!gs_options.draw_vertex(t2, vh)) @@ -88,7 +88,7 @@ void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, template void compute_elements(const T2& t2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (gs_options.are_faces_enabled()) @@ -119,7 +119,7 @@ void compute_elements(const T2& t2, template void add_in_graphics_scene(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const CGAL::Graphics_scene_options void add_in_graphics_scene(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options void draw(const CGAL_T2_TYPE &at2, const GSOptions &gs_options, const char *title="Triangulation_2 Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(at2, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -168,7 +168,7 @@ template void draw(const CGAL_T2_TYPE& at2, const char *title="Triangulation_2 Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(at2, buffer); draw_graphics_scene(buffer, title); } diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 7d59f696eb8e..22819f1c235a 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -28,7 +28,7 @@ namespace draw_function_for_t3 template void compute_face(typename T3::Finite_facets_iterator fh, const GSOptions& gs_options, - CGAL::Graphics_scene& graphics_scene, const T3 *t3) + CGAL::Graphics_scene& graphics_scene, const T3 *t3) { if(!gs_options.draw_face(*t3, fh)) { return; } @@ -50,7 +50,7 @@ void compute_face(typename T3::Finite_facets_iterator fh, template void compute_edge(typename T3::Finite_edges_iterator eh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options, const T3* t3) { if(!gs_options.draw_edge(*t3, eh)) @@ -70,7 +70,7 @@ void compute_edge(typename T3::Finite_edges_iterator eh, template void compute_vertex(typename T3::Vertex_handle vh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options, const T3* t3) { if(!gs_options.draw_vertex(*t3, vh)) @@ -86,7 +86,7 @@ void compute_vertex(typename T3::Vertex_handle vh, template void compute_elements(const T3* t3, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if (gs_options.are_faces_enabled()) @@ -118,7 +118,7 @@ void compute_elements(const T3* t3, template void add_in_graphics_scene(const CGAL_T3_TYPE& at3, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_t3::compute_elements(&at3, graphics_scene, gs_options); @@ -127,7 +127,7 @@ void add_in_graphics_scene(const CGAL_T3_TYPE& at3, template void add_in_graphics_scene(const CGAL_T3_TYPE& at3, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options void draw(const CGAL_T3_TYPE &at3, const GSOptions &gs_options, const char *title="T3 Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(at3, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -169,7 +169,7 @@ void draw(const CGAL_T3_TYPE &at3, const GSOptions &gs_options, template void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(at3, buffer); draw_graphics_scene(buffer, title); } diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index e7286b0c0d93..f14c9403412d 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -72,7 +72,7 @@ typedef Local_kernel::Vector_3 Local_vector; template void compute_vertex(const V2& v2, typename V2::Vertex_iterator vh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if(!gs_options.draw_vertex(v2, vh)) @@ -87,14 +87,14 @@ void compute_vertex(const V2& v2, template void compute_dual_vertex(const V2& /*v2*/, typename V2::Delaunay_graph::Finite_vertices_iterator vi, - CGAL::Graphics_scene &graphics_scene, + CGAL::Graphics_scene &graphics_scene, const GSOptions& gs_options) { graphics_scene.add_point(vi->point(), gs_options.dual_vertex_color); } template void add_segments_and_update_bounding_box(const V2& v2, typename V2::Halfedge_iterator he, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -224,7 +224,7 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, template void compute_rays_and_bisectors(const V2&, typename V2::Halfedge_iterator he, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -254,7 +254,7 @@ void compute_rays_and_bisectors(const V2&, template void compute_face(const V2& v2, typename V2::Face_iterator fh, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& m_gs_options) { if(fh->is_unbounded() || !m_gs_options.draw_face(v2, fh)) @@ -288,7 +288,7 @@ void compute_face(const V2& v2, template void compute_elements(const V2& v2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { if(gs_options.are_vertices_enabled()) @@ -338,7 +338,7 @@ void compute_elements(const V2& v2, template void add_in_graphics_scene(const CGAL_VORONOI_TYPE &v2, - CGAL::Graphics_scene& graphics_scene, + CGAL::Graphics_scene& graphics_scene, const GSOptions& m_gs_options) { draw_function_for_v2::compute_elements(v2, graphics_scene, m_gs_options); @@ -346,7 +346,7 @@ void add_in_graphics_scene(const CGAL_VORONOI_TYPE &v2, template void add_in_graphics_scene(const CGAL_VORONOI_TYPE& v2, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { // Default graphics view options. CGAL::Graphics_scene_options_voronoi buffer; + CGAL::Graphics_scene buffer; add_in_graphics_scene(av2, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -376,7 +376,7 @@ template void draw(const CGAL_VORONOI_TYPE& av2, const char *title="2D Voronoi Diagram Basic Viewer") { - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene buffer; CGAL::Graphics_scene_options_voronoi Date: Mon, 23 Oct 2023 01:35:11 +0200 Subject: [PATCH 220/399] Basic_viewer_qt is no more templated --- Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h | 2 +- Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h | 6 +++--- .../include/CGAL/draw_periodic_2_triangulation_2.h | 2 +- Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h | 2 +- 4 files changed, 6 insertions(+), 6 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 86edc7fa9e02..6aa3b9fcd1c7 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -50,7 +50,7 @@ struct Default_color_generator { // Viewer class for`< Polygon_2 template -class Aos_2_basic_viewer_qt : public Basic_viewer_qt { +class Aos_2_basic_viewer_qt : public Basic_viewer_qt { using Aos = ArrangementOnSurface_2; using Color_generator = ColorGenerator; using Base = Basic_viewer_qt; diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index dae70337aea6..376bf8540e2c 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -112,10 +112,10 @@ void compute_elements(const PWH& pwh, #ifdef CGAL_USE_BASIC_VIEWER -template -class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt +template +class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt { - using Base = Basic_viewer_qt; + using Base = Basic_viewer_qt; using Ps = PolygonSet_2; using Pwh = typename Ps::Polygon_with_holes_2; using Pgn = typename Ps::Polygon_2; diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 381031c47b71..fb86c03e7a0a 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -247,7 +247,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&ap2t2, &gs_options] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&ap2t2, &gs_options] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index f14c9403412d..2517c302a06c 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -391,7 +391,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&av2, &gs_options] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&av2, &gs_options] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) From 761fde02bef8d5de0e79957d741f3cb65d7029d3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 23 Oct 2023 01:52:38 +0200 Subject: [PATCH 221/399] add_in_graphics_scene -> add_to_graphics_scene; plus remove template parameter NumberType --- BGL/include/CGAL/draw_face_graph.h | 6 +- .../include/CGAL/draw_polygon_set_2.h | 22 +++---- .../CGAL/draw_linear_cell_complex.h | 5 +- .../include/CGAL/draw_linear_cell_complex.h | 26 ++++----- Nef_3/include/CGAL/draw_nef_3.h | 28 +++++---- .../CGAL/draw_periodic_2_triangulation_2.h | 28 ++++----- Point_set_3/include/CGAL/draw_point_set_3.h | 10 ++-- Polygon/include/CGAL/draw_polygon_2.h | 16 ++--- .../include/CGAL/draw_polygon_with_holes_2.h | 30 +++++----- Polyhedron/include/CGAL/draw_polyhedron.h | 14 ++--- .../include/CGAL/draw_straight_skeleton_2.h | 24 ++++---- Surface_mesh/include/CGAL/draw_surface_mesh.h | 12 ++-- .../include/CGAL/draw_face_graph_with_paths.h | 58 +++++++++---------- .../CGAL/draw_constrained_triangulation_2.h | 14 ++--- .../include/CGAL/draw_triangulation_2.h | 22 +++---- .../include/CGAL/draw_triangulation_3.h | 23 ++++---- .../include/CGAL/draw_voronoi_diagram_2.h | 32 +++++----- 17 files changed, 182 insertions(+), 188 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index 20f4cf12899f..f7d95b45d35f 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -119,7 +119,7 @@ void compute_elements(const FG &fg, } // draw_function_for_FG template -void add_in_graphics_scene_for_fg(const FG &fg, +void add_to_graphics_scene_for_fg(const FG &fg, CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { @@ -127,7 +127,7 @@ void add_in_graphics_scene_for_fg(const FG &fg, } template -void add_in_graphics_scene_for_fg(const FG &fg, +void add_to_graphics_scene_for_fg(const FG &fg, CGAL::Graphics_scene &graphics_scene) { Graphics_scene_options + +template void compute_loop(const typename PS2::Polygon_2& p, bool hole, CGAL::Graphics_scene& gs, const GSOptions& gso) { if (hole) { gs.add_point_in_face(p.vertex(p.size()-1)); } - + auto prev = p.vertices_begin(); auto it = prev; gs.add_point(*it); @@ -65,22 +65,22 @@ void compute_loop(const typename PS2::Polygon_2& p, bool hole, gs.add_point_in_face(*it); // add point in face prev = it; } - + // Add the last segment between the last point and the first one gs.add_segment(*prev, *(p.vertices_begin())); } /// Compute the elements of a polygon with holes. -template +template void compute_elements(const PWH& pwh, CGAL::Graphics_scene& gs, const GSOptions& gso) { if (!gso.draw_unbounded() && pwh.outer_boundary().is_empty()) return; - + CGAL::IO::Color c(75,160,255); gs.face_begin(c); - + const typename PWH::Point_2* point_in_face; if (pwh.outer_boundary().is_empty()) { @@ -104,12 +104,12 @@ void compute_elements(const PWH& pwh, compute_loop(*it, true, gs); gs.add_point_in_face(*point_in_face); } - + gs.face_end(); } - + } // End namespace draw_function_for_boolean_set_2 - + #ifdef CGAL_USE_BASIC_VIEWER template @@ -218,7 +218,7 @@ void draw(const CGAL::Polygon_set_2& ps, bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif - if (! cgal_test_suite) + if (! cgal_test_suite) { using Ps = CGAL::Polygon_set_2; using Viewer = Polygon_set_2_basic_viewer_qt; diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index f42aa4256d0e..6f6041e94004 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -21,7 +21,6 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5 Add in the given graphics scene the elements of alcc. \tparam LCC a model of the `LinearCellComplex` concept. -\tparam BufferType the number type used for point coordinates: `float` by default. \tparam GSOptions a class having the same methods than `Graphics_scene_options`: `Graphics_scene_options` by default. \param alcc the linear cell complex to draw. @@ -29,8 +28,8 @@ Add in the given graphics scene the elements of alcc. \param gs_options graphics scene options. */ - template - void add_in_graphics_scene(const LCC& alcc, CGAL::Graphics_scene& graphics_scene, + template + void add_to_graphics_scene(const LCC& alcc, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options=GSOptions()); } /* namespace CGAL */ 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 b80d10549b8a..bb21109dceaa 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -57,7 +57,7 @@ struct LCC_geom_utils } }; -template +template void compute_face(const LCC& lcc, typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, @@ -102,7 +102,7 @@ void compute_face(const LCC& lcc, graphics_scene.face_end(); } -template +template void compute_edge(const LCC& lcc, typename LCC::Dart_const_handle dh, CGAL::Graphics_scene& graphics_scene, @@ -126,7 +126,7 @@ void compute_edge(const LCC& lcc, } } -template +template void compute_vertex(const LCC& lcc, typename LCC::Dart_const_handle dh, CGAL::Graphics_scene& graphics_scene, @@ -145,7 +145,7 @@ void compute_vertex(const LCC& lcc, { graphics_scene.add_point(lcc.point(dh)); } } -template +template void compute_elements(const LCC& lcc, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -232,14 +232,14 @@ void compute_elements(const LCC& lcc, CGAL::Linear_cell_complex_base -// add_in_graphics_scene: to add a LCC in the given graphic buffer, with a +// add_to_graphics_scene: to add a LCC in the given graphic buffer, with a // graphics scene options. template class Map, class Refs, class Storage_, - typename BufferType=float, class GSOptions> -void add_in_graphics_scene(const CGAL_LCC_TYPE& alcc, + class GSOptions> +void add_to_graphics_scene(const CGAL_LCC_TYPE& alcc, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { @@ -247,13 +247,13 @@ void add_in_graphics_scene(const CGAL_LCC_TYPE& alcc, graphics_scene, gs_options); } -// add_in_graphics_scene: to add a LCC in the given graphic buffer, without a +// add_to_graphics_scene: to add a LCC in the given graphic buffer, without a // graphics scene options. Use default drawing values. template class Map, - class Refs, class Storage_, typename BufferType=float> -void add_in_graphics_scene(const CGAL_LCC_TYPE& alcc, + class Refs, class Storage_> +void add_to_graphics_scene(const CGAL_LCC_TYPE& alcc, CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options +template class Nef_Visitor { typedef typename Nef_Polyhedron::Halfedge_const_handle Halfedge_const_handle; @@ -212,7 +212,7 @@ class Nef_Visitor { const Nef_Polyhedron& nef; }; -template +template void compute_elements(const Nef_Polyhedron &nef, CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) @@ -223,7 +223,7 @@ void compute_elements(const Nef_Polyhedron &nef, typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; Volume_const_iterator c; - Nef_Visitor + Nef_Visitor V(nef, graphics_scene, gs_options); CGAL_forall_volumes(c, nef) { @@ -239,10 +239,10 @@ void compute_elements(const Nef_Polyhedron &nef, #define CGAL_NEF3_TYPE Nef_polyhedron_3 -// add_in_graphics_scene +// add_to_graphics_scene template -void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, + class GSOptions> +void add_to_graphics_scene(const CGAL_NEF3_TYPE &anef, CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) { @@ -251,9 +251,8 @@ void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, gs_options); } -template -void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, +template +void add_to_graphics_scene(const CGAL_NEF3_TYPE &anef, CGAL::Graphics_scene &graphics_scene) { // Default graphics view options. @@ -277,30 +276,29 @@ void add_in_graphics_scene(const CGAL_NEF3_TYPE &anef, return get_random_color(random); }; - add_in_graphics_scene(anef, graphics_scene, gs_options); + add_to_graphics_scene(anef, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function template + class GSOptions> void draw(const CGAL_NEF3_TYPE &anef, const GSOptions &gs_options, const char *title="Nef Polyhedron Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(anef, buffer, gs_options); + add_to_graphics_scene(anef, buffer, gs_options); draw_graphics_scene(buffer, title); } -template +template void draw(const CGAL_NEF3_TYPE &anef, const char *title="Nef Polyhedron Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(anef, buffer); + add_to_graphics_scene(anef, buffer); draw_graphics_scene(buffer, title); } diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index fb86c03e7a0a..e11fb2baaffa 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -66,7 +66,7 @@ struct Graphics_scene_options_periodic_2_triangulation_2 : namespace draw_function_for_P2T2 { -template +template void compute_vertex(const P2T2 &p2t2, typename P2T2::Periodic_point_iterator pi, CGAL::Graphics_scene& graphics_scene, @@ -83,7 +83,7 @@ void compute_vertex(const P2T2 &p2t2, { graphics_scene.add_point(p2t2.point(*pi)); } } -template +template void compute_edge(const P2T2 &p2t2, typename P2T2::Periodic_segment_iterator si, CGAL::Graphics_scene& graphics_scene, @@ -101,7 +101,7 @@ void compute_edge(const P2T2 &p2t2, { graphics_scene.add_segment(s[0], s[1]); } } -template +template void compute_face(const P2T2 &p2t2, typename P2T2::Periodic_triangle_iterator ti, CGAL::Graphics_scene& graphics_scene, @@ -124,7 +124,7 @@ void compute_face(const P2T2 &p2t2, graphics_scene.face_end(); } -template +template void compute_domain(const P2T2& p2t2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -153,7 +153,7 @@ void compute_domain(const P2T2& p2t2, } } -template +template void compute_elements(const P2T2& p2t2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -196,16 +196,16 @@ void compute_elements(const P2T2& p2t2, #define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 -template -void add_in_graphics_scene(const CGAL_P2T2_TYPE& p2t2, +template +void add_to_graphics_scene(const CGAL_P2T2_TYPE& p2t2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_P2T2::compute_elements(p2t2, graphics_scene, gs_options); } -template -void add_in_graphics_scene(const CGAL_P2T2_TYPE& p2t2, +template +void add_to_graphics_scene(const CGAL_P2T2_TYPE& p2t2, CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options_periodic_2_triangulation_2 @@ -214,23 +214,23 @@ void add_in_graphics_scene(const CGAL_P2T2_TYPE& p2t2, typename CGAL_P2T2_TYPE::Periodic_segment_iterator, typename CGAL_P2T2_TYPE::Periodic_triangle_iterator> gs_options; - add_in_graphics_scene(p2t2, graphics_scene, gs_options); + add_to_graphics_scene(p2t2, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function -template +template void draw(const CGAL_P2T2_TYPE& ap2t2, const GSOptions& gs_options, const char* title="2D Periodic Triangulation Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(ap2t2, buffer, gs_options); + add_to_graphics_scene(ap2t2, buffer, gs_options); draw_graphics_scene(buffer); } -template +template void draw(const CGAL_P2T2_TYPE& ap2t2, const char* title="2D Periodic Triangulation Viewer") { @@ -241,7 +241,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, typename CGAL_P2T2_TYPE::Periodic_segment_iterator, typename CGAL_P2T2_TYPE::Periodic_triangle_iterator> gs_options; - add_in_graphics_scene(ap2t2, buffer, gs_options); + add_to_graphics_scene(ap2t2, buffer, gs_options); QApplication_and_basic_viewer app(buffer, title); if(app) { 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 c1f9ccbcca61..13fefed8a391 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -69,7 +69,7 @@ void compute_elements(const PointSet& pointset, } // namespace draw_function_for_PointSet template -void add_in_graphics_scene(const Point_set_3& apointset, +void add_to_graphics_scene(const Point_set_3& apointset, Graphics_scene& graphics_scene, const GSOptions& gs_options) { @@ -79,13 +79,13 @@ void add_in_graphics_scene(const Point_set_3& apointset, } template -void add_in_graphics_scene(const Point_set_3& apointset, +void add_to_graphics_scene(const Point_set_3& apointset, Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options, typename Point_set_3::const_iterator, int, int> gs_options; - add_in_graphics_scene(apointset, graphics_scene, gs_options); + add_to_graphics_scene(apointset, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER @@ -97,7 +97,7 @@ void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { Graphics_scene buffer; - add_in_graphics_scene(apointset, buffer, gs_options); + add_to_graphics_scene(apointset, buffer, gs_options); draw_graphics_scene(buffer, title); } @@ -106,7 +106,7 @@ void draw(const Point_set_3& apointset, const char *title="Point_set_3 Basic Viewer") { Graphics_scene buffer; - add_in_graphics_scene(apointset, buffer); + add_to_graphics_scene(apointset, buffer); draw_graphics_scene(buffer, title); } diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 8184f6258b89..971c84ddce4a 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -46,7 +46,7 @@ namespace CGAL { namespace draw_function_for_p2 { -template +template void compute_elements(const P2& p2, CGAL::Graphics_scene &graphics_scene, const GSOptions& gs_options) @@ -99,16 +99,16 @@ void compute_elements(const P2& p2, #define CGAL_P2_TYPE CGAL::Polygon_2 -// Specializations of add_in_graphics_scene function +// Specializations of add_to_graphics_scene function -template -void add_in_graphics_scene(const CGAL_P2_TYPE& ap2, +template +void add_to_graphics_scene(const CGAL_P2_TYPE& ap2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_p2::compute_elements(ap2, graphics_scene, gs_options); } -template -void add_in_graphics_scene(const CGAL_P2_TYPE& ap2, +template +void add_to_graphics_scene(const CGAL_P2_TYPE& ap2, CGAL::Graphics_scene &graphics_scene) { CGAL::Graphics_scene_options +template void compute_one_loop_elements(const P2& ap2, const typename P2::General_polygon_2& aloop, Graphics_scene &graphics_scene, @@ -97,7 +97,7 @@ void compute_one_loop_elements(const P2& ap2, { graphics_scene.add_segment(*prev, *(aloop.vertices_begin())); } } -template +template void compute_elements(const P2& p2, Graphics_scene &graphics_scene, const GSOptions& gs_options) { @@ -111,13 +111,13 @@ void compute_elements(const P2& p2, Graphics_scene &graphics_scene, { graphics_scene.face_begin(); } } - compute_one_loop_elements(p2, p2.outer_boundary(), graphics_scene, - false, gs_options); + compute_one_loop_elements(p2, p2.outer_boundary(), graphics_scene, + false, gs_options); for (typename P2::Hole_const_iterator it=p2.holes_begin(); it!=p2.holes_end(); ++it) { - compute_one_loop_elements(p2, *it, graphics_scene, - true, gs_options); + compute_one_loop_elements(p2, *it, graphics_scene, + true, gs_options); if (gs_options.are_faces_enabled()) { graphics_scene.add_point_in_face(p2.outer_boundary().vertex (p2.outer_boundary().size()-1)); @@ -132,8 +132,8 @@ void compute_elements(const P2& p2, Graphics_scene &graphics_scene, #define CGAL_P2_WITH_HOLES_TYPE CGAL::Polygon_with_holes_2 -template -void add_in_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, +template +void add_to_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, CGAL::Graphics_scene& graphics_scene, const GSOptions &gs_options) { @@ -141,8 +141,8 @@ void add_in_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, gs_options); } -template -void add_in_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, +template +void add_to_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2, CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options gs_options; - add_in_graphics_scene(p2, graphics_scene, gs_options); + add_to_graphics_scene(p2, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. -template +template void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const GSOptions &gs_options, const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(ap2, buffer, gs_options); + add_to_graphics_scene(ap2, buffer, gs_options); draw_graphics_scene(buffer, title); } -template +template void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const char* title="Polygon with Holes Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(ap2, buffer); + add_to_graphics_scene(ap2, buffer); draw_graphics_scene(buffer, title); } diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 5043f0d7ef7b..37d090cabb76 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -26,26 +26,26 @@ namespace CGAL #define CGAL_POLY_TYPE CGAL::Polyhedron_3 \ -// Specialization of add_in_graphics_scene function. +// Specialization of add_to_graphics_scene function. template class T_HDS, class Alloc, class GSOptions> -void add_in_graphics_scene(const CGAL_POLY_TYPE& apoly, +void add_to_graphics_scene(const CGAL_POLY_TYPE& apoly, CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) -{ add_in_graphics_scene_for_fg(apoly, graphics_scene, gs_options); } +{ add_to_graphics_scene_for_fg(apoly, graphics_scene, gs_options); } template class T_HDS, class Alloc> -void add_in_graphics_scene(const CGAL_POLY_TYPE& apoly, +void add_to_graphics_scene(const CGAL_POLY_TYPE& apoly, CGAL::Graphics_scene &graphics_scene) -{ add_in_graphics_scene_for_fg(apoly, graphics_scene); } +{ add_to_graphics_scene_for_fg(apoly, graphics_scene); } // Specialization of draw function: require Qt and the CGAL basic viewer. #ifdef CGAL_USE_BASIC_VIEWER @@ -59,7 +59,7 @@ void draw(const CGAL_POLY_TYPE& apoly, const char* title="Polyhedron Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene_for_fg(apoly, buffer); + add_to_graphics_scene_for_fg(apoly, buffer); draw_graphics_scene(buffer, title); } @@ -74,7 +74,7 @@ void draw(const CGAL_POLY_TYPE& apoly, const char* title="Polyhedron Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene_for_fg(apoly, buffer, gs_options); + add_to_graphics_scene_for_fg(apoly, buffer, gs_options); draw_graphics_scene(buffer, title); } #endif // CGAL_USE_BASIC_VIEWER diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 104a4fa52cb7..d4766f5a903c 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -24,7 +24,7 @@ namespace CGAL { namespace draw_function_for_ss2 { -template +template void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -45,7 +45,7 @@ void compute_edge(const SS2& ss2, typename SS2::Halfedge_const_handle eh, } } -template +template void print_halfedge_labels(const SS2& ss2, typename SS2::Halfedge_const_handle h, CGAL::Graphics_scene& graphics_scene, @@ -65,7 +65,7 @@ void print_halfedge_labels(const SS2& ss2, label.str()); } -template +template void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -81,7 +81,7 @@ void compute_vertex(const SS2& ss2, typename SS2::Vertex_const_handle vh, { graphics_scene.add_point(vh->point()); } } -template +template void print_vertex_label(const SS2& ss2, typename SS2::Vertex_const_handle vh, CGAL::Graphics_scene& graphics_scene, @@ -96,7 +96,7 @@ void print_vertex_label(const SS2& ss2, graphics_scene.add_text(vh->point(), label.str()); } -template +template void compute_elements(const SS2& ss2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -129,8 +129,8 @@ void compute_elements(const SS2& ss2, #define CGAL_SS_TYPE CGAL::Straight_skeleton_2 -template -void add_in_graphics_scene(const CGAL_SS_TYPE &ass2, +template +void add_to_graphics_scene(const CGAL_SS_TYPE &ass2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { @@ -138,8 +138,8 @@ void add_in_graphics_scene(const CGAL_SS_TYPE &ass2, gs_options); } -template -void add_in_graphics_scene(const CGAL_SS_TYPE& ass2, +template +void add_to_graphics_scene(const CGAL_SS_TYPE& ass2, CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options -void add_in_graphics_scene(const Surface_mesh& amesh, +void add_to_graphics_scene(const Surface_mesh& amesh, CGAL::Graphics_scene &graphics_scene, const GSOptions &gs_options) -{ add_in_graphics_scene_for_fg(amesh, graphics_scene, gs_options); } +{ add_to_graphics_scene_for_fg(amesh, graphics_scene, gs_options); } template -void add_in_graphics_scene(const Surface_mesh& amesh, +void add_to_graphics_scene(const Surface_mesh& amesh, CGAL::Graphics_scene &graphics_scene) -{ add_in_graphics_scene_for_fg(amesh, graphics_scene, +{ add_to_graphics_scene_for_fg(amesh, graphics_scene, Graphics_scene_options_surface_mesh(amesh)); } #ifdef CGAL_USE_BASIC_VIEWER @@ -114,7 +114,7 @@ void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(amesh, buffer); + add_to_graphics_scene(amesh, buffer); draw_graphics_scene(buffer, title); } @@ -124,7 +124,7 @@ void draw(const Surface_mesh& amesh, const char* title="Surface_mesh Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(amesh, buffer, gs_options); + add_to_graphics_scene(amesh, buffer, gs_options); draw_graphics_scene(buffer, title); } diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index d354ab745319..837fd33f908e 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -141,7 +141,7 @@ const typename CGAL::Get_traits::Point& get_point return CGAL::Get_traits::get_point(mesh, dh); } -template +template void compute_face(const Mesh& mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, @@ -188,7 +188,7 @@ void compute_face(const Mesh& mesh, graphics_scene.face_end(); } -template +template void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, @@ -219,7 +219,7 @@ void compute_edge(const Mesh &mesh, } } -template +template void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, @@ -238,7 +238,7 @@ void compute_edge(const Mesh &mesh, { graphics_scene.add_segment(p1, get_point(mesh, d2), color); } } -template +template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, CGAL::Graphics_scene& graphics_scene, @@ -250,7 +250,7 @@ void compute_vertex(const Mesh &mesh, graphics_scene.add_point(get_point(mesh, dh)); } -template +template void compute_path(const Mesh &mesh, const typename Get_map::storage_type& lcc, CGAL::Graphics_scene &graphics_scene, @@ -280,7 +280,7 @@ void compute_path(const Mesh &mesh, } } -template +template void compute_elements(const Mesh &mesh, CGAL::Graphics_scene &graphics_scene, const GSOptions &m_gs_options, @@ -311,19 +311,19 @@ void compute_elements(const Mesh &mesh, if (m_current_dart!=lcc.darts().end()) { // We want to draw only one dart Dart_const_descriptor selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); - compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphics_scene, lcc); + compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphics_scene, lcc); lcc.template mark_cell<1>(selected_dart, markedges); - compute_vertex(selected_dart, mesh, graphics_scene); + compute_vertex(selected_dart, mesh, graphics_scene); if ( !m_nofaces ) - { compute_face(selected_dart, mesh, graphics_scene, lcc); } + { compute_face(selected_dart, mesh, graphics_scene, lcc); } for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), itend=lcc.darts().end(); it!=itend; ++it ) { if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphics_scene, lcc, m_amark, m_draw_marked_darts); + compute_edge(it, mesh, graphics_scene, lcc, m_amark, m_draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } } @@ -333,10 +333,10 @@ void compute_elements(const Mesh &mesh, if (m_current_path==m_paths->size()) { for (std::size_t i=0; isize(); ++i) - { compute_path(i, markedges, mesh, graphics_scene, m_paths, lcc); } + { compute_path(i, markedges, mesh, graphics_scene, m_paths, lcc); } } else if (m_current_path!=m_paths->size()+1) - { compute_path(m_current_path, markedges, mesh, graphics_scene, m_paths, lcc); } + { compute_path(m_current_path, markedges, mesh, graphics_scene, m_paths, lcc); } for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), itend=lcc.darts().end(); it!=itend; ++it ) @@ -344,19 +344,19 @@ void compute_elements(const Mesh &mesh, if (!m_nofaces && !lcc.is_marked(it, markfaces) && !lcc.is_perforated(it) && lcc.is_marked(it, m_oriented_mark)) { - compute_face(it, mesh, graphics_scene, lcc); + compute_face(it, mesh, graphics_scene, lcc); lcc.template mark_cell<2>(it, markfaces); } if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphics_scene, lcc, m_amark, m_draw_marked_darts); + compute_edge(it, mesh, graphics_scene, lcc, m_amark, m_draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } if ( !lcc.is_marked(it, markvertices) ) { - compute_vertex(it, mesh, graphics_scene); + compute_vertex(it, mesh, graphics_scene); lcc.template mark_cell<0>(it, markvertices); } } @@ -369,8 +369,8 @@ void compute_elements(const Mesh &mesh, } // namespace draw_function_for_face_graph_with_paths -template -void add_in_graphics_scene(const Mesh& mesh, +template +void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, const std::vector>* paths, const GSOptions& gs_options, @@ -383,8 +383,8 @@ void add_in_graphics_scene(const Mesh& mesh, paths, amark); } -template -void add_in_graphics_scene(const Mesh& mesh, +template +void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, const std::vector>* paths, typename Get_map::type::size_type amark= @@ -397,12 +397,12 @@ void add_in_graphics_scene(const Mesh& mesh, typename Get_map::type::Dart_const_descriptor /*fh*/> gs_options; - add_in_graphics_scene(mesh, graphics_scene, gs_options, paths, amark); + add_to_graphics_scene(mesh, graphics_scene, gs_options, paths, amark); } #ifdef CGAL_USE_BASIC_VIEWER -template +template void draw(const Mesh& mesh, const std::vector >& paths, typename Get_map::type::size_type amark= @@ -410,11 +410,11 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(mesh, buffer, &paths, amark); + add_to_graphics_scene(mesh, buffer, &paths, amark); draw_graphics_scene(buffer, title); } -template +template void draw(const Mesh& mesh, const std::vector >& paths, const GSOptions& gs_options, @@ -423,11 +423,11 @@ void draw(const Mesh& mesh, const char* title="Mesh Viewer With Path") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(mesh, buffer, gs_options, &paths, amark); + add_to_graphics_scene(mesh, buffer, gs_options, &paths, amark); draw_graphics_scene(buffer, title); } -template +template void draw(const Mesh& mesh, std::initializer_list> l, typename Get_map::type::size_type amark= @@ -436,7 +436,7 @@ void draw(const Mesh& mesh, { std::vector> paths=l; CGAL::Graphics_scene buffer; - add_in_graphics_scene(mesh, buffer, &paths, amark); + add_to_graphics_scene(mesh, buffer, &paths, amark); draw_graphics_scene(buffer, title); } @@ -447,7 +447,7 @@ void draw(const Mesh& mesh, namespace CGAL { - template + template void draw(const Mesh&, const std::vector >&, typename Get_map::type::size_type= @@ -457,7 +457,7 @@ namespace CGAL std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< + template void draw(const Mesh&, const std::vector >&, const GSOptions&, @@ -468,7 +468,7 @@ namespace CGAL std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< + template void draw(const Mesh&, std::initializer_list>, const char* ="", diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index 99e6aee57278..6fc3d8f3bbe0 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -26,8 +26,8 @@ namespace CGAL // Specialization of draw function. #define CGAL_T2_TYPE CGAL::Constrained_triangulation_2 -template -void add_in_graphics_scene(const CGAL_T2_TYPE& at2, InDomainPmap ipm, +template +void add_to_graphics_scene(const CGAL_T2_TYPE& at2, InDomainPmap ipm, CGAL::Graphics_scene& graphics_scene) { using BASET2=CGAL::Triangulation_2; @@ -54,15 +54,15 @@ void add_in_graphics_scene(const CGAL_T2_TYPE& at2, InDomainPmap ipm, [&ipm](const BASET2&, typename CGAL_T2_TYPE::Finite_faces_iterator fh) -> CGAL::IO::Color { return get(ipm, fh)? CGAL::IO::yellow() : CGAL::IO::white(); }; - add_in_graphics_scene(at2, graphics_scene, drawingFunctor); + add_to_graphics_scene(at2, graphics_scene, drawingFunctor); } -template -void add_in_graphics_scene(const CGAL_T2_TYPE& at2, +template +void add_to_graphics_scene(const CGAL_T2_TYPE& at2, CGAL::Graphics_scene& graphics_scene) { internal::In_domain in_domain; - add_in_graphics_scene(at2, in_domain, graphics_scene); + add_to_graphics_scene(at2, in_domain, graphics_scene); } template @@ -70,7 +70,7 @@ void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm, const char *title="Constrained Triangulation_2 Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(at2, ipm, buffer); + add_to_graphics_scene(at2, ipm, buffer); draw_graphics_scene(buffer, title); } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 747c2348e1fb..702aa32cd663 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -24,7 +24,7 @@ namespace CGAL { namespace draw_function_for_t2 { -template +template void compute_face(const T2& t2, typename T2::Finite_faces_iterator fh, CGAL::Graphics_scene& graphics_scene, @@ -45,7 +45,7 @@ void compute_face(const T2& t2, graphics_scene.face_end(); } -template +template void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -68,7 +68,7 @@ void compute_edge(const T2& t2, typename T2::Finite_edges_iterator eh, } } -template +template void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -86,7 +86,7 @@ void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, } } -template +template void compute_elements(const T2& t2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -117,8 +117,8 @@ void compute_elements(const T2& t2, #define CGAL_T2_TYPE CGAL::Triangulation_2 -template -void add_in_graphics_scene(const CGAL_T2_TYPE& at2, +template +void add_to_graphics_scene(const CGAL_T2_TYPE& at2, CGAL::Graphics_scene& graphics_scene, const CGAL::Graphics_scene_options -void add_in_graphics_scene(const CGAL_T2_TYPE& at2, +template +void add_to_graphics_scene(const CGAL_T2_TYPE& at2, CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options +template void compute_face(typename T3::Finite_facets_iterator fh, const GSOptions& gs_options, CGAL::Graphics_scene& graphics_scene, const T3 *t3) @@ -48,7 +48,7 @@ void compute_face(typename T3::Finite_facets_iterator fh, graphics_scene.face_end(); } -template +template void compute_edge(typename T3::Finite_edges_iterator eh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options, const T3* t3) @@ -68,7 +68,7 @@ void compute_edge(typename T3::Finite_edges_iterator eh, } } -template +template void compute_vertex(typename T3::Vertex_handle vh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options, const T3* t3) @@ -84,7 +84,7 @@ void compute_vertex(typename T3::Vertex_handle vh, { graphics_scene.add_point(vh->point()); } } -template +template void compute_elements(const T3* t3, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -116,17 +116,16 @@ void compute_elements(const T3* t3, #define CGAL_T3_TYPE CGAL::Triangulation_3 template -void add_in_graphics_scene(const CGAL_T3_TYPE& at3, + class GSOptions> +void add_to_graphics_scene(const CGAL_T3_TYPE& at3, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { draw_function_for_t3::compute_elements(&at3, graphics_scene, gs_options); } -template -void add_in_graphics_scene(const CGAL_T3_TYPE& at3, +template +void add_to_graphics_scene(const CGAL_T3_TYPE& at3, CGAL::Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(at3, buffer); + add_to_graphics_scene(at3, buffer); draw_graphics_scene(buffer, title); } diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 2517c302a06c..2a1cfba81f7d 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -69,7 +69,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; -template +template void compute_vertex(const V2& v2, typename V2::Vertex_iterator vh, CGAL::Graphics_scene& graphics_scene, @@ -84,14 +84,14 @@ void compute_vertex(const V2& v2, { graphics_scene.add_point(vh->point()); } } -template +template void compute_dual_vertex(const V2& /*v2*/, typename V2::Delaunay_graph::Finite_vertices_iterator vi, CGAL::Graphics_scene &graphics_scene, const GSOptions& gs_options) { graphics_scene.add_point(vi->point(), gs_options.dual_vertex_color); } -template +template void add_segments_and_update_bounding_box(const V2& v2, typename V2::Halfedge_iterator he, CGAL::Graphics_scene& graphics_scene, @@ -221,7 +221,7 @@ Local_kernel::Point_2 get_second_point(typename V2::Halfedge_handle ray, } // Halfedge_const_handle -template +template void compute_rays_and_bisectors(const V2&, typename V2::Halfedge_iterator he, CGAL::Graphics_scene& graphics_scene, @@ -251,7 +251,7 @@ void compute_rays_and_bisectors(const V2&, } } -template +template void compute_face(const V2& v2, typename V2::Face_iterator fh, CGAL::Graphics_scene& graphics_scene, @@ -286,7 +286,7 @@ void compute_face(const V2& v2, // } } -template +template void compute_elements(const V2& v2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -335,17 +335,16 @@ void compute_elements(const V2& v2, #define CGAL_VORONOI_TYPE CGAL::Voronoi_diagram_2 -template -void add_in_graphics_scene(const CGAL_VORONOI_TYPE &v2, +template +void add_to_graphics_scene(const CGAL_VORONOI_TYPE &v2, CGAL::Graphics_scene& graphics_scene, const GSOptions& m_gs_options) { draw_function_for_v2::compute_elements(v2, graphics_scene, m_gs_options); } -template -void add_in_graphics_scene(const CGAL_VORONOI_TYPE& v2, +template +void add_to_graphics_scene(const CGAL_VORONOI_TYPE& v2, CGAL::Graphics_scene& graphics_scene) { // Default graphics view options. @@ -355,24 +354,23 @@ void add_in_graphics_scene(const CGAL_VORONOI_TYPE& v2, typename CGAL_VORONOI_TYPE::Face_iterator> gs_options; - add_in_graphics_scene(v2, graphics_scene, gs_options); + add_to_graphics_scene(v2, graphics_scene, gs_options); } #ifdef CGAL_USE_BASIC_VIEWER // Specialization of draw function. -template +template void draw(const CGAL_VORONOI_TYPE& av2, const GSOptions& gs_options, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphics_scene buffer; - add_in_graphics_scene(av2, buffer, gs_options); + add_to_graphics_scene(av2, buffer, gs_options); draw_graphics_scene(buffer, title); } -template +template void draw(const CGAL_VORONOI_TYPE& av2, const char *title="2D Voronoi Diagram Basic Viewer") { @@ -384,7 +382,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, typename CGAL_VORONOI_TYPE::Face_iterator> gs_options; - add_in_graphics_scene(av2, buffer, gs_options); + add_to_graphics_scene(av2, buffer, gs_options); QApplication_and_basic_viewer app(buffer, title); if(app) From 43328892591c9256e3f0fb59d75760c24f73013a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 23 Oct 2023 02:03:48 +0200 Subject: [PATCH 222/399] remove template for Buffer_for_vao --- .../Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp | 2 +- .../demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp | 2 +- Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp | 2 +- Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp index 96051a607c4b..049cfd6611b5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp @@ -92,7 +92,7 @@ void Scene_movable_sm_item_priv::compute_elements() const typedef boost::graph_traits::face_descriptor face_descriptor; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef boost::graph_traits::edge_descriptor edge_descriptor; - typedef CGAL::Buffer_for_vao CPF; + typedef CGAL::Buffer_for_vao CPF; flat_vertices.clear(); flat_normals.clear(); edges_vertices.clear(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp index fc6d564379b2..c037ebb2b745 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Heat_method_plugin.cpp @@ -131,7 +131,7 @@ class Scene_heat_item void computeElements() const Q_DECL_OVERRIDE { - typedef CGAL::Buffer_for_vao CPF; + typedef CGAL::Buffer_for_vao CPF; QApplication::setOverrideCursor(Qt::WaitCursor); diff --git a/Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp b/Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp index 1247ab267f1b..917a75bb6468 100644 --- a/Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp @@ -88,7 +88,7 @@ struct lcc_priv{ faces.push_back(pt->z() + offset.z); } } - else if (CGAL::Buffer_for_vao::is_facet_convex(f.points,f.normal)) + else if (CGAL::Buffer_for_vao::is_facet_convex(f.points,f.normal)) { if (f.size()==4) { diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 49e2da75e659..59dfda31041b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -447,7 +447,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: idx_data_.reserve(num_faces(*smesh_) * 3); - typedef CGAL::Buffer_for_vao CPF; + typedef CGAL::Buffer_for_vao CPF; typedef boost::graph_traits::face_descriptor face_descriptor; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef boost::graph_traits::edge_descriptor edge_descriptor; @@ -2517,7 +2517,7 @@ void Scene_surface_mesh_item::fill_flat_vertex_map() typedef EPICK::Point_3 Point; typedef CGAL::Surface_mesh SMesh; typedef boost::graph_traits::face_descriptor face_descriptor; - typedef CGAL::Buffer_for_vao CPF; + typedef CGAL::Buffer_for_vao CPF; if(d->flat_vertex_map_ready) return; From e416fc875165c80b9381e70c2e6f464da4b26bc5 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 23 Oct 2023 15:38:43 +0200 Subject: [PATCH 223/399] new test for doc of draw --- .../CGAL/draw_triangulation_2.h | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index e46d9faebae1..4707f22bff27 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -6,36 +6,40 @@ namespace CGAL { opens a new window and draws a triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter. A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. -Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with -`CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. +Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam Gt -\tparam Tds +\cgalAdvancedBegin +The code of this function is not templated by a class `T2`, but by the template parameters of a `CGAL::Triangulation_2` in order to take directly the `CGAL::Triangulation_2` as parameter and thus allow mixing several drawings of different data structures in the same code. This is not documented here to avoid too many technical details. +\cgalAdvancedEnd + +\tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept, `Graphics_scene_options` by defafult. \param at2 the triangulation to draw. \param gso the graphics scene options parameter, `GSOptions()` by default. */ - template - void draw(const CGAL::Triangulation_2& at2, - const GSOptions& gso={}); + template + void draw(const T2& at2, const GSOptions& gso={}); /*! \ingroup PkgDrawTriangulation2 adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). -\tparam Gt -\tparam Tds +\cgalAdvancedBegin +The code of this function is not templated by a class `T2`, but by the template parameters of a `CGAL::Triangulation_2` in order to take directly the `CGAL::Triangulation_2` as parameter and thus allow mixing several drawings of different data structures in the same code. This is not documented here to avoid too many technical details. +\cgalAdvancedEnd + +\tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept, `Graphics_scene_options` by defafult. \param at2 the triangulation to draw. \param gs the graphic scene to fill. \param gso the graphics scene options parameter, `GSOptions()` by default. */ -template -void add_to_graphics_scene(const CGAL::Triangulation_2& at2, +template +void add_to_graphics_scene(const T2& at2, CGAL::Graphics_scene& gs, const GSOptions& gso={}); From 2e955e1a241cc54fd0cdf091a0893d04b1b710f0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 23 Oct 2023 16:07:28 +0200 Subject: [PATCH 224/399] The return of GSOptions template --- Triangulation_2/include/CGAL/draw_triangulation_2.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 702aa32cd663..f57691b079f1 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -117,18 +117,15 @@ void compute_elements(const T2& t2, #define CGAL_T2_TYPE CGAL::Triangulation_2 -template + template void add_to_graphics_scene(const CGAL_T2_TYPE& at2, CGAL::Graphics_scene& graphics_scene, - const CGAL::Graphics_scene_options& & gs_options) + const GSOptions& gs_options) { draw_function_for_t2::compute_elements(at2, graphics_scene, gs_options); } -template + template void add_to_graphics_scene(const CGAL_T2_TYPE& at2, CGAL::Graphics_scene& graphics_scene) { From 5ea9ac3db8bff8700229cdea1efce97e6425d7c4 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 23 Oct 2023 18:41:20 +0200 Subject: [PATCH 225/399] Remove _qt suffix from Basic_viewer --- .../Qt/{Basic_viewer_qt.h => Basic_viewer.h} | 18 ++++---- .../doc/Basic_viewer/PackageDescription.txt | 8 ++-- .../Qt/{Basic_viewer_qt.h => Basic_viewer.h} | 46 +++++++++---------- 3 files changed, 36 insertions(+), 36 deletions(-) rename Basic_viewer/doc/Basic_viewer/CGAL/Qt/{Basic_viewer_qt.h => Basic_viewer.h} (79%) rename Basic_viewer/include/CGAL/Qt/{Basic_viewer_qt.h => Basic_viewer.h} (98%) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h similarity index 79% rename from Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h rename to Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h index d33a29c49ce2..7996bed24b30 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h @@ -4,17 +4,17 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Basic_viewer_qt` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements can either be added directly in the viewer or through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. +The class `Basic_viewer` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements can either be added directly in the viewer or through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. */ -class Basic_viewer_qt : public CGAL::QGLViewer +class Basic_viewer : public CGAL::QGLViewer { public: /// Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphics_scene`. /// `title` will be the title of the window. - Basic_viewer_qt(QWidget* parent, - const Graphics_scene& scene, - const char* title=""); + Basic_viewer(QWidget* parent, + const Graphics_scene& scene, + const char* title=""); /// enables or disables the drawing of vertices. void draw_vertices(bool b); @@ -132,7 +132,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /// Function called when a key is pressed. Users can define their own function in order /// to add specific behavior. - std::function on_key_pressed; + std::function on_key_pressed; }; @@ -140,7 +140,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer /*! \ingroup PkgBasicViewerClasses -The class `QApplication_and_basic_viewer` regroups a `Basic_viewer_qt` and Qt `QApplication`. The `QApplication` is created in the constructor, but started by the `run()` method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer_qt` to define their own behavior. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. +The class `QApplication_and_basic_viewer` regroups a `Basic_viewer` and Qt `QApplication`. The `QApplication` is created in the constructor, but started by the `run()` method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer` to define their own behavior. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. */ class QApplication_and_basic_viewer @@ -153,8 +153,8 @@ class QApplication_and_basic_viewer /// runs the `QApplication`, i.e., open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. void run(); - /// returns a reference to the `Basic_viewer_qt` associated with this. - Basic_viewer_qt& basic_viewer(); + /// returns a reference to the `Basic_viewer` associated with this. + Basic_viewer& basic_viewer(); }; //------------------------------------------------------------------------------ diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 500c9f32dfbf..550e146be4a4 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -11,7 +11,7 @@ \cgalPkgDescriptionBegin{Basic Viewer,PkgBasicViewer} \cgalPkgPicture{basic_viewer_logo.png} \cgalPkgSummaryBegin -\cgalPkgAuthor{Guillaume Damiand, Mostafa Ashraf} +\cgalPkgAuthor{Guillaume Damiand} \cgalPkgDesc{This package provides a basic viewer class.} \cgalPkgManuals{Chapter_Basic_viewer,PkgBasicViewerRef} \cgalPkgSummaryEnd @@ -29,10 +29,10 @@ - `GraphicsSceneOptionsWithVolumes` \cgalCRPSection{Classes} +- `CGAL::Basic_viewer` +- `CGAL::Graphics_scene` - `CGAL::Graphics_scene_options` -- `CGAL::Graphics_scene` -- `CGAL::Basic_viewer_qt` -- `CGAL::QApplication_and_basic_viewer` +- `CGAL::QApplication_and_basic_viewer` \cgalCRPSubsection{Draw a Graphics Scene} diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h similarity index 98% rename from Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h rename to Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 0d107922a75c..0271c9ef19a4 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer_qt.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -11,8 +11,8 @@ // Author(s) : Guillaume Damiand // Mostafa Ashraf -#ifndef CGAL_BASIC_VIEWER_QT_H -#define CGAL_BASIC_VIEWER_QT_H +#ifndef CGAL_BASIC_VIEWER_H +#define CGAL_BASIC_VIEWER_H #include #include @@ -61,7 +61,7 @@ namespace CGAL { //------------------------------------------------------------------------------ -class Basic_viewer_qt : public CGAL::QGLViewer +class Basic_viewer : public CGAL::QGLViewer { public: using BufferType=float; @@ -71,18 +71,18 @@ class Basic_viewer_qt : public CGAL::QGLViewer using GS=Graphics_scene; // Constructor/Destructor - Basic_viewer_qt(QWidget* parent, - const Graphics_scene& buf, - const char* title="", - bool draw_vertices=false, - bool draw_edges=true, - bool draw_faces=true, - bool use_mono_color=false, - bool inverse_normal=false, - bool draw_rays=true, - bool draw_lines=true, - bool draw_text=true, - bool no_2D_mode=false) : + Basic_viewer(QWidget* parent, + const Graphics_scene& buf, + const char* title="", + bool draw_vertices=false, + bool draw_edges=true, + bool draw_faces=true, + bool use_mono_color=false, + bool inverse_normal=false, + bool draw_rays=true, + bool draw_lines=true, + bool draw_text=true, + bool no_2D_mode=false) : CGAL::QGLViewer(parent), gBuffer(buf), m_draw_vertices(draw_vertices), @@ -158,7 +158,7 @@ class Basic_viewer_qt : public CGAL::QGLViewer { negate_all_normals(); } } - ~Basic_viewer_qt() + ~Basic_viewer() { makeCurrent(); for (unsigned int i=0; i on_key_pressed; + std::function on_key_pressed; protected: const Graphics_scene& gBuffer; @@ -1553,7 +1553,7 @@ void draw_graphics_scene(const Graphics_scene& graphics_scene, int argc = 1; const char *argv[2] = {title, nullptr}; QApplication app(argc, const_cast(argv)); - Basic_viewer_qt basic_viewer(app.activeWindow(), + Basic_viewer basic_viewer(app.activeWindow(), graphics_scene, title); basic_viewer.show(); @@ -1586,8 +1586,8 @@ class QApplication_and_basic_viewer Qt::init_ogl_context(4, 3); m_application=new QApplication(m_argc, const_cast(m_argv)); - m_basic_viewer=new Basic_viewer_qt(m_application->activeWindow(), - buffer, title); + m_basic_viewer=new Basic_viewer(m_application->activeWindow(), + buffer, title); } ~QApplication_and_basic_viewer() @@ -1609,7 +1609,7 @@ class QApplication_and_basic_viewer } } - Basic_viewer_qt& basic_viewer() + Basic_viewer& basic_viewer() { CGAL_assertion(m_basic_viewer!=nullptr); return *m_basic_viewer; @@ -1617,7 +1617,7 @@ class QApplication_and_basic_viewer protected: QApplication* m_application; - Basic_viewer_qt* m_basic_viewer; + Basic_viewer* m_basic_viewer; char *m_argv[2]; int m_argc; }; @@ -1639,4 +1639,4 @@ namespace CGAL #endif // CGAL_USE_BASIC_VIEWER -#endif // CGAL_BASIC_VIEWER_QT_H +#endif // CGAL_BASIC_VIEWER_H From 2f07fbbb5450d5e27d95995d030a8ba27974541f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 23 Oct 2023 19:17:52 +0200 Subject: [PATCH 226/399] Update basic viewer doc following last remarks (Laurent and Andreas) --- .../doc/Basic_viewer/CGAL/Graphics_scene.h | 21 ++++++++- .../doc/Basic_viewer/CGAL/Qt/Basic_viewer.h | 4 +- .../doc/Basic_viewer/PackageDescription.txt | 3 +- Basic_viewer/doc/Basic_viewer/dependencies | 1 + .../CGAL/draw_constrained_triangulation_2.h | 2 +- .../CGAL/draw_triangulation_2.h | 45 +++++++++++++++---- .../Triangulation_2/PackageDescription.txt | 2 +- .../doc/Triangulation_2/dependencies | 1 + 8 files changed, 64 insertions(+), 15 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h index 5bc9d40f5a29..8d1abd593f81 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h @@ -4,42 +4,54 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Graphics_scene` stores points, segments, triangles, rays and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added and are triangulated internally. +The class `Graphics_scene` stores points, segments, triangles, rays, and lines. Elements can be added, possibly with associated colors. Non triangular faces can be directly added and are triangulated internally. */ class Graphics_scene { public: /// adds the given point in the scene. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. template void add_point(const KPoint &p); /// adds the given colored point in the scene. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. template void add_point(const KPoint &p, const CGAL::IO::Color &color); /// adds the given segment in the scene. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. template void add_segment(const KPoint &p1, const KPoint &p2); /// adds the given colored segment in the scene. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. template void add_segment(const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &color); /// adds the given ray in the scene: a half line starting from `p` and having `v` as direction. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. + /// \tparam KVector a model of `Kernel::Vector_2` or `Kernel::Vector_3`. template void add_ray(const KPoint &p, const KVector &v); /// adds the given colored ray in the scene: a half line starting from `p` and having `v` as direction. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. + /// \tparam KVector a model of `Kernel::Vector_2` or `Kernel::Vector_3`. template void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &color); /// adds the given line in the scene, defined by `p` and `v` as direction. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. + /// \tparam KVector a model of `Kernel::Vector_2` or `Kernel::Vector_3`. template void add_line(const KPoint &p, const KVector &v); /// adds the given colored line in the scene, defined by `p` and `v` as direction. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. + /// \tparam KVector a model of `Kernel::Vector_2` or `Kernel::Vector_3`. template void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &color); @@ -55,10 +67,13 @@ class Graphics_scene { /// adds the given point in the current face. /// @pre `a_face_started()` + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. template bool add_point_in_face(const KPoint &kp); /// adds the given point in the current face, having the vertex normal. /// @pre `a_face_started()` + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. + /// \tparam KVector a model of `Kernel::Vector_2` or `Kernel::Vector_3`. template bool add_point_in_face(const KPoint &kp, const KVector &p_normal); @@ -67,10 +82,12 @@ class Graphics_scene { void face_end(); /// adds the given text at the given position in the scene. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. template void add_text(const KPoint &kp, const char *txt); /// adds the given text at the given position in the scene. + /// \tparam KPoint a model of `Kernel::Point_2`, `Kernel::Point_3`, `Kernel::WeightedPoint_2` or `Kernel::WeightedPoint_3`. template void add_text(const KPoint &kp, const std::string &txt); @@ -84,7 +101,7 @@ class Graphics_scene { const CGAL::Bbox_3& bounding_box() const; /// returns `true` if the scene is in 2D, i.e., lies on the XY or XZ or YZ plane. - bool two_dimensional() const; + bool is_two_dimensional() const; }; } // namespace CGAL diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h index 7996bed24b30..adcdbbc266af 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h @@ -159,7 +159,9 @@ class QApplication_and_basic_viewer //------------------------------------------------------------------------------ /*! - opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition CGAL_USE_BASIC_VIEWER. + \ingroup PkgBasicViewerClasses + + opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition CGAL_USE_BASIC_VIEWER. */ void draw_graphics_scene(const Graphics_scene& graphic_scene, const char *title="CGAL Basic Viewer") diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 550e146be4a4..728e5504e347 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -12,7 +12,7 @@ \cgalPkgPicture{basic_viewer_logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand} -\cgalPkgDesc{This package provides a basic viewer class.} +\cgalPkgDesc{This package provides a basic viewer class TODO.} \cgalPkgManuals{Chapter_Basic_viewer,PkgBasicViewerRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin @@ -38,7 +38,6 @@ - `CGAL::draw_graphics_scene()` - \cgalCRPSubsection{Draw for Different Packages} - `Constrained_triangulation_2` \link PkgDrawTriangulation2 CGAL::draw() \endlink diff --git a/Basic_viewer/doc/Basic_viewer/dependencies b/Basic_viewer/doc/Basic_viewer/dependencies index 67a91f218f5e..3db1960593c5 100644 --- a/Basic_viewer/doc/Basic_viewer/dependencies +++ b/Basic_viewer/doc/Basic_viewer/dependencies @@ -11,3 +11,4 @@ Surface_mesh_topology Triangulation_2 Triangulation_3 Voronoi_diagram_2 +Kernel_23 diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h index e67670bcbc9c..2ef649265112 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h @@ -17,7 +17,7 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with */ template -void draw(const T2& at2); +void draw(const T2& at2, TODO); /*! \ingroup PkgDrawConstrainedTriangulation2 diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 4707f22bff27..bb9b106a7a7d 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -9,18 +9,32 @@ A call to this function blocks the execution of the program until the drawing wi Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. \cgalAdvancedBegin -The code of this function is not templated by a class `T2`, but by the template parameters of a `CGAL::Triangulation_2` in order to take directly the `CGAL::Triangulation_2` as parameter and thus allow mixing several drawings of different data structures in the same code. This is not documented here to avoid too many technical details. +The real declaration of this function template is: + + + template + + void CGAL::draw(const Triangulation_2& at2, const GSOptions& gso); + \cgalAdvancedEnd \tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept, `Graphics_scene_options` by defafult. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. \param at2 the triangulation to draw. -\param gso the graphics scene options parameter, `GSOptions()` by default. +\param gso the graphics scene options parameter. */ template - void draw(const T2& at2, const GSOptions& gso={}); + void draw(const T2& at2, const GSOptions& gso); + +/*! +\ingroup PkgDrawTriangulation2 + +A shortcut to `draw(at2, Graphics_scene_options{})`. +*/ + template + void draw(const T2& at2); /*! \ingroup PkgDrawTriangulation2 @@ -28,19 +42,34 @@ The code of this function is not templated by a class `T2`, but by the template adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \cgalAdvancedBegin -The code of this function is not templated by a class `T2`, but by the template parameters of a `CGAL::Triangulation_2` in order to take directly the `CGAL::Triangulation_2` as parameter and thus allow mixing several drawings of different data structures in the same code. This is not documented here to avoid too many technical details. +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const Triangulation_2& at2, CGAL::Graphics_scene& gs, const GSOptions& gso); + \cgalAdvancedEnd \tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept, `Graphics_scene_options` by defafult. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. \param at2 the triangulation to draw. \param gs the graphic scene to fill. -\param gso the graphics scene options parameter, `GSOptions()` by default. +\param gso the graphics scene options parameter. */ template void add_to_graphics_scene(const T2& at2, CGAL::Graphics_scene& gs, - const GSOptions& gso={}); + const GSOptions& gso); + +/*! +\ingroup PkgDrawTriangulation2 + +A shortcut to `add_to_graphics_scene(at2, gs, Graphics_scene_options{})`. +*/ +template +void add_to_graphics_scene(const T2& at2, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ diff --git a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt index 9ff05f26d24b..596f2ae4a425 100644 --- a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt +++ b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt @@ -21,7 +21,7 @@ /*! \code - #include + #include \endcode */ /// \defgroup PkgDrawConstrainedTriangulation2 Draw a Constrained Triangulation 2 diff --git a/Triangulation_2/doc/Triangulation_2/dependencies b/Triangulation_2/doc/Triangulation_2/dependencies index 22ae69dcfef0..db6625f491cc 100644 --- a/Triangulation_2/doc/Triangulation_2/dependencies +++ b/Triangulation_2/doc/Triangulation_2/dependencies @@ -10,3 +10,4 @@ Triangulation_3 Spatial_sorting Polygon Polyline_simplification_2 +Basic_viewer From 126b9360c9871943dc1468e44a3e15259168ee89 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 24 Oct 2023 08:27:18 +0200 Subject: [PATCH 227/399] Remove _qt from Basic viewer name --- .../CGAL/draw_arrangement_2.h | 2 +- .../include/CGAL/draw_arrangement_2.h | 20 ++--- Basic_viewer/include/CGAL/Graphics_scene.h | 2 +- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 80 +++++++++---------- .../demo/Linear_cell_complex/Viewer.cpp | 6 +- .../demo/Linear_cell_complex/Viewer.h | 16 ++-- .../include/CGAL/draw_linear_cell_complex.h | 2 +- 7 files changed, 64 insertions(+), 64 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h index f415f5c9e7ec..1f23f97d5d5d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h @@ -17,7 +17,7 @@ #ifndef CGAL_DRAW_ARRANGEMENT_2_H #define CGAL_DRAW_ARRANGEMENT_2_H -#include +#include #ifdef DOXYGEN_RUNNING 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 6aa3b9fcd1c7..9d3248073482 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -23,7 +23,7 @@ #include #include -#include +#include #ifdef CGAL_USE_BASIC_VIEWER @@ -50,10 +50,10 @@ struct Default_color_generator { // Viewer class for`< Polygon_2 template -class Aos_2_basic_viewer_qt : public Basic_viewer_qt { +class Aos_2_basic_viewer_qt : public Basic_viewer { using Aos = ArrangementOnSurface_2; using Color_generator = ColorGenerator; - using Base = Basic_viewer_qt; + using Base = Basic_viewer; using Gt = typename Aos::Geometry_traits_2; using Point = typename Aos::Point_2; using X_monotone_curve = typename Aos::X_monotone_curve_2; @@ -185,7 +185,7 @@ class Aos_2_basic_viewer_qt : public Basic_viewer_qt { void add_elements() { // std::cout << "add_elements()\n"; // std::cout << "ratio: " << this->pixel_ratio() << std::endl; - clear(); + m_graphics_scene.clear(); m_visited.clear(); if (m_aos.is_empty()) return; @@ -276,8 +276,8 @@ class Aos_2_basic_viewer_qt : public Basic_viewer_qt { auto it = polyline.begin(); auto prev = it++; for (; it != polyline.end(); prev = it++) { - this->add_segment(*prev, *it); - this->add_point_in_face(*prev); + m_graphics_scene.add_segment(*prev, *it); + m_graphics_scene.add_point_in_face(*prev); } } @@ -383,7 +383,7 @@ class Aos_2_basic_viewer_qt : public Basic_viewer_qt { * For now we use C++14 features. */ auto color = m_color_generator(circ->face()); - this->face_begin(color); + m_graphics_scene.face_begin(color); const auto* traits = this->m_aos.geometry_traits(); auto ext = find_smallest(circ, *traits); @@ -396,7 +396,7 @@ class Aos_2_basic_viewer_qt : public Basic_viewer_qt { curr = curr->next(); } while (curr != ext); - this->face_end(); + m_graphics_scene.face_end(); } /*! Draw a curve using aproximate coordinates. @@ -414,7 +414,7 @@ class Aos_2_basic_viewer_qt : public Basic_viewer_qt { if (polyline.empty()) return; auto it = polyline.begin(); auto prev = it++; - for (; it != polyline.end(); prev = it++) this->add_segment(*prev, *it); + for (; it != polyline.end(); prev = it++) m_graphics_scene.add_segment(*prev, *it); } /*! Compile time dispatching @@ -534,7 +534,7 @@ class Aos_2_basic_viewer_qt : public Basic_viewer_qt { #else template void draw_point_impl1(const Point& p, T const& traits, int) - { add_point(traits.approximate_2_object()(p)); } + { m_graphics_scene.add_point(traits.approximate_2_object()(p)); } #endif template diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index 5c8101b1fadf..c6c6b433b91a 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -158,7 +158,7 @@ class Graphics_scene update_bounding_box(lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox()); } - void negate_all_normals() const + void reverse_normals() const { m_buffer_for_mono_faces.negate_normals(); m_buffer_for_colored_faces.negate_normals(); diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 0271c9ef19a4..acd9d8b66ddf 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -155,7 +155,7 @@ class Basic_viewer : public CGAL::QGLViewer resize(CGAL_BASIC_VIEWER_INIT_SIZE_X, CGAL_BASIC_VIEWER_INIT_SIZE_Y); if (inverse_normal) - { negate_all_normals(); } + { reverse_normals(); } } ~Basic_viewer() @@ -168,73 +168,73 @@ class Basic_viewer : public CGAL::QGLViewer vao[i].destroy(); } - void set_draw_vertices(bool b) + void draw_vertices(bool b) { m_draw_vertices = b; } - void set_draw_edges(bool b) + void draw_edges(bool b) { m_draw_edges = b; } - void set_draw_rays(bool b) + void draw_rays(bool b) { m_draw_rays = b; } - void set_draw_lines(bool b) + void draw_lines(bool b) { m_draw_lines = b; } - void set_draw_faces(bool b) + void draw_faces(bool b) { m_draw_faces = b; } - void set_use_mono_color(bool b) + void use_mono_color(bool b) { m_use_mono_color = b; } - void set_draw_text(bool b) + void draw_text(bool b) { m_draw_text = b; } - void set_vertices_mono_color(const CGAL::IO::Color& c) + void vertices_mono_color(const CGAL::IO::Color& c) { m_vertices_mono_color=c; } - void set_edges_mono_color(const CGAL::IO::Color& c) + void edges_mono_color(const CGAL::IO::Color& c) { m_edges_mono_color=c; } - void set_rays_mono_color(const CGAL::IO::Color& c) + void rays_mono_color(const CGAL::IO::Color& c) { m_rays_mono_color=c; } - void set_lines_mono_color(const CGAL::IO::Color& c) + void lines_mono_color(const CGAL::IO::Color& c) { m_lines_mono_color=c; } - void set_faces_mono_color(const CGAL::IO::Color& c) + void faces_mono_color(const CGAL::IO::Color& c) { m_faces_mono_color=c; } - void negate_draw_vertices() + void toggle_draw_vertices() { m_draw_vertices = !m_draw_vertices; } - void negate_draw_edges() + void toggle_draw_edges() { m_draw_edges = !m_draw_edges; } - void negate_draw_rays() + void toggle_draw_rays() { m_draw_rays = !m_draw_rays; } - void negate_draw_lines() + void toggle_draw_lines() { m_draw_lines = !m_draw_lines; } - void negate_draw_faces() + void toggle_draw_faces() { m_draw_faces = !m_draw_faces; } - void negate_use_mono_color() + void toggle_use_mono_color() { m_use_mono_color = !m_use_mono_color; } - void negate_draw_text() + void toggle_draw_text() { m_draw_text = !m_draw_text; } - bool get_draw_vertices() const + bool draw_vertices() const { return m_draw_vertices; } - bool get_draw_edges() const + bool draw_edges() const { return m_draw_edges; } - bool get_draw_rays() const + bool draw_rays() const { return m_draw_rays; } - bool get_draw_lines() const + bool draw_lines() const { return m_draw_lines; } - bool get_draw_faces() const + bool draw_faces() const { return m_draw_faces; } - bool get_use_mono_color() const + bool use_mono_color() const { return m_use_mono_color; } - bool get_inverse_normal() const + bool reverse_normal() const { return m_inverse_normal; } - bool get_draw_text() const + bool draw_text() const { return m_draw_text; } - const CGAL::IO::Color& get_vertices_mono_color() const + const CGAL::IO::Color& vertices_mono_color() const { return m_vertices_mono_color; } - const CGAL::IO::Color& get_edges_mono_color() const + const CGAL::IO::Color& edges_mono_color() const { return m_edges_mono_color; } - const CGAL::IO::Color& get_rays_mono_color() const + const CGAL::IO::Color& rays_mono_color() const { return m_rays_mono_color; } - const CGAL::IO::Color& get_lines_mono_color() const + const CGAL::IO::Color& lines_mono_color() const { return m_lines_mono_color; } - const CGAL::IO::Color& get_faces_mono_color() const + const CGAL::IO::Color& faces_mono_color() const { return m_faces_mono_color; } Local_kernel::Plane_3 clipping_plane() const @@ -245,10 +245,10 @@ class Basic_viewer : public CGAL::QGLViewer return Local_kernel::Plane_3(n[0], n[1], n[2], -n*pos); } - bool is_clipping_plane_enabled() const + bool clipping_plane_enabled() const { return (m_use_clipping_plane!=CLIPPING_PLANE_OFF); } - const Graphics_scene& get_graphics_scene() const + const Graphics_scene& graphics_scene() const { return gBuffer; } virtual void redraw() @@ -257,10 +257,10 @@ class Basic_viewer : public CGAL::QGLViewer update(); } - void negate_all_normals() + void reverse_normals() { m_inverse_normal=!m_inverse_normal; - gBuffer.negate_all_normals(); + gBuffer.reverse_normals(); } // Returns true if the data structure lies on a plane @@ -1254,7 +1254,7 @@ class Basic_viewer : public CGAL::QGLViewer } else if ((e->key()==::Qt::Key_N) && (modifiers==::Qt::NoButton)) { - negate_all_normals(); + reverse_normals(); displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false")); redraw(); } @@ -1537,6 +1537,7 @@ class Basic_viewer : public CGAL::QGLViewer }; +inline void draw_graphics_scene(const Graphics_scene& graphics_scene, const char *title="CGAL Basic Viewer") { @@ -1553,8 +1554,7 @@ void draw_graphics_scene(const Graphics_scene& graphics_scene, int argc = 1; const char *argv[2] = {title, nullptr}; QApplication app(argc, const_cast(argv)); - Basic_viewer basic_viewer(app.activeWindow(), - graphics_scene, title); + Basic_viewer basic_viewer(app.activeWindow(), graphics_scene, title); basic_viewer.show(); app.exec(); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index 4039bb460fcf..e7ff28d2ef2e 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -20,7 +20,7 @@ Viewer::Viewer(QWidget *parent) m_previous_scene_empty(true) { m_gs_options.face_color=[](const LCC & alcc, - Dart_const_descriptor dh)->CGAL::IO::Color + Dart_const_descriptor dh)->CGAL::IO::Color { if(alcc.template is_free<3>(dh)) { return alcc.template info<3>(dh).color(); } @@ -53,7 +53,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) scene = scene_; if (scene->lcc!=nullptr) - { CGAL::add_in_graphics_scene(*scene->lcc, m_graphic_buffer, m_gs_options); } + { CGAL::add_to_graphics_scene(*scene->lcc, m_graphic_buffer, m_gs_options); } if (doredraw) { Base::redraw(); } @@ -62,7 +62,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw) void Viewer::sceneChanged() { m_graphic_buffer.clear(); - CGAL::add_in_graphics_scene(*scene->lcc, m_graphic_buffer, m_gs_options); + CGAL::add_to_graphics_scene(*scene->lcc, m_graphic_buffer, m_gs_options); this->camera()->setSceneBoundingBox( CGAL::qglviewer::Vec(gBuffer.bounding_box().xmin(), diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index a4df8965ff20..951672054599 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -16,13 +16,13 @@ #include "typedefs.h" #include -#include +#include -class Viewer : public CGAL::Basic_viewer_qt +class Viewer : public CGAL::Basic_viewer { Q_OBJECT - typedef CGAL::Basic_viewer_qt Base; + typedef CGAL::Basic_viewer Base; public: Viewer(QWidget* parent); @@ -35,11 +35,11 @@ public Q_SLOTS: private: CGAL::Graphics_scene_options m_gs_options; - CGAL::Graphics_scene m_graphic_buffer; + Dart_const_descriptor, + Dart_const_descriptor, + Dart_const_descriptor, + Dart_const_descriptor> m_gs_options; + CGAL::Graphics_scene m_graphic_buffer; Scene* scene; bool m_previous_scene_empty; }; 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 bb21109dceaa..652935b14447 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -13,7 +13,7 @@ #ifndef CGAL_DRAW_LCC_H #define CGAL_DRAW_LCC_H -#include +#include #include #include #include From 2b69e29fe57d3d5cc867006bebb0c09cd85cf525 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 25 Oct 2023 08:49:24 +0200 Subject: [PATCH 228/399] Basic viewer is now in namespace Qt --- .../doc/Basic_viewer/CGAL/Qt/Basic_viewer.h | 7 ++- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 58 ++++++++++--------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h index adcdbbc266af..5ef340bd40dc 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h @@ -1,10 +1,11 @@ namespace CGAL { + namespace Qt { //------------------------------------------------------------------------------ /*! \ingroup PkgBasicViewerClasses -The class `Basic_viewer` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements can either be added directly in the viewer or through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. +The class `Basic_viewer` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements are added through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. */ class Basic_viewer : public CGAL::QGLViewer @@ -132,7 +133,7 @@ class Basic_viewer : public CGAL::QGLViewer /// Function called when a key is pressed. Users can define their own function in order /// to add specific behavior. - std::function on_key_pressed; + std::function on_key_pressed; }; @@ -157,6 +158,8 @@ class QApplication_and_basic_viewer Basic_viewer& basic_viewer(); }; +} // End namespace Qt + //------------------------------------------------------------------------------ /*! \ingroup PkgBasicViewerClasses diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index acd9d8b66ddf..60b16ff2b208 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -59,7 +59,7 @@ #define CGAL_BASIC_VIEWER_INIT_SIZE_Y 450 namespace CGAL { - +namespace Qt { //------------------------------------------------------------------------------ class Basic_viewer : public CGAL::QGLViewer { @@ -1457,7 +1457,7 @@ class Basic_viewer : public CGAL::QGLViewer return text; } public: - std::function on_key_pressed; + std::function on_key_pressed; protected: const Graphics_scene& gBuffer; @@ -1537,30 +1537,6 @@ class Basic_viewer : public CGAL::QGLViewer }; -inline -void draw_graphics_scene(const Graphics_scene& graphics_scene, - const char *title="CGAL Basic Viewer") -{ -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite = true; -#else - bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif - - if (!cgal_test_suite) - { - Qt::init_ogl_context(4, 3); - - int argc = 1; - const char *argv[2] = {title, nullptr}; - QApplication app(argc, const_cast(argv)); - Basic_viewer basic_viewer(app.activeWindow(), graphics_scene, title); - - basic_viewer.show(); - app.exec(); - } -} - //------------------------------------------------------------------------------ class QApplication_and_basic_viewer { @@ -1622,6 +1598,36 @@ class QApplication_and_basic_viewer int m_argc; }; +} // End namespace Qt + +// A shortcut to use directly CGAL::Basic_viewer instead of CGAL::Qt::Basic_viewer. +// Can be changed later if we have several viewers. +using Qt::Basic_viewer; + +inline +void draw_graphics_scene(const Graphics_scene& graphics_scene, + const char *title="CGAL Basic Viewer") +{ +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite = true; +#else + bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) + { + Qt::init_ogl_context(4, 3); + + int argc = 1; + const char *argv[2] = {title, nullptr}; + QApplication app(argc, const_cast(argv)); + Basic_viewer basic_viewer(app.activeWindow(), graphics_scene, title); + + basic_viewer.show(); + app.exec(); + } +} + } // End namespace CGAL #else // CGAL_USE_BASIC_VIEWER From 2bad25fddc52f63e185f083bcd785a33f688dcfe Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 6 Nov 2023 18:43:02 +0100 Subject: [PATCH 229/399] draw cont (nyf) --- .../include/CGAL/draw_polygon_set_2.h | 21 ++++++++++--------- .../include/CGAL/draw_face_graph_with_paths.h | 16 +++++++------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index e1fca5ad98b2..d95561e83e0f 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -17,7 +17,9 @@ #ifndef CGAL_DRAW_POLYGON_SET_2_H #define CGAL_DRAW_POLYGON_SET_2_H -#include +#include +#include +#include #ifdef DOXYGEN_RUNNING namespace CGAL { @@ -112,10 +114,10 @@ void compute_elements(const PWH& pwh, #ifdef CGAL_USE_BASIC_VIEWER -template -class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt +template +class Polygon_set_2_basic_viewer_qt : public Basic_viewer { - using Base = Basic_viewer_qt; + using Base = Basic_viewer; using Ps = PolygonSet_2; using Pwh = typename Ps::Polygon_with_holes_2; using Pgn = typename Ps::Polygon_2; @@ -123,12 +125,10 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt public: Polygon_set_2_basic_viewer_qt(QWidget* parent, const Ps& ps, - Graphics_scene& gs, - GSOptions& gs_options, const char* title = "Basic Polygon_set_2 Viewer", bool draw_unbounded = false, bool draw_vertices = false) : - Base(parent, gs, title, draw_vertices), + Base(parent, graphics_scene, title, draw_vertices), m_ps(ps), m_draw_unbounded(draw_unbounded) { @@ -203,6 +203,9 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer_qt //! Indicates whether to draw unbounded polygons with holes. bool m_draw_unbounded = false; + + Graphics_scene graphics_scene; + Graphics_scene_options graphics_scene_options; }; // Specialization of draw function. @@ -226,9 +229,7 @@ void draw(const CGAL::Polygon_set_2& ps, int argc = 1; const char* argv[2] = {"t2_viewer", nullptr}; QApplication app(argc, const_cast(argv)); - Graphics_scene gs; - Graphics_scene_options gs; - Viewer basic_viewer(app.activeWindow(), ps, gs, gso, + Viewer basic_viewer(app.activeWindow(), ps, title, draw_unbounded, draw_vertices); basic_viewer.add_elements(); basic_viewer.show(); diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 837fd33f908e..43e65312acb3 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -50,7 +50,7 @@ struct Graphics_scene_options_face_graph_with_paths : { return true; } } - std::function color_of_path; + std::function color_of_path; std::function draw_path; protected: @@ -192,7 +192,7 @@ template void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - typename Get_map::type::size_type m_amark, + typename Get_map::type::size_type aamark, CGAL::Graphics_scene& graphics_scene, GSOptions& gs_options, bool draw_marked_darts=true) @@ -211,8 +211,8 @@ void compute_edge(const Mesh &mesh, Dart_const_descriptor d2 = lcc.other_extremity(dh); if (d2!=LCC::null_descriptor) { - if (m_draw_marked_darts && m_amark!=LCC::INVALID_MARK && - (lcc.is_marked(dh, m_amark) || lcc.is_marked(lcc.opposite2(dh), m_amark))) + if (draw_marked_darts && amark!=LCC::INVALID_MARK && + (lcc.is_marked(dh, amark) || lcc.is_marked(lcc.opposite2(dh), amark))) { graphics_scene.add_segment(p1, get_point(mesh, d2), CGAL::IO::Color(0, 0, 255)); } else { graphics_scene.add_segment(p1, get_point(mesh, d2)); } @@ -238,7 +238,7 @@ void compute_edge(const Mesh &mesh, { graphics_scene.add_segment(p1, get_point(mesh, d2), color); } } -template +template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, CGAL::Graphics_scene& graphics_scene, @@ -299,7 +299,7 @@ void compute_elements(const Mesh &mesh, typename LCC::Dart_range::const_iterator m_current_dart = lcc.darts().end(); typename LCC::size_type m_oriented_mark = lcc.get_new_mark(); std::size_t m_current_path = m_paths->size(); - typename LCC::size_type m_amark=amark==(std::numeric_limits::max)()? + typename LCC::size_type amark=amark==(std::numeric_limits::max)()? LCC::INVALID_MARK:amark; // If !=INVALID_MARK, show darts marked with this mark lcc.orient(m_oriented_mark); @@ -323,7 +323,7 @@ void compute_elements(const Mesh &mesh, { if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphics_scene, lcc, m_amark, m_draw_marked_darts); + compute_edge(it, mesh, graphics_scene, lcc, amark, draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } } @@ -350,7 +350,7 @@ void compute_elements(const Mesh &mesh, if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphics_scene, lcc, m_amark, m_draw_marked_darts); + compute_edge(it, mesh, graphics_scene, lcc, amark, draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } From 97721a0c1212ce4266ee381da386e898e2a375c6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 13 Nov 2023 11:11:46 +0000 Subject: [PATCH 230/399] namespace fixes --- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 5 ++--- Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp | 6 +++--- .../examples/Basic_viewer/draw_surface_mesh_small_faces.cpp | 2 +- Triangulation_3/include/CGAL/draw_triangulation_3.h | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 728e5504e347..d85d6ab1927e 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -29,10 +29,10 @@ - `GraphicsSceneOptionsWithVolumes` \cgalCRPSection{Classes} -- `CGAL::Basic_viewer` +- `CGAL::Qt::Basic_viewer` - `CGAL::Graphics_scene` - `CGAL::Graphics_scene_options` -- `CGAL::QApplication_and_basic_viewer` +- `CGAL::Qt::QApplication_and_basic_viewer` \cgalCRPSubsection{Draw a Graphics Scene} @@ -73,4 +73,3 @@ - Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::add_to_graphics_scene() \endlink */ - diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index a84472e51838..54b9af99ab77 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include @@ -69,8 +69,8 @@ int main(void) QWidget *centralWidget = new QWidget(mainWindow); QHBoxLayout* layout = new QHBoxLayout(mainWindow); - CGAL::Basic_viewer_qt bv1(mainWindow, graphic_buffer1); - CGAL::Basic_viewer_qt bv2(mainWindow, graphic_buffer2); + CGAL::Qt::Basic_viewer bv1(mainWindow, graphic_buffer1); + CGAL::Qt::Basic_viewer bv2(mainWindow, graphic_buffer2); bv1.set_draw_vertices(true); layout->addWidget(&bv1); diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 2bc04da399be..a933a431eef4 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -102,7 +102,7 @@ int main(int argc, char* argv[]) CGAL::Graphics_scene buffer; add_in_graphics_scene(sm, buffer, gsosm); - CGAL::QApplication_and_basic_viewer app(buffer, "Small faces"); + CGAL::Qt::QApplication_and_basic_viewer app(buffer, "Small faces"); if(app) { app.basic_viewer().on_key_pressed= diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 1cf62b22457a..50044bd845b0 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_T3_H #include -#include +#include #include #include #include From e62cb1661a70724a64eed8020ada2ca35639f167 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 13 Nov 2023 18:56:31 +0000 Subject: [PATCH 231/399] add_to --- .../examples/Basic_viewer/draw_mesh_and_points.cpp | 6 +++--- .../examples/Basic_viewer/draw_several_windows.cpp | 6 +++--- .../examples/Basic_viewer/draw_surface_mesh_height.cpp | 2 +- .../Basic_viewer/draw_surface_mesh_small_faces.cpp | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index e378696c071f..01b476b91e2d 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; @@ -55,8 +55,8 @@ int main(void) { point_set.insert(it.first); } CGAL::Graphics_scene graphic_buffer; - CGAL::add_in_graphics_scene(point_set, graphic_buffer, Graphics_scene_options_green_points()); - CGAL::add_in_graphics_scene(output_mesh, graphic_buffer); + CGAL::add_to_graphics_scene(point_set, graphic_buffer, Graphics_scene_options_green_points()); + CGAL::add_to_graphics_scene(output_mesh, graphic_buffer); CGAL::draw_graphics_scene(graphic_buffer); } else diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index 54b9af99ab77..cd387484c1f3 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; @@ -48,8 +48,8 @@ int main(void) { point_set.insert(it.first); } CGAL::Graphics_scene graphic_buffer1, graphic_buffer2; - CGAL::add_in_graphics_scene(point_set, graphic_buffer1); - CGAL::add_in_graphics_scene(output_mesh, graphic_buffer2); + CGAL::add_to_graphics_scene(point_set, graphic_buffer1); + CGAL::add_to_graphics_scene(output_mesh, graphic_buffer2); /// (2) Qt code that create windows, add them in a layout, and create app. diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp index 15a82026f97e..d1ef948609eb 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index a933a431eef4..aba2a0e1b037 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include @@ -101,7 +101,7 @@ int main(int argc, char* argv[]) Graphics_scene_options_small_faces gsosm(sm); CGAL::Graphics_scene buffer; - add_in_graphics_scene(sm, buffer, gsosm); + add_to_graphics_scene(sm, buffer, gsosm); CGAL::Qt::QApplication_and_basic_viewer app(buffer, "Small faces"); if(app) { @@ -117,7 +117,7 @@ int main(int argc, char* argv[]) (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); buffer.clear(); - add_in_graphics_scene(sm, buffer, gsosm); + add_to_graphics_scene(sm, buffer, gsosm); basic_viewer->redraw(); } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) @@ -128,7 +128,7 @@ int main(int argc, char* argv[]) (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); buffer.clear(); - add_in_graphics_scene(sm, buffer, gsosm); + add_to_graphics_scene(sm, buffer, gsosm); basic_viewer->redraw(); } else From 1ffb64e2acbbc3e911089360dd2e614779e2e04e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 13 Nov 2023 18:58:30 +0000 Subject: [PATCH 232/399] buffer -> scene --- .../examples/Basic_viewer/draw_mesh_and_points.cpp | 8 ++++---- .../examples/Basic_viewer/draw_several_windows.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 01b476b91e2d..665b006feea2 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -54,10 +54,10 @@ int main(void) for(Pwn& it: points) { point_set.insert(it.first); } - CGAL::Graphics_scene graphic_buffer; - CGAL::add_to_graphics_scene(point_set, graphic_buffer, Graphics_scene_options_green_points()); - CGAL::add_to_graphics_scene(output_mesh, graphic_buffer); - CGAL::draw_graphics_scene(graphic_buffer); + CGAL::Graphics_scene scene; + CGAL::add_to_graphics_scene(point_set, scene, Graphics_scene_options_green_points()); + CGAL::add_to_graphics_scene(output_mesh, scene); + CGAL::draw_graphics_scene(scene); } else { return EXIT_FAILURE; } diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index cd387484c1f3..945680df1477 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -47,9 +47,9 @@ int main(void) for(Pwn& it: points) { point_set.insert(it.first); } - CGAL::Graphics_scene graphic_buffer1, graphic_buffer2; - CGAL::add_to_graphics_scene(point_set, graphic_buffer1); - CGAL::add_to_graphics_scene(output_mesh, graphic_buffer2); + CGAL::Graphics_scene scene1, scene2; + CGAL::add_to_graphics_scene(point_set, scene1); + CGAL::add_to_graphics_scene(output_mesh, scene2); /// (2) Qt code that create windows, add them in a layout, and create app. @@ -69,8 +69,8 @@ int main(void) QWidget *centralWidget = new QWidget(mainWindow); QHBoxLayout* layout = new QHBoxLayout(mainWindow); - CGAL::Qt::Basic_viewer bv1(mainWindow, graphic_buffer1); - CGAL::Qt::Basic_viewer bv2(mainWindow, graphic_buffer2); + CGAL::Qt::Basic_viewer bv1(mainWindow, scene1); + CGAL::Qt::Basic_viewer bv2(mainWindow, scene2); bv1.set_draw_vertices(true); layout->addWidget(&bv1); From 525cc0f27ea64470d3b2d10ebd55b845f75793b5 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 14 Nov 2023 09:16:37 +0000 Subject: [PATCH 233/399] Descriptor -> _descriptor --- .../CGAL/Graphics_scene_options.h | 5 +++ .../Concepts/GraphicsSceneOptions.h | 36 +++++++++---------- .../include/CGAL/Graphics_scene_options.h | 10 ++++++ 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h index 5461da7ecb47..21bff4b2a649 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h @@ -27,6 +27,11 @@ template ignore_vertex; + std::function ignore_vertex; /// `std::function` that returns `true` if the given edge must be ignored, `false` otherwise. /// Returns `true` by default. - std::function ignore_edge; + std::function ignore_edge; /// `std::function` that returns `true` if the given face must be ignored, `false` otherwise. /// Returns `true` by default. - std::function ignore_face; + std::function ignore_face; /// `std::function` that returns `true` if the given vertex is colored, `false` otherwise. /// Returns `false` by default. - std::function is_vertex_colored; + std::function is_vertex_colored; /// `std::function` that returns `true` if the given edge is colored, `false` otherwise. /// Returns `false` by default. - std::function is_edge_colored; + std::function is_edge_colored; /// `std::function` that returns `true` if the given face is colored, `false` otherwise. /// Returns `false` by default. - std::function is_face_colored; + std::function is_face_colored; /// `std::function` that returns `true` if the given face is in wireframe, `false` otherwise. /// Returns `false` by default. - std::function is_face_wireframe; + std::function is_face_wireframe; /// `std::function` that returns the color of the given vertex. /// `nullptr` by default. - std::function vertex_color; + std::function vertex_color; /// `std::function` that returns the color of the given edge. /// `nullptr` by default. - std::function edge_color; + std::function edge_color; /// `std::function` that returns the color of the given face. /// `nullptr` by default. - std::function face_color; + std::function face_color; /// ignores all vertices when `b` is `true`; otherwise ignores only vertices for which `ignore_vertex()` returns `true`. void ignore_all_vertices(bool b); @@ -101,23 +101,23 @@ class GraphicsSceneOptionsWithVolumes /*! %A descriptor of volumes of `DS`. */ - typedef unspecified_type VolumeDescriptor; + typedef unspecified_type volume_descriptor; /// `std::function` that returns `true` if the given volume must be ignored, `false` otherwise. /// Returns `false` by default. - std::function ignore_volume; + std::function ignore_volume; /// `std::function` that returns `true` if the given volume is colored, `false` otherwise. /// Returns `false` by default. - std::function is_volume_colored; + std::function is_volume_colored; /// `std::function` that returns `true` if the given volume is in wireframe, `false` otherwise. /// Returns `false` by default. - std::function is_volume_wireframe; + std::function is_volume_wireframe; /// `std::function` that returns the color of the given volume. /// `nullptr` by default. - std::function volume_color; + std::function volume_color; /// ignores all volumes when `b` is `true`; otherwise ignore only volumes for which `ignore_volume()` returns `true`. void ignore_all_volumes(bool b); diff --git a/Basic_viewer/include/CGAL/Graphics_scene_options.h b/Basic_viewer/include/CGAL/Graphics_scene_options.h index 6a085c2397f3..d19194beacb1 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/include/CGAL/Graphics_scene_options.h @@ -34,6 +34,11 @@ template struct Graphics_scene_options { + + typedef VertexHandle vertex_descriptor; + typedef EdgeHandle edge_descriptor; + typedef FaceHandle face_descriptor; + Graphics_scene_options(): m_enabled_vertices(true), m_enabled_edges(true), m_enabled_faces(true) @@ -92,6 +97,11 @@ template { + typedef VertexHandle vertex_descriptor; + typedef EdgeHandle edge_descriptor; + typedef FaceHandle face_descriptor; + typedef VolumeHandle volume_descriptor; + Graphics_scene_options() : m_enabled_volumes(true) { draw_volume=[](const DS &, VolumeHandle)->bool { return true; }; From 4e5082b6b59750231a180ea5c9745438f0961b7a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 14 Nov 2023 09:25:00 +0000 Subject: [PATCH 234/399] remove _qt --- Nef_3/include/CGAL/draw_nef_3.h | 2 +- .../include/CGAL/draw_periodic_2_triangulation_2.h | 4 ++-- Point_set_3/include/CGAL/draw_point_set_3.h | 2 +- Polygon/include/CGAL/draw_polygon_2.h | 2 +- Polygon/include/CGAL/draw_polygon_with_holes_2.h | 2 +- Polyhedron/include/CGAL/draw_polyhedron.h | 2 +- Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h | 2 +- Surface_mesh/include/CGAL/draw_surface_mesh.h | 2 +- .../include/CGAL/draw_face_graph_with_paths.h | 2 +- Triangulation_2/include/CGAL/draw_triangulation_2.h | 2 +- Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h | 4 ++-- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index b8d4e37ae87d..452185e26c4c 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -15,7 +15,7 @@ #define DRAW_NEF_3_H #include -#include +#include #include #include #include diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index e11fb2baaffa..7a423e66fae6 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -14,7 +14,7 @@ #define DRAW_PERIODIC_2_TRIANGULATION_2_H #include -#include +#include #include #include #include @@ -247,7 +247,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&ap2t2, &gs_options] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&ap2t2, &gs_options] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) 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 13fefed8a391..f831c3b73e25 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -15,7 +15,7 @@ #define CGAL_DRAW_POINT_SET_3_H #include -#include +#include #include #include #include diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 971c84ddce4a..1b2b211ac5e7 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -18,7 +18,7 @@ #ifndef CGAL_DRAW_POLYGON_2_H #define CGAL_DRAW_POLYGON_2_H -#include +#include #include #include #include diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 6157b9118d2a..d2c01edf7c70 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -18,7 +18,7 @@ #ifndef CGAL_DRAW_POLYGON_WITH_HOLES_2_H #define CGAL_DRAW_POLYGON_WITH_HOLES_2_H -#include +#include #include #include #include diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 37d090cabb76..c45ea4e0dd4f 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include namespace CGAL { diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index d4766f5a903c..e5efae9c2bee 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_SS2_H #include -#include +#include #include #include #include diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 0641211dc1e4..b6f91ec5d832 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -34,7 +34,7 @@ void draw(const SM& asm); #include #include #include -#include +#include namespace CGAL { diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 43e65312acb3..75e772ac603e 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -15,7 +15,7 @@ #include -#include +#include #include #include diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index f57691b079f1..22141bf7d974 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_T2_H #include -#include +#include #include #include #include diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 2a1cfba81f7d..d7831e8ccdfe 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -14,7 +14,7 @@ #define CGAL_DRAW_VORONOI_DIAGRAM_2_H #include -#include +#include #include #include #include @@ -389,7 +389,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&av2, &gs_options] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&av2, &gs_options] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) From 09b175b63ebfded4b75075e7022649397616b8a9 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 17 Nov 2023 18:48:53 +0100 Subject: [PATCH 235/399] Explain what to do for non colored cells --- Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h b/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h index 90741ad58812..1ad90562e2a2 100644 --- a/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h +++ b/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h @@ -46,13 +46,16 @@ class GraphicsSceneOptions /// `std::function` that returns `true` if the given vertex is colored, `false` otherwise. /// Returns `false` by default. + /// For non colored vertices, this is the role of the user of a graphic scene to decide which color must be used (cf. for example `Basic_viewer`, `vertices_mono_color`). std::function is_vertex_colored; /// `std::function` that returns `true` if the given edge is colored, `false` otherwise. + /// For non colored edges, this is the role of the user of a graphic scene to decide which color must be used (cf. for example `Basic_viewer`, `edges_mono_color`). /// Returns `false` by default. std::function is_edge_colored; /// `std::function` that returns `true` if the given face is colored, `false` otherwise. + /// For non colored faces, this is the role of the user of a graphic scene to decide which color must be used (cf. for example `Basic_viewer`, `faces_mono_color`). /// Returns `false` by default. std::function is_face_colored; @@ -108,6 +111,7 @@ class GraphicsSceneOptionsWithVolumes std::function ignore_volume; /// `std::function` that returns `true` if the given volume is colored, `false` otherwise. + /// For non colored volumes, this is the role of the user of a graphic scene to decide which color must be used (cf. for example `Basic_viewer`, `faces_mono_color`). /// Returns `false` by default. std::function is_volume_colored; From 8111fdfcd332490dc8cb03578f35d177423c14bd Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 17 Nov 2023 18:56:41 +0100 Subject: [PATCH 236/399] color of volumes --- Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h b/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h index 1ad90562e2a2..f845dc792813 100644 --- a/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h +++ b/Basic_viewer/doc/Basic_viewer/Concepts/GraphicsSceneOptions.h @@ -119,7 +119,7 @@ class GraphicsSceneOptionsWithVolumes /// Returns `false` by default. std::function is_volume_wireframe; - /// `std::function` that returns the color of the given volume. + /// `std::function` that returns the color of the given volume, i.e. the color of all the faces of this volume. /// `nullptr` by default. std::function volume_color; From e3ac9932dc1c2c7a3ee20923571891f61f537ad3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 20 Nov 2023 08:34:13 +0100 Subject: [PATCH 237/399] Doc: add a link to qglviewer --- Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h index 5ef340bd40dc..34c72f8c70a0 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h @@ -7,6 +7,7 @@ namespace CGAL { The class `Basic_viewer` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements are added through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. +CGAL::QGLViewer is our internal fork of QGLViewer class which is A versatile 3D OpenGL viewer based on QOpenGLWidget. */ class Basic_viewer : public CGAL::QGLViewer { From db97ebbf1f611804442fa1e95617e0bc011e9124 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 20 Nov 2023 09:03:46 +0100 Subject: [PATCH 238/399] Update code according to final doc api --- Basic_viewer/include/CGAL/Graphics_scene.h | 34 +- .../include/CGAL/Graphics_scene_options.h | 88 +- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 852 +++++++++--------- 3 files changed, 487 insertions(+), 487 deletions(-) diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index c6c6b433b91a..4caddad03435 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -13,7 +13,7 @@ #ifndef CGAL_GRAPHICS_SCENE_H #define CGAL_GRAPHICS_SCENE_H -#include +// TODO #include #include #include @@ -231,7 +231,7 @@ class Graphics_scene return false; } - bool is_a_face_started() const + bool a_face_started() const { return m_buffer_for_mono_faces.is_a_face_started() || m_buffer_for_colored_faces.is_a_face_started(); @@ -269,7 +269,21 @@ class Graphics_scene { m_buffer_for_colored_faces.face_end(); } } - bool is_empty() const + template + void add_text(const KPoint &kp, const QString &txt) + { + Local_point p = get_local_point(kp); + m_texts.push_back(std::make_tuple(p, txt)); + } + + template void add_text(const KPoint &kp, const char *txt) + { add_text(kp, QString(txt)); } + + template + void add_text(const KPoint &kp, const std::string &txt) + { add_text(kp, txt.c_str()); } + + bool empty() const { return (m_buffer_for_mono_points.is_empty() && m_buffer_for_colored_points.is_empty() && @@ -361,20 +375,6 @@ class Graphics_scene Local_kernel>::get_local_vector(v); } - template - void add_text(const KPoint &kp, const QString &txt) - { - Local_point p = get_local_point(kp); - m_texts.push_back(std::make_tuple(p, txt)); - } - - template void add_text(const KPoint &kp, const char *txt) - { add_text(kp, QString(txt)); } - - template - void add_text(const KPoint &kp, const std::string &txt) - { add_text(kp, txt.c_str()); } - void m_texts_clear() { m_texts.clear(); } diff --git a/Basic_viewer/include/CGAL/Graphics_scene_options.h b/Basic_viewer/include/CGAL/Graphics_scene_options.h index d19194beacb1..b610665ed40a 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/include/CGAL/Graphics_scene_options.h @@ -20,56 +20,56 @@ namespace CGAL { template + typename VertexDescriptor, + typename EdgeDescriptor, + typename FaceDescriptor, + typename VolumeDescriptor=void> struct Graphics_scene_options; // Drawing functor for a 2D combinatorial data structure // (with vertices, edges and faces) template -struct Graphics_scene_options + typename VertexDescriptor, + typename EdgeDescriptor, + typename FaceDescriptor> +struct Graphics_scene_options { - typedef VertexHandle vertex_descriptor; - typedef EdgeHandle edge_descriptor; - typedef FaceHandle face_descriptor; + typedef VertexDescriptor vertex_descriptor; + typedef EdgeDescriptor edge_descriptor; + typedef FaceDescriptor face_descriptor; Graphics_scene_options(): m_enabled_vertices(true), m_enabled_edges(true), m_enabled_faces(true) { - draw_vertex=[](const DS &, VertexHandle)->bool { return true; }; - draw_edge=[](const DS &, EdgeHandle)->bool { return true; }; - draw_face=[](const DS &, FaceHandle)->bool { return true; }; + draw_vertex=[](const DS &, vertex_descriptor)->bool { return true; }; + draw_edge=[](const DS &, edge_descriptor)->bool { return true; }; + draw_face=[](const DS &, face_descriptor)->bool { return true; }; - colored_vertex=[](const DS &, VertexHandle)->bool { return false; }; - colored_edge=[](const DS &, EdgeHandle)->bool { return false; }; - colored_face=[](const DS &, FaceHandle)->bool { return false; }; + colored_vertex=[](const DS &, vertex_descriptor)->bool { return false; }; + colored_edge=[](const DS &, edge_descriptor)->bool { return false; }; + colored_face=[](const DS &, face_descriptor)->bool { return false; }; - face_wireframe=[](const DS &, FaceHandle)->bool { return false; }; + face_wireframe=[](const DS &, face_descriptor)->bool { return false; }; } // The seven following functions should not be null - std::function draw_vertex; - std::function draw_edge; - std::function draw_face; + std::function draw_vertex; + std::function draw_edge; + std::function draw_face; - std::function colored_vertex; - std::function colored_edge; - std::function colored_face; + std::function colored_vertex; + std::function colored_edge; + std::function colored_face; - std::function face_wireframe; + std::function face_wireframe; // These functions must be non null if the corresponding colored_XXX function // returns true. - std::function vertex_color; - std::function edge_color; - std::function face_color; + std::function vertex_color; + std::function edge_color; + std::function face_color; void disable_vertices() { m_enabled_vertices=false; } void enable_vertices() { m_enabled_vertices=true; } @@ -90,29 +90,29 @@ struct Graphics_scene_options // Drawing functor for a 3D combinatorial data structure // (with vertices, edges, faces and volumes) template + typename VertexDescriptor, + typename EdgeDescriptor, + typename FaceDescriptor, + typename VolumeDescriptor> struct Graphics_scene_options: - public Graphics_scene_options + public Graphics_scene_options { - typedef VertexHandle vertex_descriptor; - typedef EdgeHandle edge_descriptor; - typedef FaceHandle face_descriptor; - typedef VolumeHandle volume_descriptor; + typedef VertexDescriptor vertex_descriptor; + typedef EdgeDescriptor edge_descriptor; + typedef FaceDescriptor face_descriptor; + typedef VolumeDescriptor volume_descriptor; Graphics_scene_options() : m_enabled_volumes(true) { - draw_volume=[](const DS &, VolumeHandle)->bool { return true; }; - colored_volume=[](const DS &, VolumeHandle)->bool { return false; }; - volume_wireframe=[](const DS &, VolumeHandle)->bool { return false; }; + draw_volume=[](const DS &, volume_descriptor)->bool { return true; }; + colored_volume=[](const DS &, volume_descriptor)->bool { return false; }; + volume_wireframe=[](const DS &, volume_descriptor)->bool { return false; }; } - std::function draw_volume; - std::function colored_volume; - std::function volume_wireframe; - std::function volume_color; + std::function draw_volume; + std::function colored_volume; + std::function volume_wireframe; + std::function volume_color; void disable_volumes() { m_enabled_volumes=false; } void enable_volumes() { m_enabled_volumes=true; } diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 60b16ff2b208..73cb5a2f9e61 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -14,7 +14,7 @@ #ifndef CGAL_BASIC_VIEWER_H #define CGAL_BASIC_VIEWER_H -#include +// TODO #include #include #include #include @@ -257,7 +257,7 @@ class Basic_viewer : public CGAL::QGLViewer update(); } - void reverse_normals() + void reverse_all_normals() { m_inverse_normal=!m_inverse_normal; gBuffer.reverse_normals(); @@ -267,111 +267,455 @@ class Basic_viewer : public CGAL::QGLViewer bool is_two_dimensional() const { return !m_no_2D_mode && gBuffer.is_two_dimensional(); } -protected: - void compile_shaders() + virtual void draw() { - rendering_program_face.removeAllShaders(); - rendering_program_p_l.removeAllShaders(); - rendering_program_clipping_plane.removeAllShaders(); + glEnable(GL_DEPTH_TEST); - // Create the buffers - for (unsigned int i=0; imatrix()[i]; } + QVector4D clipPlane = clipping_mMatrix * QVector4D(0.0, 0.0, 1.0, 0.0); + QVector4D plane_point = clipping_mMatrix * QVector4D(0,0,0,1); + if(!m_are_buffers_initialized) + { initialize_buffers(); } - for (unsigned int i=0; i(gBuffer.number_of_elements(GS::POS_MONO_POINTS))); + vao[VAO_MONO_POINTS].release(); - QOpenGLShader *vertex_shader_p_l = new QOpenGLShader(QOpenGLShader::Vertex); - if(!vertex_shader_p_l->compileSourceCode(source_)) - { std::cerr<<"Compiling vertex source FAILED"<(gBuffer.number_of_elements(GS::POS_COLORED_POINTS))); + vao[VAO_COLORED_POINTS].release(); + }; - source_ = isOpenGL_4_3() - ? fragment_source_p_l - : fragment_source_p_l_comp; + enum { + DRAW_ALL = -1, // draw all + DRAW_INSIDE_ONLY, // draw only the part inside the clipping plane + DRAW_OUTSIDE_ONLY // draw only the part outside the clipping plane + }; - QOpenGLShader *fragment_shader_p_l= new QOpenGLShader(QOpenGLShader::Fragment); - if(!fragment_shader_p_l->compileSourceCode(source_)) - { std::cerr<<"Compiling fragmentsource FAILED"<(gBuffer.number_of_elements(GS::POS_MONO_SEGMENTS))); + vao[VAO_MONO_SEGMENTS].release(); - QOpenGLShader *vertex_shader_face = new QOpenGLShader(QOpenGLShader::Vertex); - if(!vertex_shader_face->compileSourceCode(source_)) - { std::cerr<<"Compiling vertex source FAILED"<(gBuffer.number_of_elements(GS::POS_COLORED_SEGMENTS))); + vao[VAO_COLORED_SEGMENTS].release(); + }; - source_ = isOpenGL_4_3() - ? fragment_source_color - : fragment_source_color_comp; + enum { + DRAW_ALL = -1, // draw all + DRAW_INSIDE_ONLY, // draw only the part inside the clipping plane + DRAW_OUTSIDE_ONLY // draw only the part outside the clipping plane + }; - QOpenGLShader *fragment_shader_face= new QOpenGLShader(QOpenGLShader::Fragment); - if(!fragment_shader_face->compileSourceCode(source_)) - { std::cerr<<"Compiling fragment source FAILED"<compileSourceCode(source_)) - { std::cerr << "Compiling vertex source for clipping plane FAILED" << std::endl; } + vao[VAO_MONO_RAYS].bind(); + color.setRgbF((double)m_rays_mono_color.red()/(double)255, + (double)m_rays_mono_color.green()/(double)255, + (double)m_rays_mono_color.blue()/(double)255); + rendering_program_p_l.setAttributeValue("color",color); + glLineWidth(m_size_rays); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_RAYS))); + vao[VAO_MONO_RAYS].release(); - source_ = fragment_source_clipping_plane; + vao[VAO_COLORED_RAYS].bind(); + if (m_use_mono_color) + { + color.setRgbF((double)m_rays_mono_color.red()/(double)255, + (double)m_rays_mono_color.green()/(double)255, + (double)m_rays_mono_color.blue()/(double)255); + rendering_program_p_l.disableAttributeArray("color"); + rendering_program_p_l.setAttributeValue("color",color); + } + else + { + rendering_program_p_l.enableAttributeArray("color"); + } + glLineWidth(m_size_rays); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_RAYS))); + vao[VAO_COLORED_RAYS].release(); - QOpenGLShader *fragment_shader_clipping_plane = new QOpenGLShader(QOpenGLShader::Fragment); - if (!fragment_shader_clipping_plane->compileSourceCode(source_)) - { std::cerr << "Compiling fragment source for clipping plane FAILED" << std::endl; } + rendering_program_p_l.release(); + } - if (!rendering_program_clipping_plane.addShader(vertex_shader_clipping_plane)) - { std::cerr << "Adding vertex shader for clipping plane FAILED" << std::endl;} - if (!rendering_program_clipping_plane.addShader(fragment_shader_clipping_plane)) - { std::cerr << "Adding fragment shader for clipping plane FAILED" << std::endl; } - if (!rendering_program_clipping_plane.link()) - { std::cerr << "Linking Program for clipping plane FAILED" << std::endl; } + if(m_draw_lines) + { + rendering_program_p_l.bind(); - } + vao[VAO_MONO_LINES].bind(); + color.setRgbF((double)m_lines_mono_color.red()/(double)255, + (double)m_lines_mono_color.green()/(double)255, + (double)m_lines_mono_color.blue()/(double)255); + rendering_program_p_l.setAttributeValue("color",color); + glLineWidth(m_size_lines); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_LINES))); + vao[VAO_MONO_LINES].release(); - // source_ = isOpenGL_4_3() - // ? vertex_source_clipping_plane - // : vertex_source_clipping_plane_comp; + rendering_program_p_l.release(); - // QOpenGLShader *vertex_shader_clipping_plane = new QOpenGLShader(QOpenGLShader::Vertex); - // if (!vertex_shader_clipping_plane->compileSourceCode(source_)) - // { std::cerr << "Compiling vertex source for clipping plane FAILED" << std::endl; } + vao[VAO_COLORED_LINES].bind(); + if (m_use_mono_color) + { + color.setRgbF((double)m_lines_mono_color.red()/(double)255, + (double)m_lines_mono_color.green()/(double)255, + (double)m_lines_mono_color.blue()/(double)255); + rendering_program_p_l.disableAttributeArray("color"); + rendering_program_p_l.setAttributeValue("color",color); + } + else + { + rendering_program_p_l.enableAttributeArray("color"); + } + glLineWidth(m_size_lines); + glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_LINES))); + vao[VAO_COLORED_LINES].release(); - // source_ = isOpenGL_4_3() - // ? fragment_source_clipping_plane - // : fragment_source_clipping_plane_comp; + rendering_program_p_l.release(); + } + + // Fix Z-fighting by drawing faces at a depth + GLfloat offset_factor; + GLfloat offset_units; + if (is_two_dimensional()) { + glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &offset_factor); + glGetFloatv(GL_POLYGON_OFFSET_UNITS, &offset_units); + glPolygonOffset(0.1f, 0.9f); + } + + if (m_draw_faces) + { + rendering_program_face.bind(); + + // reference: https://stackoverflow.com/questions/37780345/opengl-how-to-create-order-independent-transparency + // rendering_mode == -1: draw all as solid; + // rendering_mode == 0: draw solid only; + // rendering_mode == 1: draw transparent only; + auto renderer = [this, &color, &clipPlane, &plane_point](float rendering_mode) { + + vao[VAO_MONO_FACES].bind(); + color.setRgbF((double)m_faces_mono_color.red()/(double)255, + (double)m_faces_mono_color.green()/(double)255, + (double)m_faces_mono_color.blue()/(double)255); + rendering_program_face.setAttributeValue("color",color); + rendering_program_face.setUniformValue("rendering_mode", rendering_mode); + rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); + rendering_program_face.setUniformValue("clipPlane", clipPlane); + rendering_program_face.setUniformValue("pointPlane", plane_point); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_FACES))); + vao[VAO_MONO_FACES].release(); + + vao[VAO_COLORED_FACES].bind(); + if (m_use_mono_color) + { + color.setRgbF((double)m_faces_mono_color.red()/(double)255, + (double)m_faces_mono_color.green()/(double)255, + (double)m_faces_mono_color.blue()/(double)255); + rendering_program_face.disableAttributeArray("color"); + rendering_program_face.setAttributeValue("color",color); + } + else + { + rendering_program_face.enableAttributeArray("color"); + } + rendering_program_face.setUniformValue("rendering_mode", rendering_mode); + rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); + rendering_program_face.setUniformValue("clipPlane", clipPlane); + rendering_program_face.setUniformValue("pointPlane", plane_point); + glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_FACES))); + vao[VAO_COLORED_FACES].release(); + }; + + auto renderer_clipping_plane = [this](bool clipping_plane_rendering) { + if (!isOpenGL_4_3()) return; + if (!clipping_plane_rendering) return; + // render clipping plane here + rendering_program_clipping_plane.bind(); + vao[VAO_CLIPPING_PLANE].bind(); + glLineWidth(0.1f); + glDrawArrays(GL_LINES, 0, static_cast((m_array_for_clipping_plane.size()/3))); + glLineWidth(1.0f); + vao[VAO_CLIPPING_PLANE].release(); + rendering_program_clipping_plane.release(); + }; + + enum { + DRAW_SOLID_ALL = -1, // draw all mesh in solid mode + DRAW_SOLID_HALF, // draw only the mesh inside the clipping plane as solid + DRAW_TRANSPARENT_HALF // draw only the mesh outside the clipping plane as transparent + }; + + if (m_use_clipping_plane == CLIPPING_PLANE_SOLID_HALF_TRANSPARENT_HALF) + { + // The z-buffer will prevent transparent objects from being displayed behind other transparent objects. + // Before rendering all transparent objects, disable z-testing first. + + // 1. draw solid first + renderer(DRAW_SOLID_HALF); + + // 2. draw transparent layer second with back face culling to avoid messy triangles + glDepthMask(false); //disable z-testing + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glFrontFace(GL_CW); + renderer(DRAW_TRANSPARENT_HALF); + + // 3. draw solid again without culling and blend to make sure the solid mesh is visible + glDepthMask(true); //enable z-testing + glDisable(GL_CULL_FACE); + glDisable(GL_BLEND); + renderer(DRAW_SOLID_HALF); + + // 4. render clipping plane here + renderer_clipping_plane(clipping_plane_rendering); + } + else if (m_use_clipping_plane == CLIPPING_PLANE_SOLID_HALF_WIRE_HALF || + m_use_clipping_plane == CLIPPING_PLANE_SOLID_HALF_ONLY) + { + // 1. draw solid HALF + renderer(DRAW_SOLID_HALF); + + // 2. render clipping plane here + renderer_clipping_plane(clipping_plane_rendering); + } + else + { + // 1. draw solid FOR ALL + renderer(DRAW_SOLID_ALL); + } + + if (is_two_dimensional()) + glPolygonOffset(offset_factor, offset_units); + + rendering_program_face.release(); + } + + if (m_draw_text) + { + glDisable(GL_LIGHTING); + for (std::size_t i=0; iprojectedCoordinatesOf + (CGAL::qglviewer::Vec(std::get<0>(m_texts_vec[i]).x(), + std::get<0>(m_texts_vec[i]).y(), + std::get<0>(m_texts_vec[i]).z())); + + drawText((int)screenPos[0], (int)screenPos[1], std::get<1>(m_texts_vec[i])); + } + glEnable(GL_LIGHTING); + } + + // Multiply matrix to get in the frame coordinate system. + // glMultMatrixd(manipulatedFrame()->matrix()); // Linker error + // Scale down the drawings + // glScalef(0.3f, 0.3f, 0.3f); // Linker error + // Draw an axis using the QGLViewer static function + // drawAxis(); + } + +protected: + void compile_shaders() + { + rendering_program_face.removeAllShaders(); + rendering_program_p_l.removeAllShaders(); + rendering_program_clipping_plane.removeAllShaders(); + + // Create the buffers + for (unsigned int i=0; icompileSourceCode(source_)) + { std::cerr<<"Compiling vertex source FAILED"<compileSourceCode(source_)) + { std::cerr<<"Compiling fragmentsource FAILED"<compileSourceCode(source_)) + { std::cerr<<"Compiling vertex source FAILED"<compileSourceCode(source_)) + { std::cerr<<"Compiling fragment source FAILED"<compileSourceCode(source_)) + { std::cerr << "Compiling vertex source for clipping plane FAILED" << std::endl; } + + source_ = fragment_source_clipping_plane; + + QOpenGLShader *fragment_shader_clipping_plane = new QOpenGLShader(QOpenGLShader::Fragment); + if (!fragment_shader_clipping_plane->compileSourceCode(source_)) + { std::cerr << "Compiling fragment source for clipping plane FAILED" << std::endl; } + + if (!rendering_program_clipping_plane.addShader(vertex_shader_clipping_plane)) + { std::cerr << "Adding vertex shader for clipping plane FAILED" << std::endl;} + if (!rendering_program_clipping_plane.addShader(fragment_shader_clipping_plane)) + { std::cerr << "Adding fragment shader for clipping plane FAILED" << std::endl; } + if (!rendering_program_clipping_plane.link()) + { std::cerr << "Linking Program for clipping plane FAILED" << std::endl; } + + } + + // source_ = isOpenGL_4_3() + // ? vertex_source_clipping_plane + // : vertex_source_clipping_plane_comp; + + // QOpenGLShader *vertex_shader_clipping_plane = new QOpenGLShader(QOpenGLShader::Vertex); + // if (!vertex_shader_clipping_plane->compileSourceCode(source_)) + // { std::cerr << "Compiling vertex source for clipping plane FAILED" << std::endl; } + + // source_ = isOpenGL_4_3() + // ? fragment_source_clipping_plane + // : fragment_source_clipping_plane_comp; // QOpenGLShader *fragment_shader_clipping_plane = new QOpenGLShader(QOpenGLShader::Fragment); // if (!fragment_shader_clipping_plane->compileSourceCode(source_)) @@ -789,350 +1133,6 @@ class Basic_viewer : public CGAL::QGLViewer } } - virtual void draw() - { - glEnable(GL_DEPTH_TEST); - - QMatrix4x4 clipping_mMatrix; - clipping_mMatrix.setToIdentity(); - for(int i=0; i< 16 ; i++) - { clipping_mMatrix.data()[i] = m_frame_plane->matrix()[i]; } - QVector4D clipPlane = clipping_mMatrix * QVector4D(0.0, 0.0, 1.0, 0.0); - QVector4D plane_point = clipping_mMatrix * QVector4D(0,0,0,1); - if(!m_are_buffers_initialized) - { initialize_buffers(); } - - QColor color; - attrib_buffers(this); - - if(m_draw_vertices) - { - rendering_program_p_l.bind(); - - // rendering_mode == -1: draw all - // rendering_mode == 0: draw inside clipping plane - // rendering_mode == 1: draw outside clipping plane - auto renderer = [this, &color, &clipPlane, &plane_point](float rendering_mode) { - vao[VAO_MONO_POINTS].bind(); - color.setRgbF((double)m_vertices_mono_color.red()/(double)255, - (double)m_vertices_mono_color.green()/(double)255, - (double)m_vertices_mono_color.blue()/(double)255); - rendering_program_p_l.setAttributeValue("color",color); - rendering_program_p_l.setUniformValue("point_size", GLfloat(m_size_points)); - rendering_program_p_l.setUniformValue("clipPlane", clipPlane); - rendering_program_p_l.setUniformValue("pointPlane", plane_point); - rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_POINTS))); - vao[VAO_MONO_POINTS].release(); - - vao[VAO_COLORED_POINTS].bind(); - if (m_use_mono_color) - { - color.setRgbF((double)m_vertices_mono_color.red()/(double)255, - (double)m_vertices_mono_color.green()/(double)255, - (double)m_vertices_mono_color.blue()/(double)255); - rendering_program_p_l.disableAttributeArray("color"); - rendering_program_p_l.setAttributeValue("color",color); - } - else - { - rendering_program_p_l.enableAttributeArray("color"); - } - rendering_program_p_l.setUniformValue("point_size", GLfloat(m_size_points)); - rendering_program_p_l.setUniformValue("clipPlane", clipPlane); - rendering_program_p_l.setUniformValue("pointPlane", plane_point); - rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glDrawArrays(GL_POINTS, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_POINTS))); - vao[VAO_COLORED_POINTS].release(); - }; - - enum { - DRAW_ALL = -1, // draw all - DRAW_INSIDE_ONLY, // draw only the part inside the clipping plane - DRAW_OUTSIDE_ONLY // draw only the part outside the clipping plane - }; - - if (m_use_clipping_plane == CLIPPING_PLANE_SOLID_HALF_ONLY) - { - renderer(DRAW_INSIDE_ONLY); - } - else - { - renderer(DRAW_ALL); - } - - rendering_program_p_l.release(); - } - - if(m_draw_edges) - { - rendering_program_p_l.bind(); - - // rendering_mode == -1: draw all - // rendering_mode == 0: draw inside clipping plane - // rendering_mode == 1: draw outside clipping plane - auto renderer = [this, &color, &clipPlane, &plane_point](float rendering_mode) { - vao[VAO_MONO_SEGMENTS].bind(); - color.setRgbF((double)m_edges_mono_color.red()/(double)255, - (double)m_edges_mono_color.green()/(double)255, - (double)m_edges_mono_color.blue()/(double)255); - rendering_program_p_l.setAttributeValue("color",color); - rendering_program_p_l.setUniformValue("clipPlane", clipPlane); - rendering_program_p_l.setUniformValue("pointPlane", plane_point); - rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_SEGMENTS))); - vao[VAO_MONO_SEGMENTS].release(); - - vao[VAO_COLORED_SEGMENTS].bind(); - if (m_use_mono_color) - { - color.setRgbF((double)m_edges_mono_color.red()/(double)255, - (double)m_edges_mono_color.green()/(double)255, - (double)m_edges_mono_color.blue()/(double)255); - rendering_program_p_l.disableAttributeArray("color"); - rendering_program_p_l.setAttributeValue("color",color); - } - else - { - rendering_program_p_l.enableAttributeArray("color"); - } - rendering_program_p_l.setUniformValue("clipPlane", clipPlane); - rendering_program_p_l.setUniformValue("pointPlane", plane_point); - rendering_program_p_l.setUniformValue("rendering_mode", rendering_mode); - glLineWidth(m_size_edges); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_SEGMENTS))); - vao[VAO_COLORED_SEGMENTS].release(); - }; - - enum { - DRAW_ALL = -1, // draw all - DRAW_INSIDE_ONLY, // draw only the part inside the clipping plane - DRAW_OUTSIDE_ONLY // draw only the part outside the clipping plane - }; - - if (m_use_clipping_plane == CLIPPING_PLANE_SOLID_HALF_ONLY) - { - renderer(DRAW_INSIDE_ONLY); - } - else - { - renderer(DRAW_ALL); - } - - rendering_program_p_l.release(); - } - - if(m_draw_rays) - { - rendering_program_p_l.bind(); - - vao[VAO_MONO_RAYS].bind(); - color.setRgbF((double)m_rays_mono_color.red()/(double)255, - (double)m_rays_mono_color.green()/(double)255, - (double)m_rays_mono_color.blue()/(double)255); - rendering_program_p_l.setAttributeValue("color",color); - glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_RAYS))); - vao[VAO_MONO_RAYS].release(); - - vao[VAO_COLORED_RAYS].bind(); - if (m_use_mono_color) - { - color.setRgbF((double)m_rays_mono_color.red()/(double)255, - (double)m_rays_mono_color.green()/(double)255, - (double)m_rays_mono_color.blue()/(double)255); - rendering_program_p_l.disableAttributeArray("color"); - rendering_program_p_l.setAttributeValue("color",color); - } - else - { - rendering_program_p_l.enableAttributeArray("color"); - } - glLineWidth(m_size_rays); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_RAYS))); - vao[VAO_COLORED_RAYS].release(); - - rendering_program_p_l.release(); - } - - if(m_draw_lines) - { - rendering_program_p_l.bind(); - - vao[VAO_MONO_LINES].bind(); - color.setRgbF((double)m_lines_mono_color.red()/(double)255, - (double)m_lines_mono_color.green()/(double)255, - (double)m_lines_mono_color.blue()/(double)255); - rendering_program_p_l.setAttributeValue("color",color); - glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_LINES))); - vao[VAO_MONO_LINES].release(); - - rendering_program_p_l.release(); - - vao[VAO_COLORED_LINES].bind(); - if (m_use_mono_color) - { - color.setRgbF((double)m_lines_mono_color.red()/(double)255, - (double)m_lines_mono_color.green()/(double)255, - (double)m_lines_mono_color.blue()/(double)255); - rendering_program_p_l.disableAttributeArray("color"); - rendering_program_p_l.setAttributeValue("color",color); - } - else - { - rendering_program_p_l.enableAttributeArray("color"); - } - glLineWidth(m_size_lines); - glDrawArrays(GL_LINES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_LINES))); - vao[VAO_COLORED_LINES].release(); - - rendering_program_p_l.release(); - } - - // Fix Z-fighting by drawing faces at a depth - GLfloat offset_factor; - GLfloat offset_units; - if (is_two_dimensional()) { - glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &offset_factor); - glGetFloatv(GL_POLYGON_OFFSET_UNITS, &offset_units); - glPolygonOffset(0.1f, 0.9f); - } - - if (m_draw_faces) - { - rendering_program_face.bind(); - - // reference: https://stackoverflow.com/questions/37780345/opengl-how-to-create-order-independent-transparency - // rendering_mode == -1: draw all as solid; - // rendering_mode == 0: draw solid only; - // rendering_mode == 1: draw transparent only; - auto renderer = [this, &color, &clipPlane, &plane_point](float rendering_mode) { - - vao[VAO_MONO_FACES].bind(); - color.setRgbF((double)m_faces_mono_color.red()/(double)255, - (double)m_faces_mono_color.green()/(double)255, - (double)m_faces_mono_color.blue()/(double)255); - rendering_program_face.setAttributeValue("color",color); - rendering_program_face.setUniformValue("rendering_mode", rendering_mode); - rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); - rendering_program_face.setUniformValue("clipPlane", clipPlane); - rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GS::POS_MONO_FACES))); - vao[VAO_MONO_FACES].release(); - - vao[VAO_COLORED_FACES].bind(); - if (m_use_mono_color) - { - color.setRgbF((double)m_faces_mono_color.red()/(double)255, - (double)m_faces_mono_color.green()/(double)255, - (double)m_faces_mono_color.blue()/(double)255); - rendering_program_face.disableAttributeArray("color"); - rendering_program_face.setAttributeValue("color",color); - } - else - { - rendering_program_face.enableAttributeArray("color"); - } - rendering_program_face.setUniformValue("rendering_mode", rendering_mode); - rendering_program_face.setUniformValue("rendering_transparency", clipping_plane_rendering_transparency); - rendering_program_face.setUniformValue("clipPlane", clipPlane); - rendering_program_face.setUniformValue("pointPlane", plane_point); - glDrawArrays(GL_TRIANGLES, 0, static_cast(gBuffer.number_of_elements(GS::POS_COLORED_FACES))); - vao[VAO_COLORED_FACES].release(); - }; - - auto renderer_clipping_plane = [this](bool clipping_plane_rendering) { - if (!isOpenGL_4_3()) return; - if (!clipping_plane_rendering) return; - // render clipping plane here - rendering_program_clipping_plane.bind(); - vao[VAO_CLIPPING_PLANE].bind(); - glLineWidth(0.1f); - glDrawArrays(GL_LINES, 0, static_cast((m_array_for_clipping_plane.size()/3))); - glLineWidth(1.0f); - vao[VAO_CLIPPING_PLANE].release(); - rendering_program_clipping_plane.release(); - }; - - enum { - DRAW_SOLID_ALL = -1, // draw all mesh in solid mode - DRAW_SOLID_HALF, // draw only the mesh inside the clipping plane as solid - DRAW_TRANSPARENT_HALF // draw only the mesh outside the clipping plane as transparent - }; - - if (m_use_clipping_plane == CLIPPING_PLANE_SOLID_HALF_TRANSPARENT_HALF) - { - // The z-buffer will prevent transparent objects from being displayed behind other transparent objects. - // Before rendering all transparent objects, disable z-testing first. - - // 1. draw solid first - renderer(DRAW_SOLID_HALF); - - // 2. draw transparent layer second with back face culling to avoid messy triangles - glDepthMask(false); //disable z-testing - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_CULL_FACE); - glCullFace(GL_BACK); - glFrontFace(GL_CW); - renderer(DRAW_TRANSPARENT_HALF); - - // 3. draw solid again without culling and blend to make sure the solid mesh is visible - glDepthMask(true); //enable z-testing - glDisable(GL_CULL_FACE); - glDisable(GL_BLEND); - renderer(DRAW_SOLID_HALF); - - // 4. render clipping plane here - renderer_clipping_plane(clipping_plane_rendering); - } - else if (m_use_clipping_plane == CLIPPING_PLANE_SOLID_HALF_WIRE_HALF || - m_use_clipping_plane == CLIPPING_PLANE_SOLID_HALF_ONLY) - { - // 1. draw solid HALF - renderer(DRAW_SOLID_HALF); - - // 2. render clipping plane here - renderer_clipping_plane(clipping_plane_rendering); - } - else - { - // 1. draw solid FOR ALL - renderer(DRAW_SOLID_ALL); - } - - if (is_two_dimensional()) - glPolygonOffset(offset_factor, offset_units); - - rendering_program_face.release(); - } - - if (m_draw_text) - { - glDisable(GL_LIGHTING); - for (std::size_t i=0; iprojectedCoordinatesOf - (CGAL::qglviewer::Vec(std::get<0>(m_texts_vec[i]).x(), - std::get<0>(m_texts_vec[i]).y(), - std::get<0>(m_texts_vec[i]).z())); - - drawText((int)screenPos[0], (int)screenPos[1], std::get<1>(m_texts_vec[i])); - } - glEnable(GL_LIGHTING); - } - - // Multiply matrix to get in the frame coordinate system. - // glMultMatrixd(manipulatedFrame()->matrix()); // Linker error - // Scale down the drawings - // glScalef(0.3f, 0.3f, 0.3f); // Linker error - // Draw an axis using the QGLViewer static function - // drawAxis(); - } - virtual void init() { set_camera_mode(); From d2d114cf2473839693d0aba3cef6408d6c7affe9 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 20 Nov 2023 09:33:28 +0100 Subject: [PATCH 239/399] Update code to follow last api --- Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp | 2 +- .../examples/Basic_viewer/draw_surface_mesh_small_faces.cpp | 2 +- Basic_viewer/include/CGAL/Graphics_scene.h | 6 +++--- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 4 ++-- Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h | 2 +- Nef_3/include/CGAL/draw_nef_3.h | 2 +- .../include/CGAL/draw_periodic_2_triangulation_2.h | 2 +- Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index 945680df1477..e1680f30eccc 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -71,7 +71,7 @@ int main(void) CGAL::Qt::Basic_viewer bv1(mainWindow, scene1); CGAL::Qt::Basic_viewer bv2(mainWindow, scene2); - bv1.set_draw_vertices(true); + bv1.draw_vertices(true); layout->addWidget(&bv1); layout->addWidget(&bv2); diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index aba2a0e1b037..555363d72711 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -106,7 +106,7 @@ int main(int argc, char* argv[]) if(app) { app.basic_viewer().on_key_pressed= - [&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index 4caddad03435..fd9b2bd9ed74 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -239,7 +239,7 @@ class Graphics_scene void face_begin() { - if (is_a_face_started()) + if (a_face_started()) { std::cerr << "You cannot start a new face before to finish the previous one." @@ -251,7 +251,7 @@ class Graphics_scene void face_begin(const CGAL::IO::Color &acolor) { - if (is_a_face_started()) + if (a_face_started()) { std::cerr << "You cannot start a new face before to finish the previous one." @@ -342,7 +342,7 @@ class Graphics_scene // Returns true if the data structure lies on a XY or XZ or YZ plane bool is_two_dimensional() const { - return (!is_empty() && (has_zero_x() || has_zero_y() || has_zero_z())); + return (!empty() && (has_zero_x() || has_zero_y() || has_zero_z())); } void clear() diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 73cb5a2f9e61..82187ce85ae6 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -155,7 +155,7 @@ class Basic_viewer : public CGAL::QGLViewer resize(CGAL_BASIC_VIEWER_INIT_SIZE_X, CGAL_BASIC_VIEWER_INIT_SIZE_Y); if (inverse_normal) - { reverse_normals(); } + { reverse_all_normals(); } } ~Basic_viewer() @@ -1254,7 +1254,7 @@ class Basic_viewer : public CGAL::QGLViewer } else if ((e->key()==::Qt::Key_N) && (modifiers==::Qt::NoButton)) { - reverse_normals(); + reverse_all_normals(); displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false")); redraw(); } diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index d95561e83e0f..0d83d0a4a529 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -164,7 +164,7 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer */ virtual void add_elements() { - this->clear(); + graphics_scene.clear(); std::vector pwhs; m_ps.polygons_with_holes(std::back_inserter(pwhs)); for (const auto& pwh : pwhs) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 452185e26c4c..833db0d0188d 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -232,7 +232,7 @@ void compute_elements(const Nef_Polyhedron &nef, { nef.visit_shell_objects(SFace_const_handle(it), V); } } - graphics_scene.negate_all_normals(); + graphics_scene.reverse_all_normals(); } } // namespace draw_function_for_nef_polyhedron diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 7a423e66fae6..aca45e789d1e 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -41,7 +41,7 @@ struct Graphics_scene_options_periodic_2_triangulation_2 : { return m_draw_domain; } void set_draw_domain(bool b) { m_draw_domain=b; } - void negate_draw_domain() + void toggle_draw_domain() { m_draw_domain=!m_draw_domain; } typename DS::Iterator_type current_display_type() const diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index d7831e8ccdfe..831a66810849 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -46,12 +46,12 @@ struct Graphics_scene_options_voronoi : void disable_voronoi_vertices() { m_draw_voronoi_vertices=false; } void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; } bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; } - void negate_draw_voronoi_vertices() { m_draw_voronoi_vertices=!m_draw_voronoi_vertices; } + void toggle_draw_voronoi_vertices() { m_draw_voronoi_vertices=!m_draw_voronoi_vertices; } void disable_dual_vertices() { m_draw_dual_vertices=false; } void enable_dual_vertices() { m_draw_dual_vertices=true; } bool are_dual_vertices_enabled() const { return m_draw_dual_vertices; } - void negate_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; } + void toggle_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; } CGAL::IO::Color dual_vertex_color; CGAL::IO::Color ray_color; @@ -394,7 +394,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) { - basic_viewer->negate_draw_rays(); + basic_viewer->toggle_draw_rays(); basic_viewer->displayMessage (QString("Draw rays=%1.").arg(basic_viewer->get_draw_rays()?"true":"false")); From db9ca1a3fbd51b2a7a00c58f97cbca50f8c1adad Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 20 Nov 2023 09:37:36 +0100 Subject: [PATCH 240/399] reverse all normals --- Basic_viewer/include/CGAL/Graphics_scene.h | 2 +- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index fd9b2bd9ed74..1d1def2810b4 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -158,7 +158,7 @@ class Graphics_scene update_bounding_box(lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox()); } - void reverse_normals() const + void reverse_all_normals() const { m_buffer_for_mono_faces.negate_normals(); m_buffer_for_colored_faces.negate_normals(); diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 82187ce85ae6..4d54c9958e2f 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -260,7 +260,7 @@ class Basic_viewer : public CGAL::QGLViewer void reverse_all_normals() { m_inverse_normal=!m_inverse_normal; - gBuffer.reverse_normals(); + gBuffer.reverse_all_normals(); } // Returns true if the data structure lies on a plane From 12e7492f33ed55264266ea9f8b798236d08bc1b1 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 20 Nov 2023 10:19:19 +0100 Subject: [PATCH 241/399] update draw --- .../CGAL/draw_periodic_2_triangulation_2.h | 10 ++++------ .../include/CGAL/draw_voronoi_diagram_2.h | 18 +++++++----------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index aca45e789d1e..c3a7bafca673 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -242,12 +242,12 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, typename CGAL_P2T2_TYPE::Periodic_triangle_iterator> gs_options; add_to_graphics_scene(ap2t2, buffer, gs_options); - QApplication_and_basic_viewer app(buffer, title); + CGAL::Qt::QApplication_and_basic_viewer app(buffer, title); if(app) { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&ap2t2, &gs_options] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool + [&ap2t2, &buffer, &gs_options] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) @@ -258,10 +258,8 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, (gs_options.current_display_type()==1?"Unique": (gs_options.current_display_type()==2?"Stored cover": "Unique cover")))); - basic_viewer->clear(); - draw_function_for_P2T2::compute_elements(ap2t2, - basic_viewer->get_graphics_scene(), - gs_options); + buffer.clear(); + draw_function_for_P2T2::compute_elements(ap2t2, buffer, gs_options); basic_viewer->redraw(); } else diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 831a66810849..79c3501bf81e 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -384,19 +384,19 @@ void draw(const CGAL_VORONOI_TYPE& av2, add_to_graphics_scene(av2, buffer, gs_options); - QApplication_and_basic_viewer app(buffer, title); + CGAL::Qt::QApplication_and_basic_viewer app(buffer, title); if(app) { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&av2, &gs_options] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool + [&av2, &buffer, &gs_options] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) { basic_viewer->toggle_draw_rays(); basic_viewer->displayMessage - (QString("Draw rays=%1.").arg(basic_viewer->get_draw_rays()?"true":"false")); + (QString("Draw rays=%1.").arg(basic_viewer->draw_rays()?"true":"false")); basic_viewer->redraw(); } @@ -410,10 +410,8 @@ void draw(const CGAL_VORONOI_TYPE& av2, (QString("Voronoi vertices=%1."). arg(gs_options.are_voronoi_vertices_enabled()?"true":"false")); - basic_viewer->clear(); - draw_function_for_v2::compute_elements(av2, - basic_viewer->get_graphics_scene(), - gs_options); + buffer.clear(); + draw_function_for_v2::compute_elements(av2, buffer, gs_options); basic_viewer->redraw(); } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) @@ -425,10 +423,8 @@ void draw(const CGAL_VORONOI_TYPE& av2, basic_viewer->displayMessage(QString("Dual vertices=%1."). arg(gs_options.are_dual_vertices_enabled()?"true":"false")); - basic_viewer->clear(); - draw_function_for_v2::compute_elements(av2, - basic_viewer->get_graphics_scene(), - gs_options); + buffer.clear(); + draw_function_for_v2::compute_elements(av2, buffer, gs_options); basic_viewer->redraw(); } else From c379872a79a38e365f8cb364f3bd5ec2e0ee6106 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 20 Nov 2023 18:24:17 +0100 Subject: [PATCH 242/399] draw polygon set --- .../include/CGAL/draw_polygon_set_2.h | 181 ++++++++++++++---- Polygon/include/CGAL/draw_polygon_2.h | 44 ++--- 2 files changed, 163 insertions(+), 62 deletions(-) diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index 0d83d0a4a529..c735670a4bd1 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -46,6 +46,41 @@ void draw(const PS& aps); namespace CGAL { +template +struct Graphics_scene_options_polygon_set_2 : + public CGAL::Graphics_scene_options +{ + void unbounded_face_color(const CGAL::IO::Color& c) + { m_unbounded_face_color=c; } + const CGAL::IO::Color& unbounded_face_color() const + { return m_unbounded_face_color; } + + bool draw_unbounded() const + { return m_draw_unbounded; } + void draw_unbounded(bool b) const + { m_draw_unbounded=b; } + void toggle_draw_unbounded() + { m_draw_unbounded=!m_draw_unbounded; } + + int height() const + { return m_height; } + int width() const + { return m_width; } + + void height(int i) + { m_height=i; } + void width(int i) + { m_width=i; } + +protected: + bool m_draw_unbounded=true; + CGAL::IO::Color m_unbounded_face_color=CGAL::IO::Color(75,160,255); + int m_width=0, m_height=0; +}; + namespace draw_function_for_boolean_set_2 { template @@ -53,23 +88,57 @@ void compute_loop(const typename PS2::Polygon_2& p, bool hole, CGAL::Graphics_scene& gs, const GSOptions& gso) { - if (hole) + if (gso.are_faces_enabled() && hole) { gs.add_point_in_face(p.vertex(p.size()-1)); } auto prev = p.vertices_begin(); auto it = prev; - gs.add_point(*it); - gs.add_point_in_face(*it); - for (++it; it != p.vertices_end(); ++it) + + if (gso.are_vertices_enabled() && + gso.draw_vertex(p, it)) + { + if(gso.colored_vertex(p, it)) + { gs.add_point(*it, gso.vertex_color(p, it)); } + else + { gs.add_point(*it); } + } + + if (gso.are_faces_enabled()) + { gs.add_point_in_face(*it); } + + for (++it; it!=p.vertices_end(); ++it) { - gs.add_point(*it); // add vertex - gs.add_segment(*prev, *it); // add segment with previous point - gs.add_point_in_face(*it); // add point in face + if (gso.are_vertices_enabled() && + gso.draw_vertex(p, it)) + { // Add point + if(gso.colored_vertex(p, it)) + { gs.add_point(*it, gso.vertex_color(p, it)); } + else + { gs.add_point(*it); } + } + + if (gso.are_edges_enabled() && + gso.draw_edge(p, prev)) + { // Add segment with previous point + if(gso.colored_edge(p, prev)) + { gs.add_segment(*prev, *it, gso.edge_color(p, prev)); } + else + { gs.add_segment(*prev, *it); } + } + + if (gso.are_faces_enabled()) + { gs.add_point_in_face(*it); } // add point in face prev = it; } - // Add the last segment between the last point and the first one - gs.add_segment(*prev, *(p.vertices_begin())); + if (gso.are_edges_enabled() && + gso.draw_edge(p, prev)) + { // Add the last segment between the last point and the first one + if(gso.colored_edge(p, prev)) + { gs.add_segment(*prev, *(p.vertices_begin()), gso.edge_color(p, prev)); } + else + { gs.add_segment(*prev, *(p.vertices_begin())); } + } } /// Compute the elements of a polygon with holes. @@ -80,41 +149,44 @@ void compute_elements(const PWH& pwh, { if (!gso.draw_unbounded() && pwh.outer_boundary().is_empty()) return; - CGAL::IO::Color c(75,160,255); - gs.face_begin(c); + if (gso.are_faces_enabled()) + { gs.face_begin(gso.unbounded_face_color()); } - const typename PWH::Point_2* point_in_face; - if (pwh.outer_boundary().is_empty()) + using Pnt=typename PWH::Polygon_2::Point_2; + const Pnt* point_in_face=nullptr; + if (pwh.outer_boundary().is_empty() && (gso.width()!=0 || gso.height()!=0)) { typename PWH::Polygon_2 pgn; pgn.push_back(Pnt(-gso.width(), -gso.height())); pgn.push_back(Pnt(gso.width(), -gso.height())); pgn.push_back(Pnt(gso.width(), gso.height())); pgn.push_back(Pnt(-gso.width(), gso.height())); - compute_loop(pgn, false, gs); + draw_function_for_boolean_set_2::compute_loop(pgn, false, gs, gso); point_in_face = &(pgn.vertex(pgn.size()-1)); } else { const auto& outer_boundary = pwh.outer_boundary(); - compute_loop(outer_boundary, false, gs); + draw_function_for_boolean_set_2::compute_loop(outer_boundary, false, gs, gso); point_in_face = &(outer_boundary.vertex(outer_boundary.size()-1)); } for (auto it = pwh.holes_begin(); it != pwh.holes_end(); ++it) { - compute_loop(*it, true, gs); - gs.add_point_in_face(*point_in_face); + draw_function_for_boolean_set_2::compute_loop(*it, true, gs, gso); + if (gso.are_faces_enabled()) + { gs.add_point_in_face(*point_in_face); } } - gs.face_end(); + if (gso.are_faces_enabled()) + { gs.face_end(); } } } // End namespace draw_function_for_boolean_set_2 #ifdef CGAL_USE_BASIC_VIEWER -template +template class Polygon_set_2_basic_viewer_qt : public Basic_viewer { using Base = Basic_viewer; @@ -125,12 +197,11 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer public: Polygon_set_2_basic_viewer_qt(QWidget* parent, const Ps& ps, - const char* title = "Basic Polygon_set_2 Viewer", - bool draw_unbounded = false, - bool draw_vertices = false) : - Base(parent, graphics_scene, title, draw_vertices), + GSOptions& gs_options, + const char* title = "Basic Polygon_set_2 Viewer") : + Base(parent, graphics_scene, title), m_ps(ps), - m_draw_unbounded(draw_unbounded) + gso(gs_options) { if (ps.is_empty()) return; @@ -146,11 +217,12 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer */ virtual void resizeGL(int width, int height) { CGAL::QGLViewer::resizeGL(width, height); - m_width = width; - m_height = height; + gso.width(width); + gso.height(height); CGAL::qglviewer::Vec p; auto ratio = this->camera()->pixelGLRatio(p); - if (ratio != m_pixel_ratio) { + if (ratio != m_pixel_ratio) + { m_pixel_ratio = ratio; add_elements(); } @@ -168,7 +240,7 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer std::vector pwhs; m_ps.polygons_with_holes(std::back_inserter(pwhs)); for (const auto& pwh : pwhs) - { compute_elements(pwh, graphics_scene, graphics_scene_options); } + { draw_function_for_boolean_set_2::compute_elements(pwh, graphics_scene, gso); } } /*! Compute the bounding box. @@ -205,15 +277,37 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer bool m_draw_unbounded = false; Graphics_scene graphics_scene; - Graphics_scene_options graphics_scene_options; + GSOptions& gso; }; -// Specialization of draw function. +#endif // CGAL_USE_BASIC_VIEWER + +#define CGAL_PS2_TYPE CGAL::Polygon_set_2 + +// Specializations of add_to_graphics_scene function +template +void add_to_graphics_scene(const CGAL_PS2_TYPE& ap2, + CGAL::Graphics_scene& graphics_scene, + const GSOptions& gso) +{ draw_function_for_boolean_set_2::compute_elements(ap2, graphics_scene, gso); } + template -void draw(const CGAL::Polygon_set_2& ps, - const char* title = "Polygon_set_2 Basic Viewer", - bool draw_vertices = false, - bool draw_unbounded = false) +void add_to_graphics_scene(const CGAL_PS2_TYPE& ap2, + CGAL::Graphics_scene &graphics_scene) +{ + CGAL::Graphics_scene_options_polygon_set_2 gso; + draw_function_for_boolean_set_2::compute_elements(ap2, graphics_scene, gso); +} + +#ifdef CGAL_USE_BASIC_VIEWER + +// Specialization of draw function. +template +void draw(const CGAL_PS2_TYPE& ps, GSOptions& gso, + const char* title = "Polygon_set_2 Basic Viewer") { #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; @@ -224,21 +318,30 @@ void draw(const CGAL::Polygon_set_2& ps, if (! cgal_test_suite) { using Ps = CGAL::Polygon_set_2; - using Viewer = Polygon_set_2_basic_viewer_qt; + using Viewer = Polygon_set_2_basic_viewer_qt; CGAL::Qt::init_ogl_context(4,3); int argc = 1; const char* argv[2] = {"t2_viewer", nullptr}; QApplication app(argc, const_cast(argv)); - Viewer basic_viewer(app.activeWindow(), ps, - title, draw_unbounded, draw_vertices); - basic_viewer.add_elements(); + Viewer basic_viewer(app.activeWindow(), ps, gso, title); basic_viewer.show(); app.exec(); } } -} // End namespace CGAL +template +void draw(const CGAL_PS2_TYPE& ps, + const char* title = "Polygon_set_2 Basic Viewer") +{ + CGAL::Graphics_scene_options_polygon_set_2 gso; + draw(ps, gso, title); +} #endif // CGAL_USE_BASIC_VIEWER +} // End namespace CGAL + #endif // CGAL_DRAW_POLYGON_SET_2_H diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 1b2b211ac5e7..42ef92d12c62 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -49,17 +49,17 @@ namespace draw_function_for_p2 { template void compute_elements(const P2& p2, CGAL::Graphics_scene &graphics_scene, - const GSOptions& gs_options) + const GSOptions& gso) { if (p2.is_empty()) return; typename P2::Point_2 prev=p2.vertex(p2.size()-1); - if (gs_options.are_faces_enabled()) + if (gso.are_faces_enabled()) { - if(gs_options.colored_face(p2, nullptr)) - { graphics_scene.face_begin(gs_options.face_color(p2, nullptr)); } + if(gso.colored_face(p2, nullptr)) + { graphics_scene.face_begin(gso.face_color(p2, nullptr)); } else { graphics_scene.face_begin(); } } @@ -67,31 +67,31 @@ void compute_elements(const P2& p2, for (typename P2::Vertex_const_iterator i=p2.vertices_begin(); i!=p2.vertices_end(); ++i) { - if(gs_options.are_vertices_enabled() && - gs_options.draw_vertex(p2, i)) + if(gso.are_vertices_enabled() && + gso.draw_vertex(p2, i)) { // Add vertex - if(gs_options.colored_vertex(p2, i)) - { graphics_scene.add_point(*i, gs_options.vertex_color(p2, i)); } + if(gso.colored_vertex(p2, i)) + { graphics_scene.add_point(*i, gso.vertex_color(p2, i)); } else { graphics_scene.add_point(*i); } } - if(gs_options.are_edges_enabled() && - gs_options.draw_edge(p2, i)) + if(gso.are_edges_enabled() && + gso.draw_edge(p2, i)) { // Add edge with previous point - if(gs_options.colored_vertex(p2, i)) - { graphics_scene.add_segment(prev, *i, gs_options.edge_color(p2, i)); } + if(gso.colored_edge(p2, i)) + { graphics_scene.add_segment(prev, *i, gso.edge_color(p2, i)); } else { graphics_scene.add_segment(prev, *i); } } - if(gs_options.are_faces_enabled()) + if(gso.are_faces_enabled()) { graphics_scene.add_point_in_face(*i); } // Add point in face prev = *i; } - if (gs_options.are_faces_enabled()) + if (gso.are_faces_enabled()) { graphics_scene.face_end(); } } @@ -100,12 +100,11 @@ void compute_elements(const P2& p2, #define CGAL_P2_TYPE CGAL::Polygon_2 // Specializations of add_to_graphics_scene function - template void add_to_graphics_scene(const CGAL_P2_TYPE& ap2, CGAL::Graphics_scene& graphics_scene, - const GSOptions& gs_options) -{ draw_function_for_p2::compute_elements(ap2, graphics_scene, gs_options); } + const GSOptions& gso) +{ draw_function_for_p2::compute_elements(ap2, graphics_scene, gso); } template void add_to_graphics_scene(const CGAL_P2_TYPE& ap2, @@ -114,14 +113,13 @@ void add_to_graphics_scene(const CGAL_P2_TYPE& ap2, CGAL::Graphics_scene_options gs_options; - draw_function_for_p2::compute_elements(ap2, graphics_scene, gs_options); + void*> gso; + draw_function_for_p2::compute_elements(ap2, graphics_scene, gso); } -// Specialization of draw function. - #ifdef CGAL_USE_BASIC_VIEWER +// Specialization of draw function. template void draw(const CGAL_P2_TYPE &ap2, const char *title="Polygon_2 Basic Viewer") @@ -133,11 +131,11 @@ void draw(const CGAL_P2_TYPE &ap2, template void draw(const CGAL_P2_TYPE &ap2, - const GSOptions& gs_options, + const GSOptions& gso, const char *title="Polygon_2 Basic Viewer") { CGAL::Graphics_scene buffer; - add_to_graphics_scene(ap2, buffer, gs_options); + add_to_graphics_scene(ap2, buffer, gso); draw_graphics_scene(buffer, title); } From 28ec0e65349ef6ffe27bab74c8003dc665d209dd Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 21 Nov 2023 09:42:57 +0100 Subject: [PATCH 243/399] draw fg with paths (nyf) --- .../include/CGAL/draw_face_graph_with_paths.h | 113 ++++++++---------- 1 file changed, 53 insertions(+), 60 deletions(-) diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 75e772ac603e..8b22d30faa3c 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -15,7 +15,6 @@ #include -#include #include #include @@ -38,7 +37,7 @@ template { - Graphics_scene_options_face_graph_with_paths(std::size_t nbpaths): m_nbpaths(nbpaths) + Graphics_scene_options_face_graph_with_paths() { color_of_path=[](std::size_t i)->CGAL::IO::Color { @@ -47,14 +46,11 @@ struct Graphics_scene_options_face_graph_with_paths : }; draw_path=[](std::size_t)->bool - { return true; } + { return true; }; } std::function color_of_path; std::function draw_path; - -protected: - std::size_t m_nbpaths; }; namespace draw_function_for_lcc @@ -146,9 +142,9 @@ void compute_face(const Mesh& mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, CGAL::Graphics_scene& graphics_scene, - GSOptions& gs_options) + GSOptions& gso) { - if(!gs_options.draw_face(lcc, dh)) + if(!gso.draw_face(lcc, dh)) { return; } typedef typename Get_map::type LCC; @@ -170,8 +166,8 @@ void compute_face(const Mesh& mesh, } while(cur!=dh); - if(gs_options.colored_face(lcc, dh)) - { graphics_scene.face_begin(gs_options.face_color(lcc, dh)); } + if(gso.colored_face(lcc, dh)) + { graphics_scene.face_begin(gso.face_color(lcc, dh)); } else { graphics_scene.face_begin(); } @@ -192,12 +188,12 @@ template void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - typename Get_map::type::size_type aamark, + typename Get_map::type::size_type amark, CGAL::Graphics_scene& graphics_scene, - GSOptions& gs_options, + GSOptions& gso, bool draw_marked_darts=true) { - if(!gs_options.draw_edge(lcc, dh)) + if(!gso.draw_edge(lcc, dh)) { return; } typedef typename Get_map::type LCC; @@ -242,19 +238,18 @@ template void compute_vertex(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, CGAL::Graphics_scene& graphics_scene, - GSOptions& gs_options) + GSOptions& gso) { - typedef typename CGAL::Get_traits::Kernel Kernel; - typedef typename CGAL::Get_traits::Point Point; - typedef typename CGAL::Get_traits::Vector Vector; - graphics_scene.add_point(get_point(mesh, dh)); + if(gso.draw_vertex(mesh, dh)) + { graphics_scene.add_point(get_point(mesh, dh)); } } -template +template void compute_path(const Mesh &mesh, const typename Get_map::storage_type& lcc, CGAL::Graphics_scene &graphics_scene, - const std::vector>* m_paths, + const GSOptions &gso, + const std::vector>* paths, std::size_t i, typename Get_map::type::size_type amark) { @@ -263,19 +258,19 @@ void compute_path(const Mesh &mesh, typedef typename CGAL::Get_traits::Point Point; typedef typename CGAL::Get_traits::Vector Vector; - if ((*m_paths)[i].is_empty() || !gs_options.draw_path(i)) + if ((*paths)[i].is_empty() || !gso.draw_path(i)) { return; } CGAL::Random random(static_cast(i)); CGAL::IO::Color color = get_random_color(random); - graphics_scene.add_point(get_point(mesh, (*m_paths)[i].get_ith_dart(0)), color); - for (std::size_t j=0; j<(*m_paths)[i].length(); ++j) + graphics_scene.add_point(get_point(mesh, (*paths)[i].get_ith_dart(0)), color); + for (std::size_t j=0; j<(*paths)[i].length(); ++j) { - if ( !lcc.is_marked( (*m_paths)[i].get_ith_dart(j), amark) ) + if ( !lcc.is_marked( (*paths)[i].get_ith_dart(j), amark) ) { - compute_edge(mesh, lcc, (*m_paths)[i].get_ith_dart(j), color, mesh, graphics_scene, lcc); - lcc.template mark_cell<1>((*m_paths)[i].get_ith_dart(j), amark); + compute_edge(mesh, lcc, (*paths)[i].get_ith_dart(j), color, graphics_scene); + lcc.template mark_cell<1>((*paths)[i].get_ith_dart(j), amark); } } } @@ -283,9 +278,9 @@ void compute_path(const Mesh &mesh, template void compute_elements(const Mesh &mesh, CGAL::Graphics_scene &graphics_scene, - const GSOptions &m_gs_options, - const std::vector>* m_paths, - typename Get_map::type::size_type amark) + const GSOptions &gso, + const std::vector>* paths, + typename Get_map::type::size_type mark) { typedef typename Get_map::type LCC; typedef typename LCC::size_type size_type; @@ -295,27 +290,27 @@ void compute_elements(const Mesh &mesh, typedef typename CGAL::Get_traits::Vector Vector; typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; - typename Get_map::storage_type alcc(mesh); - typename LCC::Dart_range::const_iterator m_current_dart = lcc.darts().end(); - typename LCC::size_type m_oriented_mark = lcc.get_new_mark(); - std::size_t m_current_path = m_paths->size(); - typename LCC::size_type amark=amark==(std::numeric_limits::max)()? - LCC::INVALID_MARK:amark; // If !=INVALID_MARK, show darts marked with this mark + typename Get_map::storage_type lcc(mesh); + typename LCC::Dart_range::const_iterator current_dart = lcc.darts().end(); + typename LCC::size_type oriented_mark = lcc.get_new_mark(); + std::size_t current_path = paths->size(); + typename LCC::size_type amark=mark==(std::numeric_limits::max)()? + LCC::INVALID_MARK:mark; // If !=INVALID_MARK, show darts marked with this mark - lcc.orient(m_oriented_mark); + lcc.orient(oriented_mark); 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(); - if (m_current_dart!=lcc.darts().end()) + /* if (current_dart!=lcc.darts().end()) { // We want to draw only one dart - Dart_const_descriptor selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); + Dart_const_descriptor selected_dart=current_dart; //lcc.dart_handle(current_dart); compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphics_scene, lcc); lcc.template mark_cell<1>(selected_dart, markedges); compute_vertex(selected_dart, mesh, graphics_scene); - if ( !m_nofaces ) + if (gso.are_faces_enabled()) { compute_face(selected_dart, mesh, graphics_scene, lcc); } for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), @@ -328,35 +323,35 @@ void compute_elements(const Mesh &mesh, } } } - else + else */ { - if (m_current_path==m_paths->size()) + if (current_path==paths->size()) { - for (std::size_t i=0; isize(); ++i) - { compute_path(i, markedges, mesh, graphics_scene, m_paths, lcc); } + for (std::size_t i=0; isize(); ++i) + { compute_path(mesh, lcc, graphics_scene, gso, paths, i, markedges); } } - else if (m_current_path!=m_paths->size()+1) - { compute_path(m_current_path, markedges, mesh, graphics_scene, m_paths, lcc); } + else if (current_path!=paths->size()+1) + { compute_path(mesh, lcc, graphics_scene, gso, paths, current_path, markedges); } 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) && - !lcc.is_perforated(it) && lcc.is_marked(it, m_oriented_mark)) + if (gso.are_faces_enabled() && !lcc.is_marked(it, markfaces) && + !lcc.is_perforated(it) && lcc.is_marked(it, oriented_mark)) { - compute_face(it, mesh, graphics_scene, lcc); + compute_face(mesh, lcc, it, graphics_scene, gso); lcc.template mark_cell<2>(it, markfaces); } if ( !lcc.is_marked(it, markedges) ) { - compute_edge(it, mesh, graphics_scene, lcc, amark, draw_marked_darts); + compute_edge(mesh, lcc, it, amark, graphics_scene, gso, draw_marked_darts); lcc.template mark_cell<1>(it, markedges); } if ( !lcc.is_marked(it, markvertices) ) { - compute_vertex(it, mesh, graphics_scene); + compute_vertex(mesh, it, graphics_scene, gso); lcc.template mark_cell<0>(it, markvertices); } } @@ -372,15 +367,13 @@ void compute_elements(const Mesh &mesh, template void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, + const GSOptions& gso, const std::vector>* paths, - const GSOptions& gs_options, typename Get_map::type::size_type amark= typename Get_map::type::INVALID_MARK) { - draw_function_for_face_graph_with_paths::compute_elements(mesh, - graphics_scene, - gs_options, - paths, amark); + draw_function_for_face_graph_with_paths::compute_elements(mesh, graphics_scene, + gso, paths, amark); } template @@ -391,13 +384,13 @@ void add_to_graphics_scene(const Mesh& mesh, typename Get_map::type::INVALID_MARK) { // Default graphics view options. - Graphics_scene_options::type::Dart_const_descriptor /*vh*/, typename Get_map::type::Dart_const_descriptor /*eh*/, typename Get_map::type::Dart_const_descriptor /*fh*/> - gs_options; + gso; - add_to_graphics_scene(mesh, graphics_scene, gs_options, paths, amark); + add_to_graphics_scene(mesh, graphics_scene, gso, paths, amark); } #ifdef CGAL_USE_BASIC_VIEWER @@ -417,13 +410,13 @@ void draw(const Mesh& mesh, template void draw(const Mesh& mesh, const std::vector >& paths, - const GSOptions& gs_options, + const GSOptions& gso, typename Get_map::type::size_type amark= (std::numeric_limits::type::size_type>::max)(), const char* title="Mesh Viewer With Path") { CGAL::Graphics_scene buffer; - add_to_graphics_scene(mesh, buffer, gs_options, &paths, amark); + add_to_graphics_scene(mesh, buffer, gso, &paths, amark); draw_graphics_scene(buffer, title); } From 2c77ba397c41ab17b4c04a418c2e9593e45b5811 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 29 Nov 2023 15:50:26 +0100 Subject: [PATCH 244/399] draw face graph with path --- .../examples/Basic_viewer/CMakeLists.txt | 6 +- .../include/CGAL/draw_linear_cell_complex.h | 71 +++--- .../include/CGAL/draw_face_graph_with_paths.h | 215 +++++++----------- 3 files changed, 115 insertions(+), 177 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt index 2ba9f5b9dae8..6b3bdddd1969 100644 --- a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt +++ b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt @@ -9,8 +9,8 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Basic_viewer_Examples) -#CGAL_Qt5 is needed for the drawing. -find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) +#CGAL_Qt6 is needed for the drawing. +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) find_package(Eigen3 3.1.0) include(CGAL_Eigen3_support) @@ -19,7 +19,7 @@ create_single_source_cgal_program("draw_several_windows.cpp") create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") create_single_source_cgal_program("draw_surface_mesh_height.cpp") -if(CGAL_Qt5_FOUND) +if(CGAL_Qt6_FOUND) #link it with the required CGAL libraries target_link_libraries(draw_mesh_and_points PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_several_windows PUBLIC CGAL::CGAL_Basic_viewer) 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 652935b14447..e9e98ecc6b7f 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -62,10 +62,10 @@ void compute_face(const LCC& lcc, typename LCC::Dart_const_handle dh, typename LCC::Dart_const_handle voldh, CGAL::Graphics_scene& graphics_scene, - const GSOptionsLCC& gs_options) + const GSOptionsLCC& gso) { - if (!gs_options.are_faces_enabled() || - !gs_options.draw_face(lcc, dh)) + if (!gso.are_faces_enabled() || + !gso.draw_face(lcc, dh)) { return; } // We fill only closed faces. @@ -78,13 +78,13 @@ void compute_face(const LCC& lcc, } while (cur!=dh); - if (gs_options.colored_volume(lcc, voldh)) + if (gso.colored_volume(lcc, voldh)) { - graphics_scene.face_begin(gs_options.volume_color(lcc, voldh)); + graphics_scene.face_begin(gso.volume_color(lcc, voldh)); } - else if (gs_options.colored_face(lcc, dh)) + else if (gso.colored_face(lcc, dh)) { - graphics_scene.face_begin(gs_options.face_color(lcc, dh)); + graphics_scene.face_begin(gso.face_color(lcc, dh)); } else { graphics_scene.face_begin(); } @@ -106,20 +106,20 @@ template void compute_edge(const LCC& lcc, typename LCC::Dart_const_handle dh, CGAL::Graphics_scene& graphics_scene, - const GSOptions& gs_options) + const GSOptions& gso) { - if (!gs_options.are_edges_enabled() || - !gs_options.draw_edge(lcc, dh)) + if (!gso.are_edges_enabled() || + !gso.draw_edge(lcc, dh)) { return; } const typename LCC::Point& p1=lcc.point(dh); typename LCC::Dart_const_handle d2=lcc.other_extremity(dh); if (d2!=LCC::null_descriptor) { - if (gs_options.colored_edge(lcc, dh)) + if (gso.colored_edge(lcc, dh)) { graphics_scene.add_segment(p1, lcc.point(d2), - gs_options.edge_color(lcc, dh)); + gso.edge_color(lcc, dh)); } else { graphics_scene.add_segment(p1, lcc.point(d2)); } @@ -130,16 +130,15 @@ template void compute_vertex(const LCC& lcc, typename LCC::Dart_const_handle dh, CGAL::Graphics_scene& graphics_scene, - const GSOptionsLCC& gs_options) + const GSOptionsLCC& gso) { - if (!gs_options.are_vertices_enabled() || - !gs_options.draw_vertex(lcc, dh)) + if (!gso.are_vertices_enabled() || !gso.draw_vertex(lcc, dh)) { return; } - if (gs_options.colored_vertex(lcc, dh)) + if (gso.colored_vertex(lcc, dh)) { graphics_scene.add_point(lcc.point(dh), - gs_options.vertex_color(lcc, dh)); + gso.vertex_color(lcc, dh)); } else { graphics_scene.add_point(lcc.point(dh)); } @@ -148,7 +147,7 @@ void compute_vertex(const LCC& lcc, template void compute_elements(const LCC& lcc, CGAL::Graphics_scene& graphics_scene, - const GSOptions& gs_options) + const GSOptions& gso) { typename LCC::size_type markvolumes = lcc.get_new_mark(); typename LCC::size_type markfaces = lcc.get_new_mark(); @@ -162,7 +161,7 @@ void compute_elements(const LCC& lcc, itend=lcc.darts().end(); it!=itend; ++it) { if (!lcc.is_marked(it, markvolumes) && - gs_options.draw_volume(lcc, it)) + gso.draw_volume(lcc, it)) { for(typename LCC::template Dart_of_cell_basic_range<3>::const_iterator itv=lcc.template darts_of_cell_basic<3>(it, markvolumes).begin(), @@ -172,13 +171,13 @@ void compute_elements(const LCC& lcc, lcc.mark(itv, markvolumes); if (!lcc.is_marked(itv, markfaces) && lcc.is_marked(itv, oriented_mark) && - gs_options.draw_face(lcc, itv)) + gso.draw_face(lcc, itv)) { - if ((!gs_options.volume_wireframe(lcc, itv) || + if ((!gso.volume_wireframe(lcc, itv) || (!lcc.template is_free<3>(itv) && - !gs_options.volume_wireframe(lcc, lcc.template opposite<3>(itv)))) && - !gs_options.face_wireframe(lcc, itv)) - { compute_face(lcc, itv, it, graphics_scene, gs_options); } + !gso.volume_wireframe(lcc, lcc.template opposite<3>(itv)))) && + !gso.face_wireframe(lcc, itv)) + { compute_face(lcc, itv, it, graphics_scene, gso); } for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator itf=lcc.template darts_of_cell_basic<2>(itv, markfaces).begin(), itfend=lcc.template darts_of_cell_basic<2>(itv, markfaces).end(); @@ -186,9 +185,9 @@ void compute_elements(const LCC& lcc, { lcc.mark(itf, markfaces); if (!lcc.is_marked(itf, markedges) && - gs_options.draw_edge(lcc, itf)) + gso.draw_edge(lcc, itf)) { - compute_edge(lcc, itf, graphics_scene, gs_options); + compute_edge(lcc, itf, graphics_scene, gso); for(typename LCC::template Dart_of_cell_basic_range<1>::const_iterator ite=lcc.template darts_of_cell_basic<1>(itf, markedges).begin(), iteend=lcc.template darts_of_cell_basic<1>(itf, markedges).end(); @@ -196,9 +195,9 @@ void compute_elements(const LCC& lcc, { lcc.mark(ite, markedges); if (!lcc.is_marked(ite, markvertices) && - gs_options.draw_vertex(lcc, ite)) + gso.draw_vertex(lcc, ite)) { - compute_vertex(lcc, ite, graphics_scene, gs_options); + compute_vertex(lcc, ite, graphics_scene, gso); CGAL::mark_cell(lcc, ite, markvertices); } } @@ -241,10 +240,10 @@ template void add_to_graphics_scene(const CGAL_LCC_TYPE& alcc, CGAL::Graphics_scene& graphics_scene, - const GSOptions& gs_options) + const GSOptions& gso) { draw_function_for_lcc::compute_elements(static_cast(alcc), - graphics_scene, gs_options); + graphics_scene, gso); } // add_to_graphics_scene: to add a LCC in the given graphic buffer, without a @@ -261,20 +260,20 @@ void add_to_graphics_scene(const CGAL_LCC_TYPE& alcc, typename CGAL_LCC_TYPE::Dart_const_handle, typename CGAL_LCC_TYPE::Dart_const_handle, typename CGAL_LCC_TYPE::Dart_const_handle> - gs_options; + gso; - gs_options.colored_volume = [](const CGAL_LCC_TYPE&, + gso.colored_volume = [](const CGAL_LCC_TYPE&, typename CGAL_LCC_TYPE::Dart_const_handle) -> bool { return true; }; - gs_options.volume_color = [] (const CGAL_LCC_TYPE& alcc, + gso.volume_color = [] (const CGAL_LCC_TYPE& alcc, typename CGAL_LCC_TYPE::Dart_const_handle dh) -> CGAL::IO::Color { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); return get_random_color(random); }; - add_to_graphics_scene(alcc, graphics_scene, gs_options); + add_to_graphics_scene(alcc, graphics_scene, gso); } #ifdef CGAL_USE_BASIC_VIEWER @@ -285,11 +284,11 @@ template class Map, class Refs, class Storage_, class GSOptions> -void draw(const CGAL_LCC_TYPE& alcc, const GSOptions& gs_options, +void draw(const CGAL_LCC_TYPE& alcc, const GSOptions& gso, const char *title="LCC Basic Viewer") { CGAL::Graphics_scene buffer; - add_to_graphics_scene(alcc, buffer, gs_options); + add_to_graphics_scene(alcc, buffer, gso); draw_graphics_scene(buffer, title); } diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 8b22d30faa3c..aadf3f89e99e 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -49,8 +49,15 @@ struct Graphics_scene_options_face_graph_with_paths : { return true; }; } + const CGAL::IO::Color& color_of_marked_edges() const + { return m_color_of_marked_edges; } + void color_of_marked_edges(const CGAL::IO::Color& c) + { m_color_of_marked_edges=c; } + std::function color_of_path; std::function draw_path; +protected: + CGAL::IO::Color m_color_of_marked_edges=CGAL::IO::Color(0, 0, 255); }; namespace draw_function_for_lcc @@ -129,13 +136,7 @@ typedef Local_kernel::Vector_3 Local_vector; template const typename CGAL::Get_traits::Point& get_point (const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh) -{ - typedef typename CGAL::Get_traits::Kernel Kernel; - typedef typename CGAL::Get_traits::Point Point; - typedef typename CGAL::Get_traits::Vector Vector; - - return CGAL::Get_traits::get_point(mesh, dh); -} +{ return CGAL::Get_traits::get_point(mesh, dh); } template void compute_face(const Mesh& mesh, @@ -144,16 +145,11 @@ void compute_face(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, GSOptions& gso) { - if(!gso.draw_face(lcc, dh)) + if(!gso.are_faces_enabled() || !gso.draw_face(mesh, dh)) { return; } - typedef typename Get_map::type LCC; - typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; - typedef typename LCC::size_type size_type; - - typedef typename CGAL::Get_traits::Kernel Kernel; - typedef typename CGAL::Get_traits::Point Point; - typedef typename CGAL::Get_traits::Vector Vector; + typedef typename Get_map::type LCC; + typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; // We fill only closed faces. Dart_const_descriptor cur=dh; @@ -166,8 +162,8 @@ void compute_face(const Mesh& mesh, } while(cur!=dh); - if(gso.colored_face(lcc, dh)) - { graphics_scene.face_begin(gso.face_color(lcc, dh)); } + if(gso.colored_face(mesh, dh)) + { graphics_scene.face_begin(gso.face_color(mesh, dh)); } else { graphics_scene.face_begin(); } @@ -190,43 +186,47 @@ void compute_edge(const Mesh &mesh, typename Get_map::type::Dart_const_descriptor dh, typename Get_map::type::size_type amark, CGAL::Graphics_scene& graphics_scene, - GSOptions& gso, - bool draw_marked_darts=true) + GSOptions& gso) { - if(!gso.draw_edge(lcc, dh)) + if(!gso.are_edges_enabled() || !gso.draw_edge(mesh, dh)) { return; } - typedef typename Get_map::type LCC; - typedef typename LCC::size_type size_type; - typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; - typedef typename CGAL::Get_traits::Kernel Kernel; - typedef typename CGAL::Get_traits::Point Point; - typedef typename CGAL::Get_traits::Vector Vector; + typedef typename Get_map::type LCC; + typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; + typedef typename CGAL::Get_traits::Point Point; Point p1=get_point(mesh, dh); Dart_const_descriptor d2 = lcc.other_extremity(dh); if (d2!=LCC::null_descriptor) { - if (draw_marked_darts && amark!=LCC::INVALID_MARK && + if (amark!=LCC::INVALID_MARK && (lcc.is_marked(dh, amark) || lcc.is_marked(lcc.opposite2(dh), amark))) - { graphics_scene.add_segment(p1, get_point(mesh, d2), CGAL::IO::Color(0, 0, 255)); } + { graphics_scene.add_segment(p1, get_point(mesh, d2), gso.color_of_marked_edges()); } else - { graphics_scene.add_segment(p1, get_point(mesh, d2)); } + { + if(gso.colored_edge(mesh, dh)) + { graphics_scene.add_segment(p1, get_point(mesh, d2), + gso.edge_color(mesh, dh)); } + else + { graphics_scene.add_segment(p1, get_point(mesh, d2)); } + } } } -template +template void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, const CGAL::IO::Color& color, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene, + GSOptions& gso) { + if(!gso.are_edges_enabled() || !gso.draw_edge(mesh, dh)) + { return; } + typedef typename Get_map::type LCC; typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; - typedef typename CGAL::Get_traits::Kernel Kernel; typedef typename CGAL::Get_traits::Point Point; - typedef typename CGAL::Get_traits::Vector Vector; Point p1=get_point(mesh, dh); Dart_const_descriptor d2=lcc.other_extremity(dh); @@ -240,8 +240,16 @@ void compute_vertex(const Mesh &mesh, CGAL::Graphics_scene& graphics_scene, GSOptions& gso) { - if(gso.draw_vertex(mesh, dh)) - { graphics_scene.add_point(get_point(mesh, dh)); } + if(gso.are_vertices_enabled() && gso.draw_vertex(mesh, dh)) + { + if (gso.colored_vertex(mesh, dh)) + { + graphics_scene.add_point(get_point(mesh, dh), + gso.vertex_color(mesh, dh)); + } + else + { graphics_scene.add_point(get_point(mesh, dh)); } + } } template @@ -254,22 +262,16 @@ void compute_path(const Mesh &mesh, typename Get_map::type::size_type amark) { - typedef typename CGAL::Get_traits::Kernel Kernel; - typedef typename CGAL::Get_traits::Point Point; - typedef typename CGAL::Get_traits::Vector Vector; - if ((*paths)[i].is_empty() || !gso.draw_path(i)) { return; } - CGAL::Random random(static_cast(i)); - CGAL::IO::Color color = get_random_color(random); - + CGAL::IO::Color color=gso.color_of_path(i); graphics_scene.add_point(get_point(mesh, (*paths)[i].get_ith_dart(0)), color); for (std::size_t j=0; j<(*paths)[i].length(); ++j) { - if ( !lcc.is_marked( (*paths)[i].get_ith_dart(j), amark) ) + if (!lcc.is_marked( (*paths)[i].get_ith_dart(j), amark)) { - compute_edge(mesh, lcc, (*paths)[i].get_ith_dart(j), color, graphics_scene); + compute_edge(mesh, lcc, (*paths)[i].get_ith_dart(j), color, graphics_scene, gso); lcc.template mark_cell<1>((*paths)[i].get_ith_dart(j), amark); } } @@ -291,7 +293,6 @@ void compute_elements(const Mesh &mesh, typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; typename Get_map::storage_type lcc(mesh); - typename LCC::Dart_range::const_iterator current_dart = lcc.darts().end(); typename LCC::size_type oriented_mark = lcc.get_new_mark(); std::size_t current_path = paths->size(); typename LCC::size_type amark=mark==(std::numeric_limits::max)()? @@ -303,57 +304,34 @@ void compute_elements(const Mesh &mesh, typename LCC::size_type markedges = lcc.get_new_mark(); typename LCC::size_type markvertices = lcc.get_new_mark(); - /* if (current_dart!=lcc.darts().end()) - { // We want to draw only one dart - Dart_const_descriptor selected_dart=current_dart; //lcc.dart_handle(current_dart); - compute_edge(selected_dart, CGAL::IO::Color(255,0,0), mesh, graphics_scene, lcc); - lcc.template mark_cell<1>(selected_dart, markedges); - compute_vertex(selected_dart, mesh, graphics_scene); - - if (gso.are_faces_enabled()) - { compute_face(selected_dart, mesh, graphics_scene, lcc); } + if (current_path==paths->size()) + { + for (std::size_t i=0; isize(); ++i) + { compute_path(mesh, lcc, graphics_scene, gso, paths, i, markedges); } + } + else if (current_path!=paths->size()+1) + { compute_path(mesh, lcc, graphics_scene, gso, paths, current_path, markedges); } - for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), - itend=lcc.darts().end(); it!=itend; ++it ) + for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), + itend=lcc.darts().end(); it!=itend; ++it ) + { + if (gso.are_faces_enabled() && !lcc.is_marked(it, markfaces) && + !lcc.is_perforated(it) && lcc.is_marked(it, oriented_mark)) { - if ( !lcc.is_marked(it, markedges) ) - { - compute_edge(it, mesh, graphics_scene, lcc, amark, draw_marked_darts); - lcc.template mark_cell<1>(it, markedges); - } + compute_face(mesh, lcc, it, graphics_scene, gso); + lcc.template mark_cell<2>(it, markfaces); } - } - else */ - { - if (current_path==paths->size()) + + if ( !lcc.is_marked(it, markedges) ) { - for (std::size_t i=0; isize(); ++i) - { compute_path(mesh, lcc, graphics_scene, gso, paths, i, markedges); } + compute_edge(mesh, lcc, it, amark, graphics_scene, gso); + lcc.template mark_cell<1>(it, markedges); } - else if (current_path!=paths->size()+1) - { compute_path(mesh, lcc, graphics_scene, gso, paths, current_path, markedges); } - for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), - itend=lcc.darts().end(); it!=itend; ++it ) + if ( !lcc.is_marked(it, markvertices) ) { - if (gso.are_faces_enabled() && !lcc.is_marked(it, markfaces) && - !lcc.is_perforated(it) && lcc.is_marked(it, oriented_mark)) - { - compute_face(mesh, lcc, it, graphics_scene, gso); - lcc.template mark_cell<2>(it, markfaces); - } - - if ( !lcc.is_marked(it, markedges) ) - { - compute_edge(mesh, lcc, it, amark, graphics_scene, gso, draw_marked_darts); - lcc.template mark_cell<1>(it, markedges); - } - - if ( !lcc.is_marked(it, markvertices) ) - { - compute_vertex(mesh, it, graphics_scene, gso); - lcc.template mark_cell<0>(it, markvertices); - } + compute_vertex(mesh, it, graphics_scene, gso); + lcc.template mark_cell<0>(it, markvertices); } } @@ -369,8 +347,8 @@ void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gso, const std::vector>* paths, - typename Get_map::type::size_type amark= - typename Get_map::type::INVALID_MARK) + typename Get_map::type::size_type amark=0) +//TODO typename Get_map::type::INVALID_MARK) { draw_function_for_face_graph_with_paths::compute_elements(mesh, graphics_scene, gso, paths, amark); @@ -380,8 +358,8 @@ template void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, const std::vector>* paths, - typename Get_map::type::size_type amark= - typename Get_map::type::INVALID_MARK) + typename Get_map::type::size_type amark=0) + // TODO typename Get_map::type::INVALID_MARK) { // Default graphics view options. Graphics_scene_options_face_graph_with_paths void draw(const Mesh& mesh, const std::vector >& paths, + const char* title="Mesh Viewer With Path", typename Get_map::type::size_type amark= - (std::numeric_limits::type::size_type>::max)(), - const char* title="Mesh Viewer With Path") + (std::numeric_limits::type::size_type>::max)()) { CGAL::Graphics_scene buffer; add_to_graphics_scene(mesh, buffer, &paths, amark); @@ -411,9 +389,9 @@ template void draw(const Mesh& mesh, const std::vector >& paths, const GSOptions& gso, + const char* title="Mesh Viewer With Path", typename Get_map::type::size_type amark= - (std::numeric_limits::type::size_type>::max)(), - const char* title="Mesh Viewer With Path") + (std::numeric_limits::type::size_type>::max)()) { CGAL::Graphics_scene buffer; add_to_graphics_scene(mesh, buffer, gso, &paths, amark); @@ -423,9 +401,9 @@ void draw(const Mesh& mesh, template void draw(const Mesh& mesh, std::initializer_list> l, + const char* title="Mesh Viewer With Path", typename Get_map::type::size_type amark= - (std::numeric_limits::type::size_type>::max)(), - const char* title="Mesh Viewer With Path") + (std::numeric_limits::type::size_type>::max)()) { std::vector> paths=l; CGAL::Graphics_scene buffer; @@ -435,45 +413,6 @@ void draw(const Mesh& mesh, } // End namespace CGAL -#else // CGAL_USE_BASIC_VIEWER - -namespace CGAL -{ - - template - void draw(const Mesh&, - const std::vector >&, - typename Get_map::type::size_type= - (std::numeric_limits::type::size_type>::max)(), - const char* ="") - { - std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< - void draw(const Mesh&, - const std::vector >&, - const GSOptions&, - typename Get_map::type::size_type= - (std::numeric_limits::type::size_type>::max)(), - const char* ="") - { - std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< - void draw(const Mesh&, - std::initializer_list>, - const char* ="", - typename Get_map::type::size_type= - (std::numeric_limits::type::size_type>::max)(), - const char* ="") - { - std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Wed, 29 Nov 2023 16:29:04 +0100 Subject: [PATCH 245/399] SMT: draw face width --- .../Surface_mesh_topology/draw_facewidth.h | 104 ++++-------------- 1 file changed, 19 insertions(+), 85 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index e49b3a93f026..e2f781cfab83 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -9,85 +9,28 @@ #include template -struct Facewidth_graphics_scene_options +struct Facewidth_graphics_scene_options: + public CGAL::Graphics_scene_options { Facewidth_graphics_scene_options(typename ALCC::size_type amark1, typename ALCC::size_type amark2) : m_vertex_mark(amark1), m_face_mark(amark2) - {} - - template - bool colored_vertex(const LCC& alcc, typename LCC::Dart_const_descriptor dh) const - { return alcc.is_marked(dh, m_vertex_mark); } - - template - CGAL::IO::Color vertex_color(const LCC& /* alcc */, - typename LCC::Dart_const_descriptor /* dh */) const - { return CGAL::IO::Color(0, 255, 0); } - - template - bool colored_edge(const LCC& /*alcc*/, typename LCC::Dart_const_descriptor /*dh*/) const - { return false; } - - template - CGAL::IO::Color edge_color(const LCC& /* alcc*/, - typename LCC::Dart_const_descriptor /* dh */) const - { return CGAL::IO::Color(0, 0, 255); } - - template - bool colored_face(const LCC& /* alcc */, - typename LCC::Dart_const_descriptor /* dh */) const - {return true;} - - template - CGAL::IO::Color face_color(const LCC& alcc, typename LCC::Dart_const_descriptor dh) const - { return alcc.is_marked(dh, m_face_mark)?CGAL::IO::Color(255, 0, 0) - :CGAL::IO::Color(211, 211, 211); } - - template - bool colored_volume(const LCC& /* alcc */, - typename LCC::Dart_const_descriptor /* dh */) const - { return false; } - - template - bool draw_volume (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - bool draw_face (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return true; } - - template - bool draw_edge (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return true; } - - template - bool volume_wireframe (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - bool face_wireframe (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - bool draw_vertex (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return true; } - - template - CGAL::IO::Color volume_color(const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const { - return CGAL::IO::Color(20, 10, 30); + { + this->colored_vertex=[this](const ALCC& alcc, typename ALCC::Dart_const_handle dh)->bool + { return alcc.is_marked(dh, m_vertex_mark); }; + this->vertex_color=[](const ALCC&, typename ALCC::Dart_const_handle)->CGAL::IO::Color + { return CGAL::IO::Color(0, 255, 0); }; + + this->colored_face=[this](const ALCC&, typename ALCC::Dart_const_handle)->bool + { return true; }; + this->face_color=[this](const ALCC& alcc, typename ALCC::Dart_const_handle dh)->CGAL::IO::Color + { return alcc.is_marked(dh, m_face_mark)?CGAL::IO::Color(255, 0, 0) + :CGAL::IO::Color(211, 211, 211); }; } - bool are_edges_enabled() const { return true; } - bool are_vertices_enabled() const { return true; } - bool are_faces_enabled() const { return true; } - typename ALCC::size_type m_vertex_mark, m_face_mark; }; @@ -99,10 +42,10 @@ void draw_facewidth(const LCC& lcc, typename LCC::size_type face_mark = lcc.get_new_mark(); for (std::size_t i=0; i(cycle[i], vertex_mark); } - // Color the face + // Color the faces if (!lcc.is_marked(cycle[i], face_mark)) { lcc.template mark_cell<2>(cycle[i], face_mark); } } @@ -114,15 +57,6 @@ void draw_facewidth(const LCC& lcc, lcc.free_mark(face_mark); } -#else // CGAL_USE_BASIC_VIEWER - -template -void draw_facewidth(const LCC&, - const std::vector&) -{ - std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Wed, 29 Nov 2023 16:39:41 +0100 Subject: [PATCH 246/399] SMT: draw face width and unsew edgewidth --- .../Surface_mesh_topology/draw_facewidth.h | 2 +- .../unsew_edgewidth_repeatedly.cpp | 92 ++++--------------- 2 files changed, 21 insertions(+), 73 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index e2f781cfab83..0fe598482d0e 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -5,7 +5,7 @@ #ifdef CGAL_USE_BASIC_VIEWER -#include +#include #include template diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp index 485f0fa6ddc3..5dc8900de231 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp @@ -34,83 +34,31 @@ struct Weight_functor #ifdef CGAL_USE_BASIC_VIEWER -struct Draw_functor +struct Draw_functor: public CGAL::Graphics_scene_options { Draw_functor(LCC_3::size_type am1, LCC_3::size_type am2) : is_root(am1), belong_to_cycle(am2) - {} - - template - bool colored_vertex(const LCC& alcc, typename LCC::Dart_const_descriptor d) const - { return alcc.is_marked(d, is_root); } - - template - CGAL::IO::Color vertex_color(const LCC& /* alcc */, - typename LCC::Dart_const_descriptor /* d */) const - { return CGAL::IO::Color(0,255,0); } - - template - bool colored_edge(const LCC& alcc, typename LCC::Dart_const_descriptor d) const - { return alcc.is_marked(d, belong_to_cycle); } - - template - CGAL::IO::Color edge_color(const LCC& /* alcc*/, - typename LCC::Dart_const_descriptor /* d */) const - { return CGAL::IO::Color(0, 0, 255); } - - template - bool colored_face(const LCC& /* alcc */, - typename LCC::Dart_const_descriptor /* d */) const {return true;} - - template - CGAL::IO::Color face_color(const LCC& /* alcc */, - typename LCC::Dart_const_descriptor /* d */) const - {return CGAL::IO::Color(211, 211, 211);} - - template - bool colored_volume(const LCC& /* alcc */, - typename LCC::Dart_const_descriptor /* d */) const { return false; } - - template - bool draw_volume (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - bool draw_face (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - bool draw_edge (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - bool volume_wireframe (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - bool face_wireframe (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - bool draw_vertex (const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const - { return false; } - - template - CGAL::IO::Color volume_color(const LCC& /* alcc */, - typename LCC::Dart_const_handle /* dh */) const { - return CGAL::IO::Color(10, 20, 20); + { + this->colored_vertex=[this](const LCC_3& alcc, typename LCC_3::Dart_const_handle dh)->bool + { return alcc.is_marked(dh, is_root); }; + this->vertex_color=[](const LCC_3&, typename LCC_3::Dart_const_handle)->CGAL::IO::Color + { return CGAL::IO::Color(0, 255, 0); }; + + this->colored_edge=[this](const LCC_3& alcc, typename LCC_3::Dart_const_handle dh)->bool + { return alcc.is_marked(dh, belong_to_cycle); }; + this->edge_color=[](const LCC_3&, typename LCC_3::Dart_const_handle)->CGAL::IO::Color + { return CGAL::IO::Color(0, 0, 255); }; + + this->colored_face=[this](const LCC_3&, typename LCC_3::Dart_const_handle)->bool + { return true; }; + this->face_color=[](const LCC_3&, typename LCC_3::Dart_const_handle)->CGAL::IO::Color + { return CGAL::IO::Color(211, 211, 211); }; } - bool are_edges_enabled() const { return true; } - bool are_vertices_enabled() const { return true; } - bool are_faces_enabled() const { return true; } - LCC_3::size_type is_root; LCC_3::size_type belong_to_cycle; }; From 4feec0b274e23209392ab04fb0932174a84eb6a0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 29 Nov 2023 17:10:43 +0100 Subject: [PATCH 247/399] move end of namespace outside protected block --- .../include/CGAL/draw_face_graph_with_paths.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index aadf3f89e99e..375365eec38e 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -411,8 +411,8 @@ void draw(const Mesh& mesh, draw_graphics_scene(buffer, title); } -} // End namespace CGAL - #endif // CGAL_USE_BASIC_VIEWER +} // End namespace CGAL + #endif // CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H From f8a487d9ef362aac1c03ceb5180d8016c0001913 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 29 Nov 2023 18:12:09 +0100 Subject: [PATCH 248/399] update dependencies --- .../Arrangement_on_surface_2/dependencies | 2 +- .../package_info/Basic_viewer/dependencies | 31 +++++++++++++++++-- .../Boolean_set_operations_2/dependencies | 8 ++++- .../Linear_cell_complex/dependencies | 6 +++- Nef_3/package_info/Nef_3/dependencies | 2 +- .../Periodic_2_triangulation_2/dependencies | 8 ++++- .../package_info/Point_set_3/dependencies | 17 +++++++++- Polygon/package_info/Polygon/dependencies | 20 +++++++++++- .../dependencies | 2 +- .../package_info/Polyhedron/dependencies | 9 +++++- .../Straight_skeleton_2/dependencies | 6 +++- .../package_info/Surface_mesh/dependencies | 12 ++++++- .../Surface_mesh_topology/dependencies | 6 +++- .../package_info/Triangulation_2/dependencies | 3 +- .../package_info/Triangulation_3/dependencies | 5 ++- .../Voronoi_diagram_2/dependencies | 17 +++++++++- 16 files changed, 136 insertions(+), 18 deletions(-) diff --git a/Arrangement_on_surface_2/package_info/Arrangement_on_surface_2/dependencies b/Arrangement_on_surface_2/package_info/Arrangement_on_surface_2/dependencies index a723fb58f63c..c830d4b62e7c 100644 --- a/Arrangement_on_surface_2/package_info/Arrangement_on_surface_2/dependencies +++ b/Arrangement_on_surface_2/package_info/Arrangement_on_surface_2/dependencies @@ -3,6 +3,7 @@ Algebraic_kernel_d Arithmetic_kernel Arrangement_on_surface_2 BGL +Basic_viewer CGAL_Core Cartesian_kernel Circular_kernel_2 @@ -10,7 +11,6 @@ Circulator Distance_2 Distance_3 Filtered_kernel -GraphicsView HalfedgeDS Hash_map Homogeneous_kernel diff --git a/Basic_viewer/package_info/Basic_viewer/dependencies b/Basic_viewer/package_info/Basic_viewer/dependencies index d2dd8a53bd84..ea5d80f6165c 100644 --- a/Basic_viewer/package_info/Basic_viewer/dependencies +++ b/Basic_viewer/package_info/Basic_viewer/dependencies @@ -1,3 +1,28 @@ -Poisson_surface_reconstruction_3 -Polyhedron -Surface_mesh +Algebraic_foundations +Arithmetic_kernel +BGL +Basic_viewer +Cartesian_kernel +Circulator +Distance_2 +Distance_3 +Filtered_kernel +Hash_map +Homogeneous_kernel +Installation +Intersections_2 +Intersections_3 +Interval_support +Kernel_23 +Kernel_d +Modular_arithmetic +Number_types +Polygon +Profiling_tools +Property_map +Random_numbers +STL_Extension +Spatial_sorting +Stream_support +TDS_2 +Triangulation_2 diff --git a/Boolean_set_operations_2/package_info/Boolean_set_operations_2/dependencies b/Boolean_set_operations_2/package_info/Boolean_set_operations_2/dependencies index a4d2b53c7b30..bd14178031b3 100644 --- a/Boolean_set_operations_2/package_info/Boolean_set_operations_2/dependencies +++ b/Boolean_set_operations_2/package_info/Boolean_set_operations_2/dependencies @@ -1,6 +1,8 @@ Algebraic_foundations Arithmetic_kernel Arrangement_on_surface_2 +BGL +Basic_viewer Boolean_set_operations_2 Cartesian_kernel Circular_kernel_2 @@ -8,7 +10,6 @@ Circulator Distance_2 Distance_3 Filtered_kernel -GraphicsView HalfedgeDS Hash_map Homogeneous_kernel @@ -22,7 +23,12 @@ Modular_arithmetic Number_types Polygon Profiling_tools +Property_map +Random_numbers STL_Extension +Spatial_sorting Stream_support Surface_sweep_2 +TDS_2 +Triangulation_2 Union_find diff --git a/Linear_cell_complex/package_info/Linear_cell_complex/dependencies b/Linear_cell_complex/package_info/Linear_cell_complex/dependencies index 53e5ce3f1530..e73c219a56b1 100644 --- a/Linear_cell_complex/package_info/Linear_cell_complex/dependencies +++ b/Linear_cell_complex/package_info/Linear_cell_complex/dependencies @@ -1,6 +1,7 @@ Algebraic_foundations Arithmetic_kernel BGL +Basic_viewer Cartesian_kernel Circulator Combinatorial_map @@ -8,7 +9,6 @@ Distance_2 Distance_3 Filtered_kernel Generalized_map -GraphicsView HalfedgeDS Hash_map Homogeneous_kernel @@ -21,8 +21,12 @@ Kernel_d Linear_cell_complex Modular_arithmetic Number_types +Polygon Profiling_tools Property_map Random_numbers STL_Extension +Spatial_sorting Stream_support +TDS_2 +Triangulation_2 diff --git a/Nef_3/package_info/Nef_3/dependencies b/Nef_3/package_info/Nef_3/dependencies index 7fec88e23734..20c1fbadbb85 100644 --- a/Nef_3/package_info/Nef_3/dependencies +++ b/Nef_3/package_info/Nef_3/dependencies @@ -1,13 +1,13 @@ Algebraic_foundations Arithmetic_kernel BGL +Basic_viewer Box_intersection_d Cartesian_kernel Circulator Distance_2 Distance_3 Filtered_kernel -GraphicsView HalfedgeDS Hash_map Homogeneous_kernel diff --git a/Periodic_2_triangulation_2/package_info/Periodic_2_triangulation_2/dependencies b/Periodic_2_triangulation_2/package_info/Periodic_2_triangulation_2/dependencies index 22f0ba917dfa..3681bf5ae04b 100644 --- a/Periodic_2_triangulation_2/package_info/Periodic_2_triangulation_2/dependencies +++ b/Periodic_2_triangulation_2/package_info/Periodic_2_triangulation_2/dependencies @@ -1,21 +1,27 @@ Algebraic_foundations +Arithmetic_kernel +BGL +Basic_viewer Cartesian_kernel Circulator Distance_2 Distance_3 Filtered_kernel -GraphicsView Hash_map +Homogeneous_kernel Installation Intersections_2 Intersections_3 Interval_support Kernel_23 +Kernel_d Modular_arithmetic Number_types Periodic_2_triangulation_2 +Polygon Profiling_tools Property_map +Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Point_set_3/package_info/Point_set_3/dependencies b/Point_set_3/package_info/Point_set_3/dependencies index 6f0ec394588d..fec9cf39bc0b 100644 --- a/Point_set_3/package_info/Point_set_3/dependencies +++ b/Point_set_3/package_info/Point_set_3/dependencies @@ -1,16 +1,31 @@ Algebraic_foundations +Arithmetic_kernel BGL +Basic_viewer +Cartesian_kernel Circulator -GraphicsView +Distance_2 +Distance_3 +Filtered_kernel +Hash_map +Homogeneous_kernel Installation +Intersections_2 +Intersections_3 Interval_support Kernel_23 +Kernel_d Modular_arithmetic Number_types Point_set_3 Point_set_processing_3 +Polygon Profiling_tools Property_map +Random_numbers STL_Extension +Spatial_sorting Stream_support Surface_mesh +TDS_2 +Triangulation_2 diff --git a/Polygon/package_info/Polygon/dependencies b/Polygon/package_info/Polygon/dependencies index 3312eb37e462..ea5d80f6165c 100644 --- a/Polygon/package_info/Polygon/dependencies +++ b/Polygon/package_info/Polygon/dependencies @@ -1,10 +1,28 @@ Algebraic_foundations +Arithmetic_kernel +BGL +Basic_viewer +Cartesian_kernel Circulator -GraphicsView +Distance_2 +Distance_3 +Filtered_kernel +Hash_map +Homogeneous_kernel Installation +Intersections_2 +Intersections_3 +Interval_support Kernel_23 +Kernel_d +Modular_arithmetic Number_types Polygon Profiling_tools +Property_map +Random_numbers STL_Extension +Spatial_sorting Stream_support +TDS_2 +Triangulation_2 diff --git a/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies b/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies index 650e4a65343e..dccdbe6d25ab 100644 --- a/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies +++ b/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies @@ -21,8 +21,8 @@ Number_types Point_set_3 Point_set_processing_3 Polygon -Polygonal_surface_reconstruction Polygon_mesh_processing +Polygonal_surface_reconstruction Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools diff --git a/Polyhedron/package_info/Polyhedron/dependencies b/Polyhedron/package_info/Polyhedron/dependencies index 53bd7918c4d8..64c00615ce37 100644 --- a/Polyhedron/package_info/Polyhedron/dependencies +++ b/Polyhedron/package_info/Polyhedron/dependencies @@ -1,10 +1,12 @@ Algebraic_foundations +Arithmetic_kernel BGL +Basic_viewer Cartesian_kernel Circulator Distance_2 Distance_3 -GraphicsView +Filtered_kernel HalfedgeDS Hash_map Homogeneous_kernel @@ -13,12 +15,17 @@ Intersections_2 Intersections_3 Interval_support Kernel_23 +Kernel_d Modifier Modular_arithmetic Number_types +Polygon Polyhedron Profiling_tools Property_map Random_numbers STL_Extension +Spatial_sorting Stream_support +TDS_2 +Triangulation_2 diff --git a/Straight_skeleton_2/package_info/Straight_skeleton_2/dependencies b/Straight_skeleton_2/package_info/Straight_skeleton_2/dependencies index ca2e964a1732..0fb898c6ec48 100644 --- a/Straight_skeleton_2/package_info/Straight_skeleton_2/dependencies +++ b/Straight_skeleton_2/package_info/Straight_skeleton_2/dependencies @@ -1,13 +1,13 @@ Algebraic_foundations Arithmetic_kernel BGL +Basic_viewer CGAL_Core Cartesian_kernel Circulator Distance_2 Distance_3 Filtered_kernel -GraphicsView HalfedgeDS Hash_map Homogeneous_kernel @@ -22,6 +22,10 @@ Number_types Polygon Profiling_tools Property_map +Random_numbers STL_Extension +Spatial_sorting Straight_skeleton_2 Stream_support +TDS_2 +Triangulation_2 diff --git a/Surface_mesh/package_info/Surface_mesh/dependencies b/Surface_mesh/package_info/Surface_mesh/dependencies index bb41a0ba6250..5b83e82360eb 100644 --- a/Surface_mesh/package_info/Surface_mesh/dependencies +++ b/Surface_mesh/package_info/Surface_mesh/dependencies @@ -1,19 +1,29 @@ Algebraic_foundations +Arithmetic_kernel BGL +Basic_viewer Cartesian_kernel Circulator Distance_2 Distance_3 -GraphicsView +Filtered_kernel Hash_map +Homogeneous_kernel Installation +Intersections_2 +Intersections_3 Interval_support Kernel_23 +Kernel_d Modular_arithmetic Number_types +Polygon Profiling_tools Property_map Random_numbers STL_Extension +Spatial_sorting Stream_support Surface_mesh +TDS_2 +Triangulation_2 diff --git a/Surface_mesh_topology/package_info/Surface_mesh_topology/dependencies b/Surface_mesh_topology/package_info/Surface_mesh_topology/dependencies index dc2f511d1b24..41ec9a9515b2 100644 --- a/Surface_mesh_topology/package_info/Surface_mesh_topology/dependencies +++ b/Surface_mesh_topology/package_info/Surface_mesh_topology/dependencies @@ -1,6 +1,7 @@ Algebraic_foundations Arithmetic_kernel BGL +Basic_viewer Cartesian_kernel Circulator Combinatorial_map @@ -8,7 +9,6 @@ Distance_2 Distance_3 Filtered_kernel Generalized_map -GraphicsView Hash_map Homogeneous_kernel Installation @@ -20,9 +20,13 @@ Kernel_d Linear_cell_complex Modular_arithmetic Number_types +Polygon Profiling_tools Property_map Random_numbers STL_Extension +Spatial_sorting Stream_support Surface_mesh_topology +TDS_2 +Triangulation_2 diff --git a/Triangulation_2/package_info/Triangulation_2/dependencies b/Triangulation_2/package_info/Triangulation_2/dependencies index c8d90b721ca3..ea5d80f6165c 100644 --- a/Triangulation_2/package_info/Triangulation_2/dependencies +++ b/Triangulation_2/package_info/Triangulation_2/dependencies @@ -1,12 +1,12 @@ Algebraic_foundations Arithmetic_kernel BGL +Basic_viewer Cartesian_kernel Circulator Distance_2 Distance_3 Filtered_kernel -GraphicsView Hash_map Homogeneous_kernel Installation @@ -20,6 +20,7 @@ Number_types Polygon Profiling_tools Property_map +Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Triangulation_3/package_info/Triangulation_3/dependencies b/Triangulation_3/package_info/Triangulation_3/dependencies index a68982ddaa59..ba51950d993f 100644 --- a/Triangulation_3/package_info/Triangulation_3/dependencies +++ b/Triangulation_3/package_info/Triangulation_3/dependencies @@ -1,12 +1,12 @@ Algebraic_foundations Arithmetic_kernel BGL +Basic_viewer Cartesian_kernel Circulator Distance_2 Distance_3 Filtered_kernel -GraphicsView Hash_map Homogeneous_kernel Installation @@ -17,11 +17,14 @@ Kernel_23 Kernel_d Modular_arithmetic Number_types +Polygon Profiling_tools Property_map Random_numbers STL_Extension Spatial_sorting Stream_support +TDS_2 TDS_3 +Triangulation_2 Triangulation_3 diff --git a/Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies b/Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies index 47ba473b7014..d2c77619e206 100644 --- a/Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies +++ b/Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies @@ -1,15 +1,30 @@ Algebraic_foundations Apollonius_graph_2 +Arithmetic_kernel +BGL +Basic_viewer +Cartesian_kernel Circulator -GraphicsView +Distance_2 +Distance_3 +Filtered_kernel Hash_map +Homogeneous_kernel Installation +Intersections_2 +Intersections_3 Interval_support Kernel_23 +Kernel_d Modular_arithmetic Number_types +Polygon Profiling_tools +Property_map +Random_numbers STL_Extension +Spatial_sorting Stream_support TDS_2 +Triangulation_2 Voronoi_diagram_2 From a000007c8c66e31c53c2fe140369a5fea00f2b3c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 29 Nov 2023 23:50:24 +0100 Subject: [PATCH 249/399] fix the install of /include/CGAL/Qt --- Installation/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index d9a0eecee3cc..ccae6f601632 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -73,6 +73,8 @@ if(CGAL_BRANCH_BUILD) set(CGAL_GRAPHICSVIEW_PACKAGE_DIR "${CGAL_SOURCE_DIR}/GraphicsView" CACHE INTERNAL "Directory containing the GraphicsView package") + file(GLOB INCLUDE_CGAL_QT_DIRECTORIES "${CGAL_SOURCE_DIR}/*/include/CGAL/Qt") + message(STATUS "Include CGAL/Qt directories: ${INCLUDE_CGAL_QT_DIRECTORIES}") message(STATUS "Installation package directory: ${CGAL_INSTALLATION_PACKAGE_DIR}") message(STATUS "Maintenance package directory: ${CGAL_MAINTENANCE_PACKAGE_DIR}") @@ -104,6 +106,7 @@ else(CGAL_BRANCH_BUILD) set(CGAL_GRAPHICSVIEW_PACKAGE_DIR "${CGAL_SOURCE_DIR}" CACHE INTERNAL "Directory containing the GraphicsView package") + set(INCLUDE_CGAL_QT_DIRECTORIES "${CGAL_SOURCE_DIR}/include/CGAL/Qt") # Enable testing with BUILD_TESTING option(BUILD_TESTING "Build the testing tree." OFF) @@ -647,7 +650,7 @@ cache_get(CGAL_3RD_PARTY_INCLUDE_DIRS ) cache_get(CGAL_3RD_PARTY_LIBRARIES ) cache_get(CGAL_3RD_PARTY_LIBRARIES_DIRS) -install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/Qt" COMPONENT CGAL_Qt6) +install(DIRECTORY ${INCLUDE_CGAL_QT_DIRECTORIES} DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/" COMPONENT CGAL_Qt6) if(CGAL_BRANCH_BUILD) install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/resources" COMPONENT CGAL_Qt6) install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/icons" COMPONENT CGAL_Qt6) From b8c5b1ca27aafa7e8ede1fee6aeb5bdf93942630 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 30 Nov 2023 12:49:42 +0100 Subject: [PATCH 250/399] A (last) verification step for all draw functions (nyf). --- BGL/include/CGAL/draw_face_graph.h | 30 ++++++++++--------- Point_set_3/include/CGAL/draw_point_set_3.h | 6 ++-- Polygon/include/CGAL/draw_polygon_2.h | 15 +++++----- .../include/CGAL/draw_polygon_with_holes_2.h | 23 +++++++++----- Surface_mesh/include/CGAL/draw_surface_mesh.h | 2 +- 5 files changed, 43 insertions(+), 33 deletions(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index f7d95b45d35f..e4d2eecc957e 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -27,7 +27,7 @@ namespace draw_function_for_FG { template void compute_elements(const FG &fg, CGAL::Graphics_scene &graphics_scene, - const GSOptions &m_gs_options) + const GSOptions &gs_options) { using Point=typename boost::property_map_value::type; using Kernel = typename CGAL::Kernel_traits::Kernel; @@ -58,15 +58,17 @@ void compute_elements(const FG &fg, put(vnormals, v, n / i); } - if (m_gs_options.are_faces_enabled()) + if (gs_options.are_faces_enabled()) { for (auto fh : faces(fg)) { if (fh != boost::graph_traits::null_face() && // face exists - !m_gs_options.face_wireframe(fg, fh) && // face is not wireframe - m_gs_options.colored_face(fg, fh)) // and face is colored + gs_options.draw_face(fg, fh)) // face is drawn { - graphics_scene.face_begin(m_gs_options.face_color(fg, fh)); + if(gs_options.colored_face(fg, fh)) // face is colored + { graphics_scene.face_begin(gs_options.face_color(fg, fh)); } + else + { graphics_scene.face_begin(); } auto hd = halfedge(fh, fg); const auto first_hd = hd; do @@ -81,15 +83,15 @@ void compute_elements(const FG &fg, } } - if(m_gs_options.are_edges_enabled()) + if(gs_options.are_edges_enabled()) { for (auto e : edges(fg)) { - if(m_gs_options.colored_edge(fg, e)) // edge is colored + if(gs_options.colored_edge(fg, e)) // edge is colored { graphics_scene.add_segment(get(point_pmap, source(halfedge(e, fg), fg)), get(point_pmap, target(halfedge(e, fg), fg)), - m_gs_options.edge_color(fg, e)); + gs_options.edge_color(fg, e)); } else { @@ -99,14 +101,14 @@ void compute_elements(const FG &fg, } } - if(m_gs_options.are_vertices_enabled()) + if(gs_options.are_vertices_enabled()) { for (auto v : vertices(fg)) { - if(m_gs_options.colored_vertex(fg, v)) // vertex is colored + if(gs_options.colored_vertex(fg, v)) // vertex is colored { graphics_scene.add_point(get(point_pmap, v), - m_gs_options.vertex_color(fg, v)); + gs_options.vertex_color(fg, v)); } else { @@ -120,15 +122,15 @@ void compute_elements(const FG &fg, template void add_to_graphics_scene_for_fg(const FG &fg, - CGAL::Graphics_scene &graphics_scene, - const GSOptions &gs_options) + CGAL::Graphics_scene &graphics_scene, + const GSOptions &gs_options) { draw_function_for_FG::compute_elements(fg, graphics_scene, gs_options); } template void add_to_graphics_scene_for_fg(const FG &fg, - CGAL::Graphics_scene &graphics_scene) + CGAL::Graphics_scene &graphics_scene) { Graphics_scene_options::vertex_descriptor, 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 a40ad16aabff..422efde4aa22 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -70,8 +70,8 @@ void compute_elements(const PointSet& pointset, template void add_to_graphics_scene(const Point_set_3& apointset, - Graphics_scene& graphics_scene, - const GSOptions& gs_options) + Graphics_scene& graphics_scene, + const GSOptions& gs_options) { draw_function_for_PointSet::compute_elements(apointset, graphics_scene, @@ -80,7 +80,7 @@ void add_to_graphics_scene(const Point_set_3& apointset, template void add_to_graphics_scene(const Point_set_3& apointset, - Graphics_scene& graphics_scene) + Graphics_scene& graphics_scene) { CGAL::Graphics_scene_options, typename Point_set_3::const_iterator, diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 8af1ec1f1b42..b1f2209dbf5b 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -54,8 +54,6 @@ void compute_elements(const P2& p2, if (p2.is_empty()) return; - typename P2::Point_2 prev=p2.vertex(p2.size()-1); - if (gso.are_faces_enabled()) { if(gso.colored_face(p2, nullptr)) @@ -64,6 +62,7 @@ void compute_elements(const P2& p2, { graphics_scene.face_begin(); } } + typename P2::Vertex_const_iterator prev=p2.vertices_end(); --prev; for (typename P2::Vertex_const_iterator i=p2.vertices_begin(); i!=p2.vertices_end(); ++i) { @@ -77,18 +76,18 @@ void compute_elements(const P2& p2, } if(gso.are_edges_enabled() && - gso.draw_edge(p2, i)) + gso.draw_edge(p2, prev)) { // Add edge with previous point - if(gso.colored_edge(p2, i)) - { graphics_scene.add_segment(prev, *i, gso.edge_color(p2, i)); } + if(gso.colored_edge(p2, prev)) + { graphics_scene.add_segment(*prev, *i, gso.edge_color(p2, prev)); } else - { graphics_scene.add_segment(prev, *i); } + { graphics_scene.add_segment(*prev, *i); } } if(gso.are_faces_enabled()) { graphics_scene.add_point_in_face(*i); } // Add point in face - prev = *i; + prev=i; } if (gso.are_faces_enabled()) @@ -141,6 +140,8 @@ void draw(const CGAL_P2_TYPE &ap2, #endif // CGAL_USE_BASIC_VIEWER +#undef CGAL_P2_TYPE + } // End namespace CGAL #endif // CGAL_DRAW_POLYGON_2_H diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 02c06bc639d8..741524f418d0 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -68,19 +68,18 @@ void compute_one_loop_elements(const P2& ap2, { if(gs_options.are_vertices_enabled() && gs_options.draw_vertex(ap2, i)) - { // Add vertex - if(gs_options.colored_vertex(ap2, i)) + { // Add vertex + if(gs_options.colored_vertex(ap2, i)) { graphics_scene.add_point(*i, gs_options.vertex_color(ap2, i)); } else { graphics_scene.add_point(*i); } - } + } if(i!=aloop.vertices_begin() && - gs_options.are_edges_enabled() && - gs_options.draw_edge(ap2, i)) + gs_options.are_edges_enabled() && gs_options.draw_edge(ap2, prev)) { // Add segment with previous point - if(gs_options.colored_vertex(ap2, i)) - { graphics_scene.add_segment(*prev, *i, gs_options.edge_color(ap2, i)); } + if(gs_options.colored_edge(ap2, prev)) + { graphics_scene.add_segment(*prev, *i, gs_options.edge_color(ap2, prev)); } else { graphics_scene.add_segment(*prev, *i); } } @@ -94,7 +93,13 @@ void compute_one_loop_elements(const P2& ap2, // Add the last segment between the last point and the first one if(gs_options.are_edges_enabled() && gs_options.draw_edge(ap2, aloop.vertices_begin())) - { graphics_scene.add_segment(*prev, *(aloop.vertices_begin())); } + { + if(gs_options.colored_edge(ap2, prev)) + { graphics_scene.add_segment(*prev, *(aloop.vertices_begin()), + gs_options.edge_color(ap2, prev)); } + else + { graphics_scene.add_segment(*prev, *(aloop.vertices_begin())); } + } } template @@ -176,6 +181,8 @@ void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, #endif // CGAL_USE_BASIC_VIEWER +#undef CGAL_P2_WITH_HOLES_TYPE + } // End namespace CGAL #endif // CGAL_DRAW_POLYGON_WITH_HOLES_2_H diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 367a6cea0c81..69a7be45edf3 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -104,7 +104,7 @@ template void add_to_graphics_scene(const Surface_mesh& amesh, CGAL::Graphics_scene &graphics_scene) { add_to_graphics_scene_for_fg(amesh, graphics_scene, - Graphics_scene_options_surface_mesh(amesh)); } + Graphics_scene_options_surface_mesh(amesh)); } #ifdef CGAL_USE_BASIC_VIEWER From 2d256951cb9590bb12e1c44e1197a1009330e27c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 30 Nov 2023 16:21:08 +0100 Subject: [PATCH 251/399] Graphics_scene does not uses Qt --- Basic_viewer/include/CGAL/Graphics_scene.h | 14 +++++--------- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 3 ++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index 1d1def2810b4..73a5fafe6377 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -14,7 +14,6 @@ #define CGAL_GRAPHICS_SCENE_H // TODO #include -#include #include #include @@ -270,18 +269,15 @@ class Graphics_scene } template - void add_text(const KPoint &kp, const QString &txt) + void add_text(const KPoint &kp, const std::string &txt) { Local_point p = get_local_point(kp); m_texts.push_back(std::make_tuple(p, txt)); } - template void add_text(const KPoint &kp, const char *txt) - { add_text(kp, QString(txt)); } - template - void add_text(const KPoint &kp, const std::string &txt) - { add_text(kp, txt.c_str()); } + void add_text(const KPoint &kp, const char *txt) + { add_text(kp, std::string(txt)); } bool empty() const { @@ -381,7 +377,7 @@ class Graphics_scene int m_texts_size() const { return m_texts.size(); } - const std::vector>& get_m_texts() const + const std::vector>& get_m_texts() const { return m_texts; } public: @@ -428,7 +424,7 @@ class Graphics_scene Buffer_for_vao m_buffer_for_mono_faces; Buffer_for_vao m_buffer_for_colored_faces; - std::vector> m_texts; + std::vector> m_texts; std::vector arrays[LAST_INDEX]; diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 245b335eb3e6..81325a2fa25b 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -598,7 +598,8 @@ class Basic_viewer : public CGAL::QGLViewer std::get<0>(m_texts_vec[i]).y(), std::get<0>(m_texts_vec[i]).z())); - drawText((int)screenPos[0], (int)screenPos[1], std::get<1>(m_texts_vec[i])); + drawText((int)screenPos[0], (int)screenPos[1], + QString(std::get<1>(m_texts_vec[i]).c_str())); } glEnable(GL_LIGHTING); } From c53e24a84f5cf684fc2bc81f0afb09da31f049af Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 30 Nov 2023 16:21:20 +0100 Subject: [PATCH 252/399] draw straight_skeleton_2 --- .../include/CGAL/draw_straight_skeleton_2.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index e5efae9c2bee..8ff502ba5e3f 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -88,12 +88,12 @@ void print_vertex_label(const SS2& ss2, const GSOptions& gs_options) { // TODO? an option different from draw_vertex to allow to show only some labels ?? - if (!gs_options.draw_vertex(ss2, vh)) - { return; } - - std::stringstream label; - label << "V" << vh->id() << std::ends; - graphics_scene.add_text(vh->point(), label.str()); + if (gs_options.draw_vertex(ss2, vh)) + { + std::stringstream label; + label << "V" << vh->id() << std::ends; + graphics_scene.add_text(vh->point(), label.str()); + } } template @@ -101,7 +101,7 @@ void compute_elements(const SS2& ss2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) { - if (!gs_options.are_edges_enabled()) + if (gs_options.are_edges_enabled()) { for (typename SS2::Halfedge_const_iterator it=ss2.halfedges_begin(); it != ss2.halfedges_end(); ++it) @@ -114,7 +114,7 @@ void compute_elements(const SS2& ss2, } } - if (!gs_options.are_vertices_enabled()) + if (gs_options.are_vertices_enabled()) { for (typename SS2::Vertex_const_iterator it=ss2.vertices_begin(); it!=ss2.vertices_end(); ++it) From 310ad8e40ccd86cbf125d07ab653be103e5d5c77 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 30 Nov 2023 16:40:12 +0100 Subject: [PATCH 253/399] remove old file --- .../Linear_cell_complex/basic_viewer.h | 1190 ----------------- 1 file changed, 1190 deletions(-) delete mode 100644 Linear_cell_complex/examples/Linear_cell_complex/basic_viewer.h diff --git a/Linear_cell_complex/examples/Linear_cell_complex/basic_viewer.h b/Linear_cell_complex/examples/Linear_cell_complex/basic_viewer.h deleted file mode 100644 index f01ab8208f26..000000000000 --- a/Linear_cell_complex/examples/Linear_cell_complex/basic_viewer.h +++ /dev/null @@ -1,1190 +0,0 @@ -// Copyright (c) 2011 CNRS and LIRIS' Establishments (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// Author(s) : Guillaume Damiand - -#ifndef CGAL_BASIC_VIEWER_H -#define CGAL_BASIC_VIEWER_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define NB_VBO_BUFFERS 8 -#define NB_VAO_BUFFERS 4 - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; -typedef Local_kernel::Point_3 Local_point; -typedef Local_kernel::Vector_3 Local_vector; - -//Vertex source code -const char vertex_source_mono[] = - { - "#version 150 \n" - "in highp vec4 vertex;\n" - "in highp vec3 normal;\n" - - "uniform highp mat4 mvp_matrix;\n" - "uniform highp mat4 mv_matrix; \n" - - "out highp vec4 fP; \n" - "out highp vec3 fN; \n" - "void main(void)\n" - "{\n" - " fP = mv_matrix * vertex; \n" - " fN = mat3(mv_matrix)* normal; \n" - " gl_Position = mvp_matrix * vertex;\n" - "}" - }; - -const char vertex_source_color[] = - { - "#version 150 \n" - "in highp vec4 vertex;\n" - "in highp vec3 normal;\n" - "in highp vec3 color;\n" - - "uniform highp mat4 mvp_matrix;\n" - "uniform highp mat4 mv_matrix; \n" - - "out highp vec4 fP; \n" - "out highp vec3 fN; \n" - "out highp vec4 fColor; \n" - "void main(void)\n" - "{\n" - " fP = mv_matrix * vertex; \n" - " fN = mat3(mv_matrix)* normal; \n" - " fColor = vec4(color, 1.0); \n" - " gl_Position = mvp_matrix * vertex;\n" - "}" - }; - -//Vertex source code -const char fragment_source_mono[] = - { - "#version 150 \n" - "in highp vec4 fP; \n" - "in highp vec3 fN; \n" - "uniform highp vec4 color; \n" - "uniform highp vec4 light_pos; \n" - "uniform highp vec4 light_diff; \n" - "uniform highp vec4 light_spec; \n" - "uniform highp vec4 light_amb; \n" - "uniform float spec_power ; \n" - "out highp vec4 out_color; \n" - - "void main(void) { \n" - - " highp vec3 L = light_pos.xyz - fP.xyz; \n" - " highp vec3 V = -fP.xyz; \n" - - " highp vec3 N = normalize(fN); \n" - " L = normalize(L); \n" - " V = normalize(V); \n" - - " highp vec3 R = reflect(-L, N); \n" - " highp vec4 diffuse = max(dot(N,L), 0.0) * light_diff * color; \n" - " highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; \n" - - "out_color = light_amb*color + diffuse ; \n" - "} \n" - "\n" - }; - -const char fragment_source_color[] = - { - "#version 150 \n" - "in highp vec4 fP; \n" - "in highp vec3 fN; \n" - "in highp vec4 fColor; \n" - "uniform highp vec4 light_pos; \n" - "uniform highp vec4 light_diff; \n" - "uniform highp vec4 light_spec; \n" - "uniform highp vec4 light_amb; \n" - "uniform float spec_power ; \n" - "out highp vec4 out_color; \n" - - "void main(void) { \n" - - " highp vec3 L = light_pos.xyz - fP.xyz; \n" - " highp vec3 V = -fP.xyz; \n" - - " highp vec3 N = normalize(fN); \n" - " L = normalize(L); \n" - " V = normalize(V); \n" - - " highp vec3 R = reflect(-L, N); \n" - " highp vec4 diffuse = max(dot(N,L), 0.0) * light_diff * fColor; \n" - " highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; \n" - - "out_color = light_amb*fColor + diffuse ; \n" - "} \n" - "\n" - }; - -//Vertex source code -const char vertex_source_p_l[] = - { - "#version 150 \n" - "in highp vec4 vertex;\n" - "uniform highp mat4 mvp_matrix;\n" - "void main(void)\n" - "{\n" - " gl_Position = mvp_matrix * vertex;\n" - "}" - }; -//Vertex source code -const char fragment_source_p_l[] = - { - "#version 150 \n" - "uniform highp vec4 color; \n" - "out highp vec4 out_color; \n" - "void main(void) { \n" - "out_color = color; \n" - "} \n" - "\n" - }; - -namespace internal { - template - void newell_single_step_3(const Point& p, const Point& q, Vector& n) - { - // Compute normal of the face by using Newell's method: for each edge PQ - // Nx += (Py - Qy) * (Pz + Qz); - // Ny += (Pz - Qz) * (Px + Qx); - // Nz += (Px - Qx) * (Py + Qy); - n = Vector(n.x()+((p.y()-q.y())*(p.z()+q.z())), - n.y()+((p.z()-q.z())*(p.x()+q.x())), - n.z()+((p.x()-q.x())*(p.y()+q.y()))); - } -} // End namespace internal - -template -typename K::Vector_3 compute_normal_of_face(const std::vector& points) -{ - typename K::Vector_3 normal(CGAL::NULL_VECTOR); - unsigned int nb = 0; - for (std::size_t i=0; i0); - return (typename K::Construct_scaled_vector_3()(normal, 1.0/nb)); -} - -class Basic_viewer : public CGAL::QGLViewer, public QOpenGLFunctions -{ - struct Vertex_info - { - Local_vector v; - }; - - struct Face_info - { - bool exist_edge[3]; - bool is_external; - bool is_process; - }; - - typedef CGAL::Projection_traits_3 P_traits; - typedef CGAL::Triangulation_vertex_base_with_info_2 Vb; - - typedef CGAL::Triangulation_face_base_with_info_2 Fb1; - - typedef CGAL::Constrained_triangulation_face_base_2 Fb; - typedef CGAL::Triangulation_data_structure_2 TDS; - typedef CGAL::Exact_predicates_tag Itag; - typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; - -public: - // Constructor/Destructor - Basic_viewer(const char* title="") : - CGAL::QGLViewer(CGAL::Qt::createOpenGLContext()), - m_draw_vertices(true), - m_draw_edges(true), - m_draw_faces(true), - m_flatShading(true), - m_use_mono_color(false), - m_inverse_normal(false), - m_empty(true), - m_size_points(7.), - m_size_edges(3.1), - m_vertices_mono_color(51, 51, 178), - m_edges_mono_color(51, 51, 148), - m_faces_mono_color(180, 125, 200), - m_ambient_color(0.6f, 0.5f, 0.5f, 0.5f), - m_are_buffers_initialized(false), - m_face_started(false) - { - if (title[0]==0) - setWindowTitle("CGAL Basic Viewer"); - else - setWindowTitle(title); - - resize(500, 450); - - if ( is_empty() ) - { - bb=Local_point(CGAL::ORIGIN).bbox(); - bb=bb + Local_point(1,1,1).bbox(); // To avoid a warning from Qglviewer - } - } - - ~Basic_viewer() - { - for (int i=0; i& point_vector) - { - point_vector.push_back(p.x()); - point_vector.push_back(p.y()); - point_vector.push_back(p.z()); - - if (is_empty()) - { bb=p.bbox(); m_empty=false; } - else - { bb=bb+p.bbox(); } - } - - void add_color(const CGAL::IO::Color& acolor, std::vector& color_vector) - { - color_vector.push_back((double)color_of_face.red()/(double)255); - color_vector.push_back((double)color_of_face.green()/(double)255); - color_vector.push_back((double)color_of_face.blue()/(double)255); - } - - void add_normal(const Local_vector& n, std::vector& normal_vector) - { - normal_vector.push_back(n.x()); - normal_vector.push_back(n.y()); - normal_vector.push_back(n.z()); - } - - void add_mono_point(const Local_point& p) - { add_point(p, arrays[POS_MONO_POINTS]); } - - void add_colored_point(const Local_point& p, const CGAL::IO::Color& acolor) - { - add_point(p, arrays[POS_COLORED_POINTS]); - add_color(acolor, arrays[COLOR_POINTS]); - } - - void add_mono_segment(const Local_point& p1, const Local_point& p2) - { - add_point(p1, arrays[POS_MONO_SEGMENTS]); - add_point(p2, arrays[POS_MONO_SEGMENTS]); - } - - void add_colored_segment(const Local_point& p1, const Local_point& p2, - const CGAL::IO::Color& acolor) - { - add_point(p1, arrays[POS_COLORED_SEGMENTS]); - add_point(p2, arrays[POS_COLORED_SEGMENTS]); - add_color(acolor, arrays[COLOR_SEGMENTS]); - } - - void face_begin() - { - if (m_face_started) - { - std::cerr<<"You cannot start a new face before to finish the previous one."<(points_of_face); - - if (points_of_face.size()==3) // Triangle: no need to triangulate - { - for (int i=0; i<3; ++i) - { - // The point - add_point(points_of_face[i], arrays[m_started_face_is_colored? - POS_COLORED_FACES: - POS_MONO_FACES]); - - // Its color - if (m_started_face_is_colored) - { add_color(color_of_face, arrays[COLOR_FACES]); } - - // Its flat normal - add_normal(normal, arrays[m_started_face_is_colored? - FLAT_NORMAL_COLORED_FACES: - FLAT_NORMAL_MONO_FACES]); - - // Its smoth normal (if given by the user) - if (vertex_normals_for_face.size()==3) - { // Here we have 3 vertex normals; we can use Gourod - add_normal(vertex_normals_for_face[i], arrays[m_started_face_is_colored? - SMOOTH_NORMAL_COLORED_FACES: - SMOOTH_NORMAL_MONO_FACES]); - } - else - { // Here user does not provide all vertex normals: we use face normal instead - // and thus we will not be able to use Gourod - add_normal(normal, arrays[m_started_face_is_colored? - SMOOTH_NORMAL_COLORED_FACES: - SMOOTH_NORMAL_MONO_FACES]); - } - } - } - // TODO CASE OF 4 POINTS ? PB HOW TO FIND (EASILY) THE TWO POINTS TO LINK ? - // else if (points_of_face.size()==4) - else - { // More than 3 points: we triangulate - try - { - P_traits cdt_traits(normal); - CDT cdt(cdt_traits); - - bool with_vertex_normal=(vertex_normals_for_face.size()==points_of_face.size()); - - // (1) We insert all the edges as constraint in the CDT. - typename CDT::Vertex_descriptor previous=NULL, first=NULL; - for (int i=0; iinfo().v=vertex_normals_for_face[i]; } - else - { vh->info().v=normal; } - - if(previous!=NULL && previous!=vh) - { cdt.insert_constraint(previous, vh); } - previous=vh; - } - - if (previous!=NULL && previous!=first) - cdt.insert_constraint(previous, first); - - // (2) We mark all external triangles - // (2.1) We initialize is_external and is_process values - for(typename CDT::All_faces_iterator fit = cdt.all_faces_begin(), - fitend = cdt.all_faces_end(); fit!=fitend; ++fit) - { - fit->info().is_external = true; - fit->info().is_process = false; - } - // (2.2) We check if the facet is external or internal - std::queue face_queue; - typename CDT::Face_descriptor face_internal = NULL; - if (cdt.infinite_vertex()->face()!=NULL) - face_queue.push(cdt.infinite_vertex()->face()); - while(! face_queue.empty() ) - { - typename CDT::Face_descriptor fh = face_queue.front(); - face_queue.pop(); - if(!fh->info().is_process) - { - fh->info().is_process = true; - for(int i=0; i<3; ++i) - { - if(!cdt.is_constrained(std::make_pair(fh, i))) - { - if (fh->neighbor(i)!=NULL) - face_queue.push(fh->neighbor(i)); - } - else if (face_internal==NULL) - { - face_internal = fh->neighbor(i); - } - } - } - } - - if ( face_internal!=NULL ) - face_queue.push(face_internal); - - while(! face_queue.empty() ) - { - typename CDT::Face_descriptor fh = face_queue.front(); - face_queue.pop(); - if(!fh->info().is_process) - { - fh->info().is_process = true; - fh->info().is_external = false; - for(int i=0; i<3; ++i) - { - if(!cdt.is_constrained(std::make_pair(fh, i))) - { - if (fh->neighbor(i)!=NULL) - face_queue.push(fh->neighbor(i)); - } - } - } - } - - // (3) Now we iterates on the internal faces to add the vertices to the - // positions and the normals to the appropriate vectors - for(typename CDT::Finite_faces_iterator ffit=cdt.finite_faces_begin(), - ffitend = cdt.finite_faces_end(); ffit!=ffitend; ++ffit) - { - if(!ffit->info().is_external) - { - for(int i=0; i<3; ++i) - { - // The point - add_point(ffit->vertex(i)->point(), arrays[m_started_face_is_colored? - POS_COLORED_FACES: - POS_MONO_FACES]); - - // Its color - if (m_started_face_is_colored) - { add_color(color_of_face, arrays[COLOR_FACES]); } - - // Its flat normal - add_normal(normal, arrays[m_started_face_is_colored? - FLAT_NORMAL_COLORED_FACES: - FLAT_NORMAL_MONO_FACES]); - - // Its smoth normal (if given by the user) - add_normal(ffit->vertex(i)->info().v, arrays[m_started_face_is_colored? - SMOOTH_NORMAL_COLORED_FACES: - SMOOTH_NORMAL_MONO_FACES]); - } - } - } - } - catch(...) - { // Triangulation crash: the face is not filled - std::cout<<"Catch: face not filled."<compileSourceCode(vertex_source_mono)) - { std::cerr<<"Compiling vertex source FAILED"<compileSourceCode(fragment_source_mono)) - { std::cerr<<"Compiling fragmentsource FAILED"<compileSourceCode(vertex_source_mono)) - { std::cerr<<"Compiling vertex source FAILED"<compileSourceCode(fragment_source_mono)) - { std::cerr<<"Compiling fragmentsource FAILED"<compileSourceCode(vertex_source_color)) - { std::cerr<<"Compiling vertex source FAILED"<compileSourceCode(fragment_source_color)) - { std::cerr<<"Compiling fragmentsource FAILED"<compileSourceCode(vertex_source_p_l)) - { std::cerr<<"Compiling vertex source FAILED"<compileSourceCode(fragment_source_p_l)) - { std::cerr<<"Compiling fragmentsource FAILED"<(arrays[POS_MONO_FACES].size()*sizeof(float))); - vertexLocation[vaon] = rendering_program_mono.attributeLocation("vertex"); - rendering_program_mono.bind(); - rendering_program_mono.enableAttributeArray(vertexLocation[vaon]); - rendering_program_mono.setAttributeBuffer(vertexLocation[vaon],GL_FLOAT,0,3); - rendering_program_mono.release(); - - buffers[bufn].release(); - ++bufn; - - // 3.1.2) normals of the mono faces - assert(bufn(arrays[FLAT_NORMAL_MONO_FACES].size()* - sizeof(float))); - } - else - { - buffers[bufn].allocate(arrays[SMOOTH_NORMAL_MONO_FACES].data(), - static_cast(arrays[SMOOTH_NORMAL_MONO_FACES].size()* - sizeof(float))); - } - normalsLocation = rendering_program_mono.attributeLocation("normal"); - rendering_program_mono.bind(); - rendering_program_mono.enableAttributeArray(normalsLocation); - rendering_program_mono.setAttributeBuffer(normalsLocation,GL_FLOAT,0,3); - rendering_program_mono.release(); - - buffers[bufn].release(); - ++bufn; - - vao[vaon].release(); - ++vaon; - - // 3.2) Color faces - assert(vaon(arrays[POS_COLORED_FACES].size()*sizeof(float))); - vertexLocation[vaon] = rendering_program_color.attributeLocation("vertex"); - rendering_program_color.bind(); - rendering_program_color.enableAttributeArray(vertexLocation[vaon]); - rendering_program_color.setAttributeBuffer(vertexLocation[vaon],GL_FLOAT,0,3); - rendering_program_color.release(); - - buffers[bufn].release(); - ++bufn; - - // 3.2.2) normals of the color faces - assert(bufn(arrays[FLAT_NORMAL_COLORED_FACES].size()* - sizeof(float))); - } - else - { - buffers[bufn].allocate(arrays[SMOOTH_NORMAL_COLORED_FACES].data(), - static_cast(arrays[SMOOTH_NORMAL_COLORED_FACES].size()* - sizeof(float))); - } - normalsLocation = rendering_program_color.attributeLocation("normal"); - rendering_program_color.bind(); - rendering_program_color.enableAttributeArray(normalsLocation); - rendering_program_color.setAttributeBuffer(normalsLocation,GL_FLOAT,0,3); - rendering_program_color.release(); - - buffers[bufn].release(); - ++bufn; - - // 3.2.3) colors of the faces - if (!m_use_mono_color) - { - assert(bufn(arrays[COLOR_FACES].size()*sizeof(float))); - colorsLocation = rendering_program_color.attributeLocation("color"); - rendering_program_color.bind(); - rendering_program_color.enableAttributeArray(colorsLocation); - rendering_program_color.setAttributeBuffer(colorsLocation,GL_FLOAT,0,3); - rendering_program_color.release(); - - buffers[bufn].release(); - ++bufn; - } - - vao[vaon].release(); - ++vaon; - - m_are_buffers_initialized = true; - } - - void attrib_buffers(CGAL::QGLViewer* viewer) - { - QMatrix4x4 mvpMatrix; - QMatrix4x4 mvMatrix; - double mat[16]; - viewer->camera()->getModelViewProjectionMatrix(mat); - for(int i=0; i < 16; i++) - { - mvpMatrix.data()[i] = (float)mat[i]; - } - viewer->camera()->getModelViewMatrix(mat); - for(int i=0; i < 16; i++) - { - mvMatrix.data()[i] = (float)mat[i]; - } - // define material - QVector4D diffuse( 0.9f, - 0.9f, - 0.9f, - 0.9f ); - - QVector4D specular( 0.0f, - 0.0f, - 0.0f, - 1.0f ); - - QVector4D position((bb.xmax()-bb.xmin())/2, (bb.ymax()-bb.ymin())/2,bb.zmax(), 0.0 ); - GLfloat shininess = 1.0f; - - rendering_program_mono.bind(); - mvpLocation[0] = rendering_program_mono.uniformLocation("mvp_matrix"); - mvLocation = rendering_program_mono.uniformLocation("mv_matrix"); - lightLocation[0] = rendering_program_mono.uniformLocation("light_pos"); - lightLocation[1] = rendering_program_mono.uniformLocation("light_diff"); - lightLocation[2] = rendering_program_mono.uniformLocation("light_spec"); - lightLocation[3] = rendering_program_mono.uniformLocation("light_amb"); - lightLocation[4] = rendering_program_mono.uniformLocation("spec_power"); - - rendering_program_mono.setUniformValue(lightLocation[0], position); - rendering_program_mono.setUniformValue(lightLocation[1], diffuse); - rendering_program_mono.setUniformValue(lightLocation[2], specular); - rendering_program_mono.setUniformValue(lightLocation[3], m_ambient_color); - rendering_program_mono.setUniformValue(lightLocation[4], shininess); - rendering_program_mono.setUniformValue(mvpLocation[0], mvpMatrix); - rendering_program_mono.setUniformValue(mvLocation, mvMatrix); - - colorLocation1 = rendering_program_mono.uniformLocation("color"); - rendering_program_mono.release(); - - rendering_program_color.bind(); - mvpLocation[0] = rendering_program_color.uniformLocation("mvp_matrix"); - mvLocation = rendering_program_color.uniformLocation("mv_matrix"); - lightLocation[0] = rendering_program_color.uniformLocation("light_pos"); - lightLocation[1] = rendering_program_color.uniformLocation("light_diff"); - lightLocation[2] = rendering_program_color.uniformLocation("light_spec"); - lightLocation[3] = rendering_program_color.uniformLocation("light_amb"); - lightLocation[4] = rendering_program_color.uniformLocation("spec_power"); - - rendering_program_color.setUniformValue(lightLocation[0], position); - rendering_program_color.setUniformValue(lightLocation[1], diffuse); - rendering_program_color.setUniformValue(lightLocation[2], specular); - rendering_program_color.setUniformValue(lightLocation[3], m_ambient_color); - rendering_program_color.setUniformValue(lightLocation[4], shininess); - rendering_program_color.setUniformValue(mvpLocation[0], mvpMatrix); - rendering_program_color.setUniformValue(mvLocation, mvMatrix); - - if (m_use_mono_color) - { colorLocation2 = rendering_program_color.uniformLocation("color"); } - rendering_program_color.release(); - - /* rendering_program_p_l_.bind(); - mvpLocation[1] = rendering_program_p_l.uniformLocation("mvp_matrix"); - colorLocation = rendering_program_p_l.uniformLocation("color"); - rendering_program.setUniformValue(mvpLocation[1], mvpMatrix); - rendering_program_p_l.release();*/ - } - - virtual void draw() - { - glEnable(GL_DEPTH_TEST); - if(!m_are_buffers_initialized) - initialize_buffers(); - - QColor color; - - if (m_draw_faces) - { - vao[0].bind(); - attrib_buffers(this); - rendering_program_mono.bind(); - color.setRgbF((double)m_faces_mono_color.red()/(double)255, - (double)m_faces_mono_color.green()/(double)255, - (double)m_faces_mono_color.blue()/(double)255); - rendering_program_mono.setUniformValue(colorLocation1,color); - glDrawArrays(GL_TRIANGLES, 0, static_cast(arrays[POS_MONO_FACES].size()/3)); - rendering_program_mono.release(); - vao[0].release(); - - vao[1].bind(); - attrib_buffers(this); - rendering_program_color.bind(); - if (m_use_mono_color) - { - color.setRgbF((double)m_faces_mono_color.red()/(double)255, - (double)m_faces_mono_color.green()/(double)255, - (double)m_faces_mono_color.blue()/(double)255); - rendering_program_color.setUniformValue(colorLocation2,color); - } - glDrawArrays(GL_TRIANGLES, 0, static_cast(arrays[POS_COLORED_FACES].size()/3)); - rendering_program_color.release(); - vao[1].release(); - } - } - - virtual void init() - { - // Restore previous viewer state. - initializeOpenGLFunctions(); - - // Define 'Control+Q' as the new exit shortcut (default was 'Escape') - setShortcut(EXIT_VIEWER, Qt::CTRL+Qt::Key_Q); - - // Add custom key description (see keyPressEvent). - setKeyDescription(Qt::Key_E, "Toggles edges display"); - setKeyDescription(Qt::Key_F, "Toggles faces display"); - setKeyDescription(Qt::Key_G, "Switch between flat/Gouraud shading display"); - setKeyDescription(Qt::Key_M, "Toggles mono color for all faces"); - setKeyDescription(Qt::Key_N, "Inverse direction of normals"); - setKeyDescription(Qt::Key_V, "Toggles vertices display"); - setKeyDescription(Qt::Key_Plus, "Increase size of edges"); - setKeyDescription(Qt::Key_Minus, "Decrease size of edges"); - setKeyDescription(Qt::Key_Plus+Qt::ShiftModifier, "Increase size of vertices"); - setKeyDescription(Qt::Key_Minus+Qt::ShiftModifier, "Decrease size of vertices"); - setKeyDescription(Qt::Key_PageDown, "Increase light (all colors, use shift/alt/ctrl for one rgb component)"); - setKeyDescription(Qt::Key_PageUp, "Decrease light (all colors, use shift/alt/ctrl for one rgb component)"); - - // Light default parameters - ::glLineWidth(m_size_edges); - ::glEnable(GL_POLYGON_OFFSET_FILL); - ::glPolygonOffset(1.f,1.f); - ::glClearColor(1.0f,1.0f,1.0f,0.0f); - ::glDisable(GL_BLEND); - ::glEnable(GL_LINE_SMOOTH); - ::glDisable(GL_POLYGON_SMOOTH_HINT); - ::glBlendFunc(GL_ONE, GL_ZERO); - ::glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST); - - compile_shaders(); - - this->camera()->setSceneBoundingBox(CGAL::qglviewer::Vec(bb.xmin(), - bb.ymin(), - bb.zmin()), - CGAL::qglviewer::Vec(bb.xmax(), - bb.ymax(), - bb.zmax())); - - this->showEntireScene(); - } - - void negate_all_normals() - { - for (unsigned int k=BEGIN_NORMAL; kmodifiers(); - - if ((e->key()==Qt::Key_E) && (modifiers==Qt::NoButton)) - { - m_draw_edges=!m_draw_edges; - displayMessage(QString("Draw edges=%1.").arg(m_draw_edges?"true":"false")); - updateGL(); - } - else if ((e->key()==Qt::Key_F) && (modifiers==Qt::NoButton)) - { - m_draw_faces=!m_draw_faces; - displayMessage(QString("Draw faces=%1.").arg(m_draw_faces?"true":"false")); - updateGL(); - } - else if ((e->key()==Qt::Key_G) && (modifiers==Qt::NoButton)) - { - m_flatShading=!m_flatShading; - if (m_flatShading) - displayMessage("Flat shading."); - else - displayMessage("Gouraud shading."); - compile_shaders(); - initialize_buffers(); - updateGL(); - } - else if ((e->key()==Qt::Key_M) && (modifiers==Qt::NoButton)) - { - m_use_mono_color=!m_use_mono_color; - displayMessage(QString("Mono color=%1.").arg(m_use_mono_color?"true":"false")); - compile_shaders(); - initialize_buffers(); - updateGL(); - } - else if ((e->key()==Qt::Key_N) && (modifiers==Qt::NoButton)) - { - m_inverse_normal=!m_inverse_normal; - negate_all_normals(); - compile_shaders(); - initialize_buffers(); - displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false")); - updateGL(); - } - else if ((e->key()==Qt::Key_V) && (modifiers==Qt::NoButton)) - { - m_draw_vertices=!m_draw_vertices; - displayMessage(QString("Draw vertices=%1.").arg(m_draw_vertices?"true":"false")); - updateGL(); - } - else if ((e->key()==Qt::Key_Plus) && (modifiers==Qt::KeypadModifier)) - { - m_size_edges+=.5; - displayMessage(QString("Size of edges=%1.").arg(m_size_edges)); - updateGL(); - } - else if ((e->key()==Qt::Key_Minus) && (modifiers==Qt::KeypadModifier)) - { - if (m_size_edges>.5) m_size_edges-=.5; - displayMessage(QString("Size of edges=%1.").arg(m_size_edges)); - updateGL(); - } - else if ((e->key()==Qt::Key_Plus) && (modifiers==(Qt::ShiftModifier|Qt::KeypadModifier))) - { - m_size_points+=.5; - displayMessage(QString("Size of points=%1.").arg(m_size_points)); - updateGL(); - } - else if ((e->key()==Qt::Key_Minus) && (modifiers==(Qt::ShiftModifier|Qt::KeypadModifier))) - { - if (m_size_points>.5) m_size_points-=.5; - displayMessage(QString("Size of points=%1.").arg(m_size_points)); - updateGL(); - } - else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) - { - m_ambient_color.setX(m_ambient_color.x()+.1); - if (m_ambient_color.x()>1.) m_ambient_color.setX(1.); - m_ambient_color.setY(m_ambient_color.x()+.1); - if (m_ambient_color.y()>1.) m_ambient_color.setY(1.); - m_ambient_color.setZ(m_ambient_color.x()+.1); - if (m_ambient_color.z()>1.) m_ambient_color.setZ(1.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - updateGL(); - } - else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::NoButton)) - { - m_ambient_color.setX(m_ambient_color.x()-.1); - if (m_ambient_color.x()<0.) m_ambient_color.setX(0.); - m_ambient_color.setY(m_ambient_color.y()-.1); - if (m_ambient_color.y()<0.) m_ambient_color.setY(0.); - m_ambient_color.setZ(m_ambient_color.z()-.1); - if (m_ambient_color.z()<0.) m_ambient_color.setZ(0.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - updateGL(); - } - else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::ShiftModifier)) - { - m_ambient_color.setX(m_ambient_color.x()+.1); - if (m_ambient_color.x()>1.) m_ambient_color.setX(1.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - updateGL(); - } - else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::AltModifier)) - { - m_ambient_color.setY(m_ambient_color.y()+.1); - if (m_ambient_color.y()>1.) m_ambient_color.setY(1.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - updateGL(); - } - else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::ControlModifier)) - { - m_ambient_color.setZ(m_ambient_color.z()+.1); - if (m_ambient_color.z()>1.) m_ambient_color.setZ(1.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - updateGL(); - } - else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::ShiftModifier)) - { - m_ambient_color.setX(m_ambient_color.x()-.1); - if (m_ambient_color.x()<0.) m_ambient_color.setX(0.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - updateGL(); - } - else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::AltModifier)) - { - m_ambient_color.setY(m_ambient_color.y()-.1); - if (m_ambient_color.y()<0.) m_ambient_color.setY(0.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - updateGL(); - } - else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::ControlModifier)) - { - m_ambient_color.setZ(m_ambient_color.z()-.1); - if (m_ambient_color.z()<0.) m_ambient_color.setZ(0.); - displayMessage(QString("Light color=(%1 %2 %3)."). - arg(m_ambient_color.x()).arg(m_ambient_color.y()).arg(m_ambient_color.z())); - updateGL(); - } - else - CGAL::QGLViewer::keyPressEvent(e); - } - - virtual QString helpString() const - { - QString text("

C G A L B a s i c V i e w e r

"); - text += "Use the mouse to move the camera around the object. "; - text += "You can respectively revolve around, zoom and translate with " - "the three mouse buttons. "; - text += "Left and middle buttons pressed together rotate around the " - "camera view direction axis

"; - text += "Pressing Alt and one of the function keys " - "(F1..F12) defines a camera keyFrame. "; - text += "Simply press the function key again to restore it. " - "Several keyFrames define a "; - text += "camera path. Paths are saved when you quit the application " - "and restored at next start.

"; - text += "Press F to display the frame rate, A for the " - "world axis, "; - text += "Alt+Return for full screen mode and Control+S " - "to save a snapshot. "; - text += "See the Keyboard tab in this window for a complete " - "shortcut list.

"; - text += "Double clicks automates single click actions: A left button " - "double click aligns the closer axis with the camera (if close enough). "; - text += "A middle button double click fits the zoom of the camera and " - "the right button re-centers the scene.

"; - text += "A left button double click while holding right button pressed " - "defines the camera Revolve Around Point. "; - text += "See the Mouse tab and the documentation web pages for " - "details.

"; - text += "Press Escape to exit the viewer."; - return text; - } - -private: - bool m_draw_vertices; - bool m_draw_edges; - bool m_draw_faces; - bool m_flatShading; - bool m_use_mono_color; - bool m_inverse_normal; - bool m_empty; - - double m_size_points; - double m_size_edges; - - CGAL::IO::Color m_vertices_mono_color; - CGAL::IO::Color m_edges_mono_color; - CGAL::IO::Color m_faces_mono_color; - QVector4D m_ambient_color; - - bool m_are_buffers_initialized; - CGAL::Bbox_3 bb; - - //Shaders elements - int vertexLocation[NB_VAO_BUFFERS]; - int normalsLocation; - int mvpLocation[2]; - int mvLocation; - int colorLocation1; - int colorLocation2; - int lightLocation[5]; - - enum - { POS_MONO_POINTS=0, - POS_COLORED_POINTS, - POS_MONO_SEGMENTS, - POS_COLORED_SEGMENTS, - POS_MONO_FACES, - POS_COLORED_FACES, - BEGIN_NORMAL, - SMOOTH_NORMAL_MONO_FACES=BEGIN_NORMAL, - FLAT_NORMAL_MONO_FACES, - SMOOTH_NORMAL_COLORED_FACES, - FLAT_NORMAL_COLORED_FACES, - END_NORMAL, - COLOR_POINTS=END_NORMAL, - COLOR_SEGMENTS, - COLOR_FACES, - LAST_INDEX - }; - - std::vector arrays[LAST_INDEX]; - - QGLBuffer buffers[NB_VBO_BUFFERS]; - QOpenGLVertexArrayObject vao[NB_VAO_BUFFERS]; - int colorsLocation; - - QOpenGLShaderProgram rendering_program_mono; - QOpenGLShaderProgram rendering_program_color; - QOpenGLShaderProgram rendering_program_p_l_mono; - QOpenGLShaderProgram rendering_program_p_l_color; - - // Local variables, used when we started a new face. - bool m_face_started; - bool m_started_face_is_colored; - std::vector points_of_face; - std::vector vertex_normals_for_face; - CGAL::IO::Color color_of_face; -}; - -#endif // CGAL_BASIC_VIEWER_H From f70a2d30cd5ef9f47cf33c8209e73734dd795f45 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 1 Dec 2023 09:06:54 +0100 Subject: [PATCH 254/399] draw lcc --- .../include/CGAL/draw_linear_cell_complex.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) 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 e9e98ecc6b7f..7a5ad6eb7aa8 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -64,8 +64,7 @@ void compute_face(const LCC& lcc, CGAL::Graphics_scene& graphics_scene, const GSOptionsLCC& gso) { - if (!gso.are_faces_enabled() || - !gso.draw_face(lcc, dh)) + if(!gso.are_faces_enabled() || !gso.draw_face(lcc, dh)) { return; } // We fill only closed faces. @@ -79,13 +78,9 @@ void compute_face(const LCC& lcc, while (cur!=dh); if (gso.colored_volume(lcc, voldh)) - { - graphics_scene.face_begin(gso.volume_color(lcc, voldh)); - } + { graphics_scene.face_begin(gso.volume_color(lcc, voldh)); } else if (gso.colored_face(lcc, dh)) - { - graphics_scene.face_begin(gso.face_color(lcc, dh)); - } + { graphics_scene.face_begin(gso.face_color(lcc, dh)); } else { graphics_scene.face_begin(); } @@ -108,8 +103,7 @@ void compute_edge(const LCC& lcc, CGAL::Graphics_scene& graphics_scene, const GSOptions& gso) { - if (!gso.are_edges_enabled() || - !gso.draw_edge(lcc, dh)) + if(!gso.are_edges_enabled() || !gso.draw_edge(lcc, dh)) { return; } const typename LCC::Point& p1=lcc.point(dh); @@ -263,11 +257,11 @@ void add_to_graphics_scene(const CGAL_LCC_TYPE& alcc, gso; gso.colored_volume = [](const CGAL_LCC_TYPE&, - typename CGAL_LCC_TYPE::Dart_const_handle) -> bool + typename CGAL_LCC_TYPE::Dart_const_handle) -> bool { return true; }; gso.volume_color = [] (const CGAL_LCC_TYPE& alcc, - typename CGAL_LCC_TYPE::Dart_const_handle dh) -> CGAL::IO::Color + typename CGAL_LCC_TYPE::Dart_const_handle dh) -> CGAL::IO::Color { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); return get_random_color(random); From 2c3428335bae289ccfc6c7b5e4520d3e13e26aab Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 1 Dec 2023 09:53:27 +0100 Subject: [PATCH 255/399] draw smt --- .../Surface_mesh_topology/draw_facewidth.h | 2 - .../include/CGAL/draw_face_graph_with_paths.h | 61 +++++++++---------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index 0fe598482d0e..e277f7b91527 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -1,8 +1,6 @@ #ifndef DRAW_FACEWIDTH_H #define DRAW_FACEWIDTH_H -#include - #ifdef CGAL_USE_BASIC_VIEWER #include diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 375365eec38e..12d645ec1c78 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -184,32 +184,26 @@ template void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - typename Get_map::type::size_type amark, CGAL::Graphics_scene& graphics_scene, - GSOptions& gso) + GSOptions& gso, + bool colored=false, + const CGAL::IO::Color& color=CGAL::IO::black()) { if(!gso.are_edges_enabled() || !gso.draw_edge(mesh, dh)) { return; } - typedef typename Get_map::type LCC; - typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; - typedef typename CGAL::Get_traits::Point Point; + typedef typename Get_map::type LCC; + typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; + typedef typename CGAL::Get_traits::Point Point; Point p1=get_point(mesh, dh); - Dart_const_descriptor d2 = lcc.other_extremity(dh); + Dart_const_descriptor d2=lcc.other_extremity(dh); if (d2!=LCC::null_descriptor) { - if (amark!=LCC::INVALID_MARK && - (lcc.is_marked(dh, amark) || lcc.is_marked(lcc.opposite2(dh), amark))) - { graphics_scene.add_segment(p1, get_point(mesh, d2), gso.color_of_marked_edges()); } + if(colored) + { graphics_scene.add_segment(p1, get_point(mesh, d2), color); } else - { - if(gso.colored_edge(mesh, dh)) - { graphics_scene.add_segment(p1, get_point(mesh, d2), - gso.edge_color(mesh, dh)); } - else - { graphics_scene.add_segment(p1, get_point(mesh, d2)); } - } + { graphics_scene.add_segment(p1, get_point(mesh, d2)); } } } @@ -217,21 +211,24 @@ template void compute_edge(const Mesh &mesh, const typename Get_map::storage_type& lcc, typename Get_map::type::Dart_const_descriptor dh, - const CGAL::IO::Color& color, CGAL::Graphics_scene& graphics_scene, - GSOptions& gso) + GSOptions& gso, + typename Get_map::type::size_type amark) { if(!gso.are_edges_enabled() || !gso.draw_edge(mesh, dh)) { return; } - typedef typename Get_map::type LCC; - typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; - typedef typename CGAL::Get_traits::Point Point; - - Point p1=get_point(mesh, dh); - Dart_const_descriptor d2=lcc.other_extremity(dh); - if (d2!=LCC::null_descriptor) - { graphics_scene.add_segment(p1, get_point(mesh, d2), color); } + if (amark!=Get_map::type::INVALID_MARK && + (lcc.is_marked(dh, amark) || lcc.is_marked(lcc.opposite2(dh), amark))) + { compute_edge(mesh, lcc, dh, graphics_scene, gso, true, gso.color_of_marked_edges()); } + else + { + if(gso.colored_edge(mesh, dh)) + { compute_edge(mesh, lcc, dh, graphics_scene, gso, true, + gso.edge_color(mesh, dh)); } + else + { compute_edge(mesh, lcc, dh, graphics_scene, gso, false); } + } } template @@ -271,7 +268,7 @@ void compute_path(const Mesh &mesh, { if (!lcc.is_marked( (*paths)[i].get_ith_dart(j), amark)) { - compute_edge(mesh, lcc, (*paths)[i].get_ith_dart(j), color, graphics_scene, gso); + compute_edge(mesh, lcc, (*paths)[i].get_ith_dart(j), graphics_scene, gso, true, color); lcc.template mark_cell<1>((*paths)[i].get_ith_dart(j), amark); } } @@ -324,7 +321,7 @@ void compute_elements(const Mesh &mesh, if ( !lcc.is_marked(it, markedges) ) { - compute_edge(mesh, lcc, it, amark, graphics_scene, gso); + compute_edge(mesh, lcc, it, graphics_scene, gso, amark); lcc.template mark_cell<1>(it, markedges); } @@ -347,8 +344,8 @@ void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gso, const std::vector>* paths, - typename Get_map::type::size_type amark=0) -//TODO typename Get_map::type::INVALID_MARK) + typename Get_map::type::size_type amark= + Get_map::type::INVALID_MARK) { draw_function_for_face_graph_with_paths::compute_elements(mesh, graphics_scene, gso, paths, amark); @@ -358,8 +355,8 @@ template void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, const std::vector>* paths, - typename Get_map::type::size_type amark=0) - // TODO typename Get_map::type::INVALID_MARK) + typename Get_map::type::size_type amark= + Get_map::type::INVALID_MARK) { // Default graphics view options. Graphics_scene_options_face_graph_with_paths Date: Fri, 1 Dec 2023 10:00:03 +0100 Subject: [PATCH 256/399] draw t3 --- Triangulation_3/include/CGAL/draw_triangulation_3.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 50044bd845b0..376b73b8c53b 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -27,8 +27,8 @@ namespace draw_function_for_t3 template void compute_face(typename T3::Finite_facets_iterator fh, - const GSOptions& gs_options, - CGAL::Graphics_scene& graphics_scene, const T3 *t3) + CGAL::Graphics_scene& graphics_scene, + const GSOptions& gs_options, const T3 *t3) { if(!gs_options.draw_face(*t3, fh)) { return; } @@ -62,7 +62,8 @@ void compute_edge(typename T3::Finite_edges_iterator eh, eh->first->vertex(eh->third)->point(), gs_options.edge_color(*t3, eh)); } - else { + else + { graphics_scene.add_segment(eh->first->vertex(eh->second)->point(), eh->first->vertex(eh->third)->point()); } @@ -93,14 +94,14 @@ void compute_elements(const T3* t3, { for (typename T3::Finite_facets_iterator it=t3->finite_facets_begin(); it!=t3->finite_facets_end(); ++it) - { compute_face(it, gs_options, graphics_scene, t3); } + { compute_face(it, graphics_scene, gs_options, t3); } } if (gs_options.are_edges_enabled()) { for (typename T3::Finite_edges_iterator it=t3->finite_edges_begin(); it!=t3->finite_edges_end(); ++it) - { compute_edge(it, graphics_scene,gs_options, t3); } + { compute_edge(it, graphics_scene, gs_options, t3); } } if (gs_options.are_vertices_enabled()) From c1dd38e5813d8977a7b99b51ea73237c4aba9de1 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 1 Dec 2023 13:21:50 +0100 Subject: [PATCH 257/399] draw nef3 --- Nef_3/include/CGAL/draw_nef_3.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 833db0d0188d..99fe167ad623 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -223,8 +223,7 @@ void compute_elements(const Nef_Polyhedron &nef, typedef typename Nef_Polyhedron::SFace_const_handle SFace_const_handle; Volume_const_iterator c; - Nef_Visitor - V(nef, graphics_scene, gs_options); + Nef_Visitor V(nef, graphics_scene, gs_options); CGAL_forall_volumes(c, nef) { Shell_entry_const_iterator it; @@ -262,12 +261,12 @@ void add_to_graphics_scene(const CGAL_NEF3_TYPE &anef, typename CGAL_NEF3_TYPE::Halffacet_const_handle /*fh*/> gs_options; - gs_options.colored_face = [] (const CGAL_NEF3_TYPE&, - typename CGAL_NEF3_TYPE::Halffacet_const_handle) -> bool + gs_options.colored_face=[](const CGAL_NEF3_TYPE&, + typename CGAL_NEF3_TYPE::Halffacet_const_handle) -> bool { return true; }; - gs_options.face_color = [] (const CGAL_NEF3_TYPE&, - typename CGAL_NEF3_TYPE::Halffacet_const_handle fh) -> CGAL::IO::Color + gs_options.face_color=[](const CGAL_NEF3_TYPE&, + typename CGAL_NEF3_TYPE::Halffacet_const_handle fh) -> CGAL::IO::Color { if (fh==nullptr) // use to get the mono color { return CGAL::IO::Color(100, 125, 200); } @@ -304,6 +303,8 @@ void draw(const CGAL_NEF3_TYPE &anef, #endif // CGAL_USE_BASIC_VIEWER +#undef CGAL_NEF3_TYPE + } // End namespace CGAL #endif // DRAW_NEF_3_H From e3497d08e005c619e8c6ed7cb6c33e41ce5ad559 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 1 Dec 2023 13:58:47 +0100 Subject: [PATCH 258/399] draw ps2 --- .../include/CGAL/draw_polygon_set_2.h | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index 2dea0e7b0415..a6dd820f5f43 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -94,8 +94,8 @@ void compute_loop(const typename PS2::Polygon_2& p, bool hole, auto prev = p.vertices_begin(); auto it = prev; - if (gso.are_vertices_enabled() && - gso.draw_vertex(p, it)) + // First vertex + if (gso.are_vertices_enabled() && gso.draw_vertex(p, it)) { if(gso.colored_vertex(p, it)) { gs.add_point(*it, gso.vertex_color(p, it)); } @@ -106,10 +106,10 @@ void compute_loop(const typename PS2::Polygon_2& p, bool hole, if (gso.are_faces_enabled()) { gs.add_point_in_face(*it); } + // Other vertices for (++it; it!=p.vertices_end(); ++it) { - if (gso.are_vertices_enabled() && - gso.draw_vertex(p, it)) + if (gso.are_vertices_enabled() && gso.draw_vertex(p, it)) { // Add point if(gso.colored_vertex(p, it)) { gs.add_point(*it, gso.vertex_color(p, it)); } @@ -117,8 +117,7 @@ void compute_loop(const typename PS2::Polygon_2& p, bool hole, { gs.add_point(*it); } } - if (gso.are_edges_enabled() && - gso.draw_edge(p, prev)) + if (gso.are_edges_enabled() && gso.draw_edge(p, prev)) { // Add segment with previous point if(gso.colored_edge(p, prev)) { gs.add_segment(*prev, *it, gso.edge_color(p, prev)); } @@ -131,9 +130,9 @@ void compute_loop(const typename PS2::Polygon_2& p, bool hole, prev = it; } - if (gso.are_edges_enabled() && - gso.draw_edge(p, prev)) - { // Add the last segment between the last point and the first one + // Last segment (between last and first point) + if (gso.are_edges_enabled() && gso.draw_edge(p, prev)) + { if(gso.colored_edge(p, prev)) { gs.add_segment(*prev, *(p.vertices_begin()), gso.edge_color(p, prev)); } else @@ -154,15 +153,18 @@ void compute_elements(const PWH& pwh, using Pnt=typename PWH::Polygon_2::Point_2; const Pnt* point_in_face=nullptr; - if (pwh.outer_boundary().is_empty() && (gso.width()!=0 || gso.height()!=0)) + if (pwh.outer_boundary().is_empty()) { - typename PWH::Polygon_2 pgn; - pgn.push_back(Pnt(-gso.width(), -gso.height())); - pgn.push_back(Pnt(gso.width(), -gso.height())); - pgn.push_back(Pnt(gso.width(), gso.height())); - pgn.push_back(Pnt(-gso.width(), gso.height())); - draw_function_for_boolean_set_2::compute_loop(pgn, false, gs, gso); - point_in_face = &(pgn.vertex(pgn.size()-1)); + if(gso.width()!=0 && gso.height()!=0) + { + typename PWH::Polygon_2 pgn; + pgn.push_back(Pnt(-gso.width(), -gso.height())); + pgn.push_back(Pnt(gso.width(), -gso.height())); + pgn.push_back(Pnt(gso.width(), gso.height())); + pgn.push_back(Pnt(-gso.width(), gso.height())); + draw_function_for_boolean_set_2::compute_loop(pgn, false, gs, gso); + point_in_face = &(pgn.vertex(pgn.size()-1)); + } } else { @@ -174,12 +176,12 @@ void compute_elements(const PWH& pwh, for (auto it = pwh.holes_begin(); it != pwh.holes_end(); ++it) { draw_function_for_boolean_set_2::compute_loop(*it, true, gs, gso); - if (gso.are_faces_enabled()) + if (gso.are_faces_enabled() && point_in_face && point_in_face!=nullptr) { gs.add_point_in_face(*point_in_face); } } - if (gso.are_faces_enabled()) - { gs.face_end(); } + if (gso.are_faces_enabled()) + { gs.face_end(); } } } // End namespace draw_function_for_boolean_set_2 @@ -203,6 +205,9 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer m_ps(ps), gso(gs_options) { + gso.width(CGAL_BASIC_VIEWER_INIT_SIZE_X); + gso.height(CGAL_BASIC_VIEWER_INIT_SIZE_Y); + if (ps.is_empty()) return; // mimic the computation of Camera::pixelGLRatio() @@ -210,7 +215,7 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer CGAL::qglviewer::Vec minv(bbox.xmin(), bbox.ymin(), 0); CGAL::qglviewer::Vec maxv(bbox.xmax(), bbox.ymax(), 0); auto diameter = (maxv - minv).norm(); - m_pixel_ratio = diameter / m_height; + m_pixel_ratio = diameter / gso.height(); } /*! Intercept the resizing of the window. @@ -261,12 +266,6 @@ class Polygon_set_2_basic_viewer_qt : public Basic_viewer } private: - //! The window width in pixels. - int m_width = CGAL_BASIC_VIEWER_INIT_SIZE_X; - - //! The window height in pixels. - int m_height = CGAL_BASIC_VIEWER_INIT_SIZE_Y; - //! The ratio between pixel and opengl units (in world coordinate system). double m_pixel_ratio = 1; @@ -342,6 +341,8 @@ void draw(const CGAL_PS2_TYPE& ps, #endif // CGAL_USE_BASIC_VIEWER +#undef CGAL_PS2_TYPE + } // End namespace CGAL #endif // CGAL_DRAW_POLYGON_SET_2_H From 3aa6ad18b287e11ab914fd06a201464fa498a6a7 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 30 Nov 2023 14:35:49 +0100 Subject: [PATCH 259/399] Bug fix for 2D mode in basic viewer --- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 81325a2fa25b..8f7869441132 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -1415,6 +1415,7 @@ class Basic_viewer : public CGAL::QGLViewer if (is_two_dimensional()) { displayMessage(QString("Viewer is in 2D mode.")); } else { displayMessage(QString("Viewer is in 3D mode.")); } + set_camera_mode(); update(); } } From 4684dc4f8e2687ac453b6aec1baa73849d6b47c0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 1 Dec 2023 18:01:58 +0100 Subject: [PATCH 260/399] T2 and CDT2 draw --- .../examples/Triangulation_2/CMakeLists.txt | 3 +- .../examples/Triangulation_2/constrained.cpp | 4 + .../Triangulation_2/polygon_triangulation.cpp | 4 +- ...gon_triangulation_graphics_scene_options.h | 46 ++-------- .../CGAL/draw_constrained_triangulation_2.h | 92 +++++++++++-------- .../include/CGAL/draw_triangulation_2.h | 14 +-- 6 files changed, 74 insertions(+), 89 deletions(-) diff --git a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt index 47374a859985..8f399fa86da8 100644 --- a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt @@ -16,8 +16,9 @@ foreach(cppfile ${cppfiles}) endforeach() if(CGAL_Qt6_FOUND) - target_link_libraries(polygon_triangulation PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(constrained PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_triangulation_2 PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(polygon_triangulation PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(star_conflict_zone PUBLIC CGAL::CGAL_Basic_viewer) else() message(STATUS "NOTICE: Several examples require Qt6 and will not be compiled.") diff --git a/Triangulation_2/examples/Triangulation_2/constrained.cpp b/Triangulation_2/examples/Triangulation_2/constrained.cpp index 9901ec05fd37..3ed1b19a880f 100644 --- a/Triangulation_2/examples/Triangulation_2/constrained.cpp +++ b/Triangulation_2/examples/Triangulation_2/constrained.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -27,5 +28,8 @@ main( ) ++count; std::cout << "The number of resulting constrained edges is "; std::cout << count << std::endl; + + CGAL::draw(cdt); + return 0; } diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp b/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp index 82d17c9e88b4..698ff58b99ba 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp @@ -58,7 +58,7 @@ int main( ) assert(count > 0); assert(count < cdt.number_of_faces()); - CGAL::Polygon_triangulation_gs_options myfunctor(in_domain); - CGAL::draw(cdt, myfunctor); + Polygon_triangulation_gs_options gso(in_domain); + CGAL::draw(cdt, gso); return 0; } diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_graphics_scene_options.h b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_graphics_scene_options.h index 02f467dcb58b..4768211fdfa6 100644 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation_graphics_scene_options.h +++ b/Triangulation_2/examples/Triangulation_2/polygon_triangulation_graphics_scene_options.h @@ -12,42 +12,37 @@ #ifndef CGAL_POLYGON_TRIANGULATION_GRAPHICS_SCENE_OPTIONS_H #define CGAL_POLYGON_TRIANGULATION_GRAPHICS_SCENE_OPTIONS_H -#include #include #include -#include -#include - -namespace CGAL -{ template struct Polygon_triangulation_gs_options : - public CGAL::Graphics_scene_options { + using T2=typename PT::Triangulation; template Polygon_triangulation_gs_options(IPM ipm) { this->colored_face = - [](const PT&, const typename PT::Finite_faces_iterator) -> bool + [](const T2&, const typename PT::Finite_faces_iterator) -> bool { return true; }; this->face_color = - [](const PT&, const typename PT::Finite_faces_iterator fh) -> CGAL::IO::Color + [](const T2&, const typename PT::Finite_faces_iterator fh) -> CGAL::IO::Color { CGAL::Random random((unsigned int)(std::size_t)(&*fh)); return get_random_color(random); }; this->draw_face= - [ipm](const PT&, const typename PT::Finite_faces_iterator fh) -> bool + [ipm](const T2&, const typename PT::Finite_faces_iterator fh) -> bool { return get(ipm, fh); }; this->draw_edge= - [ipm](const PT& pt, const typename PT::Finite_edges_iterator eh) -> bool + [ipm](const T2& pt, const typename PT::Finite_edges_iterator eh) -> bool { typename PT::Face_handle fh1=eh->first; typename PT::Face_handle fh2=pt.mirror_edge(*eh).first; @@ -56,33 +51,4 @@ struct Polygon_triangulation_gs_options : } }; -#define CGAL_CT2_TYPE CGAL::Constrained_Delaunay_triangulation_2 - -template -void add_in_graphics_scene(const CGAL_CT2_TYPE& ct2, - CGAL::Graphics_scene& graphic_buffer, - const GSOptions& gs_options) -{ - draw_function_for_t2::compute_elements(ct2, graphic_buffer, gs_options); -} - -#ifdef CGAL_USE_BASIC_VIEWER - -// Specialization of draw function. -template -void draw(const CGAL_CT2_TYPE &ct2, const GSOptions &gs_options, - const char *title="Constrained Triangulation_2 Basic Viewer") -{ - CGAL::Graphics_scene buffer; - add_in_graphics_scene(ct2, buffer, gs_options); - draw_graphics_scene(buffer, title); -} - -#endif // CGAL_USE_BASIC_VIEWER - -#undef CGAL_CT2_TYPE - -}; // end namespace CGAL - #endif // CGAL_POLYGON_TRIANGULATION_GRAPHICS_SCENE_OPTIONS_H diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index 6fc3d8f3bbe0..05d933f92e9b 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -16,55 +16,73 @@ #include #include - -#ifdef CGAL_USE_BASIC_VIEWER - #include namespace CGAL { + +template +struct Graphics_scene_options_constrained_triangulation_2: + public CGAL::Graphics_scene_options +{ + using BASET2=typename CDT::Triangulation; + + Graphics_scene_options_constrained_triangulation_2(const CDT& cdt) + { + this->colored_edge = + [&cdt](const BASET2&, typename CDT::Finite_edges_iterator eh) -> bool + { return cdt.is_constrained(*eh); }; + + this->edge_color = + [&cdt](const BASET2&, typename CDT::Finite_edges_iterator eh) -> CGAL::IO::Color + { return cdt.is_constrained(*eh)? CGAL::IO::green() : CGAL::IO::black(); }; + }; + + template + Graphics_scene_options_constrained_triangulation_2(const CDT& cdt, InDomainPmap ipm) + { + this->colored_edge = + [&cdt](const BASET2&, typename CDT::Finite_edges_iterator eh) -> bool + { return cdt.is_constrained(*eh); }; + + this->edge_color = + [&cdt](const BASET2&, typename CDT::Finite_edges_iterator eh) -> CGAL::IO::Color + { return cdt.is_constrained(*eh)? CGAL::IO::green() : CGAL::IO::black(); }; + + this->colored_face = + [](const BASET2&, typename CDT::Finite_faces_iterator) -> bool + { return true; }; + + this->face_color = + [ipm](const BASET2&, typename CDT::Finite_faces_iterator fh) -> CGAL::IO::Color + { return get(ipm, fh)? CGAL::IO::blue() : CGAL::IO::white(); }; + }; +}; + // Specialization of draw function. #define CGAL_T2_TYPE CGAL::Constrained_triangulation_2 template void add_to_graphics_scene(const CGAL_T2_TYPE& at2, InDomainPmap ipm, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { - using BASET2=CGAL::Triangulation_2; - - Graphics_scene_options - drawingFunctor; - - drawingFunctor.colored_edge = - [](const BASET2& t2, typename CGAL_T2_TYPE::Finite_edges_iterator eh) -> bool - { return static_cast(t2).is_constrained(*eh); }; - - drawingFunctor.edge_color = - [](const BASET2& t2, typename CGAL_T2_TYPE::Finite_edges_iterator eh) -> CGAL::IO::Color - { return static_cast(t2).is_constrained(*eh)? CGAL::IO::green() : CGAL::IO::black(); }; - - drawingFunctor.colored_face = - [](const BASET2&, typename CGAL_T2_TYPE::Finite_faces_iterator) -> bool - { return true; }; - - drawingFunctor.face_color = - [&ipm](const BASET2&, typename CGAL_T2_TYPE::Finite_faces_iterator fh) -> CGAL::IO::Color - { return get(ipm, fh)? CGAL::IO::yellow() : CGAL::IO::white(); }; - - add_to_graphics_scene(at2, graphics_scene, drawingFunctor); + Graphics_scene_options_constrained_triangulation_2 gso(at2, ipm); + draw_function_for_t2::compute_elements(at2, graphics_scene, gso); } template void add_to_graphics_scene(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { - internal::In_domain in_domain; - add_to_graphics_scene(at2, in_domain, graphics_scene); + Graphics_scene_options_constrained_triangulation_2 gso(at2); + draw_function_for_t2::compute_elements(at2, graphics_scene, gso); } +#ifdef CGAL_USE_BASIC_VIEWER + template void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm, const char *title="Constrained Triangulation_2 Basic Viewer") @@ -74,19 +92,19 @@ void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm, draw_graphics_scene(buffer, title); } - template void draw(const CGAL_T2_TYPE& at2, const char *title="Constrained Triangulation_2 Basic Viewer") { - internal::In_domain in_domain; - draw(at2, in_domain, title); + CGAL::Graphics_scene buffer; + add_to_graphics_scene(at2, buffer); + draw_graphics_scene(buffer, title); } +#endif // CGAL_USE_BASIC_VIEWER + #undef CGAL_T2_TYPE } // End namespace CGAL -#endif // CGAL_USE_BASIC_VIEWER - #endif // CGAL_DRAW_CT2_H diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 22141bf7d974..32a42879ae46 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -77,13 +77,9 @@ void compute_vertex(const T2& t2, typename T2::Vertex_handle vh, { return; } if (gs_options.colored_vertex(t2, vh)) - { - graphics_scene.add_point(vh->point(), gs_options.vertex_color(t2, vh)); - } + { graphics_scene.add_point(vh->point(), gs_options.vertex_color(t2, vh)); } else - { - graphics_scene.add_point(vh->point()); - } + { graphics_scene.add_point(vh->point()); } } template @@ -117,7 +113,7 @@ void compute_elements(const T2& t2, #define CGAL_T2_TYPE CGAL::Triangulation_2 - template +template void add_to_graphics_scene(const CGAL_T2_TYPE& at2, CGAL::Graphics_scene& graphics_scene, const GSOptions& gs_options) @@ -125,9 +121,9 @@ void add_to_graphics_scene(const CGAL_T2_TYPE& at2, draw_function_for_t2::compute_elements(at2, graphics_scene, gs_options); } - template +template void add_to_graphics_scene(const CGAL_T2_TYPE& at2, - CGAL::Graphics_scene& graphics_scene) + CGAL::Graphics_scene& graphics_scene) { Graphics_scene_options Date: Mon, 4 Dec 2023 08:19:46 +0100 Subject: [PATCH 261/399] draw p2t2 --- .../CGAL/draw_periodic_2_triangulation_2.h | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index c3a7bafca673..048494256b32 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -32,35 +32,38 @@ struct Graphics_scene_options_periodic_2_triangulation_2 : public CGAL::Graphics_scene_options { Graphics_scene_options_periodic_2_triangulation_2(): - domain_color(CGAL::IO::Color(96, 104, 252)), + m_domain_color(CGAL::IO::Color(96, 104, 252)), m_draw_domain(true), - m_current_display_type(DS::STORED) + m_display_type(DS::STORED) {} - bool get_draw_domain() const + bool draw_domain() const { return m_draw_domain; } - void set_draw_domain(bool b) + void draw_domain(bool b) { m_draw_domain=b; } void toggle_draw_domain() { m_draw_domain=!m_draw_domain; } - typename DS::Iterator_type current_display_type() const - { return m_current_display_type; } + typename DS::Iterator_type display_type() const + { return m_display_type; } - void increase_current_display_type() + void increase_display_type() { - if(m_current_display_type==DS::UNIQUE_COVER_DOMAIN) - { m_current_display_type=DS::STORED; } + if(m_display_type==DS::UNIQUE_COVER_DOMAIN) + { m_display_type=DS::STORED; } else - { m_current_display_type=typename DS::Iterator_type(static_cast(m_current_display_type)+1); } + { m_display_type=typename DS::Iterator_type(static_cast(m_display_type)+1); } } -public: - CGAL::IO::Color domain_color; + const CGAL::IO::Color& domain_color() const + { return m_domain_color; } + void domain_color(const CGAL::IO::Color& c) + { m_domain_color=c; } protected: + CGAL::IO::Color m_domain_color; bool m_draw_domain; - typename DS::Iterator_type m_current_display_type; + typename DS::Iterator_type m_display_type; }; namespace draw_function_for_P2T2 @@ -145,10 +148,10 @@ void compute_domain(const P2T2& p2t2, Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin()); Kernel::Point_2 p4((orig_domain.max)()); - graphics_scene.add_segment(p1 + shift, p2 + shift, gs_options.domain_color); - graphics_scene.add_segment(p1 + shift, p3 + shift, gs_options.domain_color); - graphics_scene.add_segment(p2 + shift, p4 + shift, gs_options.domain_color); - graphics_scene.add_segment(p3 + shift, p4 + shift, gs_options.domain_color); + graphics_scene.add_segment(p1 + shift, p2 + shift, gs_options.domain_color()); + graphics_scene.add_segment(p1 + shift, p3 + shift, gs_options.domain_color()); + graphics_scene.add_segment(p2 + shift, p4 + shift, gs_options.domain_color()); + graphics_scene.add_segment(p3 + shift, p4 + shift, gs_options.domain_color()); } } } @@ -161,7 +164,7 @@ void compute_elements(const P2T2& p2t2, // Get the display type, iterate through periodic elements according // to the display type typedef typename P2T2::Iterator_type Iterator_type; - Iterator_type it_type = (Iterator_type)gs_options.current_display_type(); + Iterator_type it_type = (Iterator_type)gs_options.display_type(); // Iterate through vertices, edges and faces, add elements to buffer if(gs_options.are_vertices_enabled()) @@ -185,7 +188,7 @@ void compute_elements(const P2T2& p2t2, { compute_face(p2t2, it, graphics_scene, gs_options); } } - if(gs_options.get_draw_domain()) + if(gs_options.draw_domain()) { // Compute the (9-sheet covering space) domain of the periodic triangulation compute_domain(p2t2, graphics_scene, gs_options); @@ -222,44 +225,29 @@ void add_to_graphics_scene(const CGAL_P2T2_TYPE& p2t2, // Specialization of draw function template void draw(const CGAL_P2T2_TYPE& ap2t2, - const GSOptions& gs_options, + GSOptions& gs_options, const char* title="2D Periodic Triangulation Viewer") { - CGAL::Graphics_scene buffer; - add_to_graphics_scene(ap2t2, buffer, gs_options); - draw_graphics_scene(buffer); -} - -template -void draw(const CGAL_P2T2_TYPE& ap2t2, - const char* title="2D Periodic Triangulation Viewer") -{ - CGAL::Graphics_scene buffer; - CGAL::Graphics_scene_options_periodic_2_triangulation_2 - gs_options; - - add_to_graphics_scene(ap2t2, buffer, gs_options); - CGAL::Qt::QApplication_and_basic_viewer app(buffer, title); + CGAL::Graphics_scene gs; + add_to_graphics_scene(ap2t2, gs, gs_options); + CGAL::Qt::QApplication_and_basic_viewer app(gs, title); if(app) { // Here we define the std::function to capture key pressed. app.basic_viewer().on_key_pressed= - [&ap2t2, &buffer, &gs_options] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool + [&ap2t2, &gs, &gs_options] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { - gs_options.increase_current_display_type(); + gs_options.increase_display_type(); basic_viewer->displayMessage - (QString("Display type=%1.").arg(gs_options.current_display_type()==0?"Stored": - (gs_options.current_display_type()==1?"Unique": - (gs_options.current_display_type()==2?"Stored cover": + (QString("Display type=%1.").arg(gs_options.display_type()==0?"Stored": + (gs_options.display_type()==1?"Unique": + (gs_options.display_type()==2?"Stored cover": "Unique cover")))); - buffer.clear(); - draw_function_for_P2T2::compute_elements(ap2t2, buffer, gs_options); + gs.clear(); + add_to_graphics_scene(ap2t2, gs, gs_options); basic_viewer->redraw(); } else @@ -278,6 +266,18 @@ void draw(const CGAL_P2T2_TYPE& ap2t2, } } +template +void draw(const CGAL_P2T2_TYPE& ap2t2, + const char* title="2D Periodic Triangulation Viewer") +{ + CGAL::Graphics_scene_options_periodic_2_triangulation_2 + gs_options; + draw(ap2t2, gs_options, title); +} + #endif // CGAL_USE_BASIC_VIEWER #undef CGAL_P2T2_TYPE From 91ecafd004127305a1553e7beab08d155c1818b0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 4 Dec 2023 08:40:28 +0100 Subject: [PATCH 262/399] draw voronoi 2 --- .../draw_voronoi_diagram_2.cpp | 18 ++-- .../include/CGAL/draw_voronoi_diagram_2.h | 88 +++++++++++-------- 2 files changed, 59 insertions(+), 47 deletions(-) diff --git a/Voronoi_diagram_2/examples/Voronoi_diagram_2/draw_voronoi_diagram_2.cpp b/Voronoi_diagram_2/examples/Voronoi_diagram_2/draw_voronoi_diagram_2.cpp index 2cd8f4a7ef3c..54c1e8c9b545 100644 --- a/Voronoi_diagram_2/examples/Voronoi_diagram_2/draw_voronoi_diagram_2.cpp +++ b/Voronoi_diagram_2/examples/Voronoi_diagram_2/draw_voronoi_diagram_2.cpp @@ -23,15 +23,15 @@ int main(int argc, char* argv[]) { VD vd; std::ifstream ifs((argc>1)?argv[1]:"data/data4.dt.cin"); - assert(ifs); - - Site_2 t; - while ( ifs >> t ) { vd.insert(t); } - ifs.close(); - - assert( vd.is_valid() ); - - CGAL::draw(vd); + if(ifs) + { + Site_2 t; + while ( ifs >> t ) { vd.insert(t); } + ifs.close(); + assert( vd.is_valid() ); + + CGAL::draw(vd); + } return EXIT_SUCCESS; } diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 79c3501bf81e..afe34cd5855f 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -33,16 +33,30 @@ template -struct Graphics_scene_options_voronoi : +struct Graphics_scene_options_voronoi_2 : public CGAL::Graphics_scene_options { - Graphics_scene_options_voronoi() : m_draw_voronoi_vertices(true), - m_draw_dual_vertices(true), - dual_vertex_color(CGAL::IO::Color(50, 100, 180)), - ray_color(CGAL::IO::Color(100, 0, 0)), - bisector_color(CGAL::IO::Color(0, 100, 0)) + Graphics_scene_options_voronoi_2() : m_dual_vertex_color(50, 100, 180), + m_ray_color(100, 0, 0), + m_bisector_color(0, 100, 0), + m_draw_voronoi_vertices(true), + m_draw_dual_vertices(true) {} + const CGAL::IO::Color& dual_vertex_color() const + { return m_dual_vertex_color; } + const CGAL::IO::Color& ray_color() const + { return m_ray_color; } + const CGAL::IO::Color& bisector_color() const + { return m_bisector_color; } + + void dual_vertex_color(const CGAL::IO::Color& c) + { m_dual_vertex_color=c; } + void ray_color(const CGAL::IO::Color& c) + { m_ray_color=c; } + void bisector_color(const CGAL::IO::Color& c) + { m_bisector_color=c; } + void disable_voronoi_vertices() { m_draw_voronoi_vertices=false; } void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; } bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; } @@ -53,11 +67,10 @@ struct Graphics_scene_options_voronoi : bool are_dual_vertices_enabled() const { return m_draw_dual_vertices; } void toggle_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; } - CGAL::IO::Color dual_vertex_color; - CGAL::IO::Color ray_color; - CGAL::IO::Color bisector_color; - protected: + CGAL::IO::Color m_dual_vertex_color; + CGAL::IO::Color m_ray_color; + CGAL::IO::Color m_bisector_color; bool m_draw_voronoi_vertices; bool m_draw_dual_vertices; }; @@ -89,7 +102,7 @@ void compute_dual_vertex(const V2& /*v2*/, typename V2::Delaunay_graph::Finite_vertices_iterator vi, CGAL::Graphics_scene &graphics_scene, const GSOptions& gs_options) -{ graphics_scene.add_point(vi->point(), gs_options.dual_vertex_color); } +{ graphics_scene.add_point(vi->point(), gs_options.dual_vertex_color()); } template void add_segments_and_update_bounding_box(const V2& v2, @@ -102,14 +115,17 @@ void add_segments_and_update_bounding_box(const V2& v2, if (he->is_segment()) { - if(gs_options.colored_edge(v2, he)) - { - graphics_scene.add_segment(he->source()->point(), he->target()->point(), - gs_options.edge_color(v2, he)); - } - else + if(gs_options.draw_edge(v2, he)) { - graphics_scene.add_segment(he->source()->point(), he->target()->point()); + if(gs_options.colored_edge(v2, he)) + { + graphics_scene.add_segment(he->source()->point(), he->target()->point(), + gs_options.edge_color(v2, he)); + } + else + { + graphics_scene.add_segment(he->source()->point(), he->target()->point()); + } } } else @@ -240,14 +256,14 @@ void compute_rays_and_bisectors(const V2&, if (he->has_source()) { // add_ray_segment(he->source()->point(), get_second_point(he, graphics_scene.get_bounding_box())); - graphics_scene.add_ray(he->source()->point(), direction, gs_options.ray_color); + graphics_scene.add_ray(he->source()->point(), direction, gs_options.ray_color()); } } else if (he->is_bisector()) { Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, (v1->point().y() + v2->point().y()) / 2); - graphics_scene.add_line(pointOnLine, direction, gs_options.bisector_color); + graphics_scene.add_line(pointOnLine, direction, gs_options.bisector_color()); } } @@ -348,7 +364,7 @@ void add_to_graphics_scene(const CGAL_VORONOI_TYPE& v2, CGAL::Graphics_scene& graphics_scene) { // Default graphics view options. - CGAL::Graphics_scene_options_voronoi @@ -362,27 +378,11 @@ void add_to_graphics_scene(const CGAL_VORONOI_TYPE& v2, // Specialization of draw function. template void draw(const CGAL_VORONOI_TYPE& av2, - const GSOptions& gs_options, + GSOptions& gs_options, const char *title="2D Voronoi Diagram Basic Viewer") { CGAL::Graphics_scene buffer; add_to_graphics_scene(av2, buffer, gs_options); - draw_graphics_scene(buffer, title); -} - -template -void draw(const CGAL_VORONOI_TYPE& av2, - const char *title="2D Voronoi Diagram Basic Viewer") -{ - CGAL::Graphics_scene buffer; - - CGAL::Graphics_scene_options_voronoi - gs_options; - - add_to_graphics_scene(av2, buffer, gs_options); CGAL::Qt::QApplication_and_basic_viewer app(buffer, title); if(app) @@ -445,6 +445,18 @@ void draw(const CGAL_VORONOI_TYPE& av2, } } +template +void draw(const CGAL_VORONOI_TYPE& av2, + const char *title="2D Voronoi Diagram Basic Viewer") +{ + CGAL::Graphics_scene_options_voronoi_2 + gs_options; + draw(av2, gs_options, title); +} + #endif // CGAL_USE_BASIC_VIEWER #undef CGAL_VORONOI_TYPE From 046fa81d688fe461673500690e44ce719de143a8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 4 Dec 2023 16:59:46 +0100 Subject: [PATCH 263/399] draw arrangement --- .../Arrangement_on_surface_2/draw_arr.cpp | 29 +- .../include/CGAL/draw_arrangement_2.h | 1079 +++++++---------- 2 files changed, 457 insertions(+), 651 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp index 91da88edc68a..8cff8c50625f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp @@ -100,13 +100,24 @@ int main() { << arr.number_of_faces() << std::endl; std::size_t id(0); - CGAL::draw(arr, [&] (Arrangement_2::Face_const_handle) -> CGAL::IO::Color { - float h = 360.0f * id++ / arr.number_of_faces(); - float s = 0.5; - float v = 0.5; - auto [r, g, b] = hsv_to_rgb(h, s, v); - return CGAL::IO::Color(r,g,b); - }, "hsv colors", true); - - return EXIT_SUCCESS; + + CGAL::Graphics_scene_options gso; + gso.colored_face=[](const Arrangement_2&, Arrangement_2::Face_const_handle) -> bool + { return true; }; + + gso.face_color=[&id](const Arrangement_2& arr, Arrangement_2::Face_const_handle) -> CGAL::IO::Color + { + float h = 360.0f * id++ / arr.number_of_faces(); + float s = 0.5; + float v = 0.5; + auto [r, g, b] = hsv_to_rgb(h, s, v); + return CGAL::IO::Color(r,g,b); + }; + + CGAL::draw(arr, gso, "hsv colors"); + + 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 9d3248073482..2c26b65a55cd 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -24,379 +24,344 @@ #include #include - -#ifdef CGAL_USE_BASIC_VIEWER +#include +#include +#include #include -#include #include #include #include namespace CGAL { -struct Default_color_generator { - /*! Obtain color - */ - template - CGAL::IO::Color operator()(HalfedgeHandle /* h */) { - static std::random_device rd; - static std::mt19937 rng(rd()); - static std::uniform_int_distribution uni(0, 255); - return CGAL::IO::Color(uni(rng), uni(rng), uni(rng)); - } -}; - -// Viewer class for`< Polygon_2 -template -class Aos_2_basic_viewer_qt : public Basic_viewer { - using Aos = ArrangementOnSurface_2; - using Color_generator = ColorGenerator; - using Base = Basic_viewer; - using Gt = typename Aos::Geometry_traits_2; - using Point = typename Aos::Point_2; - using X_monotone_curve = typename Aos::X_monotone_curve_2; - using Vertex_const_handle = typename Aos::Vertex_const_handle; - using Halfedge_const_handle = typename Aos::Halfedge_const_handle; - using Face_const_handle = typename Aos::Face_const_handle; - using Ccb_halfedge_const_circulator = - typename Aos::Ccb_halfedge_const_circulator; - -public: - /// Construct the viewer. - /// @param arr the arrangement to view - /// @param title the title of the window - Aos_2_basic_viewer_qt(QWidget* parent, const Aos& aos, - Color_generator color_generator, - const char* title = "2D Arrangement Basic Viewer", - bool draw_vertices = false) : - // First draw: vertices; edges, faces; multi-color; no inverse normal - Base(parent, m_graphics_scene, title, draw_vertices, true, true, false, false), - m_aos(aos), - m_color_generator(color_generator) +namespace draw_function_for_arrangement_2 +{ + template + class Draw_arr_tool { - // mimic the computation of Camera::pixelGLRatio() - auto bbox = bounding_box(); - CGAL::qglviewer::Vec minv(bbox.xmin(), bbox.ymin(), 0); - CGAL::qglviewer::Vec maxv(bbox.xmax(), bbox.ymax(), 0); - auto diameter = (maxv - minv).norm(); - m_pixel_ratio = diameter / m_height; - } + public: + using Halfedge_const_handle=typename Arr::Halfedge_const_handle; + using Vertex_const_handle=typename Arr::Vertex_const_handle; + using Face_const_handle=typename Arr::Face_const_handle; + using Ccb_halfedge_const_circulator=typename Arr::Ccb_halfedge_const_circulator; + using Inner_ccb_const_iterator=typename Arr::Inner_ccb_const_iterator; + using Outer_ccb_const_iterator=typename Arr::Outer_ccb_const_iterator; + using Gt=typename Arr::Geometry_traits_2; + using Point=typename Arr::Point_2; + using X_monotone_curve = typename Arr::X_monotone_curve_2; + + Draw_arr_tool(Arr& a_aos, CGAL::Graphics_scene& a_gs, const GSOptions& a_gso): + m_aos(a_aos), m_gs(a_gs), m_gso(a_gso) + {} + + /// Add a face. + void add_face(Face_const_handle face) + { + // std::cout << "add_face()\n"; + for (Inner_ccb_const_iterator it = face->inner_ccbs_begin(); + it != face->inner_ccbs_end(); ++it) + { add_ccb(*it); } + + for (Outer_ccb_const_iterator it = face->outer_ccbs_begin(); + it != face->outer_ccbs_end(); ++it) + { + add_ccb(*it); + draw_region(*it); + } + } - /*! Intercept the resizing of the window. - */ - virtual void resizeGL(int width, int height) { - CGAL::QGLViewer::resizeGL(width, height); - m_width = width; - m_height = height; - CGAL::qglviewer::Vec p; - auto ratio = camera()->pixelGLRatio(p); - if (ratio != m_pixel_ratio) { - m_pixel_ratio = ratio; - add_elements(); + /// Add a Connected Component of the Boundary. + void add_ccb(Ccb_halfedge_const_circulator circ) + { + // std::cout << "add_ccb()\n"; + auto curr = circ; + do { + auto new_face = curr->twin()->face(); + if (m_visited.find(new_face) != m_visited.end()) continue; + m_visited[new_face] = true; + add_face(new_face); + } while (++curr != circ); } - } - /*! Compute an approximation of the bounding box of a point. - * \param[in] p the (exact) point. - * Call this member function only if the geometry traits is equipped with - * the coordinate-approximation functionality of a point coordinate. - * This function must be inlined (e.g., a template) to enable the - * compiled-time dispatching in the function `bounding_box()`. - */ - template - CGAL::Bbox_2 approximate_bbox(const Point& p, const Approximate& approx) { - auto x = approx(p, 0); - auto y = approx(p, 1); - return CGAL::Bbox_2(x, y, x, y); - } + ///! Draw a region. + void draw_region(Ccb_halfedge_const_circulator circ) + { + // std::cout << "draw_region()\n"; + /* Check whether the traits has a member function called + * approximate_2_object() and if so check whether the return type, namely + * `Approximate_2` has an appropriate operator. + * + * C++20 supports concepts and `requires` expression; see, e.g., + * https://en.cppreference.com/w/cpp/language/constraints; thus, the first + * condition above can be elegantly verified as follows: + * constexpr bool has_approximate_2_object = + * requires(const Gt& traits) { traits.approximate_2_object(); }; + * + * C++17 has experimental constructs called is_detected and + * is_detected_v that can be used to achieve the same goal. + * + * For now we use C++14 features. + */ + if(m_gso.colored_face(m_aos, circ->face())) + { m_gs.face_begin(m_gso.face_color(m_aos, circ->face())); } + else + { m_gs.face_begin(); } - /*! Obtain the bounding box of a point. - * \param[in] p the point. - * We assume that if the coordinate-approximation functionality is not - * supported, the point supports the member function `bbox()`. - * This function must be inlined (e.g., a template) to enable the - * compiled-time dispatching in the function `bounding_box()`. - */ - template - CGAL::Bbox_2 exact_bbox(const Point& p) { return p.bbox(); } + const auto* traits = this->m_aos.geometry_traits(); + auto ext = find_smallest(circ, *traits); + auto curr = ext; - /*! Compile time dispatching - */ + do { + // Skip halfedges that are "antenas": + while (curr->face() == curr->twin()->face()) curr = curr->twin()->next(); + draw_region_impl1(curr, *traits, 0); + curr = curr->next(); + } while (curr != ext); + + m_gs.face_end(); + } + + /// Compile time dispatching #if 0 - template - void bounding_box_impl2(CGAL::Bbox_2& bbox, const Point& p, T const&, long) - { bbox += exact_bbox(p); } - - template - auto bounding_box_impl2(CGAL::Bbox_2& bbox, const Point& p, T const& approx, - int) -> decltype(approx.operator()(p), void()) - { bbox += approximate_bbox(p, approx); } - - template - void bounding_box_impl1(CGAL::Bbox_2& bbox, const Point& p, T const&, long) - { bbox += exact_bbox(p); } - - template - auto bounding_box_impl1(CGAL::Bbox_2& bbox, const Point& p, T const& traits, - int) -> - decltype(traits.approximate_2_object(), void()) { - using Approximate = typename Gt::Approximate_2; - bounding_box_impl2(bbox, p, traits.approximate_2_object(), 0); - } + template + void draw_region_impl2(Halfedge_const_handle curr, T const&, long) + { draw_exact_region(curr); } + + template + auto draw_region_impl2(Halfedge_const_handle curr, T const& approx, int) -> + decltype(approx.template operator()(X_monotone_curve{}, double{}, I{}, + bool{}), void()) + { draw_approximate_region(curr, approx); } + + template + void draw_region_impl1(Halfedge_const_handle curr, T const&, long) + { draw_exact_region(curr); } + + template + auto draw_region_impl1(Halfedge_const_handle curr, T const& traits, int) -> + decltype(traits.approximate_2_object(), void()) { + using Approximate = typename Gt::Approximate_2; + draw_region_impl2(curr, traits.approximate_2_object(), 0); + } #else - template - void bounding_box_impl1(CGAL::Bbox_2& bbox, const Point& p, T const& traits, - int) - { bbox += approximate_bbox(p, traits.approximate_2_object()); } + template + void draw_region_impl1(Halfedge_const_handle curr, T const& traits, int) + { draw_approximate_region(curr, traits.approximate_2_object()); } #endif - /*! Compute the bounding box. - */ - CGAL::Bbox_2 bounding_box() { - CGAL::Bbox_2 bbox; - const auto* traits = this->m_aos.geometry_traits(); - // At this point we assume that the arrangement is not open, and thus the - // bounding box is defined by the vertices. - for (auto it = m_aos.vertices_begin(); it != m_aos.vertices_end(); ++it) - bounding_box_impl1(bbox, it->point(), *traits, 0); - return bbox; - } - - /*! Add all faces. - */ - template - void add_faces(const Traits&) { - for (auto it = m_aos.unbounded_faces_begin(); - it != m_aos.unbounded_faces_end(); ++it) - add_face(it); - } - - /*! Add all faces. - */ - template - void - add_faces(Arr_geodesic_arc_on_sphere_traits_2 const&) - { add_face(m_aos.faces_begin()); } - - /*! Add all elements to be drawn. - */ - void add_elements() { - // std::cout << "add_elements()\n"; - // std::cout << "ratio: " << this->pixel_ratio() << std::endl; - m_graphics_scene.clear(); - m_visited.clear(); - - if (m_aos.is_empty()) return; - add_faces(*(this->m_aos.geometry_traits())); - - // Add edges that do not separate faces. - for (auto it = m_aos.edges_begin(); it != m_aos.edges_end(); ++it) - if (it->face() == it->twin()->face()) draw_curve(it->curve()); - - // Add all points - for (auto it = m_aos.vertices_begin(); it != m_aos.vertices_end(); ++it) - draw_point(it->point()); - - m_visited.clear(); - } - - /*/ Obtain the pixel ratio - */ - double pixel_ratio() const { return m_pixel_ratio; } - -protected: - template - Halfedge_const_handle - find_smallest(Ccb_halfedge_const_circulator circ, - Arr_geodesic_arc_on_sphere_traits_2 const&) - { return circ; } - - /*! Find the halfedge incident to the lexicographically smallest vertex - * along the CCB, such that there is no other halfedge underneath. - */ - template - Halfedge_const_handle find_smallest(Ccb_halfedge_const_circulator circ, - const Traits&) { - // std::cout << "find_smallest()\n"; - const auto* traits = this->m_aos.geometry_traits(); - auto cmp_xy = traits->compare_xy_2_object(); - auto cmp_y = traits->compare_y_at_x_right_2_object(); - - // Find the first halfedge directed from left to right - auto curr = circ; - do if (curr->direction() == CGAL::ARR_LEFT_TO_RIGHT) break; - while (++curr != circ); - Halfedge_const_handle ext = curr; - - // Find the halfedge incident to the lexicographically smallest vertex, - // such that there is no other halfedge underneath. - do { - // Discard edges not directed from left to right: - if (curr->direction() != CGAL::ARR_LEFT_TO_RIGHT) continue; - - - auto res = cmp_xy(curr->source()->point(), ext->source()->point()); - - // Discard the edges inciden to a point strictly larger than the point - // incident to the stored extreme halfedge: - if (res == LARGER) continue; - - // Store the edge inciden to a point strictly smaller: - if (res == SMALLER) { - ext = curr; - continue; + template + void draw_region_impl1 + (Halfedge_const_handle curr, + Arr_geodesic_arc_on_sphere_traits_2 const& traits, + int) + { + // std::cout << "draw_region_impl1()\n"; + auto approx = traits.approximate_2_object(); + using Kernel = Kernel_; + using Traits = Arr_geodesic_arc_on_sphere_traits_2; + using Ak = typename Traits::Approximate_kernel; + using Ap = typename Traits::Approximate_point_2; + using Approx_point_3 = typename Ak::Point_3; + + std::vector polyline; + double error(0.01); + bool l2r = curr->direction() == ARR_LEFT_TO_RIGHT; + approx(curr->curve(), error, std::back_inserter(polyline), l2r); + if (polyline.empty()) return; + auto it = polyline.begin(); + auto x = it->dx(); + auto y = it->dy(); + auto z = it->dz(); + auto l = std::sqrt(x*x + y*y + z*z); + Approx_point_3 prev(x/l, y/l, z/l); + for (++it; it != polyline.end(); ++it) { + auto x = it->dx(); + auto y = it->dy(); + auto z = it->dz(); + auto l = std::sqrt(x*x + y*y + z*z); + Approx_point_3 next(x/l, y/l, z/l); + this->add_segment(prev, next); + prev = next; + // this->add_point_in_face(*prev); } + } - // The incident points are equal; compare the halfedges themselves: - if (cmp_y(curr->curve(), ext->curve(), curr->source()->point()) == - SMALLER) - ext = curr; - } while (++curr != circ); + /*! Draw a region using aproximate coordinates. + * Call this member function only if the geometry traits is equipped with + * the coordinate-approximation functionality of a curve. + * This function must be inlined (e.g., a template) to enable the + * compiled-time dispatching in the function `draw_region()`. + */ + template + void draw_approximate_region(Halfedge_const_handle curr, + const Approximate& approx) + { + // std::cout << "draw_approximate_region()\n"; + std::vector polyline; + double error(0.01); // TODO? (this->pixel_ratio()); + bool l2r = curr->direction() == ARR_LEFT_TO_RIGHT; + approx(curr->curve(), error, std::back_inserter(polyline), l2r); + if (polyline.empty()) return; + auto it = polyline.begin(); + auto prev = it++; + for (; it != polyline.end(); prev = it++) { + m_gs.add_segment(*prev, *it); + m_gs.add_point_in_face(*prev); + } + } - return ext; - } + /// Draw an exact curve. + template + void draw_exact_curve(const XMonotoneCurve& curve) + { + const auto* traits = this->m_aos.geometry_traits(); + auto ctr_min = traits->construct_min_vertex_2_object(); + auto ctr_max = traits->construct_max_vertex_2_object(); + this->add_segment(ctr_min(curve), ctr_max(curve)); + } - /*! Draw a region using aproximate coordinates. - * Call this member function only if the geometry traits is equipped with - * the coordinate-approximation functionality of a curve. - * This function must be inlined (e.g., a template) to enable the - * compiled-time dispatching in the function `draw_region()`. - */ - template - void draw_approximate_region(Halfedge_const_handle curr, - const Approximate& approx) { - // std::cout << "draw_approximate_region()\n"; - std::vector polyline; - double error(this->pixel_ratio()); - bool l2r = curr->direction() == ARR_LEFT_TO_RIGHT; - approx(curr->curve(), error, std::back_inserter(polyline), l2r); - if (polyline.empty()) return; - auto it = polyline.begin(); - auto prev = it++; - for (; it != polyline.end(); prev = it++) { - m_graphics_scene.add_segment(*prev, *it); - m_graphics_scene.add_point_in_face(*prev); + /// Draw an exact region. + void draw_exact_region(Halfedge_const_handle curr) + { + // this->add_point_in_face(curr->source()->point()); + draw_exact_curve(curr->curve()); } - } - /*! Draw an exact curve. - */ - template - void draw_exact_curve(const XMonotoneCurve& curve) { - const auto* traits = this->m_aos.geometry_traits(); - auto ctr_min = traits->construct_min_vertex_2_object(); - auto ctr_max = traits->construct_max_vertex_2_object(); - this->add_segment(ctr_min(curve), ctr_max(curve)); - } + /// Add all faces. + template + void add_faces(const Traits&) + { + for (auto it=m_aos.unbounded_faces_begin(); it!=m_aos.unbounded_faces_end(); ++it) + { add_face(it); } + } - /*! Draw an exact region. - */ - void draw_exact_region(Halfedge_const_handle curr) { - // this->add_point_in_face(curr->source()->point()); - draw_exact_curve(curr->curve()); - } + /// Add all faces. + template + void add_faces(Arr_geodesic_arc_on_sphere_traits_2 const&) + { add_face(m_aos.faces_begin()); } - /*! Compile time dispatching - */ + /// Compile time dispatching #if 0 - template - void draw_region_impl2(Halfedge_const_handle curr, T const&, long) - { draw_exact_region(curr); } - - template - auto draw_region_impl2(Halfedge_const_handle curr, T const& approx, int) -> - decltype(approx.template operator()(X_monotone_curve{}, double{}, I{}, - bool{}), void()) - { draw_approximate_region(curr, approx); } - - template - void draw_region_impl1(Halfedge_const_handle curr, T const&, long) - { draw_exact_region(curr); } - - template - auto draw_region_impl1(Halfedge_const_handle curr, T const& traits, int) -> - decltype(traits.approximate_2_object(), void()) { - using Approximate = typename Gt::Approximate_2; - draw_region_impl2(curr, traits.approximate_2_object(), 0); - } + template + void draw_point_impl2(const Point& p, T const&, long) { add_point(p); } + + template + auto draw_point_impl2(const Point& p, T const& approx, int) -> + decltype(approx.operator()(p), void()) + { add_point(approx(p)); } + + template + void draw_point_impl1(const Point& p, T const&, long) { add_point(p); } + + template + auto draw_point_impl1(const Point& p, T const& traits, int) -> + decltype(traits.approximate_2_object(), void()) { + using Approximate = typename Gt::Approximate_2; + draw_point_impl2(p, traits.approximate_2_object(), true); + } #else - template - void draw_region_impl1(Halfedge_const_handle curr, T const& traits, int) - { draw_approximate_region(curr, traits.approximate_2_object()); } + template + void draw_point_impl1(const Point& p, T const& traits, int) + { m_gs.add_point(traits.approximate_2_object()(p)); } #endif - template - void draw_region_impl1 - (Halfedge_const_handle curr, - Arr_geodesic_arc_on_sphere_traits_2 const& traits, - int) { - // std::cout << "draw_region_impl1()\n"; - auto approx = traits.approximate_2_object(); - using Kernel = Kernel_; - using Traits = Arr_geodesic_arc_on_sphere_traits_2; - using Ak = typename Traits::Approximate_kernel; - using Ap = typename Traits::Approximate_point_2; - using Approx_point_3 = typename Ak::Point_3; - - std::vector polyline; - double error(0.01); - bool l2r = curr->direction() == ARR_LEFT_TO_RIGHT; - approx(curr->curve(), error, std::back_inserter(polyline), l2r); - if (polyline.empty()) return; - auto it = polyline.begin(); - auto x = it->dx(); - auto y = it->dy(); - auto z = it->dz(); - auto l = std::sqrt(x*x + y*y + z*z); - Approx_point_3 prev(x/l, y/l, z/l); - for (++it; it != polyline.end(); ++it) { - auto x = it->dx(); - auto y = it->dy(); - auto z = it->dz(); + template + void draw_point_impl1 + (const Point& p, + Arr_geodesic_arc_on_sphere_traits_2 const& traits, + int) + { + auto approx = traits.approximate_2_object(); + using Traits = Arr_geodesic_arc_on_sphere_traits_2; + using Ak = typename Traits::Approximate_kernel; + using Approx_point_3 = typename Ak::Point_3; + auto ap = approx(p); + auto x = ap.dx(); + auto y = ap.dy(); + auto z = ap.dz(); auto l = std::sqrt(x*x + y*y + z*z); - Approx_point_3 next(x/l, y/l, z/l); - this->add_segment(prev, next); - prev = next; - // this->add_point_in_face(*prev); + Approx_point_3 p3(x/l, y/l, z/l); + add_point(p3); } - } - /*! Draw a region. - */ - void draw_region(Ccb_halfedge_const_circulator circ) { - // std::cout << "draw_region()\n"; - /* Check whether the traits has a member function called - * approximate_2_object() and if so check whether the return type, namely - * `Approximate_2` has an appropriate operator. - * - * C++20 supports concepts and `requires` expression; see, e.g., - * https://en.cppreference.com/w/cpp/language/constraints; thus, the first - * condition above can be elegantly verified as follows: - * constexpr bool has_approximate_2_object = - * requires(const Gt& traits) { traits.approximate_2_object(); }; - * - * C++17 has experimental constructs called is_detected and - * is_detected_v that can be used to achieve the same goal. - * - * For now we use C++14 features. + /// Draw a point. + void draw_point(const Point& p) + { + const auto* traits = m_aos.geometry_traits(); + draw_point_impl1(p, *traits, 0); + } + + template + Halfedge_const_handle + find_smallest(Ccb_halfedge_const_circulator circ, + Arr_geodesic_arc_on_sphere_traits_2 const&) + { return circ; } + + /*! Find the halfedge incident to the lexicographically smallest vertex + * along the CCB, such that there is no other halfedge underneath. */ - auto color = m_color_generator(circ->face()); - m_graphics_scene.face_begin(color); + template + Halfedge_const_handle find_smallest(Ccb_halfedge_const_circulator circ, + const Traits&) + { + // std::cout << "find_smallest()\n"; + const auto* traits = this->m_aos.geometry_traits(); + auto cmp_xy = traits->compare_xy_2_object(); + auto cmp_y = traits->compare_y_at_x_right_2_object(); + + // Find the first halfedge directed from left to right + auto curr = circ; + do if (curr->direction() == CGAL::ARR_LEFT_TO_RIGHT) break; + while (++curr != circ); + Halfedge_const_handle ext = curr; + + // Find the halfedge incident to the lexicographically smallest vertex, + // such that there is no other halfedge underneath. + do { + // Discard edges not directed from left to right: + if (curr->direction() != CGAL::ARR_LEFT_TO_RIGHT) continue; + + auto res = cmp_xy(curr->source()->point(), ext->source()->point()); + + // Discard the edges inciden to a point strictly larger than the point + // incident to the stored extreme halfedge: + if (res == LARGER) continue; + + // Store the edge inciden to a point strictly smaller: + if (res == SMALLER) { + ext = curr; + continue; + } + + // The incident points are equal; compare the halfedges themselves: + if (cmp_y(curr->curve(), ext->curve(), curr->source()->point()) == + SMALLER) + ext = curr; + } while (++curr != circ); + + return ext; + } - const auto* traits = this->m_aos.geometry_traits(); - auto ext = find_smallest(circ, *traits); - auto curr = ext; + /// Add all elements to be drawn. + void add_elements() + { + // std::cout << "add_elements()\n"; + // std::cout << "ratio: " << this->pixel_ratio() << std::endl; + m_visited.clear(); - do { - // Skip halfedges that are "antenas": - while (curr->face() == curr->twin()->face()) curr = curr->twin()->next(); - draw_region_impl1(curr, *traits, 0); - curr = curr->next(); - } while (curr != ext); + if (m_aos.is_empty()) return; + add_faces(*(this->m_aos.geometry_traits())); + + // Add edges that do not separate faces. + for (auto it = m_aos.edges_begin(); it != m_aos.edges_end(); ++it) + { if (it->face() == it->twin()->face()) draw_curve(it->curve()); } + + // Add all points + for (auto it = m_aos.vertices_begin(); it != m_aos.vertices_end(); ++it) + { draw_point(it->point()); } - m_graphics_scene.face_end(); + m_visited.clear(); } /*! Draw a curve using aproximate coordinates. @@ -409,348 +374,178 @@ class Aos_2_basic_viewer_qt : public Basic_viewer { void draw_approximate_curve(const XMonotoneCurve& curve, const Approximate& approx) { std::vector polyline; - double error(this->pixel_ratio()); + double error(0.01); // TODO? (this->pixel_ratio()); approx(curve, error, std::back_inserter(polyline)); if (polyline.empty()) return; auto it = polyline.begin(); auto prev = it++; - for (; it != polyline.end(); prev = it++) m_graphics_scene.add_segment(*prev, *it); + for (; it != polyline.end(); prev = it++) m_gs.add_segment(*prev, *it); } /*! Compile time dispatching */ #if 0 - template - void draw_curve_impl2(const X_monotone_curve& xcv, T const&, long) - { draw_exact_curve(xcv); } - - template - auto draw_curve_impl2(const X_monotone_curve& xcv, T const& approx, int) -> - decltype(approx.template operator()(X_monotone_curve{}, double{}, I{}, - bool{}), void()) - { draw_approximate_curve(xcv, approx); } - - template - void draw_curve_impl1(const X_monotone_curve& xcv, T const&, long) - { draw_exact_curve(xcv); } - - template - auto draw_curve_impl1(const X_monotone_curve& xcv, T const& traits, int) -> - decltype(traits.approximate_2_object(), void()) { - using Approximate = typename Gt::Approximate_2; - draw_curve_impl2(xcv, traits.approximate_2_object(), 0); - } + template + void draw_curve_impl2(const X_monotone_curve& xcv, T const&, long) + { draw_exact_curve(xcv); } + + template + auto draw_curve_impl2(const X_monotone_curve& xcv, T const& approx, int) -> + decltype(approx.template operator()(X_monotone_curve{}, double{}, I{}, + bool{}), void()) + { draw_approximate_curve(xcv, approx); } + + template + void draw_curve_impl1(const X_monotone_curve& xcv, T const&, long) + { draw_exact_curve(xcv); } + + template + auto draw_curve_impl1(const X_monotone_curve& xcv, T const& traits, int) -> + decltype(traits.approximate_2_object(), void()) { + using Approximate = typename Gt::Approximate_2; + draw_curve_impl2(xcv, traits.approximate_2_object(), 0); + } #else - template - void draw_curve_impl1(const X_monotone_curve& xcv, T const& traits, int) - { draw_approximate_curve(xcv, traits.approximate_2_object()); } + template + void draw_curve_impl1(const X_monotone_curve& xcv, T const& traits, int) + { draw_approximate_curve(xcv, traits.approximate_2_object()); } #endif - template - void draw_curve_impl1 - (const X_monotone_curve& xcv, - Arr_geodesic_arc_on_sphere_traits_2 const& traits, - int) { - auto approx = traits.approximate_2_object(); - using Kernel = Kernel_; - using Traits = Arr_geodesic_arc_on_sphere_traits_2; - using Ak = typename Traits::Approximate_kernel; - using Ap = typename Traits::Approximate_point_2; - using Approx_point_3 = typename Ak::Point_3; - std::vector apoints; - double error(0.01); - approx(xcv, error, std::back_inserter(apoints)); - auto it = apoints.begin(); - auto x = it->dx(); - auto y = it->dy(); - auto z = it->dz(); - auto l = std::sqrt(x*x + y*y + z*z); - Approx_point_3 prev(x/l, y/l, z/l); - for (++it; it != apoints.end(); ++it) { + template + void draw_curve_impl1 + (const X_monotone_curve& xcv, + Arr_geodesic_arc_on_sphere_traits_2 const& traits, + int) + { + auto approx = traits.approximate_2_object(); + using Kernel = Kernel_; + using Traits = Arr_geodesic_arc_on_sphere_traits_2; + using Ak = typename Traits::Approximate_kernel; + using Ap = typename Traits::Approximate_point_2; + using Approx_point_3 = typename Ak::Point_3; + std::vector apoints; + double error(0.01); + approx(xcv, error, std::back_inserter(apoints)); + auto it = apoints.begin(); auto x = it->dx(); auto y = it->dy(); auto z = it->dz(); auto l = std::sqrt(x*x + y*y + z*z); - Approx_point_3 next(x/l, y/l, z/l); - this->add_segment(prev, next); - prev = next; + Approx_point_3 prev(x/l, y/l, z/l); + for (++it; it != apoints.end(); ++it) { + auto x = it->dx(); + auto y = it->dy(); + auto z = it->dz(); + auto l = std::sqrt(x*x + y*y + z*z); + Approx_point_3 next(x/l, y/l, z/l); + this->add_segment(prev, next); + prev = next; + } } - } - /*! Draw a curve. - */ - template - void draw_curve(const XMonotoneCurve& curve) { - /* Check whether the traits has a member function called - * approximate_2_object() and if so check whether the return type, namely - * `Approximate_2` has an appropriate operator. - * - * C++20 supports concepts and `requires` expression; see, e.g., - * https://en.cppreference.com/w/cpp/language/constraints; thus, the first - * condition above can be elegantly verified as follows: - * constexpr bool has_approximate_2_object = - * requires(const Gt& traits) { traits.approximate_2_object(); }; - * - * C++17 has experimental constructs called is_detected and - * is_detected_v that can be used to achieve the same goal. - * - * For now we use C++14 features. - */ -#if 0 - if constexpr (std::experimental::is_detected_v) + /// Draw a curve. + template + void draw_curve(const XMonotoneCurve& curve) { - const auto* traits = this->m_aos.geometry_traits(); - auto approx = traits->approximate_2_object(); - draw_approximate_curve(curve, approx); - return; - } - draw_exact_curve(curve); -#else - const auto* traits = this->m_aos.geometry_traits(); - draw_curve_impl1(curve, *traits, 0); -#endif - } - - /*! Compile time dispatching - */ + /* Check whether the traits has a member function called + * approximate_2_object() and if so check whether the return type, namely + * `Approximate_2` has an appropriate operator. + * + * C++20 supports concepts and `requires` expression; see, e.g., + * https://en.cppreference.com/w/cpp/language/constraints; thus, the first + * condition above can be elegantly verified as follows: + * constexpr bool has_approximate_2_object = + * requires(const Gt& traits) { traits.approximate_2_object(); }; + * + * C++17 has experimental constructs called is_detected and + * is_detected_v that can be used to achieve the same goal. + * + * For now we use C++14 features. + */ #if 0 - template - void draw_point_impl2(const Point& p, T const&, long) { add_point(p); } - - template - auto draw_point_impl2(const Point& p, T const& approx, int) -> - decltype(approx.operator()(p), void()) - { add_point(approx(p)); } - - template - void draw_point_impl1(const Point& p, T const&, long) { add_point(p); } - - template - auto draw_point_impl1(const Point& p, T const& traits, int) -> - decltype(traits.approximate_2_object(), void()) { - using Approximate = typename Gt::Approximate_2; - draw_point_impl2(p, traits.approximate_2_object(), true); - } + if constexpr (std::experimental::is_detected_v) + { + const auto* traits = this->m_aos.geometry_traits(); + auto approx = traits->approximate_2_object(); + draw_approximate_curve(curve, approx); + return; + } + draw_exact_curve(curve); #else - template - void draw_point_impl1(const Point& p, T const& traits, int) - { m_graphics_scene.add_point(traits.approximate_2_object()(p)); } + const auto* traits = this->m_aos.geometry_traits(); + draw_curve_impl1(curve, *traits, 0); #endif - - template - void draw_point_impl1 - (const Point& p, - Arr_geodesic_arc_on_sphere_traits_2 const& traits, - int) { - auto approx = traits.approximate_2_object(); - using Traits = Arr_geodesic_arc_on_sphere_traits_2; - using Ak = typename Traits::Approximate_kernel; - using Approx_point_3 = typename Ak::Point_3; - auto ap = approx(p); - auto x = ap.dx(); - auto y = ap.dy(); - auto z = ap.dz(); - auto l = std::sqrt(x*x + y*y + z*z); - Approx_point_3 p3(x/l, y/l, z/l); - add_point(p3); - } - - /*! Draw a point. - */ - void draw_point(const Point& p) { - const auto* traits = m_aos.geometry_traits(); - draw_point_impl1(p, *traits, 0); - } - - /*! Add a Connected Component of the Boundary. - */ - void add_ccb(Ccb_halfedge_const_circulator circ) { - // std::cout << "add_ccb()\n"; - auto curr = circ; - do { - auto new_face = curr->twin()->face(); - if (m_visited.find(new_face) != m_visited.end()) continue; - m_visited[new_face] = true; - add_face(new_face); - } while (++curr != circ); - } - - /*! Add a face. - */ - void add_face(Face_const_handle face) { - // std::cout << "add_face()\n"; - using Inner_ccb_const_iterator = typename Aos::Inner_ccb_const_iterator; - using Outer_ccb_const_iterator = typename Aos::Outer_ccb_const_iterator; - - for (Inner_ccb_const_iterator it = face->inner_ccbs_begin(); - it != face->inner_ccbs_end(); ++it) - add_ccb(*it); - - for (Outer_ccb_const_iterator it = face->outer_ccbs_begin(); - it != face->outer_ccbs_end(); ++it) { - add_ccb(*it); - draw_region(*it); } - } - //! - virtual void keyPressEvent(QKeyEvent* e) { - // Test key pressed: - // const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - // if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ... } + protected: + Arr& m_aos; + CGAL::Graphics_scene& m_gs; + const GSOptions& m_gso; + std::unordered_map m_visited; + }; - // Call: * add_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 +} // namespace draw_function_for_arrangement_2 - // Call the base method to process others/classicals key - Base::keyPressEvent(e); - } - -protected: - //! The window width in pixels. - int m_width = CGAL_BASIC_VIEWER_INIT_SIZE_X; - - //! The window height in pixels. - int m_height = CGAL_BASIC_VIEWER_INIT_SIZE_Y; - - //! The ratio between pixel and opengl units (in world coordinate system). - double m_pixel_ratio = 1; - - //! The arrangement to draw. - const Aos& m_aos; - - //! The color generator. - Color_generator m_color_generator; - - std::unordered_map m_visited; - CGAL::Graphics_scene m_graphics_scene; -}; - -//! Basic viewer of a 2D arrangement. -template -class Aos_2_viewer_qt : public Aos_2_basic_viewer_qt { -public: - using Aos = ArrangementOnSurface_2; - using Color_generator = ColorGenerator; - using Base = Aos_2_basic_viewer_qt; - using Point = typename Aos::Point_2; - using X_monotone_curve = typename Aos::X_monotone_curve_2; - using Halfedge_const_handle = typename Aos::Halfedge_const_handle; - using Face_const_handle = typename Aos::Face_const_handle; - using Ccb_halfedge_const_circulator = - typename Aos::Ccb_halfedge_const_circulator; - - /// Construct the viewer. - /// @param arr the arrangement to view - /// @param title the title of the window - Aos_2_viewer_qt(QWidget* parent, const Aos& aos, - Color_generator color_generator, - const char* title = "2D Arrangement on Surface Basic Viewer", - bool draw_vertices = false) : - Base(parent, aos, color_generator, title, draw_vertices) - {} -}; - -/*! Draw an arrangement on surface. - */ -template -void draw(const Arrangement_on_surface_2& aos, - const char* title = "2D Arrangement on Surface Basic Viewer", - bool draw_vertices = false) { -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif +#define CGAL_ARR_TYPE CGAL::Arrangement_on_surface_2 - if (cgal_test_suite) return; - using Gt = GeometryTraits_2; - using Tt = TopologyTraits; - using Aos = CGAL::Arrangement_on_surface_2; - using Viewer = Aos_2_viewer_qt; - - CGAL::Qt::init_ogl_context(4,3); - - int argc = 1; - const char* argv[2] = {"t2_viewer", nullptr}; - QApplication app(argc, const_cast(argv)); - Default_color_generator color_generator; - Viewer mainwindow(app.activeWindow(), aos, color_generator, title, - draw_vertices); - mainwindow.add_elements(); - mainwindow.show(); - app.exec(); +template +void add_to_graphics_scene(const CGAL_ARR_TYPE& aos, + CGAL::Graphics_scene& graphics_scene, + const GSOptions& gso) +{ + draw_function_for_arrangement_2::Draw_arr_tool dar(aos, graphics_scene, gso); + dar.add_elements(); } -/*! Draw an arrangement. - */ -template -void draw(const Arrangement_2& arr, - const char* title = "2D Arrangement Basic Viewer", - bool draw_vertices = false) { -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif +template +void add_to_graphics_scene(const CGAL_ARR_TYPE& aos, + CGAL::Graphics_scene& graphics_scene) +{ + CGAL::Graphics_scene_options + gso; + gso.colored_face=[](const CGAL_ARR_TYPE&, + typename CGAL_ARR_TYPE::Face_const_handle) -> bool + { return true; }; + + gso.face_color=[](const CGAL_ARR_TYPE&, + typename CGAL_ARR_TYPE::Face_const_handle fh) -> CGAL::IO::Color + { + CGAL::Random random((std::size_t)(&*fh)); + return get_random_color(random); + }; - if (cgal_test_suite) return; - using Gt = GeometryTraits_2; - using Arr = CGAL::Arrangement_2; - using Viewer = Aos_2_viewer_qt; - - CGAL::Qt::init_ogl_context(4,3); - - int argc = 1; - const char* argv[2] = {"t2_viewer", nullptr}; - QApplication app(argc, const_cast(argv)); - Default_color_generator color_generator; - Viewer mainwindow(app.activeWindow(), arr, color_generator, title, - draw_vertices); - mainwindow.add_elements(); - mainwindow.show(); - app.exec(); + add_to_graphics_scene(aos, graphics_scene, gso); } -/*! Draw an arrangement using a given color generator. - */ -template -void draw(const Arrangement_2& arr, - ColorGenerator color_generator, - const char* title = "2D Arrangement Basic Viewer", - bool draw_vertices = 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) return; - - using Color_generator = ColorGenerator; - using Gt = GeometryTraits_2; - using Arr = CGAL::Arrangement_2; - using Viewer = Aos_2_viewer_qt; +#ifdef CGAL_USE_BASIC_VIEWER - CGAL::Qt::init_ogl_context(4,3); +/// Draw an arrangement on surface. +template +void draw(const CGAL_ARR_TYPE& aos, const GSOptions& gso, + const char* title = "2D Arrangement on Surface Basic Viewer") +{ + CGAL::Graphics_scene graphics_scene; + add_to_graphics_scene(aos, graphics_scene, gso); + draw_graphics_scene(graphics_scene, title); - int argc = 1; - const char* argv[2] = {"t2_viewer", nullptr}; - QApplication app(argc, const_cast(argv)); - Viewer mainwindow(app.activeWindow(), arr, color_generator, title, - draw_vertices); - mainwindow.add_elements(); - mainwindow.show(); - app.exec(); } +template +void draw(const CGAL_ARR_TYPE& aos, + const char* title = "2D Arrangement on Surface Basic Viewer") +{ + CGAL::Graphics_scene graphics_scene; + add_to_graphics_scene(aos, graphics_scene); + draw_graphics_scene(graphics_scene, title); } -#endif +#endif // CGAL_USE_BASIC_VIEWER + +#undef CGAL_ARR_TYPE + +} // namespace CGAL + #endif From f8364752e01a282f3ab6212ed48bf78a65b730c8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 4 Dec 2023 18:05:40 +0100 Subject: [PATCH 264/399] draw arrangement: use gs_options --- .../include/CGAL/draw_arrangement_2.h | 117 ++++++++++++++---- 1 file changed, 91 insertions(+), 26 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 2c26b65a55cd..2298cdd5ef55 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -156,6 +156,9 @@ namespace draw_function_for_arrangement_2 Arr_geodesic_arc_on_sphere_traits_2 const& traits, int) { + if(!m_gso.draw_edge(m_aos, curr)) + { return; } + // std::cout << "draw_region_impl1()\n"; auto approx = traits.approximate_2_object(); using Kernel = Kernel_; @@ -181,9 +184,14 @@ namespace draw_function_for_arrangement_2 auto z = it->dz(); auto l = std::sqrt(x*x + y*y + z*z); Approx_point_3 next(x/l, y/l, z/l); - this->add_segment(prev, next); + + if(m_gso.colored_edge(m_aos, curr)) + { m_gs.add_segment(prev, next, m_gso.edge_color(m_aos, curr)); } + else + { m_gs.add_segment(prev, next); } + prev = next; - // this->add_point_in_face(*prev); + // m_gs.add_point_in_face(*prev); } } @@ -206,7 +214,13 @@ namespace draw_function_for_arrangement_2 auto it = polyline.begin(); auto prev = it++; for (; it != polyline.end(); prev = it++) { - m_gs.add_segment(*prev, *it); + if(m_gso.draw_edge(m_aos, curr)) + { + if(m_gso.colored_edge(m_aos, curr)) + { m_gs.add_segment(*prev, *it, m_gso.edge_color(m_aos, curr)); } + else + { m_gs.add_segment(*prev, *it); } + } m_gs.add_point_in_face(*prev); } } @@ -218,7 +232,7 @@ namespace draw_function_for_arrangement_2 const auto* traits = this->m_aos.geometry_traits(); auto ctr_min = traits->construct_min_vertex_2_object(); auto ctr_max = traits->construct_max_vertex_2_object(); - this->add_segment(ctr_min(curve), ctr_max(curve)); + m_gs.add_segment(ctr_min(curve), ctr_max(curve)); } /// Draw an exact region. @@ -244,15 +258,15 @@ namespace draw_function_for_arrangement_2 /// Compile time dispatching #if 0 template - void draw_point_impl2(const Point& p, T const&, long) { add_point(p); } + void draw_point_impl2(const Point& p, T const&, long) { m_gs.add_point(p); } template auto draw_point_impl2(const Point& p, T const& approx, int) -> decltype(approx.operator()(p), void()) - { add_point(approx(p)); } + { m_gs.add_point(approx(p)); } template - void draw_point_impl1(const Point& p, T const&, long) { add_point(p); } + void draw_point_impl1(const Point& p, T const&, long) { m_gs.add_point(p); } template auto draw_point_impl1(const Point& p, T const& traits, int) -> @@ -262,15 +276,23 @@ namespace draw_function_for_arrangement_2 } #else template - void draw_point_impl1(const Point& p, T const& traits, int) - { m_gs.add_point(traits.approximate_2_object()(p)); } + void draw_point_impl1(const Point& p, T const& traits, int, + bool colored, const CGAL::IO::Color& color) + { + if(colored) + { m_gs.add_point(traits.approximate_2_object()(p), color); } + else + { m_gs.add_point(traits.approximate_2_object()(p)); } + } #endif template void draw_point_impl1 (const Point& p, Arr_geodesic_arc_on_sphere_traits_2 const& traits, - int) + int, + bool colored, + const CGAL::IO::Color& color) { auto approx = traits.approximate_2_object(); using Traits = Arr_geodesic_arc_on_sphere_traits_2; @@ -282,14 +304,24 @@ namespace draw_function_for_arrangement_2 auto z = ap.dz(); auto l = std::sqrt(x*x + y*y + z*z); Approx_point_3 p3(x/l, y/l, z/l); - add_point(p3); + if(colored) + { m_gs.add_point(p3, color); } + else + { m_gs.add_point(p3); } } /// Draw a point. - void draw_point(const Point& p) + void draw_point(Vertex_const_handle vh) { const auto* traits = m_aos.geometry_traits(); - draw_point_impl1(p, *traits, 0); + if(m_gso.draw_vertex(m_aos, vh)) + { + if(m_gso.colored_vertex(m_aos, vh)) + { draw_point_impl1(vh->point(), *traits, 0, true, + m_gso.vertex_color(m_aos, vh)); } + else + { draw_point_impl1(vh->point(), *traits, 0, false, CGAL::IO::Color()); } // color will be unused + } } template @@ -351,15 +383,33 @@ namespace draw_function_for_arrangement_2 m_visited.clear(); if (m_aos.is_empty()) return; - add_faces(*(this->m_aos.geometry_traits())); + + if(m_gso.are_faces_enabled()) + { add_faces(*(this->m_aos.geometry_traits())); } // Add edges that do not separate faces. - for (auto it = m_aos.edges_begin(); it != m_aos.edges_end(); ++it) - { if (it->face() == it->twin()->face()) draw_curve(it->curve()); } + if(m_gso.are_edges_enabled()) + { + for (auto it = m_aos.edges_begin(); it != m_aos.edges_end(); ++it) + { if (it->face()==it->twin()->face()) + { + if(m_gso.draw_edge(m_aos, it)) + { + if(m_gso.colored_edge(m_aos, it)) + { draw_curve(it->curve(), true, m_gso.edge_color(m_aos, it)); } + else + { draw_curve(it->curve(), false, CGAL::IO::Color()); } + } + } + } + } // Add all points - for (auto it = m_aos.vertices_begin(); it != m_aos.vertices_end(); ++it) - { draw_point(it->point()); } + if(m_gso.are_vertices_enabled()) + { + for (auto it = m_aos.vertices_begin(); it != m_aos.vertices_end(); ++it) + { draw_point(it); } + } m_visited.clear(); } @@ -372,14 +422,23 @@ namespace draw_function_for_arrangement_2 */ template void draw_approximate_curve(const XMonotoneCurve& curve, - const Approximate& approx) { + const Approximate& approx, + bool colored, const CGAL::IO::Color& c) + { std::vector polyline; double error(0.01); // TODO? (this->pixel_ratio()); approx(curve, error, std::back_inserter(polyline)); if (polyline.empty()) return; auto it = polyline.begin(); auto prev = it++; - for (; it != polyline.end(); prev = it++) m_gs.add_segment(*prev, *it); + for (; it != polyline.end(); prev = it++) + { + if(colored) + { m_gs.add_segment(*prev, *it, c); } + else + { m_gs.add_segment(*prev, *it); } + } + } /*! Compile time dispatching @@ -407,15 +466,17 @@ namespace draw_function_for_arrangement_2 } #else template - void draw_curve_impl1(const X_monotone_curve& xcv, T const& traits, int) - { draw_approximate_curve(xcv, traits.approximate_2_object()); } + void draw_curve_impl1(const X_monotone_curve& xcv, T const& traits, int, + bool colored, const CGAL::IO::Color& c) + { draw_approximate_curve(xcv, traits.approximate_2_object(), colored, c); } #endif template void draw_curve_impl1 (const X_monotone_curve& xcv, Arr_geodesic_arc_on_sphere_traits_2 const& traits, - int) + int, + bool colored, const CGAL::IO::Color& c) { auto approx = traits.approximate_2_object(); using Kernel = Kernel_; @@ -438,14 +499,18 @@ namespace draw_function_for_arrangement_2 auto z = it->dz(); auto l = std::sqrt(x*x + y*y + z*z); Approx_point_3 next(x/l, y/l, z/l); - this->add_segment(prev, next); + if(colored) + { m_gs.add_segment(prev, next, c); } + else + { m_gs.add_segment(prev, next); } prev = next; } } /// Draw a curve. template - void draw_curve(const XMonotoneCurve& curve) + void draw_curve(const XMonotoneCurve& curve, + bool colored, const CGAL::IO::Color& c) { /* Check whether the traits has a member function called * approximate_2_object() and if so check whether the return type, namely @@ -473,7 +538,7 @@ namespace draw_function_for_arrangement_2 draw_exact_curve(curve); #else const auto* traits = this->m_aos.geometry_traits(); - draw_curve_impl1(curve, *traits, 0); + draw_curve_impl1(curve, *traits, 0, colored, c); #endif } From d97ff7beb6cb437181c0297e54559f1f669ff831 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 4 Dec 2023 18:25:56 +0100 Subject: [PATCH 265/399] remove duplicate doc --- .../include/CGAL/draw_polygon_set_2.h | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index a6dd820f5f43..2164082adba7 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -20,28 +20,6 @@ #include #include #include - -#ifdef DOXYGEN_RUNNING -namespace CGAL { - -/*! - * \ingroup PkgDrawPolygonSet2 - * - * opens a new window and draws `aps`, an instance of the `CGAL::Polygon_set_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_Qt6`, and is - * only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with - * the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add - * the definition `CGAL_USE_BASIC_VIEWER`. - * \tparam PS an instance of the `CGAL::Polygon_set_2` class. - * \param aps the polygon set to draw. - */ -template -void draw(const PS& aps); - -} /* namespace CGAL */ -#endif - #include namespace CGAL { From d2f007d0df28d435cf1f2bce92e576851112e3c5 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 10:35:07 +0100 Subject: [PATCH 266/399] doc draw t3 --- .../CGAL/draw_triangulation_3.h | 65 ++++++++++++++++++- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h index 82d1caf91248..788623bda6e5 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h @@ -3,14 +3,73 @@ namespace CGAL { /*! \ingroup PkgDrawTriangulation3 -opens a new window and draws `at3`, a model of the `TriangulationDataStructure_3` concept. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires CGAL_Qt6, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +\opens a new window and draws a 3D triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam T3 a model of the `TriangulationDataStructure_3` concept. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const Triangulation_3& at3, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam T3 which must be an instanciation of a `CGAL::Triangulation_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param at3 the triangulation to draw. +\param gso the graphics scene options parameter. + +*/ +template +void draw(const T3& at3, const GSOptions& gso); + +/*! +\ingroup PkgDrawTriangulation3 + A shortcut to `draw(at3, Graphics_scene_options{})`. +*/ + template + void draw(const T3& at3); + +/*! +\ingroup PkgDrawTriangulation3 + +adds the vertices, edges and faces of `at3` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const Triangulation_3& at3, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam T3 which must be an instanciation of a `CGAL::Triangulation_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + \param at3 the triangulation to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. +*/ +template +void add_to_graphics_scene(const T3& at3, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawTriangulation3 +A shortcut to `add_to_graphics_scene(at3, gs, Graphics_scene_options{})`. */ template -void draw(const T3& at3); +void add_to_graphics_scene(const T3& at3, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ From 5b7f499fc171c2a7f0f71e9cd62611920fd36b38 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 12:58:30 +0100 Subject: [PATCH 267/399] doc draw polygon --- Polygon/include/CGAL/draw_polygon_2.h | 68 +++++++++++++++++-- .../CGAL/draw_triangulation_2.h | 4 +- .../CGAL/draw_triangulation_3.h | 6 +- 3 files changed, 68 insertions(+), 10 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index b1f2209dbf5b..a248a9714049 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -29,15 +29,73 @@ 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_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +opens a new window and draws a 2D polygon. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam P an instance of the `CGAL::Polygon_2` class. -\param ap the polygon to draw. +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Polygon_2& p, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam P which must be an instanciation of a `CGAL::Polygon_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param p the polygon to draw. +\param gso the graphics scene options parameter. */ -template -void draw(const P& ap); +template +void draw(const P& p, const GSOptions& gso); + +/*! +\ingroup PkgDrawPolygon2 + +A shortcut to `draw(p, Graphics_scene_options{})`. +*/ + template + void draw(const P& p); + +/*! +\ingroup PkgDrawPolygon2 + +adds the vertices, edges and faces of `p` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + void CGAL::add_to_graphics_scene(const Polygon_2& p, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam P which must be an instanciation of a `CGAL::Polygon_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param p the 2D polygon to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. +*/ +template +void add_to_graphics_scene(const P& p, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawPolygon2 + +A shortcut to `add_to_graphics_scene(p, gs, Graphics_scene_options{})`. +*/ +template +void add_to_graphics_scene(const P& p, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ #endif diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 042081f3dcff..12adeda043e5 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -14,7 +14,7 @@ The real declaration of this function template is: template - void CGAL::draw(const Triangulation_2& at2, const GSOptions& gso); + void CGAL::draw(const CGAL::Triangulation_2& at2, const GSOptions& gso); \cgalAdvancedEnd @@ -47,7 +47,7 @@ The real declaration of this function template is: template - void CGAL::add_to_graphics_scene(const Triangulation_2& at2, CGAL::Graphics_scene& gs, const GSOptions& gso); + void CGAL::add_to_graphics_scene(const CGAL::Triangulation_2& at2, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h index 788623bda6e5..b243757699c1 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h @@ -3,7 +3,7 @@ namespace CGAL { /*! \ingroup PkgDrawTriangulation3 -\opens a new window and draws a 3D triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter. +opens a new window and draws a 3D triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter. A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. @@ -14,7 +14,7 @@ The real declaration of this function template is: template - void CGAL::draw(const Triangulation_3& at3, const GSOptions& gso); + void CGAL::draw(const CGAL::Triangulation_3& at3, const GSOptions& gso); \cgalAdvancedEnd @@ -46,7 +46,7 @@ The real declaration of this function template is: template - void CGAL::add_to_graphics_scene(const Triangulation_3& at3, CGAL::Graphics_scene& gs, const GSOptions& gso); + void CGAL::add_to_graphics_scene(const CGAL::Triangulation_3& at3, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd From df2b9ad1723e2b5da8278b1fd5772bd736e43f42 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 13:16:54 +0100 Subject: [PATCH 268/399] doc draw pwh --- Polygon/include/CGAL/draw_polygon_2.h | 4 +- .../include/CGAL/draw_polygon_with_holes_2.h | 80 ++++++++++++++++--- .../CGAL/draw_triangulation_2.h | 4 +- .../CGAL/draw_triangulation_3.h | 4 +- 4 files changed, 73 insertions(+), 19 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index a248a9714049..1e1618c5da06 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -56,7 +56,7 @@ void draw(const P& p, const GSOptions& gso); /*! \ingroup PkgDrawPolygon2 -A shortcut to `draw(p, Graphics_scene_options{})`. +A shortcut to `CGAL::draw(p, Graphics_scene_options{})`. */ template void draw(const P& p); @@ -91,7 +91,7 @@ void add_to_graphics_scene(const P& p, /*! \ingroup PkgDrawPolygon2 -A shortcut to `add_to_graphics_scene(p, gs, Graphics_scene_options{})`. +A shortcut to `CGAL::add_to_graphics_scene(p, gs, Graphics_scene_options{})`. */ template void add_to_graphics_scene(const P& p, diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 741524f418d0..15112bdcb11a 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -27,21 +27,75 @@ 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_Qt6`, and is only available if the macro - * `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target - * `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition - * `CGAL_USE_BASIC_VIEWER`. - * \tparam PH an instance of the `CGAL::Polygon_with_holes_2` class. - * \param aph the polygon with holes to draw. + \ingroup PkgDrawPolygonWithHoles2 + +opens a new window and draws a 2D polygon with holes. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Polygon_with_holes_2& ph, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam PH which must be an instanciation of a `CGAL::Polygon_with_holes_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param ph the polygon with holes to draw. +\param gso the graphics scene options parameter. */ +template +void draw(const PH& ph, const GSOptions& gso); + +/*! +\ingroup PkgDrawPolygonWithHoles2 + +A shortcut to `CGAL::draw(ph, Graphics_scene_options{})`. +*/ + template + void draw(const PH& ph); + +/*! +\ingroup PkgDrawPolygonWithHoles2 + +adds the vertices, edges and faces of `ph` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const Polygon_with_holes_2& ph, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam PH which must be an instanciation of a `CGAL::Polygon_with_holes_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param ph the polygon with holes to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. +*/ +template +void add_to_graphics_scene(const PH& ph, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawPolygonWithHoles2 -template -void draw(const PH& aph); +A shortcut to `CGAL::add_to_graphics_scene(ph, gs, Graphics_scene_options{})`. +*/ +template +void add_to_graphics_scene(const PH& ph, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 12adeda043e5..a4733e4f0fd8 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -31,7 +31,7 @@ The real declaration of this function template is: /*! \ingroup PkgDrawTriangulation2 -A shortcut to `draw(at2, Graphics_scene_options{})`. +A shortcut to `CGAL::draw(at2, Graphics_scene_options{})`. */ template void draw(const T2& at2); @@ -66,7 +66,7 @@ void add_to_graphics_scene(const T2& at2, /*! \ingroup PkgDrawTriangulation2 -A shortcut to `add_to_graphics_scene(at2, gs, Graphics_scene_options{})`. +A shortcut to `CGAL::add_to_graphics_scene(at2, gs, Graphics_scene_options{})`. */ template void add_to_graphics_scene(const T2& at2, diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h index b243757699c1..e6b8a684e26d 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h @@ -30,7 +30,7 @@ void draw(const T3& at3, const GSOptions& gso); /*! \ingroup PkgDrawTriangulation3 - A shortcut to `draw(at3, Graphics_scene_options{})`. + A shortcut to `CGAL::draw(at3, Graphics_scene_options{})`. */ template void draw(const T3& at3); @@ -65,7 +65,7 @@ void add_to_graphics_scene(const T3& at3, /*! \ingroup PkgDrawTriangulation3 -A shortcut to `add_to_graphics_scene(at3, gs, Graphics_scene_options{})`. +A shortcut to `CGAL::add_to_graphics_scene(at3, gs, Graphics_scene_options{})`. */ template void add_to_graphics_scene(const T3& at3, From 74c0894336824f5180a193a2e51e1f289110faf8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 13:19:35 +0100 Subject: [PATCH 269/399] doc draw polygon --- Polygon/include/CGAL/draw_polygon_2.h | 2 +- Polygon/include/CGAL/draw_polygon_with_holes_2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 1e1618c5da06..3a18d3001ab6 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -72,7 +72,7 @@ The real declaration of this function template is: template - void CGAL::add_to_graphics_scene(const Polygon_2& p, CGAL::Graphics_scene& gs, const GSOptions& gso); + void CGAL::add_to_graphics_scene(const CGAL::Polygon_2& p, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 15112bdcb11a..0a3174b4e21d 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -72,7 +72,7 @@ The real declaration of this function template is: template - void CGAL::add_to_graphics_scene(const Polygon_with_holes_2& ph, CGAL::Graphics_scene& gs, const GSOptions& gso); + void CGAL::add_to_graphics_scene(const CGAL::Polygon_with_holes_2& ph, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd From 711a07dfe99e07ea891444877794b613a6c5fcfe Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 13:49:32 +0100 Subject: [PATCH 270/399] doc draw surface mesh and polyhedron --- .../doc/Polyhedron/CGAL/draw_polyhedron.h | 69 +++++++++++++++++-- Surface_mesh/include/CGAL/draw_surface_mesh.h | 67 ++++++++++++++++-- 2 files changed, 127 insertions(+), 9 deletions(-) diff --git a/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h b/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h index 9ed56fe232c2..2529cb72d085 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h +++ b/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h @@ -3,14 +3,73 @@ namespace CGAL { /*! \ingroup PkgDrawPolyhedron -opens a new window and draws `apoly`, an instance of the `CGAL::Polyhedron_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_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +opens a new window and draws a polyhedron. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam POLY an instance of the `CGAL::Polyhedron_3` class. -\param apoly the polyhedron to draw. +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Polyhedron_3& p, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam P which must be an instanciation of a `CGAL::Polyhedron_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param p the polyhedron to draw. +\param gso the graphics scene options parameter. +*/ +template +void draw(const P& p, const GSOptions& gso); + +/*! +\ingroup PkgDrawPolyhedron + +A shortcut to `CGAL::draw(p, Graphics_scene_options{})`. +*/ + template + void draw(const P& p); + +/*! +\ingroup PkgDrawPolyhedron + +adds the vertices, edges and faces of `p` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Polyhedron_3& p, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam P which must be an instanciation of a `CGAL::Polyhedron_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param p the polyhedron to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. +*/ +template +void add_to_graphics_scene(const P& p, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawPolyhedron + +A shortcut to `CGAL::add_to_graphics_scene(p, gs, Graphics_scene_options{})`. */ -template -void draw(const POLY& apoly); +template +void add_to_graphics_scene(const P& p, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 69a7be45edf3..33ed8f7e66ee 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -18,14 +18,73 @@ /*! \ingroup PkgDrawSurfaceMesh -Open a new window and draw `asm`, an instance of the `CGAL::Surface_mesh` class. The function is blocking, that is the program continues as soon as the user closes the window. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +opens a new window and draws a surface mesh. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam SM an instance of the `CGAL::Surface_mesh` class. -\param asm the surface mesh to draw. +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Surface_mesh& sm, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam SM which must be an instanciation of a `CGAL::Surface_mesh<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param sm the surface mesh to draw. +\param gso the graphics scene options parameter. +*/ +template +void draw(const SM& sm, const GSOptions& gso); + +/*! +\ingroup PkgDrawSurfaceMesh + +A shortcut to `CGAL::draw(sm, Graphics_scene_options{})`. +*/ + template + void draw(const SM& sm); + +/*! +\ingroup PkgDrawSurfaceMesh + +adds the vertices, edges and faces of `sm` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Surface_mesh& sm, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd + +\tparam SM which must be an instanciation of a `CGAL::Surface_mesh<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param sm the surface mesh to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. +*/ +template +void add_to_graphics_scene(const SM& sm, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawSurfaceMesh + +A shortcut to `CGAL::add_to_graphics_scene(sm, gs, Graphics_scene_options{})`. */ template -void draw(const SM& asm); +void add_to_graphics_scene(const SM& sm, + CGAL::Graphics_scene& gs); #else // DOXYGEN_RUNNING From 269f5829c237b338d320bcda87d78c0c01e99fc0 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 13:51:45 +0100 Subject: [PATCH 271/399] try to move advanced --- .../doc/Polyhedron/CGAL/draw_polyhedron.h | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h b/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h index 2529cb72d085..d3c0a5e82bf8 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h +++ b/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h @@ -8,6 +8,12 @@ opens a new window and draws a polyhedron. Parameters of the drawing are taken f A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. +\tparam P which must be an instanciation of a `CGAL::Polyhedron_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param p the polyhedron to draw. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -18,11 +24,6 @@ The real declaration of this function template is: \cgalAdvancedEnd -\tparam P which must be an instanciation of a `CGAL::Polyhedron_3<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param p the polyhedron to draw. -\param gso the graphics scene options parameter. */ template void draw(const P& p, const GSOptions& gso); @@ -40,6 +41,13 @@ A shortcut to `CGAL::draw(p, Graphics_scene_options{})`. adds the vertices, edges and faces of `p` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +\tparam P which must be an instanciation of a `CGAL::Polyhedron_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param p the polyhedron to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -49,13 +57,6 @@ The real declaration of this function template is: void CGAL::add_to_graphics_scene(const CGAL::Polyhedron_3& p, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd - -\tparam P which must be an instanciation of a `CGAL::Polyhedron_3<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param p the polyhedron to draw. -\param gs the graphic scene to fill. -\param gso the graphics scene options parameter. */ template void add_to_graphics_scene(const P& p, From 03ff679df455b753d758695f8de839f289eda065 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 14:10:25 +0100 Subject: [PATCH 272/399] doc draw: move advanced blocks --- Polygon/include/CGAL/draw_polygon_2.h | 26 +++++++++--------- .../include/CGAL/draw_polygon_with_holes_2.h | 26 +++++++++--------- .../doc/Polyhedron/CGAL/draw_polyhedron.h | 1 - Surface_mesh/include/CGAL/draw_surface_mesh.h | 26 +++++++++--------- .../CGAL/draw_triangulation_2.h | 27 +++++++++---------- .../CGAL/draw_triangulation_3.h | 27 +++++++++---------- 6 files changed, 65 insertions(+), 68 deletions(-) diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 3a18d3001ab6..e65b7583533f 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -34,6 +34,12 @@ opens a new window and draws a 2D polygon. Parameters of the drawing are taken f A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. +\tparam P which must be an instanciation of a `CGAL::Polygon_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param p the polygon to draw. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -43,12 +49,6 @@ The real declaration of this function template is: void CGAL::draw(const CGAL::Polygon_2& p, const GSOptions& gso); \cgalAdvancedEnd - -\tparam P which must be an instanciation of a `CGAL::Polygon_2<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param p the polygon to draw. -\param gso the graphics scene options parameter. */ template void draw(const P& p, const GSOptions& gso); @@ -66,6 +66,13 @@ A shortcut to `CGAL::draw(p, Graphics_scene_options{})`. adds the vertices, edges and faces of `p` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +\tparam P which must be an instanciation of a `CGAL::Polygon_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param p the 2D polygon to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -75,13 +82,6 @@ The real declaration of this function template is: void CGAL::add_to_graphics_scene(const CGAL::Polygon_2& p, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd - -\tparam P which must be an instanciation of a `CGAL::Polygon_2<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param p the 2D polygon to draw. -\param gs the graphic scene to fill. -\param gso the graphics scene options parameter. */ template void add_to_graphics_scene(const P& p, diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 0a3174b4e21d..f2f313028ec7 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -34,6 +34,12 @@ opens a new window and draws a 2D polygon with holes. Parameters of the drawing A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. +\tparam PH which must be an instanciation of a `CGAL::Polygon_with_holes_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param ph the polygon with holes to draw. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -43,12 +49,6 @@ The real declaration of this function template is: void CGAL::draw(const CGAL::Polygon_with_holes_2& ph, const GSOptions& gso); \cgalAdvancedEnd - -\tparam PH which must be an instanciation of a `CGAL::Polygon_with_holes_2<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param ph the polygon with holes to draw. -\param gso the graphics scene options parameter. */ template void draw(const PH& ph, const GSOptions& gso); @@ -66,6 +66,13 @@ A shortcut to `CGAL::draw(ph, Graphics_scene_options{})`. adds the vertices, edges and faces of `ph` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +\tparam PH which must be an instanciation of a `CGAL::Polygon_with_holes_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param ph the polygon with holes to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -75,13 +82,6 @@ The real declaration of this function template is: void CGAL::add_to_graphics_scene(const CGAL::Polygon_with_holes_2& ph, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd - -\tparam PH which must be an instanciation of a `CGAL::Polygon_with_holes_2<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param ph the polygon with holes to draw. -\param gs the graphic scene to fill. -\param gso the graphics scene options parameter. */ template void add_to_graphics_scene(const PH& ph, diff --git a/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h b/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h index d3c0a5e82bf8..fd69b1e93715 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h +++ b/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h @@ -23,7 +23,6 @@ The real declaration of this function template is: void CGAL::draw(const CGAL::Polyhedron_3& p, const GSOptions& gso); \cgalAdvancedEnd - */ template void draw(const P& p, const GSOptions& gso); diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 33ed8f7e66ee..da98cc05a82f 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -23,6 +23,12 @@ opens a new window and draws a surface mesh. Parameters of the drawing are taken A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. +\tparam SM which must be an instanciation of a `CGAL::Surface_mesh<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param sm the surface mesh to draw. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -32,12 +38,6 @@ The real declaration of this function template is: void CGAL::draw(const CGAL::Surface_mesh& sm, const GSOptions& gso); \cgalAdvancedEnd - -\tparam SM which must be an instanciation of a `CGAL::Surface_mesh<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param sm the surface mesh to draw. -\param gso the graphics scene options parameter. */ template void draw(const SM& sm, const GSOptions& gso); @@ -55,6 +55,13 @@ A shortcut to `CGAL::draw(sm, Graphics_scene_options{})`. adds the vertices, edges and faces of `sm` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +\tparam SM which must be an instanciation of a `CGAL::Surface_mesh<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param sm the surface mesh to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -64,13 +71,6 @@ The real declaration of this function template is: void CGAL::add_to_graphics_scene(const CGAL::Surface_mesh& sm, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd - -\tparam SM which must be an instanciation of a `CGAL::Surface_mesh<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param sm the surface mesh to draw. -\param gs the graphic scene to fill. -\param gso the graphics scene options parameter. */ template void add_to_graphics_scene(const SM& sm, diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index a4733e4f0fd8..60813b35d86c 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -8,6 +8,12 @@ opens a new window and draws a triangulation. Parameters of the drawing are take A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. +\tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param at2 the triangulation to draw. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -17,13 +23,6 @@ The real declaration of this function template is: void CGAL::draw(const CGAL::Triangulation_2& at2, const GSOptions& gso); \cgalAdvancedEnd - -\tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param at2 the triangulation to draw. -\param gso the graphics scene options parameter. - */ template void draw(const T2& at2, const GSOptions& gso); @@ -41,6 +40,13 @@ A shortcut to `CGAL::draw(at2, Graphics_scene_options{})`. adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +\tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param at2 the triangulation to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -50,13 +56,6 @@ The real declaration of this function template is: void CGAL::add_to_graphics_scene(const CGAL::Triangulation_2& at2, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd - -\tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param at2 the triangulation to draw. -\param gs the graphic scene to fill. -\param gso the graphics scene options parameter. */ template void add_to_graphics_scene(const T2& at2, diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h index e6b8a684e26d..b85fff6ee252 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h @@ -8,6 +8,12 @@ opens a new window and draws a 3D triangulation. Parameters of the drawing are t A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. +\tparam T3 which must be an instanciation of a `CGAL::Triangulation_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param at3 the triangulation to draw. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -17,13 +23,6 @@ The real declaration of this function template is: void CGAL::draw(const CGAL::Triangulation_3& at3, const GSOptions& gso); \cgalAdvancedEnd - -\tparam T3 which must be an instanciation of a `CGAL::Triangulation_3<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param at3 the triangulation to draw. -\param gso the graphics scene options parameter. - */ template void draw(const T3& at3, const GSOptions& gso); @@ -40,6 +39,13 @@ void draw(const T3& at3, const GSOptions& gso); adds the vertices, edges and faces of `at3` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +\tparam T3 which must be an instanciation of a `CGAL::Triangulation_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param at3 the triangulation to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + \cgalAdvancedBegin The real declaration of this function template is: @@ -49,13 +55,6 @@ The real declaration of this function template is: void CGAL::add_to_graphics_scene(const CGAL::Triangulation_3& at3, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd - -\tparam T3 which must be an instanciation of a `CGAL::Triangulation_3<...>`. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param at3 the triangulation to draw. -\param gs the graphic scene to fill. -\param gso the graphics scene options parameter. */ template void add_to_graphics_scene(const T3& at3, From 029ab430a32ea84924980fbb48c9aceed24bd882 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 14:58:28 +0100 Subject: [PATCH 273/399] doc draw nef3 --- Nef_3/doc/Nef_3/CGAL/draw_nef_3.h | 70 +++++++++++++++++-- .../CGAL/draw_triangulation_2.h | 4 +- .../Triangulation_2/PackageDescription.txt | 4 +- 3 files changed, 67 insertions(+), 11 deletions(-) diff --git a/Nef_3/doc/Nef_3/CGAL/draw_nef_3.h b/Nef_3/doc/Nef_3/CGAL/draw_nef_3.h index d61f502cc4f0..fc5b4b7ea8f6 100644 --- a/Nef_3/doc/Nef_3/CGAL/draw_nef_3.h +++ b/Nef_3/doc/Nef_3/CGAL/draw_nef_3.h @@ -3,14 +3,72 @@ namespace CGAL { /*! \ingroup PkgDrawNef3 -Open a new window and draws `anef3`, the `Nef_polyhedron_3`. A call to this function is blocking, that is the program continues as soon as the user closes the window. -This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +opens a new window and draws a nef polyhedron. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam Nef3 a model of the `Nef_polyhedron_3` concept. -\param anef3 the nef polyhedron to draw. +\tparam NP3 which must be an instanciation of a `CGAL::Nef_polyhedron_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param np3 the nef polyhedron to draw. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Nef_polyhedron_3& np3, const GSOptions& gso); + +\cgalAdvancedEnd +*/ + template + void draw(const NP3& np3, const GSOptions& gso); + +/*! +\ingroup PkgDrawNef3 + +A shortcut to `CGAL::draw(np3, Graphics_scene_options{})`. +*/ + template + void draw(const NP3& np3); + +/*! +\ingroup PkgDrawNef3 + +adds the vertices, edges and faces of `np3` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\tparam NP3 which must be an instanciation of a `CGAL::Nef_polyhedron_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param np3 the nef polyhedron to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Nef_polyhedron_3& np3, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd +*/ +template +void add_to_graphics_scene(const NP3& np3, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawNef3 + +A shortcut to `CGAL::add_to_graphics_scene(np3, gs, Graphics_scene_options{})`. */ -template -void draw(const Nef3& anef3); +template +void add_to_graphics_scene(const NP3& np3, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 60813b35d86c..7300d0d92fbf 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -20,7 +20,7 @@ The real declaration of this function template is: template - void CGAL::draw(const CGAL::Triangulation_2& at2, const GSOptions& gso); + void CGAL::draw(const CGAL::Triangulation_2& at2, const GSOptions& gso); \cgalAdvancedEnd */ @@ -53,7 +53,7 @@ The real declaration of this function template is: template - void CGAL::add_to_graphics_scene(const CGAL::Triangulation_2& at2, CGAL::Graphics_scene& gs, const GSOptions& gso); + void CGAL::add_to_graphics_scene(const CGAL::Triangulation_2& at2, CGAL::Graphics_scene& gs, const GSOptions& gso); \cgalAdvancedEnd */ diff --git a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt index 596f2ae4a425..f84ffe376bac 100644 --- a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt +++ b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt @@ -20,9 +20,7 @@ /// \ingroup PkgTriangulation2Ref /*! - \code - #include - \endcode +\cgalInclude{CGAL/draw_constrained_triangulation_2.h} */ /// \defgroup PkgDrawConstrainedTriangulation2 Draw a Constrained Triangulation 2 /// \ingroup PkgTriangulation2Ref From 3d8037d7f620dd0be564a041c886248037c4a1e7 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 5 Dec 2023 15:11:49 +0100 Subject: [PATCH 274/399] doc draw lcc --- .../CGAL/draw_linear_cell_complex.h | 69 +++++++++++++++---- 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index 9dbad5c9a698..c4046126c800 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -3,34 +3,73 @@ namespace CGAL { /*! \ingroup PkgDrawLinearCellComplex -opens a new window and draws `alcc`, a model of the `LinearCellComplex` concept. A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +opens a new window and draws a linear cell complex. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam LCC a model of the `LinearCellComplex` concept. -\tparam GSOptions a class having the same methods than `Graphics_scene_options`: `Graphics_scene_options` by default. -\param alcc the linear cell complex to draw. -\param gs_options graphics scene options. +\tparam LCC which must be an instanciation of a `CGAL::Linear_cell_complex_for_combinatorial_map<...>` or `CGAL::Linear_cell_complex_for_generalized_map<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param lcc the linear cell complex to draw. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + template + + void CGAL::draw(const CGAL::Linear_cell_complex_base& lcc, const GSOptions& gso); + +\cgalAdvancedEnd */ template - void draw(const LCC& alcc, const GSOptions& gs_options=GSOptions()); + void draw(const LCC& lcc, const GSOptions& gso); + +/*! +\ingroup PkgDrawLinearCellComplex + +A shortcut to `CGAL::draw(lcc, Graphics_scene_options{})`. +*/ + template + void draw(const LCC& lcc); /*! \ingroup PkgDrawLinearCellComplex -Add in the given graphics scene the elements of alcc. +adds the vertices, edges and faces of `lcc` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). -\tparam LCC a model of the `LinearCellComplex` concept. -\tparam GSOptions a class having the same methods than `Graphics_scene_options`: `Graphics_scene_options` by default. +\tparam LCC which must be an instanciation of a `CGAL::Linear_cell_complex_for_combinatorial_map<...>` or `CGAL::Linear_cell_complex_for_generalized_map<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. -\param alcc the linear cell complex to draw. -\param graphics_scene the graphics scene. -\param gs_options graphics scene options. +\param lcc the linear cell complex to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Linear_cell_complex_base& lcc, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd */ - template - void add_to_graphics_scene(const LCC& alcc, CGAL::Graphics_scene& graphics_scene, - const GSOptions& gs_options=GSOptions()); +template +void add_to_graphics_scene(const LCC& lcc, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawLinearCellComplex + +A shortcut to `CGAL::add_to_graphics_scene(lcc, gs, Graphics_scene_options{})`. +*/ +template +void add_to_graphics_scene(const LCC& lcc, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ From bfcb44bd8ce84ed8e7c08a5fc4105a09c3dfe08c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 6 Dec 2023 16:23:49 +0100 Subject: [PATCH 275/399] doc: draw point set 3 and constrained triangulation 2 --- Point_set_3/include/CGAL/draw_point_set_3.h | 67 +++++++++++++++++-- .../CGAL/draw_constrained_triangulation_2.h | 53 +++++++-------- 2 files changed, 88 insertions(+), 32 deletions(-) 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 422efde4aa22..a6799ed7fb78 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -26,14 +26,73 @@ 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_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +opens a new window and draws a point set. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam PS an instance of the `CGAL::Point_set_3` class. -\param aps the point set to draw. +\tparam PS which must be an instanciation of a `CGAL::Point_set_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param ps the point set to draw. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Point_set_3& ps, const GSOptions& gso); + +\cgalAdvancedEnd +*/ + template + void draw(const PS& ps, const GSOptions& gso); + +/*! +\ingroup PkgDrawPointSet3D + +A shortcut to `CGAL::draw(ps, Graphics_scene_options{})`. +*/ + template + void draw(const PS& ps); + +/*! +\ingroup PkgDrawPointSet3D + +adds the vertices, edges and faces of `ps` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\tparam PS which must be an instanciation of a `CGAL::Point_set_3<...>`. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param ps the point set to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Point_set_3& ps, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd +*/ +template +void add_to_graphics_scene(const PS& ps, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawPointSet3D + +A shortcut to `CGAL::add_to_graphics_scene(ps, gs, Graphics_scene_options{})`. */ template -void draw(const PS& aps); +void add_to_graphics_scene(const PS& ps, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ #endif diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h index 2ef649265112..0c83594cc18e 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h @@ -1,43 +1,40 @@ namespace CGAL { -/*! + /*! \ingroup PkgDrawConstrainedTriangulation2 -opens a new window and draws a triangulation. If the triangulation -has constraints they are drawn. If the face type has a member -function `bool is_in_domain()` the faces inside and outside of the -domain are drawn in different colors. - -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 macro `CGAL_USE_BASIC_VIEWER` is defined. -Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with -`CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. +opens a new window and draws a constrained triangulation. If the triangulation has constraints they are drawn. The faces inside and outside of the domain, based on the property map, are drawn in different colors. Parameters of the drawing are taken from the optional graphics scene options parameter. -\tparam T2 a triangulation class derived from `Triangulation_2` or `Constrained_triangulation_2` -\param at2 the triangulation to draw. +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -*/ -template -void draw(const T2& at2, TODO); +\tparam CT2 which must be an instanciation of a `CGAL::Constrained_triangulation_2<...>`. +\tparam InDomainPMap a class model of `ReadablePropertyMap` with `CT2::Face_handle` as key type and `bool` as value type. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. - /*! -\ingroup PkgDrawConstrainedTriangulation2 +\param ct2 the constrained triangulation to draw. +\param ipm the property map defining the faces which are in the domain. +\param gso the graphics scene options parameter. -opens a new window and draws a constrained triangulation. If the triangulation -has constraints they are drawn. The faces inside and outside of the -domain, based on the property map, are drawn in different colors. +\cgalAdvancedBegin +The real declaration of this function template is: -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 macro `CGAL_USE_BASIC_VIEWER` is defined. -Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. + + template -\tparam CT2 a triangulation class derived from `Constrained_triangulation_2` -\tparam InDomainPMap a class model of `ReadablePropertyMap` with -`CT::Face_handle` as key type and `bool` as value type. + void CGAL::draw(const CGAL::Constrained_triangulation_2& ct2, InDomainPMap ipm, const GSOptions& gso); + +\cgalAdvancedEnd +*/ + template + void draw(const CT2& act2, InDomainPMap ipm, const GSOptions& gso); -\param act2 the constrained triangulation to draw. -\param ipm the property map defining the faces which are in the domain. +/*! +\ingroup PkgDrawConstrainedTriangulation2 +A shortcut to `CGAL::draw(at2, ipm, Graphics_scene_options{})`. */ - template - void draw(const CT2& act2, InDomainPMap ipm); + template + void draw(const T2& at2, InDomainPMap ipm); } /* namespace CGAL */ From b34fb266a4bf3305971b11aa0238c6939eae164e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 6 Dec 2023 16:37:48 +0100 Subject: [PATCH 276/399] fix doc draw ct2 --- .../CGAL/draw_constrained_triangulation_2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h index 0c83594cc18e..5cd72edd15a6 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h @@ -27,14 +27,14 @@ The real declaration of this function template is: \cgalAdvancedEnd */ template - void draw(const CT2& act2, InDomainPMap ipm, const GSOptions& gso); + void draw(const CT2& ct2, InDomainPMap ipm, const GSOptions& gso); /*! \ingroup PkgDrawConstrainedTriangulation2 -A shortcut to `CGAL::draw(at2, ipm, Graphics_scene_options{})`. +A shortcut to `CGAL::draw(ct2, ipm, Graphics_scene_options{})`. */ - template - void draw(const T2& at2, InDomainPMap ipm); + template + void draw(const CT2& ct2, InDomainPMap ipm); } /* namespace CGAL */ From 4d02be9db3c7e2cd9d5949143c6336d08ff5b935 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 6 Dec 2023 17:00:20 +0100 Subject: [PATCH 277/399] doc: draw ct2 --- .../CGAL/draw_constrained_triangulation_2.h | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h index 5cd72edd15a6..d714a6c59610 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_constrained_triangulation_2.h @@ -3,38 +3,54 @@ namespace CGAL { /*! \ingroup PkgDrawConstrainedTriangulation2 -opens a new window and draws a constrained triangulation. If the triangulation has constraints they are drawn. The faces inside and outside of the domain, based on the property map, are drawn in different colors. Parameters of the drawing are taken from the optional graphics scene options parameter. +opens a new window and draws a constrained triangulation. If the triangulation has constraints they are drawn. The faces inside and outside of the domain, based on the property map, are drawn in different colors. A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. \tparam CT2 which must be an instanciation of a `CGAL::Constrained_triangulation_2<...>`. \tparam InDomainPMap a class model of `ReadablePropertyMap` with `CT2::Face_handle` as key type and `bool` as value type. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. \param ct2 the constrained triangulation to draw. \param ipm the property map defining the faces which are in the domain. -\param gso the graphics scene options parameter. \cgalAdvancedBegin The real declaration of this function template is: - template + template - void CGAL::draw(const CGAL::Constrained_triangulation_2& ct2, InDomainPMap ipm, const GSOptions& gso); + void CGAL::draw(const CGAL::Constrained_triangulation_2& ct2, InDomainPMap ipm); \cgalAdvancedEnd */ - template - void draw(const CT2& ct2, InDomainPMap ipm, const GSOptions& gso); + template + void draw(const CT2& ct2, InDomainPMap ipm); /*! \ingroup PkgDrawConstrainedTriangulation2 -A shortcut to `CGAL::draw(ct2, ipm, Graphics_scene_options{})`. +adds the vertices, edges and faces of `ct2` into the given graphic scene `gs`. If the triangulation has constraints they are drawn. The faces inside and outside of the domain, based on the property map, are drawn in different colors. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\tparam CT2 which must be an instanciation of a `CGAL::Constrained_triangulation_2<...>`. +\tparam InDomainPMap a class model of `ReadablePropertyMap` with `CT2::Face_handle` as key type and `bool` as value type. + +\param ct2 the constrained triangulation to draw. +\param ipm the property map defining the faces which are in the domain. +\param gs the graphic scene to fill. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Constrained_triangulation_2& ct2, InDomainPMap ipm, CGAL::Graphics_scene& gs); + +\cgalAdvancedEnd */ - template - void draw(const CT2& ct2, InDomainPMap ipm); +template +void add_to_graphics_scene(const CT2& ct2, InDomainPMap ipm, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ From bd04b2a68db62f938b407211db54a0aaa4f195f8 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 6 Dec 2023 17:01:34 +0100 Subject: [PATCH 278/399] Remove space in doc --- .../doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h | 2 +- Nef_3/doc/Nef_3/CGAL/draw_nef_3.h | 2 +- Point_set_3/include/CGAL/draw_point_set_3.h | 2 +- Polygon/include/CGAL/draw_polygon_2.h | 2 +- Polygon/include/CGAL/draw_polygon_with_holes_2.h | 2 +- Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h | 2 +- Surface_mesh/include/CGAL/draw_surface_mesh.h | 2 +- Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h | 2 +- Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h index c4046126c800..6dc9b021133e 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/draw_linear_cell_complex.h @@ -38,7 +38,7 @@ A shortcut to `CGAL::draw(lcc, Graphics_scene_options{})`. /*! \ingroup PkgDrawLinearCellComplex -adds the vertices, edges and faces of `lcc` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `lcc` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam LCC which must be an instanciation of a `CGAL::Linear_cell_complex_for_combinatorial_map<...>` or `CGAL::Linear_cell_complex_for_generalized_map<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. diff --git a/Nef_3/doc/Nef_3/CGAL/draw_nef_3.h b/Nef_3/doc/Nef_3/CGAL/draw_nef_3.h index fc5b4b7ea8f6..1d2528d60792 100644 --- a/Nef_3/doc/Nef_3/CGAL/draw_nef_3.h +++ b/Nef_3/doc/Nef_3/CGAL/draw_nef_3.h @@ -38,7 +38,7 @@ A shortcut to `CGAL::draw(np3, Graphics_scene_options{})`. /*! \ingroup PkgDrawNef3 -adds the vertices, edges and faces of `np3` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `np3` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam NP3 which must be an instanciation of a `CGAL::Nef_polyhedron_3<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. 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 a6799ed7fb78..6a8f671296da 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -61,7 +61,7 @@ A shortcut to `CGAL::draw(ps, Graphics_scene_options{})`. /*! \ingroup PkgDrawPointSet3D -adds the vertices, edges and faces of `ps` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `ps` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam PS which must be an instanciation of a `CGAL::Point_set_3<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index e65b7583533f..24acaaa7535e 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -64,7 +64,7 @@ A shortcut to `CGAL::draw(p, Graphics_scene_options{})`. /*! \ingroup PkgDrawPolygon2 -adds the vertices, edges and faces of `p` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `p` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam P which must be an instanciation of a `CGAL::Polygon_2<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index f2f313028ec7..3be337aa1573 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -64,7 +64,7 @@ A shortcut to `CGAL::draw(ph, Graphics_scene_options{})`. /*! \ingroup PkgDrawPolygonWithHoles2 -adds the vertices, edges and faces of `ph` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `ph` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam PH which must be an instanciation of a `CGAL::Polygon_with_holes_2<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. diff --git a/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h b/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h index fd69b1e93715..6d30faa65620 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h +++ b/Polyhedron/doc/Polyhedron/CGAL/draw_polyhedron.h @@ -38,7 +38,7 @@ A shortcut to `CGAL::draw(p, Graphics_scene_options{})`. /*! \ingroup PkgDrawPolyhedron -adds the vertices, edges and faces of `p` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `p` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam P which must be an instanciation of a `CGAL::Polyhedron_3<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index da98cc05a82f..776aa5097b21 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -53,7 +53,7 @@ A shortcut to `CGAL::draw(sm, Graphics_scene_options{})`. /*! \ingroup PkgDrawSurfaceMesh -adds the vertices, edges and faces of `sm` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `sm` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam SM which must be an instanciation of a `CGAL::Surface_mesh<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h index 7300d0d92fbf..a7567db9b0a8 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/draw_triangulation_2.h @@ -38,7 +38,7 @@ A shortcut to `CGAL::draw(at2, Graphics_scene_options{})`. /*! \ingroup PkgDrawTriangulation2 -adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `at2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam T2 which must be an instanciation of a `CGAL::Triangulation_2<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h index b85fff6ee252..5c8c0d041c15 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/draw_triangulation_3.h @@ -37,7 +37,7 @@ void draw(const T3& at3, const GSOptions& gso); /*! \ingroup PkgDrawTriangulation3 -adds the vertices, edges and faces of `at3` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso` . Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). +adds the vertices, edges and faces of `at3` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). \tparam T3 which must be an instanciation of a `CGAL::Triangulation_3<...>`. \tparam GSOptions a model of `GraphicsSceneOptions` concept. From ac1fcdec135318c98ada5a85abaff0406e227300 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 7 Dec 2023 08:11:27 +0100 Subject: [PATCH 279/399] Doc basic viewer --- .../doc/Basic_viewer/CGAL/Qt/Basic_viewer.h | 8 ++- .../doc/Basic_viewer/PackageDescription.txt | 58 ++++++++++--------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h index 34c72f8c70a0..2ed9bec56be3 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h @@ -5,7 +5,7 @@ namespace CGAL { /*! \ingroup PkgBasicViewerClasses -The class `Basic_viewer` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements are added through the scene. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. +The class `Basic_viewer` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements are added through the scene. This class requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. CGAL::QGLViewer is our internal fork of QGLViewer class which is A versatile 3D OpenGL viewer based on QOpenGLWidget. */ @@ -142,7 +142,9 @@ class Basic_viewer : public CGAL::QGLViewer /*! \ingroup PkgBasicViewerClasses -The class `QApplication_and_basic_viewer` regroups a `Basic_viewer` and Qt `QApplication`. The `QApplication` is created in the constructor, but started by the `run()` method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer` to define their own behavior. This class requires `CGAL_Qt5`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition `CGAL_USE_BASIC_VIEWER`. +The class `QApplication_and_basic_viewer` regroups a `Basic_viewer` and Qt `QApplication`. The `QApplication` is created in the constructor, but started by the `run()` method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer` to define their own behavior. + +This class requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. */ class QApplication_and_basic_viewer @@ -165,7 +167,7 @@ class QApplication_and_basic_viewer /*! \ingroup PkgBasicViewerClasses - opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method 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 macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5` and add the definition CGAL_USE_BASIC_VIEWER. + opens a new window and draws the given `Graphics_scene` (which must have been filled before). `title` will be the title of the window. A call to this method is blocking, that is the program continues as soon as the user closes the window. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition CGAL_USE_BASIC_VIEWER. */ void draw_graphics_scene(const Graphics_scene& graphic_scene, const char *title="CGAL Basic Viewer") diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index d85d6ab1927e..4e505a4b6a28 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -40,36 +40,38 @@ \cgalCRPSubsection{Draw for Different Packages} -- `Constrained_triangulation_2` \link PkgDrawTriangulation2 CGAL::draw() \endlink -- `Linear_cell_complex` \link PkgDrawLinearCellComplex CGAL::draw() \endlink -- `Nef_polyhedron_3` \link PkgDrawNef3 CGAL::draw() \endlink -- `Periodic_2_Triangulation_2` \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink -- `Point_set_3` \link PkgDrawPointSet3D CGAL::draw() \endlink -- `Polygon_2` \link PkgDrawPolygon2 CGAL::draw() \endlink -- `Polygon_set_2` \link PkgDrawPolygonSet2 CGAL::draw() \endlink -- `Polygon_with_holes_2` \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink -- `Polyhedron_3` \link PkgDrawPolyhedron CGAL::draw() \endlink -- `Surface_mesh` \link PkgDrawSurfaceMesh CGAL::draw() \endlink -- `Surface_mesh_topology` \link PkgDrawFaceGraphWithPaths CGAL::draw() \endlink -- `Triangulation_2` \link PkgDrawTriangulation2 CGAL::draw() \endlink -- `Triangulation_3` \link PkgDrawTriangulation3 CGAL::draw() \endlink -- `Voronoi_diagram_2` \link PkgDrawVoronoiDiagram2 CGAL::draw() \endlink +- `CGAL::Arrangement_2` \link PkgArrangementOnSurface2Draw CGAL::draw() \endlink +- `CGAL::Constrained_triangulation_2` \link PkgDrawTriangulation2 CGAL::draw() \endlink +- `CGAL::Linear_cell_complex` \link PkgDrawLinearCellComplex CGAL::draw() \endlink +- `CGAL::Nef_polyhedron_3` \link PkgDrawNef3 CGAL::draw() \endlink +- `CGAL::Periodic_2_Triangulation_2` \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink +- `CGAL::Point_set_3` \link PkgDrawPointSet3D CGAL::draw() \endlink +- `CGAL::Polygon_2` \link PkgDrawPolygon2 CGAL::draw() \endlink +- `CGAL::Polygon_set_2` \link PkgDrawPolygonSet2 CGAL::draw() \endlink +- `CGAL::Polygon_with_holes_2` \link PkgDrawPolygonWithHoles2 CGAL::draw() \endlink +- `CGAL::Polyhedron_3` \link PkgDrawPolyhedron CGAL::draw() \endlink +- `CGAL::Surface_mesh` \link PkgDrawSurfaceMesh CGAL::draw() \endlink +- `CGAL::Surface_mesh_topology` \link PkgDrawFaceGraphWithPaths CGAL::draw() \endlink +- `CGAL::Triangulation_2` \link PkgDrawTriangulation2 CGAL::draw() \endlink +- `CGAL::Triangulation_3` \link PkgDrawTriangulation3 CGAL::draw() \endlink +- `CGAL::Voronoi_diagram_2` \link PkgDrawVoronoiDiagram2 CGAL::draw() \endlink \cgalCRPSubsection{Fill Graphics Scene for Different Packages} -- Constrained_triangulation_2 \link PkgDrawTriangulation2 CGAL::add_to_graphics_scene() \endlink -- Linear_cell_complex \link PkgDrawLinearCellComplex CGAL::add_to_graphics_scene() \endlink -- Nef_polyhedron_3 \link PkgDrawNef3 CGAL::add_to_graphics_scene() \endlink -- Periodic_2_Triangulation_2 \link PkgDrawPeriodic2Triangulation2 CGAL::add_to_graphics_scene() \endlink -- Point_set_3 \link PkgDrawPointSet3D CGAL::add_to_graphics_scene() \endlink -- Polygon_2 \link PkgDrawPolygon2 CGAL::add_to_graphics_scene() \endlink -- Polygon_set_2 \link PkgDrawPolygonSet2 CGAL::add_to_graphics_scene() \endlink -- Polygon_with_holes_2 \link PkgDrawPolygonWithHoles2 CGAL::add_to_graphics_scene() \endlink -- Polyhedron_3 \link PkgDrawPolyhedron CGAL::add_to_graphics_scene() \endlink -- Surface_mesh \link PkgDrawSurfaceMesh CGAL::add_to_graphics_scene() \endlink -- Surface_mesh_topology \link PkgDrawFaceGraphWithPaths CGAL::add_to_graphics_scene() \endlink -- Triangulation_2 \link PkgDrawTriangulation2 CGAL::add_to_graphics_scene() \endlink -- Triangulation_3 \link PkgDrawTriangulation3 CGAL::add_to_graphics_scene() \endlink -- Voronoi_diagram_2 \link PkgDrawVoronoiDiagram2 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Arrangement_2` \link PkgArrangementOnSurface2Draw CGAL::add_to_graphics_scene() \endlink +- `CGAL::Constrained_triangulation_2` \link PkgDrawTriangulation2 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Linear_cell_complex` \link PkgDrawLinearCellComplex CGAL::add_to_graphics_scene() \endlink +- `CGAL::Nef_polyhedron_3` \link PkgDrawNef3 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Periodic_2_Triangulation_2` \link PkgDrawPeriodic2Triangulation2 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Point_set_3` \link PkgDrawPointSet3D CGAL::add_to_graphics_scene() \endlink +- `CGAL::Polygon_2` \link PkgDrawPolygon2 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Polygon_set_2` \link PkgDrawPolygonSet2 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Polygon_with_holes_2` \link PkgDrawPolygonWithHoles2 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Polyhedron_3` \link PkgDrawPolyhedron CGAL::add_to_graphics_scene() \endlink +- `CGAL::Surface_mesh` \link PkgDrawSurfaceMesh CGAL::add_to_graphics_scene() \endlink +- `CGAL::Surface_mesh_topology` \link PkgDrawFaceGraphWithPaths CGAL::add_to_graphics_scene() \endlink +- `CGAL::Triangulation_2` \link PkgDrawTriangulation2 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Triangulation_3` \link PkgDrawTriangulation3 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Voronoi_diagram_2` \link PkgDrawVoronoiDiagram2 CGAL::add_to_graphics_scene() \endlink */ From 3f3a21a949732ef18914597f7d4866a854ba5a4a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 7 Dec 2023 13:55:42 +0100 Subject: [PATCH 280/399] Doc draw face with graph (NYF: todo add links) --- .../CGAL/draw_face_graph_with_paths.h | 88 +++++++++++++++++-- .../include/CGAL/draw_face_graph_with_paths.h | 83 +++++++++++------ 2 files changed, 138 insertions(+), 33 deletions(-) diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h index df9bde13a6f3..75c2b5378e8d 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h @@ -3,28 +3,100 @@ namespace CGAL { /*! \ingroup PkgDrawFaceGraphWithPaths -opens a new window and draws `amesh`, either a 2D linear cell complex or a model of the FaceGraph concept, plus the paths lying on this mesh given in `apaths`. -A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires `CGAL_Qt6`, and is only available if the flag `CGAL_USE_BASIC_VIEWER` is defined at compile time. +opens a new window and draws `amesh`, either a 2D linear cell complex or a model of the FaceGraph concept, plus the paths lying on this mesh given in `apaths`. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. + \tparam Mesh either a 2D linear cell complex or a model of the FaceGraph concept. +\tparam GSOptions a model of `GraphicsSceneOptionsFaceGraphWithPaths` concept. + \param amesh the mesh to draw. \param apaths the paths to draw, which should lie on `amesh`. +\param gso the graphics scene options parameter. +*/ +template +void draw(const Mesh& amesh, + const std::vector >& apaths, + const GSOptions& gso); + +/*! +\ingroup PkgDrawFaceGraphWithPaths + +A shortcut to `CGAL::draw(mesh, paths, Graphics_scene_options_face_graph_with_paths{})`. */ template void draw(const Mesh& amesh, - const std::vector >& apaths); + const std::vector >& apaths); /*! \ingroup PkgDrawFaceGraphWithPaths -opens a new window and draws `amesh`, either a 2D linear cell complex or a model of the FaceGraph concept, plus the paths lying on this mesh given in `apaths`. -A call to this function is blocking, that is the program continues as soon as the user closes the window. This function requires `CGAL_Qt6`, and is only available if the flag `CGAL_USE_BASIC_VIEWER` is defined at compile time. +Same function than draw() but taking the paths from a list instead from an std::vector. +*/ +template +void draw(const Mesh& amesh, + std::initializer_list > apaths, + const GSOptions& gso); + +/*! +\ingroup PkgDrawFaceGraphWithPaths + +Same function than draw() but taking the paths from a list instead from as std::vector. +*/ +template +void draw(const Mesh& amesh, + std::initializer_list > apaths); + +/*! +\ingroup PkgDrawFaceGraphWithPaths + +adds the vertices, edges and faces of `amesh`, either a 2D linear cell complex or a model of the FaceGraph concept, plus the paths lying on this mesh given in `apaths`, into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + \tparam Mesh either a 2D linear cell complex or a model of the FaceGraph concept. +\tparam GSOptions a model of `GraphicsSceneOptionsFaceGraphWithPaths` concept. + \param amesh the mesh to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. \param apaths the paths to draw, which should lie on `amesh`. */ -template -void draw(const Mesh& amesh, - std::initializer_list >& apaths); +template +void add_to_graphics_scene(const Mesh& mesh, + CGAL::Graphics_scene& graphics_scene, + const GSOptions& gso, + const std::vector>& paths); + +/*! +\ingroup PkgDrawFaceGraphWithPaths + +A shortcut to `CGAL::add_to_graphics_scene(mesh, graphics_scene, Graphics_scene_options_face_graph_with_paths{}, paths)`. +*/ +template +void add_to_graphics_scene(const Mesh& mesh, + CGAL::Graphics_scene& graphics_scene, + const std::vector>& paths); + +/*! +\ingroup PkgDrawFaceGraphWithPaths + +Same function than add_to_graphics_scene() but taking the paths from a list instead from an std::vector. +*/ +template +void add_to_graphics_scene(const Mesh& mesh, + CGAL::Graphics_scene& graphics_scene, + const GSOptions& gso, + std::initializer_list > apaths); + +/*! +\ingroup PkgDrawFaceGraphWithPaths + +Same function than add_to_graphics_scene() but taking the paths from a list instead from an std::vector. +*/ +template +void add_to_graphics_scene(const Mesh& mesh, + CGAL::Graphics_scene& graphics_scene, + std::initializer_list > apaths); } /* namespace CGAL */ diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 12d645ec1c78..cea1c61faae8 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -254,22 +254,22 @@ void compute_path(const Mesh &mesh, const typename Get_map::storage_type& lcc, CGAL::Graphics_scene &graphics_scene, const GSOptions &gso, - const std::vector>* paths, + const std::vector>& paths, std::size_t i, typename Get_map::type::size_type amark) { - if ((*paths)[i].is_empty() || !gso.draw_path(i)) + if (paths[i].is_empty() || !gso.draw_path(i)) { return; } CGAL::IO::Color color=gso.color_of_path(i); - graphics_scene.add_point(get_point(mesh, (*paths)[i].get_ith_dart(0)), color); - for (std::size_t j=0; j<(*paths)[i].length(); ++j) + graphics_scene.add_point(get_point(mesh, paths[i].get_ith_dart(0)), color); + for (std::size_t j=0; j((*paths)[i].get_ith_dart(j), amark); + compute_edge(mesh, lcc, paths[i].get_ith_dart(j), graphics_scene, gso, true, color); + lcc.template mark_cell<1>(paths[i].get_ith_dart(j), amark); } } } @@ -278,7 +278,7 @@ template void compute_elements(const Mesh &mesh, CGAL::Graphics_scene &graphics_scene, const GSOptions &gso, - const std::vector>* paths, + const std::vector>& paths, typename Get_map::type::size_type mark) { typedef typename Get_map::type LCC; @@ -291,7 +291,7 @@ void compute_elements(const Mesh &mesh, typename Get_map::storage_type lcc(mesh); typename LCC::size_type oriented_mark = lcc.get_new_mark(); - std::size_t current_path = paths->size(); + std::size_t current_path = paths.size(); typename LCC::size_type amark=mark==(std::numeric_limits::max)()? LCC::INVALID_MARK:mark; // If !=INVALID_MARK, show darts marked with this mark @@ -301,12 +301,12 @@ void compute_elements(const Mesh &mesh, typename LCC::size_type markedges = lcc.get_new_mark(); typename LCC::size_type markvertices = lcc.get_new_mark(); - if (current_path==paths->size()) + if (current_path==paths.size()) { - for (std::size_t i=0; isize(); ++i) + for (std::size_t i=0; isize()+1) + else if (current_path!=paths.size()+1) { compute_path(mesh, lcc, graphics_scene, gso, paths, current_path, markedges); } for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(), @@ -343,7 +343,7 @@ template void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, const GSOptions& gso, - const std::vector>* paths, + const std::vector>& paths, typename Get_map::type::size_type amark= Get_map::type::INVALID_MARK) { @@ -354,7 +354,7 @@ void add_to_graphics_scene(const Mesh& mesh, template void add_to_graphics_scene(const Mesh& mesh, CGAL::Graphics_scene& graphics_scene, - const std::vector>* paths, + const std::vector>& paths, typename Get_map::type::size_type amark= Get_map::type::INVALID_MARK) { @@ -368,31 +368,66 @@ void add_to_graphics_scene(const Mesh& mesh, add_to_graphics_scene(mesh, graphics_scene, gso, paths, amark); } +template +void add_to_graphics_scene(const Mesh& mesh, + CGAL::Graphics_scene& graphics_scene, + const GSOptions& gso, + std::initializer_list> l, + typename Get_map::type::size_type amark= + Get_map::type::INVALID_MARK) +{ + std::vector> paths=l; + add_to_graphics_scene(mesh, graphics_scene, gso, paths, amark); +} + +template +void add_to_graphics_scene(const Mesh& mesh, + CGAL::Graphics_scene& graphics_scene, + std::initializer_list> l, + typename Get_map::type::size_type amark= + Get_map::type::INVALID_MARK) +{ + std::vector> paths=l; + add_to_graphics_scene(mesh, graphics_scene, paths, amark); +} + #ifdef CGAL_USE_BASIC_VIEWER -template +template void draw(const Mesh& mesh, const std::vector >& paths, + const GSOptions& gso, const char* title="Mesh Viewer With Path", typename Get_map::type::size_type amark= (std::numeric_limits::type::size_type>::max)()) { - CGAL::Graphics_scene buffer; - add_to_graphics_scene(mesh, buffer, &paths, amark); - draw_graphics_scene(buffer, title); + CGAL::Graphics_scene graphics_scene; + add_to_graphics_scene(mesh, graphics_scene, paths, gso, amark); + draw_graphics_scene(graphics_scene, title); } -template +template void draw(const Mesh& mesh, const std::vector >& paths, + const char* title="Mesh Viewer With Path", + typename Get_map::type::size_type amark= + (std::numeric_limits::type::size_type>::max)()) +{ + CGAL::Graphics_scene graphics_scene; + add_to_graphics_scene(mesh, graphics_scene, paths, amark); + draw_graphics_scene(graphics_scene, title); +} + +template +void draw(const Mesh& mesh, + std::initializer_list> l, const GSOptions& gso, const char* title="Mesh Viewer With Path", typename Get_map::type::size_type amark= (std::numeric_limits::type::size_type>::max)()) { - CGAL::Graphics_scene buffer; - add_to_graphics_scene(mesh, buffer, gso, &paths, amark); - draw_graphics_scene(buffer, title); + std::vector> paths=l; + draw(mesh, paths, gso, title, amark); } template @@ -403,9 +438,7 @@ void draw(const Mesh& mesh, (std::numeric_limits::type::size_type>::max)()) { std::vector> paths=l; - CGAL::Graphics_scene buffer; - add_to_graphics_scene(mesh, buffer, &paths, amark); - draw_graphics_scene(buffer, title); + draw(mesh, paths, title, amark); } #endif // CGAL_USE_BASIC_VIEWER From 973fb082d53d3a610cf96e25c5e89170e202cb24 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 7 Dec 2023 17:21:54 +0100 Subject: [PATCH 281/399] doc draw arrangement; fix to doc face graph with path --- .../CGAL/draw_arrangement_2.h | 44 ++++++++++++++++--- .../CGAL/draw_face_graph_with_paths.h | 24 +++++----- 2 files changed, 49 insertions(+), 19 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h index 51507311b8d4..9ba97a1c5297 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h @@ -26,11 +26,11 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Draw * * opens a new window and draws `arr`, an instance of the `CGAL::Arrangement_2` - * class template. A call to this function is blocking; that is, the program - * continues only after the user closes the window. This function requires - * `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is - * defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link - * with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. + * class template. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. + * * \tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement * traits concept. At this point it must be an instance of either @@ -44,9 +44,39 @@ namespace CGAL { * \sa `ArrangementDcel` * \sa `ArrangementTraits_2` */ +template +void draw(const Arrangement_2& arr, const GSOptions& gso); + +/*! \ingroup PkgArrangementOnSurface2Draw + + A shortcut to `CGAL::draw(arr, Graphics_scene_options{})`. + */ +template +void draw(const Arrangement_2& arr); + +/*! \ingroup PkgArrangementOnSurface2Draw + +adds the vertices, edges and faces of `arr` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement traits concept. At this point it must be an instance of either `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`. +\tparam Dcel the \dcel type, a model of the `ArrangementDcel` concept. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param arr the 2D arrangement to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + */ +template +void add_to_graphics_scene(const Arrangement_2& arr, + CGAL::Graphics_scene& gs, const GSOptions& gso); + +/*! \ingroup PkgArrangementOnSurface2Draw + + A shortcut to `CGAL::add_to_graphics_scene(arr, gs, Graphics_scene_options{})`. + */ template -void draw(const Arrangement_2& arr, - const char* title = "2D Arrangement Basic Viewer"); +void add_to_graphics_scene(const Arrangement_2& arr, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h index 75c2b5378e8d..9a088f236f57 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h @@ -23,7 +23,7 @@ void draw(const Mesh& amesh, /*! \ingroup PkgDrawFaceGraphWithPaths -A shortcut to `CGAL::draw(mesh, paths, Graphics_scene_options_face_graph_with_paths{})`. +A shortcut to `CGAL::draw(amesh, apaths, Graphics_scene_options_face_graph_with_paths{})`. */ template void draw(const Mesh& amesh, @@ -62,20 +62,20 @@ adds the vertices, edges and faces of `amesh`, either a 2D linear cell complex o \param apaths the paths to draw, which should lie on `amesh`. */ template -void add_to_graphics_scene(const Mesh& mesh, - CGAL::Graphics_scene& graphics_scene, +void add_to_graphics_scene(const Mesh& amesh, + CGAL::Graphics_scene& gs, const GSOptions& gso, - const std::vector>& paths); + const std::vector>& apaths); /*! \ingroup PkgDrawFaceGraphWithPaths -A shortcut to `CGAL::add_to_graphics_scene(mesh, graphics_scene, Graphics_scene_options_face_graph_with_paths{}, paths)`. +A shortcut to `CGAL::add_to_graphics_scene(amesh, gs, Graphics_scene_options_face_graph_with_paths{}, apaths)`. */ template -void add_to_graphics_scene(const Mesh& mesh, - CGAL::Graphics_scene& graphics_scene, - const std::vector>& paths); +void add_to_graphics_scene(const Mesh& amesh, + CGAL::Graphics_scene& gs, + const std::vector>& apaths); /*! \ingroup PkgDrawFaceGraphWithPaths @@ -83,8 +83,8 @@ void add_to_graphics_scene(const Mesh& mesh, Same function than add_to_graphics_scene() but taking the paths from a list instead from an std::vector. */ template -void add_to_graphics_scene(const Mesh& mesh, - CGAL::Graphics_scene& graphics_scene, +void add_to_graphics_scene(const Mesh& amesh, + CGAL::Graphics_scene& gs, const GSOptions& gso, std::initializer_list > apaths); @@ -94,8 +94,8 @@ void add_to_graphics_scene(const Mesh& mesh, Same function than add_to_graphics_scene() but taking the paths from a list instead from an std::vector. */ template -void add_to_graphics_scene(const Mesh& mesh, - CGAL::Graphics_scene& graphics_scene, +void add_to_graphics_scene(const Mesh& amesh, + CGAL::Graphics_scene& gs, std::initializer_list > apaths); } /* namespace CGAL */ From 2bd80f65711324cd723cc2fb1dd23cd1cc200414 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 7 Dec 2023 17:35:48 +0100 Subject: [PATCH 282/399] doc draw arrangement --- .../CGAL/draw_arrangement_2.h | 31 +++++++++---------- Basic_viewer/doc/Basic_viewer/dependencies | 1 + 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h index 9ba97a1c5297..cf7782447aa4 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h @@ -24,33 +24,30 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Draw - * - * opens a new window and draws `arr`, an instance of the `CGAL::Arrangement_2` - * class template. Parameters of the drawing are taken from the optional graphics scene options parameter. + + opens a new window and draws `arr`, an instance of the `CGAL::Arrangement_2` class template. Parameters of the drawing are taken from the optional graphics scene options parameter. A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. - * - * \tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement - * traits concept. At this point it must be an instance of either - * `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`. - * - * \tparam Dcel the \dcel type, a model of the `ArrangementDcel` concept. - * - * \param arr the 2D arrangement to draw. - * \param title the window title. - * - * \sa `ArrangementDcel` - * \sa `ArrangementTraits_2` - */ + +\tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement traits concept. At this point it must be an instance of either `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`. +\tparam Dcel the \dcel type, a model of the `ArrangementDcel` concept. +\tparam GSOptions a model of `GraphicsSceneOptions` concept. + +\param arr the 2D arrangement to draw. +\param gso the graphics scene options parameter. + +\sa `ArrangementDcel` +\sa `ArrangementTraits_2` +*/ template void draw(const Arrangement_2& arr, const GSOptions& gso); /*! \ingroup PkgArrangementOnSurface2Draw A shortcut to `CGAL::draw(arr, Graphics_scene_options{})`. - */ +*/ template void draw(const Arrangement_2& arr); diff --git a/Basic_viewer/doc/Basic_viewer/dependencies b/Basic_viewer/doc/Basic_viewer/dependencies index 3db1960593c5..296159a45e74 100644 --- a/Basic_viewer/doc/Basic_viewer/dependencies +++ b/Basic_viewer/doc/Basic_viewer/dependencies @@ -12,3 +12,4 @@ Triangulation_2 Triangulation_3 Voronoi_diagram_2 Kernel_23 +Arrangement_on_surface_2 From f3c5f5329665b1c4a5eea4c8fe7b4a1f952dc0be Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 7 Dec 2023 17:49:19 +0100 Subject: [PATCH 283/399] doc add link --- .../CGAL/draw_face_graph_with_paths.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h index 9a088f236f57..b09424dbecd8 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/draw_face_graph_with_paths.h @@ -32,7 +32,7 @@ void draw(const Mesh& amesh, /*! \ingroup PkgDrawFaceGraphWithPaths -Same function than draw() but taking the paths from a list instead from an std::vector. +Same function than draw() but taking the paths from a list instead from an std::vector. */ template void draw(const Mesh& amesh, @@ -42,7 +42,7 @@ void draw(const Mesh& amesh, /*! \ingroup PkgDrawFaceGraphWithPaths -Same function than draw() but taking the paths from a list instead from as std::vector. +A shortcut to `CGAL::draw(amesh, apaths, Graphics_scene_options_face_graph_with_paths{})`. */ template void draw(const Mesh& amesh, @@ -80,7 +80,7 @@ void add_to_graphics_scene(const Mesh& amesh, /*! \ingroup PkgDrawFaceGraphWithPaths -Same function than add_to_graphics_scene() but taking the paths from a list instead from an std::vector. +Same function than add_to_graphics_scene() but taking the paths from a list instead from an std::vector. */ template void add_to_graphics_scene(const Mesh& amesh, @@ -91,7 +91,7 @@ void add_to_graphics_scene(const Mesh& amesh, /*! \ingroup PkgDrawFaceGraphWithPaths -Same function than add_to_graphics_scene() but taking the paths from a list instead from an std::vector. +A shortcut to `CGAL::add_to_graphics_scene(amesh, gs, Graphics_scene_options_face_graph_with_paths{}, apaths)`. */ template void add_to_graphics_scene(const Mesh& amesh, From 769f6153667a7dcc86ba59dc0baad6c362f51f45 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 8 Dec 2023 13:45:48 +0100 Subject: [PATCH 284/399] doc: draw p2t2 --- .../CGAL/draw_periodic_2_triangulation_2.h | 95 ++++++++++++++++++- ...phicsSceneOptionsPeriodic2Triangulation2.h | 37 ++++++++ 2 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/GraphicsSceneOptionsPeriodic2Triangulation2.h diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/draw_periodic_2_triangulation_2.h index cbad54f1f7aa..c0d06a67e332 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/draw_periodic_2_triangulation_2.h @@ -3,14 +3,99 @@ namespace CGAL { /*! \ingroup PkgDrawPeriodic2Triangulation2 -opens a new window and draws `ap2t2`, the `Periodic_2_Triangulation_2`. A call to this function is blocking, that is the program continues as soon as the user closes the window. -This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +The class `Graphics_scene_options_periodic_2_triangulation_2` defines data and methods used to tune the way that the cells of a `Periodic_2_triangulation_2` are considered for drawing or to be added into a graphics scene. + +This class is a model of `GraphicsSceneOptionsPeriodic2Triangulation2`. + +\tparam DS a `CGAL::Periodic_2_triangulation_2`. +\tparam VertexDescriptor a descriptor of vertices of `DS`. +\tparam EdgeDescriptor a descriptor of edges of `DS`. +\tparam FaceDescriptor a descriptor of faces of `DS`. + +\cgalModels{GraphicsSceneOptionsPeriodic2Triangulation2} +*/ + +template +struct Graphics_scene_options_periodic_2_triangulation_2: public CGAL::Graphics_scene_options +{ +public: + typedef VertexDescriptor vertex_descriptor; + typedef EdgeDescriptor edge_descriptor; + typedef FaceDescriptor face_descriptor; +}; + +/*! +\ingroup PkgDrawPeriodic2Triangulation2 + +opens a new window and draws a periodic 2D triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam P2T2 a model of the `Periodic_2TriangulationTraits_2` concept. -\param ap2t2 the 2D periodic trinagulation to draw. +\tparam P2T2 which must be an instanciation of a `CGAL::Periodic_2_triangulation_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptionsPeriodic2Triangulation2` concept. + +\param p2t2 the periodic triangulation to draw. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Periodic_2_triangulation_2& p2t2, const GSOptions& gso); + +\cgalAdvancedEnd +*/ +template +void draw(const P2T2& p2t2, const GSOptions& gso); + +/*! +\ingroup PkgDrawPeriodic2Triangulation2 + +A shortcut to `CGAL::draw(p2t2, Graphics_scene_options_periodic_2_triangulation_2{})`. +*/ +template +void draw(const P2T2& p2t2); + +/*! +\ingroup PkgDrawPeriodic2Triangulation2 + +adds the vertices, edges and faces of `p2t2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\tparam P2T2 which must be an instanciation of a `CGAL::Periodic_2_triangulation_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptionsPeriodic2Triangulation2` concept. + +\param p2t2 the periodic triangulation to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Periodic_2_triangulation_2& p2t2, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd +*/ +template +void add_to_graphics_scene(const P2T2& p2t2, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawPeriodic2Triangulation2 + +A shortcut to `CGAL::add_to_graphics_scene(p2t2, gs, Graphics_scene_options_periodic_2_triangulation_2{})`. */ template -void draw(const P2T2& ap2t2); +void add_to_graphics_scene(const P2T2& p2t2, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/GraphicsSceneOptionsPeriodic2Triangulation2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/GraphicsSceneOptionsPeriodic2Triangulation2.h new file mode 100644 index 000000000000..565d8e1b913a --- /dev/null +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/GraphicsSceneOptionsPeriodic2Triangulation2.h @@ -0,0 +1,37 @@ +/*! +\ingroup PkgPeriodic2Triangulation2Concepts + +The concept `GraphicsSceneOptionsPeriodic2Triangulation2` defines data and methods used to tune the way that the cells of a `Periodic_2_triangulation_2` are considered for drawing or to be added into a graphics scene. + +\cgalRefines{GraphicsSceneOptions} + +\cgalHasModelsBegin +\cgalHasModelsBare{\link CGAL::Graphics_scene_options_periodic_2_triangulation_2 `CGAL::Graphics_scene_options_periodic_2_triangulation_2`\endlink} +\cgalHasModelsEnd + +*/ +class GraphicsSceneOptionsPeriodic2Triangulation2 +{ +public: + /// returns `true` if the domain of the Periodic_2_triangulation_2 must be ignored, `false` otherwise. + /// Returns `false` by default. + bool draw_domain() const; + + /// sets the draw domain value to `b`. + void draw_domain(bool b); + + /// toggles the draw domain value. + void toggle_draw_domain(); + + /// returns the type of the display (STORED, UNIQUE, STORED_COVER_DOMAIN or UNIQUE_COVER_DOMAIN). + typename DS::Iterator_type display_type() const; + + /// set the display type to the next type (in the ordered circular list STORED, UNIQUE, STORED_COVER_DOMAIN, UNIQUE_COVER_DOMAIN). + void increase_display_type(); + + /// returns the color used to draw the domain. + const CGAL::IO::Color& domain_color() const; + + /// sets the color used to draw the domain to `c`. + void domain_color(const CGAL::IO::Color& c) +}; From 489317b6f2b0f0760d94f44e708b50bfe686bf63 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 8 Dec 2023 14:38:45 +0100 Subject: [PATCH 285/399] doc: draw p2t2 and voronoi2 --- .../CGAL/draw_periodic_2_triangulation_2.h | 7 +- ...phicsSceneOptionsPeriodic2Triangulation2.h | 2 +- .../PackageDescription.txt | 4 +- .../CGAL/draw_voronoi_diagram_2.h | 94 +++++++++++++++++-- .../GraphicsSceneOptionsVoronoiDiagram2.h | 46 +++++++++ .../Voronoi_diagram_2/PackageDescription.txt | 3 +- .../include/CGAL/draw_voronoi_diagram_2.h | 28 ++---- 7 files changed, 149 insertions(+), 35 deletions(-) create mode 100644 Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/GraphicsSceneOptionsVoronoiDiagram2.h diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/draw_periodic_2_triangulation_2.h index c0d06a67e332..fafd9a4f5f19 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/draw_periodic_2_triangulation_2.h @@ -20,12 +20,7 @@ template struct Graphics_scene_options_periodic_2_triangulation_2: public CGAL::Graphics_scene_options -{ -public: - typedef VertexDescriptor vertex_descriptor; - typedef EdgeDescriptor edge_descriptor; - typedef FaceDescriptor face_descriptor; -}; +{}; /*! \ingroup PkgDrawPeriodic2Triangulation2 diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/GraphicsSceneOptionsPeriodic2Triangulation2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/GraphicsSceneOptionsPeriodic2Triangulation2.h index 565d8e1b913a..54b84e2d75a2 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/GraphicsSceneOptionsPeriodic2Triangulation2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/GraphicsSceneOptionsPeriodic2Triangulation2.h @@ -13,7 +13,7 @@ The concept `GraphicsSceneOptionsPeriodic2Triangulation2` defines data and metho class GraphicsSceneOptionsPeriodic2Triangulation2 { public: - /// returns `true` if the domain of the Periodic_2_triangulation_2 must be ignored, `false` otherwise. + /// returns `true` if the domain of the Periodic_2_triangulation_2 must be drawn, `false` otherwise. /// Returns `false` by default. bool draw_domain() const; diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/PackageDescription.txt b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/PackageDescription.txt index 00c17ceec127..3c527f6fdd2c 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/PackageDescription.txt +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/PackageDescription.txt @@ -110,7 +110,9 @@ of the concept `Periodic_2Offset_2`. - `CGAL::Periodic_2_triangulation_2::Locate_type` \cgalCRPSection{Draw 2D Periodic Triangulation} - - \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink +- \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink +- `GraphicsSceneOptionsPeriodic2Triangulation2` +- `CGAL::Graphics_scene_options_periodic_2_triangulation_2` */ diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/draw_voronoi_diagram_2.h index 530bcaf5dda2..8298b7b1a52f 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/draw_voronoi_diagram_2.h @@ -3,16 +3,94 @@ namespace CGAL { /*! \ingroup PkgDrawVoronoiDiagram2 -opens a new window and draws `av2`, the `Voronoi_diagram_2` constructed from a Delaunay Graph which is a model of `DelaunayGraph_2` concept. -The class `Voronoi_diagram_2` provides an adaptor to view a triangulated Delaunay graph as their dual subdivision, the -Voronoi diagram. A call to this function is blocking, that is the program continues as soon as the user closes the window. -This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +The class `Graphics_scene_options_voronoi_diagram_2` defines data and methods used to tune the way that the cells of a `Voronoi_diagram_2` are considered for drawing or to be added into a graphics scene. + +This class is a model of `GraphicsSceneOptionsVoronoiDiagram2`. + +\tparam DS a `CGAL::Voronoi_diagram_2`. +\tparam VertexDescriptor a descriptor of vertices of `DS`. +\tparam EdgeDescriptor a descriptor of edges of `DS`. +\tparam FaceDescriptor a descriptor of faces of `DS`. + +\cgalModels{GraphicsSceneOptionsVoronoiDiagram2} +*/ + +template +struct Graphics_scene_options_voronoi_diagram_2: public CGAL::Graphics_scene_options +{}; + +/*! +\ingroup PkgDrawVoronoiDiagram2 + +opens a new window and draws a 2D voronoi diagram. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam V2 a model of the `AdaptationTraits_2` concept. -\param av2 the voronoi diagram to draw. +\tparam VD2 which must be an instanciation of a `CGAL::Voronoi_diagram_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptionsVoronoiDiagram2` concept. + +\param vd2 the voronoi diagram to draw. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Voronoi_diagram_2& vd2, const GSOptions& gso); + +\cgalAdvancedEnd +*/ +template +void draw(const VD2& vd2, const GSOptions& gso); + +/*! +\ingroup PkgDrawVoronoiDiagram2 + +A shortcut to `CGAL::draw(vd2, Graphics_scene_options_voronoi_diagram_2{})`. +*/ +template +void draw(const VD2& vd2); + +/*! +\ingroup PkgDrawVoronoiDiagram2 + +adds the vertices, edges and faces of `vd2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\tparam VD2 which must be an instanciation of a `CGAL::Voronoi_diagram_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptionsVoronoiDiagram2` concept. + +\param vd2 the voronoi diagram to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Voronoi_diagram_2& vd2, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd +*/ +template +void add_to_graphics_scene(const VD2& vd2, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawVoronoiDiagram2 + +A shortcut to `CGAL::add_to_graphics_scene(vd2, gs, Graphics_scene_options_voronoi_diagram_2{})`. */ -template -void draw(const V2& av2); +template +void add_to_graphics_scene(const VD2& vd2, + CGAL::Graphics_scene& gs); } /* namespace CGAL */ diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/GraphicsSceneOptionsVoronoiDiagram2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/GraphicsSceneOptionsVoronoiDiagram2.h new file mode 100644 index 000000000000..42c8baee9723 --- /dev/null +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/GraphicsSceneOptionsVoronoiDiagram2.h @@ -0,0 +1,46 @@ +/*! +\ingroup PkgVoronoiDiagram2Concepts + +The concept `GraphicsSceneOptionsVoronoiDiagram2` defines data and methods used to tune the way that the cells of a `Voronoi_diagram_2` are considered for drawing or to be added into a graphics scene. + +\cgalRefines{GraphicsSceneOptions} + +\cgalHasModelsBegin +\cgalHasModelsBare{\link CGAL::Graphics_scene_options_voronoi_diagram_2 `CGAL::Graphics_scene_options_voronoi_diagram_2`\endlink} +\cgalHasModelsEnd + +*/ +class GraphicsSceneOptionsVoronoiDiagram2 +{ +public: + /// returns the color of the dual vertices. + const CGAL::IO::Color& dual_vertex_color() const; + /// sets the color of dual vertices to `c`. + void dual_vertex_color(const CGAL::IO::Color& c); + + /// returns the color of rays. + const CGAL::IO::Color& ray_color() const; + /// sets the color of rays to `c`. + void ray_color(const CGAL::IO::Color& c); + + /// returns the color of the bisectors. + const CGAL::IO::Color& bisector_color() const; + /// sets the color of bisectors to `c`. + void bisector_color(const CGAL::IO::Color& c); + + /// returns `true` if the voronoi vertices must be drawn, `false` otherwise. + /// Returns `false` by default. + bool draw_voronoi_vertices() const; + /// sets the draw of voronoi vertices to `b`. + void draw_voronoi_vertices(bool b); + /// toggles the draw voronoi vertices value. + void toggle_draw_voronoi_vertices(); + + /// returns `true` if the dual vertices must be drawn, `false` otherwise. + /// Returns `false` by default. + bool draw_dual_vertices() const; + /// sets the draw of dual vertices to `b`. + void draw_dual_vertices(); + /// toggles the draw dual vertices value. + void toggle_draw_dual_vertices(); +}; diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt b/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt index b109a0213d91..58edde2ec5ab 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt @@ -90,6 +90,7 @@ performing this adaptation. \cgalCRPSection{Draw Voronoi Diagram} - \link PkgDrawVoronoiDiagram2 CGAL::draw() \endlink - +- `GraphicsSceneOptionsVoronoiDiagram2` +- `CGAL::Graphics_scene_options_voronoi_2` */ diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index afe34cd5855f..534d5aa47c38 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -57,14 +57,12 @@ struct Graphics_scene_options_voronoi_2 : void bisector_color(const CGAL::IO::Color& c) { m_bisector_color=c; } - void disable_voronoi_vertices() { m_draw_voronoi_vertices=false; } - void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; } - bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; } + void draw_voronoi_vertices(bool b) { m_draw_voronoi_vertices=b; } + bool draw_voronoi_vertices() const { return m_draw_voronoi_vertices; } void toggle_draw_voronoi_vertices() { m_draw_voronoi_vertices=!m_draw_voronoi_vertices; } - void disable_dual_vertices() { m_draw_dual_vertices=false; } - void enable_dual_vertices() { m_draw_dual_vertices=true; } - bool are_dual_vertices_enabled() const { return m_draw_dual_vertices; } + void draw_dual_vertices(bool b) { m_draw_dual_vertices=b; } + bool draw_dual_vertices() const { return m_draw_dual_vertices; } void toggle_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; } protected: @@ -310,7 +308,7 @@ void compute_elements(const V2& v2, if(gs_options.are_vertices_enabled()) { // Draw the voronoi vertices - if (gs_options.are_voronoi_vertices_enabled()) + if (gs_options.draw_voronoi_vertices()) { for (typename V2::Vertex_iterator it=v2.vertices_begin(); it!=v2.vertices_end(); ++it) @@ -318,7 +316,7 @@ void compute_elements(const V2& v2, } // Draw the dual vertices - if (gs_options.are_dual_vertices_enabled()) + if (gs_options.draw_dual_vertices()) { for (typename V2::Delaunay_graph::Finite_vertices_iterator it=v2.dual().finite_vertices_begin(); @@ -402,13 +400,10 @@ void draw(const CGAL_VORONOI_TYPE& av2, } else if ((e->key() == ::Qt::Key_V) && (modifiers == ::Qt::ShiftModifier)) { - if(gs_options.are_voronoi_vertices_enabled()) - { gs_options.disable_voronoi_vertices(); } - else { gs_options.enable_voronoi_vertices(); } - + gs_options.toggle_draw_voronoi_vertices(); basic_viewer->displayMessage (QString("Voronoi vertices=%1."). - arg(gs_options.are_voronoi_vertices_enabled()?"true":"false")); + arg(gs_options.draw_voronoi_vertices()?"true":"false")); buffer.clear(); draw_function_for_v2::compute_elements(av2, buffer, gs_options); @@ -416,12 +411,9 @@ void draw(const CGAL_VORONOI_TYPE& av2, } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) { - if(gs_options.are_dual_vertices_enabled()) - { gs_options.disable_dual_vertices(); } - else { gs_options.enable_dual_vertices(); } - + gs_options.toggle_draw_dual_vertices(); basic_viewer->displayMessage(QString("Dual vertices=%1."). - arg(gs_options.are_dual_vertices_enabled()?"true":"false")); + arg(gs_options.draw_dual_vertices()?"true":"false")); buffer.clear(); draw_function_for_v2::compute_elements(av2, buffer, gs_options); From 62b8460b0f073951b870352f9296731642371b1d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 8 Dec 2023 14:53:46 +0100 Subject: [PATCH 286/399] doc draw boolean set op 2 --- .../CGAL/draw_polygon_set_2.h | 91 ++++++++++++++++++- .../GraphicsSceneOptionsPolygonSet2.h | 38 ++++++++ .../PackageDescription.txt | 4 +- 3 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GraphicsSceneOptionsPolygonSet2.h diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/draw_polygon_set_2.h index 5728fe8b86c6..32b2cecdb634 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/draw_polygon_set_2.h @@ -3,13 +3,94 @@ namespace CGAL { /*! \ingroup PkgDrawPolygonSet2 -opens a new window and draws `aps`, an instance of the `CGAL::Polygon_set_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_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. +The class `Graphics_scene_options_polygon_set_2` defines data and methods used to tune the way that the cells of a `Polygon_set_2` are considered for drawing or to be added into a graphics scene. + +This class is a model of `GraphicsSceneOptionsPolygonSet2`. + +\tparam DS a `CGAL::Polygon_set_2`. +\tparam VertexDescriptor a descriptor of vertices of `DS`. +\tparam EdgeDescriptor a descriptor of edges of `DS`. +\tparam FaceDescriptor a descriptor of faces of `DS`. + +\cgalModels{GraphicsSceneOptionsPolygonSet2} +*/ + +template +struct Graphics_scene_options_polygon_set_2: public CGAL::Graphics_scene_options +{}; + +/*! +\ingroup PkgDrawPolygonSet2 + +opens a new window and draws a 2D polygon set. Parameters of the drawing are taken from the optional graphics scene options parameter. + +A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. -\tparam PS an instance of the `CGAL::Polygon_set_2` class. -\param aps the polygon set to draw. +\tparam PS2 which must be an instanciation of a `CGAL::Polygon_set_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptionsPolygonSet2` concept. + +\param ps2 the polygon set to draw. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::draw(const CGAL::Polygon_set_2& ps2, const GSOptions& gso); + +\cgalAdvancedEnd +*/ +template +void draw(const PS2& ps2, const GSOptions& gso); + +/*! +\ingroup PkgDrawPolygonSet2 + +A shortcut to `CGAL::draw(ps2, Graphics_scene_options_polygon_set_2{})`. +*/ +template +void draw(const PS2& ps2); + +/*! +\ingroup PkgDrawPolygonSet2 + +adds the vertices, edges and faces of `ps2` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). + +\tparam PS2 which must be an instanciation of a `CGAL::Polygon_set_2<...>`. +\tparam GSOptions a model of `GraphicsSceneOptionsPolygonSet2` concept. + +\param ps2 the polygon set to draw. +\param gs the graphic scene to fill. +\param gso the graphics scene options parameter. + +\cgalAdvancedBegin +The real declaration of this function template is: + + + template + + void CGAL::add_to_graphics_scene(const CGAL::Polygon_set_2& ps2, CGAL::Graphics_scene& gs, const GSOptions& gso); + +\cgalAdvancedEnd +*/ +template +void add_to_graphics_scene(const PS2& ps2, + CGAL::Graphics_scene& gs, + const GSOptions& gso); + +/*! +\ingroup PkgDrawPolygonSet2 + +A shortcut to `CGAL::add_to_graphics_scene(ps2, gs, Graphics_scene_options_polygon_set_2{})`. */ -template -void draw(const PS& aps); +template +void add_to_graphics_scene(const PS2& ps2, + CGAL::Graphics_scene& gs); } /* end namespace CGAL */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GraphicsSceneOptionsPolygonSet2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GraphicsSceneOptionsPolygonSet2.h new file mode 100644 index 000000000000..458b9baa2834 --- /dev/null +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GraphicsSceneOptionsPolygonSet2.h @@ -0,0 +1,38 @@ +/*! +\ingroup PkgBooleanSetOperations2Concepts + +The concept `GraphicsSceneOptionsPolygonSet2` defines data and methods used to tune the way that the cells of a `Polygon_set_2` are considered for drawing or to be added into a graphics scene. + +\cgalRefines{GraphicsSceneOptions} + +\cgalHasModelsBegin +\cgalHasModelsBare{\link CGAL::Graphics_scene_options_polygon_set_2 `CGAL::Graphics_scene_options_polygon_set_2`\endlink} +\cgalHasModelsEnd + +*/ +class GraphicsSceneOptionsPolygonSet2 +{ +public: + /// returns the color of the unbounded face. + const CGAL::IO::Color& unbounded_face_color() const; + /// sets the color of the unbounded face to `c`. + void unbounded_face_color(const CGAL::IO::Color& c); + + /// returns `true` if the unbounded face must be drawn, `false` otherwise. + /// Returns `false` by default. + bool draw_unbounded() const; + /// sets the draw of unbounded face to `b`. + void draw_unbounded(bool b); + /// toggles the draw unbounded face value. + void toggle_draw_unbounded(); + + /// returns the height of the box used to draw the unbounded face. + int height() const; + /// returns the width of the box used to draw the unbounded face. + int width() const; + + /// sets the height of the box used to draw the unbounded face to `i`. + void height(int i); + /// sets the width of the box used to draw the unbounded face to `i`. + void width(int i); +}; diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt b/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt index f67e57f7e1a9..a562dd4e48a7 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt @@ -69,6 +69,8 @@ containment predicates. - \link boolean_connect_holes `CGAL::connect_holes()` \endlink \cgalCRPSection{Draw a Polygon_set_2} -- \link PkgDrawPolygonSet2 CGAL::draw() \endlink +- \link PkgDrawPolygonSet2 CGAL::draw() \endlink +- `GraphicsSceneOptionsPolygonSet2` +- `CGAL::Graphics_scene_options_polygon_set_2` */ From dcac571d9986acb1bcd2838244f7d2fd90938bf6 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 14 Dec 2023 08:23:16 +0100 Subject: [PATCH 287/399] Remove a warning --- Basic_viewer/include/CGAL/Graphics_scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index 73a5fafe6377..155a471b217d 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -374,7 +374,7 @@ class Graphics_scene void m_texts_clear() { m_texts.clear(); } - int m_texts_size() const + std::size_t m_texts_size() const { return m_texts.size(); } const std::vector>& get_m_texts() const From d7720073e2ac04972ae9c56785c29d8f219de13d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 14 Dec 2023 08:24:09 +0100 Subject: [PATCH 288/399] Remove a wrong const --- Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index 2164082adba7..ab197fe02ff0 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -38,7 +38,7 @@ struct Graphics_scene_options_polygon_set_2 : bool draw_unbounded() const { return m_draw_unbounded; } - void draw_unbounded(bool b) const + void draw_unbounded(bool b) { m_draw_unbounded=b; } void toggle_draw_unbounded() { m_draw_unbounded=!m_draw_unbounded; } From b7ed4f249e5f2192fa7832eb9e57a3f58212b40c Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 14 Dec 2023 08:26:55 +0100 Subject: [PATCH 289/399] protect min and max --- .../examples/Basic_viewer/draw_surface_mesh_height.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp index d1ef948609eb..46399cbb4bdb 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -26,8 +26,8 @@ struct Colored_faces_given_height: { m_min_z=sm.point(vi).z(); m_max_z=m_min_z; first=false; } else { - m_min_z=std::min(m_min_z, sm.point(vi).z()); - m_max_z=std::max(m_max_z, sm.point(vi).z()); + m_min_z=(std::min)(m_min_z, sm.point(vi).z()); + m_max_z=(std::max)(m_max_z, sm.point(vi).z()); } } } From 8710dbe861beebc5edeb711ca7936c2bdd61f642 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 14 Dec 2023 08:32:32 +0100 Subject: [PATCH 290/399] example requires qt --- .../examples/Basic_viewer/draw_surface_mesh_small_faces.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 555363d72711..3275b40981c3 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -102,6 +102,9 @@ int main(int argc, char* argv[]) CGAL::Graphics_scene buffer; add_to_graphics_scene(sm, buffer, gsosm); + +#ifdef CGAL_USE_BASIC_VIEWER + CGAL::Qt::QApplication_and_basic_viewer app(buffer, "Small faces"); if(app) { @@ -147,6 +150,8 @@ int main(int argc, char* argv[]) app.run(); } +#endif + sm.remove_property_map(faces_size); return EXIT_SUCCESS; From d13b856c20bd2b738cd8e80705ae076aff1c84ff Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 14 Dec 2023 08:33:58 +0100 Subject: [PATCH 291/399] example requires qt --- Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index e1680f30eccc..f1fead0a1ded 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -6,7 +6,10 @@ #include #include #include + +#ifdef CGAL_USE_BASIC_VIEWER #include +#endif #include #include @@ -52,6 +55,7 @@ int main(void) CGAL::add_to_graphics_scene(output_mesh, scene2); /// (2) Qt code that create windows, add them in a layout, and create app. +#ifdef CGAL_USE_BASIC_VIEWER #if defined(CGAL_TEST_SUITE) bool cgal_test_suite=true; @@ -81,6 +85,7 @@ int main(void) mainWindow->show(); app.exec(); +#endif return EXIT_SUCCESS; } From 0fdd175ef076ca88de4757b4533c7bc59dd9dd82 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 26 Dec 2023 09:46:36 +0100 Subject: [PATCH 292/399] use strncpy instead of strcpy --- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 8f7869441132..2a5748b5c6f2 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -15,6 +15,7 @@ #define CGAL_BASIC_VIEWER_H // TODO #include +#include #include #include #include @@ -1550,7 +1551,7 @@ class QApplication_and_basic_viewer m_argc(1) { m_argv[0]=new char[strlen(title)+1]; - strcpy(m_argv[0], title); + strncpy(m_argv[0], title, strlen(title)); m_argv[1]=nullptr; #if defined(CGAL_TEST_SUITE) From a31128516b38db74cc06582a77b192cc438cfa45 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 26 Dec 2023 09:51:02 +0100 Subject: [PATCH 293/399] remove warning --- .../Basic_viewer/draw_surface_mesh_height.cpp | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp index 46399cbb4bdb..78645874547b 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -16,19 +16,18 @@ struct Colored_faces_given_height: { Colored_faces_given_height(const Mesh& sm) { + if(sm.is_empty()) return; + double m_min_z, m_max_z; - if(!sm.is_empty()) + bool first=true; + for(typename Mesh::Vertex_index vi: sm.vertices()) { - bool first=true; - for(typename Mesh::Vertex_index vi: sm.vertices()) + if(first) + { m_min_z=sm.point(vi).z(); m_max_z=m_min_z; first=false; } + else { - if(first) - { m_min_z=sm.point(vi).z(); m_max_z=m_min_z; first=false; } - else - { - m_min_z=(std::min)(m_min_z, sm.point(vi).z()); - m_max_z=(std::max)(m_max_z, sm.point(vi).z()); - } + m_min_z=(std::min)(m_min_z, sm.point(vi).z()); + m_max_z=(std::max)(m_max_z, sm.point(vi).z()); } } @@ -37,7 +36,7 @@ struct Colored_faces_given_height: this->face_color=[m_min_z, m_max_z] (const Mesh& sm, typename Mesh::Face_index fi)->CGAL::IO::Color { - double res; + double res=0.; std::size_t n=0; for(typename Mesh::Vertex_index vi: vertices_around_face(sm.halfedge(fi), sm)) { From 3e16be00d32d23be412dcb6c9dc0b432628b3104 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 26 Dec 2023 09:55:58 +0100 Subject: [PATCH 294/399] remove warning --- Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp index 78645874547b..b7b5be585973 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -44,7 +44,7 @@ struct Colored_faces_given_height: ++n; } // Random color depending on the "height" of the facet - CGAL::Random random(30*((res/n)-m_min_z)/(m_max_z-m_min_z)); + CGAL::Random random(static_cast(30*((res/n)-m_min_z)/(m_max_z-m_min_z))); return CGAL::get_random_color(random); }; } From 01e333caae457d6a382700c6ea95a7f3f6cf15a4 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 26 Dec 2023 10:07:52 +0100 Subject: [PATCH 295/399] add missing include and function when basic viewer is disable --- .../examples/Basic_viewer/draw_mesh_and_points.cpp | 1 + Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 665b006feea2..0b3fd2285a9b 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 2a5748b5c6f2..9fd22f61c344 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -1644,6 +1644,13 @@ namespace CGAL std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Tue, 26 Dec 2023 10:08:15 +0100 Subject: [PATCH 296/399] warning in draw nef3 --- Nef_3/include/CGAL/draw_nef_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 99fe167ad623..aac531bcd5d4 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -98,9 +98,9 @@ class Nef_Visitor { CGAL::Graphics_scene& _graphics_scene, const GSOptions&_gs_options) : n_faces(0), n_edges(0), - nef(_nef), graphics_scene(_graphics_scene), - gs_options(_gs_options) + gs_options(_gs_options), + nef(_nef) {} void visit(Vertex_const_handle vh) From 1b281f9b650b2a1f674d007f32601b817954e6f7 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 26 Dec 2023 10:12:33 +0100 Subject: [PATCH 297/399] warning in surface mesh topology --- .../include/CGAL/draw_face_graph_with_paths.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index cea1c61faae8..79ba01fedd09 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -284,22 +284,17 @@ void compute_elements(const Mesh &mesh, typedef typename Get_map::type LCC; typedef typename LCC::size_type size_type; - typedef typename CGAL::Get_traits::Kernel Kernel; - typedef typename CGAL::Get_traits::Point Point; - typedef typename CGAL::Get_traits::Vector Vector; - typedef typename LCC::Dart_const_descriptor Dart_const_descriptor; - typename Get_map::storage_type lcc(mesh); - typename LCC::size_type oriented_mark = lcc.get_new_mark(); + size_type oriented_mark = lcc.get_new_mark(); std::size_t current_path = paths.size(); typename LCC::size_type amark=mark==(std::numeric_limits::max)()? LCC::INVALID_MARK:mark; // If !=INVALID_MARK, show darts marked with this mark lcc.orient(oriented_mark); - 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(); + size_type markfaces = lcc.get_new_mark(); + size_type markedges = lcc.get_new_mark(); + size_type markvertices = lcc.get_new_mark(); if (current_path==paths.size()) { From 26096e9365286cfc257188f5fb00cb4f699d99ab Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 26 Dec 2023 10:46:03 +0100 Subject: [PATCH 298/399] missing include --- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 9fd22f61c344..203ddf86dc96 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef CGAL_USE_BASIC_VIEWER @@ -50,7 +51,6 @@ #include #include -#include #include #include #include @@ -1646,7 +1646,7 @@ namespace CGAL inline void draw_graphics_scene(const Graphics_scene&, - const char *="CGAL Basic Viewer") + const char* ="CGAL Basic Viewer") { std::cerr<<"Impossible to draw, CGAL_USE_BASIC_VIEWER is not defined."< Date: Tue, 26 Dec 2023 10:51:38 +0100 Subject: [PATCH 299/399] SMT draw: Cannot use directly initializer list with variadic template. --- .../examples/Surface_mesh_topology/edgewidth_lcc.cpp | 6 +++++- .../Surface_mesh_topology/edgewidth_surface_mesh.cpp | 6 +++++- .../examples/Surface_mesh_topology/facewidth.cpp | 2 ++ .../examples/Surface_mesh_topology/open_path_homotopy.cpp | 5 ++++- .../Surface_mesh_topology/path_homotopy_double_torus.cpp | 5 ++++- .../examples/Surface_mesh_topology/path_homotopy_torus.cpp | 5 ++++- .../path_homotopy_with_sm_and_polyhedron.cpp | 5 ++++- .../Surface_mesh_topology/path_simplicity_double_torus.cpp | 5 ++++- .../path_simplicity_double_torus_2.cpp | 5 ++++- .../shortest_noncontractible_cycle.cpp | 6 +++++- .../shortest_noncontractible_cycle_2.cpp | 6 +++++- 11 files changed, 46 insertions(+), 10 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_lcc.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_lcc.cpp index 5f6692f4f837..8e492372e9c3 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_lcc.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_lcc.cpp @@ -48,7 +48,11 @@ int main(int argc, char* argv[]) std::cout<<"Cycle 1 (pink): "; display_cycle_info(lcc, cycle1); std::cout<<"Cycle 2 (green): "; display_cycle_info(lcc, cycle2); - if (draw) { CGAL::draw(lcc, {cycle1, cycle2}); } + if (draw) + { + auto cycles={cycle1, cycle2}; + CGAL::draw(lcc, cycles); + } return EXIT_SUCCESS; } diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp index a6ec92e76a78..5fb35c3c0704 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp @@ -51,7 +51,11 @@ int main(int argc, char* argv[]) std::cout<<"Cycle 1 (pink): "; display_cycle_info(sm, cycle1); std::cout<<"Cycle 2 (green): "; display_cycle_info(sm, cycle2); - if (draw) { CGAL::draw(sm, {cycle1, cycle2}); } + if (draw) + { + auto cycles={cycle1, cycle2}; + CGAL::draw(sm, cycles); + } return EXIT_SUCCESS; } diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp index 43f4b2d6a99d..e35579bd8ee4 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp @@ -35,7 +35,9 @@ int main(int argc, char* argv[]) { std::cout<<" Number of faces: "< Date: Wed, 27 Dec 2023 08:55:39 +0100 Subject: [PATCH 300/399] remove a windows warning about strncpy --- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 203ddf86dc96..575b9fcfae3f 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -1550,9 +1550,11 @@ class QApplication_and_basic_viewer m_basic_viewer(nullptr), m_argc(1) { +#define _CRT_SECURE_NO_WARNINGS m_argv[0]=new char[strlen(title)+1]; strncpy(m_argv[0], title, strlen(title)); m_argv[1]=nullptr; +#undef _CRT_SECURE_NO_WARNINGS #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; From e3249bd90884e8a60e5b6110f2e0881fdd2e2bf3 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Wed, 27 Dec 2023 13:58:36 +0100 Subject: [PATCH 301/399] fix warning --- Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2298cdd5ef55..5911752813af 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -578,7 +578,7 @@ void add_to_graphics_scene(const CGAL_ARR_TYPE& aos, gso.face_color=[](const CGAL_ARR_TYPE&, typename CGAL_ARR_TYPE::Face_const_handle fh) -> CGAL::IO::Color { - CGAL::Random random((std::size_t)(&*fh)); + CGAL::Random random((unsigned int)(&*fh)); return get_random_color(random); }; From efb946a4f539b76b3485d6e730d30d75b6627077 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 27 Dec 2023 16:26:13 +0100 Subject: [PATCH 302/399] warnings --- .../examples/Surface_mesh_topology/facewidth.cpp | 5 ++--- .../Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp index e35579bd8ee4..1ac14f92fdaa 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp @@ -14,8 +14,6 @@ int main(int argc, char* argv[]) { std::cout<<"Program facewidth_on_unweighted_map started."<=3 && std::string(argv[2])=="-draw") + { draw_facewidth(lcc, cycle); } #endif } diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp index 5dc8900de231..441d41bd45c8 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp @@ -53,7 +53,7 @@ struct Draw_functor: public CGAL::Graphics_scene_optionsedge_color=[](const LCC_3&, typename LCC_3::Dart_const_handle)->CGAL::IO::Color { return CGAL::IO::Color(0, 0, 255); }; - this->colored_face=[this](const LCC_3&, typename LCC_3::Dart_const_handle)->bool + this->colored_face=[](const LCC_3&, typename LCC_3::Dart_const_handle)->bool { return true; }; this->face_color=[](const LCC_3&, typename LCC_3::Dart_const_handle)->CGAL::IO::Color { return CGAL::IO::Color(211, 211, 211); }; From 7b483d41280f97cac8bd6a39917a95226a9f779a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 27 Dec 2023 17:57:00 +0100 Subject: [PATCH 303/399] warning in draw lcc --- .../include/CGAL/draw_linear_cell_complex.h | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) 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 7a5ad6eb7aa8..9034d419963c 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -138,6 +138,26 @@ void compute_vertex(const LCC& lcc, { graphics_scene.add_point(lcc.point(dh)); } } +template +struct Test_opposite_draw_lcc +{ + template + static bool run(const LCC& lcc, const GSOptions& gso, + typename LCC::Dart_const_descriptor dh) + { return (!lcc.template is_free<3>(dh) && + !gso.volume_wireframe(lcc, lcc.template opposite<3>(dh))); } +}; + +template +struct Test_opposite_draw_lcc +{ + template + static bool run(const LCC&, const GSOptions&, + typename LCC::Dart_const_descriptor) + { return true; } +}; + + template void compute_elements(const LCC& lcc, CGAL::Graphics_scene& graphics_scene, @@ -168,8 +188,7 @@ void compute_elements(const LCC& lcc, gso.draw_face(lcc, itv)) { if ((!gso.volume_wireframe(lcc, itv) || - (!lcc.template is_free<3>(itv) && - !gso.volume_wireframe(lcc, lcc.template opposite<3>(itv)))) && + Test_opposite_draw_lcc::run(lcc, gso, itv)) && !gso.face_wireframe(lcc, itv)) { compute_face(lcc, itv, it, graphics_scene, gso); } for(typename LCC::template Dart_of_cell_basic_range<2>::const_iterator From ca296d548a82855192dfa42f01bc8bd1891c300e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Dec 2023 08:46:59 +0100 Subject: [PATCH 304/399] the cast must be into std::size_t --- Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5911752813af..2298cdd5ef55 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -578,7 +578,7 @@ void add_to_graphics_scene(const CGAL_ARR_TYPE& aos, gso.face_color=[](const CGAL_ARR_TYPE&, typename CGAL_ARR_TYPE::Face_const_handle fh) -> CGAL::IO::Color { - CGAL::Random random((unsigned int)(&*fh)); + CGAL::Random random((std::size_t)(&*fh)); return get_random_color(random); }; From 089f0535e2afadda279776c7ea898f6110c75a0e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Dec 2023 08:47:22 +0100 Subject: [PATCH 305/399] disable warning must eb defined before includes --- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 575b9fcfae3f..b1959a295824 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -14,6 +14,8 @@ #ifndef CGAL_BASIC_VIEWER_H #define CGAL_BASIC_VIEWER_H +#define _CRT_SECURE_NO_WARNINGS + // TODO #include #include #include @@ -1550,11 +1552,9 @@ class QApplication_and_basic_viewer m_basic_viewer(nullptr), m_argc(1) { -#define _CRT_SECURE_NO_WARNINGS m_argv[0]=new char[strlen(title)+1]; strncpy(m_argv[0], title, strlen(title)); m_argv[1]=nullptr; -#undef _CRT_SECURE_NO_WARNINGS #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; @@ -1657,4 +1657,6 @@ namespace CGAL #endif // CGAL_USE_BASIC_VIEWER +#undef _CRT_SECURE_NO_WARNINGS + #endif // CGAL_BASIC_VIEWER_H From 217d4c0ec20bc6e07fb01dc79e5a9d954a3c2134 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Dec 2023 09:01:02 +0100 Subject: [PATCH 306/399] do not use strncpy --- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index b1959a295824..dafa07e8a27b 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -14,8 +14,6 @@ #ifndef CGAL_BASIC_VIEWER_H #define CGAL_BASIC_VIEWER_H -#define _CRT_SECURE_NO_WARNINGS - // TODO #include #include #include @@ -1553,7 +1551,7 @@ class QApplication_and_basic_viewer m_argc(1) { m_argv[0]=new char[strlen(title)+1]; - strncpy(m_argv[0], title, strlen(title)); + memcpy(m_argv[0], title, strlen(title)+1); m_argv[1]=nullptr; #if defined(CGAL_TEST_SUITE) @@ -1657,6 +1655,4 @@ namespace CGAL #endif // CGAL_USE_BASIC_VIEWER -#undef _CRT_SECURE_NO_WARNINGS - #endif // CGAL_BASIC_VIEWER_H From 768164464a30418c7c191a99eeff18078ccf16f3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Dec 2023 09:01:11 +0100 Subject: [PATCH 307/399] warning --- Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp index b7b5be585973..e81063b85dad 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -18,7 +18,7 @@ struct Colored_faces_given_height: { if(sm.is_empty()) return; - double m_min_z, m_max_z; + double m_min_z=0., m_max_z=0.; bool first=true; for(typename Mesh::Vertex_index vi: sm.vertices()) { From d3bbe0dd70b7021a52e8aeb5aafbaf862191fa20 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Dec 2023 09:04:12 +0100 Subject: [PATCH 308/399] cast in two steps --- Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2298cdd5ef55..3d49d1dd0d24 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -578,7 +578,7 @@ void add_to_graphics_scene(const CGAL_ARR_TYPE& aos, gso.face_color=[](const CGAL_ARR_TYPE&, typename CGAL_ARR_TYPE::Face_const_handle fh) -> CGAL::IO::Color { - CGAL::Random random((std::size_t)(&*fh)); + CGAL::Random random((unsigned int)(std::size_t)(&*fh)); return get_random_color(random); }; From 38b03d20164c50fcc6a86abadc544fc6fd174edb Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Dec 2023 09:38:18 +0100 Subject: [PATCH 309/399] warning draw smt --- .../examples/Surface_mesh_topology/draw_facewidth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index e277f7b91527..5883d7d32d77 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -22,7 +22,7 @@ struct Facewidth_graphics_scene_options: this->vertex_color=[](const ALCC&, typename ALCC::Dart_const_handle)->CGAL::IO::Color { return CGAL::IO::Color(0, 255, 0); }; - this->colored_face=[this](const ALCC&, typename ALCC::Dart_const_handle)->bool + this->colored_face=[](const ALCC&, typename ALCC::Dart_const_handle)->bool { return true; }; this->face_color=[this](const ALCC& alcc, typename ALCC::Dart_const_handle dh)->CGAL::IO::Color { return alcc.is_marked(dh, m_face_mark)?CGAL::IO::Color(255, 0, 0) From 77643b6a2c0b1462a1167b327dab29481568d8de Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 8 Jan 2024 13:05:50 +0100 Subject: [PATCH 310/399] remove a sentence (no need to replace it) The following sentence about concepts explains all. --- Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h index 21bff4b2a649..ac2fa1dc3ed6 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene_options.h @@ -6,7 +6,7 @@ namespace CGAL { The class `Graphics_scene_options` is used to tune the way that the cells of a given data structure of \cgal are considered. The different `std::function` can be modified to change for example the behavior of the drawing. -`VolumeDescriptor` can be `void` for data structures that do not represent volumes. In such a case, all methods about volumes do not exist. +`VolumeDescriptor` can be `void` for data structures that do not represent volumes. This class is a model of `GraphicsSceneOptions` when `VolumeDescriptor` is `void`, or a model of `GraphicsSceneOptionsWithVolumes` otherwise (`VolumeDescriptor` non `void`). From 1e189930b6811493f5867183597aa11d3d974224 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 8 Jan 2024 13:43:14 +0100 Subject: [PATCH 311/399] solve a todo --- BGL/include/CGAL/draw_face_graph.h | 1 - 1 file changed, 1 deletion(-) diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index e4d2eecc957e..11c1da1d6188 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -148,7 +148,6 @@ void add_to_graphics_scene_for_fg(const FG &fg, if (fh==boost::graph_traits::null_face()) { return CGAL::IO::Color(100, 125, 200); } - // TODO (?) use a seed given fh (cannot directly cast because FG is either a polyhedron or a surface mesh) return get_random_color(CGAL::get_default_random()); }; From ca895e66fa10354ccf6e0a9cdf97f0a1166725c4 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Fri, 19 Jan 2024 21:11:31 +0200 Subject: [PATCH 312/399] Basic Viewer Initial commit. --- .../doc/Basic_viewer/Basic_viewer.txt | 75 +++++++++++++++---- 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 0ec0627a8106..eabc07211f59 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -8,50 +8,97 @@ namespace CGAL { \author Guillaume Damiand, Mostafa Ashraf \cgalAutoToc -\section Basic_viewerDoc +\section Basic_Viewer -\subsection Basic_viewerDoc_1 Direct Draw +\subsection Introduction -draw(XXX) +The Basic_viewer class appears to serve as a foundation for a 3D graphics viewer in the context of the CGAL (Computational Geometry Algorithms Library) and Qt (a C++ GUI toolkit). The goal of Basic_viewer is to provide a flexible and interactive environment for visualizing geometric data and interacting with 3D scenes. The Functionality of the Basic_viewer is to renders various geometric elements such as(points, segments, rays, lines, faces, edges, etc.) and supports user interaction through keyboard inputs. -\subsection Basic_viewerDoc_2 Customize the drawing +The goal of Basic_viewer is allowing to view all CGAL data structures, such as (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more). -Graphics_scene_options +\subsubsection Some key goals and features of Basic_viewer include: + +
    +
  1. Versatile Rendering: + +The viewer supports the rendering of various geometric elements, such as points, edges, faces, rays, and lines. +Different rendering modes, including mono and colored representations, are available for these elements. + +
  2. Camera Control: + +The viewer allows users to switch between 2D and 3D viewing modes, adjusting the camera accordingly. +Camera settings, such as orthographic or perspective projection, can be configured based on the dimensionality of the scene. + +
  3. User Interaction: + +Users can interact with the viewer through keyboard inputs, enabling them to control rendering options, toggle the display of elements, and adjust visual parameters. +Key presses are mapped to specific actions, such as toggling the clipping plane, changing rendering modes, adjusting the size of elements, and modifying ambient light color. + +
  4. Clipping Plane: + +The viewer includes support for a clipping plane, allowing users to selectively render parts of the scene. +The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.). + +
  5. Shader Support: + +Shaders are compiled to enhance the rendering capabilities of the viewer, potentially providing advanced shading and visual effects. -\subsection Basic_viewerDoc_3 Graphic Scene +
  6. Flexibility and Configurability: -\subsection Basic_viewerDoc_4 Basic viewer Qt +The viewer is designed to be flexible, allowing users to configure various rendering parameters and interact with the scene based on their needs. +The code includes functions for setting up the initial state of the viewer, initializing OpenGL settings, and handling key events. -\subsection Basic_viewerDoc_5 Application and basic viewer +
+Based on class QApplication_and_basic_viewer you can develop your own demo. -\section Basic_viewerExamples Examples +\subsection Basic_viewerUsage -\subsection Basic_viewerExamples_simple_draw Basic draw +\subsubsection Basic_viewerDoc_1 Direct Draw + +draw(XXX) [WIP] + +\subsubsection Basic_viewerDoc_2 Customize the drawing + +[WIP] + +\subsection Basic_viewerExamples Examples that use Basic_viewer + +\subsubsection Basic_viewerExamples_simple_draw Basic draw \cgalExample{Surface_mesh/draw_surface_mesh.cpp} -\subsection Basic_viewerExamples_custom_color Change Face Colors +\subsubsection Basic_viewerExamples_custom_color Change Face Colors \cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} -\subsection Basic_viewerExamples_two_ds Draw two different CGAL data-structures in a same viewer +\subsubsection Basic_viewerExamples_two_ds Draw two different CGAL data-structures in a same viewer \cgalExample{Basic_viewer/draw_mesh_and_points.cpp} -\subsection Basic_viewerExamples_interact Interaction with the viewer +\subsubsection Basic_viewerExamples_interact Interaction with the viewer \cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} -\subsection Basic_viewerExamples_several_window Draw several basic viewers +\subsubsection Basic_viewerExamples_several_window Draw several basic viewers \cgalExample{Basic_viewer/draw_several_windows.cpp} +\section Graphic_Scene + +Graphics_scene_options +[WIP] + +\section secsoftwaredesign Software Design + +class diagram [WIP] + + */ } /* namespace CGAL */ From 346bc633ca79d67b3608e2e5b09fd34dcca92348 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sun, 4 Feb 2024 20:55:34 +0200 Subject: [PATCH 313/399] figs for drawing LCC example. From ca9faa4bfcb564ec1d4639627a745d6a7f9815e2 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sun, 4 Feb 2024 20:57:16 +0200 Subject: [PATCH 314/399] new for basic viewer, WIP graphic scene and class diagram. --- .../doc/Basic_viewer/Basic_viewer.txt | 93 ++++++++++++++++--- 1 file changed, 81 insertions(+), 12 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index eabc07211f59..591881d1bedb 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -52,15 +52,31 @@ The code includes functions for setting up the initial state of the viewer, init Based on class QApplication_and_basic_viewer you can develop your own demo. -\subsection Basic_viewerUsage +\subsection Basic_viewerUsage Basic Viewer Class Draw virtual function -\subsubsection Basic_viewerDoc_1 Direct Draw +The draw function is a virtual function in the Basic_viewer class responsible for rendering 3D elements such as points, segments, triangles, rays, lines, and faces. It utilizes OpenGL for rendering and incorporates several customization options for drawing styles and colors. Below is an overview of key functionalities: -draw(XXX) [WIP] +
    +
  1. Initialization: The function starts by enabling depth testing and initializing matrices for the clipping plane. -\subsubsection Basic_viewerDoc_2 Customize the drawing +
  2. Vertex Rendering: Renders vertices (points) based on specified rendering modes and colors. Supports both mono and colored points. -[WIP] +
  3. Edge Rendering: Renders edges (segments) with specified rendering modes and colors. Supports both mono and colored edges. + +
  4. Ray Rendering: Renders rays with specified rendering modes and colors. Supports both mono and colored rays. + +
  5. Line Rendering: Renders lines with specified rendering modes and colors. Supports both mono and colored lines. + +
  6. Face Rendering: Renders faces (triangles) with specified rendering modes and colors. Supports both mono and colored faces. Implements transparency for specific rendering modes. + +
  7. Clipping Plane Rendering: Renders the clipping plane when applicable. + +
  8. Text Rendering: Renders text on the screen at specified positions. + +
  9. Coordinate System Transformation: Applies transformations to bring drawings into the frame coordinate system. This includes multiplying matrices and scaling down drawings. + +
  10. Additional Rendering Considerations: Handles Z-fighting by offsetting polygons and includes adjustments for two-dimensional rendering. +
\subsection Basic_viewerExamples Examples that use Basic_viewer @@ -68,37 +84,90 @@ draw(XXX) [WIP] \cgalExample{Surface_mesh/draw_surface_mesh.cpp} - \subsubsection Basic_viewerExamples_custom_color Change Face Colors \cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} - \subsubsection Basic_viewerExamples_two_ds Draw two different CGAL data-structures in a same viewer \cgalExample{Basic_viewer/draw_mesh_and_points.cpp} - \subsubsection Basic_viewerExamples_interact Interaction with the viewer \cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} - \subsubsection Basic_viewerExamples_several_window Draw several basic viewers \cgalExample{Basic_viewer/draw_several_windows.cpp} - \section Graphic_Scene - -Graphics_scene_options [WIP] +\subsection GraphicSceneContinue Graphics_scene_options +The Graphics_scene_options class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various elements such as vertices, edges, faces, and volumes in a graphical representation of a combinatorial data structure (DS). The classes are template classes, allowing them to work with different combinatorial data structures (DS) in 2D and 3D. +\subsubsection GraphicSceneOptionsCont Here are some key responsibilities of the Graphics_scene_options class: +
    +
  1. Drawing Control: It determines whether to draw vertices, edges, faces, and volumes in the graphics scene through the use of drawing functors (draw_vertex, draw_edge, draw_face, draw_volume). +
  2. Coloring Control: It allows users to customize the coloring of vertices, edges, faces, and volumes. Users can specify whether coloring is enabled (colored_vertex, colored_edge, colored_face, colored_volume) and, if so, provide functions (vertex_color, edge_color, face_color, volume_color) to determine the color for each element. +
  3. Wireframe Control: For faces and volumes, it provides options to draw a wireframe representation (face_wireframe, volume_wireframe), allowing users to choose whether to display a wireframe overlay. +
  4. Visibility Control: Users can enable or disable the visibility of vertices, edges, faces, and volumes independently using functions like disable_vertices, enable_vertices, are_vertices_enabled, and similar functions for other components. +
  5. Template Flexibility: The class is templated to support different types of combinatorial data structures (DS) in 2D and 3D. This template flexibility allows users to use the class with various geometric structures. +
  6. Default Settings: It provides reasonable default settings for the various options, ensuring that users can get started with a sensible configuration without needing to customize every parameter. +
+ \section secsoftwaredesign Software Design class diagram [WIP] +\section DrawFunction Global Draw Function + +The draw function is a template function that facilitates drawing an almost mentioned data structures such as (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more) in a graphics scene. It has two specialization, one for using graphics scene options and another without graphics scene options. + +The draw function can be used in default way or in custom way with a graphics scene options + +``` +// Specialization of draw function for a LCC, with a drawing graphics scene options. +template class Map, + class Refs, class Storage_, + class GSOptions> +void draw(const CGAL_LCC_TYPE& alcc, const GSOptions& gso, + const char *title="LCC Basic Viewer") +{ + CGAL::Graphics_scene buffer; + add_to_graphics_scene(alcc, buffer, gso); + draw_graphics_scene(buffer, title); +} + +// Specialization of draw function for a LCC, without a graphics scene options. +template class Map, + class Refs, class Storage_> +void draw(const CGAL_LCC_TYPE& alcc, const char *title="LCC Basic Viewer") +{ + CGAL::Graphics_scene buffer; + add_to_graphics_scene(alcc, buffer); + draw_graphics_scene(buffer, title); +} + +``` +As shown above in code snippt the add_to_graphics_scene function fill LCC in the given graphic buffer with or without options, and then we pass graphic buffer to draw_graphics_scene function which is designed to display or render the contents of a Graphics_scene object. + +\cgalFigureBegin{linear_cell_complex_for_combinatorial_map,lcc_cmap_with_faces.png} +example of drawing LCC for CMap with faces +\cgalFigureEnd + +\cgalFigureBegin{linear_cell_complex_for_combinatorial_map,lcc_cmap_without_edges.png} +example of drawing LCC for CMap without edges +\cgalFigureEnd + +\cgalFigureBegin{linear_cell_complex_for_combinatorial_map,lcc_cmap_without_faces.png} +example of drawing LCC for CMap without faces +\cgalFigureEnd */ } /* namespace CGAL */ + From 369fab8a3eabbbfbb22d64ffec3279f70e76d40d Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 5 Feb 2024 14:11:12 +0200 Subject: [PATCH 315/399] added Graphic_Scene section --- .../doc/Basic_viewer/Basic_viewer.txt | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 591881d1bedb..c7a2630bde40 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -101,18 +101,97 @@ The draw function is a virtual function in the Basic_viewer class responsible fo \cgalExample{Basic_viewer/draw_several_windows.cpp} \section Graphic_Scene -[WIP] + +The Graphics_scene class appears to be a container class responsible for managing CGAL data structures and handling buffers for various geometric elements, such as points, segments, rays, lines, and faces by fill data in given graphic buffer. + +\subsection GraphicSceneClass key components and functionality of this class: +
    + +
  1. Buffer Management: + +
      +
    1. The class manages buffers for different geometric elements, including mono and colored versions of points, segments, rays, lines, and faces. +
    2. Buffers are stored in the arrays array, which holds vectors of BufferType (defaulted to float), and each buffer is initialized in the constructor. +
    + +
  2. Bounding Box: +
      +
    1. The class maintains a bounding box (m_bounding_box) that encompasses all the geometric elements in the scene. +
    2. The bounding box can be initiated and updated based on the elements added to the scene. +
    + +
  3. Adding Geometric Elements: +
      +
    1. The class provides template member functions (add_point, add_segment, add_ray, etc.) for adding various geometric elements to the corresponding buffers. +
    2. It supports both mono and colored versions of these elements, allowing for the addition of color information. +
    + +
  4. Face Handling: +
      +
    1. The class supports the creation of faces by providing methods such as face_begin, add_point_in_face, and face_end. +
    2. Faces can be either mono or colored, and they are constructed by adding points to the corresponding face buffers. +
    + +
  5. Normal Handling: +
      +
    1. Normals for faces are handled separately for smooth and flat shading, and they are part of the normal buffers. +
    + +
  6. Text Handling: +
      +
    1. The class maintains a vector of text elements (m_texts), where each text element is associated with a 3D point in the scene. +
    2. Text elements can be added using the add_text member function. +
    + +
  7. Utility Functions: +
      +
    1. The class provides utility functions such as checking if a face has started (a_face_started), clearing all buffers (clear), and determining if the scene is empty. +
    + +
  8. Coordinate System Information: +
      +
    1. The class contains functions to check if the data structure lies on a particular plane (XY, XZ, or YZ), providing information about the coordinate system. +
    + +
  9. Local Coordinate Transformations: +
      +
    1. There are template functions (get_local_point and get_local_vector) for transforming CGAL points and vectors into a local coordinate system (Local_kernel). +
    + +
  10. Size and Dimensionality: +
      +
    1. Functions like get_size_of_index and number_of_elements provide information about the size and dimensionality of buffers. +
    + +
  11. Miscellaneous: +
      +
    1. The class allows for reversing all normals in the scene using the reverse_all_normals function. +
    2. The empty function checks whether the scene is empty. +
    3. Functions like has_zero_x, has_zero_y, and has_zero_z check if any element in the scene has a zero value in a specific coordinate. +
    + +
+ +This class provides a comprehensive interface for managing and manipulating geometric data in a 3D scene, facilitating the rendering and interaction of complex scenes in a graphics application. + \subsection GraphicSceneContinue Graphics_scene_options The Graphics_scene_options class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various elements such as vertices, edges, faces, and volumes in a graphical representation of a combinatorial data structure (DS). The classes are template classes, allowing them to work with different combinatorial data structures (DS) in 2D and 3D. \subsubsection GraphicSceneOptionsCont Here are some key responsibilities of the Graphics_scene_options class:
    +
  1. Drawing Control: It determines whether to draw vertices, edges, faces, and volumes in the graphics scene through the use of drawing functors (draw_vertex, draw_edge, draw_face, draw_volume). +
  2. Coloring Control: It allows users to customize the coloring of vertices, edges, faces, and volumes. Users can specify whether coloring is enabled (colored_vertex, colored_edge, colored_face, colored_volume) and, if so, provide functions (vertex_color, edge_color, face_color, volume_color) to determine the color for each element. +
  3. Wireframe Control: For faces and volumes, it provides options to draw a wireframe representation (face_wireframe, volume_wireframe), allowing users to choose whether to display a wireframe overlay. +
  4. Visibility Control: Users can enable or disable the visibility of vertices, edges, faces, and volumes independently using functions like disable_vertices, enable_vertices, are_vertices_enabled, and similar functions for other components. +
  5. Template Flexibility: The class is templated to support different types of combinatorial data structures (DS) in 2D and 3D. This template flexibility allows users to use the class with various geometric structures. +
  6. Default Settings: It provides reasonable default settings for the various options, ensuring that users can get started with a sensible configuration without needing to customize every parameter. +
\section secsoftwaredesign Software Design From 44e5d7f7abedb5797ce67e6789542bb875c66751 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 5 Feb 2024 14:24:12 +0200 Subject: [PATCH 316/399] fixed errors of build doc logs. --- Basic_viewer/doc/Basic_viewer/Basic_viewer.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index c7a2630bde40..036592b50e31 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -194,7 +194,7 @@ The Graphics_scene_options class is responsible for providing a set of options a -\section secsoftwaredesign Software Design +\section SoftwareDesignClassDiagam Software Design class diagram [WIP] @@ -234,15 +234,15 @@ void draw(const CGAL_LCC_TYPE& alcc, const char *title="LCC Basic Viewer") ``` As shown above in code snippt the add_to_graphics_scene function fill LCC in the given graphic buffer with or without options, and then we pass graphic buffer to draw_graphics_scene function which is designed to display or render the contents of a Graphics_scene object. -\cgalFigureBegin{linear_cell_complex_for_combinatorial_map,lcc_cmap_with_faces.png} +\cgalFigureBegin{linear_cell_complex_for_combinatorial_map_ex1,lcc_cmap_with_faces.png} example of drawing LCC for CMap with faces \cgalFigureEnd -\cgalFigureBegin{linear_cell_complex_for_combinatorial_map,lcc_cmap_without_edges.png} +\cgalFigureBegin{linear_cell_complex_for_combinatorial_map_ex2,lcc_cmap_without_edges.png} example of drawing LCC for CMap without edges \cgalFigureEnd -\cgalFigureBegin{linear_cell_complex_for_combinatorial_map,lcc_cmap_without_faces.png} +\cgalFigureBegin{linear_cell_complex_for_combinatorial_map_ex3,lcc_cmap_without_faces.png} example of drawing LCC for CMap without faces \cgalFigureEnd From f91a498908742dce633f3460a12aa34ee1a6c0f2 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 5 Feb 2024 18:03:42 +0200 Subject: [PATCH 317/399] Basic_viewer UML class diagram. From 27081859ac341a681a4844d80ffcf958fec5458e Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Mon, 5 Feb 2024 18:08:48 +0200 Subject: [PATCH 318/399] Basic_viewer package UML class diagram. --- Basic_viewer/doc/Basic_viewer/Basic_viewer.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 036592b50e31..c01454aa36a4 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -196,7 +196,11 @@ The Graphics_scene_options class is responsible for providing a set of options a \section SoftwareDesignClassDiagam Software Design -class diagram [WIP] +The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the different classes of the package. + +\cgalFigureBegin{fig_basic_viewer_diagramme_class,basic_viewer_diagramme_class.svg} +UML diagram of the main classes of the package. +\cgalFigureEnd \section DrawFunction Global Draw Function From 62b8e8fb6fe4e7bf9334015dad26e80cc9be04a2 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 6 Feb 2024 12:13:03 +0100 Subject: [PATCH 319/399] new function add_bbox(face_graph) that adds bbox to face graph the bbox can be : * triangulated or not * tight or not --- .../CGAL/Polygon_mesh_processing/bbox.h | 85 ++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 96e61d7bb674..43e50077fc5d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -15,14 +15,18 @@ #include - #include -#include +#include +#include +#include +#include #include #include +#include + namespace CGAL { namespace Polygon_mesh_processing { @@ -255,6 +259,83 @@ namespace CGAL { } return bb; } + + /*! + * adds a triangulated bounding box to a polygon mesh + * @todo add extended bbox factor + * @todo add triangulate or not as NP + */ + template + void add_bbox(PolygonMesh& pmesh, + const NamedParameters& np = parameters::default_values()) + { + using parameters::choose_parameter; + using parameters::get_parameter; + + typedef typename GetGeomTraits::type GT; + GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); + typedef typename GT::Point_3 Point_3; + + const double factor = 1.1; //todo : add as NP + CGAL::Bbox_3 bb = bbox(pmesh); + if (factor != 1.0) + { + const double dx = bb.xmax() - bb.xmin(); + const double dy = bb.ymax() - bb.ymin(); + const double dz = bb.zmax() - bb.zmin(); + const Point_3 center( bb.xmin() + 0.5 * dx, + bb.ymin() + 0.5 * dy, + bb.zmin() + 0.5 * dz ); + bb = Bbox_3( center.x() - factor * 0.5 * dx, + center.y() - factor * 0.5 * dy, + center.z() - factor * 0.5 * dz, + center.x() + factor * 0.5 * dx, + center.y() + factor * 0.5 * dy, + center.z() + factor * 0.5 * dz ); + } + + const bool triangulate = true; //todo : add as NP + + const typename GT::Iso_cuboid_3 bbox(bb); + std::vector bb_points; + for (int i = 0; i < 8; ++i) + bb_points.push_back(bbox[i]); + + std::vector> faces; + if (!triangulate) + { + faces.push_back({0, 1, 2, 3});//bottom + faces.push_back({4, 5, 6, 7});//top + faces.push_back({0, 1, 6, 5});//front + faces.push_back({2, 3, 4, 7});//back + faces.push_back({1, 2, 7, 6});//right + faces.push_back({0, 3, 4, 5});//left + } + else + { + faces.push_back({0, 1, 2});//bottom + faces.push_back({0, 2, 3}); + faces.push_back({4, 5, 6});//top + faces.push_back({4, 6, 7}); + faces.push_back({0, 1, 5});//front + faces.push_back({1, 5, 6}); + faces.push_back({2, 3, 4});//back + faces.push_back({2, 4, 7}); + faces.push_back({1, 2, 6});//right + faces.push_back({2, 6, 7}); + faces.push_back({0, 3, 4});//left + faces.push_back({0, 4, 5}); + } + + PolygonMesh bbox_pmesh; + orient_polygon_soup(bb_points, faces); + polygon_soup_to_polygon_mesh(bb_points, faces, bbox_pmesh); + + CGAL::copy_face_graph(bbox_pmesh, pmesh, + parameters::default_values(), + np); + } } } From ce2bb371386f4ef297edc69889376b195fcf2b94 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 6 Feb 2024 15:31:35 +0100 Subject: [PATCH 320/399] change order --- .../doc/Basic_viewer/Basic_viewer.txt | 194 +++++++----------- 1 file changed, 75 insertions(+), 119 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index c01454aa36a4..8013632b1dd8 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -8,102 +8,122 @@ namespace CGAL { \author Guillaume Damiand, Mostafa Ashraf \cgalAutoToc -\section Basic_Viewer +\section Introduction -\subsection Introduction - -The Basic_viewer class appears to serve as a foundation for a 3D graphics viewer in the context of the CGAL (Computational Geometry Algorithms Library) and Qt (a C++ GUI toolkit). The goal of Basic_viewer is to provide a flexible and interactive environment for visualizing geometric data and interacting with 3D scenes. The Functionality of the Basic_viewer is to renders various geometric elements such as(points, segments, rays, lines, faces, edges, etc.) and supports user interaction through keyboard inputs. +The basic viewer package appears to serve as a foundation for a 3D graphics viewer in the context of the CGAL (Computational Geometry Algorithms Library) and Qt (a C++ GUI toolkit). The goal of this package is to provide a flexible and interactive environment for visualizing geometric data and interacting with 3D scenes. The functionality of the package is to renders various geometric elements such as(points, segments, rays, lines, faces, edges, etc.) and supports user interaction through keyboard inputs. The goal of Basic_viewer is allowing to view all CGAL data structures, such as (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more). -\subsubsection Some key goals and features of Basic_viewer include: +There are mainly: two global functions for each CGAL package `CGAL::draw` and `CGAL::add_to_graphics_scene`; four classes `CGAL::Graphics_scene`, `CGAL::Graphics_scene_option`, `CGAL::Qt::Basic_viewer` and `CGAL::Qt::QApplication_and_basic_viewer`. -
    -
  1. Versatile Rendering: +\section SoftwareDesignClassDiagam Software Design -The viewer supports the rendering of various geometric elements, such as points, edges, faces, rays, and lines. -Different rendering modes, including mono and colored representations, are available for these elements. +The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the different classes of the package. -
  2. Camera Control: +\cgalFigureBegin{fig_basic_viewer_diagramme_class,basic_viewer_diagramme_class.svg} +UML diagram of the main classes of the package. +\cgalFigureEnd -The viewer allows users to switch between 2D and 3D viewing modes, adjusting the camera accordingly. -Camera settings, such as orthographic or perspective projection, can be configured based on the dimensionality of the scene. +TODO links the classes with the different sections where they will be explained -
  3. User Interaction: +\section Basic Usage: global `CGAL::draw` functions -Users can interact with the viewer through keyboard inputs, enabling them to control rendering options, toggle the display of elements, and adjust visual parameters. -Key presses are mapped to specific actions, such as toggling the clipping plane, changing rendering modes, adjusting the size of elements, and modifying ambient light color. +A first simple solution provide to draw the different data structures of CGAL is the use of global draw functions. +The draw function is a template function that facilitates drawing an almost mentioned data structures such as (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more) -
  4. Clipping Plane: +``` +#include +#include + +using LCC=CGAL::Linear_cell_complex_for_combinatorial_map<3>; +using Point=LCC::Point; + +LCC lcc; +lcc.make_hexahedron(Point(0,0,0), Point(5,0,0), + Point(5,5,0), Point(0,5,0), + Point(0,5,4), Point(0,0,4), + Point(5,0,4), Point(5,5,4)); +CGAL::draw(lcc); +``` -The viewer includes support for a clipping plane, allowing users to selectively render parts of the scene. -The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.). -
  5. Shader Support: +\cgalFigureBegin{linear_cell_complex_for_combinatorial_map_ex1,lcc_cmap_with_faces.png} +example of drawing LCC for CMap with faces +\cgalFigureEnd -Shaders are compiled to enhance the rendering capabilities of the viewer, potentially providing advanced shading and visual effects. +More advanced example -
  6. Flexibility and Configurability: +\cgalExample{Surface_mesh/draw_surface_mesh.cpp} -The viewer is designed to be flexible, allowing users to configure various rendering parameters and interact with the scene based on their needs. -The code includes functions for setting up the initial state of the viewer, initializing OpenGL settings, and handling key events. +\subsection GraphicSceneContinue Tune the drawing thanks to `CGAL::Graphics_scene_options` -
+There is one specialization of each draw function that takes a graphics scene options as parameter, allowing to tune the drawing. -Based on class QApplication_and_basic_viewer you can develop your own demo. +The Graphics_scene_options class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various elements such as vertices, edges, faces, and volumes in a graphical representation of a combinatorial data structure (DS). The classes are template classes, allowing them to work with different combinatorial data structures (DS) in 2D and 3D. +\subsubsection GraphicSceneOptionsCont Here are some key responsibilities of the Graphics_scene_options class: +
    -\subsection Basic_viewerUsage Basic Viewer Class Draw virtual function +
  1. Drawing Control: It determines whether to draw vertices, edges, faces, and volumes in the graphics scene through the use of drawing functors (draw_vertex, draw_edge, draw_face, draw_volume). -The draw function is a virtual function in the Basic_viewer class responsible for rendering 3D elements such as points, segments, triangles, rays, lines, and faces. It utilizes OpenGL for rendering and incorporates several customization options for drawing styles and colors. Below is an overview of key functionalities: +
  2. Coloring Control: It allows users to customize the coloring of vertices, edges, faces, and volumes. Users can specify whether coloring is enabled (colored_vertex, colored_edge, colored_face, colored_volume) and, if so, provide functions (vertex_color, edge_color, face_color, volume_color) to determine the color for each element. -
      -
    1. Initialization: The function starts by enabling depth testing and initializing matrices for the clipping plane. +
    2. Wireframe Control: For faces and volumes, it provides options to draw a wireframe representation (face_wireframe, volume_wireframe), allowing users to choose whether to display a wireframe overlay. -
    3. Vertex Rendering: Renders vertices (points) based on specified rendering modes and colors. Supports both mono and colored points. +
    4. Visibility Control: Users can enable or disable the visibility of vertices, edges, faces, and volumes independently using functions like disable_vertices, enable_vertices, are_vertices_enabled, and similar functions for other components. -
    5. Edge Rendering: Renders edges (segments) with specified rendering modes and colors. Supports both mono and colored edges. +
    6. Template Flexibility: The class is templated to support different types of combinatorial data structures (DS) in 2D and 3D. This template flexibility allows users to use the class with various geometric structures. -
    7. Ray Rendering: Renders rays with specified rendering modes and colors. Supports both mono and colored rays. +
    8. Default Settings: It provides reasonable default settings for the various options, ensuring that users can get started with a sensible configuration without needing to customize every parameter. -
    9. Line Rendering: Renders lines with specified rendering modes and colors. Supports both mono and colored lines. +
    -
  3. Face Rendering: Renders faces (triangles) with specified rendering modes and colors. Supports both mono and colored faces. Implements transparency for specific rendering modes. +\cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} -
  4. Clipping Plane Rendering: Renders the clipping plane when applicable. +\subsection Some key goals and features of the Qt viewer include: -
  5. Text Rendering: Renders text on the screen at specified positions. +TODO explain the main key options -
  6. Coordinate System Transformation: Applies transformations to bring drawings into the frame coordinate system. This includes multiplying matrices and scaling down drawings. +
      +
    1. Versatile Rendering: -
    2. Additional Rendering Considerations: Handles Z-fighting by offsetting polygons and includes adjustments for two-dimensional rendering. -
    +The viewer supports the rendering of various geometric elements, such as points, edges, faces, rays, and lines. +Different rendering modes, including mono and colored representations, are available for these elements. -\subsection Basic_viewerExamples Examples that use Basic_viewer +
  7. Camera Control: -\subsubsection Basic_viewerExamples_simple_draw Basic draw +The viewer allows users to switch between 2D and 3D viewing modes, adjusting the camera accordingly. +Camera settings, such as orthographic or perspective projection, can be configured based on the dimensionality of the scene. -\cgalExample{Surface_mesh/draw_surface_mesh.cpp} +
  8. User Interaction: -\subsubsection Basic_viewerExamples_custom_color Change Face Colors +Users can interact with the viewer through keyboard inputs, enabling them to control rendering options, toggle the display of elements, and adjust visual parameters. +Key presses are mapped to specific actions, such as toggling the clipping plane, changing rendering modes, adjusting the size of elements, and modifying ambient light color. -\cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} +
  9. Clipping Plane: -\subsubsection Basic_viewerExamples_two_ds Draw two different CGAL data-structures in a same viewer +The viewer includes support for a clipping plane, allowing users to selectively render parts of the scene. +The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.). -\cgalExample{Basic_viewer/draw_mesh_and_points.cpp} +
  10. Shader Support: -\subsubsection Basic_viewerExamples_interact Interaction with the viewer +Shaders are compiled to enhance the rendering capabilities of the viewer, potentially providing advanced shading and visual effects. -\cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} +
  11. Flexibility and Configurability: -\subsubsection Basic_viewerExamples_several_window Draw several basic viewers +The viewer is designed to be flexible, allowing users to configure various rendering parameters and interact with the scene based on their needs. +The code includes functions for setting up the initial state of the viewer, initializing OpenGL settings, and handling key events. -\cgalExample{Basic_viewer/draw_several_windows.cpp} +
\section Graphic_Scene The Graphics_scene class appears to be a container class responsible for managing CGAL data structures and handling buffers for various geometric elements, such as points, segments, rays, lines, and faces by fill data in given graphic buffer. +Draw two different CGAL data-structures in a same viewer + +\cgalExample{Basic_viewer/draw_mesh_and_points.cpp} + + \subsection GraphicSceneClass key components and functionality of this class:
    @@ -175,80 +195,16 @@ The Graphics_scene class appears to be a container class responsible for managin This class provides a comprehensive interface for managing and manipulating geometric data in a 3D scene, facilitating the rendering and interaction of complex scenes in a graphics application. -\subsection GraphicSceneContinue Graphics_scene_options -The Graphics_scene_options class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various elements such as vertices, edges, faces, and volumes in a graphical representation of a combinatorial data structure (DS). The classes are template classes, allowing them to work with different combinatorial data structures (DS) in 2D and 3D. -\subsubsection GraphicSceneOptionsCont Here are some key responsibilities of the Graphics_scene_options class: -
      - -
    1. Drawing Control: It determines whether to draw vertices, edges, faces, and volumes in the graphics scene through the use of drawing functors (draw_vertex, draw_edge, draw_face, draw_volume). - -
    2. Coloring Control: It allows users to customize the coloring of vertices, edges, faces, and volumes. Users can specify whether coloring is enabled (colored_vertex, colored_edge, colored_face, colored_volume) and, if so, provide functions (vertex_color, edge_color, face_color, volume_color) to determine the color for each element. - -
    3. Wireframe Control: For faces and volumes, it provides options to draw a wireframe representation (face_wireframe, volume_wireframe), allowing users to choose whether to display a wireframe overlay. - -
    4. Visibility Control: Users can enable or disable the visibility of vertices, edges, faces, and volumes independently using functions like disable_vertices, enable_vertices, are_vertices_enabled, and similar functions for other components. +\section Use the Qt widget CGAL::Qt::Basic_viewer -
    5. Template Flexibility: The class is templated to support different types of combinatorial data structures (DS) in 2D and 3D. This template flexibility allows users to use the class with various geometric structures. - -
    6. Default Settings: It provides reasonable default settings for the various options, ensuring that users can get started with a sensible configuration without needing to customize every parameter. - -
    - -\section SoftwareDesignClassDiagam Software Design - -The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the different classes of the package. - -\cgalFigureBegin{fig_basic_viewer_diagramme_class,basic_viewer_diagramme_class.svg} -UML diagram of the main classes of the package. -\cgalFigureEnd - -\section DrawFunction Global Draw Function - -The draw function is a template function that facilitates drawing an almost mentioned data structures such as (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more) in a graphics scene. It has two specialization, one for using graphics scene options and another without graphics scene options. - -The draw function can be used in default way or in custom way with a graphics scene options - -``` -// Specialization of draw function for a LCC, with a drawing graphics scene options. -template class Map, - class Refs, class Storage_, - class GSOptions> -void draw(const CGAL_LCC_TYPE& alcc, const GSOptions& gso, - const char *title="LCC Basic Viewer") -{ - CGAL::Graphics_scene buffer; - add_to_graphics_scene(alcc, buffer, gso); - draw_graphics_scene(buffer, title); -} - -// Specialization of draw function for a LCC, without a graphics scene options. -template class Map, - class Refs, class Storage_> -void draw(const CGAL_LCC_TYPE& alcc, const char *title="LCC Basic Viewer") -{ - CGAL::Graphics_scene buffer; - add_to_graphics_scene(alcc, buffer); - draw_graphics_scene(buffer, title); -} +\cgalExample{Basic_viewer/draw_several_windows.cpp} -``` -As shown above in code snippt the add_to_graphics_scene function fill LCC in the given graphic buffer with or without options, and then we pass graphic buffer to draw_graphics_scene function which is designed to display or render the contents of a Graphics_scene object. +\section Add some small interactions with the viewer -\cgalFigureBegin{linear_cell_complex_for_combinatorial_map_ex1,lcc_cmap_with_faces.png} -example of drawing LCC for CMap with faces -\cgalFigureEnd +\cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} -\cgalFigureBegin{linear_cell_complex_for_combinatorial_map_ex2,lcc_cmap_without_edges.png} -example of drawing LCC for CMap without edges -\cgalFigureEnd +\subsubsection Basic_viewerExamples_several_window Draw several basic viewers -\cgalFigureBegin{linear_cell_complex_for_combinatorial_map_ex3,lcc_cmap_without_faces.png} -example of drawing LCC for CMap without faces -\cgalFigureEnd */ From f35858694afecc333d6beabc7e849dd9addc12dd Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 6 Feb 2024 15:39:35 +0100 Subject: [PATCH 321/399] bugfix doc --- Basic_viewer/doc/Basic_viewer/Basic_viewer.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 8013632b1dd8..b673b49fbbc5 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -203,9 +203,6 @@ This class provides a comprehensive interface for managing and manipulating geom \cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} -\subsubsection Basic_viewerExamples_several_window Draw several basic viewers - - */ } /* namespace CGAL */ From 6ed6aa681afda106795b5cb6c7abff7598468b83 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 12 Feb 2024 16:32:52 +0100 Subject: [PATCH 322/399] improve add_bbox using make_hexahedron and Iso_cuboid_3 --- .../CGAL/Polygon_mesh_processing/bbox.h | 113 ++++++++---------- .../internal/parameters_interface.h | 2 + 2 files changed, 51 insertions(+), 64 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 43e50077fc5d..833d22e0103b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -17,9 +17,9 @@ #include -#include -#include +#include #include +#include #include #include @@ -261,9 +261,28 @@ namespace CGAL { } /*! - * adds a triangulated bounding box to a polygon mesh - * @todo add extended bbox factor - * @todo add triangulate or not as NP + * adds an axis-aligned bounding box to a polygon mesh. + * @tparam PolygonMesh a model of `MutableFaceGraph` + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * @param pmesh a polygon mesh + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * \cgalNamedParamsBegin + * \cgalParamNBegin{bbox_scaling} + * \cgalParamDescription{a double used to scale the bounding box. + * The default value is 1 and the bounding box is the smallest possible + * axis-aligned bounding box.} + * \cgalParamDefault{1.} + * \cgalParamNEnd + * \cgalParamNBegin{triangulate_bbox} + * \cgalParamDescription{a boolean used to specify if the bounding box should be triangulated or not.} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3`, + * the function `Construct_bbox_3 construct_bbox_3_object()`, + * the types `Point_3`, `Vector_3` and `Iso_cuboid_3`.} + * \cgalParamNEnd + * \cgalNamedParamsEnd */ template @@ -273,66 +292,32 @@ namespace CGAL { using parameters::choose_parameter; using parameters::get_parameter; - typedef typename GetGeomTraits::type GT; + using GT = typename GetGeomTraits::type; GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); - typedef typename GT::Point_3 Point_3; - - const double factor = 1.1; //todo : add as NP - CGAL::Bbox_3 bb = bbox(pmesh); - if (factor != 1.0) - { - const double dx = bb.xmax() - bb.xmin(); - const double dy = bb.ymax() - bb.ymin(); - const double dz = bb.zmax() - bb.zmin(); - const Point_3 center( bb.xmin() + 0.5 * dx, - bb.ymin() + 0.5 * dy, - bb.zmin() + 0.5 * dz ); - bb = Bbox_3( center.x() - factor * 0.5 * dx, - center.y() - factor * 0.5 * dy, - center.z() - factor * 0.5 * dz, - center.x() + factor * 0.5 * dx, - center.y() + factor * 0.5 * dy, - center.z() + factor * 0.5 * dz ); - } - - const bool triangulate = true; //todo : add as NP - - const typename GT::Iso_cuboid_3 bbox(bb); - std::vector bb_points; - for (int i = 0; i < 8; ++i) - bb_points.push_back(bbox[i]); - - std::vector> faces; - if (!triangulate) - { - faces.push_back({0, 1, 2, 3});//bottom - faces.push_back({4, 5, 6, 7});//top - faces.push_back({0, 1, 6, 5});//front - faces.push_back({2, 3, 4, 7});//back - faces.push_back({1, 2, 7, 6});//right - faces.push_back({0, 3, 4, 5});//left - } - else - { - faces.push_back({0, 1, 2});//bottom - faces.push_back({0, 2, 3}); - faces.push_back({4, 5, 6});//top - faces.push_back({4, 6, 7}); - faces.push_back({0, 1, 5});//front - faces.push_back({1, 5, 6}); - faces.push_back({2, 3, 4});//back - faces.push_back({2, 4, 7}); - faces.push_back({1, 2, 6});//right - faces.push_back({2, 6, 7}); - faces.push_back({0, 3, 4});//left - faces.push_back({0, 4, 5}); - } - - PolygonMesh bbox_pmesh; - orient_polygon_soup(bb_points, faces); - polygon_soup_to_polygon_mesh(bb_points, faces, bbox_pmesh); - - CGAL::copy_face_graph(bbox_pmesh, pmesh, + using Point_3 = typename GT::Point_3; + using Iso_cuboid_3 = typename GT::Iso_cuboid_3; + using Vector_3 = typename GT::Vector_3; + + double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); + bool triangulate = choose_parameter(get_parameter(np, internal_np::triangulate_bbox), true); + + Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); + Point_3 bb_center(0.5 * (bb.xmax() + bb.xmin()), + 0.5 * (bb.ymax() + bb.ymin()), + 0.5 * (bb.zmax() + bb.zmin())); + Iso_cuboid_3 bbext( + (bb.min)() + 0.5 * factor * Vector_3(bb_center, (bb.min)()), + (bb.max)() + 0.5 * factor * Vector_3(bb_center, (bb.max)())); + + PolygonMesh bbox_mesh; + CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], + bbext[4], bbext[5], bbext[6], bbext[7], + bbox_mesh); + + if(triangulate) + CGAL::Polygon_mesh_processing::triangulate_faces(bbox_mesh); + + CGAL::copy_face_graph(bbox_mesh, pmesh, parameters::default_values(), np); } diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 9b172f5b4c16..c5c143399d66 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -163,6 +163,8 @@ CGAL_add_named_parameter(patch_normal_map_t, patch_normal_map, patch_normal_map) CGAL_add_named_parameter(region_primitive_map_t, region_primitive_map, region_primitive_map) CGAL_add_named_parameter(postprocess_regions_t, postprocess_regions, postprocess_regions) CGAL_add_named_parameter(sizing_function_t, sizing_function, sizing_function) +CGAL_add_named_parameter(bbox_scaling_t, bbox_scaling, bbox_scaling) +CGAL_add_named_parameter(triangulate_bbox_t, triangulate_bbox, triangulate_bbox) // List of named parameters that we use in the package 'Surface Mesh Simplification' CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost) From 9f863845c68517827bb6933fbedaed183dbf7ebc Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 12 Feb 2024 16:34:20 +0100 Subject: [PATCH 323/399] add PMP::add_bbox(pmesh) to repair plugin --- .../Polyhedron/Plugins/PMP/AddBboxDialog.ui | 105 ++++++++++++++++++ .../Polyhedron/Plugins/PMP/CMakeLists.txt | 3 +- .../Plugins/PMP/Repair_polyhedron_plugin.cpp | 46 +++++++- 3 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 Polyhedron/demo/Polyhedron/Plugins/PMP/AddBboxDialog.ui diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/AddBboxDialog.ui b/Polyhedron/demo/Polyhedron/Plugins/PMP/AddBboxDialog.ui new file mode 100644 index 000000000000..1de3d65e9ebd --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/AddBboxDialog.ui @@ -0,0 +1,105 @@ + + + AddBboxDialog + + + + 0 + 0 + 413 + 108 + + + + Dialog + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Triangulate bbox + + + + + + + + + Scaling : + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + DoubleEdit + QLineEdit +
    CGAL_double_edit.h
    +
    +
    + + + buttonBox + accepted() + AddBboxDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AddBboxDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
    diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt index 232e6f364d67..412126f18eac 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt @@ -131,14 +131,13 @@ target_link_libraries( PUBLIC scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) -qt6_wrap_ui( repairUI_FILES RemoveNeedlesDialog.ui SelfSnapDialog.ui) +qt6_wrap_ui( repairUI_FILES RemoveNeedlesDialog.ui SelfSnapDialog.ui AddBboxDialog.ui) polyhedron_demo_plugin(repair_polyhedron_plugin Repair_polyhedron_plugin ${repairUI_FILES} KEYWORDS PMP) target_link_libraries(repair_polyhedron_plugin PUBLIC scene_points_with_normal_item scene_surface_mesh_item scene_polygon_soup_item) if(TARGET CGAL::TBB_support) target_link_libraries(repair_polyhedron_plugin PUBLIC CGAL::TBB_support) endif() - if(TARGET CGAL::Eigen3_support) qt6_wrap_ui(isotropicRemeshingUI_FILES Isotropic_remeshing_dialog.ui) polyhedron_demo_plugin(isotropic_remeshing_plugin Isotropic_remeshing_plugin diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index b0ac1f859965..aa54e0679b7e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -25,6 +25,7 @@ #include "ui_RemoveNeedlesDialog.h" #include "ui_SelfSnapDialog.h" +#include "ui_AddBboxDialog.h" #include #include #include @@ -60,6 +61,7 @@ class Polyhedron_demo_repair_polyhedron_plugin : actionAutorefineAndRMSelfIntersections = new QAction(tr("Autorefine and Remove Self-Intersections (Deprecated)"), mw); actionRemoveNeedlesAndCaps = new QAction(tr("Remove Needles And Caps")); actionSnapBorders = new QAction(tr("Snap Boundaries")); + actionAddBbox = new QAction(tr("Add Bounding Box")); actionRemoveIsolatedVertices->setObjectName("actionRemoveIsolatedVertices"); actionRemoveDegenerateFaces->setObjectName("actionRemoveDegenerateFaces"); @@ -73,6 +75,7 @@ class Polyhedron_demo_repair_polyhedron_plugin : actionAutorefineAndRMSelfIntersections->setObjectName("actionAutorefineAndRMSelfIntersections"); actionRemoveNeedlesAndCaps->setObjectName("actionRemoveNeedlesAndCaps"); actionSnapBorders->setObjectName("actionSnapBorders"); + actionAddBbox->setObjectName("actionAddBbox"); actionRemoveDegenerateFaces->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionStitchCloseBorderHalfedges->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); @@ -85,6 +88,7 @@ class Polyhedron_demo_repair_polyhedron_plugin : actionNewAutorefine->setProperty("subMenuName", "Polygon Mesh Processing/Repair"); actionAutorefineAndRMSelfIntersections->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionSnapBorders->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); + actionAddBbox->setProperty("subMenuName", "Polygon Mesh Processing"); autoConnectActions(); } @@ -102,7 +106,8 @@ class Polyhedron_demo_repair_polyhedron_plugin : << actionNewAutorefine << actionAutorefineAndRMSelfIntersections << actionRemoveNeedlesAndCaps - << actionSnapBorders; + << actionSnapBorders + << actionAddBbox; } bool applicable(QAction* action) const @@ -127,6 +132,8 @@ class Polyhedron_demo_repair_polyhedron_plugin : template void on_actionRemoveDegenerateFaces_triggered(Scene_interface::Item_id index); template + void on_actionAddBbox_triggered(Scene_interface::Item_id index); + template void on_actionRemoveSelfIntersections_triggered(Scene_interface::Item_id index); template void on_actionStitchCloseBorderHalfedges_triggered(Scene_interface::Item_id index); @@ -156,6 +163,7 @@ public Q_SLOTS: void on_actionAutorefineAndRMSelfIntersections_triggered(); void on_actionRemoveNeedlesAndCaps_triggered(); void on_actionSnapBorders_triggered(); + void on_actionAddBbox_triggered(); private: QAction* actionRemoveIsolatedVertices; @@ -170,6 +178,7 @@ public Q_SLOTS: QAction* actionAutorefineAndRMSelfIntersections; QAction* actionRemoveNeedlesAndCaps; QAction* actionSnapBorders; + QAction* actionAddBbox; Messages_interface* messages; }; // end Polyhedron_demo_repair_polyhedron_plugin @@ -366,6 +375,41 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionSnapBorders_triggered() sm_item->itemChanged(); } +template +void Polyhedron_demo_repair_polyhedron_plugin::on_actionAddBbox_triggered(Scene_interface::Item_id index) +{ + Item* poly_item = + qobject_cast(scene->item(index)); + if (poly_item) + { + QDialog dialog; + Ui::AddBboxDialog ui; + ui.setupUi(&dialog); + ui.triangulate_bbox->setChecked(true); + ui.bbox_scaling->setValue(1.0); + + if(dialog.exec() != QDialog::Accepted) + return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + const double scaling = ui.bbox_scaling->value(); + CGAL::Polygon_mesh_processing::add_bbox(*poly_item->face_graph(), + CGAL::parameters::bbox_scaling(scaling). + triangulate_bbox(ui.triangulate_bbox->isChecked())); + + poly_item->invalidateOpenGLBuffers(); + Q_EMIT poly_item->itemChanged(); + QApplication::restoreOverrideCursor(); + CGAL::Three::Three::information(tr("Bbox has been added (%1 @%)").arg(scaling)); + } +} + +void Polyhedron_demo_repair_polyhedron_plugin::on_actionAddBbox_triggered() +{ + const Scene_interface::Item_id index = scene->mainSelectionIndex(); + on_actionAddBbox_triggered(index); +} + template void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveDegenerateFaces_triggered(Scene_interface::Item_id index) { From 801d7822c6b795202cdb5ffd85a8c11df8d20c90 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 12 Feb 2024 16:39:54 +0100 Subject: [PATCH 324/399] doc --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 833d22e0103b..b9701de8c03c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -261,11 +261,16 @@ namespace CGAL { } /*! + * \ingroup PkgPolygonMeshProcessingRef + * * adds an axis-aligned bounding box to a polygon mesh. + * * @tparam PolygonMesh a model of `MutableFaceGraph` * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * * @param pmesh a polygon mesh * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * * \cgalNamedParamsBegin * \cgalParamNBegin{bbox_scaling} * \cgalParamDescription{a double used to scale the bounding box. @@ -283,6 +288,8 @@ namespace CGAL { * the types `Point_3`, `Vector_3` and `Iso_cuboid_3`.} * \cgalParamNEnd * \cgalNamedParamsEnd + * + * @see `bbox()` */ template From b48760af26466621138554a538d387aab9de1dfd Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 12 Feb 2024 17:08:46 +0100 Subject: [PATCH 325/399] use do_not_triangulate_faces a NP that already existed before this PR --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 13 ++++++++----- .../Plugins/PMP/Repair_polyhedron_plugin.cpp | 2 +- .../STL_Extension/internal/parameters_interface.h | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index b9701de8c03c..813c6a3ef8e9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -278,9 +278,11 @@ namespace CGAL { * axis-aligned bounding box.} * \cgalParamDefault{1.} * \cgalParamNEnd - * \cgalParamNBegin{triangulate_bbox} - * \cgalParamDescription{a boolean used to specify if the bounding box should be triangulated or not.} - * \cgalParamDefault{true} + * \cgalParamNBegin{do_not_triangulate_faces} + * \cgalParamDescription{a boolean used to specify if the bounding box faces + * should be triangulated or not. + * The default value is `false`, and faces are triangulated.} + * \cgalParamDefault{false} * \cgalParamNEnd * \cgalParamNBegin{geom_traits} * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3`, @@ -306,7 +308,8 @@ namespace CGAL { using Vector_3 = typename GT::Vector_3; double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); - bool triangulate = choose_parameter(get_parameter(np, internal_np::triangulate_bbox), true); + bool dont_triangulate = choose_parameter( + get_parameter(np, internal_np::do_not_triangulate_faces), false); Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); Point_3 bb_center(0.5 * (bb.xmax() + bb.xmin()), @@ -321,7 +324,7 @@ namespace CGAL { bbext[4], bbext[5], bbext[6], bbext[7], bbox_mesh); - if(triangulate) + if(!dont_triangulate) CGAL::Polygon_mesh_processing::triangulate_faces(bbox_mesh); CGAL::copy_face_graph(bbox_mesh, pmesh, diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index aa54e0679b7e..496b998a97ab 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -395,7 +395,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionAddBbox_triggered(Scene_ const double scaling = ui.bbox_scaling->value(); CGAL::Polygon_mesh_processing::add_bbox(*poly_item->face_graph(), CGAL::parameters::bbox_scaling(scaling). - triangulate_bbox(ui.triangulate_bbox->isChecked())); + do_not_triangulate_faces(!ui.triangulate_bbox->isChecked())); poly_item->invalidateOpenGLBuffers(); Q_EMIT poly_item->itemChanged(); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index c5c143399d66..7f84dd628e31 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -164,7 +164,6 @@ CGAL_add_named_parameter(region_primitive_map_t, region_primitive_map, region_pr CGAL_add_named_parameter(postprocess_regions_t, postprocess_regions, postprocess_regions) CGAL_add_named_parameter(sizing_function_t, sizing_function, sizing_function) CGAL_add_named_parameter(bbox_scaling_t, bbox_scaling, bbox_scaling) -CGAL_add_named_parameter(triangulate_bbox_t, triangulate_bbox, triangulate_bbox) // List of named parameters that we use in the package 'Surface Mesh Simplification' CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost) From 6191f7de3c2520135ee7f411f5e084b0b397718f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 13 Feb 2024 10:31:26 +0100 Subject: [PATCH 326/399] use split_face() instead of triangulate_faces() and remove dependency on T2 --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 813c6a3ef8e9..aa80a4b4f0cd 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -325,8 +325,15 @@ namespace CGAL { bbox_mesh); if(!dont_triangulate) - CGAL::Polygon_mesh_processing::triangulate_faces(bbox_mesh); - + { + for (auto h : halfedges(bbox_mesh)) + { + if (is_quad(h, bbox_mesh)) + CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh); + else + CGAL_assertion(is_triangle(h, bbox_mesh)); + } + } CGAL::copy_face_graph(bbox_mesh, pmesh, parameters::default_values(), np); From c23db551f3f75ea8f2dd7339b16b5e6959e79013 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 13 Feb 2024 11:18:59 +0100 Subject: [PATCH 327/399] make bbox really tight when factor is 1. --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index aa80a4b4f0cd..cc95eb174f43 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -307,17 +307,16 @@ namespace CGAL { using Iso_cuboid_3 = typename GT::Iso_cuboid_3; using Vector_3 = typename GT::Vector_3; - double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); - bool dont_triangulate = choose_parameter( + const double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); + const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); - Point_3 bb_center(0.5 * (bb.xmax() + bb.xmin()), - 0.5 * (bb.ymax() + bb.ymin()), - 0.5 * (bb.zmax() + bb.zmin())); - Iso_cuboid_3 bbext( - (bb.min)() + 0.5 * factor * Vector_3(bb_center, (bb.min)()), - (bb.max)() + 0.5 * factor * Vector_3(bb_center, (bb.max)())); + const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); + const Point_3 bb_center = CGAL::midpoint((bb.min)(), (bb.max())); + const Iso_cuboid_3 bbext = (factor == 1.) + ? bb + : Iso_cuboid_3(bb_center + factor * Vector_3(bb_center, (bb.min)()), + bb_center + factor * Vector_3(bb_center, (bb.max)())); PolygonMesh bbox_mesh; CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], From 83e80c91e9a85bf28c5aeb6594e1190750880130 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 13 Feb 2024 13:48:24 +0100 Subject: [PATCH 328/399] doc --- .../CGAL/Polygon_mesh_processing/bbox.h | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index cc95eb174f43..8684fd5c71a9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -284,10 +284,23 @@ namespace CGAL { * The default value is `false`, and faces are triangulated.} * \cgalParamDefault{false} * \cgalParamNEnd + * \cgalParamNBegin{vertex_point_map} + * \cgalParamDescription{a property map associating points to the vertices of `pmesh`} + * \cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits::%vertex_descriptor` + * as key type and `%Point_3` as value type} + * \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`} + * \cgalParamExtra{If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` + * must be available in `PolygonMesh`.} + * \cgalParamNEnd * \cgalParamNBegin{geom_traits} - * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3`, - * the function `Construct_bbox_3 construct_bbox_3_object()`, - * the types `Point_3`, `Vector_3` and `Iso_cuboid_3`.} + * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3` + * and the function `Construct_bbox_3 construct_bbox_3_object()`. + * `Construct_bbox_3` must provide `Bbox_3 operator()(Point_3)` + * where `%Point_3` is the value type of the vertex point map. + * It must also provide the functor `Construct_midpoint_3` and, + * the function `Construct_midpoint_3 construct_midpoint_3_object()`. + * `Construct_midpoint_3` must provide `Point_3 operator()(Point_3, Point_3)`. + * The types `Vector_3` and `Iso_cuboid_3` must also be provided.} * \cgalParamNEnd * \cgalNamedParamsEnd * @@ -312,7 +325,7 @@ namespace CGAL { get_parameter(np, internal_np::do_not_triangulate_faces), false); const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); - const Point_3 bb_center = CGAL::midpoint((bb.min)(), (bb.max())); + const Point_3 bb_center = CGAL::midpoint((bb.min)(), (bb.max)()); const Iso_cuboid_3 bbext = (factor == 1.) ? bb : Iso_cuboid_3(bb_center + factor * Vector_3(bb_center, (bb.min)()), From cb07b0f545b22d12e98250db261cf725a911cf31 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 13 Feb 2024 15:04:43 +0100 Subject: [PATCH 329/399] use midpoint from GT (and add precondition on factor) --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 8684fd5c71a9..b8c2680b26b3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -277,6 +277,7 @@ namespace CGAL { * The default value is 1 and the bounding box is the smallest possible * axis-aligned bounding box.} * \cgalParamDefault{1.} + * \cgalParamPrecondition{`bbox_scaling > 0`} * \cgalParamNEnd * \cgalParamNBegin{do_not_triangulate_faces} * \cgalParamDescription{a boolean used to specify if the bounding box faces @@ -321,11 +322,14 @@ namespace CGAL { using Vector_3 = typename GT::Vector_3; const double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); + CGAL_precondition(factor > 0); const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); - const Point_3 bb_center = CGAL::midpoint((bb.min)(), (bb.max)()); + const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); + + auto midpoint = gt.construct_midpoint_3_object(); + const Point_3 bb_center = midpoint((bb.min)(), (bb.max)()); const Iso_cuboid_3 bbext = (factor == 1.) ? bb : Iso_cuboid_3(bb_center + factor * Vector_3(bb_center, (bb.min)()), From 124f2b1eff2604c1e36e4d71cbef6cbc40210481 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 19 Feb 2024 11:01:34 +0100 Subject: [PATCH 330/399] CHANGES.md --- Installation/CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 09bde261d24b..af2504005a90 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -49,6 +49,8 @@ Release date: October 2023 `CGAL::Polygon_mesh_processing::autorefine_triangle_soup()` that refines a soup of triangles so that no pair of triangles intersects in their interiors. Also added, the function `autorefine()` operating directly on a triangle mesh and updating it using the aforementioned function on a triangle soup. +- Added the function `CGAL::Polygon_mesh_processing::add_bbox()` that enables to add a tight or extended, triangulated or not, + bounding box to a face graph. ### [2D Arrangements](https://doc.cgal.org/6.0/Manual/packages.html#PkgArrangementOnSurface2) - Fixed a bug in the zone construction code applied to arrangements of geodesic arcs on a sphere, From 67b330bd5a51e30df42732a4e6dc6c3eef65ecab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 26 Feb 2024 17:20:22 +0100 Subject: [PATCH 331/399] do no iterate on a container you modify --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index b8c2680b26b3..ed1bc400a401 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -342,12 +342,13 @@ namespace CGAL { if(!dont_triangulate) { - for (auto h : halfedges(bbox_mesh)) + std::size_t k=0; + std::array::halfedge_descriptor, 8> hfaces; + for (auto f : faces(bbox_mesh)) + hfaces[k++]=halfedge(f, bbox_mesh); + for (auto h : hfaces) { - if (is_quad(h, bbox_mesh)) - CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh); - else - CGAL_assertion(is_triangle(h, bbox_mesh)); + CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh); } } CGAL::copy_face_graph(bbox_mesh, pmesh, From 272beb678a007f4cd8fdf5c57ab7a26db77bb528 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 4 Mar 2024 16:08:10 +0100 Subject: [PATCH 332/399] move scaling to CGAL::Bbox_3 --- Kernel_23/include/CGAL/Bbox_3.h | 20 +++++++++++++++ .../CGAL/Polygon_mesh_processing/bbox.h | 25 +++++++++++-------- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index b5bb3640800c..7e8a86eec730 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -77,6 +77,7 @@ class Bbox_3 Bbox_3& operator+=(const Bbox_3& b); void dilate(int dist); + void scale(double factor); }; inline @@ -200,6 +201,25 @@ Bbox_3::dilate(int dist) rep[5] = float_advance(rep[5],dist); } +inline +void +Bbox_3::scale(double factor) +{ + CGAL_precondition(factor > 0); + + if (factor == 1.) + return; + + std::array center = { (xmin() + xmax()) * 0.5, + (ymin() + ymax()) * 0.5, + (zmin() + zmax()) * 0.5 }; + rep[0] = center[0] + factor * (xmin() - center[0]); + rep[1] = center[1] + factor * (ymin() - center[1]); + rep[2] = center[2] + factor * (zmin() - center[2]); + rep[3] = center[0] + factor * (xmax() - center[0]); + rep[4] = center[1] + factor * (ymax() - center[1]); + rep[5] = center[2] + factor * (zmax() - center[2]); +} inline bool diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index b8c2680b26b3..5660a7cfdd5e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -58,6 +58,14 @@ namespace CGAL { * `Construct_bbox_3` must provide the functor `Bbox_3 operator()(Point_3)` * where `%Point_3` is the value type of the vertex point map.} * \cgalParamNEnd + * + * \cgalParamNBegin{bbox_scaling} + * \cgalParamDescription{a double used to scale the bounding box. + * The default value is 1 and the bounding box is the smallest possible + * axis-aligned bounding box.} + * \cgalParamDefault{1.} + * \cgalParamPrecondition{`bbox_scaling > 0`} + * \cgalParamNEnd * \cgalNamedParamsEnd * * @see `vertex_bbox()` @@ -79,6 +87,9 @@ namespace CGAL { GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object(); + const double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); + CGAL_precondition(factor > 0); + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; CGAL::Bbox_3 bb; @@ -86,6 +97,9 @@ namespace CGAL { { bb += get_bbox( get(vpm, v) ); } + if (factor != 1.) + bb.scale(factor); + return bb; } @@ -321,19 +335,10 @@ namespace CGAL { using Iso_cuboid_3 = typename GT::Iso_cuboid_3; using Vector_3 = typename GT::Vector_3; - const double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); - CGAL_precondition(factor > 0); const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); - - auto midpoint = gt.construct_midpoint_3_object(); - const Point_3 bb_center = midpoint((bb.min)(), (bb.max)()); - const Iso_cuboid_3 bbext = (factor == 1.) - ? bb - : Iso_cuboid_3(bb_center + factor * Vector_3(bb_center, (bb.min)()), - bb_center + factor * Vector_3(bb_center, (bb.max)())); + const Iso_cuboid_3 bbext(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); PolygonMesh bbox_mesh; CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], From 3ceaaccfa1bac58ccad65d89e204bf2596c00337 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 4 Mar 2024 16:09:40 +0100 Subject: [PATCH 333/399] document Bbox_3::scale(factor) --- Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h index f44a44e48129..98c55a313666 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h @@ -115,6 +115,12 @@ Bbox_3& operator+=(const Bbox_3 &c); dilates the bounding box by a specified number of ULP. */ void dilate(int dist); + +/*! +scales the bounding box by a factor, while keeping its center fixed. +*/ +void scale(double factor); + /// @} }; /* end Bbox_3 */ From 685f6e7f84e27c317be5d07d4aa85c47c9b2435f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 4 Mar 2024 17:04:06 +0100 Subject: [PATCH 334/399] create an overload of CGAL::make_hexahedron for Iso_cuboid_3 --- BGL/include/CGAL/boost/graph/generators.h | 16 ++++++++++++++++ .../include/CGAL/Polygon_mesh_processing/bbox.h | 7 +------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index a4e91f177fb0..842cc1dfdfe2 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -348,6 +348,22 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, return next(next(hb, g), g); } +/** + * \ingroup PkgBGLHelperFct + * \tparam IsoCuboid model of `IsoCuboid_3` + * \brief creates an isolated hexahedron + * equivalent to `c`, and adds it to the graph `g`. + * \returns the halfedge that has the target vertex associated with `c.min()`, + * in the bottom face of the cuboid. + **/ +template +typename boost::graph_traits::halfedge_descriptor +make_hexahedron(const IsoCuboid& c, Graph& g) +{ + return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], + c[4], c[5], c[6], c[7], g); +} + /** * \ingroup PkgBGLHelperFct * \brief creates an isolated tetrahedron diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 5660a7cfdd5e..015265a48bd7 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -331,18 +331,13 @@ namespace CGAL { using GT = typename GetGeomTraits::type; GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); - using Point_3 = typename GT::Point_3; using Iso_cuboid_3 = typename GT::Iso_cuboid_3; - using Vector_3 = typename GT::Vector_3; const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - const Iso_cuboid_3 bbext(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); - PolygonMesh bbox_mesh; - CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], - bbext[4], bbext[5], bbext[6], bbext[7], + CGAL::make_hexahedron(Iso_cuboid_3(bbox(pmesh, np)), bbox_mesh); if(!dont_triangulate) From 1fc30afde75f56a6fa1fb6d46ffaeb0535e6d7a0 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 4 Mar 2024 17:05:08 +0100 Subject: [PATCH 335/399] doc simplified (similar to most functions of PMP) --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 015265a48bd7..753a9440f102 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -308,14 +308,7 @@ namespace CGAL { * must be available in `PolygonMesh`.} * \cgalParamNEnd * \cgalParamNBegin{geom_traits} - * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3` - * and the function `Construct_bbox_3 construct_bbox_3_object()`. - * `Construct_bbox_3` must provide `Bbox_3 operator()(Point_3)` - * where `%Point_3` is the value type of the vertex point map. - * It must also provide the functor `Construct_midpoint_3` and, - * the function `Construct_midpoint_3 construct_midpoint_3_object()`. - * `Construct_midpoint_3` must provide `Point_3 operator()(Point_3, Point_3)`. - * The types `Vector_3` and `Iso_cuboid_3` must also be provided.} + * \cgalParamDescription{an instance of a geometric traits class model of `Kernel`.} * \cgalParamNEnd * \cgalNamedParamsEnd * From 6407f852e60b2f6e1e9b292d829236e27f9c224e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Mar 2024 09:47:16 +0100 Subject: [PATCH 336/399] add scale(factor) to bbox_2 and uniformize implementation with bbox_3 --- Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h | 5 +++++ Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h | 2 +- Kernel_23/include/CGAL/Bbox_2.h | 20 ++++++++++++++++++++ Kernel_23/include/CGAL/Bbox_3.h | 19 +++++++++++-------- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h index 1905d3367034..f713671c9ad9 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h @@ -102,6 +102,11 @@ dilates the bounding box by a specified number of ULP. */ void dilate(int dist); +/*! +scales the bounding box by `factor`, while keeping its center fixed. +*/ +void scale(double factor); + /// @} }; /* end Bbox_2 */ diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h index 98c55a313666..9037907b8389 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h @@ -117,7 +117,7 @@ dilates the bounding box by a specified number of ULP. void dilate(int dist); /*! -scales the bounding box by a factor, while keeping its center fixed. +scales the bounding box by `factor`, while keeping its center fixed. */ void scale(double factor); diff --git a/Kernel_23/include/CGAL/Bbox_2.h b/Kernel_23/include/CGAL/Bbox_2.h index 57e482e8b0c8..da67fe432a36 100644 --- a/Kernel_23/include/CGAL/Bbox_2.h +++ b/Kernel_23/include/CGAL/Bbox_2.h @@ -71,6 +71,7 @@ class Bbox_2 inline Bbox_2& operator+=(const Bbox_2 &b); inline void dilate(int dist); + inline void scale(double factor); }; inline @@ -170,6 +171,25 @@ Bbox_2::dilate(int dist) rep[3] = float_advance(rep[3],dist); } +inline +void +Bbox_2::scale(double factor) +{ + CGAL_precondition(factor > 0); + + if(factor == 1.) + return; + + std::array center = { (xmin() + xmax()) * 0.5, + (ymin() + ymax()) * 0.5 }; + std::array half_width = { (xmax() - xmin()) * 0.5, + (ymax() - ymin()) * 0.5 }; + rep[0] = center[0] - factor * half_width[0]; + rep[1] = center[1] - factor * half_width[1]; + rep[2] = center[0] + factor * half_width[0]; + rep[3] = center[1] + factor * half_width[1]; +} + inline bool do_overlap(const Bbox_2 &bb1, const Bbox_2 &bb2) diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index 7e8a86eec730..978b627522f9 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -76,8 +76,8 @@ class Bbox_3 Bbox_3 operator+(const Bbox_3& b) const; Bbox_3& operator+=(const Bbox_3& b); - void dilate(int dist); - void scale(double factor); + inline void dilate(int dist); + inline void scale(double factor); }; inline @@ -213,12 +213,15 @@ Bbox_3::scale(double factor) std::array center = { (xmin() + xmax()) * 0.5, (ymin() + ymax()) * 0.5, (zmin() + zmax()) * 0.5 }; - rep[0] = center[0] + factor * (xmin() - center[0]); - rep[1] = center[1] + factor * (ymin() - center[1]); - rep[2] = center[2] + factor * (zmin() - center[2]); - rep[3] = center[0] + factor * (xmax() - center[0]); - rep[4] = center[1] + factor * (ymax() - center[1]); - rep[5] = center[2] + factor * (zmax() - center[2]); + std::array half_width = { (xmax() - xmin()) * 0.5, + (ymax() - ymin()) * 0.5, + (zmax() - zmin()) * 0.5 }; + rep[0] = center[0] - factor * half_width[0]; + rep[1] = center[1] - factor * half_width[1]; + rep[2] = center[2] - factor * half_width[2]; + rep[3] = center[0] + factor * half_width[0]; + rep[4] = center[1] + factor * half_width[1]; + rep[5] = center[2] + factor * half_width[2]; } inline From 2d288803b9caab534d5adcb93bc96224ab1f9748 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Mar 2024 11:25:01 +0100 Subject: [PATCH 337/399] doc precondition --- Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h | 1 + Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h index f713671c9ad9..600314c0330e 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h @@ -104,6 +104,7 @@ void dilate(int dist); /*! scales the bounding box by `factor`, while keeping its center fixed. +\pre `factor > 0` */ void scale(double factor); diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h index 9037907b8389..734f79bc76e4 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h @@ -118,6 +118,7 @@ void dilate(int dist); /*! scales the bounding box by `factor`, while keeping its center fixed. +\pre `factor > 0` */ void scale(double factor); From 78872aca27ae283a50734ddcb5ae0b5a0df4b8bd Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Mar 2024 11:26:01 +0100 Subject: [PATCH 338/399] move NP do_not_triangulate to make_hexahedron(isocuboid) and fix nb of faces of hexahedron from 8 to 6 --- BGL/include/CGAL/boost/graph/generators.h | 71 +++++++++++++++++-- .../CGAL/Polygon_mesh_processing/bbox.h | 24 ++----- 2 files changed, 69 insertions(+), 26 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 842cc1dfdfe2..0a4da951412f 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -19,14 +19,19 @@ #include #include +#include +#include +#include + #include #include #include +#include namespace CGAL { namespace Euler { -// Some forward declaration to break the helpers.h > generators.h > Euler_operations.h cycle +// Some forward declarations to break the helpers.h > generators.h > Euler_operations.h cycle template< typename Graph> void fill_hole(typename boost::graph_traits::halfedge_descriptor h, Graph& g); @@ -35,6 +40,12 @@ template typename boost::graph_traits::face_descriptor add_face(const VertexRange& vr, Graph& g); +template +typename boost::graph_traits::halfedge_descriptor +split_face(typename boost::graph_traits::halfedge_descriptor h1, + typename boost::graph_traits::halfedge_descriptor h2, + Graph& g); + } // namespace Euler namespace internal { @@ -350,18 +361,66 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, /** * \ingroup PkgBGLHelperFct - * \tparam IsoCuboid model of `IsoCuboid_3` * \brief creates an isolated hexahedron * equivalent to `c`, and adds it to the graph `g`. * \returns the halfedge that has the target vertex associated with `c.min()`, + * aligned with axis, * in the bottom face of the cuboid. + * + * \tparam IsoCuboid a model of `IsoCuboid_3` + * \tparam Graph a model of `MutableFaceGraph` + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * \param c the `IsoCuboid_3` to be used to create the hexahedron + * \param g the graph in which the hexahedron will be created + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" + * among the ones listed below + * \cgalNamedParamsBegin + * \cgalParamNBegin{do_not_triangulate_faces} + * \cgalParamDescription{a boolean used to specify if the bounding box faces + * should be triangulated or not. + * The default value is `true`, and faces are not triangulated.} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd **/ -template +template typename boost::graph_traits::halfedge_descriptor -make_hexahedron(const IsoCuboid& c, Graph& g) +make_hexahedron(const IsoCuboid& c, + Graph& g, + const NamedParameters& np = parameters::default_values()) { - return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], - c[4], c[5], c[6], c[7], g); + using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; + + const bool dont_triangulate = parameters::choose_parameter( + parameters::get_parameter(np, internal_np::do_not_triangulate_faces), true); + + if(dont_triangulate) + return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], + c[4], c[5], c[6], c[7], g); + + Graph hexahedron; + halfedge_descriptor res = CGAL::make_hexahedron(c[0], c[1], c[2], c[3], + c[4], c[5], c[6], c[7], + hexahedron); + std::size_t k = 0; + std::array hfaces; + for (auto f : faces(hexahedron)) + hfaces[k++] = halfedge(f, hexahedron); + for (halfedge_descriptor h : hfaces) + { + halfedge_descriptor h2 = next(next(h, hexahedron), hexahedron); + CGAL::Euler::split_face(h, h2, hexahedron); + } + + std::unordered_map h2h; + CGAL::copy_face_graph(hexahedron, g, + parameters::halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end())), + np); + + return h2h.at(res); } /** diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 2182cd41d8bd..ece5825fa295 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -296,8 +295,8 @@ namespace CGAL { * \cgalParamNBegin{do_not_triangulate_faces} * \cgalParamDescription{a boolean used to specify if the bounding box faces * should be triangulated or not. - * The default value is `false`, and faces are triangulated.} - * \cgalParamDefault{false} + * The default value is `true`, and faces are not triangulated.} + * \cgalParamDefault{true} * \cgalParamNEnd * \cgalParamNBegin{vertex_point_map} * \cgalParamDescription{a property map associating points to the vertices of `pmesh`} @@ -323,27 +322,12 @@ namespace CGAL { using parameters::get_parameter; using GT = typename GetGeomTraits::type; - GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); using Iso_cuboid_3 = typename GT::Iso_cuboid_3; - const bool dont_triangulate = choose_parameter( - get_parameter(np, internal_np::do_not_triangulate_faces), false); - PolygonMesh bbox_mesh; CGAL::make_hexahedron(Iso_cuboid_3(bbox(pmesh, np)), - bbox_mesh); - - if(!dont_triangulate) - { - std::size_t k=0; - std::array::halfedge_descriptor, 8> hfaces; - for (auto f : faces(bbox_mesh)) - hfaces[k++]=halfedge(f, bbox_mesh); - for (auto h : hfaces) - { - CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh); - } - } + bbox_mesh, + np); CGAL::copy_face_graph(bbox_mesh, pmesh, parameters::default_values(), np); From a4d6523f4a93141adb25fb8ae5f946c14851103b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Mar 2024 14:36:52 +0000 Subject: [PATCH 339/399] add missing forward declaration for copy_face_graph() --- BGL/include/CGAL/boost/graph/generators.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 0a4da951412f..25de662748ed 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -48,6 +48,12 @@ split_face(typename boost::graph_traits::halfedge_descriptor h1, } // namespace Euler +template +void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, + const NamedParameters1& np1, + const NamedParameters2& np2); + namespace internal { template From c21fc4f2384b4343ce588bc7fd4d3c60fbe8b64f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 10:42:53 +0100 Subject: [PATCH 340/399] remove circular dependency and corresponding fwd declarations include in helpers.h was introduced by 05285920114e53e1347cd980a91d4480963337b2 in 2019 for backward compatibility, it can now be removed --- BGL/include/CGAL/boost/graph/generators.h | 24 ------------------- BGL/include/CGAL/boost/graph/helpers.h | 3 --- Convex_hull_3/include/CGAL/convex_hull_3.h | 1 + .../oriented_bounding_box.h | 1 + .../Plugins/PCA/Basic_generator_plugin.cpp | 1 + .../Plugins/PCA/Clipping_box_plugin.cpp | 1 + .../Plugins/PCA/Create_bbox_mesh_plugin.cpp | 2 ++ .../Plugins/PCA/Edit_box_plugin.cpp | 1 + .../Polyhedron/Plugins/PCA/Pca_plugin.cpp | 1 + 9 files changed, 8 insertions(+), 27 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 25de662748ed..638cebe54ef4 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -29,30 +29,6 @@ #include namespace CGAL { -namespace Euler { - -// Some forward declarations to break the helpers.h > generators.h > Euler_operations.h cycle -template< typename Graph> -void fill_hole(typename boost::graph_traits::halfedge_descriptor h, - Graph& g); - -template -typename boost::graph_traits::face_descriptor add_face(const VertexRange& vr, - Graph& g); - -template -typename boost::graph_traits::halfedge_descriptor -split_face(typename boost::graph_traits::halfedge_descriptor h1, - typename boost::graph_traits::halfedge_descriptor h2, - Graph& g); - -} // namespace Euler - -template -void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, - const NamedParameters1& np1, - const NamedParameters2& np2); namespace internal { diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 43016f9889fb..32b99ba397d3 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -1081,8 +1081,5 @@ int halfedge_index_in_face(typename boost::graph_traits::halfedge_descrip } // namespace CGAL -// Here at the bottom because helpers.h must include generators (for backward compatibility reasons), -// and Euler_operations.h needs helpers.h -#include #endif // CGAL_BOOST_GRAPH_HELPERS_H diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 51555a5d57b0..eac141440733 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -33,6 +33,7 @@ #include #include +#include #include #include #include diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h index d64b73e699bf..c867c1908148 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp index 51355a07b5fd..7c4b491ce0b2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp index aa32c5005941..079100d1fb6f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "Selection_visualizer.h" #include "Scene_plane_item.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp index ee591ddc04ae..c227227f1bde 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp @@ -3,6 +3,8 @@ #include #include +#include + #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp index 77569a7b810b..dc96135c003d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp index 2fcecd22abd4..66331a4a6d24 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "Kernel_type.h" #include From ff3db1e0d700e4302e3b76aadddf2380f63c0436 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 11:11:27 +0100 Subject: [PATCH 341/399] doc suggestions from code review Co-authored-by: Mael --- BGL/include/CGAL/boost/graph/generators.h | 6 +++--- .../include/CGAL/Polygon_mesh_processing/bbox.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 638cebe54ef4..6d014b61185f 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -353,13 +353,13 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, * \tparam Graph a model of `MutableFaceGraph` * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * - * \param c the `IsoCuboid_3` to be used to create the hexahedron - * \param g the graph in which the hexahedron will be created + * \param c the iso-cuboid describing the geometry of the hexahedron + * \param g the graph to which the hexahedron will be appended * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" * among the ones listed below * \cgalNamedParamsBegin * \cgalParamNBegin{do_not_triangulate_faces} - * \cgalParamDescription{a boolean used to specify if the bounding box faces + * \cgalParamDescription{a Boolean used to specify whether the hexadron's faces * should be triangulated or not. * The default value is `true`, and faces are not triangulated.} * \cgalParamDefault{true} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index ece5825fa295..cce3346d8357 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -293,7 +293,7 @@ namespace CGAL { * \cgalParamPrecondition{`bbox_scaling > 0`} * \cgalParamNEnd * \cgalParamNBegin{do_not_triangulate_faces} - * \cgalParamDescription{a boolean used to specify if the bounding box faces + * \cgalParamDescription{a Boolean used to specify whether the bounding box's faces * should be triangulated or not. * The default value is `true`, and faces are not triangulated.} * \cgalParamDefault{true} From 75160fc24b9ea5558443412be61c280aa0925d62 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 11:52:26 +0100 Subject: [PATCH 342/399] reduce number of operations in bbox scaling --- Kernel_23/include/CGAL/Bbox_2.h | 4 ++-- Kernel_23/include/CGAL/Bbox_3.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Kernel_23/include/CGAL/Bbox_2.h b/Kernel_23/include/CGAL/Bbox_2.h index da67fe432a36..0222cf947782 100644 --- a/Kernel_23/include/CGAL/Bbox_2.h +++ b/Kernel_23/include/CGAL/Bbox_2.h @@ -180,10 +180,10 @@ Bbox_2::scale(double factor) if(factor == 1.) return; - std::array center = { (xmin() + xmax()) * 0.5, - (ymin() + ymax()) * 0.5 }; std::array half_width = { (xmax() - xmin()) * 0.5, (ymax() - ymin()) * 0.5 }; + std::array center = { xmin() + half_width[0], + ymin() + half_width[1] }; rep[0] = center[0] - factor * half_width[0]; rep[1] = center[1] - factor * half_width[1]; rep[2] = center[0] + factor * half_width[0]; diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index 978b627522f9..dc750e4d0e0e 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -210,12 +210,12 @@ Bbox_3::scale(double factor) if (factor == 1.) return; - std::array center = { (xmin() + xmax()) * 0.5, - (ymin() + ymax()) * 0.5, - (zmin() + zmax()) * 0.5 }; std::array half_width = { (xmax() - xmin()) * 0.5, (ymax() - ymin()) * 0.5, (zmax() - zmin()) * 0.5 }; + std::array center = { xmin() + half_width[0], + ymin() + half_width[1], + zmin() + half_width[2] }; rep[0] = center[0] - factor * half_width[0]; rep[1] = center[1] - factor * half_width[1]; rep[2] = center[2] - factor * half_width[2]; From 4555c3e0f7fee456b39e6b28f38eaebf18b6383f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 11:52:42 +0100 Subject: [PATCH 343/399] use make_hexahedron(Iso_cuboid_3) --- .../demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp index c227227f1bde..c624727032e8 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp @@ -166,7 +166,7 @@ bbox(bool extended) Scene_item* item; EPICK::Iso_cuboid_3 ic(bbox); SMesh* p = new SMesh; - CGAL::make_hexahedron(ic[0], ic[1], ic[2], ic[3], ic[4], ic[5], ic[6], ic[7], *p); + CGAL::make_hexahedron(ic, *p); item = new Scene_surface_mesh_item(p); item->setName(name + (extended ? " (Extended Bbox)" : " (Bbox)")); From 6b75fea902cf1c4844170bd20d7cbaaa9f17b3df Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 14:48:01 +0100 Subject: [PATCH 344/399] move triangulation step into make_hexahedron(8 points) --- BGL/doc/BGL/Doxyfile.in | 1 + BGL/include/CGAL/boost/graph/generators.h | 90 ++++++++++++++--------- 2 files changed, 57 insertions(+), 34 deletions(-) diff --git a/BGL/doc/BGL/Doxyfile.in b/BGL/doc/BGL/Doxyfile.in index 72d3e79168c8..524cd9e77372 100644 --- a/BGL/doc/BGL/Doxyfile.in +++ b/BGL/doc/BGL/Doxyfile.in @@ -34,6 +34,7 @@ ALIASES += "bgllink{1}= EXTRACT_ALL=NO HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES +WARN_IF_UNDOCUMENTED = NO # macros to be used inside the code ALIASES += "cgalAssociatedTypesBegin=
    Associated Types
    " diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 6d014b61185f..b66b00390fcd 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -26,7 +26,6 @@ #include #include #include -#include namespace CGAL { @@ -285,12 +284,30 @@ make_quad(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) * with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`. * \image html hexahedron.png * \image latex hexahedron.png - * \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, `p2`, and `p3`. + * \returns the halfedge that has the target vertex associated with `p0`, + * in the face with the vertices with the points `p0`, `p1`, `p2`, and `p3` + * (or `p0`, `p2` and `p3` when `do_not_triangulate` is set to `false`). + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" + * among the ones listed below + * \cgalNamedParamsBegin + * \cgalParamNBegin{do_not_triangulate_faces} + * \cgalParamDescription{a Boolean used to specify whether the hexadron's faces + * should be triangulated or not. + * The default value is `true`, and faces are not triangulated.} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd **/ -template +template typename boost::graph_traits::halfedge_descriptor make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, - const P& p4, const P& p5, const P& p6, const P& p7, Graph& g) + const P& p4, const P& p5, const P& p6, const P& p7, + Graph& g, + const NamedParameters& np = parameters::default_values()) { typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; @@ -299,6 +316,9 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, typedef typename boost::property_map::type Point_property_map; Point_property_map ppmap = get(CGAL::vertex_point, g); + const bool triangulate = !parameters::choose_parameter( + parameters::get_parameter(np, internal_np::do_not_triangulate_faces), true); + vertex_descriptor v0, v1, v2, v3, v4, v5, v6, v7; v0 = add_vertex(g); v1 = add_vertex(g); @@ -319,6 +339,14 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, halfedge_descriptor ht = internal::make_quad(v4, v5, v6, v7, g); halfedge_descriptor hb = prev(internal::make_quad(v0, v3, v2, v1, g), g); + + std::array he_faces; + if(triangulate) + { + he_faces[0] = hb; + he_faces[1] = ht; + } + for(int i=0; i <4; ++i) { halfedge_descriptor h = halfedge(add_edge(g), g); @@ -335,9 +363,20 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, for(int i=0; i <4; ++i) { Euler::fill_hole(opposite(hb, g), g); + if(triangulate) + he_faces[i+2] = opposite(hb, g); hb = next(hb, g); } + if(triangulate) + { + for (halfedge_descriptor hi : he_faces) + { + halfedge_descriptor nnhi = next(next(hi, g), g); + Euler::split_face(hi, nnhi, g); + } + } + return next(next(hb, g), g); } @@ -346,7 +385,7 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, * \brief creates an isolated hexahedron * equivalent to `c`, and adds it to the graph `g`. * \returns the halfedge that has the target vertex associated with `c.min()`, - * aligned with axis, + * aligned with x-axis, * in the bottom face of the cuboid. * * \tparam IsoCuboid a model of `IsoCuboid_3` @@ -364,6 +403,9 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, * The default value is `true`, and faces are not triangulated.} * \cgalParamDefault{true} * \cgalParamNEnd + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class model of `Kernel`.} + * \cgalParamNEnd * \cgalNamedParamsEnd **/ template::halfedge_descriptor; - - const bool dont_triangulate = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::do_not_triangulate_faces), true); - - if(dont_triangulate) - return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], - c[4], c[5], c[6], c[7], g); - - Graph hexahedron; - halfedge_descriptor res = CGAL::make_hexahedron(c[0], c[1], c[2], c[3], - c[4], c[5], c[6], c[7], - hexahedron); - std::size_t k = 0; - std::array hfaces; - for (auto f : faces(hexahedron)) - hfaces[k++] = halfedge(f, hexahedron); - for (halfedge_descriptor h : hfaces) - { - halfedge_descriptor h2 = next(next(h, hexahedron), hexahedron); - CGAL::Euler::split_face(h, h2, hexahedron); - } - - std::unordered_map h2h; - CGAL::copy_face_graph(hexahedron, g, - parameters::halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end())), - np); - - return h2h.at(res); + using GT = typename GetGeomTraits::type; + GT gt = parameters::choose_parameter( + parameters::get_parameter(np, internal_np::geom_traits)); + typename GT::Construct_vertex_3 v = gt.construct_vertex_3_object(); + + return CGAL::make_hexahedron(v(c, 0), v(c, 1), v(c, 2), v(c, 3), + v(c, 4), v(c, 5), v(c, 6), v(c, 7), + g, + np); } /** From 15310c93ef5bedd233da6dc990e043c376408956 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 14:48:31 +0100 Subject: [PATCH 345/399] copy_face_graph is not needed anymore --- .../CGAL/Polygon_mesh_processing/bbox.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index cce3346d8357..d094ab83d66b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -322,15 +321,15 @@ namespace CGAL { using parameters::get_parameter; using GT = typename GetGeomTraits::type; - using Iso_cuboid_3 = typename GT::Iso_cuboid_3; - - PolygonMesh bbox_mesh; - CGAL::make_hexahedron(Iso_cuboid_3(bbox(pmesh, np)), - bbox_mesh, - np); - CGAL::copy_face_graph(bbox_mesh, pmesh, - parameters::default_values(), - np); + using P = typename GT::Point_3; + GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); + typename GT::Construct_iso_cuboid_3 + iso_cuboid = gt.construct_iso_cuboid_3_object(); + + const CGAL::Bbox_3 bb = bbox(pmesh, np); + CGAL::make_hexahedron(iso_cuboid(P(bb.xmin(), bb.ymin(), bb.zmin()), + P(bb.xmax(), bb.ymax(), bb.zmax())), + pmesh, np); } } } From bb2335a86e7e89688e7a4dee93ec89e9ce5868f6 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 14:50:32 +0100 Subject: [PATCH 346/399] early exit already is in Bbox_3::scale() so we can remove this condition --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index d094ab83d66b..dd19ef4c6852 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -95,8 +95,7 @@ namespace CGAL { { bb += get_bbox( get(vpm, v) ); } - if (factor != 1.) - bb.scale(factor); + bb.scale(factor); return bb; } From 7ca00f90ef37ac77bb44f47cedd63b22cee0124e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 16:12:53 +0100 Subject: [PATCH 347/399] add missing includes (not included by helpers.h anymore) --- Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h | 1 + Weights/include/CGAL/Weights/cotangent_weights.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h b/Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h index a20a6643f501..d222d7411003 100644 --- a/Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h +++ b/Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h @@ -27,6 +27,7 @@ #include #include #include +#include #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 29 diff --git a/Weights/include/CGAL/Weights/cotangent_weights.h b/Weights/include/CGAL/Weights/cotangent_weights.h index dc070c5c493e..7bd3f706a4b7 100644 --- a/Weights/include/CGAL/Weights/cotangent_weights.h +++ b/Weights/include/CGAL/Weights/cotangent_weights.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include From a02ce9ea21f2d1fd1e865cce0993a70acb4d6a3b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 7 Mar 2024 09:36:59 +0100 Subject: [PATCH 348/399] fix dependencies by removing Random_numbers where it's not needed anymore --- .../Advancing_front_surface_reconstruction/dependencies | 1 - .../package_info/Barycentric_coordinates_2/dependencies | 1 - Combinatorial_map/package_info/Combinatorial_map/dependencies | 1 - .../package_info/Convex_decomposition_3/dependencies | 1 - Heat_method_3/package_info/Heat_method_3/dependencies | 1 - .../package_info/Linear_cell_complex/dependencies | 1 - Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies | 1 - Nef_3/package_info/Nef_3/dependencies | 1 - .../package_info/Polygonal_surface_reconstruction/dependencies | 1 - Polyhedron/package_info/Polyhedron/dependencies | 1 - Ridges_3/package_info/Ridges_3/dependencies | 1 - SMDS_3/package_info/SMDS_3/dependencies | 1 - Skin_surface_3/package_info/Skin_surface_3/dependencies | 1 - .../package_info/Straight_skeleton_extrusion_2/dependencies | 1 - .../package_info/Subdivision_method_3/dependencies | 1 - Surface_mesh/package_info/Surface_mesh/dependencies | 1 - .../package_info/Surface_mesh_approximation/dependencies | 1 - .../package_info/Surface_mesh_deformation/dependencies | 1 - .../package_info/Surface_mesh_parameterization/dependencies | 1 - .../package_info/Surface_mesh_shortest_path/dependencies | 1 - .../package_info/Surface_mesh_simplification/dependencies | 1 - .../package_info/Tetrahedral_remeshing/dependencies | 1 - Triangulation_3/package_info/Triangulation_3/dependencies | 1 - Weights/package_info/Weights/dependencies | 1 - 24 files changed, 24 deletions(-) diff --git a/Advancing_front_surface_reconstruction/package_info/Advancing_front_surface_reconstruction/dependencies b/Advancing_front_surface_reconstruction/package_info/Advancing_front_surface_reconstruction/dependencies index fffe4db3c74c..0c34be3d210c 100644 --- a/Advancing_front_surface_reconstruction/package_info/Advancing_front_surface_reconstruction/dependencies +++ b/Advancing_front_surface_reconstruction/package_info/Advancing_front_surface_reconstruction/dependencies @@ -22,7 +22,6 @@ Number_types Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies b/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies index ee1e1d6538ae..1c390ed84981 100644 --- a/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies +++ b/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies @@ -20,7 +20,6 @@ Number_types Polygon Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Combinatorial_map/package_info/Combinatorial_map/dependencies b/Combinatorial_map/package_info/Combinatorial_map/dependencies index 279a01a72ae2..1a0b63927fdf 100644 --- a/Combinatorial_map/package_info/Combinatorial_map/dependencies +++ b/Combinatorial_map/package_info/Combinatorial_map/dependencies @@ -19,6 +19,5 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support diff --git a/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies b/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies index fa1556add87e..35f171409060 100644 --- a/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies +++ b/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies @@ -27,7 +27,6 @@ Polygon Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Heat_method_3/package_info/Heat_method_3/dependencies b/Heat_method_3/package_info/Heat_method_3/dependencies index 42f0881808eb..fe8fe1b0af76 100644 --- a/Heat_method_3/package_info/Heat_method_3/dependencies +++ b/Heat_method_3/package_info/Heat_method_3/dependencies @@ -12,7 +12,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Stream_support diff --git a/Linear_cell_complex/package_info/Linear_cell_complex/dependencies b/Linear_cell_complex/package_info/Linear_cell_complex/dependencies index 53e5ce3f1530..4a46d8312a82 100644 --- a/Linear_cell_complex/package_info/Linear_cell_complex/dependencies +++ b/Linear_cell_complex/package_info/Linear_cell_complex/dependencies @@ -23,6 +23,5 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support diff --git a/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies b/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies index e2123abc9c96..9b6178b9511d 100644 --- a/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies +++ b/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies @@ -28,7 +28,6 @@ Polygon Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Nef_3/package_info/Nef_3/dependencies b/Nef_3/package_info/Nef_3/dependencies index 7fec88e23734..52c69d704bf0 100644 --- a/Nef_3/package_info/Nef_3/dependencies +++ b/Nef_3/package_info/Nef_3/dependencies @@ -28,7 +28,6 @@ Polygon_mesh_processing Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies b/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies index 650e4a65343e..dc7691e64d97 100644 --- a/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies +++ b/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies @@ -27,7 +27,6 @@ Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Spatial_searching diff --git a/Polyhedron/package_info/Polyhedron/dependencies b/Polyhedron/package_info/Polyhedron/dependencies index 53bd7918c4d8..e2ff41c5601e 100644 --- a/Polyhedron/package_info/Polyhedron/dependencies +++ b/Polyhedron/package_info/Polyhedron/dependencies @@ -19,6 +19,5 @@ Number_types Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Stream_support diff --git a/Ridges_3/package_info/Ridges_3/dependencies b/Ridges_3/package_info/Ridges_3/dependencies index 3d5486b85be8..f4b40909932d 100644 --- a/Ridges_3/package_info/Ridges_3/dependencies +++ b/Ridges_3/package_info/Ridges_3/dependencies @@ -9,7 +9,6 @@ Number_types Principal_component_analysis_LGPL Profiling_tools Property_map -Random_numbers Ridges_3 STL_Extension Stream_support diff --git a/SMDS_3/package_info/SMDS_3/dependencies b/SMDS_3/package_info/SMDS_3/dependencies index bebf22165bb0..2d0c3068c4a6 100644 --- a/SMDS_3/package_info/SMDS_3/dependencies +++ b/SMDS_3/package_info/SMDS_3/dependencies @@ -19,7 +19,6 @@ Number_types Polygon_mesh_processing Profiling_tools Property_map -Random_numbers SMDS_3 STL_Extension Spatial_sorting diff --git a/Skin_surface_3/package_info/Skin_surface_3/dependencies b/Skin_surface_3/package_info/Skin_surface_3/dependencies index fb635c6334cc..fabd25a0537d 100644 --- a/Skin_surface_3/package_info/Skin_surface_3/dependencies +++ b/Skin_surface_3/package_info/Skin_surface_3/dependencies @@ -21,7 +21,6 @@ Number_types Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Skin_surface_3 Spatial_sorting diff --git a/Straight_skeleton_extrusion_2/package_info/Straight_skeleton_extrusion_2/dependencies b/Straight_skeleton_extrusion_2/package_info/Straight_skeleton_extrusion_2/dependencies index eafd536cd0a5..354e1eb0c02b 100644 --- a/Straight_skeleton_extrusion_2/package_info/Straight_skeleton_extrusion_2/dependencies +++ b/Straight_skeleton_extrusion_2/package_info/Straight_skeleton_extrusion_2/dependencies @@ -22,7 +22,6 @@ Polygon Polygon_mesh_processing Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Straight_skeleton_2 diff --git a/Subdivision_method_3/package_info/Subdivision_method_3/dependencies b/Subdivision_method_3/package_info/Subdivision_method_3/dependencies index b42b51ec6d8a..95d535dc5716 100644 --- a/Subdivision_method_3/package_info/Subdivision_method_3/dependencies +++ b/Subdivision_method_3/package_info/Subdivision_method_3/dependencies @@ -9,7 +9,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support Subdivision_method_3 diff --git a/Surface_mesh/package_info/Surface_mesh/dependencies b/Surface_mesh/package_info/Surface_mesh/dependencies index bb41a0ba6250..474db4e67138 100644 --- a/Surface_mesh/package_info/Surface_mesh/dependencies +++ b/Surface_mesh/package_info/Surface_mesh/dependencies @@ -13,7 +13,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support Surface_mesh diff --git a/Surface_mesh_approximation/package_info/Surface_mesh_approximation/dependencies b/Surface_mesh_approximation/package_info/Surface_mesh_approximation/dependencies index b1ab146c636d..aaf95de7e9da 100644 --- a/Surface_mesh_approximation/package_info/Surface_mesh_approximation/dependencies +++ b/Surface_mesh_approximation/package_info/Surface_mesh_approximation/dependencies @@ -14,7 +14,6 @@ Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Stream_support diff --git a/Surface_mesh_deformation/package_info/Surface_mesh_deformation/dependencies b/Surface_mesh_deformation/package_info/Surface_mesh_deformation/dependencies index e4abdd72dbd4..2019eca3e762 100644 --- a/Surface_mesh_deformation/package_info/Surface_mesh_deformation/dependencies +++ b/Surface_mesh_deformation/package_info/Surface_mesh_deformation/dependencies @@ -13,7 +13,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Stream_support diff --git a/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies b/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies index 19c7b2f79832..da5779cf1ede 100644 --- a/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies +++ b/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies @@ -18,7 +18,6 @@ Number_types Polygon_mesh_processing Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Spatial_sorting diff --git a/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies b/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies index 0acb32e88130..5336f29d3b67 100644 --- a/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies +++ b/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies @@ -14,7 +14,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Spatial_searching Stream_support diff --git a/Surface_mesh_simplification/package_info/Surface_mesh_simplification/dependencies b/Surface_mesh_simplification/package_info/Surface_mesh_simplification/dependencies index 27dd31f34e61..e6a49c552eb4 100644 --- a/Surface_mesh_simplification/package_info/Surface_mesh_simplification/dependencies +++ b/Surface_mesh_simplification/package_info/Surface_mesh_simplification/dependencies @@ -14,7 +14,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Spatial_searching Stream_support diff --git a/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies b/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies index d9c5098d64f6..86896096c6e0 100644 --- a/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies +++ b/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies @@ -19,7 +19,6 @@ Number_types Polygon_mesh_processing Profiling_tools Property_map -Random_numbers SMDS_3 STL_Extension Spatial_sorting diff --git a/Triangulation_3/package_info/Triangulation_3/dependencies b/Triangulation_3/package_info/Triangulation_3/dependencies index a68982ddaa59..7b31a4d37e37 100644 --- a/Triangulation_3/package_info/Triangulation_3/dependencies +++ b/Triangulation_3/package_info/Triangulation_3/dependencies @@ -19,7 +19,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Weights/package_info/Weights/dependencies b/Weights/package_info/Weights/dependencies index 4ff65640789f..63d9e7ce1333 100644 --- a/Weights/package_info/Weights/dependencies +++ b/Weights/package_info/Weights/dependencies @@ -9,7 +9,6 @@ Number_types Polygon Profiling_tools Property_map -Random_numbers STL_Extension Stream_support Weights From a42d56fc675bc500b6a5aa72b42a7d1b1439dee0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 14 Mar 2024 10:09:07 +0100 Subject: [PATCH 349/399] Add several #include --- .../face_selection_borders_regularization_example.cpp | 2 +- BGL/examples/BGL_surface_mesh/gwdwg.cpp | 1 + BGL/examples/BGL_surface_mesh/write_inp.cpp | 1 + BGL/test/BGL/test_Collapse_edge_with_constraints.cpp | 1 + BGL/test/BGL/test_Euler_operations.cpp | 1 + BGL/test/BGL/test_Face_filtered_graph.cpp | 1 + BGL/test/BGL/test_test_face.cpp | 1 + Hash_map/test/Hash_map/Hash.cpp | 2 +- .../test/Linear_cell_complex/Linear_cell_complex_2_test.h | 1 + .../connected_component_surface_mesh.cpp | 2 +- .../test/Polygon_mesh_processing/test_pmp_transform.cpp | 2 +- .../test/Polygon_mesh_processing/test_stitching.cpp | 1 + Property_map/examples/Property_map/dynamic_properties.cpp | 1 + Property_map/test/Property_map/dynamic_properties_test.cpp | 1 + .../test/Property_map/kernel_converter_properties_test.cpp | 1 + Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp | 1 + .../test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp | 1 + 17 files changed, 17 insertions(+), 4 deletions(-) diff --git a/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp b/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp index c9671dd408ec..38de21612d57 100644 --- a/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp +++ b/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp @@ -2,7 +2,7 @@ #include #include #include - +#include #include #include diff --git a/BGL/examples/BGL_surface_mesh/gwdwg.cpp b/BGL/examples/BGL_surface_mesh/gwdwg.cpp index f9a7228f7112..aaa5eb333bfe 100644 --- a/BGL/examples/BGL_surface_mesh/gwdwg.cpp +++ b/BGL/examples/BGL_surface_mesh/gwdwg.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include diff --git a/BGL/examples/BGL_surface_mesh/write_inp.cpp b/BGL/examples/BGL_surface_mesh/write_inp.cpp index 7554bed208db..aedd8f539fb4 100644 --- a/BGL/examples/BGL_surface_mesh/write_inp.cpp +++ b/BGL/examples/BGL_surface_mesh/write_inp.cpp @@ -1,5 +1,6 @@ #include #include +#include #include diff --git a/BGL/test/BGL/test_Collapse_edge_with_constraints.cpp b/BGL/test/BGL/test_Collapse_edge_with_constraints.cpp index a8f84f6e6543..34d704bb6794 100644 --- a/BGL/test/BGL/test_Collapse_edge_with_constraints.cpp +++ b/BGL/test/BGL/test_Collapse_edge_with_constraints.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Simple_cartesian K; typedef K::Point_3 Point_3; diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index fe7c3275dd12..3fdcfe0edec8 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -2,6 +2,7 @@ #include "test_Prefix.h" #include #include +#include #include #include diff --git a/BGL/test/BGL/test_Face_filtered_graph.cpp b/BGL/test/BGL/test_Face_filtered_graph.cpp index 9623d2868bdc..9917b7d06a52 100644 --- a/BGL/test/BGL/test_Face_filtered_graph.cpp +++ b/BGL/test/BGL/test_Face_filtered_graph.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "test_Prefix.h" diff --git a/BGL/test/BGL/test_test_face.cpp b/BGL/test/BGL/test_test_face.cpp index aa4e0fa08790..7afbc79385b4 100644 --- a/BGL/test/BGL/test_test_face.cpp +++ b/BGL/test/BGL/test_test_face.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include diff --git a/Hash_map/test/Hash_map/Hash.cpp b/Hash_map/test/Hash_map/Hash.cpp index fc12a7571fb4..e73d4c3033d9 100644 --- a/Hash_map/test/Hash_map/Hash.cpp +++ b/Hash_map/test/Hash_map/Hash.cpp @@ -11,9 +11,9 @@ #include #include #include +#include #include #include -#include typedef CGAL::Simple_cartesian Kernel; diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h index b76bbf1d7e62..f22bd0a480ab 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h @@ -17,6 +17,7 @@ #include #include #include +#include #include // #define LCC_TRACE_TEST_BEGIN 1 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp index bff0cb6d083c..f308a4ce35ad 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_transform.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_transform.cpp index 695d4862623f..c45de576ffb0 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_transform.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_transform.cpp @@ -1,7 +1,7 @@ #include +#include #include -#include #include diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp index d5d2fa63b9d8..540aeb846397 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/Property_map/examples/Property_map/dynamic_properties.cpp b/Property_map/examples/Property_map/dynamic_properties.cpp index 6edbd4cfb9ae..e3eb014e40c7 100644 --- a/Property_map/examples/Property_map/dynamic_properties.cpp +++ b/Property_map/examples/Property_map/dynamic_properties.cpp @@ -1,6 +1,7 @@ #include #include +#include #include diff --git a/Property_map/test/Property_map/dynamic_properties_test.cpp b/Property_map/test/Property_map/dynamic_properties_test.cpp index 41a4ea8abce5..07fd4751c4c0 100644 --- a/Property_map/test/Property_map/dynamic_properties_test.cpp +++ b/Property_map/test/Property_map/dynamic_properties_test.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #if defined(CGAL_USE_OPENMESH) #include diff --git a/Property_map/test/Property_map/kernel_converter_properties_test.cpp b/Property_map/test/Property_map/kernel_converter_properties_test.cpp index ebe871bc3e36..05cf177b3253 100644 --- a/Property_map/test/Property_map/kernel_converter_properties_test.cpp +++ b/Property_map/test/Property_map/kernel_converter_properties_test.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include diff --git a/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp b/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp index eba06f7b5780..ba18732911d7 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp @@ -6,6 +6,7 @@ #include #include #include +#include typedef CGAL::Simple_cartesian K; typedef K::Point_3 Point; diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp index fffb560ac889..0d09480d987e 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include From dc3d4a7c5106ad5647096da383675d336051932d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 14 Mar 2024 16:24:56 +0100 Subject: [PATCH 350/399] use the right config flag --- BGL/doc/BGL/Doxyfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/doc/BGL/Doxyfile.in b/BGL/doc/BGL/Doxyfile.in index 524cd9e77372..f37650c983f8 100644 --- a/BGL/doc/BGL/Doxyfile.in +++ b/BGL/doc/BGL/Doxyfile.in @@ -34,7 +34,7 @@ ALIASES += "bgllink{1}= EXTRACT_ALL=NO HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES -WARN_IF_UNDOCUMENTED = NO +WARN_IF_INCOMPLETE_DOC = NO # macros to be used inside the code ALIASES += "cgalAssociatedTypesBegin=
    Associated Types
    " From ebee48b81ec00a585d78400d1981c2e4d10673ef Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Mar 2024 08:48:23 +0100 Subject: [PATCH 351/399] More #includes --- BGL/test/BGL/next.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/test/BGL/next.cpp b/BGL/test/BGL/next.cpp index fd69cc003044..4332aa86637d 100644 --- a/BGL/test/BGL/next.cpp +++ b/BGL/test/BGL/next.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include typedef CGAL::Exact_predicates_exact_constructions_kernel K; typedef K::Point_3 Point_3; From b855194fbae3e2f119413fa3c321dcd79105d1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 15 Mar 2024 09:20:44 +0100 Subject: [PATCH 352/399] add missing include directive --- .../CGAL/Polygon_mesh_processing/internal/Snapping/snap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index b7c0d086c5cb..347db104f0c6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -27,6 +27,7 @@ #include #include +#include #include #include From a2b7a727520d27b01c7985e10186bbd85a3da1f8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Mar 2024 13:11:12 +0100 Subject: [PATCH 353/399] Create a doxygen grup for generators --- BGL/doc/BGL/PackageDescription.txt | 17 +++++++++++++++-- BGL/include/CGAL/boost/graph/generators.h | 18 +++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 6032e29a6c90..ec0014c799bb 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -449,6 +449,9 @@ the requirement for traversal of all faces in a graph. /// \defgroup PkgBGLHelperFct Helper Functions /// \ingroup PkgBGLRef +/// \defgroup PkgBGLGeneratorFct Generator Functions +/// \ingroup PkgBGLRef + /// \defgroup PkgBGLIterators Iterators and Circulators /// \ingroup PkgBGLRef @@ -520,7 +523,14 @@ by attaching and initializing external IDs to the elements of the graph. Generic convenience functions for testing if an edge is a border edge, if a mesh is triangular, for conversion between models of different `FaceGraph` concepts, etc. -Most functions are in the header file `` +All functions are in the header file `` +*/ + +/*! +\addtogroup PkgBGLGeneratorrFct +Generic convenience functions for generating meshes such as a triangle, a quad, or a grid. + +All functions are in the header file `` */ /*! @@ -667,7 +677,10 @@ user might encounter. - `CGAL::is_valid_face_graph()` - `CGAL::is_valid_polygon_mesh()` -- `CGAL::is_tetrahedron()` +- `CGAL::is_tetrahedron() + +` +\cgalCRPSection{Generator Functions} - `CGAL::is_hexahedron()` - `CGAL::make_triangle()` - `CGAL::make_tetrahedron()` diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index b66b00390fcd..6454253811dd 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -118,7 +118,7 @@ random_face_in_mesh(const Graph& g, CGAL::Random& rnd = get_default_random()) } // namespace internal /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates an isolated triangle * with its vertices initialized to `p0`, `p1` and `p2`, and adds it to the graph `g`. @@ -248,7 +248,7 @@ struct Default_grid_maker } // namespace internal /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates an isolated quad with * its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`. @@ -279,7 +279,7 @@ make_quad(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * \brief creates an isolated hexahedron * with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`. * \image html hexahedron.png @@ -381,7 +381,7 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * \brief creates an isolated hexahedron * equivalent to `c`, and adds it to the graph `g`. * \returns the halfedge that has the target vertex associated with `c.min()`, @@ -428,7 +428,7 @@ make_hexahedron(const IsoCuboid& c, } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * \brief creates an isolated tetrahedron * with its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`. * \image html tetrahedron.png @@ -526,7 +526,7 @@ make_tetrahedron(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates a triangulated regular prism, outward oriented, * having `nb_vertices` vertices in each of its bases and adds it to the graph `g`. @@ -626,7 +626,7 @@ make_regular_prism(typename boost::graph_traits::vertices_size_type nb_ve } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * \brief creates a pyramid, outward oriented, having `nb_vertices` vertices in its base and adds it to the graph `g`. * * If `center` is `(0, 0, 0)`, then the first point of the base is `(radius, 0, 0)` @@ -714,7 +714,7 @@ make_pyramid(typename boost::graph_traits::vertices_size_type nb_vertices } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates an icosahedron, outward oriented, centered in `center` and adds it to the graph `g`. * @@ -809,7 +809,7 @@ make_icosahedron(Graph& g, } /*! - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates a row major ordered grid with `i` cells along the width and `j` cells * along the height and adds it to the graph `g`. From be1e07575097c17c94a39ed0fd2138720a68e275 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 21 Mar 2024 11:51:19 +0100 Subject: [PATCH 354/399] Algebraic_kernel_d: replace new/delete --- .../CGAL/Algebraic_kernel_d/Descartes.h | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h index 0adc7652b04b..bc2287665f02 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h @@ -68,9 +68,9 @@ class Descartes { Polynomial poly_; int number_of_real_roots_; - IT* numerator; - IT* denominator_exponent; - bool* is_exact; + std::vector numerator; + std::vector denominator_exponent; + std::vector is_exact; IT LEFT,SCALE,DENOM; bool is_strong_; int k; @@ -91,9 +91,9 @@ class Descartes { k(kk), interval_given(false) { - numerator = new IT[CGAL::degree(P)]; - denominator_exponent = new IT[CGAL::degree(P)]; - is_exact = new bool[CGAL::degree(P)]; + numerator.resize(CGAL::degree(P)); + denominator_exponent.resize(CGAL::degree(P)); + is_exact.resize(CGAL::degree(P)); number_of_real_roots_ = 0; if(CGAL::degree(P) == 0) { @@ -116,9 +116,9 @@ class Descartes { k(kk), interval_given(true) { - numerator = new IT[CGAL::degree(P)]; - denominator_exponent = new IT[CGAL::degree(P)]; - is_exact = new bool[CGAL::degree(P)]; + numerator.resize(CGAL::degree(P)); + denominator_exponent.resize(CGAL::degree(P)); + is_exact.resize(CGAL::degree(P)); number_of_real_roots_ = 0; if(CGAL::degree(P) == 0) { @@ -153,9 +153,9 @@ class Descartes { k(D.k), interval_given(D.interval_given) { - numerator = new IT[CGAL::degree(poly_)]; - denominator_exponent = new IT[CGAL::degree(poly_)]; - is_exact = new bool[CGAL::degree(poly_)]; + numerator.resize(CGAL::degree(poly_)); + denominator_exponent.resize(CGAL::degree(poly_)); + is_exact.resize(CGAL::degree(poly_)); for(int i=0; i Date: Mon, 25 Mar 2024 10:18:34 +0100 Subject: [PATCH 355/399] add documentation --- BGL/doc/BGL/BGL.txt | 5 +++-- .../examples/Property_map/dynamic_properties.cpp | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/BGL/doc/BGL/BGL.txt b/BGL/doc/BGL/BGL.txt index cf7e8a739031..96be1186c663 100644 --- a/BGL/doc/BGL/BGL.txt +++ b/BGL/doc/BGL/BGL.txt @@ -510,11 +510,12 @@ Dynamic property tags, such as `dynamic_vertex_property_t`, are a generalization value type of the dynamic property map, and a default value. `boost::property_map::%type` is used to obtain the type of the dynamic property map for a graph of type `G`, for a -dynamic property tag `T`. This type must be default constructible and assignable. +dynamic property tag `T`. This type must be assignable, and if no +default is provided it must be default constructible. As for ordinary properties, the function `%get()` is overloaded and serves for retrieving a property map for a given graph and dynamic property tag, as well as for retrieving a value for a given key and -property map. +property map. The default value is provided as third parameter. The following example shows how to attach a `string` property to vertices and a `double` value to the halfedges of a graph. diff --git a/Property_map/examples/Property_map/dynamic_properties.cpp b/Property_map/examples/Property_map/dynamic_properties.cpp index 6edbd4cfb9ae..cb838c6096f5 100644 --- a/Property_map/examples/Property_map/dynamic_properties.cpp +++ b/Property_map/examples/Property_map/dynamic_properties.cpp @@ -14,16 +14,24 @@ int main() CGAL::make_triangle(Point_3(0,0,0),Point_3(1,0,0),Point_3(1,1,0), mesh); typedef boost::property_map >::type VertexNameMap; - VertexNameMap vnm = get(CGAL::dynamic_vertex_property_t(), mesh); + VertexNameMap vnm = get(CGAL::dynamic_vertex_property_t(), mesh, std::string("default")); put(vnm, *(vertices(mesh).first), "Paris"); + assert(get(vnm, *(vertices(mesh).first))=="Paris"); + assert(get(vnm, *(std::next(vertices(mesh).first)))=="default"); + std::cout << get(vnm, *(vertices(mesh).first)) << std::endl; + std::cout << get(vnm, *(std::next(vertices(mesh).first))) << std::endl; typedef boost::property_map >::type TrafficDensityMap; - TrafficDensityMap tdm = get(CGAL::dynamic_halfedge_property_t(), mesh); + TrafficDensityMap tdm = get(CGAL::dynamic_halfedge_property_t(), mesh, -1.); put(tdm, *(halfedges(mesh).first), 0.7); + assert(get(tdm, *(halfedges(mesh).first))==0.7); + assert(get(tdm, *(std::next(halfedges(mesh).first)))==-1.); + std::cout << get(tdm, *(halfedges(mesh).first)) << std::endl; + std::cout << get(tdm, *(std::next(halfedges(mesh).first))) << std::endl; return 0; } From baf084950b927e2b1dec3c4c19ce564286152a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 25 Mar 2024 10:45:37 +0100 Subject: [PATCH 356/399] use default value for dynamic maps --- .../angle_and_area_smoothing.h | 9 +-------- .../internal/Smoothing/mesh_smoothing_impl.h | 5 +---- .../internal/Snapping/snap.h | 12 +++++------- .../Polygon_mesh_processing/manifoldness.h | 19 ++++--------------- .../repair_degeneracies.h | 2 +- .../Polygon_mesh_processing/stitch_borders.h | 2 +- 6 files changed, 13 insertions(+), 36 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h index e51999b9c543..5db4a1e29fcf 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h @@ -209,14 +209,7 @@ void angle_and_area_smoothing(const FaceRange& faces, const bool use_Delaunay_flips = choose_parameter(get_parameter(np, internal_np::use_Delaunay_flips), true); VCMap vcmap = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), - get(Vertex_property_tag(), tmesh)); - - // If it's the default vcmap, manually set everything to false because the dynamic pmap has no default initialization - if((std::is_same::value)) - { - for(vertex_descriptor v : vertices(tmesh)) - put(vcmap, v, false); - } + get(Vertex_property_tag(), tmesh, false)); ECMap ecmap = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), Static_boolean_property_map()); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h index e15ae718823d..54b15c7777a9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h @@ -154,11 +154,8 @@ class Delaunay_edge_flipper typedef typename boost::property_map::type Marked_edges_map; - Marked_edges_map marks = get(Edge_property_tag(), mesh_); + Marked_edges_map marks = get(Edge_property_tag(), mesh_, false); - // dynamic pmaps do not have default values... - for(edge_descriptor e : edges(mesh_)) - put(marks, e, false); for(edge_descriptor e : edge_range) put(marks, e, true); #ifdef CGAL_PMP_SMOOTHING_DEBUG diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index b7c0d086c5cb..6edbc0f1c3ca 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -104,9 +104,7 @@ void simplify_range(HalfedgeRange& halfedge_range, typedef CGAL::dynamic_halfedge_property_t Halfedge_bool_tag; typedef typename boost::property_map::type Range_halfedges; - Range_halfedges range_halfedges = get(Halfedge_bool_tag(), tm); - for(halfedge_descriptor h : halfedge_range) - put(range_halfedges, h, true); + Range_halfedges range_halfedges = get(Halfedge_bool_tag(), tm, false); CGAL_postcondition_code(const std::size_t initial_n = halfedge_range.size();) @@ -1233,10 +1231,10 @@ std::size_t snap_non_conformal(HalfedgeRange& halfedge_range_A, // We keep in memory pairs of source/target edges that are stitchable after vertex-vertex snapping // --> these halfedges should not be considered as targets in non-conformal snapping // Similarly, matching vertices whose incident edges have matching directions are also locked - Locked_vertices locked_vertices_A = get(Vertex_bool_tag(), tm_A); - Locked_vertices locked_vertices_B = get(Vertex_bool_tag(), tm_B); - Locked_halfedges locked_halfedges_A = get(Halfedge_bool_tag(), tm_A); - Locked_halfedges locked_halfedges_B = get(Halfedge_bool_tag(), tm_B); + Locked_vertices locked_vertices_A = get(Vertex_bool_tag(), tm_A, false); + Locked_vertices locked_vertices_B = get(Vertex_bool_tag(), tm_B, false); + Locked_halfedges locked_halfedges_A = get(Halfedge_bool_tag(), tm_A, false); + Locked_halfedges locked_halfedges_B = get(Halfedge_bool_tag(), tm_B, false); std::vector > locked_vertices; std::vector locked_halfedges_A_vector, locked_halfedges_B_vector; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h index de45ca3150e1..46ac4ed6cb65 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h @@ -58,9 +58,7 @@ bool is_non_manifold_vertex(typename boost::graph_traits::vertex_de typedef typename boost::property_map::const_type Visited_halfedge_map; // Dynamic pmaps do not have default initialization values (yet) - Visited_halfedge_map visited_halfedges = get(Halfedge_property_tag(), pm); - for(halfedge_descriptor h : halfedges(pm)) - put(visited_halfedges, h, false); + Visited_halfedge_map visited_halfedges = get(Halfedge_property_tag(), pm, false); std::size_t incident_null_faces_counter = 0; for(halfedge_descriptor h : halfedges_around_target(v, pm)) @@ -324,20 +322,11 @@ OutputIterator non_manifold_vertices(const PolygonMesh& pm, typedef CGAL::dynamic_halfedge_property_t Halfedge_property_tag; typedef typename boost::property_map::const_type Visited_halfedge_map; - Known_manifold_vertex_map known_nm_vertices = get(Vertex_bool_tag(), pm); - Visited_vertex_map visited_vertices = get(Vertex_halfedge_tag(), pm); - Visited_halfedge_map visited_halfedges = get(Halfedge_property_tag(), pm); - halfedge_descriptor null_h = boost::graph_traits::null_halfedge(); - // Dynamic pmaps do not have default initialization values (yet) - for(vertex_descriptor v : vertices(pm)) - { - put(known_nm_vertices, v, false); - put(visited_vertices, v, null_h); - } - for(halfedge_descriptor h : halfedges(pm)) - put(visited_halfedges, h, false); + Known_manifold_vertex_map known_nm_vertices = get(Vertex_bool_tag(), pm, false); + Visited_vertex_map visited_vertices = get(Vertex_halfedge_tag(), pm, null_h); + Visited_halfedge_map visited_halfedges = get(Halfedge_property_tag(), pm, false); for(halfedge_descriptor h : halfedges(pm)) { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index c71a5d4c8062..1dde0a5b20d3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h @@ -639,7 +639,7 @@ bool remove_almost_degenerate_faces(const FaceRange& face_range, // Vertex property map that combines the VCM and the fact that extremities of a constrained edge should be constrained typedef CGAL::dynamic_vertex_property_t Vertex_property_tag; typedef typename boost::property_map::type DVCM; - DVCM vcm = get(Vertex_property_tag(), tmesh); + DVCM vcm = get(Vertex_property_tag(), tmesh, false); // parameters const double cap_threshold = diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h index e30f95fd2896..343007a83b2c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h @@ -190,7 +190,7 @@ struct Boundary_cycle_rep_maintainer Boundary_cycle_rep_maintainer(PolygonMesh& pmesh) : m_pmesh(pmesh) { - m_candidate_halfedges = get(Candidate_tag(), pmesh); + m_candidate_halfedges = get(Candidate_tag(), pmesh, false); } public: From 120a8c14a37575f35b5c058b1a067af9fd8e361b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 26 Mar 2024 11:29:51 +0100 Subject: [PATCH 357/399] add missing includes detected with gcc 14.0.1 from Fedora 40 --- Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h | 1 + .../include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h index 380696549c13..d2df50df3fa7 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h index eafd4d73b895..21b21d10fb9c 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h @@ -15,6 +15,8 @@ #define CGAL_SURFACE_SWEEP_2_IMPL_H #include +#include +#include /*! \file * From 7d0f05846345318b5dc336ccf4c9cd2fec4f0fa4 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 26 Mar 2024 15:52:09 +0100 Subject: [PATCH 358/399] remove T_2 from dependencies of GraphicsView --- GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h | 1 - {Triangulation_2 => GraphicsView}/include/CGAL/apply_to_range.h | 0 .../include/internal/Qt/TriangulationGraphicsItem.h | 1 - 3 files changed, 2 deletions(-) rename {Triangulation_2 => GraphicsView}/include/CGAL/apply_to_range.h (100%) diff --git a/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h index 1348f5d29322..a44bd71044f7 100644 --- a/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h @@ -19,7 +19,6 @@ #include #include -#include #include #include #include diff --git a/Triangulation_2/include/CGAL/apply_to_range.h b/GraphicsView/include/CGAL/apply_to_range.h similarity index 100% rename from Triangulation_2/include/CGAL/apply_to_range.h rename to GraphicsView/include/CGAL/apply_to_range.h diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h index e6b56085125a..71e38171d572 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h @@ -14,7 +14,6 @@ #define CGAL_QT_TRIANGULATION_GRAPHICS_ITEM_H #include -#include #include #include From c78160075f91a6dfc47a14244b10f310c23d4cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 26 Mar 2024 16:39:01 +0100 Subject: [PATCH 359/399] remove remove deps --- GraphicsView/package_info/GraphicsView/dependencies | 1 - 1 file changed, 1 deletion(-) diff --git a/GraphicsView/package_info/GraphicsView/dependencies b/GraphicsView/package_info/GraphicsView/dependencies index f74d1ba2e464..b4a464ef5e7c 100644 --- a/GraphicsView/package_info/GraphicsView/dependencies +++ b/GraphicsView/package_info/GraphicsView/dependencies @@ -11,4 +11,3 @@ Number_types Profiling_tools STL_Extension Stream_support -Triangulation_2 From 736c182b42f3fe70c87043b1c1a93990dc0fcf6d Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 26 Mar 2024 17:14:06 +0100 Subject: [PATCH 360/399] Basic viewer user manual --- .../doc/Basic_viewer/Basic_viewer.txt | 70 ++++++++++--------- .../examples/Basic_viewer/CMakeLists.txt | 8 ++- .../examples/Basic_viewer/draw_lcc.cpp | 17 +++++ .../Basic_viewer/draw_surface_mesh_vcolor.cpp | 51 ++++++++++++++ 4 files changed, 112 insertions(+), 34 deletions(-) create mode 100644 Basic_viewer/examples/Basic_viewer/draw_lcc.cpp create mode 100644 Basic_viewer/examples/Basic_viewer/draw_surface_mesh_vcolor.cpp diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index b673b49fbbc5..03aa3150a6ba 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -10,11 +10,15 @@ namespace CGAL { \section Introduction -The basic viewer package appears to serve as a foundation for a 3D graphics viewer in the context of the CGAL (Computational Geometry Algorithms Library) and Qt (a C++ GUI toolkit). The goal of this package is to provide a flexible and interactive environment for visualizing geometric data and interacting with 3D scenes. The functionality of the package is to renders various geometric elements such as(points, segments, rays, lines, faces, edges, etc.) and supports user interaction through keyboard inputs. +The basic viewer package appears to serve as a foundation to provide a small interactive visualization tools of all CGAL data structures, such as Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more. The functionality of the package is to renders various geometric elements such as points, segments, rays, lines, faces, etc. -The goal of Basic_viewer is allowing to view all CGAL data structures, such as (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more). +The most basic usage of the basic viewer is the use of the global `CGAL::draw` function. There is one draw function for each package CGAL. Such a call opens a new interactive window showing the given model and allowing to navigate in the scene, show or hide some specific cells, show the interior of the model if any... -There are mainly: two global functions for each CGAL package `CGAL::draw` and `CGAL::add_to_graphics_scene`; four classes `CGAL::Graphics_scene`, `CGAL::Graphics_scene_option`, `CGAL::Qt::Basic_viewer` and `CGAL::Qt::QApplication_and_basic_viewer`. +The drawing can be tuned using a `CGAL::Graphics_scene_option` allowing to change the color of some cells or hide some cells. + +More complex usage can be achieved by using the `CGAL::Graphics_scene` class. Several representation of different CGAL data structures can be added in a same `CGAL::Graphics_scene` allowing to visualize different models in a same window. Like for the draw function, the drawing parameters can be tune thanks to the `CGAL::Graphics_scene_option`. + +Two classes are based on Qt. (1) `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` (libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers). (2) `CGAL::Qt::QApplication_and_basic_viewer` which regroups a `Qt::QApplication` and a `CGAL::Basic_viewer`. \section SoftwareDesignClassDiagam Software Design @@ -28,54 +32,56 @@ TODO links the classes with the different sections where they will be explained \section Basic Usage: global `CGAL::draw` functions -A first simple solution provide to draw the different data structures of CGAL is the use of global draw functions. -The draw function is a template function that facilitates drawing an almost mentioned data structures such as (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more) +A first simple solution provide to draw the different data structures of CGAL is the use of global `CGAL::draw` functions. This function is templated by the type of the data structure to draw. The following example shows a basic use of this function. -``` -#include -#include +\cgalExample{Basic_viewer/draw_lcc.cpp} -using LCC=CGAL::Linear_cell_complex_for_combinatorial_map<3>; -using Point=LCC::Point; +This example creates a 3D linear cell complex, fill it by creating an hexahedron, and draw it using the basic viewer. The result of the viewing is shown in the following figure. -LCC lcc; -lcc.make_hexahedron(Point(0,0,0), Point(5,0,0), - Point(5,5,0), Point(0,5,0), - Point(0,5,4), Point(0,0,4), - Point(5,0,4), Point(5,5,4)); -CGAL::draw(lcc); -``` +\cgalFigureBegin{basic_viewer_ex1,lcc_draw.png} +Example of drawing of a 3D LCC. +\cgalFigureEnd +Users can interact with the viewer using some specific keys or mouse interactions. You can press 'h' key to visualize an help showing all the different shortcuts and mouse interactions. The main functionalities of the viewer are: -\cgalFigureBegin{linear_cell_complex_for_combinatorial_map_ex1,lcc_cmap_with_faces.png} -example of drawing LCC for CMap with faces -\cgalFigureEnd +
  1. Versatile Rendering: -More advanced example +The viewer supports the rendering of various geometric elements, such as points, edges, faces, rays, and lines. +Different rendering modes, including mono and colored representations, are available for these elements. + +
  2. Camera Control: + +The viewer allows users to switch between 2D and 3D viewing modes, adjusting the camera accordingly. +Camera settings, such as orthographic or perspective projection, can be configured based on the dimensionality of the scene. + +
  3. User Interaction: + +Users can interact with the viewer through keyboard inputs, enabling them to control rendering options, toggle the display of elements, and adjust visual parameters. +Key presses are mapped to specific actions, such as toggling the clipping plane, changing rendering modes, adjusting the size of elements, and modifying ambient light color. + +
  4. Clipping Plane: + +The viewer includes support for a clipping plane, allowing users to selectively render parts of the scene. +The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.). -\cgalExample{Surface_mesh/draw_surface_mesh.cpp} \subsection GraphicSceneContinue Tune the drawing thanks to `CGAL::Graphics_scene_options` There is one specialization of each draw function that takes a graphics scene options as parameter, allowing to tune the drawing. -The Graphics_scene_options class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various elements such as vertices, edges, faces, and volumes in a graphical representation of a combinatorial data structure (DS). The classes are template classes, allowing them to work with different combinatorial data structures (DS) in 2D and 3D. -\subsubsection GraphicSceneOptionsCont Here are some key responsibilities of the Graphics_scene_options class: -
      +The Graphics_scene_options class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various cells such as vertices, edges, faces, and volumes in a graphical representation of a given data structure. -
    1. Drawing Control: It determines whether to draw vertices, edges, faces, and volumes in the graphics scene through the use of drawing functors (draw_vertex, draw_edge, draw_face, draw_volume). +The following example shows how to use a graphics scene options to tune the drawing of a surface mesh. In this example, we define our own class `My_graphics_scene_options` that inherits from `CGAL::Graphics_scene_options` to get all the default parameters. In this class, we only override the two methods `colored_vertex` and `vertex_color` to draw all vertices in color, and chose randomly green or blue colors for one out of two vertices. -
    2. Coloring Control: It allows users to customize the coloring of vertices, edges, faces, and volumes. Users can specify whether coloring is enabled (colored_vertex, colored_edge, colored_face, colored_volume) and, if so, provide functions (vertex_color, edge_color, face_color, volume_color) to determine the color for each element. +\cgalFigureBegin{basic_viewer_ex2,draw_surface_mesh_vcolor.png} +Example of tuned drawing of a 3D surface mesh where some vertex colors are changed. +\cgalFigureEnd -
    3. Wireframe Control: For faces and volumes, it provides options to draw a wireframe representation (face_wireframe, volume_wireframe), allowing users to choose whether to display a wireframe overlay. -
    4. Visibility Control: Users can enable or disable the visibility of vertices, edges, faces, and volumes independently using functions like disable_vertices, enable_vertices, are_vertices_enabled, and similar functions for other components. -
    5. Template Flexibility: The class is templated to support different types of combinatorial data structures (DS) in 2D and 3D. This template flexibility allows users to use the class with various geometric structures. +ICICICI -
    6. Default Settings: It provides reasonable default settings for the various options, ensuring that users can get started with a sensible configuration without needing to customize every parameter. -
    \cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} diff --git a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt index 6b3bdddd1969..c1b97ddd9e75 100644 --- a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt +++ b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt @@ -14,17 +14,21 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) find_package(Eigen3 3.1.0) include(CGAL_Eigen3_support) +create_single_source_cgal_program("draw_lcc.cpp") create_single_source_cgal_program("draw_mesh_and_points.cpp") create_single_source_cgal_program("draw_several_windows.cpp") -create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") create_single_source_cgal_program("draw_surface_mesh_height.cpp") +create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") +create_single_source_cgal_program("draw_surface_mesh_vcolor.cpp") if(CGAL_Qt6_FOUND) #link it with the required CGAL libraries + target_link_libraries(draw_lcc PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_mesh_and_points PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_several_windows PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_surface_mesh_height PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(draw_surface_mesh_vcolor PUBLIC CGAL::CGAL_Basic_viewer) endif() if(TARGET CGAL::Eigen3_support) diff --git a/Basic_viewer/examples/Basic_viewer/draw_lcc.cpp b/Basic_viewer/examples/Basic_viewer/draw_lcc.cpp new file mode 100644 index 000000000000..019db26519a1 --- /dev/null +++ b/Basic_viewer/examples/Basic_viewer/draw_lcc.cpp @@ -0,0 +1,17 @@ +#include +#include + +using LCC=CGAL::Linear_cell_complex_for_combinatorial_map<3>; +using Point=LCC::Point; + +int main() +{ + LCC lcc; + lcc.make_hexahedron(Point(0,0,0), Point(5,0,0), + Point(5,5,0), Point(0,5,0), + Point(0,5,4), Point(0,0,4), + Point(5,0,4), Point(5,5,4)); + CGAL::draw(lcc); + + return EXIT_SUCCESS; +} diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_vcolor.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_vcolor.cpp new file mode 100644 index 000000000000..209d73bd71a8 --- /dev/null +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_vcolor.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include + +using Kernel=CGAL::Simple_cartesian; +using Point=Kernel::Point_3; +using Mesh=CGAL::Surface_mesh; + +// Inherit from CGAL::Graphics_scene_options to get all the default values. +struct My_graphics_scene_options: + public CGAL::Graphics_scene_options::vertex_descriptor, + typename boost::graph_traits::edge_descriptor, + typename boost::graph_traits::face_descriptor> +{ + // All vertices are colored. + bool colored_vertex(const Mesh&, + typename boost::graph_traits::vertex_descriptor) const + { return true; } + + // Change the color of vertices randomly. + CGAL::IO::Color vertex_color(const Mesh&, + typename boost::graph_traits::vertex_descriptor) const + { + static bool v_green=true; + v_green=!v_green; + if(v_green) // 1 vertex out of two green (randomly) + { return CGAL::IO::Color(0,220,0); } + else // the others are blue + { return CGAL::IO::Color(0,0,220); } + } +}; + + +int main(int argc, char* argv[]) +{ + const std::string filename = (argc>1) ? argv[1] : CGAL::data_file_path("meshes/elephant.off"); + + Mesh sm; + if(!CGAL::IO::read_polygon_mesh(filename, sm)) + { + std::cerr << "Invalid input file: " << filename << std::endl; + return EXIT_FAILURE; + } + + // Draw the mesh using the new graphics scene option. + CGAL::draw(sm, My_graphics_scene_options()); + return EXIT_SUCCESS; +} From cc19f2b3ee57b41b9b1341e9e2439ca6af4b7920 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 26 Mar 2024 17:26:25 +0100 Subject: [PATCH 361/399] =?UTF-8?q?add=20examples=20=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doc/Basic_viewer/Basic_viewer.txt | 19 ++++++++++--------- Basic_viewer/doc/Basic_viewer/examples.txt | 5 +++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 03aa3150a6ba..15c04986dc50 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -44,26 +44,27 @@ Example of drawing of a 3D LCC. Users can interact with the viewer using some specific keys or mouse interactions. You can press 'h' key to visualize an help showing all the different shortcuts and mouse interactions. The main functionalities of the viewer are: -
  5. Versatile Rendering: +
      +
    • Versatile Rendering: The viewer supports the rendering of various geometric elements, such as points, edges, faces, rays, and lines. -Different rendering modes, including mono and colored representations, are available for these elements. +Different rendering modes, including mono and colored representations, are available for these elements.
    • -
    • Camera Control: +
    • Camera Control: The viewer allows users to switch between 2D and 3D viewing modes, adjusting the camera accordingly. -Camera settings, such as orthographic or perspective projection, can be configured based on the dimensionality of the scene. +Camera settings, such as orthographic or perspective projection, can be configured based on the dimensionality of the scene.
    • -
    • User Interaction: +
    • User Interaction: Users can interact with the viewer through keyboard inputs, enabling them to control rendering options, toggle the display of elements, and adjust visual parameters. -Key presses are mapped to specific actions, such as toggling the clipping plane, changing rendering modes, adjusting the size of elements, and modifying ambient light color. +Key presses are mapped to specific actions, such as toggling the clipping plane, changing rendering modes, adjusting the size of elements, and modifying ambient light color.
    • -
    • Clipping Plane: +
    • Clipping Plane: The viewer includes support for a clipping plane, allowing users to selectively render parts of the scene. -The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.). - +The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.).
    • +
    \subsection GraphicSceneContinue Tune the drawing thanks to `CGAL::Graphics_scene_options` diff --git a/Basic_viewer/doc/Basic_viewer/examples.txt b/Basic_viewer/doc/Basic_viewer/examples.txt index 0a13e1c0f6fd..2e18952fcb4f 100644 --- a/Basic_viewer/doc/Basic_viewer/examples.txt +++ b/Basic_viewer/doc/Basic_viewer/examples.txt @@ -1,7 +1,8 @@ /*! -\example Surface_mesh/draw_surface_mesh.cpp +\example Basic_viewer/draw_lcc.cpp \example Basic_viewer/draw_mesh_and_points.cpp \example Basic_viewer/draw_several_windows.cpp -\example Basic_viewer/draw_surface_mesh_height.cpp \example Basic_viewer/draw_surface_mesh_small_faces.cpp +\example Basic_viewer/draw_surface_mesh_height.cpp +\example Basic_viewer/draw_surface_mesh_vcolor.cpp */ From 45451cfc67a52ae1660e80986ee63720a0ae8a89 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 26 Mar 2024 19:03:45 +0200 Subject: [PATCH 362/399] Fixed order of Qt6 components in find_package(Qt6 ....) --- Installation/cmake/modules/CGAL_SetupCGAL_Qt6Dependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/cmake/modules/CGAL_SetupCGAL_Qt6Dependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGAL_Qt6Dependencies.cmake index f4c961ab97dc..e8bc2f8c788e 100644 --- a/Installation/cmake/modules/CGAL_SetupCGAL_Qt6Dependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGAL_Qt6Dependencies.cmake @@ -25,7 +25,7 @@ set(CGAL_SetupCGAL_Qt6Dependencies_included TRUE) # ^^^^^^^^^^^^ # - :module:`Qt6Config` -find_package(Qt6 QUIET COMPONENTS Widgets OpenGL OpenGLWidgets OPTIONAL_COMPONENTS Svg) +find_package(Qt6 QUIET COMPONENTS OpenGL OpenGLWidgets Widgets OPTIONAL_COMPONENTS Svg) set(CGAL_Qt6_MISSING_DEPS "") if(NOT Qt6OpenGLWidgets_FOUND) From a34120d817e062c8b1023ffde3ab144002dff5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 08:21:34 +0100 Subject: [PATCH 363/399] fix warning --- .../CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h index 5db4a1e29fcf..0166c85e58fe 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h @@ -134,7 +134,6 @@ void angle_and_area_smoothing(const FaceRange& faces, TriangleMesh& tmesh, const NamedParameters& np = parameters::default_values()) { - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; From e9fefbbacade9e4b15194e33038421e4e0b6b691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 10:12:02 +0100 Subject: [PATCH 364/399] disable generic overload --- .../CGAL/boost/graph/properties_HalfedgeDS_base.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h index 489caf5e3c75..a39cfd907154 100644 --- a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h +++ b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace CGAL { @@ -126,11 +127,20 @@ typename boost::property_map::type get(PropertyTag,CGAL_HDS_CLASS&) { return typename boost::property_map::type(); } + // generalized 3-ary get functions -template +template> && + !std::is_same_v> && + !std::is_same_v> && + !std::is_same_v> + > +> typename boost::property_traits< typename boost::property_map::type >::reference get(PropertyTag p,CGAL_HDS_CLASS& g, const Key& key) -{ return get(get(p, g), key); } +{ + return get(get(p, g), key); +} template typename boost::property_traits< typename boost::property_map::const_type >::reference From 102f1595e83b042ce762c1a326e10577476ffb5b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 27 Mar 2024 11:36:23 +0100 Subject: [PATCH 365/399] basic viewer user manual --- .../doc/Basic_viewer/Basic_viewer.txt | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 15c04986dc50..67b0eb4b967e 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -74,53 +74,46 @@ The Graphics_scene_options class is responsible for providing a set of options a The following example shows how to use a graphics scene options to tune the drawing of a surface mesh. In this example, we define our own class `My_graphics_scene_options` that inherits from `CGAL::Graphics_scene_options` to get all the default parameters. In this class, we only override the two methods `colored_vertex` and `vertex_color` to draw all vertices in color, and chose randomly green or blue colors for one out of two vertices. +\cgalExample{Basic_viewer/draw_surface_mesh_vcolor.cpp} + +The result of this example can be shown in \cgalFigureRef{basic_viewer_ex2}. + \cgalFigureBegin{basic_viewer_ex2,draw_surface_mesh_vcolor.png} Example of tuned drawing of a 3D surface mesh where some vertex colors are changed. \cgalFigureEnd +The drawing options can depend on the cells. We illustrate this possibility of the following example which compute a color for each face depending on its height. -ICICICI +\cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} +The result of this example can be shown in \cgalFigureRef{basic_viewer_ex3} where we can see that all faces in a same height share the same color. +\cgalFigureBegin{basic_viewer_ex3,draw_surface_height.png} +Example of mesh drawing with a color for each face computed thanks to its height. +\cgalFigureEnd -\cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} -\subsection Some key goals and features of the Qt viewer include: -TODO explain the main key options -
      -
    1. Versatile Rendering: -The viewer supports the rendering of various geometric elements, such as points, edges, faces, rays, and lines. -Different rendering modes, including mono and colored representations, are available for these elements. -
    2. Camera Control: -The viewer allows users to switch between 2D and 3D viewing modes, adjusting the camera accordingly. -Camera settings, such as orthographic or perspective projection, can be configured based on the dimensionality of the scene. -
    3. User Interaction: -Users can interact with the viewer through keyboard inputs, enabling them to control rendering options, toggle the display of elements, and adjust visual parameters. -Key presses are mapped to specific actions, such as toggling the clipping plane, changing rendering modes, adjusting the size of elements, and modifying ambient light color. -
    4. Clipping Plane: -The viewer includes support for a clipping plane, allowing users to selectively render parts of the scene. -The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.). -
    5. Shader Support: -Shaders are compiled to enhance the rendering capabilities of the viewer, potentially providing advanced shading and visual effects. -
    6. Flexibility and Configurability: -The viewer is designed to be flexible, allowing users to configure various rendering parameters and interact with the scene based on their needs. -The code includes functions for setting up the initial state of the viewer, initializing OpenGL settings, and handling key events. -
    + + + + +ICICICI + \section Graphic_Scene From 785f301cda3b3a8d1f238c0eb0300f15837b1aca Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 27 Mar 2024 12:12:47 +0100 Subject: [PATCH 366/399] basic viewer user manual --- .../doc/Basic_viewer/Basic_viewer.txt | 22 ++++++++++--------- .../Basic_viewer/draw_mesh_and_points.cpp | 10 ++++----- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 67b0eb4b967e..202a6be8d29c 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -93,18 +93,30 @@ The result of this example can be shown in \cgalFigureRef{basic_viewer_ex3} wher Example of mesh drawing with a color for each face computed thanks to its height. \cgalFigureEnd +\section Graphic_Scene +It is possible to do more advanced visualisations by using the class `CGAL::Graphics_scene`. Its goal is to be a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements (points, segments, rays, lines, text), possibly with colors. Things are a little bit different for faces. You should call `face_begin` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face` as many times as necessary, then call `face_end` to finish the face. Note that the given polygonal face is internally triangulated. +This class also stores the normal of the faces (computed automatically), and possibly the normal of the vertices that should be given by the users. +Users can either fill directly a `Graphics_scene` using these methods, or by using a global function `CGAL::add_to_graphics_scene` that fill the scene using all the geometric elements of the given CGAL data structure. Like for the draw functions, there is one `add_to_graphics_scene` for each CGAL data structure (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2). +A `Graphics_scene` can be drawn using the basic viewer thanks to the `CGAL::draw_graphics_scene` function. +The following example illustrates this possibility by showing in a same viewer both a `CGAL::Point_set_3` and a `CGAL::Polyhedron_3`. Note that, like the draw functions, each `add_to_graphics_scene` can use an optional Graphics_scene_options as parameter allowing to tune the drawing of the given data structure. In the example, we use this possibility to change the color of all vertices of the point set. +\cgalExample{Basic_viewer/draw_mesh_and_points.cpp} +The result of this example can be shown in \cgalFigureRef{basic_viewer_ex4} where we can see in green the original points of the point cloud, supperposed with the polyhedron surface reconstructed by the poisson surface reconstruction method. +\cgalFigureBegin{basic_viewer_ex4,draw_mesh_and_points.png} +Example of drawing of a point cloud and a polyhedron in a same viewer. +\cgalFigureEnd +ICICICI @@ -112,16 +124,6 @@ Example of mesh drawing with a color for each face computed thanks to its height -ICICICI - - -\section Graphic_Scene - -The Graphics_scene class appears to be a container class responsible for managing CGAL data structures and handling buffers for various geometric elements, such as points, segments, rays, lines, and faces by fill data in given graphic buffer. - -Draw two different CGAL data-structures in a same viewer - -\cgalExample{Basic_viewer/draw_mesh_and_points.cpp} \subsection GraphicSceneClass key components and functionality of this class: diff --git a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp index 0b3fd2285a9b..e104f016447a 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_mesh_and_points.cpp @@ -10,11 +10,11 @@ #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; -typedef std::pair Pwn; -typedef CGAL::Polyhedron_3 Polyhedron; +using Kernel=CGAL::Exact_predicates_inexact_constructions_kernel; +using Point=Kernel::Point_3; +using Vector=Kernel::Vector_3; +using Pwn=std::pair; +using Polyhedron=CGAL::Polyhedron_3; using PS3=CGAL::Point_set_3; struct Graphics_scene_options_green_points: From 492133a0c6c53ece9ecaadbf0acce0e18e06c178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 13:11:02 +0100 Subject: [PATCH 367/399] test Exact_integer and Exact_rational are as expected --- .../test/Number_types/check_exact_backend.cpp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Number_types/test/Number_types/check_exact_backend.cpp diff --git a/Number_types/test/Number_types/check_exact_backend.cpp b/Number_types/test/Number_types/check_exact_backend.cpp new file mode 100644 index 000000000000..c447d21eb629 --- /dev/null +++ b/Number_types/test/Number_types/check_exact_backend.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +#include + +using namespace CGAL::internal; + +int main() +{ + static_assert( +#ifdef CGAL_USE_GMP + ( Default_exact_nt_backend!=GMP_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif +#ifdef CGAL_USE_GMPXX + ( Default_exact_nt_backend!=GMPXX_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif +#if defined(CGAL_USE_BOOST_MP) && defined(CGAL_USE_GMP) + ( Default_exact_nt_backend!=BOOST_GMP_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif +#if defined(CGAL_USE_BOOST_MP) + ( Default_exact_nt_backend!=BOOST_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif +#if defined(CGAL_USE_LEDA) + ( Default_exact_nt_backend!=LEDA_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif + ( Default_exact_nt_backend!=MP_FLOAT_BACKEND || (std::is_same_v && std::is_same_v>) ) + ); +} From 2991e85cdd03942a6bad6cde04358a4358fad817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 13:19:36 +0100 Subject: [PATCH 368/399] add function to display the exact backend as a string --- .../internal/Exact_type_selector.h | 19 +++++++++++++++++++ Number_types/test/Number_types/CMakeLists.txt | 1 + .../test/Number_types/check_exact_backend.cpp | 2 ++ 3 files changed, 22 insertions(+) diff --git a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h index d29278219dca..bcb5615fedc1 100644 --- a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h +++ b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h @@ -317,6 +317,25 @@ template < typename ET > struct Exact_type_selector : Exact_field_selector< ET > {}; #endif +constexpr const char* exact_nt_backend_string() +{ + switch(Default_exact_nt_backend) + { + case GMP_BACKEND: + return "GMP_BACKEND"; + case GMPXX_BACKEND: + return "GMPXX_BACKEND"; + case BOOST_GMP_BACKEND: + return "BOOST_GMP_BACKEND"; + case BOOST_BACKEND: + return "BOOST_BACKEND"; + case LEDA_BACKEND: + return "LEDA_BACKEND"; + case MP_FLOAT_BACKEND: + return "MP_FLOAT_BACKEND"; + } +} + } } // namespace CGAL::internal #undef CGAL_EXACT_SELECTORS_SPECS diff --git a/Number_types/test/Number_types/CMakeLists.txt b/Number_types/test/Number_types/CMakeLists.txt index 73488a8a819b..f8ff8698b72e 100644 --- a/Number_types/test/Number_types/CMakeLists.txt +++ b/Number_types/test/Number_types/CMakeLists.txt @@ -61,6 +61,7 @@ create_single_source_cgal_program("unsigned.cpp") create_single_source_cgal_program("utilities.cpp") create_single_source_cgal_program("Exact_rational.cpp") create_single_source_cgal_program("Mpzf_new.cpp") +create_single_source_cgal_program("check_exact_backend.cpp") if( CGAL_Core_FOUND ) create_single_source_cgal_program( "CORE_Expr_ticket_4296.cpp" ) diff --git a/Number_types/test/Number_types/check_exact_backend.cpp b/Number_types/test/Number_types/check_exact_backend.cpp index c447d21eb629..747b184ea23c 100644 --- a/Number_types/test/Number_types/check_exact_backend.cpp +++ b/Number_types/test/Number_types/check_exact_backend.cpp @@ -26,4 +26,6 @@ int main() #endif ( Default_exact_nt_backend!=MP_FLOAT_BACKEND || (std::is_same_v && std::is_same_v>) ) ); + + std::cout << "Exact backend is " << exact_nt_backend_string() << "\n"; } From 3804cf6371ce81d2630d913f0ed07dc9e677e2e5 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 27 Mar 2024 15:07:23 +0100 Subject: [PATCH 369/399] basic viewer example --- .../examples/Basic_viewer/draw_several_windows.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index f1fead0a1ded..2ac2ff2d66d0 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -14,16 +14,16 @@ #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; -typedef std::pair Pwn; -typedef CGAL::Polyhedron_3 Polyhedron; +using Kernel=CGAL::Exact_predicates_inexact_constructions_kernel; +using Point=Kernel::Point_3; +using Vector=Kernel::Vector_3; +using Pwn=std::pair; +using Polyhedron=CGAL::Polyhedron_3; using PS3=CGAL::Point_set_3; int main(void) { - /// (1) Some CGAL code that create data structure and fill Graphics_scene. + /// (1) Some CGAL code that create data structures and fill two Graphics_scene. std::vector points; if(!CGAL::IO::read_points(CGAL::data_file_path("points_3/kitten.xyz"), std::back_inserter(points), From f904090248cefdde67edde61f6670052aafd58b6 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 27 Mar 2024 18:08:04 +0100 Subject: [PATCH 370/399] basic viewer user manual --- .../doc/Basic_viewer/Basic_viewer.txt | 119 +++++------------- 1 file changed, 34 insertions(+), 85 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 202a6be8d29c..7b482c0a8019 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -8,7 +8,8 @@ namespace CGAL { \author Guillaume Damiand, Mostafa Ashraf \cgalAutoToc -\section Introduction + +\section BV_Intro Introduction The basic viewer package appears to serve as a foundation to provide a small interactive visualization tools of all CGAL data structures, such as Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more. The functionality of the package is to renders various geometric elements such as points, segments, rays, lines, faces, etc. @@ -18,19 +19,21 @@ The drawing can be tuned using a `CGAL::Graphics_scene_option` allowing to chang More complex usage can be achieved by using the `CGAL::Graphics_scene` class. Several representation of different CGAL data structures can be added in a same `CGAL::Graphics_scene` allowing to visualize different models in a same window. Like for the draw function, the drawing parameters can be tune thanks to the `CGAL::Graphics_scene_option`. -Two classes are based on Qt. (1) `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` (libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers). (2) `CGAL::Qt::QApplication_and_basic_viewer` which regroups a `Qt::QApplication` and a `CGAL::Basic_viewer`. +Two classes are based on Qt. (1) `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` (libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers). (2) `CGAL::Qt::QApplication_and_basic_viewer` which regroups a `Qt::QApplication` and a `CGAL::Qt::Basic_viewer`. -\section SoftwareDesignClassDiagam Software Design + +\section BV_SoftwareDesign Software Design -The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the different classes of the package. +The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the different classes and functions of the package. \cgalFigureBegin{fig_basic_viewer_diagramme_class,basic_viewer_diagramme_class.svg} -UML diagram of the main classes of the package. +UML diagram of the classes and functions of the package. \cgalFigureEnd TODO links the classes with the different sections where they will be explained -\section Basic Usage: global `CGAL::draw` functions + +\section BV_BasicUsage Basic Usage: global CGAL::draw functions A first simple solution provide to draw the different data structures of CGAL is the use of global `CGAL::draw` functions. This function is templated by the type of the data structure to draw. The following example shows a basic use of this function. @@ -66,7 +69,7 @@ The viewer includes support for a clipping plane, allowing users to selectively The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.).
  6. -\subsection GraphicSceneContinue Tune the drawing thanks to `CGAL::Graphics_scene_options` +\subsection BV_GraphicSceneOptions Tune the drawing thanks to CGAL::Graphics_scene_options There is one specialization of each draw function that takes a graphics scene options as parameter, allowing to tune the drawing. @@ -82,7 +85,6 @@ The result of this example can be shown in \cgalFigureRef{basic_viewer_ex2}. Example of tuned drawing of a 3D surface mesh where some vertex colors are changed. \cgalFigureEnd - The drawing options can depend on the cells. We illustrate this possibility of the following example which compute a color for each face depending on its height. \cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} @@ -93,7 +95,8 @@ The result of this example can be shown in \cgalFigureRef{basic_viewer_ex3} wher Example of mesh drawing with a color for each face computed thanks to its height. \cgalFigureEnd -\section Graphic_Scene + +\section BV_GraphicsScene CGAL::Graphics_Scene It is possible to do more advanced visualisations by using the class `CGAL::Graphics_scene`. Its goal is to be a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements (points, segments, rays, lines, text), possibly with colors. Things are a little bit different for faces. You should call `face_begin` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face` as many times as necessary, then call `face_end` to finish the face. Note that the given polygonal face is internally triangulated. @@ -113,97 +116,43 @@ The result of this example can be shown in \cgalFigureRef{basic_viewer_ex4} wher Example of drawing of a point cloud and a polyhedron in a same viewer. \cgalFigureEnd + +\section BV_BasicViewer Use the Qt widget CGAL::Qt::Basic_viewer +The class `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` and mainly stores a Graphics_scene and allows to visualize it and interact with the scene. Since this class is a Qt widget, it can be used into more complex Qt code to create more advanced demos. +In the following example, we illustrate this possibility by creating two graphics scenes, one filled by a point cloud, a second one filled by the polyhedral surface reconstructed the poisson surface reconstruction method. Then, we create two basic viewers associated with these two scenes. These basic viewer can be added into a same Qt layout allowing to visualize the two scenes side by side. -ICICICI - - - - - - - - - -\subsection GraphicSceneClass key components and functionality of this class: -
      - -
    1. Buffer Management: - -
        -
      1. The class manages buffers for different geometric elements, including mono and colored versions of points, segments, rays, lines, and faces. -
      2. Buffers are stored in the arrays array, which holds vectors of BufferType (defaulted to float), and each buffer is initialized in the constructor. -
      - -
    2. Bounding Box: -
        -
      1. The class maintains a bounding box (m_bounding_box) that encompasses all the geometric elements in the scene. -
      2. The bounding box can be initiated and updated based on the elements added to the scene. -
      - -
    3. Adding Geometric Elements: -
        -
      1. The class provides template member functions (add_point, add_segment, add_ray, etc.) for adding various geometric elements to the corresponding buffers. -
      2. It supports both mono and colored versions of these elements, allowing for the addition of color information. -
      - -
    4. Face Handling: -
        -
      1. The class supports the creation of faces by providing methods such as face_begin, add_point_in_face, and face_end. -
      2. Faces can be either mono or colored, and they are constructed by adding points to the corresponding face buffers. -
      - -
    5. Normal Handling: -
        -
      1. Normals for faces are handled separately for smooth and flat shading, and they are part of the normal buffers. -
      - -
    6. Text Handling: -
        -
      1. The class maintains a vector of text elements (m_texts), where each text element is associated with a 3D point in the scene. -
      2. Text elements can be added using the add_text member function. -
      +\cgalExample{Basic_viewer/draw_several_windows.cpp} -
    7. Utility Functions: -
        -
      1. The class provides utility functions such as checking if a face has started (a_face_started), clearing all buffers (clear), and determining if the scene is empty. -
      +The result of this example is shown in \cgalFigureRef{basic_viewer_ex5}, showing the two Basic_viewer side by side. -
    8. Coordinate System Information: -
        -
      1. The class contains functions to check if the data structure lies on a particular plane (XY, XZ, or YZ), providing information about the coordinate system. -
      +\cgalFigureBegin{basic_viewer_ex5,draw_several_windows.png} +Example of drawing of two Basic_viewer side by side. +\cgalFigureEnd -
    9. Local Coordinate Transformations: -
        -
      1. There are template functions (get_local_point and get_local_vector) for transforming CGAL points and vectors into a local coordinate system (Local_kernel). -
      -
    10. Size and Dimensionality: -
        -
      1. Functions like get_size_of_index and number_of_elements provide information about the size and dimensionality of buffers. -
      + +\section BV_Interactions Add some interactions with the viewer -
    11. Miscellaneous: -
        -
      1. The class allows for reversing all normals in the scene using the reverse_all_normals function. -
      2. The empty function checks whether the scene is empty. -
      3. Functions like has_zero_x, has_zero_y, and has_zero_z check if any element in the scene has a zero value in a specific coordinate. -
      +In all the previous examples, the models are only drawn once and there is no interaction with the visualization and the users that allow to update the drawing. -
    +It is possible to define such interactions thanks to the class `CGAL::Qt::QApplication_and_basic_viewer`. In this class, you can define your own function that is called automatically by the viewer when an user press a key. This can allow to change some parameters and update the drawing accordingly. -This class provides a comprehensive interface for managing and manipulating geometric data in a 3D scene, facilitating the rendering and interaction of complex scenes in a graphics application. +We illustrate this possibility in the following example that show a surface mesh, while coloring the small faces in red. To do so, we use our own graphics scene options than change the color of a face depending on its size. A face is considered small if its size is smaller than a certain threshold. This threashold can be updated by users, pressing key I to increase it and D to decrease it. This is done in the key pressed function defined in the `QApplication_and_basic_viewer`. When the threashold changes, the graphics scene are recomputed to take into account the modification of the size threashold. +\cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} -\section Use the Qt widget CGAL::Qt::Basic_viewer +The result of this example is shown in \cgalFigureRef{basic_viewer_ex6}, showing to the left the initial drawing of the 3D model, and to the right the same model after having changed the size threashold. -\cgalExample{Basic_viewer/draw_several_windows.cpp} +\cgalFigureBegin{basic_viewer_ex6,draw_surface_mesh_small_faces.png} +Two examples of drawing of a mesh with small faces in red. Left: With the initial threashold. Right: After having increased the threashold. +\cgalFigureEnd -\section Add some small interactions with the viewer + +\section BV_Design Design and Implementation History -\cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} +This package was started by Mostafa Ashraf during his 2022 GSOC project. Guillaume Damiand redeveloped almost entirely the package, examples and wrote the manual. */ From 1f04bad68e65e6ffdc39d943b755603097b01305 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 27 Mar 2024 21:22:03 +0100 Subject: [PATCH 371/399] Basic viewer user manual --- .../doc/Basic_viewer/Basic_viewer.txt | 32 +++++++++---------- .../doc/Basic_viewer/CGAL/Qt/Basic_viewer.h | 2 +- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 7b482c0a8019..d14313c787f7 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -11,7 +11,7 @@ namespace CGAL { \section BV_Intro Introduction -The basic viewer package appears to serve as a foundation to provide a small interactive visualization tools of all CGAL data structures, such as Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2, and more. The functionality of the package is to renders various geometric elements such as points, segments, rays, lines, faces, etc. +The basic viewer package appears to serve as a foundation to provide a small interactive visualization tools of all CGAL data structures, such as `Arrangement_on_surface_2`, `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`, and more. The functionality of the package is to renders various geometric elements such as points, segments, rays, lines, faces, etc. The most basic usage of the basic viewer is the use of the global `CGAL::draw` function. There is one draw function for each package CGAL. Such a call opens a new interactive window showing the given model and allowing to navigate in the scene, show or hide some specific cells, show the interior of the model if any... @@ -24,14 +24,12 @@ Two classes are based on Qt. (1) `CGAL::Qt::Basic_viewer` is a Qt widget that in \section BV_SoftwareDesign Software Design -The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the different classes and functions of the package. +The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the main different classes and functions of this package. \cgalFigureBegin{fig_basic_viewer_diagramme_class,basic_viewer_diagramme_class.svg} -UML diagram of the classes and functions of the package. +UML diagram of the classes and functions of the package (only partial representation). \cgalFigureEnd -TODO links the classes with the different sections where they will be explained - \section BV_BasicUsage Basic Usage: global CGAL::draw functions @@ -55,8 +53,8 @@ Different rendering modes, including mono and colored representations, are avail
  7. Camera Control: -The viewer allows users to switch between 2D and 3D viewing modes, adjusting the camera accordingly. -Camera settings, such as orthographic or perspective projection, can be configured based on the dimensionality of the scene.
  8. +The viewer allows users to move the camera, switch between 2D and 3D viewing modes, adjusting the camera accordingly. +Camera settings, such as orthographic or perspective projection, can be configured based on the dimension of the scene.
  9. User Interaction: @@ -73,7 +71,7 @@ The clipping plane can be toggled on and off, and its rendering style can be mod There is one specialization of each draw function that takes a graphics scene options as parameter, allowing to tune the drawing. -The Graphics_scene_options class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various cells such as vertices, edges, faces, and volumes in a graphical representation of a given data structure. +The `Graphics_scene_options` class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various cells such as vertices, edges, faces, and volumes in a graphical representation of a given data structure. The following example shows how to use a graphics scene options to tune the drawing of a surface mesh. In this example, we define our own class `My_graphics_scene_options` that inherits from `CGAL::Graphics_scene_options` to get all the default parameters. In this class, we only override the two methods `colored_vertex` and `vertex_color` to draw all vertices in color, and chose randomly green or blue colors for one out of two vertices. @@ -98,19 +96,19 @@ Example of mesh drawing with a color for each face computed thanks to its height \section BV_GraphicsScene CGAL::Graphics_Scene -It is possible to do more advanced visualisations by using the class `CGAL::Graphics_scene`. Its goal is to be a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements (points, segments, rays, lines, text), possibly with colors. Things are a little bit different for faces. You should call `face_begin` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face` as many times as necessary, then call `face_end` to finish the face. Note that the given polygonal face is internally triangulated. +It is possible to do more advanced visualizations by using the class `CGAL::Graphics_scene`. Its goal is to be a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements (points, segments, rays, lines, text), possibly with colors. Things are a little bit different for faces. You should call `face_begin` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face` as many times as necessary, then call `face_end` to finish the face. Note that the given polygonal face is internally triangulated. This class also stores the normal of the faces (computed automatically), and possibly the normal of the vertices that should be given by the users. -Users can either fill directly a `Graphics_scene` using these methods, or by using a global function `CGAL::add_to_graphics_scene` that fill the scene using all the geometric elements of the given CGAL data structure. Like for the draw functions, there is one `add_to_graphics_scene` for each CGAL data structure (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2). +Users can either fill directly a `Graphics_scene` using these methods, or by using a global function `CGAL::add_to_graphics_scene` that fill the scene using all the geometric elements of the given CGAL data structure. Like for the draw functions, there is one `add_to_graphics_scene` for each CGAL data structure (`Arrangement_on_surface_2`, `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`). A `Graphics_scene` can be drawn using the basic viewer thanks to the `CGAL::draw_graphics_scene` function. -The following example illustrates this possibility by showing in a same viewer both a `CGAL::Point_set_3` and a `CGAL::Polyhedron_3`. Note that, like the draw functions, each `add_to_graphics_scene` can use an optional Graphics_scene_options as parameter allowing to tune the drawing of the given data structure. In the example, we use this possibility to change the color of all vertices of the point set. +The following example illustrates this possibility by showing in a same viewer both a `CGAL::Point_set_3` and a `CGAL::Polyhedron_3`. Note that, like the draw functions, each `add_to_graphics_scene` can use an optional `Graphics_scene_options` as parameter allowing to tune the drawing of the given data structure. In the example, we use this possibility to change the color of all vertices of the point set. \cgalExample{Basic_viewer/draw_mesh_and_points.cpp} -The result of this example can be shown in \cgalFigureRef{basic_viewer_ex4} where we can see in green the original points of the point cloud, supperposed with the polyhedron surface reconstructed by the poisson surface reconstruction method. +The result of this example can be shown in \cgalFigureRef{basic_viewer_ex4} where we can see in green the original points of the point cloud, superposed with the polyhedron surface reconstructed by the Poisson surface reconstruction method. \cgalFigureBegin{basic_viewer_ex4,draw_mesh_and_points.png} Example of drawing of a point cloud and a polyhedron in a same viewer. @@ -119,9 +117,9 @@ Example of drawing of a point cloud and a polyhedron in a same viewer. \section BV_BasicViewer Use the Qt widget CGAL::Qt::Basic_viewer -The class `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` and mainly stores a Graphics_scene and allows to visualize it and interact with the scene. Since this class is a Qt widget, it can be used into more complex Qt code to create more advanced demos. +The class `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` and mainly stores a `Graphics_scene` and allows to visualize it and interact with the scene. Since this class is a Qt widget, it can be used into more complex Qt code to create more advanced demos. -In the following example, we illustrate this possibility by creating two graphics scenes, one filled by a point cloud, a second one filled by the polyhedral surface reconstructed the poisson surface reconstruction method. Then, we create two basic viewers associated with these two scenes. These basic viewer can be added into a same Qt layout allowing to visualize the two scenes side by side. +In the following example, we illustrate this possibility by creating two graphics scenes, one filled by a point cloud, a second one filled by the polyhedral surface reconstructed the Poisson surface reconstruction method. Then, we create two basic viewers associated with these two scenes. These basic viewer can be added into a same Qt layout allowing to visualize the two scenes side by side. \cgalExample{Basic_viewer/draw_several_windows.cpp} @@ -139,14 +137,14 @@ In all the previous examples, the models are only drawn once and there is no int It is possible to define such interactions thanks to the class `CGAL::Qt::QApplication_and_basic_viewer`. In this class, you can define your own function that is called automatically by the viewer when an user press a key. This can allow to change some parameters and update the drawing accordingly. -We illustrate this possibility in the following example that show a surface mesh, while coloring the small faces in red. To do so, we use our own graphics scene options than change the color of a face depending on its size. A face is considered small if its size is smaller than a certain threshold. This threashold can be updated by users, pressing key I to increase it and D to decrease it. This is done in the key pressed function defined in the `QApplication_and_basic_viewer`. When the threashold changes, the graphics scene are recomputed to take into account the modification of the size threashold. +We illustrate this possibility in the following example that show a surface mesh, while coloring the small faces in red. To do so, we use our own graphics scene options than change the color of a face depending on its size. A face is considered small if its size is smaller than a certain threshold. This threshold can be updated by users, pressing key I to increase it and D to decrease it. This is done in the key pressed function defined in the `QApplication_and_basic_viewer`. When the threshold changes, the graphics scene are recomputed to take into account the modification of the size threshold. \cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} -The result of this example is shown in \cgalFigureRef{basic_viewer_ex6}, showing to the left the initial drawing of the 3D model, and to the right the same model after having changed the size threashold. +The result of this example is shown in \cgalFigureRef{basic_viewer_ex6}, showing to the left the initial drawing of the 3D model, and to the right the same model after having changed the size threshold. \cgalFigureBegin{basic_viewer_ex6,draw_surface_mesh_small_faces.png} -Two examples of drawing of a mesh with small faces in red. Left: With the initial threashold. Right: After having increased the threashold. +Two examples of drawing of a mesh with small faces in red. Left: With the initial threshold. Right: After having increased the threshold. \cgalFigureEnd diff --git a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h index 2ed9bec56be3..6ff91f29739d 100644 --- a/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer.h @@ -151,7 +151,7 @@ class QApplication_and_basic_viewer { public: /// Constructor given a `Graphics_scene` and possibly a title. - QApplication_and_basic_viewer(const CGAL::Graphics_scene& buffer, + QApplication_and_basic_viewer(const CGAL::Graphics_scene& gs, const char* title="CGAL Basic Viewer"); /// runs the `QApplication`, i.e., open the Qt window. A call to this method is blocking, that is the program continues as soon as the user closes the window. From bb0b1aa6bb7746f0f06b6365d40bb7717d7b4584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 22:15:15 +0100 Subject: [PATCH 372/399] do not pollute CI with useless warnings/errors --- Documentation/doc/CMakeLists.txt | 4 ++++ Installation/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 0e7ddd3b95af..f9efeb99354f 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -354,6 +354,10 @@ configure_file(${CGAL_DOC_RESOURCE_DIR}/BaseDoxyfile.in set(CGAL_DOC_DOXY_DEFAULT "${CGAL_DOC_DXY_DIR}/BaseDoxyfile") +if (BE_QUIET) + file(APPEND ${CGAL_DOC_DOXY_DEFAULT} "WARN_LOGFILE=doxygen.log\n") +endif() + # pkglist_filter gets the path to the pkglist_filter of this source # directory. if(WIN32) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 6335ead84111..f28b65b785ef 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1052,7 +1052,7 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") execute_process( COMMAND "${CMAKE_COMMAND}" -DCGAL_BUILD_THREE_DOC=TRUE - -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} + -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} -DBE_QUIET=TRUE -DDOXYGEN_QUIET=TRUE "${CGAL_SOURCE_DIR}/Documentation/doc" WORKING_DIRECTORY "${DOC_DIR}") execute_process( From f8d2d3d3519aa1932aa4fd21f9fbdb9b8a926ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 28 Mar 2024 12:52:53 +0100 Subject: [PATCH 373/399] remove leftover --- Installation/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index f28b65b785ef..9f2e6648b198 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1052,7 +1052,7 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") execute_process( COMMAND "${CMAKE_COMMAND}" -DCGAL_BUILD_THREE_DOC=TRUE - -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} -DBE_QUIET=TRUE -DDOXYGEN_QUIET=TRUE + -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} -DBE_QUIET=TRUE "${CGAL_SOURCE_DIR}/Documentation/doc" WORKING_DIRECTORY "${DOC_DIR}") execute_process( From 031c833855116a54a2c5344e5caa3e13805ffbd5 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 28 Mar 2024 14:02:10 +0100 Subject: [PATCH 374/399] First pass on User Manual --- .../doc/Basic_viewer/Basic_viewer.txt | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index d14313c787f7..22eb03e9c160 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -11,45 +11,45 @@ namespace CGAL { \section BV_Intro Introduction -The basic viewer package appears to serve as a foundation to provide a small interactive visualization tools of all CGAL data structures, such as `Arrangement_on_surface_2`, `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`, and more. The functionality of the package is to renders various geometric elements such as points, segments, rays, lines, faces, etc. +The basic viewer package provides interactive visualization for most \cgal data structures, such as `Arrangement_on_surface_2`, `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`, and more. The functionality of the package is to render various geometric elements such as points, segments, rays, lines, faces, etc. -The most basic usage of the basic viewer is the use of the global `CGAL::draw` function. There is one draw function for each package CGAL. Such a call opens a new interactive window showing the given model and allowing to navigate in the scene, show or hide some specific cells, show the interior of the model if any... +The most basic usage of the basic viewer is the use of the global `CGAL::draw()` function. There is one draw function for each \cgal package. Such a call opens a new interactive window showing the given model and allowing to navigate in the scene, show or hide some specific cells, show the interior of the model if any... -The drawing can be tuned using a `CGAL::Graphics_scene_option` allowing to change the color of some cells or hide some cells. +The drawing can be tuned using `CGAL::Graphics_scene_options`, for example to change the color of some cells or hide some cells. -More complex usage can be achieved by using the `CGAL::Graphics_scene` class. Several representation of different CGAL data structures can be added in a same `CGAL::Graphics_scene` allowing to visualize different models in a same window. Like for the draw function, the drawing parameters can be tune thanks to the `CGAL::Graphics_scene_option`. +More complex usage can be achieved by using the `CGAL::Graphics_scene` class. Several representations of different \cgal data structures can be added in a same `CGAL::Graphics_scene` allowing to visualize different models in a same window. Like for the draw function, the drawing parameters can be tuned thanks to the `CGAL::Graphics_scene_options`. Two classes are based on Qt. (1) `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` (libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers). (2) `CGAL::Qt::QApplication_and_basic_viewer` which regroups a `Qt::QApplication` and a `CGAL::Qt::Basic_viewer`. \section BV_SoftwareDesign Software Design -The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the main different classes and functions of this package. +The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the main classes and functions of this package. \cgalFigureBegin{fig_basic_viewer_diagramme_class,basic_viewer_diagramme_class.svg} UML diagram of the classes and functions of the package (only partial representation). \cgalFigureEnd -\section BV_BasicUsage Basic Usage: global CGAL::draw functions +\section BV_BasicUsage Basic Usage: Global CGAL::draw Functions -A first simple solution provide to draw the different data structures of CGAL is the use of global `CGAL::draw` functions. This function is templated by the type of the data structure to draw. The following example shows a basic use of this function. +A first simple solution provided to draw the different data structures of \cgal is the global function `CGAL::draw()` function. This function is templated by the type of the data structure to draw. The following example shows how it can be used. \cgalExample{Basic_viewer/draw_lcc.cpp} -This example creates a 3D linear cell complex, fill it by creating an hexahedron, and draw it using the basic viewer. The result of the viewing is shown in the following figure. +This example creates a 3D linear cell complex of a hexahedron, and draws it. The result is shown in the following figure. \cgalFigureBegin{basic_viewer_ex1,lcc_draw.png} Example of drawing of a 3D LCC. \cgalFigureEnd -Users can interact with the viewer using some specific keys or mouse interactions. You can press 'h' key to visualize an help showing all the different shortcuts and mouse interactions. The main functionalities of the viewer are: +Users can interact with the viewer using some specific keys or mouse interactions. Pressing key 'h' makes pop up a help window showing the different shortcuts and mouse interactions. The main functionalities of the viewer are:
    • Versatile Rendering: The viewer supports the rendering of various geometric elements, such as points, edges, faces, rays, and lines. -Different rendering modes, including mono and colored representations, are available for these elements.
    • +Different rendering modes, including mono and colored representation, are available for these elements.
    • Camera Control: @@ -63,17 +63,17 @@ Key presses are mapped to specific actions, such as toggling the clipping plane,
    • Clipping Plane: -The viewer includes support for a clipping plane, allowing users to selectively render parts of the scene. +The viewer includes support for a clipping plane, enableing users to selectively render parts of the scene. The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.).
    -\subsection BV_GraphicSceneOptions Tune the drawing thanks to CGAL::Graphics_scene_options +\subsection BV_GraphicSceneOptions Tune the drawing thanks to Graphics Scene Options -There is one specialization of each draw function that takes a graphics scene options as parameter, allowing to tune the drawing. +There is one specialization of each draw function that takes graphics scene options as parameter, allowing to tune the drawing. The `Graphics_scene_options` class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various cells such as vertices, edges, faces, and volumes in a graphical representation of a given data structure. -The following example shows how to use a graphics scene options to tune the drawing of a surface mesh. In this example, we define our own class `My_graphics_scene_options` that inherits from `CGAL::Graphics_scene_options` to get all the default parameters. In this class, we only override the two methods `colored_vertex` and `vertex_color` to draw all vertices in color, and chose randomly green or blue colors for one out of two vertices. +The following example shows how to use graphics scene options to tune the drawing of a surface mesh. We define our own class `My_graphics_scene_options` that inherits from `CGAL::Graphics_scene_options` to get all the default parameters. In this class, we only override the two methods `colored_vertex` and `vertex_color` to draw all vertices in color, and chose randomly green or blue colors for one out of two vertices. \cgalExample{Basic_viewer/draw_surface_mesh_vcolor.cpp} @@ -83,61 +83,61 @@ The result of this example can be shown in \cgalFigureRef{basic_viewer_ex2}. Example of tuned drawing of a 3D surface mesh where some vertex colors are changed. \cgalFigureEnd -The drawing options can depend on the cells. We illustrate this possibility of the following example which compute a color for each face depending on its height. +The drawing options can depend on the cells. Inthe following example the color of each face depends on its height. \cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} -The result of this example can be shown in \cgalFigureRef{basic_viewer_ex3} where we can see that all faces in a same height share the same color. +The result of this example is shown in \cgalFigureRef{basic_viewer_ex3}. \cgalFigureBegin{basic_viewer_ex3,draw_surface_height.png} -Example of mesh drawing with a color for each face computed thanks to its height. +Example of mesh drawing with a color for each face computed depending on its height. \cgalFigureEnd -\section BV_GraphicsScene CGAL::Graphics_Scene +\section BV_GraphicsScene The Graphics Scene -It is possible to do more advanced visualizations by using the class `CGAL::Graphics_scene`. Its goal is to be a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements (points, segments, rays, lines, text), possibly with colors. Things are a little bit different for faces. You should call `face_begin` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face` as many times as necessary, then call `face_end` to finish the face. Note that the given polygonal face is internally triangulated. +It is possible to do more advanced visualizations by using the class `CGAL::Graphics_scene`. It is a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements, possibly with individual colors. Things are a little bit different for faces. You must call `face_begin()` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face()`, and call `face_end()` to finish the face. Note that the given polygonal face is internally triangulated. This class also stores the normal of the faces (computed automatically), and possibly the normal of the vertices that should be given by the users. -Users can either fill directly a `Graphics_scene` using these methods, or by using a global function `CGAL::add_to_graphics_scene` that fill the scene using all the geometric elements of the given CGAL data structure. Like for the draw functions, there is one `add_to_graphics_scene` for each CGAL data structure (`Arrangement_on_surface_2`, `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`). +Users can either fill directly a `Graphics_scene` using these methods, or by using a global function `CGAL::add_to_graphics_scene()` that fills the scene using all the geometric elements of the given \cgal data structure. Like for the draw functions, there is an overload of `add_to_graphics_scene()` for each \cgal data structure (`Arrangement_on_surface_2`, `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`). -A `Graphics_scene` can be drawn using the basic viewer thanks to the `CGAL::draw_graphics_scene` function. +A `Graphics_scene` can be drawn using the basic viewer thanks to the `CGAL::draw_graphics_scene()` function. -The following example illustrates this possibility by showing in a same viewer both a `CGAL::Point_set_3` and a `CGAL::Polyhedron_3`. Note that, like the draw functions, each `add_to_graphics_scene` can use an optional `Graphics_scene_options` as parameter allowing to tune the drawing of the given data structure. In the example, we use this possibility to change the color of all vertices of the point set. +The following example shows in a same viewer both a `CGAL::Point_set_3` and a `CGAL::Polyhedron_3`. Note that, like the draw functions, each `add_to_graphics_scene()` can use an optional `Graphics_scene_options` as parameter allowing to tune the drawing of the given data structure. In the example, we change the color of all vertices of the point set. \cgalExample{Basic_viewer/draw_mesh_and_points.cpp} -The result of this example can be shown in \cgalFigureRef{basic_viewer_ex4} where we can see in green the original points of the point cloud, superposed with the polyhedron surface reconstructed by the Poisson surface reconstruction method. +The result of this example is shown in \cgalFigureRef{basic_viewer_ex4} where we can see in green the original points of the point cloud, superposed with the polyhedron surface reconstructed by the Poisson surface reconstruction method. \cgalFigureBegin{basic_viewer_ex4,draw_mesh_and_points.png} Example of drawing of a point cloud and a polyhedron in a same viewer. \cgalFigureEnd -\section BV_BasicViewer Use the Qt widget CGAL::Qt::Basic_viewer +\section BV_BasicViewer The Basic Viewer Class The class `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` and mainly stores a `Graphics_scene` and allows to visualize it and interact with the scene. Since this class is a Qt widget, it can be used into more complex Qt code to create more advanced demos. -In the following example, we illustrate this possibility by creating two graphics scenes, one filled by a point cloud, a second one filled by the polyhedral surface reconstructed the Poisson surface reconstruction method. Then, we create two basic viewers associated with these two scenes. These basic viewer can be added into a same Qt layout allowing to visualize the two scenes side by side. +In the following example, we create two graphics scenes, one filled by a point cloud, a second one filled by the polyhedral surface reconstructed by the Poisson surface reconstruction method. Then, we create two basic viewers associated with these two scenes. The two basic viewers are added into a same Qt layout allowing to visualize the two scenes side by side. \cgalExample{Basic_viewer/draw_several_windows.cpp} -The result of this example is shown in \cgalFigureRef{basic_viewer_ex5}, showing the two Basic_viewer side by side. +The result of this example is shown in \cgalFigureRef{basic_viewer_ex5). \cgalFigureBegin{basic_viewer_ex5,draw_several_windows.png} -Example of drawing of two Basic_viewer side by side. +Example of drawing of two `Basic_viewer` side by side. \cgalFigureEnd -\section BV_Interactions Add some interactions with the viewer +\section BV_Interactions Adding Interaction -In all the previous examples, the models are only drawn once and there is no interaction with the visualization and the users that allow to update the drawing. +In the previous examples, the models are only drawn once and there is no interaction with the user to update the drawing. -It is possible to define such interactions thanks to the class `CGAL::Qt::QApplication_and_basic_viewer`. In this class, you can define your own function that is called automatically by the viewer when an user press a key. This can allow to change some parameters and update the drawing accordingly. +It is possible to define such interactions thanks to the class `CGAL::Qt::QApplication_and_basic_viewer`. In this class, you can define your own function that is called automatically by the viewer when a user presses a key. This can be used to change some parameters and update the drawing accordingly. -We illustrate this possibility in the following example that show a surface mesh, while coloring the small faces in red. To do so, we use our own graphics scene options than change the color of a face depending on its size. A face is considered small if its size is smaller than a certain threshold. This threshold can be updated by users, pressing key I to increase it and D to decrease it. This is done in the key pressed function defined in the `QApplication_and_basic_viewer`. When the threshold changes, the graphics scene are recomputed to take into account the modification of the size threshold. +We illustrate this possibility in the following example that shows a surface mesh, while coloring the small faces in red. To do so, we use our own graphics scene options than change the color of a face depending on its size. A face is considered small if its size is smaller than a certain threshold. This threshold can be updated by the user, pressing key 'I' to increase it and 'D' to decrease it. This is done in the key pressed function defined in the `QApplication_and_basic_viewer`. When the threshold changes, the graphics scene are recomputed to take into account the modification of the size threshold. \cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} @@ -150,9 +150,8 @@ Two examples of drawing of a mesh with small faces in red. Left: With the \section BV_Design Design and Implementation History -This package was started by Mostafa Ashraf during his 2022 GSOC project. Guillaume Damiand redeveloped almost entirely the package, examples and wrote the manual. +This package was started by Mostafa Ashraf during his 2022 GSoC project. Guillaume Damiand redeveloped almost entirely the package, examples and wrote the manual. */ } /* namespace CGAL */ - From 344ea7c9d59ffb05478addceef319c38bd353f0a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 14:12:55 +0100 Subject: [PATCH 375/399] typo in manual --- Basic_viewer/doc/Basic_viewer/Basic_viewer.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 22eb03e9c160..4dadaea10477 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -123,7 +123,7 @@ In the following example, we create two graphics scenes, one filled by a point c \cgalExample{Basic_viewer/draw_several_windows.cpp} -The result of this example is shown in \cgalFigureRef{basic_viewer_ex5). +The result of this example is shown in \cgalFigureRef{basic_viewer_ex5}. \cgalFigureBegin{basic_viewer_ex5,draw_several_windows.png} Example of drawing of two `Basic_viewer` side by side. From c19e64fa97840fed078e45a1f554bae9dac0135c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 28 Mar 2024 15:18:11 +0100 Subject: [PATCH 376/399] Second pass --- .../doc/Basic_viewer/Basic_viewer.txt | 44 +++++++++---------- .../doc/Basic_viewer/PackageDescription.txt | 6 ++- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 4dadaea10477..bad2f92a673a 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -11,15 +11,15 @@ namespace CGAL { \section BV_Intro Introduction -The basic viewer package provides interactive visualization for most \cgal data structures, such as `Arrangement_on_surface_2`, `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`, and more. The functionality of the package is to render various geometric elements such as points, segments, rays, lines, faces, etc. +The basic viewer package provides interactive visualization for most \cgal packages, such as \ref PkgArrangementOnSurface2Ref "2D Arrangements", `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`, and more. -The most basic usage of the basic viewer is the use of the global `CGAL::draw()` function. There is one draw function for each \cgal package. Such a call opens a new interactive window showing the given model and allowing to navigate in the scene, show or hide some specific cells, show the interior of the model if any... +The most simple use case of the basic viewer is the call of the global `draw()` function. There is one draw function for each \cgal package. Such a call opens a new interactive window showing the given model and allowing to navigate in the scene, show or hide some specific cells, show the interior of the model if any, etc. -The drawing can be tuned using `CGAL::Graphics_scene_options`, for example to change the color of some cells or hide some cells. +The drawing can be tuned using `Graphics_scene_options`, for example to change the color of some cells or hide some cells. -More complex usage can be achieved by using the `CGAL::Graphics_scene` class. Several representations of different \cgal data structures can be added in a same `CGAL::Graphics_scene` allowing to visualize different models in a same window. Like for the draw function, the drawing parameters can be tuned thanks to the `CGAL::Graphics_scene_options`. +More complex usage can be achieved by using the `Graphics_scene` class. Different \cgal data structures can be added in a same `Graphics_scene` allowing to visualize them simultaneously in a same window. Like for the draw function, the drawing parameters can be tuned thanks to the `Graphics_scene_options`. -Two classes are based on Qt. (1) `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` (libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers). (2) `CGAL::Qt::QApplication_and_basic_viewer` which regroups a `Qt::QApplication` and a `CGAL::Qt::Basic_viewer`. +Two classes are based on \qt. (1) `CGAL::Qt::Basic_viewer` is a \qt widget that inherits from `QGLViewer` (libQGLViewer is an open source C++ library based on \qt that eases the creation of OpenGL 3D viewers). (2) `CGAL::Qt::QApplication_and_basic_viewer` which regroups a `Qt::QApplication` and a `CGAL::Qt::Basic_viewer`. \section BV_SoftwareDesign Software Design @@ -31,9 +31,9 @@ UML diagram of the classes and functions of the package (only partial representa \cgalFigureEnd -\section BV_BasicUsage Basic Usage: Global CGAL::draw Functions +\section BV_BasicUsage Basic Usage: The Global Draw Functions -A first simple solution provided to draw the different data structures of \cgal is the global function `CGAL::draw()` function. This function is templated by the type of the data structure to draw. The following example shows how it can be used. +A first simple solution provided to draw the different data structures of \cgal is the global `draw()` function. This function is templated by the type of the data structure to draw. The following example shows how it can be used. \cgalExample{Basic_viewer/draw_lcc.cpp} @@ -63,17 +63,17 @@ Key presses are mapped to specific actions, such as toggling the clipping plane,
  10. Clipping Plane: -The viewer includes support for a clipping plane, enableing users to selectively render parts of the scene. +The viewer includes support for a clipping plane, enabling users to selectively render parts of the scene. The clipping plane can be toggled on and off, and its rendering style can be modified (solid, wireframe, etc.).
  11. -\subsection BV_GraphicSceneOptions Tune the drawing thanks to Graphics Scene Options +\subsection BV_GraphicSceneOptions Tuning with Graphics Scene Options -There is one specialization of each draw function that takes graphics scene options as parameter, allowing to tune the drawing. +There is one specialization of each draw function that takes graphics scene options as additional parameter, allowing to tune the drawing. -The `Graphics_scene_options` class is responsible for providing a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various cells such as vertices, edges, faces, and volumes in a graphical representation of a given data structure. +The `Graphics_scene_options` class provides a set of options and customization parameters for rendering geometric structures in a graphics scene. Its main purpose is to allow users to control the visual appearance of various cells such as vertices, edges, faces, and volumes in a graphical representation of a given data structure. -The following example shows how to use graphics scene options to tune the drawing of a surface mesh. We define our own class `My_graphics_scene_options` that inherits from `CGAL::Graphics_scene_options` to get all the default parameters. In this class, we only override the two methods `colored_vertex` and `vertex_color` to draw all vertices in color, and chose randomly green or blue colors for one out of two vertices. +The following example shows how to use graphics scene options to tune the drawing of a surface mesh. We define our own class `My_graphics_scene_options` that inherits from `Graphics_scene_options` to get all the default parameters. In this class, we only override the two methods `colored_vertex` and `vertex_color` to draw all vertices in color, and chose randomly green or blue colors for one out of two vertices. \cgalExample{Basic_viewer/draw_surface_mesh_vcolor.cpp} @@ -83,7 +83,7 @@ The result of this example can be shown in \cgalFigureRef{basic_viewer_ex2}. Example of tuned drawing of a 3D surface mesh where some vertex colors are changed. \cgalFigureEnd -The drawing options can depend on the cells. Inthe following example the color of each face depends on its height. +The drawing options can depend on the cells. In the following example the color of each face depends on its height. \cgalExample{Basic_viewer/draw_surface_mesh_height.cpp} @@ -96,15 +96,15 @@ Example of mesh drawing with a color for each face computed depending on its hei \section BV_GraphicsScene The Graphics Scene -It is possible to do more advanced visualizations by using the class `CGAL::Graphics_scene`. It is a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements, possibly with individual colors. Things are a little bit different for faces. You must call `face_begin()` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face()`, and call `face_end()` to finish the face. Note that the given polygonal face is internally triangulated. +It is possible to do more advanced visualizations by using the class `Graphics_scene`. It is a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements, possibly with individual colors. Things are a little bit different for faces. You must call `face_begin()` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face()`, and call `face_end()` to finish the face. Note that the given polygonal face is internally triangulated. -This class also stores the normal of the faces (computed automatically), and possibly the normal of the vertices that should be given by the users. +This class also stores the normal of the faces (computed automatically), and possibly the normal of the vertices that can be provided by the users. -Users can either fill directly a `Graphics_scene` using these methods, or by using a global function `CGAL::add_to_graphics_scene()` that fills the scene using all the geometric elements of the given \cgal data structure. Like for the draw functions, there is an overload of `add_to_graphics_scene()` for each \cgal data structure (`Arrangement_on_surface_2`, `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`). +Users can either fill directly a `Graphics_scene` using these methods, or by using a global function `add_to_graphics_scene()` that fills the scene using all the geometric elements of a given \cgal data structure. Like for the draw functions, there is an overload of `add_to_graphics_scene()` for each \cgal package. -A `Graphics_scene` can be drawn using the basic viewer thanks to the `CGAL::draw_graphics_scene()` function. +A `Graphics_scene` can be drawn using the basic viewer thanks to the `draw_graphics_scene()` function. -The following example shows in a same viewer both a `CGAL::Point_set_3` and a `CGAL::Polyhedron_3`. Note that, like the draw functions, each `add_to_graphics_scene()` can use an optional `Graphics_scene_options` as parameter allowing to tune the drawing of the given data structure. In the example, we change the color of all vertices of the point set. +The following example shows in a same viewer both a `Point_set_3` and a `Polyhedron_3`. Note that, like the draw functions, each `add_to_graphics_scene()` can use an optional `Graphics_scene_options` as parameter allowing to tune the drawing of the given data structure. In the example, we change the color of all vertices of the point set. \cgalExample{Basic_viewer/draw_mesh_and_points.cpp} @@ -117,9 +117,9 @@ Example of drawing of a point cloud and a polyhedron in a same viewer. \section BV_BasicViewer The Basic Viewer Class -The class `CGAL::Qt::Basic_viewer` is a Qt widget that inherits from `QGLViewer` and mainly stores a `Graphics_scene` and allows to visualize it and interact with the scene. Since this class is a Qt widget, it can be used into more complex Qt code to create more advanced demos. +The class `CGAL::Qt::Basic_viewer` is a \qt widget that inherits from `QGLViewer` and mainly stores a `Graphics_scene` and allows to visualize it and interact with the scene. Since this class is a \qt widget, it can be used into more complex \qt code to create more advanced demos. -In the following example, we create two graphics scenes, one filled by a point cloud, a second one filled by the polyhedral surface reconstructed by the Poisson surface reconstruction method. Then, we create two basic viewers associated with these two scenes. The two basic viewers are added into a same Qt layout allowing to visualize the two scenes side by side. +In the following example, we create two graphics scenes, one filled with a point cloud, a second one filled with the polyhedral surface reconstructed by the Poisson surface reconstruction method. Then, we create two basic viewers associated with these two scenes. The two basic viewers are added into a \qt layout allowing to visualize the two scenes side by side. \cgalExample{Basic_viewer/draw_several_windows.cpp} @@ -137,7 +137,7 @@ In the previous examples, the models are only drawn once and there is no interac It is possible to define such interactions thanks to the class `CGAL::Qt::QApplication_and_basic_viewer`. In this class, you can define your own function that is called automatically by the viewer when a user presses a key. This can be used to change some parameters and update the drawing accordingly. -We illustrate this possibility in the following example that shows a surface mesh, while coloring the small faces in red. To do so, we use our own graphics scene options than change the color of a face depending on its size. A face is considered small if its size is smaller than a certain threshold. This threshold can be updated by the user, pressing key 'I' to increase it and 'D' to decrease it. This is done in the key pressed function defined in the `QApplication_and_basic_viewer`. When the threshold changes, the graphics scene are recomputed to take into account the modification of the size threshold. +We illustrate this possibility in the following example that shows a surface mesh, while coloring the small faces in red. To do so, we use our own graphics scene options than change the color of a face depending on its size. A face is considered small if its size is below a certain threshold. This threshold can be updated by the user, pressing key 'I' to increase it and 'D' to decrease it. This is done in the key pressed function defined in the `QApplication_and_basic_viewer`. When the threshold changes, the graphics scene is recomputed to take the modification of the size threshold into account. \cgalExample{Basic_viewer/draw_surface_mesh_small_faces.cpp} @@ -150,7 +150,7 @@ Two examples of drawing of a mesh with small faces in red. Left: With the \section BV_Design Design and Implementation History -This package was started by Mostafa Ashraf during his 2022 GSoC project. Guillaume Damiand redeveloped almost entirely the package, examples and wrote the manual. +This package was started by Mostafa Ashraf during his 2022 GSoC project. Guillaume Damiand, who mentored the project, reworked large parts of the package, wrote examples and the manual. */ diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 4e505a4b6a28..3cc9aa7fd40f 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -12,7 +12,11 @@ \cgalPkgPicture{basic_viewer_logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand} -\cgalPkgDesc{This package provides a basic viewer class TODO.} +\cgalPkgDesc{This package provides interactive visualization for most \cgal packages. +First, the function `draw()` is provided for each data structure. +Several data structures can be added to a same graphics scene and visualized simultaneously. +Rendering can be controlled (color, point size, etc.). +Finally a \qt widget is provided that can be integrated in the GUI of a user application.} \cgalPkgManuals{Chapter_Basic_viewer,PkgBasicViewerRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin From 41ebe968dfde50e907e2b766dd5bed3bf7929857 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 15:52:24 +0100 Subject: [PATCH 377/399] change draw height color examples --- Basic_viewer/examples/Basic_viewer/CMakeLists.txt | 2 ++ .../Basic_viewer/draw_surface_mesh_height.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt index c1b97ddd9e75..f758661d6bb7 100644 --- a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt +++ b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt @@ -29,6 +29,8 @@ if(CGAL_Qt6_FOUND) target_link_libraries(draw_surface_mesh_height PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_surface_mesh_vcolor PUBLIC CGAL::CGAL_Basic_viewer) +else() + message("CGAL_Qt6 not configured: examples that require Qt will not be compiled.") endif() if(TARGET CGAL::Eigen3_support) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp index e81063b85dad..719ac3254edc 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_height.cpp @@ -18,33 +18,33 @@ struct Colored_faces_given_height: { if(sm.is_empty()) return; - double m_min_z=0., m_max_z=0.; + double m_min_y=0., m_max_y=0.; bool first=true; for(typename Mesh::Vertex_index vi: sm.vertices()) { if(first) - { m_min_z=sm.point(vi).z(); m_max_z=m_min_z; first=false; } + { m_min_y=sm.point(vi).y(); m_max_y=m_min_y; first=false; } else { - m_min_z=(std::min)(m_min_z, sm.point(vi).z()); - m_max_z=(std::max)(m_max_z, sm.point(vi).z()); + m_min_y=(std::min)(m_min_y, sm.point(vi).y()); + m_max_y=(std::max)(m_max_y, sm.point(vi).y()); } } this->colored_face=[](const Mesh &, typename Mesh::Face_index)->bool { return true; }; - this->face_color=[m_min_z, m_max_z] + this->face_color=[m_min_y, m_max_y] (const Mesh& sm, typename Mesh::Face_index fi)->CGAL::IO::Color { double res=0.; std::size_t n=0; for(typename Mesh::Vertex_index vi: vertices_around_face(sm.halfedge(fi), sm)) { - res+=sm.point(vi).z(); + res+=sm.point(vi).y(); ++n; } // Random color depending on the "height" of the facet - CGAL::Random random(static_cast(30*((res/n)-m_min_z)/(m_max_z-m_min_z))); + CGAL::Random random(static_cast(30*((res/n)-m_min_y)/(m_max_y-m_min_y))); return CGAL::get_random_color(random); }; } From eb03647cb17c468ec18e5dd59a5e4a33cbbc9380 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 16:45:02 +0100 Subject: [PATCH 378/399] Rename variable for graphics scene --- .../draw_surface_mesh_small_faces.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 3275b40981c3..396f3a9a8149 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -99,17 +99,17 @@ int main(int argc, char* argv[]) { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } Graphics_scene_options_small_faces gsosm(sm); - CGAL::Graphics_scene buffer; + CGAL::Graphics_scene gs; - add_to_graphics_scene(sm, buffer, gsosm); + add_to_graphics_scene(sm, gs, gsosm); #ifdef CGAL_USE_BASIC_VIEWER - CGAL::Qt::QApplication_and_basic_viewer app(buffer, "Small faces"); + CGAL::Qt::QApplication_and_basic_viewer app(gs, "Small faces"); if(app) { app.basic_viewer().on_key_pressed= - [&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool + [&sm, &gsosm, &gs] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) @@ -119,8 +119,8 @@ int main(int argc, char* argv[]) basic_viewer->displayMessage (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); - buffer.clear(); - add_to_graphics_scene(sm, buffer, gsosm); + gs.clear(); + add_to_graphics_scene(sm, gs, gsosm); basic_viewer->redraw(); } else if ((e->key() == ::Qt::Key_D) && (modifiers == ::Qt::NoButton)) @@ -130,8 +130,8 @@ int main(int argc, char* argv[]) basic_viewer->displayMessage (QString("Small faces threshold=%1.").arg(gsosm.m_threshold)); - buffer.clear(); - add_to_graphics_scene(sm, buffer, gsosm); + gs.clear(); + add_to_graphics_scene(sm, gs, gsosm); basic_viewer->redraw(); } else From 4d1a4b039449f5512f7f652069de3261bf995e94 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 16:45:21 +0100 Subject: [PATCH 379/399] Basic viewer user manual: several fixes --- Basic_viewer/doc/Basic_viewer/Basic_viewer.txt | 16 +++++++++++++++- .../doc/Basic_viewer/PackageDescription.txt | 10 ++++++---- Basic_viewer/doc/Basic_viewer/dependencies | 1 + 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index bad2f92a673a..87896219fda3 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -11,7 +11,21 @@ namespace CGAL { \section BV_Intro Introduction -The basic viewer package provides interactive visualization for most \cgal packages, such as \ref PkgArrangementOnSurface2Ref "2D Arrangements", `Boolean_set_operations_2`, `Linear_cell_complex`, `Nef_3`, `Periodic_2_triangulation_2`, `Point_set_3`, `Polygon`, `Polyhedron`, `Straight_skeleton_2`, `Surface_mesh`, `Triangulation_2`, `Triangulation_3`, `Voronoi_diagram_2`, and more. +The basic viewer package provides interactive visualization for most \cgal packages, such as +\ref PkgArrangementOnSurface2Ref "2D Arrangements", +\ref PkgBooleanSetOperations2Ref "2D Boolean Set", +\ref PkgLinearCellComplexRef "Linear cell complex", +\ref PkgNef3Ref "3D Nef", +\ref PkgPeriodic2Triangulation2Ref "2D Periodic Triangulations", +\ref PkgPointSet3Ref "3D Point Set", +\ref PkgPolygon2Ref "2D Polygon", +\ref PkgPolyhedronRef "3D Polyhedral Surface", +\ref PkgStraightSkeleton2Ref "2D Straight Skeleton", +\ref PkgSurface_mesh "Surface Mesh", +\ref PkgTriangulation2Ref "2D Triangulation", +\ref PkgTriangulation3Ref "3D Triangulation", +\ref PkgVoronoiDiagram2Ref "2D Voronoi Diagram", +and more. The most simple use case of the basic viewer is the call of the global `draw()` function. There is one draw function for each \cgal package. Such a call opens a new interactive window showing the given model and allowing to navigate in the scene, show or hide some specific cells, show the interior of the model if any, etc. diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 3cc9aa7fd40f..7891cc174474 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -46,9 +46,10 @@ Finally a \qt widget is provided that can be integrated in the GUI of a user app - `CGAL::Arrangement_2` \link PkgArrangementOnSurface2Draw CGAL::draw() \endlink - `CGAL::Constrained_triangulation_2` \link PkgDrawTriangulation2 CGAL::draw() \endlink -- `CGAL::Linear_cell_complex` \link PkgDrawLinearCellComplex CGAL::draw() \endlink +- `CGAL::Linear_cell_complex_for_combinatorial_map` \link PkgDrawLinearCellComplex CGAL::draw() \endlink +- `CGAL::Linear_cell_complex_for_generalized_map` \link PkgDrawLinearCellComplex CGAL::draw() \endlink - `CGAL::Nef_polyhedron_3` \link PkgDrawNef3 CGAL::draw() \endlink -- `CGAL::Periodic_2_Triangulation_2` \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink +- `CGAL::Periodic_2_triangulation_2` \link PkgDrawPeriodic2Triangulation2 CGAL::draw() \endlink - `CGAL::Point_set_3` \link PkgDrawPointSet3D CGAL::draw() \endlink - `CGAL::Polygon_2` \link PkgDrawPolygon2 CGAL::draw() \endlink - `CGAL::Polygon_set_2` \link PkgDrawPolygonSet2 CGAL::draw() \endlink @@ -64,9 +65,10 @@ Finally a \qt widget is provided that can be integrated in the GUI of a user app - `CGAL::Arrangement_2` \link PkgArrangementOnSurface2Draw CGAL::add_to_graphics_scene() \endlink - `CGAL::Constrained_triangulation_2` \link PkgDrawTriangulation2 CGAL::add_to_graphics_scene() \endlink -- `CGAL::Linear_cell_complex` \link PkgDrawLinearCellComplex CGAL::add_to_graphics_scene() \endlink +- `CGAL::Linear_cell_complex_for_combinatorial_map` \link PkgDrawLinearCellComplex CGAL::add_to_graphics_scene() \endlink +- `CGAL::Linear_cell_complex_for_generalized_map` \link PkgDrawLinearCellComplex CGAL::add_to_graphics_scene() \endlink - `CGAL::Nef_polyhedron_3` \link PkgDrawNef3 CGAL::add_to_graphics_scene() \endlink -- `CGAL::Periodic_2_Triangulation_2` \link PkgDrawPeriodic2Triangulation2 CGAL::add_to_graphics_scene() \endlink +- `CGAL::Periodic_2_triangulation_2` \link PkgDrawPeriodic2Triangulation2 CGAL::add_to_graphics_scene() \endlink - `CGAL::Point_set_3` \link PkgDrawPointSet3D CGAL::add_to_graphics_scene() \endlink - `CGAL::Polygon_2` \link PkgDrawPolygon2 CGAL::add_to_graphics_scene() \endlink - `CGAL::Polygon_set_2` \link PkgDrawPolygonSet2 CGAL::add_to_graphics_scene() \endlink diff --git a/Basic_viewer/doc/Basic_viewer/dependencies b/Basic_viewer/doc/Basic_viewer/dependencies index 296159a45e74..c684a90bb27f 100644 --- a/Basic_viewer/doc/Basic_viewer/dependencies +++ b/Basic_viewer/doc/Basic_viewer/dependencies @@ -6,6 +6,7 @@ Periodic_2_triangulation_2 Point_set_3 Polygon Polyhedron +Straight_skeleton_2 Surface_mesh Surface_mesh_topology Triangulation_2 From ff4a201b2aaae5561559d80b4b02f2aaba0c24fe Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 16:49:29 +0100 Subject: [PATCH 380/399] bibtex --- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 7891cc174474..07d666823950 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -11,7 +11,7 @@ \cgalPkgDescriptionBegin{Basic Viewer,PkgBasicViewer} \cgalPkgPicture{basic_viewer_logo.png} \cgalPkgSummaryBegin -\cgalPkgAuthor{Guillaume Damiand} +\cgalPkgAuthor{Guillaume Damiand, Mostafa Ashraf} \cgalPkgDesc{This package provides interactive visualization for most \cgal packages. First, the function `draw()` is provided for each data structure. Several data structures can be added to a same graphics scene and visualized simultaneously. @@ -21,7 +21,7 @@ Finally a \qt widget is provided that can be integrated in the GUI of a user app \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{6.0} -\cgalPkgBib{cgal:XXX} +\cgalPkgBib{cgal:d-bv-24} \cgalPkgLicense{\ref licensesLGPL "LGPL"} \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd From 70d398b6927461a34e1bd8d9dcd6b60b376e289e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 17:41:43 +0100 Subject: [PATCH 381/399] add examples of drawing of polygon with holes --- Polygon/examples/Polygon/CMakeLists.txt | 1 + .../Polygon/draw_polygon_with_holes_2.cpp | 46 +++++++++++++++++++ .../CGAL/draw_multipolygon_with_holes_2.h | 32 +++++++------ 3 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 Polygon/examples/Polygon/draw_polygon_with_holes_2.cpp diff --git a/Polygon/examples/Polygon/CMakeLists.txt b/Polygon/examples/Polygon/CMakeLists.txt index 1d559bbe210d..d70f0d7df184 100644 --- a/Polygon/examples/Polygon/CMakeLists.txt +++ b/Polygon/examples/Polygon/CMakeLists.txt @@ -18,5 +18,6 @@ endforeach() if(CGAL_Qt6_FOUND) target_link_libraries(draw_polygon PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_polygon_with_holes PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(draw_polygon_with_holes_2 PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_multipolygon_with_holes PUBLIC CGAL::CGAL_Basic_viewer) endif() diff --git a/Polygon/examples/Polygon/draw_polygon_with_holes_2.cpp b/Polygon/examples/Polygon/draw_polygon_with_holes_2.cpp new file mode 100644 index 000000000000..3306655a135f --- /dev/null +++ b/Polygon/examples/Polygon/draw_polygon_with_holes_2.cpp @@ -0,0 +1,46 @@ +/*! \file draw_polygon_with_holes_2.cpp + */ + +#include +#include +#include +#include + +using K=CGAL::Exact_predicates_inexact_constructions_kernel; +using Point_2=K::Point_2; +using Polygon_2=CGAL::Polygon_2; +using Polygon_with_holes_2=CGAL::Polygon_with_holes_2; + +Polygon_2 triangle(double x, double y) +{ // Create a triangle (x, y) + Polygon_2 P; + P.push_back(Point_2(x, y)); + P.push_back(Point_2(x+0.5, y+1)); + P.push_back(Point_2(x+1, y)); + return P; +} + +Polygon_2 rectangle(double l) +{ // Create a rectangle with given side length. + Polygon_2 P; + P.push_back(Point_2(0, 0)); + P.push_back(Point_2(l, 0)); + P.push_back(Point_2(l, l)); + P.push_back(Point_2(0, l)); + return P; +} + +int main() +{ + // Create a large rectangle A, with 3 triangle holes + Polygon_with_holes_2 A(rectangle(4)); + Polygon_2 H1(triangle(1, 1)); + Polygon_2 H2(triangle(2, 1)); + Polygon_2 H3(triangle(1.5, 2)); + A.add_hole(H1); + A.add_hole(H2); + A.add_hole(H3); + CGAL::draw(A); + + return 0; +} diff --git a/Polygon/include/CGAL/draw_multipolygon_with_holes_2.h b/Polygon/include/CGAL/draw_multipolygon_with_holes_2.h index 909b4b29da82..1584845f19f1 100644 --- a/Polygon/include/CGAL/draw_multipolygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_multipolygon_with_holes_2.h @@ -18,7 +18,7 @@ #ifndef CGAL_DRAW_MULTIPOLYGON_WITH_HOLES_2_H #define CGAL_DRAW_MULTIPOLYGON_WITH_HOLES_2_H -#include +#include #ifdef DOXYGEN_RUNNING namespace CGAL { @@ -53,8 +53,8 @@ namespace CGAL { // Viewer class for Multipolygon_with_holes_2 template -class Mpwh_2_basic_viewer_qt : public Basic_viewer_qt { - using Base = Basic_viewer_qt; +class Mpwh_2_basic_viewer_qt : public Qt::Basic_viewer { + using Base = Qt::Basic_viewer; using Mpwh = Multipolygon; using Pwh = typename Mpwh::Polygon_with_holes_2; using Pgn = typename Mpwh::Polygon_2; @@ -67,7 +67,7 @@ class Mpwh_2_basic_viewer_qt : public Basic_viewer_qt { /// @param title the title of the window Mpwh_2_basic_viewer_qt(QWidget* parent, const Mpwh& mpwh, const char* title = "Basic Multipolygon_with_holes_2 Viewer") : - Base(parent, title, true, true, true, false, false), + Base(parent, gs, title, true, true, true, false, false), m_mpwh(mpwh) { if (mpwh.number_of_polygons_with_holes() == 0) return; @@ -109,11 +109,11 @@ class Mpwh_2_basic_viewer_qt : public Basic_viewer_qt { /*! Compute the elements of a multipolygon with holes. */ void add_elements() { - clear(); + gs.clear(); for (auto const& p: m_mpwh.polygons_with_holes()) { CGAL::IO::Color c(rand()%255,rand()%255,rand()%255); - face_begin(c); + gs.face_begin(c); const Pnt* point_in_face; const auto& outer_boundary = p.outer_boundary(); @@ -122,10 +122,10 @@ class Mpwh_2_basic_viewer_qt : public Basic_viewer_qt { for (auto it = p.holes_begin(); it != p.holes_end(); ++it) { compute_loop(*it, true); - add_point_in_face(*point_in_face); + gs.add_point_in_face(*point_in_face); } - face_end(); + gs.face_end(); } } @@ -133,21 +133,21 @@ class Mpwh_2_basic_viewer_qt : public Basic_viewer_qt { /*! Compute the face */ void compute_loop(const Pgn& p, bool hole) { - if (hole) add_point_in_face(p.vertex(p.size()-1)); + if (hole) gs.add_point_in_face(p.vertex(p.size()-1)); auto prev = p.vertices_begin(); auto it = prev; - add_point(*it); - add_point_in_face(*it); + gs.add_point(*it); + gs.add_point_in_face(*it); for (++it; it != p.vertices_end(); ++it) { - add_segment(*prev, *it); // add segment with previous point - add_point(*it); - add_point_in_face(*it); // add point in face + gs.add_segment(*prev, *it); // add segment with previous point + gs.add_point(*it); + gs.add_point_in_face(*it); // add point in face prev = it; } // Add the last segment between the last point and the first one - add_segment(*prev, *(p.vertices_begin())); + gs.add_segment(*prev, *(p.vertices_begin())); } virtual void keyPressEvent(QKeyEvent* e) { @@ -166,6 +166,8 @@ class Mpwh_2_basic_viewer_qt : public Basic_viewer_qt { } private: + Graphics_scene gs; + //! The window width in pixels. int m_width = CGAL_BASIC_VIEWER_INIT_SIZE_X; From 6cf73a65a9bfbe531dc350e3038e5e0d7cadacfb Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 28 Mar 2024 18:24:22 +0100 Subject: [PATCH 382/399] minor changes --- Basic_viewer/doc/Basic_viewer/Basic_viewer.txt | 8 +++++--- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 87896219fda3..799855f1d813 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -33,14 +33,16 @@ The drawing can be tuned using `Graphics_scene_options`, for example to change t More complex usage can be achieved by using the `Graphics_scene` class. Different \cgal data structures can be added in a same `Graphics_scene` allowing to visualize them simultaneously in a same window. Like for the draw function, the drawing parameters can be tuned thanks to the `Graphics_scene_options`. -Two classes are based on \qt. (1) `CGAL::Qt::Basic_viewer` is a \qt widget that inherits from `QGLViewer` (libQGLViewer is an open source C++ library based on \qt that eases the creation of OpenGL 3D viewers). (2) `CGAL::Qt::QApplication_and_basic_viewer` which regroups a `Qt::QApplication` and a `CGAL::Qt::Basic_viewer`. +Two classes are based on \qt. + - `CGAL::Qt::Basic_viewer` is a \qt widget that inherits from `QGLViewer` (libQGLViewer is an open source C++ library based on \qt that eases the creation of OpenGL 3D viewers). + - `CGAL::Qt::QApplication_and_basic_viewer` which regroups a `Qt::QApplication` and a `CGAL::Qt::Basic_viewer`. \section BV_SoftwareDesign Software Design -The diagram in \cgalFigureRef{fig_basic_viewer_diagramme_class} shows the main classes and functions of this package. +The diagram in \cgalFigureRef{fig_basic_viewer_diagram_class} shows the main classes and functions of this package. -\cgalFigureBegin{fig_basic_viewer_diagramme_class,basic_viewer_diagramme_class.svg} +\cgalFigureBegin{fig_basic_viewer_diagram_class,basic_viewer_diagramme_class.svg} UML diagram of the classes and functions of the package (only partial representation). \cgalFigureEnd diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index 07d666823950..aa919ce3e389 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -21,7 +21,7 @@ Finally a \qt widget is provided that can be integrated in the GUI of a user app \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{6.0} -\cgalPkgBib{cgal:d-bv-24} +\cgalPkgBib{cgal:d-bv} \cgalPkgLicense{\ref licensesLGPL "LGPL"} \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd From 04cf39bd8cbd8bea6c16965a2ce92791cf3912ce Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 28 Mar 2024 18:34:26 +0100 Subject: [PATCH 383/399] CMake: simplify, now that C++17 is required --- .../examples/Point_set_3/CMakeLists.txt | 4 +-- .../Polygon_mesh_processing/CMakeLists.txt | 4 +-- .../demo/Polyhedron/Plugins/IO/CMakeLists.txt | 34 ++++++------------- .../test/Triangulation_3/CMakeLists.txt | 13 ++----- 4 files changed, 16 insertions(+), 39 deletions(-) diff --git a/Point_set_3/examples/Point_set_3/CMakeLists.txt b/Point_set_3/examples/Point_set_3/CMakeLists.txt index 747ba9d79922..833fb5097194 100644 --- a/Point_set_3/examples/Point_set_3/CMakeLists.txt +++ b/Point_set_3/examples/Point_set_3/CMakeLists.txt @@ -11,9 +11,7 @@ create_single_source_cgal_program("point_set.cpp") create_single_source_cgal_program("point_set_property.cpp") create_single_source_cgal_program("point_set_read_xyz.cpp") create_single_source_cgal_program("point_set_advanced.cpp") - -set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates) -create_single_source_cgal_program("point_set_read_ply.cpp" CXX_FEATURES ${needed_cxx_features}) +create_single_source_cgal_program("point_set_read_ply.cpp") find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 455e1ce2be7a..d66c727f73d9 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -14,8 +14,8 @@ create_single_source_cgal_program("polyhedral_envelope_of_triangle_soup.cpp" ) create_single_source_cgal_program("polyhedral_envelope_mesh_containment.cpp" ) create_single_source_cgal_program("self_intersections_example.cpp" ) create_single_source_cgal_program("stitch_borders_example.cpp" ) -create_single_source_cgal_program("compute_normals_example_Polyhedron.cpp" CXX_FEATURES cxx_range_for ) -create_single_source_cgal_program("compute_normals_example.cpp" CXX_FEATURES cxx_range_for cxx_auto_type ) +create_single_source_cgal_program("compute_normals_example_Polyhedron.cpp") +create_single_source_cgal_program("compute_normals_example.cpp") create_single_source_cgal_program("point_inside_example.cpp") create_single_source_cgal_program("triangulate_faces_example.cpp") create_single_source_cgal_program("triangulate_faces_split_visitor_example.cpp") diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt index ec7b583d8a28..d80560ab5d4a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt @@ -79,30 +79,18 @@ endif() polyhedron_demo_plugin(xyz_plugin XYZ_io_plugin KEYWORDS Viewer PointSetProcessing Classification) target_link_libraries(xyz_plugin PUBLIC scene_points_with_normal_item) -list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_rvalue_references has_cxx_rvalues) -list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_variadic_templates has_cxx_variadic) - -if(has_cxx_rvalues LESS 0 OR has_cxx_variadic LESS 0) - message(STATUS "NOTICE: LAS/PLY IO examples require a C++11 compiler and will not be compiled.") -else() - set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates) - - polyhedron_demo_plugin(ply_plugin PLY_io_plugin KEYWORDS Viewer PointSetProcessing Classification PMP) - target_link_libraries(ply_plugin PUBLIC scene_points_with_normal_item scene_polygon_soup_item scene_surface_mesh_item scene_textured_item) - target_compile_features(ply_plugin PRIVATE ${needed_cxx_features}) - - if (TARGET CGAL::LASLIB_support) - polyhedron_demo_plugin(las_plugin LAS_io_plugin KEYWORDS Viewer PointSetProcessing Classification) - target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item CGAL::LASLIB_support) - target_compile_features(las_plugin PRIVATE ${needed_cxx_features}) - if(MSVC) - target_compile_definitions( - las_plugin - PUBLIC "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS") - endif() - else() - message(STATUS "NOTICE: the LAS IO plugin needs LAS libraries and will not be compiled.") +polyhedron_demo_plugin(ply_plugin PLY_io_plugin KEYWORDS Viewer PointSetProcessing Classification PMP) +target_link_libraries(ply_plugin PUBLIC scene_points_with_normal_item scene_polygon_soup_item scene_surface_mesh_item scene_textured_item) +if (TARGET CGAL::LASLIB_support) + polyhedron_demo_plugin(las_plugin LAS_io_plugin KEYWORDS Viewer PointSetProcessing Classification) + target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item CGAL::LASLIB_support) + if(MSVC) + target_compile_definitions( + las_plugin + PUBLIC "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS") endif() +else() + message(STATUS "NOTICE: the LAS IO plugin needs LAS libraries and will not be compiled.") endif() find_path( diff --git a/Triangulation_3/test/Triangulation_3/CMakeLists.txt b/Triangulation_3/test/Triangulation_3/CMakeLists.txt index 4998791123e5..85fff794a2f2 100644 --- a/Triangulation_3/test/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/test/Triangulation_3/CMakeLists.txt @@ -23,17 +23,8 @@ create_single_source_cgal_program("test_RT_cell_base_with_weighted_circumcenter_ create_single_source_cgal_program("test_robust_weighted_circumcenter.cpp") create_single_source_cgal_program("test_simplex_3.cpp") create_single_source_cgal_program("test_segment_simplex_traverser_3.cpp" ) -if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES) - create_single_source_cgal_program("test_simplex_iterator_3.cpp" ) - create_single_source_cgal_program("test_segment_cell_traverser_3.cpp" ) - target_compile_features(test_simplex_iterator_3 PRIVATE cxx_std_17) - target_compile_features(test_segment_simplex_traverser_3 PRIVATE cxx_std_17) -else() - message( - STATUS - "NOTICE: test_simplex_iterator_3.cpp and test_segment_simplex_traverser_3.cpp require C++17 and will not be compiled." - ) -endif() +create_single_source_cgal_program("test_simplex_iterator_3.cpp" ) +create_single_source_cgal_program("test_segment_cell_traverser_3.cpp" ) create_single_source_cgal_program("test_static_filters.cpp") create_single_source_cgal_program("test_triangulation_3.cpp") create_single_source_cgal_program("test_io_triangulation_3.cpp") From 57aa719fbe30c856232c0fd53724ac1a42d43fe3 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 18:43:26 +0100 Subject: [PATCH 384/399] do not use white as random color --- Polygon/include/CGAL/draw_multipolygon_with_holes_2.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Polygon/include/CGAL/draw_multipolygon_with_holes_2.h b/Polygon/include/CGAL/draw_multipolygon_with_holes_2.h index 1584845f19f1..8950956786eb 100644 --- a/Polygon/include/CGAL/draw_multipolygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_multipolygon_with_holes_2.h @@ -112,8 +112,7 @@ class Mpwh_2_basic_viewer_qt : public Qt::Basic_viewer { gs.clear(); for (auto const& p: m_mpwh.polygons_with_holes()) { - CGAL::IO::Color c(rand()%255,rand()%255,rand()%255); - gs.face_begin(c); + gs.face_begin(get_random_color(get_default_random())); const Pnt* point_in_face; const auto& outer_boundary = p.outer_boundary(); From da217566d0e77cf68beb593ea8a7151840cf5004 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 18:43:56 +0100 Subject: [PATCH 385/399] Update triangulation method in buffer for vao to deal with some nested polygonal faces --- Basic_viewer/include/CGAL/Buffer_for_vao.h | 98 ++++++++++------------ 1 file changed, 42 insertions(+), 56 deletions(-) diff --git a/Basic_viewer/include/CGAL/Buffer_for_vao.h b/Basic_viewer/include/CGAL/Buffer_for_vao.h index 3ed3515273a3..d7c9619619ad 100644 --- a/Basic_viewer/include/CGAL/Buffer_for_vao.h +++ b/Basic_viewer/include/CGAL/Buffer_for_vao.h @@ -125,6 +125,35 @@ namespace internal static const typename Local_kernel::Ray_2& get_local_ray(const typename Local_kernel::Ray_2& r) { return r; } }; + + template + void mark_domains(CDT& tri, + typename CDT::Face_handle start, int index, + std::queue& border) + { + if (start->info().m_nesting_level!=-1) return; + std::queue queue; + queue.push(start); + while (!queue.empty()) + { + auto fh=queue.front(); + queue.pop(); + if (fh->info().m_nesting_level==-1) + { + fh->info().m_nesting_level=index; + for (int i = 0; i < 3; i++) + { + typename CDT::Edge e(fh,i); + auto n = fh->neighbor(i); + if (n->info().m_nesting_level==-1) + { + if (tri.is_constrained(e)) { border.push(e); } + else { queue.push(n); } + } + } + } + } + } } // End namespace internal //------------------------------------------------------------------------------ @@ -738,62 +767,20 @@ class Buffer_for_vao { cdt.insert_constraint(previous, first); } } - // (2) We mark all external triangles - // (2.1) We initialize is_external and is_process values + // (2.1) We initialize nesting_level for(typename CDT::All_faces_iterator fit = cdt.all_faces_begin(), fitend = cdt.all_faces_end(); fit!=fitend; ++fit) - { - fit->info().is_external = true; - fit->info().is_process = false; - } - // (2.2) We check if the facet is external or internal - std::queue face_queue, faces_internal; - if (cdt.infinite_vertex()->face()!=nullptr) - { - typename CDT::Face_circulator - incident_faces(cdt.infinite_vertex()), end_incident_faces(incident_faces); - do - { face_queue.push(incident_faces); } - while(++incident_faces!=end_incident_faces); - } - // std::cout<<"# faces PUSHED "<info().is_process) - { - fh->info().is_process=true; - for(int i=0; i<3; ++i) - { - if(!cdt.is_constrained(std::make_pair(fh, i))) - { - if (fh->neighbor(i)!=nullptr) - { face_queue.push(fh->neighbor(i)); } - } - else - { faces_internal.push(fh->neighbor(i)); } - } - } - } + { fit->info().m_nesting_level=-1; } - while(!faces_internal.empty()) + std::queue border; + internal::mark_domains(cdt, cdt.infinite_face(), 0, border); + while(!border.empty()) { - typename CDT::Face_handle fh=faces_internal.front(); - faces_internal.pop(); - if(!fh->info().is_process) - { - fh->info().is_process = true; - fh->info().is_external = false; - for(unsigned int i=0; i<3; ++i) - { - if(!cdt.is_constrained(std::make_pair(fh, i))) - { - if (fh->neighbor(i)!=nullptr) - { faces_internal.push(fh->neighbor(i)); } - } - } - } + auto e=border.front(); + border.pop(); + auto n=e.first->neighbor(e.second); + if (n->info().m_nesting_level==-1) + { internal::mark_domains(cdt, n, e.first->info().m_nesting_level+1, border); } } // (3) Now we iterates on the internal faces to add the vertices @@ -801,7 +788,7 @@ class Buffer_for_vao for(typename CDT::Finite_faces_iterator ffit=cdt.finite_faces_begin(), ffitend = cdt.finite_faces_end(); ffit!=ffitend; ++ffit) { - if(!ffit->info().is_external) + if(ffit->info().in_domain()) { for(unsigned int i=0; i<3; ++i) { @@ -883,9 +870,8 @@ class Buffer_for_vao struct Face_info { - bool exist_edge[3]; - bool is_external; - bool is_process; + int m_nesting_level=-1; + bool in_domain() { return m_nesting_level%2==1; } }; typedef CGAL::Projection_traits_3 P_traits; From 8869ab3b8fb897b9ea9a845e7f2e4574682b36a1 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 19:31:57 +0100 Subject: [PATCH 386/399] dependencies for core --- Basic_viewer/package_info/Basic_viewer/dependencies | 1 + .../package_info/Periodic_2_triangulation_2/dependencies | 1 + Point_set_3/package_info/Point_set_3/dependencies | 1 + Polygon/package_info/Polygon/dependencies | 1 + Polyhedron/package_info/Polyhedron/dependencies | 1 + Surface_mesh/package_info/Surface_mesh/dependencies | 1 + Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies | 1 + 7 files changed, 7 insertions(+) diff --git a/Basic_viewer/package_info/Basic_viewer/dependencies b/Basic_viewer/package_info/Basic_viewer/dependencies index ea5d80f6165c..8533556ba081 100644 --- a/Basic_viewer/package_info/Basic_viewer/dependencies +++ b/Basic_viewer/package_info/Basic_viewer/dependencies @@ -26,3 +26,4 @@ Spatial_sorting Stream_support TDS_2 Triangulation_2 +CGAL_Core diff --git a/Periodic_2_triangulation_2/package_info/Periodic_2_triangulation_2/dependencies b/Periodic_2_triangulation_2/package_info/Periodic_2_triangulation_2/dependencies index 3681bf5ae04b..fa072ac62995 100644 --- a/Periodic_2_triangulation_2/package_info/Periodic_2_triangulation_2/dependencies +++ b/Periodic_2_triangulation_2/package_info/Periodic_2_triangulation_2/dependencies @@ -27,3 +27,4 @@ Spatial_sorting Stream_support TDS_2 Triangulation_2 +CGAL_Core diff --git a/Point_set_3/package_info/Point_set_3/dependencies b/Point_set_3/package_info/Point_set_3/dependencies index fec9cf39bc0b..5b0eb897d7ef 100644 --- a/Point_set_3/package_info/Point_set_3/dependencies +++ b/Point_set_3/package_info/Point_set_3/dependencies @@ -29,3 +29,4 @@ Stream_support Surface_mesh TDS_2 Triangulation_2 +CGAL_Core diff --git a/Polygon/package_info/Polygon/dependencies b/Polygon/package_info/Polygon/dependencies index ea5d80f6165c..8533556ba081 100644 --- a/Polygon/package_info/Polygon/dependencies +++ b/Polygon/package_info/Polygon/dependencies @@ -26,3 +26,4 @@ Spatial_sorting Stream_support TDS_2 Triangulation_2 +CGAL_Core diff --git a/Polyhedron/package_info/Polyhedron/dependencies b/Polyhedron/package_info/Polyhedron/dependencies index 64c00615ce37..7ab360cb4710 100644 --- a/Polyhedron/package_info/Polyhedron/dependencies +++ b/Polyhedron/package_info/Polyhedron/dependencies @@ -29,3 +29,4 @@ Spatial_sorting Stream_support TDS_2 Triangulation_2 +CGAL_Core diff --git a/Surface_mesh/package_info/Surface_mesh/dependencies b/Surface_mesh/package_info/Surface_mesh/dependencies index 5b83e82360eb..1e1a85b5e663 100644 --- a/Surface_mesh/package_info/Surface_mesh/dependencies +++ b/Surface_mesh/package_info/Surface_mesh/dependencies @@ -27,3 +27,4 @@ Stream_support Surface_mesh TDS_2 Triangulation_2 +CGAL_Core diff --git a/Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies b/Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies index d2c77619e206..b92af4a0b3ba 100644 --- a/Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies +++ b/Voronoi_diagram_2/package_info/Voronoi_diagram_2/dependencies @@ -28,3 +28,4 @@ Stream_support TDS_2 Triangulation_2 Voronoi_diagram_2 +CGAL_Core From 7f6505c193ceac14c13eba4709157101c5be9eaf Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 28 Mar 2024 19:39:37 +0100 Subject: [PATCH 387/399] update changes --- Installation/CHANGES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 906bd670cf89..f0fb08b6cb70 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -10,7 +10,8 @@ Release date: October 2023 - **Breaking change**: C++17 is now required - Support for Visual `C++` 14.0 (Visual studio 2015) is dropped. -- The demos as well as the `draw()` functions using the `Basic_viewer` are based on Qt6 +- The demos as well as the `Basic_viewer` are based on Qt6. +- The `Basic_viewer` is improved and documented. - **Breaking change**: The usage of `boost::shared_ptr` has been replaced by `std::shared_ptr`. Packages affected are 2D Straight Line Skeleton and Shape Detection. - **Breaking change**: The usage of `boost::optional` has been replaced by `std::optional`. Packages affected are 2D Straight Line Skeleton, 3D Fast Intersection and Distance Computation (AABB Tree), and the Kernel intersection. - **Breaking change**: The usage of `boost::variant` has been replaced by `std::variant`. Packages affected are 2D Arrangements, and the Kernel intersection. From 7a5d20a0c573b7dca157a6634eb9d891b0a3fbcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Mar 2024 00:06:52 +0100 Subject: [PATCH 388/399] typos --- .../include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h index d6ca4fb356c3..8d3d837034b2 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h @@ -1153,15 +1153,17 @@ class Alpha_wrapper_3 if(!is_positive(alpha) || !is_positive(offset)) { #ifdef CGAL_AW3_DEBUG - std::cerr << "Error: invalid input parameters: " << alpha << " and" << offset << std::endl; + std::cerr << "Error: invalid input parameters: " << alpha << " and " << offset << std::endl; #endif return false; } +#ifdef CGAL_AW3_DEBUG if(refining && alpha > m_alpha) std::cerr << "Warning: refining with an alpha greater than the last iteration's!" << std::endl; if(refining && offset != m_offset) std::cerr << "Warning: refining with a different offset value!" << std::endl; +#endif m_alpha = FT(alpha); m_sq_alpha = square(m_alpha); From 152999929b4e0de4ef1aa29709042de48fb114b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Mar 2024 12:11:47 +0100 Subject: [PATCH 389/399] also print info on CORE --- Number_types/test/Number_types/check_exact_backend.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Number_types/test/Number_types/check_exact_backend.cpp b/Number_types/test/Number_types/check_exact_backend.cpp index 747b184ea23c..6aff3bf2d0a8 100644 --- a/Number_types/test/Number_types/check_exact_backend.cpp +++ b/Number_types/test/Number_types/check_exact_backend.cpp @@ -28,4 +28,13 @@ int main() ); std::cout << "Exact backend is " << exact_nt_backend_string() << "\n"; +#ifdef CGAL_USE_CORE +#ifdef CGAL_CORE_USE_GMP_BACKEND + std::cout << "CGAL_CORE_USE_GMP_BACKEND is defined, using gmp backend in BigInt and BigRat\n"; +#else + std::cout << "CGAL_CORE_USE_GMP_BACKEND is NOT defined, using boost-mp backend in BigInt and BigRat\n"; +#endif +#else + std::cout << "CGAL_USE_CORE is not defined\n"; +#endif } From b765bcd27e96ea4ddd6c121d29fe224d4bd42b9d Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Sun, 31 Mar 2024 21:20:38 +0300 Subject: [PATCH 390/399] Added missing headers --- .../include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h index eafd4d73b895..08f22b4c5d68 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h @@ -21,6 +21,9 @@ * Member-function definitions of the Surface_sweep_2 class-template. */ +#include +#include + namespace CGAL { namespace Surface_sweep_2 { From 8ef3ffa5fbd2e3a5a0659db5fa1690c1e4b177ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 2 Apr 2024 10:16:39 +0200 Subject: [PATCH 391/399] fix warning --- .../include/CGAL/Number_types/internal/Exact_type_selector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h index bcb5615fedc1..bfc1d066f411 100644 --- a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h +++ b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h @@ -331,7 +331,7 @@ constexpr const char* exact_nt_backend_string() return "BOOST_BACKEND"; case LEDA_BACKEND: return "LEDA_BACKEND"; - case MP_FLOAT_BACKEND: + default: return "MP_FLOAT_BACKEND"; } } From 68bc4a4bbcbd0913bab153d5dd3e598048ae4ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Apr 2024 15:59:34 +0200 Subject: [PATCH 392/399] typos --- .../include/CGAL/Polygon_mesh_processing/clip.h | 10 +++++----- .../CGAL/Polygon_mesh_processing/corefinement.h | 6 +++--- .../CGAL/Polygon_mesh_processing/intersection.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index f37105cd6e60..9cf0e4b43a5a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -566,7 +566,7 @@ generic_clip_impl( * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` and `clipper` will be + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` and `clipper` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} @@ -668,7 +668,7 @@ clip(TriangleMesh& tm, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` * and `plane` will be checked for self-intersections * and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} @@ -778,7 +778,7 @@ bool clip(TriangleMesh& tm, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` * and `iso_cuboid` will be checked for self-intersections * and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} @@ -980,7 +980,7 @@ void split(TriangleMesh& tm, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` * and `plane` will be checked for self-intersections * and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} @@ -1069,7 +1069,7 @@ void split(TriangleMesh& tm, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` * and `iso_cuboid` will be checked for self-intersections * and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index 8cad7f7227cb..c955aa8bdc30 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -138,7 +138,7 @@ enum Boolean_operation_type {UNION = 0, INTERSECTION=1, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm1` and `tm2` will be + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm1` and `tm2` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} @@ -477,7 +477,7 @@ corefine_and_compute_boolean_operations( * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true` the set of triangles closed to the intersection of `tm1` and `tm2` will be + * \cgalParamDescription{If `true` the set of triangles close to the intersection of `tm1` and `tm2` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} @@ -644,7 +644,7 @@ corefine_and_compute_difference( TriangleMesh& tm1, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true` the set of triangles closed to the intersection of `tm1` and `tm2` will be + * \cgalParamDescription{If `true` the set of triangles close to the intersection of `tm1` and `tm2` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index a996edae6483..650268e1c401 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -1711,7 +1711,7 @@ OutputIterator intersecting_meshes(const TriangleMeshRange& range, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm1` and `tm2` will be + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm1` and `tm2` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} From 7059b5b5242ca82f3d4506fa10098e1f4a4938a1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 4 Apr 2024 07:56:45 +0100 Subject: [PATCH 393/399] Polyline_simplification: fix documentation --- .../CGAL/Polyline_simplification_2/Stop_above_cost_threshold.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Stop_above_cost_threshold.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Stop_above_cost_threshold.h index e1ab3d7fc012..9b41fffcfe21 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Stop_above_cost_threshold.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/Stop_above_cost_threshold.h @@ -36,7 +36,7 @@ public : /// Initializes it with the given threshold value. Stop_above_cost_threshold( double threshold ) : mThres(threshold) {} - /// Returns `true` when `cost` is smaller or equal than the threshold. + /// Returns `true` when `cost` is greater or equal than the threshold. /// \tparam CDT must be `CGAL::Constrained_Delaunay_triangulation_2` with a vertex type that /// is model of `PolylineSimplificationVertexBase_2`. @@ -61,4 +61,3 @@ public : } //namespace CGAL #endif // CGAL_POLYLINE_SIMPLIFICATION_2_STOP_ABOVE_COST_THRESHOLD_H - From 8fe576c4509afe04f713f50e7b3f0f38f44bfaeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Apr 2024 13:20:55 +0200 Subject: [PATCH 394/399] use and --- Basic_viewer/doc/Basic_viewer/Basic_viewer.txt | 2 +- Basic_viewer/doc/Basic_viewer/PackageDescription.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt index 799855f1d813..970ddbd5f5f5 100644 --- a/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt +++ b/Basic_viewer/doc/Basic_viewer/Basic_viewer.txt @@ -5,7 +5,7 @@ namespace CGAL { \anchor Chapter_Basic_viewer \anchor ChapterBasicViewer -\author Guillaume Damiand, Mostafa Ashraf +\author Guillaume Damiand and Mostafa Ashraf \cgalAutoToc diff --git a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt index aa919ce3e389..d90a773fed56 100644 --- a/Basic_viewer/doc/Basic_viewer/PackageDescription.txt +++ b/Basic_viewer/doc/Basic_viewer/PackageDescription.txt @@ -11,7 +11,7 @@ \cgalPkgDescriptionBegin{Basic Viewer,PkgBasicViewer} \cgalPkgPicture{basic_viewer_logo.png} \cgalPkgSummaryBegin -\cgalPkgAuthor{Guillaume Damiand, Mostafa Ashraf} +\cgalPkgAuthor{Guillaume Damiand and Mostafa Ashraf} \cgalPkgDesc{This package provides interactive visualization for most \cgal packages. First, the function `draw()` is provided for each data structure. Several data structures can be added to a same graphics scene and visualized simultaneously. From cb8e88075d83656d1a3c30db4e05aabd87054ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Apr 2024 14:26:23 +0200 Subject: [PATCH 395/399] delete allocated objects --- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index dafa07e8a27b..20ef729341d1 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -167,6 +167,14 @@ class Basic_viewer : public CGAL::QGLViewer for (unsigned int i=0; i Date: Thu, 4 Apr 2024 14:32:13 +0200 Subject: [PATCH 396/399] Remove useless header includes --- Orthtree/include/CGAL/Orthtree_traits.h | 2 -- Orthtree/include/CGAL/Orthtree_traits_base.h | 2 -- Orthtree/include/CGAL/Orthtree_traits_point.h | 2 -- 3 files changed, 6 deletions(-) diff --git a/Orthtree/include/CGAL/Orthtree_traits.h b/Orthtree/include/CGAL/Orthtree_traits.h index cc1665622e7b..7937afbe7fbb 100644 --- a/Orthtree/include/CGAL/Orthtree_traits.h +++ b/Orthtree/include/CGAL/Orthtree_traits.h @@ -15,8 +15,6 @@ #include #include -#include -#include #include #include diff --git a/Orthtree/include/CGAL/Orthtree_traits_base.h b/Orthtree/include/CGAL/Orthtree_traits_base.h index 9750b2684ac6..2d1ade67e927 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_base.h +++ b/Orthtree/include/CGAL/Orthtree_traits_base.h @@ -14,8 +14,6 @@ #include -#include -#include #include #include diff --git a/Orthtree/include/CGAL/Orthtree_traits_point.h b/Orthtree/include/CGAL/Orthtree_traits_point.h index 84e95bde81c0..f05416b91db7 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_point.h +++ b/Orthtree/include/CGAL/Orthtree_traits_point.h @@ -15,8 +15,6 @@ #include #include -#include -#include #include #include From 5da46a5a654f5d512cb037c8062f9862345d3305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 4 Apr 2024 14:59:26 +0200 Subject: [PATCH 397/399] Update dependencies --- Orthtree/package_info/Orthtree/dependencies | 7 ------- Shape_detection/package_info/Shape_detection/dependencies | 5 ----- .../package_info/Shape_regularization/dependencies | 1 - 3 files changed, 13 deletions(-) diff --git a/Orthtree/package_info/Orthtree/dependencies b/Orthtree/package_info/Orthtree/dependencies index d8fbb010a7a2..fee49d8d44b7 100644 --- a/Orthtree/package_info/Orthtree/dependencies +++ b/Orthtree/package_info/Orthtree/dependencies @@ -1,10 +1,7 @@ Algebraic_foundations Cartesian_kernel -Circulator Distance_2 Distance_3 -Filtered_kernel -Hash_map Installation Intersections_2 Intersections_3 @@ -13,11 +10,7 @@ Kernel_23 Modular_arithmetic Number_types Orthtree -Point_set_2 Profiling_tools Property_map STL_Extension -Spatial_sorting Stream_support -TDS_2 -Triangulation_2 diff --git a/Shape_detection/package_info/Shape_detection/dependencies b/Shape_detection/package_info/Shape_detection/dependencies index 23bbe655dfaf..26fdaaadd2f5 100644 --- a/Shape_detection/package_info/Shape_detection/dependencies +++ b/Shape_detection/package_info/Shape_detection/dependencies @@ -7,7 +7,6 @@ Circulator Distance_2 Distance_3 Filtered_kernel -Hash_map Homogeneous_kernel Installation Intersections_2 @@ -18,7 +17,6 @@ Kernel_d Modular_arithmetic Number_types Orthtree -Point_set_2 Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools @@ -28,7 +26,4 @@ STL_Extension Shape_detection Solver_interface Spatial_searching -Spatial_sorting Stream_support -TDS_2 -Triangulation_2 \ No newline at end of file diff --git a/Shape_regularization/package_info/Shape_regularization/dependencies b/Shape_regularization/package_info/Shape_regularization/dependencies index b07b869d7157..353a79ca562f 100644 --- a/Shape_regularization/package_info/Shape_regularization/dependencies +++ b/Shape_regularization/package_info/Shape_regularization/dependencies @@ -15,7 +15,6 @@ Kernel_d Modular_arithmetic Number_types Orthtree -Point_set_2 Principal_component_analysis_LGPL Profiling_tools Property_map From 6a1417d8ba3456d198822f2b95719f79ee90ad00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 9 Apr 2024 13:33:41 +0200 Subject: [PATCH 398/399] trigger the update --- Triangulation_3/demo/Triangulation_3/MainWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Triangulation_3/demo/Triangulation_3/MainWindow.cpp b/Triangulation_3/demo/Triangulation_3/MainWindow.cpp index 030948e7a2ca..aad061f5e441 100644 --- a/Triangulation_3/demo/Triangulation_3/MainWindow.cpp +++ b/Triangulation_3/demo/Triangulation_3/MainWindow.cpp @@ -137,6 +137,7 @@ void MainWindow::on_actionLoad_Points_triggered() // update viewer Q_EMIT( sceneChanged() ); + viewer->changed(); } void MainWindow::on_actionSave_Points_triggered() From dc06506a0449c949b94200a36b42a744aa6b8376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 9 Apr 2024 13:43:25 +0200 Subject: [PATCH 399/399] fix a2b7a727520d27b01c7985e10186bbd85a3da1f8 --- BGL/doc/BGL/PackageDescription.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index ec0014c799bb..89497261a964 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -677,10 +677,8 @@ user might encounter. - `CGAL::is_valid_face_graph()` - `CGAL::is_valid_polygon_mesh()` -- `CGAL::is_tetrahedron() - -` \cgalCRPSection{Generator Functions} +- `CGAL::is_tetrahedron()` - `CGAL::is_hexahedron()` - `CGAL::make_triangle()` - `CGAL::make_tetrahedron()`