mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'remotes/orth/orthtree-generalization' into Kinetic_shape_reconstruction-new_package-soesau
This commit is contained in:
commit
b26e22bca8
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsInteroperabilityConcepts
|
||||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
Two types `A` and `B` are a model of the `ExplicitInteroperable`
|
||||
|
|
@ -27,4 +27,3 @@ class ExplicitInteroperable {
|
|||
public:
|
||||
|
||||
}; /* end ExplicitInteroperable */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsFractionsConcepts
|
||||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A type is considered as a `Fraction`, if there is a reasonable way to
|
||||
|
|
@ -17,4 +17,3 @@ class Fraction {
|
|||
public:
|
||||
|
||||
}; /* end Fraction */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsConcepts
|
||||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of the concept `FromDoubleConstructible` is required
|
||||
|
|
@ -27,4 +27,3 @@ FromDoubleConstructible(const double& d);
|
|||
/// @}
|
||||
|
||||
}; /* end FromDoubleConstructible */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsConcepts
|
||||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of the concept `FromIntConstructible` is required
|
||||
|
|
@ -28,4 +28,3 @@ FromIntConstructible(int& i);
|
|||
/// @}
|
||||
|
||||
}; /* end FromIntConstructible */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsInteroperabilityConcepts
|
||||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
Two types `A` and `B` are a model of the concept
|
||||
|
|
@ -29,4 +29,3 @@ class ImplicitInteroperable {
|
|||
public:
|
||||
|
||||
}; /* end ImplicitInteroperable */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,16 @@
|
|||
#ifndef 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_hierarchy_2.h>
|
||||
#include <CGAL/Apollonius_graph_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"
|
||||
|
||||
|
|
@ -839,24 +836,29 @@ bool test_algo_generic(InputStream& is)
|
|||
// 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 );
|
||||
ag.file_output(ofs);
|
||||
ofs.close();
|
||||
|
||||
std::ifstream ifs("ag_testsuite.tmp");
|
||||
std::ifstream ifs(fname);
|
||||
assert( ifs );
|
||||
ag.file_input(ifs);
|
||||
ifs.close();
|
||||
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 );
|
||||
ofs << ag;
|
||||
ofs.close();
|
||||
|
||||
std::ifstream ifs("ag_testsuite.tmp");
|
||||
std::ifstream ifs(fname);
|
||||
assert( ifs );
|
||||
ifs >> ag;
|
||||
ifs.close();
|
||||
|
|
|
|||
|
|
@ -5651,10 +5651,24 @@ must model the basic concept `ArrangementBasicTopologyTraits`. A model
|
|||
of this basic concept holds the (\dcel) data structure used to
|
||||
represent the arrangement cells (i.e., vertices, edges, and facets)
|
||||
and the incidence relations between them. At this point we do not
|
||||
expose the concepts that refine the basic concept. The package
|
||||
contains one topology traits, namely,
|
||||
`Arr_spherical_topology_traits_2`. It can serve as a topology traits
|
||||
for an arrangement embedded on a sphere. More precisely, for an
|
||||
expose the concepts that refine the basic concept. The package
|
||||
contains three topology traits class templates, namely,
|
||||
`Arr_bounded_planar_topology_traits_2`,
|
||||
`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
|
||||
left and right boundary sides of which are identified, and the top and
|
||||
bottom boundary sides are contracted.
|
||||
|
|
|
|||
|
|
@ -26,45 +26,37 @@ one of the integral types above.
|
|||
|
||||
|
||||
*/
|
||||
template< typename Coefficient >
|
||||
template <typename Coefficient>
|
||||
class Arr_algebraic_segment_traits_2 {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Value to specify whether a point should be in the interior
|
||||
of a segment, or its minimal point,
|
||||
or its maximal point in lexicographic order.
|
||||
*/
|
||||
/*! Value to specify whether a point should be in the interior 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 };
|
||||
|
||||
/*!
|
||||
the type for bivariate polynomials,
|
||||
with innermost coefficient type `Coefficient`.
|
||||
Constitutes a model of the concept `Polynomial_d`
|
||||
with two variables.
|
||||
|
||||
\sa `CGAL::Polynomial_d`
|
||||
*/
|
||||
/*! the type for bivariate polynomials, with innermost coefficient type
|
||||
* `Coefficient`. Constitutes a model of the concept `Polynomial_d` with two
|
||||
* variables.
|
||||
*
|
||||
* \sa `CGAL::Polynomial_d`
|
||||
*/
|
||||
typedef unspecified_type Polynomial_2;
|
||||
|
||||
/*!
|
||||
model for the concept
|
||||
`AlgebraicKernel_1`
|
||||
*/
|
||||
/*! model for the concept `AlgebraicKernel_1`
|
||||
*/
|
||||
typedef unspecified_type Algebraic_kernel_1;
|
||||
|
||||
/*!
|
||||
represents coordinates of points.
|
||||
Typedef from `Algebraic_kernel_1::Algebraic_real_1`
|
||||
*/
|
||||
/*! represents coordinates of points.
|
||||
* Typedef from `Algebraic_kernel_1::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;
|
||||
|
||||
/// @}
|
||||
|
|
@ -74,46 +66,41 @@ typedef unspecified_type Bound;
|
|||
|
||||
/*!
|
||||
|
||||
*/
|
||||
*/
|
||||
Construct_curve_2 construct_curve_2_object() const;
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
*/
|
||||
Construct_point_2 construct_point_2_object() const;
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
*/
|
||||
Construct_x_monotone_segment_2 construct_x_monotone_segment_2_object() const;
|
||||
|
||||
/// @}
|
||||
|
||||
/*!
|
||||
|
||||
|
||||
*/
|
||||
*/
|
||||
class Construct_curve_2 {
|
||||
public:
|
||||
|
||||
/// \name Object Creation Functors
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Returns a `Curve_2` object that represents the curve defined by
|
||||
the polynomial `p`
|
||||
*/
|
||||
/*! Returns a `Curve_2` object that represents the curve defined by the
|
||||
* polynomial `p`
|
||||
*/
|
||||
Curve_2 operator() (Polynomial_2 p);
|
||||
|
||||
/*!
|
||||
Returns a `Curve_2` object specified by `s`.
|
||||
The passed string represents the defining polynomial of the curve
|
||||
and must be given in a MAPLE-readable format using "x" as first
|
||||
and "y" as second variable, e.g.,
|
||||
"(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.
|
||||
*/
|
||||
/*! Returns a `Curve_2` object specified by `s`. The passed string represents
|
||||
* the defining polynomial of the curve and must be given in a MAPLE-readable
|
||||
* format using "x" as first and "y" as second variable, e.g.,
|
||||
* \f$(x^3*y-2*x)*(-6*x-y^3*x^6)\f$ for integer coefficients, and
|
||||
* \f$3/2*x*y^4-5/7*x^2+3/1\f$ for rational coefficients.
|
||||
*/
|
||||
Curve_2 operator() (std::string s);
|
||||
|
||||
/// @}
|
||||
|
|
@ -122,49 +109,42 @@ Curve_2 operator() (std::string s);
|
|||
|
||||
/*!
|
||||
|
||||
|
||||
*/
|
||||
*/
|
||||
class Construct_point_2 {
|
||||
public:
|
||||
|
||||
/// \name Object Creation Functors
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Returns a `Point_2` object that represents the `arcno`-th
|
||||
point in the fiber of `cv` at \f$ x\f$-coordinate `x`,
|
||||
counted from the bottom, starting with zero.
|
||||
\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
|
||||
in the fiber of `cv` at `x`.)
|
||||
*/
|
||||
/*! Returns a `Point_2` object that represents the `arcno`-th
|
||||
* point in the fiber of `cv` at \f$ x\f$-coordinate `x`,
|
||||
* counted from the bottom, starting with zero.
|
||||
* \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
|
||||
* in the fiber of `cv` at `x`.)
|
||||
*/
|
||||
Point_2 operator() (Algebraic_real_1 x, Curve_2 cv, int arcno);
|
||||
|
||||
/*!
|
||||
Returns a `Point_2` object that represents the
|
||||
point on `xcv` at \f$ x\f$-coordinate `x`
|
||||
\pre (`x` is in the \f$ x\f$-range of `xcv`.)
|
||||
*/
|
||||
/*! Returns a `Point_2` object that represents the
|
||||
* point on `xcv` at \f$ x\f$-coordinate `x`
|
||||
* \pre (`x` is in the \f$ x\f$-range of `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);
|
||||
|
||||
/*!
|
||||
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);
|
||||
|
||||
/*!
|
||||
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);
|
||||
|
||||
/*!
|
||||
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);
|
||||
|
||||
/// @}
|
||||
|
|
@ -173,91 +153,86 @@ Point_2 operator() (int x, int y);
|
|||
|
||||
/*!
|
||||
|
||||
|
||||
*/
|
||||
*/
|
||||
class Construct_x_monotone_segment_2 {
|
||||
public:
|
||||
|
||||
/// \name Object Creation Functors
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Writes a sequence of `X_monotone_curve_2` objects (terminal
|
||||
segments) into `out`. These terminal segments compose an
|
||||
\f$ x\f$-monotone (or vertical) segment of the curve `cv` that
|
||||
starts in `end_min`, and ends in `end_max`.
|
||||
\pre (`end_min` must have a unique \f$ x\f$-monotone segment
|
||||
to its right, or `end_max` must have a unique
|
||||
\f$ x\f$-monotone segment to its left. Furthermore,
|
||||
`end_min` and `end_max` must be connected
|
||||
by an \f$ x\f$-monotone segment of `cv`)
|
||||
*/
|
||||
template<class OutputIterator> OutputIterator
|
||||
operator() (Curve_2 cv, Point_2 end_min, Point_2 end_max,
|
||||
OutputIterator out);
|
||||
/*! inserts a sequence of `X_monotone_curve_2` objects (terminal segments) into
|
||||
* an output container given through an output iterator. These terminal segments
|
||||
* compose an \f$x\f$-monotone (or vertical) segment of a given curve that
|
||||
* starts in `end_min`, and ends in `end_max`.
|
||||
*
|
||||
* \param cv The input curve.
|
||||
* \param end_min The starting point.
|
||||
* \param end_max The ending point.
|
||||
* \param oi The output iterator that points at the output container.
|
||||
* \return The past-the-end iterator of the output container.
|
||||
*
|
||||
* \pre `end_min` must have a unique \f$x\f$-monotone segment to its right, or
|
||||
* `end_max` must have a unique \f$x\f$-monotone segment to its left.
|
||||
* 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);
|
||||
|
||||
/*!
|
||||
Writes a sequence of `X_monotone_curve_2` objects into `out`.
|
||||
These segments form an \f$ x\f$-monotone (or vertical)
|
||||
segment of the curve `cv`.
|
||||
/*! inserts a sequence of `X_monotone_curve_2` objects into an output container
|
||||
* given through an output iterator. These segments form an \f$x\f$-monotone
|
||||
* (or vertical) 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
|
||||
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<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);
|
||||
/*! inserts a sequence of `X_monotone_curve_2` objects into an output container
|
||||
* 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
|
||||
* \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 <typename OutputIterator>
|
||||
OutputIterator operator() (Point_2 p, Point_2 q, OutputIterator out);
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* 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.
|
||||
In order to use internal caching, instances should only be created
|
||||
using the `Construct_curve_2` functor of the traits class.
|
||||
|
||||
*/
|
||||
/*! Models the `ArrangementTraits_2::Curve_2` concept.
|
||||
* Represents algebraic curves. Internally, the type stores
|
||||
* 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 {
|
||||
public:
|
||||
|
||||
/// \name Modifiers
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the defining polynomial of the curve.
|
||||
/*! returns the defining polynomial of the curve.
|
||||
*/
|
||||
Polynomial_2 polynomial () const;
|
||||
|
||||
|
|
@ -265,124 +240,105 @@ Polynomial_2 polynomial () const;
|
|||
|
||||
}; /* 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 {
|
||||
public:
|
||||
|
||||
/// \name Modifiers
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the \f$ x\f$-coordinate of `p`.
|
||||
*/
|
||||
/*! returns the \f$ x\f$-coordinate of `p`.
|
||||
*/
|
||||
Algebraic_real_1 x () const;
|
||||
|
||||
/*!
|
||||
returns the \f$ y\f$-coordinates of `p`.
|
||||
|
||||
<B>Attention:</B> As described above, points are not stored
|
||||
by their \f$ y\f$-coordinate in `Algebraic_real_1` representation. In fact,
|
||||
this representation must be computed on demand, and might become quite
|
||||
costly for points defined by high-degree polynomials. Therefore, it is
|
||||
recommended to avoid to call this function as much as possible.
|
||||
*/
|
||||
/*! returns the \f$ y\f$-coordinates of `p`.
|
||||
*
|
||||
* <B>Attention:</B> As described above, points are not stored
|
||||
* by their \f$ y\f$-coordinate in `Algebraic_real_1` representation. In fact,
|
||||
* this representation must be computed on demand, and might become quite
|
||||
* costly for points defined by high-degree polynomials. Therefore, it is
|
||||
* recommended to avoid to call this function as much as possible.
|
||||
*/
|
||||
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;
|
||||
|
||||
/*!
|
||||
returns the arc number of `p`.
|
||||
*/
|
||||
/*! returns the arc number of `p`.
|
||||
*/
|
||||
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;
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* 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 in the interior of their \f$ x\f$-range.
|
||||
Terminal segments might either be bounded or unbounded.
|
||||
By definition, each interior point of
|
||||
a non-vertical segment has the same arc number (see the documentation of
|
||||
type `Point_2` above, which is called the <I>arc number</I> 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$,
|
||||
where \f$ p\f$ and \f$ q\f$ are the endpoints, \f$ cv\f$ is the <I>supporting curve</I>
|
||||
that the segment belongs to, and arcno is the arc number of the segment.
|
||||
|
||||
Arbitrary (weakly) \f$ x\f$-monotone segments are presented by a range
|
||||
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.
|
||||
|
||||
*/
|
||||
/*! 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
|
||||
* in the interior of their \f$ x\f$-range. Terminal segments might either be
|
||||
* bounded or unbounded. By definition, each interior point of a non-vertical
|
||||
* segment has the same arc number (see the documentation of type `Point_2`
|
||||
* above, which is called the <I>arc number</I> 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$, where \f$ p\f$ and \f$ q\f$
|
||||
* are the endpoints, \f$ cv\f$ is the <I>supporting curve</I> that the segment
|
||||
* belongs to, and arcno is the arc number of the segment.
|
||||
*
|
||||
* Arbitrary (weakly) \f$ x\f$-monotone segments are presented by a range
|
||||
* 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 {
|
||||
public:
|
||||
|
||||
/// \name Modifiers
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the supporting algebraic curve of `s`.
|
||||
*/
|
||||
/*! returns the supporting algebraic curve of `s`.
|
||||
*/
|
||||
Curve_2 curve () const;
|
||||
|
||||
/*!
|
||||
returns whether `s` is a vertical segment.
|
||||
*/
|
||||
/*! returns whether `s` is a vertical segment.
|
||||
*/
|
||||
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;
|
||||
|
||||
/*!
|
||||
\pre (The corresponding curve end is finite)
|
||||
*/
|
||||
/*! \pre (The corresponding curve end is finite)
|
||||
*/
|
||||
Point_2 curve_end (CGAL::Arr_curve_end ce) const;
|
||||
|
||||
/*!
|
||||
returns the arc number of the segment.
|
||||
\pre (The segment is non-vertical)
|
||||
*/
|
||||
/*! returns the arc number of the segment.
|
||||
* \pre (The segment is non-vertical)
|
||||
*/
|
||||
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 */
|
||||
|
||||
} /* end namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -1,36 +1,38 @@
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgArrangementOnSurface2PointLocation
|
||||
|
||||
Performs a batched point-location operation on a
|
||||
given arrangement. It accepts a range of query points, and locates each
|
||||
point in the arrangement. The query results are returned through the output
|
||||
iterator. Each query result is given as a pair of the query point and an
|
||||
object representing the arrangement feature that contains it, namely a
|
||||
discriminated union container of the bounded types `Face_const_handle`,
|
||||
`Halfedge_const_handle`, and `Vertex_const_hanlde`. The resulting
|
||||
pairs in the output sequence are sorted in increasing \f$ xy\f$-lexicographical
|
||||
order of the query points. The function returns a past-the-end iterator of
|
||||
the output sequence.
|
||||
|
||||
\cgalHeading{Requirements}
|
||||
|
||||
<UL>
|
||||
<LI>`InputIterator::value_type` must be `Arrangement_2::Point_2`.
|
||||
<LI>`OutputIterator::value_type` must be convertible to
|
||||
`std::pair<Arrangement_2::Point_2, Arr_point_location_result<Arrangement_2>::%Type>`.
|
||||
</UL>
|
||||
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
|
||||
*/
|
||||
template<typename Traits, typename Dcel,
|
||||
/*! \ingroup PkgArrangementOnSurface2PointLocation
|
||||
*
|
||||
* performs a batched point-location operation on a given arrangement. It
|
||||
* accepts a collection of query points, locates each point in a given
|
||||
* arrangement, and inserts the query results into an output container given
|
||||
* through an output iterator. Each query result is given as a pair of the query
|
||||
* point and an object representing the arrangement feature that contains it,
|
||||
* namely a discriminated union container of the types `Face_const_handle`,
|
||||
* `Halfedge_const_handle`, and `Vertex_const_hanlde`. The resulting pairs in
|
||||
* the output container are sorted in increasing \f$xy\f$-lexicographical order
|
||||
* of the query points.
|
||||
*
|
||||
* \param arr The arrangement.
|
||||
* \param begin The begin iterator of the container of input points.
|
||||
* \param end The past-the-end iterator of the container of input points.
|
||||
* \param oi The output iterator that points at the output container.
|
||||
* \return The past-the-end iterator of the output container.
|
||||
*
|
||||
* \cgalHeading{Requirements}
|
||||
*
|
||||
* \pre The value type of `InputIterator` must be convertible to
|
||||
* `Arrangement_2::Point_2`.
|
||||
* \pre Dereferencing `oi` must yield an object convertible to
|
||||
* `std::pair<Arrangement_2::Point_2, Arr_point_location_result<Arrangement_2>::%Type>`.
|
||||
*
|
||||
* \sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
*
|
||||
*/
|
||||
template <typename Traits, typename Dcel,
|
||||
typename InputIterator, typename OutputIterator>
|
||||
OutputIterator locate (const Arrangement_2<Traits,Dcel>& arr,
|
||||
InputIterator points_begin,
|
||||
InputIterator points_end,
|
||||
OutputIterator oi);
|
||||
OutputIterator locate (const Arrangement_2<Traits, Dcel>& arr,
|
||||
InputIterator begin,
|
||||
InputIterator end,
|
||||
OutputIterator oi);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
||||
|
|
|
|||
|
|
@ -467,20 +467,23 @@ public:
|
|||
*/
|
||||
Approximate_point_2 operator()(const Point_2& p) const;
|
||||
|
||||
/*! Obtain a polyline that approximates an \f$x\f$-monotone curve. The
|
||||
* polyline is defined by a range of approximate points beginning at
|
||||
* `oi`. The type `OutputIterator` must dereference the type
|
||||
* `Approximate_point_2`. The first and last points in the range are always
|
||||
* the endpoints of the given arc `xcv`. The operator returns a
|
||||
* past-the-end iterator of the destination range.
|
||||
* \param oi An output iterator for the resulting polyline.
|
||||
* \param error The error bound of the polyline approximation. This is
|
||||
* the Hausdorff distance between the arc and the polyline
|
||||
* that approximates the arc.
|
||||
/*! approximates a given \f$x\f$-monotone curve. It computes a sequence of
|
||||
* approximate points that represent an approximate polyline, and inserts
|
||||
* them into an output container given through an output iterator. The
|
||||
* first and last points in the sequence are always approximations of the
|
||||
* endpoints of the given arc.
|
||||
*
|
||||
* \param oi An output iterator for the output container.
|
||||
* \param error The error bound of the polyline approximation. This is the
|
||||
* Hausdorff distance between the arc and the polyline that
|
||||
* approximates the arc.
|
||||
* \param xcv The exact \f$x\f$-monotone arc.
|
||||
* \param l2r A Boolean flag that indicates whether the arc direction is
|
||||
* left to right.
|
||||
* \return The past-the-end iterator of the output iterator.
|
||||
* left to right.
|
||||
* \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>
|
||||
OutputIterator operator()(OutputIterator oi, double error,
|
||||
|
|
@ -521,7 +524,7 @@ public:
|
|||
Trim_2 trim_2_object() const;
|
||||
|
||||
/*! Obtain an `Approximate_2` functor. */
|
||||
Trim_2 approximate_2_object() const;
|
||||
Approximate_2 approximate_2_object() const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,28 @@
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgArrangementOnSurface2PointLocation
|
||||
|
||||
A unary metafunction to determine the return type of a point-location
|
||||
or vertical ray-shoot query.
|
||||
|
||||
\tparam Arrangement must be an instance of the `CGAL::Arrangement_2<Traits,Dcel>` class template.
|
||||
|
||||
\sa `ArrangementPointLocation_2`
|
||||
\sa `ArrangementVerticalRayShoot_2`
|
||||
\sa `CGAL::Arr_naive_point_location<Arrangement>`
|
||||
\sa `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
||||
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
||||
\sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
||||
*/
|
||||
template <class Arrangement>
|
||||
/*! \ingroup PkgArrangementOnSurface2PointLocation
|
||||
*
|
||||
* A unary metafunction to determine the return type of a point-location or
|
||||
* vertical ray-shoot query.
|
||||
*
|
||||
* \tparam Arrangement must be an instance of the
|
||||
* `CGAL::Arrangement_on_surface_2<GeometryTraits,Topology>` class template.
|
||||
*
|
||||
* \sa `ArrangementPointLocation_2`
|
||||
* \sa `ArrangementVerticalRayShoot_2`
|
||||
* \sa `CGAL::Arr_naive_point_location<Arrangement>`
|
||||
* \sa `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
||||
* \sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
||||
* \sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
||||
*/
|
||||
template <typename Arrangement>
|
||||
struct Arr_point_location_result
|
||||
{
|
||||
/*! The type of the arrangement feature that is the result of a
|
||||
* 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;
|
||||
}; /* end Arr_point_location_result */
|
||||
|
||||
} /* end namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -238,17 +238,22 @@ namespace CGAL {
|
|||
const Point_2& tgt) const;
|
||||
};
|
||||
|
||||
/*! Subdivide a given subcurve into x-monotone subcurves and insert them
|
||||
* into a given output iterator.
|
||||
/*! Subdivide a given subcurve into \f$x\f$-monotone subcurves and
|
||||
* 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 {
|
||||
public:
|
||||
/*!
|
||||
* \pre if `cv` is not empty then it must be continuous and well-oriented.
|
||||
/*! performs the subdivision.
|
||||
*
|
||||
* \param cv the subcurve.
|
||||
* \param oi an output iterator for the result. Its value type is a variant
|
||||
* that wraps Point_2 or an X_monotone_curve_2 objects.
|
||||
* \return the past-the-end iterator.
|
||||
* \param oi The output iterator that points at the output container.
|
||||
* \return the past-the-end iterator of the output container.
|
||||
*
|
||||
* \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>
|
||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const;
|
||||
|
|
|
|||
|
|
@ -2,51 +2,51 @@ namespace CGAL {
|
|||
|
||||
/*! \ingroup PkgArrangementOnSurface2Funcs
|
||||
*
|
||||
* Produces the symbolic vertical decomposition of a given arrangement,
|
||||
* performing a batched vertical ray-shooting query from all arrangement
|
||||
* vertices, such that every vertex is associated with a pair of objects, one
|
||||
* corresponds to the arrangement feature that lies below it, and the other
|
||||
* corresponds to the feature that lies above it. The output of this function
|
||||
* 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 a given arrangement. More
|
||||
* precisely, this function performs a batched vertical ray-shooting query from
|
||||
* every arrangement vertex, and pairs each vertex with a pair of polymorphic
|
||||
* objects, one corresponds to the arrangement feature that lies below it, and
|
||||
* the other corresponds to the feature that lies above it.
|
||||
*
|
||||
* Produces the symbolic vertical decomposition of the `arr` arrangement. More
|
||||
* precisely, it performs a batched vertical ray-shooting query from all
|
||||
* arrangement vertices, such that every vertex is associated with a pair of
|
||||
* objects, one corresponding to the arrangement feature that lies below it,
|
||||
* 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
|
||||
* The finite arrangement vertices and the features they "see", if exist,
|
||||
* that are, the query results, are inserted in ascending \f$xy\f$-lexicographic
|
||||
* order (of the query vertex) into an output container given through an output
|
||||
* iterator. 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
|
||||
* vertical edge, we say that there is no feature above it. In these cases the
|
||||
* optional object is set to be empty; otherwise it is set as follows:
|
||||
* vertical edge, we say that there is no feature above it. Each feature, if
|
||||
* exists, is represented by a discriminated union container that holds an
|
||||
* object of one of the following types:
|
||||
*
|
||||
* <UL>
|
||||
* <LI>`Halfedge_const_handle`, if the vertex is located above (or below) an
|
||||
* edge. The given halfedge is always directed from right to left. In case
|
||||
* there is no concrete edge below (or above) the vertex, and the arrangement
|
||||
* is unbounded, then the object returned is a <I>fictitious</I> halfedge.
|
||||
* <LI>`Face_const_handle`, in case there is no edge below (or above)
|
||||
* the vertex, and the arrangement is bounded.
|
||||
* <LI>`Vertex_const_handle`, in case the vertex is located vertically above
|
||||
* (or below) another arrangement vertex.
|
||||
* </UL> The function returns a past-the-end iterator for its output sequence.
|
||||
* <LI> `Arrangement_on_surface_2::Halfedge_const_handle`, if the vertex is
|
||||
* located above (or below) an edge. The given halfedge is always directed
|
||||
* from right to left. In case there is no concrete edge below (or above)
|
||||
* the vertex, and the arrangement is unbounded, then the object returned
|
||||
* is a <I>fictitious</I> halfedge.
|
||||
* <LI> `Arrangement_on_surface_2::Face_const_handle`, in case there is no edge
|
||||
* below (or above) the vertex, and the arrangement is bounded.
|
||||
* <LI> `Arrangement_on_surface_2::Vertex_const_handle`, in case the vertex is
|
||||
* 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}
|
||||
*
|
||||
* `OutputIterator::value_type` must be
|
||||
* `pair<Arrangement_2::Vertex_const_handle, pair<Object, Object> >`.
|
||||
*
|
||||
* \pre Dereferencing `oi` must yield an object of type
|
||||
* `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,
|
||||
typename OutputIterator>
|
||||
OutputIterator decompose (const Arrangement_2<Traits,Dcel>& arr,
|
||||
OutputIterator oi);
|
||||
template <typename Traits, typename TopologyTraits, typename OutputIterator>
|
||||
OutputIterator
|
||||
decompose(const Arrangement_on_surface_2<GeometryTraits,TopologyTraits>& arr,
|
||||
OutputIterator oi);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -160,12 +160,12 @@ public:
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
/*! \ingroup PkgArrangementOnSurface2Insert insert 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 inserted curves. If an
|
||||
* inserted curve is not \f$ x\f$-monotone curve, it is subdivided into \f$
|
||||
* x\f$-monotone subcurves (and perhaps isolated points), which are inserted
|
||||
* into the arrangement.
|
||||
/*! \ingroup PkgArrangementOnSurface2Insert
|
||||
* 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 inserted
|
||||
* curves. If an inserted curve is not \f$ x\f$-monotone curve, it is subdivided
|
||||
* into \f$ x\f$-monotone subcurves (and perhaps isolated points), which are
|
||||
* inserted into the arrangement.
|
||||
*
|
||||
* \cgalHeading{Requirements}
|
||||
*
|
||||
|
|
@ -379,37 +379,4 @@ template <typename Traits, typename Dcel>
|
|||
bool remove_vertex(Arrangement_2<Traits,Dcel>& arr,
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ namespace CGAL {
|
|||
* \sa `Arr_default_dcel<Traits>`
|
||||
* \sa `ArrangementBasicTraits_2`
|
||||
* \sa `CGAL::overlay()`
|
||||
* \sa `CGAL::is_valid()`
|
||||
|
||||
* Insertion Functions
|
||||
|
||||
|
|
@ -1014,7 +1013,7 @@ public:
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
/*! \ingroup PkgArrangementOnSurface2Insert insert
|
||||
/*! \ingroup PkgArrangementOnSurface2Insert
|
||||
* 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
|
||||
* inserted curves. If an inserted curve is not \f$ x\f$-monotone curve, it is
|
||||
|
|
@ -1295,38 +1294,43 @@ bool remove_vertex
|
|||
|
||||
/*! \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.
|
||||
* computes the zone of the given \f$x\f$-monotone curve in a given
|
||||
* arrangement. More precisely, this function finds the arrangement vertices,
|
||||
* edges ,and faces that the given \f$x\f$-monotone curve intersects, and
|
||||
* inserts them in the order they are discovered when traversing the
|
||||
* \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
|
||||
* 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,
|
||||
* TopologyTraits> >`.
|
||||
* TopologyTraits>>`.
|
||||
*
|
||||
* Compute the zone of the given \f$ x\f$-monotone curve `c` in the arrangement
|
||||
* `arr`.
|
||||
* \param arr The given arrangement.
|
||||
* \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 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}
|
||||
*
|
||||
* <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,
|
||||
typename OutputIterator, typename PointLocation>
|
||||
OutputIterator zone
|
||||
(Arrangement_on_surface_2<GeometryTraits, TopologyTraits>& arr,
|
||||
const typename GeometryTraits::X_monotone_curve_2& c,
|
||||
OutputIterator oi,
|
||||
const PointLocation& pl);
|
||||
OutputIterator
|
||||
zone(Arrangement_on_surface_2<GeometryTraits, TopologyTraits>& arr,
|
||||
const typename GeometryTraits::X_monotone_curve_2& c,
|
||||
OutputIterator oi,
|
||||
const PointLocation& pl);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
@ -16,26 +16,33 @@ public:
|
|||
/// A model of this concept must provide:
|
||||
/// @{
|
||||
|
||||
/*! computes the intersections of `xc1` and `xc2` and writes them <I>in an
|
||||
* ascending lexicographic \f$xy\f$-order</I> into a range beginning at
|
||||
* `oi`. The type `OutputIterator` must dereference a polymorphic object of
|
||||
* type `std::variant` that wraps objects of type either type
|
||||
* `pair<ArrTraits::Point_2, ArrTraits::Multiplicity>` or
|
||||
* `ArrTraits::X_monotone_curve_2`. An object of the former type represents an
|
||||
* intersection point with its multiplicity (in case the multiplicity is
|
||||
* 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.
|
||||
/*! computes the intersections of two \f$x\f$-monotone curves and inserts the
|
||||
* result in ascending \f$xy\f$-lexicographic order into an output container
|
||||
* given through an output iterator. An intersection, if exists, is
|
||||
* represented by a discriminated union container that holds either an
|
||||
* intersection point along with its multiplicity or an overlapping
|
||||
* \f$x\f$-monotone subcurve. If the multiplicity is undefined or unknown, it
|
||||
* should be set to \f$0\f$.
|
||||
*
|
||||
* A special case may occur when the parameter space of the surface, the
|
||||
* arrangement is embedded on, is identified on the left and right sides of
|
||||
* the boundary. An intersection point that lies on the identification curve,
|
||||
* \param xc1 The first \f$x\f$-monotone curve.
|
||||
* \param xc2 The second \f$x\f$-monotone 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
|
||||
* 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
|
||||
* the identification curve. If, for example, the number of intersections
|
||||
* 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>
|
||||
OutputIterator operator()(ArrTraits::X_monotone_curve_2 xc1,
|
||||
|
|
|
|||
|
|
@ -15,12 +15,20 @@ public:
|
|||
/// A model of this concept must provide:
|
||||
/// @{
|
||||
|
||||
/*! subdivides the input curve `c` into \f$x\f$-monotone subcurves and
|
||||
* isolated points, and inserts the results into a range beginning at the given
|
||||
* output iterator `oi`. The type `OutputIterator` dereferences a
|
||||
* `std::variant` that wraps either an `ArrTraits::Point_2` object or an
|
||||
* `ArrTraits::X_monotone_curve_2` object. The operator returns a past-the-end
|
||||
* iterator for the output sequence.
|
||||
/*! subdivides an input curve into \f$x\f$-monotone subcurves and isolated
|
||||
* points, and inserts the results into an output container given through an
|
||||
* output iterator. 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.
|
||||
*
|
||||
* \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>
|
||||
OutputIterator operator()(ArrTraits::Curve_2 c, OutputIterator oi);
|
||||
|
|
|
|||
|
|
@ -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_unb_planar_topology_traits_2<GeometryTraits_2,Dcel>`
|
||||
- `CGAL::Arr_spherical_topology_traits_2<GeometryTraits_2,Dcel>`
|
||||
- `CGAL::CORE_algebraic_number_traits`
|
||||
|
||||
\cgalCRPSection{Functions}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ int main() {
|
|||
Point(1, 4), Point(4, 3), Point(6, 3), Point(3, 2), Point(5, 2), Point(1, 0)
|
||||
};
|
||||
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.
|
||||
for (auto it = results.begin(); it != results.end(); ++it)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#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 <CGAL/graph_traits_Arrangement_2.h>
|
||||
|
|
|
|||
|
|
@ -736,13 +736,13 @@ public:
|
|||
swallow(is, '(');
|
||||
|
||||
// read values
|
||||
is >> iformat(rep._m_xy);
|
||||
is >> IO::iformat(rep._m_xy);
|
||||
swallow(is, ',');
|
||||
is >> iformat(rep._m_x);
|
||||
is >> IO::iformat(rep._m_x);
|
||||
swallow(is, ',');
|
||||
is >> iformat(rep._m_curve);
|
||||
is >> IO::iformat(rep._m_curve);
|
||||
swallow(is, ',');
|
||||
is >> iformat(rep._m_arcno);
|
||||
is >> IO::iformat(rep._m_arcno);
|
||||
swallow(is, ',');
|
||||
is >> rep._m_location;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <CGAL/Arr_extended_dcel.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>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <CGAL/graph_traits_Arrangement_2.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>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.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>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include <CGAL/Triangulation_vertex_base_with_id_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>
|
||||
|
||||
|
|
|
|||
|
|
@ -102,10 +102,10 @@ public:
|
|||
|
||||
// Construct the graph
|
||||
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));
|
||||
VCM vcm = choose_parameter<VCM>(get_parameter(np, internal_np::vertex_color_map));
|
||||
VTM vtm = choose_parameter<VTM>(get_parameter(np, internal_np::vertex_texture_map));
|
||||
FCM fcm = choose_parameter<FCM>(get_parameter(np, internal_np::face_color_map));
|
||||
VNM vnm = choose_parameter(get_parameter(np, internal_np::vertex_normal_map), VNM());
|
||||
VCM vcm = choose_parameter(get_parameter(np, internal_np::vertex_color_map), VCM());
|
||||
VTM vtm = choose_parameter(get_parameter(np, internal_np::vertex_texture_map), VTM());
|
||||
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_colors = (is_vcm_requested && !(vertex_colors.empty()));
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -24,10 +24,10 @@ template < class TriangleMesh,
|
|||
class VertexPointMap = typename boost::property_map<TriangleMesh,vertex_point_t>::type >
|
||||
struct Triangle_from_face_descriptor_map{
|
||||
typename std::remove_const_t<TriangleMesh>* m_tm;
|
||||
std::optional<VertexPointMap> m_vpm;
|
||||
VertexPointMap m_vpm;
|
||||
|
||||
Triangle_from_face_descriptor_map()
|
||||
: m_tm(nullptr), m_vpm()
|
||||
: m_tm(nullptr)
|
||||
{}
|
||||
|
||||
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);
|
||||
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)),
|
||||
get(pmap.m_vpm.value(), target(next(halfedge(f,tm),tm),tm)),
|
||||
get(pmap.m_vpm.value(), source(halfedge(f,tm),tm)) );
|
||||
return value_type( get(pmap.m_vpm, target(halfedge(f,tm),tm)),
|
||||
get(pmap.m_vpm, target(next(halfedge(f,tm),tm),tm)),
|
||||
get(pmap.m_vpm, source(halfedge(f,tm),tm)) );
|
||||
}
|
||||
|
||||
inline friend
|
||||
|
|
@ -71,9 +71,9 @@ struct Triangle_from_face_descriptor_map{
|
|||
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));
|
||||
|
||||
return value_type( get(pmap.m_vpm.value(), target(halfedge(f.first,tm),tm)),
|
||||
get(pmap.m_vpm.value(), target(next(halfedge(f.first,tm),tm),tm)),
|
||||
get(pmap.m_vpm.value(), source(halfedge(f.first,tm),tm)) );
|
||||
return value_type( get(pmap.m_vpm, target(halfedge(f.first,tm),tm)),
|
||||
get(pmap.m_vpm, target(next(halfedge(f.first,tm),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{
|
||||
|
||||
Segment_from_edge_descriptor_map()
|
||||
: m_pm(nullptr), m_vpm()
|
||||
: m_pm(nullptr)
|
||||
{}
|
||||
|
||||
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;
|
||||
//data
|
||||
std::remove_const_t<PolygonMesh>* m_pm;
|
||||
std::optional<VertexPointMap> m_vpm;
|
||||
VertexPointMap m_vpm;
|
||||
|
||||
//get function for property map
|
||||
inline friend
|
||||
|
|
@ -113,8 +113,8 @@ struct Segment_from_edge_descriptor_map{
|
|||
get(const Segment_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap,
|
||||
key_type h)
|
||||
{
|
||||
return value_type(get(pmap.m_vpm.value(), source(h, *pmap.m_pm) ),
|
||||
get(pmap.m_vpm.value(), target(h, *pmap.m_pm) ) );
|
||||
return value_type(get(pmap.m_vpm, source(h, *pmap.m_pm) ),
|
||||
get(pmap.m_vpm, target(h, *pmap.m_pm) ) );
|
||||
}
|
||||
|
||||
inline friend
|
||||
|
|
@ -122,8 +122,8 @@ struct Segment_from_edge_descriptor_map{
|
|||
get(const Segment_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap,
|
||||
const std::pair<key_type, const PolygonMesh*>& h)
|
||||
{
|
||||
return value_type(get(pmap.m_vpm.value(), source(h.first, *pmap.m_pm) ),
|
||||
get(pmap.m_vpm.value(), target(h.first, *pmap.m_pm) ) );
|
||||
return value_type(get(pmap.m_vpm, source(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 >
|
||||
struct 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)
|
||||
|
|
@ -146,7 +146,7 @@ struct One_point_from_face_descriptor_map{
|
|||
{}
|
||||
|
||||
std::remove_const_t<PolygonMesh>* m_pm;
|
||||
std::optional<VertexPointMap> m_vpm;
|
||||
VertexPointMap m_vpm;
|
||||
|
||||
//classical typedefs
|
||||
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,
|
||||
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
|
||||
|
|
@ -168,7 +168,7 @@ struct One_point_from_face_descriptor_map{
|
|||
get(const One_point_from_face_descriptor_map<PolygonMesh,VertexPointMap>& m,
|
||||
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,
|
||||
class VertexPointMap = typename boost::property_map<PolygonMesh,vertex_point_t>::type >
|
||||
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)
|
||||
|
|
@ -197,7 +197,7 @@ struct Source_point_from_edge_descriptor_map{
|
|||
|
||||
//data
|
||||
std::remove_const_t<PolygonMesh>* m_pm;
|
||||
std::optional<VertexPointMap> m_vpm;
|
||||
VertexPointMap m_vpm;
|
||||
|
||||
//get function for property map
|
||||
inline friend
|
||||
|
|
@ -205,7 +205,7 @@ struct Source_point_from_edge_descriptor_map{
|
|||
get(const Source_point_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap,
|
||||
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
|
||||
|
|
@ -213,7 +213,7 @@ struct Source_point_from_edge_descriptor_map{
|
|||
get(const Source_point_from_edge_descriptor_map<PolygonMesh,VertexPointMap>& pmap,
|
||||
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) );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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 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
|
||||
uses the `handle` and the global `triangles` vector to
|
||||
calculate the triangle numbers. Then it checks the triangles
|
||||
|
|
@ -480,4 +480,3 @@ however, we learned too late about this implementation.
|
|||
|
||||
*/
|
||||
} /* namespace CGAL */
|
||||
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ Box_traits_d();
|
|||
|
||||
|
||||
/*!
|
||||
\ingroup PkgBoxIntersectionDFunctions
|
||||
\ingroup PkgBoxIntersectionDEnums
|
||||
*/
|
||||
enum Setting { COMPLETE, BIPARTITE };
|
||||
|
||||
/*!
|
||||
\ingroup PkgBoxIntersectionDFunctions
|
||||
\ingroup PkgBoxIntersectionDEnums
|
||||
*/
|
||||
enum Topology { HALF_OPEN, CLOSED };
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
/// \defgroup PkgBoxIntersectionDConcepts Concepts
|
||||
/// \ingroup PkgBoxIntersectionDRef
|
||||
|
||||
/// \defgroup PkgBoxIntersectionDEnums Enumerations
|
||||
/// \ingroup PkgBoxIntersectionDRef
|
||||
|
||||
/// \defgroup PkgBoxIntersectionDClasses Classes
|
||||
/// \ingroup PkgBoxIntersectionDRef
|
||||
|
||||
|
|
@ -43,6 +46,10 @@
|
|||
- `BoxIntersectionBox_d`
|
||||
- `BoxIntersectionTraits_d`
|
||||
|
||||
\cgalCRPSection{Enumerations}
|
||||
- `CGAL::Box_intersection_d::Setting`
|
||||
- `CGAL::Box_intersection_d::Topology`
|
||||
|
||||
\cgalCRPSection{Classes}
|
||||
- `CGAL::Box_intersection_d::Box_d<NT,int D,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`
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ STL_Extension
|
|||
Algebraic_foundations
|
||||
Circulator
|
||||
Stream_support
|
||||
Polyhedron
|
||||
|
|
|
|||
|
|
@ -102,12 +102,14 @@ collinearC3(const FT &px, const FT &py, const FT &pz,
|
|||
FT dqx = qx-rx;
|
||||
FT dpy = py-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;
|
||||
FT dpz = pz-rz;
|
||||
FT dqz = qz-rz;
|
||||
return CGAL_AND( sign_of_determinant(dpx, dqx, dpz, dqz) == ZERO ,
|
||||
sign_of_determinant(dpy, dqy, dpz, dqz) == ZERO );
|
||||
return is_zero & CGAL_AND( sign_of_determinant(dpx, dqx, dpz, dqz) == ZERO ,
|
||||
sign_of_determinant(dpy, dqy, dpz, dqz) == ZERO );
|
||||
}
|
||||
|
||||
template < class FT >
|
||||
|
|
|
|||
|
|
@ -34,11 +34,7 @@
|
|||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/ptr_container/ptr_vector.hpp>
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#if BOOST_VERSION >= 104700
|
||||
# include <boost/random/uniform_int_distribution.hpp>
|
||||
#else
|
||||
# include <boost/random/uniform_int.hpp>
|
||||
#endif
|
||||
#include <boost/random/uniform_int_distribution.hpp>
|
||||
#include <boost/random/uniform_01.hpp>
|
||||
#include <boost/random/normal_distribution.hpp>
|
||||
#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;
|
||||
|
||||
#if BOOST_VERSION >= 104700
|
||||
typedef boost::random::uniform_int_distribution<> UniformIntDist;
|
||||
typedef boost::random::normal_distribution<> NormalDist;
|
||||
typedef boost::random::mt19937 RandomGen;
|
||||
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 {
|
||||
size_t n_classes;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ private:
|
|||
using Image_bool = Image<bool>;
|
||||
|
||||
const PointRange* m_points;
|
||||
std::optional<PointMap> m_point_map;
|
||||
PointMap m_point_map;
|
||||
Iso_cuboid_3 m_bbox;
|
||||
float m_resolution;
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ public:
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -356,7 +356,7 @@ public:
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class Point_set_neighborhood
|
|||
using key_type = std::uint32_t;
|
||||
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)
|
||||
: 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>;
|
||||
|
||||
std::shared_ptr<Tree> m_tree;
|
||||
std::optional<Distance> m_distance;
|
||||
Distance m_distance;
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -300,7 +300,7 @@ private:
|
|||
void k_neighbors (const Point& query, const unsigned int k, OutputIterator output) const
|
||||
{
|
||||
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)
|
||||
*(output ++) = it->first;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
Face_descriptor_to_center_of_mass_map ()
|
||||
: m_mesh (nullptr) { }
|
||||
Face_descriptor_to_center_of_mass_map (const FaceGraph* mesh)
|
||||
: m_mesh (mesh), m_vpm (get (vertex_point, *m_mesh)) { }
|
||||
Face_descriptor_to_center_of_mass_map (const FaceGraph* mesh, VertexPointMap vpm)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
The code of this package is inspired by Moka, a 3D topological modeler mainly developed by Frédé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é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ä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édé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é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ä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 */
|
||||
|
|
|
|||
|
|
@ -148,6 +148,10 @@ namespace CGAL {
|
|||
{ return mmap.mdarts.is_used(i); }
|
||||
bool owns(size_type i) const
|
||||
{ return mmap.mdarts.owns(i); }
|
||||
size_type capacity() const
|
||||
{ return mmap.mdarts.capacity(); }
|
||||
size_type upper_bound() const
|
||||
{ return mmap.mdarts.upper_bound(); }
|
||||
private:
|
||||
Self & mmap;
|
||||
};
|
||||
|
|
@ -444,7 +448,7 @@ namespace CGAL {
|
|||
(mattribute_containers).upper_bound();
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// Set the handle on the i th attribute
|
||||
template<unsigned int i>
|
||||
void basic_set_dart_attribute(Dart_descriptor dh,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ then the default traits class of `::convex_hull_3()` is `Convex_hull_traits_3<R>
|
|||
\cgalHeading{Implementation}
|
||||
|
||||
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}.
|
||||
|
||||
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -238,9 +238,10 @@ in \cgal programs, the executables should be linked with the CMake
|
|||
imported target `CGAL::LASLIB_support` provided in
|
||||
`CGAL_LASLIB_support.cmake`.
|
||||
|
||||
The \laslib web site is <a
|
||||
href="https://rapidlasso.com/lastools/">`https://rapidlasso.com/lastools/`</a>. \laslib
|
||||
is usually distributed along with LAStools: for simplicity, \cgal
|
||||
\laslib information can be obtained from
|
||||
<a href="https://lastools.github.io/">https://lastools.github.io/</a> and
|
||||
<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
|
||||
CMake based install procedure</a>.
|
||||
|
||||
|
|
|
|||
|
|
@ -276,8 +276,8 @@ dependencies.
|
|||
\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.
|
||||
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**)
|
||||
that contains dlls files that must be placed in the same directory as the `.exe` of the demo.
|
||||
A link is provided in the column on the right, to download an archive. It contains the demo executable itself,
|
||||
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.
|
||||
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@
|
|||
, pages = "617--625"
|
||||
, note = "SIGGRAPH '2005 Conference Proceedings"
|
||||
, volume = 24
|
||||
, url = "https://hal.inria.fr/inria-00226418"
|
||||
, url = "https://inria.hal.science/inria-00226418"
|
||||
, geombib = "not yet"
|
||||
}
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ Pion and Monique Teillaud and Mariette Yvinec"
|
|||
@ARTICLE{cgal:bdt-hdcvd-14,
|
||||
AUTHOR = {Mikhail Bogdanov and Olivier Devillers and Monique Teillaud},
|
||||
JOURNAL = {Journal of Computational Geometry},
|
||||
NOTE = {https://hal.inria.fr/hal-00961390},
|
||||
NOTE = {https://inria.hal.science/hal-00961390},
|
||||
PAGES = {56--85},
|
||||
TITLE = {Hyperbolic {Delaunay} complexes and {Voronoi} diagrams made practical},
|
||||
VOLUME = {5},
|
||||
|
|
@ -243,7 +243,7 @@ Pion and Monique Teillaud and Mariette Yvinec"
|
|||
Boissonnat}
|
||||
, title = {Mesh Generation from 3D Multi-material Images}
|
||||
, pages = {283--290}
|
||||
, url = "https://hal.inria.fr/inria-00420228"
|
||||
, url = "https://inria.hal.science/inria-00420228"
|
||||
, x-international-audience = "yes"
|
||||
, x-proceedings = "yes"
|
||||
}
|
||||
|
|
@ -257,7 +257,7 @@ Boissonnat}
|
|||
, pages = "1455-14645"
|
||||
, volume = 28
|
||||
, year = 2009
|
||||
, url = "https://hal.inria.fr/inria-00413248"
|
||||
, url = "https://inria.hal.science/inria-00413248"
|
||||
, x-international-audience = "yes"
|
||||
, x-editorial-board = "yes"
|
||||
}
|
||||
|
|
@ -338,7 +338,7 @@ Boissonnat}
|
|||
,title = "{PLY} - Polygon File Format"
|
||||
,howpublished = {Paul Bourke}
|
||||
,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},
|
||||
YEAR = {2016},
|
||||
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}"
|
||||
,address = "France"
|
||||
,year = 2010
|
||||
,url = "https://tel.archives-ouvertes.fr/tel-00552215/"
|
||||
,url = "https://theses.hal.science/tel-00552215/"
|
||||
}
|
||||
|
||||
@inproceedings{cgal:ccplr-redtp-10,
|
||||
|
|
@ -539,13 +539,13 @@ note="Conference version: Symp. on Geometry Processing 2003"
|
|||
@inproceedings{ cgal:ct-c3pt-09
|
||||
, title = "Computing {3D} Periodic Triangulations"
|
||||
, author = "Manuel Caroli and Monique Teillaud"
|
||||
, booktitle = "Proceedings 17th European Symposium on Algorithms"
|
||||
, nickname = "ESA'09"
|
||||
, booktitle = "Proceedings 17th European Symposium on Algorithms"
|
||||
, nickname = "ESA'09"
|
||||
, series = "Lecture Notes in Computer Science"
|
||||
, year = 2009
|
||||
, volume = 5757
|
||||
, 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,
|
||||
|
|
@ -729,7 +729,7 @@ Mourrain and Monique Teillaud"
|
|||
|
||||
@article{cgal:dmsl-ssmrp-11,
|
||||
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},
|
||||
journal = {Computer Graphics Forum},
|
||||
year = {2011},
|
||||
|
|
@ -741,13 +741,13 @@ Mourrain and Monique Teillaud"
|
|||
}
|
||||
|
||||
@inproceedings{ cgal:dp-eegpd-03
|
||||
, author = "Olivier Devillers and Sylvain Pion"
|
||||
, title = "Efficient Exact Geometric Predicates for {Delaunay} Triangulations"
|
||||
, booktitle = "Proc. 5th Workshop Algorithm Eng. Exper."
|
||||
, nickname = "ALENEX '03"
|
||||
, year = 2003
|
||||
, pages = "37--44"
|
||||
, url = "https://hal.inria.fr/inria-00344517/"
|
||||
, author = "Olivier Devillers and Sylvain Pion"
|
||||
, title = "Efficient Exact Geometric Predicates for {Delaunay} Triangulations"
|
||||
, booktitle = "Proc. 5th Workshop Algorithm Eng. Exper."
|
||||
, nickname = "ALENEX '03"
|
||||
, year = 2003
|
||||
, pages = "37--44"
|
||||
, url = "https://inria.hal.science/inria-00344517/"
|
||||
}
|
||||
|
||||
@article{ cgal:dpt-wt-02
|
||||
|
|
@ -766,7 +766,7 @@ Teillaud"
|
|||
, author = "Olivier Devillers and Monique Teillaud"
|
||||
, title = "Perturbations and Vertex Removal in a {3D Delaunay} Triangulation"
|
||||
, 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
|
||||
, pages = "313-319"
|
||||
}
|
||||
|
|
@ -778,7 +778,7 @@ Teillaud"
|
|||
, volume = 44
|
||||
, year = 2011
|
||||
, 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"
|
||||
}
|
||||
|
||||
|
|
@ -845,7 +845,7 @@ Teillaud"
|
|||
,school = "Universit\'e de {Nice-Sophia Antipolis}"
|
||||
,address = "France"
|
||||
,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}},
|
||||
YEAR = {2017},
|
||||
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,
|
||||
|
|
@ -1261,13 +1261,13 @@ Teillaud"
|
|||
|
||||
|
||||
@InProceedings{ cgal:k-reisv-04,
|
||||
author = {Menelaos I. Karavelas},
|
||||
title = {A robust and efficient implementation for the segment
|
||||
author = {Menelaos I. Karavelas},
|
||||
title = {A robust and efficient implementation for the segment
|
||||
{V}oronoi diagram},
|
||||
booktitle = {Proc. Internat. Symp. on Voronoi diagrams in Science
|
||||
and Engineering (VD2004)},
|
||||
pages = {51--62},
|
||||
year = {2004}
|
||||
pages = {51--62},
|
||||
year = {2004}
|
||||
}
|
||||
|
||||
@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
|
||||
, author = "G. Medioni and M. Lee and C. Tang"
|
||||
, title = "A Computational Framework for Segmentation and Grouping"
|
||||
, journal = "Elsevier Science"
|
||||
, year = 2000
|
||||
, pages = ""
|
||||
, update = "12.13 afabri"
|
||||
, author = "G. Medioni and M. Lee and C. Tang"
|
||||
, title = "A Computational Framework for Segmentation and Grouping"
|
||||
, journal = "Elsevier Science"
|
||||
, year = 2000
|
||||
, pages = ""
|
||||
, update = "12.13 afabri"
|
||||
}
|
||||
|
||||
@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,
|
||||
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},
|
||||
URL = {https://hal.inria.fr/hal-01348404},
|
||||
URL = {https://inria.hal.science/hal-01348404},
|
||||
JOURNAL = {{Computer Graphics Forum}},
|
||||
PUBLISHER = {{Wiley}},
|
||||
PAGES = {27},
|
||||
YEAR = {2016},
|
||||
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_VERSION = {v2}
|
||||
}
|
||||
|
||||
|
||||
@TechReport{ cgal:pabl-cco-07,
|
||||
author = {Poudret, M. and Arnould, A. and Bertrand, Y. and Lienhardt, P.},
|
||||
title = {Cartes Combinatoires Ouvertes.},
|
||||
institution = {Laboratoire SIC E.A. 4103},
|
||||
number = {2007-1},
|
||||
month = {October},
|
||||
year = {2007},
|
||||
address = {F-86962 Futuroscope Cedex, France},
|
||||
type = {Research Notes},
|
||||
keywords = {cartes combinatoires, demi-ar{\^e}te, ar{\^e}te radiale},
|
||||
author = {Poudret, M. and Arnould, A. and Bertrand, Y. and Lienhardt, P.},
|
||||
title = {Cartes Combinatoires Ouvertes.},
|
||||
institution = {Laboratoire SIC E.A. 4103},
|
||||
number = {2007-1},
|
||||
month = {October},
|
||||
year = {2007},
|
||||
address = {F-86962 Futuroscope Cedex, France},
|
||||
type = {Research Notes},
|
||||
keywords = {cartes combinatoires, demi-ar{\^e}te, ar{\^e}te radiale},
|
||||
}
|
||||
|
||||
@article{ cgal:pc-rdp-86
|
||||
|
|
@ -2293,7 +2293,7 @@ location = {Salt Lake City, Utah, USA}
|
|||
, pages = "75:1-75:9"
|
||||
, note = "SIGGRAPH '2009 Conference Proceedings"
|
||||
, volume = "28(3)"
|
||||
, url = "https://hal.inria.fr/inria-00359288"
|
||||
, url = "https://inria.hal.science/inria-00359288"
|
||||
, geombib = "not yet"
|
||||
, x-editorial-board = {yes}
|
||||
, x-proceedings = {yes}
|
||||
|
|
@ -2332,7 +2332,7 @@ location = {Salt Lake City, Utah, USA}
|
|||
,month = jun
|
||||
,pages = {26--31}
|
||||
,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"
|
||||
}
|
||||
|
||||
|
|
@ -2354,7 +2354,7 @@ location = {Salt Lake City, Utah, USA}
|
|||
,month = may
|
||||
,pages = {36--43}
|
||||
,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"
|
||||
}
|
||||
|
||||
|
|
@ -2422,7 +2422,7 @@ location = {Salt Lake City, Utah, USA}
|
|||
@book{ cgal:w-impoo-94
|
||||
,author = {Josie Wernicke}
|
||||
,title = {The Inventor Mentor: Programming Object-Oriented
|
||||
3D Graphics with Open Inventor, Release 2}
|
||||
3D Graphics with Open Inventor, Release 2}
|
||||
,publisher = {Addison-Wesley}
|
||||
,year = 1994
|
||||
,update = "97.04 kettner"
|
||||
|
|
@ -2549,12 +2549,12 @@ url = "https://wscg.zcu.cz/wscg2003/Papers_2003/G67.pdf"
|
|||
}
|
||||
|
||||
@InProceedings{cgal:k-vdc-06,
|
||||
author = {Menelaos I. Karavelas},
|
||||
title = {Voronoi diagrams in {\sc Cgal}},
|
||||
author = {Menelaos I. Karavelas},
|
||||
title = {Voronoi diagrams in {\sc Cgal}},
|
||||
booktitle = {22nd European Symposium on Computational Geometry},
|
||||
pages = {229--232},
|
||||
year = {2006},
|
||||
address = {Delphi, Greece},
|
||||
pages = {229--232},
|
||||
year = {2006},
|
||||
address = {Delphi, Greece},
|
||||
}
|
||||
|
||||
@incollection{cgal:fhktww-a-07,
|
||||
|
|
@ -2607,27 +2607,27 @@ url = "https://www.boost.org/community/exception_safety.html"
|
|||
}
|
||||
|
||||
@article{cgal:as-solri-92
|
||||
, author = "F. Aurenhammer and O. Schwarzkopf"
|
||||
, title = "A simple on-line randomized incremental algorithm for computing higher order {Voronoi} diagrams"
|
||||
, journal = "Internat. J. Comput. Geom. Appl."
|
||||
, volume = 2
|
||||
, year = 1992
|
||||
, pages = "363--381"
|
||||
, keywords = "Voronoi diagrams, geometric transforms, dynamization"
|
||||
, succeeds = "as-solri-91"
|
||||
, update = "93.09 aurenhammer, 93.05 schwarzkopf"
|
||||
, author = "F. Aurenhammer and O. Schwarzkopf"
|
||||
, title = "A simple on-line randomized incremental algorithm for computing higher order {Voronoi} diagrams"
|
||||
, journal = "Internat. J. Comput. Geom. Appl."
|
||||
, volume = 2
|
||||
, year = 1992
|
||||
, pages = "363--381"
|
||||
, keywords = "Voronoi diagrams, geometric transforms, dynamization"
|
||||
, succeeds = "as-solri-91"
|
||||
, update = "93.09 aurenhammer, 93.05 schwarzkopf"
|
||||
}
|
||||
|
||||
@inproceedings{cgal:fy-okvd-01
|
||||
, author = "Julia Fl{\"o}totto and Mariette Yvinec"
|
||||
, title = "Order-$k$ {Voronoi} Diagrams"
|
||||
, booktitle = "Abstracts 17th European Workshop Comput. Geom."
|
||||
, nickname = "CG 2001"
|
||||
, site = "Berlin"
|
||||
, publisher = "Freie Universit{\"a}t Berlin"
|
||||
, year = 2001
|
||||
, pages = "109--112"
|
||||
, update = "01.04 icking"
|
||||
, author = "Julia Fl{\"o}totto and Mariette Yvinec"
|
||||
, title = "Order-$k$ {Voronoi} Diagrams"
|
||||
, booktitle = "Abstracts 17th European Workshop Comput. Geom."
|
||||
, nickname = "CG 2001"
|
||||
, site = "Berlin"
|
||||
, publisher = "Freie Universit{\"a}t Berlin"
|
||||
, year = 2001
|
||||
, pages = "109--112"
|
||||
, update = "01.04 icking"
|
||||
}
|
||||
|
||||
@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"
|
||||
, number = "1"
|
||||
, 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"
|
||||
, x-international-audience = "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"
|
||||
, booktitle = "Proc. 18th ACM-SIAM Sympos. Discrete Algorithms"
|
||||
, nickname = "SODA"
|
||||
, url = "https://hal.inria.fr/inria-00182835/"
|
||||
, url = "https://inria.hal.science/inria-00182835/"
|
||||
, year = 2007
|
||||
, pages = "1106--1113"
|
||||
}
|
||||
|
|
@ -2856,14 +2856,14 @@ ADDRESS = "Saarbr{\"u}cken, Germany"
|
|||
}
|
||||
|
||||
@InCollection{grlr-sturm-habicht-98,
|
||||
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},
|
||||
booktitle = {Quantifier Elimination and Cylindrical Algebraic Decomposition},
|
||||
pages = {300--316},
|
||||
publisher = {Springer},
|
||||
year = 1998,
|
||||
editor = {B.F.~Caviness and J.R.~Johnson},
|
||||
series = {Texts and Monographs in Symbolic Computation}
|
||||
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},
|
||||
booktitle = {Quantifier Elimination and Cylindrical Algebraic Decomposition},
|
||||
pages = {300--316},
|
||||
publisher = {Springer},
|
||||
year = 1998,
|
||||
editor = {B.F.~Caviness and J.R.~Johnson},
|
||||
series = {Texts and Monographs in Symbolic Computation}
|
||||
}
|
||||
|
||||
@inproceedings{Sorkine2007AsRigidAs,
|
||||
|
|
@ -3213,14 +3213,14 @@ pages = "207--221"
|
|||
@techreport{frey:inria-00069921,
|
||||
TITLE = {{MEDIT : An interactive Mesh visualization Software}},
|
||||
AUTHOR = {Frey, Pascal},
|
||||
URL = {https://hal.inria.fr/inria-00069921},
|
||||
URL = {https://inria.hal.science/inria-00069921},
|
||||
NUMBER = {RT-0253},
|
||||
PAGES = {41},
|
||||
INSTITUTION = {{INRIA}},
|
||||
YEAR = {2001},
|
||||
MONTH = Dec,
|
||||
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_VERSION = {v1}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -172,9 +172,9 @@ ALIASES = "cgal=%CGAL" \
|
|||
"cgalPkgSince{1}=<B>Introduced in:</B> \cgal \1<BR>" \
|
||||
"cgalPkgDependsOn{1}=<B>Depends on:</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{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{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{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>" \
|
||||
"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=" \
|
||||
"cgalModifBegin=\htmlonly <div class=\"CGALModification\"> \endhtmlonly \xrefitem Modification \"Modifications\" \"MODIFICATIONS\" " \
|
||||
"cgalModifEnd=\htmlonly </div> \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \
|
||||
|
|
|
|||
|
|
@ -181,9 +181,9 @@ ALIASES = "cgal=%CGAL" \
|
|||
"cgalPkgSince{1}=<B>Introduced in:</B> \cgal \1<BR>" \
|
||||
"cgalPkgDependsOn{1}=<B>Depends on:</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{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{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{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>" \
|
||||
"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=" \
|
||||
"cgalModifBegin=\htmlonly <div class=\"CGALModification\"> \endhtmlonly \xrefitem Modification \"Modifications\" \"MODIFICATIONS\"" \
|
||||
"cgalModifEnd=\htmlonly </div> \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \
|
||||
|
|
|
|||
|
|
@ -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"/>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ def clean_doc():
|
|||
duplicate_files=list(package_glob('./*/jquery.js'))
|
||||
duplicate_files.extend(package_glob('./*/dynsections.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
|
||||
duplicate_files.extend(glob.glob('./*/tabs.css'))
|
||||
# left-over by doxygen?
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#ifdef CGAL_ENVELOPE_USE_BFS_FACE_ORDER
|
||||
#include <CGAL/Arr_face_index_map.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
|
||||
|
||||
// this base divide & conquer algorithm splits the input into 2 groups,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ Algebraic_foundations
|
|||
Apollonius_graph_2
|
||||
Arithmetic_kernel
|
||||
Arrangement_on_surface_2
|
||||
BGL
|
||||
Cartesian_kernel
|
||||
Circulator
|
||||
Distance_2
|
||||
|
|
|
|||
|
|
@ -293,7 +293,6 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
|
|||
double drt = (((square( drx ) + square( dry )) + square( drz )) + twt_rwt);
|
||||
int cmp;
|
||||
int int_tmp_result;
|
||||
double eps;
|
||||
double RT_tmp_result = CGAL::determinant( dpx, dpy, dpt, dqx, dqy, dqt, drx, dry, drt );
|
||||
|
||||
double max7 = CGAL::abs(dpz);
|
||||
|
|
@ -371,217 +370,45 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
|
|||
if( max5 < aqx_rx ) max5 = aqx_rx;
|
||||
double max6 = CGAL::abs(qy_ry);
|
||||
if( max6 < apy_ry ) max6 = apy_ry;
|
||||
if( (cmp != 0) )
|
||||
{
|
||||
int int_tmp_result_FFWKCAA;
|
||||
double double_tmp_result;
|
||||
double_tmp_result = ((px_rx * qy_ry) - (qx_rx * py_ry));
|
||||
lower_bound_1 = max5;
|
||||
upper_bound_1 = max5;
|
||||
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);
|
||||
}
|
||||
|
||||
int int_tmp_result_FFWKCAA;
|
||||
double double_tmp_result;
|
||||
double_tmp_result = ((px_rx * qy_ry) - (qx_rx * py_ry));
|
||||
lower_bound_1 = max5;
|
||||
upper_bound_1 = max5;
|
||||
if( (max6 < lower_bound_1) ) lower_bound_1 = max6;
|
||||
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( (lower_bound_1 < 5.00368081960964690982e-147) )
|
||||
{
|
||||
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
|
||||
return Base::operator()(p,q,r,t);
|
||||
}
|
||||
{
|
||||
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 * (max6 * max8));
|
||||
if( (double_tmp_result_Dw20Kqh > eps) )
|
||||
{
|
||||
int_tmp_result_agX3WsT = 1;
|
||||
}
|
||||
{
|
||||
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_Dw20Kqh < -eps) )
|
||||
{
|
||||
int_tmp_result_agX3WsT = -1;
|
||||
}
|
||||
{
|
||||
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_agX3WsT);
|
||||
{
|
||||
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
|
||||
return Base::operator()(p,q,r,t);
|
||||
}
|
||||
}
|
||||
}
|
||||
return static_cast<result_type>(cmp * int_tmp_result_FFWKCAA);
|
||||
}
|
||||
else
|
||||
return Base::operator()(p,q,r,t);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
|
|||
find_package(Qt5 QUIET COMPONENTS Widgets)
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
cgal_add_compilation_test(Bounding_volumes)
|
||||
|
|
@ -53,3 +58,6 @@ else()
|
|||
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
else()
|
||||
message("NOTICE: This demo requires CGAL and Eigen, and will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
#ifndef ELLIPSE_H
|
||||
#define ELLIPSE_H
|
||||
|
||||
#include <Eigen/Dense>
|
||||
#include <Eigen/Eigenvalues>
|
||||
|
||||
template <class R>
|
||||
class Ellipse_2 {
|
||||
|
||||
|
|
@ -20,50 +23,51 @@ template <class R>
|
|||
CGAL::Simple_cartesian<double>::Conic_2 co;
|
||||
me.ellipse().double_conic(co);
|
||||
|
||||
double a11 = co.r();
|
||||
double a12 = co.t()/2.0;
|
||||
double a22 = co.s();
|
||||
double b1 = co.u();
|
||||
double b2 = co.v();
|
||||
double c = co.w();
|
||||
// https://en.wikipedia.org/wiki/Matrix_representation_of_conic_sections
|
||||
double A = co.r();
|
||||
double B = co.t();
|
||||
double C = co.s();
|
||||
double D = co.u();
|
||||
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;
|
||||
if( (delta < 0.00000000001) && (a12 == 0)){
|
||||
ce = Point_2(-b1/(2*a11), -b2/(2*a11));
|
||||
a_ = b_ = std::sqrt(b1*b1+b2*b2-4*a11*c)/(2*a11);
|
||||
va_ = Vector_2(a_, 0);
|
||||
vb_ = Vector_2(0, b_);
|
||||
return;
|
||||
}
|
||||
Eigen::Matrix2d A33, A33i;
|
||||
A33 << A, B/2, B/2, C;
|
||||
A33i = A33.inverse();
|
||||
|
||||
double kden = 2.0*(a12*a12 - a11*a22);
|
||||
double k1 = (a22*b1 - a12*b2)/kden;
|
||||
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;
|
||||
Eigen::Vector2d v;
|
||||
v << -D/2 , -E/2;
|
||||
|
||||
double r = std::sqrt((m11-m22)*(m11-m22) + 4.0*m12*m12);
|
||||
double lambda1 = ((m11+m22) + r)/2.0;
|
||||
double lambda2 = ((m11+m22) - r)/2.0;
|
||||
v = A33i * v;
|
||||
|
||||
b_ = 1.0/sqrt(lambda1);
|
||||
a_ = 1.0/sqrt(lambda2);
|
||||
double omega = 1.0/
|
||||
std::sqrt((lambda1-m22)*(lambda1-m22) + m12*m12);
|
||||
ce = Point_2(v[0],v[1]);
|
||||
|
||||
double u1x = - a_ * omega*m12;
|
||||
double u1y = a_ * omega * (lambda1-m22);
|
||||
Eigen::EigenSolver<Eigen::Matrix2d> es(A33);
|
||||
|
||||
double u2x = b_* omega * (lambda1-m22);
|
||||
double u2y = b_* omega*m12;
|
||||
Eigen::Matrix2cd ev;
|
||||
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);
|
||||
vb_ = Vector_2(u2x,u2y);
|
||||
double lambda1 = es.eigenvalues()[0].real();
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
0 2
|
||||
2 1
|
||||
0 0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
-2 1
|
||||
-2 -1
|
||||
2 1
|
||||
2 -1
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
-2 -1
|
||||
-1 -2
|
||||
1 2
|
||||
2 1
|
||||
|
|
@ -746,17 +746,23 @@ protected:
|
|||
fit->info().is_process = false;
|
||||
}
|
||||
// (2.2) We check if the facet is external or internal
|
||||
std::queue<typename CDT::Face_handle> face_queue;
|
||||
typename CDT::Face_handle face_internal = nullptr;
|
||||
std::queue<typename CDT::Face_handle> face_queue, faces_internal;
|
||||
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())
|
||||
{
|
||||
typename CDT::Face_handle fh = face_queue.front();
|
||||
typename CDT::Face_handle fh=face_queue.front();
|
||||
face_queue.pop();
|
||||
if(!fh->info().is_process)
|
||||
{
|
||||
fh->info().is_process = true;
|
||||
fh->info().is_process=true;
|
||||
for(int i=0; i<3; ++i)
|
||||
{
|
||||
if(!cdt.is_constrained(std::make_pair(fh, i)))
|
||||
|
|
@ -764,21 +770,16 @@ protected:
|
|||
if (fh->neighbor(i)!=nullptr)
|
||||
{ face_queue.push(fh->neighbor(i)); }
|
||||
}
|
||||
else if (face_internal==nullptr)
|
||||
{
|
||||
face_internal = fh->neighbor(i);
|
||||
}
|
||||
else
|
||||
{ faces_internal.push(fh->neighbor(i)); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( face_internal!=nullptr )
|
||||
{ face_queue.push(face_internal); }
|
||||
|
||||
while(!face_queue.empty())
|
||||
while(!faces_internal.empty())
|
||||
{
|
||||
typename CDT::Face_handle fh = face_queue.front();
|
||||
face_queue.pop();
|
||||
typename CDT::Face_handle fh=faces_internal.front();
|
||||
faces_internal.pop();
|
||||
if(!fh->info().is_process)
|
||||
{
|
||||
fh->info().is_process = true;
|
||||
|
|
@ -788,7 +789,7 @@ protected:
|
|||
if(!cdt.is_constrained(std::make_pair(fh, i)))
|
||||
{
|
||||
if (fh->neighbor(i)!=nullptr)
|
||||
{ face_queue.push(fh->neighbor(i)); }
|
||||
{ faces_internal.push(fh->neighbor(i)); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ is available in:
|
|||
Mikhail Bogdanov, Olivier Devillers, and Monique Teillaud. Hyperbolic
|
||||
Delaunay complexes and Voronoi diagrams made practical. Journal of
|
||||
Computational Geometry, 5(1):56–85, 2014.
|
||||
URL: https://hal.inria.fr/hal-00961390,
|
||||
URL: https://inria.hal.science/hal-00961390,
|
||||
doi:10.20382/jocg.v5i1a4.
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup kernel_affine
|
||||
\ingroup kernel_classes2
|
||||
|
||||
The class `Aff_transformation_2` represents two-dimensional affine transformations.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ namespace CGAL {
|
|||
|
||||
/*!
|
||||
\ingroup kernel_classes3
|
||||
\ingroup kernel_affine
|
||||
|
||||
The class `Aff_transformation_3` represents three-dimensional affine transformations.
|
||||
The general form of an affine transformation is based on a homogeneous
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup kernel_affine
|
||||
\ingroup PkgKernel23Ref
|
||||
|
||||
Tag class for affine transformations.
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ public:
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup kernel_affine
|
||||
\ingroup PkgKernel23Ref
|
||||
|
||||
Tag class for affine transformations.
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ public:
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup kernel_affine
|
||||
\ingroup PkgKernel23Ref
|
||||
|
||||
Tag class for affine transformations.
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ public:
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup kernel_affine
|
||||
\ingroup PkgKernel23Ref
|
||||
|
||||
Tag class for affine transformations.
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ public:
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup kernel_affine
|
||||
\ingroup PkgKernel23Ref
|
||||
|
||||
Tag class for affine transformations.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ function are available.
|
|||
|
||||
/*!
|
||||
\addtogroup do_intersect_linear_grp
|
||||
\ingroup do_intersect
|
||||
\ingroup do_intersect_grp
|
||||
|
||||
\sa `do_intersect_circular_grp`
|
||||
\sa `do_intersect_spherical_grp`
|
||||
|
|
@ -79,7 +79,7 @@ function are available.
|
|||
|
||||
/*!
|
||||
\addtogroup intersection_linear_grp
|
||||
\ingroup intersection
|
||||
\ingroup intersection_grp
|
||||
|
||||
*/
|
||||
/// @{
|
||||
|
|
|
|||
|
|
@ -99,14 +99,14 @@ namespace CGAL {
|
|||
{};
|
||||
template<int i>
|
||||
struct Attribute_const_descriptor:
|
||||
public Helper::template Attribute_const_descriptor<i>
|
||||
public Helper::template Attribute_const_descriptor<i>
|
||||
{};
|
||||
template<int i>
|
||||
struct Attribute_range: public Helper::template Attribute_range<i>
|
||||
{};
|
||||
template<int i>
|
||||
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;
|
||||
|
|
@ -169,6 +169,10 @@ namespace CGAL {
|
|||
{ return mmap.mdarts.is_used(i); }
|
||||
bool owns(size_type i) const
|
||||
{ return mmap.mdarts.owns(i); }
|
||||
size_type capacity() const
|
||||
{ return mmap.mdarts.capacity(); }
|
||||
size_type upper_bound() const
|
||||
{ return mmap.mdarts.upper_bound(); }
|
||||
private:
|
||||
Self & mmap;
|
||||
};
|
||||
|
|
@ -202,7 +206,7 @@ namespace CGAL {
|
|||
* @return true iff the map is empty.
|
||||
*/
|
||||
bool is_empty() const
|
||||
{ return darts().empty(); }
|
||||
{ return darts().empty(); }
|
||||
|
||||
/// @return the number of darts.
|
||||
size_type number_of_darts() const
|
||||
|
|
@ -288,18 +292,18 @@ namespace CGAL {
|
|||
typename Attribute_descriptor<i>::type attribute(Dart_descriptor ADart)
|
||||
{
|
||||
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>
|
||||
(mdarts[ADart].mattribute_descriptors);
|
||||
(mdarts[ADart].mattribute_descriptors);
|
||||
}
|
||||
template<unsigned int i>
|
||||
typename Attribute_const_descriptor<i>::type
|
||||
attribute(Dart_const_descriptor ADart) const
|
||||
{
|
||||
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>
|
||||
(mdarts[ADart].mattribute_descriptors);
|
||||
(mdarts[ADart].mattribute_descriptors);
|
||||
}
|
||||
|
||||
// Copy a given attribute
|
||||
|
|
@ -360,7 +364,7 @@ namespace CGAL {
|
|||
{
|
||||
CGAL_assertion( ah!=null_descriptor );
|
||||
return std::get<Helper::template Dimension_index<i>::value>
|
||||
(mattribute_containers)[ah];
|
||||
(mattribute_containers)[ah];
|
||||
}
|
||||
template<unsigned int i>
|
||||
const typename Attribute_type<i>::type&
|
||||
|
|
@ -368,7 +372,7 @@ namespace CGAL {
|
|||
{
|
||||
CGAL_assertion( ah!=null_descriptor );
|
||||
return std::get<Helper::template Dimension_index<i>::value>
|
||||
(mattribute_containers)[ah];
|
||||
(mattribute_containers)[ah];
|
||||
}
|
||||
|
||||
// Get the dart of the given attribute
|
||||
|
|
@ -486,14 +490,14 @@ namespace CGAL {
|
|||
typename Attribute_descriptor<i>::type ah)
|
||||
{
|
||||
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.
|
||||
* @param adart the dart to link.
|
||||
* @param adart2 the dart to link with.
|
||||
* @param i the dimension.
|
||||
*/
|
||||
* @param adart the dart to link.
|
||||
* @param adart2 the dart to link with.
|
||||
* @param i the dimension.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
void dart_link_beta(Dart_descriptor adart, Dart_descriptor adart2)
|
||||
{
|
||||
|
|
@ -509,9 +513,9 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
/** Unlink a dart for a given dimension.
|
||||
* @param adart a dart.
|
||||
* @param i the dimension.
|
||||
*/
|
||||
* @param adart a dart.
|
||||
* @param i the dimension.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
void dart_unlink_beta(Dart_descriptor adart)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ read_triangle_poly_file(CDT& t, std::istream &f,
|
|||
{
|
||||
unsigned int j;
|
||||
double x, y;
|
||||
f >> j >> iformat(x) >> iformat(y);
|
||||
f >> j >> IO::iformat(x) >> IO::iformat(y);
|
||||
Point p(x, y);
|
||||
skip_until_EOL(f); skip_comment_OFF(f);
|
||||
vertices[--j] = t.insert(p);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
@ -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 */
|
||||
|
|
@ -198,6 +198,7 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support)
|
|||
target
|
||||
mesh_3D_image
|
||||
mesh_3D_weighted_image
|
||||
mesh_3D_weighted_image_with_detection_of_features
|
||||
mesh_3D_image_variable_size
|
||||
mesh_3D_image_with_custom_initialization
|
||||
mesh_3D_gray_image_with_custom_initialization
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
||||
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 really in subdomain: " << oformat(mc_subdomain)
|
||||
<< " / mc is really in subdomain: " << IO::oformat(mc_subdomain)
|
||||
<< std::endl;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
|
||||
|
||||
template <typename Concurrency_tag>
|
||||
void test()
|
||||
{
|
||||
|
|
@ -31,7 +32,7 @@ void test()
|
|||
std::size_t nb_runs = 2;
|
||||
unsigned int nb_lloyd = 2;
|
||||
unsigned int nb_odt = 2;
|
||||
double perturb_bound = 10.;
|
||||
double perturb_bound = 7.;
|
||||
double exude_bound = 15.;
|
||||
|
||||
// Domain
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public:
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgMinkowskiSum2Classes
|
||||
\ingroup PkgMinkowskiSum2Ref
|
||||
|
||||
The `Hertel_Mehlhorn_convex_decomposition_2` class implements the approximation algorithm of Hertel
|
||||
and Mehlhorn for decomposing a polygon into convex
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@
|
|||
/// \defgroup nt_cgal CGAL Number Types
|
||||
/// \ingroup PkgNumberTypesRef
|
||||
|
||||
/// \defgroup nt_cgal CGAL Number Types
|
||||
/// \ingroup PkgNumberTypesRef
|
||||
|
||||
/// \defgroup nt_rrational Relates Rational
|
||||
/// \ingroup PkgNumberTypesRef
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace CGAL {
|
|||
\anchor Chapter_Orthtree
|
||||
|
||||
\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
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ For nontrivial point counts, the naive approach's calculation time dwarfs that o
|
|||
\section Section_Orthtree_History History
|
||||
|
||||
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
|
||||
2020. Simon Giraudot, supervisor of the GSoC internship, completed and
|
||||
finalized the package for integration in CGAL 5.3. Pierre Alliez
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public:
|
|||
using Maybe_node_index = std::optional<Node_index>;
|
||||
|
||||
// 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.
|
||||
|
|
@ -205,10 +205,10 @@ public:
|
|||
// Determine dimensions of the root bbox
|
||||
Bbox_dimensions size;
|
||||
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
|
||||
m_bbox_min = bbox.min();
|
||||
m_bbox_min = (bbox.min)();
|
||||
m_side_per_depth.push_back(size);
|
||||
data(root()) = m_traits.construct_root_node_contents_object()();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,15 +8,4 @@
|
|||
<enableAddressBar>false</enableAddressBar>
|
||||
<enableFilterFunctionality>false</enableFilterFunctionality>
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,4 @@
|
|||
<enableAddressBar>false</enableAddressBar>
|
||||
<enableFilterFunctionality>false</enableFilterFunctionality>
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include <typeindex>
|
||||
|
||||
#include <CGAL/Property_container.h>
|
||||
#include <CGAL/Surface_mesh/Properties.h>
|
||||
|
||||
#include <CGAL/Point_set_3/IO.h>
|
||||
|
||||
|
|
@ -53,7 +53,11 @@ namespace internal {
|
|||
typedef CGAL::Point_set_3<Point, Vector> Point_set_3;
|
||||
|
||||
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;
|
||||
|
||||
public:
|
||||
|
|
@ -126,14 +130,18 @@ public:
|
|||
|
||||
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>
|
||||
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;
|
||||
|
||||
// todo: apparently unused?
|
||||
template <typename Key, typename T>
|
||||
struct Get_property_map {
|
||||
typedef Property_map<T> type;
|
||||
|
|
@ -163,7 +171,6 @@ public:
|
|||
typedef Property_map<Vector> Vector_map; ///< Property map of vectors
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
// todo: CGAL should probably have a general "span" type
|
||||
template <class Type>
|
||||
class Property_range
|
||||
{
|
||||
|
|
@ -177,17 +184,18 @@ public:
|
|||
private:
|
||||
const_iterator m_begin;
|
||||
const_iterator m_end;
|
||||
// todo: couldn't this be replaced by std::distance(begin, end)?
|
||||
std::size_t m_size;
|
||||
|
||||
public:
|
||||
Property_range (const Property_map<Type>& pmap,
|
||||
typename Point_set::const_iterator begin,
|
||||
typename Point_set::const_iterator end,
|
||||
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_size(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_size = size;
|
||||
}
|
||||
|
||||
const_iterator begin() const { return m_begin; }
|
||||
const_iterator end() const { return m_end; }
|
||||
|
|
@ -202,17 +210,11 @@ public:
|
|||
protected:
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
// todo: this shouldn't be necessary
|
||||
mutable Base m_base;
|
||||
Base m_base;
|
||||
Index_map m_indices;
|
||||
Point_map m_points;
|
||||
std::optional<Vector_map> m_normals{};
|
||||
|
||||
// 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;
|
||||
Vector_map m_normals;
|
||||
std::size_t m_nb_removed;
|
||||
/// \endcond
|
||||
|
||||
public:
|
||||
|
|
@ -228,11 +230,9 @@ public:
|
|||
added. If `false` (default value), the normal map can still be
|
||||
added later on (see `add_normal_map()`).
|
||||
*/
|
||||
Point_set_3(bool with_normal_map = false) :
|
||||
m_base(),
|
||||
m_indices(m_base.template add_property<Index>("index", typename Index::size_type(-1))),
|
||||
m_points(m_base.template add_property<Point>("point", CGAL::ORIGIN)) {
|
||||
|
||||
Point_set_3 (bool with_normal_map = false) : m_base()
|
||||
{
|
||||
clear();
|
||||
if (with_normal_map)
|
||||
add_normal_map();
|
||||
}
|
||||
|
|
@ -240,23 +240,25 @@ public:
|
|||
/*!
|
||||
\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_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;
|
||||
if (has_normal_map())
|
||||
add_normal_map();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
// copy constructor (same as assignment)
|
||||
Point_set_3(const Point_set_3& ps) :
|
||||
m_base(ps.m_base),
|
||||
m_indices(m_base.template get_property<Index>("index")),
|
||||
m_points(m_base.template get_property<Point>("point")),
|
||||
m_nb_removed(ps.m_nb_removed) {
|
||||
if (has_normal_map())
|
||||
add_normal_map();
|
||||
Point_set_3 (const Point_set_3& ps)
|
||||
{
|
||||
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;
|
||||
}
|
||||
/// \endcond
|
||||
|
||||
|
|
@ -264,7 +266,6 @@ public:
|
|||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
const Base& base() const { return m_base; }
|
||||
Base& base() { return m_base; }
|
||||
/// \endcond
|
||||
|
||||
|
||||
|
|
@ -294,9 +295,8 @@ public:
|
|||
\note The method `size()` is also available (see `Range`) and
|
||||
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
|
||||
// todo: why is this undocumented, but mentioned in the number_of_points documentation?
|
||||
std::size_t size () const { return number_of_points(); }
|
||||
/// \endcond
|
||||
|
||||
|
|
@ -310,8 +310,6 @@ public:
|
|||
the point set and `other`. Property maps which are only in
|
||||
`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
|
||||
before calling this method, then all the content of `other` will
|
||||
be copied and no property will be lost in the process.
|
||||
|
|
@ -322,7 +320,8 @@ public:
|
|||
{
|
||||
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
|
||||
for (std::size_t i = 0; i < this->m_base.size(); ++ i)
|
||||
|
|
@ -340,8 +339,9 @@ public:
|
|||
*/
|
||||
void clear()
|
||||
{
|
||||
m_base.resize(0);
|
||||
m_base.remove_all_properties_except({"index", "point"});
|
||||
m_base.clear();
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -353,8 +353,14 @@ public:
|
|||
*/
|
||||
void clear_properties()
|
||||
{
|
||||
// todo: The old version was pretty convoluted, but I'm pretty sure this is the intended behavior
|
||||
m_base.remove_all_properties_except({"index", "point"});
|
||||
Base other;
|
||||
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
|
||||
is only used for optimization.
|
||||
*/
|
||||
void reserve (std::size_t 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;
|
||||
}
|
||||
void reserve (std::size_t s) { m_base.reserve (s); }
|
||||
|
||||
/*!
|
||||
\brief changes size of the point set.
|
||||
|
|
@ -429,8 +429,7 @@ public:
|
|||
{
|
||||
if (m_nb_removed == 0)
|
||||
{
|
||||
auto new_index = m_base.emplace_back();
|
||||
CGAL_assertion(std::size_t(new_index) == size() - 1);
|
||||
m_base.push_back();
|
||||
m_indices[size()-1] = size()-1;
|
||||
return m_indices.end() - 1;
|
||||
}
|
||||
|
|
@ -464,7 +463,7 @@ public:
|
|||
iterator insert (const Point& p)
|
||||
{
|
||||
iterator out = insert();
|
||||
m_points[*out] = p;
|
||||
m_points[size()-1] = p;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -504,8 +503,6 @@ public:
|
|||
method allows the user to easily copy one point (along with the
|
||||
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 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
|
||||
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()`.
|
||||
|
||||
\note All iterators, pointers and references related to the
|
||||
|
|
@ -607,7 +604,6 @@ public:
|
|||
while (source != last // All elements have been moved
|
||||
&& 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::swap (*(source ++), *(dest --));
|
||||
}
|
||||
|
|
@ -634,7 +630,6 @@ public:
|
|||
*/
|
||||
void remove (iterator it)
|
||||
{
|
||||
// todo: Maybe some form of erase-by-iterator should exist?
|
||||
std::iter_swap (it, (end() - 1));
|
||||
++ m_nb_removed;
|
||||
}
|
||||
|
|
@ -733,7 +728,7 @@ public:
|
|||
// 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));
|
||||
|
||||
m_base.resize(size ());
|
||||
m_base.resize (size ());
|
||||
m_base.shrink_to_fit ();
|
||||
m_nb_removed = 0;
|
||||
}
|
||||
|
|
@ -787,8 +782,11 @@ public:
|
|||
\param name Name of the property.
|
||||
*/
|
||||
template <typename T>
|
||||
bool has_property_map (const std::string& name) const {
|
||||
return m_base.template property_exists<T>(name);
|
||||
bool has_property_map (const std::string& name) const
|
||||
{
|
||||
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>
|
||||
add_property_map (const std::string& name, const T t=T())
|
||||
{
|
||||
auto [array, created] = m_base.template get_or_add_property<T>(name, t);
|
||||
return {{array.get()}, created};
|
||||
Property_map<T> pm;
|
||||
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.
|
||||
|
||||
\return Returns an optional containing: the specified property map
|
||||
or an empty property map (if the property was not found).
|
||||
\return Returns a pair containing: the specified property map and a
|
||||
Boolean set to `true` or an empty property map and a Boolean set
|
||||
to `false` (if the property was not found).
|
||||
*/
|
||||
template <class T>
|
||||
std::optional<Property_map<T>>
|
||||
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>>
|
||||
std::pair<Property_map<T>,bool>
|
||||
property_map (const std::string& name) const
|
||||
{
|
||||
auto maybe_property_map = m_base.template get_property_if_exists<T>(name);
|
||||
if (!maybe_property_map) return {};
|
||||
else return {{maybe_property_map.value()}};
|
||||
Property_map<T> pm;
|
||||
bool okay = false;
|
||||
std::tie (pm, okay) = m_base.template get<T>(name);
|
||||
return std::make_pair (pm, okay);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -854,7 +846,7 @@ public:
|
|||
template <class T>
|
||||
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
|
||||
{
|
||||
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.
|
||||
|
|
@ -879,9 +872,9 @@ public:
|
|||
*/
|
||||
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);
|
||||
m_normals = {pair.first};
|
||||
return pair;
|
||||
bool out = false;
|
||||
std::tie (m_normals, out) = this->add_property_map<Vector> ("normal", default_value);
|
||||
return std::make_pair (m_normals, out);
|
||||
}
|
||||
/*!
|
||||
\brief returns the property map of the normal property.
|
||||
|
|
@ -894,7 +887,7 @@ public:
|
|||
{
|
||||
if (!m_normals)
|
||||
add_normal_map();
|
||||
return m_normals.value();
|
||||
return m_normals;
|
||||
}
|
||||
/*!
|
||||
\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
|
||||
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.value();
|
||||
return m_normals;
|
||||
}
|
||||
/*!
|
||||
\brief Convenience method that removes the normal property.
|
||||
|
|
@ -915,7 +907,7 @@ public:
|
|||
*/
|
||||
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.
|
||||
|
|
@ -944,7 +936,7 @@ public:
|
|||
{
|
||||
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());
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -1018,7 +1010,7 @@ public:
|
|||
std::vector<std::string> prop = m_base.properties();
|
||||
for (std::size_t i = 0; i < prop.size(); ++ i)
|
||||
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();
|
||||
}
|
||||
|
|
@ -1093,82 +1085,71 @@ public:
|
|||
#endif
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
// todo: these should probably be reconsidered.
|
||||
template <typename Property>
|
||||
class Property_back_inserter {
|
||||
|
||||
public:
|
||||
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 void pointer;
|
||||
typedef void reference;
|
||||
|
||||
private:
|
||||
|
||||
Point_set& ps;
|
||||
Property_map<Property> map;
|
||||
Index index;
|
||||
Point_set* ps;
|
||||
Property* prop;
|
||||
Index ind;
|
||||
|
||||
public:
|
||||
|
||||
Property_back_inserter(
|
||||
Point_set& ps,
|
||||
Properties::Property_array<Point_set::Index, Property>& prop,
|
||||
Index ind = Index{0}
|
||||
) : ps(ps), map(prop), index(ind) {}
|
||||
Property_back_inserter(Point_set* ps, Property* prop, Index ind=Index())
|
||||
: ps(ps), prop (prop), ind(ind) {}
|
||||
Property_back_inserter& operator++() { return *this; }
|
||||
Property_back_inserter& operator++(int) { return *this; }
|
||||
Property_back_inserter& operator*() { return *this; }
|
||||
Property_back_inserter& operator= (const value_type& p)
|
||||
{
|
||||
|
||||
if(ps.size() <= index)
|
||||
ps.insert();
|
||||
put(map, index, p);
|
||||
++index;
|
||||
if(ps->size() <= ind)
|
||||
ps->insert();
|
||||
put(*prop, ind, p);
|
||||
++ ind;
|
||||
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>
|
||||
class Push_property_map
|
||||
{
|
||||
|
||||
public:
|
||||
typedef Index key_type;
|
||||
typedef Property value_type;
|
||||
typedef typename Property::value_type value_type;
|
||||
typedef value_type& reference;
|
||||
typedef boost::read_write_property_map_tag category;
|
||||
|
||||
Point_set& ps;
|
||||
Property_map<Property> map;
|
||||
mutable Index index;
|
||||
Point_set* ps;
|
||||
Property* prop;
|
||||
mutable Index ind;
|
||||
|
||||
Push_property_map(
|
||||
Point_set& ps,
|
||||
Properties::Property_array<Point_set::Index, Property>& prop,
|
||||
Index ind = Index{0}
|
||||
) : ps(ps), map(prop) {}
|
||||
Push_property_map(Point_set* ps = nullptr,
|
||||
Property* prop = nullptr,
|
||||
Index ind=Index())
|
||||
: ps(ps), prop(prop), ind(ind) {}
|
||||
|
||||
friend void put(const Push_property_map& pm, Index& i, const value_type& t)
|
||||
{
|
||||
++pm.index;
|
||||
if(pm.ps.size() <= pm.index)
|
||||
pm.ps.insert();
|
||||
put(pm.map, pm.index, t);
|
||||
i = pm.index;
|
||||
if(pm.ps->size() <= (pm.ind))
|
||||
pm.ps->insert();
|
||||
put(*(pm.prop), pm.ind, t);
|
||||
i = pm.ind;
|
||||
++pm.ind;
|
||||
}
|
||||
|
||||
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
|
||||
/// Back inserter on indices
|
||||
/// \cgalAdvancedEnd
|
||||
typedef Property_back_inserter<Index> Index_back_inserter;
|
||||
typedef Property_back_inserter<Index_map> Index_back_inserter;
|
||||
/// \cgalAdvancedType
|
||||
/// \cgalAdvancedBegin
|
||||
/// Back inserter on points
|
||||
/// \cgalAdvancedEnd
|
||||
typedef Property_back_inserter<Point> Point_back_inserter;
|
||||
typedef Property_back_inserter<Point_map> Point_back_inserter;
|
||||
/// \cgalAdvancedType
|
||||
/// \cgalAdvancedBegin
|
||||
/// Property map for pushing new points
|
||||
/// \cgalAdvancedEnd
|
||||
typedef Push_property_map<Point> Point_push_map;
|
||||
typedef Push_property_map<Point_map> Point_push_map;
|
||||
/// \cgalAdvancedType
|
||||
/// \cgalAdvancedBegin
|
||||
/// Property map for pushing new vectors
|
||||
/// \cgalAdvancedEnd
|
||||
typedef Push_property_map<Vector> Vector_push_map;
|
||||
typedef Push_property_map<Vector_map> Vector_push_map;
|
||||
|
||||
/*!
|
||||
\cgalAdvancedFunction
|
||||
|
|
@ -1210,10 +1191,10 @@ public:
|
|||
\cgalAdvancedEnd
|
||||
*/
|
||||
template <class T>
|
||||
Push_property_map<T>
|
||||
Push_property_map<Property_map<T> >
|
||||
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
|
||||
|
|
@ -1223,7 +1204,7 @@ public:
|
|||
*/
|
||||
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
|
||||
|
|
@ -1236,8 +1217,7 @@ public:
|
|||
*/
|
||||
Vector_push_map normal_push_map ()
|
||||
{
|
||||
CGAL_precondition(m_normals.has_value());
|
||||
return Vector_push_map (*this, m_base.template get_property<Vector>("normal"));
|
||||
return Vector_push_map (this, &m_normals, size());
|
||||
}
|
||||
/*!
|
||||
\cgalAdvancedFunction
|
||||
|
|
@ -1247,7 +1227,7 @@ public:
|
|||
*/
|
||||
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
|
||||
|
|
@ -1257,7 +1237,7 @@ public:
|
|||
*/
|
||||
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());
|
||||
}
|
||||
|
||||
/// @}
|
||||
|
|
|
|||
|
|
@ -49,15 +49,17 @@ private:
|
|||
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 Push_property_map<Type> Pmap;
|
||||
typedef typename Point_set::template Push_property_map<Map> Pmap;
|
||||
Map m_map;
|
||||
Pmap m_pmap;
|
||||
std::string m_name;
|
||||
public:
|
||||
PLY_property_to_point_set_property(Point_set& ps, const std::string& name) :
|
||||
m_name(name),
|
||||
m_map(ps.add_property_map(name, Type()).first),
|
||||
m_pmap(ps.push_property_map(m_map)) {}
|
||||
PLY_property_to_point_set_property(Point_set& ps, const std::string& name)
|
||||
: m_name(name)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
|
@ -538,92 +540,102 @@ bool write_PLY(std::ostream& os,
|
|||
|
||||
bool okay = false;
|
||||
{
|
||||
auto pmap = point_set.template property_map<std::int8_t>(prop[i]);
|
||||
if(pmap)
|
||||
Int8_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<std::int8_t>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<std::uint8_t>(prop[i]);
|
||||
if(pmap)
|
||||
Uint8_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<std::uint8_t>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<std::int16_t>(prop[i]);
|
||||
if(pmap)
|
||||
Int16_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<std::int16_t>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<std::uint16_t>(prop[i]);
|
||||
if(pmap)
|
||||
Uint16_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<std::uint16_t>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<std::int32_t>(prop[i]);
|
||||
if(pmap)
|
||||
Int32_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<std::int32_t>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<std::uint32_t>(prop[i]);
|
||||
if(pmap)
|
||||
Uint32_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<std::uint32_t>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<std::int64_t>(prop[i]);
|
||||
if(pmap)
|
||||
Int64_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<std::int64_t>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<std::uint64_t>(prop[i]);
|
||||
if(pmap)
|
||||
Uint64_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<std::uint64_t>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<float>(prop[i]);
|
||||
if(pmap)
|
||||
Float_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<float>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pmap = point_set.template property_map<double>(prop[i]);
|
||||
if(pmap)
|
||||
Double_map pmap;
|
||||
boost::tie(pmap, okay) = point_set.template property_map<double>(prop[i]);
|
||||
if(okay)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ bool read_XYZ(std::istream& is,
|
|||
bool has_normals = false;
|
||||
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;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -7,9 +7,6 @@ project(Point_set_3_Tests)
|
|||
# CGAL and its components
|
||||
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_join.cpp")
|
||||
create_single_source_cgal_program("test_deprecated_io_ps.cpp")
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
||||
}
|
||||
|
|
@ -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());
|
||||
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
@ -19,15 +19,12 @@ typedef std::array<unsigned char, 3> Color;
|
|||
std::size_t nb_test = 0;
|
||||
std::size_t nb_success = 0;
|
||||
|
||||
// todo: Automatically numbering the tests is unhelpful
|
||||
void test (bool expr, const char* msg)
|
||||
{
|
||||
++ nb_test;
|
||||
if (!expr) {
|
||||
if (!expr)
|
||||
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)
|
||||
exit(1);
|
||||
} else
|
||||
else
|
||||
++ nb_success;
|
||||
}
|
||||
|
||||
|
|
@ -83,8 +80,10 @@ int main (int, char**)
|
|||
point_set.collect_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.");
|
||||
auto [color_prop, garbage] = point_set.add_property_map ("color", Color());
|
||||
test (!(point_set.has_property_map<Color> ("color")), "point set shouldn't have colors.");
|
||||
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.");
|
||||
|
||||
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.");
|
||||
}
|
||||
|
||||
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.");
|
||||
|
||||
point_set.remove_normal_map ();
|
||||
|
|
@ -114,13 +114,12 @@ int main (int, char**)
|
|||
for (const auto& p : pnt)
|
||||
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().num_properties() == 4, "point set should have 4 properties.");
|
||||
test (point_set.base().n_properties() == 4, "point set should have 4 properties.");
|
||||
|
||||
Point p_before = *(point_set.points().begin());
|
||||
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<double>("intensity")), "point set shouldn' have intensity.");
|
||||
test (!(point_set.empty()), "point set shouldn' be empty.");
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ void test (bool expr, 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;
|
||||
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);
|
||||
if (ps.has_normal_map())
|
||||
std::cerr << ", normal " << ps.normal(*it);
|
||||
if (intensity.has_value())
|
||||
std::cerr << ", intensity " << intensity.value()[*it];
|
||||
if (has_intensity)
|
||||
std::cerr << ", intensity " << intensity[*it];
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
|
@ -68,7 +70,10 @@ int main (int, char**)
|
|||
Point_set ps3;
|
||||
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);
|
||||
|
||||
Point_set::iterator it = ps3.insert (Point (double(0), double(1), double(2)),
|
||||
|
|
|
|||
|
|
@ -134,15 +134,15 @@ bool read_XYZ(std::istream& is,
|
|||
{
|
||||
iss.clear();
|
||||
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);
|
||||
Vector normal = CGAL::NULL_VECTOR;
|
||||
// ... + normal...
|
||||
if (iss >> iformat(nx))
|
||||
if (iss >> IO::iformat(nx))
|
||||
{
|
||||
// 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);
|
||||
} else {
|
||||
std::cerr << "Error line " << lineNumber << " of file (incomplete normal coordinates)" << std::endl;
|
||||
|
|
|
|||
|
|
@ -39,11 +39,7 @@
|
|||
|
||||
#include <CGAL/property_map.h>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <CGAL/boost/graph/dijkstra_shortest_paths.h> // work around a
|
||||
// bug in boost
|
||||
// 1.54
|
||||
|
||||
|
||||
#include <boost/graph/dijkstra_shortest_paths.hpp>
|
||||
#include <boost/graph/prim_minimum_spanning_tree.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
|
|
@ -553,9 +549,6 @@ create_mst_graph(
|
|||
For this reason it should not be called on sorted containers.
|
||||
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 `k >= 2`
|
||||
|
||||
|
|
|
|||
|
|
@ -1150,6 +1150,9 @@ bool adapt_patch(std::vector<std::vector<Point> >& point_patch,
|
|||
put(local_vpm, v, projector(get(local_vpm, v)));
|
||||
|
||||
// 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))
|
||||
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
|
||||
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
|
||||
|
||||
// expand the region to be filled
|
||||
|
|
|
|||
|
|
@ -49,21 +49,3 @@
|
|||
#include <CGAL/Polygon_mesh_processing/smooth_mesh.h>
|
||||
#include <CGAL/Polygon_mesh_processing/smooth_shape.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
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@
|
|||
#include <CGAL/Polygonal_surface_reconstruction/internal/hypothesis.h>
|
||||
#include <CGAL/Polygonal_surface_reconstruction/internal/compute_confidences.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>
|
||||
|
||||
|
|
@ -28,7 +32,7 @@
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgPolygonalSurfaceReconstruction
|
||||
\ingroup PkgPolygonalSurfaceReconstructionRef
|
||||
|
||||
\brief
|
||||
|
||||
|
|
@ -455,7 +459,12 @@ namespace CGAL {
|
|||
|
||||
// Converts from internal data structure to the required `PolygonMesh`.
|
||||
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 {
|
||||
error_message_ = "solving the binary program failed";
|
||||
|
|
|
|||
|
|
@ -747,7 +747,7 @@ namespace CGAL {
|
|||
if (v == Polygon_mesh::null_vertex()) // failed splitting edge
|
||||
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;
|
||||
|
||||
Edge_descriptor e1 = mesh.edge(h);
|
||||
|
|
|
|||
|
|
@ -67,6 +67,18 @@ namespace CGAL {
|
|||
delete supporting_plane_;
|
||||
supporting_plane_ = new Plane;
|
||||
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_;
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +154,7 @@ namespace CGAL {
|
|||
std::size_t idx = 0;
|
||||
for (typename PointRange::const_iterator it = points.begin(); it != points.end(); ++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);
|
||||
if (plane_index != -1) {
|
||||
auto it_and_bool = plane_index_remap.emplace(plane_index, planar_segments_.size());
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ Point_set_3
|
|||
Point_set_processing_3
|
||||
Polygon
|
||||
Polygonal_surface_reconstruction
|
||||
Polygon_mesh_processing
|
||||
Principal_component_analysis
|
||||
Principal_component_analysis_LGPL
|
||||
Profiling_tools
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
|
|||
Viewer_interface_moc.cpp
|
||||
Scene_item_moc.cpp
|
||||
Scene_item.cpp
|
||||
Scene_item_with_properties.cpp
|
||||
Triangle_container.cpp
|
||||
Edge_container.cpp
|
||||
Point_container.cpp
|
||||
|
|
@ -231,7 +232,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
|
|||
endmacro(add_item)
|
||||
|
||||
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)
|
||||
target_link_libraries(
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
|
|||
|
||||
backup_existing_colors_and_add_new();
|
||||
|
||||
auto m_cluster_id = m_points->point_set()->property_map<int>("shape");
|
||||
if (!m_cluster_id)
|
||||
bool cluster_found = false;
|
||||
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;
|
||||
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()),
|
||||
m_points->point_set()->point_map(),
|
||||
m_cluster_id.value(),
|
||||
m_cluster_id,
|
||||
m_clusters);
|
||||
|
||||
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)
|
||||
{
|
||||
auto las_classif = m_points->point_set()->property_map<unsigned char>("classification");
|
||||
las_found = las_classif.has_value();
|
||||
if (las_classif)
|
||||
Point_set::Property_map<unsigned char> las_classif;
|
||||
boost::tie (las_classif, las_found) = m_points->point_set()->property_map<unsigned char>("classification");
|
||||
if (las_found)
|
||||
{
|
||||
m_input_is_las = true;
|
||||
for (Point_set::const_iterator it = m_points->point_set()->begin();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
unsigned char uc = las_classif.value()[*it];
|
||||
m_classif.value()[*it] = int(uc);
|
||||
unsigned char uc = las_classif[*it];
|
||||
m_classif[*it] = int(uc);
|
||||
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;
|
||||
training_found = true;
|
||||
}
|
||||
|
|
@ -84,7 +85,7 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po
|
|||
{
|
||||
if (training_found)
|
||||
{
|
||||
int l = m_training.value()[*it];
|
||||
int l = m_training[*it];
|
||||
if (l >= 0)
|
||||
{
|
||||
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)
|
||||
{
|
||||
int l = m_classif.value()[*it];
|
||||
int l = m_classif[*it];
|
||||
if (l >= 0)
|
||||
{
|
||||
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();
|
||||
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 (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
|
||||
m_training.value()[*it] = -1;
|
||||
else if (m_training.value()[*it] != -1)
|
||||
m_training.value()[*it] = used_indices[std::size_t(m_training.value()[*it])];
|
||||
if (las_found && (m_training[*it] == 0 || m_training[*it] == 1)) // Unclassified class in LAS
|
||||
m_training[*it] = -1;
|
||||
else if (m_training[*it] != -1)
|
||||
m_training[*it] = used_indices[std::size_t(m_training[*it])];
|
||||
}
|
||||
if (c != -1 && m_training.value()[*it] != -1)
|
||||
m_clusters[c].training() = m_training.value()[*it];
|
||||
if (c != -1 && m_training[*it] != -1)
|
||||
m_clusters[c].training() = m_training[*it];
|
||||
}
|
||||
if (classif_found)
|
||||
{
|
||||
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
|
||||
m_classif.value()[*it] = -1;
|
||||
else if (m_classif.value()[*it] != -1)
|
||||
m_classif.value()[*it] = used_indices[std::size_t(m_classif.value()[*it])];
|
||||
if (las_found && (m_classif[*it] == 0 || m_classif[*it] == 1)) // Unclassified class in LAS
|
||||
m_classif[*it] = -1;
|
||||
else if (m_classif[*it] != -1)
|
||||
m_classif[*it] = used_indices[std::size_t(m_classif[*it])];
|
||||
}
|
||||
if (c != -1 && m_classif.value()[*it] != -1)
|
||||
m_clusters[c].label() = m_classif.value()[*it];
|
||||
if (c != -1 && m_classif[*it] != -1)
|
||||
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
|
||||
(m_points->point_set()->begin(),
|
||||
Point_set_with_cluster_info (m_points->point_set(),
|
||||
m_cluster_id.value())),
|
||||
m_cluster_id)),
|
||||
boost::make_transform_iterator
|
||||
(m_points->point_set()->end(),
|
||||
Point_set_with_cluster_info (m_points->point_set(),
|
||||
m_cluster_id.value())));
|
||||
m_cluster_id)));
|
||||
|
||||
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();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
int c = m_cluster_id.value()[*it];
|
||||
int c = m_cluster_id[*it];
|
||||
if (c != -1)
|
||||
{
|
||||
m_training.value()[*it] = m_clusters[c].training();
|
||||
m_classif.value()[*it] = m_clusters[c].label();
|
||||
m_training[*it] = m_clusters[c].training();
|
||||
m_classif[*it] = m_clusters[c].label();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_training.value()[*it] = -1;
|
||||
m_classif.value()[*it] = -1;
|
||||
m_training[*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();
|
||||
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
|
||||
if (c != -1)
|
||||
lc = label_indices[std::size_t(c)];
|
||||
|
||||
las_classif[*it] = lc;
|
||||
|
||||
int t = m_training.value()[*it];
|
||||
int t = m_training[*it];
|
||||
unsigned char lt = 1; // unclassified in LAS standard
|
||||
if (t != -1)
|
||||
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;
|
||||
for (Point_set::const_iterator it = m_points->point_set()->begin();
|
||||
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()->blue(*it)));
|
||||
|
||||
|
|
@ -402,15 +403,15 @@ void Cluster_classification::backup_existing_colors_and_add_new()
|
|||
|
||||
void Cluster_classification::reset_colors()
|
||||
{
|
||||
if (!m_color)
|
||||
if (m_color == Point_set::Property_map<CGAL::IO::Color>())
|
||||
m_points->point_set()->remove_colors();
|
||||
else
|
||||
{
|
||||
for (Point_set::const_iterator it = m_points->point_set()->begin();
|
||||
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();
|
||||
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
|
||||
{
|
||||
|
|
@ -445,7 +446,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
|
|||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
QColor color (0, 0, 0);
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
if (cid != -1)
|
||||
{
|
||||
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)
|
||||
{
|
||||
QColor color (0, 0, 0);
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
float div = 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();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
|
||||
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();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
if (cid != -1)
|
||||
{
|
||||
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();
|
||||
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 (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();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
if (cid != -1)
|
||||
{
|
||||
float v = (feature->value(cid) - min) / (max - min);
|
||||
|
|
@ -597,14 +598,15 @@ int Cluster_classification::real_index_color() const
|
|||
{
|
||||
int out = m_index_color;
|
||||
|
||||
if (out == 0 && !m_color)
|
||||
if (out == 0 && m_color == Point_set::Property_map<CGAL::IO::Color>())
|
||||
out = -1;
|
||||
return out;
|
||||
}
|
||||
|
||||
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();
|
||||
Point_set::Index idx;
|
||||
|
|
@ -627,16 +629,18 @@ void Cluster_classification::compute_features (std::size_t nb_scales, float voxe
|
|||
|
||||
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();
|
||||
if (normals)
|
||||
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");
|
||||
if (!echo_map)
|
||||
echo_map = m_points->point_set()->template property_map<std::uint8_t>("number_of_returns").value();
|
||||
Point_set::Property_map<std::uint8_t> echo_map;
|
||||
bool echo;
|
||||
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;
|
||||
|
||||
|
|
@ -651,11 +655,11 @@ void Cluster_classification::compute_features (std::size_t nb_scales, float voxe
|
|||
|
||||
generator.generate_point_based_features(pointwise_features);
|
||||
if (normals)
|
||||
generator.generate_normal_based_features (pointwise_features, normal_map.value());
|
||||
generator.generate_normal_based_features (pointwise_features, normal_map);
|
||||
if (colors)
|
||||
generator.generate_color_based_features (pointwise_features, m_color.value());
|
||||
if (echo_map)
|
||||
generator.generate_echo_based_features (pointwise_features, echo_map.value());
|
||||
generator.generate_color_based_features (pointwise_features, m_color);
|
||||
if (echo)
|
||||
generator.generate_echo_based_features (pointwise_features, echo_map);
|
||||
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
pointwise_features.end_parallel_additions();
|
||||
|
|
|
|||
|
|
@ -125,12 +125,13 @@ class Cluster_classification : public Item_classification_base
|
|||
{
|
||||
typedef typename Point_set::template Property_map<Type> Pmap;
|
||||
bool okay = false;
|
||||
auto pmap = m_points->point_set()->template property_map<Type>(name.c_str());
|
||||
if (pmap)
|
||||
Pmap 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> >
|
||||
(*(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)
|
||||
|
|
@ -138,7 +139,7 @@ class Cluster_classification : public Item_classification_base
|
|||
for (Point_set::const_iterator it = m_points->point_set()->first_selected();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
if (cid != -1)
|
||||
{
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
if (cid != -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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
if (cid != -1)
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
if (cid != -1)
|
||||
{
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
int cid = m_cluster_id.value()[*it];
|
||||
int cid = m_cluster_id[*it];
|
||||
if (cid != -1)
|
||||
{
|
||||
int c = m_clusters[cid].label();
|
||||
|
|
@ -375,10 +376,13 @@ class Cluster_classification : public Item_classification_base
|
|||
|
||||
std::vector<Cluster> m_clusters;
|
||||
|
||||
std::optional<Point_set::Property_map<CGAL::IO::Color>> m_color;
|
||||
std::optional<Point_set::Property_map<int>> m_cluster_id;
|
||||
std::optional<Point_set::Property_map<int>> m_training;
|
||||
std::optional<Point_set::Property_map<int>> m_classif;
|
||||
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;
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,20 +16,23 @@
|
|||
#include <algorithm>
|
||||
|
||||
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_training(),
|
||||
m_classif(){
|
||||
: m_points (points)
|
||||
, m_generator (nullptr)
|
||||
, m_input_is_las (false)
|
||||
{
|
||||
m_index_color = 1;
|
||||
|
||||
reset_indices();
|
||||
|
||||
auto cluster_id = m_points->point_set()->property_map<int>("shape");
|
||||
if (cluster_id)
|
||||
Point_set::Property_map<int> 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();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
int c = cluster_id.value()[*it];
|
||||
int c = cluster_id[*it];
|
||||
if (c == -1)
|
||||
continue;
|
||||
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)
|
||||
{
|
||||
auto las_classif = m_points->point_set()->property_map<unsigned char>("classification");
|
||||
las_found = las_classif.has_value();
|
||||
if (las_classif)
|
||||
Point_set::Property_map<unsigned char> las_classif;
|
||||
boost::tie (las_classif, las_found) = m_points->point_set()->property_map<unsigned char>("classification");
|
||||
if (las_found)
|
||||
{
|
||||
m_input_is_las = true;
|
||||
for (Point_set::const_iterator it = m_points->point_set()->begin();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
unsigned char uc = las_classif.value()[*it];
|
||||
m_classif.value()[*it] = int(uc);
|
||||
unsigned char uc = las_classif[*it];
|
||||
m_classif[*it] = int(uc);
|
||||
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;
|
||||
training_found = true;
|
||||
}
|
||||
|
|
@ -79,7 +82,7 @@ Point_set_item_classification::Point_set_item_classification(Scene_points_with_n
|
|||
{
|
||||
if (training_found)
|
||||
{
|
||||
int l = m_training.value()[*it];
|
||||
int l = m_training[*it];
|
||||
if (l >= 0)
|
||||
{
|
||||
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)
|
||||
{
|
||||
int l = m_classif.value()[*it];
|
||||
int l = m_classif[*it];
|
||||
if (l >= 0)
|
||||
{
|
||||
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 (las_found && (m_training.value()[*it] == 0 || m_training.value()[*it] == 1)) // Unclassified class in LAS
|
||||
m_training.value()[*it] = -1;
|
||||
else if (m_training.value()[*it] != -1)
|
||||
m_training.value()[*it] = used_indices[std::size_t(m_training.value()[*it])];
|
||||
if (las_found && (m_training[*it] == 0 || m_training[*it] == 1)) // Unclassified class in LAS
|
||||
m_training[*it] = -1;
|
||||
else if (m_training[*it] != -1)
|
||||
m_training[*it] = used_indices[std::size_t(m_training[*it])];
|
||||
}
|
||||
if (classif_found)
|
||||
{
|
||||
if (las_found && (m_classif.value()[*it] == 0 || m_classif.value()[*it] == 1)) // Unclassified class in LAS
|
||||
m_classif.value()[*it] = -1;
|
||||
else if (m_classif.value()[*it] != -1)
|
||||
m_classif.value()[*it] = used_indices[std::size_t(m_classif.value()[*it])];
|
||||
if (las_found && (m_classif[*it] == 0 || m_classif[*it] == 1)) // Unclassified class in LAS
|
||||
m_classif[*it] = -1;
|
||||
else if (m_classif[*it] != -1)
|
||||
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();
|
||||
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
|
||||
if (c != -1)
|
||||
lc = label_indices[std::size_t(c)];
|
||||
|
||||
las_classif[*it] = lc;
|
||||
|
||||
int t = m_training.value()[*it];
|
||||
int t = m_training[*it];
|
||||
unsigned char lt = 1; // unclassified in LAS standard
|
||||
if (t != -1)
|
||||
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();
|
||||
|
|
@ -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;
|
||||
for (Point_set::const_iterator it = m_points->point_set()->begin();
|
||||
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()->blue(*it)));
|
||||
|
||||
|
|
@ -336,15 +339,15 @@ void Point_set_item_classification::backup_existing_colors_and_add_new()
|
|||
|
||||
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();
|
||||
else
|
||||
{
|
||||
for (Point_set::const_iterator it = m_points->point_set()->begin();
|
||||
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();
|
||||
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
|
||||
{
|
||||
|
|
@ -379,7 +382,7 @@ void Point_set_item_classification::change_color (int index, float* vmin, float*
|
|||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
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))
|
||||
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)
|
||||
{
|
||||
QColor color (0, 0, 0);
|
||||
int c = m_training.value()[*it];
|
||||
int c2 = m_classif.value()[*it];
|
||||
int c = m_training[*it];
|
||||
int c2 = m_classif[*it];
|
||||
|
||||
if (c != -1)
|
||||
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;
|
||||
|
||||
if (out == 0 && !m_color)
|
||||
if (out == 0 && m_color == Point_set::Property_map<CGAL::IO::Color>())
|
||||
out = -1;
|
||||
return out;
|
||||
}
|
||||
|
||||
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();
|
||||
Point_set::Index idx;
|
||||
|
|
@ -520,16 +524,18 @@ void Point_set_item_classification::compute_features (std::size_t nb_scales, flo
|
|||
|
||||
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();
|
||||
if (normals)
|
||||
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");
|
||||
if (!echo_map)
|
||||
echo_map = m_points->point_set()->template add_property_map<std::uint8_t>("number_of_returns").first;
|
||||
Point_set::Property_map<std::uint8_t> echo_map;
|
||||
bool echo;
|
||||
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);
|
||||
|
||||
|
|
@ -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);
|
||||
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)
|
||||
m_generator->generate_color_based_features (m_features, m_color.value());
|
||||
if (echo_map)
|
||||
m_generator->generate_echo_based_features (m_features, echo_map.value());
|
||||
m_generator->generate_color_based_features (m_features, m_color);
|
||||
if (echo)
|
||||
m_generator->generate_echo_based_features (m_features, echo_map);
|
||||
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
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();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
training[*it] = m_training.value()[*it];
|
||||
training[*it] = m_training[*it];
|
||||
if (training[*it] != -1)
|
||||
{
|
||||
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();
|
||||
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)
|
||||
change_color (m_index_color);
|
||||
|
|
|
|||
|
|
@ -47,9 +47,13 @@ class Point_set_item_classification : public Item_classification_base
|
|||
Point_set::Property_map<int> cluster_id;
|
||||
std::vector<Cluster>* clusters;
|
||||
|
||||
Cluster_neighborhood(Point_set* point_set,
|
||||
std::vector<Cluster>& clusters)
|
||||
: point_set(point_set), clusters(&clusters), cluster_id(point_set->add_property_map<int>("shape").first) {}
|
||||
Cluster_neighborhood (Point_set* point_set,
|
||||
std::vector<Cluster>& clusters)
|
||||
: point_set (point_set)
|
||||
, clusters (&clusters)
|
||||
{
|
||||
cluster_id = point_set->property_map<int>("shape").first;
|
||||
}
|
||||
|
||||
template <typename OutputIterator>
|
||||
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)
|
||||
{
|
||||
typedef typename Point_set::template Property_map<Type> Pmap;
|
||||
auto pmap = m_points->point_set()->template property_map<Type>(name.c_str());
|
||||
if (pmap)
|
||||
bool okay = false;
|
||||
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()) << ">("
|
||||
<< name << ") as feature" << std::endl;
|
||||
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)
|
||||
|
|
@ -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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
m_training.value()[*it] = int(label);
|
||||
m_classif.value()[*it] = int(label);
|
||||
m_training[*it] = int(label);
|
||||
m_classif[*it] = int(label);
|
||||
}
|
||||
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
if (m_training.value()[*it] == int(label))
|
||||
m_training.value()[*it] = -1;
|
||||
if (m_training[*it] == int(label))
|
||||
m_training[*it] = -1;
|
||||
if (m_index_color == 1 || m_index_color == 2)
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
m_training.value()[*it] = -1;
|
||||
m_classif.value()[*it] = -1;
|
||||
m_training[*it] = -1;
|
||||
m_classif[*it] = -1;
|
||||
}
|
||||
if (m_index_color == 1 || m_index_color == 2)
|
||||
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();
|
||||
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)
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
m_training.value()[*it] = m_classif.value()[*it];
|
||||
m_training[*it] = m_classif[*it];
|
||||
|
||||
m_points->resetSelection();
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
int c = m_classif.value()[*it];
|
||||
int c = m_classif[*it];
|
||||
if (c == label)
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
int c = m_classif.value()[*it];
|
||||
int c = m_classif[*it];
|
||||
if (c != -1)
|
||||
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();
|
||||
it != m_points->point_set()->end(); ++ it)
|
||||
{
|
||||
if (m_training.value()[*it] == int(position))
|
||||
m_training.value()[*it] = -1;
|
||||
else if (m_training.value()[*it] > int(position))
|
||||
m_training.value()[*it] --;
|
||||
if (m_training[*it] == int(position))
|
||||
m_training[*it] = -1;
|
||||
else if (m_training[*it] > int(position))
|
||||
m_training[*it] --;
|
||||
|
||||
if (m_classif.value()[*it] == int(position))
|
||||
m_classif.value()[*it] = -1;
|
||||
else if (m_classif.value()[*it] > int(position))
|
||||
m_classif.value()[*it] --;
|
||||
if (m_classif[*it] == int(position))
|
||||
m_classif[*it] = -1;
|
||||
else if (m_classif[*it] > int(position))
|
||||
m_classif[*it] --;
|
||||
}
|
||||
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();
|
||||
it != m_points->point_set()->first_selected(); ++ it)
|
||||
{
|
||||
m_classif.value()[*it] = indices[*it];
|
||||
ground_truth[*it] = m_training.value()[*it];
|
||||
m_classif[*it] = indices[*it];
|
||||
ground_truth[*it] = m_training[*it];
|
||||
}
|
||||
|
||||
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::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::optional<Point_set::Property_map<int>> m_training;
|
||||
std::optional<Point_set::Property_map<int>> m_classif;
|
||||
Point_set::Property_map<int> m_training;
|
||||
Point_set::Property_map<int> m_classif;
|
||||
|
||||
Generator* m_generator;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@
|
|||
Surface_mesh_item_classification::Surface_mesh_item_classification(Scene_surface_mesh_item* mesh)
|
||||
: m_mesh (mesh),
|
||||
m_selection (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_generator (nullptr)
|
||||
{
|
||||
m_index_color = 1;
|
||||
|
||||
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("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;
|
||||
for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
|
||||
{
|
||||
m_real_color.value()[fd] = m_color.value()[fd];
|
||||
m_color.value()[fd] = CGAL::IO::Color(128, 128, 128);
|
||||
m_real_color[fd] = m_color[fd];
|
||||
m_color[fd] = CGAL::IO::Color(128, 128, 128);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -77,7 +77,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
|
|||
{
|
||||
m_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;
|
||||
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
|
|
@ -103,7 +103,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
|
|||
if (c != std::size_t(-1))
|
||||
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
|
||||
|
|
@ -120,7 +120,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
|
|||
float div = 1;
|
||||
if (c != c2)
|
||||
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.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())))
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
|
|||
for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
|
||||
{
|
||||
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.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 > 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.b(v) * 255));
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue