@@ -12,126 +12,189 @@ CGAL::QGLViewer is our internal fork of <a href="https://github.com/GillesDebunn
1212class Basic_viewer : public CGAL ::QGLViewer
1313{
1414public:
15+ // / \name Constructors
16+ // / @{
17+
1518 // / Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphics_scene`.
1619 // / `title` will be the title of the window.
1720 Basic_viewer (QWidget* parent,
1821 const Graphics_scene& scene,
1922 const char * title=" " );
2023
21- // / enables or disables the drawing of vertices.
24+ // / @}
25+
26+ // / \name Setters
27+ // / @{
28+
29+ // / \brief Set size of vertices.
30+ // / \param s The size of vertices.
31+ void size_vertices (float s);
32+
33+ // / \brief Set size of edges.
34+ // / \param s The size of edges.
35+ void size_edges (float s);
36+
37+ // / \brief Set size of rays.
38+ // / \param s The size of rays.
39+ void size_rays (float s);
40+
41+ // / \brief Set size of lines.
42+ // / \param s The size of lines.
43+ void size_lines (float s);
44+
45+ // / \brief Enables or disables the drawing of vertices.
46+ // / \param b Set to `true` to enable, `false` to disable.
2247 void draw_vertices (bool b);
2348
24- // / enables or disables the drawing of edges.
49+ // / \brief Enables or disables the drawing of edges.
50+ // / \param b Set to `true` to enable, `false` to disable.
2551 void draw_edges (bool b);
2652
27- // / enables or disables the drawing of rays.
53+ // / \brief Enables or disables the drawing of rays.
54+ // / \param b Set to `true` to enable, `false` to disable.
2855 void draw_rays (bool b);
2956
30- // / enables or disables the drawing of lines.
57+ // / \brief Enables or disables the drawing of lines.
58+ // / \param b Set to `true` to enable, `false` to disable.
3159 void draw_lines (bool b);
3260
33- // / enables or disables the drawing of faces.
61+ // / \brief enables or disables the drawing of faces.
62+ // / \param b Set to `true` to enable, `false` to disable.
3463 void draw_faces (bool b);
3564
36- // / enables or disables the use of only one color (if `b` is `true`) or the use of multiple colors (if `b` is `false`).
37- void use_mono_color (bool b);
38-
3965 // / enables or disables the drawing of texts.
66+ // / \brief enables or disables the drawing of texts.
67+ // / \param b Set to `true` to enable, `false` to disable.
4068 void draw_text (bool b);
4169
42- // / sets the color used for vertices in mono color mode.
43- void vertices_mono_color (const CGAL::IO::Color& c);
70+ // / \brief Enables or disables the drawing of mesh triangles.
71+ // / \param b Set to `true` to enable, `false` to disable.
72+ void draw_mesh_triangles (bool b);
73+
74+ // / \brief Enables or disables the use of only one color or the use of multiple colors.
75+ // / \param b Set to `true` to use only one color, `false` to use multiple colors.
76+ void use_default_color (bool b);
77+
78+ // / \brief Enables or disables the use of a single color for all normals.
79+ // / \param b Set to `true` to enable, `false` to disable.
80+ void use_default_color_normals (bool b);
4481
45- // / sets the color used for edges in mono color mode.
46- void edges_mono_color (const CGAL::IO::Color& c);
82+ // / \brief enables or disables the use of flat shading or the use of smooth shading.
83+ // / \param b Set to `true` for flat shading, `false` for smooth shading.
84+ void flat_shading (bool b);
4785
48- // / sets the color used for rays in mono color mode.
49- void rays_mono_color (const CGAL::IO::Color& c);
86+ // / \brief Enables or disables the reversal of normals.
87+ // / \param b Set to `true` to reverse normals, `false` to keep normals as is.
88+ void reverse_normal (bool b);
5089
51- // / sets the color used for lines in mono color mode.
52- void lines_mono_color (const CGAL::IO::Color& c);
90+ // / \brief Sets the default color of the normals.
91+ // / \param c The default color of the normals.
92+ void default_color_normals (const CGAL::IO::Color& c);
5393
54- // / sets the color used for faces in mono color mode.
55- void faces_mono_color (const CGAL::IO::Color& c);
94+ // / \brief Sets the height factor value of the normals.
95+ // / \param h The height factor value of the normals.
96+ void normal_height_factor (float h);
5697
57- // / toggles the drawing of vertices.
98+ // / \brief Toggles the drawing of vertices.
5899 void toggle_draw_vertices ();
59100
60- // / toggles the drawing of edges.
101+ // / \brief Toggles the drawing of edges.
61102 void toggle_draw_edges ();
62103
63- // / toggles the drawing of rays.
104+ // / \brief Toggles the drawing of rays.
64105 void toggle_draw_rays ();
65106
66- // / toggles the drawing of lines.
107+ // / \brief Toggles the drawing of lines.
67108 void toggle_draw_lines ();
68109
69- // / toggles the drawing of faces.
110+ // / \brief Toggles the drawing of faces.
70111 void toggle_draw_faces ();
71112
72- // / toggles the use of mono color mode.
73- void toggle_use_mono_color ();
113+ // / \brief Toggles the use of mono color mode.
114+ void toggle_use_default_color ();
74115
75- // / toggles the drawing of text.
116+ // / \brief Toggles the use of the default color mode for normals.
117+ void toggle_use_default_color_normal ();
118+
119+ // / \brief Toggles the use of flat shading.
120+ void toggle_flat_shading ();
121+
122+ // / \brief Toggles the drawing of text.
76123 void toggle_draw_text ();
77124
78- // / returns `true` if vertices are drawn.
125+ // / \brief Reverses all normals of vertices and faces.
126+ void reverse_all_normals ();
127+
128+ // / @}
129+
130+ // / \name Getters
131+ // / @{
132+
133+ // / \brief Checks if vertices are drawn.
134+ // / \return `true` if vertices are drawn, `false` otherwise.
79135 bool draw_vertices () const ;
80136
81- // / returns `true` if edges are drawn.
137+ // / \brief Checks if edges are drawn.
138+ // / \return `true` if edges are drawn, `false` otherwise.
82139 bool draw_edges () const ;
83140
84- // / returns `true` if rays are drawn.
141+ // / \brief Checks if rays are drawn.
142+ // / \return `true` if rays are drawn, `false` otherwise.
85143 bool draw_rays () const ;
86144
87- // / returns `true` if lines are drawn.
145+ // / \brief Checks if lines are drawn.
146+ // / \return `true` if lines are drawn, `false` otherwise.
88147 bool draw_lines () const ;
89148
90- // / returns `true` if faces are drawn.
149+ // / \brief Checks if faces are drawn.
150+ // / \return `true` if faces are drawn, `false` otherwise.
91151 bool draw_faces () const ;
92152
93- // / returns `true` if mono color mode is used.
94- bool use_mono_color () const ;
95-
96- // / returns `true` if normals are reversed.
97- bool reverse_normal () const ;
98-
99- // / returns `true` if text are drawn.
153+ // / \brief Checks if text is drawn.
154+ // / \return `true` if text is drawn, `false` otherwise.
100155 bool draw_text () const ;
101156
102- // / returns the mono color used for vertices.
103- const CGAL::IO::Color& vertices_mono_color () const ;
104-
105- // / returns the mono color used for edges.
106- const CGAL::IO::Color& edges_mono_color () const ;
157+ // / \brief Checks if the default color mode is used.
158+ // / \return `true` if mono color mode is used, `false` otherwise.
159+ bool use_default_color () const ;
107160
108- // / returns the mono color used for rays.
109- const CGAL::IO::Color& rays_mono_color () const ;
161+ // / \brief Checks if the default color mode for normals is used.
162+ // / \return `true` if default color mode for normals is used, `false` otherwise.
163+ bool use_default_color_normal () const ;
110164
111- // / returns the mono color used for lines.
112- const CGAL::IO::Color& lines_mono_color () const ;
113-
114- // / returns the mono color used for faces.
115- const CGAL::IO::Color& faces_mono_color () const ;
165+ // / \brief Checks if normals are reversed.
166+ // / \return `true` if normals are reversed, `false` otherwise.
167+ bool reverse_normal () const ;
116168
117- // / returns `true` if the clipping plane is enabled.
169+ // / \brief Checks if the clipping plane is enabled.
170+ // / \return `true` if the clipping plane is enabled, `false` otherwise.
118171 bool clipping_plane_enabled () const ;
119172
120- // / returns the clipping plane when it is enabled.
173+ // / \brief Checks if m_no_2D_mode is false and the graphics scene is two-dimensional.
174+ // / \return `true` if m_no_2D_mode is false and the scene is 2D, `false` otherwise.
175+ bool is_two_dimensional () const ;
176+
177+ // / \brief Gets the clipping plane when enabled.
178+ // / \return The clipping plane as a `CGAL::Exact_predicates_inexact_constructions_kernel::Plane_3` object.
121179 CGAL::Exact_predicates_inexact_constructions_kernel::Plane_3 clipping_plane () const ;
122180
123- // / returns the graphics scene of the viewer.
181+ // / \brief Gets the graphics scene of the viewer.
182+ // / \return A reference to the `Graphics_scene` object.
124183 const Graphics_scene& graphics_scene () const ;
125184
126- // / reverses all normals of vertices and faces.
127- void reverse_all_normals ();
185+ // / @}
186+
187+ // / \name Draw
188+ // / @{
128189
129190 // / draws the viewer without recomputing all internal buffers.
130191 virtual void draw ();
131192
132193 // / redraws the viewer, i.e., recompute all internal buffers and update the window.
133194 virtual void redraw ();
134195
196+ // / @}
197+
135198 // / Function called when a key is pressed. Users can define their own function in order
136199 // / to add specific behavior.
137200 std::function<bool (QKeyEvent *, CGAL::Qt::Basic_viewer *)> on_key_pressed;
0 commit comments