mirror of https://github.com/CGAL/cgal
Massive addition of enable/disable_ifs
This commit is contained in:
parent
00ffbe2caf
commit
ba86b13ac9
|
|
@ -116,7 +116,13 @@ bool read_OFF(const std::string& fname, FaceGraph& g, const CGAL_BGL_NP_CLASS& n
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FaceGraph>
|
template <typename FaceGraph>
|
||||||
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<FaceGraph>::type
|
||||||
|
>::type* =0)
|
||||||
|
{
|
||||||
|
return read_OFF(is, g, parameters::all_default());
|
||||||
|
}
|
||||||
template <typename FaceGraph>
|
template <typename FaceGraph>
|
||||||
bool read_OFF(const char* fname, FaceGraph& g) { return read_OFF(fname, g, parameters::all_default()); }
|
bool read_OFF(const char* fname, FaceGraph& g) { return read_OFF(fname, g, parameters::all_default()); }
|
||||||
template <typename FaceGraph>
|
template <typename FaceGraph>
|
||||||
|
|
@ -178,7 +184,13 @@ bool write_OFF(const std::string& fname, const FaceGraph& g, const CGAL_BGL_NP_C
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FaceGraph>
|
template <typename FaceGraph>
|
||||||
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<FaceGraph>::type
|
||||||
|
>::type* =0)
|
||||||
|
{
|
||||||
|
return write_OFF(os, g, parameters::all_default());
|
||||||
|
}
|
||||||
template <typename FaceGraph>
|
template <typename FaceGraph>
|
||||||
bool write_OFF(const char* fname, const FaceGraph& g) { return write_OFF(fname, g, parameters::all_default()); }
|
bool write_OFF(const char* fname, const FaceGraph& g) { return write_OFF(fname, g, parameters::all_default()); }
|
||||||
template <typename FaceGraph>
|
template <typename FaceGraph>
|
||||||
|
|
|
||||||
|
|
@ -810,7 +810,7 @@ write_LAS(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool okay
|
bool okay
|
||||||
= write_LAS
|
= write_LAS_with_properties
|
||||||
(stream, point_set,
|
(stream, point_set,
|
||||||
make_las_point_writer (point_set.point_map()),
|
make_las_point_writer (point_set.point_map()),
|
||||||
std::make_pair (intensity, LAS_property::Intensity()),
|
std::make_pair (intensity, LAS_property::Intensity()),
|
||||||
|
|
@ -929,7 +929,7 @@ std::istream& operator>>(std::istream& is,
|
||||||
CGAL::read_PLY (is, ps);
|
CGAL::read_PLY (is, ps);
|
||||||
#ifdef CGAL_LINKED_WITH_LASLIB
|
#ifdef CGAL_LINKED_WITH_LASLIB
|
||||||
else if (line.find("LASF") == 0)
|
else if (line.find("LASF") == 0)
|
||||||
CGAL::read_las_point_set (is, ps);
|
CGAL::read_las_points(is, ps);
|
||||||
#endif // LAS
|
#endif // LAS
|
||||||
else
|
else
|
||||||
CGAL::read_XYZ (is, ps);
|
CGAL::read_XYZ (is, ps);
|
||||||
|
|
@ -1048,7 +1048,7 @@ write_las_point_set(
|
||||||
std::ostream& stream, ///< output stream.
|
std::ostream& stream, ///< output stream.
|
||||||
CGAL::Point_set_3<Point, Vector>& point_set) ///< point set
|
CGAL::Point_set_3<Point, Vector>& point_set) ///< point set
|
||||||
{
|
{
|
||||||
return write_LAS(stram, point_set);
|
return write_LAS(stream, point_set);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||||
#include <CGAL/boost/graph/named_params_helper.h>
|
#include <CGAL/boost/graph/named_params_helper.h>
|
||||||
|
#include <CGAL/is_iterator.h>
|
||||||
|
|
||||||
#include <boost/version.hpp>
|
#include <boost/version.hpp>
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
|
|
@ -499,7 +500,10 @@ template <typename OutputIterator>
|
||||||
bool
|
bool
|
||||||
read_LAS(
|
read_LAS(
|
||||||
std::istream& stream, ///< input stream.
|
std::istream& stream, ///< input stream.
|
||||||
OutputIterator output)
|
OutputIterator output,
|
||||||
|
typename boost::enable_if<
|
||||||
|
typename CGAL::is_iterator<OutputIterator>
|
||||||
|
>::type* =0)
|
||||||
{
|
{
|
||||||
return read_LAS<typename value_type_traits<OutputIterator>::type>
|
return read_LAS<typename value_type_traits<OutputIterator>::type>
|
||||||
(stream, output, CGAL::parameters::all_default());
|
(stream, output, CGAL::parameters::all_default());
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,13 @@
|
||||||
#include <CGAL/Origin.h>
|
#include <CGAL/Origin.h>
|
||||||
#include <CGAL/point_set_processing_assertions.h>
|
#include <CGAL/point_set_processing_assertions.h>
|
||||||
#include <CGAL/Kernel_traits.h>
|
#include <CGAL/Kernel_traits.h>
|
||||||
|
#include <CGAL/iterator.h>
|
||||||
|
|
||||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||||
#include <CGAL/boost/graph/named_params_helper.h>
|
#include <CGAL/boost/graph/named_params_helper.h>
|
||||||
|
|
||||||
|
#include <boost/utility/enable_if.hpp>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
@ -201,7 +204,10 @@ bool
|
||||||
read_OFF(
|
read_OFF(
|
||||||
std::istream& stream, ///< input stream.
|
std::istream& stream, ///< input stream.
|
||||||
OutputIterator output,
|
OutputIterator output,
|
||||||
const CGAL_BGL_NP_CLASS& np)
|
const CGAL_BGL_NP_CLASS& np,
|
||||||
|
typename boost::enable_if<
|
||||||
|
CGAL::is_iterator<OutputIterator>
|
||||||
|
>::type* =0)
|
||||||
{
|
{
|
||||||
return read_OFF<typename value_type_traits<OutputIterator>::type>
|
return read_OFF<typename value_type_traits<OutputIterator>::type>
|
||||||
(stream, output, np);
|
(stream, output, np);
|
||||||
|
|
@ -211,8 +217,11 @@ read_OFF(
|
||||||
template <typename OutputIterator>
|
template <typename OutputIterator>
|
||||||
bool
|
bool
|
||||||
read_OFF(
|
read_OFF(
|
||||||
std::istream& stream, ///< input stream.
|
std::istream& stream, ///< input stream.
|
||||||
OutputIterator output)
|
OutputIterator output,
|
||||||
|
typename std::enable_if<
|
||||||
|
CGAL::is_iterator<OutputIterator>::value
|
||||||
|
>::type* =0)
|
||||||
{
|
{
|
||||||
return read_OFF<typename value_type_traits<OutputIterator>::type>
|
return read_OFF<typename value_type_traits<OutputIterator>::type>
|
||||||
(stream, output, CGAL::parameters::all_default());
|
(stream, output, CGAL::parameters::all_default());
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,10 @@ template <typename OutputIterator>
|
||||||
bool
|
bool
|
||||||
read_XYZ(
|
read_XYZ(
|
||||||
std::istream& stream, ///< input stream.
|
std::istream& stream, ///< input stream.
|
||||||
OutputIterator output)
|
OutputIterator output,
|
||||||
|
typename boost::enable_if<
|
||||||
|
CGAL::is_iterator<OutputIterator>
|
||||||
|
>::type* =0)
|
||||||
{
|
{
|
||||||
return read_XYZ<typename value_type_traits<OutputIterator>::type>
|
return read_XYZ<typename value_type_traits<OutputIterator>::type>
|
||||||
(stream, output, CGAL::parameters::all_default());
|
(stream, output, CGAL::parameters::all_default());
|
||||||
|
|
|
||||||
|
|
@ -109,17 +109,21 @@ write_OFF(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \cond SKIP_IN_MANUAL
|
/// \cond SKIP_IN_MANUAL
|
||||||
|
namespace internal{
|
||||||
|
BOOST_MPL_HAS_XXX_TRAIT_DEF(Point_set)
|
||||||
|
}
|
||||||
// variant with default NP
|
// variant with default NP
|
||||||
template <typename PointRange>
|
template <typename PointRange>
|
||||||
bool
|
bool
|
||||||
write_OFF(
|
write_OFF(
|
||||||
std::ostream& stream, ///< output stream.
|
std::ostream& stream, ///< output stream.
|
||||||
const PointRange& points
|
const PointRange& points
|
||||||
#ifndef DOXYGEN_RUNNING
|
|
||||||
,typename boost::enable_if<
|
,typename boost::enable_if<
|
||||||
typename boost::has_range_const_iterator<PointRange>::type
|
typename boost::has_range_const_iterator<PointRange>::type
|
||||||
|
>::type* =0,
|
||||||
|
typename std::enable_if<
|
||||||
|
!internal::has_Point_set<PointRange>::value
|
||||||
>::type* =0
|
>::type* =0
|
||||||
#endif
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return write_OFF
|
return write_OFF
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ Polyhedron_demo_off_plugin::load_off(QFileInfo fileinfo) {
|
||||||
Scene_points_with_normal_item* item = new Scene_points_with_normal_item();
|
Scene_points_with_normal_item* item = new Scene_points_with_normal_item();
|
||||||
item->setName(fileinfo.completeBaseName());
|
item->setName(fileinfo.completeBaseName());
|
||||||
if (scanner.size_of_vertices()==0) return item;
|
if (scanner.size_of_vertices()==0) return item;
|
||||||
if(!item->read_OFF(in))
|
if(!item->read_off_point_set(in))
|
||||||
{
|
{
|
||||||
delete item;
|
delete item;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -627,7 +627,7 @@ bool Scene_points_with_normal_item::write_ply_point_set(std::ostream& stream, bo
|
||||||
if (binary)
|
if (binary)
|
||||||
CGAL::set_binary_mode (stream);
|
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;
|
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();
|
d->m_points->reset_indices();
|
||||||
|
|
||||||
return stream &&
|
return stream &&
|
||||||
CGAL::write_xyz_point_set (stream, *(d->m_points));
|
CGAL::write_XYZ (stream, *(d->m_points));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||||
#include <CGAL/property_map.h>
|
#include <CGAL/property_map.h>
|
||||||
|
#include <CGAL/iterator.h>
|
||||||
|
|
||||||
#include <boost/utility/enable_if.hpp>
|
#include <boost/utility/enable_if.hpp>
|
||||||
|
|
||||||
|
|
@ -237,7 +238,13 @@ bool
|
||||||
read_PLY(std::istream& is,
|
read_PLY(std::istream& is,
|
||||||
PointRange& points,
|
PointRange& points,
|
||||||
PolygonRange& polygons,
|
PolygonRange& polygons,
|
||||||
bool /* verbose */ = false)
|
bool /* verbose */ = false
|
||||||
|
#ifndef DOXYGEN_RUNNING
|
||||||
|
,typename std::enable_if<
|
||||||
|
boost::has_value_type<PointRange>::value
|
||||||
|
>::type* =0
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
typedef typename PointRange::value_type Point_3;
|
typedef typename PointRange::value_type Point_3;
|
||||||
if(!is.good())
|
if(!is.good())
|
||||||
|
|
@ -337,6 +344,7 @@ bool read_PLY(std::istream& is,
|
||||||
std::back_inserter(dummy_pf));
|
std::back_inserter(dummy_pf));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
/// Write
|
/// Write
|
||||||
|
|
@ -360,6 +368,9 @@ bool write_PLY(std::ostream& out,
|
||||||
#ifndef DOXYGEN_RUNNING
|
#ifndef DOXYGEN_RUNNING
|
||||||
,typename boost::enable_if<
|
,typename boost::enable_if<
|
||||||
typename boost::has_range_const_iterator<PointRange>::type
|
typename boost::has_range_const_iterator<PointRange>::type
|
||||||
|
>::type* =0,
|
||||||
|
typename std::enable_if<
|
||||||
|
boost::has_value_type<PointRange>::value
|
||||||
>::type* =0
|
>::type* =0
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue