Bugfix: update structuring test with new API

This commit is contained in:
Simon Giraudot 2017-08-02 13:44:33 +02:00
parent 421cb91e75
commit 7de200fffa
1 changed files with 13 additions and 3 deletions

View File

@ -23,7 +23,7 @@ typedef CGAL::Shape_detection_3::Shape_detection_traits
<Kernel, Pwn_vector, Point_map, Normal_map> Traits;
typedef CGAL::Shape_detection_3::Efficient_RANSAC<Traits> Efficient_ransac;
typedef CGAL::Point_set_with_structure<Traits> Points_with_structure;
typedef CGAL::Point_set_with_structure<Kernel> Points_with_structure;
template <typename OutputIterator>
void generate_random_points (const Point& origin, const Vector& base1, const Vector& base2,
@ -79,14 +79,24 @@ int main()
ransac.set_input(points);
ransac.detect(op);
Efficient_ransac::Plane_range planes = ransac.planes();
Points_with_structure pss (points, Point_map(), Normal_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
op.cluster_epsilon);
Points_with_structure pss (points.begin(), points.end(), ransac, op.cluster_epsilon);
std::vector<Point> vertices;
for (std::size_t i = 0; i < pss.size(); ++ i)
if (pss.adjacency (i).size () == 3)
{
std::vector<Plane> planes;
pss.adjacency (i, std::back_inserter (planes));
if (planes.size () == 3)
vertices.push_back (pss.point (i));
}
if (vertices.size () != 8)
{