Update code to follow last api

This commit is contained in:
Guillaume Damiand 2023-11-20 09:33:28 +01:00
parent db97ebbf1f
commit d2d114cf24
8 changed files with 13 additions and 13 deletions

View File

@ -71,7 +71,7 @@ int main(void)
CGAL::Qt::Basic_viewer bv1(mainWindow, scene1);
CGAL::Qt::Basic_viewer bv2(mainWindow, scene2);
bv1.set_draw_vertices(true);
bv1.draw_vertices(true);
layout->addWidget(&bv1);
layout->addWidget(&bv2);

View File

@ -106,7 +106,7 @@ int main(int argc, char* argv[])
if(app)
{
app.basic_viewer().on_key_pressed=
[&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool
[&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool
{
const ::Qt::KeyboardModifiers modifiers = e->modifiers();
if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton))

View File

@ -239,7 +239,7 @@ public:
void face_begin()
{
if (is_a_face_started())
if (a_face_started())
{
std::cerr
<< "You cannot start a new face before to finish the previous one."
@ -251,7 +251,7 @@ public:
void face_begin(const CGAL::IO::Color &acolor)
{
if (is_a_face_started())
if (a_face_started())
{
std::cerr
<< "You cannot start a new face before to finish the previous one."
@ -342,7 +342,7 @@ public:
// Returns true if the data structure lies on a XY or XZ or YZ plane
bool is_two_dimensional() const
{
return (!is_empty() && (has_zero_x() || has_zero_y() || has_zero_z()));
return (!empty() && (has_zero_x() || has_zero_y() || has_zero_z()));
}
void clear()

View File

@ -155,7 +155,7 @@ public:
resize(CGAL_BASIC_VIEWER_INIT_SIZE_X, CGAL_BASIC_VIEWER_INIT_SIZE_Y);
if (inverse_normal)
{ reverse_normals(); }
{ reverse_all_normals(); }
}
~Basic_viewer()
@ -1254,7 +1254,7 @@ protected:
}
else if ((e->key()==::Qt::Key_N) && (modifiers==::Qt::NoButton))
{
reverse_normals();
reverse_all_normals();
displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false"));
redraw();
}

View File

@ -164,7 +164,7 @@ public:
*/
virtual void add_elements()
{
this->clear();
graphics_scene.clear();
std::vector<Pwh> pwhs;
m_ps.polygons_with_holes(std::back_inserter(pwhs));
for (const auto& pwh : pwhs)

View File

@ -232,7 +232,7 @@ void compute_elements(const Nef_Polyhedron &nef,
{ nef.visit_shell_objects(SFace_const_handle(it), V); }
}
graphics_scene.negate_all_normals();
graphics_scene.reverse_all_normals();
}
} // namespace draw_function_for_nef_polyhedron

View File

@ -41,7 +41,7 @@ struct Graphics_scene_options_periodic_2_triangulation_2 :
{ return m_draw_domain; }
void set_draw_domain(bool b)
{ m_draw_domain=b; }
void negate_draw_domain()
void toggle_draw_domain()
{ m_draw_domain=!m_draw_domain; }
typename DS::Iterator_type current_display_type() const

View File

@ -46,12 +46,12 @@ struct Graphics_scene_options_voronoi :
void disable_voronoi_vertices() { m_draw_voronoi_vertices=false; }
void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; }
bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; }
void negate_draw_voronoi_vertices() { m_draw_voronoi_vertices=!m_draw_voronoi_vertices; }
void toggle_draw_voronoi_vertices() { m_draw_voronoi_vertices=!m_draw_voronoi_vertices; }
void disable_dual_vertices() { m_draw_dual_vertices=false; }
void enable_dual_vertices() { m_draw_dual_vertices=true; }
bool are_dual_vertices_enabled() const { return m_draw_dual_vertices; }
void negate_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; }
void toggle_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; }
CGAL::IO::Color dual_vertex_color;
CGAL::IO::Color ray_color;
@ -394,7 +394,7 @@ void draw(const CGAL_VORONOI_TYPE& av2,
const ::Qt::KeyboardModifiers modifiers = e->modifiers();
if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton))
{
basic_viewer->negate_draw_rays();
basic_viewer->toggle_draw_rays();
basic_viewer->displayMessage
(QString("Draw rays=%1.").arg(basic_viewer->get_draw_rays()?"true":"false"));