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)
|
void get_new_object(CGAL::Object obj)
|
||||||
{
|
{
|
||||||
Cgal_Polygon poly;
|
if (const Cgal_Polygon *poly = CGAL::object_cast<Cgal_Polygon>(&obj))
|
||||||
if (CGAL::assign(poly, obj))
|
|
||||||
{
|
{
|
||||||
polygon = poly;
|
polygon = *poly;
|
||||||
something_changed();
|
something_changed();
|
||||||
}
|
}
|
||||||
widget->redraw();
|
widget->redraw();
|
||||||
|
|
|
||||||
|
|
@ -191,14 +191,12 @@ private slots:
|
||||||
|
|
||||||
void get_new_object(CGAL::Object obj)
|
void get_new_object(CGAL::Object obj)
|
||||||
{
|
{
|
||||||
Cgal_Polygon poly;
|
if(const Cgal_Polygon *poly = CGAL::object_cast<Cgal_Polygon>(&obj)) {
|
||||||
Point_2 p;
|
polygon = *poly;
|
||||||
if(CGAL::assign(poly, obj)) {
|
|
||||||
polygon = poly;
|
|
||||||
something_changed();
|
something_changed();
|
||||||
show_info();
|
show_info();
|
||||||
} else if(CGAL::assign(p, obj)) {
|
} else if(const Point_2 *p = CGAL::object_cast<Point_2>(&obj)) {
|
||||||
point = p;
|
point = *p;
|
||||||
is_point_visible = true;
|
is_point_visible = true;
|
||||||
show_pinfo();
|
show_pinfo();
|
||||||
something_changed();
|
something_changed();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue