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 cbad54f1f7a..c0d06a67e33 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. -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. +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 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& ap2t2); +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 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 00000000000..565d8e1b913 --- /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) +};