Merge remote-tracking branch 'remotes/orth/orthtree-generalization' into Kinetic_shape_reconstruction-new_package-soesau

This commit is contained in:
Sven Oesau 2023-11-08 08:58:25 +01:00
commit b26e22bca8
186 changed files with 112975 additions and 111121 deletions

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsInteroperabilityConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
Two types `A` and `B` are a model of the `ExplicitInteroperable` Two types `A` and `B` are a model of the `ExplicitInteroperable`
@ -27,4 +27,3 @@ class ExplicitInteroperable {
public: public:
}; /* end ExplicitInteroperable */ }; /* end ExplicitInteroperable */

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsFractionsConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
A type is considered as a `Fraction`, if there is a reasonable way to A type is considered as a `Fraction`, if there is a reasonable way to
@ -17,4 +17,3 @@ class Fraction {
public: public:
}; /* end Fraction */ }; /* end Fraction */

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
A model of the concept `FromDoubleConstructible` is required A model of the concept `FromDoubleConstructible` is required
@ -27,4 +27,3 @@ FromDoubleConstructible(const double& d);
/// @} /// @}
}; /* end FromDoubleConstructible */ }; /* end FromDoubleConstructible */

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
A model of the concept `FromIntConstructible` is required A model of the concept `FromIntConstructible` is required
@ -28,4 +28,3 @@ FromIntConstructible(int& i);
/// @} /// @}
}; /* end FromIntConstructible */ }; /* end FromIntConstructible */

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsInteroperabilityConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
Two types `A` and `B` are a model of the concept Two types `A` and `B` are a model of the concept
@ -29,4 +29,3 @@ class ImplicitInteroperable {
public: public:
}; /* end ImplicitInteroperable */ }; /* end ImplicitInteroperable */

View File

@ -1,19 +1,16 @@
#ifndef CGAL_APOLLONIUS_GRAPH_2_TEST_H #ifndef CGAL_APOLLONIUS_GRAPH_2_TEST_H
#define CGAL_APOLLONIUS_GRAPH_2_TEST_H #define CGAL_APOLLONIUS_GRAPH_2_TEST_H
#include <cassert>
#include <CGAL/enum.h>
#include <CGAL/use.h>
#include <CGAL/Vector_2.h> // this is done in order to avoid error
// when the Segment_2_Segment_2_intersection.h file is included from
// the Triangulation_euclidean_traits_2.h file.
#include <CGAL/Apollonius_graph_2.h> #include <CGAL/Apollonius_graph_2.h>
#include <CGAL/Apollonius_graph_hierarchy_2.h> #include <CGAL/Apollonius_graph_hierarchy_2.h>
#include <CGAL/Apollonius_graph_traits_2.h> #include <CGAL/Apollonius_graph_traits_2.h>
#include <CGAL/Apollonius_graph_filtered_traits_2.h> #include <CGAL/Apollonius_graph_filtered_traits_2.h>
//#include <CGAL/new_traits/Apollonius_graph_new_filtered_traits_2.h>
#include <cassert>
#include <CGAL/enum.h>
#include <CGAL/use.h>
#include <CGAL/Random.h>
#include "IO/Null_output_stream.h" #include "IO/Null_output_stream.h"
@ -839,24 +836,29 @@ bool test_algo_generic(InputStream& is)
// file I/O methods // file I/O methods
//-------------------------------------------------------------------- //--------------------------------------------------------------------
{ {
std::ofstream ofs("ag_testsuite.tmp"); std::string fname = "ag_testsuite_" + std::to_string(CGAL::Random().get_seed()) + ".tmp";
std::cout << "writing to " << fname << std::endl;
std::ofstream ofs(fname);
assert( ofs ); assert( ofs );
ag.file_output(ofs); ag.file_output(ofs);
ofs.close(); ofs.close();
std::ifstream ifs("ag_testsuite.tmp"); std::ifstream ifs(fname);
assert( ifs ); assert( ifs );
ag.file_input(ifs); ag.file_input(ifs);
ifs.close(); ifs.close();
assert( ag.is_valid() ); assert( ag.is_valid() );
} }
{ {
std::ofstream ofs("ag_testsuite.tmp"); std::string fname = "ag_testsuite_" + std::to_string(CGAL::Random().get_seed()) + ".tmp";
std::cout << "writing to " << fname << std::endl;
std::ofstream ofs(fname);
assert( ofs ); assert( ofs );
ofs << ag; ofs << ag;
ofs.close(); ofs.close();
std::ifstream ifs("ag_testsuite.tmp"); std::ifstream ifs(fname);
assert( ifs ); assert( ifs );
ifs >> ag; ifs >> ag;
ifs.close(); ifs.close();

View File

@ -5651,10 +5651,24 @@ must model the basic concept `ArrangementBasicTopologyTraits`. A model
of this basic concept holds the (\dcel) data structure used to of this basic concept holds the (\dcel) data structure used to
represent the arrangement cells (i.e., vertices, edges, and facets) represent the arrangement cells (i.e., vertices, edges, and facets)
and the incidence relations between them. At this point we do not and the incidence relations between them. At this point we do not
expose the concepts that refine the basic concept. The package expose the concepts that refine the basic concept. The package
contains one topology traits, namely, contains three topology traits class templates, namely,
`Arr_spherical_topology_traits_2`. It can serve as a topology traits `Arr_bounded_planar_topology_traits_2`,
for an arrangement embedded on a sphere. More precisely, for an `Arr_unb_planar_topology_traits_2`, and
`Arr_spherical_topology_traits_2`. The first two are internally used
to define any instance of the class template
`Arrangement_2<GeometryTraits_2, Dcel>`. In particular, an instance
`Arrangement_2<Geometry_traits_2, Dcel_>` is derived from the instance
`Arrangement_on_surface_2<Geometry_traits_2,Topology_traits>`, where
the `Topology_traits` type is selected based on the provided geometry
traits `Geometry_traits_2`, or more precisely, on the boundary
conditions defined by the geometry traits. If all sides of the
boundary of the parameter space are closed, the instance
`Arr_bounded_planar_topology_traits_2<Geometry_traits_2,Dcel_>` is
selected; otherwise the instance
`Arr_unb_planar_topology_traits_2<Geometry_traits_2,Dcel_>` is
selected. The third topology traits serves as a topology traits for
an arrangement embedded on a sphere. More precisely, for an
arrangement embedded on a sphere defined over a parameter space, the arrangement embedded on a sphere defined over a parameter space, the
left and right boundary sides of which are identified, and the top and left and right boundary sides of which are identified, and the top and
bottom boundary sides are contracted. bottom boundary sides are contracted.

View File

@ -26,45 +26,37 @@ one of the integral types above.
*/ */
template< typename Coefficient > template <typename Coefficient>
class Arr_algebraic_segment_traits_2 { class Arr_algebraic_segment_traits_2 {
public: public:
/// \name Types /// \name Types
/// @{ /// @{
/*! /*! Value to specify whether a point should be in the interior of a segment, or
Value to specify whether a point should be in the interior * its minimal point, or its maximal point in lexicographic order.
of a segment, or its minimal point, */
or its maximal point in lexicographic order.
*/
enum Site_of_point { POINT_IN_INTERIOR = 0, MIN_ENDPOINT = -1, MAX_ENDPOINT = 1 }; enum Site_of_point { POINT_IN_INTERIOR = 0, MIN_ENDPOINT = -1, MAX_ENDPOINT = 1 };
/*! /*! the type for bivariate polynomials, with innermost coefficient type
the type for bivariate polynomials, * `Coefficient`. Constitutes a model of the concept `Polynomial_d` with two
with innermost coefficient type `Coefficient`. * variables.
Constitutes a model of the concept `Polynomial_d` *
with two variables. * \sa `CGAL::Polynomial_d`
*/
\sa `CGAL::Polynomial_d`
*/
typedef unspecified_type Polynomial_2; typedef unspecified_type Polynomial_2;
/*! /*! model for the concept `AlgebraicKernel_1`
model for the concept */
`AlgebraicKernel_1`
*/
typedef unspecified_type Algebraic_kernel_1; typedef unspecified_type Algebraic_kernel_1;
/*! /*! represents coordinates of points.
represents coordinates of points. * Typedef from `Algebraic_kernel_1::Algebraic_real_1`
Typedef from `Algebraic_kernel_1::Algebraic_real_1` */
*/
typedef unspecified_type Algebraic_real_1; typedef unspecified_type Algebraic_real_1;
/*! /*! Typedef from `Algebraic_kernel_1::Bound`
Typedef from `Algebraic_kernel_1::Bound` */
*/
typedef unspecified_type Bound; typedef unspecified_type Bound;
/// @} /// @}
@ -74,46 +66,41 @@ typedef unspecified_type Bound;
/*! /*!
*/ */
Construct_curve_2 construct_curve_2_object() const; Construct_curve_2 construct_curve_2_object() const;
/*! /*!
*/ */
Construct_point_2 construct_point_2_object() const; Construct_point_2 construct_point_2_object() const;
/*! /*!
*/ */
Construct_x_monotone_segment_2 construct_x_monotone_segment_2_object() const; Construct_x_monotone_segment_2 construct_x_monotone_segment_2_object() const;
/// @} /// @}
/*! /*!
*/
*/
class Construct_curve_2 { class Construct_curve_2 {
public: public:
/// \name Object Creation Functors /// \name Object Creation Functors
/// @{ /// @{
/*! /*! Returns a `Curve_2` object that represents the curve defined by the
Returns a `Curve_2` object that represents the curve defined by * polynomial `p`
the polynomial `p` */
*/
Curve_2 operator() (Polynomial_2 p); Curve_2 operator() (Polynomial_2 p);
/*! /*! Returns a `Curve_2` object specified by `s`. The passed string represents
Returns a `Curve_2` object specified by `s`. * the defining polynomial of the curve and must be given in a MAPLE-readable
The passed string represents the defining polynomial of the curve * format using "x" as first and "y" as second variable, e.g.,
and must be given in a MAPLE-readable format using "x" as first * \f$(x^3*y-2*x)*(-6*x-y^3*x^6)\f$ for integer coefficients, and
and "y" as second variable, e.g., * \f$3/2*x*y^4-5/7*x^2+3/1\f$ for rational coefficients.
"(x^3*y-2*x)*(-6*x-y^3*x^6)" */
for integer coefficients, and "3/2*x*y^4-5/7*x^2+3/1"
for rational coefficients.
*/
Curve_2 operator() (std::string s); Curve_2 operator() (std::string s);
/// @} /// @}
@ -122,49 +109,42 @@ Curve_2 operator() (std::string s);
/*! /*!
*/
*/
class Construct_point_2 { class Construct_point_2 {
public: public:
/// \name Object Creation Functors /// \name Object Creation Functors
/// @{ /// @{
/*! /*! Returns a `Point_2` object that represents the `arcno`-th
Returns a `Point_2` object that represents the `arcno`-th * point in the fiber of `cv` at \f$ x\f$-coordinate `x`,
point in the fiber of `cv` at \f$ x\f$-coordinate `x`, * counted from the bottom, starting with zero.
counted from the bottom, starting with zero. * \pre (`cv` must not have a vertical line at `x`,
\pre (`cv` must not have a vertical line at `x`, * and \f$ 0\leq arcno < c\f$, where \f$ c\f$ is the number of points
and \f$ 0\leq arcno < c\f$, where \f$ c\f$ is the number of points * in the fiber of `cv` at `x`.)
in the fiber of `cv` at `x`.) */
*/
Point_2 operator() (Algebraic_real_1 x, Curve_2 cv, int arcno); Point_2 operator() (Algebraic_real_1 x, Curve_2 cv, int arcno);
/*! /*! Returns a `Point_2` object that represents the
Returns a `Point_2` object that represents the * point on `xcv` at \f$ x\f$-coordinate `x`
point on `xcv` at \f$ x\f$-coordinate `x` * \pre (`x` is in the \f$ x\f$-range of `xcv`.)
\pre (`x` is in the \f$ x\f$-range of `xcv`.) */
*/
Point_2 operator() (Algebraic_real_1 x, X_monotone_curve_2 xcv); Point_2 operator() (Algebraic_real_1 x, X_monotone_curve_2 xcv);
/*! /*! Returns a `Point_2` object that represents (x,y)
Returns a `Point_2` object that represents (x,y) */
*/
Point_2 operator() (Algebraic_real_1 x, Algebraic_real_1 y); Point_2 operator() (Algebraic_real_1 x, Algebraic_real_1 y);
/*! /*! Returns a `Point_2` object that represents (x,y)
Returns a `Point_2` object that represents (x,y) */
*/
Point_2 operator() (Coefficient x, Coefficient y); Point_2 operator() (Coefficient x, Coefficient y);
/*! /*! Returns a `Point_2` object that represents (x,y)
Returns a `Point_2` object that represents (x,y) */
*/
Point_2 operator() (Bound x, Bound y); Point_2 operator() (Bound x, Bound y);
/*! /*! Returns a `Point_2` object that represents (x,y)
Returns a `Point_2` object that represents (x,y) */
*/
Point_2 operator() (int x, int y); Point_2 operator() (int x, int y);
/// @} /// @}
@ -173,91 +153,86 @@ Point_2 operator() (int x, int y);
/*! /*!
*/
*/
class Construct_x_monotone_segment_2 { class Construct_x_monotone_segment_2 {
public: public:
/// \name Object Creation Functors /// \name Object Creation Functors
/// @{ /// @{
/*! /*! inserts a sequence of `X_monotone_curve_2` objects (terminal segments) into
Writes a sequence of `X_monotone_curve_2` objects (terminal * an output container given through an output iterator. These terminal segments
segments) into `out`. These terminal segments compose an * compose an \f$x\f$-monotone (or vertical) segment of a given curve that
\f$ x\f$-monotone (or vertical) segment of the curve `cv` that * starts in `end_min`, and ends in `end_max`.
starts in `end_min`, and ends in `end_max`. *
\pre (`end_min` must have a unique \f$ x\f$-monotone segment * \param cv The input curve.
to its right, or `end_max` must have a unique * \param end_min The starting point.
\f$ x\f$-monotone segment to its left. Furthermore, * \param end_max The ending point.
`end_min` and `end_max` must be connected * \param oi The output iterator that points at the output container.
by an \f$ x\f$-monotone segment of `cv`) * \return The past-the-end iterator of the output container.
*/ *
template<class OutputIterator> OutputIterator * \pre `end_min` must have a unique \f$x\f$-monotone segment to its right, or
operator() (Curve_2 cv, Point_2 end_min, Point_2 end_max, * `end_max` must have a unique \f$x\f$-monotone segment to its left.
OutputIterator out); * Furthermore, `end_min` and `end_max` must be connected by an
* \f$x\f$-monotone segment of `cv`)
*/
template <typename OutputIterator>
OutputIterator operator() (Curve_2 cv, Point_2 end_min, Point_2 end_max,
OutputIterator oi);
/*! /*! inserts a sequence of `X_monotone_curve_2` objects into an output container
Writes a sequence of `X_monotone_curve_2` objects into `out`. * given through an output iterator. These segments form an \f$x\f$-monotone
These segments form an \f$ x\f$-monotone (or vertical) * (or vertical) segment of the curve `cv`.
segment of the curve `cv`. *
* If `site_of_p==POINT_IN_INTERIOR`, the maximal segment is
* returned that contains `p` in its interior.
*
* returned that contains `p` as its left endpoint.
*
* returned that contains `p` as its left endpoint.
*
* \pre (If `site_of_p==POINT_IN_INTERIOR`, `p`
* must be an interior point of an \f$x\f$-monotone or a vertical
* segment.
* must either have a unique \f$x\f$-monotone segment to the right,
* or a vertical segment from `p` upwards.
* must either have a unique \f$x\f$-monotone segment to the left,
* or a vertical segment from `p` downwards.)
*/
template <typename OutputIterator>
OutputIterator operator() (Curve_2 cv, Point_2 p, Site_of_point site_of_p,
OutputIterator out);
If `site_of_p==POINT_IN_INTERIOR`, the maximal segment is /*! inserts a sequence of `X_monotone_curve_2` objects into an output container
returned that contains `p` in its interior. * given through an output iterator. These segments form a straight-line
* segment connecting the points `p` and `q`. If `p` and `q` share the same
returned that contains `p` as its left endpoint. * \f$x\f$-coordinate, the constructed vertical segment consists of only one
* `X_monotone_curve_2` object and can be computed efficiently. In the
returned that contains `p` as its left endpoint. * non-vertical case, the construction is only possible if `p` and `q` have both
\pre (If `site_of_p==POINT_IN_INTERIOR`, `p` * rational x- and y-coordinates.
must be an interior point of an \f$ x\f$-monotone or a vertical *
segment. * \pre (`p` must not be equal to `q`.)
must either have a unique \f$ x\f$-monotone segment to the right, */
or a vertical segment from `p` upwards. template <typename OutputIterator>
must either have a unique \f$ x\f$-monotone segment to the left, OutputIterator operator() (Point_2 p, Point_2 q, OutputIterator out);
or a vertical segment from `p` downwards.)
*/
template<class OutputIterator> OutputIterator
operator() (Curve_2 cv, Point_2 p,
Site_of_point site_of_p,
OutputIterator out);
/*!
Writes a sequence of `X_monotone_curve_2` objects into `out`.
These segments form a straight-line segment connecting
the points `p` and `q`. If `p` and `q` share the
same \f$ x\f$-coordinate, the constructed vertical segment consists of
only one `X_monotone_curve_2` object and can be computed
efficiently. In the non-vertical case,
the construction is only possible if `p` and `q`
have both rational x- and y-coordinates.
\pre (`p` must not be equal to `q`.)
*/
template<class OutputIterator> OutputIterator
operator() (Point_2 p, Point_2 q,
OutputIterator out);
/// @} /// @}
}; /* end Arr_algebraic_segment_traits_2::Construct_x_monotone_segment_2 */ }; /* end Arr_algebraic_segment_traits_2::Construct_x_monotone_segment_2 */
/*! /*! Models the `ArrangementTraits_2::Curve_2` concept.
* Represents algebraic curves. Internally, the type stores
* topological-geometric information about the particular curve.
Models the `ArrangementTraits_2::Curve_2` concept. * In order to use internal caching, instances should only be created
Represents algebraic curves. Internally, the type stores * using the `Construct_curve_2` functor of the traits class.
topological-geometric information about the particular curve. */
In order to use internal caching, instances should only be created
using the `Construct_curve_2` functor of the traits class.
*/
class Curve_2 { class Curve_2 {
public: public:
/// \name Modifiers /// \name Modifiers
/// @{ /// @{
/*! /*! returns the defining polynomial of the curve.
returns the defining polynomial of the curve.
*/ */
Polynomial_2 polynomial () const; Polynomial_2 polynomial () const;
@ -265,124 +240,105 @@ Polynomial_2 polynomial () const;
}; /* end Arr_algebraic_segment_traits_2::Curve_2 */ }; /* end Arr_algebraic_segment_traits_2::Curve_2 */
/*! /*! Models the `ArrangementBasicTraits_2::Point_2` concept.
* Represents points in \f$ \mathbb{R}^2\f$. Intersection points of algebraic
* curves are in general non-rational, so we need a data structure that is
* capable of representing arbitrary points with algebraic coordinates.
*
* The traits class represents algebraic coordinates by the type
* `Algebraic_real_1`, which is a model of the `AlgebraicReal_1` concept.
* A point \f$ p\f$ is stored by a triple \f$ (x,cv,arcno)\f$,
* where \f$ x\f$ is the \f$ x\f$-coordinate of a point, \f$ cv\f$ is an instance
* of `Curve_2` that contains the point, (and has no vertical line at \f$ x\f$),
* and \f$ arcno\f$ is an `int`, denoting that \f$ p\f$ is met as the
* \f$arcno\f$-th point when shooting a vertical ray at \f$ x\f$, starting from
* \f$-\infty\f$ (where counting starts with \f$ 0\f$).
*
* In addition to the methods listed below, the copy constructor and assignment
* operator for `Point_2` objects are also supported.
*
* The functor `Construct_point_2` constructs `Point_2` instances.
*/
Models the `ArrangementBasicTraits_2::Point_2` concept.
Represents points in \f$ \mathbb{R}^2\f$. Intersection points of algebraic curves
are in general non-rational, so we need a data structure that is capable
of representing arbitrary points with algebraic coordinates.
The traits class represents algebraic coordinates by the type
`Algebraic_real_1`, which is a model of the `AlgebraicReal_1`
concept.
A point \f$ p\f$ is stored by a triple \f$ (x,cv,arcno)\f$,
where \f$ x\f$ is the \f$ x\f$-coordinate of a point, \f$ cv\f$ is an instance
of `Curve_2` that contains the point, (and has no vertical line at \f$ x\f$),
and \f$ arcno\f$ is an `int`, denoting that \f$ p\f$ is met as the \f$ arcno\f$-th
point when shooting a vertical ray at \f$ x\f$, starting from \f$ -\infty\f$
(where counting starts with \f$ 0\f$).
In addition to the methods listed below, the copy constructor and assignment
operator for `Point_2` objects are also supported.
The functor `Construct_point_2` constructs `Point_2` instances.
*/
class Point_2 { class Point_2 {
public: public:
/// \name Modifiers /// \name Modifiers
/// @{ /// @{
/*! /*! returns the \f$ x\f$-coordinate of `p`.
returns the \f$ x\f$-coordinate of `p`. */
*/
Algebraic_real_1 x () const; Algebraic_real_1 x () const;
/*! /*! returns the \f$ y\f$-coordinates of `p`.
returns the \f$ y\f$-coordinates of `p`. *
* <B>Attention:</B> As described above, points are not stored
<B>Attention:</B> As described above, points are not stored * by their \f$ y\f$-coordinate in `Algebraic_real_1` representation. In fact,
by their \f$ y\f$-coordinate in `Algebraic_real_1` representation. In fact, * this representation must be computed on demand, and might become quite
this representation must be computed on demand, and might become quite * costly for points defined by high-degree polynomials. Therefore, it is
costly for points defined by high-degree polynomials. Therefore, it is * recommended to avoid to call this function as much as possible.
recommended to avoid to call this function as much as possible. */
*/
Algebraic_real_1 y () const; Algebraic_real_1 y () const;
/*! /*! returns a `Curve_2` instance that `p`is part of.
returns a `Curve_2` instance that `p`is part of. */
*/
Curve_2 curve () const; Curve_2 curve () const;
/*! /*! returns the arc number of `p`.
returns the arc number of `p`. */
*/
int arcno () const; int arcno () const;
/*! /*! returns double-approximations of the \f$ x\f$- and \f$ y\f$-coordinates.
returns double-approximations of the \f$ x\f$- and \f$ y\f$-coordinates. */
*/
std::pair<double,double> to_double () const; std::pair<double,double> to_double () const;
/// @} /// @}
}; /* end Arr_algebraic_segment_traits_2::Point_2 */ }; /* end Arr_algebraic_segment_traits_2::Point_2 */
/*! /*! Models the `ArrangementBasicTraits_2::X_monotone_curve_2` concept.
* Represents terminal segments of an algebraic curves, that means vertical
* segments or \f$ x\f$-monotone segments with no critical \f$ x\f$-coordinate
Models the `ArrangementBasicTraits_2::X_monotone_curve_2` concept. * in the interior of their \f$ x\f$-range. Terminal segments might either be
Represents terminal segments of an algebraic curves, * bounded or unbounded. By definition, each interior point of a non-vertical
that means vertical segments or \f$ x\f$-monotone segments with no critical * segment has the same arc number (see the documentation of type `Point_2`
\f$ x\f$-coordinate in the interior of their \f$ x\f$-range. * above, which is called the <I>arc number</I> of the segment (note the arc
Terminal segments might either be bounded or unbounded. * number at the endpoints might differ). Such segments are represented
By definition, each interior point of * internally by a 4-tuple \f$ (p,q,cv,arcno)\f$, where \f$ p\f$ and \f$ q\f$
a non-vertical segment has the same arc number (see the documentation of * are the endpoints, \f$ cv\f$ is the <I>supporting curve</I> that the segment
type `Point_2` above, which is called the <I>arc number</I> of the segment * belongs to, and arcno is the arc number of the segment.
(note the arc number at the endpoints might differ). *
Such segments are represented internally by a 4-tuple \f$ (p,q,cv,arcno)\f$, * Arbitrary (weakly) \f$ x\f$-monotone segments are presented by a range
where \f$ p\f$ and \f$ q\f$ are the endpoints, \f$ cv\f$ is the <I>supporting curve</I> * of `X_monotone_curve_2` instances, whose union equals the segment.
that the segment belongs to, and arcno is the arc number of the segment. * The functor `Construct_x_monotone_segment_2` allows their construction.
* To construct all (maximal) terminal segments of a curve,
Arbitrary (weakly) \f$ x\f$-monotone segments are presented by a range * use the `Make_x_monotone_2` functor supplied by the traits class.
of `X_monotone_curve_2` instances, whose union equals the segment. */
The functor `Construct_x_monotone_segment_2` allows their construction.
To construct all (maximal) terminal segments of a curve,
use the `Make_x_monotone_2` functor supplied by the traits class.
*/
class X_monotone_curve_2 { class X_monotone_curve_2 {
public: public:
/// \name Modifiers /// \name Modifiers
/// @{ /// @{
/*! /*! returns the supporting algebraic curve of `s`.
returns the supporting algebraic curve of `s`. */
*/
Curve_2 curve () const; Curve_2 curve () const;
/*! /*! returns whether `s` is a vertical segment.
returns whether `s` is a vertical segment. */
*/
bool is_vertical () const; bool is_vertical () const;
/*! /*! returns whether `s` has a finite endpoint on the left
returns whether `s` has a finite endpoint on the left */
*/
bool is_finite (CGAL::Arr_curve_end ce) const; bool is_finite (CGAL::Arr_curve_end ce) const;
/*! /*! \pre (The corresponding curve end is finite)
\pre (The corresponding curve end is finite) */
*/
Point_2 curve_end (CGAL::Arr_curve_end ce) const; Point_2 curve_end (CGAL::Arr_curve_end ce) const;
/*! /*! returns the arc number of the segment.
returns the arc number of the segment. * \pre (The segment is non-vertical)
\pre (The segment is non-vertical) */
*/
int arcno () const; int arcno () const;
/*! /*!
@ -395,8 +351,6 @@ Algebraic_real_1 x () const;
}; /* end Arr_algebraic_segment_traits_2::X_monotone_curve_2 */ }; /* end Arr_algebraic_segment_traits_2::X_monotone_curve_2 */
}; /* end Arr_algebraic_segment_traits_2 */ }; /* end Arr_algebraic_segment_traits_2 */
} /* end namespace CGAL */ } /* end namespace CGAL */

View File

@ -1,36 +1,38 @@
namespace CGAL { namespace CGAL {
/*! /*! \ingroup PkgArrangementOnSurface2PointLocation
\ingroup PkgArrangementOnSurface2PointLocation *
* performs a batched point-location operation on a given arrangement. It
Performs a batched point-location operation on a * accepts a collection of query points, locates each point in a given
given arrangement. It accepts a range of query points, and locates each * arrangement, and inserts the query results into an output container given
point in the arrangement. The query results are returned through the output * through an output iterator. Each query result is given as a pair of the query
iterator. Each query result is given as a pair of the query point and an * point and an object representing the arrangement feature that contains it,
object representing the arrangement feature that contains it, namely a * namely a discriminated union container of the types `Face_const_handle`,
discriminated union container of the bounded types `Face_const_handle`, * `Halfedge_const_handle`, and `Vertex_const_hanlde`. The resulting pairs in
`Halfedge_const_handle`, and `Vertex_const_hanlde`. The resulting * the output container are sorted in increasing \f$xy\f$-lexicographical order
pairs in the output sequence are sorted in increasing \f$ xy\f$-lexicographical * of the query points.
order of the query points. The function returns a past-the-end iterator of *
the output sequence. * \param arr The arrangement.
* \param begin The begin iterator of the container of input points.
\cgalHeading{Requirements} * \param end The past-the-end iterator of the container of input points.
* \param oi The output iterator that points at the output container.
<UL> * \return The past-the-end iterator of the output container.
<LI>`InputIterator::value_type` must be `Arrangement_2::Point_2`. *
<LI>`OutputIterator::value_type` must be convertible to * \cgalHeading{Requirements}
`std::pair<Arrangement_2::Point_2, Arr_point_location_result<Arrangement_2>::%Type>`. *
</UL> * \pre The value type of `InputIterator` must be convertible to
* `Arrangement_2::Point_2`.
\sa `CGAL::Arr_point_location_result<Arrangement>` * \pre Dereferencing `oi` must yield an object convertible to
* `std::pair<Arrangement_2::Point_2, Arr_point_location_result<Arrangement_2>::%Type>`.
*/ *
template<typename Traits, typename Dcel, * \sa `CGAL::Arr_point_location_result<Arrangement>`
*
*/
template <typename Traits, typename Dcel,
typename InputIterator, typename OutputIterator> typename InputIterator, typename OutputIterator>
OutputIterator locate (const Arrangement_2<Traits,Dcel>& arr, OutputIterator locate (const Arrangement_2<Traits, Dcel>& arr,
InputIterator points_begin, InputIterator begin,
InputIterator points_end, InputIterator end,
OutputIterator oi); OutputIterator oi);
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -467,20 +467,23 @@ public:
*/ */
Approximate_point_2 operator()(const Point_2& p) const; Approximate_point_2 operator()(const Point_2& p) const;
/*! Obtain a polyline that approximates an \f$x\f$-monotone curve. The /*! approximates a given \f$x\f$-monotone curve. It computes a sequence of
* polyline is defined by a range of approximate points beginning at * approximate points that represent an approximate polyline, and inserts
* `oi`. The type `OutputIterator` must dereference the type * them into an output container given through an output iterator. The
* `Approximate_point_2`. The first and last points in the range are always * first and last points in the sequence are always approximations of the
* the endpoints of the given arc `xcv`. The operator returns a * endpoints of the given arc.
* past-the-end iterator of the destination range. *
* \param oi An output iterator for the resulting polyline. * \param oi An output iterator for the output container.
* \param error The error bound of the polyline approximation. This is * \param error The error bound of the polyline approximation. This is the
* the Hausdorff distance between the arc and the polyline * Hausdorff distance between the arc and the polyline that
* that approximates the arc. * approximates the arc.
* \param xcv The exact \f$x\f$-monotone arc. * \param xcv The exact \f$x\f$-monotone arc.
* \param l2r A Boolean flag that indicates whether the arc direction is * \param l2r A Boolean flag that indicates whether the arc direction is
* left to right. * left to right.
* \return The past-the-end iterator of the output iterator. * \return The past-the-end iterator of the output container.
*
* \pre Dereferencing `oi` must yield an object of type
* `Arr_conic_traits_2::Approximate_point_2`.
*/ */
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator operator()(OutputIterator oi, double error, OutputIterator operator()(OutputIterator oi, double error,
@ -521,7 +524,7 @@ public:
Trim_2 trim_2_object() const; Trim_2 trim_2_object() const;
/*! Obtain an `Approximate_2` functor. */ /*! Obtain an `Approximate_2` functor. */
Trim_2 approximate_2_object() const; Approximate_2 approximate_2_object() const;
/// @} /// @}

View File

@ -1,27 +1,28 @@
namespace CGAL { namespace CGAL {
/*! /*! \ingroup PkgArrangementOnSurface2PointLocation
\ingroup PkgArrangementOnSurface2PointLocation *
* A unary metafunction to determine the return type of a point-location or
A unary metafunction to determine the return type of a point-location * vertical ray-shoot query.
or vertical ray-shoot query. *
* \tparam Arrangement must be an instance of the
\tparam Arrangement must be an instance of the `CGAL::Arrangement_2<Traits,Dcel>` class template. * `CGAL::Arrangement_on_surface_2<GeometryTraits,Topology>` class template.
*
\sa `ArrangementPointLocation_2` * \sa `ArrangementPointLocation_2`
\sa `ArrangementVerticalRayShoot_2` * \sa `ArrangementVerticalRayShoot_2`
\sa `CGAL::Arr_naive_point_location<Arrangement>` * \sa `CGAL::Arr_naive_point_location<Arrangement>`
\sa `CGAL::Arr_walk_along_line_point_location<Arrangement>` * \sa `CGAL::Arr_walk_along_line_point_location<Arrangement>`
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>` * \sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
\sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>` * \sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
*/ */
template <class Arrangement> template <typename Arrangement>
struct Arr_point_location_result struct Arr_point_location_result
{ {
/*! The type of the arrangement feature that is the result of a /*! The type of the arrangement feature that is the result of a
* point-location query or a vertical ray-shoot query, namely, * point-location query or a vertical ray-shoot query, namely,
* `std::variant<Arrangement::Vertex_const_handle, Arrangement::Halfedge_const_handle, Arrangement::Face_const_handle>` * `std::variant<Arrangement_on_surface_2::Vertex_const_handle, Arrangement_on_surface_2::Halfedge_const_handle, Arrangement_on_surface_2::Face_const_handle>`
*/ */
typedef unspecified_type Type; typedef unspecified_type Type;
}; /* end Arr_point_location_result */ }; /* end Arr_point_location_result */
} /* end namespace CGAL */ } /* end namespace CGAL */

View File

@ -238,17 +238,22 @@ namespace CGAL {
const Point_2& tgt) const; const Point_2& tgt) const;
}; };
/*! Subdivide a given subcurve into x-monotone subcurves and insert them /*! Subdivide a given subcurve into \f$x\f$-monotone subcurves and
* into a given output iterator. * isolated points, and insert them into an output container. An object in
* the output container is represented by a discriminated union container
* that holds either a point or an \f$x\f$-monotone curve.
*/ */
class Make_x_monotone_2 { class Make_x_monotone_2 {
public: public:
/*! /*! performs the subdivision.
* \pre if `cv` is not empty then it must be continuous and well-oriented. *
* \param cv the subcurve. * \param cv the subcurve.
* \param oi an output iterator for the result. Its value type is a variant * \param oi The output iterator that points at the output container.
* that wraps Point_2 or an X_monotone_curve_2 objects. * \return the past-the-end iterator of the output container.
* \return the past-the-end iterator. *
* \pre if `cv` is not empty, then it must be continuous and well-oriented.
* \pre Dereferencing `oi` must yield a polymorphic object of type
* `std::variant<`\link Arr_polycurve_traits_2::Point_2 `Point_2` \endlink, `X_monotone_curve_2>`.
*/ */
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const; OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const;

View File

@ -2,51 +2,51 @@ namespace CGAL {
/*! \ingroup PkgArrangementOnSurface2Funcs /*! \ingroup PkgArrangementOnSurface2Funcs
* *
* Produces the symbolic vertical decomposition of a given arrangement, * produces the symbolic vertical decomposition of a given arrangement. More
* performing a batched vertical ray-shooting query from all arrangement * precisely, this function performs a batched vertical ray-shooting query from
* vertices, such that every vertex is associated with a pair of objects, one * every arrangement vertex, and pairs each vertex with a pair of polymorphic
* corresponds to the arrangement feature that lies below it, and the other * objects, one corresponds to the arrangement feature that lies below it, and
* corresponds to the feature that lies above it. The output of this function * the other corresponds to the feature that lies above it.
* can be readily used for inserting vertical walls and physically decomposing
* the arrangement into pseudo-trapezoids. To do this, it is convenient to
* process the vertices in an ascending \f$ xy\f$-lexicographic order. The
* visible objects are therefore returned through an output iterator, which
* pairs each finite arrangement vertex with the two features it "sees", such
* that the vertices are given in ascending \f$ xy\f$-lexicographic order.
* *
* Produces the symbolic vertical decomposition of the `arr` arrangement. More * The finite arrangement vertices and the features they "see", if exist,
* precisely, it performs a batched vertical ray-shooting query from all * that are, the query results, are inserted in ascending \f$xy\f$-lexicographic
* arrangement vertices, such that every vertex is associated with a pair of * order (of the query vertex) into an output container given through an output
* objects, one corresponding to the arrangement feature that lies below it, * iterator. If the vertex is the top end-vertex of a vertical edge, we say that
* while the other corresponds to the feature that lies above it. The query
* results are returned through the output iterator, which pairs each finite
* arrangement vertex with a pair of objects, the first represents the feature
* below the vertex, and the second represents the feature that lies above
* it. Each object is an optional variant that wraps a handle to an arrangement
* feature. If the vertex is the top end-vertex of a vertical edge, we say that
* there is no feature below it; similarly, if it is the bottom end-vertex of a * there is no feature below it; similarly, if it is the bottom end-vertex of a
* vertical edge, we say that there is no feature above it. In these cases the * vertical edge, we say that there is no feature above it. Each feature, if
* optional object is set to be empty; otherwise it is set as follows: * exists, is represented by a discriminated union container that holds an
* object of one of the following types:
*
* <UL> * <UL>
* <LI>`Halfedge_const_handle`, if the vertex is located above (or below) an * <LI> `Arrangement_on_surface_2::Halfedge_const_handle`, if the vertex is
* edge. The given halfedge is always directed from right to left. In case * located above (or below) an edge. The given halfedge is always directed
* there is no concrete edge below (or above) the vertex, and the arrangement * from right to left. In case there is no concrete edge below (or above)
* is unbounded, then the object returned is a <I>fictitious</I> halfedge. * the vertex, and the arrangement is unbounded, then the object returned
* <LI>`Face_const_handle`, in case there is no edge below (or above) * is a <I>fictitious</I> halfedge.
* the vertex, and the arrangement is bounded. * <LI> `Arrangement_on_surface_2::Face_const_handle`, in case there is no edge
* <LI>`Vertex_const_handle`, in case the vertex is located vertically above * below (or above) the vertex, and the arrangement is bounded.
* (or below) another arrangement vertex. * <LI> `Arrangement_on_surface_2::Vertex_const_handle`, in case the vertex is
* </UL> The function returns a past-the-end iterator for its output sequence. * located vertically above (or below) another arrangement vertex.
* </UL>
*
* The output of this function can be readily used for inserting vertical walls
* and physically decomposing the arrangement into pseudo-trapezoids.
*
* \param arr The arrangement.
* \param oi The output iterator that points at the output container.
* \return The past-the-end iterator of the output container.
* *
* \cgalHeading{Requirements} * \cgalHeading{Requirements}
* *
* `OutputIterator::value_type` must be * \pre Dereferencing `oi` must yield an object of type
* `pair<Arrangement_2::Vertex_const_handle, pair<Object, Object> >`. * `std::pair<Arrangement_on_surface_2::Vertex_const_handle,
* * std::pair<std::optional<Type,std::optional<Type>>>`,
* where `Type` is
* `std::variant<Arrangement_on_surface_2::Vertex_const_handle, Arrangement_on_surface_2::Halfedge_const_handle, Arrangement_on_surface_2::Face_const_handle>`.
*/ */
template<typename Traits, typename Dcel, template <typename Traits, typename TopologyTraits, typename OutputIterator>
typename OutputIterator> OutputIterator
OutputIterator decompose (const Arrangement_2<Traits,Dcel>& arr, decompose(const Arrangement_on_surface_2<GeometryTraits,TopologyTraits>& arr,
OutputIterator oi); OutputIterator oi);
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -160,12 +160,12 @@ public:
namespace CGAL { namespace CGAL {
/*! \ingroup PkgArrangementOnSurface2Insert insert The function `%insert` /*! \ingroup PkgArrangementOnSurface2Insert
* inserts one or more curves or \f$ x\f$-monotone curves into a given * The function `%insert` inserts one or more curves or \f$ x\f$-monotone curves
* arrangement, where no restrictions are imposed on the inserted curves. If an * into a given arrangement, where no restrictions are imposed on the inserted
* inserted curve is not \f$ x\f$-monotone curve, it is subdivided into \f$ * curves. If an inserted curve is not \f$ x\f$-monotone curve, it is subdivided
* x\f$-monotone subcurves (and perhaps isolated points), which are inserted * into \f$ x\f$-monotone subcurves (and perhaps isolated points), which are
* into the arrangement. * inserted into the arrangement.
* *
* \cgalHeading{Requirements} * \cgalHeading{Requirements}
* *
@ -379,37 +379,4 @@ template <typename Traits, typename Dcel>
bool remove_vertex(Arrangement_2<Traits,Dcel>& arr, bool remove_vertex(Arrangement_2<Traits,Dcel>& arr,
typename Arrangement_2<Traits,Dcel>::Vertex_handle v); typename Arrangement_2<Traits,Dcel>::Vertex_handle v);
/*! \ingroup PkgArrangementOnSurface2Funcs
*
* Compute the zone of the given \f$ x\f$-monotone curve in the existing
* arrangement. Meaning, it output the arrangement's vertices, edges and faces
* that the \f$ x\f$-monotone curve intersects. The order of the objects is the
* order that they are discovered when traversing the \f$ x\f$-monotone curve
* from left to right.
*
* A given point-location object is used for answering point-location queries
* during the insertion process. By default, the function uses the "walk along
* line" point-location strategy - namely an instance of the class
* `Arr_walk_along_line_point_location<Arrangement_2<Traits,Dcel> >`.
*
* Compute the zone of the given \f$ x\f$-monotone curve `c` in the arrangement
* `arr`.
*
* \pre If provided, `pl` must be attached to the given arrangement `arr`.
*
* \cgalHeading{Requirements}
*
* <UL>
* <LI>The instantiated `GeomTraits` class must model the
* `ArrangementXMonotoneTraits_2` concept.
* <LI>The point-location object `pl`, must model the
* `ArrangementPointLocation_2` concept.
* </UL>
*/
template <typename Traits, typename Dcel,
typename OutputIterator, typename PointLocation>
OutputIterator zone(Arrangement_2<Traits, Dcel>& arr,
const typename Traits::X_monotone_curve_2& c,
OutputIterator oi, const PointLocation& pl);
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -34,7 +34,6 @@ namespace CGAL {
* \sa `Arr_default_dcel<Traits>` * \sa `Arr_default_dcel<Traits>`
* \sa `ArrangementBasicTraits_2` * \sa `ArrangementBasicTraits_2`
* \sa `CGAL::overlay()` * \sa `CGAL::overlay()`
* \sa `CGAL::is_valid()`
* Insertion Functions * Insertion Functions
@ -1014,7 +1013,7 @@ public:
namespace CGAL { namespace CGAL {
/*! \ingroup PkgArrangementOnSurface2Insert insert /*! \ingroup PkgArrangementOnSurface2Insert
* The function `%insert` inserts one or more curves or \f$ x\f$-monotone * The function `%insert` inserts one or more curves or \f$ x\f$-monotone
* curves into a given arrangement, where no restrictions are imposed on the * curves into a given arrangement, where no restrictions are imposed on the
* inserted curves. If an inserted curve is not \f$ x\f$-monotone curve, it is * inserted curves. If an inserted curve is not \f$ x\f$-monotone curve, it is
@ -1295,38 +1294,43 @@ bool remove_vertex
/*! \ingroup PkgArrangementOnSurface2Funcs /*! \ingroup PkgArrangementOnSurface2Funcs
* *
* Compute the zone of the given \f$ x\f$-monotone curve in the existing * computes the zone of the given \f$x\f$-monotone curve in a given
* arrangement. Meaning, it output the arrangement's vertices, edges and faces * arrangement. More precisely, this function finds the arrangement vertices,
* that the \f$ x\f$-monotone curve intersects. The order of the objects is the * edges ,and faces that the given \f$x\f$-monotone curve intersects, and
* order that they are discovered when traversing the \f$ x\f$-monotone curve * inserts them in the order they are discovered when traversing the
* from left to right. * \f$x\f$-monotone curve from left to right into an output contaiuner given
* through an output iterator. An object in the resulting zone is represented by
* a discriminated union container that holds a vertex handle, halfedge handle,
* or a face handle.
* *
* A given point-location object is used for answering point-location queries * A given point-location object is used for answering point-location queries
* during the insertion process. By default, the function uses the "walk along * during the insertion process. By default, the function uses the "walk along
* line" point-location strategy - namely an instance of the class * line" point-location strategy, namely, an instance of the class
* `Arr_walk_along_line_point_location<Arrangement_on_surface_2<GeometryTraits, * `Arr_walk_along_line_point_location<Arrangement_on_surface_2<GeometryTraits,
* TopologyTraits> >`. * TopologyTraits>>`.
* *
* Compute the zone of the given \f$ x\f$-monotone curve `c` in the arrangement * \param arr The given arrangement.
* `arr`. * \param c The \f$x\f$-monotone curve.
* \param oi The output iterator that points at the output container.
* \param pl The point-location object.
* \return The past-the-end iterator of the output container.
* *
* \pre If provided, `pl` must be attached to the given arrangement `arr`. * \pre If provided, `pl` must be attached to the given arrangement `arr`.
* \pre The instantiated `GeometryTraits` class must model the
* `ArrangementXMonotoneTraits_2` concept.
* \pre The point-location object `pl`, must model the
* `ArrangementPointLocation_2` concept.
* \pre Dereferencing `oi` must yield a polymorphic object of type
* `std::variant<Arrangement_on_surface_2::Vertex_handle, Arrangement_on_surface_2::Halfedge_handle, Arrangement_on_surface_2::Face_handle>`.
* *
* \cgalHeading{Requirements} * \cgalHeading{Requirements}
*
* <UL>
* <LI>The instantiated `GeometryTraits` class must model the
* `ArrangementXMonotoneTraits_2` concept.
* <LI>The point-location object `pl`, must model the
* `ArrangementPointLocation_2` concept.
* </UL>
*/ */
template <typename GeometryTraits, typename TopologyTraits, template <typename GeometryTraits, typename TopologyTraits,
typename OutputIterator, typename PointLocation> typename OutputIterator, typename PointLocation>
OutputIterator zone OutputIterator
(Arrangement_on_surface_2<GeometryTraits, TopologyTraits>& arr, zone(Arrangement_on_surface_2<GeometryTraits, TopologyTraits>& arr,
const typename GeometryTraits::X_monotone_curve_2& c, const typename GeometryTraits::X_monotone_curve_2& c,
OutputIterator oi, OutputIterator oi,
const PointLocation& pl); const PointLocation& pl);
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -0,0 +1,246 @@
namespace CGAL {
/*! \ingroup PkgArrangementOnSurface2TraitsClasses
*
* `CORE_algebraic_number_traits` is a traits class for CORE's algebraic
* number types.
*
* \sa `Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>`
*/
class CORE_algebraic_number_traits {
public:
/// \name Types
/// @{
//! The integer number type.
typedef CORE::BigInt Integer;
//! The rational number type.
typedef CORE::BigRat Rational;
//! The polynomial type.
typedef CORE::Polynomial<Integer> Polynomial;
//! The algebraic number type.
typedef CORE::Expr Algebraic;
/// @}
/// \name Utility Functions
/// @{
/*! obtains the numerator of a rational number.
*
* \param q The rational number.
* \return The numerator of `q`.
*/
Integer numerator(const Rational& q) const;
/*! obtains the denominator of a rational number.
*
* \param q The rational number.
* \return The denominator of `q`.
*/
Integer denominator(const Rational& q) const;
/*! converts an integer to an algebraic number.
*
* \param z The integer.
* \return The algebraic number equivalent to `z`.
*/
Algebraic convert(const Integer& z) const;
/*! converts a rational number to an algebraic number.
*
* \param q A rational number.
* \return The algebraic number equivalent to `q`.
*/
Algebraic convert(const Rational& q) const;
/*! constructs a rational number that lies strictly between two algebraic
* values.
*
* \param x1 The first algebraic value.
* \param x2 The second algebraic value.
* \pre The two values are not equal.
* \return The rational number that lies in the open interval (`x1`, `x2`).
*/
Rational rational_in_interval(const Algebraic& x1, const Algebraic& x2) const;
/*! obtains a range of double-precision floats that contains the given
* algebraic number.
*
* \param x The given number.
* \return The range of double-precision floats that contain `x`.
*/
std::pair<double, double> double_interval(const Algebraic& x) const;
/*! converts a sequence of rational coefficients to an equivalent sequence
* of integer coefficients. If the input coefficients are
* \f$q(1),\ldots,q(k)\f$, where \f$q(i) = n(i)/d(i)\f$, then the output
* coefficients will be of the form:
* \f$a(i) = \frac{n(i) \cdot \mathrm{lcm}(d(1),\ldots,d(k))}{d(i) \cdot \mathrm{gcd}(n(1),\ldots, n(k))}\f$.
* It inserts the output sequence into an output container given through an
* output iterator.
*
* \param begin The begin iterator of the rational coefficients input
* container.
* \param end The past-the-end iterator of the rational coefficients input
* container.
* \param oi The output iterator of the integer coefficients output container.
* \return The past-the-end iterator of the output container.
*
* \pre The value type of `InputIterator` is `Rational`.
* \pre Dereferencing `oi` must yield an object convertible to `Integer`.
*/
template <typename InputIterator, typename OutputIterator>
OutputIterator convert_coefficients(InputIterator begin,
InputIterator end,
OutputIterator oi) const;
/*! computes the square root of an algebraic number.
*
* \param x The number.
* \return The square root of `x`.
* \pre `x` is non-negative.
*/
Algebraic sqrt(const Algebraic& x) const;
/*! computes the roots of a quadratic equations \f$a*x^2+ b*x + c = 0\f$
* with integer coefficients, and inserts them into an output container given
* through an output iterator.
*
* \param a The coefficient of \f$x^2\f$
* \param b The coefficient of \f$x\f$
* \param c The free term.
* \param oi The output iterator of the output container of real-valued
* solutions of the quadratic equation.
* \return The past-the-end iterator of the output container.
*
* \pre Dereferencing `oi` must yield an object convertible to `Algebraic`.
*/
template <typename NT, typename OutputIterator>
OutputIterator solve_quadratic_equation(const NT& a, const NT& b, const NT& c,
OutputIterator oi) const;
/*! constructs a polynomial with integer coefficients.
*
* \param coeffs The coefficients of the input polynomial.
* \param degree The degree of the input polynomial.
* \return The polynomial.
*/
Polynomial construct_polynomial(const Integer* coeffs,
unsigned int degree) const;
/*! constructs a polynomial with integer coefficients given rational
* coefficients.
*
* \param coeffs The coefficients of the input polynomial.
* \param degree The degree of the input polynomial.
* \param poly Output: The resulting polynomial with integer coefficients.
* \param poly_denom Output: The denominator for the polynomial.
* \return Whether this polynomial is non-zero (false if the polynomial is
* zero).
*/
bool construct_polynomial(const Rational *coeffs,
unsigned int degree,
Polynomial& poly, Integer& poly_denom) const;
/*! constructs two polynomials with integer coefficients such that
* \f$P(x)/Q(x)\f$ is a rational function equivalent to the one represented
* by the two given vectors of rational coefficients. It is guaranteed that
* the GCD of \f$P(x)\f$ and \f$Q(x)\f$ is trivial.
*
* \param p_coeffs The coefficients of the input numerator polynomial.
* \param p_degree The degree of the input numerator polynomial.
* \param q_coeffs The coefficients of the input denominator polynomial.
* \param q_degree The degree of the input denominator polynomial.
* \param p_poly Output: The resulting numerator polynomial with integer
* coefficients.
* \param q_poly Output: The resulting denominator polynomial with integer
* coefficients.
* \return `true` on success; `false` if the denominator is 0.
*/
bool construct_polynomials(const Rational* p_coeffs,
unsigned int p_degree,
const Rational* q_coeffs,
unsigned int q_degree,
Polynomial& p_poly, Polynomial& q_poly) const;
/*! Compute the degree of a polynomial.
*/
int degree(const Polynomial& poly) const;
/*! evaluates a polynomial at a given \f$x\f$-value.
*
* \param poly The polynomial.
* \param x The value to evaluate at.
* \return The value of the polynomial at `x`.
*/
template <typename NT>
NT evaluate_at(const Polynomial& poly, NT& x) const;
/*! computes the derivative of the given polynomial.
*
* \param poly The polynomial \f$p(x)\f$.
* \return The derivative \f$p'(x)\f$.
*/
Polynomial derive(const Polynomial& poly) const;
/*! multiplies a polynomial by some scalar coefficient.
*
* \param poly The polynomial \f$P(x)\f$.
* \param a The scalar value.
* \return The scalar multiplication \f$a \cdot P(x)\f$.
*/
Polynomial scale(const Polynomial& poly, const Integer& a) const;
/*! performs "long division" of two polynomials: Given \f$A(x)\f$ and
* \f$B(x)\f$ compute two polynomials \f$Q(x)\f$ and \f$R(x)\f$ such that:
* \f$A(x) = Q(x) \cdot B(x) + R(x)\f$ and \f$R(x)\f$ has minimal degree.
*
* \param poly_a The first polynomial \f$A(x)\f$.
* \param poly_b The second polynomial \f$A(x)\f$.
* \param rem Output: The remainder polynomial \f$R(x)\f$.
* \return The quontient polynomial \f$Q(x)\f$.
*/
Polynomial divide(const Polynomial& poly_a,
const Polynomial& poly_b,
Polynomial& rem) const;
/*! computes the real-valued roots of a polynomial with integer coefficients,
* and inserts them in ascending order into an output container given through
* an output iterator.
*
* \param poly The input polynomial.
* \param oi The output iterator of the output container of real-valued root
* of the polynomial.
* \return The past-the-end iterator of the output container.
*
* \pre Dereferencing `oi` must yield an object convertible to `Algebraic`.
*/
template <typename OutputIterator>
OutputIterator compute_polynomial_roots(const Polynomial& poly,
OutputIterator oi) const;
/*! computes the real-valued roots of a polynomial with integer coefficients
* within a given interval, and inserts them in ascending order into an output
* container given through an output iterator.
*
* \param poly The input polynomial.
* \param x_min The left bound of the interval.
* \param x_max The right bound of the interval.
* \param oi The output iterator of the output container of the real-valued
* root of the polynomial.
* \return The past-the-end iterator of the output container.
*
* \pre Dereferencing `oi` must yield an object convertible to `Algebraic`.
*/
template <typename OutputIterator>
OutputIterator compute_polynomial_roots(const Polynomial& poly,
double x_min, double x_max,
OutputIterator oi) const;
/// @}
};
} /* end namespace CGAL */

View File

@ -16,26 +16,33 @@ public:
/// A model of this concept must provide: /// A model of this concept must provide:
/// @{ /// @{
/*! computes the intersections of `xc1` and `xc2` and writes them <I>in an /*! computes the intersections of two \f$x\f$-monotone curves and inserts the
* ascending lexicographic \f$xy\f$-order</I> into a range beginning at * result in ascending \f$xy\f$-lexicographic order into an output container
* `oi`. The type `OutputIterator` must dereference a polymorphic object of * given through an output iterator. An intersection, if exists, is
* type `std::variant` that wraps objects of type either type * represented by a discriminated union container that holds either an
* `pair<ArrTraits::Point_2, ArrTraits::Multiplicity>` or * intersection point along with its multiplicity or an overlapping
* `ArrTraits::X_monotone_curve_2`. An object of the former type represents an * \f$x\f$-monotone subcurve. If the multiplicity is undefined or unknown, it
* intersection point with its multiplicity (in case the multiplicity is * should be set to \f$0\f$.
* undefined or unknown, it should be set to \f$0\f$). An object of the latter
* type represents an overlapping subcurve of `xc1` and `xc2`. The operator
* returns a past-the-end iterator of the destination range.
* *
* A special case may occur when the parameter space of the surface, the * \param xc1 The first \f$x\f$-monotone curve.
* arrangement is embedded on, is identified on the left and right sides of * \param xc2 The second \f$x\f$-monotone curve.
* the boundary. An intersection point that lies on the identification curve, * \param oi The output iterator that points at the output container.
* \return The past-the-end iterator of the output container.
*
* A special case may occur when the left and right sides of the boundary of
* the parameter space of the surface, the arrangement is embedded on, are
* identified. An intersection point that lies on the identification curve,
* between two \f$x\f$-monotone curves that intersect at their left and right * between two \f$x\f$-monotone curves that intersect at their left and right
* ends must be ignored. Consider two \f$x\f$-monotone curves that intersect * ends must be ignored. Consider two \f$x\f$-monotone curves that intersect
* at their left and right ends, respectively, at a point \f$p\f$ that lies on * at their left and right ends, respectively, at a point \f$p\f$ that lies on
* the identification curve. If, for example, the number of intersections * the identification curve. If, for example, the number of intersections
* between these two curves is greater than 1, the order of intersections is * between these two curves is greater than 1, the order of intersections is
* non-deterministic. * nondeterministic.
*
* \pre Dereferencing `oi` must yield an object of type
* `std::optional<std::variant<std::pair<%Point_2,ArrangementXMonotoneTraits_2::Multiplicity,X_monotone_curve_2>>`,
* where `%Point_2` is a model of `ArrTraits::Point_2` and
* `X_monotone_curve_2` is a model of `ArrTraits::XMonotoneCurve_2`.
*/ */
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator operator()(ArrTraits::X_monotone_curve_2 xc1, OutputIterator operator()(ArrTraits::X_monotone_curve_2 xc1,

View File

@ -15,12 +15,20 @@ public:
/// A model of this concept must provide: /// A model of this concept must provide:
/// @{ /// @{
/*! subdivides the input curve `c` into \f$x\f$-monotone subcurves and /*! subdivides an input curve into \f$x\f$-monotone subcurves and isolated
* isolated points, and inserts the results into a range beginning at the given * points, and inserts the results into an output container given through an
* output iterator `oi`. The type `OutputIterator` dereferences a * output iterator. An object in the output container is represented by a
* `std::variant` that wraps either an `ArrTraits::Point_2` object or an * discriminated union container that holds either a point or an
* `ArrTraits::X_monotone_curve_2` object. The operator returns a past-the-end * \f$x\f$-monotone curve.
* iterator for the output sequence. *
* \param c The input curve.
* \param oi The output iterator that points at the output container.
* \return The past-the-end iterator of the output container.
*
* \pre Dereferencing `oi` must yield a polymorphic object of type
* `std::variant<%Point_2, X_monotone_curve_2>`, where `%Point_2` is a model
* of `ArrTraits::Point_2` and `X_monotone_curve_2` is a model of
* `ArrTraits::XMonotoneCurve_2`.
*/ */
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator operator()(ArrTraits::Curve_2 c, OutputIterator oi); OutputIterator operator()(ArrTraits::Curve_2 c, OutputIterator oi);

View File

@ -236,6 +236,7 @@ implemented as peripheral classes or as free (global) functions.
- `CGAL::Arr_bounded_planar_topology_traits_2<GeometryTraits_2,Dcel>` - `CGAL::Arr_bounded_planar_topology_traits_2<GeometryTraits_2,Dcel>`
- `CGAL::Arr_unb_planar_topology_traits_2<GeometryTraits_2,Dcel>` - `CGAL::Arr_unb_planar_topology_traits_2<GeometryTraits_2,Dcel>`
- `CGAL::Arr_spherical_topology_traits_2<GeometryTraits_2,Dcel>` - `CGAL::Arr_spherical_topology_traits_2<GeometryTraits_2,Dcel>`
- `CGAL::CORE_algebraic_number_traits`
\cgalCRPSection{Functions} \cgalCRPSection{Functions}

View File

@ -23,7 +23,7 @@ int main() {
Point(1, 4), Point(4, 3), Point(6, 3), Point(3, 2), Point(5, 2), Point(1, 0) Point(1, 4), Point(4, 3), Point(6, 3), Point(3, 2), Point(5, 2), Point(1, 0)
}; };
std::list<Query_result> results; std::list<Query_result> results;
locate(arr, points.begin(), points.end(), std::back_inserter(results)); CGAL::locate(arr, points.begin(), points.end(), std::back_inserter(results));
// Print the results. // Print the results.
for (auto it = results.begin(); it != results.end(); ++it) for (auto it = results.begin(); it != results.end(); ++it)

View File

@ -5,7 +5,7 @@
#include <CGAL/config.h> #include <CGAL/config.h>
#include <CGAL/boost/graph/dijkstra_shortest_paths.h> #include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/property_map/vector_property_map.hpp> #include <boost/property_map/vector_property_map.hpp>
#include <CGAL/graph_traits_Arrangement_2.h> #include <CGAL/graph_traits_Arrangement_2.h>

View File

@ -736,13 +736,13 @@ public:
swallow(is, '('); swallow(is, '(');
// read values // read values
is >> iformat(rep._m_xy); is >> IO::iformat(rep._m_xy);
swallow(is, ','); swallow(is, ',');
is >> iformat(rep._m_x); is >> IO::iformat(rep._m_x);
swallow(is, ','); swallow(is, ',');
is >> iformat(rep._m_curve); is >> IO::iformat(rep._m_curve);
swallow(is, ','); swallow(is, ',');
is >> iformat(rep._m_arcno); is >> IO::iformat(rep._m_arcno);
swallow(is, ','); swallow(is, ',');
is >> rep._m_location; is >> rep._m_location;

View File

@ -5,7 +5,7 @@
#include <CGAL/Arr_extended_dcel.h> #include <CGAL/Arr_extended_dcel.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
#include <CGAL/boost/graph/dijkstra_shortest_paths.h> #include <boost/graph/dijkstra_shortest_paths.hpp>
#include <CGAL/graph_traits_dual_arrangement_2.h> #include <CGAL/graph_traits_dual_arrangement_2.h>

View File

@ -8,7 +8,7 @@
#include <CGAL/graph_traits_Arrangement_2.h> #include <CGAL/graph_traits_Arrangement_2.h>
#include <CGAL/Arr_vertex_index_map.h> #include <CGAL/Arr_vertex_index_map.h>
#include <CGAL/boost/graph/dijkstra_shortest_paths.h> #include <boost/graph/dijkstra_shortest_paths.hpp>
#include <CGAL/property_map.h> #include <CGAL/property_map.h>

View File

@ -1,7 +1,7 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/boost/graph/graph_traits_Triangulation_2.h> #include <CGAL/boost/graph/graph_traits_Triangulation_2.h>
#include <CGAL/boost/graph/dijkstra_shortest_paths.h> #include <boost/graph/dijkstra_shortest_paths.hpp>
#include <fstream> #include <fstream>

View File

@ -4,7 +4,7 @@
#include <CGAL/Triangulation_vertex_base_with_id_2.h> #include <CGAL/Triangulation_vertex_base_with_id_2.h>
#include <CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h> #include <CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h>
#include <CGAL/boost/graph/dijkstra_shortest_paths.h> #include <boost/graph/dijkstra_shortest_paths.hpp>
#include <fstream> #include <fstream>

View File

@ -102,10 +102,10 @@ public:
// Construct the graph // Construct the graph
VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_property_map(CGAL::vertex_point, g)); VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_property_map(CGAL::vertex_point, g));
VNM vnm = choose_parameter<VNM>(get_parameter(np, internal_np::vertex_normal_map)); VNM vnm = choose_parameter(get_parameter(np, internal_np::vertex_normal_map), VNM());
VCM vcm = choose_parameter<VCM>(get_parameter(np, internal_np::vertex_color_map)); VCM vcm = choose_parameter(get_parameter(np, internal_np::vertex_color_map), VCM());
VTM vtm = choose_parameter<VTM>(get_parameter(np, internal_np::vertex_texture_map)); VTM vtm = choose_parameter(get_parameter(np, internal_np::vertex_texture_map), VTM());
FCM fcm = choose_parameter<FCM>(get_parameter(np, internal_np::face_color_map)); FCM fcm = choose_parameter(get_parameter(np, internal_np::face_color_map), FCM());
const bool has_vertex_normals = (is_vnm_requested && !(vertex_normals.empty())); const bool has_vertex_normals = (is_vnm_requested && !(vertex_normals.empty()));
const bool has_vertex_colors = (is_vcm_requested && !(vertex_colors.empty())); const bool has_vertex_colors = (is_vcm_requested && !(vertex_colors.empty()));

View File

@ -1,30 +0,0 @@
// Copyright (c) 2014 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Sebastien Loriot
#ifndef CGAL_BOOST_GRAPH_DIJKSTRA_SHORTEST_PATHS_H
#define CGAL_BOOST_GRAPH_DIJKSTRA_SHORTEST_PATHS_H
// This will push/pop a VC++ warning
#include <CGAL/Named_function_parameters.h>
#if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable:4172) // Address warning inside boost named parameters
#endif
#include <boost/graph/dijkstra_shortest_paths.hpp>
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
#endif // CGAL_BOOST_GRAPH_DIJKSTRA_SHORTEST_PATHS_H

View File

@ -24,10 +24,10 @@ template < class TriangleMesh,
class VertexPointMap = typename boost::property_map<TriangleMesh,vertex_point_t>::type > class VertexPointMap = typename boost::property_map<TriangleMesh,vertex_point_t>::type >
struct Triangle_from_face_descriptor_map{ struct Triangle_from_face_descriptor_map{
typename std::remove_const_t<TriangleMesh>* m_tm; typename std::remove_const_t<TriangleMesh>* m_tm;
std::optional<VertexPointMap> m_vpm; VertexPointMap m_vpm;
Triangle_from_face_descriptor_map() Triangle_from_face_descriptor_map()
: m_tm(nullptr), m_vpm() : m_tm(nullptr)
{} {}
Triangle_from_face_descriptor_map(TriangleMesh const* tm) Triangle_from_face_descriptor_map(TriangleMesh const* tm)
@ -58,9 +58,9 @@ struct Triangle_from_face_descriptor_map{
std::remove_const_t<TriangleMesh>& tm = *(pmap.m_tm); std::remove_const_t<TriangleMesh>& tm = *(pmap.m_tm);
CGAL_precondition(halfedge(f,tm) == next(next(next(halfedge(f,tm),tm),tm),tm)); CGAL_precondition(halfedge(f,tm) == next(next(next(halfedge(f,tm),tm),tm),tm));
return value_type( get(pmap.m_vpm.value(), target(halfedge(f,tm),tm)), return value_type( get(pmap.m_vpm, target(halfedge(f,tm),tm)),
get(pmap.m_vpm.value(), target(next(halfedge(f,tm),tm),tm)), get(pmap.m_vpm, target(next(halfedge(f,tm),tm),tm)),
get(pmap.m_vpm.value(), source(halfedge(f,tm),tm)) ); get(pmap.m_vpm, source(halfedge(f,tm),tm)) );
} }
inline friend inline friend
@ -71,9 +71,9 @@ struct Triangle_from_face_descriptor_map{
std::remove_const_t<TriangleMesh> & tm = *(pmap.m_tm); std::remove_const_t<TriangleMesh> & tm = *(pmap.m_tm);
CGAL_precondition(halfedge(f.first,tm) == next(next(next(halfedge(f.first,tm),tm),tm),tm)); CGAL_precondition(halfedge(f.first,tm) == next(next(next(halfedge(f.first,tm),tm),tm),tm));
return value_type( get(pmap.m_vpm.value(), target(halfedge(f.first,tm),tm)), return value_type( get(pmap.m_vpm, target(halfedge(f.first,tm),tm)),
get(pmap.m_vpm.value(), target(next(halfedge(f.first,tm),tm),tm)), get(pmap.m_vpm, target(next(halfedge(f.first,tm),tm),tm)),
get(pmap.m_vpm.value(), source(halfedge(f.first,tm),tm)) ); get(pmap.m_vpm, source(halfedge(f.first,tm),tm)) );
} }
}; };
@ -82,7 +82,7 @@ template < class PolygonMesh,
struct Segment_from_edge_descriptor_map{ struct Segment_from_edge_descriptor_map{
Segment_from_edge_descriptor_map() Segment_from_edge_descriptor_map()
: m_pm(nullptr), m_vpm() : m_pm(nullptr)
{} {}
Segment_from_edge_descriptor_map(PolygonMesh const * pm) Segment_from_edge_descriptor_map(PolygonMesh const * pm)
@ -105,7 +105,7 @@ struct Segment_from_edge_descriptor_map{
typedef boost::readable_property_map_tag category; typedef boost::readable_property_map_tag category;
//data //data
std::remove_const_t<PolygonMesh>* m_pm; std::remove_const_t<PolygonMesh>* m_pm;
std::optional<VertexPointMap> m_vpm; VertexPointMap m_vpm;
//get function for property map //get function for property map
inline friend inline friend
@ -113,8 +113,8 @@ struct Segment_from_edge_descriptor_map{
get(const Segment_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap, get(const Segment_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap,
key_type h) key_type h)
{ {
return value_type(get(pmap.m_vpm.value(), source(h, *pmap.m_pm) ), return value_type(get(pmap.m_vpm, source(h, *pmap.m_pm) ),
get(pmap.m_vpm.value(), target(h, *pmap.m_pm) ) ); get(pmap.m_vpm, target(h, *pmap.m_pm) ) );
} }
inline friend inline friend
@ -122,8 +122,8 @@ struct Segment_from_edge_descriptor_map{
get(const Segment_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap, get(const Segment_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap,
const std::pair<key_type, const PolygonMesh*>& h) const std::pair<key_type, const PolygonMesh*>& h)
{ {
return value_type(get(pmap.m_vpm.value(), source(h.first, *pmap.m_pm) ), return value_type(get(pmap.m_vpm, source(h.first, *pmap.m_pm) ),
get(pmap.m_vpm.value(), target(h.first, *pmap.m_pm) ) ); get(pmap.m_vpm, target(h.first, *pmap.m_pm) ) );
} }
}; };
@ -132,7 +132,7 @@ template <class PolygonMesh,
class VertexPointMap = typename boost::property_map<PolygonMesh,vertex_point_t>::type > class VertexPointMap = typename boost::property_map<PolygonMesh,vertex_point_t>::type >
struct One_point_from_face_descriptor_map{ struct One_point_from_face_descriptor_map{
One_point_from_face_descriptor_map() One_point_from_face_descriptor_map()
: m_pm(nullptr), m_vpm() : m_pm(nullptr)
{} {}
One_point_from_face_descriptor_map(PolygonMesh const * g) One_point_from_face_descriptor_map(PolygonMesh const * g)
@ -146,7 +146,7 @@ struct One_point_from_face_descriptor_map{
{} {}
std::remove_const_t<PolygonMesh>* m_pm; std::remove_const_t<PolygonMesh>* m_pm;
std::optional<VertexPointMap> m_vpm; VertexPointMap m_vpm;
//classical typedefs //classical typedefs
typedef typename boost::graph_traits<PolygonMesh>::face_descriptor key_type; typedef typename boost::graph_traits<PolygonMesh>::face_descriptor key_type;
@ -160,7 +160,7 @@ struct One_point_from_face_descriptor_map{
get(const One_point_from_face_descriptor_map<PolygonMesh,VertexPointMap>& m, get(const One_point_from_face_descriptor_map<PolygonMesh,VertexPointMap>& m,
key_type f) key_type f)
{ {
return get(m.m_vpm.value(), target(halfedge(f, *m.m_pm), *m.m_pm)); return get(m.m_vpm, target(halfedge(f, *m.m_pm), *m.m_pm));
} }
inline friend inline friend
@ -168,7 +168,7 @@ struct One_point_from_face_descriptor_map{
get(const One_point_from_face_descriptor_map<PolygonMesh,VertexPointMap>& m, get(const One_point_from_face_descriptor_map<PolygonMesh,VertexPointMap>& m,
const std::pair<key_type, const PolygonMesh*>& f) const std::pair<key_type, const PolygonMesh*>& f)
{ {
return get(m.m_vpm.value(), target(halfedge(f.first, *m.m_pm), *m.m_pm)); return get(m.m_vpm, target(halfedge(f.first, *m.m_pm), *m.m_pm));
} }
}; };
@ -176,7 +176,7 @@ struct One_point_from_face_descriptor_map{
template < class PolygonMesh, template < class PolygonMesh,
class VertexPointMap = typename boost::property_map<PolygonMesh,vertex_point_t>::type > class VertexPointMap = typename boost::property_map<PolygonMesh,vertex_point_t>::type >
struct Source_point_from_edge_descriptor_map{ struct Source_point_from_edge_descriptor_map{
Source_point_from_edge_descriptor_map() : m_pm(nullptr), m_vpm() Source_point_from_edge_descriptor_map() : m_pm(nullptr)
{} {}
Source_point_from_edge_descriptor_map(PolygonMesh const * g) Source_point_from_edge_descriptor_map(PolygonMesh const * g)
@ -197,7 +197,7 @@ struct Source_point_from_edge_descriptor_map{
//data //data
std::remove_const_t<PolygonMesh>* m_pm; std::remove_const_t<PolygonMesh>* m_pm;
std::optional<VertexPointMap> m_vpm; VertexPointMap m_vpm;
//get function for property map //get function for property map
inline friend inline friend
@ -205,7 +205,7 @@ struct Source_point_from_edge_descriptor_map{
get(const Source_point_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap, get(const Source_point_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap,
key_type h) key_type h)
{ {
return get(pmap.m_vpm.value(), source(h, *pmap.m_pm) ); return get(pmap.m_vpm, source(h, *pmap.m_pm) );
} }
inline friend inline friend
@ -213,7 +213,7 @@ struct Source_point_from_edge_descriptor_map{
get(const Source_point_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap, get(const Source_point_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap,
const std::pair<key_type, const PolygonMesh*>& h) const std::pair<key_type, const PolygonMesh*>& h)
{ {
return get(pmap.m_vpm.value(), source(h.first, *pmap.m_pm) ); return get(pmap.m_vpm, source(h.first, *pmap.m_pm) );
} }
}; };

View File

@ -216,7 +216,7 @@ boxes and approximated geometry, which is the case here. It saves us
the extra space that was needed for the explicit `id`-number in the extra space that was needed for the explicit `id`-number in
the previous example. the previous example.
We run the self intersection algorithm with the `report_inters` We run the self intersection algorithm with the `report_inters()`
function as callback. This callback reports the intersecting boxes. It function as callback. This callback reports the intersecting boxes. It
uses the `handle` and the global `triangles` vector to uses the `handle` and the global `triangles` vector to
calculate the triangle numbers. Then it checks the triangles calculate the triangle numbers. Then it checks the triangles
@ -480,4 +480,3 @@ however, we learned too late about this implementation.
*/ */
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -47,12 +47,12 @@ Box_traits_d();
/*! /*!
\ingroup PkgBoxIntersectionDFunctions \ingroup PkgBoxIntersectionDEnums
*/ */
enum Setting { COMPLETE, BIPARTITE }; enum Setting { COMPLETE, BIPARTITE };
/*! /*!
\ingroup PkgBoxIntersectionDFunctions \ingroup PkgBoxIntersectionDEnums
*/ */
enum Topology { HALF_OPEN, CLOSED }; enum Topology { HALF_OPEN, CLOSED };

View File

@ -2,6 +2,9 @@
/// \defgroup PkgBoxIntersectionDConcepts Concepts /// \defgroup PkgBoxIntersectionDConcepts Concepts
/// \ingroup PkgBoxIntersectionDRef /// \ingroup PkgBoxIntersectionDRef
/// \defgroup PkgBoxIntersectionDEnums Enumerations
/// \ingroup PkgBoxIntersectionDRef
/// \defgroup PkgBoxIntersectionDClasses Classes /// \defgroup PkgBoxIntersectionDClasses Classes
/// \ingroup PkgBoxIntersectionDRef /// \ingroup PkgBoxIntersectionDRef
@ -43,6 +46,10 @@
- `BoxIntersectionBox_d` - `BoxIntersectionBox_d`
- `BoxIntersectionTraits_d` - `BoxIntersectionTraits_d`
\cgalCRPSection{Enumerations}
- `CGAL::Box_intersection_d::Setting`
- `CGAL::Box_intersection_d::Topology`
\cgalCRPSection{Classes} \cgalCRPSection{Classes}
- `CGAL::Box_intersection_d::Box_d<NT,int D,IdPolicy>` - `CGAL::Box_intersection_d::Box_d<NT,int D,IdPolicy>`
- `CGAL::Box_intersection_d::Box_with_handle_d<NT, int D, Handle, IdPolicy>` - `CGAL::Box_intersection_d::Box_with_handle_d<NT, int D, Handle, IdPolicy>`
@ -56,4 +63,3 @@
- `CGAL::box_self_intersection_all_pairs_d` - `CGAL::box_self_intersection_all_pairs_d`
*/ */

View File

@ -4,3 +4,4 @@ STL_Extension
Algebraic_foundations Algebraic_foundations
Circulator Circulator
Stream_support Stream_support
Polyhedron

View File

@ -102,12 +102,14 @@ collinearC3(const FT &px, const FT &py, const FT &pz,
FT dqx = qx-rx; FT dqx = qx-rx;
FT dpy = py-ry; FT dpy = py-ry;
FT dqy = qy-ry; FT dqy = qy-ry;
if (sign_of_determinant(dpx, dqx, dpy, dqy) != ZERO)
auto is_zero = sign_of_determinant(dpx, dqx, dpy, dqy) == ZERO;
if (certainly_not(is_zero))
return false; return false;
FT dpz = pz-rz; FT dpz = pz-rz;
FT dqz = qz-rz; FT dqz = qz-rz;
return CGAL_AND( sign_of_determinant(dpx, dqx, dpz, dqz) == ZERO , return is_zero & CGAL_AND( sign_of_determinant(dpx, dqx, dpz, dqz) == ZERO ,
sign_of_determinant(dpy, dqy, dpz, dqz) == ZERO ); sign_of_determinant(dpy, dqy, dpz, dqz) == ZERO );
} }
template < class FT > template < class FT >

View File

@ -34,11 +34,7 @@
#include <boost/bind/bind.hpp> #include <boost/bind/bind.hpp>
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <boost/random/mersenne_twister.hpp> #include <boost/random/mersenne_twister.hpp>
#if BOOST_VERSION >= 104700 #include <boost/random/uniform_int_distribution.hpp>
# include <boost/random/uniform_int_distribution.hpp>
#else
# include <boost/random/uniform_int.hpp>
#endif
#include <boost/random/uniform_01.hpp> #include <boost/random/uniform_01.hpp>
#include <boost/random/normal_distribution.hpp> #include <boost/random/normal_distribution.hpp>
#if defined(CGAL_LINKED_WITH_BOOST_IOSTREAMS) && defined(CGAL_LINKED_WITH_BOOST_SERIALIZATION) #if defined(CGAL_LINKED_WITH_BOOST_IOSTREAMS) && defined(CGAL_LINKED_WITH_BOOST_SERIALIZATION)
@ -65,17 +61,10 @@ inline void init_feature_class_data(FeatureClassDataFloat& /*data*/, int /*n_cla
} }
typedef std::unordered_set<int> FeatureSet; typedef std::unordered_set<int> FeatureSet;
#if BOOST_VERSION >= 104700
typedef boost::random::uniform_int_distribution<> UniformIntDist; typedef boost::random::uniform_int_distribution<> UniformIntDist;
typedef boost::random::normal_distribution<> NormalDist; typedef boost::random::normal_distribution<> NormalDist;
typedef boost::random::mt19937 RandomGen; typedef boost::random::mt19937 RandomGen;
typedef boost::random::uniform_01<> UnitDist; typedef boost::random::uniform_01<> UnitDist;
#else
typedef boost::uniform_int<> UniformIntDist;
typedef boost::normal_distribution<> NormalDist;
typedef boost::uniform_01<> UnitDist;
typedef boost::mt19937 RandomGen;
#endif
struct ForestParams { struct ForestParams {
size_t n_classes; size_t n_classes;

View File

@ -59,7 +59,7 @@ private:
using Image_bool = Image<bool>; using Image_bool = Image<bool>;
const PointRange* m_points; const PointRange* m_points;
std::optional<PointMap> m_point_map; PointMap m_point_map;
Iso_cuboid_3 m_bbox; Iso_cuboid_3 m_bbox;
float m_resolution; float m_resolution;
@ -342,7 +342,7 @@ public:
{ {
if (m_lower_scale == nullptr) if (m_lower_scale == nullptr)
{ {
const Point_3& p = get(m_point_map.value(), *(m_points->begin()+index)); const Point_3& p = get(m_point_map, *(m_points->begin()+index));
return (std::size_t)((p.x() - m_bbox.xmin()) / m_resolution); return (std::size_t)((p.x() - m_bbox.xmin()) / m_resolution);
} }
@ -356,7 +356,7 @@ public:
{ {
if (m_lower_scale == nullptr) if (m_lower_scale == nullptr)
{ {
const Point_3& p = get(m_point_map.value(), *(m_points->begin()+index)); const Point_3& p = get(m_point_map, *(m_points->begin()+index));
return (std::size_t)((p.y() - m_bbox.ymin()) / m_resolution); return (std::size_t)((p.y() - m_bbox.ymin()) / m_resolution);
} }

View File

@ -69,7 +69,7 @@ class Point_set_neighborhood
using key_type = std::uint32_t; using key_type = std::uint32_t;
using category = boost::readable_property_map_tag; using category = boost::readable_property_map_tag;
//My_point_property_map () { } My_point_property_map () { }
My_point_property_map (const PointRange *input, PointMap point_map) My_point_property_map (const PointRange *input, PointMap point_map)
: input (input), point_map (point_map) { } : input (input), point_map (point_map) { }
@ -88,7 +88,7 @@ class Point_set_neighborhood
using Knn = Orthogonal_k_neighbor_search<Search_traits, Distance, Splitter, Tree>; using Knn = Orthogonal_k_neighbor_search<Search_traits, Distance, Splitter, Tree>;
std::shared_ptr<Tree> m_tree; std::shared_ptr<Tree> m_tree;
std::optional<Distance> m_distance; Distance m_distance;
public: public:
@ -300,7 +300,7 @@ private:
void k_neighbors (const Point& query, const unsigned int k, OutputIterator output) const void k_neighbors (const Point& query, const unsigned int k, OutputIterator output) const
{ {
CGAL_assertion (m_tree != nullptr); CGAL_assertion (m_tree != nullptr);
Knn search (*m_tree, query, k, 0, true, m_distance.value()); Knn search (*m_tree, query, k, 0, true, m_distance);
for (typename Knn::iterator it = search.begin(); it != search.end(); ++ it) for (typename Knn::iterator it = search.begin(); it != search.end(); ++ it)
*(output ++) = it->first; *(output ++) = it->first;
} }

View File

@ -59,6 +59,8 @@ private:
public: public:
Face_descriptor_to_center_of_mass_map ()
: m_mesh (nullptr) { }
Face_descriptor_to_center_of_mass_map (const FaceGraph* mesh) Face_descriptor_to_center_of_mass_map (const FaceGraph* mesh)
: m_mesh (mesh), m_vpm (get (vertex_point, *m_mesh)) { } : m_mesh (mesh), m_vpm (get (vertex_point, *m_mesh)) { }
Face_descriptor_to_center_of_mass_map (const FaceGraph* mesh, VertexPointMap vpm) Face_descriptor_to_center_of_mass_map (const FaceGraph* mesh, VertexPointMap vpm)

View File

@ -562,7 +562,7 @@ Let <I>d0</I>\f$ \in \f$ <I>D</I> be a dart. Given <I>i</I>, 1 \f$ \leq \f$ <I>i
\section Combinatorial_mapDesign Design and Implementation History \section Combinatorial_mapDesign Design and Implementation History
The code of this package is inspired by Moka, a 3D topological modeler mainly developed by Fr&eacute;d&eacute;ric Vidil and Guillaume Damiand (<A HREF="https://moka-modeller.sourceforge.net/">https://moka-modeller.sourceforge.net/</A>). However, Moka was based on Generalized maps (and not Combinatorial maps), and the design was not \cgal "compatible". Thus, Guillaume Damiand started to develop a totally new package by mixing ideas taken from Moka with the design of the Halfedge data structure package of \cgal. Andreas Fabri and S&eacute;bastien Loriot contributed to the design, the coding, and to the documentation of the package, and Laurent Rineau helped for the design. Emma Michel contributed to the manual. Monique Teillaud and Bernd G&auml;rtner contributed to the manual by giving useful remarks, really numerous and detailed for Monique. Ken Arroyo Ohori contributed to the two reverse orientation functions. The code of this package is inspired by Moka, a 3D topological modeler mainly developed by Fr&eacute;d&eacute;ric Vidil and Guillaume Damiand (see https://projet.liris.cnrs.fr/moka/index.php and https://github.com/gdamiand/moka). However, Moka was based on Generalized maps (and not Combinatorial maps), and the design was not \cgal "compatible". Thus, Guillaume Damiand started to develop a totally new package by mixing ideas taken from Moka with the design of the Halfedge data structure package of \cgal. Andreas Fabri and S&eacute;bastien Loriot contributed to the design, the coding, and to the documentation of the package, and Laurent Rineau helped for the design. Emma Michel contributed to the manual. Monique Teillaud and Bernd G&auml;rtner contributed to the manual by giving useful remarks, really numerous and detailed for Monique. Ken Arroyo Ohori contributed to the two reverse orientation functions.
*/ */
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -148,6 +148,10 @@ namespace CGAL {
{ return mmap.mdarts.is_used(i); } { return mmap.mdarts.is_used(i); }
bool owns(size_type i) const bool owns(size_type i) const
{ return mmap.mdarts.owns(i); } { return mmap.mdarts.owns(i); }
size_type capacity() const
{ return mmap.mdarts.capacity(); }
size_type upper_bound() const
{ return mmap.mdarts.upper_bound(); }
private: private:
Self & mmap; Self & mmap;
}; };
@ -444,7 +448,7 @@ namespace CGAL {
(mattribute_containers).upper_bound(); (mattribute_containers).upper_bound();
} }
protected: protected:
// Set the handle on the i th attribute // Set the handle on the i th attribute
template<unsigned int i> template<unsigned int i>
void basic_set_dart_attribute(Dart_descriptor dh, void basic_set_dart_attribute(Dart_descriptor dh,

View File

@ -26,7 +26,7 @@ then the default traits class of `::convex_hull_3()` is `Convex_hull_traits_3<R>
\cgalHeading{Implementation} \cgalHeading{Implementation}
The algorithm implemented by these functions is the quickhull algorithm of The algorithm implemented by these functions is the quickhull algorithm of
Barnard <I>et al.</I> \cgalCite{bdh-qach-96}. Barber <I>et al.</I> \cgalCite{bdh-qach-96}.
*/ */

View File

@ -238,9 +238,10 @@ in \cgal programs, the executables should be linked with the CMake
imported target `CGAL::LASLIB_support` provided in imported target `CGAL::LASLIB_support` provided in
`CGAL_LASLIB_support.cmake`. `CGAL_LASLIB_support.cmake`.
The \laslib web site is <a \laslib information can be obtained from
href="https://rapidlasso.com/lastools/">`https://rapidlasso.com/lastools/`</a>. \laslib <a href="https://lastools.github.io/">https://lastools.github.io/</a> and
is usually distributed along with LAStools: for simplicity, \cgal <a href="https://rapidlasso.de/product-overview/">https://rapidlasso.de/product-overview/</a>.
\laslib is usually distributed along with LAStools: for simplicity, \cgal
provides <a href="https://github.com/CGAL/LAStools">a fork with a provides <a href="https://github.com/CGAL/LAStools">a fork with a
CMake based install procedure</a>. CMake based install procedure</a>.

View File

@ -276,8 +276,8 @@ dependencies.
\section sec-win-demo Trying CGAL algorithms using a Precompiled Demo \section sec-win-demo Trying CGAL algorithms using a Precompiled Demo
\cgal provides a few demos offering a graphical user interface for some \cgal algorithms. \cgal provides a few demos offering a graphical user interface for some \cgal algorithms.
All precompiled demos are available for download on the \ref packages page. All precompiled demos are available for download on the \ref packages page.
Two links are provided in the column on the right: the demo itself (under **Windows Demo**) and a set of dlls (under **Common Demo Dlls**) A link is provided in the column on the right, to download an archive. It contains the demo executable itself,
that contains dlls files that must be placed in the same directory as the `.exe` of the demo. and a set of dll files that must remain in the same directory as the `.exe` of the demo.
See for example the \ref PkgConvexHull3 package. See for example the \ref PkgConvexHull3 package.
*/ */

View File

@ -100,7 +100,7 @@
, pages = "617--625" , pages = "617--625"
, note = "SIGGRAPH '2005 Conference Proceedings" , note = "SIGGRAPH '2005 Conference Proceedings"
, volume = 24 , volume = 24
, url = "https://hal.inria.fr/inria-00226418" , url = "https://inria.hal.science/inria-00226418"
, geombib = "not yet" , geombib = "not yet"
} }
@ -157,7 +157,7 @@ Pion and Monique Teillaud and Mariette Yvinec"
@ARTICLE{cgal:bdt-hdcvd-14, @ARTICLE{cgal:bdt-hdcvd-14,
AUTHOR = {Mikhail Bogdanov and Olivier Devillers and Monique Teillaud}, AUTHOR = {Mikhail Bogdanov and Olivier Devillers and Monique Teillaud},
JOURNAL = {Journal of Computational Geometry}, JOURNAL = {Journal of Computational Geometry},
NOTE = {https://hal.inria.fr/hal-00961390}, NOTE = {https://inria.hal.science/hal-00961390},
PAGES = {56--85}, PAGES = {56--85},
TITLE = {Hyperbolic {Delaunay} complexes and {Voronoi} diagrams made practical}, TITLE = {Hyperbolic {Delaunay} complexes and {Voronoi} diagrams made practical},
VOLUME = {5}, VOLUME = {5},
@ -243,7 +243,7 @@ Pion and Monique Teillaud and Mariette Yvinec"
Boissonnat} Boissonnat}
, title = {Mesh Generation from 3D Multi-material Images} , title = {Mesh Generation from 3D Multi-material Images}
, pages = {283--290} , pages = {283--290}
, url = "https://hal.inria.fr/inria-00420228" , url = "https://inria.hal.science/inria-00420228"
, x-international-audience = "yes" , x-international-audience = "yes"
, x-proceedings = "yes" , x-proceedings = "yes"
} }
@ -257,7 +257,7 @@ Boissonnat}
, pages = "1455-14645" , pages = "1455-14645"
, volume = 28 , volume = 28
, year = 2009 , year = 2009
, url = "https://hal.inria.fr/inria-00413248" , url = "https://inria.hal.science/inria-00413248"
, x-international-audience = "yes" , x-international-audience = "yes"
, x-editorial-board = "yes" , x-editorial-board = "yes"
} }
@ -338,7 +338,7 @@ Boissonnat}
,title = "{PLY} - Polygon File Format" ,title = "{PLY} - Polygon File Format"
,howpublished = {Paul Bourke} ,howpublished = {Paul Bourke}
,year = 2011 ,year = 2011
,url = "http://paulbourke.net/dataformats/ply/" ,url = "https://paulbourke.net/dataformats/ply/"
} }
@ -361,7 +361,7 @@ Boissonnat}
TITLE = {Delaunay triangulations on orientable surfaces of low genus}, TITLE = {Delaunay triangulations on orientable surfaces of low genus},
YEAR = {2016}, YEAR = {2016},
DOI = {10.4230/LIPIcs.SoCG.2016.20}, DOI = {10.4230/LIPIcs.SoCG.2016.20},
URL = {https://hal.inria.fr/hal-01276386} URL = {https://inria.hal.science/hal-01276386}
} }
@ -402,7 +402,7 @@ Boissonnat}
,school = "Universit\'e de {Nice-Sophia Antipolis}" ,school = "Universit\'e de {Nice-Sophia Antipolis}"
,address = "France" ,address = "France"
,year = 2010 ,year = 2010
,url = "https://tel.archives-ouvertes.fr/tel-00552215/" ,url = "https://theses.hal.science/tel-00552215/"
} }
@inproceedings{cgal:ccplr-redtp-10, @inproceedings{cgal:ccplr-redtp-10,
@ -539,13 +539,13 @@ note="Conference version: Symp. on Geometry Processing 2003"
@inproceedings{ cgal:ct-c3pt-09 @inproceedings{ cgal:ct-c3pt-09
, title = "Computing {3D} Periodic Triangulations" , title = "Computing {3D} Periodic Triangulations"
, author = "Manuel Caroli and Monique Teillaud" , author = "Manuel Caroli and Monique Teillaud"
, booktitle = "Proceedings 17th European Symposium on Algorithms" , booktitle = "Proceedings 17th European Symposium on Algorithms"
, nickname = "ESA'09" , nickname = "ESA'09"
, series = "Lecture Notes in Computer Science" , series = "Lecture Notes in Computer Science"
, year = 2009 , year = 2009
, volume = 5757 , volume = 5757
, pages = "37--48" , pages = "37--48"
, note = "Full version available as INRIA Research Report 6823 \url{https://hal.inria.fr/inria-00356871}" , note = "Full version available as INRIA Research Report 6823 \url{https://inria.hal.science/inria-00356871}"
} }
@inproceedings{cgal:pt-rs-14, @inproceedings{cgal:pt-rs-14,
@ -729,7 +729,7 @@ Mourrain and Monique Teillaud"
@article{cgal:dmsl-ssmrp-11, @article{cgal:dmsl-ssmrp-11,
author = {Digne, Julie and Morel, Jean-Michel and Souzani, Charyar-Mehdi and author = {Digne, Julie and Morel, Jean-Michel and Souzani, Charyar-Mehdi and
Lartigue, Claire}, Lartigue, Claire},
title = {Scale Space Meshing of Raw Data Point Sets}, title = {Scale Space Meshing of Raw Data Point Sets},
journal = {Computer Graphics Forum}, journal = {Computer Graphics Forum},
year = {2011}, year = {2011},
@ -741,13 +741,13 @@ Mourrain and Monique Teillaud"
} }
@inproceedings{ cgal:dp-eegpd-03 @inproceedings{ cgal:dp-eegpd-03
, author = "Olivier Devillers and Sylvain Pion" , author = "Olivier Devillers and Sylvain Pion"
, title = "Efficient Exact Geometric Predicates for {Delaunay} Triangulations" , title = "Efficient Exact Geometric Predicates for {Delaunay} Triangulations"
, booktitle = "Proc. 5th Workshop Algorithm Eng. Exper." , booktitle = "Proc. 5th Workshop Algorithm Eng. Exper."
, nickname = "ALENEX '03" , nickname = "ALENEX '03"
, year = 2003 , year = 2003
, pages = "37--44" , pages = "37--44"
, url = "https://hal.inria.fr/inria-00344517/" , url = "https://inria.hal.science/inria-00344517/"
} }
@article{ cgal:dpt-wt-02 @article{ cgal:dpt-wt-02
@ -766,7 +766,7 @@ Teillaud"
, author = "Olivier Devillers and Monique Teillaud" , author = "Olivier Devillers and Monique Teillaud"
, title = "Perturbations and Vertex Removal in a {3D Delaunay} Triangulation" , title = "Perturbations and Vertex Removal in a {3D Delaunay} Triangulation"
, booktitle = "Proc. 14th ACM-SIAM Sympos. Discrete Algorithms (SODA)" , booktitle = "Proc. 14th ACM-SIAM Sympos. Discrete Algorithms (SODA)"
, url = "https://hal.inria.fr/inria-00166710/" , url = "https://inria.hal.science/inria-00166710/"
, year = 2003 , year = 2003
, pages = "313-319" , pages = "313-319"
} }
@ -778,7 +778,7 @@ Teillaud"
, volume = 44 , volume = 44
, year = 2011 , year = 2011
, pages = "160--168" , pages = "160--168"
, url = "https://hal.archives-ouvertes.fr/inria-00560388/" , url = "https://theses.hal.science/inria-00560388/"
, doi = "10.1016/j.comgeo.2010.09.010" , doi = "10.1016/j.comgeo.2010.09.010"
} }
@ -845,7 +845,7 @@ Teillaud"
,school = "Universit\'e de {Nice-Sophia Antipolis}" ,school = "Universit\'e de {Nice-Sophia Antipolis}"
,address = "France" ,address = "France"
,year = 2003 ,year = 2003
,url = "https://tel.archives-ouvertes.fr/tel-00832487/" ,url = "https://theses.hal.science/tel-00832487/"
} }
@ -1230,7 +1230,7 @@ Teillaud"
TITLE = {{Implementing Delaunay triangulations of the Bolza surface}}, TITLE = {{Implementing Delaunay triangulations of the Bolza surface}},
YEAR = {2017}, YEAR = {2017},
DOI = {10.4230/LIPIcs.SoCG.2017.44}, DOI = {10.4230/LIPIcs.SoCG.2017.44},
URL = {https://hal.inria.fr/hal-01568002}, URL = {https://inria.hal.science/hal-01568002},
} }
@inproceedings{cgal:j-lrsspp-19, @inproceedings{cgal:j-lrsspp-19,
@ -1261,13 +1261,13 @@ Teillaud"
@InProceedings{ cgal:k-reisv-04, @InProceedings{ cgal:k-reisv-04,
author = {Menelaos I. Karavelas}, author = {Menelaos I. Karavelas},
title = {A robust and efficient implementation for the segment title = {A robust and efficient implementation for the segment
{V}oronoi diagram}, {V}oronoi diagram},
booktitle = {Proc. Internat. Symp. on Voronoi diagrams in Science booktitle = {Proc. Internat. Symp. on Voronoi diagrams in Science
and Engineering (VD2004)}, and Engineering (VD2004)},
pages = {51--62}, pages = {51--62},
year = {2004} year = {2004}
} }
@article{ cgal:k-rprnm-96 @article{ cgal:k-rprnm-96
@ -1599,12 +1599,12 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio
} }
@article{cgal:ml-cfsg-00 @article{cgal:ml-cfsg-00
, author = "G. Medioni and M. Lee and C. Tang" , author = "G. Medioni and M. Lee and C. Tang"
, title = "A Computational Framework for Segmentation and Grouping" , title = "A Computational Framework for Segmentation and Grouping"
, journal = "Elsevier Science" , journal = "Elsevier Science"
, year = 2000 , year = 2000
, pages = "" , pages = ""
, update = "12.13 afabri" , update = "12.13 afabri"
} }
@book{ cgal:m-cst-93 @book{ cgal:m-cst-93
@ -1887,28 +1887,28 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio
@article{cgal:btsag-asosr-16, @article{cgal:btsag-asosr-16,
TITLE = {{A Survey of Surface Reconstruction from Point Clouds}}, TITLE = {{A Survey of Surface Reconstruction from Point Clouds}},
AUTHOR = {Berger, Matthew and Tagliasacchi, Andrea and Seversky, Lee and Alliez, Pierre and Guennebaud, Gael and Levine, Joshua and Sharf, Andrei and Silva, Claudio}, AUTHOR = {Berger, Matthew and Tagliasacchi, Andrea and Seversky, Lee and Alliez, Pierre and Guennebaud, Gael and Levine, Joshua and Sharf, Andrei and Silva, Claudio},
URL = {https://hal.inria.fr/hal-01348404}, URL = {https://inria.hal.science/hal-01348404},
JOURNAL = {{Computer Graphics Forum}}, JOURNAL = {{Computer Graphics Forum}},
PUBLISHER = {{Wiley}}, PUBLISHER = {{Wiley}},
PAGES = {27}, PAGES = {27},
YEAR = {2016}, YEAR = {2016},
DOI = {10.1111/cgf.12802}, DOI = {10.1111/cgf.12802},
PDF = {https://hal.inria.fr/hal-01348404/file/survey-author.pdf}, PDF = {https://inria.hal.science/hal-01348404/file/survey-author.pdf},
HAL_ID = {hal-01348404}, HAL_ID = {hal-01348404},
HAL_VERSION = {v2} HAL_VERSION = {v2}
} }
@TechReport{ cgal:pabl-cco-07, @TechReport{ cgal:pabl-cco-07,
author = {Poudret, M. and Arnould, A. and Bertrand, Y. and Lienhardt, P.}, author = {Poudret, M. and Arnould, A. and Bertrand, Y. and Lienhardt, P.},
title = {Cartes Combinatoires Ouvertes.}, title = {Cartes Combinatoires Ouvertes.},
institution = {Laboratoire SIC E.A. 4103}, institution = {Laboratoire SIC E.A. 4103},
number = {2007-1}, number = {2007-1},
month = {October}, month = {October},
year = {2007}, year = {2007},
address = {F-86962 Futuroscope Cedex, France}, address = {F-86962 Futuroscope Cedex, France},
type = {Research Notes}, type = {Research Notes},
keywords = {cartes combinatoires, demi-ar{\^e}te, ar{\^e}te radiale}, keywords = {cartes combinatoires, demi-ar{\^e}te, ar{\^e}te radiale},
} }
@article{ cgal:pc-rdp-86 @article{ cgal:pc-rdp-86
@ -2293,7 +2293,7 @@ location = {Salt Lake City, Utah, USA}
, pages = "75:1-75:9" , pages = "75:1-75:9"
, note = "SIGGRAPH '2009 Conference Proceedings" , note = "SIGGRAPH '2009 Conference Proceedings"
, volume = "28(3)" , volume = "28(3)"
, url = "https://hal.inria.fr/inria-00359288" , url = "https://inria.hal.science/inria-00359288"
, geombib = "not yet" , geombib = "not yet"
, x-editorial-board = {yes} , x-editorial-board = {yes}
, x-proceedings = {yes} , x-proceedings = {yes}
@ -2332,7 +2332,7 @@ location = {Salt Lake City, Utah, USA}
,month = jun ,month = jun
,pages = {26--31} ,pages = {26--31}
,annote = {Inlining vector expressions and parameter passing ,annote = {Inlining vector expressions and parameter passing
of expressions at compile time. Template Metaprograms.} of expressions at compile time. Template Metaprograms.}
,update = "98.01 kettner" ,update = "98.01 kettner"
} }
@ -2354,7 +2354,7 @@ location = {Salt Lake City, Utah, USA}
,month = may ,month = may
,pages = {36--43} ,pages = {36--43}
,annote = {Prime numbers at compiler time, C++ programs at ,annote = {Prime numbers at compiler time, C++ programs at
compile time, control structures, local variables.} compile time, control structures, local variables.}
,update = "98.01 kettner" ,update = "98.01 kettner"
} }
@ -2422,7 +2422,7 @@ location = {Salt Lake City, Utah, USA}
@book{ cgal:w-impoo-94 @book{ cgal:w-impoo-94
,author = {Josie Wernicke} ,author = {Josie Wernicke}
,title = {The Inventor Mentor: Programming Object-Oriented ,title = {The Inventor Mentor: Programming Object-Oriented
3D Graphics with Open Inventor, Release 2} 3D Graphics with Open Inventor, Release 2}
,publisher = {Addison-Wesley} ,publisher = {Addison-Wesley}
,year = 1994 ,year = 1994
,update = "97.04 kettner" ,update = "97.04 kettner"
@ -2549,12 +2549,12 @@ url = "https://wscg.zcu.cz/wscg2003/Papers_2003/G67.pdf"
} }
@InProceedings{cgal:k-vdc-06, @InProceedings{cgal:k-vdc-06,
author = {Menelaos I. Karavelas}, author = {Menelaos I. Karavelas},
title = {Voronoi diagrams in {\sc Cgal}}, title = {Voronoi diagrams in {\sc Cgal}},
booktitle = {22nd European Symposium on Computational Geometry}, booktitle = {22nd European Symposium on Computational Geometry},
pages = {229--232}, pages = {229--232},
year = {2006}, year = {2006},
address = {Delphi, Greece}, address = {Delphi, Greece},
} }
@incollection{cgal:fhktww-a-07, @incollection{cgal:fhktww-a-07,
@ -2607,27 +2607,27 @@ url = "https://www.boost.org/community/exception_safety.html"
} }
@article{cgal:as-solri-92 @article{cgal:as-solri-92
, author = "F. Aurenhammer and O. Schwarzkopf" , author = "F. Aurenhammer and O. Schwarzkopf"
, title = "A simple on-line randomized incremental algorithm for computing higher order {Voronoi} diagrams" , title = "A simple on-line randomized incremental algorithm for computing higher order {Voronoi} diagrams"
, journal = "Internat. J. Comput. Geom. Appl." , journal = "Internat. J. Comput. Geom. Appl."
, volume = 2 , volume = 2
, year = 1992 , year = 1992
, pages = "363--381" , pages = "363--381"
, keywords = "Voronoi diagrams, geometric transforms, dynamization" , keywords = "Voronoi diagrams, geometric transforms, dynamization"
, succeeds = "as-solri-91" , succeeds = "as-solri-91"
, update = "93.09 aurenhammer, 93.05 schwarzkopf" , update = "93.09 aurenhammer, 93.05 schwarzkopf"
} }
@inproceedings{cgal:fy-okvd-01 @inproceedings{cgal:fy-okvd-01
, author = "Julia Fl{\"o}totto and Mariette Yvinec" , author = "Julia Fl{\"o}totto and Mariette Yvinec"
, title = "Order-$k$ {Voronoi} Diagrams" , title = "Order-$k$ {Voronoi} Diagrams"
, booktitle = "Abstracts 17th European Workshop Comput. Geom." , booktitle = "Abstracts 17th European Workshop Comput. Geom."
, nickname = "CG 2001" , nickname = "CG 2001"
, site = "Berlin" , site = "Berlin"
, publisher = "Freie Universit{\"a}t Berlin" , publisher = "Freie Universit{\"a}t Berlin"
, year = 2001 , year = 2001
, pages = "109--112" , pages = "109--112"
, update = "01.04 icking" , update = "01.04 icking"
} }
@proceedings{cgal:jlm-isgp-98, @proceedings{cgal:jlm-isgp-98,
@ -2768,7 +2768,7 @@ author = "Pedro M.M. de Castro and Frederic Cazals and Sebastien Loriot and Moni
, volume = "40" , volume = "40"
, number = "1" , number = "1"
, pages = "61-78" , pages = "61-78"
, url = "https://hal.inria.fr/inria-00344310/" , url = "https://inria.hal.science/inria-00344310/"
, doi = "10.1016/j.comgeo.2007.06.003" , doi = "10.1016/j.comgeo.2007.06.003"
, x-international-audience = "yes" , x-international-audience = "yes"
, x-editorial-board = "yes" , x-editorial-board = "yes"
@ -2788,7 +2788,7 @@ author = "Pedro M.M. de Castro and Frederic Cazals and Sebastien Loriot and Moni
, title = "Complexity of {Delaunay} triangulation for points on lower-dimensional polyhedra" , title = "Complexity of {Delaunay} triangulation for points on lower-dimensional polyhedra"
, booktitle = "Proc. 18th ACM-SIAM Sympos. Discrete Algorithms" , booktitle = "Proc. 18th ACM-SIAM Sympos. Discrete Algorithms"
, nickname = "SODA" , nickname = "SODA"
, url = "https://hal.inria.fr/inria-00182835/" , url = "https://inria.hal.science/inria-00182835/"
, year = 2007 , year = 2007
, pages = "1106--1113" , pages = "1106--1113"
} }
@ -2856,14 +2856,14 @@ ADDRESS = "Saarbr{\"u}cken, Germany"
} }
@InCollection{grlr-sturm-habicht-98, @InCollection{grlr-sturm-habicht-98,
author = {L.~Gonzalez-Vega and T.~Recio and H.~Lombardi and M.-F.~Roy}, author = {L.~Gonzalez-Vega and T.~Recio and H.~Lombardi and M.-F.~Roy},
title = {Sturm-Habicht Sequences, Determinants and Real Roots of Univariate Polynomials}, title = {Sturm-Habicht Sequences, Determinants and Real Roots of Univariate Polynomials},
booktitle = {Quantifier Elimination and Cylindrical Algebraic Decomposition}, booktitle = {Quantifier Elimination and Cylindrical Algebraic Decomposition},
pages = {300--316}, pages = {300--316},
publisher = {Springer}, publisher = {Springer},
year = 1998, year = 1998,
editor = {B.F.~Caviness and J.R.~Johnson}, editor = {B.F.~Caviness and J.R.~Johnson},
series = {Texts and Monographs in Symbolic Computation} series = {Texts and Monographs in Symbolic Computation}
} }
@inproceedings{Sorkine2007AsRigidAs, @inproceedings{Sorkine2007AsRigidAs,
@ -3213,14 +3213,14 @@ pages = "207--221"
@techreport{frey:inria-00069921, @techreport{frey:inria-00069921,
TITLE = {{MEDIT : An interactive Mesh visualization Software}}, TITLE = {{MEDIT : An interactive Mesh visualization Software}},
AUTHOR = {Frey, Pascal}, AUTHOR = {Frey, Pascal},
URL = {https://hal.inria.fr/inria-00069921}, URL = {https://inria.hal.science/inria-00069921},
NUMBER = {RT-0253}, NUMBER = {RT-0253},
PAGES = {41}, PAGES = {41},
INSTITUTION = {{INRIA}}, INSTITUTION = {{INRIA}},
YEAR = {2001}, YEAR = {2001},
MONTH = Dec, MONTH = Dec,
KEYWORDS = {MESH ; VISUALIZATION ; POST-PROCESSING}, KEYWORDS = {MESH ; VISUALIZATION ; POST-PROCESSING},
PDF = {https://hal.inria.fr/inria-00069921/file/RT-0253.pdf}, PDF = {https://inria.hal.science/inria-00069921/file/RT-0253.pdf},
HAL_ID = {inria-00069921}, HAL_ID = {inria-00069921},
HAL_VERSION = {v1} HAL_VERSION = {v1}
} }

File diff suppressed because it is too large Load Diff

View File

@ -172,9 +172,9 @@ ALIASES = "cgal=%CGAL" \
"cgalPkgSince{1}=<B>Introduced in:</B> \cgal \1<BR>" \ "cgalPkgSince{1}=<B>Introduced in:</B> \cgal \1<BR>" \
"cgalPkgDependsOn{1}=<B>Depends on:</B> \1 <BR>" \ "cgalPkgDependsOn{1}=<B>Depends on:</B> \1 <BR>" \
"cgalPkgLicense{1}=<B>License:</B> \1 <BR>" \ "cgalPkgLicense{1}=<B>License:</B> \1 <BR>" \
"cgalPkgDemo{2}=<B>Windows demo:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a><BR><B>Common demo dlls:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/CGAL-demoDLLs.zip\">dlls</a><BR>" \ "cgalPkgDemo{2}=<B>Windows Demo:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a><BR>" \
"cgalPkgDemo{4}=<B>Windows demos:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\4\">\3</a><BR><B>Common demo dlls:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/CGAL-demoDLLs.zip\">dlls</a><BR>" \ "cgalPkgDemo{4}=<B>Windows Demos:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\4\">\3</a><BR>" \
"cgalPkgDemo{6}=<B>Windows demos:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\4\">\3</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\6\">\5</a><BR><B>Common demo dlls:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/CGAL-demoDLLs.zip\">dlls</a><BR>" \ "cgalPkgDemo{6}=<B>Windows Demos:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\4\">\3</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\6\">\5</a><BR>" \
"cgalPkgDescriptionEnd=" \ "cgalPkgDescriptionEnd=" \
"cgalModifBegin=\htmlonly <div class=\"CGALModification\"> \endhtmlonly \xrefitem Modification \"Modifications\" \"MODIFICATIONS\" " \ "cgalModifBegin=\htmlonly <div class=\"CGALModification\"> \endhtmlonly \xrefitem Modification \"Modifications\" \"MODIFICATIONS\" " \
"cgalModifEnd=\htmlonly </div> \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \ "cgalModifEnd=\htmlonly </div> \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \

View File

@ -181,9 +181,9 @@ ALIASES = "cgal=%CGAL" \
"cgalPkgSince{1}=<B>Introduced in:</B> \cgal \1<BR>" \ "cgalPkgSince{1}=<B>Introduced in:</B> \cgal \1<BR>" \
"cgalPkgDependsOn{1}=<B>Depends on:</B> \1 <BR>" \ "cgalPkgDependsOn{1}=<B>Depends on:</B> \1 <BR>" \
"cgalPkgLicense{1}=<B>License:</B> \1 <BR>" \ "cgalPkgLicense{1}=<B>License:</B> \1 <BR>" \
"cgalPkgDemo{2}=<B>Windows demo:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a><BR><B>Common demo dlls:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/CGAL-demoDLLs.zip\">dlls</a><BR>" \ "cgalPkgDemo{2}=<B>Windows Demo:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a><BR>" \
"cgalPkgDemo{4}=<B>Windows demos:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\4\">\3</a><BR><B>Common demo dlls:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/CGAL-demoDLLs.zip\">dlls</a><BR>" \ "cgalPkgDemo{4}=<B>Windows Demos:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\4\">\3</a><BR>" \
"cgalPkgDemo{6}=<B>Windows demos:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\4\">\3</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\6\">\5</a><BR><B>Common demo dlls:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/CGAL-demoDLLs.zip\">dlls</a><BR>" \ "cgalPkgDemo{6}=<B>Windows Demos:</B> <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\2\">\1</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\4\">\3</a>, <a href=\"https://www.cgal.org/demo/${CGAL_CREATED_VERSION_NUM}/\6\">\5</a><BR>" \
"cgalPkgDescriptionEnd=" \ "cgalPkgDescriptionEnd=" \
"cgalModifBegin=\htmlonly <div class=\"CGALModification\"> \endhtmlonly \xrefitem Modification \"Modifications\" \"MODIFICATIONS\"" \ "cgalModifBegin=\htmlonly <div class=\"CGALModification\"> \endhtmlonly \xrefitem Modification \"Modifications\" \"MODIFICATIONS\"" \
"cgalModifEnd=\htmlonly </div> \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \ "cgalModifEnd=\htmlonly </div> \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \

View File

@ -85,7 +85,7 @@ pre_html=r"""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt
<link rel="icon" type="image/png" href="../Manual/g-196x196-doc.png"/> <link rel="icon" type="image/png" href="../Manual/g-196x196-doc.png"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<link href="stylesheet.css" rel="stylesheet" type="text/css" /> <link href="cgal_stylesheet.css" rel="stylesheet" type="text/css" />
<title>CGAL ${CGAL_CREATED_VERSION_NUM} - Manual: Acknowledging CGAL</title> <title>CGAL ${CGAL_CREATED_VERSION_NUM} - Manual: Acknowledging CGAL</title>
</head> </head>
<body> <body>

View File

@ -70,7 +70,7 @@ def clean_doc():
duplicate_files=list(package_glob('./*/jquery.js')) duplicate_files=list(package_glob('./*/jquery.js'))
duplicate_files.extend(package_glob('./*/dynsections.js')) duplicate_files.extend(package_glob('./*/dynsections.js'))
duplicate_files.extend(package_glob('./*/resize.js')) duplicate_files.extend(package_glob('./*/resize.js'))
duplicate_files.extend(package_glob('./*/stylesheet.css')) duplicate_files.extend(package_glob('./*/cgal_stylesheet.css'))
# kill _all_, including the one in CGAL tabs.css files # kill _all_, including the one in CGAL tabs.css files
duplicate_files.extend(glob.glob('./*/tabs.css')) duplicate_files.extend(glob.glob('./*/tabs.css'))
# left-over by doxygen? # left-over by doxygen?

View File

@ -37,7 +37,7 @@
#ifdef CGAL_ENVELOPE_USE_BFS_FACE_ORDER #ifdef CGAL_ENVELOPE_USE_BFS_FACE_ORDER
#include <CGAL/Arr_face_index_map.h> #include <CGAL/Arr_face_index_map.h>
#include <CGAL/graph_traits_dual_arrangement_on_surface_2.h> #include <CGAL/graph_traits_dual_arrangement_on_surface_2.h>
#include <CGAL/boost/graph/dijkstra_shortest_paths.h> #include <boost/graph/dijkstra_shortest_paths.hpp>
#endif #endif
// this base divide & conquer algorithm splits the input into 2 groups, // this base divide & conquer algorithm splits the input into 2 groups,

View File

@ -2,7 +2,6 @@ Algebraic_foundations
Apollonius_graph_2 Apollonius_graph_2
Arithmetic_kernel Arithmetic_kernel
Arrangement_on_surface_2 Arrangement_on_surface_2
BGL
Cartesian_kernel Cartesian_kernel
Circulator Circulator
Distance_2 Distance_2

View File

@ -293,7 +293,6 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
double drt = (((square( drx ) + square( dry )) + square( drz )) + twt_rwt); double drt = (((square( drx ) + square( dry )) + square( drz )) + twt_rwt);
int cmp; int cmp;
int int_tmp_result; int int_tmp_result;
double eps;
double RT_tmp_result = CGAL::determinant( dpx, dpy, dpt, dqx, dqy, dqt, drx, dry, drt ); double RT_tmp_result = CGAL::determinant( dpx, dpy, dpt, dqx, dqy, dqt, drx, dry, drt );
double max7 = CGAL::abs(dpz); double max7 = CGAL::abs(dpz);
@ -371,217 +370,45 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
if( max5 < aqx_rx ) max5 = aqx_rx; if( max5 < aqx_rx ) max5 = aqx_rx;
double max6 = CGAL::abs(qy_ry); double max6 = CGAL::abs(qy_ry);
if( max6 < apy_ry ) max6 = apy_ry; if( max6 < apy_ry ) max6 = apy_ry;
if( (cmp != 0) )
{ int int_tmp_result_FFWKCAA;
int int_tmp_result_FFWKCAA; double double_tmp_result;
double double_tmp_result; double_tmp_result = ((px_rx * qy_ry) - (qx_rx * py_ry));
double_tmp_result = ((px_rx * qy_ry) - (qx_rx * py_ry)); lower_bound_1 = max5;
lower_bound_1 = max5; upper_bound_1 = max5;
upper_bound_1 = max5; if( (max6 < lower_bound_1) ) lower_bound_1 = max6;
if( (max6 < lower_bound_1) ) lower_bound_1 = max6;
else
{
if( (max6 > upper_bound_1) ) upper_bound_1 = max6;
}
if( (lower_bound_1 < 5.00368081960964690982e-147) )
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
else
{
if( (upper_bound_1 > 7.23700557733225980357e+75) )
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
double eps = (8.88720573725927976811e-16 * (max5 * max6));
if( (double_tmp_result > eps) ) int_tmp_result_FFWKCAA = 1;
else
{
if( (double_tmp_result < -eps) )
{
int_tmp_result_FFWKCAA = -1;
}
else
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
}
}
return static_cast<result_type>(cmp * int_tmp_result_FFWKCAA);
}
int int_tmp_result_k60Ocge;
double RT_tmp_result_3SPBwDj = CGAL::determinant( dpx, dpz, dpt, dqx, dqz, dqt, drx, drz, drt );
lower_bound_1 = max1;
upper_bound_1 = max1;
if( (max7 < lower_bound_1) ) lower_bound_1 = max7;
if( (max2 < lower_bound_1) ) lower_bound_1 = max2;
//handwritten workaround to handle case where all weights are equal
//if( ((lower_bound_1 < 2.92391967062015793913e-74) || (max4 < 8.54930624023949352313e-148)) )
if( ((lower_bound_1 < 2.92391967062015793913e-74) || (max4 < 8.54930624023949352313e-148 && max4!=0)) )
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
else else
{ {
if( ((upper_bound_1 > 7.23700557733225980357e+75) || (max4 > 5.23742497263382350320e+151)) )
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
eps = (3.04426660386257731823e-14 * ((max2 * max7) * (CGAL::max)( max4, (max1 * max1) )));
if( (RT_tmp_result_3SPBwDj > eps) )
{
int_tmp_result_k60Ocge = 1;
}
else
{
if( (RT_tmp_result_3SPBwDj < -eps) )
{
int_tmp_result_k60Ocge = -1;
}
else
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
}
}
cmp = int_tmp_result_k60Ocge;
double qz_rz = (qz - rz);
double pz_rz = (pz - rz);
double max8 = CGAL::abs(qz_rz);
double apz_rz = CGAL::abs(pz_rz);
if( max8 < apz_rz ) max8 = apz_rz;
if( (cmp != 0) )
{
int int_tmp_result_k3Lzf6g;
double double_tmp_result_Gx4H;
double_tmp_result_Gx4H = ((px_rx * qz_rz) - (qx_rx * pz_rz));
lower_bound_1 = max5;
upper_bound_1 = max5;
if( (max8 < lower_bound_1) ) lower_bound_1 = max8;
else
{
if( (max8 > upper_bound_1) ) upper_bound_1 = max8;
}
if( (lower_bound_1 < 5.00368081960964690982e-147) )
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
else
{
if( (upper_bound_1 > 7.23700557733225980357e+75) )
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
eps = (8.88720573725927976811e-16 * (max5 * max8));
if( (double_tmp_result_Gx4H > eps) )
{
int_tmp_result_k3Lzf6g = 1;
}
else
{
if( (double_tmp_result_Gx4H < -eps) )
{
int_tmp_result_k3Lzf6g = -1;
}
else
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
}
}
return static_cast<result_type>(cmp * int_tmp_result_k3Lzf6g);
}
int int_tmp_result_AvrrXBP;
double RT_tmp_result_feLwnHn = CGAL::determinant( dpy, dpz, dpt, dqy, dqz, dqt, dry, drz, drt );
lower_bound_1 = max1;
upper_bound_1 = max1;
if( (max7 < lower_bound_1) ) lower_bound_1 = max7;
if( (max3 < lower_bound_1) ) lower_bound_1 = max3;
//handwritten workaround to handle case where all weights are equal
//if( ((lower_bound_1 < 2.92391967062015793913e-74) || (max4 < 8.54930624023949352313e-148)) )
if( ((lower_bound_1 < 2.92391967062015793913e-74) || (max4 < 8.54930624023949352313e-148 && max4!=0)) )
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
else
{
if( ((upper_bound_1 > 7.23700557733225980357e+75) || (max4 > 5.23742497263382350320e+151)) )
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
eps = (3.04426660386257731823e-14 * ((max3 * max7) * (CGAL::max)( max4, (max1 * max1) )));
if( (RT_tmp_result_feLwnHn > eps) )
{
int_tmp_result_AvrrXBP = 1;
}
else
{
if( (RT_tmp_result_feLwnHn < -eps) )
{
int_tmp_result_AvrrXBP = -1;
}
else
{
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t);
}
}
}
cmp = int_tmp_result_AvrrXBP;
int int_tmp_result_agX3WsT;
double double_tmp_result_Dw20Kqh = ((py_ry * qz_rz) - (qy_ry * pz_rz));
lower_bound_1 = max8;
upper_bound_1 = max8;
if( (max6 < lower_bound_1) )
{
lower_bound_1 = max6;
}
else
{
if( (max6 > upper_bound_1) ) upper_bound_1 = max6; if( (max6 > upper_bound_1) ) upper_bound_1 = max6;
} }
if( (lower_bound_1 < 5.00368081960964690982e-147) ) if( (lower_bound_1 < 5.00368081960964690982e-147) )
{ {
CGAL_BRANCH_PROFILER_BRANCH_2(tmp); CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t); return Base::operator()(p,q,r,t);
} }
else else
{ {
if( (upper_bound_1 > 7.23700557733225980357e+75) ) if( (upper_bound_1 > 7.23700557733225980357e+75) )
{ {
CGAL_BRANCH_PROFILER_BRANCH_2(tmp); CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t); return Base::operator()(p,q,r,t);
} }
eps = (8.88720573725927976811e-16 * (max6 * max8)); double eps = (8.88720573725927976811e-16 * (max5 * max6));
if( (double_tmp_result_Dw20Kqh > eps) ) if( (double_tmp_result > eps) ) int_tmp_result_FFWKCAA = 1;
{
int_tmp_result_agX3WsT = 1;
}
else else
{ {
if( (double_tmp_result_Dw20Kqh < -eps) ) if( (double_tmp_result < -eps) )
{ {
int_tmp_result_agX3WsT = -1; int_tmp_result_FFWKCAA = -1;
} }
else else
{ {
CGAL_BRANCH_PROFILER_BRANCH_2(tmp); CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
return Base::operator()(p,q,r,t); return Base::operator()(p,q,r,t);
} }
} }
} }
return static_cast<result_type>(cmp * int_tmp_result_agX3WsT); return static_cast<result_type>(cmp * int_tmp_result_FFWKCAA);
} }
else else
return Base::operator()(p,q,r,t); return Base::operator()(p,q,r,t);

View File

@ -571,7 +571,7 @@ Let <I>d0</I> \f$ \in \f$ <I>D</I> be a dart. Given <I>i</I>, 0 \f$ \leq \f$ <I>
\section Generalized_mapDesign Design and Implementation History \section Generalized_mapDesign Design and Implementation History
The code of this package followed the code of Combinatorial maps and was inspired by Moka, a 3D topological modeler that uses 3D generalized maps (<A HREF="https://moka-modeller.sourceforge.net/">https://moka-modeller.sourceforge.net/</A>). The code of this package followed the code of Combinatorial maps and was inspired by Moka, a 3D topological modeler that uses 3D generalized maps (see https://projet.liris.cnrs.fr/moka/index.php and https://github.com/gdamiand/moka).
*/ */
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -18,6 +18,10 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Widgets) find_package(Qt5 QUIET COMPONENTS Widgets)
include_directories(BEFORE ./include) include_directories(BEFORE ./include)
find_package(Eigen3 3.1.91 QUIET) #(requires 3.1.91 or greater)
include(CGAL_Eigen3_support)
if(TARGET CGAL::Eigen3_support)
if(CGAL_Qt5_FOUND AND Qt5_FOUND) if(CGAL_Qt5_FOUND AND Qt5_FOUND)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -40,7 +44,8 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Bounding_volumes) add_to_cached_list(CGAL_EXECUTABLE_TARGETS Bounding_volumes)
target_link_libraries(Bounding_volumes PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 target_link_libraries(Bounding_volumes PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Widgets) Qt5::Widgets
PUBLIC CGAL::Eigen3_support)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Bounding_volumes) cgal_add_compilation_test(Bounding_volumes)
@ -53,3 +58,6 @@ else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
endif() endif()
else()
message("NOTICE: This demo requires CGAL and Eigen, and will not be compiled.")
endif()

View File

@ -1,6 +1,9 @@
#ifndef ELLIPSE_H #ifndef ELLIPSE_H
#define ELLIPSE_H #define ELLIPSE_H
#include <Eigen/Dense>
#include <Eigen/Eigenvalues>
template <class R> template <class R>
class Ellipse_2 { class Ellipse_2 {
@ -20,50 +23,51 @@ template <class R>
CGAL::Simple_cartesian<double>::Conic_2 co; CGAL::Simple_cartesian<double>::Conic_2 co;
me.ellipse().double_conic(co); me.ellipse().double_conic(co);
double a11 = co.r(); // https://en.wikipedia.org/wiki/Matrix_representation_of_conic_sections
double a12 = co.t()/2.0; double A = co.r();
double a22 = co.s(); double B = co.t();
double b1 = co.u(); double C = co.s();
double b2 = co.v(); double D = co.u();
double c = co.w(); double E = co.v();
double F = co.w();
assert(a11*a22-a12*a12 >= 0); assert(A * C - B*B/4 >= 0);
double delta = (a11>a22)? a11-a22 : a22-a11; Eigen::Matrix2d A33, A33i;
if( (delta < 0.00000000001) && (a12 == 0)){ A33 << A, B/2, B/2, C;
ce = Point_2(-b1/(2*a11), -b2/(2*a11)); A33i = A33.inverse();
a_ = b_ = std::sqrt(b1*b1+b2*b2-4*a11*c)/(2*a11);
va_ = Vector_2(a_, 0);
vb_ = Vector_2(0, b_);
return;
}
double kden = 2.0*(a12*a12 - a11*a22); Eigen::Vector2d v;
double k1 = (a22*b1 - a12*b2)/kden; v << -D/2 , -E/2;
double k2 = (a11*b2 - a12*b1)/kden;
ce = Point_2(k1,k2);
double mu = 1/(a11*k1*k1 + 2.0*a12*k1*k2 + a22*k2*k2 - c);
double m11 = mu*a11;
double m12 = mu*a12;
double m22 = mu*a22;
double r = std::sqrt((m11-m22)*(m11-m22) + 4.0*m12*m12); v = A33i * v;
double lambda1 = ((m11+m22) + r)/2.0;
double lambda2 = ((m11+m22) - r)/2.0;
b_ = 1.0/sqrt(lambda1); ce = Point_2(v[0],v[1]);
a_ = 1.0/sqrt(lambda2);
double omega = 1.0/
std::sqrt((lambda1-m22)*(lambda1-m22) + m12*m12);
double u1x = - a_ * omega*m12; Eigen::EigenSolver<Eigen::Matrix2d> es(A33);
double u1y = a_ * omega * (lambda1-m22);
double u2x = b_* omega * (lambda1-m22); Eigen::Matrix2cd ev;
double u2y = b_* omega*m12; ev = es.eigenvectors();
double x0 = ev.col(0)[0].real();
double y0 = ev.col(0)[1].real();
double x1 = ev.col(1)[0].real();
double y1 = ev.col(1)[1].real();
va_ = Vector_2(u1x,u1y); double lambda1 = es.eigenvalues()[0].real();
vb_ = Vector_2(u2x,u2y); double lambda2 = es.eigenvalues()[1].real();
Eigen::Matrix3d AQ;
AQ << A, B/2, D/2,
B/2, C, E/2,
D/2, E/2, F;
double K = AQ.determinant() / A33.determinant();
a_ = sqrt(-K/lambda1);
b_ = sqrt(-K/lambda2);
va_ = a_ * Vector_2(x0,y0);
vb_ = b_ * Vector_2(x1,y1);
} }

View File

@ -0,0 +1,3 @@
0 2
2 1
0 0

View File

@ -0,0 +1,4 @@
-2 1
-2 -1
2 1
2 -1

View File

@ -0,0 +1,4 @@
-2 -1
-1 -2
1 2
2 1

View File

@ -746,17 +746,23 @@ protected:
fit->info().is_process = false; fit->info().is_process = false;
} }
// (2.2) We check if the facet is external or internal // (2.2) We check if the facet is external or internal
std::queue<typename CDT::Face_handle> face_queue; std::queue<typename CDT::Face_handle> face_queue, faces_internal;
typename CDT::Face_handle face_internal = nullptr;
if (cdt.infinite_vertex()->face()!=nullptr) if (cdt.infinite_vertex()->face()!=nullptr)
{ face_queue.push(cdt.infinite_vertex()->face()); } {
typename CDT::Face_circulator
incident_faces(cdt.infinite_vertex()), end_incident_faces(incident_faces);
do
{ face_queue.push(incident_faces); }
while(++incident_faces!=end_incident_faces);
}
// std::cout<<"# faces PUSHED "<<face_queue.size()<<std::endl;
while(!face_queue.empty()) while(!face_queue.empty())
{ {
typename CDT::Face_handle fh = face_queue.front(); typename CDT::Face_handle fh=face_queue.front();
face_queue.pop(); face_queue.pop();
if(!fh->info().is_process) if(!fh->info().is_process)
{ {
fh->info().is_process = true; fh->info().is_process=true;
for(int i=0; i<3; ++i) for(int i=0; i<3; ++i)
{ {
if(!cdt.is_constrained(std::make_pair(fh, i))) if(!cdt.is_constrained(std::make_pair(fh, i)))
@ -764,21 +770,16 @@ protected:
if (fh->neighbor(i)!=nullptr) if (fh->neighbor(i)!=nullptr)
{ face_queue.push(fh->neighbor(i)); } { face_queue.push(fh->neighbor(i)); }
} }
else if (face_internal==nullptr) else
{ { faces_internal.push(fh->neighbor(i)); }
face_internal = fh->neighbor(i);
}
} }
} }
} }
if ( face_internal!=nullptr ) while(!faces_internal.empty())
{ face_queue.push(face_internal); }
while(!face_queue.empty())
{ {
typename CDT::Face_handle fh = face_queue.front(); typename CDT::Face_handle fh=faces_internal.front();
face_queue.pop(); faces_internal.pop();
if(!fh->info().is_process) if(!fh->info().is_process)
{ {
fh->info().is_process = true; fh->info().is_process = true;
@ -788,7 +789,7 @@ protected:
if(!cdt.is_constrained(std::make_pair(fh, i))) if(!cdt.is_constrained(std::make_pair(fh, i)))
{ {
if (fh->neighbor(i)!=nullptr) if (fh->neighbor(i)!=nullptr)
{ face_queue.push(fh->neighbor(i)); } { faces_internal.push(fh->neighbor(i)); }
} }
} }
} }

View File

@ -8,5 +8,5 @@ is available in:
Mikhail Bogdanov, Olivier Devillers, and Monique Teillaud. Hyperbolic Mikhail Bogdanov, Olivier Devillers, and Monique Teillaud. Hyperbolic
Delaunay complexes and Voronoi diagrams made practical. Journal of Delaunay complexes and Voronoi diagrams made practical. Journal of
Computational Geometry, 5(1):5685, 2014. Computational Geometry, 5(1):5685, 2014.
URL: https://hal.inria.fr/hal-00961390, URL: https://inria.hal.science/hal-00961390,
doi:10.20382/jocg.v5i1a4. doi:10.20382/jocg.v5i1a4.

View File

@ -1,7 +1,6 @@
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup kernel_affine
\ingroup kernel_classes2 \ingroup kernel_classes2
The class `Aff_transformation_2` represents two-dimensional affine transformations. The class `Aff_transformation_2` represents two-dimensional affine transformations.

View File

@ -2,7 +2,6 @@ namespace CGAL {
/*! /*!
\ingroup kernel_classes3 \ingroup kernel_classes3
\ingroup kernel_affine
The class `Aff_transformation_3` represents three-dimensional affine transformations. The class `Aff_transformation_3` represents three-dimensional affine transformations.
The general form of an affine transformation is based on a homogeneous The general form of an affine transformation is based on a homogeneous

View File

@ -2,7 +2,7 @@
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup kernel_affine \ingroup PkgKernel23Ref
Tag class for affine transformations. Tag class for affine transformations.
@ -24,7 +24,7 @@ public:
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup kernel_affine \ingroup PkgKernel23Ref
Tag class for affine transformations. Tag class for affine transformations.
@ -46,7 +46,7 @@ public:
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup kernel_affine \ingroup PkgKernel23Ref
Tag class for affine transformations. Tag class for affine transformations.
@ -68,7 +68,7 @@ public:
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup kernel_affine \ingroup PkgKernel23Ref
Tag class for affine transformations. Tag class for affine transformations.
@ -90,7 +90,7 @@ public:
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup kernel_affine \ingroup PkgKernel23Ref
Tag class for affine transformations. Tag class for affine transformations.

View File

@ -12,7 +12,7 @@ function are available.
/*! /*!
\addtogroup do_intersect_linear_grp \addtogroup do_intersect_linear_grp
\ingroup do_intersect \ingroup do_intersect_grp
\sa `do_intersect_circular_grp` \sa `do_intersect_circular_grp`
\sa `do_intersect_spherical_grp` \sa `do_intersect_spherical_grp`
@ -79,7 +79,7 @@ function are available.
/*! /*!
\addtogroup intersection_linear_grp \addtogroup intersection_linear_grp
\ingroup intersection \ingroup intersection_grp
*/ */
/// @{ /// @{

View File

@ -99,14 +99,14 @@ namespace CGAL {
{}; {};
template<int i> template<int i>
struct Attribute_const_descriptor: struct Attribute_const_descriptor:
public Helper::template Attribute_const_descriptor<i> public Helper::template Attribute_const_descriptor<i>
{}; {};
template<int i> template<int i>
struct Attribute_range: public Helper::template Attribute_range<i> struct Attribute_range: public Helper::template Attribute_range<i>
{}; {};
template<int i> template<int i>
struct Attribute_const_range: struct Attribute_const_range:
public Helper::template Attribute_const_range<i> public Helper::template Attribute_const_range<i>
{}; {};
typedef typename Attribute_type<0>::type Vertex_attribute; typedef typename Attribute_type<0>::type Vertex_attribute;
@ -169,6 +169,10 @@ namespace CGAL {
{ return mmap.mdarts.is_used(i); } { return mmap.mdarts.is_used(i); }
bool owns(size_type i) const bool owns(size_type i) const
{ return mmap.mdarts.owns(i); } { return mmap.mdarts.owns(i); }
size_type capacity() const
{ return mmap.mdarts.capacity(); }
size_type upper_bound() const
{ return mmap.mdarts.upper_bound(); }
private: private:
Self & mmap; Self & mmap;
}; };
@ -202,7 +206,7 @@ namespace CGAL {
* @return true iff the map is empty. * @return true iff the map is empty.
*/ */
bool is_empty() const bool is_empty() const
{ return darts().empty(); } { return darts().empty(); }
/// @return the number of darts. /// @return the number of darts.
size_type number_of_darts() const size_type number_of_darts() const
@ -288,18 +292,18 @@ namespace CGAL {
typename Attribute_descriptor<i>::type attribute(Dart_descriptor ADart) typename Attribute_descriptor<i>::type attribute(Dart_descriptor ADart)
{ {
static_assert(Helper::template Dimension_index<i>::value>=0, static_assert(Helper::template Dimension_index<i>::value>=0,
"attribute<i> called but i-attributes are disabled."); "attribute<i> called but i-attributes are disabled.");
return std::get<Helper::template Dimension_index<i>::value> return std::get<Helper::template Dimension_index<i>::value>
(mdarts[ADart].mattribute_descriptors); (mdarts[ADart].mattribute_descriptors);
} }
template<unsigned int i> template<unsigned int i>
typename Attribute_const_descriptor<i>::type typename Attribute_const_descriptor<i>::type
attribute(Dart_const_descriptor ADart) const attribute(Dart_const_descriptor ADart) const
{ {
static_assert(Helper::template Dimension_index<i>::value>=0, static_assert(Helper::template Dimension_index<i>::value>=0,
"attribute<i> called but i-attributes are disabled."); "attribute<i> called but i-attributes are disabled.");
return std::get<Helper::template Dimension_index<i>::value> return std::get<Helper::template Dimension_index<i>::value>
(mdarts[ADart].mattribute_descriptors); (mdarts[ADart].mattribute_descriptors);
} }
// Copy a given attribute // Copy a given attribute
@ -360,7 +364,7 @@ namespace CGAL {
{ {
CGAL_assertion( ah!=null_descriptor ); CGAL_assertion( ah!=null_descriptor );
return std::get<Helper::template Dimension_index<i>::value> return std::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah]; (mattribute_containers)[ah];
} }
template<unsigned int i> template<unsigned int i>
const typename Attribute_type<i>::type& const typename Attribute_type<i>::type&
@ -368,7 +372,7 @@ namespace CGAL {
{ {
CGAL_assertion( ah!=null_descriptor ); CGAL_assertion( ah!=null_descriptor );
return std::get<Helper::template Dimension_index<i>::value> return std::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah]; (mattribute_containers)[ah];
} }
// Get the dart of the given attribute // Get the dart of the given attribute
@ -486,14 +490,14 @@ namespace CGAL {
typename Attribute_descriptor<i>::type ah) typename Attribute_descriptor<i>::type ah)
{ {
std::get<Helper::template Dimension_index<i>::value> std::get<Helper::template Dimension_index<i>::value>
(mdarts[dh].mattribute_descriptors) = ah; (mdarts[dh].mattribute_descriptors) = ah;
} }
/** Link a dart with a given dart for a given dimension. /** Link a dart with a given dart for a given dimension.
* @param adart the dart to link. * @param adart the dart to link.
* @param adart2 the dart to link with. * @param adart2 the dart to link with.
* @param i the dimension. * @param i the dimension.
*/ */
template<unsigned int i> template<unsigned int i>
void dart_link_beta(Dart_descriptor adart, Dart_descriptor adart2) void dart_link_beta(Dart_descriptor adart, Dart_descriptor adart2)
{ {
@ -509,9 +513,9 @@ namespace CGAL {
} }
/** Unlink a dart for a given dimension. /** Unlink a dart for a given dimension.
* @param adart a dart. * @param adart a dart.
* @param i the dimension. * @param i the dimension.
*/ */
template<unsigned int i> template<unsigned int i>
void dart_unlink_beta(Dart_descriptor adart) void dart_unlink_beta(Dart_descriptor adart)
{ {

View File

@ -43,7 +43,7 @@ read_triangle_poly_file(CDT& t, std::istream &f,
{ {
unsigned int j; unsigned int j;
double x, y; double x, y;
f >> j >> iformat(x) >> iformat(y); f >> j >> IO::iformat(x) >> IO::iformat(y);
Point p(x, y); Point p(x, y);
skip_until_EOL(f); skip_comment_OFF(f); skip_until_EOL(f); skip_comment_OFF(f);
vertices[--j] = t.insert(p); vertices[--j] = t.insert(p);

View File

@ -1,60 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgMesh3Domains
The class `Polyhedral_mesh_domain_3` implements
a domain defined by a simplicial polyhedral surface.
The input polyhedral surface must be free of intersection.
It must include (at least) one closed connected component
that defines the boundary of the domain to be meshed.
Inside this bounding component,
the input polyhedral surface may contain
several other components (closed or not)
that will be represented in the final mesh.
This class is a model of the concept `MeshDomain_3`.
\tparam Polyhedron stands for the type of the input polyhedral surface(s),
model of `FaceListGraph`.
\tparam IGT stands for a geometric traits class
providing the types and functors required to implement
the intersection tests and intersection computations
for polyhedral boundary surfaces. This parameter has to be instantiated
with a model of the concept `IntersectionGeometricTraits_3`.
\cgalModels{MeshDomain_3}
\sa `IntersectionGeometricTraits_3`
\sa `CGAL::make_mesh_3()`.
*/
template< typename Polyhedron, typename IGT, typename TriangleAccessor >
class Polyhedral_mesh_domain_3
{
public:
/// \name Creation
/// @{
/*!
Construction from a bounding polyhedral surface which must be closed, and free of intersections.
The inside of `bounding_polyhedron` will be meshed.
*/
Polyhedral_mesh_domain_3(const Polyhedron& bounding_polyhedron);
/*!
Construction from a polyhedral surface, and a bounding polyhedral surface,.
The first polyhedron must be entirely included inside `bounding_polyhedron`, which must be closed
and free of intersections.
Using this constructor allows to mesh a polyhedral surface which is not closed, or has holes.
The inside of `bounding_polyhedron` will be meshed.
*/
Polyhedral_mesh_domain_3(const Polyhedron& polyhedron,
const Polyhedron& bounding_polyhedron);
/// @}
}; /* end Polyhedral_mesh_domain_3 */
} /* end namespace CGAL */

View File

@ -1,105 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgMesh3Domains
The class `Polyhedral_mesh_domain_with_features_3` implements a domain whose
boundary is a simplicial polyhedral surface.
This surface must be free of intersection.
It can either be closed,
included inside another polyhedral surface which is closed and free of intersection,
or open. In the latter case, the meshing process will only take care of the quality
of the 1D (features and boundaries) and 2D (surfaces) components of the mesh.
It is a model of the concept `MeshDomainWithFeatures_3`. It also
provides a member function to automatically detect sharp features and boundaries from
the input polyhedral surface(s).
\tparam IGT stands for a geometric traits class providing the types
and functors required to implement the intersection tests and intersection computations
for polyhedral boundary surfaces. This parameter has to be
instantiated with a model of the concept `IntersectionGeometricTraits_3`.
\cgalModels{MeshDomainWithFeatures_3}
\sa `CGAL::Mesh_domain_with_polyline_features_3<MD>`
\sa `CGAL::Polyhedral_mesh_domain_3<Polyhedron,IGT,TriangleAccessor>`
\sa `CGAL::Mesh_polyhedron_3<IGT>`
*/
template< typename IGT >
class Polyhedral_mesh_domain_with_features_3
: public CGAL::Mesh_domain_with_polyline_features_3<
CGAL::Polyhedral_mesh_domain_3< CGAL::Mesh_polyhedron_3<IGT>::type, IGT> >
{
public:
/// \name Types
/// @{
/*!
Numerical type.
*/
typedef unspecified_type FT;
/// @}
/// \name Creation
/// @{
/*!
Constructs a `Polyhedral_mesh_domain_with_features_3` from a polyhedral surface of type `Polyhedron`.
The only requirement on type `Polyhedron` is that `CGAL::Mesh_polyhedron_3<IGT>::%type` should
be constructible from `Polyhedron`.
No feature detection is done at this level. Note that a copy of `bounding_polyhedron` will be done.
The polyhedron `bounding_polyhedron` has to be closed and free of intersections.
Its interior of `bounding_polyhedron` will be meshed.
*/
template <typename Polyhedron>
Polyhedral_mesh_domain_with_features_3(const Polyhedron& bounding_polyhedron);
/*!
Constructs a `Polyhedral_mesh_domain_with_features_3` from a polyhedral surface, and a bounding polyhedral surface.
`CGAL::Mesh_polyhedron_3<IGT>::%type` should be constructible from `Polyhedron`.
The first polyhedron should be entirely included inside `bounding_polyhedron`, which has to be closed
and free of intersections.
Using this constructor allows to mesh a polyhedral surface which is not closed, or has holes.
The inside of `bounding_polyhedron` will be meshed.
*/
template <typename Polyhedron>
Polyhedral_mesh_domain_with_features_3(const Polyhedron& polyhedron,
const Polyhedron& bounding_polyhedron);
/*!
\deprecated Constructs a `Polyhedral_mesh_domain_with_features_3` from an off file. No feature
detection is done at this level. Users must read the file into a `Polyhedron_3` and call the
constructor above.
*/
Polyhedral_mesh_domain_with_features_3(const std::string& filename);
/// @}
/// \name Operations
/// @{
/*!
Detects sharp features and boundaries of the internal bounding polyhedron (and the potential internal polyhedron)
and inserts them as features of the domain. `angle_bound` gives the maximum
angle (in degrees) between the two normal vectors of adjacent triangles.
For an edge of the polyhedron, if the angle between the two normal vectors of its
incident facets is bigger than the given bound, then the edge is considered as
a feature edge.
*/
void detect_features(FT angle_bound=60);
/*!
Detects border edges of the bounding polyhedron and inserts them as features of the domain.
This function should be called alone only, and not before or after `detect_features()`.
*/
void detect_borders();
/// @}
}; /* end Polyhedral_mesh_domain_with_features_3 */
} /* end namespace CGAL */

View File

@ -198,6 +198,7 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support)
target target
mesh_3D_image mesh_3D_image
mesh_3D_weighted_image mesh_3D_weighted_image
mesh_3D_weighted_image_with_detection_of_features
mesh_3D_image_variable_size mesh_3D_image_variable_size
mesh_3D_image_with_custom_initialization mesh_3D_image_with_custom_initialization
mesh_3D_gray_image_with_custom_initialization mesh_3D_gray_image_with_custom_initialization

View File

@ -1148,9 +1148,9 @@ number_of_bad_elements_impl()
const Subdomain mc_subdomain = this->r_oracle_.is_in_domain_object()(this->r_tr_.dual(mc)); const Subdomain mc_subdomain = this->r_oracle_.is_in_domain_object()(this->r_tr_.dual(mc));
std::cerr << "*** Is in complex? c is marked in domain: " << this->r_c3t3_.is_in_complex(c) std::cerr << "*** Is in complex? c is marked in domain: " << this->r_c3t3_.is_in_complex(c)
<< " / c is really in subdomain: " << oformat(c_subdomain) << " / c is really in subdomain: " << IO::oformat(c_subdomain)
<< " / mc is marked in domain: " << this->r_c3t3_.is_in_complex(mc) << " / mc is marked in domain: " << this->r_c3t3_.is_in_complex(mc)
<< " / mc is really in subdomain: " << oformat(mc_subdomain) << " / mc is really in subdomain: " << IO::oformat(mc_subdomain)
<< std::endl; << std::endl;

View File

@ -24,6 +24,7 @@
// To avoid verbose function and named parameters call // To avoid verbose function and named parameters call
using namespace CGAL::parameters; using namespace CGAL::parameters;
template <typename Concurrency_tag> template <typename Concurrency_tag>
void test() void test()
{ {
@ -31,7 +32,7 @@ void test()
std::size_t nb_runs = 2; std::size_t nb_runs = 2;
unsigned int nb_lloyd = 2; unsigned int nb_lloyd = 2;
unsigned int nb_odt = 2; unsigned int nb_odt = 2;
double perturb_bound = 10.; double perturb_bound = 7.;
double exude_bound = 15.; double exude_bound = 15.;
// Domain // Domain

View File

@ -31,7 +31,7 @@ public:
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup PkgMinkowskiSum2Classes \ingroup PkgMinkowskiSum2Ref
The `Hertel_Mehlhorn_convex_decomposition_2` class implements the approximation algorithm of Hertel The `Hertel_Mehlhorn_convex_decomposition_2` class implements the approximation algorithm of Hertel
and Mehlhorn for decomposing a polygon into convex and Mehlhorn for decomposing a polygon into convex

View File

@ -18,9 +18,6 @@
/// \defgroup nt_cgal CGAL Number Types /// \defgroup nt_cgal CGAL Number Types
/// \ingroup PkgNumberTypesRef /// \ingroup PkgNumberTypesRef
/// \defgroup nt_cgal CGAL Number Types
/// \ingroup PkgNumberTypesRef
/// \defgroup nt_rrational Relates Rational /// \defgroup nt_rrational Relates Rational
/// \ingroup PkgNumberTypesRef /// \ingroup PkgNumberTypesRef

View File

@ -5,7 +5,7 @@ namespace CGAL {
\anchor Chapter_Orthtree \anchor Chapter_Orthtree
\cgalAutoToc \cgalAutoToc
\authors Jackson Campolattaro, Simon Giraudot, Cédric Portaneri, Tong Zhao, Pierre Alliez \authors Jackson Campolattaro, Simon Giraudot, Cedric Portaneri, Tong Zhao, Pierre Alliez
\section Section_Orthtree_Introduction Introduction \section Section_Orthtree_Introduction Introduction
@ -57,7 +57,7 @@ a node needs to be split. Custom predicates can easily be defined if
the existing ones do not match users' needs. the existing ones do not match users' needs.
The following example shows the construction of an Octree from a vector of points. The following example shows the construction of an Octree from a vector of points.
`octree.refine(10, 1)` uses the default split predicate, which `octree.refine(10, 1)` uses the default split predicate, which
enforces a max-depth and a maximum number of inliers per node ("bucket size"). enforces a max-depth and a maximum number of inliers per node ("bucket size").
Nodes are split if their depth is less than 10, and they contain more than one inlier. Nodes are split if their depth is less than 10, and they contain more than one inlier.
@ -65,8 +65,8 @@ Nodes are split if their depth is less than 10, and they contain more than one i
\subsection Section_Orthtree_Quadtree Building a Quadtree \subsection Section_Orthtree_Quadtree Building a Quadtree
The `Orthtree` class may be templated with `Orthtree_traits_point<>` The `Orthtree` class may be templated with `Orthtree_traits_point<>`
with a 2d dimension tag and thus behave as a %quadtree. with a 2d dimension tag and thus behave as a %quadtree.
For convenience, the alias `Quadtree` is provided. For convenience, the alias `Quadtree` is provided.
The following example shows the construction of %quadtree from a vector of `Point_2` objects. The following example shows the construction of %quadtree from a vector of `Point_2` objects.
@ -116,12 +116,12 @@ at depth 7 can hold 14.
\subsection Section_Orthtree_Orthtree_Point_Vector Building an Orthtree \subsection Section_Orthtree_Orthtree_Point_Vector Building an Orthtree
An orthtree can also be used with an arbitrary number of dimensions. An orthtree can also be used with an arbitrary number of dimensions.
The `Orthtree_traits_point` template can infer the arbitrary dimension count from the d-dimensional kernel. The `Orthtree_traits_point` template can infer the arbitrary dimension count from the d-dimensional kernel.
The following example shows how to build a generalized orthtree in dimension 4. The following example shows how to build a generalized orthtree in dimension 4.
As `std::vector<Point_d>` is manually filled with 4-dimensional points. As `std::vector<Point_d>` is manually filled with 4-dimensional points.
The vector is used as the point set, and an `Identity_property_map` is automatically The vector is used as the point set, and an `Identity_property_map` is automatically
set as the orthtree's map type, so a map does not need to be provided. set as the orthtree's map type, so a map does not need to be provided.
\cgalExample{Orthtree/orthtree_build.cpp} \cgalExample{Orthtree/orthtree_build.cpp}
@ -141,14 +141,14 @@ number of different solutions for traversing the tree.
Because our orthtree is a form of connected acyclic undirected graph, it is possible to navigate between any two nodes. Because our orthtree is a form of connected acyclic undirected graph, it is possible to navigate between any two nodes.
What that means in practice is that given a node on the tree, it is possible to What that means in practice is that given a node on the tree, it is possible to
access any other node using the right set of operations. access any other node using the right set of operations.
The `Node_index` type provides a handle on a node, and the `orthree` class provides methods The `Node_index` type provides a handle on a node, and the `orthree` class provides methods
that enable the user to retrieve the indices of each of its children as well as its parent (if they exist). that enable the user to retrieve the indices of each of its children as well as its parent (if they exist).
Given any node index `node`, the `n`th child of that node can be found with `orthtree.child(node, n)`. Given any node index `node`, the `n`th child of that node can be found with `orthtree.child(node, n)`.
For an octree, values of `n` from 0-7 provide access to the different children. For an octree, values of `n` from 0-7 provide access to the different children.
For non-root nodes, it is possible to access parent nodes using the `orthtree.parent()` accessor. For non-root nodes, it is possible to access parent nodes using the `orthtree.parent()` accessor.
To access grandchildren, it isn't necessary to use nested `orthtree.child()` calls. To access grandchildren, it isn't necessary to use nested `orthtree.child()` calls.
Instead, the `orthtree.descendant(node, a, b, ...)` convenience method is provided. Instead, the `orthtree.descendant(node, a, b, ...)` convenience method is provided.
This retrieves the `b`th child of the `a`th child, to any depth. This retrieves the `b`th child of the `a`th child, to any depth.
@ -165,7 +165,7 @@ The following example demonstrates the use of several of these accessors.
It is often useful to be able to iterate over the nodes of the tree in a particular order. It is often useful to be able to iterate over the nodes of the tree in a particular order.
For example, the stream operator `<<` uses a traversal to print out each node. For example, the stream operator `<<` uses a traversal to print out each node.
A few traversals are provided, among them [Preorder_traversal](@ref CGAL::Orthtrees::Preorder_traversal) A few traversals are provided, among them [Preorder_traversal](@ref CGAL::Orthtrees::Preorder_traversal)
and [Postorder_traversal](@ref CGAL::Orthtrees::Postorder_traversal). and [Postorder_traversal](@ref CGAL::Orthtrees::Postorder_traversal).
To traverse a tree in preorder is to visit each parent immediately followed by its children, To traverse a tree in preorder is to visit each parent immediately followed by its children,
whereas in postorder, traversal the children are visited first. whereas in postorder, traversal the children are visited first.
@ -180,7 +180,7 @@ In this case, we print out the nodes of the tree without indentation instead.
\subsection Section_Orthtree_Custom_Traversal Custom Traversal \subsection Section_Orthtree_Custom_Traversal Custom Traversal
Users can define their own traversal methods by creating models of the `OrthtreeTraversal` concept. Users can define their own traversal methods by creating models of the `OrthtreeTraversal` concept.
The custom traversal must provide a method which returns the starting point of the traversal (`first_index()`) The custom traversal must provide a method which returns the starting point of the traversal (`first_index()`)
and another method which returns the next node in the sequence (`next_index()`). and another method which returns the next node in the sequence (`next_index()`).
`next_index()` returns an empty optional when the end of the traversal is reached. `next_index()` returns an empty optional when the end of the traversal is reached.
@ -223,7 +223,7 @@ Results are put in a vector, and then printed.
Not all octrees are compatible with nearest neighbor functionality, Not all octrees are compatible with nearest neighbor functionality,
as the idea of a nearest neighbor may not make sense for some tree contents. as the idea of a nearest neighbor may not make sense for some tree contents.
For the nearest neighbor functions to work, the traits class must implement the For the nearest neighbor functions to work, the traits class must implement the
`CollectionPartitioningOrthtreeTraits` concept. `CollectionPartitioningOrthtreeTraits` concept.
\subsection Section_Orthtree_Grade Grading \subsection Section_Orthtree_Grade Grading
@ -285,7 +285,7 @@ For nontrivial point counts, the naive approach's calculation time dwarfs that o
\section Section_Orthtree_History History \section Section_Orthtree_History History
A prototype code was implemented by Pierre Alliez and improved by Tong A prototype code was implemented by Pierre Alliez and improved by Tong
Zhao and Cédric Portaneri. From this prototype code, the package was Zhao and Cedric Portaneri. From this prototype code, the package was
developed by Jackson Campolatarro as part of the Google Summer of Code developed by Jackson Campolatarro as part of the Google Summer of Code
2020. Simon Giraudot, supervisor of the GSoC internship, completed and 2020. Simon Giraudot, supervisor of the GSoC internship, completed and
finalized the package for integration in CGAL 5.3. Pierre Alliez finalized the package for integration in CGAL 5.3. Pierre Alliez

View File

@ -110,7 +110,7 @@ public:
using Maybe_node_index = std::optional<Node_index>; using Maybe_node_index = std::optional<Node_index>;
// todo: maybe this could be private? // todo: maybe this could be private?
using Node_property_container = Properties::Property_container<Node_index>; using Node_property_container = Properties::Experimental::Property_container<Node_index>;
/*! /*!
\brief Set of bits representing this node's relationship to its parent. \brief Set of bits representing this node's relationship to its parent.
@ -205,10 +205,10 @@ public:
// Determine dimensions of the root bbox // Determine dimensions of the root bbox
Bbox_dimensions size; Bbox_dimensions size;
for (int i = 0; i < Dimension::value; ++i) for (int i = 0; i < Dimension::value; ++i)
size[i] = bbox.max()[i] - bbox.min()[i]; size[i] = (bbox.max)()[i] - (bbox.min)()[i];
// save orthtree attributes // save orthtree attributes
m_bbox_min = bbox.min(); m_bbox_min = (bbox.min)();
m_side_per_depth.push_back(size); m_side_per_depth.push_back(size);
data(root()) = m_traits.construct_root_node_contents_object()(); data(root()) = m_traits.construct_root_node_contents_object()();
} }

View File

@ -8,15 +8,4 @@
<enableAddressBar>false</enableAddressBar> <enableAddressBar>false</enableAddressBar>
<enableFilterFunctionality>false</enableFilterFunctionality> <enableFilterFunctionality>false</enableFilterFunctionality>
</assistant> </assistant>
<docFiles>
<generate>
<file>
<input>Periodic_3_triangulation_3.qhp</input>
<output>Periodic_3_triangulation_3.qch</output>
</file>
</generate>
<register>
<file>Periodic_3_triangulation_3.qch</file>
</register>
</docFiles>
</QHelpCollectionProject> </QHelpCollectionProject>

View File

@ -8,15 +8,4 @@
<enableAddressBar>false</enableAddressBar> <enableAddressBar>false</enableAddressBar>
<enableFilterFunctionality>false</enableFilterFunctionality> <enableFilterFunctionality>false</enableFilterFunctionality>
</assistant> </assistant>
<docFiles>
<generate>
<file>
<input>Periodic_Lloyd_3.qhp</input>
<output>Periodic_Lloyd_3.qch</output>
</file>
</generate>
<register>
<file>Periodic_Lloyd_3.qch</file>
</register>
</docFiles>
</QHelpCollectionProject> </QHelpCollectionProject>

View File

@ -17,7 +17,7 @@
#include <typeindex> #include <typeindex>
#include <CGAL/Property_container.h> #include <CGAL/Surface_mesh/Properties.h>
#include <CGAL/Point_set_3/IO.h> #include <CGAL/Point_set_3/IO.h>
@ -53,7 +53,11 @@ namespace internal {
typedef CGAL::Point_set_3<Point, Vector> Point_set_3; typedef CGAL::Point_set_3<Point, Vector> Point_set_3;
private: private:
friend class CGAL::Point_set_3<Point, Vector>;
friend class Properties::Property_container<Point_set_3, Point_set_3_index>;
template <class> friend class Properties::Property_array;
template <class> friend struct Property_map;
friend class std::vector<Point_set_3_index>;
size_type value; size_type value;
public: public:
@ -126,14 +130,18 @@ public:
using Index = internal::Point_set_3_index<Point, Vector>; using Index = internal::Point_set_3_index<Point, Vector>;
typedef typename Properties::Property_container<Index> Base; typedef typename Properties::Property_container<Point_set, Index> Base;
template <class Type> template <class Type>
using Property_map = Properties::Property_array_handle<Index, Type>; struct Property_map
: public Properties::Property_map_base<Index, Type, Property_map<Type> >
{
typedef Properties::Property_map_base<Index, Type, Property_map<Type> > Base;
Property_map() : Base() {}
Property_map(const Base& pm): Base(pm) {}
};
typedef Property_map<Index> Index_map; typedef Property_map<Index> Index_map;
// todo: apparently unused?
template <typename Key, typename T> template <typename Key, typename T>
struct Get_property_map { struct Get_property_map {
typedef Property_map<T> type; typedef Property_map<T> type;
@ -163,7 +171,6 @@ public:
typedef Property_map<Vector> Vector_map; ///< Property map of vectors typedef Property_map<Vector> Vector_map; ///< Property map of vectors
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
// todo: CGAL should probably have a general "span" type
template <class Type> template <class Type>
class Property_range class Property_range
{ {
@ -177,17 +184,18 @@ public:
private: private:
const_iterator m_begin; const_iterator m_begin;
const_iterator m_end; const_iterator m_end;
// todo: couldn't this be replaced by std::distance(begin, end)?
std::size_t m_size; std::size_t m_size;
public: public:
Property_range (const Property_map<Type>& pmap, Property_range (const Property_map<Type>& pmap,
typename Point_set::const_iterator begin, typename Point_set::const_iterator begin,
typename Point_set::const_iterator end, typename Point_set::const_iterator end,
std::size_t size) : std::size_t size)
m_begin(boost::make_transform_iterator (begin, Unary_function(pmap))), {
m_end(boost::make_transform_iterator (end, Unary_function(pmap))), m_begin = boost::make_transform_iterator (begin, Unary_function(pmap));
m_size(size) {} m_end = boost::make_transform_iterator (end, Unary_function(pmap));
m_size = size;
}
const_iterator begin() const { return m_begin; } const_iterator begin() const { return m_begin; }
const_iterator end() const { return m_end; } const_iterator end() const { return m_end; }
@ -202,17 +210,11 @@ public:
protected: protected:
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
// todo: this shouldn't be necessary Base m_base;
mutable Base m_base;
Index_map m_indices; Index_map m_indices;
Point_map m_points; Point_map m_points;
std::optional<Vector_map> m_normals{}; Vector_map m_normals;
std::size_t m_nb_removed;
// todo: this is redundant!
// Property_container has its own garbage management, but it's not contiguous
// It should eventually be replaced with something like a Contiguous_property_container
// which places deleted elements at the end
std::size_t m_nb_removed = 0;
/// \endcond /// \endcond
public: public:
@ -228,11 +230,9 @@ public:
added. If `false` (default value), the normal map can still be added. If `false` (default value), the normal map can still be
added later on (see `add_normal_map()`). added later on (see `add_normal_map()`).
*/ */
Point_set_3(bool with_normal_map = false) : Point_set_3 (bool with_normal_map = false) : m_base()
m_base(), {
m_indices(m_base.template add_property<Index>("index", typename Index::size_type(-1))), clear();
m_points(m_base.template add_property<Point>("point", CGAL::ORIGIN)) {
if (with_normal_map) if (with_normal_map)
add_normal_map(); add_normal_map();
} }
@ -240,23 +240,25 @@ public:
/*! /*!
\brief Assignment operator, all properties with their content are copied. \brief Assignment operator, all properties with their content are copied.
*/ */
Point_set_3& operator=(const Point_set_3 &ps){ Point_set_3& operator= (const Point_set_3& ps)
{
m_base = ps.m_base; m_base = ps.m_base;
m_indices = this->property_map<Index> ("index").first;
m_points = this->property_map<Point> ("point").first;
m_normals = this->property_map<Vector> ("normal").first;
m_nb_removed = ps.m_nb_removed; m_nb_removed = ps.m_nb_removed;
if (has_normal_map())
add_normal_map();
return *this; return *this;
} }
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
// copy constructor (same as assignment) // copy constructor (same as assignment)
Point_set_3(const Point_set_3& ps) : Point_set_3 (const Point_set_3& ps)
m_base(ps.m_base), {
m_indices(m_base.template get_property<Index>("index")), m_base = ps.m_base;
m_points(m_base.template get_property<Point>("point")), m_indices = this->property_map<Index> ("index").first;
m_nb_removed(ps.m_nb_removed) { m_points = this->property_map<Point> ("point").first;
if (has_normal_map()) m_normals = this->property_map<Vector> ("normal").first;
add_normal_map(); m_nb_removed = ps.m_nb_removed;
} }
/// \endcond /// \endcond
@ -264,7 +266,6 @@ public:
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
const Base& base() const { return m_base; } const Base& base() const { return m_base; }
Base& base() { return m_base; }
/// \endcond /// \endcond
@ -294,9 +295,8 @@ public:
\note The method `size()` is also available (see `Range`) and \note The method `size()` is also available (see `Range`) and
does the same thing. does the same thing.
*/ */
std::size_t number_of_points () const { return m_base.capacity() - m_nb_removed; } std::size_t number_of_points () const { return m_base.size() - m_nb_removed; }
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
// todo: why is this undocumented, but mentioned in the number_of_points documentation?
std::size_t size () const { return number_of_points(); } std::size_t size () const { return number_of_points(); }
/// \endcond /// \endcond
@ -310,8 +310,6 @@ public:
the point set and `other`. Property maps which are only in the point set and `other`. Property maps which are only in
`other` are ignored. `other` are ignored.
todo: this seems backwards to me, isn't it clearer to have an append() function?
\note If `copy_properties()` with `other` as argument is called \note If `copy_properties()` with `other` as argument is called
before calling this method, then all the content of `other` will before calling this method, then all the content of `other` will
be copied and no property will be lost in the process. be copied and no property will be lost in the process.
@ -322,7 +320,8 @@ public:
{ {
collect_garbage(); collect_garbage();
other.collect_garbage(); other.collect_garbage();
m_base.append(other.m_base); resize (number_of_points() + other.number_of_points());
m_base.transfer (other.m_base);
// Reset indices // Reset indices
for (std::size_t i = 0; i < this->m_base.size(); ++ i) for (std::size_t i = 0; i < this->m_base.size(); ++ i)
@ -340,8 +339,9 @@ public:
*/ */
void clear() void clear()
{ {
m_base.resize(0); m_base.clear();
m_base.remove_all_properties_except({"index", "point"}); m_indices = this->add_property_map<Index>("index", typename Index::size_type(-1)).first;
m_points = this->add_property_map<Point>("point", CGAL::ORIGIN).first;
m_nb_removed = 0; m_nb_removed = 0;
} }
@ -353,8 +353,14 @@ public:
*/ */
void clear_properties() void clear_properties()
{ {
// todo: The old version was pretty convoluted, but I'm pretty sure this is the intended behavior Base other;
m_base.remove_all_properties_except({"index", "point"}); other.template add<Index>("index", typename Index::size_type(-1));
other.template add<Point>("point", CGAL::ORIGIN);
other.resize(m_base.size());
other.transfer(m_base);
m_base.swap(other);
m_indices = this->property_map<Index>("index").first;
m_points = this->property_map<Point>("point").first;
} }
/*! /*!
@ -366,13 +372,7 @@ public:
\note This method does not change the content of the point set and \note This method does not change the content of the point set and
is only used for optimization. is only used for optimization.
*/ */
void reserve (std::size_t s) { void reserve (std::size_t s) { m_base.reserve (s); }
std::size_t initial_size = m_base.size();
m_base.resize(s);
m_nb_removed = m_base.size() - initial_size;
for (std::size_t i = initial_size; i < m_base.size(); ++ i)
m_indices[i] = i;
}
/*! /*!
\brief changes size of the point set. \brief changes size of the point set.
@ -429,8 +429,7 @@ public:
{ {
if (m_nb_removed == 0) if (m_nb_removed == 0)
{ {
auto new_index = m_base.emplace_back(); m_base.push_back();
CGAL_assertion(std::size_t(new_index) == size() - 1);
m_indices[size()-1] = size()-1; m_indices[size()-1] = size()-1;
return m_indices.end() - 1; return m_indices.end() - 1;
} }
@ -464,7 +463,7 @@ public:
iterator insert (const Point& p) iterator insert (const Point& p)
{ {
iterator out = insert(); iterator out = insert();
m_points[*out] = p; m_points[size()-1] = p;
return out; return out;
} }
@ -504,8 +503,6 @@ public:
method allows the user to easily copy one point (along with the method allows the user to easily copy one point (along with the
values of all its properties) from one point set to another. values of all its properties) from one point set to another.
todo: this must have been terribly slow, and the new implementation isn't any better.
\param other Point set to which the point to copy belongs \param other Point set to which the point to copy belongs
\param idx Index of the point to copy in `other` \param idx Index of the point to copy in `other`
@ -586,7 +583,7 @@ public:
\note The elements are just marked as removed and are not erased \note The elements are just marked as removed and are not erased
from the memory. `collect_garbage()` should be called if the from the memory. `collect_garbage()` should be called if the
memory needs to be deallocated. Elements can be recovered with memory needs to be disallocated. Elements can be recovered with
`cancel_removals()`. `cancel_removals()`.
\note All iterators, pointers and references related to the \note All iterators, pointers and references related to the
@ -607,7 +604,6 @@ public:
while (source != last // All elements have been moved while (source != last // All elements have been moved
&& dest != last - 1) // All elements are at the end of the container && dest != last - 1) // All elements are at the end of the container
{ {
// todo: Why is this writing to cerr?
std::cerr << "Swapping " << *source << " and " << *dest << std::endl; std::cerr << "Swapping " << *source << " and " << *dest << std::endl;
std::swap (*(source ++), *(dest --)); std::swap (*(source ++), *(dest --));
} }
@ -634,7 +630,6 @@ public:
*/ */
void remove (iterator it) void remove (iterator it)
{ {
// todo: Maybe some form of erase-by-iterator should exist?
std::iter_swap (it, (end() - 1)); std::iter_swap (it, (end() - 1));
++ m_nb_removed; ++ m_nb_removed;
} }
@ -733,7 +728,7 @@ public:
// Sorting based on the indices reorders the point set correctly // Sorting based on the indices reorders the point set correctly
quick_sort_on_indices ((std::ptrdiff_t)0, (std::ptrdiff_t)(m_base.size() - 1)); quick_sort_on_indices ((std::ptrdiff_t)0, (std::ptrdiff_t)(m_base.size() - 1));
m_base.resize(size ()); m_base.resize (size ());
m_base.shrink_to_fit (); m_base.shrink_to_fit ();
m_nb_removed = 0; m_nb_removed = 0;
} }
@ -787,8 +782,11 @@ public:
\param name Name of the property. \param name Name of the property.
*/ */
template <typename T> template <typename T>
bool has_property_map (const std::string& name) const { bool has_property_map (const std::string& name) const
return m_base.template property_exists<T>(name); {
std::pair<Property_map<T>, bool>
pm = m_base.template get<T> (name);
return pm.second;
} }
/*! /*!
@ -808,8 +806,10 @@ public:
std::pair<Property_map<T>, bool> std::pair<Property_map<T>, bool>
add_property_map (const std::string& name, const T t=T()) add_property_map (const std::string& name, const T t=T())
{ {
auto [array, created] = m_base.template get_or_add_property<T>(name, t); Property_map<T> pm;
return {{array.get()}, created}; bool added = false;
std::tie (pm, added) = m_base.template add<T> (name, t);
return std::make_pair (pm, added);
} }
/*! /*!
@ -819,26 +819,18 @@ public:
\param name Name of the property. \param name Name of the property.
\return Returns an optional containing: the specified property map \return Returns a pair containing: the specified property map and a
or an empty property map (if the property was not found). Boolean set to `true` or an empty property map and a Boolean set
to `false` (if the property was not found).
*/ */
template <class T> template <class T>
std::optional<Property_map<T>> std::pair<Property_map<T>,bool>
property_map (const std::string& name)
{
auto maybe_property_map = m_base.template get_property_if_exists<T>(name);
if (!maybe_property_map) return {};
else return {{maybe_property_map.value()}};
}
// todo: The const version should return a Const_property_map type
template <class T>
std::optional<Property_map<T>>
property_map (const std::string& name) const property_map (const std::string& name) const
{ {
auto maybe_property_map = m_base.template get_property_if_exists<T>(name); Property_map<T> pm;
if (!maybe_property_map) return {}; bool okay = false;
else return {{maybe_property_map.value()}}; std::tie (pm, okay) = m_base.template get<T>(name);
return std::make_pair (pm, okay);
} }
/*! /*!
@ -854,7 +846,7 @@ public:
template <class T> template <class T>
bool remove_property_map (Property_map<T>& prop) bool remove_property_map (Property_map<T>& prop)
{ {
return m_base.remove_property(prop.array()); return m_base.template remove<T> (prop);
} }
/*! /*!
@ -865,7 +857,8 @@ public:
*/ */
bool has_normal_map() const bool has_normal_map() const
{ {
return m_base.template property_exists<Vector>("normal"); std::pair<Vector_map, bool> pm = this->property_map<Vector> ("normal");
return pm.second;
} }
/*! /*!
\brief Convenience method that adds a normal property. \brief Convenience method that adds a normal property.
@ -879,9 +872,9 @@ public:
*/ */
std::pair<Vector_map, bool> add_normal_map (const Vector& default_value = CGAL::NULL_VECTOR) std::pair<Vector_map, bool> add_normal_map (const Vector& default_value = CGAL::NULL_VECTOR)
{ {
auto pair = this->add_property_map<Vector> ("normal", default_value); bool out = false;
m_normals = {pair.first}; std::tie (m_normals, out) = this->add_property_map<Vector> ("normal", default_value);
return pair; return std::make_pair (m_normals, out);
} }
/*! /*!
\brief returns the property map of the normal property. \brief returns the property map of the normal property.
@ -894,7 +887,7 @@ public:
{ {
if (!m_normals) if (!m_normals)
add_normal_map(); add_normal_map();
return m_normals.value(); return m_normals;
} }
/*! /*!
\brief returns the property map of the normal property (constant version). \brief returns the property map of the normal property (constant version).
@ -902,10 +895,9 @@ public:
\note The normal property must have been added to the point set \note The normal property must have been added to the point set
before calling this method (see `add_normal_map()`). before calling this method (see `add_normal_map()`).
*/ */
const Vector_map normal_map () const // todo: This is not how const works const Vector_map normal_map () const
{ {
CGAL_precondition(m_normals.has_value()); return m_normals;
return m_normals.value();
} }
/*! /*!
\brief Convenience method that removes the normal property. \brief Convenience method that removes the normal property.
@ -915,7 +907,7 @@ public:
*/ */
bool remove_normal_map() bool remove_normal_map()
{ {
return m_base.remove_property("normal"); return m_base.template remove<Vector> (m_normals);
} }
/*! /*!
\brief returns the property map of the point property. \brief returns the property map of the point property.
@ -944,7 +936,7 @@ public:
{ {
m_base.copy_properties (other.base()); m_base.copy_properties (other.base());
m_normals = this->property_map<Vector> ("normal"); // In case normal was added m_normals = this->property_map<Vector> ("normal").first; // In case normal was added
} }
@ -970,7 +962,7 @@ public:
std::vector<std::pair<std::string, std::type_index> > out; out.reserve (prop.size()); std::vector<std::pair<std::string, std::type_index> > out; out.reserve (prop.size());
for (std::size_t i = 0; i < prop.size(); ++ i) for (std::size_t i = 0; i < prop.size(); ++ i)
out.push_back (std::make_pair (prop[i], std::type_index(m_base.property_type(prop[i])))); out.push_back (std::make_pair (prop[i], std::type_index(m_base.get_type(prop[i]))));
return out; return out;
} }
@ -1018,7 +1010,7 @@ public:
std::vector<std::string> prop = m_base.properties(); std::vector<std::string> prop = m_base.properties();
for (std::size_t i = 0; i < prop.size(); ++ i) for (std::size_t i = 0; i < prop.size(); ++ i)
oss << " * \"" << prop[i] << "\" property of type " oss << " * \"" << prop[i] << "\" property of type "
<< CGAL::demangle(m_base.property_type(prop[i]).name()) << std::endl; << CGAL::demangle(m_base.get_type(prop[i]).name()) << std::endl;
return oss.str(); return oss.str();
} }
@ -1093,82 +1085,71 @@ public:
#endif #endif
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
// todo: these should probably be reconsidered.
template <typename Property> template <typename Property>
class Property_back_inserter { class Property_back_inserter {
public: public:
typedef std::output_iterator_tag iterator_category; typedef std::output_iterator_tag iterator_category;
typedef Property value_type; typedef typename Property::value_type value_type;
typedef std::ptrdiff_t difference_type; typedef std::ptrdiff_t difference_type;
typedef void pointer; typedef void pointer;
typedef void reference; typedef void reference;
private: private:
Point_set& ps; Point_set* ps;
Property_map<Property> map; Property* prop;
Index index; Index ind;
public: public:
Property_back_inserter( Property_back_inserter(Point_set* ps, Property* prop, Index ind=Index())
Point_set& ps, : ps(ps), prop (prop), ind(ind) {}
Properties::Property_array<Point_set::Index, Property>& prop,
Index ind = Index{0}
) : ps(ps), map(prop), index(ind) {}
Property_back_inserter& operator++() { return *this; } Property_back_inserter& operator++() { return *this; }
Property_back_inserter& operator++(int) { return *this; } Property_back_inserter& operator++(int) { return *this; }
Property_back_inserter& operator*() { return *this; } Property_back_inserter& operator*() { return *this; }
Property_back_inserter& operator= (const value_type& p) Property_back_inserter& operator= (const value_type& p)
{ {
if(ps->size() <= ind)
if(ps.size() <= index) ps->insert();
ps.insert(); put(*prop, ind, p);
put(map, index, p); ++ ind;
++index;
return *this; return *this;
// auto new_index = *ps.insert();
// put(map, new_index, p);
// return *this;
} }
}; };
// todo: this should be provided by the Property system
template <typename Property> template <typename Property>
class Push_property_map class Push_property_map
{ {
public: public:
typedef Index key_type; typedef Index key_type;
typedef Property value_type; typedef typename Property::value_type value_type;
typedef value_type& reference; typedef value_type& reference;
typedef boost::read_write_property_map_tag category; typedef boost::read_write_property_map_tag category;
Point_set& ps; Point_set* ps;
Property_map<Property> map; Property* prop;
mutable Index index; mutable Index ind;
Push_property_map( Push_property_map(Point_set* ps = nullptr,
Point_set& ps, Property* prop = nullptr,
Properties::Property_array<Point_set::Index, Property>& prop, Index ind=Index())
Index ind = Index{0} : ps(ps), prop(prop), ind(ind) {}
) : ps(ps), map(prop) {}
friend void put(const Push_property_map& pm, Index& i, const value_type& t) friend void put(const Push_property_map& pm, Index& i, const value_type& t)
{ {
++pm.index; if(pm.ps->size() <= (pm.ind))
if(pm.ps.size() <= pm.index) pm.ps->insert();
pm.ps.insert(); put(*(pm.prop), pm.ind, t);
put(pm.map, pm.index, t); i = pm.ind;
i = pm.index; ++pm.ind;
} }
friend reference get (const Push_property_map& pm, const Index& i) friend reference get (const Push_property_map& pm, const Index& i)
{ {
return ((*(pm.map))[i]); return ((*(pm.prop))[i]);
} }
}; };
@ -1178,22 +1159,22 @@ public:
/// \cgalAdvancedBegin /// \cgalAdvancedBegin
/// Back inserter on indices /// Back inserter on indices
/// \cgalAdvancedEnd /// \cgalAdvancedEnd
typedef Property_back_inserter<Index> Index_back_inserter; typedef Property_back_inserter<Index_map> Index_back_inserter;
/// \cgalAdvancedType /// \cgalAdvancedType
/// \cgalAdvancedBegin /// \cgalAdvancedBegin
/// Back inserter on points /// Back inserter on points
/// \cgalAdvancedEnd /// \cgalAdvancedEnd
typedef Property_back_inserter<Point> Point_back_inserter; typedef Property_back_inserter<Point_map> Point_back_inserter;
/// \cgalAdvancedType /// \cgalAdvancedType
/// \cgalAdvancedBegin /// \cgalAdvancedBegin
/// Property map for pushing new points /// Property map for pushing new points
/// \cgalAdvancedEnd /// \cgalAdvancedEnd
typedef Push_property_map<Point> Point_push_map; typedef Push_property_map<Point_map> Point_push_map;
/// \cgalAdvancedType /// \cgalAdvancedType
/// \cgalAdvancedBegin /// \cgalAdvancedBegin
/// Property map for pushing new vectors /// Property map for pushing new vectors
/// \cgalAdvancedEnd /// \cgalAdvancedEnd
typedef Push_property_map<Vector> Vector_push_map; typedef Push_property_map<Vector_map> Vector_push_map;
/*! /*!
\cgalAdvancedFunction \cgalAdvancedFunction
@ -1210,10 +1191,10 @@ public:
\cgalAdvancedEnd \cgalAdvancedEnd
*/ */
template <class T> template <class T>
Push_property_map<T> Push_property_map<Property_map<T> >
push_property_map (Property_map<T>& prop) push_property_map (Property_map<T>& prop)
{ {
return Push_property_map<T> (*this, prop.array()); return Push_property_map<Property_map<T> > (this, &prop, size());
} }
/*! /*!
\cgalAdvancedFunction \cgalAdvancedFunction
@ -1223,7 +1204,7 @@ public:
*/ */
Point_push_map point_push_map () Point_push_map point_push_map ()
{ {
return Point_push_map (*this, m_base.template get_property<Point>("point")); return Point_push_map (this, &m_points, size());
} }
/*! /*!
\cgalAdvancedFunction \cgalAdvancedFunction
@ -1236,8 +1217,7 @@ public:
*/ */
Vector_push_map normal_push_map () Vector_push_map normal_push_map ()
{ {
CGAL_precondition(m_normals.has_value()); return Vector_push_map (this, &m_normals, size());
return Vector_push_map (*this, m_base.template get_property<Vector>("normal"));
} }
/*! /*!
\cgalAdvancedFunction \cgalAdvancedFunction
@ -1247,7 +1227,7 @@ public:
*/ */
Index_back_inserter index_back_inserter () Index_back_inserter index_back_inserter ()
{ {
return Index_back_inserter (*this, m_base.template get_property<Index>("index")); return Index_back_inserter (this, &m_indices, size());
} }
/*! /*!
\cgalAdvancedFunction \cgalAdvancedFunction
@ -1257,7 +1237,7 @@ public:
*/ */
Point_back_inserter point_back_inserter () Point_back_inserter point_back_inserter ()
{ {
return Point_back_inserter (*this, m_base.template get_property<Point>("point")); return Point_back_inserter (this, &m_points, size());
} }
/// @} /// @}

View File

@ -49,15 +49,17 @@ private:
class PLY_property_to_point_set_property : public Abstract_ply_property_to_point_set_property class PLY_property_to_point_set_property : public Abstract_ply_property_to_point_set_property
{ {
typedef typename Point_set::template Property_map<Type> Map; typedef typename Point_set::template Property_map<Type> Map;
typedef typename Point_set::template Push_property_map<Type> Pmap; typedef typename Point_set::template Push_property_map<Map> Pmap;
Map m_map; Map m_map;
Pmap m_pmap; Pmap m_pmap;
std::string m_name; std::string m_name;
public: public:
PLY_property_to_point_set_property(Point_set& ps, const std::string& name) : PLY_property_to_point_set_property(Point_set& ps, const std::string& name)
m_name(name), : m_name(name)
m_map(ps.add_property_map(name, Type()).first), {
m_pmap(ps.push_property_map(m_map)) {} boost::tie(m_map, boost::tuples::ignore) = ps.add_property_map(name, Type());
m_pmap = ps.push_property_map(m_map);
}
virtual void assign(PLY_element& element, typename Point_set::Index index) virtual void assign(PLY_element& element, typename Point_set::Index index)
{ {
@ -538,92 +540,102 @@ bool write_PLY(std::ostream& os,
bool okay = false; bool okay = false;
{ {
auto pmap = point_set.template property_map<std::int8_t>(prop[i]); Int8_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<std::int8_t>(prop[i]);
if(okay)
{ {
os << "property char " << prop[i] << std::endl; os << "property char " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Int8_map>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Int8_map>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<std::uint8_t>(prop[i]); Uint8_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<std::uint8_t>(prop[i]);
if(okay)
{ {
os << "property uchar " << prop[i] << std::endl; os << "property uchar " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Uint8_map>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Uint8_map>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<std::int16_t>(prop[i]); Int16_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<std::int16_t>(prop[i]);
if(okay)
{ {
os << "property short " << prop[i] << std::endl; os << "property short " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Int16_map>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Int16_map>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<std::uint16_t>(prop[i]); Uint16_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<std::uint16_t>(prop[i]);
if(okay)
{ {
os << "property ushort " << prop[i] << std::endl; os << "property ushort " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Uint16_map>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Uint16_map>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<std::int32_t>(prop[i]); Int32_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<std::int32_t>(prop[i]);
if(okay)
{ {
os << "property int " << prop[i] << std::endl; os << "property int " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Int32_map>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Int32_map>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<std::uint32_t>(prop[i]); Uint32_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<std::uint32_t>(prop[i]);
if(okay)
{ {
os << "property uint " << prop[i] << std::endl; os << "property uint " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Uint32_map>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Uint32_map>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<std::int64_t>(prop[i]); Int64_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<std::int64_t>(prop[i]);
if(okay)
{ {
os << "property int " << prop[i] << std::endl; os << "property int " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Int64_map,std::int32_t>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Int64_map,std::int32_t>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<std::uint64_t>(prop[i]); Uint64_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<std::uint64_t>(prop[i]);
if(okay)
{ {
os << "property uint " << prop[i] << std::endl; os << "property uint " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Uint64_map,std::uint32_t>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Uint64_map,std::uint32_t>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<float>(prop[i]); Float_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<float>(prop[i]);
if(okay)
{ {
os << "property float " << prop[i] << std::endl; os << "property float " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Float_map>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Float_map>(pmap));
continue; continue;
} }
} }
{ {
auto pmap = point_set.template property_map<double>(prop[i]); Double_map pmap;
if(pmap) boost::tie(pmap, okay) = point_set.template property_map<double>(prop[i]);
if(okay)
{ {
os << "property double " << prop[i] << std::endl; os << "property double " << prop[i] << std::endl;
printers.push_back(new internal::Simple_property_printer<Index,Double_map>(pmap.value())); printers.push_back(new internal::Simple_property_printer<Index,Double_map>(pmap));
continue; continue;
} }
} }

View File

@ -57,7 +57,7 @@ bool read_XYZ(std::istream& is,
bool has_normals = false; bool has_normals = false;
for(typename CGAL::Point_set_3<Point, Vector>::const_iterator it=point_set.begin(); it!=point_set.end(); ++it) for(typename CGAL::Point_set_3<Point, Vector>::const_iterator it=point_set.begin(); it!=point_set.end(); ++it)
{ {
if(std::size_t(*it) < point_set.size() && point_set.normal(*it) != CGAL::NULL_VECTOR) if(point_set.normal(*it) != CGAL::NULL_VECTOR)
{ {
has_normals = true; has_normals = true;
break; break;

View File

@ -7,9 +7,6 @@ project(Point_set_3_Tests)
# CGAL and its components # CGAL and its components
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)
create_single_source_cgal_program("copy_construction_test.cpp")
create_single_source_cgal_program("file_load_test.cpp")
create_single_source_cgal_program("point_insertion_test.cpp")
create_single_source_cgal_program("point_set_test.cpp") create_single_source_cgal_program("point_set_test.cpp")
create_single_source_cgal_program("point_set_test_join.cpp") create_single_source_cgal_program("point_set_test_join.cpp")
create_single_source_cgal_program("test_deprecated_io_ps.cpp") create_single_source_cgal_program("test_deprecated_io_ps.cpp")

View File

@ -1,36 +0,0 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Point_set_3.h>
#include <CGAL/grid_simplify_point_set.h>
#include <boost/unordered_set.hpp>
#include <fstream>
#include <limits>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef CGAL::Point_set_3<Point> Point_set;
typedef std::array<unsigned char, 3> Color;
int main (int, char**)
{
Point_set original;
original.insert({1, 2, 3});
original.insert({4, 5, 6});
Point_set copy_constructed{original};
assert(copy_constructed.number_of_points() == original.number_of_points());
assert(copy_constructed.point(0) == original.point(0));
assert(copy_constructed.point(1) == original.point(1));
Point_set copy_assigned;
copy_assigned = original;
assert(copy_assigned.number_of_points() == original.number_of_points());
assert(copy_assigned.point(0) == original.point(0));
assert(copy_assigned.point(1) == original.point(1));
}

View File

@ -1,33 +0,0 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Point_set_3.h>
#include <CGAL/grid_simplify_point_set.h>
#include <CGAL/point_generators_3.h>
#include <boost/unordered_set.hpp>
#include <fstream>
#include <limits>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef CGAL::Point_set_3<Point> Point_set;
int main() {
std::ifstream stream_xyz{CGAL::data_file_path("points_3/cube.xyz")};
Point_set points_xyz;
stream_xyz >> points_xyz;
assert(points_xyz.number_of_points() == 8);
assert(!points_xyz.has_normal_map());
std::ifstream stream_pwn{CGAL::data_file_path("points_3/cube.pwn")};
Point_set points_pwn;
stream_pwn >> points_pwn;
assert(points_pwn.number_of_points() == 50000);
assert(points_pwn.has_normal_map());
}

View File

@ -1,39 +0,0 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Point_set_3.h>
#include <CGAL/grid_simplify_point_set.h>
#include <CGAL/point_generators_3.h>
#include <boost/unordered_set.hpp>
#include <fstream>
#include <limits>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef CGAL::Point_set_3<Point> Point_set;
int main() {
Point_set points;
assert(points.number_of_points() == 0);
// Add a large number of points using a generator
std::size_t reserved_points_count = 1000;
CGAL::Random_points_in_cube_3<Point> generator;
points.reserve(reserved_points_count);
assert(points.number_of_points() == 0);
for (std::size_t i = 0; i < reserved_points_count; ++i)
points.insert(*(generator++));
assert(points.number_of_points() == reserved_points_count);
// Add more points without making a reservation beforehand
std::size_t additional_points_count = 100;
for (std::size_t i = 0; i < additional_points_count; ++i)
points.insert(*(generator++));
assert(points.number_of_points() == reserved_points_count + additional_points_count);
}

View File

@ -19,15 +19,12 @@ typedef std::array<unsigned char, 3> Color;
std::size_t nb_test = 0; std::size_t nb_test = 0;
std::size_t nb_success = 0; std::size_t nb_success = 0;
// todo: Automatically numbering the tests is unhelpful
void test (bool expr, const char* msg) void test (bool expr, const char* msg)
{ {
++ nb_test; ++ nb_test;
if (!expr) { if (!expr)
std::cerr << "Error on test " << nb_test << ": " << msg << std::endl; std::cerr << "Error on test " << nb_test << ": " << msg << std::endl;
// stop on fail, so it's easier to find the error (and so it shows up in CI) else
exit(1);
} else
++ nb_success; ++ nb_success;
} }
@ -83,8 +80,10 @@ int main (int, char**)
point_set.collect_garbage(); point_set.collect_garbage();
test (!(point_set.has_garbage()), "point set shouldn't have garbage."); test (!(point_set.has_garbage()), "point set shouldn't have garbage.");
test (!(point_set.has_property_map<Color>("color")), "point set shouldn't have colors."); test (!(point_set.has_property_map<Color> ("color")), "point set shouldn't have colors.");
auto [color_prop, garbage] = point_set.add_property_map ("color", Color()); Point_set::Property_map<Color> color_prop;
bool garbage;
boost::tie (color_prop, garbage) = point_set.add_property_map ("color", Color());
test (point_set.has_property_map<Color> ("color"), "point set should have colors."); test (point_set.has_property_map<Color> ("color"), "point set should have colors.");
for (Point_set::iterator it = point_set.begin(); it != point_set.end(); ++ it) for (Point_set::iterator it = point_set.begin(); it != point_set.end(); ++ it)
@ -96,7 +95,8 @@ int main (int, char**)
test ((get (color_prop, *it) == c), "recovered color is incorrect."); test ((get (color_prop, *it) == c), "recovered color is incorrect.");
} }
auto color_prop_2 = point_set.property_map<Color>("color").value(); Point_set::Property_map<Color> color_prop_2;
boost::tie (color_prop_2, garbage) = point_set.property_map<Color>("color");
test ((color_prop_2 == color_prop), "color property not recovered correctly."); test ((color_prop_2 == color_prop), "color property not recovered correctly.");
point_set.remove_normal_map (); point_set.remove_normal_map ();
@ -114,13 +114,12 @@ int main (int, char**)
for (const auto& p : pnt) for (const auto& p : pnt)
std::cerr << " * " << p.first << " with type " << p.second.name() << std::endl; std::cerr << " * " << p.first << " with type " << p.second.name() << std::endl;
// todo: was it okay to rename this to num_properties? test (point_set.base().n_properties() == 4, "point set should have 4 properties.");
test (point_set.base().num_properties() == 4, "point set should have 4 properties.");
Point p_before = *(point_set.points().begin()); Point p_before = *(point_set.points().begin());
point_set.clear_properties(); point_set.clear_properties();
test (point_set.base().num_properties() == 2, "point set should have 2 properties."); test (point_set.base().n_properties() == 2, "point set should have 2 properties.");
test (!(point_set.has_property_map<int>("label")), "point set shouldn' have labels."); test (!(point_set.has_property_map<int>("label")), "point set shouldn' have labels.");
test (!(point_set.has_property_map<double>("intensity")), "point set shouldn' have intensity."); test (!(point_set.has_property_map<double>("intensity")), "point set shouldn' have intensity.");
test (!(point_set.empty()), "point set shouldn' be empty."); test (!(point_set.empty()), "point set shouldn' be empty.");

View File

@ -30,7 +30,9 @@ void test (bool expr, const char* msg)
void print_point_set (const Point_set& ps, const char* msg) void print_point_set (const Point_set& ps, const char* msg)
{ {
auto intensity = ps.property_map<int>("intensity"); Point_set::Property_map<int> intensity;
bool has_intensity;
boost::tie (intensity, has_intensity) = ps.property_map<int>("intensity");
std::cerr << msg << std::endl; std::cerr << msg << std::endl;
for (Point_set::const_iterator it = ps.begin(); it != ps.end(); ++ it) for (Point_set::const_iterator it = ps.begin(); it != ps.end(); ++ it)
@ -38,8 +40,8 @@ void print_point_set (const Point_set& ps, const char* msg)
std::cerr << *it << ": " << ps.point(*it); std::cerr << *it << ": " << ps.point(*it);
if (ps.has_normal_map()) if (ps.has_normal_map())
std::cerr << ", normal " << ps.normal(*it); std::cerr << ", normal " << ps.normal(*it);
if (intensity.has_value()) if (has_intensity)
std::cerr << ", intensity " << intensity.value()[*it]; std::cerr << ", intensity " << intensity[*it];
std::cerr << std::endl; std::cerr << std::endl;
} }
} }
@ -68,7 +70,10 @@ int main (int, char**)
Point_set ps3; Point_set ps3;
ps3.add_normal_map(); ps3.add_normal_map();
auto [intensity, okay] = ps3.add_property_map<int>("intensity", 0); Point_set::Property_map<int> intensity;
bool okay;
boost::tie (intensity, okay) = ps3.add_property_map<int>("intensity", 0);
assert (okay); assert (okay);
Point_set::iterator it = ps3.insert (Point (double(0), double(1), double(2)), Point_set::iterator it = ps3.insert (Point (double(0), double(1), double(2)),

View File

@ -134,15 +134,15 @@ bool read_XYZ(std::istream& is,
{ {
iss.clear(); iss.clear();
iss.str(line); iss.str(line);
if (iss >> iformat(x) >> iformat(y) >> iformat(z)) if (iss >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z))
{ {
Point point(x,y,z); Point point(x,y,z);
Vector normal = CGAL::NULL_VECTOR; Vector normal = CGAL::NULL_VECTOR;
// ... + normal... // ... + normal...
if (iss >> iformat(nx)) if (iss >> IO::iformat(nx))
{ {
// In case we could read one number, we expect that there are two more // In case we could read one number, we expect that there are two more
if(iss >> iformat(ny) >> iformat(nz)){ if(iss >> IO::iformat(ny) >> IO::iformat(nz)){
normal = Vector(nx,ny,nz); normal = Vector(nx,ny,nz);
} else { } else {
std::cerr << "Error line " << lineNumber << " of file (incomplete normal coordinates)" << std::endl; std::cerr << "Error line " << lineNumber << " of file (incomplete normal coordinates)" << std::endl;

View File

@ -39,11 +39,7 @@
#include <CGAL/property_map.h> #include <CGAL/property_map.h>
#include <boost/graph/adjacency_list.hpp> #include <boost/graph/adjacency_list.hpp>
#include <CGAL/boost/graph/dijkstra_shortest_paths.h> // work around a #include <boost/graph/dijkstra_shortest_paths.hpp>
// bug in boost
// 1.54
#include <boost/graph/prim_minimum_spanning_tree.hpp> #include <boost/graph/prim_minimum_spanning_tree.hpp>
#if defined(BOOST_MSVC) #if defined(BOOST_MSVC)
@ -553,9 +549,6 @@ create_mst_graph(
For this reason it should not be called on sorted containers. For this reason it should not be called on sorted containers.
It is based on \cgalCite{cgal:hddms-srup-92}. It is based on \cgalCite{cgal:hddms-srup-92}.
\warning This function may fail when Boost version 1.54 is used,
because of the following bug: https://svn.boost.org/trac/boost/ticket/9012
\pre Normals must be unit vectors \pre Normals must be unit vectors
\pre `k >= 2` \pre `k >= 2`

View File

@ -1150,6 +1150,9 @@ bool adapt_patch(std::vector<std::vector<Point> >& point_patch,
put(local_vpm, v, projector(get(local_vpm, v))); put(local_vpm, v, projector(get(local_vpm, v)));
// The projector can create degenerate faces // The projector can create degenerate faces
for (halfedge_descriptor h : border_hedges)
if (is_degenerate_triangle_face(face(opposite(h, local_mesh), local_mesh), local_mesh))
return !has_SI;
if(!remove_degenerate_faces(local_mesh)) if(!remove_degenerate_faces(local_mesh))
return !has_SI; return !has_SI;
@ -2031,7 +2034,7 @@ remove_self_intersections_one_step(std::set<typename boost::graph_traits<Triangl
#ifdef CGAL_PMP_REMOVE_SELF_INTERSECTION_OUTPUT_INTERMEDIATE_FULL_MESH #ifdef CGAL_PMP_REMOVE_SELF_INTERSECTION_OUTPUT_INTERMEDIATE_FULL_MESH
fname = "results/mesh_at_step_"+std::to_string(step)+"_CC_"+std::to_string(cc_id)+".off"; fname = "results/mesh_at_step_"+std::to_string(step)+"_CC_"+std::to_string(cc_id)+".off";
CGAL::IO::write_polygon_mesh(fname, tmesh, CGAL::parameters::stream_precision); CGAL::IO::write_polygon_mesh(fname, tmesh, CGAL::parameters::stream_precision(17));
#endif #endif
// expand the region to be filled // expand the region to be filled

View File

@ -49,21 +49,3 @@
#include <CGAL/Polygon_mesh_processing/smooth_mesh.h> #include <CGAL/Polygon_mesh_processing/smooth_mesh.h>
#include <CGAL/Polygon_mesh_processing/smooth_shape.h> #include <CGAL/Polygon_mesh_processing/smooth_shape.h>
#include <CGAL/Polygon_mesh_processing/manifoldness.h> #include <CGAL/Polygon_mesh_processing/manifoldness.h>
// the named parameter header being not documented the doc is put here for now
#ifdef DOXYGEN_RUNNING
namespace CGAL {
namespace Polygon_mesh_processing {
namespace parameters {
/*! \ingroup namedparameters
\deprecated This function is deprecated and `default_values()` should be used instead.
This function can be used to indicate that all optional named parameters
to be used are the default ones. This is particularly useful when a function
requires more than one sequence of named parameters and default values is
fine only for some of them.
*/
unspecified_type all_default();
} } } // end of namespace CGAL::Polygon_mesh_processing::parameters
#endif

View File

@ -18,6 +18,10 @@
#include <CGAL/Polygonal_surface_reconstruction/internal/hypothesis.h> #include <CGAL/Polygonal_surface_reconstruction/internal/hypothesis.h>
#include <CGAL/Polygonal_surface_reconstruction/internal/compute_confidences.h> #include <CGAL/Polygonal_surface_reconstruction/internal/compute_confidences.h>
#include <CGAL/Polygonal_surface_reconstruction/internal/point_set_with_planes.h> #include <CGAL/Polygonal_surface_reconstruction/internal/point_set_with_planes.h>
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup.h>
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
#include <CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h>
#include <CGAL/Polygon_mesh_processing/repair_polygon_soup.h>
#include <unordered_map> #include <unordered_map>
@ -28,7 +32,7 @@
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup PkgPolygonalSurfaceReconstruction \ingroup PkgPolygonalSurfaceReconstructionRef
\brief \brief
@ -455,7 +459,12 @@ namespace CGAL {
// Converts from internal data structure to the required `PolygonMesh`. // Converts from internal data structure to the required `PolygonMesh`.
output_mesh.clear(); // make sure it is empty. output_mesh.clear(); // make sure it is empty.
CGAL::copy_face_graph(target_mesh, output_mesh); std::vector<Point> points;
std::vector<std::vector<std::size_t> > polygons;
CGAL::Polygon_mesh_processing::polygon_mesh_to_polygon_soup(target_mesh, points, polygons);
CGAL::Polygon_mesh_processing::merge_duplicate_points_in_polygon_soup(points, polygons);
CGAL::Polygon_mesh_processing::orient_polygon_soup(points, polygons);
CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, output_mesh);
} }
else { else {
error_message_ = "solving the binary program failed"; error_message_ = "solving the binary program failed";

View File

@ -747,7 +747,7 @@ namespace CGAL {
if (v == Polygon_mesh::null_vertex()) // failed splitting edge if (v == Polygon_mesh::null_vertex()) // failed splitting edge
return Polygon_mesh::null_halfedge(); return Polygon_mesh::null_halfedge();
auto &coords = mesh.points(); typename Polygon_mesh::template Property_map<Vertex_descriptor, Point>& coords = mesh.points();
coords[v] = *ep.pos; coords[v] = *ep.pos;
Edge_descriptor e1 = mesh.edge(h); Edge_descriptor e1 = mesh.edge(h);

View File

@ -67,6 +67,18 @@ namespace CGAL {
delete supporting_plane_; delete supporting_plane_;
supporting_plane_ = new Plane; supporting_plane_ = new Plane;
CGAL::linear_least_squares_fitting_3(pts.begin(), pts.end(), *supporting_plane_, CGAL::Dimension_tag<0>()); CGAL::linear_least_squares_fitting_3(pts.begin(), pts.end(), *supporting_plane_, CGAL::Dimension_tag<0>());
// Check orientation
int vote_for_opposite = 0;
for (std::size_t i = 0; i < size(); i++)
if (supporting_plane_->orthogonal_vector() * point_set_->normal_map()[at(i)] < 0)
vote_for_opposite++;
else
vote_for_opposite--;
if (vote_for_opposite > 0)
*supporting_plane_ = supporting_plane_->opposite();
return supporting_plane_; return supporting_plane_;
} }
@ -142,7 +154,7 @@ namespace CGAL {
std::size_t idx = 0; std::size_t idx = 0;
for (typename PointRange::const_iterator it = points.begin(); it != points.end(); ++it) { for (typename PointRange::const_iterator it = points.begin(); it != points.end(); ++it) {
Base_class::m_points[idx] = get(point_map, *it); Base_class::m_points[idx] = get(point_map, *it);
Base_class::m_normals.value()[idx] = get(normal_map, *it); Base_class::m_normals[idx] = get(normal_map, *it);
int plane_index = get(plane_index_map, *it); int plane_index = get(plane_index_map, *it);
if (plane_index != -1) { if (plane_index != -1) {
auto it_and_bool = plane_index_remap.emplace(plane_index, planar_segments_.size()); auto it_and_bool = plane_index_remap.emplace(plane_index, planar_segments_.size());

View File

@ -22,6 +22,7 @@ Point_set_3
Point_set_processing_3 Point_set_processing_3
Polygon Polygon
Polygonal_surface_reconstruction Polygonal_surface_reconstruction
Polygon_mesh_processing
Principal_component_analysis Principal_component_analysis
Principal_component_analysis_LGPL Principal_component_analysis_LGPL
Profiling_tools Profiling_tools

View File

@ -179,6 +179,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
Viewer_interface_moc.cpp Viewer_interface_moc.cpp
Scene_item_moc.cpp Scene_item_moc.cpp
Scene_item.cpp Scene_item.cpp
Scene_item_with_properties.cpp
Triangle_container.cpp Triangle_container.cpp
Edge_container.cpp Edge_container.cpp
Point_container.cpp Point_container.cpp
@ -231,7 +232,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
endmacro(add_item) endmacro(add_item)
add_item(scene_triangulation_3_item Scene_triangulation_3_item.cpp) add_item(scene_triangulation_3_item Scene_triangulation_3_item.cpp)
target_link_libraries(scene_triangulation_3_item PUBLIC scene_basic_objects) target_link_libraries(scene_triangulation_3_item PUBLIC scene_basic_objects scene_edit_box_item)
add_item(scene_c3t3_item Scene_c3t3_item.cpp) add_item(scene_c3t3_item Scene_c3t3_item.cpp)
target_link_libraries( target_link_libraries(

View File

@ -30,8 +30,9 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
backup_existing_colors_and_add_new(); backup_existing_colors_and_add_new();
auto m_cluster_id = m_points->point_set()->property_map<int>("shape"); bool cluster_found = false;
if (!m_cluster_id) boost::tie (m_cluster_id, cluster_found) = m_points->point_set()->property_map<int>("shape");
if (!cluster_found)
{ {
std::cerr << "Error! Cluster not found!" << std::endl; std::cerr << "Error! Cluster not found!" << std::endl;
abort(); abort();
@ -39,7 +40,7 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
CGAL::Classification::create_clusters_from_indices (*(m_points->point_set()), CGAL::Classification::create_clusters_from_indices (*(m_points->point_set()),
m_points->point_set()->point_map(), m_points->point_set()->point_map(),
m_cluster_id.value(), m_cluster_id,
m_clusters); m_clusters);
std::cerr << m_clusters.size() << " cluster(s) found" << std::endl; std::cerr << m_clusters.size() << " cluster(s) found" << std::endl;
@ -56,20 +57,20 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
if (!classif_found) if (!classif_found)
{ {
auto las_classif = m_points->point_set()->property_map<unsigned char>("classification"); Point_set::Property_map<unsigned char> las_classif;
las_found = las_classif.has_value(); boost::tie (las_classif, las_found) = m_points->point_set()->property_map<unsigned char>("classification");
if (las_classif) if (las_found)
{ {
m_input_is_las = true; m_input_is_las = true;
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
unsigned char uc = las_classif.value()[*it]; unsigned char uc = las_classif[*it];
m_classif.value()[*it] = int(uc); m_classif[*it] = int(uc);
if (!training_found) if (!training_found)
m_training.value()[*it] = int(uc); m_training[*it] = int(uc);
} }
m_points->point_set()->remove_property_map (las_classif.value()); m_points->point_set()->remove_property_map (las_classif);
classif_found = true; classif_found = true;
training_found = true; training_found = true;
} }
@ -84,7 +85,7 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
{ {
if (training_found) if (training_found)
{ {
int l = m_training.value()[*it]; int l = m_training[*it];
if (l >= 0) if (l >= 0)
{ {
if (std::size_t(l) >= used_indices.size()) if (std::size_t(l) >= used_indices.size())
@ -94,7 +95,7 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
} }
if (classif_found) if (classif_found)
{ {
int l = m_classif.value()[*it]; int l = m_classif[*it];
if (l >= 0) if (l >= 0)
{ {
if (std::size_t(l) >= used_indices.size()) if (std::size_t(l) >= used_indices.size())
@ -124,31 +125,31 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
int c = m_cluster_id.value()[*it]; int c = m_cluster_id[*it];
if (training_found) if (training_found)
{ {
if (std::size_t(current_idx) != used_indices.size()) // Empty indices -> reorder indices in point set if (std::size_t(current_idx) != used_indices.size()) // Empty indices -> reorder indices in point set
{ {
if (las_found && (m_training.value()[*it] == 0 || m_training.value()[*it] == 1)) // Unclassified class in LAS if (las_found && (m_training[*it] == 0 || m_training[*it] == 1)) // Unclassified class in LAS
m_training.value()[*it] = -1; m_training[*it] = -1;
else if (m_training.value()[*it] != -1) else if (m_training[*it] != -1)
m_training.value()[*it] = used_indices[std::size_t(m_training.value()[*it])]; m_training[*it] = used_indices[std::size_t(m_training[*it])];
} }
if (c != -1 && m_training.value()[*it] != -1) if (c != -1 && m_training[*it] != -1)
m_clusters[c].training() = m_training.value()[*it]; m_clusters[c].training() = m_training[*it];
} }
if (classif_found) if (classif_found)
{ {
if (std::size_t(current_idx) != used_indices.size()) // Empty indices -> reorder indices in point set if (std::size_t(current_idx) != used_indices.size()) // Empty indices -> reorder indices in point set
{ {
if (las_found && (m_classif.value()[*it] == 0 || m_classif.value()[*it] == 1)) // Unclassified class in LAS if (las_found && (m_classif[*it] == 0 || m_classif[*it] == 1)) // Unclassified class in LAS
m_classif.value()[*it] = -1; m_classif[*it] = -1;
else if (m_classif.value()[*it] != -1) else if (m_classif[*it] != -1)
m_classif.value()[*it] = used_indices[std::size_t(m_classif.value()[*it])]; m_classif[*it] = used_indices[std::size_t(m_classif[*it])];
} }
if (c != -1 && m_classif.value()[*it] != -1) if (c != -1 && m_classif[*it] != -1)
m_clusters[c].label() = m_classif.value()[*it]; m_clusters[c].label() = m_classif[*it];
} }
} }
@ -239,11 +240,11 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
Delaunay dt (boost::make_transform_iterator Delaunay dt (boost::make_transform_iterator
(m_points->point_set()->begin(), (m_points->point_set()->begin(),
Point_set_with_cluster_info (m_points->point_set(), Point_set_with_cluster_info (m_points->point_set(),
m_cluster_id.value())), m_cluster_id)),
boost::make_transform_iterator boost::make_transform_iterator
(m_points->point_set()->end(), (m_points->point_set()->end(),
Point_set_with_cluster_info (m_points->point_set(), Point_set_with_cluster_info (m_points->point_set(),
m_cluster_id.value()))); m_cluster_id)));
std::set<std::pair<int, int> > adjacencies; std::set<std::pair<int, int> > adjacencies;
@ -293,16 +294,16 @@ Cluster_classification::~Cluster_classification()
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
int c = m_cluster_id.value()[*it]; int c = m_cluster_id[*it];
if (c != -1) if (c != -1)
{ {
m_training.value()[*it] = m_clusters[c].training(); m_training[*it] = m_clusters[c].training();
m_classif.value()[*it] = m_clusters[c].label(); m_classif[*it] = m_clusters[c].label();
} }
else else
{ {
m_training.value()[*it] = -1; m_training[*it] = -1;
m_classif.value()[*it] = -1; m_classif[*it] = -1;
} }
} }
@ -358,22 +359,22 @@ Cluster_classification::~Cluster_classification()
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int c = m_classif.value()[*it]; int c = m_classif[*it];
unsigned char lc = 1; // unclassified in LAS standard unsigned char lc = 1; // unclassified in LAS standard
if (c != -1) if (c != -1)
lc = label_indices[std::size_t(c)]; lc = label_indices[std::size_t(c)];
las_classif[*it] = lc; las_classif[*it] = lc;
int t = m_training.value()[*it]; int t = m_training[*it];
unsigned char lt = 1; // unclassified in LAS standard unsigned char lt = 1; // unclassified in LAS standard
if (t != -1) if (t != -1)
lt = label_indices[std::size_t(t)]; lt = label_indices[std::size_t(t)];
m_training.value()[*it] = int(lt); m_training[*it] = int(lt);
} }
m_points->point_set()->remove_property_map (m_classif.value()); m_points->point_set()->remove_property_map (m_classif);
} }
@ -390,7 +391,7 @@ void Cluster_classification::backup_existing_colors_and_add_new()
m_color = m_points->point_set()->add_property_map<CGAL::IO::Color>("real_color").first; m_color = m_points->point_set()->add_property_map<CGAL::IO::Color>("real_color").first;
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
m_color.value()[*it] = CGAL::IO::Color ((unsigned char)(255 * m_points->point_set()->red(*it)), m_color[*it] = CGAL::IO::Color ((unsigned char)(255 * m_points->point_set()->red(*it)),
(unsigned char)(255 * m_points->point_set()->green(*it)), (unsigned char)(255 * m_points->point_set()->green(*it)),
(unsigned char)(255 * m_points->point_set()->blue(*it))); (unsigned char)(255 * m_points->point_set()->blue(*it)));
@ -402,15 +403,15 @@ void Cluster_classification::backup_existing_colors_and_add_new()
void Cluster_classification::reset_colors() void Cluster_classification::reset_colors()
{ {
if (!m_color) if (m_color == Point_set::Property_map<CGAL::IO::Color>())
m_points->point_set()->remove_colors(); m_points->point_set()->remove_colors();
else else
{ {
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
m_points->point_set()->set_color(*it, m_color.value()[*it]); m_points->point_set()->set_color(*it, m_color[*it]);
m_points->point_set()->remove_property_map(m_color.value()); m_points->point_set()->remove_property_map(m_color);
} }
} }
@ -437,7 +438,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
m_points->point_set()->set_color(*it, m_color.value()[*it]); m_points->point_set()->set_color(*it, m_color[*it]);
} }
else if (index_color == 1) // classif else if (index_color == 1) // classif
{ {
@ -445,7 +446,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
QColor color (0, 0, 0); QColor color (0, 0, 0);
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
std::size_t c = m_clusters[cid].label(); std::size_t c = m_clusters[cid].label();
@ -463,7 +464,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
QColor color (0, 0, 0); QColor color (0, 0, 0);
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
float div = 1; float div = 1;
if (cid != -1) if (cid != -1)
@ -485,7 +486,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
@ -515,7 +516,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
float v = (std::max) (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][cid])); float v = (std::max) (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][cid]));
@ -552,7 +553,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
if (feature->value(cid) > max) if (feature->value(cid) > max)
@ -566,7 +567,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
float v = (feature->value(cid) - min) / (max - min); float v = (feature->value(cid) - min) / (max - min);
@ -597,14 +598,15 @@ int Cluster_classification::real_index_color() const
{ {
int out = m_index_color; int out = m_index_color;
if (out == 0 && !m_color) if (out == 0 && m_color == Point_set::Property_map<CGAL::IO::Color>())
out = -1; out = -1;
return out; return out;
} }
void Cluster_classification::reset_indices () void Cluster_classification::reset_indices ()
{ {
auto indices = m_points->point_set()->property_map<Point_set::Index>("index").value(); Point_set::Property_map<Point_set::Index> indices
= m_points->point_set()->property_map<Point_set::Index>("index").first;
m_points->point_set()->unselect_all(); m_points->point_set()->unselect_all();
Point_set::Index idx; Point_set::Index idx;
@ -627,16 +629,18 @@ void Cluster_classification::compute_features (std::size_t nb_scales, float voxe
m_features.clear(); m_features.clear();
std::optional<Point_set::Vector_map> normal_map; Point_set::Vector_map normal_map;
bool normals = m_points->point_set()->has_normal_map(); bool normals = m_points->point_set()->has_normal_map();
if (normals) if (normals)
normal_map = m_points->point_set()->normal_map(); normal_map = m_points->point_set()->normal_map();
bool colors = m_color.has_value(); bool colors = (m_color != Point_set::Property_map<CGAL::IO::Color>());
auto echo_map = m_points->point_set()->template property_map<std::uint8_t>("echo"); Point_set::Property_map<std::uint8_t> echo_map;
if (!echo_map) bool echo;
echo_map = m_points->point_set()->template property_map<std::uint8_t>("number_of_returns").value(); boost::tie (echo_map, echo) = m_points->point_set()->template property_map<std::uint8_t>("echo");
if (!echo)
boost::tie (echo_map, echo) = m_points->point_set()->template property_map<std::uint8_t>("number_of_returns");
Feature_set pointwise_features; Feature_set pointwise_features;
@ -651,11 +655,11 @@ void Cluster_classification::compute_features (std::size_t nb_scales, float voxe
generator.generate_point_based_features(pointwise_features); generator.generate_point_based_features(pointwise_features);
if (normals) if (normals)
generator.generate_normal_based_features (pointwise_features, normal_map.value()); generator.generate_normal_based_features (pointwise_features, normal_map);
if (colors) if (colors)
generator.generate_color_based_features (pointwise_features, m_color.value()); generator.generate_color_based_features (pointwise_features, m_color);
if (echo_map) if (echo)
generator.generate_echo_based_features (pointwise_features, echo_map.value()); generator.generate_echo_based_features (pointwise_features, echo_map);
#ifdef CGAL_LINKED_WITH_TBB #ifdef CGAL_LINKED_WITH_TBB
pointwise_features.end_parallel_additions(); pointwise_features.end_parallel_additions();

View File

@ -125,12 +125,13 @@ class Cluster_classification : public Item_classification_base
{ {
typedef typename Point_set::template Property_map<Type> Pmap; typedef typename Point_set::template Property_map<Type> Pmap;
bool okay = false; bool okay = false;
auto pmap = m_points->point_set()->template property_map<Type>(name.c_str()); Pmap pmap;
if (pmap) boost::tie (pmap, okay) = m_points->point_set()->template property_map<Type>(name.c_str());
if (okay)
feature_set.template add<CGAL::Classification::Feature::Simple_feature <Point_set, Pmap> > feature_set.template add<CGAL::Classification::Feature::Simple_feature <Point_set, Pmap> >
(*(m_points->point_set()), pmap.value(), name.c_str()); (*(m_points->point_set()), pmap, name.c_str());
return pmap.has_value(); return okay;
} }
void add_selection_to_training_set (std::size_t label) void add_selection_to_training_set (std::size_t label)
@ -138,7 +139,7 @@ class Cluster_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->first_selected(); for (Point_set::const_iterator it = m_points->point_set()->first_selected();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
m_clusters[cid].training() = int(label); m_clusters[cid].training() = int(label);
@ -164,7 +165,7 @@ class Cluster_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->first_selected(); for (Point_set::const_iterator it = m_points->point_set()->first_selected();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
m_clusters[cid].training() = -1; m_clusters[cid].training() = -1;
@ -186,7 +187,7 @@ class Cluster_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->first_selected(); for (Point_set::const_iterator it = m_points->point_set()->first_selected();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
m_clusters[cid].training() = m_clusters[cid].label(); m_clusters[cid].training() = m_clusters[cid].label();
} }
@ -211,7 +212,7 @@ class Cluster_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
int c = m_clusters[cid].label(); int c = m_clusters[cid].label();
@ -237,7 +238,7 @@ class Cluster_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int cid = m_cluster_id.value()[*it]; int cid = m_cluster_id[*it];
if (cid != -1) if (cid != -1)
{ {
int c = m_clusters[cid].label(); int c = m_clusters[cid].label();
@ -375,10 +376,13 @@ class Cluster_classification : public Item_classification_base
std::vector<Cluster> m_clusters; std::vector<Cluster> m_clusters;
std::optional<Point_set::Property_map<CGAL::IO::Color>> m_color; Point_set::Property_map<unsigned char> m_red;
std::optional<Point_set::Property_map<int>> m_cluster_id; Point_set::Property_map<unsigned char> m_green;
std::optional<Point_set::Property_map<int>> m_training; Point_set::Property_map<unsigned char> m_blue;
std::optional<Point_set::Property_map<int>> m_classif; Point_set::Property_map<CGAL::IO::Color> m_color;
Point_set::Property_map<int> m_cluster_id;
Point_set::Property_map<int> m_training;
Point_set::Property_map<int> m_classif;
std::vector<std::vector<float> > m_label_probabilities; std::vector<std::vector<float> > m_label_probabilities;

View File

@ -16,20 +16,23 @@
#include <algorithm> #include <algorithm>
Point_set_item_classification::Point_set_item_classification(Scene_points_with_normal_item* points) Point_set_item_classification::Point_set_item_classification(Scene_points_with_normal_item* points)
: m_points(points), m_generator(nullptr), m_input_is_las(false), : m_points (points)
m_training(), , m_generator (nullptr)
m_classif(){ , m_input_is_las (false)
{
m_index_color = 1; m_index_color = 1;
reset_indices(); reset_indices();
auto cluster_id = m_points->point_set()->property_map<int>("shape"); Point_set::Property_map<int> cluster_id;
if (cluster_id) bool cluster_found = false;
boost::tie (cluster_id, cluster_found) = m_points->point_set()->property_map<int>("shape");
if (cluster_found)
{ {
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
int c = cluster_id.value()[*it]; int c = cluster_id[*it];
if (c == -1) if (c == -1)
continue; continue;
if (std::size_t(c) >= m_clusters.size()) if (std::size_t(c) >= m_clusters.size())
@ -51,20 +54,20 @@ Point_set_item_classification::Point_set_item_classification(Scene_points_with_n
if (!classif_found) if (!classif_found)
{ {
auto las_classif = m_points->point_set()->property_map<unsigned char>("classification"); Point_set::Property_map<unsigned char> las_classif;
las_found = las_classif.has_value(); boost::tie (las_classif, las_found) = m_points->point_set()->property_map<unsigned char>("classification");
if (las_classif) if (las_found)
{ {
m_input_is_las = true; m_input_is_las = true;
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
unsigned char uc = las_classif.value()[*it]; unsigned char uc = las_classif[*it];
m_classif.value()[*it] = int(uc); m_classif[*it] = int(uc);
if (!training_found) if (!training_found)
m_training.value()[*it] = int(uc); m_training[*it] = int(uc);
} }
m_points->point_set()->remove_property_map (las_classif.value()); m_points->point_set()->remove_property_map (las_classif);
classif_found = true; classif_found = true;
training_found = true; training_found = true;
} }
@ -79,7 +82,7 @@ Point_set_item_classification::Point_set_item_classification(Scene_points_with_n
{ {
if (training_found) if (training_found)
{ {
int l = m_training.value()[*it]; int l = m_training[*it];
if (l >= 0) if (l >= 0)
{ {
if (std::size_t(l) >= used_indices.size()) if (std::size_t(l) >= used_indices.size())
@ -89,7 +92,7 @@ Point_set_item_classification::Point_set_item_classification(Scene_points_with_n
} }
if (classif_found) if (classif_found)
{ {
int l = m_classif.value()[*it]; int l = m_classif[*it];
if (l >= 0) if (l >= 0)
{ {
if (std::size_t(l) >= used_indices.size()) if (std::size_t(l) >= used_indices.size())
@ -122,17 +125,17 @@ Point_set_item_classification::Point_set_item_classification(Scene_points_with_n
{ {
if (training_found) if (training_found)
{ {
if (las_found && (m_training.value()[*it] == 0 || m_training.value()[*it] == 1)) // Unclassified class in LAS if (las_found && (m_training[*it] == 0 || m_training[*it] == 1)) // Unclassified class in LAS
m_training.value()[*it] = -1; m_training[*it] = -1;
else if (m_training.value()[*it] != -1) else if (m_training[*it] != -1)
m_training.value()[*it] = used_indices[std::size_t(m_training.value()[*it])]; m_training[*it] = used_indices[std::size_t(m_training[*it])];
} }
if (classif_found) if (classif_found)
{ {
if (las_found && (m_classif.value()[*it] == 0 || m_classif.value()[*it] == 1)) // Unclassified class in LAS if (las_found && (m_classif[*it] == 0 || m_classif[*it] == 1)) // Unclassified class in LAS
m_classif.value()[*it] = -1; m_classif[*it] = -1;
else if (m_classif.value()[*it] != -1) else if (m_classif[*it] != -1)
m_classif.value()[*it] = used_indices[std::size_t(m_classif.value()[*it])]; m_classif[*it] = used_indices[std::size_t(m_classif[*it])];
} }
} }
} }
@ -292,22 +295,22 @@ Point_set_item_classification::~Point_set_item_classification()
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int c = m_classif.value()[*it]; int c = m_classif[*it];
unsigned char lc = 1; // unclassified in LAS standard unsigned char lc = 1; // unclassified in LAS standard
if (c != -1) if (c != -1)
lc = label_indices[std::size_t(c)]; lc = label_indices[std::size_t(c)];
las_classif[*it] = lc; las_classif[*it] = lc;
int t = m_training.value()[*it]; int t = m_training[*it];
unsigned char lt = 1; // unclassified in LAS standard unsigned char lt = 1; // unclassified in LAS standard
if (t != -1) if (t != -1)
lt = label_indices[std::size_t(t)]; lt = label_indices[std::size_t(t)];
m_training.value()[*it] = int(lt); m_training[*it] = int(lt);
} }
m_points->point_set()->remove_property_map (m_classif.value()); m_points->point_set()->remove_property_map (m_classif);
} }
reset_colors(); reset_colors();
@ -324,7 +327,7 @@ void Point_set_item_classification::backup_existing_colors_and_add_new()
m_color = m_points->point_set()->add_property_map<CGAL::IO::Color>("real_color").first; m_color = m_points->point_set()->add_property_map<CGAL::IO::Color>("real_color").first;
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
m_color.value()[*it] = CGAL::IO::Color((unsigned char)(255 * m_points->point_set()->red(*it)), m_color[*it] = CGAL::IO::Color((unsigned char)(255 * m_points->point_set()->red(*it)),
(unsigned char)(255 * m_points->point_set()->green(*it)), (unsigned char)(255 * m_points->point_set()->green(*it)),
(unsigned char)(255 * m_points->point_set()->blue(*it))); (unsigned char)(255 * m_points->point_set()->blue(*it)));
@ -336,15 +339,15 @@ void Point_set_item_classification::backup_existing_colors_and_add_new()
void Point_set_item_classification::reset_colors() void Point_set_item_classification::reset_colors()
{ {
if (!m_color) if (m_color == Point_set::Property_map<CGAL::IO::Color>())
m_points->point_set()->remove_colors(); m_points->point_set()->remove_colors();
else else
{ {
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
m_points->point_set()->set_color(*it, m_color.value()[*it]); m_points->point_set()->set_color(*it, m_color[*it]);
m_points->point_set()->remove_property_map(m_color.value()); m_points->point_set()->remove_property_map(m_color);
} }
} }
@ -371,7 +374,7 @@ void Point_set_item_classification::change_color (int index, float* vmin, float*
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
m_points->point_set()->set_color(*it, m_color.value()[*it]); m_points->point_set()->set_color(*it, m_color[*it]);
} }
else if (index_color == 1) // classif else if (index_color == 1) // classif
{ {
@ -379,7 +382,7 @@ void Point_set_item_classification::change_color (int index, float* vmin, float*
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
QColor color (0, 0, 0); QColor color (0, 0, 0);
std::size_t c = m_classif.value()[*it]; std::size_t c = m_classif[*it];
if (c != std::size_t(-1)) if (c != std::size_t(-1))
color = label_qcolor (m_labels[c]); color = label_qcolor (m_labels[c]);
@ -393,8 +396,8 @@ void Point_set_item_classification::change_color (int index, float* vmin, float*
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
QColor color (0, 0, 0); QColor color (0, 0, 0);
int c = m_training.value()[*it]; int c = m_training[*it];
int c2 = m_classif.value()[*it]; int c2 = m_classif[*it];
if (c != -1) if (c != -1)
color = label_qcolor (m_labels[std::size_t(c)]); color = label_qcolor (m_labels[std::size_t(c)]);
@ -487,14 +490,15 @@ int Point_set_item_classification::real_index_color() const
{ {
int out = m_index_color; int out = m_index_color;
if (out == 0 && !m_color) if (out == 0 && m_color == Point_set::Property_map<CGAL::IO::Color>())
out = -1; out = -1;
return out; return out;
} }
void Point_set_item_classification::reset_indices () void Point_set_item_classification::reset_indices ()
{ {
auto indices = m_points->point_set()->property_map<Point_set::Index>("index").value(); Point_set::Property_map<Point_set::Index> indices
= m_points->point_set()->property_map<Point_set::Index>("index").first;
m_points->point_set()->unselect_all(); m_points->point_set()->unselect_all();
Point_set::Index idx; Point_set::Index idx;
@ -520,16 +524,18 @@ void Point_set_item_classification::compute_features (std::size_t nb_scales, flo
m_features.clear(); m_features.clear();
std::optional<Point_set::Vector_map> normal_map; Point_set::Vector_map normal_map;
bool normals = m_points->point_set()->has_normal_map(); bool normals = m_points->point_set()->has_normal_map();
if (normals) if (normals)
normal_map = m_points->point_set()->normal_map(); normal_map = m_points->point_set()->normal_map();
bool colors = m_color.has_value(); bool colors = (m_color != Point_set::Property_map<CGAL::IO::Color>());
auto echo_map = m_points->point_set()->template property_map<std::uint8_t>("echo"); Point_set::Property_map<std::uint8_t> echo_map;
if (!echo_map) bool echo;
echo_map = m_points->point_set()->template add_property_map<std::uint8_t>("number_of_returns").first; boost::tie (echo_map, echo) = m_points->point_set()->template property_map<std::uint8_t>("echo");
if (!echo)
boost::tie (echo_map, echo) = m_points->point_set()->template property_map<std::uint8_t>("number_of_returns");
m_generator = new Generator (*(m_points->point_set()), m_points->point_set()->point_map(), nb_scales, voxel_size); m_generator = new Generator (*(m_points->point_set()), m_points->point_set()->point_map(), nb_scales, voxel_size);
@ -542,11 +548,11 @@ void Point_set_item_classification::compute_features (std::size_t nb_scales, flo
m_generator->generate_point_based_features(m_features); m_generator->generate_point_based_features(m_features);
if (normals) if (normals)
m_generator->generate_normal_based_features (m_features, normal_map.value()); m_generator->generate_normal_based_features (m_features, normal_map);
if (colors) if (colors)
m_generator->generate_color_based_features (m_features, m_color.value()); m_generator->generate_color_based_features (m_features, m_color);
if (echo_map) if (echo)
m_generator->generate_echo_based_features (m_features, echo_map.value()); m_generator->generate_echo_based_features (m_features, echo_map);
#ifdef CGAL_LINKED_WITH_TBB #ifdef CGAL_LINKED_WITH_TBB
m_features.end_parallel_additions(); m_features.end_parallel_additions();
@ -703,7 +709,7 @@ void Point_set_item_classification::train(int classifier, const QMultipleInputDi
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
training[*it] = m_training.value()[*it]; training[*it] = m_training[*it];
if (training[*it] != -1) if (training[*it] != -1)
{ {
nb_label[std::size_t(training[*it])] ++; nb_label[std::size_t(training[*it])] ++;
@ -752,7 +758,7 @@ void Point_set_item_classification::train(int classifier, const QMultipleInputDi
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
m_classif.value()[*it] = indices[*it]; m_classif[*it] = indices[*it];
if (m_index_color == 1 || m_index_color == 2) if (m_index_color == 1 || m_index_color == 2)
change_color (m_index_color); change_color (m_index_color);

View File

@ -47,9 +47,13 @@ class Point_set_item_classification : public Item_classification_base
Point_set::Property_map<int> cluster_id; Point_set::Property_map<int> cluster_id;
std::vector<Cluster>* clusters; std::vector<Cluster>* clusters;
Cluster_neighborhood(Point_set* point_set, Cluster_neighborhood (Point_set* point_set,
std::vector<Cluster>& clusters) std::vector<Cluster>& clusters)
: point_set(point_set), clusters(&clusters), cluster_id(point_set->add_property_map<int>("shape").first) {} : point_set (point_set)
, clusters (&clusters)
{
cluster_id = point_set->property_map<int>("shape").first;
}
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator operator() (const Point_set::Index& idx, OutputIterator operator() (const Point_set::Index& idx,
@ -143,16 +147,18 @@ class Point_set_item_classification : public Item_classification_base
bool try_adding_simple_feature (const std::string& name) bool try_adding_simple_feature (const std::string& name)
{ {
typedef typename Point_set::template Property_map<Type> Pmap; typedef typename Point_set::template Property_map<Type> Pmap;
auto pmap = m_points->point_set()->template property_map<Type>(name.c_str()); bool okay = false;
if (pmap) Pmap pmap;
boost::tie (pmap, okay) = m_points->point_set()->template property_map<Type>(name.c_str());
if (okay)
{ {
std::cerr << "Adding property<" << CGAL::demangle(typeid(Type).name()) << ">(" std::cerr << "Adding property<" << CGAL::demangle(typeid(Type).name()) << ">("
<< name << ") as feature" << std::endl; << name << ") as feature" << std::endl;
m_features.template add<CGAL::Classification::Feature::Simple_feature <Point_set, Pmap> > m_features.template add<CGAL::Classification::Feature::Simple_feature <Point_set, Pmap> >
(*(m_points->point_set()), pmap.value(), name.c_str()); (*(m_points->point_set()), pmap, name.c_str());
} }
return pmap.has_value(); return okay;
} }
void add_selection_to_training_set (std::size_t label) void add_selection_to_training_set (std::size_t label)
@ -160,8 +166,8 @@ class Point_set_item_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->first_selected(); for (Point_set::const_iterator it = m_points->point_set()->first_selected();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
m_training.value()[*it] = int(label); m_training[*it] = int(label);
m_classif.value()[*it] = int(label); m_classif[*it] = int(label);
} }
m_points->resetSelection(); m_points->resetSelection();
@ -172,8 +178,8 @@ class Point_set_item_classification : public Item_classification_base
{ {
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
if (m_training.value()[*it] == int(label)) if (m_training[*it] == int(label))
m_training.value()[*it] = -1; m_training[*it] = -1;
if (m_index_color == 1 || m_index_color == 2) if (m_index_color == 1 || m_index_color == 2)
change_color (m_index_color); change_color (m_index_color);
} }
@ -182,8 +188,8 @@ class Point_set_item_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->first_selected(); for (Point_set::const_iterator it = m_points->point_set()->first_selected();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
m_training.value()[*it] = -1; m_training[*it] = -1;
m_classif.value()[*it] = -1; m_classif[*it] = -1;
} }
if (m_index_color == 1 || m_index_color == 2) if (m_index_color == 1 || m_index_color == 2)
change_color (m_index_color); change_color (m_index_color);
@ -192,7 +198,7 @@ class Point_set_item_classification : public Item_classification_base
{ {
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
m_training.value()[*it] = -1; m_training[*it] = -1;
if (m_index_color == 1 || m_index_color == 2) if (m_index_color == 1 || m_index_color == 2)
change_color (m_index_color); change_color (m_index_color);
} }
@ -200,7 +206,7 @@ class Point_set_item_classification : public Item_classification_base
{ {
for (Point_set::const_iterator it = m_points->point_set()->first_selected(); for (Point_set::const_iterator it = m_points->point_set()->first_selected();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
m_training.value()[*it] = m_classif.value()[*it]; m_training[*it] = m_classif[*it];
m_points->resetSelection(); m_points->resetSelection();
if (m_index_color == 1 || m_index_color == 2) if (m_index_color == 1 || m_index_color == 2)
@ -223,7 +229,7 @@ class Point_set_item_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int c = m_classif.value()[*it]; int c = m_classif[*it];
if (c == label) if (c == label)
points_item->point_set()->insert (m_points->point_set()->point(*it)); points_item->point_set()->insert (m_points->point_set()->point(*it));
} }
@ -245,7 +251,7 @@ class Point_set_item_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
int c = m_classif.value()[*it]; int c = m_classif[*it];
if (c != -1) if (c != -1)
points_item[c]->point_set()->insert (m_points->point_set()->point(*it)); points_item[c]->point_set()->insert (m_points->point_set()->point(*it));
} }
@ -265,15 +271,15 @@ class Point_set_item_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->end(); ++ it) it != m_points->point_set()->end(); ++ it)
{ {
if (m_training.value()[*it] == int(position)) if (m_training[*it] == int(position))
m_training.value()[*it] = -1; m_training[*it] = -1;
else if (m_training.value()[*it] > int(position)) else if (m_training[*it] > int(position))
m_training.value()[*it] --; m_training[*it] --;
if (m_classif.value()[*it] == int(position)) if (m_classif[*it] == int(position))
m_classif.value()[*it] = -1; m_classif[*it] = -1;
else if (m_classif.value()[*it] > int(position)) else if (m_classif[*it] > int(position))
m_classif.value()[*it] --; m_classif[*it] --;
} }
update_comments_of_point_set_item(); update_comments_of_point_set_item();
} }
@ -358,8 +364,8 @@ class Point_set_item_classification : public Item_classification_base
for (Point_set::const_iterator it = m_points->point_set()->begin(); for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it) it != m_points->point_set()->first_selected(); ++ it)
{ {
m_classif.value()[*it] = indices[*it]; m_classif[*it] = indices[*it];
ground_truth[*it] = m_training.value()[*it]; ground_truth[*it] = m_training[*it];
} }
if (m_index_color == 1 || m_index_color == 2) if (m_index_color == 1 || m_index_color == 2)
@ -390,11 +396,14 @@ class Point_set_item_classification : public Item_classification_base
std::vector<Cluster> m_clusters; std::vector<Cluster> m_clusters;
std::optional<Point_set::Property_map<CGAL::IO::Color>> m_color; Point_set::Property_map<unsigned char> m_red;
Point_set::Property_map<unsigned char> m_green;
Point_set::Property_map<unsigned char> m_blue;
Point_set::Property_map<CGAL::IO::Color> m_color;
std::vector<std::vector<float> > m_label_probabilities; std::vector<std::vector<float> > m_label_probabilities;
std::optional<Point_set::Property_map<int>> m_training; Point_set::Property_map<int> m_training;
std::optional<Point_set::Property_map<int>> m_classif; Point_set::Property_map<int> m_classif;
Generator* m_generator; Generator* m_generator;

View File

@ -15,13 +15,13 @@
Surface_mesh_item_classification::Surface_mesh_item_classification(Scene_surface_mesh_item* mesh) Surface_mesh_item_classification::Surface_mesh_item_classification(Scene_surface_mesh_item* mesh)
: m_mesh (mesh), : m_mesh (mesh),
m_selection (nullptr), m_selection (nullptr),
m_generator (nullptr), m_generator (nullptr)
m_training(m_mesh->polyhedron()->add_property_map<face_descriptor, std::size_t>("f:training", std::size_t(-1)).first),
m_classif(m_mesh->polyhedron()->add_property_map<face_descriptor, std::size_t>("f:label", std::size_t(-1)).first)
{ {
m_index_color = 1; m_index_color = 1;
backup_existing_colors_and_add_new(); backup_existing_colors_and_add_new();
m_training = m_mesh->polyhedron()->add_property_map<face_descriptor, std::size_t>("f:training", std::size_t(-1)).first;
m_classif = m_mesh->polyhedron()->add_property_map<face_descriptor, std::size_t>("f:label", std::size_t(-1)).first;
m_labels.add("ground"); m_labels.add("ground");
m_labels.add("vegetation"); m_labels.add("vegetation");
@ -64,8 +64,8 @@ void Surface_mesh_item_classification::backup_existing_colors_and_add_new()
= m_mesh->polyhedron()->add_property_map<face_descriptor, CGAL::IO::Color>("f:real_color").first; = m_mesh->polyhedron()->add_property_map<face_descriptor, CGAL::IO::Color>("f:real_color").first;
for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
{ {
m_real_color.value()[fd] = m_color.value()[fd]; m_real_color[fd] = m_color[fd];
m_color.value()[fd] = CGAL::IO::Color(128, 128, 128); m_color[fd] = CGAL::IO::Color(128, 128, 128);
} }
} }
else else
@ -77,7 +77,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
{ {
m_index_color = index; m_index_color = index;
int index_color = index; int index_color = index;
if (index == 0 && !m_real_color) if (index == 0 && m_real_color == Mesh::Property_map<face_descriptor, CGAL::IO::Color>())
index_color = -1; index_color = -1;
static Color_ramp ramp; static Color_ramp ramp;
@ -86,12 +86,12 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
if (index_color == -1) // item color if (index_color == -1) // item color
{ {
for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
m_color.value()[fd] = CGAL::IO::Color(128,128,128); m_color[fd] = CGAL::IO::Color(128,128,128);
} }
else if (index_color == 0) // real colors else if (index_color == 0) // real colors
{ {
for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
m_color.value()[fd] = m_real_color.value()[fd]; m_color[fd] = m_real_color[fd];
} }
else if (index_color == 1) // classif else if (index_color == 1) // classif
{ {
@ -103,7 +103,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
if (c != std::size_t(-1)) if (c != std::size_t(-1))
color = label_qcolor (m_labels[c]); color = label_qcolor (m_labels[c]);
m_color.value()[fd] = CGAL::IO::Color(color.red(), color.green(), color.blue()); m_color[fd] = CGAL::IO::Color(color.red(), color.green(), color.blue());
} }
} }
else if (index_color == 2) // training else if (index_color == 2) // training
@ -120,7 +120,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
float div = 1; float div = 1;
if (c != c2) if (c != c2)
div = 2; div = 2;
m_color.value()[fd] = CGAL::IO::Color(color.red() / div, m_color[fd] = CGAL::IO::Color(color.red() / div,
color.green() / div, color.green() / div,
color.blue() / div); color.blue() / div);
} }
@ -135,7 +135,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
{ {
for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
{ {
m_color.value()[fd] = CGAL::IO::Color((unsigned char)(128), m_color[fd] = CGAL::IO::Color((unsigned char)(128),
(unsigned char)(128), (unsigned char)(128),
(unsigned char)(128)); (unsigned char)(128));
} }
@ -145,7 +145,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
{ {
float v = (std::max) (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][fd])); float v = (std::max) (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][fd]));
m_color.value()[fd] = CGAL::IO::Color((unsigned char)(ramp.r(v) * 255), m_color[fd] = CGAL::IO::Color((unsigned char)(ramp.r(v) * 255),
(unsigned char)(ramp.g(v) * 255), (unsigned char)(ramp.g(v) * 255),
(unsigned char)(ramp.b(v) * 255)); (unsigned char)(ramp.b(v) * 255));
} }
@ -189,7 +189,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
if (v < 0.f) v = 0.f; if (v < 0.f) v = 0.f;
if (v > 1.f) v = 1.f; if (v > 1.f) v = 1.f;
m_color.value()[fd] = CGAL::IO::Color((unsigned char)(ramp.r(v) * 255), m_color[fd] = CGAL::IO::Color((unsigned char)(ramp.r(v) * 255),
(unsigned char)(ramp.g(v) * 255), (unsigned char)(ramp.g(v) * 255),
(unsigned char)(ramp.b(v) * 255)); (unsigned char)(ramp.b(v) * 255));
} }

Some files were not shown because too many files have changed in this diff Show More