diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_visitors.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_visitors.h index af3818c80e9..f71c95d1771 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_visitors.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_visitors.h @@ -67,7 +67,7 @@ public: typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2; typedef typename Gt2::Point_2 Point_2; - typedef CGAL::Surface_sweep_2::Surface_sweep_2 Surface_sweep_2; + typedef typename Base::Surface_sweep_2 Surface_sweep_2; protected: Output_ierator m_out; // The output points. @@ -92,9 +92,7 @@ public: this->traits()); //Perform the sweep - Surface_sweep_2* sl = - reinterpret_cast(this->surface_sweep()); - + Surface_sweep_2* sl = this->surface_sweep(); sl->sweep(curves_vec.begin(), curves_vec.end(), points_vec.begin(), points_vec.end()); } @@ -146,7 +144,7 @@ public: typedef typename Subcurve::Status_line_iterator Status_line_iterator; - typedef CGAL::Surface_sweep_2::Surface_sweep_2 Surface_sweep_2; + typedef typename Base::Surface_sweep_2 Surface_sweep_2; protected: // Data members: @@ -172,9 +170,7 @@ public: this->traits()); // Perform the sweep. - Surface_sweep_2* sl = - reinterpret_cast(this->surface_sweep()); - + Surface_sweep_2* sl = this->surface_sweep(); sl->sweep(curves_vec.begin(), curves_vec.end(), points_vec.begin(), points_vec.end()); } @@ -225,7 +221,7 @@ public: typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2; typedef typename Gt2::Point_2 Point_2; - typedef CGAL::Surface_sweep_2::Surface_sweep_2 Surface_sweep_2; + typedef typename Base::Surface_sweep_2 Surface_sweep_2; protected: // Data members: @@ -247,9 +243,7 @@ public: this-> traits()); // Perform the sweep. - Surface_sweep_2* sl = - reinterpret_cast(this->surface_sweep()); - + Surface_sweep_2* sl = this->surface_sweep(); sl->sweep(curves_vec.begin(), curves_vec.end(), points_vec.begin(), points_vec.end()); } @@ -286,8 +280,7 @@ public: void sweep_xcurves(XCurveIterator begin, XCurveIterator end) { // Perform the sweep. - Surface_sweep_2* sl = - reinterpret_cast(this->surface_sweep()); + Surface_sweep_2* sl = this->surface_sweep(); sl->sweep(begin, end); } @@ -301,9 +294,8 @@ public: bool /* flag */) { if (m_found_x) { - Surface_sweep_2* sl = - reinterpret_cast(this->surface_sweep()); - sl->stop_sweep(); + Surface_sweep_2* sl = this->surface_sweep(); + sl->stop_sweep(); } return true; } diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Visitor.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Visitor.h index 56121d4ee16..92d46544d53 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Visitor.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Visitor.h @@ -76,8 +76,7 @@ public: virtual ~Visitor_base() {} /*! Attach the a sweep-line object. */ - void attach(const Surface_sweep_2* sl) - { m_surface_sweep = (Surface_sweep_2*)(sl); } + void attach(Surface_sweep_2* sl) { m_surface_sweep = sl; } /*! * A notification invoked before the sweep-line starts handling the given