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 83530ad83d2..fb0e635758a 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 @@ -42,11 +42,8 @@ namespace CGAL { -namespace LAS -{ - /// \cond SKIP_IN_MANUAL - namespace Property + namespace LAS_property { struct X { typedef double type; }; @@ -79,7 +76,7 @@ namespace LAS Generates a %LAS property handler to read 3D points. Points are constructed from the input the using 3 %LAS properties - `LAS::Property::X`, `LAS::Property::Y` and `LAS::Property::Z`. + `LAS_property::X`, `LAS_property::Y` and `LAS_property::Z`. \sa `read_las_points_with_properties()` @@ -88,58 +85,60 @@ namespace LAS template cpp11::tuple::Kernel::Construct_point_3, - Property::X, Property::Y, Property::Z > - make_point_reader(PointMap point_map) + LAS_property::X, LAS_property::Y, LAS_property::Z > + make_las_point_reader(PointMap point_map) { return cpp11::make_tuple (point_map, typename Kernel_traits::Kernel::Construct_point_3(), - Property::X(), Property::Y(), Property::Z()); + LAS_property::X(), LAS_property::Y(), LAS_property::Z()); } /// \cond SKIP_IN_MANUAL namespace internal { - void get_value(const LASpoint& r, double& v, LAS::Property::X&) + namespace LAS { + + void get_value(const LASpoint& r, double& v, LAS_property::X&) { v = r.get_x(); } - void get_value(const LASpoint& r, double& v, LAS::Property::Y&) + void get_value(const LASpoint& r, double& v, LAS_property::Y&) { v = r.get_y(); } - void get_value(const LASpoint& r, double& v, LAS::Property::Z&) + void get_value(const LASpoint& r, double& v, LAS_property::Z&) { v = r.get_z(); } - void get_value(const LASpoint& r, unsigned short& v, LAS::Property::Intensity&) + void get_value(const LASpoint& r, unsigned short& v, LAS_property::Intensity&) { v = r.get_intensity(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::Return_number&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::Return_number&) { v = r.get_return_number(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::Number_of_returns&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::Number_of_returns&) { v = r.get_number_of_returns(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::Scan_direction_flag&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::Scan_direction_flag&) { v = r.get_scan_direction_flag(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::Edge_of_flight_line&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::Edge_of_flight_line&) { v = r.get_edge_of_flight_line(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::Classification&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::Classification&) { v = r.get_classification(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::Synthetic_flag&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::Synthetic_flag&) { v = r.get_synthetic_flag(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::Keypoint_flag&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::Keypoint_flag&) { v = r.get_keypoint_flag(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::Withheld_flag&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::Withheld_flag&) { v = r.get_withheld_flag(); } - void get_value(const LASpoint& r, float& v, LAS::Property::Scan_angle&) + void get_value(const LASpoint& r, float& v, LAS_property::Scan_angle&) { v = r.get_scan_angle(); } - void get_value(const LASpoint& r, unsigned char& v, LAS::Property::User_data&) + void get_value(const LASpoint& r, unsigned char& v, LAS_property::User_data&) { v = r.get_user_data(); } - void get_value(const LASpoint& r, unsigned short& v, LAS::Property::Point_source_ID&) + void get_value(const LASpoint& r, unsigned short& v, LAS_property::Point_source_ID&) { v = r.get_point_source_ID(); } - void get_value(const LASpoint& r, unsigned int& v, LAS::Property::Deleted_flag&) + void get_value(const LASpoint& r, unsigned int& v, LAS_property::Deleted_flag&) { v = r.get_deleted_flag(); } - void get_value(const LASpoint& r, double& v, LAS::Property::GPS_time&) + void get_value(const LASpoint& r, double& v, LAS_property::GPS_time&) { v = r.get_gps_time(); } - void get_value(const LASpoint& r, unsigned short& v, LAS::Property::R&) + void get_value(const LASpoint& r, unsigned short& v, LAS_property::R&) { v = r.get_R(); } - void get_value(const LASpoint& r, unsigned short& v, LAS::Property::G&) + void get_value(const LASpoint& r, unsigned short& v, LAS_property::G&) { v = r.get_G(); } - void get_value(const LASpoint& r, unsigned short& v, LAS::Property::B&) + void get_value(const LASpoint& r, unsigned short& v, LAS_property::B&) { v = r.get_B(); } - void get_value(const LASpoint& r, unsigned short& v, LAS::Property::I&) + void get_value(const LASpoint& r, unsigned short& v, LAS_property::I&) { v = r.get_I(); } @@ -253,13 +252,14 @@ namespace internal { put (current.first, new_element, new_value); process_properties (reader, new_element, next, properties...); } + + } // namespace LAS } // namespace internal /// \endcond -} //=================================================================================== /// \ingroup PkgPointSetProcessing @@ -270,45 +270,45 @@ namespace internal { /// Properties are handled through a variadic list of property /// handlers. A `PropertyHandler` can either be: /// -/// - A `std::pair` if the user wants to -/// read a %LAS property as a scalar value `LAS::Property::Tag::type` (for +/// - A `std::pair` if the user wants to +/// read a %LAS property as a scalar value `LAS_property::Tag::type` (for /// example, storing an `int` %LAS property into an `int` variable). /// /// - A `CGAL::cpp11::tuple` if the user wants to use one or several +/// LAS_property::Tag...>` if the user wants to use one or several /// %LAS properties to construct a complex object (for example, /// storing 4 `unsigned short` %LAS properties into a %Color object /// that can for example be a `CGAL::cpp11::array`). In that case, the second element of the tuple should be a /// functor that constructs the value type of `PropertyMap` from N -/// objects of of type `LAS::Property::Tag::type`. +/// objects of of type `LAS_property::Tag::type`. /// /// The %LAS standard defines a fixed set of properties accessible /// through the following tag classes: /// -/// - `LAS::Property::X` with type `double` -/// - `LAS::Property::Y` with type `double` -/// - `LAS::Property::Z` with type `double` -/// - `LAS::Property::Intensity` with type `unsigned short` -/// - `LAS::Property::Return_number` with type `unsigned char` -/// - `LAS::Property::Number_of_returns` with type `unsigned char` -/// - `LAS::Property::Scan_direction_flag` with type `unsigned char` -/// - `LAS::Property::Edge_of_flight_line` with type `unsigned char` -/// - `LAS::Property::Classification` with type `unsigned char` -/// - `LAS::Property::Synthetic_flag` with type `unsigned char` -/// - `LAS::Property::Keypoint_flag` with type `unsigned char` -/// - `LAS::Property::Withheld_flag` with type `unsigned char` -/// - `LAS::Property::Scan_angle` with type `double` -/// - `LAS::Property::User_data` with type `unsigned char` -/// - `LAS::Property::Point_source_ID` with type `unsigned short` -/// - `LAS::Property::Deleted_flag` with type `unsigned int` -/// - `LAS::Property::GPS_time` with type `double` -/// - `LAS::Property::R` with type `unsigned short` -/// - `LAS::Property::G` with type `unsigned short` -/// - `LAS::Property::B` with type `unsigned short` -/// - `LAS::Property::I` with type `unsigned short` +/// - `LAS_property::X` with type `double` +/// - `LAS_property::Y` with type `double` +/// - `LAS_property::Z` with type `double` +/// - `LAS_property::Intensity` with type `unsigned short` +/// - `LAS_property::Return_number` with type `unsigned char` +/// - `LAS_property::Number_of_returns` with type `unsigned char` +/// - `LAS_property::Scan_direction_flag` with type `unsigned char` +/// - `LAS_property::Edge_of_flight_line` with type `unsigned char` +/// - `LAS_property::Classification` with type `unsigned char` +/// - `LAS_property::Synthetic_flag` with type `unsigned char` +/// - `LAS_property::Keypoint_flag` with type `unsigned char` +/// - `LAS_property::Withheld_flag` with type `unsigned char` +/// - `LAS_property::Scan_angle` with type `double` +/// - `LAS_property::User_data` with type `unsigned char` +/// - `LAS_property::Point_source_ID` with type `unsigned short` +/// - `LAS_property::Deleted_flag` with type `unsigned int` +/// - `LAS_property::GPS_time` with type `double` +/// - `LAS_property::R` with type `unsigned short` +/// - `LAS_property::G` with type `unsigned short` +/// - `LAS_property::B` with type `unsigned short` +/// - `LAS_property::I` with type `unsigned short` /// -/// @sa `LAS::make_point_reader()` +/// @sa `make_las_point_reader()` /// /// @tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. /// It is default to `value_type_traits::%type` and can be omitted when the default is fine. @@ -336,7 +336,7 @@ bool read_las_points_with_properties (std::istream& stream, const LASpoint& laspoint = lasreader.point; Enriched_point new_point; - LAS::internal::process_properties (laspoint, new_point, properties...); + internal::LAS::process_properties (laspoint, new_point, properties...); *(output ++) = new_point; } @@ -385,7 +385,7 @@ bool read_las_points(std::istream& stream, ///< input stream. PointPMap point_pmap) ///< property map: value_type of OutputIterator -> Point_3. { return read_las_points_with_properties (stream, output, - LAS::make_point_reader(point_pmap)); + make_las_point_reader(point_pmap)); } /// @cond SKIP_IN_MANUAL diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index a592651f880..c8058f447f1 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -51,8 +51,6 @@ namespace CGAL { // float single-precision float 4 // double double-precision float 8 -namespace PLY -{ /** \ingroup PkgPointSetProcessing @@ -61,11 +59,11 @@ namespace PLY \sa `read_ply_points_with_properties()` */ template - struct Property + struct PLY_property { typedef T type; const char* name; - Property (const char* name) : name (name) { } + PLY_property (const char* name) : name (name) { } }; /** @@ -82,11 +80,11 @@ namespace PLY template cpp11::tuple::Kernel::Construct_point_3, - Property, Property, Property > - make_point_reader(PointMap point_map) + PLY_property, PLY_property, PLY_property > + make_ply_point_reader(PointMap point_map) { return cpp11::make_tuple (point_map, typename Kernel_traits::Kernel::Construct_point_3(), - Property("x"), Property("y"), Property("z")); + PLY_property("x"), PLY_property("y"), PLY_property("z")); } /** @@ -103,17 +101,19 @@ namespace PLY template cpp11::tuple::Kernel::Construct_vector_3, - Property, Property, Property > - make_normal_reader(VectorMap normal_map) + PLY_property, PLY_property, PLY_property > + make_ply_normal_reader(VectorMap normal_map) { return cpp11::make_tuple (normal_map, typename Kernel_traits::Kernel::Construct_vector_3(), - Property("nx"), Property("ny"), Property("nz")); + PLY_property("nx"), PLY_property("ny"), PLY_property("nz")); } /// \cond SKIP_IN_MANUAL namespace internal { + namespace PLY { + class PLY_read_number { protected: @@ -417,7 +417,7 @@ namespace internal { }; template - void get_value(Reader& r, T& v, PLY::Property& wrapper) + void get_value(Reader& r, T& v, PLY_property& wrapper) { return r.assign(v, wrapper.name); } @@ -471,7 +471,7 @@ namespace internal { typename Constructor, typename ... T> void process_properties (PLY_reader& reader, OutputValueType& new_element, - cpp11::tuple...>& current) + cpp11::tuple...>& current) { typedef typename PropertyMap::value_type PmapValueType; cpp11::tuple values; @@ -487,7 +487,7 @@ namespace internal { typename NextPropertyBinder, typename ... PropertyMapBinders> void process_properties (PLY_reader& reader, OutputValueType& new_element, - cpp11::tuple...>& current, + cpp11::tuple...>& current, NextPropertyBinder& next, PropertyMapBinders&& ... properties) { @@ -503,7 +503,7 @@ namespace internal { template void process_properties (PLY_reader& reader, OutputValueType& new_element, - std::pair >& current) + std::pair >& current) { T new_value = T(); reader.assign (new_value, current.second.name); @@ -513,7 +513,7 @@ namespace internal { template void process_properties (PLY_reader& reader, OutputValueType& new_element, - std::pair >& current, + std::pair >& current, NextPropertyBinder& next, PropertyMapBinders&& ... properties) { @@ -522,13 +522,13 @@ namespace internal { put (current.first, new_element, new_value); process_properties (reader, new_element, next, properties...); } + + } // namespace PLY } // namespace internal /// \endcond - -}; //=================================================================================== @@ -541,20 +541,20 @@ namespace internal { /// Properties are handled through a variadic list of property /// handlers. A `PropertyHandler` can either be: /// -/// - A `std::pair >` if the user wants +/// - A `std::pair >` if the user wants /// to read a %PLY property as a scalar value T (for example, storing /// an `int` %PLY property into an `int` variable). /// /// - A `CGAL::cpp11::tuple...>` if the user wants to use one or several PLY +/// PLY_property...>` if the user wants to use one or several PLY /// properties to construct a complex object (for example, storing 3 /// `uchar` %PLY properties into a %Color object that can for example /// be a `CGAL::cpp11::array`). In that case, the /// second element of the tuple should be a functor that constructs /// the value type of `PropertyMap` from N objects of types `T`. /// -/// @sa `PLY::make_point_reader()` -/// @sa `PLY::make_normal_reader()` +/// @sa `make_ply_point_reader()` +/// @sa `make_ply_normal_reader()` /// /// @tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. /// It is default to `value_type_traits::%type` and can be omitted when the default is fine. @@ -580,7 +580,7 @@ bool read_ply_points_with_properties (std::istream& stream, return false; } - PLY::internal::PLY_reader reader; + internal::PLY::PLY_reader reader; if (!(reader.init (stream))) return false; @@ -594,7 +594,7 @@ bool read_ply_points_with_properties (std::istream& stream, OutputValueType new_element; - PLY::internal::process_properties (reader, new_element, properties...); + internal::PLY::process_properties (reader, new_element, properties...); *(output ++) = new_element; @@ -646,8 +646,8 @@ bool read_ply_points_and_normals(std::istream& stream, ///< input stream. { return read_ply_points_with_properties (stream, output, - PLY::make_point_reader (point_pmap), - PLY::make_normal_reader (normal_pmap)); + make_ply_point_reader (point_pmap), + make_ply_normal_reader (normal_pmap)); } /// @cond SKIP_IN_MANUAL @@ -726,7 +726,7 @@ bool read_ply_points(std::istream& stream, ///< input stream. PointPMap point_pmap) ///< property map: value_type of OutputIterator -> Point_3. { return read_ply_points_with_properties (stream, output, - PLY::make_point_reader (point_pmap)); + make_ply_point_reader (point_pmap)); } /// @cond SKIP_IN_MANUAL diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index b1ac401bb50..1c06faabe51 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -42,9 +42,6 @@ namespace CGAL { -namespace LAS -{ - /** \ingroup PkgPointSetProcessing @@ -56,7 +53,7 @@ namespace LAS */ template cpp11::tuple - make_point_writer(PointMap point_map) + make_las_point_writer(PointMap point_map) { return cpp11::make_tuple (point_map, Property::X(), Property::Y(), Property::Z()); } @@ -65,41 +62,43 @@ namespace LAS namespace internal { - void output_value(LASpoint& r, unsigned short& v, LAS::Property::Intensity&) + namespace LAS { + + void output_value(LASpoint& r, unsigned short& v, LAS_property::Intensity&) { r.set_intensity(v); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::Return_number&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::Return_number&) { r.set_return_number(v); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::Number_of_returns&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::Number_of_returns&) { r.set_number_of_returns(v); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::Scan_direction_flag&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::Scan_direction_flag&) { r.set_scan_direction_flag(v); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::Edge_of_flight_line&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::Edge_of_flight_line&) { r.set_edge_of_flight_line(v); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::Classification&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::Classification&) { r.set_classification(v); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::Synthetic_flag&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::Synthetic_flag&) { r.set_synthetic_flag(v); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::Keypoint_flag&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::Keypoint_flag&) { r.set_keypoint_flag(v); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::Withheld_flag&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::Withheld_flag&) { r.set_withheld_flag(v); } - void output_value(LASpoint& r, float& v, LAS::Property::Scan_angle&) + void output_value(LASpoint& r, float& v, LAS_property::Scan_angle&) { r.set_scan_angle_rank(char(v)); } - void output_value(LASpoint& r, unsigned char& v, LAS::Property::User_data&) + void output_value(LASpoint& r, unsigned char& v, LAS_property::User_data&) { r.set_user_data(v); } - void output_value(LASpoint& r, unsigned short& v, LAS::Property::Point_source_ID&) + void output_value(LASpoint& r, unsigned short& v, LAS_property::Point_source_ID&) { r.set_point_source_ID(v); } - void output_value(LASpoint& r, unsigned int& v, LAS::Property::Deleted_flag&) + void output_value(LASpoint& r, unsigned int& v, LAS_property::Deleted_flag&) { r.set_deleted_flag(v); } - void output_value(LASpoint& r, double& v, LAS::Property::GPS_time&) + void output_value(LASpoint& r, double& v, LAS_property::GPS_time&) { r.set_gps_time(v); } - void output_value(LASpoint& r, unsigned short& v, LAS::Property::R&) + void output_value(LASpoint& r, unsigned short& v, LAS_property::R&) { r.set_R(v); } - void output_value(LASpoint& r, unsigned short& v, LAS::Property::G&) + void output_value(LASpoint& r, unsigned short& v, LAS_property::G&) { r.set_G(v); } - void output_value(LASpoint& r, unsigned short& v, LAS::Property::B&) + void output_value(LASpoint& r, unsigned short& v, LAS_property::B&) { r.set_B(v); } - void output_value(LASpoint& r, unsigned short& v, LAS::Property::I&) + void output_value(LASpoint& r, unsigned short& v, LAS_property::I&) { r.set_I(v); } template @@ -133,13 +132,13 @@ namespace internal { output_properties (point, it, next, properties...); } + } // namespace LAS } // namespace internal /// \endcond -} //=================================================================================== /// \ingroup PkgPointSetProcessing @@ -148,15 +147,15 @@ namespace internal { /// /// Properties are handled through a variadic list of property /// handlers. A `PropertyHandle` is a `std::pair` used to write a scalar value -/// `LAS::Property::Tag::type` as a %LAS property (for example, +/// LAS_property::Tag >` used to write a scalar value +/// `LAS_property::Tag::type` as a %LAS property (for example, /// writing an `int` vairable as an `int` %LAS property). An exception /// is used for points that are written using a `cpp11::tuple` object. /// /// See documentation of `read_las_points_with_properties()` for the -/// list of available `LAS::Property::Tag` classes. +/// list of available `LAS_property::Tag` classes. /// -/// @sa `LAS::make_point_writer()` +/// @sa `make_las_point_writer()` /// /// @tparam ForwardIterator iterator over input points. /// @tparam PointMap is a model of `ReadablePropertyMap` with a value_type = `CGAL::Point_3`. @@ -170,9 +169,9 @@ bool write_las_points_with_properties (std::ostream& stream, ///< output stream ForwardIterator first, ///< iterator over the first input point. ForwardIterator beyond, ///< past-the-end iterator over the input points. cpp11::tuple point_property, ///< property handler for points + LAS_property::X, + LAS_property::Y, + LAS_property::Z> point_property, ///< property handler for points PropertyHandler&& ... properties) ///< parameter pack of property handlers { CGAL_point_set_processing_precondition(first != beyond); @@ -210,7 +209,7 @@ bool write_las_points_with_properties (std::ostream& stream, ///< output stream laspoint.set_X ((unsigned int)((p.x() - header.x_offset) / header.x_scale_factor)); laspoint.set_Y ((unsigned int)((p.y() - header.y_offset) / header.y_scale_factor)); laspoint.set_Z ((unsigned int)((p.z() - header.z_offset) / header.z_scale_factor)); - LAS::internal::output_properties (laspoint, it, properties...); + internal::LAS::output_properties (laspoint, it, properties...); laswriter.write_point (&laspoint); laswriter.update_inventory(&laspoint); @@ -244,7 +243,7 @@ write_las_points( ForwardIterator beyond, ///< past-the-end input point. PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. { - return write_las_points_with_properties (stream, first, beyond, LAS::make_point_writer(point_map)); + return write_las_points_with_properties (stream, first, beyond, make_las_point_writer(point_map)); } /// @cond SKIP_IN_MANUAL diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index eb7b189781a..e6580e3c731 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -34,8 +34,6 @@ namespace CGAL { -namespace PLY { - /** \ingroup PkgPointSetProcessing @@ -48,10 +46,10 @@ namespace PLY { \tparam PointMap the property map used to store points. */ template - cpp11::tuple, Property, Property > - make_point_writer(PointMap point_map) + cpp11::tuple, PLY_property, PLY_property > + make_ply_point_writer(PointMap point_map) { - return cpp11::make_tuple (point_map, Property("x"), Property("y"), Property("z")); + return cpp11::make_tuple (point_map, PLY_property("x"), PLY_property("y"), PLY_property("z")); } /** @@ -66,16 +64,18 @@ namespace PLY { \tparam VectorMap the property map used to store vectors. */ template - cpp11::tuple, Property, Property > - make_normal_writer(VectorMap normal_map) + cpp11::tuple, PLY_property, PLY_property > + make_ply_normal_writer(VectorMap normal_map) { - return cpp11::make_tuple (normal_map, Property("nx"), Property("ny"), Property("nz")); + return cpp11::make_tuple (normal_map, PLY_property("nx"), PLY_property("ny"), PLY_property("nz")); } /// \cond SKIP_IN_MANUAL namespace internal { + namespace PLY { + template void property_header_type (std::ostream& stream) { stream << "undefined_type"; } template <> void property_header_type (std::ostream& stream) { stream << "char"; } @@ -90,7 +90,7 @@ namespace internal { template - void property_header (std::ostream& stream, const PLY::Property& prop) + void property_header (std::ostream& stream, const PLY_property& prop) { stream << "property "; property_header_type(stream); @@ -121,7 +121,7 @@ namespace internal { template void output_property_header (std::ostream& stream, - cpp11::tuple... >& current) + cpp11::tuple... >& current) { Properties_header::write(stream, current); } @@ -130,7 +130,7 @@ namespace internal { template void output_property_header (std::ostream& stream, - std::pair >& current) + std::pair >& current) { property_header (stream, current.second); } @@ -140,7 +140,7 @@ namespace internal { typename NextPropertyHandler, typename ... PropertyHandler> void output_property_header (std::ostream& stream, - std::pair >& current, + std::pair >& current, NextPropertyHandler& next, PropertyHandler&& ... properties) { @@ -152,7 +152,7 @@ namespace internal { typename NextPropertyHandler, typename ... PropertyHandler> void output_property_header (std::ostream& stream, - cpp11::tuple... >& current, + cpp11::tuple... >& current, NextPropertyHandler& next, PropertyHandler&& ... properties) { @@ -186,7 +186,7 @@ namespace internal { typename ... T> void output_properties (std::ostream& stream, ForwardIterator it, - cpp11::tuple... >& current) + cpp11::tuple... >& current) { property_write (stream, it, std::get<0>(current)); if (get_mode(stream) == IO::ASCII) @@ -199,7 +199,7 @@ namespace internal { typename T> void output_properties (std::ostream& stream, ForwardIterator it, - std::pair >& current) + std::pair >& current) { simple_property_write (stream, it, current.first); if (get_mode(stream) == IO::ASCII) @@ -213,7 +213,7 @@ namespace internal { typename ... PropertyHandler> void output_properties (std::ostream& stream, ForwardIterator it, - std::pair >& current, + std::pair >& current, NextPropertyHandler& next, PropertyHandler&& ... properties) { @@ -230,7 +230,7 @@ namespace internal { typename ... PropertyHandler> void output_properties (std::ostream& stream, ForwardIterator it, - cpp11::tuple... >& current, + cpp11::tuple... >& current, NextPropertyHandler& next, PropertyHandler&& ... properties) { @@ -239,11 +239,12 @@ namespace internal { stream << " "; output_properties (stream, it, next, properties...); } -} + + } // namespace PLY + +} // namespace internal /// \endcond -} - //=================================================================================== @@ -255,19 +256,19 @@ namespace internal { /// Properties are handled through a variadic list of property /// handlers. A `PropertyHandler` can either be: /// -/// - A `std::pair >` if the user wants +/// - A `std::pair >` if the user wants /// to write a scalar value T as a %PLY property (for example, writing /// an `int` variable as an `int` %PLY property). /// -/// - A `CGAL::cpp11::tuple...>` if the +/// - A `CGAL::cpp11::tuple...>` if the /// user wants to write a complex object as several %PLY /// properties. In that case, and overload of the stream operator /// `std::operator<<()` must be provided for /// `PropertyMap::value_type` that handles both ASCII and binary /// output (see `CGAL::get_mode()`). /// -/// @sa `PLY::make_point_writer()` -/// @sa `PLY::make_normal_writer()` +/// @sa `make_ply_point_writer()` +/// @sa `make_ply_normal_writer()` /// /// @tparam ForwardIterator iterator over input points. /// @tparam PropertyHandler handlers to recover properties. @@ -296,7 +297,7 @@ write_ply_points_with_properties( << "comment Generated by the CGAL library" << std::endl << "element vertex " << std::distance (first, beyond) << std::endl; - PLY::internal::output_property_header (stream, properties...); + internal::PLY::output_property_header (stream, properties...); stream << "end_header" << std::endl; @@ -304,7 +305,7 @@ write_ply_points_with_properties( // Write positions + normals for(ForwardIterator it = first; it != beyond; it++) { - PLY::internal::output_properties (stream, it, properties...); + internal::PLY::output_properties (stream, it, properties...); } return ! stream.fail(); @@ -341,8 +342,8 @@ write_ply_points_and_normals( return write_ply_points_with_properties( stream, first, beyond, - PLY::make_point_writer(point_map), - PLY::make_normal_writer(normal_map)); + make_ply_point_writer(point_map), + make_ply_normal_writer(normal_map)); } /// @cond SKIP_IN_MANUAL @@ -389,7 +390,7 @@ write_ply_points( ForwardIterator beyond, ///< past-the-end input point. PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. { - return write_ply_points_with_properties (stream, first, beyond, PLY::make_point_writer(point_map)); + return write_ply_points_with_properties (stream, first, beyond, make_ply_point_writer(point_map)); } /// @cond SKIP_IN_MANUAL