mirror of https://github.com/CGAL/cgal
commited
This commit is contained in:
parent
c1a1f5b824
commit
056ecbaadf
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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<FT>(widget->x_real(e->x())),
|
||||
y=static_cast<FT>(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<FT>(widget->x_real(e->x()));
|
||||
FT y=static_cast<FT>(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
|
||||
|
|
|
|||
Loading…
Reference in New Issue