From 156ea1a1c94ebe71f1cb2a6ffb21caa4b46298f6 Mon Sep 17 00:00:00 2001 From: Mostafa-ashraf19 Date: Sat, 10 Sep 2022 21:52:39 +0200 Subject: [PATCH] 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 efd64ff4271..4b218c7431d 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);