// 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 Drawing_functor { Drawing_functor(): 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 Drawing_functor_with_volume : public Drawing_functor { 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; }; 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