From d4ab17634e23a8ca4b6b96219056b56797c7ec2d Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Wed, 28 Sep 2016 10:49:42 +0200 Subject: [PATCH] Update reference manual --- .../doc/Point_set_3/PackageDescription.txt | 6 +- Point_set_3/doc/Point_set_3/examples.txt | 1 + Point_set_3/include/CGAL/Point_set_3.h | 79 +++++++++++++------ Point_set_3/include/CGAL/Point_set_3/IO.h | 16 ++-- .../CGAL/Point_set_3/Point_set_processing_3.h | 32 ++++---- 5 files changed, 81 insertions(+), 53 deletions(-) diff --git a/Point_set_3/doc/Point_set_3/PackageDescription.txt b/Point_set_3/doc/Point_set_3/PackageDescription.txt index 4852df0a81a..f7a0d83009c 100644 --- a/Point_set_3/doc/Point_set_3/PackageDescription.txt +++ b/Point_set_3/doc/Point_set_3/PackageDescription.txt @@ -6,7 +6,7 @@ \cgalPkgSummaryBegin \cgalPkgAuthors{Simon Giraudot} -\cgalPkgDesc{This component provides the user with a flexible 3D point set data structure. The user can easily define any additional property needed (such a normal vectors, colors, labels, etc.). All data structures needed to apply \cgal algorithms on point sets are provided.} +\cgalPkgDesc{This component provides the user with a flexible 3D point set data structure. The user can easily define any additional property needed such a normal vectors, colors or labels. All data structures needed to apply \cgal algorithms on point sets are provided.} \cgalPkgManuals{Chapter_Point_Set_3, PkgPointSet3} \cgalPkgSummaryEnd @@ -33,8 +33,8 @@ user to call point set processing algorithms without having to handle manually property maps and iterators. -The overloads all follow the same templates based on the original -point set processing functions: +The overloads all follow the same pattern based on the original point +set processing functions: - Iterators and property maps of the original function are replaced with a single parameter `CGAL::Point_set_3` diff --git a/Point_set_3/doc/Point_set_3/examples.txt b/Point_set_3/doc/Point_set_3/examples.txt index 584862621b5..269700c266a 100644 --- a/Point_set_3/doc/Point_set_3/examples.txt +++ b/Point_set_3/doc/Point_set_3/examples.txt @@ -4,4 +4,5 @@ \example Point_set_3/point_set_algo.cpp \example Point_set_3/point_set_read_xyz.cpp \example Point_set_3/point_set_read_ply.cpp +\example Point_set_3/point_set_advanced.cpp */ diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index 8ca67fa8927..071a785f8a1 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -62,22 +62,11 @@ public: typedef Point Point_type; typedef Vector Vector_type; typedef Point_set_3 Point_set; - /// \endcond - /*! - \brief This represents a point with associated properties. - \cgalModels `Index` - \cgalModels `LessThanComparable` - \cgalModels `Hashable` - */ class Index; - - /// \cond SKIP_IN_MANUAL typedef typename Properties::Property_container Base; - /// \endcond - - /// \cond SKIP_IN_MANUAL + template struct Property_map : public Properties::Property_map @@ -87,9 +76,17 @@ public: template class Push_property_map; - + /// \endcond + + /*! + \brief This represents a point with associated properties. + \cgalModels `Index` + \cgalModels `LessThanComparable` + \cgalModels `Hashable` + */ class Index { + /// \cond SKIP_IN_MANUAL friend class Point_set_3; friend class Properties::Property_container; template friend class Properties::Property_array; @@ -99,9 +96,9 @@ public: std::size_t value; // Only Point_set_3 and other friend classes are allowed to - // instanciate an Index with a specific value + // instantiate an Index with a specific value Index (const std::size_t& value) : value (value) { } - + /// \endcond public: Index (const Index& index) : value (index) { } Index () : value ((std::size_t)(-1)) { } @@ -115,8 +112,6 @@ public: Index operator++ (int) { Index tmp(*this); ++ value; return tmp; } Index operator-- (int) { Index tmp(*this); -- value; return tmp; } }; - - /// \endcond #ifdef DOXYGEN_RUNNING @@ -761,12 +756,44 @@ public: /// @} + /*! + + \ingroup PkgPointSet3 + + \brief Reads the point set from an input stream that can be either: + + - XYZ + - OFF + - PLY + + The format is detected from the stream. If the stream contains + normal vectors, the normal map is added to the point set. For PLY + input, all point properties found in the header are added. + \relates Point_set_3 + */ + template + friend std::istream& operator>>(std::istream& is, Point_set_3

& ps) + { + // Check format identifier on first line + // std::string line; + // if (!getline(stream, line)) + // return is; + // stream.seekg(0); + // if (line == "OFF" || line == "NOFF") + // CGAL::read_off_point_set (is, ps); + // else if (line == "ply") + // CGAL::read_ply_point_set (is, ps); + // else + // CGAL::read_xyz_point_set (is, ps); + + return is; + } /*! \ingroup PkgPointSet3 \brief Inserts the point set in an output stream in Ascii PLY - format. All properties are inserted in their instanciation order. + format. All properties are inserted in their instantiation order. \relates Point_set_3 */ @@ -791,21 +818,21 @@ public: os << "property double nx" << std::endl << "property double ny" << std::endl << "property double nz" << std::endl; - else if (ps.m_base.template get(prop[i]).first) + else if (ps.m_base.template get(prop[i]).second) os << "property char " << prop[i] << std::endl; - else if (ps.m_base.template get(prop[i]).first) + else if (ps.m_base.template get(prop[i]).second) os << "property uchar " << prop[i] << std::endl; - else if (ps.m_base.template get(prop[i]).first) + else if (ps.m_base.template get(prop[i]).second) os << "property short " << prop[i] << std::endl; - else if (ps.m_base.template get(prop[i]).first) + else if (ps.m_base.template get(prop[i]).second) os << "property ushort " << prop[i] << std::endl; - else if (ps.m_base.template get(prop[i]).first) + else if (ps.m_base.template get(prop[i]).second) os << "property int " << prop[i] << std::endl; - else if (ps.m_base.template get(prop[i]).first) + else if (ps.m_base.template get(prop[i]).second) os << "property uint " << prop[i] << std::endl; - else if (ps.m_base.template get(prop[i]).first) + else if (ps.m_base.template get(prop[i]).second) os << "property float " << prop[i] << std::endl; - else if (ps.m_base.template get(prop[i]).first) + else if (ps.m_base.template get(prop[i]).second) os << "property double " << prop[i] << std::endl; else os << "property " << boost::core::demangle(ps.m_base.get_type(prop[i]).name()) 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 7da0d341c41..f5bebf85107 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO.h @@ -39,7 +39,7 @@ template bool read_xyz_point_set( std::istream& stream, ///< input stream. - Point_set_3& point_set) ///< point set + CGAL::Point_set_3& point_set) ///< point set { point_set.add_normal_map(); @@ -50,7 +50,7 @@ read_xyz_point_set( point_set.normal_push_map()); bool has_normals = false; - for (typename Point_set_3::const_iterator it = point_set.begin(); + for (typename CGAL::Point_set_3::const_iterator it = point_set.begin(); it != point_set.end(); ++ it) if (point_set.normal(*it) != CGAL::NULL_VECTOR) { @@ -71,7 +71,7 @@ template bool read_off_point_set( std::istream& stream, ///< input stream. - Point_set_3& point_set) ///< point set + CGAL::Point_set_3& point_set) ///< point set { point_set.add_normal_map(); @@ -82,7 +82,7 @@ read_off_point_set( point_set.normal_push_map()); bool has_normals = false; - for (typename Point_set_3::const_iterator it = point_set.begin(); + for (typename CGAL::Point_set_3::const_iterator it = point_set.begin(); it != point_set.end(); ++ it) if (point_set.normal(*it) != CGAL::NULL_VECTOR) { @@ -105,7 +105,7 @@ template bool read_ply_point_set( std::istream& stream, ///< input stream. - Point_set_3& point_set) ///< point set + CGAL::Point_set_3& point_set) ///< point set { CGAL::Ply_interpreter_point_set_3 interpreter (point_set); @@ -121,7 +121,7 @@ template bool write_xyz_point_set( std::ostream& stream, ///< output stream. - const Point_set_3& point_set) ///< point set + const CGAL::Point_set_3& point_set) ///< point set { if (point_set.has_normal_map()) return CGAL::write_xyz_points_and_normals @@ -140,7 +140,7 @@ template bool write_off_point_set( std::ostream& stream, ///< output stream. - const Point_set_3& point_set) ///< point set + const CGAL::Point_set_3& point_set) ///< point set { if (point_set.has_normal_map()) return CGAL::write_off_points_and_normals @@ -159,7 +159,7 @@ template bool write_ply_point_set( std::ostream& stream, ///< output stream. - const Point_set_3& point_set) ///< point set + const CGAL::Point_set_3& point_set) ///< point set { stream << point_set; diff --git a/Point_set_3/include/CGAL/Point_set_3/Point_set_processing_3.h b/Point_set_3/include/CGAL/Point_set_3/Point_set_processing_3.h index 83854545196..d24b52270e8 100644 --- a/Point_set_3/include/CGAL/Point_set_3/Point_set_processing_3.h +++ b/Point_set_3/include/CGAL/Point_set_3/Point_set_processing_3.h @@ -46,7 +46,7 @@ template double bilateral_smooth_point_set( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set const unsigned int k, ///< number of neighbors. double sharpness_angle) ///< control sharpness(0-90) { @@ -64,7 +64,7 @@ template double compute_average_spacing( - const Point_set_3& point_set, ///< point set + const CGAL::Point_set_3& point_set, ///< point set unsigned int k) ///< number of neighbors. { return CGAL::compute_average_spacing @@ -78,7 +78,7 @@ template void edge_aware_upsample_point_set( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set double sharpness_angle = 30, ///< control sharpness(0-90) double edge_sensitivity = 1, ///< edge sensitivity(0-5) double neighbor_radius = -1, ///< initial size of neighbors. @@ -99,7 +99,7 @@ edge_aware_upsample_point_set( */ template void grid_simplify_point_set( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set double epsilon) ///< tolerance value when merging 3D points. { point_set.remove_from @@ -115,7 +115,7 @@ void grid_simplify_point_set( */ template void hierarchy_simplify_point_set( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set const unsigned int size = 10, ///< maximum cluster size const double var_max = 0.333) ///< maximal surface variation { @@ -135,7 +135,7 @@ template void jet_estimate_normals( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set unsigned int k, ///< number of neighbors. unsigned int degree_fitting = 2) ///< fitting degree { @@ -155,7 +155,7 @@ template void jet_smooth_point_set( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set unsigned int k, ///< number of neighbors. unsigned int degree_fitting = 2, ///< fitting degree unsigned int degree_monge = 2) ///< Monge degree @@ -170,9 +170,9 @@ jet_smooth_point_set( \ingroup PkgPointSet3PointSetProcessing3 */ template -typename Point_set_3::iterator +typename CGAL::Point_set_3::iterator mst_orient_normals( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set unsigned int k) ///< number of neighbors { return CGAL::mst_orient_normals @@ -189,7 +189,7 @@ template void pca_estimate_normals( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set unsigned int k) ///< number of neighbors. { point_set.add_normal_map(); @@ -208,7 +208,7 @@ pca_estimate_normals( */ template void random_simplify_point_set( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set double removed_percentage) ///< percentage of points to remove { point_set.remove_from @@ -225,7 +225,7 @@ void random_simplify_point_set( */ template void remove_outliers( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set unsigned int k, ///< number of neighbors. double threshold_percent) ///< percentage of points to remove { @@ -242,7 +242,7 @@ void remove_outliers( template void vcm_estimate_normals( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set double offset_radius, ///< offset radius. double convolution_radius) ///< convolution radius. { @@ -262,7 +262,7 @@ vcm_estimate_normals( template void vcm_estimate_normals( - Point_set_3& point_set, ///< point set + CGAL::Point_set_3& point_set, ///< point set double offset_radius, ///< offset radius. unsigned int nb_neighbors_convolve) ///< number of neighbors used during the convolution. { @@ -281,8 +281,8 @@ template void wlop_simplify_and_regularize_point_set( - const Point_set_3& input_point_set, ///< input point set - Point_set_3& output_point_set, ///< output point set + const CGAL::Point_set_3& input_point_set, ///< input point set + CGAL::Point_set_3& output_point_set, ///< output point set const double select_percentage = 5, ///< percentage of points to retain double neighbor_radius = -1, ///< size of neighbors. const unsigned int max_iter_number = 35, ///< number of iterations.