mirror of https://github.com/CGAL/cgal
remove the flag CGAL_USE_PROPERTY_MAPS_API_V1 and keep only new API
This commit is contained in:
parent
f3e5e81d79
commit
e3a44a9d75
|
|
@ -147,6 +147,12 @@ and <code>src/</code> directories).
|
|||
<!-- Geometry Kernels -->
|
||||
<!-- Convex Hull Algorithms -->
|
||||
<!-- Polygons -->
|
||||
<h3>2D Minkowski Sums</h3>
|
||||
<ul>
|
||||
<li>Introduce a convex decomposition strategy, namely Polygon_nop_decomposition_2, that merely passed the input polygon to the list of output polygons.</li>
|
||||
<li>Introduce overloads of the function minkowski_sum_2(), which accepts 2 decomposition strategies.</li>
|
||||
<li>Introduce an overloaded function called minkowski_sum_by_decomposition_2(P, Q, decom_no_holes, decomp_with_holes), which computes the 2D Minkowski sum using optimal choices of decomposition strategies.</li>
|
||||
</ul>
|
||||
<!-- Cell Complexes and Polyhedra -->
|
||||
<h3>Combinatorial Maps</h3>
|
||||
<ul>
|
||||
|
|
@ -189,7 +195,7 @@ and <code>src/</code> directories).
|
|||
<li>
|
||||
The user can choose the number of relaxation steps happening at each loop,
|
||||
and to run 1-dimensional relaxation along constrained polylines.
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
|
@ -221,12 +227,15 @@ and <code>src/</code> directories).
|
|||
of a <code>FaceGraph</code> and a creation function <code>CGAL::dual(primal)</code>.
|
||||
</li>
|
||||
</ul>
|
||||
<h3>2D Minkowski Sums</h3>
|
||||
<h4>CGAL and Boost Property Maps</h4>
|
||||
<ul>
|
||||
<li>Introduce a convex decomposition strategy, namely Polygon_nop_decomposition_2, that merely passed the input polygon to the list of output polygons.</li>
|
||||
<li>Introduce overloads of the function minkowski_sum_2(), which accepts 2 decomposition strategies.</li>
|
||||
<li>Introduce an overloaded function called minkowski_sum_by_decomposition_2(P, Q, decom_no_holes, decomp_with_holes), which computes the 2D Minkowski sum using optimal choices of decomposition strategies.</li>
|
||||
<li>It is not longer possible to use the old API of the property maps
|
||||
provided by CGAL, switched on by defining the macro
|
||||
<code>CGAL_USE_PROPERTY_MAPS_API_V1</code>. This API was deprecated
|
||||
since CGAL 4.3
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Visualization -->
|
||||
|
||||
<!-- end of the div for 4.9 -->
|
||||
|
|
|
|||
|
|
@ -377,13 +377,8 @@ public:
|
|||
|
||||
std::vector<Sample_*> m_samples;
|
||||
for (InputIterator it = start; it != beyond; it++) {
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
FT mass = get( mass_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
FT mass = get( mass_pmap, *it);
|
||||
#endif
|
||||
Sample_* s = new Sample_(point, mass);
|
||||
m_samples.push_back(s);
|
||||
}
|
||||
|
|
@ -439,11 +434,7 @@ public:
|
|||
int nb = static_cast<int>(m_dt.number_of_vertices());
|
||||
m_dt.infinite_vertex()->pinned() = true;
|
||||
for (Iterator it = begin; it != beyond; it++) {
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
insert_point(point, false, nb++);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,13 +140,8 @@ read_off_points_and_normals(
|
|||
}
|
||||
}
|
||||
Enriched_point pwn;
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put(point_pmap, &pwn, point); // point_pmap[&pwn] = point
|
||||
put(normal_pmap, &pwn, normal); // normal_pmap[&pwn] = normal
|
||||
#else
|
||||
put(point_pmap, pwn, point); // point_pmap[&pwn] = point
|
||||
put(normal_pmap, pwn, normal); // normal_pmap[&pwn] = normal
|
||||
#endif
|
||||
*output++ = pwn;
|
||||
pointsRead++;
|
||||
}
|
||||
|
|
@ -249,11 +244,7 @@ read_off_points_and_normals(
|
|||
<OutputIteratorValueType>(
|
||||
stream,
|
||||
output,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(output),
|
||||
#else
|
||||
make_identity_property_map(OutputIteratorValueType()),
|
||||
#endif
|
||||
normal_pmap);
|
||||
}
|
||||
|
||||
|
|
@ -398,11 +389,7 @@ read_off_points(
|
|||
<OutputIteratorValueType>(
|
||||
stream,
|
||||
output,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(output)
|
||||
#else
|
||||
make_identity_property_map(OutputIteratorValueType())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -472,13 +472,8 @@ public:
|
|||
Vector normal (nx, ny, nz);
|
||||
Enriched_point pwn;
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put(m_point_pmap, &pwn, point); // point_pmap[&pwn] = point
|
||||
put(m_normal_pmap, &pwn, normal); // normal_pmap[&pwn] = normal
|
||||
#else
|
||||
put(m_point_pmap, pwn, point); // point_pmap[&pwn] = point
|
||||
put(m_normal_pmap, pwn, normal); // normal_pmap[&pwn] = normal
|
||||
#endif
|
||||
*m_output++ = pwn;
|
||||
}
|
||||
|
||||
|
|
@ -636,11 +631,7 @@ bool read_ply_points_and_normals(std::istream& stream, ///< input stream.
|
|||
return read_ply_points_and_normals
|
||||
<OutputIteratorValueType>(stream,
|
||||
output,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(output),
|
||||
#else
|
||||
make_identity_property_map(OutputIteratorValueType()),
|
||||
#endif
|
||||
normal_pmap);
|
||||
}
|
||||
|
||||
|
|
@ -759,11 +750,7 @@ bool read_ply_points(std::istream& stream, ///< input stream.
|
|||
return read_ply_points
|
||||
<OutputIteratorValueType>(stream,
|
||||
output,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(output)
|
||||
#else
|
||||
make_identity_property_map(OutputIteratorValueType())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,13 +123,8 @@ read_xyz_points_and_normals(
|
|||
}
|
||||
}
|
||||
Enriched_point pwn;
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put(point_pmap, &pwn, point); // point_pmap[&pwn] = point
|
||||
put(normal_pmap, &pwn, normal); // normal_pmap[&pwn] = normal
|
||||
#else
|
||||
put(point_pmap, pwn, point); // point_pmap[pwn] = point
|
||||
put(normal_pmap, pwn, normal); // normal_pmap[pwn] = normal
|
||||
#endif
|
||||
*output++ = pwn;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -241,11 +236,7 @@ read_xyz_points_and_normals(
|
|||
<OutputIteratorValueType>(
|
||||
stream,
|
||||
output,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(output),
|
||||
#else
|
||||
make_identity_property_map(OutputIteratorValueType()),
|
||||
#endif
|
||||
normal_pmap);
|
||||
}
|
||||
|
||||
|
|
@ -391,11 +382,7 @@ read_xyz_points(
|
|||
<OutputIteratorValueType>(
|
||||
stream,
|
||||
output,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(output)
|
||||
#else
|
||||
make_identity_property_map(OutputIteratorValueType())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,13 +81,8 @@ write_off_points_and_normals(
|
|||
// Write positions + normals
|
||||
for(ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point p = get(point_pmap, it);
|
||||
Vector n = get(normal_pmap, it);
|
||||
#else
|
||||
Point p = get(point_pmap, *it);
|
||||
Vector n = get(normal_pmap, *it);
|
||||
#endif
|
||||
stream << p << " " << n << std::endl;
|
||||
}
|
||||
|
||||
|
|
@ -134,12 +129,8 @@ write_off_points_and_normals(
|
|||
return write_off_points_and_normals(
|
||||
stream,
|
||||
first, beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
@ -190,11 +181,7 @@ write_off_points(
|
|||
// Write positions
|
||||
for(ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point p = get(point_pmap, it);
|
||||
#else
|
||||
Point p = get(point_pmap, *it);
|
||||
#endif
|
||||
stream << p << std::endl;
|
||||
}
|
||||
|
||||
|
|
@ -236,12 +223,8 @@ write_off_points(
|
|||
return write_off_points(
|
||||
stream,
|
||||
first, beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first)
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
|
|||
|
|
@ -89,13 +89,8 @@ write_ply_points_and_normals(
|
|||
// Write positions + normals
|
||||
for(ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point p = get(point_pmap, it);
|
||||
Vector n = get(normal_pmap, it);
|
||||
#else
|
||||
Point p = get(point_pmap, *it);
|
||||
Vector n = get(normal_pmap, *it);
|
||||
#endif
|
||||
stream << p << " " << n << std::endl;
|
||||
}
|
||||
|
||||
|
|
@ -141,12 +136,8 @@ write_ply_points_and_normals(
|
|||
return write_ply_points_and_normals(
|
||||
stream,
|
||||
first, beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
@ -200,11 +191,7 @@ write_ply_points(
|
|||
// Write positions
|
||||
for(ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point p = get(point_pmap, it);
|
||||
#else
|
||||
Point p = get(point_pmap, *it);
|
||||
#endif
|
||||
stream << p << std::endl;
|
||||
}
|
||||
|
||||
|
|
@ -244,12 +231,8 @@ write_ply_points(
|
|||
return write_ply_points(
|
||||
stream,
|
||||
first, beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first)
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
|
|||
|
|
@ -76,13 +76,8 @@ write_xyz_points_and_normals(
|
|||
// Write positions + normals
|
||||
for(ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point p = get(point_pmap, it);
|
||||
Vector n = get(normal_pmap, it);
|
||||
#else
|
||||
Point p = get(point_pmap, *it);
|
||||
Vector n = get(normal_pmap, *it);
|
||||
#endif
|
||||
stream << p << " " << n << std::endl;
|
||||
}
|
||||
|
||||
|
|
@ -129,12 +124,8 @@ write_xyz_points_and_normals(
|
|||
return write_xyz_points_and_normals(
|
||||
stream,
|
||||
first, beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(output),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
@ -180,11 +171,7 @@ write_xyz_points(
|
|||
// Write positions
|
||||
for(ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point p = get(point_pmap, it);
|
||||
#else
|
||||
Point p = get(point_pmap, *it);
|
||||
#endif
|
||||
|
||||
stream << p << std::endl;
|
||||
}
|
||||
|
|
@ -227,12 +214,8 @@ write_xyz_points(
|
|||
return write_xyz_points(
|
||||
stream,
|
||||
first, beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(output)
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ private:
|
|||
|
||||
//=========================================================================
|
||||
|
||||
#ifndef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
|
||||
/// Property map that accesses the normal vector from a Point_with_normal_3 object
|
||||
///
|
||||
/// @heading Is Model for the Concepts:
|
||||
|
|
@ -165,51 +165,6 @@ Normal_of_point_with_normal_pmap<
|
|||
return Normal_of_point_with_normal_pmap<typename CGAL::Kernel_traits<Point_with_normal>::Kernel>();
|
||||
}
|
||||
|
||||
#else
|
||||
/// Property map that accesses the normal vector from a Point_with_normal_3* pointer
|
||||
/// (or in general an iterator over Point_with_normal_3 elements).
|
||||
///
|
||||
/// @heading Is Model for the Concepts:
|
||||
/// \cgalModels `LvaluePropertyMap`
|
||||
///
|
||||
/// @heading Parameters:
|
||||
/// @param Gt Geometric traits class.
|
||||
|
||||
template <class Gt>
|
||||
struct Normal_of_point_with_normal_pmap
|
||||
: public boost::put_get_helper<typename Gt::Vector_3&,
|
||||
Normal_of_point_with_normal_pmap<Gt> >
|
||||
{
|
||||
typedef Point_with_normal_3<Gt> Point_with_normal; ///< Position + normal
|
||||
typedef typename Gt::Vector_3 Vector; /// normal
|
||||
|
||||
typedef Point_with_normal* key_type;
|
||||
typedef Vector value_type;
|
||||
typedef value_type& reference;
|
||||
typedef boost::lvalue_property_map_tag category;
|
||||
|
||||
/// Access a property map element.
|
||||
///
|
||||
/// @tparam Iter Type convertible to key_type.
|
||||
template <class Iter>
|
||||
reference operator[](Iter it) const { return (reference) it->normal(); }
|
||||
};
|
||||
|
||||
/// Free function to create a Normal_of_point_with_normal_pmap property map.
|
||||
///
|
||||
/// @relates Normal_of_point_with_normal_pmap
|
||||
|
||||
template <class Iter> // Type convertible to key_type
|
||||
Normal_of_point_with_normal_pmap<typename CGAL::Kernel_traits<typename CGAL::value_type_traits<Iter>::type>::Kernel>
|
||||
make_normal_of_point_with_normal_pmap(Iter)
|
||||
{
|
||||
// value_type_traits is a workaround as back_insert_iterator's value_type is void
|
||||
typedef typename CGAL::value_type_traits<Iter>::type Value_type;
|
||||
typedef typename CGAL::Kernel_traits<Value_type>::Kernel Kernel;
|
||||
return Normal_of_point_with_normal_pmap<Kernel>();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// \endcond
|
||||
|
||||
} //namespace CGAL
|
||||
|
|
|
|||
|
|
@ -433,13 +433,8 @@ bilateral_smooth_point_set(
|
|||
Pwns pwns;
|
||||
for(ForwardIterator it = first; it != beyond; ++it)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Point& p = get(point_pmap, it);
|
||||
const Vector& n = get(normal_pmap, it);
|
||||
#else
|
||||
const Point& p = get(point_pmap, *it);
|
||||
const Vector& n = get(normal_pmap, *it);
|
||||
#endif
|
||||
CGAL_point_set_processing_precondition(n.squared_length() > 1e-10);
|
||||
|
||||
pwns.push_back(Pwn(p, n));
|
||||
|
|
@ -569,19 +564,10 @@ bilateral_smooth_point_set(
|
|||
ForwardIterator it = first;
|
||||
for(unsigned int i = 0 ; it != beyond; ++it, ++i)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Point& p = get(point_pmap, it);
|
||||
#else
|
||||
const Point& p = get(point_pmap, *it);
|
||||
#endif
|
||||
sum_move_error += CGAL::squared_distance(p, update_pwns[i].position());
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put (point_pmap, it, update_pwns[i].position());
|
||||
put (normal_pmap, it, update_pwns[i].normal());
|
||||
#else
|
||||
put (point_pmap, *it, update_pwns[i].position());
|
||||
put (normal_pmap, *it, update_pwns[i].normal());
|
||||
#endif
|
||||
}
|
||||
|
||||
return sum_move_error / nb_points;
|
||||
|
|
@ -631,12 +617,8 @@ bilateral_smooth_point_set(
|
|||
{
|
||||
return bilateral_smooth_point_set<Concurrency_tag>(
|
||||
first, beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap,
|
||||
k,
|
||||
sharpness_angle);
|
||||
|
|
|
|||
|
|
@ -178,11 +178,7 @@ compute_average_spacing(
|
|||
std::vector<Point> kd_tree_points;
|
||||
for(InputIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
kd_tree_points.push_back(point);
|
||||
}
|
||||
Tree tree(kd_tree_points.begin(), kd_tree_points.end());
|
||||
|
|
@ -210,11 +206,7 @@ compute_average_spacing(
|
|||
for(InputIterator it = first; it != beyond; it++)
|
||||
{
|
||||
sum_spacings += internal::compute_average_spacing<Kernel,Tree>(
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
get(point_pmap,it),
|
||||
#else
|
||||
get(point_pmap,*it),
|
||||
#endif
|
||||
tree,k);
|
||||
}
|
||||
}
|
||||
|
|
@ -257,12 +249,8 @@ compute_average_spacing(
|
|||
{
|
||||
return compute_average_spacing<Concurrency_tag>(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<InputIterator>::value_type()),
|
||||
#endif
|
||||
k);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
@ -271,4 +259,3 @@ compute_average_spacing(
|
|||
} //namespace CGAL
|
||||
|
||||
#endif // CGAL_AVERAGE_SPACING_3_H
|
||||
|
||||
|
|
|
|||
|
|
@ -382,13 +382,8 @@ edge_aware_upsample_point_set(
|
|||
ForwardIterator it = first; // point iterator
|
||||
for(unsigned int i = 0; it != beyond; ++it, ++i)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
rich_point_set[i].pt = get(point_pmap, it);
|
||||
rich_point_set[i].normal = get(normal_pmap, it);
|
||||
#else
|
||||
rich_point_set[i].pt = get(point_pmap, *it);
|
||||
rich_point_set[i].normal = get(normal_pmap, *it);
|
||||
#endif
|
||||
|
||||
rich_point_set[i].index = i;
|
||||
bbox += rich_point_set[i].pt.bbox();
|
||||
|
|
|
|||
|
|
@ -65,13 +65,8 @@ public:
|
|||
typedef typename boost::property_traits<PointPMap>::value_type Point;
|
||||
|
||||
// Round points to multiples of m_epsilon, then compare.
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point a_n = get(point_pmap,&a);
|
||||
Point b_n = get(point_pmap,&b);
|
||||
#else
|
||||
Point a_n = get(point_pmap,a);
|
||||
Point b_n = get(point_pmap,b);
|
||||
#endif
|
||||
|
||||
Point rounded_a(round_epsilon(a_n.x(), m_epsilon),
|
||||
round_epsilon(a_n.y(), m_epsilon),
|
||||
|
|
@ -219,12 +214,8 @@ grid_simplify_point_set(
|
|||
{
|
||||
return grid_simplify_point_set(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
epsilon);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
|
|||
|
|
@ -56,11 +56,7 @@ namespace CGAL {
|
|||
unsigned int nb_pts = 0;
|
||||
while(begin != end)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Point& point = get(point_pmap, begin);
|
||||
#else
|
||||
const Point& point = get(point_pmap, *begin);
|
||||
#endif
|
||||
x += point.x (); y += point.y (); z += point.z ();
|
||||
++ nb_pts;
|
||||
++ begin;
|
||||
|
|
@ -88,11 +84,7 @@ namespace CGAL {
|
|||
typename std::list<Input_type>::iterator point_min;
|
||||
for (Iterator it = cluster.begin (); it != cluster.end (); ++ it)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Point& point = get(point_pmap, it);
|
||||
#else
|
||||
const Point& point = get(point_pmap, *it);
|
||||
#endif
|
||||
FT dist = CGAL::squared_distance (point, centroid);
|
||||
if (dist < dist_min)
|
||||
{
|
||||
|
|
@ -199,11 +191,7 @@ namespace CGAL {
|
|||
for (typename std::list<Input_type>::iterator it = current_cluster->first.begin ();
|
||||
it != current_cluster->first.end (); ++ it)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Point& point = get(point_pmap, it);
|
||||
#else
|
||||
const Point& point = get(point_pmap, *it);
|
||||
#endif
|
||||
Vector d = point - current_cluster->second;
|
||||
covariance[0] += d.x () * d.x ();
|
||||
covariance[1] += d.x () * d.y ();
|
||||
|
|
@ -242,11 +230,7 @@ namespace CGAL {
|
|||
while (it != current_cluster->first.end ())
|
||||
{
|
||||
typename std::list<Input_type>::iterator current = it ++;
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Point& point = get(point_pmap, current);
|
||||
#else
|
||||
const Point& point = get(point_pmap, *current);
|
||||
#endif
|
||||
|
||||
// Test if point is on negative side of plane and
|
||||
// transfer it to the negative_side cluster if it is
|
||||
|
|
@ -371,11 +355,7 @@ namespace CGAL {
|
|||
{
|
||||
return hierarchy_simplify_point_set
|
||||
(begin, end,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map (typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
size, var_max);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
|
|||
|
|
@ -212,11 +212,7 @@ jet_estimate_normals(
|
|||
std::vector<Point> kd_tree_points;
|
||||
for(it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
kd_tree_points.push_back(point);
|
||||
}
|
||||
Tree tree(kd_tree_points.begin(), kd_tree_points.end());
|
||||
|
|
@ -239,11 +235,7 @@ jet_estimate_normals(
|
|||
unsigned int i = 0;
|
||||
for(it = first; it != beyond; ++ it, ++ i)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put (normal_pmap, it, normals[i]);
|
||||
#else
|
||||
put (normal_pmap, *it, normals[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -252,18 +244,10 @@ jet_estimate_normals(
|
|||
for(it = first; it != beyond; it++)
|
||||
{
|
||||
Vector normal = internal::jet_estimate_normal<Kernel,SvdTraits,Tree>(
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
get(point_pmap,it),
|
||||
#else
|
||||
get(point_pmap,*it),
|
||||
#endif
|
||||
tree, k, degree_fitting);
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put(normal_pmap, it, normal); // normal_pmap[it] = normal
|
||||
#else
|
||||
put(normal_pmap, *it, normal); // normal_pmap[it] = normal
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -344,12 +328,8 @@ jet_estimate_normals(
|
|||
{
|
||||
jet_estimate_normals<Concurrency_tag>(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap,
|
||||
k,
|
||||
degree_fitting);
|
||||
|
|
|
|||
|
|
@ -206,11 +206,7 @@ jet_smooth_point_set(
|
|||
std::vector<Point> kd_tree_points;
|
||||
for(it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
kd_tree_points.push_back(point);
|
||||
}
|
||||
Tree tree(kd_tree_points.begin(), kd_tree_points.end());
|
||||
|
|
@ -232,11 +228,8 @@ jet_smooth_point_set(
|
|||
unsigned int i = 0;
|
||||
for(it = first; it != beyond; ++ it, ++ i)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put(point_pmap, it , mutated_points[i]);
|
||||
#else
|
||||
put(point_pmap, *it, mutated_points[i]);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -244,17 +237,10 @@ jet_smooth_point_set(
|
|||
{
|
||||
for(it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Point& p = get(point_pmap, it);
|
||||
put(point_pmap, it ,
|
||||
internal::jet_smooth_point<Kernel, SvdTraits>(
|
||||
p,tree,k,degree_fitting,degree_monge) );
|
||||
#else
|
||||
const Point& p = get(point_pmap, *it);
|
||||
put(point_pmap, *it ,
|
||||
internal::jet_smooth_point<Kernel, SvdTraits>(
|
||||
p,tree,k,degree_fitting,degree_monge) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -327,12 +313,8 @@ jet_smooth_point_set(
|
|||
{
|
||||
jet_smooth_point_set<Concurrency_tag>(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<InputIterator>::value_type()),
|
||||
#endif
|
||||
k,
|
||||
degree_fitting,degree_monge);
|
||||
}
|
||||
|
|
@ -342,4 +324,3 @@ jet_smooth_point_set(
|
|||
} //namespace CGAL
|
||||
|
||||
#endif // CGAL_JET_SMOOTH_POINT_SET_H
|
||||
|
||||
|
|
|
|||
|
|
@ -154,19 +154,11 @@ struct Propagate_normal_orientation
|
|||
|
||||
// Gets source normal
|
||||
vertex_descriptor source_vertex = source(edge, mst_graph);
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Vector source_normal = get(mst_graph.m_normal_pmap, mst_graph[source_vertex].input_point);
|
||||
#else
|
||||
const Vector source_normal = get(mst_graph.m_normal_pmap, *(mst_graph[source_vertex].input_point) );
|
||||
#endif
|
||||
const bool source_normal_is_oriented = mst_graph[source_vertex].is_oriented;
|
||||
// Gets target normal
|
||||
vertex_descriptor target_vertex = target(edge, mst_graph);
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Vector& target_normal = get( mst_graph.m_normal_pmap, mst_graph[target_vertex].input_point);
|
||||
#else
|
||||
const Vector& target_normal = get( mst_graph.m_normal_pmap, *(mst_graph[target_vertex].input_point) );
|
||||
#endif
|
||||
bool& target_normal_is_oriented = ((MST_graph&)mst_graph)[target_vertex].is_oriented;
|
||||
if ( ! target_normal_is_oriented )
|
||||
{
|
||||
|
|
@ -175,11 +167,7 @@ struct Propagate_normal_orientation
|
|||
double normals_dot = source_normal * target_normal;
|
||||
if (normals_dot < 0)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put( mst_graph.m_normal_pmap, mst_graph[target_vertex].input_point, -target_normal);
|
||||
#else
|
||||
put( mst_graph.m_normal_pmap, *(mst_graph[target_vertex].input_point), -target_normal );
|
||||
#endif
|
||||
}
|
||||
|
||||
// Is orientation robust?
|
||||
|
|
@ -229,32 +217,19 @@ mst_find_source(
|
|||
for (ForwardIterator v = ++first; v != beyond; v++)
|
||||
{
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
double top_z = get(point_pmap,top_point).z(); // top_point's Z coordinate
|
||||
double z = get(point_pmap,v).z();
|
||||
#else
|
||||
double top_z = get(point_pmap,*top_point).z(); // top_point's Z coordinate
|
||||
double z = get(point_pmap,*v).z();
|
||||
#endif
|
||||
|
||||
if (top_z < z)
|
||||
top_point = v;
|
||||
}
|
||||
|
||||
// Orients its normal towards +Z axis
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Vector& normal = get(normal_pmap,top_point);
|
||||
#else
|
||||
const Vector& normal = get(normal_pmap,*top_point);
|
||||
#endif
|
||||
const Vector Z(0, 0, 1);
|
||||
if (Z * normal < 0) {
|
||||
CGAL_TRACE(" Flip top point normal\n");
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put(normal_pmap,top_point, -normal);
|
||||
#else
|
||||
put(normal_pmap,*top_point, -normal);
|
||||
#endif
|
||||
}
|
||||
|
||||
return top_point;
|
||||
|
|
@ -327,11 +302,7 @@ create_riemannian_graph(
|
|||
for (ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
Point_vertex_handle_3 point_wrapper(point.x(), point.y(), point.z(), it);
|
||||
kd_tree_points.push_back(point_wrapper);
|
||||
}
|
||||
|
|
@ -363,22 +334,14 @@ create_riemannian_graph(
|
|||
for (ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
std::size_t it_index = get(index_pmap,it);
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Vector it_normal_vector = get(normal_pmap,it);
|
||||
#else
|
||||
Vector it_normal_vector = get(normal_pmap,*it);
|
||||
#endif
|
||||
|
||||
// Gather set of (k+1) neighboring points.
|
||||
// Perform k+1 queries (as in point set, the query point is
|
||||
// output first). Search may be aborted if k is greater
|
||||
// than number of input points.
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
Point_vertex_handle_3 point_wrapper(point.x(), point.y(), point.z(), it);
|
||||
Neighbor_search search(*tree, point_wrapper, k+1);
|
||||
Search_iterator search_iterator = search.begin();
|
||||
|
|
@ -403,11 +366,7 @@ create_riemannian_graph(
|
|||
// Computes edge weight = 1 - | normal1 * normal2 |
|
||||
// where normal1 and normal2 are the normal at the edge extremities.
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Vector neighbor_normal_vector = get(normal_pmap,neighbor);
|
||||
#else
|
||||
Vector neighbor_normal_vector = get(normal_pmap,*neighbor);
|
||||
#endif
|
||||
double weight = 1.0 - std::abs(it_normal_vector * neighbor_normal_vector);
|
||||
if (weight < 0)
|
||||
weight = 0; // safety check
|
||||
|
|
@ -699,12 +658,8 @@ mst_orient_normals(
|
|||
{
|
||||
return mst_orient_normals(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap,
|
||||
k);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,11 +199,7 @@ pca_estimate_normals(
|
|||
std::vector<Point> kd_tree_points;
|
||||
for(it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
kd_tree_points.push_back(point);
|
||||
}
|
||||
Tree tree(kd_tree_points.begin(), kd_tree_points.end());
|
||||
|
|
@ -226,11 +222,7 @@ pca_estimate_normals(
|
|||
unsigned int i = 0;
|
||||
for(it = first; it != beyond; ++ it, ++ i)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put (normal_pmap, it, normals[i]);
|
||||
#else
|
||||
put (normal_pmap, *it, normals[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -239,19 +231,11 @@ pca_estimate_normals(
|
|||
for(it = first; it != beyond; it++)
|
||||
{
|
||||
Vector normal = internal::pca_estimate_normal<Kernel,Tree>(
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
get(point_pmap,it),
|
||||
#else
|
||||
get(point_pmap,*it),
|
||||
#endif
|
||||
tree,
|
||||
k);
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put(normal_pmap, it, normal); // normal_pmap[it] = normal
|
||||
#else
|
||||
put(normal_pmap, *it, normal); // normal_pmap[it] = normal
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -300,12 +284,8 @@ pca_estimate_normals(
|
|||
{
|
||||
pca_estimate_normals<Concurrency_tag>(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap,
|
||||
k);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,11 +83,7 @@ radial_orient_normals(
|
|||
int nb_points = 0;
|
||||
for (ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
sum = sum + (point - CGAL::ORIGIN);
|
||||
nb_points++;
|
||||
}
|
||||
|
|
@ -98,20 +94,13 @@ radial_orient_normals(
|
|||
std::deque<Enriched_point> oriented_points, unoriented_points;
|
||||
for (ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
|
||||
// Radial vector towards exterior of the point set
|
||||
Vector vec1 = point - barycenter;
|
||||
|
||||
// Point's normal
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Vector vec2 = get(normal_pmap, it);
|
||||
#else
|
||||
Vector vec2 = get(normal_pmap, *it);
|
||||
#endif
|
||||
|
||||
// -> ->
|
||||
// Orients vec2 parallel to vec1
|
||||
|
|
@ -119,11 +108,7 @@ radial_orient_normals(
|
|||
if (dot < 0)
|
||||
vec2 = -vec2;
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
put(normal_pmap, it, vec2);
|
||||
#else
|
||||
put(normal_pmap, *it, vec2);
|
||||
#endif
|
||||
|
||||
// Is orientation robust?
|
||||
bool oriented = (std::abs(dot) > std::cos(80.*CGAL_PI/180.)); // robust iff angle < 80 degrees
|
||||
|
|
@ -179,12 +164,8 @@ radial_orient_normals(
|
|||
{
|
||||
return radial_orient_normals(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
|
|||
|
|
@ -107,12 +107,8 @@ random_simplify_point_set(
|
|||
{
|
||||
return random_simplify_point_set(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<ForwardIterator>::value_type()),
|
||||
#endif
|
||||
removed_percentage);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
|
|||
|
|
@ -163,11 +163,7 @@ remove_outliers(
|
|||
std::vector<Point> kd_tree_points;
|
||||
for(it = first; it != beyond; it++)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point point = get(point_pmap, it);
|
||||
#else
|
||||
Point point = get(point_pmap, *it);
|
||||
#endif
|
||||
kd_tree_points.push_back(point);
|
||||
}
|
||||
Tree tree(kd_tree_points.begin(), kd_tree_points.end());
|
||||
|
|
@ -177,11 +173,7 @@ remove_outliers(
|
|||
for(it = first; it != beyond; it++)
|
||||
{
|
||||
FT sq_distance = internal::compute_avg_knn_sq_distance_3<Kernel>(
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
get(point_pmap,it),
|
||||
#else
|
||||
get(point_pmap,*it),
|
||||
#endif
|
||||
tree, k);
|
||||
sorted_points.insert( std::make_pair(sq_distance, *it) );
|
||||
}
|
||||
|
|
@ -241,12 +233,8 @@ remove_outliers(
|
|||
{
|
||||
return remove_outliers(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<InputIterator>::value_type()),
|
||||
#endif
|
||||
k,threshold_percent);
|
||||
}
|
||||
/// @endcond
|
||||
|
|
|
|||
|
|
@ -487,11 +487,7 @@ wlop_simplify_and_regularize_point_set(
|
|||
|
||||
for(it = first_sample_iter; it != beyond; ++it)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
sample_points.push_back(get(point_pmap, it));
|
||||
#else
|
||||
sample_points.push_back(get(point_pmap, *it));
|
||||
#endif
|
||||
}
|
||||
|
||||
//compute default neighbor_radius, if no radius in
|
||||
|
|
@ -517,11 +513,7 @@ wlop_simplify_and_regularize_point_set(
|
|||
std::vector<Kd_tree_element> original_treeElements;
|
||||
for (it = first_original_iter, i=0 ; it != beyond ; ++it, ++i)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
const Point& p0 = get(point_pmap, it);
|
||||
#else
|
||||
const Point& p0 = get(point_pmap, *it);
|
||||
#endif
|
||||
|
||||
original_treeElements.push_back(Kd_tree_element(p0, i));
|
||||
}
|
||||
|
|
@ -543,11 +535,7 @@ wlop_simplify_and_regularize_point_set(
|
|||
FT density = simplify_and_regularize_internal::
|
||||
compute_density_weight_for_original_point<Kernel, Kd_Tree>
|
||||
(
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
get(point_pmap, it),
|
||||
#else
|
||||
get(point_pmap, *it),
|
||||
#endif
|
||||
original_kd_tree,
|
||||
radius);
|
||||
|
||||
|
|
@ -696,13 +684,9 @@ wlop_simplify_and_regularize_point_set(
|
|||
return wlop_simplify_and_regularize_point_set<Concurrency_tag>(
|
||||
first, beyond,
|
||||
output,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(typename std::iterator_traits
|
||||
<RandomAccessIterator >::
|
||||
value_type()),
|
||||
#endif
|
||||
select_percentage,
|
||||
neighbor_radius,
|
||||
max_iter_number,
|
||||
|
|
|
|||
|
|
@ -134,11 +134,7 @@ bool run_pca_estimate_normals(PointList& points, // input points + output normal
|
|||
<< nb_neighbors_pca_normals << ")...\n";
|
||||
|
||||
CGAL::pca_estimate_normals<Concurrency_tag>(points.begin(), points.end(),
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
CGAL::make_normal_of_point_with_normal_pmap(points.begin()),
|
||||
#else
|
||||
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type()),
|
||||
#endif
|
||||
nb_neighbors_pca_normals);
|
||||
|
||||
std::size_t memory = CGAL::Memory_sizer().virtual_size();
|
||||
|
|
@ -162,11 +158,7 @@ bool run_jet_estimate_normals(PointList& points, // input points + output normal
|
|||
<< nb_neighbors_jet_fitting_normals << ")...\n";
|
||||
|
||||
CGAL::jet_estimate_normals<Concurrency_tag>(points.begin(), points.end(),
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
CGAL::make_normal_of_point_with_normal_pmap(points.begin()),
|
||||
#else
|
||||
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type()),
|
||||
#endif
|
||||
nb_neighbors_jet_fitting_normals);
|
||||
|
||||
std::size_t memory = CGAL::Memory_sizer().virtual_size();
|
||||
|
|
@ -255,11 +247,7 @@ bool run_mst_orient_normals(PointList& points, // input points + input/output no
|
|||
|
||||
PointList::iterator unoriented_points_begin =
|
||||
CGAL::mst_orient_normals(points.begin(), points.end(),
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
CGAL::make_normal_of_point_with_normal_pmap(points.begin()),
|
||||
#else
|
||||
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type()),
|
||||
#endif
|
||||
nb_neighbors_mst);
|
||||
|
||||
std::size_t memory = CGAL::Memory_sizer().virtual_size();
|
||||
|
|
@ -331,11 +319,7 @@ int main(int argc, char * argv[])
|
|||
success = stream &&
|
||||
CGAL::read_off_points_and_normals(stream,
|
||||
std::back_inserter(points),
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
CGAL::make_normal_of_point_with_normal_pmap(std::back_inserter(points))
|
||||
#else
|
||||
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
// If XYZ file format
|
||||
|
|
@ -346,11 +330,7 @@ int main(int argc, char * argv[])
|
|||
success = stream &&
|
||||
CGAL::read_xyz_points_and_normals(stream,
|
||||
std::back_inserter(points),
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
CGAL::make_normal_of_point_with_normal_pmap(std::back_inserter(points))
|
||||
#else
|
||||
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type())
|
||||
#endif
|
||||
);
|
||||
}
|
||||
if (success)
|
||||
|
|
@ -423,4 +403,3 @@ int main(int argc, char * argv[])
|
|||
std::cerr << "Tool returned " << accumulated_fatal_err << std::endl;
|
||||
return accumulated_fatal_err;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -339,12 +339,8 @@ public:
|
|||
, average_spacing(CGAL::compute_average_spacing<CGAL::Sequential_tag>(first, beyond, 6))
|
||||
{
|
||||
forward_constructor(first, beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<InputIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap, Poisson_visitor());
|
||||
CGAL::Timer task_timer; task_timer.start();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,11 +384,7 @@ public:
|
|||
//std::vector<Point_with_normal> points;
|
||||
for (InputIterator it = first; it != beyond; ++it)
|
||||
{
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
Point_with_normal pwn(get(point_pmap,it), get(normal_pmap,it));
|
||||
#else
|
||||
Point_with_normal pwn(get(point_pmap,*it), get(normal_pmap,*it));
|
||||
#endif
|
||||
points.push_back(pwn);
|
||||
}
|
||||
std::size_t n = points.size();
|
||||
|
|
@ -453,12 +449,8 @@ public:
|
|||
{
|
||||
return insert(
|
||||
first,beyond,
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
make_dereference_property_map(first),
|
||||
#else
|
||||
make_identity_property_map(
|
||||
typename std::iterator_traits<InputIterator>::value_type()),
|
||||
#endif
|
||||
normal_pmap,
|
||||
visitor);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,11 +145,7 @@ int main(int argc, char * argv[])
|
|||
!CGAL::read_xyz_points_and_normals(
|
||||
stream,
|
||||
std::back_inserter(points),
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
CGAL::make_normal_of_point_with_normal_pmap(std::back_inserter(points))
|
||||
#else
|
||||
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type())
|
||||
#endif
|
||||
))
|
||||
{
|
||||
std::cerr << "Error: cannot read file " << input_filename << std::endl;
|
||||
|
|
@ -206,11 +202,7 @@ int main(int argc, char * argv[])
|
|||
// The position property map can be omitted here as we use iterators over Point_3 elements.
|
||||
Poisson_reconstruction_function function(
|
||||
points.begin(), points.end(),
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
CGAL::make_normal_of_point_with_normal_pmap(points.begin())
|
||||
#else
|
||||
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type())
|
||||
#endif
|
||||
);
|
||||
|
||||
// Computes the Poisson indicator function f()
|
||||
|
|
@ -307,4 +299,3 @@ int main(int argc, char * argv[])
|
|||
std::cerr << "Tool returned " << accumulated_fatal_err << std::endl;
|
||||
return accumulated_fatal_err;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,42 +163,6 @@ Identity_property_map<T>
|
|||
}
|
||||
|
||||
|
||||
//=========================================================================
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
/// \ingroup PkgProperty_map
|
||||
/// Property map that accesses the first item of a `std::pair`.
|
||||
/// \tparam Pair Instance of `std::pair`.
|
||||
/// \cgalModels `LvaluePropertyMap`
|
||||
///
|
||||
/// \sa `CGAL::Second_of_pair_property_map<Pair>`
|
||||
template <typename Pair>
|
||||
struct First_of_pair_property_map
|
||||
: public boost::put_get_helper<typename Pair::first_type&,
|
||||
First_of_pair_property_map<Pair> >
|
||||
{
|
||||
typedef Pair* key_type; ///< typedef to `Pair*`
|
||||
typedef typename Pair::first_type value_type; ///< typedef to `Pair::first_type`
|
||||
typedef value_type& reference; ///< typedef to `value_type&`
|
||||
typedef boost::lvalue_property_map_tag category; ///< boost::lvalue_property_map_tag
|
||||
|
||||
/// Access a property map element.
|
||||
///
|
||||
/// @tparam Iter Type convertible to `key_type`.
|
||||
template <class Iter>
|
||||
reference operator[](Iter pair) const { return reference(pair->first); }
|
||||
};
|
||||
|
||||
/// Free function to create a `First_of_pair_property_map` property map.
|
||||
///
|
||||
/// \relates First_of_pair_property_map
|
||||
template <class Iter> // Type convertible to key_type
|
||||
First_of_pair_property_map<typename CGAL::value_type_traits<Iter>::type>
|
||||
make_first_of_pair_property_map(Iter)
|
||||
{
|
||||
// value_type_traits is a workaround as back_insert_iterator's value_type is void
|
||||
return First_of_pair_property_map<typename CGAL::value_type_traits<Iter>::type>();
|
||||
}
|
||||
#else
|
||||
/// \ingroup PkgProperty_map
|
||||
/// Property map that accesses the first item of a `std::pair`.
|
||||
/// \tparam Pair Instance of `std::pair`.
|
||||
|
|
@ -235,46 +199,7 @@ First_of_pair_property_map<Pair>
|
|||
{
|
||||
return First_of_pair_property_map<Pair>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
/// \ingroup PkgProperty_map
|
||||
///
|
||||
/// Property map that accesses the second item of a `std::pair`.
|
||||
///
|
||||
/// \tparam Pair Instance of `std::pair`.
|
||||
///
|
||||
/// \cgalModels `LvaluePropertyMap`
|
||||
///
|
||||
/// \sa `CGAL::First_of_pair_property_map<Pair>`
|
||||
template <typename Pair>
|
||||
struct Second_of_pair_property_map
|
||||
: public boost::put_get_helper<typename Pair::second_type&,
|
||||
Second_of_pair_property_map<Pair> >
|
||||
{
|
||||
typedef Pair* key_type; ///< typedef to `Pair*`
|
||||
typedef typename Pair::second_type value_type; ///< typedef to `Pair::second_type`
|
||||
typedef value_type& reference; ///< typedef to `value_type&`
|
||||
typedef boost::lvalue_property_map_tag category; ///< `boost::lvalue_property_map_tag`
|
||||
|
||||
/// Access a property map element.
|
||||
///
|
||||
/// @tparam Iter Type convertible to `key_type`.
|
||||
template <class Iter>
|
||||
reference operator[](Iter pair) const { return reference(pair->second); }
|
||||
};
|
||||
|
||||
/// Free function to create a Second_of_pair_property_map property map.
|
||||
///
|
||||
/// \relates Second_of_pair_property_map
|
||||
template <class Iter> // Type convertible to key_type
|
||||
Second_of_pair_property_map<typename CGAL::value_type_traits<Iter>::type>
|
||||
make_second_of_pair_property_map(Iter)
|
||||
{
|
||||
// value_type_traits is a workaround as back_insert_iterator's value_type is void
|
||||
return Second_of_pair_property_map<typename CGAL::value_type_traits<Iter>::type>();
|
||||
}
|
||||
#else
|
||||
/// \ingroup PkgProperty_map
|
||||
///
|
||||
/// Property map that accesses the second item of a `std::pair`.
|
||||
|
|
@ -314,49 +239,7 @@ Second_of_pair_property_map<Pair>
|
|||
{
|
||||
return Second_of_pair_property_map<Pair>();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//=========================================================================
|
||||
|
||||
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
|
||||
/// \ingroup PkgProperty_map
|
||||
///
|
||||
/// Property map that accesses the Nth item of a `boost::tuple`.
|
||||
///
|
||||
/// \tparam N %Index of the item to access.
|
||||
/// \tparam Tuple Instance of `boost::tuple`.
|
||||
///
|
||||
/// \cgalModels `LvaluePropertyMap`
|
||||
template <int N, typename Tuple>
|
||||
struct Nth_of_tuple_property_map
|
||||
: public boost::put_get_helper<typename boost::tuples::element<N,Tuple>::type&,
|
||||
Nth_of_tuple_property_map<N,Tuple> >
|
||||
{
|
||||
typedef Tuple* key_type; ///< typedef to `Tuple*`
|
||||
typedef typename boost::tuples::element<N,Tuple>::type value_type; ///< typedef to `boost::tuples::element<N,Tuple>::%type`
|
||||
typedef value_type& reference; ///< typedef to `value_type&`
|
||||
typedef boost::lvalue_property_map_tag category; ///< `boost::lvalue_property_map_tag`
|
||||
|
||||
/// Access a property map element.
|
||||
///
|
||||
/// @tparam Iter Type convertible to `key_type`.
|
||||
template <class Iter>
|
||||
reference operator[](Iter tuple) const { return (reference) tuple->template get<N>(); }
|
||||
};
|
||||
|
||||
/// Free function to create a Nth_of_tuple_property_map property map.
|
||||
///
|
||||
/// \relates Nth_of_tuple_property_map
|
||||
template <int N, class Iter> // Type convertible to key_type
|
||||
Nth_of_tuple_property_map<N, typename CGAL::value_type_traits<Iter>::type>
|
||||
make_nth_of_tuple_property_map(Iter)
|
||||
{
|
||||
// value_type_traits is a workaround as back_insert_iterator's `value_type` is void
|
||||
return Nth_of_tuple_property_map<N, typename CGAL::value_type_traits<Iter>::type>();
|
||||
}
|
||||
#else
|
||||
/// \ingroup PkgProperty_map
|
||||
///
|
||||
/// Property map that accesses the Nth item of a `boost::tuple`.
|
||||
|
|
@ -394,7 +277,6 @@ Nth_of_tuple_property_map<N, Tuple>
|
|||
{
|
||||
return Nth_of_tuple_property_map<N, Tuple>();
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue