diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index 58b5743f456..411d80c1ba3 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -149,7 +149,7 @@ struct Face_filtered_graph */ template Face_filtered_graph(const Graph& graph, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) : _graph(const_cast(graph)) , fimap(CGAL::get_initialized_face_index_map(graph, np)) , vimap(CGAL::get_initialized_vertex_index_map(graph, np)) @@ -159,10 +159,6 @@ struct Face_filtered_graph , selected_halfedges(num_halfedges(graph), 0) {} - Face_filtered_graph(const Graph& graph) - :Face_filtered_graph(graph, parameters::all_default()) - {} - /*! * \brief Constructor where the set of selected faces is specified as a range of patch ids. * diff --git a/BGL/include/CGAL/boost/graph/IO/INP.h b/BGL/include/CGAL/boost/graph/IO/INP.h index 5c12b889441..f2605a00af5 100644 --- a/BGL/include/CGAL/boost/graph/IO/INP.h +++ b/BGL/include/CGAL/boost/graph/IO/INP.h @@ -87,23 +87,15 @@ bool write_INP(const std::string& fname, } #ifndef CGAL_NO_DEPRECATED_CODE -template +template CGAL_DEPRECATED bool write_inp(std::ostream& os, const FaceGraph& g, std::string name, std::string type, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { return write_INP(os, name, type, g, np); } -template -CGAL_DEPRECATED bool write_inp(std::ostream& os, - const FaceGraph& g, - std::string name, - std::string type) -{ - return write_INP(os, name, type, g, parameters::all_default()); -} #endif /// \endcond diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h index 3608e5943bb..4648f5ec93e 100644 --- a/BGL/include/CGAL/boost/graph/IO/PLY.h +++ b/BGL/include/CGAL/boost/graph/IO/PLY.h @@ -61,7 +61,7 @@ public: template bool read_PLY_BGL(std::istream& is, Graph& g, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename CGAL::GetVertexPointMap::type VPM; typedef typename boost::property_traits::value_type Point; @@ -134,7 +134,7 @@ template bool read_PLY(std::istream& is, Graph& g, - const CGAL_BGL_NP_CLASS& np + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , typename boost::disable_if >::type* = nullptr #endif @@ -143,17 +143,6 @@ bool read_PLY(std::istream& is, return internal::read_PLY_BGL(is, g, np); } -/// \cond SKIP_IN_MANUAL - -template -bool read_PLY(std::istream& is, Graph& g, - typename boost::disable_if >::type* = nullptr) -{ - return internal::read_PLY_BGL(is, g, parameters::all_default()); -} - -/// \endcond - /*! \ingroup PkgBGLIoFuncsPLY @@ -220,7 +209,7 @@ template bool read_PLY(const std::string& fname, Graph& g, - const CGAL_BGL_NP_CLASS& np + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , typename boost::disable_if >::type* = nullptr #endif @@ -241,17 +230,6 @@ bool read_PLY(const std::string& fname, } } -/// \cond SKIP_IN_MANUAL - -template -bool read_PLY(const std::string& fname, Graph& g, - typename boost::disable_if >::type* = nullptr) -{ - return read_PLY(fname, g, parameters::all_default()); -} - -/// \endcond - //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write @@ -318,7 +296,7 @@ template bool write_PLY(std::ostream& os, const Graph& g, const std::string& comments, - const CGAL_BGL_NP_CLASS& np + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , typename boost::disable_if >::type* = nullptr #endif @@ -441,27 +419,13 @@ bool write_PLY(std::ostream& os, /// \cond SKIP_IN_MANUAL -template -bool write_PLY(std::ostream& os, const Graph& g, const std::string& comments, - typename boost::disable_if >::type* = nullptr) -{ - return write_PLY(os, g, comments, parameters::all_default()); -} - template -bool write_PLY(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np, +bool write_PLY(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np = parameters::use_default_values(), typename boost::disable_if >::type* = nullptr) { return write_PLY(os, g, std::string(), np); } -template -bool write_PLY(std::ostream& os, const Graph& g, - typename boost::disable_if >::type* = nullptr) -{ - return write_PLY(os, g, std::string(), parameters::all_default()); -} - /// \endcond /*! @@ -528,7 +492,7 @@ template bool write_PLY(const std::string& fname, const Graph& g, const std::string& comments, - const CGAL_BGL_NP_CLASS& np + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , typename boost::disable_if >::type* = nullptr #endif @@ -552,27 +516,13 @@ bool write_PLY(const std::string& fname, /// \cond SKIP_IN_MANUAL -template -bool write_PLY(const std::string& fname, const Graph& g, const std::string comments, - typename boost::disable_if >::type* = nullptr) -{ - return write_PLY(fname, g, comments, parameters::all_default()); -} - template -bool write_PLY(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np, +bool write_PLY(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np = parameters::use_default_values(), typename boost::disable_if >::type* = nullptr) { return write_PLY(fname, g, std::string(), np); } -template -bool write_PLY(const std::string& fname, const Graph& g, - typename boost::disable_if >::type* = nullptr) -{ - return write_PLY(fname, g, std::string(), parameters::all_default()); -} - /// \endcond } } // namespace CGAL::IO diff --git a/BGL/include/CGAL/boost/graph/IO/STL.h b/BGL/include/CGAL/boost/graph/IO/STL.h index 099216010f9..3459917ad43 100644 --- a/BGL/include/CGAL/boost/graph/IO/STL.h +++ b/BGL/include/CGAL/boost/graph/IO/STL.h @@ -230,7 +230,7 @@ bool read_STL(const std::string& fname, template bool write_STL(std::ostream& os, const Graph& g, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; diff --git a/BGL/include/CGAL/boost/graph/Named_function_parameters.h b/BGL/include/CGAL/boost/graph/Named_function_parameters.h index a4fe0fe8229..b7327e0b911 100644 --- a/BGL/include/CGAL/boost/graph/Named_function_parameters.h +++ b/BGL/include/CGAL/boost/graph/Named_function_parameters.h @@ -25,6 +25,10 @@ #define CGAL_BGL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT NP_T, typename NP_Tag, typename NP_Base #define CGAL_BGL_NP_CLASS CGAL::Named_function_parameters +#define CGAL_BGL_NP_TEMPLATE_PARAMETERS_1 NP_T1=bool, typename NP_Tag1=CGAL::internal_np::all_default_t, typename NP_Base1=CGAL::internal_np::No_property +#define CGAL_BGL_NP_CLASS_1 CGAL::Named_function_parameters +#define CGAL_BGL_NP_TEMPLATE_PARAMETERS_2 NP_T2=bool, typename NP_Tag2=CGAL::internal_np::all_default_t, typename NP_Base2=CGAL::internal_np::No_property +#define CGAL_BGL_NP_CLASS_2 CGAL::Named_function_parameters namespace CGAL { namespace internal_np{ diff --git a/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h b/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h index a1842b8148a..3d7b5b57e83 100644 --- a/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h +++ b/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h @@ -271,7 +271,7 @@ get_initialized_index_map(CGAL::internal_np::Param_not_found, template > + typename NamedParameters = parameters::Default_named_parameters > class GetInitializedIndexMap { public: diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index d4c8d83db14..4beef30e5a5 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -2175,6 +2175,10 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN_RUNNING \ "CGAL_BGL_NP_TEMPLATE_PARAMETERS=NamedParameters" \ "CGAL_BGL_NP_CLASS=NamedParameters" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_1=NamedParameters1" \ + "CGAL_BGL_NP_CLASS_1=NamedParameters1" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2" \ + "CGAL_BGL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index d5a161b32e4..231bd26238f 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -2163,6 +2163,10 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN_RUNNING \ "CGAL_BGL_NP_TEMPLATE_PARAMETERS=NamedParameters" \ "CGAL_BGL_NP_CLASS=NamedParameters" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_1=NamedParameters1" \ + "CGAL_BGL_NP_CLASS_1=NamedParameters1" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2" \ + "CGAL_BGL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this diff --git a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in index 8961312a965..44d829bb0ff 100644 --- a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in @@ -2246,6 +2246,10 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN_RUNNING \ "CGAL_BGL_NP_TEMPLATE_PARAMETERS=NamedParameters" \ "CGAL_BGL_NP_CLASS=NamedParameters" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_1=NamedParameters1" \ + "CGAL_BGL_NP_CLASS_1=NamedParameters1" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2" \ + "CGAL_BGL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 58b291697b3..2dd83eddb59 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -1763,6 +1763,10 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN_RUNNING \ "CGAL_BGL_NP_TEMPLATE_PARAMETERS=NamedParameters" \ "CGAL_BGL_NP_CLASS=NamedParameters" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_1=NamedParameters1" \ + "CGAL_BGL_NP_CLASS_1=NamedParameters1" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2" \ + "CGAL_BGL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then diff --git a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in index b453970b1e1..6936ae60211 100644 --- a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in @@ -2246,6 +2246,10 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN_RUNNING \ "CGAL_BGL_NP_TEMPLATE_PARAMETERS=NamedParameters" \ "CGAL_BGL_NP_CLASS=NamedParameters" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_1=NamedParameters1" \ + "CGAL_BGL_NP_CLASS_1=NamedParameters1" \ + "CGAL_BGL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2" \ + "CGAL_BGL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h index 4fe8a9deaf0..42762cec85a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h @@ -84,10 +84,10 @@ namespace IO { * * \sa \link PkgBGLIOFct `CGAL::IO::write_polygon_mesh()` \endlink */ -template +template bool read_polygon_mesh(const std::string& fname, PolygonMesh& g, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { namespace PMP = CGAL::Polygon_mesh_processing; @@ -125,21 +125,11 @@ bool read_polygon_mesh(const std::string& fname, return false; } - PMP::polygon_soup_to_polygon_mesh(points, faces, g, parameters::all_default(), np); + PMP::polygon_soup_to_polygon_mesh(points, faces, g, parameters::use_default_values(), np); return true; } -/// \cond SKIP_IN_MANUAL - -template -bool read_polygon_mesh(const std::string& fname, PolygonMesh& g) -{ - return CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(fname, g, parameters::all_default()); -} - -/// \endcond - } // namespace IO } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index 649fad58ee1..69ab66cb09c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -717,7 +717,7 @@ bool clip(TriangleMesh& tm, bbox=CGAL::Bbox_3(bbox.xmin()-xd, bbox.ymin()-yd, bbox.zmin()-zd, bbox.xmax()+xd, bbox.ymax()+yd, bbox.zmax()+zd); TriangleMesh clipper; - Oriented_side os = internal::clip_to_bbox(plane, bbox, clipper, parameters::all_default()); + Oriented_side os = internal::clip_to_bbox(plane, bbox, clipper, parameters::use_default_values()); switch(os) { case ON_NEGATIVE_SIDE: diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index 744fec1f8fe..d049d4caa75 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -300,7 +300,7 @@ namespace internal { template std::size_t number_of_connected_components(const PolygonMesh& pmesh, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename boost::graph_traits::faces_size_type faces_size_type; typedef CGAL::dynamic_face_property_t Face_property_tag; @@ -311,12 +311,6 @@ std::size_t number_of_connected_components(const PolygonMesh& pmesh, return CGAL::Polygon_mesh_processing::connected_components(pmesh, patch_ids_map, np); } -template -std::size_t number_of_connected_components(const PolygonMesh& pmesh) -{ - return internal::number_of_connected_components(pmesh, CGAL::parameters::all_default()); -} - } // end namespace internal /*! diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index 14a84753f10..6964e1f5ef7 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -175,23 +175,24 @@ enum Boolean_operation_type {UNION = 0, INTERSECTION=1, * will only be corefined. */ template + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters, + class NamedParametersOut0 = parameters::Default_named_parameters, + class NamedParametersOut1 = parameters::Default_named_parameters, + class NamedParametersOut2 = parameters::Default_named_parameters, + class NamedParametersOut3 = parameters::Default_named_parameters> std::array corefine_and_compute_boolean_operations( TriangleMesh& tm1, TriangleMesh& tm2, const std::array< boost::optional,4>& output, - const NamedParameters1& np1, - const NamedParameters2& np2, + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values(), const std::tuple& nps_out) + NamedParametersOut1, + NamedParametersOut2, + NamedParametersOut3>& nps_out + = std::tuple()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -412,51 +413,6 @@ corefine_and_compute_boolean_operations( ob.tm2_minus_tm1_is_valid()); } -template -std::array -corefine_and_compute_boolean_operations( - TriangleMesh& tm1, - TriangleMesh& tm2, - const std::array< boost::optional,4>& output) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_boolean_operations(tm1, tm2, output, - all_default(), all_default(), - std::make_tuple(all_default(), all_default(), - all_default(), all_default())); -} - -template -std::array -corefine_and_compute_boolean_operations( - TriangleMesh& tm1, - TriangleMesh& tm2, - const std::array< boost::optional,4>& output, - const NamedParameters1& np1) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_boolean_operations(tm1, tm2, output, - np1, all_default(), - std::make_tuple(all_default(), all_default(), - all_default(), all_default())); -} - -template -std::array -corefine_and_compute_boolean_operations( - TriangleMesh& tm1, - TriangleMesh& tm2, - const std::array< boost::optional,4>& output, - const NamedParameters1& np1, - const NamedParameters2& np2) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_boolean_operations(tm1, tm2, output, - np1, np2, - std::make_tuple(all_default(), all_default(), - all_default(), all_default())); -} - #undef CGAL_COREF_SET_OUTPUT_VERTEX_POINT_MAP #undef CGAL_COREF_SET_OUTPUT_EDGE_MARK_MAP @@ -554,16 +510,16 @@ corefine_and_compute_boolean_operations( * If `false` is returned and if `tm_out` is one of the input surface meshes, * then `tm_out` is only corefined. */ template + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters, + class NamedParametersOut = parameters::Default_named_parameters> bool corefine_and_compute_union( TriangleMesh& tm1, TriangleMesh& tm2, TriangleMesh& tm_out, - const NamedParameters1& np1, - const NamedParameters2& np2, - const NamedParametersOut& np_out) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values(), + const NamedParametersOut& np_out = parameters::use_default_values()) { using namespace CGAL::Polygon_mesh_processing::parameters; std::array< boost::optional,4> output; @@ -572,9 +528,9 @@ corefine_and_compute_union( TriangleMesh& tm1, return corefine_and_compute_boolean_operations(tm1, tm2, output, np1, np2, std::make_tuple(np_out, - all_default(), - all_default(), - all_default())) + parameters::use_default_values(), + parameters::use_default_values(), + parameters::use_default_values())) [Corefinement::UNION]; } @@ -586,16 +542,16 @@ corefine_and_compute_union( TriangleMesh& tm1, * \copydetails CGAL::Polygon_mesh_processing::corefine_and_compute_union() */ template + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters, + class NamedParametersOut = parameters::Default_named_parameters> bool corefine_and_compute_intersection( TriangleMesh& tm1, TriangleMesh& tm2, TriangleMesh& tm_out, - const NamedParameters1& np1, - const NamedParameters2& np2, - const NamedParametersOut& np_out) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values(), + const NamedParametersOut& np_out = parameters::use_default_values()) { using namespace CGAL::Polygon_mesh_processing::parameters; std::array< boost::optional,4> output; @@ -603,10 +559,10 @@ corefine_and_compute_intersection( TriangleMesh& tm1, return corefine_and_compute_boolean_operations(tm1, tm2, output, np1, np2, - std::make_tuple(all_default(), + std::make_tuple(parameters::use_default_values(), np_out, - all_default(), - all_default())) + parameters::use_default_values(), + parameters::use_default_values())) [Corefinement::INTERSECTION]; } @@ -618,16 +574,16 @@ corefine_and_compute_intersection( TriangleMesh& tm1, * \copydetails CGAL::Polygon_mesh_processing::corefine_and_compute_union() */ template + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters, + class NamedParametersOut = parameters::Default_named_parameters> bool corefine_and_compute_difference( TriangleMesh& tm1, TriangleMesh& tm2, TriangleMesh& tm_out, - const NamedParameters1& np1, - const NamedParameters2& np2, - const NamedParametersOut& np_out) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values(), + const NamedParametersOut& np_out = parameters::use_default_values()) { using namespace CGAL::Polygon_mesh_processing::parameters; using namespace CGAL::Polygon_mesh_processing::Corefinement; @@ -636,10 +592,10 @@ corefine_and_compute_difference( TriangleMesh& tm1, return corefine_and_compute_boolean_operations(tm1, tm2, output, np1, np2, - std::make_tuple(all_default(), - all_default(), + std::make_tuple(parameters::use_default_values(), + parameters::use_default_values(), np_out, - all_default())) + parameters::use_default_values())) [TM1_MINUS_TM2]; } @@ -706,13 +662,13 @@ corefine_and_compute_difference( TriangleMesh& tm1, * */ template + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters> void corefine( TriangleMesh& tm1, TriangleMesh& tm2, - const NamedParameters1& np1, - const NamedParameters2& np2) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -849,10 +805,10 @@ namespace experimental { * */ template + class NamedParameters = parameters::Default_named_parameters> void autorefine( TriangleMesh& tm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -942,10 +898,10 @@ autorefine( TriangleMesh& tm, * */ template + class NamedParameters = parameters::Default_named_parameters> bool autorefine_and_remove_self_intersections( TriangleMesh& tm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -997,208 +953,6 @@ autorefine_and_remove_self_intersections( TriangleMesh& tm, }// end of namespace experimental -// overload with default named parameters -///// corefine_and_compute_union ///// -template -bool -corefine_and_compute_union( TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out, - const NamedParameters1& np1, - const NamedParameters2& np2) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_union(tm1, tm2, tm_out, - np1, np2, all_default()); -} - -template -bool -corefine_and_compute_union( TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out, - const NamedParameters1& np1) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_union(tm1, tm2, tm_out, - np1, all_default(), all_default()); -} - -template -bool -corefine_and_compute_union(TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_union(tm1, tm2, tm_out, - all_default(), all_default(), all_default()); -} - -///// corefine_and_compute_intersection ///// -template -bool -corefine_and_compute_intersection( TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out, - const NamedParameters1& np1, - const NamedParameters2& np2) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_intersection(tm1, tm2, tm_out, - np1, np2, all_default()); -} - -template -bool -corefine_and_compute_intersection( TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out, - const NamedParameters1& np1) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_intersection(tm1, tm2, tm_out, - np1, all_default(), all_default()); -} - -template -bool -corefine_and_compute_intersection(TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_intersection(tm1, tm2, tm_out, - all_default(), all_default(), all_default()); -} - -///// difference ///// -template -bool -corefine_and_compute_difference( TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out, - const NamedParameters1& np1, - const NamedParameters2& np2) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_difference(tm1, tm2, tm_out, - np1, np2, all_default()); -} - -template -bool -corefine_and_compute_difference( TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out, - const NamedParameters1& np1) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_difference(tm1, tm2, tm_out, - np1, all_default(), all_default()); -} - -template -bool -corefine_and_compute_difference(TriangleMesh& tm1, - TriangleMesh& tm2, - TriangleMesh& tm_out) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return corefine_and_compute_difference(tm1, tm2, tm_out, - all_default(), all_default(), all_default()); -} - -///// corefine ///// -template -void -corefine( TriangleMesh& tm1, - TriangleMesh& tm2, - const NamedParameters1& np1) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - corefine(tm1, tm2, np1, all_default()); -} - -template -void -corefine( TriangleMesh& tm1, - TriangleMesh& tm2) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - corefine(tm1, tm2, all_default(), all_default()); -} - -#ifndef CGAL_NO_DEPRECATED_CODE - template - void - corefine( TriangleMesh& tm1, - TriangleMesh& tm2, - const NamedParameters1& np1, - const NamedParameters2& np2, - const bool throw_on_self_intersection) -{ - corefine(tm1, tm2, np1.throw_on_self_intersection(throw_on_self_intersection), np2); -} - -template -void -corefine( TriangleMesh& tm1, - TriangleMesh& tm2, - const NamedParameters1& np1, - const bool throw_on_self_intersection) -{ - namespace params = CGAL::Polygon_mesh_processing::parameters; - corefine(tm1, tm2, - np1.throw_on_self_intersection(throw_on_self_intersection), - params::all_default()); -} - -template -void -corefine( TriangleMesh& tm1, - TriangleMesh& tm2, - const bool throw_on_self_intersection) -{ - namespace params = CGAL::Polygon_mesh_processing::parameters; - corefine(tm1, tm2, - params::throw_on_self_intersection(throw_on_self_intersection), - params::all_default()); -} -#endif - -///// autorefine ///// -namespace experimental { -template -void -autorefine(TriangleMesh& tm) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - autorefine(tm, all_default()); -} - -///// autorefine_and_remove_self_intersections ///// -template -bool -autorefine_and_remove_self_intersections(TriangleMesh& tm) -{ - using namespace CGAL::Polygon_mesh_processing::parameters; - return autorefine_and_remove_self_intersections(tm, all_default()); -} - -} // end of namespace experimental - } } // end of namespace CGAL::Polygon_mesh_processing #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index e0f4b4dc5ef..3bca2a77041 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -2288,14 +2288,14 @@ double bounded_error_Hausdorff_naive_impl( template< class Concurrency_tag, class TriangleMesh1, class TriangleMesh2, - class NamedParameters1, - class NamedParameters2 > + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters > double bounded_error_Hausdorff_distance( const TriangleMesh1& tm1, const TriangleMesh2& tm2, - const double error_bound, - const NamedParameters1& np1, - const NamedParameters2& np2) + const double error_bound = 0.0001, + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values()) { CGAL_assertion_code( const bool is_triangle = is_triangle_mesh(tm1) && is_triangle_mesh(tm2)); @@ -2328,32 +2328,6 @@ double bounded_error_Hausdorff_distance( tm1, tm2, error_threshold, -FT(1), match_faces, vpm1, vpm2, np1, np2, out); } -template< class Concurrency_tag, - class TriangleMesh1, - class TriangleMesh2, - class NamedParameters1 > -double bounded_error_Hausdorff_distance( - const TriangleMesh1& tm1, - const TriangleMesh2& tm2, - const double error_bound, - const NamedParameters1& np1) -{ - return bounded_error_Hausdorff_distance( - tm1, tm2, error_bound, np1, parameters::all_default()); -} - -template< class Concurrency_tag, - class TriangleMesh1, - class TriangleMesh2 > -double bounded_error_Hausdorff_distance( - const TriangleMesh1& tm1, - const TriangleMesh2& tm2, - const double error_bound = 0.0001) -{ - return bounded_error_Hausdorff_distance( - tm1, tm2, error_bound, parameters::all_default()); -} - /** * \ingroup PMP_distance_grp * returns the maximum of `bounded_error_Hausdorff_distance(tm1, tm2, error_bound, np1, np2)` @@ -2368,14 +2342,14 @@ double bounded_error_Hausdorff_distance( template< class Concurrency_tag, class TriangleMesh1, class TriangleMesh2, - class NamedParameters1, - class NamedParameters2 > + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters > double bounded_error_symmetric_Hausdorff_distance( const TriangleMesh1& tm1, const TriangleMesh2& tm2, const double error_bound, - const NamedParameters1& np1, - const NamedParameters2& np2) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values()) { CGAL_assertion_code( const bool is_triangle = is_triangle_mesh(tm1) && is_triangle_mesh(tm2)); @@ -2412,35 +2386,6 @@ double bounded_error_symmetric_Hausdorff_distance( tm1, tm2, error_threshold, -FT(1), match_faces, vpm1, vpm2, np1, np2, out1, out2); } -template< class Concurrency_tag, - class TriangleMesh1, - class TriangleMesh2, - class NamedParameters1 > -double bounded_error_symmetric_Hausdorff_distance( - const TriangleMesh1& tm1, - const TriangleMesh2& tm2, - const double error_bound, - const NamedParameters1& np1) -{ - return bounded_error_symmetric_Hausdorff_distance( - tm1, tm2, error_bound, np1, parameters::all_default()); -} - -template< class Concurrency_tag, - class TriangleMesh1, - class TriangleMesh2> -double bounded_error_symmetric_Hausdorff_distance( - const TriangleMesh1& tm1, - const TriangleMesh2& tm2, - const double error_bound = 0.0001) -{ - return bounded_error_symmetric_Hausdorff_distance( - tm1, tm2, error_bound, parameters::all_default()); -} - -// TODO: Find better name! -// TODO: Should we use one-sided or symmetric distance here? - /** * \ingroup PMP_distance_grp * returns `true` if the Hausdorff distance between two meshes is larger than @@ -2466,15 +2411,15 @@ double bounded_error_symmetric_Hausdorff_distance( template< class Concurrency_tag, class TriangleMesh1, class TriangleMesh2, - class NamedParameters1, - class NamedParameters2 > + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters> bool is_Hausdorff_distance_larger( const TriangleMesh1& tm1, const TriangleMesh2& tm2, const double distance_bound, const double error_bound, - const NamedParameters1& np1, - const NamedParameters2& np2) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values()) { CGAL_assertion_code( const bool is_triangle = is_triangle_mesh(tm1) && is_triangle_mesh(tm2)); @@ -2523,46 +2468,18 @@ bool is_Hausdorff_distance_larger( return hdist > distance_bound; } -template< class Concurrency_tag, - class TriangleMesh1, - class TriangleMesh2, - class NamedParameters1 > -double is_Hausdorff_distance_larger( - const TriangleMesh1& tm1, - const TriangleMesh2& tm2, - const double max_distance, - const double error_bound, - const NamedParameters1& np1) -{ - return is_Hausdorff_distance_larger( - tm1, tm2, max_distance, error_bound, np1, parameters::all_default()); -} - -template< class Concurrency_tag, - class TriangleMesh1, - class TriangleMesh2 > -double is_Hausdorff_distance_larger( - const TriangleMesh1& tm1, - const TriangleMesh2& tm2, - const double max_distance = 1.0, - const double error_bound = 0.0001) -{ - return is_Hausdorff_distance_larger( - tm1, tm2, max_distance, error_bound, parameters::all_default()); -} - // Implementation of the naive Bounded Error Hausdorff distance. template< class Concurrency_tag, class TriangleMesh1, class TriangleMesh2, - class NamedParameters1, - class NamedParameters2 > + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters > double bounded_error_Hausdorff_distance_naive( const TriangleMesh1& tm1, const TriangleMesh2& tm2, const double error_bound, - const NamedParameters1& np1, - const NamedParameters2& np2) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values()) { CGAL_assertion_code( const bool is_triangle = is_triangle_mesh(tm1) && is_triangle_mesh(tm2)); @@ -2586,32 +2503,6 @@ double bounded_error_Hausdorff_distance_naive( tm1, tm2, error_threshold, vpm1, vpm2); } -template< class Concurrency_tag, - class TriangleMesh1, - class TriangleMesh2, - class NamedParameters1 > -double bounded_error_Hausdorff_distance_naive( - const TriangleMesh1& tm1, - const TriangleMesh2& tm2, - const double error_bound, - const NamedParameters1& np1) -{ - return bounded_error_Hausdorff_distance_naive( - tm1, tm2, error_bound, np1, parameters::all_default()); -} - -template< class Concurrency_tag, - class TriangleMesh1, - class TriangleMesh2 > -double bounded_error_Hausdorff_distance_naive( - const TriangleMesh1& tm1, - const TriangleMesh2& tm2, - const double error_bound = 0.0001) -{ - return bounded_error_Hausdorff_distance_naive( - tm1, tm2, error_bound, parameters::all_default()); -} - } } // end of namespace CGAL::Polygon_mesh_processing diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/extrude.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/extrude.h index 330207f47c3..11ca36a76bb 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/extrude.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/extrude.h @@ -158,15 +158,15 @@ template void extrude_mesh(const InputMesh& input, OutputMesh& output, const BottomFunctor& bot, const TopFunctor& top, - const NamedParameters1& np_in, - const NamedParameters2& np_out) + const CGAL_BGL_NP_CLASS_1& np_in = parameters::use_default_values(), + const CGAL_BGL_NP_CLASS_2& np_out = parameters::use_default_values()) { typedef typename boost::graph_traits::vertex_descriptor input_vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor input_halfedge_descriptor; @@ -175,8 +175,8 @@ void extrude_mesh(const InputMesh& input, typedef typename boost::graph_traits::halfedge_descriptor output_halfedge_descriptor; CGAL_assertion(!CGAL::is_closed(input)); - typedef typename GetVertexPointMap < OutputMesh, NamedParameters2>::type VPMap; - typedef typename GetVertexPointMap < InputMesh, NamedParameters1>::const_type IVPMap; + typedef typename GetVertexPointMap < OutputMesh, CGAL_BGL_NP_CLASS_2>::type VPMap; + typedef typename GetVertexPointMap < InputMesh, CGAL_BGL_NP_CLASS_1>::const_type IVPMap; using parameters::get_parameter; using parameters::choose_parameter; @@ -276,68 +276,29 @@ void extrude_mesh(const InputMesh& input, */ template + class CGAL_BGL_NP_TEMPLATE_PARAMETERS_1, + class CGAL_BGL_NP_TEMPLATE_PARAMETERS_2> void extrude_mesh(const InputMesh& input, OutputMesh& output, #ifdef DOXYGEN_RUNNING Vector_3 v, #else - typename GetGeomTraits::type::Vector_3 v, + typename GetGeomTraits::type::Vector_3 v, #endif - const NamedParameters1& np_in, - const NamedParameters2& np_out) + const CGAL_BGL_NP_CLASS_1& np_in = parameters::use_default_values(), + const CGAL_BGL_NP_CLASS_2& np_out = parameters::use_default_values()) { - typedef typename GetVertexPointMap < OutputMesh, NamedParameters2>::type VPMap; + typedef typename GetVertexPointMap < OutputMesh, CGAL_BGL_NP_CLASS_2>::type VPMap; VPMap output_vpm = parameters::choose_parameter(parameters::get_parameter(np_out, internal_np::vertex_point), get_property_map(vertex_point, output)); extrude_impl::Const_dist_translation< - typename GetVertexPointMap::type, - typename GetGeomTraits::type::Vector_3> bot(output_vpm, + typename GetVertexPointMap::type, + typename GetGeomTraits::type::Vector_3> bot(output_vpm, v); extrude_impl::Identity_functor top; extrude_mesh(input, output, bot,top, np_in, np_out); } -//convenience overload -template -void extrude_mesh(const InputMesh& input, - OutputMesh& output, - Vector dir) -{ - extrude_mesh(input, output, dir, - parameters::all_default(), - parameters::all_default()); -} - -template -void extrude_mesh(const InputMesh& input, - OutputMesh& output, - Vector dir, - const CGAL_BGL_NP_CLASS& np) -{ - extrude_mesh(input, output, dir, - np, - parameters::all_default()); -} - -template -void extrude_mesh(const InputMesh& input, - OutputMesh& output, - const BottomFunctor& bot, - const TopFunctor& top) -{ - extrude_mesh(input, output, bot, top, - parameters::all_default(), parameters::all_default()); -} }} //end CGAL::PMP #endif //CGAL_POLYGON_MESH_PROCESSING_EXTRUDE_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index bbc9155bc08..07504b628d1 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -1355,7 +1355,7 @@ template std::size_t snap_borders(TriangleMesh& tm, ToleranceMap tolerance_map, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -1367,20 +1367,11 @@ std::size_t snap_borders(TriangleMesh& tm, true /*self snapping*/, np, np); } -template -std::size_t snap_borders(TriangleMesh& tm, - ToleranceMap tolerance_map) -{ - return snap_borders(tm, tolerance_map, CGAL::parameters::all_default()); -} - template std::size_t snap_borders(TriangleMesh& tm, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -1402,13 +1393,6 @@ std::size_t snap_borders(TriangleMesh& tm, true /*self snapping*/, np, np); } -template -std::size_t snap_borders(TriangleMesh& tm) -{ - return snap_borders(tm, CGAL::parameters::all_default()); -} - } // end namespace experimental } // end namespace Polygon_mesh_processing } // end namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h index d2620cf502d..aa9249c1ded 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h @@ -1218,17 +1218,16 @@ std::size_t snap_vertices(const HalfedgeRange_A& halfedge_range_A, template + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS_1, + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS_2> std::size_t snap_vertices(const HalfedgeRange_A& halfedge_range_A, PolygonMesh& tm_A, const HalfedgeRange_B& halfedge_range_B, PolygonMesh& tm_B, - const CGAL::Named_function_parameters& np_A, - const CGAL::Named_function_parameters& np_B) + const CGAL_BGL_NP_CLASS_1& np_A=parameters::use_default_values(), + const CGAL_BGL_NP_CLASS_2& np_B=parameters::use_default_values()) { - typedef CGAL::Named_function_parameters NamedParameters_A; - typedef typename GetGeomTraits::type GT; + typedef typename GetGeomTraits::type GT; typedef typename GT::FT FT; typedef CGAL::dynamic_vertex_property_t Vertex_property_tag; typedef typename boost::property_map::type Tolerance_map; @@ -1243,17 +1242,6 @@ std::size_t snap_vertices(const HalfedgeRange_A& halfedge_range_A, return snap_vertices(halfedge_range_A, tm_A, tolerance_map_A, halfedge_range_B, tm_B, tolerance_map_B, np_A, np_B); } -template -std::size_t snap_vertices(const HalfedgeRange_A& halfedge_range_A, - PolygonMesh& tm_A, - const HalfedgeRange_B& halfedge_range_B, - PolygonMesh& tm_B) -{ - return snap_vertices(halfedge_range_A, tm_A, halfedge_range_B, tm_B, - parameters::all_default(), parameters::all_default()); -} - /////////////////////////////////////////////////////////////////////////////////////////////////// /// Border convenience overloads /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index 6ff025c3a1e..75904853114 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -1251,12 +1251,18 @@ bool do_intersect(const Polyline& polyline1, * */ template + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters> bool do_intersect(const TriangleMesh& tm1, const TriangleMesh& tm2, - const NamedParameters1& np1, - const NamedParameters2& np2) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values() +#ifndef DOXYGEN_RUNNING + , const typename boost::disable_if< + typename boost::has_range_const_iterator::type + >::type* = 0 +#endif + ) { using parameters::choose_parameter; using parameters::get_parameter; @@ -1294,19 +1300,6 @@ bool do_intersect(const TriangleMesh& tm1, return false; } -//convenient overload -template -bool do_intersect(const TriangleMesh& tm1, - const TriangleMesh& tm2, - const typename boost::disable_if< - typename boost::has_range_const_iterator::type - >::type* = 0) -{ - CGAL_precondition(CGAL::is_triangle_mesh(tm1)); - CGAL_precondition(CGAL::is_triangle_mesh(tm2)); - return CGAL::Polygon_mesh_processing::do_intersect(tm1, tm2, parameters::all_default(), parameters::all_default()); -} - /** * \ingroup PMP_predicates_grp * returns `true` if there exists a face of `tm` and a segment of a polyline of `polylines` which intersect, @@ -1344,10 +1337,10 @@ bool do_intersect(const TriangleMesh& tm1, */ template + class NamedParameters = parameters::Default_named_parameters> bool do_intersect(const TriangleMesh& tm, const PolylineRange& polylines, - const NamedParameters& np + const NamedParameters& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , const typename boost::enable_if< typename boost::has_range_iterator< @@ -1409,10 +1402,10 @@ bool do_intersect(const TriangleMesh& tm, */ template + class NamedParameters = parameters::Default_named_parameters> bool do_intersect(const TriangleMesh& tm, const Polyline& polyline, - const NamedParameters& np + const NamedParameters& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , const typename boost::disable_if< typename boost::has_range_iterator< @@ -1438,46 +1431,6 @@ bool do_intersect(const TriangleMesh& tm, return false; } -template -bool do_intersect(const TriangleMesh& tm, - const PolylineRange& polylines, - const typename boost::enable_if< - typename boost::has_range_iterator< - typename boost::mpl::eval_if< - boost::has_range_iterator, - boost::range_value, - boost::false_type - >::type - >::type - >::type* = 0) -{ - CGAL_precondition(CGAL::is_triangle_mesh(tm)); - return CGAL::Polygon_mesh_processing::do_intersect(tm, polylines, parameters::all_default()); -} - - -template -bool do_intersect(const TriangleMesh& tm, - const Polyline& polyline, - const typename boost::disable_if< - typename boost::has_range_const_iterator::type - >::type* = 0, - const typename boost::disable_if< - typename boost::has_range_iterator< - typename boost::mpl::eval_if< - boost::has_range_iterator, - boost::range_value, - boost::false_type - >::type - >::type - >::type* = 0) -{ - CGAL_precondition(CGAL::is_triangle_mesh(tm)); - return CGAL::Polygon_mesh_processing::do_intersect(tm, polyline, parameters::all_default()); -} - namespace internal{ template >nps( - std::distance(range.begin(), range.end()), parameters::all_default()); + std::vector nps( + std::distance(range.begin(), range.end()), parameters::use_default_values()); return intersecting_meshes(range, out, np, nps); } @@ -1697,7 +1650,7 @@ template OutputIterator intersecting_meshes(const TriangleMeshRange& range, OutputIterator out) { - return intersecting_meshes(range, out, parameters::all_default()); + return intersecting_meshes(range, out, parameters::use_default_values()); } /** @@ -1746,14 +1699,14 @@ OutputIterator intersecting_meshes(const TriangleMeshRange& range, */ template + class NamedParameters1 = parameters::Default_named_parameters, + class NamedParameters2 = parameters::Default_named_parameters > OutputIterator surface_intersection(const TriangleMesh& tm1, const TriangleMesh& tm2, OutputIterator polyline_output, - const NamedParameters1& np1, - const NamedParameters2& np2) + const NamedParameters1& np1 = parameters::use_default_values(), + const NamedParameters2& np2 = parameters::use_default_values()) { const bool throw_on_self_intersection = parameters::choose_parameter(parameters::get_parameter(np1, internal_np::throw_on_self_intersection), false); @@ -1809,11 +1762,11 @@ namespace experimental { */ template + class NamedParameters = parameters::Default_named_parameters > OutputIterator surface_self_intersection(const TriangleMesh& tm, OutputIterator polyline_output, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { // Vertex point maps typedef typename GetVertexPointMap::const_type VPM; @@ -1829,77 +1782,6 @@ surface_self_intersection(const TriangleMesh& tm, return polyline_output; } -} //end of namespace experimental - - -template -OutputIterator -surface_intersection(const TriangleMesh& tm1, - const TriangleMesh& tm2, - OutputIterator polyline_output) -{ - return surface_intersection(tm1, tm2, polyline_output, - CGAL::Polygon_mesh_processing::parameters::all_default(), - CGAL::Polygon_mesh_processing::parameters::all_default()); -} - -template -OutputIterator -surface_intersection(const TriangleMesh& tm1, - const TriangleMesh& tm2, - OutputIterator polyline_output, - const NamedParameters1& np) -{ - return surface_intersection(tm1, tm2, polyline_output, np, - CGAL::Polygon_mesh_processing::parameters::all_default()); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -template -OutputIterator -surface_intersection(const TriangleMesh& tm1, - const TriangleMesh& tm2, - OutputIterator polyline_output, - const NamedParameters1& np1, - const NamedParameters2& np2, - const bool throw_on_self_intersection) -{ - return surface_intersection(tm1, tm2, polyline_output, - np1.throw_on_self_intersection(throw_on_self_intersection), np2); -} - -template -OutputIterator -surface_intersection(const TriangleMesh& tm1, - const TriangleMesh& tm2, - OutputIterator polyline_output, - const bool throw_on_self_intersection) -{ - return surface_intersection(tm1, tm2, polyline_output, - CGAL::parameters::throw_on_self_intersection(throw_on_self_intersection), - CGAL::parameters::use_default_values()); -} -#endif - -namespace experimental { -template -OutputIterator -surface_self_intersection(const TriangleMesh& tm, - OutputIterator polyline_output) -{ - return surface_self_intersection(tm, polyline_output, - CGAL::Polygon_mesh_processing::parameters::all_default() - ); -} - } //end of namespace experimental } //end of namespace Polygon_mesh_processing } //end of namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h index 40f9201ca53..e28d937ac08 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -73,7 +73,7 @@ struct Ray_type_selector // Just for convenience template > + typename NamedParameters = parameters::Default_named_parameters> struct Location_traits { typedef typename GetVertexPointMap::const_type VertexPointMap; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h index 16c3a1a027f..6bd1fb6dc6c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h @@ -172,7 +172,7 @@ edge_length(typename boost::graph_traits::edge_descriptor e, * @sa `face_border_length()` */ template + typename NamedParameters = parameters::Default_named_parameters> #ifdef DOXYGEN_RUNNING FT #else @@ -180,7 +180,7 @@ typename GetGeomTraits::type::FT #endif squared_edge_length(typename boost::graph_traits::halfedge_descriptor h, const PolygonMesh& pmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef typename GetGeomTraits::type Geom_traits; @@ -199,35 +199,18 @@ squared_edge_length(typename boost::graph_traits::halfedge_descript get(vpm, target(h, pmesh))); } -template -typename CGAL::Kernel_traits::type>::Kernel::FT -squared_edge_length(typename boost::graph_traits::halfedge_descriptor h, - const PolygonMesh& pmesh) -{ - return squared_edge_length(h, pmesh, CGAL::Polygon_mesh_processing::parameters::all_default()); -} + // edge overloads template + typename NamedParameters = parameters::Default_named_parameters> typename GetGeomTraits::type::FT squared_edge_length(typename boost::graph_traits::edge_descriptor e, const PolygonMesh& pmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { return squared_edge_length(halfedge(e, pmesh), pmesh, np); } -template -typename CGAL::Kernel_traits::type>::Kernel::FT -squared_edge_length(typename boost::graph_traits::edge_descriptor e, - const PolygonMesh& pmesh) -{ - return squared_edge_length(halfedge(e, pmesh), pmesh); -} - - /** * \ingroup measure_grp * computes the length of the border polyline diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h index 2a1e1019878..f2591bc6c3f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h @@ -277,11 +277,11 @@ void merge_vertices_in_range(const HalfedgeRange& sorted_hedges, /// \cgalParamNEnd /// \cgalNamedParamsEnd /// -template +template void merge_duplicated_vertices_in_boundary_cycle( typename boost::graph_traits::halfedge_descriptor h, PolygonMesh& pm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename GetVertexPointMap::const_type Vpm; @@ -333,9 +333,9 @@ void merge_duplicated_vertices_in_boundary_cycle( /// \cgalNamedParamsEnd /// /// \sa `merge_duplicated_vertices_in_boundary_cycle()` -template +template void merge_duplicated_vertices_in_boundary_cycles( PolygonMesh& pm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -346,20 +346,6 @@ void merge_duplicated_vertices_in_boundary_cycles( PolygonMesh& pm, merge_duplicated_vertices_in_boundary_cycle(h, pm, np); } -template -void merge_duplicated_vertices_in_boundary_cycles(PolygonMesh& pm) -{ - merge_duplicated_vertices_in_boundary_cycles(pm, parameters::all_default()); -} - -template -void merge_duplicated_vertices_in_boundary_cycle( - typename boost::graph_traits::halfedge_descriptor h, - PolygonMesh& pm) -{ - merge_duplicated_vertices_in_boundary_cycle(h, pm, parameters::all_default()); -} - } } // end of CGAL::Polygon_mesh_processing #endif //CGAL_POLYGON_MESH_PROCESSING_MERGE_BORDER_VERTICES_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h index 6769b9e49a1..368886c3cfb 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h @@ -522,10 +522,10 @@ struct Polygon_soup_orienter * @return `false` if some points were duplicated, thus producing a self-intersecting polyhedron. * */ -template +template bool orient_polygon_soup(PointRange& points, PolygonRange& polygons, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -546,14 +546,6 @@ bool orient_polygon_soup(PointRange& points, return inital_nb_pts==points.size(); } - -template -bool orient_polygon_soup(PointRange& points, - PolygonRange& polygons) -{ - return orient_polygon_soup(points, polygons, parameters::all_default()); -} - } }//end namespace CGAL::Polygon_mesh_processing #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h index 2a9b8e05099..039ed20290a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h @@ -118,13 +118,13 @@ duplicate_non_manifold_edges_in_polygon_soup(PointRange& points, */ template + class TriangleMesh, class NamedParameters = parameters::Default_named_parameters> void orient_triangle_soup_with_reference_triangle_mesh( const TriangleMesh& tm_ref, PointRange& points, TriangleRange& triangles, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { namespace PMP = CGAL::Polygon_mesh_processing; @@ -187,17 +187,5 @@ orient_triangle_soup_with_reference_triangle_mesh( process_facet); } - -template -void -orient_triangle_soup_with_reference_triangle_mesh( - const TriangleMesh& tm_ref, - PointRange& points, - TriangleRange& triangles) -{ - orient_triangle_soup_with_reference_triangle_mesh(tm_ref, points, triangles, CGAL::parameters::all_default()); -} - }}//end namespace CGAL::Polygon_mesh_processing #endif // CGAL_ORIENT_POLYGON_SOUP_EXTENSION_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h index e38b6e925f8..d19d72f92df 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -181,9 +181,9 @@ namespace internal{ * * \sa `CGAL::Polygon_mesh_processing::reverse_face_orientations()` */ -template +template bool is_outward_oriented(const TriangleMesh& tm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { CGAL_warning(CGAL::is_closed(tm)); CGAL_warning(CGAL::is_triangle_mesh(tm)); @@ -230,17 +230,6 @@ bool is_outward_oriented(const TriangleMesh& tm, return internal::is_outward_oriented(v_max, tm, np); } -///\cond SKIP_IN_MANUAL - -template -bool is_outward_oriented(const TriangleMesh& tm) -{ - return is_outward_oriented(tm, - CGAL::Polygon_mesh_processing::parameters::all_default()); -} - -/// \endcond - template void reverse_orientation(typename boost::graph_traits::halfedge_descriptor first, PolygonMesh& pmesh) { @@ -405,9 +394,9 @@ void reverse_face_orientations(const FaceRange& face_range, PolygonMesh& pmesh) * \cgalParamNEnd * \cgalNamedParamsEnd */ -template +template void orient(TriangleMesh& tm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef boost::graph_traits Graph_traits; typedef typename Graph_traits::vertex_descriptor vertex_descriptor; @@ -472,12 +461,6 @@ void orient(TriangleMesh& tm, } } -template -void orient(TriangleMesh& tm) -{ - orient(tm, parameters::all_default()); -} - /*! * \ingroup PMP_orientation_grp * Enumeration type used to indicate the status of a set of faces @@ -811,11 +794,11 @@ void set_cc_intersecting_pairs( * * \return the number of volume components defined by `tm` */ -template +template std::size_t volume_connected_components(const TriangleMesh& tm, VolumeFaceIndexMap volume_id_map, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { CGAL_precondition(is_triangle_mesh(tm)); CGAL_precondition(is_closed(tm)); @@ -1269,8 +1252,8 @@ volume_connected_components(const TriangleMesh& tm, * * \see `CGAL::Polygon_mesh_processing::orient_to_bound_a_volume()` */ -template -bool does_bound_a_volume(const TriangleMesh& tm, const NamedParameters& np) +template +bool does_bound_a_volume(const TriangleMesh& tm, const NamedParameters& np = parameters::use_default_values()) { typedef boost::graph_traits GT; typedef typename GT::face_descriptor face_descriptor; @@ -1287,21 +1270,6 @@ bool does_bound_a_volume(const TriangleMesh& tm, const NamedParameters& np) return res!=0; } -/// \cond SKIP_IN_MANUAL -template -bool does_bound_a_volume(const TriangleMesh& tm) -{ - return does_bound_a_volume(tm, parameters::all_default()); -} - -template -std::size_t volume_connected_components(const TriangleMesh& tm, VolumeFaceIndexMap volume_id_map) -{ - return volume_connected_components(tm, volume_id_map, parameters::all_default()); -} -/// \endcond - - /** \ingroup PMP_orientation_grp * * orients the connected components of `tm` to make it bound a volume. @@ -1349,9 +1317,9 @@ std::size_t volume_connected_components(const TriangleMesh& tm, VolumeFaceIndexM * * \see `CGAL::Polygon_mesh_processing::does_bound_a_volume()` */ -template +template void orient_to_bound_a_volume(TriangleMesh& tm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef boost::graph_traits Graph_traits; typedef typename Graph_traits::face_descriptor face_descriptor; @@ -1415,12 +1383,6 @@ void orient_to_bound_a_volume(TriangleMesh& tm, reverse_face_orientations(faces_to_reverse, tm); } -template -void orient_to_bound_a_volume(TriangleMesh& tm) -{ - orient_to_bound_a_volume(tm, parameters::all_default()); -} - /*! * \ingroup PMP_orientation_grp * reverses the connected components of `tm` having compatible boundary cycles @@ -1460,9 +1422,9 @@ void orient_to_bound_a_volume(TriangleMesh& tm) * \cgalParamNEnd * \cgalNamedParamsEnd */ -template +template void merge_reversible_connected_components(PolygonMesh& pm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef boost::graph_traits GrT; typedef typename GrT::face_descriptor face_descriptor; @@ -1627,11 +1589,6 @@ void merge_reversible_connected_components(PolygonMesh& pm, } } -template -void merge_reversible_connected_components(PolygonMesh& pm) -{ - merge_reversible_connected_components(pm, parameters::all_default()); -} } // namespace Polygon_mesh_processing } // namespace CGAL #endif // CGAL_ORIENT_POLYGON_MESH_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h index e9c0f6ce302..6a5b1baaa14 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h @@ -68,11 +68,11 @@ namespace Polygon_mesh_processing { /// template + typename NamedParameters = parameters::Default_named_parameters> void polygon_mesh_to_polygon_soup(const PolygonMesh& mesh, PointRange& points, PolygonRange& polygons, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -117,18 +117,6 @@ void polygon_mesh_to_polygon_soup(const PolygonMesh& mesh, } } -/// \cond SKIP_IN_MANUAL - -template -void polygon_mesh_to_polygon_soup(const PolygonMesh& mesh, - PointRange& points, - PolygonRange& polygons) -{ - return polygon_mesh_to_polygon_soup(mesh, points, polygons, CGAL::parameters::all_default()); -} - -/// \endcond - } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h index 9e704870c18..76f677ca4fd 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h @@ -269,12 +269,12 @@ bool is_polygon_soup_a_polygon_mesh(const PolygonRange& polygons) */ template + typename NamedParameters_PS = parameters::Default_named_parameters, typename NamedParameters_PM = parameters::Default_named_parameters> void polygon_soup_to_polygon_mesh(const PointRange& points, const PolygonRange& polygons, PolygonMesh& out, - const NamedParameters_PS& np_ps, - const NamedParameters_PM& np_pm) + const NamedParameters_PS& np_ps = parameters::use_default_values(), + const NamedParameters_PM& np_pm = parameters::use_default_values()) { CGAL_precondition_msg(is_polygon_soup_a_polygon_mesh(polygons), "Input soup needs to define a valid polygon mesh! See is_polygon_soup_a_polygon_mesh() for further information."); @@ -293,29 +293,6 @@ void polygon_soup_to_polygon_mesh(const PointRange& points, converter(out, vpm); } -/// \cond SKIP_IN_MANUAL - -template -void polygon_soup_to_polygon_mesh(const PointRange& points, - const PolygonRange& polygons, - PolygonMesh& out, - const NamedParameters_PS& np_ps) -{ - return polygon_soup_to_polygon_mesh(points, polygons, out, np_ps, parameters::all_default()); -} - -template -void polygon_soup_to_polygon_mesh(const PointRange& points, - const PolygonRange& polygons, - PolygonMesh& out) -{ - return polygon_soup_to_polygon_mesh(points, polygons, out, parameters::all_default(), parameters::all_default()); -} - -/// \endcond - } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h index defc8d3de61..eee86f2326b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h @@ -152,11 +152,11 @@ namespace internal { * \cgalNamedParamsEnd * */ -template +template void random_perturbation(VertexRange vertices , TriangleMesh& tmesh , const double& perturbation_max_size - , const NamedParameters& np) + , const NamedParameters& np = parameters::use_default_values()) { typedef TriangleMesh PM; using parameters::get_parameter; @@ -212,32 +212,13 @@ void random_perturbation(VertexRange vertices * \ingroup PMP_meshing_grp * @brief same as above, but all non-border vertices of `tmesh` are perturbed. */ -template +template void random_perturbation(TriangleMesh& tmesh , const double& perturbation_max_size - , const NamedParameters& np) + , const NamedParameters& np = parameters::use_default_values()) { random_perturbation(vertices(tmesh), tmesh, perturbation_max_size, np); } - -template -void random_perturbation(VertexRange vertices - , TriangleMesh& tmesh - , const double& perturbation_max_size) -{ - random_perturbation(vertices, tmesh, perturbation_max_size, - parameters::all_default()); -} - -template -void random_perturbation(TriangleMesh& tmesh - , const double& perturbation_max_size) -{ - random_perturbation(tmesh, - perturbation_max_size, - parameters::all_default()); -} - } //end namespace Polygon_mesh_processing } //end namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h index d2dd629bd6c..909de894a4e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h @@ -72,13 +72,13 @@ namespace Polygon_mesh_processing { typename FaceRange, typename FaceOutputIterator, typename VertexOutputIterator, - typename NamedParameters> + typename NamedParameters = parameters::Default_named_parameters> std::pair refine(TriangleMesh& tmesh, const FaceRange& faces, FaceOutputIterator faces_out, VertexOutputIterator vertices_out, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -97,22 +97,6 @@ namespace Polygon_mesh_processing { return std::make_pair(faces_out, vertices_out); } -///\cond SKIP_IN_MANUAL - template - - std::pair - refine(TriangleMesh& tmesh, - const FaceRange& faces, - FaceOutputIterator faces_out, - VertexOutputIterator vertices_out) - { - return refine(tmesh, faces, faces_out, vertices_out, - CGAL::Polygon_mesh_processing::parameters::all_default()); - } -///\endcond }//end namespace Polygon_mesh_processing }//end namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h index 0d41ff42435..1f8da9d5816 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -192,11 +192,11 @@ namespace Polygon_mesh_processing { */ template + , typename NamedParameters = parameters::Default_named_parameters> void isotropic_remeshing(const FaceRange& faces , const double& target_edge_length , PolygonMesh& pmesh - , const NamedParameters& np) + , const NamedParameters& np = parameters::use_default_values()) { if (boost::begin(faces)==boost::end(faces)) return; @@ -337,20 +337,6 @@ void isotropic_remeshing(const FaceRange& faces #endif } -template -void isotropic_remeshing( - const FaceRange& faces - , const double& target_edge_length - , PolygonMesh& pmesh) -{ - isotropic_remeshing( - faces, - target_edge_length, - pmesh, - parameters::all_default()); -} - /*! * \ingroup PMP_meshing_grp * @brief splits the edges listed in `edges` into sub-edges @@ -404,11 +390,11 @@ void isotropic_remeshing( */ template + , typename NamedParameters = parameters::Default_named_parameters> void split_long_edges(const EdgeRange& edges , const double& max_length , PolygonMesh& pmesh - , const NamedParameters& np) + , const NamedParameters& np = parameters::use_default_values()) { typedef PolygonMesh PM; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; @@ -448,17 +434,6 @@ void split_long_edges(const EdgeRange& edges remesher.split_long_edges(edges, max_length); } -template -void split_long_edges(const EdgeRange& edges - , const double& max_length - , PolygonMesh& pmesh) -{ - split_long_edges(edges, - max_length, - pmesh, - parameters::all_default()); -} - } //end namespace Polygon_mesh_processing } //end namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h index 46b3dbe9ae8..ba3f72c7396 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -148,9 +148,9 @@ std::size_t remove_isolated_vertices(PolygonMesh& pmesh) /// \return the number of connected components removed (ignoring isolated vertices). /// template + typename NamedParameters = parameters::Default_named_parameters> std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::is_default_parameter; @@ -339,12 +339,6 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh, return res; } -template -std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh) -{ - return remove_connected_components_of_negligible_size(tmesh, parameters::all_default()); -} - } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index 6da0d04006a..5f1b6e4313f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h @@ -529,13 +529,13 @@ struct Filter_wrapper_for_cap_needle_removal +template bool remove_almost_degenerate_faces(const FaceRange& face_range, TriangleMesh& tmesh, const double cap_threshold, const double needle_threshold, const double collapse_length_threshold, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using CGAL::parameters::choose_parameter; using CGAL::parameters::get_parameter; @@ -908,40 +908,17 @@ bool remove_almost_degenerate_faces(const FaceRange& face_range, return false; } -template -bool remove_almost_degenerate_faces(const FaceRange& face_range, - TriangleMesh& tmesh, - const double cap_threshold, - const double needle_threshold, - const double collapse_length_threshold) -{ - return remove_almost_degenerate_faces(face_range, tmesh, - cap_threshold, needle_threshold, collapse_length_threshold, - CGAL::parameters::all_default()); -} - template bool remove_almost_degenerate_faces(TriangleMesh& tmesh, const double cap_threshold, const double needle_threshold, const double collapse_length_threshold, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { return remove_almost_degenerate_faces(faces(tmesh), tmesh, cap_threshold, needle_threshold, collapse_length_threshold, np); } -template -bool remove_almost_degenerate_faces(TriangleMesh& tmesh, - const double cap_threshold, - const double needle_threshold, - const double collapse_length_threshold) -{ - return remove_almost_degenerate_faces(faces(tmesh), tmesh, - cap_threshold, needle_threshold, collapse_length_threshold, - CGAL::parameters::all_default()); -} - } // namespace experimental //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1225,11 +1202,11 @@ remove_a_border_edge(typename boost::graph_traits::edge_descriptor return remove_a_border_edge(ed, tm, input_range, edge_set, face_set); } -template +template bool remove_degenerate_edges(const EdgeRange& edge_range, TriangleMesh& tmesh, FaceSet& face_set, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { CGAL_assertion(CGAL::is_triangle_mesh(tmesh)); CGAL_assertion(CGAL::is_valid_polygon_mesh(tmesh)); @@ -1731,7 +1708,7 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, template bool remove_degenerate_edges(const EdgeRange& edge_range, TriangleMesh& tmesh, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { std::set::face_descriptor> face_set; return remove_degenerate_edges(edge_range, tmesh, face_set, np); @@ -1739,27 +1716,12 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, template bool remove_degenerate_edges(TriangleMesh& tmesh, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { std::set::face_descriptor> face_set; return remove_degenerate_edges(edges(tmesh), tmesh, face_set, np); } -template -bool remove_degenerate_edges(const EdgeRange& edge_range, - TriangleMesh& tmesh) -{ - std::set::face_descriptor> face_set; - return remove_degenerate_edges(edge_range, tmesh, face_set, parameters::all_default()); -} - -template -bool remove_degenerate_edges(TriangleMesh& tmesh) -{ - std::set::face_descriptor> face_set; - return remove_degenerate_edges(edges(tmesh), tmesh, face_set, parameters::all_default()); -} - // \ingroup PMP_repairing_grp // removes the degenerate faces from a triangulated surface mesh. // A face is considered degenerate if two of its vertices share the same location, @@ -1801,10 +1763,10 @@ bool remove_degenerate_edges(TriangleMesh& tmesh) // We should probably do something with the return type. // // \return `true` if all degenerate faces were successfully removed, and `false` otherwise. -template +template bool remove_degenerate_faces(const FaceRange& face_range, TriangleMesh& tmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { CGAL_assertion(CGAL::is_triangle_mesh(tmesh)); CGAL_assertion(CGAL::is_valid_polygon_mesh(tmesh)); @@ -2617,26 +2579,13 @@ bool remove_degenerate_faces(const FaceRange& face_range, return all_removed; } -template -bool remove_degenerate_faces(const FaceRange& face_range, - TriangleMesh& tmesh) -{ - return remove_degenerate_faces(face_range, tmesh, CGAL::parameters::all_default()); -} - template bool remove_degenerate_faces(TriangleMesh& tmesh, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { return remove_degenerate_faces(faces(tmesh), tmesh, np); } -template -bool remove_degenerate_faces(TriangleMesh& tmesh) -{ - return remove_degenerate_faces(tmesh, CGAL::parameters::all_default()); -} - } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h index 1bd4c9e445e..ace300c5ead 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h @@ -475,10 +475,10 @@ std::size_t remove_isolated_points_in_polygon_soup(PointRange& points, /// /// \returns the number of removed points /// -template +template std::size_t merge_duplicate_points_in_polygon_soup(PointRange& points, PolygonRange& polygons, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef typename internal::Polygon_types::P_ID P_ID; typedef typename internal::Polygon_types::Point_3 Point_3; @@ -549,13 +549,6 @@ std::size_t merge_duplicate_points_in_polygon_soup(PointRange& points, return removed_points_n; } -template -std::size_t merge_duplicate_points_in_polygon_soup(PointRange& points, - PolygonRange& polygons) -{ - return merge_duplicate_points_in_polygon_soup(points, polygons, CGAL::parameters::all_default()); -} - namespace internal { // Find the position of the (arbitrarily chose) first point of the canonical point @@ -881,10 +874,10 @@ DuplicateOutputIterator collect_duplicate_polygons(const PointRange& points, /// /// \returns the number of removed polygons /// -template +template std::size_t merge_duplicate_polygons_in_polygon_soup(const PointRange& points, PolygonRange& polygons, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::get_parameter; using parameters::choose_parameter; @@ -980,13 +973,6 @@ std::size_t merge_duplicate_polygons_in_polygon_soup(const PointRange& points, return removed_polygons_n; } -template -std::size_t merge_duplicate_polygons_in_polygon_soup(PointRange& points, - PolygonRange& polygons) -{ - return merge_duplicate_polygons_in_polygon_soup(points, polygons, CGAL::parameters::all_default()); -} - /// \ingroup PMP_repairing_grp /// /// cleans a given polygon soup through various repairing operations. More precisely, this function @@ -1044,10 +1030,10 @@ std::size_t merge_duplicate_polygons_in_polygon_soup(PointRange& points, /// \cgalParamNEnd /// \cgalNamedParamsEnd /// -template +template void repair_polygon_soup(PointRange& points, PolygonRange& polygons, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::get_parameter; using parameters::choose_parameter; @@ -1067,13 +1053,6 @@ void repair_polygon_soup(PointRange& points, remove_isolated_points_in_polygon_soup(points, polygons); } -template -void repair_polygon_soup(PointRange& points, - PolygonRange& polygons) -{ - return repair_polygon_soup(points, polygons, CGAL::parameters::all_default()); -} - } // end namespace Polygon_mesh_processing } // end namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h index 26736869a67..f62a4c46ef9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h @@ -1956,10 +1956,10 @@ struct Remove_self_intersection_default_visitor double /* containment_epsilon */ ) {} }; -template +template bool remove_self_intersections(const FaceRange& face_range, TriangleMesh& tmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -2104,24 +2104,12 @@ bool remove_self_intersections(const FaceRange& face_range, return step < max_steps; } -template -bool remove_self_intersections(const FaceRange& face_range, TriangleMesh& tmesh) -{ - return remove_self_intersections(face_range, tmesh, parameters::all_default()); -} - template -bool remove_self_intersections(TriangleMesh& tmesh, const CGAL_BGL_NP_CLASS& np) +bool remove_self_intersections(TriangleMesh& tmesh, const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { return remove_self_intersections(faces(tmesh), tmesh, np); } -template -bool remove_self_intersections(TriangleMesh& tmesh) -{ - return remove_self_intersections(tmesh, parameters::all_default()); -} - } // namespace experimental } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h index 678e35773ee..60a2a9dac0f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h @@ -456,30 +456,16 @@ template < class ConcurrencyTag = Sequential_tag, class TriangleMesh, class FaceRange, class FacePairOutputIterator, - class NamedParameters> + class NamedParameters = parameters::Default_named_parameters> FacePairOutputIterator self_intersections(const FaceRange& face_range, const TriangleMesh& tmesh, FacePairOutputIterator out, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { return internal::self_intersections_impl(face_range, tmesh, out, false /*don't throw*/, np); } -/// \cond SKIP_IN_MANUAL -template -FacePairOutputIterator -self_intersections(const FaceRange& face_range, - const TriangleMesh& tmesh, - FacePairOutputIterator out) -{ - return self_intersections(face_range, tmesh, out, CGAL::parameters::all_default()); -} -/// \endcond - /** * \ingroup PMP_intersection_grp * collects intersections between all the faces of a triangulated surface mesh. @@ -538,20 +524,11 @@ template (faces(tmesh), tmesh, out, np); } -/// \cond SKIP_IN_MANUAL -template -FacePairOutputIterator -self_intersections(const TriangleMesh& tmesh, FacePairOutputIterator out) -{ - return self_intersections(faces(tmesh), tmesh, out, parameters::all_default()); -} -/// \endcond - /** * \ingroup PMP_intersection_grp * tests if a set of faces of a triangulated surface mesh self-intersects. @@ -590,10 +567,10 @@ self_intersections(const TriangleMesh& tmesh, FacePairOutputIterator out) template + class NamedParameters = parameters::Default_named_parameters> bool does_self_intersect(const FaceRange& face_range, const TriangleMesh& tmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { CGAL_precondition(CGAL::is_triangle_mesh(tmesh)); @@ -657,26 +634,11 @@ template bool does_self_intersect(const TriangleMesh& tmesh, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { return does_self_intersect(faces(tmesh), tmesh, np); } -/// \cond SKIP_IN_MANUAL -template -bool does_self_intersect(const TriangleMesh& tmesh) -{ - return does_self_intersect(faces(tmesh), tmesh, CGAL::parameters::all_default()); -} - -template -bool does_self_intersect(const FaceRange& face_range, - const TriangleMesh& tmesh) -{ - return does_self_intersect(face_range, tmesh, CGAL::parameters::all_default()); -} -/// \endcond - }// namespace Polygon_mesh_processing }// namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h index 33b70706c12..fddb8859654 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h @@ -66,10 +66,10 @@ namespace Polygon_mesh_processing { /// \sa `degenerate_edges()` /// /// \return `true` if the edge `e` is degenerate, `false` otherwise. -template +template bool is_degenerate_edge(typename boost::graph_traits::edge_descriptor e, const PolygonMesh& pm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::get_parameter; using parameters::choose_parameter; @@ -84,13 +84,6 @@ bool is_degenerate_edge(typename boost::graph_traits::edge_descript return traits.equal_3_object()(get(vpmap, source(e, pm)), get(vpmap, target(e, pm))); } -template -bool is_degenerate_edge(typename boost::graph_traits::edge_descriptor e, - const PolygonMesh& pm) -{ - return is_degenerate_edge(e, pm, parameters::all_default()); -} - /// \ingroup PMP_repairing_grp /// collects the degenerate edges within a given range of edges. /// @@ -121,11 +114,11 @@ bool is_degenerate_edge(typename boost::graph_traits::edge_descript /// \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} /// \cgalParamNEnd /// \cgalNamedParamsEnd -template +template OutputIterator degenerate_edges(const EdgeRange& edges, const TriangleMesh& tm, OutputIterator out, - const NamedParameters& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename boost::graph_traits::edge_descriptor edge_descriptor; @@ -136,43 +129,20 @@ OutputIterator degenerate_edges(const EdgeRange& edges, return out; } -template -OutputIterator degenerate_edges(const EdgeRange& edges, - const TriangleMesh& tm, - OutputIterator out, - typename boost::enable_if< - typename boost::has_range_iterator - >::type* = 0) -{ - return degenerate_edges(edges, tm, out, CGAL::parameters::all_default()); -} - /// \ingroup PMP_repairing_grp /// calls the function `degenerate_edges()` with the range: `edges(tm)`. /// /// See above for the comprehensive description of the parameters. /// -template +template OutputIterator degenerate_edges(const TriangleMesh& tm, OutputIterator out, - const NamedParameters& np -#ifndef DOXYGEN_RUNNING - , - typename boost::disable_if< - boost::has_range_iterator - >::type* = 0 -#endif + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values() ) { return degenerate_edges(edges(tm), tm, out, np); } -template -OutputIterator degenerate_edges(const TriangleMesh& tm, OutputIterator out) -{ - return degenerate_edges(edges(tm), tm, out, CGAL::parameters::all_default()); -} - /// \ingroup PMP_repairing_grp /// checks whether a triangle face is degenerate. /// A triangle face is considered degenerate if the geometric positions of its vertices are collinear. @@ -204,10 +174,10 @@ OutputIterator degenerate_edges(const TriangleMesh& tm, OutputIterator out) /// \sa `degenerate_faces()` /// /// \return `true` if the face `f` is degenerate, `false` otherwise. -template +template bool is_degenerate_triangle_face(typename boost::graph_traits::face_descriptor f, const TriangleMesh& tm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); @@ -228,13 +198,6 @@ bool is_degenerate_triangle_face(typename boost::graph_traits::fac get(vpmap, target(next(h, tm), tm))); } -template -bool is_degenerate_triangle_face(typename boost::graph_traits::face_descriptor f, - const TriangleMesh& tm) -{ - return CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(f, tm, parameters::all_default()); -} - /// \ingroup PMP_repairing_grp /// collects the degenerate faces within a given range of faces. /// @@ -266,11 +229,11 @@ bool is_degenerate_triangle_face(typename boost::graph_traits::fac /// \cgalParamNEnd /// \cgalNamedParamsEnd /// -template +template OutputIterator degenerate_faces(const FaceRange& faces, const TriangleMesh& tm, OutputIterator out, - const NamedParameters& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename boost::graph_traits::face_descriptor face_descriptor; @@ -282,43 +245,20 @@ OutputIterator degenerate_faces(const FaceRange& faces, return out; } -template -OutputIterator degenerate_faces(const FaceRange& faces, - const TriangleMesh& tm, - OutputIterator out, - typename boost::enable_if< - boost::has_range_iterator - >::type* = 0) -{ - return degenerate_faces(faces, tm, out, CGAL::parameters::all_default()); -} - /// \ingroup PMP_repairing_grp /// calls the function `degenerate_faces()` with the range: `faces(tm)`. /// /// See above for the comprehensive description of the parameters. /// -template +template OutputIterator degenerate_faces(const TriangleMesh& tm, OutputIterator out, - const NamedParameters& np -#ifndef DOXYGEN_RUNNING - , - typename boost::disable_if< - boost::has_range_iterator - >::type* = 0 -#endif + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values() ) { return degenerate_faces(faces(tm), tm, out, np); } -template -OutputIterator degenerate_faces(const TriangleMesh& tm, OutputIterator out) -{ - return degenerate_faces(faces(tm), tm, out, CGAL::parameters::all_default()); -} - /// \ingroup PMP_repairing_grp /// checks whether a triangle face is needle. /// A triangle is said to be a needle if its longest edge is much longer than its shortest edge. @@ -350,12 +290,12 @@ OutputIterator degenerate_faces(const TriangleMesh& tm, OutputIterator out) /// /// \return the shortest halfedge if the triangle face is a needle, and a null halfedge otherwise. /// If the face contains degenerate edges, a halfedge corresponding to one of these edges is returned. -template +template typename boost::graph_traits::halfedge_descriptor is_needle_triangle_face(typename boost::graph_traits::face_descriptor f, const TriangleMesh& tm, const double threshold, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { CGAL_precondition(threshold >= 1.); CGAL_precondition(f != boost::graph_traits::null_face()); @@ -415,15 +355,6 @@ is_needle_triangle_face(typename boost::graph_traits::face_descrip return boost::graph_traits::null_halfedge(); } -template -typename boost::graph_traits::halfedge_descriptor -is_needle_triangle_face(typename boost::graph_traits::face_descriptor f, - const TriangleMesh& tm, - const double threshold) -{ - return is_needle_triangle_face(f, tm, threshold, parameters::all_default()); -} - /// \ingroup PMP_repairing_grp /// checks whether a triangle face is a cap. /// A triangle is said to be a cap if one of the its angles is close to `180` degrees. @@ -457,12 +388,12 @@ is_needle_triangle_face(typename boost::graph_traits::face_descrip /// \cgalNamedParamsEnd /// /// \return the halfedge opposite of the largest angle if the face is a cap, and a null halfedge otherwise. -template +template typename boost::graph_traits::halfedge_descriptor is_cap_triangle_face(typename boost::graph_traits::face_descriptor f, const TriangleMesh& tm, const double threshold, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { CGAL_precondition(f != boost::graph_traits::null_face()); CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); @@ -524,15 +455,6 @@ is_cap_triangle_face(typename boost::graph_traits::face_descriptor return boost::graph_traits::null_halfedge(); } -template -typename boost::graph_traits::halfedge_descriptor -is_cap_triangle_face(typename boost::graph_traits::face_descriptor f, - const TriangleMesh& tm, - const double threshold) -{ - return is_cap_triangle_face(f, tm, threshold, parameters::all_default()); -} - } } // end namespaces CGAL and PMP #endif // CGAL_POLYGON_MESH_PROCESSING_SHAPE_PREDICATES_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_mesh.h index 842257462f1..894982013f8 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_mesh.h @@ -129,10 +129,10 @@ namespace Polygon_mesh_processing { * * @pre `tmesh` does not contain any degenerate faces */ -template +template void smooth_mesh(const FaceRange& faces, TriangleMesh& tmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -324,24 +324,12 @@ void smooth_mesh(const FaceRange& faces, } ///\cond SKIP_IN_MANUAL -template -void smooth_mesh(const FaceRange& face_range, TriangleMesh& tmesh) -{ - smooth_mesh(face_range, tmesh, parameters::all_default()); -} - template -void smooth_mesh(TriangleMesh& tmesh, const CGAL_BGL_NP_CLASS& np) +void smooth_mesh(TriangleMesh& tmesh, const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { smooth_mesh(faces(tmesh), tmesh, np); } -template -void smooth_mesh(TriangleMesh& tmesh) -{ - smooth_mesh(faces(tmesh), tmesh, parameters::all_default()); -} - template void angles_evaluation(TriangleMesh& tmesh, GeomTraits traits, Stream& output) { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h index 5aebfe9d66a..4f59172e541 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h @@ -95,11 +95,11 @@ namespace Polygon_mesh_processing { * * @warning This function involves linear algebra, that is computed using a non-exact floating-point arithmetic. */ -template +template void smooth_shape(const FaceRange& faces, TriangleMesh& tmesh, const double time, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { if(std::begin(faces) == std::end(faces)) return; @@ -197,28 +197,13 @@ void smooth_shape(const FaceRange& faces, } /// \cond SKIP_IN_MANUAL -template -void smooth_shape(const FaceRange& faces, - TriangleMesh& tmesh, - const double time) -{ - smooth_shape(faces, tmesh, time, parameters::all_default()); -} - template void smooth_shape(TriangleMesh& tmesh, const double time, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { smooth_shape(faces(tmesh), tmesh, time, np); } - -template -void smooth_shape(TriangleMesh& tmesh, - const double time) -{ - smooth_shape(faces(tmesh), tmesh, time, parameters::all_default()); -} /// \endcond } // Polygon_mesh_processing diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h index 61da01c049b..a082967091f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h @@ -1117,19 +1117,12 @@ std::size_t stitch_boundary_cycle(const typename boost::graph_traits std::size_t stitch_boundary_cycle(const typename boost::graph_traits::halfedge_descriptor h, PolygonMesh& pmesh, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { internal::Dummy_cycle_rep_maintainer dummy_maintainer(pmesh); return internal::stitch_boundary_cycle(h, pmesh, dummy_maintainer, np); } -template -std::size_t stitch_boundary_cycle(const typename boost::graph_traits::halfedge_descriptor h, - PolygonMesh& pmesh) -{ - return stitch_boundary_cycle(h, pmesh, parameters::all_default()); -} - namespace internal { template std::size_t stitch_boundary_cycles(const BorderHalfedgeRange& boundary_cycle_representatives, PolygonMesh& pmesh, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { // If this API is called, we are not from stitch_borders() (otherwise there would be a maintainer) // so there is only one pass and we don't carea bout maintaining the cycle subset @@ -1198,7 +1191,7 @@ std::size_t stitch_boundary_cycles(const BorderHalfedgeRange& boundary_cycle_rep // convenience overloads template std::size_t stitch_boundary_cycles(PolygonMesh& pmesh, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -1208,44 +1201,11 @@ std::size_t stitch_boundary_cycles(PolygonMesh& pmesh, return stitch_boundary_cycles(boundary_cycle_representatives, pmesh, np); } -template -std::size_t stitch_boundary_cycles(const BorderHalfedgeRange& boundary_cycle_representatives, - PolygonMesh& pmesh) -{ - return stitch_boundary_cycles(boundary_cycle_representatives, pmesh, parameters::all_default()); -} +/// \endcond -template -std::size_t stitch_boundary_cycles(PolygonMesh& pmesh) -{ - return stitch_boundary_cycles(pmesh, parameters::all_default()); -} // The VPM is only used here for debugging info purposes as in this overload, the halfedges // to stitch are already provided and all further checks are combinatorial and not geometrical. -// There is thus nothing interesting to pass via named parameters and this overload is not documented. -template -std::size_t stitch_borders(PolygonMesh& pmesh, - const HalfedgePairsRange& hedge_pairs_to_stitch, - const CGAL_BGL_NP_CLASS& np, - typename boost::enable_if< - typename boost::has_range_iterator - >::type* = 0) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - - typedef typename GetVertexPointMap::const_type VPM; - VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), - get_const_property_map(vertex_point, pmesh)); - - return internal::stitch_halfedge_range_dispatcher(hedge_pairs_to_stitch, pmesh, vpm); -} - -///\endcond - /*! * \ingroup PMP_repairing_grp * @@ -1264,22 +1224,40 @@ std::size_t stitch_borders(PolygonMesh& pmesh, * * \param pmesh the polygon mesh to be modified by stitching * \param hedge_pairs_to_stitch a range of `std::pair` of halfedges to be stitched together +* \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below +* +* \cgalNamedParamsBegin +* \cgalParamNBegin{vertex_point_map} +* \cgalParamDescription{a property map associating points to the vertices of `pm`} +* \cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits::%vertex_descriptor` +* as key type and `%Point_3` as value type} +* \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`} +* \cgalParamExtra{If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` +* must be available in `PolygonMesh`.} +* \cgalParamNEnd +* \cgalNamedParamsEnd * * \return the number of pairs of halfedges that were stitched. * */ template + typename HalfedgePairsRange, + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS> std::size_t stitch_borders(PolygonMesh& pmesh, - const HalfedgePairsRange& hedge_pairs_to_stitch -#ifndef DOXYGEN_RUNNING - , typename boost::enable_if< - typename boost::has_range_iterator - >::type* = 0 -#endif - ) + const HalfedgePairsRange& hedge_pairs_to_stitch, + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values(), + typename boost::enable_if< + typename boost::has_range_iterator + >::type* = 0) { - return stitch_borders(pmesh, hedge_pairs_to_stitch, parameters::all_default()); + using parameters::choose_parameter; + using parameters::get_parameter; + + typedef typename GetVertexPointMap::const_type VPM; + VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), + get_const_property_map(vertex_point, pmesh)); + + return internal::stitch_halfedge_range_dispatcher(hedge_pairs_to_stitch, pmesh, vpm); } namespace internal { @@ -1364,6 +1342,65 @@ std::size_t stitch_borders(const BorderHalfedgeRange& boundary_cycle_representat /// \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph` /// \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" /// +/// \param pmesh the polygon mesh to be modified by the stitching procedure +/// \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below +/// +/// \cgalNamedParamsBegin +/// \cgalParamNBegin{vertex_point_map} +/// \cgalParamDescription{a property map associating points to the vertices of `pmesh`} +/// \cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits::%vertex_descriptor` +/// as key type and `%Point_3` as value type} +/// \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`} +/// \cgalParamExtra{If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` +/// must be available in `PolygonMesh`.} +/// \cgalParamNEnd +/// +/// \cgalParamNBegin{apply_per_connected_component} +/// \cgalParamDescription{specifies if the borders should only be stitched only within their own connected component.} +/// \cgalParamType{Boolean} +/// \cgalParamDefault{`false`} +/// \cgalParamNEnd +/// +/// \cgalParamNBegin{face_index_map} +/// \cgalParamDescription{a property map associating to each face of `pmesh` a unique index between `0` and `num_faces(pmesh) - 1`} +/// \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%face_descriptor` +/// as key type and `std::size_t` as value type} +/// \cgalParamDefault{an automatically indexed internal map} +/// \cgalParamNEnd +/// \cgalNamedParamsEnd +/// +/// \return the number of pairs of halfedges that were stitched. +/// +/// \sa `stitch_boundary_cycle()` +/// \sa `stitch_boundary_cycles()` +/// +template +std::size_t stitch_borders(PolygonMesh& pmesh, + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + std::vector boundary_cycle_representatives; + extract_boundary_cycles(pmesh, std::back_inserter(boundary_cycle_representatives)); + + // We are working on all boundary cycles, so there is no need to keep track of any subset + internal::Dummy_cycle_rep_maintainer dummy_maintainer(pmesh); + return stitch_borders(boundary_cycle_representatives, pmesh, dummy_maintainer, np); +} + +/// \ingroup PMP_repairing_grp +/// +/// \brief Same as the other overload, but the pairs of halfedges to be stitched +/// are automatically found amongst halfedges in cycles described by `boundary_cycle_representatives`. +/// +/// Two border halfedges `h1` and `h2` are set to be stitched +/// if the points associated to the source and target vertices of `h1` are +/// the same as those of the target and source vertices of `h2`, respectively. +/// +/// \tparam BorderHalfedgeRange a model of `Range` with value type `boost::graph_traits::%halfedge_descriptor` +/// \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph` +/// \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" +/// /// \param boundary_cycle_representatives a range of border halfedges, each describing a boundary cycle whose halfedges /// will be considered for stitching /// \param pmesh the polygon mesh to be modified by the stitching procedure @@ -1401,7 +1438,7 @@ std::size_t stitch_borders(const BorderHalfedgeRange& boundary_cycle_representat template std::size_t stitch_borders(const BorderHalfedgeRange& boundary_cycle_representatives, PolygonMesh& pmesh, - const CGAL_BGL_NP_CLASS& np + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , typename boost::enable_if< typename boost::has_range_iterator @@ -1414,41 +1451,6 @@ std::size_t stitch_borders(const BorderHalfedgeRange& boundary_cycle_representat return stitch_borders(boundary_cycle_representatives, pmesh, cycle_reps_maintainer, np); } -/// \cond SKIP_IN_MANUAL - -template -std::size_t stitch_borders(const BorderHalfedgeRange& boundary_cycle_representatives, - PolygonMesh& pmesh, - typename boost::enable_if< - typename boost::has_range_iterator - >::type* = 0) -{ - // Need to keep track of the cycles since we are working on a subset of all the boundary cycles - internal::Boundary_cycle_rep_maintainer cycle_reps_maintainer(pmesh); - return stitch_borders(boundary_cycle_representatives, pmesh, cycle_reps_maintainer, parameters::all_default()); -} - -template -std::size_t stitch_borders(PolygonMesh& pmesh, - const CGAL_BGL_NP_CLASS& np) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - - std::vector boundary_cycle_representatives; - extract_boundary_cycles(pmesh, std::back_inserter(boundary_cycle_representatives)); - - // We are working on all boundary cycles, so there is no need to keep track of any subset - internal::Dummy_cycle_rep_maintainer dummy_maintainer(pmesh); - return stitch_borders(boundary_cycle_representatives, pmesh, dummy_maintainer, np); -} - -template -std::size_t stitch_borders(PolygonMesh& pmesh) -{ - return stitch_borders(pmesh, parameters::all_default()); -} - -/// \endcond } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/transform.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/transform.h index 1dd96bfd21c..263a73dd374 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/transform.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/transform.h @@ -44,10 +44,10 @@ namespace Polygon_mesh_processing{ * \cgalNamedParamsEnd * */ -template +template void transform(const Transformation& transformation, PolygonMesh& mesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { typedef typename GetVertexPointMap::type VPMap; VPMap vpm = parameters::choose_parameter(parameters::get_parameter(np, internal_np::vertex_point), @@ -59,14 +59,6 @@ void transform(const Transformation& transformation, } } -/// \cond SKIP_IN_MANUAL -template -void transform(const Transformation& transformation, - PolygonMesh& mesh) -{ - transform(transformation, mesh, parameters::all_default()); -} -/// \endcond } } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h index 984df6eb7b0..89788b43134 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h @@ -462,10 +462,10 @@ public: * * @return `true` if the face has been triangulated. */ -template +template bool triangulate_face(typename boost::graph_traits::face_descriptor f, PolygonMesh& pmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -495,13 +495,6 @@ bool triangulate_face(typename boost::graph_traits::face_descriptor return modifier.triangulate_face(f, pmesh, use_cdt, visitor); } -template -bool triangulate_face(typename boost::graph_traits::face_descriptor f, - PolygonMesh& pmesh) -{ - return triangulate_face(f, pmesh, CGAL::Polygon_mesh_processing::parameters::all_default()); -} - /** * \ingroup PMP_meshing_grp * triangulates given faces of a polygon mesh. This function depends on the package \ref PkgTriangulation2 @@ -546,10 +539,10 @@ bool triangulate_face(typename boost::graph_traits::face_descriptor * * @see triangulate_face() */ -template +template bool triangulate_faces(FaceRange face_range, PolygonMesh& pmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -579,12 +572,6 @@ bool triangulate_faces(FaceRange face_range, return modifier(face_range, pmesh, use_cdt, visitor); } -template -bool triangulate_faces(FaceRange face_range, PolygonMesh& pmesh) -{ - return triangulate_faces(face_range, pmesh, CGAL::Polygon_mesh_processing::parameters::all_default()); -} - /** * \ingroup PMP_meshing_grp * triangulates all faces of a polygon mesh. This function depends on the package \ref PkgTriangulation2 @@ -624,19 +611,13 @@ bool triangulate_faces(FaceRange face_range, PolygonMesh& pmesh) * * @see triangulate_face() */ -template +template bool triangulate_faces(PolygonMesh& pmesh, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { return triangulate_faces(faces(pmesh), pmesh, np); } -template -bool triangulate_faces(PolygonMesh& pmesh) -{ - return triangulate_faces(faces(pmesh), pmesh, CGAL::Polygon_mesh_processing::parameters::all_default()); -} - } // end namespace Polygon_mesh_processing } // end namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h index 9fd14f02c87..a4296f6dc2b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h @@ -115,12 +115,12 @@ namespace Polygon_mesh_processing { */ template + typename NamedParameters = parameters::Default_named_parameters> OutputIterator triangulate_hole(PolygonMesh& pmesh, typename boost::graph_traits::halfedge_descriptor border_halfedge, OutputIterator out, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -176,16 +176,6 @@ namespace Polygon_mesh_processing { max_squared_distance).first; } - template - OutputIterator - triangulate_hole(PolygonMesh& pmesh, - typename boost::graph_traits::halfedge_descriptor border_halfedge, - OutputIterator out) - { - return triangulate_hole(pmesh, border_halfedge, out, - CGAL::Polygon_mesh_processing::parameters::all_default()); - } - template void test_in_edges(const PM& pmesh, const VertexRange& patch) { @@ -283,13 +273,13 @@ namespace Polygon_mesh_processing { template + typename NamedParameters = parameters::Default_named_parameters> std::pair triangulate_and_refine_hole(PolygonMesh& pmesh, typename boost::graph_traits::halfedge_descriptor border_halfedge, FaceOutputIterator face_out, VertexOutputIterator vertex_out, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { std::vector::face_descriptor> patch; triangulate_hole(pmesh, border_halfedge, std::back_inserter(patch), np); @@ -300,20 +290,6 @@ namespace Polygon_mesh_processing { return refine(pmesh, patch, face_out, vertex_out, np); } - template - std::pair - triangulate_and_refine_hole(PolygonMesh& pmesh, - typename boost::graph_traits::halfedge_descriptor border_halfedge, - FaceOutputIterator face_out, - VertexOutputIterator vertex_out) - { - return triangulate_and_refine_hole(pmesh, border_halfedge, - face_out, vertex_out, - CGAL::Polygon_mesh_processing::parameters::all_default()); - } - /*! \ingroup hole_filling_grp @brief triangulates, refines and fairs a hole in a polygon mesh. @@ -417,13 +393,13 @@ namespace Polygon_mesh_processing { template + typename NamedParameters = parameters::Default_named_parameters> std::tuple triangulate_refine_and_fair_hole(PolygonMesh& pmesh, typename boost::graph_traits::halfedge_descriptor border_halfedge, FaceOutputIterator face_out, VertexOutputIterator vertex_out, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { std::vector::vertex_descriptor> patch; @@ -442,20 +418,6 @@ namespace Polygon_mesh_processing { return std::make_tuple(fair_success, face_out, vertex_out); } - template - std::tuple - triangulate_refine_and_fair_hole(PolygonMesh& pmesh, - typename boost::graph_traits::halfedge_descriptor border_halfedge, - FaceOutputIterator face_out, - VertexOutputIterator vertex_out) - { - return triangulate_refine_and_fair_hole(pmesh, border_halfedge, - face_out, vertex_out, - CGAL::Polygon_mesh_processing::parameters::all_default()); - } - /*! \ingroup hole_filling_grp creates triangles to fill the hole defined by points in the range `points`. @@ -531,12 +493,12 @@ namespace Polygon_mesh_processing { template + typename NamedParameters = parameters::Default_named_parameters> OutputIterator triangulate_hole_polyline(const PointRange1& points, const PointRange2& third_points, OutputIterator out, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { if (points.empty()) return out; @@ -610,18 +572,6 @@ bool use_dt3 = return tracer.out; } - template - OutputIterator - triangulate_hole_polyline(const PointRange1& points, - const PointRange2& third_points, - OutputIterator out) - { - return triangulate_hole_polyline(points, third_points, out, - CGAL::Polygon_mesh_processing::parameters::all_default()); - } - /*! \ingroup hole_filling_grp Same as above but the range of third points is omitted. They are not @@ -633,7 +583,7 @@ bool use_dt3 = OutputIterator triangulate_hole_polyline(const PointRange& points, OutputIterator out, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values()) { typedef typename std::iterator_traits< typename PointRange::iterator>::value_type Point; @@ -641,16 +591,6 @@ bool use_dt3 = return triangulate_hole_polyline(points, third_points, out, np); } - template - OutputIterator - triangulate_hole_polyline(const PointRange& points, - OutputIterator out) - { - return triangulate_hole_polyline(points, out, - CGAL::Polygon_mesh_processing::parameters::all_default()); - } - } //end namespace Polygon_mesh_processing } //end namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index ec560767978..71c7a9c0c98 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -359,10 +359,10 @@ public: * \note The triangle mesh gets copied internally, that is it can be modifed after having passed as argument, * while the queries are performed */ - template + template Polyhedral_envelope(const TriangleMesh& tmesh, double epsilon, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -459,11 +459,11 @@ public: * \note The triangle mesh gets copied internally, that is it can be modifed after having passed as argument, * while the queries are performed */ - template + template Polyhedral_envelope(const FaceRange& face_range, const TriangleMesh& tmesh, double epsilon, - const NamedParameters& np + const NamedParameters& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , typename std::enable_if::value>::type* = 0 #endif @@ -563,11 +563,11 @@ public: * \cgalNamedParamsEnd * */ - template + template Polyhedral_envelope(const PointRange& points, const TriangleRange& triangles, double epsilon, - const NamedParameters& np + const NamedParameters& np = parameters::use_default_values() #ifndef DOXYGEN_RUNNING , typename std::enable_if::value>::type* = 0 #endif @@ -618,30 +618,6 @@ public: /// @} -#ifndef DOXYGEN_RUNNING - template - Polyhedral_envelope(const TriangleMesh& tmesh, - double epsilon) - : Polyhedral_envelope(tmesh, epsilon, parameters::all_default()) - {} - - template - Polyhedral_envelope(const FaceRange& face_range, - const TriangleMesh& tmesh, - double epsilon, - typename std::enable_if::value>::type* = 0) - : Polyhedral_envelope(face_range, tmesh, epsilon, parameters::all_default()) - {} - - template - Polyhedral_envelope(const PointRange& points, - const TriangleRange& triangles, - double epsilon, - typename std::enable_if::value>::type* = 0) - : Polyhedral_envelope(points, triangles, epsilon, parameters::all_default()) - {} -#endif - private: template @@ -2246,7 +2222,12 @@ public: */ template bool - operator()(const TriangleMesh& tmesh, const CGAL_BGL_NP_CLASS& np) const + operator()(const TriangleMesh& tmesh, + const CGAL_BGL_NP_CLASS& np = parameters::use_default_values() +#ifndef DOXYGEN_RUNNING + , typename std::enable_if::value>::type* = 0 +#endif + ) const { using parameters::choose_parameter; using parameters::get_parameter; @@ -2270,16 +2251,6 @@ public: return true; } -#ifndef DOXYGEN_RUNNING - template - bool - operator()(const TriangleMesh& tmesh, - typename std::enable_if::value>::type* = 0) const - { - return this->operator()(tmesh, parameters::all_default()); - } -#endif - /** * returns `true`, iff all the triangles in `triangles` are inside the polyhedral envelope. * @@ -2304,10 +2275,10 @@ public: * \cgalNamedParamsEnd * */ - template + template bool operator()(const PointRange& points, const TriangleRange& triangles, - const NamedParameters& np) const + const NamedParameters& np = parameters::use_default_values()) const { using parameters::choose_parameter; using parameters::get_parameter; @@ -2333,16 +2304,6 @@ public: return true; } -#ifndef DOXYGEN_RUNNING - template - bool operator()(const PointRange& points, - const TriangleRange& triangles) const - { - return this->operator()(points, triangles, parameters::all_default()); - } - -#endif - /** * returns `true`, iff all the triangles in `triangle_range` are inside the polyhedral envelope. * @tparam TriangleRange a model of `ConstRange` with `ConstRange::const_iterator` diff --git a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h index 927fed1fe89..f387376104b 100644 --- a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h +++ b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h @@ -240,9 +240,9 @@ public: * \cgalParamNEnd * \cgalNamedParamsEnd */ - template + template std::size_t add_mesh(const TriangleMesh& tm, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { // handle vpm typedef typename CGAL::GetVertexPointMap::const_type Local_vpm; @@ -299,8 +299,8 @@ public: * \cgalParamNEnd * \cgalNamedParamsEnd */ - template - std::size_t add_mesh(const AABB_tree& tree, const TriangleMesh& tm, const NamedParameters& np) + template + std::size_t add_mesh(const AABB_tree& tree, const TriangleMesh& tm, const NamedParameters& np = parameters::use_default_values()) { std::size_t id = get_id_for_new_mesh(); CGAL_assertion( m_aabb_trees[id] == nullptr ); @@ -546,12 +546,12 @@ public: * \cgalParamNEnd * \cgalNamedParamsEnd */ - template + template static void collect_one_point_per_connected_component( const TriangleMesh& tm, std::vector& points, - const NamedParameters& np) + const NamedParameters& np = parameters::use_default_values()) { const bool maybe_several_cc = parameters::choose_parameter( @@ -625,25 +625,6 @@ public: return id; } - - // versions without NP - static - void collect_one_point_per_connected_component( - const TriangleMesh& tm, - std::vector& points) - { - collect_one_point_per_connected_component(tm, points, parameters::all_default()); - } - - std::size_t add_mesh(const TriangleMesh& tm) - { - return add_mesh(tm, parameters::all_default()); - } - - std::size_t add_mesh(const AABB_tree& tree, const TriangleMesh& tm) - { - return add_mesh(tree, tm, parameters::all_default()); - } #endif }; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_hausdorff_bounded_error_distance.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_hausdorff_bounded_error_distance.cpp index 9006f74d9cb..2068553b08d 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_hausdorff_bounded_error_distance.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_hausdorff_bounded_error_distance.cpp @@ -1132,7 +1132,7 @@ void test_early_quit(const std::string filepath) { std::cout << " ---- distance 0.0 = 0.0 ---- " << std::endl; timer.reset(); timer.start(); - assert(!PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 0.0)); + assert(!PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 0.0, 0.0001)); timer.stop(); const double timea = timer.time(); @@ -1142,25 +1142,25 @@ void test_early_quit(const std::string filepath) { std::cout << " ---- distance 0.5 < 1.0 ---- " << std::endl; timer.reset(); timer.start(); - assert(!PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 1.0)); + assert(!PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 1.0, 0.0001)); timer.stop(); const double timeb = timer.time(); std::cout << " ---- distance 0.5 < 0.6 ---- " << std::endl; timer.reset(); timer.start(); - assert(!PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 0.6)); + assert(!PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 0.6, 0.0001)); timer.stop(); const double timec = timer.time(); std::cout << " ---- distance 0.5 > 0.4 ---- " << std::endl; timer.reset(); timer.start(); - assert(PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 0.4)); + assert(PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 0.4, 0.0001)); timer.stop(); const double timed = timer.time(); std::cout << " ---- distance 0.5 > 0.0 ---- " << std::endl; timer.reset(); timer.start(); - assert(PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 0.0)); + assert(PMP::is_Hausdorff_distance_larger(mesh1, mesh2, 0.0, 0.0001)); timer.stop(); const double timee = timer.time();