diff --git a/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Apollonius_site_2.h b/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Apollonius_site_2.h deleted file mode 100644 index 2277935778a..00000000000 --- a/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Apollonius_site_2.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2003,2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Menelaos Karavelas - - -#ifndef CGAL_QT_WIDGET_APOLLONIUS_SITE_2_H -#define CGAL_QT_WIDGET_APOLLONIUS_SITE_2_H - -#include -#include - -namespace CGAL { - -template -Qt_widget& -operator<<(Qt_widget &qt_w, const Apollonius_site_2& wp) -{ - typedef typename K::Circle_2 Circle_2; - typedef typename K::Point_2 Point_2; - - Point_2 p(wp.point()); - Circle_2 c(p, CGAL::square(wp.weight())); - return qt_w << p << c; -} - -} //namespace CGAL - - -#include - -#endif // CGAL_QT_WIDGET_APOLLONIUS_SITE_2_H diff --git a/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Hyperbola_2.h b/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Hyperbola_2.h deleted file mode 100644 index 1ff35051de6..00000000000 --- a/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Hyperbola_2.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2003,2004 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Menelaos Karavelas - -#ifndef CGAL_QT_WIDGET_HYPERBOLA_2_H -#define CGAL_QT_WIDGET_HYPERBOLA_2_H - -#include -#include -#include - -namespace CGAL { - -template< class Gt > -inline -Qt_widget& operator<<(Qt_widget& s, const Hyperbola_2< Gt > &H) -{ - H.draw_qt(s); - return s; -} - -template< class Gt > -inline -Qt_widget& operator<<(Qt_widget &s, Hyperbola_ray_2 &H) -{ - H.draw_qt(s); - return s; -} - -} //namespace CGAL - -#endif // CGAL_QT_WIDGET_HYPERBOLA_2_H diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Qt_widget_Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Qt_widget_Curve_renderer_2.h deleted file mode 100644 index 8005c97d271..00000000000 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Qt_widget_Curve_renderer_2.h +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) 2010,2011 Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Pavel Emeliyanenko -// -// ============================================================================ - -/*!\file CGAL/IO/Qt_widget_Curve_renderer_2.h - * \brief - * provides \c CGAL::Qt_widget interface for the curve renderer - */ - -#ifndef CGAL_QT_WIDGET_CURVE_RENDERER_2_H -#define CGAL_QT_WIDGET_CURVE_RENDERER_2_H - -#include -#include -#include - -namespace CGAL { - -#define CGAL_REND_PT_RADIUS 6 - -/*! \brief - * outputs a curve arc to \c Qt_widget - */ -template -Qt_widget& operator << (Qt_widget& ws, const internal::Arc_2< CKvA_2 >& arc) { - - typedef Curve_renderer_facade Facade; - - typedef std::pair< int, int > Coord_2; - typedef std::vector< Coord_2 > Coord_vec_2; - - boost::optional < Coord_2 > p1, p2; - std::list points; - - //Facade::setup(CGAL::Bbox_2(-100, -100, 10, -10), - // 330, 270); - - Facade::setup(CGAL::Bbox_2(ws.x_min(), ws.y_min(), ws.x_max(), ws.y_max()), - ws.width(), ws.height()); - - Facade::instance().draw(arc, points, &p1, &p2); - if(points.empty()) - return ws; - - QPainter *ppnt = &ws.get_painter(); - int height = ws.height(); - - // std::cerr << ws.width() << " and " << ws.height() << "\n"; - typename std::list::const_iterator lit = points.begin(); - //ppnt->moveTo((*p1).first, height - (*p1).second); - while(lit != points.end()) { - - const Coord_vec_2& vec = *lit; - typename Coord_vec_2::const_iterator vit = vec.begin(); - //std::cerr << "(" << vit->first << "; " << vit->second << ")\n"; -// if(lit == points.begin() &&*/ vit != vec.end()) { -// ppnt->lineTo(vit->first, height - vit->second); -// vit++; -// } - if(vit != vec.end()) - ppnt->moveTo(vit->first, height - vit->second); - - while(vit != vec.end()) { - ppnt->lineTo(vit->first, height - vit->second); - vit++; - //std::cerr << "(" << vit->e0 << "; " << vit->e1 << "\n"; - } - lit++; - } - //ppnt->lineTo((*p2).first, height - (*p2).second); - - QPen old_pen = ppnt->pen(); - ppnt->setPen(QPen(Qt::NoPen)); // avoid drawing outlines - // draw with the current brush attributes - - //std::cerr << "endpts1: (" << (*p1).first << "; " << (*p1).second << "\n"; - //std::cerr << "endpts2: (" << (*p2).first << "; " << (*p2).second << "\n"; - - unsigned sz = CGAL_REND_PT_RADIUS; - ppnt->drawEllipse((*p1).first - sz, height-(*p1).second - sz, sz*2, sz*2); - ppnt->drawEllipse((*p2).first - sz, height-(*p2).second - sz, sz*2, sz*2); - ppnt->setPen(old_pen); - - return ws; -} - -/*! \brief - * outputs a curve point to \c Qt_widget - */ -template -Qt_widget& operator << (Qt_widget& ws, const internal::Point_2< CKvA_2 >& pt) { - - typedef Curve_renderer_facade Facade; - - std::pair< int, int > coord; - Facade::setup(CGAL::Bbox_2(ws.x_min(), ws.y_min(), ws.x_max(), ws.y_max()), - ws.width(), ws.height()); - - if(!Facade::instance().draw(pt, coord)) { - return ws; - } - - QPainter *ppnt = &ws.get_painter(); - QPen old_pen = ppnt->pen(); - ppnt->setPen(QPen(Qt::NoPen)); - - unsigned sz = CGAL_REND_PT_RADIUS; - ppnt->drawEllipse(coord.first - sz, ws.height() - coord.second - sz, - sz*2, sz*2); - ppnt->setPen(old_pen); - return ws; -} - -} //namespace CGAL - -#endif // CGAL_QT_WIDGET_CURVE_RENDERER_2_H - diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Conic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Conic_arc_2.h deleted file mode 100644 index 24263c6f3c0..00000000000 --- a/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Conic_arc_2.h +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Ron Wein -// Efi Fogel - -#ifndef CGAL_QT_WIDGET_CONIC_ARC_2_H -#define CGAL_QT_WIDGET_CONIC_ARC_2_H - -#include -#include -#include - -namespace CGAL { - -/*! - * Draw an x-monotone conic arc. - */ -template -Qt_widget& operator<< (Qt_widget& ws, - const _Conic_x_monotone_arc_2& cv) -{ - // Get the co-ordinates of the curve's source and target. - const double sx = CGAL::to_double(cv.source().x()); - const double sy = CGAL::to_double(cv.source().y()); - const double tx = CGAL::to_double(cv.target().x()); - const double ty = CGAL::to_double(cv.target().y()); - - if (cv.orientation() == COLLINEAR) - { - // The curve is a segment - simply draw it. - ws.get_painter().drawLine(ws.x_pixel(sx), ws.y_pixel(sy), - ws.x_pixel(tx), ws.y_pixel(ty)); - return (ws); - } - - // Draw a curves conic arc: As the arc is x-monotone, its source and its - // target has the extreme x-coordinates. - const bool is_source_left = (sx < tx); - const int x_min = is_source_left ? ws.x_pixel(sx) : ws.x_pixel(tx); - const int x_max = is_source_left ? ws.x_pixel(tx) : ws.x_pixel(sx); - const int n = x_max - x_min + 1; - - if (n <= 0) - return (ws); - - typedef std::pair App_point_2; - int i; - - App_point_2 *pts = new App_point_2 [n + 1]; - cv.polyline_approximation (n, pts); - - ws.get_painter().moveTo (ws.x_pixel(pts[0].first), - ws.y_pixel(pts[0].second)); - for (i = 1; i <= n; i++) - { - ws.get_painter().lineTo (ws.x_pixel(pts[i].first), - ws.y_pixel(pts[i].second)); - } - delete[] pts; - - return (ws); -} - -/*! - * Draw a conic arc. - */ -template -Qt_widget& operator<< - (Qt_widget& ws, - const typename Arr_conic_traits_2::Curve_2& cv) -{ - typedef Arr_conic_traits_2 Conic_traits_2; - typedef typename Conic_traits_2::X_monotone_curve_2 X_monotone_conic_arc_2; - - - // Break the arc into x-monotone sub-curves and draw each one separately. - Conic_traits_2 traits; - std::list x_arcs; - typename std::list::const_iterator x_iter; - - traits.curve_make_x_monotone (cv, - std::back_inserter (x_arcs)); - - for (x_iter = x_arcs.begin(); x_iter != x_arcs.end(); ++x_iter) - ws << *x_iter; - - return (ws); -} - -} //namespace CGAL - -#endif diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Linear_object_2.h b/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Linear_object_2.h deleted file mode 100644 index bda5c41b2e2..00000000000 --- a/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Linear_object_2.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2006,2007,2009,2010,2011 Tel-Aviv University (Israel). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// $Date$ -// -// -// Author(s) : Ron Wein -// Efi Fogel - -#ifndef CGAL_QT_WIDGET_LINEAR_OBJECT_2_H -#define CGAL_QT_WIDGET_LINEAR_OBJECT_2_H - -#include -#include - -namespace CGAL { - -/*! - * Export a polyline to a window stream - */ -template -Qt_widget & operator<<(Qt_widget & ws, const Arr_linear_object_2 & o) -{ - if(o.is_segment()) - { - ws << o.segment(); - return ws; - } - if(o.is_ray()) - { - ws << o.ray(); - return ws; - } - - CGAL_assertion(o.is_line()); - ws << o.line(); - return ws; -} - -} //namespace CGAL - -#endif diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Polyline_2.h b/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Polyline_2.h deleted file mode 100644 index 62ce484ddac..00000000000 --- a/Arrangement_on_surface_2/include/CGAL/IO/Qt_widget_Polyline_2.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// $Date$ -// -// -// Author(s) : Ron Wein -// Efi Fogel - -#ifndef CGAL_QT_WIDGET_POLYLINE_2_H -#define CGAL_QT_WIDGET_POLYLINE_2_H - -#include -#include - -namespace CGAL { - -/*! - * Export a polyline to a window stream - */ -template -Qt_widget & operator<<(Qt_widget & ws, const _Polyline_2 & cv) -{ - for (unsigned int i = 0; i < cv.size(); ++i) ws << cv[i]; - return ws; -} - -} //namespace CGAL - -#endif diff --git a/Circular_kernel_2/include/CGAL/IO/Qt_widget_circular_arc_2.h b/Circular_kernel_2/include/CGAL/IO/Qt_widget_circular_arc_2.h deleted file mode 100644 index 752002d6377..00000000000 --- a/Circular_kernel_2/include/CGAL/IO/Qt_widget_circular_arc_2.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) 2003-2008 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Monique Teillaud, Sylvain Pion, Radu Ursu - -// Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 -// (ACS -- Algorithms for Complex Shapes) - -#ifndef CGAL_IO_QT_WIDGET_CIRCULAR_ARC_2_H -#define CGAL_IO_QT_WIDGET_CIRCULAR_ARC_2_H - -#include -#include -#include - -namespace CGAL { - -template < typename CK > -CGAL::Qt_widget & -operator<<(CGAL::Qt_widget & widget, const CGAL::Circular_arc_2 &arc) -{ - const typename CK::Circle_2 & circ = arc.supporting_circle(); - //typename CK::Circle_2 circ = arc.supporting_circle(); - const typename CK::Point_2 & center = circ.center(); - const typename CK::Circular_arc_point_2 & source = arc.source(); - const typename CK::Circular_arc_point_2 & target = arc.target(); - double rad = std::sqrt(CGAL::to_double(circ.squared_radius())); - - int x_screen = widget.x_pixel(CGAL::to_double(center.x())); - int y_screen = widget.y_pixel(CGAL::to_double(center.y())); - int x_screen_b = widget.x_pixel(CGAL::to_double(center.x()) + rad); - int radius = x_screen_b - x_screen; - - double a = std::atan2( to_double(source.y() - center.y()), - to_double(source.x() - center.x())); - double a2p = std::atan2( to_double(target.y() - center.y()), - to_double(target.x() - center.x())); - - if (a2p <= a) - a2p += 2 * CGAL_PI; - - double alen2 = a2p - a; - - double diff = 180/CGAL_PI*16; - - widget.get_painter().drawArc(x_screen - radius, - y_screen - radius, - 2 * radius, 2 * radius, - (int)(a * diff), - (int)(alen2 * diff)); - return widget; -} - -} // namespace CGAL - -#endif // CGAL_IO_QT_WIDGET_CIRCULAR_ARC_2_H diff --git a/Circular_kernel_2/include/CGAL/IO/Qt_widget_circular_arc_endpoint_2.h b/Circular_kernel_2/include/CGAL/IO/Qt_widget_circular_arc_endpoint_2.h deleted file mode 100644 index 2e3f384c67e..00000000000 --- a/Circular_kernel_2/include/CGAL/IO/Qt_widget_circular_arc_endpoint_2.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2003-2008 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Monique Teillaud, Sylvain Pion - -// Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 -// (ACS -- Algorithms for Complex Shapes) - -#ifndef CGAL_IO_QT_WIDGET_CIRCULAR_ARC_ENDPOINT_2_H -#define CGAL_IO_QT_WIDGET_CIRCULAR_ARC_ENDPOINT_2_H - -#include -#include - -namespace CGAL { - -template < typename CK > -CGAL::Qt_widget & -operator<<(CGAL::Qt_widget & widget, const CGAL::Circular_arc_point_2 &p) -{ - typedef typename CK::Point_2 Point_2; - return widget << Point_2(to_double(p.x()), to_double(p.y())); -} - -} // namespace CGAL - -#endif // CGAL_IO_QT_WIDGET_CIRCULAR_ARC_ENDPOINT_2_H diff --git a/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h b/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h deleted file mode 100644 index 0a94a198b88..00000000000 --- a/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) 1997-2002 Max-Planck-Institute Saarbruecken (Germany). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Michael Seel -// Miguel Granados -// Susan Hert -// Lutz Kettner -#ifndef CGAL_SNC_RAY_SHOOTER_H -#define CGAL_SNC_RAY_SHOOTER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef SM_VISUALIZOR -#include -#endif // SM_VISUALIZOR -#include -#include -#undef CGAL_NEF_DEBUG -#define CGAL_NEF_DEBUG 37 -#include - -#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include -#endif - -namespace CGAL { - -// ---------------------------------------------------------------------------- -// SNC_ray_shooting -// ---------------------------------------------------------------------------- - -/*{\Manpage{SNC_ray_shooting}{SNC}{ray shoot functionality}{O}}*/ - -template -class SNC_ray_shooter : public SNC_decorator -{ - -protected: - typedef typename SNC_decorator::SNC_structure SNC_structure; - typedef SNC_ray_shooter Self; - typedef SNC_decorator Base; - -public: - typedef typename SNC_decorator::Decorator_traits Decorator_traits; - typedef typename Decorator_traits::SM_decorator SM_decorator; - typedef SM_point_locator SM_point_locator; - typedef SNC_intersection SNC_intersection; - - typedef typename Decorator_traits::Vertex_handle Vertex_handle; - typedef typename Decorator_traits::Halfedge_handle Halfedge_handle; - typedef typename Decorator_traits::Halffacet_handle Halffacet_handle; - typedef typename Decorator_traits::Volume_handle Volume_handle; - - typedef typename Decorator_traits::SVertex_handle SVertex_handle; - typedef typename Decorator_traits::SHalfedge_handle SHalfedge_handle; - typedef typename Decorator_traits::SFace_handle SFace_handle; - typedef typename Decorator_traits::SHalfloop_handle SHalfloop_handle; - - typedef typename SNC_structure::Object_handle Object_handle; - - typedef typename SNC_structure::Kernel Kernel; - typedef typename SNC_structure::Point_3 Point_3; - typedef typename SNC_structure::Vector_3 Vector_3; - typedef typename SNC_structure::Segment_3 Segment_3; - typedef typename SNC_structure::Ray_3 Ray_3; - typedef typename SNC_structure::Line_3 Line_3; - typedef typename SNC_structure::Plane_3 Plane_3; - - typedef typename SNC_structure::Mark Mark; - - #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO - typedef void* GenPtr; - #else - typedef boost::any GenPtr; - #endif - - SNC_ray_shooter() {} - void initialize(SNC_structure* W) { *this = SNC_ray_shooter(*W);} - - SNC_ray_shooter(SNC_structure& W) : Base(W) {} - /*{\Mcreate makes |\Mvar| a ray shooter on |W|.}*/ - - private: - Volume_handle determine_volume(const Ray_3& ray) const { - CGAL_precondition( !ray.is_degenerate()); - Object_handle o = shoot(ray); - Vertex_handle v; - Halfedge_handle e; - Halffacet_handle f, f_below; - if( CGAL::assign(v, o)) { - CGAL_NEF_TRACEN("facet below from from vertex..."); - f_below = get_visible_facet(v, ray); - if(f_below != Halffacet_handle()) - return f_below->incident_volume(); - SM_decorator SD(&*v); - CGAL_assertion( SD.number_of_sfaces() == 1); - return SD.sfaces_begin()->volume(); - } - else if( CGAL::assign(e, o)) { - CGAL_NEF_TRACEN("facet below from from edge..."); - f_below = get_visible_facet(e, ray); - if(f_below != Halffacet_handle()) - return f_below->incident_volume(); - SM_decorator SD(&*e->source()); - CGAL_assertion(SD.is_isolated(e)); - return e->incident_sface()->volume(); - } - else if( CGAL::assign(f, o)) { - CGAL_NEF_TRACEN("facet below from from facet..."); - f_below = get_visible_facet(f, ray); - CGAL_assertion( f_below != Halffacet_handle()); - return f_below->incident_volume(); - } - - return Base(*this).volumes_begin(); - } - - public: - Object_handle shoot(const Ray_3& ray) const - /*{\Mop returns the nearest object hit by a ray |ray|. }*/ { - CGAL_precondition( !ray.is_degenerate()); - bool hit = false; - Point_3 end_of_seg; - SNC_intersection is(*this->sncp()); - - CGAL_NEF_TRACEN( "Shooting ray " << ray); - Object_handle o; - Vertex_handle v; - CGAL_forall_vertices( v, *this->sncp()) { - if ( ray.source() != v->point() && ray.has_on(v->point())) { - if(hit && !Segment_3(ray.source(), end_of_seg).has_on(v->point())) - continue; - CGAL_NEF_TRACEN("ray hit vertex case "<point()); - end_of_seg = v->point(); - hit = true; - o = Object_handle(v); - } - } - - Halfedge_handle e; - CGAL_forall_edges( e, *this->sncp()) { - Point_3 q; - if( is.does_intersect_internally( ray, segment(e), q)) { - if (!hit || - has_smaller_distance_to_point(ray.source(),q, end_of_seg)) { - CGAL_NEF_TRACEN("ray hit edge case " << segment(e) << " in " << q); - end_of_seg = q; - hit = true; - o = Object_handle(e); - } - } - } - - Halffacet_handle f; - CGAL_forall_halffacets( f, *this->sncp()) { - Point_3 q; - if( is.does_intersect_internally( ray, f, q) ) { - if(!hit || - has_smaller_distance_to_point(ray.source(), q, end_of_seg)) { - CGAL_NEF_TRACEN("ray hit facet "<< f->plane()<<" on "<sncp()); - - CGAL_NEF_TRACEN( "Point locator for " << p); - Vertex_handle v; - CGAL_forall_vertices( v, *this->sncp()) { - CGAL_NEF_TRACEN("test vertex " << v->point()); - if ( p == v->point()) { - CGAL_NEF_TRACEN("on vertex."); - return Object_handle(v); - } - } - - Halfedge_handle e; - CGAL_forall_edges( e, *this->sncp()) { - if ( is.does_contain_internally( segment(e), p) ) { - CGAL_NEF_TRACEN("on edge."); - return Object_handle(e); - } - } - Halffacet_handle f; - CGAL_forall_halffacets( f, *this->sncp()) { - if ( is.does_contain_internally( f, p) ) { - CGAL_NEF_TRACEN("on facet."); - return Object_handle(f); - } - } - - CGAL_warning("altered code in SNC_ray_shooter"); - Ray_3 r( p, Vector_3( 0, 0, 1)); - return Object_handle(determine_volume(r)); - } - -}; // SNC_ray_shooter - -} //namespace CGAL - -#endif //CGAL_SNC_RAY_SHOOTER_H diff --git a/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Nef_3/include/CGAL/Nef_polyhedron_3.h index 81ed498efb4..a8f75ab4bee 100644 --- a/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -48,9 +48,6 @@ #include #include -#ifdef CGAL_NEF3_POINT_LOCATOR_NAIVE -#include -#endif #ifdef CGAL_NEF3_CGAL_NEF3_SM_VISUALIZOR #include @@ -115,11 +112,7 @@ class Nef_polyhedron_3_rep typedef CGAL::SNC_external_structure SNC_external_structure; typedef CGAL::SNC_point_locator SNC_point_locator; typedef CGAL::SNC_simplify SNC_simplify; -#ifdef CGAL_NEF3_POINT_LOCATOR_NAIVE - typedef CGAL::SNC_point_locator_naive SNC_point_locator_default; -#else typedef CGAL::SNC_point_locator_by_spatial_subdivision SNC_point_locator_default; -#endif typedef typename SNC_structure::Sphere_map Sphere_map; typedef CGAL::SM_decorator SM_decorator;