diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 34bd3e6d67b..c25db11a964 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -1324,7 +1324,5 @@ Scene_c3t3_item::setColor(QColor c) color_ = c; compute_color_map(c); invalidateOpenGLBuffers(); -// changed() doesn't work because the timerEvent delays it out of the draw -// function and the intersection is not drawn before the next draw call are_intersection_buffers_filled = false; } diff --git a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp index a17717df8f8..d48e021121f 100644 --- a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp @@ -353,7 +353,6 @@ Scene_implicit_function_item(Implicit_function_interface* f) texture = new Texture(grid_size_-1,grid_size_-1); blue_color_ramp_.build_blue(); red_color_ramp_.build_red(); - startTimer(0); //Generates an integer which will be used as ID for each buffer compute_min_max(); compute_function_grid(); @@ -583,7 +582,7 @@ Scene_implicit_function_item::invalidateOpenGLBuffers() } -void Scene_implicit_function_item::timerEvent(QTimerEvent* /*event*/) +void Scene_implicit_function_item::updateCutPlane() { // just handle deformation - paint like selection is handled in eventFilter() if(need_update_) { compute_function_grid(); diff --git a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h index 053f2d566ce..ba163a5cbf1 100644 --- a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h @@ -71,9 +71,9 @@ public: virtual QString toolTip() const; virtual void invalidateOpenGLBuffers(); public Q_SLOTS: - void plane_was_moved() { need_update_ = true; } + void plane_was_moved() { need_update_ = true; QTimer::singleShot(0, this, SLOT(updateCutPlane())); } void compute_function_grid() const; - void timerEvent(QTimerEvent*); + void updateCutPlane(); private: typedef qglviewer::Vec Point;