diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayShootCallback.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayShootCallback.h index 53cb0fcb76e..00b841f2d6f 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayShootCallback.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayShootCallback.h @@ -127,7 +127,11 @@ protected: void highlightPointLocation( QGraphicsSceneMouseEvent *event ); Face_const_handle getFace( const CGAL::Object& o ); CGAL::Object rayShootUp( const Kernel_point_2& point ); + CGAL::Object rayShootUp( const Kernel_point_2& point, CGAL::Tag_true ); + CGAL::Object rayShootUp( const Kernel_point_2& point, CGAL::Tag_false ); CGAL::Object rayShootDown( const Kernel_point_2& point ); + CGAL::Object rayShootDown( const Kernel_point_2& point, CGAL::Tag_true ); + CGAL::Object rayShootDown( const Kernel_point_2& point, CGAL::Tag_false ); using Superclass::scene; using Superclass::shootingUp; @@ -304,6 +308,14 @@ VerticalRayShootCallback< Arr_ >::getFace( const CGAL::Object& obj ) template < typename Arr_ > CGAL::Object VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt ) +{ + typename Supports_landmarks< Arrangement >::Tag supportsLandmarks; + return this->rayShootUp( pt, supportsLandmarks ); +} + +template < typename Arr_ > +CGAL::Object VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt, + CGAL::Tag_true ) { CGAL::Object pointLocationResult; Walk_pl_strategy* walkStrategy; @@ -334,9 +346,48 @@ VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt ) return pointLocationResult; } +template < typename Arr_ > +CGAL::Object VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt, + CGAL::Tag_false ) +{ + CGAL::Object pointLocationResult; + Walk_pl_strategy* walkStrategy; + TrapezoidPointLocationStrategy* trapezoidStrategy; + SimplePointLocationStrategy* simpleStrategy; + + Point_2 point = this->toArrPoint( pt ); + + if ( CGAL::assign( walkStrategy, this->pointLocationStrategy ) ) + { + pointLocationResult = walkStrategy->ray_shoot_up( point ); + } + else if ( CGAL::assign( trapezoidStrategy, this->pointLocationStrategy ) ) + { + pointLocationResult = trapezoidStrategy->ray_shoot_up( point ); + } + else if ( CGAL::assign( simpleStrategy, this->pointLocationStrategy ) ) + { + pointLocationResult = simpleStrategy->ray_shoot_up( point ); + } + else + { + std::cout<<"Didn't find the right strategy\n"; + } + + return pointLocationResult; +} + template < typename Arr_ > CGAL::Object VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt ) +{ + typename Supports_landmarks< Arrangement >::Tag supportsLandmarks; + return this->rayShootDown( pt, supportsLandmarks ); +} + +template < typename Arr_ > +CGAL::Object +VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt, CGAL::Tag_true ) { CGAL::Object pointLocationResult; Walk_pl_strategy* walkStrategy; @@ -367,4 +418,30 @@ VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt ) return pointLocationResult; } +template < typename Arr_ > +CGAL::Object +VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt, CGAL::Tag_false ) +{ + CGAL::Object pointLocationResult; + Walk_pl_strategy* walkStrategy; + TrapezoidPointLocationStrategy* trapezoidStrategy; + SimplePointLocationStrategy* simpleStrategy; + + Point_2 point = this->toArrPoint( pt ); + + if ( CGAL::assign( walkStrategy, this->pointLocationStrategy ) ) + { + pointLocationResult = walkStrategy->ray_shoot_down( point ); + } + else if ( CGAL::assign( trapezoidStrategy, this->pointLocationStrategy ) ) + { + pointLocationResult = trapezoidStrategy->ray_shoot_down( point ); + } + else if ( CGAL::assign( simpleStrategy, this->pointLocationStrategy ) ) + { + pointLocationResult = simpleStrategy->ray_shoot_down( point ); + } + return pointLocationResult; +} + #endif // VERTICAL_RAY_SHOOT_CALLBACK_H