mirror of https://github.com/CGAL/cgal
Uniformize names of template parameters and graph in segmentation package
This commit is contained in:
parent
bdfc2a269e
commit
312d4cb553
|
|
@ -28,11 +28,11 @@ namespace CGAL
|
|||
|
||||
|
||||
/// @cond SKIP_IN_MANUAL
|
||||
template <bool Fast_sdf_calculation_mode, class Polyhedron,
|
||||
template <bool Fast_sdf_calculation_mode, class TriangleMesh,
|
||||
class SDFPropertyMap,
|
||||
class PointPropertyMap
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
= typename boost::property_map<Polyhedron, boost::vertex_point_t>::type
|
||||
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type
|
||||
#endif
|
||||
, class GeomTraits
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
|
|
@ -40,7 +40,7 @@ template <bool Fast_sdf_calculation_mode, class Polyhedron,
|
|||
#endif
|
||||
>
|
||||
std::pair<double, double>
|
||||
sdf_values( const Polyhedron& polyhedron,
|
||||
sdf_values( const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -49,8 +49,8 @@ sdf_values( const Polyhedron& polyhedron,
|
|||
GeomTraits traits = GeomTraits())
|
||||
{
|
||||
typedef PointPropertyMap VPMap;
|
||||
internal::Surface_mesh_segmentation<Polyhedron, GeomTraits, VPMap, Fast_sdf_calculation_mode>
|
||||
algorithm(polyhedron, traits, ppmap);
|
||||
internal::Surface_mesh_segmentation<TriangleMesh, GeomTraits, VPMap, Fast_sdf_calculation_mode>
|
||||
algorithm(triangle_mesh, traits, ppmap);
|
||||
return algorithm.calculate_sdf_values(cone_angle, number_of_rays,
|
||||
sdf_values_map, postprocess);
|
||||
}
|
||||
|
|
@ -64,26 +64,26 @@ sdf_values( const Polyhedron& polyhedron,
|
|||
* It is possible to compute raw SDF values (without post-processing). In such a case,
|
||||
* -1 is used to indicate when no SDF value could be computed for a facet.
|
||||
*
|
||||
* @pre @a polyhedron.is_pure_triangle()
|
||||
* @pre @a triangle_mesh.is_pure_triangle()
|
||||
*
|
||||
* @tparam Polyhedron a model of `FaceListGraph`
|
||||
* @tparam SDFPropertyMap a `ReadWritePropertyMap` with `boost::graph_traits<Polyhedron>::%face_descriptor` as key and `double` as value type
|
||||
* @tparam TriangleMesh a model of `FaceListGraph`
|
||||
* @tparam SDFPropertyMap a `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::%face_descriptor` as key and `double` as value type
|
||||
* @tparam GeomTraits a model of `SegmentationGeomTraits`
|
||||
* @tparam PointPropertyMap a `ReadablePropertyMap` with `boost::graph_traits<Polyhedron>::%vertex_descriptor` as key and `GeomTraits::Point_3` as value type.
|
||||
* @tparam PointPropertyMap a `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::%vertex_descriptor` as key and `GeomTraits::Point_3` as value type.
|
||||
*
|
||||
* @param polyhedron surface mesh on which SDF values are computed
|
||||
* @param triangle_mesh surface mesh on which SDF values are computed
|
||||
* @param[out] sdf_values_map the SDF value of each facet
|
||||
* @param cone_angle opening angle in radians for the cone of each facet
|
||||
* @param number_of_rays number of rays picked in the cone of each facet. In our experiments, we observe that increasing the number of rays beyond the default has little effect on the quality of the segmentation result
|
||||
* @param postprocess if `true`, `CGAL::sdf_values_postprocessing()` is called on raw SDF value computed.
|
||||
* @param traits traits class
|
||||
* @param ppmap point property map. An overload is provided with `get(boost::vertex_point,polyhedron)` as default.
|
||||
* @param ppmap point property map. An overload is provided with `get(boost::vertex_point,triangle_mesh)` as default.
|
||||
*
|
||||
* @return minimum and maximum raw SDF values if @a postprocess is `true`, otherwise minimum and maximum SDF values (before linear normalization)
|
||||
*/
|
||||
template <class Polyhedron, class SDFPropertyMap, class PointPropertyMap
|
||||
template <class TriangleMesh, class SDFPropertyMap, class PointPropertyMap
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
= typename boost::property_map<Polyhedron, boost::vertex_point_t>::type
|
||||
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type
|
||||
#endif
|
||||
, class GeomTraits
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
|
|
@ -91,7 +91,7 @@ template <class Polyhedron, class SDFPropertyMap, class PointPropertyMap
|
|||
#endif
|
||||
>
|
||||
std::pair<double, double>
|
||||
sdf_values( const Polyhedron& polyhedron,
|
||||
sdf_values( const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -99,8 +99,8 @@ sdf_values( const Polyhedron& polyhedron,
|
|||
PointPropertyMap ppmap = PointPropertyMap(),
|
||||
GeomTraits traits = GeomTraits())
|
||||
{
|
||||
return sdf_values<true, Polyhedron, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
return sdf_values<true, TriangleMesh, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -117,24 +117,24 @@ sdf_values( const Polyhedron& polyhedron,
|
|||
*
|
||||
* See the section \ref Surface_mesh_segmentationPostprocessing for more details.
|
||||
*
|
||||
* @pre @a polyhedron.is_pure_triangle()
|
||||
* @pre @a triangle_mesh.is_pure_triangle()
|
||||
* @pre Raw values should be greater or equal to 0. -1 indicates when no value could be computed
|
||||
*
|
||||
* @tparam Polyhedron a model of `FaceListGraph`
|
||||
* @tparam SDFPropertyMap a `ReadWritePropertyMap` with `boost::graph_traits<Polyhedron>::%face_descriptor` as key and `double` as value type
|
||||
* @tparam TriangleMesh a model of `FaceListGraph`
|
||||
* @tparam SDFPropertyMap a `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::%face_descriptor` as key and `double` as value type
|
||||
*
|
||||
* @param polyhedron surface mesh on which SDF values are computed
|
||||
* @param triangle_mesh surface mesh on which SDF values are computed
|
||||
* @param[in, out] sdf_values_map the SDF value of each facet
|
||||
*
|
||||
* @return minimum and maximum SDF values before linear normalization
|
||||
*/
|
||||
template<class Polyhedron, class SDFPropertyMap>
|
||||
template<class TriangleMesh, class SDFPropertyMap>
|
||||
std::pair<double, double>
|
||||
sdf_values_postprocessing(const Polyhedron& polyhedron,
|
||||
sdf_values_postprocessing(const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map)
|
||||
{
|
||||
CGAL_precondition(polyhedron.is_pure_triangle());
|
||||
return internal::Postprocess_sdf_values<Polyhedron>().postprocess(polyhedron,
|
||||
CGAL_precondition(triangle_mesh.is_pure_triangle());
|
||||
return internal::Postprocess_sdf_values<TriangleMesh>().postprocess(triangle_mesh,
|
||||
sdf_values_map);
|
||||
}
|
||||
|
||||
|
|
@ -155,30 +155,30 @@ sdf_values_postprocessing(const Polyhedron& polyhedron,
|
|||
* \note There is no direct relation between the parameter `number_of_clusters`
|
||||
* and the final number of segments after segmentation. However, setting a large number of clusters will result in a detailed segmentation of the mesh with a large number of segments.
|
||||
*
|
||||
* @pre @a polyhedron.is_pure_triangle()
|
||||
* @pre @a triangle_mesh.is_pure_triangle()
|
||||
* @pre @a number_of_clusters > 0
|
||||
*
|
||||
* @tparam Polyhedron a model of `FaceListGraph`
|
||||
* @tparam SDFPropertyMap a `ReadablePropertyMap` with `boost::graph_traits<Polyhedron>::%face_descriptor` as key and `double` as value type
|
||||
* @tparam SegmentPropertyMap a `ReadWritePropertyMap` with `boost::graph_traits<Polyhedron>::%face_descriptor` as key and `std::size_t` as value type
|
||||
* @tparam TriangleMesh a model of `FaceListGraph`
|
||||
* @tparam SDFPropertyMap a `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::%face_descriptor` as key and `double` as value type
|
||||
* @tparam SegmentPropertyMap a `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::%face_descriptor` as key and `std::size_t` as value type
|
||||
* @tparam GeomTraits a model of `SegmentationGeomTraits`
|
||||
* @tparam PointPropertyMap a `ReadablePropertyMap` with `boost::graph_traits<Polyhedron>::%vertex_descriptor` as key and `GeomTraits::Point_3` as value type.
|
||||
* @tparam PointPropertyMap a `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::%vertex_descriptor` as key and `GeomTraits::Point_3` as value type.
|
||||
*
|
||||
* @param polyhedron surface mesh corresponding to the SDF values
|
||||
* @param triangle_mesh surface mesh corresponding to the SDF values
|
||||
* @param sdf_values_map the SDF value of each facet between [0-1]
|
||||
* @param[out] segment_ids the segment or cluster id of each facet
|
||||
* @param number_of_clusters number of clusters for the soft clustering
|
||||
* @param smoothing_lambda factor which indicates the importance of the surface features for the energy minimization. It is recommended to choose a value in the interval [0,1]. See the section \ref Surface_mesh_segmentationGraphCut for more details.
|
||||
* @param output_cluster_ids if `false` fill `segment_ids` with segment-ids, and with cluster-ids otherwise (see \cgalFigureRef{Cluster_vs_segment})
|
||||
* @param traits traits class
|
||||
* @param ppmap point property map. An overload is provided with `get(boost::vertex_point,polyhedron)` as default.
|
||||
* @param ppmap point property map. An overload is provided with `get(boost::vertex_point,triangle_mesh)` as default.
|
||||
*
|
||||
* @return number of segments if `output_cluster_ids` is set to `false` and `number_of_clusters` otherwise
|
||||
*/
|
||||
template <class Polyhedron, class SDFPropertyMap, class SegmentPropertyMap,
|
||||
template <class TriangleMesh, class SDFPropertyMap, class SegmentPropertyMap,
|
||||
class PointPropertyMap
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
= typename boost::property_map<Polyhedron, boost::vertex_point_t>::type
|
||||
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type
|
||||
#endif
|
||||
, class GeomTraits
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
|
|
@ -186,7 +186,7 @@ template <class Polyhedron, class SDFPropertyMap, class SegmentPropertyMap,
|
|||
#endif
|
||||
>
|
||||
std::size_t
|
||||
segmentation_from_sdf_values( const Polyhedron& polyhedron,
|
||||
segmentation_from_sdf_values( const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
SegmentPropertyMap segment_ids,
|
||||
std::size_t number_of_clusters = 5,
|
||||
|
|
@ -195,17 +195,17 @@ segmentation_from_sdf_values( const Polyhedron& polyhedron,
|
|||
PointPropertyMap ppmap=PointPropertyMap(),
|
||||
GeomTraits traits=GeomTraits())
|
||||
{
|
||||
typedef typename boost::property_map<Polyhedron, boost::vertex_point_t>::type VPMap;
|
||||
internal::Surface_mesh_segmentation<Polyhedron, GeomTraits, VPMap> algorithm(polyhedron, traits, ppmap);
|
||||
typedef typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type VPMap;
|
||||
internal::Surface_mesh_segmentation<TriangleMesh, GeomTraits, VPMap> algorithm(triangle_mesh, traits, ppmap);
|
||||
return algorithm.partition(number_of_clusters, smoothing_lambda, sdf_values_map,
|
||||
segment_ids, !output_cluster_ids);
|
||||
}
|
||||
|
||||
///\cond SKIP_IN_MANUAL
|
||||
template < bool Fast_sdf_calculation_mode, class Polyhedron,
|
||||
template < bool Fast_sdf_calculation_mode, class TriangleMesh,
|
||||
class SegmentPropertyMap, class PointPropertyMap
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
= typename boost::property_map<Polyhedron, boost::vertex_point_t>::type
|
||||
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type
|
||||
#endif
|
||||
, class GeomTraits
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
|
|
@ -213,7 +213,7 @@ template < bool Fast_sdf_calculation_mode, class Polyhedron,
|
|||
#endif
|
||||
>
|
||||
std::size_t
|
||||
segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
||||
segmentation_via_sdf_values(const TriangleMesh& triangle_mesh,
|
||||
SegmentPropertyMap segment_ids,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -223,17 +223,17 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
PointPropertyMap ppmap=PointPropertyMap(),
|
||||
GeomTraits traits=GeomTraits() )
|
||||
{
|
||||
typedef typename boost::graph_traits<Polyhedron>::face_descriptor face_descriptor;
|
||||
typedef typename boost::graph_traits<TriangleMesh>::face_descriptor face_descriptor;
|
||||
typedef std::map<face_descriptor, double>
|
||||
Facet_double_map;
|
||||
Facet_double_map internal_sdf_map;
|
||||
boost::associative_property_map<Facet_double_map> sdf_property_map(
|
||||
internal_sdf_map);
|
||||
|
||||
sdf_values<Fast_sdf_calculation_mode, Polyhedron, boost::associative_property_map<Facet_double_map>, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_property_map, cone_angle, number_of_rays, true, ppmap, traits);
|
||||
return segmentation_from_sdf_values<Polyhedron, boost::associative_property_map<Facet_double_map>, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_property_map, segment_ids, number_of_clusters,
|
||||
sdf_values<Fast_sdf_calculation_mode, TriangleMesh, boost::associative_property_map<Facet_double_map>, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_property_map, cone_angle, number_of_rays, true, ppmap, traits);
|
||||
return segmentation_from_sdf_values<TriangleMesh, boost::associative_property_map<Facet_double_map>, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_property_map, segment_ids, number_of_clusters,
|
||||
smoothing_lambda, output_cluster_ids, ppmap, traits);
|
||||
}
|
||||
/// \endcond
|
||||
|
|
@ -252,15 +252,15 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
* it is more efficient to first compute the SDF values using `CGAL::sdf_values()` and use them in different calls to
|
||||
* `CGAL::segmentation_from_sdf_values()`.
|
||||
*
|
||||
* @pre @a polyhedron.is_pure_triangle()
|
||||
* @pre @a triangle_mesh.is_pure_triangle()
|
||||
* @pre @a number_of_clusters > 0
|
||||
*
|
||||
* @tparam Polyhedron a model of `FaceListGraph`
|
||||
* @tparam SegmentPropertyMap a `ReadWritePropertyMap` with `boost::graph_traits<Polyhedron>::%face_descriptor` as key and `std::size_t` as value type
|
||||
* @tparam TriangleMesh a model of `FaceListGraph`
|
||||
* @tparam SegmentPropertyMap a `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::%face_descriptor` as key and `std::size_t` as value type
|
||||
* @tparam GeomTraits a model of `SegmentationGeomTraits`
|
||||
* @tparam PointPropertyMap a `ReadablePropertyMap` with `boost::graph_traits<Polyhedron>::%vertex_descriptor` as key and `GeomTraits::Point_3` as value type.
|
||||
* @tparam PointPropertyMap a `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::%vertex_descriptor` as key and `GeomTraits::Point_3` as value type.
|
||||
*
|
||||
* @param polyhedron surface mesh on which SDF values are computed
|
||||
* @param triangle_mesh surface mesh on which SDF values are computed
|
||||
* @param[out] segment_ids the segment or cluster id of each facet
|
||||
* @param cone_angle opening angle in radians for the cone of each facet
|
||||
* @param number_of_rays number of rays picked in the cone of each facet. In our experiments, we observe that increasing the number of rays beyond the default has a little effect on the quality of the segmentation result
|
||||
|
|
@ -268,13 +268,13 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
* @param smoothing_lambda factor which indicates the importance of the surface features for the energy minimization. It is recommended to choose a value in the interval [0,1]. See the section \ref Surface_mesh_segmentationGraphCut for more details.
|
||||
* @param output_cluster_ids if `false` fill `segment_ids` with segment-ids, and with cluster-ids otherwise (see \cgalFigureRef{Cluster_vs_segment})
|
||||
* @param traits traits class
|
||||
* @param ppmap point property map. An overload is provided with `get(boost::vertex_point,polyhedron)` as default.
|
||||
* @param ppmap point property map. An overload is provided with `get(boost::vertex_point,triangle_mesh)` as default.
|
||||
*
|
||||
* @return number of segments if `output_cluster_ids` is set to `false` and `number_of_clusters` otherwise
|
||||
*/
|
||||
template < class Polyhedron, class SegmentPropertyMap, class PointPropertyMap
|
||||
template < class TriangleMesh, class SegmentPropertyMap, class PointPropertyMap
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
= typename boost::property_map<Polyhedron, boost::vertex_point_t>::type
|
||||
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type
|
||||
#endif
|
||||
, class GeomTraits
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
|
|
@ -282,7 +282,7 @@ template < class Polyhedron, class SegmentPropertyMap, class PointPropertyMap
|
|||
#endif
|
||||
>
|
||||
std::size_t
|
||||
segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
||||
segmentation_via_sdf_values(const TriangleMesh& triangle_mesh,
|
||||
SegmentPropertyMap segment_ids,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -292,8 +292,8 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
PointPropertyMap ppmap=PointPropertyMap(),
|
||||
GeomTraits traits=GeomTraits())
|
||||
{
|
||||
return segmentation_via_sdf_values<true, Polyhedron, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
return segmentation_via_sdf_values<true, TriangleMesh, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
smoothing_lambda, output_cluster_ids, ppmap, traits);
|
||||
}
|
||||
|
||||
|
|
@ -301,9 +301,9 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
// we need these overloads for the default of the point property map
|
||||
|
||||
/// sdf_values ///
|
||||
template < bool Fast_sdf_calculation_mode, class Polyhedron, class SDFPropertyMap, class PointPropertyMap>
|
||||
template < bool Fast_sdf_calculation_mode, class TriangleMesh, class SDFPropertyMap, class PointPropertyMap>
|
||||
std::pair<double, double>
|
||||
sdf_values( const Polyhedron& polyhedron,
|
||||
sdf_values( const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -313,30 +313,30 @@ sdf_values( const Polyhedron& polyhedron,
|
|||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return sdf_values<Fast_sdf_calculation_mode, Polyhedron, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
return sdf_values<Fast_sdf_calculation_mode, TriangleMesh, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
}
|
||||
|
||||
template < bool Fast_sdf_calculation_mode, class Polyhedron, class SDFPropertyMap>
|
||||
template < bool Fast_sdf_calculation_mode, class TriangleMesh, class SDFPropertyMap>
|
||||
std::pair<double, double>
|
||||
sdf_values( const Polyhedron& polyhedron,
|
||||
sdf_values( const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
bool postprocess = true)
|
||||
{
|
||||
typedef typename boost::property_map<Polyhedron, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<Polyhedron&>(polyhedron));
|
||||
typedef typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<TriangleMesh&>(triangle_mesh));
|
||||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return sdf_values<Fast_sdf_calculation_mode, Polyhedron, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
return sdf_values<Fast_sdf_calculation_mode, TriangleMesh, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
}
|
||||
|
||||
template < class Polyhedron, class SDFPropertyMap, class PointPropertyMap>
|
||||
template < class TriangleMesh, class SDFPropertyMap, class PointPropertyMap>
|
||||
std::pair<double, double>
|
||||
sdf_values( const Polyhedron& polyhedron,
|
||||
sdf_values( const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -346,31 +346,31 @@ sdf_values( const Polyhedron& polyhedron,
|
|||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return sdf_values<true, Polyhedron, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
return sdf_values<true, TriangleMesh, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
}
|
||||
|
||||
template < class Polyhedron, class SDFPropertyMap>
|
||||
template < class TriangleMesh, class SDFPropertyMap>
|
||||
std::pair<double, double>
|
||||
sdf_values( const Polyhedron& polyhedron,
|
||||
sdf_values( const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
bool postprocess = true)
|
||||
{
|
||||
typedef typename boost::property_map<Polyhedron, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<Polyhedron&>(polyhedron));
|
||||
typedef typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<TriangleMesh&>(triangle_mesh));
|
||||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return sdf_values<true, Polyhedron, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
return sdf_values<true, TriangleMesh, SDFPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_values_map, cone_angle, number_of_rays, postprocess, ppmap, traits);
|
||||
}
|
||||
|
||||
/// segmentation_from_sdf_values ///
|
||||
template <class Polyhedron, class SDFPropertyMap, class SegmentPropertyMap, class PointPropertyMap>
|
||||
template <class TriangleMesh, class SDFPropertyMap, class SegmentPropertyMap, class PointPropertyMap>
|
||||
std::size_t
|
||||
segmentation_from_sdf_values(const Polyhedron& polyhedron,
|
||||
segmentation_from_sdf_values(const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
SegmentPropertyMap segment_ids,
|
||||
std::size_t number_of_clusters = 5,
|
||||
|
|
@ -381,34 +381,34 @@ segmentation_from_sdf_values(const Polyhedron& polyhedron,
|
|||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return segmentation_from_sdf_values<Polyhedron, SDFPropertyMap, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_values_map, segment_ids, number_of_clusters, smoothing_lambda,
|
||||
return segmentation_from_sdf_values<TriangleMesh, SDFPropertyMap, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_values_map, segment_ids, number_of_clusters, smoothing_lambda,
|
||||
output_cluster_ids, ppmap, traits);
|
||||
}
|
||||
|
||||
template <class Polyhedron, class SDFPropertyMap, class SegmentPropertyMap>
|
||||
template <class TriangleMesh, class SDFPropertyMap, class SegmentPropertyMap>
|
||||
std::size_t
|
||||
segmentation_from_sdf_values(const Polyhedron& polyhedron,
|
||||
segmentation_from_sdf_values(const TriangleMesh& triangle_mesh,
|
||||
SDFPropertyMap sdf_values_map,
|
||||
SegmentPropertyMap segment_ids,
|
||||
std::size_t number_of_clusters = 5,
|
||||
double smoothing_lambda = 0.26,
|
||||
bool output_cluster_ids = false)
|
||||
{
|
||||
typedef typename boost::property_map<Polyhedron, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<Polyhedron&>(polyhedron));
|
||||
typedef typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<TriangleMesh&>(triangle_mesh));
|
||||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return segmentation_from_sdf_values<Polyhedron, SDFPropertyMap, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, sdf_values_map, segment_ids, number_of_clusters, smoothing_lambda,
|
||||
return segmentation_from_sdf_values<TriangleMesh, SDFPropertyMap, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, sdf_values_map, segment_ids, number_of_clusters, smoothing_lambda,
|
||||
output_cluster_ids, ppmap, traits);
|
||||
}
|
||||
|
||||
/// segmentation_via_sdf_values ///
|
||||
template <bool Fast_sdf_calculation_mode, class Polyhedron, class SegmentPropertyMap, class PointPropertyMap>
|
||||
template <bool Fast_sdf_calculation_mode, class TriangleMesh, class SegmentPropertyMap, class PointPropertyMap>
|
||||
std::size_t
|
||||
segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
||||
segmentation_via_sdf_values(const TriangleMesh& triangle_mesh,
|
||||
SegmentPropertyMap segment_ids,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -420,14 +420,14 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return segmentation_via_sdf_values<Fast_sdf_calculation_mode, Polyhedron, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
return segmentation_via_sdf_values<Fast_sdf_calculation_mode, TriangleMesh, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
smoothing_lambda, output_cluster_ids, ppmap, traits);
|
||||
}
|
||||
|
||||
template <bool Fast_sdf_calculation_mode, class Polyhedron, class SegmentPropertyMap>
|
||||
template <bool Fast_sdf_calculation_mode, class TriangleMesh, class SegmentPropertyMap>
|
||||
std::size_t
|
||||
segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
||||
segmentation_via_sdf_values(const TriangleMesh& triangle_mesh,
|
||||
SegmentPropertyMap segment_ids,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -435,19 +435,19 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
double smoothing_lambda = 0.26,
|
||||
bool output_cluster_ids = false)
|
||||
{
|
||||
typedef typename boost::property_map<Polyhedron, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<Polyhedron&>(polyhedron));
|
||||
typedef typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<TriangleMesh&>(triangle_mesh));
|
||||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return segmentation_via_sdf_values<Fast_sdf_calculation_mode, Polyhedron, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
return segmentation_via_sdf_values<Fast_sdf_calculation_mode, TriangleMesh, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
smoothing_lambda, output_cluster_ids, ppmap, traits);
|
||||
}
|
||||
|
||||
template <class Polyhedron, class SegmentPropertyMap, class PointPropertyMap>
|
||||
template <class TriangleMesh, class SegmentPropertyMap, class PointPropertyMap>
|
||||
std::size_t
|
||||
segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
||||
segmentation_via_sdf_values(const TriangleMesh& triangle_mesh,
|
||||
SegmentPropertyMap segment_ids,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -459,14 +459,14 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return segmentation_via_sdf_values<true, Polyhedron, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
return segmentation_via_sdf_values<true, TriangleMesh, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
smoothing_lambda, output_cluster_ids, ppmap, traits);
|
||||
}
|
||||
|
||||
template <class Polyhedron, class SegmentPropertyMap>
|
||||
template <class TriangleMesh, class SegmentPropertyMap>
|
||||
std::size_t
|
||||
segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
||||
segmentation_via_sdf_values(const TriangleMesh& triangle_mesh,
|
||||
SegmentPropertyMap segment_ids,
|
||||
double cone_angle = 2.0 / 3.0 * CGAL_PI,
|
||||
std::size_t number_of_rays = 25,
|
||||
|
|
@ -474,13 +474,13 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron,
|
|||
double smoothing_lambda = 0.26,
|
||||
bool output_cluster_ids = false)
|
||||
{
|
||||
typedef typename boost::property_map<Polyhedron, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<Polyhedron&>(polyhedron));
|
||||
typedef typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type PointPropertyMap;
|
||||
PointPropertyMap ppmap = get(boost::vertex_point, const_cast<TriangleMesh&>(triangle_mesh));
|
||||
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||
typedef typename Kernel_traits<Point_3>::Kernel GeomTraits;
|
||||
GeomTraits traits;
|
||||
return segmentation_via_sdf_values<true, Polyhedron, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
return segmentation_via_sdf_values<true, TriangleMesh, SegmentPropertyMap, PointPropertyMap, GeomTraits>
|
||||
(triangle_mesh, segment_ids, cone_angle, number_of_rays, number_of_clusters,
|
||||
smoothing_lambda, output_cluster_ids, ppmap, traits);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue