diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp index ba80cb353c5..7a1481020c4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp @@ -9,6 +9,10 @@ #include #include + +#include +#include + #include "Color_map.h" #include @@ -56,7 +60,9 @@ CGAL::Three::Scene_item* Surf_io_plugin::load(QFileInfo fileinfo) std::vector patches; std::vector material_data; - read_surf(in, patches, material_data); + CGAL::Bbox_3 grid_box; + CGAL::cpp11::array grid_size; + read_surf(in, patches, material_data, grid_box, grid_size); for(std::size_t i=0; i> xmin >> xmax >> ymin >> ymax >> zmin >> zmax; + grid_box = CGAL::Bbox_3(xmin, xmax, ymin, ymax, zmin, zmax); + break; + } + } + + //get grid size + while (std::getline(input, line)) + { + line.erase(0, line.find_first_not_of(" \t")); + if (line.compare(0, 8, "GridSize") != 0) + continue; + else + { + iss.clear(); + line.erase(0, 8); + iss.str(line); + iss >> grid_size[0] >> grid_size[1] >> grid_size[2]; + break; + } + } + //get number of vertices while(std::getline(input, line)) { @@ -100,7 +140,7 @@ void read_surf(std::istream& input, std::vector& output, std::vector> x >> y >> z; + iss >> CGAL::iformat(x) >> CGAL::iformat(y) >> CGAL::iformat(z); points.push_back(Point_3(x,y,z)); } std::cout<& output, std::vector -void read_surf(std::istream& input, std::vector& output, std::vector& metadata) +void read_surf(std::istream& input, std::vector& output, + std::vector& metadata, + CGAL::Bbox_3& grid_box, + CGAL::cpp11::array grid_size) { - read_surf(input, output, metadata, CGAL::Polygon_mesh_processing::parameters::all_default()); + read_surf(input, output, metadata, grid_box, grid_size, + CGAL::Polygon_mesh_processing::parameters::all_default()); }