mirror of https://github.com/CGAL/cgal
Polishing
This commit is contained in:
parent
c01661b643
commit
ea3f79c52c
|
|
@ -38,7 +38,6 @@ public:
|
||||||
Qt_widget_get_polygon()
|
Qt_widget_get_polygon()
|
||||||
: active(false), lastx(0), lasty(0), num_points(0), points(), qpoints(0), qpoints_old(0) {};
|
: active(false), lastx(0), lasty(0), num_points(0), points(), qpoints(0), qpoints_old(0) {};
|
||||||
|
|
||||||
private:
|
|
||||||
void mousePressEvent(QMouseEvent *e)
|
void mousePressEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
QPainter painter(widget);
|
QPainter painter(widget);
|
||||||
|
|
@ -52,6 +51,7 @@ private:
|
||||||
qpoints_old.putPoints(num_points,1,e->x(),e->y());
|
qpoints_old.putPoints(num_points,1,e->x(),e->y());
|
||||||
++num_points;
|
++num_points;
|
||||||
active=true;
|
active=true;
|
||||||
|
widget->setMouseTracking(TRUE);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
if(e->button() == Qt::RightButton)
|
if(e->button() == Qt::RightButton)
|
||||||
|
|
@ -70,6 +70,7 @@ private:
|
||||||
qpoints_old.resize(0);
|
qpoints_old.resize(0);
|
||||||
num_points=0;
|
num_points=0;
|
||||||
active=false;
|
active=false;
|
||||||
|
widget->setMouseTracking(FALSE);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -97,22 +98,13 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
bool active;
|
bool active;
|
||||||
int lastx, lasty;
|
int lastx, lasty;
|
||||||
int num_points;
|
int num_points;
|
||||||
std::list<Point> points;
|
std::list<Point> points;
|
||||||
QPointArray qpoints;
|
QPointArray qpoints;
|
||||||
QPointArray qpoints_old;
|
QPointArray qpoints_old;
|
||||||
|
|
||||||
void attaching()
|
|
||||||
{
|
|
||||||
widget->setMouseTracking(TRUE);
|
|
||||||
};
|
|
||||||
|
|
||||||
void dettaching()
|
|
||||||
{
|
|
||||||
widget->setMouseTracking(FALSE);
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue