From 056ecbaadfb84e067cd3f46fbf996a6ad40a619b Mon Sep 17 00:00:00 2001 From: Radu Ursu Date: Fri, 12 Apr 2002 08:07:36 +0000 Subject: [PATCH] commited --- Packages/Qt_widget/TODO | 3 +- .../include/CGAL/IO/Qt_widget_get_segment.h | 52 +++++++++---------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Packages/Qt_widget/TODO b/Packages/Qt_widget/TODO index fa56b2c8100..59570a94841 100644 --- a/Packages/Qt_widget/TODO +++ b/Packages/Qt_widget/TODO @@ -34,6 +34,7 @@ TODO FOR DOC 1) put do_paint in an advanced section 2) Document well set_window() add ranges ... 3) Document the compilation phase (with moc). create_makefile? -4) add the signal detached_tool() +4) add the signal detached_tool() + [removed because of progress to layers] 5) add custom_redraw() signal [done] 6) remove the derivation of redraw(); [done] diff --git a/Packages/Qt_widget/include/CGAL/IO/Qt_widget_get_segment.h b/Packages/Qt_widget/include/CGAL/IO/Qt_widget_get_segment.h index 46b17bc8678..5826005215c 100644 --- a/Packages/Qt_widget/include/CGAL/IO/Qt_widget_get_segment.h +++ b/Packages/Qt_widget/include/CGAL/IO/Qt_widget_get_segment.h @@ -43,6 +43,7 @@ public: firsttime(true){}; private: + QCursor oldcursor; void mousePressEvent(QMouseEvent *e) { if(e->button() == CGAL_QT_WIDGET_GET_POINT_BUTTON && !firstpoint) @@ -73,11 +74,11 @@ private: RasterOp old_raster = widget->rasterOp();//save the initial raster mode QColor old_color = widget->color(); widget->lock(); - widget->setRasterOp(XorROP); - *widget << CGAL::GREEN; - *widget << Segment(Point(x1,y1),Point(x2,y2)); - widget->setRasterOp(old_raster); - widget->setColor(old_color); + widget->setRasterOp(XorROP); + *widget << CGAL::GREEN; + *widget << Segment(Point(x1,y1),Point(x2,y2)); + widget->setRasterOp(old_raster); + widget->setColor(old_color); widget->unlock(); firsttime = true; } @@ -86,25 +87,24 @@ private: { if(firstpoint) { - FT - x=static_cast(widget->x_real(e->x())), - y=static_cast(widget->y_real(e->y())); - RasterOp old_raster = widget->rasterOp();//save the initial raster mode - QColor old_color = widget->color(); - widget->setRasterOp(XorROP); - widget->lock(); - *widget << CGAL::GREEN; - if(!firsttime) - *widget << Segment(Point(x1,y1),Point(x2,y2)); - *widget << Segment(Point(x1,y1),Point(x,y)); - widget->unlock(); - widget->setRasterOp(old_raster); - widget->setColor(old_color); + FT x=static_cast(widget->x_real(e->x())); + FT y=static_cast(widget->y_real(e->y())); + RasterOp old_raster = widget->rasterOp();//save the initial raster mode + QColor old_color = widget->color(); + widget->setRasterOp(XorROP); + widget->lock(); + *widget << CGAL::GREEN; + if(!firsttime) + *widget << Segment(Point(x1,y1),Point(x2,y2)); + *widget << Segment(Point(x1,y1),Point(x,y)); + widget->unlock(); + widget->setRasterOp(old_raster); + widget->setColor(old_color); - //save the last coordinates to redraw the screen - x2 = x; - y2 = y; - firsttime = false; + //save the last coordinates to redraw the screen + x2 = x; + y2 = y; + firsttime = false; } }; void activating() @@ -120,11 +120,11 @@ private: }; FT x1, //the X of the first point - y1; //the Y of the first point + y1; //the Y of the first point FT x2, //the old second point's X - y2; //the old second point's Y + y2; //the old second point's Y bool firstpoint, //true if the user left clicked once - firsttime; //true if the line is not drawn + firsttime; //true if the line is not drawn };//end class } // namespace CGAL