diff --git a/BGL/include/CGAL/boost/graph/IO/GOCAD.h b/BGL/include/CGAL/boost/graph/IO/GOCAD.h index d8483eec223..ef97f74105d 100644 --- a/BGL/include/CGAL/boost/graph/IO/GOCAD.h +++ b/BGL/include/CGAL/boost/graph/IO/GOCAD.h @@ -153,16 +153,15 @@ template bool read_GOCAD(const char* fname, FaceGraph& g, const CGAL_BGL_NP_CLASS& np, bool verbose = true) { std::ifstream in(fname); - std::string unused_name; - std::string unused_color; + std::pair dummy; - return read_GOCAD(in, unused_name, unused_color, g, np, verbose); + return read_GOCAD(in, dummy, g, np, verbose); } template -bool read_GOCAD(const std::string& fname, FaceGraph& g, CGAL_BGL_NP_CLASS np) +bool read_GOCAD(const std::string& fname, FaceGraph& g, CGAL_BGL_NP_CLASS np, bool verbose = true) { - return read_GOCAD(fname.c_str(), g, np); + return read_GOCAD(fname.c_str(), g, np, verbose); } template diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h index 888f158d933..b6b4eadbde7 100644 --- a/BGL/include/CGAL/boost/graph/IO/PLY.h +++ b/BGL/include/CGAL/boost/graph/IO/PLY.h @@ -163,7 +163,7 @@ template bool read_PLY(const std::string& fname, FaceGraph& g, const CGAL_BGL_NP_CLASS& np, bool verbose = true) { - return IO::internal::read_PLY_BGL(fname.c_str(), g, np, verbose); + return IO::internal::read_PLY(fname.c_str(), g, np, verbose); } diff --git a/BGL/include/CGAL/boost/graph/io.h b/BGL/include/CGAL/boost/graph/io.h index 23c5f3fbc06..1bd51ebee2d 100644 --- a/BGL/include/CGAL/boost/graph/io.h +++ b/BGL/include/CGAL/boost/graph/io.h @@ -99,8 +99,8 @@ bool read_polygon_mesh(const std::string& fname, return read_VTP(fname, g, np); } - std::istream is(fname.c_str()); - return read_polygon_mesh(is, g, np, false); + std::ifstream is(fname.c_str()); + return read_polygon_mesh(is, g, np); } template diff --git a/BGL/test/BGL/test_bgl_read_write.cpp b/BGL/test/BGL/test_bgl_read_write.cpp index 24bc852e1cb..d7c83d45efa 100644 --- a/BGL/test/BGL/test_bgl_read_write.cpp +++ b/BGL/test/BGL/test_bgl_read_write.cpp @@ -73,9 +73,10 @@ void fill_soup(PointRange& points, PolygonRange& polygons) template void test_bgl_OFF(const char* filename) { - Mesh sm; + Mesh sm, sm2; std::ifstream in(filename); CGAL::read_polygon_mesh(in,sm); + CGAL::read_polygon_mesh(filename, sm2); CGAL::write_OFF(std::cout, sm); } @@ -104,6 +105,12 @@ void test_bgl_OFF_with_np() .vertex_texture_map(vtm) .face_color_map(fcm)); CGAL_assertion(ok); + fg.clear(); + ok = CGAL::read_polygon_mesh("data/full.off", fg, CGAL::parameters::vertex_normal_map(vnm) + .vertex_color_map(vcm) + .vertex_texture_map(vtm) + .face_color_map(fcm)); + CGAL_assertion(ok); ok = CGAL::write_OFF(std::cout, fg, CGAL::parameters::vertex_normal_map(vnm) .vertex_color_map(vcm) @@ -134,6 +141,11 @@ bool test_bgl_OBJ() CGAL::read_polygon_mesh(in, fg); CGAL_assertion(num_vertices(fg) == 4); CGAL_assertion(num_faces(fg) == 4); + fg.clear(); + CGAL::read_polygon_mesh("data/sphere.obj", fg); + CGAL_assertion(num_vertices(fg) == 162); + CGAL_assertion(num_faces(fg) == 320); + return true; } @@ -203,7 +215,7 @@ bool test_bgl_vtp(bool binary = false) } os.close(); Mesh fg2; - if(!CGAL::read_VTP("tetrahedron.vtp", fg2)) + if(!CGAL::read_polygon_mesh("tetrahedron.vtp", fg2)) { std::cerr<<"vtp reading failed."<(bool binary) } os.close(); Polyhedron fg2; - if(!CGAL::read_VTP("tetrahedron.vtp", fg2)) + if(!CGAL::read_polygon_mesh("tetrahedron.vtp", fg2)) { std::cerr<<"vtp reading failed."< +template bool read_GOCAD(std::istream& input, std::pair& name_and_color, PointRange& points, PolygonRange& polygons, - const NamedParameters&, + const CGAL_BGL_NP_CLASS&, bool verbose = true) { CGAL_USE(verbose); @@ -105,33 +105,33 @@ bool read_GOCAD(std::istream& input, return !input.fail(); } -template +template bool read_GOCAD(std::istream& is, PointRange& points, PolygonRange& polygons, - const NamedParameters&np) + const CGAL_BGL_NP_CLASS&np) { std::pair dummy; return read_GOCAD(is, dummy, points, polygons, np); } -template +template bool read_GOCAD(const char* fname, PointRange& points, PolygonRange& polygons, - const NamedParameters& np) + const CGAL_BGL_NP_CLASS& np) { std::ifstream in(fname); std::pair dummy; return read_GOCAD(in, dummy, points, polygons, np); } -template +template bool read_GOCAD(const std::string& fname, PointRange& points, PolygonRange& polygons, - const NamedParameters& np) + const CGAL_BGL_NP_CLASS& np) { return read_GOCAD(fname.c_str(), points, polygons, np); } diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Properties.h b/Surface_mesh/include/CGAL/Surface_mesh/Properties.h index d4c416bc2e7..108744ccf64 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Properties.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Properties.h @@ -136,7 +136,7 @@ public: // virtual interface of Base_property_array if(pa != nullptr){ std::copy((*pa).data_.begin(), (*pa).data_.end(), data_.end()-(*pa).data_.size()); return true; - } + } return false; } @@ -221,7 +221,7 @@ private: template class Property_container; -/// @endcond +/// @endcond @@ -291,7 +291,7 @@ public: parrays_.back()->resize(size_); } } - + // Transfer one element with all properties // WARNING: properties must be the same in the two containers bool transfer(const Property_container& _rhs, std::size_t from, std::size_t to) @@ -326,7 +326,7 @@ public: typedef typename Ref_class::template Get_property_map::type type; }; - template + template std::pair::type, bool> get(const std::string& name, std::size_t i) const { @@ -365,7 +365,7 @@ public: // get a property by its name. returns invalid property if it does not exist. - template + template std::pair::type, bool> get(const std::string& name) const { @@ -394,7 +394,7 @@ public: // get the type of property by its name. returns typeid(void) if it does not exist. - const std::type_info& + const std::type_info& get_type(const std::string& name) const { for (std::size_t i=0; i + template bool remove(typename Get_pmap_type::type& h) { @@ -487,7 +487,7 @@ public: this->parrays_.swap (other.parrays_); std::swap(this->size_, other.size_); } - + private: std::vector parrays_; size_t size_; @@ -497,11 +497,11 @@ private: /// @endcond #ifndef DOXYGEN_RUNNING -/// /// -/// `Property_map` enables to attach properties to the simplices of a +/// +/// `Property_map` enables to attach properties to the simplices of a /// surface mesh. -/// +/// /// @tparam Key The key type of the property map. It must be a model of `Index`. /// @tparam Value The value type of the property. /// @@ -510,7 +510,7 @@ private: template class Property_map_base /// @cond CGAL_DOCUMENT_INTERNALS - : public boost::put_get_helper< + : public boost::put_get_helper< typename Property_array::reference, CRTP_derived_class> /// @endcond @@ -528,7 +528,7 @@ public: typedef typename Property_array::const_reference const_reference; typedef typename Property_array::iterator iterator; typedef typename Property_array::const_iterator const_iterator; -#else +#else /// A reference to the value type of the property. typedef unspecified_type reference; @@ -549,14 +549,14 @@ public: { parray_ = nullptr; } - /// @endcond + /// @endcond public: /// \name Accessing Properties //@{ #ifdef DOXYGEN_RUNNING /// Conversion to a Boolean. It is \c true when the property map - /// can be used, and \c false otherwise. + /// can be used, and \c false otherwise. operator bool () const; #else operator bool_type() const {