fix the default vertex point map used

This commit is contained in:
Sébastien Loriot 2016-10-03 10:26:07 +02:00
parent aa5dffa48d
commit a195583c9d
2 changed files with 7 additions and 8 deletions

View File

@ -465,19 +465,18 @@ typedef const Point_3& reference;
/*!
Creates an input iterator `g` generating points of type `Point_3` uniformly
distributed in the mesh faces. Each triangle has a probability to be chosen to hold the point depending on its area.
*/
Random_points_in_triangle_mesh_3(const TriangleMesh& mesh, Random& rnd = get_default_random() );
/*!
Creates an input iterator `g` generating points of type `Point_3` uniformly
distributed in the mesh faces based on `vpm`. Each triangle has a probability to be chosen to hold the point depending on its area.
*/
Random_points_in_triangle_mesh_3(const TriangleMesh& mesh, VertexPointMap vpm, Random& rnd = get_default_random() );
/*!
Similar to the previous constructor using `get(vertex_point, mesh)` as vertex point map.
*/
Random_points_in_triangle_mesh_3(const TriangleMesh& mesh, Random& rnd = get_default_random() );
/// @}
}; /* end Random_points_in_triangle_mesh_3 */

View File

@ -334,7 +334,7 @@ struct Random_points_in_triangle_mesh_3
Random_points_in_triangle_mesh_3( const TriangleMesh& mesh,Random& rnd = get_default_random())
: Base( faces(mesh),
CGAL::Property_map_to_unary_function<Pmap>(&mesh),
CGAL::Property_map_to_unary_function<Pmap>(Pmap(&mesh, get(vertex_point, mesh))),
internal::Apply_approx_sqrt<typename Kernel_traits<P>::Kernel::Compute_squared_area_3>(),
rnd )
{