Explicit Point_set_3 parameter in PSP overloads

This commit is contained in:
Simon Giraudot 2016-09-27 11:39:17 +02:00
parent 2dc269bc05
commit 21c95b267c
2 changed files with 45 additions and 48 deletions

View File

@ -35,11 +35,11 @@ namespace CGAL {
/*!
\ingroup PkgPointSet3IO
*/
template <typename PointSet>
template <typename Point, typename Vector>
bool
read_xyz_point_set(
std::istream& stream, ///< input stream.
PointSet& point_set) ///< point set
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 PointSet::const_iterator it = point_set.begin();
for (typename Point_set_3<Point, Vector>::const_iterator it = point_set.begin();
it != point_set.end(); ++ it)
if (point_set.normal(*it) != CGAL::NULL_VECTOR)
{
@ -67,11 +67,11 @@ read_xyz_point_set(
/*!
\ingroup PkgPointSet3IO
*/
template <typename PointSet>
template <typename Point, typename Vector>
bool
read_off_point_set(
std::istream& stream, ///< input stream.
PointSet& point_set) ///< point set
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 PointSet::const_iterator it = point_set.begin();
for (typename Point_set_3<Point, Vector>::const_iterator it = point_set.begin();
it != point_set.end(); ++ it)
if (point_set.normal(*it) != CGAL::NULL_VECTOR)
{
@ -101,16 +101,12 @@ read_off_point_set(
/*!
\ingroup PkgPointSet3IO
*/
template <typename PointSet>
template <typename Point, typename Vector>
bool
read_ply_point_set(
std::istream& stream, ///< input stream.
PointSet& point_set) ///< point set
Point_set_3<Point, Vector>& point_set) ///< point set
{
typedef typename PointSet::Point_type Point;
typedef typename PointSet::Vector_type Vector;
CGAL::Ply_interpreter_point_set_3<Point, Vector> interpreter (point_set);
return CGAL::read_ply_custom_points
@ -121,11 +117,11 @@ read_ply_point_set(
/*!
\ingroup PkgPointSet3IO
*/
template <typename PointSet>
template <typename Point, typename Vector>
bool
write_xyz_point_set(
std::ostream& stream, ///< output stream.
const PointSet& point_set) ///< point set
const Point_set_3<Point, Vector>& point_set) ///< point set
{
if (point_set.has_normals())
return CGAL::write_xyz_points_and_normals
@ -140,11 +136,11 @@ write_xyz_point_set(
/*!
\ingroup PkgPointSet3IO
*/
template <typename PointSet>
template <typename Point, typename Vector>
bool
write_off_point_set(
std::ostream& stream, ///< output stream.
const PointSet& point_set) ///< point set
const Point_set_3<Point, Vector>& point_set) ///< point set
{
if (point_set.has_normal_map())
return CGAL::write_off_points_and_normals
@ -159,11 +155,11 @@ write_off_point_set(
/*!
\ingroup PkgPointSet3IO
*/
template <typename PointSet>
template <typename Point, typename Vector>
bool
write_ply_point_set(
std::ostream& stream, ///< output stream.
const PointSet& point_set) ///< point set
const Point_set_3<Point, Vector>& point_set) ///< point set
{
if (point_set.has_normals())
return CGAL::write_ply_points_and_normals

View File

@ -42,10 +42,11 @@ namespace CGAL {
\ingroup PkgPointSet3PointSetProcessing3
*/
template <typename Concurrency_tag,
typename PointSet>
typename Point,
typename Vector>
double
bilateral_smooth_point_set(
PointSet& point_set, ///< point set
Point_set_3<Point, Vector>& point_set, ///< point set
const unsigned int k, ///< number of neighbors.
double sharpness_angle) ///< control sharpness(0-90)
{
@ -60,10 +61,10 @@ bilateral_smooth_point_set(
\ingroup PkgPointSet3PointSetProcessing3
*/
template <typename Concurrency_tag,
typename PointSet>
typename Point, typename Vector>
double
compute_average_spacing(
const PointSet& point_set, ///< point set
const Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k) ///< number of neighbors.
{
return CGAL::compute_average_spacing<Concurrency_tag>
@ -74,10 +75,10 @@ compute_average_spacing(
\ingroup PkgPointSet3PointSetProcessing3
*/
template <typename Concurrency_tag,
typename PointSet>
typename Point, typename Vector>
void
edge_aware_upsample_point_set(
PointSet& point_set, ///< point set
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.
@ -96,9 +97,9 @@ edge_aware_upsample_point_set(
\note No iterator is returned, points simplified are directly
removed from the point set.
*/
template <typename PointSet>
template <typename Point, typename Vector>
void grid_simplify_point_set(
PointSet& point_set, ///< point set
Point_set_3<Point, Vector>& point_set, ///< point set
double epsilon) ///< tolerance value when merging 3D points.
{
point_set.remove_from
@ -112,9 +113,9 @@ void grid_simplify_point_set(
\note No iterator is returned, points simplified are directly
removed from the point set.
*/
template <typename PointSet>
template <typename Point, typename Vector>
void hierarchy_simplify_point_set(
PointSet& point_set, ///< point set
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
{
@ -131,10 +132,10 @@ void hierarchy_simplify_point_set(
\note This function adds a normal map to the point set.
*/
template <typename Concurrency_tag,
typename PointSet>
typename Point, typename Vector>
void
jet_estimate_normals(
PointSet& point_set, ///< point set
Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k, ///< number of neighbors.
unsigned int degree_fitting = 2) ///< fitting degree
{
@ -151,10 +152,10 @@ jet_estimate_normals(
\ingroup PkgPointSet3PointSetProcessing3
*/
template <typename Concurrency_tag,
typename PointSet>
typename Point, typename Vector>
void
jet_smooth_point_set(
PointSet& point_set, ///< point set
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
@ -168,10 +169,10 @@ jet_smooth_point_set(
/*!
\ingroup PkgPointSet3PointSetProcessing3
*/
template <typename PointSet>
typename PointSet::iterator
template <typename Point, typename Vector>
typename Point_set_3<Point, Vector>::iterator
mst_orient_normals(
PointSet& point_set, ///< point set
Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k) ///< number of neighbors
{
return CGAL::mst_orient_normals
@ -185,10 +186,10 @@ mst_orient_normals(
\note This function adds a normal map to the point set.
*/
template <typename Concurrency_tag,
typename PointSet>
typename Point, typename Vector>
void
pca_estimate_normals(
PointSet& point_set, ///< point set
Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k) ///< number of neighbors.
{
point_set.add_normal_map();
@ -205,9 +206,9 @@ pca_estimate_normals(
\note No iterator is returned, points simplified are directly
removed from the point set.
*/
template <typename PointSet>
template <typename Point, typename Vector>
void random_simplify_point_set(
PointSet& point_set, ///< point set
Point_set_3<Point, Vector>& point_set, ///< point set
double removed_percentage) ///< percentage of points to remove
{
point_set.remove_from
@ -222,9 +223,9 @@ void random_simplify_point_set(
\note No iterator is returned, points simplified are directly
removed from the point set.
*/
template <typename PointSet>
template <typename Point, typename Vector>
void remove_outliers(
PointSet& point_set, ///< point set
Point_set_3<Point, Vector>& point_set, ///< point set
unsigned int k, ///< number of neighbors.
double threshold_percent) ///< percentage of points to remove
{
@ -238,10 +239,10 @@ void remove_outliers(
\note This function adds a normal map to the point set.
*/
template <typename PointSet>
template <typename Point, typename Vector>
void
vcm_estimate_normals(
PointSet& point_set, ///< point set
Point_set_3<Point, Vector>& point_set, ///< point set
double offset_radius, ///< offset radius.
double convolution_radius) ///< convolution radius.
{
@ -258,10 +259,10 @@ vcm_estimate_normals(
\note This function adds a normal map to the point set.
*/
template <typename PointSet>
template <typename Point, typename Vector>
void
vcm_estimate_normals(
PointSet& point_set, ///< point set
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.
{
@ -277,11 +278,11 @@ vcm_estimate_normals(
\ingroup PkgPointSet3PointSetProcessing3
*/
template <typename Concurrency_tag,
typename PointSet>
typename Point, typename Vector>
void
wlop_simplify_and_regularize_point_set(
const PointSet& input_point_set, ///< input point set
PointSet& output_point_set, ///< output 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 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.