mirror of https://github.com/CGAL/cgal
Use object_cast instead of assign
This commit is contained in:
parent
0c9d10baa6
commit
d2fb090976
|
|
@ -157,10 +157,9 @@ private slots:
|
|||
|
||||
void get_new_object(CGAL::Object obj)
|
||||
{
|
||||
Cgal_Polygon poly;
|
||||
if (CGAL::assign(poly, obj))
|
||||
if (const Cgal_Polygon *poly = CGAL::object_cast<Cgal_Polygon>(&obj))
|
||||
{
|
||||
polygon = poly;
|
||||
polygon = *poly;
|
||||
something_changed();
|
||||
}
|
||||
widget->redraw();
|
||||
|
|
|
|||
|
|
@ -191,14 +191,12 @@ private slots:
|
|||
|
||||
void get_new_object(CGAL::Object obj)
|
||||
{
|
||||
Cgal_Polygon poly;
|
||||
Point_2 p;
|
||||
if(CGAL::assign(poly, obj)) {
|
||||
polygon = poly;
|
||||
if(const Cgal_Polygon *poly = CGAL::object_cast<Cgal_Polygon>(&obj)) {
|
||||
polygon = *poly;
|
||||
something_changed();
|
||||
show_info();
|
||||
} else if(CGAL::assign(p, obj)) {
|
||||
point = p;
|
||||
} else if(const Point_2 *p = CGAL::object_cast<Point_2>(&obj)) {
|
||||
point = *p;
|
||||
is_point_visible = true;
|
||||
show_pinfo();
|
||||
something_changed();
|
||||
|
|
|
|||
Loading…
Reference in New Issue