mirror of https://github.com/CGAL/cgal
Add overload without traits and clean-up test.
This commit is contained in:
parent
91c704b7ca
commit
58bc2faeff
|
|
@ -1031,11 +1031,29 @@ extreme_vertices(const InputRange& range,
|
||||||
OutputIterator out,
|
OutputIterator out,
|
||||||
const Traits& traits)
|
const Traits& traits)
|
||||||
{
|
{
|
||||||
|
|
||||||
Vertex_to_point_traits_adapter<Traits, PointPropertyMap> traits_adapter(map, traits);
|
Vertex_to_point_traits_adapter<Traits, PointPropertyMap> traits_adapter(map, traits);
|
||||||
extreme_points_3(range, out,traits_adapter);
|
extreme_points_3(range, out,traits_adapter);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class InputRange,
|
||||||
|
class PointPropertyMap,
|
||||||
|
class OutputIterator>
|
||||||
|
OutputIterator
|
||||||
|
extreme_vertices(const InputRange& range,
|
||||||
|
PointPropertyMap map,
|
||||||
|
OutputIterator out)
|
||||||
|
{
|
||||||
|
typedef typename boost::property_traits<PointPropertyMap>::value_type Point_3;
|
||||||
|
typedef typename internal::Convex_hull_3::Default_traits_for_Chull_3<Point_3>::type Traits;
|
||||||
|
|
||||||
|
Vertex_to_point_traits_adapter<Traits, PointPropertyMap> traits_adapter(map, Traits());
|
||||||
|
extreme_points_3(range, out,traits_adapter);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class InputIterator, class Polyhedron_3>
|
template <class InputIterator, class Polyhedron_3>
|
||||||
void convex_hull_3(InputIterator first, InputIterator beyond,
|
void convex_hull_3(InputIterator first, InputIterator beyond,
|
||||||
Polyhedron_3& polyhedron)
|
Polyhedron_3& polyhedron)
|
||||||
|
|
|
||||||
|
|
@ -204,22 +204,6 @@ void test_equal_points()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class InputRange,
|
|
||||||
class OutputIterator,
|
|
||||||
class VertexPointMap,
|
|
||||||
class Traits>
|
|
||||||
OutputIterator
|
|
||||||
extreme_vertices(const InputRange& range,
|
|
||||||
OutputIterator out,
|
|
||||||
VertexPointMap vpm,
|
|
||||||
const Traits& traits)
|
|
||||||
{
|
|
||||||
CGAL::Vertex_to_point_traits_adapter<Traits, VertexPointMap> traits_adapter(vpm, traits);
|
|
||||||
CGAL::extreme_points_3(range, out,traits_adapter);
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
void test_extreme_vertices(const char* fname)
|
void test_extreme_vertices(const char* fname)
|
||||||
{
|
{
|
||||||
std::ifstream input(fname);
|
std::ifstream input(fname);
|
||||||
|
|
@ -229,21 +213,19 @@ void test_extreme_vertices(const char* fname)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
std::vector<boost::graph_traits<Polyhedron_3>::vertex_descriptor> verts;
|
std::vector<boost::graph_traits<Polyhedron_3>::vertex_descriptor> verts;
|
||||||
extreme_vertices(vertices(P), std::back_inserter(verts) , get(CGAL::vertex_point, P),
|
CGAL::extreme_vertices(vertices(P), get(CGAL::vertex_point, P), std::back_inserter(verts) ,
|
||||||
CGAL::Convex_hull_traits_3<K, Polyhedron_3, CGAL::Tag_true>());
|
CGAL::Convex_hull_traits_3<K, Polyhedron_3, CGAL::Tag_true>());
|
||||||
std::cout<<verts.size()<<std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{/*
|
{
|
||||||
test_function_overload();
|
test_function_overload();
|
||||||
test_3_points();
|
test_3_points();
|
||||||
test_up_to_3_extreme_points();
|
test_up_to_3_extreme_points();
|
||||||
test_3_collinear();
|
test_3_collinear();
|
||||||
test_triangulated_cube("data/cube_meshed.off");
|
test_triangulated_cube("data/cube_meshed.off");
|
||||||
test_coplanar_points("data/coplanar_points.xyz");
|
test_coplanar_points("data/coplanar_points.xyz");
|
||||||
test_equal_points();*/
|
test_equal_points();
|
||||||
|
|
||||||
test_extreme_vertices("data/cross.off");
|
test_extreme_vertices("data/cross.off");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue