Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSoC'22: New CGAL's design to handle basic viewers #6967

Merged
merged 350 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
350 commits
Select commit Hold shift + click to select a range
0db66d1
example draw sm
gdamiand Oct 14, 2022
549fe77
create examples directory for basic viewer
gdamiand Oct 14, 2022
89f7e05
some drawing functor are necessary non null; review of draw for lcc.
gdamiand Oct 14, 2022
1e8ef8f
Update LCC demo to use a 'better' color for faces.
gdamiand Oct 17, 2022
58fead2
draw nef3 review
gdamiand Oct 17, 2022
8e93b8c
spaces
gdamiand Oct 17, 2022
1b1e699
Review point set 3
gdamiand Oct 17, 2022
72c7608
review draw polygon2
gdamiand Oct 18, 2022
199499b
Review draw polygon with holes
gdamiand Oct 18, 2022
2970aa5
review draw triangulation2
gdamiand Oct 18, 2022
0d49e61
add missing include
gdamiand Oct 18, 2022
999d496
review draw triangulation3
gdamiand Oct 18, 2022
8c546ef
code review for polygon triangulation
gdamiand Oct 18, 2022
d1eed1d
start straight skeleton 2, NYF
gdamiand Oct 18, 2022
14848d4
Add a class allowing to create a qt application and a basic viewer, w…
gdamiand Oct 19, 2022
2f07ea2
review draw voronoi 2
gdamiand Oct 19, 2022
09eaba2
move functor for voronoi
gdamiand Oct 19, 2022
655b0c8
review draw periodic triangulation 2
gdamiand Oct 19, 2022
e18a573
add missing include
gdamiand Oct 19, 2022
9da6a6d
add missing include
gdamiand Oct 19, 2022
779fea4
use references
gdamiand Oct 19, 2022
fb80b2f
add missing include
gdamiand Oct 19, 2022
4377f52
add missing include
gdamiand Oct 19, 2022
534e789
replace use of get_local_point
gdamiand Oct 19, 2022
de846fc
do not use beta in lcc
gdamiand Oct 19, 2022
8550ce6
draw_surface_mesh_small_faces and draw_face_graph_with_paths NYF
gdamiand Nov 5, 2022
101ec5f
Test push
Mostafa-ashraf19 Nov 16, 2022
9fcd8f7
bugs fixed, added TODO
Mostafa-ashraf19 Dec 8, 2022
5948fc1
Initial Commit
Mostafa-ashraf19 Dec 9, 2022
803fc71
Path handled
Mostafa-ashraf19 Dec 9, 2022
d780acb
Example for basic viewer draw small faces
gdamiand Apr 25, 2023
cb2d506
Rename package basic viewer; move example
gdamiand Apr 27, 2023
5709abc
example basic viewer
gdamiand Apr 27, 2023
fe92449
doc
gdamiand Apr 27, 2023
8f29e4d
Rename class graphic buffer
gdamiand Apr 27, 2023
379b193
move basic viewer files
gdamiand Apr 27, 2023
5ef4638
start docé
gdamiand Apr 27, 2023
48cfa7a
add default value in the doc
gdamiand Apr 27, 2023
4df2edd
Replace draw_buffer by draw_graphic_storage
gdamiand Apr 28, 2023
b04d7a6
Rename
gdamiand Apr 28, 2023
519c7cc
rename add_in_graphic_buffer into add_in_graphic_storage
gdamiand Apr 28, 2023
e242890
doc
gdamiand Apr 28, 2023
43194fb
Add new example of Basic viewer allowing to view several windows
gdamiand Apr 28, 2023
e7acefd
clean
gdamiand Apr 28, 2023
bde0a52
Add new example of Basic viewer allowing to view several windows
gdamiand Apr 28, 2023
d3acc09
add one example with custom color
gdamiand Apr 28, 2023
f39254f
doc
gdamiand Apr 28, 2023
45e2d49
doc
gdamiand Jun 22, 2023
03d7c10
doc
gdamiand Jun 22, 2023
7da9812
Rename graphic_buffer into graphic_storage.
gdamiand Jun 22, 2023
7e99eac
Rename graphic_buffer into graphic_storage
gdamiand Jun 22, 2023
10a8748
Basic viewer doc (cont)
gdamiand Jun 22, 2023
1acb0e6
typo
gdamiand Jun 22, 2023
2f3d0c1
add lcc in dependencies
gdamiand Jun 22, 2023
5e420b1
doc
gdamiand Jun 22, 2023
0fe120b
add links to draw functions
gdamiand Jun 22, 2023
b9a4f86
doc
gdamiand Jun 23, 2023
980241e
author
gdamiand Jun 23, 2023
157558a
update doc
gdamiand Jun 26, 2023
11c7e44
move file
gdamiand Jun 26, 2023
fe23441
Merge master
gdamiand Jun 26, 2023
ef602d7
draw constrained triangulation can reuse draw triangulation
gdamiand Jun 26, 2023
0f6acac
draw constrained triangulation instead of triangulation
gdamiand Jun 26, 2023
6664339
Update drawing functor for surface mesh
gdamiand Jun 27, 2023
367b2d3
Update doc
gdamiand Jun 27, 2023
8b55613
split draw triangulation in two for the doc (without and with constra…
gdamiand Jun 27, 2023
44fd0bc
camel case
gdamiand Jun 27, 2023
df33c70
Update doc
gdamiand Jul 3, 2023
3e71ba9
update doc
gdamiand Aug 24, 2023
cc03d2c
verbs with s
gdamiand Aug 24, 2023
f3e3fcd
data structure
gdamiand Aug 24, 2023
b069114
more s
gdamiand Aug 24, 2023
467e55f
Merge branch 'master' into gsoc2022-EBVs-Mostafa-ashraf19
gdamiand Aug 28, 2023
1b651f1
Doc following Sebastien remarks
gdamiand Sep 11, 2023
0ee25cd
After Andreas review
gdamiand Sep 25, 2023
ebd13c8
Rename Drawing_functor in Graphics_scene_options (following Andreas a…
gdamiand Sep 28, 2023
5cf89da
Rename Drawing_functor in Graphics_scene_options (following Andreas a…
gdamiand Sep 28, 2023
e5a8a0d
Pmap readable
gdamiand Sep 28, 2023
fd115bd
Rename Graphic_storare into Graphics_scene (Andreas and Sebastien rev…
gdamiand Sep 28, 2023
6be7477
Camel case (Andreas review)
gdamiand Sep 28, 2023
9f22d67
Rename Graphic_storage in Graphics_scene (Andreas and Sebastien review)
gdamiand Sep 28, 2023
da7da48
Basic viewer doc
gdamiand Sep 28, 2023
c999b12
Basic viewer doc
gdamiand Sep 29, 2023
218be31
Basic viewer examples
gdamiand Sep 29, 2023
a5ee74c
Merge branch 'master' into gsoc2022-EBVs-Mostafa-ashraf19
gdamiand Sep 29, 2023
55509a6
GPL instead of LGPL (?)
gdamiand Sep 29, 2023
2755f2c
Basic viewer logo + move include file
gdamiand Sep 29, 2023
9f10513
lcc doc (temp)
gdamiand Oct 2, 2023
823392a
Update Basic_viewer/doc/Basic_viewer/PackageDescription.txt
gdamiand Oct 3, 2023
a8e68ca
Update Basic_viewer/doc/Basic_viewer/PackageDescription.txt
gdamiand Oct 3, 2023
5d1ae46
Update Basic_viewer/doc/Basic_viewer/PackageDescription.txt
gdamiand Oct 3, 2023
ac1c489
Update names following Andreas remarks
gdamiand Oct 6, 2023
93183fc
document draw and add_in_graphics_scene for lcc (for validation)
gdamiand Oct 6, 2023
163e8ae
Doc basic viewer
gdamiand Oct 13, 2023
40b9b10
Update Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h
gdamiand Oct 18, 2023
b47694c
Update Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h
gdamiand Oct 18, 2023
12365d7
Update Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h
gdamiand Oct 18, 2023
eca66e9
Update Basic_viewer/doc/Basic_viewer/CGAL/Graphics_scene.h
gdamiand Oct 18, 2023
a33b4e3
Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h
gdamiand Oct 18, 2023
67b41d9
Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h
gdamiand Oct 18, 2023
bfa138d
Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h
gdamiand Oct 18, 2023
c551b6c
Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h
gdamiand Oct 18, 2023
dfb32ba
Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h
gdamiand Oct 18, 2023
46ddf99
Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h
gdamiand Oct 18, 2023
66eba9f
Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h
gdamiand Oct 18, 2023
cb2ab73
Update Basic_viewer/doc/Basic_viewer/CGAL/Qt/Basic_viewer_qt.h
gdamiand Oct 18, 2023
ef73057
acolor -> color
gdamiand Oct 18, 2023
d213747
nullptr must be quoted
lrineau Oct 18, 2023
31d79bd
fix a copy-paste typo
lrineau Oct 18, 2023
1369628
Update Basic_viewer/doc/Basic_viewer/PackageDescription.txt
gdamiand Oct 18, 2023
eea01ce
Replace some flot by BufferType
gdamiand Oct 18, 2023
e3f1772
Rename add_in_graphics_scene -> add_to_graphics_scene
gdamiand Oct 18, 2023
75d2b15
Start to rewrite draw_polygon_set_2.h (NYF)
gdamiand Oct 18, 2023
175166d
Remove all methods to add elements from Basic_viewer_qt.
gdamiand Oct 20, 2023
d8e190c
Basic viewer doc
gdamiand Oct 20, 2023
e1cd107
typo
gdamiand Oct 20, 2023
0c8704f
Basic viewer doc: variable name
gdamiand Oct 20, 2023
3fa4c70
Basic viewer doc typo
gdamiand Oct 20, 2023
45d9708
Basic viewer names in doc
gdamiand Oct 20, 2023
cf797a5
basic viewer does not have clear anymore
gdamiand Oct 20, 2023
d74a3db
Remove template parameter for graphics scene
gdamiand Oct 22, 2023
c9d93ba
Add GraphicsSceneOptions concept; use it to document draw(T2); waitin…
gdamiand Oct 22, 2023
cbe7ef2
Merge branch 'master' into gsoc2022-EBVs-Mostafa-ashraf19
gdamiand Oct 22, 2023
6daa2a0
Graphics_scene is no more templated
gdamiand Oct 22, 2023
1c6b1e4
Basic_viewer_qt is no more templated
gdamiand Oct 22, 2023
761fde0
add_in_graphics_scene -> add_to_graphics_scene; plus remove template …
gdamiand Oct 22, 2023
4332889
remove template for Buffer_for_vao
gdamiand Oct 23, 2023
e416fc8
new test for doc of draw
gdamiand Oct 23, 2023
2e955e1
The return of GSOptions template
gdamiand Oct 23, 2023
5ea9ac3
Remove _qt suffix from Basic_viewer
gdamiand Oct 23, 2023
2f07fbb
Update basic viewer doc following last remarks (Laurent and Andreas)
gdamiand Oct 23, 2023
126b936
Remove _qt from Basic viewer name
gdamiand Oct 24, 2023
2b69e29
Basic viewer is now in namespace Qt
gdamiand Oct 25, 2023
2bad25f
draw cont (nyf)
gdamiand Nov 6, 2023
97721a0
namespace fixes
afabri Nov 13, 2023
e62cb16
add_to
afabri Nov 13, 2023
1ffb64e
buffer -> scene
afabri Nov 13, 2023
525cc0f
Descriptor -> _descriptor
afabri Nov 14, 2023
4e5082b
remove _qt
afabri Nov 14, 2023
09b175b
Explain what to do for non colored cells
gdamiand Nov 17, 2023
8111fdf
color of volumes
gdamiand Nov 17, 2023
e3ac993
Doc: add a link to qglviewer
gdamiand Nov 20, 2023
db97ebb
Update code according to final doc api
gdamiand Nov 20, 2023
d2d114c
Update code to follow last api
gdamiand Nov 20, 2023
db9ca1a
reverse all normals
gdamiand Nov 20, 2023
12e7492
update draw
gdamiand Nov 20, 2023
c379872
draw polygon set
gdamiand Nov 20, 2023
28ec0e6
draw fg with paths (nyf)
gdamiand Nov 21, 2023
0655006
Merge with master: now viewers use Qt6
gdamiand Nov 29, 2023
2c77ba3
draw face graph with path
gdamiand Nov 29, 2023
9cf93aa
SMT: draw face width
gdamiand Nov 29, 2023
3c97859
SMT: draw face width and unsew edgewidth
gdamiand Nov 29, 2023
4feec0b
move end of namespace outside protected block
gdamiand Nov 29, 2023
f8a487d
update dependencies
gdamiand Nov 29, 2023
a000007
fix the install of /include/CGAL/Qt
lrineau Nov 29, 2023
b8c5b1c
A (last) verification step for all draw functions (nyf).
gdamiand Nov 30, 2023
2d25695
Graphics_scene does not uses Qt
gdamiand Nov 30, 2023
c53e24a
draw straight_skeleton_2
gdamiand Nov 30, 2023
310ad8e
remove old file
gdamiand Nov 30, 2023
f70a2d3
draw lcc
gdamiand Dec 1, 2023
2c34283
draw smt
gdamiand Dec 1, 2023
a204073
draw t3
gdamiand Dec 1, 2023
c1dd38e
draw nef3
gdamiand Dec 1, 2023
e3497d0
draw ps2
gdamiand Dec 1, 2023
3aa6ad1
Bug fix for 2D mode in basic viewer
gdamiand Nov 30, 2023
4684dc4
T2 and CDT2 draw
gdamiand Dec 1, 2023
1760fcf
draw p2t2
gdamiand Dec 4, 2023
91ecafd
draw voronoi 2
gdamiand Dec 4, 2023
046fa81
draw arrangement
gdamiand Dec 4, 2023
f836475
draw arrangement: use gs_options
gdamiand Dec 4, 2023
d97ff7b
remove duplicate doc
gdamiand Dec 4, 2023
d2f007d
doc draw t3
gdamiand Dec 5, 2023
5b7f499
doc draw polygon
gdamiand Dec 5, 2023
df2b9ad
doc draw pwh
gdamiand Dec 5, 2023
74c0894
doc draw polygon
gdamiand Dec 5, 2023
711a07d
doc draw surface mesh and polyhedron
gdamiand Dec 5, 2023
269f582
try to move advanced
gdamiand Dec 5, 2023
03ff679
doc draw: move advanced blocks
gdamiand Dec 5, 2023
029ab43
doc draw nef3
gdamiand Dec 5, 2023
3d8037d
doc draw lcc
gdamiand Dec 5, 2023
bfcb44b
doc: draw point set 3 and constrained triangulation 2
gdamiand Dec 6, 2023
b34fb26
fix doc draw ct2
gdamiand Dec 6, 2023
4d02be9
doc: draw ct2
gdamiand Dec 6, 2023
bd04b2a
Remove space in doc
gdamiand Dec 6, 2023
ac1fcde
Doc basic viewer
gdamiand Dec 7, 2023
3f3a21a
Doc draw face with graph (NYF: todo add links)
gdamiand Dec 7, 2023
973fb08
doc draw arrangement; fix to doc face graph with path
gdamiand Dec 7, 2023
2bd80f6
doc draw arrangement
gdamiand Dec 7, 2023
f3c5f53
doc add link
gdamiand Dec 7, 2023
769f615
doc: draw p2t2
gdamiand Dec 8, 2023
489317b
doc: draw p2t2 and voronoi2
gdamiand Dec 8, 2023
62b8460
doc draw boolean set op 2
gdamiand Dec 8, 2023
dcac571
Remove a warning
gdamiand Dec 14, 2023
d772007
Remove a wrong const
gdamiand Dec 14, 2023
b7ed4f2
protect min and max
gdamiand Dec 14, 2023
8710dbe
example requires qt
gdamiand Dec 14, 2023
d13b856
example requires qt
gdamiand Dec 14, 2023
0fdd175
use strncpy instead of strcpy
gdamiand Dec 26, 2023
a311285
remove warning
gdamiand Dec 26, 2023
3e16be0
remove warning
gdamiand Dec 26, 2023
01e333c
add missing include and function when basic viewer is disable
gdamiand Dec 26, 2023
88e9921
warning in draw nef3
gdamiand Dec 26, 2023
1b281f9
warning in surface mesh topology
gdamiand Dec 26, 2023
26096e9
missing include
gdamiand Dec 26, 2023
01decbb
SMT draw: Cannot use directly initializer list with variadic template.
gdamiand Dec 26, 2023
6146924
remove a windows warning about strncpy
gdamiand Dec 27, 2023
e3249bd
fix warning
sloriot Dec 27, 2023
efb946a
warnings
gdamiand Dec 27, 2023
7b483d4
warning in draw lcc
gdamiand Dec 27, 2023
ca296d5
the cast must be into std::size_t
gdamiand Dec 28, 2023
089f053
disable warning must eb defined before includes
gdamiand Dec 28, 2023
217d4c0
do not use strncpy
gdamiand Dec 28, 2023
7681644
warning
gdamiand Dec 28, 2023
d3bbe0d
cast in two steps
gdamiand Dec 28, 2023
38b03d2
warning draw smt
gdamiand Dec 28, 2023
77643b6
remove a sentence (no need to replace it)
lrineau Jan 8, 2024
1e18993
solve a todo
gdamiand Jan 8, 2024
3bc5602
Merge branch 'master' into gsoc2022-EBVs-Mostafa-ashraf19
gdamiand Jan 11, 2024
ca895e6
Basic Viewer Initial commit.
Mostafa-ashraf19 Jan 19, 2024
346bc63
figs for drawing LCC example.
Mostafa-ashraf19 Feb 4, 2024
ca9faa4
new for basic viewer, WIP graphic scene and class diagram.
Mostafa-ashraf19 Feb 4, 2024
369fab8
added Graphic_Scene section
Mostafa-ashraf19 Feb 5, 2024
44e5d7f
fixed errors of build doc logs.
Mostafa-ashraf19 Feb 5, 2024
f91a498
Basic_viewer UML class diagram.
Mostafa-ashraf19 Feb 5, 2024
2708185
Basic_viewer package UML class diagram.
Mostafa-ashraf19 Feb 5, 2024
ce2bb37
change order
gdamiand Feb 6, 2024
f358586
bugfix doc
gdamiand Feb 6, 2024
9a0b8eb
Merge branch 'master' into gsoc2022-EBVs-Mostafa-ashraf19
gdamiand Mar 26, 2024
736c182
Basic viewer user manual
gdamiand Mar 26, 2024
cc19f2b
add examples é
gdamiand Mar 26, 2024
102f159
basic viewer user manual
gdamiand Mar 27, 2024
785f301
basic viewer user manual
gdamiand Mar 27, 2024
3804cf6
basic viewer example
gdamiand Mar 27, 2024
f904090
basic viewer user manual
gdamiand Mar 27, 2024
1f04bad
Basic viewer user manual
gdamiand Mar 27, 2024
031c833
First pass on User Manual
afabri Mar 28, 2024
344ea7c
typo in manual
gdamiand Mar 28, 2024
c19e64f
Second pass
afabri Mar 28, 2024
41ebe96
change draw height color examples
gdamiand Mar 28, 2024
eb03647
Rename variable for graphics scene
gdamiand Mar 28, 2024
4d1a4b0
Basic viewer user manual: several fixes
gdamiand Mar 28, 2024
ff4a201
bibtex
gdamiand Mar 28, 2024
70d398b
add examples of drawing of polygon with holes
gdamiand Mar 28, 2024
6cf73a6
minor changes
lrineau Mar 28, 2024
57aa719
do not use white as random color
gdamiand Mar 28, 2024
da21756
Update triangulation method in buffer for vao to deal with some neste…
gdamiand Mar 28, 2024
8869ab3
dependencies for core
gdamiand Mar 28, 2024
7f6505c
update changes
gdamiand Mar 28, 2024
8fe576c
use and
sloriot Apr 4, 2024
cb8e880
delete allocated objects
sloriot Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,63 @@
#ifndef CGAL_DRAW_ARRANGEMENT_2_H
#define CGAL_DRAW_ARRANGEMENT_2_H

#include <CGAL/Qt/Basic_viewer_qt.h>
#include <CGAL/Qt/Basic_viewer.h>

#ifdef DOXYGEN_RUNNING

namespace CGAL {

/*! \ingroup PkgArrangementOnSurface2Draw
*
* opens a new window and draws `arr`, an instance of the `CGAL::Arrangement_2`
* class template. A call to this function is blocking; that is, the program
* continues only after 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 GeometryTraits_2 a geometry traits type, a model of a 2D arrangement
* traits concept. At this point it must be an instance of either
* `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`.
*
* \tparam Dcel the \dcel type, a model of the `ArrangementDcel` concept.
*
* \param arr the 2D arrangement to draw.
* \param title the window title.
*
* \sa `ArrangementDcel`
* \sa `ArrangementTraits_2`

opens a new window and draws `arr`, an instance of the `CGAL::Arrangement_2` class template. 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 GeometryTraits_2 a geometry traits type, a model of a 2D arrangement traits concept. At this point it must be an instance of either `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`.
\tparam Dcel the \dcel type, a model of the `ArrangementDcel` concept.
\tparam GSOptions a model of `GraphicsSceneOptions` concept.

\param arr the 2D arrangement to draw.
\param gso the graphics scene options parameter.

\sa `ArrangementDcel`
\sa `ArrangementTraits_2`
*/
template <typename GeometryTraits_2, typename Dcel, typename GSOptions>
void draw(const Arrangement_2<GeometryTraits_2, Dcel>& arr, const GSOptions& gso);

/*! \ingroup PkgArrangementOnSurface2Draw

A shortcut to `CGAL::draw(arr, Graphics_scene_options{})`.
*/
template <typename GeometryTraits_2, typename Dcel>
void draw(const Arrangement_2<GeometryTraits_2, Dcel>& arr);

/*! \ingroup PkgArrangementOnSurface2Draw

adds the vertices, edges and faces of `arr` 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 GeometryTraits_2 a geometry traits type, a model of a 2D arrangement traits concept. At this point it must be an instance of either `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`.
\tparam Dcel the \dcel type, a model of the `ArrangementDcel` concept.
\tparam GSOptions a model of `GraphicsSceneOptions` concept.

\param arr the 2D arrangement to draw.
\param gs the graphic scene to fill.
\param gso the graphics scene options parameter.
*/
template <typename GeometryTraits_2, typename Dcel, typename GSOptions>
void add_to_graphics_scene(const Arrangement_2<GeometryTraits_2, Dcel>& arr,
CGAL::Graphics_scene& gs, const GSOptions& gso);

/*! \ingroup PkgArrangementOnSurface2Draw

A shortcut to `CGAL::add_to_graphics_scene(arr, gs, Graphics_scene_options{})`.
*/
template <typename GeometryTraits_2, typename Dcel>
void draw(const Arrangement_2<GeometryTraits_2, Dcel>& arr,
const char* title = "2D Arrangement Basic Viewer");
void add_to_graphics_scene(const Arrangement_2<GeometryTraits_2, Dcel>& arr,
CGAL::Graphics_scene& gs);

} /* namespace CGAL */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,24 @@ int main() {
<< arr.number_of_faces() << std::endl;

std::size_t id(0);
CGAL::draw(arr, [&] (Arrangement_2::Face_const_handle) -> CGAL::IO::Color {
float h = 360.0f * id++ / arr.number_of_faces();
float s = 0.5;
float v = 0.5;
auto [r, g, b] = hsv_to_rgb(h, s, v);
return CGAL::IO::Color(r,g,b);
}, "hsv colors", true);

return EXIT_SUCCESS;

CGAL::Graphics_scene_options<Arrangement_2,
typename Arrangement_2::Vertex_const_handle,
typename Arrangement_2::Halfedge_const_handle,
typename Arrangement_2::Face_const_handle> gso;
gso.colored_face=[](const Arrangement_2&, Arrangement_2::Face_const_handle) -> bool
{ return true; };

gso.face_color=[&id](const Arrangement_2& arr, Arrangement_2::Face_const_handle) -> CGAL::IO::Color
{
float h = 360.0f * id++ / arr.number_of_faces();
float s = 0.5;
float v = 0.5;
auto [r, g, b] = hsv_to_rgb(h, s, v);
return CGAL::IO::Color(r,g,b);
};

CGAL::draw(arr, gso, "hsv colors");

return EXIT_SUCCESS;
}
Loading