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 bv1(mainWindow, scene1);
CGAL::Qt::Basic_viewer bv2(mainWindow, scene2); CGAL::Qt::Basic_viewer bv2(mainWindow, scene2);
bv1.set_draw_vertices(true); bv1.draw_vertices(true);
layout->addWidget(&bv1); layout->addWidget(&bv1);
layout->addWidget(&bv2); layout->addWidget(&bv2);

View File

@ -106,7 +106,7 @@ int main(int argc, char* argv[])
if(app) if(app)
{ {
app.basic_viewer().on_key_pressed= 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(); const ::Qt::KeyboardModifiers modifiers = e->modifiers();
if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton))

View File

@ -239,7 +239,7 @@ public:
void face_begin() void face_begin()
{ {
if (is_a_face_started()) if (a_face_started())
{ {
std::cerr std::cerr
<< "You cannot start a new face before to finish the previous one." << "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) void face_begin(const CGAL::IO::Color &acolor)
{ {
if (is_a_face_started()) if (a_face_started())
{ {
std::cerr std::cerr
<< "You cannot start a new face before to finish the previous one." << "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 // Returns true if the data structure lies on a XY or XZ or YZ plane
bool is_two_dimensional() const 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() void clear()

View File

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

View File

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

View File

@ -41,7 +41,7 @@ struct Graphics_scene_options_periodic_2_triangulation_2 :
{ return m_draw_domain; } { return m_draw_domain; }
void set_draw_domain(bool b) void set_draw_domain(bool b)
{ m_draw_domain=b; } { m_draw_domain=b; }
void negate_draw_domain() void toggle_draw_domain()
{ m_draw_domain=!m_draw_domain; } { m_draw_domain=!m_draw_domain; }
typename DS::Iterator_type current_display_type() const 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 disable_voronoi_vertices() { m_draw_voronoi_vertices=false; }
void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; } void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; }
bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; } 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 disable_dual_vertices() { m_draw_dual_vertices=false; }
void enable_dual_vertices() { m_draw_dual_vertices=true; } void enable_dual_vertices() { m_draw_dual_vertices=true; }
bool are_dual_vertices_enabled() const { return m_draw_dual_vertices; } 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 dual_vertex_color;
CGAL::IO::Color ray_color; CGAL::IO::Color ray_color;
@ -394,7 +394,7 @@ void draw(const CGAL_VORONOI_TYPE& av2,
const ::Qt::KeyboardModifiers modifiers = e->modifiers(); const ::Qt::KeyboardModifiers modifiers = e->modifiers();
if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton))
{ {
basic_viewer->negate_draw_rays(); basic_viewer->toggle_draw_rays();
basic_viewer->displayMessage basic_viewer->displayMessage
(QString("Draw rays=%1.").arg(basic_viewer->get_draw_rays()?"true":"false")); (QString("Draw rays=%1.").arg(basic_viewer->get_draw_rays()?"true":"false"));