Update reference manual

This commit is contained in:
Simon Giraudot 2016-09-28 10:49:42 +02:00
parent a6b64c907b
commit d4ab17634e
5 changed files with 81 additions and 53 deletions

View File

@ -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<Point,Vector>`

View File

@ -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
*/

View File

@ -62,22 +62,11 @@ public:
typedef Point Point_type;
typedef Vector Vector_type;
typedef Point_set_3<Point, Vector> 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<Index> Base;
/// \endcond
/// \cond SKIP_IN_MANUAL
template <class Type>
struct Property_map
: public Properties::Property_map<Index, Type>
@ -87,9 +76,17 @@ public:
template <typename Property>
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<Index>;
template <class> 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 <typename P>
friend std::istream& operator>>(std::istream& is, Point_set_3<P>& 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<boost::int8_t>(prop[i]).first)
else if (ps.m_base.template get<boost::int8_t>(prop[i]).second)
os << "property char " << prop[i] << std::endl;
else if (ps.m_base.template get<boost::uint8_t>(prop[i]).first)
else if (ps.m_base.template get<boost::uint8_t>(prop[i]).second)
os << "property uchar " << prop[i] << std::endl;
else if (ps.m_base.template get<boost::int16_t>(prop[i]).first)
else if (ps.m_base.template get<boost::int16_t>(prop[i]).second)
os << "property short " << prop[i] << std::endl;
else if (ps.m_base.template get<boost::uint16_t>(prop[i]).first)
else if (ps.m_base.template get<boost::uint16_t>(prop[i]).second)
os << "property ushort " << prop[i] << std::endl;
else if (ps.m_base.template get<boost::int32_t>(prop[i]).first)
else if (ps.m_base.template get<boost::int32_t>(prop[i]).second)
os << "property int " << prop[i] << std::endl;
else if (ps.m_base.template get<boost::uint32_t>(prop[i]).first)
else if (ps.m_base.template get<boost::uint32_t>(prop[i]).second)
os << "property uint " << prop[i] << std::endl;
else if (ps.m_base.template get<float>(prop[i]).first)
else if (ps.m_base.template get<float>(prop[i]).second)
os << "property float " << prop[i] << std::endl;
else if (ps.m_base.template get<double>(prop[i]).first)
else if (ps.m_base.template get<double>(prop[i]).second)
os << "property double " << prop[i] << std::endl;
else
os << "property " << boost::core::demangle(ps.m_base.get_type(prop[i]).name())

View File

@ -39,7 +39,7 @@ template <typename Point, typename Vector>
bool
read_xyz_point_set(
std::istream& stream, ///< input stream.
Point_set_3<Point, Vector>& point_set) ///< point set
CGAL::Point_set_3<Point, Vector>& 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<Point, Vector>::const_iterator it = point_set.begin();
for (typename CGAL::Point_set_3<Point, Vector>::const_iterator it = point_set.begin();
it != point_set.end(); ++ it)
if (point_set.normal(*it) != CGAL::NULL_VECTOR)
{
@ -71,7 +71,7 @@ template <typename Point, typename Vector>
bool
read_off_point_set(
std::istream& stream, ///< input stream.
Point_set_3<Point, Vector>& point_set) ///< point set
CGAL::Point_set_3<Point, Vector>& 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<Point, Vector>::const_iterator it = point_set.begin();
for (typename CGAL::Point_set_3<Point, Vector>::const_iterator it = point_set.begin();
it != point_set.end(); ++ it)
if (point_set.normal(*it) != CGAL::NULL_VECTOR)
{
@ -105,7 +105,7 @@ template <typename Point, typename Vector>
bool
read_ply_point_set(
std::istream& stream, ///< input stream.
Point_set_3<Point, Vector>& point_set) ///< point set
CGAL::Point_set_3<Point, Vector>& point_set) ///< point set
{
CGAL::Ply_interpreter_point_set_3<Point, Vector> interpreter (point_set);
@ -121,7 +121,7 @@ template <typename Point, typename Vector>
bool
write_xyz_point_set(
std::ostream& stream, ///< output stream.
const Point_set_3<Point, Vector>& point_set) ///< point set
const CGAL::Point_set_3<Point, Vector>& point_set) ///< point set
{
if (point_set.has_normal_map())
return CGAL::write_xyz_points_and_normals
@ -140,7 +140,7 @@ template <typename Point, typename Vector>
bool
write_off_point_set(
std::ostream& stream, ///< output stream.
const Point_set_3<Point, Vector>& point_set) ///< point set
const CGAL::Point_set_3<Point, Vector>& point_set) ///< point set
{
if (point_set.has_normal_map())
return CGAL::write_off_points_and_normals
@ -159,7 +159,7 @@ template <typename Point, typename Vector>
bool
write_ply_point_set(
std::ostream& stream, ///< output stream.
const Point_set_3<Point, Vector>& point_set) ///< point set
const CGAL::Point_set_3<Point, Vector>& point_set) ///< point set
{
stream << point_set;

View File

@ -46,7 +46,7 @@ template <typename Concurrency_tag,
typename Vector>
double
bilateral_smooth_point_set(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& point_set, ///< point set
const unsigned int k, ///< number of neighbors.
double sharpness_angle) ///< control sharpness(0-90)
{
@ -64,7 +64,7 @@ template <typename Concurrency_tag,
typename Point, typename Vector>
double
compute_average_spacing(
const Point_set_3<Point, Vector>& point_set, ///< point set
const CGAL::Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k) ///< number of neighbors.
{
return CGAL::compute_average_spacing<Concurrency_tag>
@ -78,7 +78,7 @@ template <typename Concurrency_tag,
typename Point, typename Vector>
void
edge_aware_upsample_point_set(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& 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 <typename Point, typename Vector>
void grid_simplify_point_set(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& 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 <typename Point, typename Vector>
void hierarchy_simplify_point_set(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& 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 <typename Concurrency_tag,
typename Point, typename Vector>
void
jet_estimate_normals(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k, ///< number of neighbors.
unsigned int degree_fitting = 2) ///< fitting degree
{
@ -155,7 +155,7 @@ template <typename Concurrency_tag,
typename Point, typename Vector>
void
jet_smooth_point_set(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& 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, typename Vector>
typename Point_set_3<Point, Vector>::iterator
typename CGAL::Point_set_3<Point, Vector>::iterator
mst_orient_normals(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k) ///< number of neighbors
{
return CGAL::mst_orient_normals
@ -189,7 +189,7 @@ template <typename Concurrency_tag,
typename Point, typename Vector>
void
pca_estimate_normals(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k) ///< number of neighbors.
{
point_set.add_normal_map();
@ -208,7 +208,7 @@ pca_estimate_normals(
*/
template <typename Point, typename Vector>
void random_simplify_point_set(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& 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 <typename Point, typename Vector>
void remove_outliers(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& 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 <typename Point, typename Vector>
void
vcm_estimate_normals(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& point_set, ///< point set
double offset_radius, ///< offset radius.
double convolution_radius) ///< convolution radius.
{
@ -262,7 +262,7 @@ vcm_estimate_normals(
template <typename Point, typename Vector>
void
vcm_estimate_normals(
Point_set_3<Point, Vector>& point_set, ///< point set
CGAL::Point_set_3<Point, Vector>& 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 <typename Concurrency_tag,
typename Point, typename Vector>
void
wlop_simplify_and_regularize_point_set(
const Point_set_3<Point, Vector>& input_point_set, ///< input point set
Point_set_3<Point, Vector>& output_point_set, ///< output point set
const CGAL::Point_set_3<Point, Vector>& input_point_set, ///< input point set
CGAL::Point_set_3<Point, Vector>& 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.