diff --git a/BGL/include/CGAL/boost/graph/IO/OFF.h b/BGL/include/CGAL/boost/graph/IO/OFF.h index 82348115a1d..a9c8c97f329 100644 --- a/BGL/include/CGAL/boost/graph/IO/OFF.h +++ b/BGL/include/CGAL/boost/graph/IO/OFF.h @@ -116,7 +116,13 @@ bool read_OFF(const std::string& fname, FaceGraph& g, const CGAL_BGL_NP_CLASS& n } template -bool read_OFF(std::istream& is, FaceGraph& g) { return read_OFF(is, g, parameters::all_default()); } +bool read_OFF(std::istream& is, FaceGraph& g, + typename boost::disable_if< + typename boost::has_range_const_iterator::type + >::type* =0) +{ + return read_OFF(is, g, parameters::all_default()); +} template bool read_OFF(const char* fname, FaceGraph& g) { return read_OFF(fname, g, parameters::all_default()); } template @@ -178,7 +184,13 @@ bool write_OFF(const std::string& fname, const FaceGraph& g, const CGAL_BGL_NP_C } template -bool write_OFF(std::ostream& os, const FaceGraph& g) { return write_OFF(os, g, parameters::all_default()); } +bool write_OFF(std::ostream& os, const FaceGraph& g + ,typename boost::disable_if< + typename boost::has_range_const_iterator::type + >::type* =0) +{ + return write_OFF(os, g, parameters::all_default()); +} template bool write_OFF(const char* fname, const FaceGraph& g) { return write_OFF(fname, g, parameters::all_default()); } template diff --git a/Point_set_3/include/CGAL/Point_set_3/IO.h b/Point_set_3/include/CGAL/Point_set_3/IO.h index d7332570cf5..6cd4719b0fe 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO.h @@ -810,7 +810,7 @@ write_LAS( } bool okay - = write_LAS + = write_LAS_with_properties (stream, point_set, make_las_point_writer (point_set.point_map()), std::make_pair (intensity, LAS_property::Intensity()), @@ -929,7 +929,7 @@ std::istream& operator>>(std::istream& is, CGAL::read_PLY (is, ps); #ifdef CGAL_LINKED_WITH_LASLIB else if (line.find("LASF") == 0) - CGAL::read_las_point_set (is, ps); + CGAL::read_las_points(is, ps); #endif // LAS else CGAL::read_XYZ (is, ps); @@ -1048,7 +1048,7 @@ write_las_point_set( std::ostream& stream, ///< output stream. CGAL::Point_set_3& point_set) ///< point set { - return write_LAS(stram, point_set); + return write_LAS(stream, point_set); } #endif /*! diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index 01dffacab50..00099e55b59 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -499,7 +500,10 @@ template bool read_LAS( std::istream& stream, ///< input stream. - OutputIterator output) + OutputIterator output, + typename boost::enable_if< + typename CGAL::is_iterator + >::type* =0) { return read_LAS::type> (stream, output, CGAL::parameters::all_default()); diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index 9c73308c218..a3999fcdbd2 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -21,10 +21,13 @@ #include #include #include +#include #include #include +#include + #include #include #include @@ -201,7 +204,10 @@ bool read_OFF( std::istream& stream, ///< input stream. OutputIterator output, - const CGAL_BGL_NP_CLASS& np) + const CGAL_BGL_NP_CLASS& np, + typename boost::enable_if< + CGAL::is_iterator + >::type* =0) { return read_OFF::type> (stream, output, np); @@ -211,8 +217,11 @@ read_OFF( template bool read_OFF( - std::istream& stream, ///< input stream. - OutputIterator output) + std::istream& stream, ///< input stream. + OutputIterator output, + typename std::enable_if< + CGAL::is_iterator::value + >::type* =0) { return read_OFF::type> (stream, output, CGAL::parameters::all_default()); diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h index 4dc7d2dcece..ea460257e80 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h @@ -204,7 +204,10 @@ template bool read_XYZ( std::istream& stream, ///< input stream. - OutputIterator output) + OutputIterator output, + typename boost::enable_if< + CGAL::is_iterator + >::type* =0) { return read_XYZ::type> (stream, output, CGAL::parameters::all_default()); diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index fdbb6326064..7a2f4881320 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -109,17 +109,21 @@ write_OFF( } /// \cond SKIP_IN_MANUAL +namespace internal{ +BOOST_MPL_HAS_XXX_TRAIT_DEF(Point_set) +} // variant with default NP template bool write_OFF( std::ostream& stream, ///< output stream. const PointRange& points - #ifndef DOXYGEN_RUNNING ,typename boost::enable_if< typename boost::has_range_const_iterator::type + >::type* =0, + typename std::enable_if< + !internal::has_Point_set::value >::type* =0 - #endif ) { return write_OFF diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp index 43102097bd6..f8b649c001e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp @@ -123,7 +123,7 @@ Polyhedron_demo_off_plugin::load_off(QFileInfo fileinfo) { Scene_points_with_normal_item* item = new Scene_points_with_normal_item(); item->setName(fileinfo.completeBaseName()); if (scanner.size_of_vertices()==0) return item; - if(!item->read_OFF(in)) + if(!item->read_off_point_set(in)) { delete item; return 0; diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp index 7a39e5e2e59..9d21e363538 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp @@ -627,7 +627,7 @@ bool Scene_points_with_normal_item::write_ply_point_set(std::ostream& stream, bo if (binary) CGAL::set_binary_mode (stream); - CGAL::write_ply_point_set (stream, *(d->m_points), d->m_comments); + CGAL::write_PLY (stream, *(d->m_points), d->m_comments); return true; } @@ -680,7 +680,7 @@ bool Scene_points_with_normal_item::write_xyz_point_set(std::ostream& stream) co d->m_points->reset_indices(); return stream && - CGAL::write_xyz_point_set (stream, *(d->m_points)); + CGAL::write_XYZ (stream, *(d->m_points)); } QString diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index 728fdd7e011..f7cf91f186b 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -17,6 +17,7 @@ #include #include +#include #include @@ -237,7 +238,13 @@ bool read_PLY(std::istream& is, PointRange& points, PolygonRange& polygons, - bool /* verbose */ = false) + bool /* verbose */ = false +#ifndef DOXYGEN_RUNNING + ,typename std::enable_if< + boost::has_value_type::value + >::type* =0 + #endif + ) { typedef typename PointRange::value_type Point_3; if(!is.good()) @@ -337,6 +344,7 @@ bool read_PLY(std::istream& is, std::back_inserter(dummy_pf)); } + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// /// Write @@ -360,6 +368,9 @@ bool write_PLY(std::ostream& out, #ifndef DOXYGEN_RUNNING ,typename boost::enable_if< typename boost::has_range_const_iterator::type + >::type* =0, + typename std::enable_if< + boost::has_value_type::value >::type* =0 #endif )