From 1565773fdad723f1b941d53961b07149568e727a Mon Sep 17 00:00:00 2001 From: Jasmeet Singh Date: Fri, 12 Jul 2019 10:46:48 -0700 Subject: [PATCH] Specialization of draw() function for P2T2, can be called together with another viewer now. --- .../CGAL/draw_periodic_2_triangulation_2.h | 40 +++++++------------ .../include/CGAL/draw_voronoi_diagram_2.h | 26 ------------ 2 files changed, 14 insertions(+), 52 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 2406915d842..3e158d7fd85 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 @@ -250,16 +250,20 @@ protected: bool m_domain; }; -template -void draw(const P2T2& ap2t2, - const char* title, - bool nofill, - const ColorFunctor& fcolor) +// Specialization of draw function +#define CGAL_P2T2_TYPE CGAL::Periodic_2_triangulation_2 \ + + +template < class Gt, + class Tds > +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=false; + bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); #endif if (!cgal_test_suite) @@ -267,31 +271,15 @@ void draw(const P2T2& ap2t2, int argc=1; const char* argv[2]={"p2t2_viewer","\0"}; QApplication app(argc,const_cast(argv)); - SimplePeriodic2Triangulation2ViewerQt mainwindow(app.activeWindow(), - ap2t2, - title, - nofill, - fcolor); + DefaultColorFunctorP2T2 fcolor; + SimplePeriodic2Triangulation2ViewerQt + mainwindow(app.activeWindow(), ap2t2, title, nofill, fcolor); mainwindow.show(); app.exec(); } } -template -void draw(const P2T2& ap2t2, const char* title, bool nofill) -{ - DefaultColorFunctorP2T2 c; - draw(ap2t2, title, nofill, c); -} - -template -void draw(const P2T2& ap2t2, const char* title) -{ draw(ap2t2, title, false); } - -template -void draw(const P2T2& ap2t2) -{ draw(ap2t2, "Basic 2D Periodic Triangulation Viewer"); } - } // namespace CGAL #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 c139f5a390d..3e425074553 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -337,32 +337,6 @@ void draw(const CGAL_VORONOI_TYPE &av2, } } -//template -//void draw(const V2 &av2, const char *title, bool nofill, -// bool draw_voronoi_vertices, bool draw_dual_vertices) { -// DefaultColorFunctorV2 c; -// draw(av2, title, nofill, draw_voronoi_vertices, draw_dual_vertices, c); -//} - -//template -//void draw(const V2 &av2, const char *title, bool nofill, -// bool draw_voronoi_vertices) { -// DefaultColorFunctorV2 c; -// draw(av2, title, nofill, draw_voronoi_vertices, true); -//} - -//template void draw(const V2 &av2, const char *title, bool nofill) { -// draw(av2, title, nofill, true); -//} - -//template void draw(const V2 &av2, const char *title) { -// draw(av2, title, false); -//} - -//template void draw(const V2 &av2) { -// draw(av2, "Basic Voronoi Diagram Viewer"); -//} - } // End namespace CGAL #endif // CGAL_USE_BASIC_VIEWER