// Copyright (c) 2000 Max-Planck-Institute Saarbruecken (Germany). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL: https://github.com/CGAL/cgal/blob/v5.1/Partition_2/include/CGAL/Partition_traits_2.h $ // $Id: Partition_traits_2.h 0779373 2020-03-26T13:31:46+01:00 Sébastien Loriot // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Susan Hert #ifndef CGAL_PARTITION_TRAITS_2_H #define CGAL_PARTITION_TRAITS_2_H #include #include #include #include #include #include namespace CGAL { template > class Partition_traits_2; template struct Polygon_traits_getter{ typedef Partition_traits_2 type; }; template struct Polygon_traits_getter > { typedef BT type; }; template class Partition_traits_2 : public Base_traits { private: typedef Base_traits Kernel; typedef Partition_traits_2 Self; PointPropertyMap ppmap; public: Partition_traits_2(const Base_traits& base=Base_traits()) : Base_traits(base) {} Partition_traits_2(const PointPropertyMap& ppmap, const Base_traits& base=Base_traits()) : Base_traits(base),ppmap(ppmap) {} typedef typename Kernel::FT FT; typedef typename boost::property_traits::key_type Point_2; typedef typename boost::call_traits::param_type Arg_type; typedef ::std::list Container; typedef typename Polygon_traits_getter::type PolygonTraits; typedef CGAL::Polygon_2 Polygon_2; template struct Pmap_fct : public BaseFct { Pmap_fct(const PointPropertyMap& ppmap, const BaseFct& base) : BaseFct(base),ppmap(ppmap) {} const PointPropertyMap& ppmap; typename BaseFct::result_type operator()(const Arg_type& p, const Arg_type& q) const { return static_cast(this)->operator()(get(ppmap,p),get(ppmap,q)); } typename BaseFct::result_type operator()(const Arg_type& p, const Arg_type& q, const Arg_type& r) const { return static_cast(this)->operator()(get(ppmap,p),get(ppmap,q),get(ppmap,r)); } }; typedef Pmap_fct Equal_2; typedef Pmap_fct Less_yx_2; typedef Pmap_fct Less_xy_2; typedef Pmap_fct Left_turn_2; typedef Pmap_fct Orientation_2; typedef Pmap_fct Compare_y_2; typedef Pmap_fct Compare_x_2; typedef CGAL::Is_convex_2 Is_convex_2; typedef CGAL::Is_y_monotone_2 Is_y_monotone_2; // needed by visibility graph and thus by optimal convex typedef Pmap_fct Collinear_are_ordered_along_line_2; typedef Pmap_fct Are_strictly_ordered_along_line_2; Equal_2 equal_2_object() const { return Equal_2(ppmap,static_cast(this)->equal_2_object()); } Orientation_2 orientation_2_object() const { return Orientation_2(ppmap,static_cast(this)->orientation_2_object()); } Less_yx_2 less_yx_2_object() const { return Less_yx_2(ppmap,static_cast(this)->less_yx_2_object()); } Less_xy_2 less_xy_2_object() const { return Less_xy_2(ppmap,static_cast(this)->less_xy_2_object()); } Left_turn_2 left_turn_2_object() const { return Left_turn_2(ppmap,static_cast(this)->left_turn_2_object()); } Compare_y_2 compare_y_2_object() const { return Compare_y_2(ppmap,static_cast(this)->compare_y_2_object()); } Compare_x_2 compare_x_2_object() const { return Compare_x_2(ppmap,static_cast(this)->compare_x_2_object()); } Collinear_are_ordered_along_line_2 collinear_are_ordered_along_line_2_object() const { return Collinear_are_ordered_along_line_2(ppmap,static_cast(this)->collinear_are_ordered_along_line_2_object()); } Are_strictly_ordered_along_line_2 are_strictly_ordered_along_line_2_object() const { return Are_strictly_ordered_along_line_2(ppmap,static_cast(this)->are_strictly_ordered_along_line_2_object()); } Is_convex_2 is_convex_2_object(const Self& traits) const { return Is_convex_2(traits); } Is_y_monotone_2 is_y_monotone_2_object(const Self& traits) const { return Is_y_monotone_2(traits); } }; } #endif // CGAL_PARTITION_TRAITS_2_H