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