// Copyright (c) 2005 Utrecht University // // This file is part of CGAL (www.cgal.org); you may redistribute it under // the terms of the Q Public License version 1.0. // See the file LICENSE.QPL distributed with CGAL. // // 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) : Ovidiu Grigore, Remco Veltkamp #ifndef CGAL_SIMPLIFY_POLYLINE_H #define CGAL_SIMPLIFY_POLYLINE_H #include #include CGAL_BEGIN_NAMESPACE template struct Simplify_polyline_bound_number_of_points { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { std::cout << "generic" << std::endl; return result; } }; template struct Simplify_polyline_bound_error { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t& n_pt_bound, typename DistTraits::FT error, OutputIterator result) { std::cout << "generic" << std::endl; return result; } }; struct Local{}; struct Global{}; struct Dynamic_programmming {}; struct Graph_search {}; struct Convex_hull_graph_search {}; struct Iterative_graph_search {}; struct Recursive_split {}; ////////////// Recursive Split template struct Simplify_polyline_bound_number_of_points { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return polygonal_approximation_RS_bnp_lea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_number_of_points { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return polygonal_approximation_RS_bnp_gea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_error { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t& n_pt_bound, typename DistTraits::FT error, OutputIterator result) { return polygonal_approximation_RS_be_lea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_error { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t& n_pt_bound, typename DistTraits::FT error, OutputIterator result) { return polygonal_approximation_RS_be_gea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; ////////////// Dynamic Programmming template struct Simplify_polyline_bound_number_of_points { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return polygonal_approximation_DP_bnp_lea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_number_of_points { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return polygonal_approximation_DP_bnp_gea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_error { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t& n_pt_bound, typename DistTraits::FT error, OutputIterator result) { return polygonal_approximation_DP_be_lea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_error { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t& n_pt_bound, typename DistTraits::FT error, OutputIterator result) { return polygonal_approximation_DP_be_gea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; ////////////// Graph Search template struct Simplify_polyline_bound_number_of_points { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return polygonal_approximation_GS_bnp_lea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_number_of_points { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return polygonal_approximation_GS_bnp_gea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_error { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t& n_pt_bound, typename DistTraits::FT error, OutputIterator result) { return polygonal_approximation_GS_be_lea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; template struct Simplify_polyline_bound_error { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t& n_pt_bound, typename DistTraits::FT error, OutputIterator result) { return polygonal_approximation_GS_be_gea(begin, beyond, n_pt_bound, error, result, DistTraits()); } }; ////////////// Convex Hull Graph Search (exists only for Local) template struct Simplify_polyline_bound_number_of_points { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return polygonal_approximation_CHGS_bnp_lea(begin, beyond, n_pt_bound, error, result); } }; template struct Simplify_polyline_bound_error { static OutputIterator fct(InputIterator begin, InputIterator beyond, std::size_t& n_pt_bound, typename DistTraits::FT error, OutputIterator result) { return polygonal_approximation_CHGS_be_lea(begin, beyond, n_pt_bound, error, result); } }; ////////////////////////////////////////////////////////////////////////////////////////////////////// template OutputIterator simplify_polyline_bound_number_of_points(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return Simplify_polyline_bound_number_of_points::fct (begin, beyond, n_pt_bound, error, result); } template OutputIterator simplify_polyline_bound_error(InputIterator begin, InputIterator beyond, std::size_t n_pt_bound, typename DistTraits::FT &error, OutputIterator result) { return Simplify_polyline_bound_error::fct (begin, beyond, n_pt_bound, error, result); } CGAL_END_NAMESPACE #endif // CGAL_SIMPLIFY_POLYLINE_H