Update read_test with new ply function

This commit is contained in:
Simon Giraudot 2015-10-06 15:16:16 +02:00
parent ac3dbad721
commit 6b4da62cab
2 changed files with 13 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/read_off_points.h>
#include <CGAL/IO/read_ply_points.h>
#include <CGAL/IO/read_xyz_points.h>
#include <vector>
@ -47,6 +48,17 @@ bool read_off(std::string s,
CGAL::Second_of_pair_property_map<PointVectorPair>());
}
bool read_ply (std::string s,
std::vector<PointVectorPair>& pv_pairs)
{
std::ifstream fs(s.c_str());
return CGAL::read_ply_points_and_normals (fs,
back_inserter(pv_pairs),
CGAL::First_of_pair_property_map<PointVectorPair>(),
CGAL::Second_of_pair_property_map<PointVectorPair>());
}
int main()
{
@ -78,6 +90,7 @@ int main()
assert(pv_pairs[2] == std::make_pair(Point_3(4,5,6), Vector_3(0,0,0)));
assert(pv_pairs[3] == std::make_pair(Point_3(7,8,9), Vector_3(0,0,0)));
assert(read_ply("data/read_test/simple.ply", pv_pairs));
return 0;
}