Use object_cast instead of assign

This commit is contained in:
Sylvain Pion 2008-07-29 14:12:25 +00:00
parent 0c9d10baa6
commit d2fb090976
2 changed files with 6 additions and 9 deletions

View File

@ -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();

View File

@ -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();