1 #ifndef CGAL_SURFACE_MESH_SEGMENTATION_MESH_SEGMENTATION_H
2 #define CGAL_SURFACE_MESH_SEGMENTATION_MESH_SEGMENTATION_H
8 #include <CGAL/internal/Surface_mesh_segmentation/Surface_mesh_segmentation.h>
9 #include <boost/config.hpp>
36 template <
class Polyhedron,
class SDFPropertyMap,
class GeomTraits
37 #ifndef BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
38 =
typename Polyhedron::Traits
41 std::pair<double, double>
43 SDFPropertyMap sdf_values,
44 double cone_angle = 2.0 / 3.0 * CGAL_PI,
45 int number_of_rays = 25,
46 GeomTraits traits = GeomTraits())
48 internal::Surface_mesh_segmentation<Polyhedron, GeomTraits> algorithm(polyhedron, traits);
49 return algorithm.calculate_sdf_values(cone_angle, number_of_rays, sdf_values);
75 template <
class Polyhedron,
class SDFPropertyMap,
class SegmentPropertyMap,
class GeomTraits
76 #ifndef BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
77 =
typename Polyhedron::Traits
82 SDFPropertyMap sdf_values,
83 SegmentPropertyMap segment_ids,
84 int number_of_levels = 5,
85 double smoothing_lambda = 0.26,
86 GeomTraits traits = GeomTraits())
88 smoothing_lambda = (std::max)(0.0, (std::min)(1.0, smoothing_lambda));
90 internal::Surface_mesh_segmentation<Polyhedron, GeomTraits> algorithm(polyhedron, traits);
91 return algorithm.partition(number_of_levels, smoothing_lambda, sdf_values, segment_ids);
118 template <
class Polyhedron,
class SegmentPropertyMap,
class GeomTraits
119 #ifndef BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
120 =
typename Polyhedron::Traits
125 SegmentPropertyMap segment_ids,
126 double cone_angle = 2.0 / 3.0 * CGAL_PI,
127 int number_of_rays = 25,
128 int number_of_levels = 5,
129 double smoothing_lambda = 0.26,
130 GeomTraits traits = GeomTraits())
132 smoothing_lambda = (std::max)(0.0, (std::min)(1.0, smoothing_lambda));
134 typedef std::map< typename Polyhedron::Facet_const_handle, double> Facet_double_map;
135 Facet_double_map internal_sdf_map;
136 boost::associative_property_map<Facet_double_map> sdf_property_map(internal_sdf_map);
138 compute_sdf_values<Polyhedron, boost::associative_property_map<Facet_double_map>, GeomTraits>
139 (polyhedron, sdf_property_map, cone_angle, number_of_rays, traits);
140 return segment_from_sdf_values<Polyhedron, boost::associative_property_map<Facet_double_map>, SegmentPropertyMap, GeomTraits>
141 (polyhedron, sdf_property_map, segment_ids, number_of_levels, smoothing_lambda, traits);
145 #ifdef BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
146 template <
class Polyhedron,
class SDFPropertyMap>
147 std::pair<double, double>
149 SDFPropertyMap sdf_values,
150 double cone_angle = 2.0 / 3.0 * CGAL_PI,
151 int number_of_rays = 25,
152 typename Polyhedron::Traits traits =
typename Polyhedron::Traits())
154 return compute_sdf_values<Polyhedron, SDFPropertyMap, typename Polyhedron::Traits>
155 (polyhedron, sdf_values, cone_angle, number_of_rays, traits);
158 template <
class Polyhedron,
class SDFPropertyMap,
class SegmentPropertyMap>
161 SDFPropertyMap sdf_values,
162 SegmentPropertyMap segment_ids,
163 int number_of_levels = 5,
164 double smoothing_lambda = 0.26,
165 typename Polyhedron::Traits traits =
typename Polyhedron::Traits())
167 return segment_from_sdf_values<Polyhedron, SDFPropertyMap, SegmentPropertyMap, typename Polyhedron::Traits>
168 (polyhedron, sdf_values, segment_ids, number_of_levels, smoothing_lambda, traits);
171 template <
class Polyhedron,
class SegmentPropertyMap>
174 SegmentPropertyMap segment_ids,
175 double cone_angle = 2.0 / 3.0 * CGAL_PI,
176 int number_of_rays = 25,
177 int number_of_levels = 5,
178 double smoothing_lambda = 0.26,
179 typename Polyhedron::Traits traits =
typename Polyhedron::Traits())
181 return compute_sdf_values_and_segment<Polyhedron, SegmentPropertyMap, typename Polyhedron::Traits>
182 (polyhedron, segment_ids, cone_angle, number_of_rays, number_of_levels, smoothing_lambda, traits);
188 #endif // CGAL_SURFACE_MESH_SEGMENTATION_MESH_SEGMENTATION_H //