doc: draw p2t2

This commit is contained in:
Guillaume Damiand 2023-12-08 13:45:48 +01:00
parent f3c5f53296
commit 769f615366
2 changed files with 128 additions and 6 deletions

View File

@ -3,14 +3,99 @@ namespace CGAL {
/*! /*!
\ingroup PkgDrawPeriodic2Triangulation2 \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. 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 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.
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 <typename DS,
typename VertexDescriptor,
typename EdgeDescriptor,
typename FaceDescriptor>
struct Graphics_scene_options_periodic_2_triangulation_2: public CGAL::Graphics_scene_options<DS, VertexDescriptor, EdgeDescriptor, FaceDescriptor>
{
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:
<code>
template<class Gt, class Tds, class GSOptions>
void CGAL::draw(const CGAL::Periodic_2_triangulation_2<Gt, Tds>& p2t2, const GSOptions& gso);
</code>
\cgalAdvancedEnd
*/
template<class P2T2, class GSOptions>
void draw(const P2T2& p2t2, const GSOptions& gso);
/*!
\ingroup PkgDrawPeriodic2Triangulation2
A shortcut to `CGAL::draw(p2t2, Graphics_scene_options_periodic_2_triangulation_2{})`.
*/ */
template<class P2T2> template<class P2T2>
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:
<code>
template<class Gt, class Tds, class GSOptions>
void CGAL::add_to_graphics_scene(const CGAL::Periodic_2_triangulation_2<Gt, Tds>& p2t2, CGAL::Graphics_scene& gs, const GSOptions& gso);
</code>
\cgalAdvancedEnd
*/
template<class P2T2, class GSOptions>
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<class P2T2>
void add_to_graphics_scene(const P2T2& p2t2,
CGAL::Graphics_scene& gs);
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -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<DS, VertexDescriptor, EdgeDescriptor, FaceDescriptor>`\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)
};