Merge branch 'CGAL:master' into master

This commit is contained in:
Amin Khalsi 2025-04-18 14:34:15 +01:00 committed by GitHub
commit b6a084fe02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
514 changed files with 27909 additions and 5995 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
build
/*build*
/*/*/*/build
/*/*/*/VC*

View File

@ -46,7 +46,7 @@ class Root_for_circles_2_2 {
Root_for_circles_2_2(const Root_of_2& r1, const Root_of_2& r2)
: x_(r1), y_(r2)
{
// When it is an interval this assertion dont compile
// When it is an interval this assertion doesn't compile
//CGAL_assertion((r1.is_rational() || r2.is_rational()) ||
// (r1.gamma() == r2.gamma()));
}

View File

@ -134,13 +134,13 @@ def main(argv):
avg_diff_str = str(format(abs(avg_diff_to_goal), '.2f'))
if key == "Mean_Min_Angle_(degree)" or key == "Mean_Max_Angle_(degree)":
if avg_diff_to_goal < 0 :
title += "\nIn average we loose "
title += "\nIn average we lose "
else :
title += "\nIn average we gain "
title += avg_diff_str + "° toward 60°"
elif key == "Mean_Radius_Ratio" or key == "Mean_Edge_Ratio" or key == "Mean_Aspect_Ratio" :
if avg_diff_to_goal < 0 :
title += "\nIn average we loose "
title += "\nIn average we lose "
else :
title += "\nIn average we gain "
title += avg_diff_str + " of ratio toward 1"

View File

@ -77,7 +77,7 @@ private:
public:
typedef Voronoi_radius_2<K> Voronoi_radius;
typedef typename K::Bounded_side Bounded_dide;
typedef typename K::Bounded_side Bounded_side;
public:
template<class Tag>

View File

@ -164,7 +164,7 @@
or at least issues warnings about returning a reference to temporary
variable. Can you prompt the INRIA people to fix this?
(I personally think that we should remove this example from our test-suite,
but if the INRIA people believe that it's place is there, they should at
but if the INRIA people believe that its place is there, they should at
least properly maintain it ...)
- There is a problem with the examples that use CORE on Darwin (platform #10).
Other Darwin platforms seem fine. Do we want to investigate? (perhaps it's

View File

@ -232,7 +232,7 @@ protected: // methods
// Assumes that clippingRect is valid.
std::vector< X_monotone_curve_2 > visibleParts( X_monotone_curve_2 curve );
// keep only the intersection points ie. throw out overlapping curve segments
// keep only the intersection points i.e. throw out overlapping curve segments
void filterIntersectionPoints( std::vector< CGAL::Object >& res );
protected: // members

View File

@ -1999,7 +1999,7 @@ operates in two-dimensional surfaces (not restricted to the plane),
(ii) accepts various families of \f$x\f$-monotone curves (not only
line segments), and (iii) handles overlaps. (Observe that the original
algorithm did not handle overlaps. Handling overlaps is difficult,
especially for polyline, as two polylines may overlap in more then one
especially for polyline, as two polylines may overlap in more than one
connected component.) The generic implementation serves as the
foundation of a family of concrete operations described in the rest of
this section, such as aggregately constructing an arrangement induced

View File

@ -113,7 +113,7 @@ locate(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
*
* If the type Bgt2 is the same as the type Gt2, use a reference to Gt2
* to avoid constructing a new one. Otherwise, instantiate a local variable
* of the former and provide the later as a single parameter to the
* of the former and provide the latter as a single parameter to the
* constructor.
*
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has

View File

@ -127,7 +127,11 @@ private:
public:
/*! constructs default.
*/
Arr_conic_traits_2() {}
Arr_conic_traits_2()
: m_rat_kernel(std::make_shared<Rat_kernel>()),
m_alg_kernel(std::make_shared<Alg_kernel>()),
m_nt_traits(std::make_shared<Nt_traits>())
{}
/*! constructs from resources.
*/
@ -2500,7 +2504,7 @@ public:
double min_dist = -1;
Integer aux_coeffs[6];
for (int k = 1; k <= 2; ++k) {
// Get the integer coefficients of the k'th auxiliary conic curve.
// Get the integer coefficients of the k-th auxiliary conic curve.
aux_rat_coeffs[0] = (k == 1) ? r_1 : r_2;
aux_rat_coeffs[1] = (k == 1) ? s_1 : s_2;
aux_rat_coeffs[2] = (k == 1) ? t_1 : t_2;
@ -2516,7 +2520,7 @@ public:
(CGAL::sign(aux_coeffs[2]) == ZERO)) ? 1 : 2;
// Compute the \f$x\f$- and \f$y\f$-coordinates of intersection points
// of the base conic and the k'th auxiliary conic.
// of the base conic and the k-th auxiliary conic.
int n_xs = compute_resultant_roots(*nt_traits,
base_coeffs[0], base_coeffs[1],
base_coeffs[2],

View File

@ -590,7 +590,7 @@ bool _Bezier_cache<NtTraits>::_intersection_params
// Construct the bivariate polynomial that corresponds to Equation I.
// Note that we represent a bivariate polynomial as a vector of univariate
// polynomials, whose i'th entry corresponds to the coefficient of t^i,
// polynomials, whose i-th entry corresponds to the coefficient of t^i,
// which is in turn a polynomial it s.
const int degX_2 = nt_traits.degree (polyX_2);
std::vector<Polynomial> coeffsX_st (degX_2 < 0 ? 1 : (degX_2 + 1));
@ -657,7 +657,7 @@ void _Bezier_cache<NtTraits>::_self_intersection_params
// Construct the bivariate polynomial that corresponds to Equation I.
// Note that we represent a bivariate polynomial as a vector of univariate
// polynomials, whose i'th entry corresponds to the coefficient of t^i,
// polynomials, whose i-th entry corresponds to the coefficient of t^i,
// which is in turn a polynomial it s.
const int degX = nt_traits.degree (polyX);
CGAL_assertion(degX > 0);
@ -771,7 +771,7 @@ _Bezier_cache<NtTraits>::_compute_resultant
if (nt_traits.degree (mat[i][i]) < 0)
{
// If the current diagonal value is a zero polynomial, try to replace
// the current i'th row with a row with a higher index k, such that
// the current i-th row with a row with a higher index k, such that
// mat[k][i] is not a zero polynomial.
found_row = false;
@ -786,7 +786,7 @@ _Bezier_cache<NtTraits>::_compute_resultant
if (found_row)
{
// Swap the i'th and the k'th rows (note that we start from the i'th
// Swap the i-th and the k-th rows (note that we start from the i-th
// column, because the first i entries in every row with index i or
// higher should be zero by now).
for (j = i; j < dim; j++)
@ -808,7 +808,7 @@ _Bezier_cache<NtTraits>::_compute_resultant
}
}
// Zero the whole i'th column of the following rows.
// Zero the whole i-th column of the following rows.
for (k = i + 1; k < dim; k++)
{
if (nt_traits.degree (mat[k][i]) >= 0)
@ -821,7 +821,7 @@ _Bezier_cache<NtTraits>::_compute_resultant
mat[k][j] = mat[k][j] * mat[i][i] - mat[i][j] * value;
}
// We multiplied the current row by the i'th diagonal entry, thus
// We multiplied the current row by the i-th diagonal entry, thus
// multiplying the determinant value by it. We therefore increment
// the exponent of mat[i][i] in the normalization factor.
exp_fact[i] = exp_fact[i] + 1;

View File

@ -397,7 +397,7 @@ public:
return static_cast<unsigned int>((this->_rep()._ctrl_pts.size()));
}
/*! obtains the i'th control point.
/*! obtains the i-th control point.
* \pre i must be between 0 and n - 1, where n is the number of control
* points.
*/
@ -681,7 +681,7 @@ void _Bezier_curve_2_rep<RatKer, AlgKer, NtTrt,
px = pts_begin->x();
py = pts_begin->y();
// By simplifying (1 - t)^(n-k) we obtain that the k'th expression of
// By simplifying (1 - t)^(n-k) we obtain that the k-th expression of
// the above sum is given by:
//
// n-k

View File

@ -572,7 +572,7 @@ public:
int k;
for (k = 1; k <= 2; ++k) {
// Get the integer coefficients of the k'th auxiliary conic curve.
// Get the integer coefficients of the k-th auxiliary conic curve.
aux_rat_coeffs[0] = (k == 1) ? r_1 : r_2;
aux_rat_coeffs[1] = (k == 1) ? s_1 : s_2;
aux_rat_coeffs[2] = (k == 1) ? t_1 : t_2;
@ -593,7 +593,7 @@ public:
}
// Compute the x- and y-coordinates of intersection points of the base
// conic and the k'th auxiliary conic.
// conic and the k-th auxiliary conic.
n_xs = compute_resultant_roots(nt_traits,
base_coeffs[0], base_coeffs[1],
base_coeffs[2],

View File

@ -1078,7 +1078,7 @@ private:
}
public:
/*! obtains the i'th order derivative by x of the conic at the point p=(x,y).
/*! obtains the i-th order derivative by x of the conic at the point p=(x,y).
* \param p The point where we derive.
* \param i The order of the derivatives (either 1, 2 or 3).
* \param slope_numer The numerator of the slope.
@ -1187,7 +1187,7 @@ public:
CGAL_error();
}
/*! obtains the i'th order derivative by y of the conic at the point p=(x,y).
/*! obtains the i-th order derivative by y of the conic at the point p=(x,y).
* \param p The point where we derive.
* \param i The order of the derivatives (either 1, 2 or 3).
* \param slope_numer The numerator of the slope.

View File

@ -77,7 +77,7 @@ bisect_control_polygon_2(InputIterator ctrl_pts_begin,
while (last_index > 0)
{
// Construct (m - 1) control points from the m point we currently have,
// where the new i'th point is the midpoint between p[i] and p[i + 1].
// where the new i-th point is the midpoint between p[i] and p[i + 1].
for (i = 0; i < last_index; ++i)
vec[i] = midpoint(vec[i], vec[i + 1]);
@ -134,7 +134,7 @@ typename InputIterator::value_type point_on_Bezier_curve_2
while (last_index > 0)
{
// Construct (m - 1) control points from the m point we currently have,
// where the new i'th point is given by: (1 - t0)*p[i] + t0*p[i + 1].
// where the new i-th point is given by: (1 - t0)*p[i] + t0*p[i + 1].
for (i = 0; i < last_index; ++i)
{
vec[i] = _Point_2(comp_t0*vec[i].x() + t0*vec[i + 1].x(),
@ -197,7 +197,7 @@ typename InputIterator::value_type de_Casteljau_2
while (last_index > 0)
{
// Construct (m - 1) control points from the m point we currently have,
// where the new i'th point is given by: (1 - t0)*p[i] + t0*p[i + 1].
// where the new i-th point is given by: (1 - t0)*p[i] + t0*p[i + 1].
for (i = 0; i < last_index; ++i)
{
vec[i] = _Point_2(comp_t0*vec[i].x() + t0*vec[i + 1].x(),

View File

@ -241,7 +241,7 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
* If the type Ovl_gt2 is the same as the type
* GeomTraits, use a reference to GeomTraits to avoid constructing a new one.
* Otherwise, instantiate a local variable of the former and provide
* the later as a single parameter to the constructor.
* the latter as a single parameter to the constructor.
*
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
* only an implicit constructor, (which takes *b as a parameter).

View File

@ -1992,10 +1992,10 @@ public:
determines according to pre defined conditions whether the
current Trapezoidal_decomposition_2<Traits> needs update
Postconditions:
The output is true iff the depth of the Trapezoidal Tree is more then
The output is true iff the depth of the Trapezoidal Tree is more than
DepthThreshold times log of the X_curve count or the Trapezoidal Tree's
size
is more then SizeThreshold times the log of the last count.
is more than SizeThreshold times the log of the last count.
*/
bool set_with_guarantees(bool u)
{

View File

@ -2625,7 +2625,7 @@ protected:
if ((! is_vert(cv[0]) && (cmp_x(get_min_v(cv[i]), q) == EQUAL)) ||
(is_vert(cv[0]) && equal(get_min_v(cv[i]), q))) {
// q is the left endpoint of the i'th subcurve:
// q is the left endpoint of the i-th subcurve:
if (to_right) return i;
else {
// to_left
@ -2642,7 +2642,7 @@ protected:
if ((! is_vert(cv[0]) && (cmp_x(get_max_v(cv[i]), q) == EQUAL)) ||
(is_vert(cv[0]) && equal(get_max_v(cv[i]), q))) {
// q is the right endpoint of the i'th subcurve:
// q is the right endpoint of the i-th subcurve:
if (! to_right) return i;
else {
if (direction == SMALLER) {

View File

@ -598,15 +598,15 @@ public:
if (dir == SMALLER){
// Check whether the split point is xcv[i]'s source or target.
if (equal(max_vertex(xcv[i]), p)) {
// The entire i'th subcurve belongs to xcv1:
// The entire i-th subcurve belongs to xcv1:
xcv1.push_back(xcv[i]);
}
else if (equal(min_vertex(xcv[i]), p)) {
// The entire i'th subcurves belongs to xcv2:
// The entire i-th subcurves belongs to xcv2:
xcv2.push_back(xcv[i]);
}
else {
// The i'th subcurve should be split: The left part(seg1)
// The i-th subcurve should be split: The left part(seg1)
// goes to xcv1, and the right part(seg2) goes to xcv2.
X_monotone_subcurve_2 seg1, seg2;
m_poly_traits.subcurve_traits_2()->split_2_object()(xcv[i], p,

View File

@ -281,7 +281,7 @@ is_in_face(const Face* f, const Point_2& p, const Vertex* v) const
// -----------
// cv1 coincide with the identification curve. In this case we
// consider the identification to be on the right. All (interior)
// points are smaller then the right boundary.
// points are smaller than the right boundary.
rc1 = SMALLER;
rc2 = cmp_x_pt_ce(p, cv2, ARR_MAX_END);
}
@ -294,7 +294,7 @@ is_in_face(const Face* f, const Point_2& p, const Vertex* v) const
// -----------
// cv2 coincide with the identification curve. In this case we
// consider the identification to be on the left. All (interior)
// points are larger then the left boundary.
// points are larger than the left boundary.
rc1 = cmp_x_pt_ce(p, cv1, ARR_MAX_END);
rc2 = LARGER;
}

View File

@ -117,7 +117,7 @@ decompose(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
*
* If the type Vgt2 is the same as the type Gt2, use a
* reference to Gt2 to avoid constructing a new one. Otherwise,
* instantiate a local variable of the former and provide the later as a
* instantiate a local variable of the former and provide the latter as a
* single parameter to the constructor.
*
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has

View File

@ -264,7 +264,7 @@ insert_empty(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
* If the type C_visitor::Geometry_traits_2 is the same as the type
* GeometryTraits_2, use a reference to GeometryTraits_2 to avoid constructing
* a new one. Otherwise, instantiate a local variable of the former and
* provide the later as a single parameter to the constructor.
* provide the latter as a single parameter to the constructor.
*
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
* only an implicit constructor, (which takes *b as a parameter).
@ -319,7 +319,7 @@ void insert_empty(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>&
* If the type C_visitor::Geometry_traits_2 is the same as the type
* GeometryTraits_2, use a reference to GeometryTraits_2 to avoid constructing
* a new one. Otherwise, instantiate a local variable of the former and
* provide the later as a single parameter to the constructor.
* provide the latter as a single parameter to the constructor.
*
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
* only an implicit constructor, (which takes *b as a parameter).
@ -372,7 +372,7 @@ void insert_non_empty(Arrangement_on_surface_2<GeometryTraits_2,
* If the type Igt2 is the same as the type
* GeometryTraits_2, use a reference to GeometryTraits_2 to avoid constructing
* a new one. Otherwise, instantiate a local variable of the former and
* provide the later as a single parameter to the constructor.
* provide the latter as a single parameter to the constructor.
*
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
* only an implicit constructor, (which takes *b as a parameter).
@ -972,7 +972,7 @@ non_intersecting_insert_non_empty(Arrangement_on_surface_2<GeometryTraits_2,
* If the type Nxi_visitor::Geometry_traits_2 is the same as the type
* GeometryTraits_2, use a reference to GeometryTraits_2 to avoid constructing
* a new one. Otherwise, instantiate a local variable of the former and
* provide the later as a single parameter to the constructor.
* provide the latter as a single parameter to the constructor.
*
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
* only an implicit constructor, (which takes *b as a parameter).

View File

@ -541,7 +541,7 @@ public:
for (i = 1; i <= n_roots; i++)
{
// Get the i'th real-valued root.
// Get the i-th real-valued root.
*oi = rootOf(poly, i);
++oi;
}
@ -603,7 +603,7 @@ public:
for (i = 0; i < root_intervals.size(); i++)
{
// Get the i'th real-valued root.
// Get the i-th real-valued root.
*oi = rootOf(poly, root_intervals[i]);
++oi;
}

View File

@ -197,11 +197,11 @@ public:
void init_subcurve_in_arrangement_flags(size_t n)
{ m_isCurveInArr.resize(n, false); }
/*! checks if the i'th subcurve is in the arrangement. */
/*! checks if the i-th subcurve is in the arrangement. */
bool is_subcurve_in_arrangement(unsigned int i) const
{ return (m_isCurveInArr[i]); }
/*! sets the flag indicating whether the i'th subcurve is in the arrangement.
/*! sets the flag indicating whether the i-th subcurve is in the arrangement.
*/
void set_subcurve_in_arrangement(unsigned int i, bool flag)
{ m_isCurveInArr[i] = flag; }

View File

@ -563,7 +563,7 @@ template <typename InputStream_>
bool IO_base_test<Base_geom_traits>::read_segment(InputStream_& is,
Subcurve_2& seg)
{
//we dont need to check this type as it has already been checked in the
//we don't need to check this type as it has already been checked in the
//IO_test.h
char type;
is >> type;
@ -600,7 +600,7 @@ template <typename InputStream_>
bool IO_base_test<Base_geom_traits>::read_xsegment(InputStream_& is,
X_monotone_subcurve_2& xseg)
{
//we dont need to check this type as it has already been checked in the
//we don't need to check this type as it has already been checked in the
//IO_test.h
char type;
is >> type;

View File

@ -116,7 +116,7 @@ int main(int argc, char* argv[])
std::cout << argv[2]
<< " was generated successfully"
<< ", dont forget to add it to test_construction.cmd"
<< ", don't forget to add it to test_construction.cmd"
<< std::endl;
return 0;
}

View File

@ -586,7 +586,7 @@ so that they <em>virtually</em> become border edges when exploring a seam mesh w
The input mesh is referred to as <em>underlying</em> mesh of the seam mesh.
We denote `tm` and `sm` the underlying mesh and the seam mesh respectively.
Figure \cgalFigureRef{fig_Seam_mesh_1} shows an example of mesh on which two
\cgalFigureRef{fig_Seam_mesh_1} shows an example of mesh on which two
edges, defined by the halfedge pairs `h2-h3` and `h6-h7`, are marked as seams.
The introduction of virtual borders modifies the elementary \bgl graph traversal
operations: when we circulate around the target of `h7` in the underlying mesh,
@ -600,7 +600,7 @@ A seam mesh with two seam edges `(h2, h3)` and `(h6, h7)`.
\cgalFigureEnd
A vertex of the underlying mesh may correspond to multiple vertices in the seam mesh.
For example in Figure \cgalFigureRef{fig_Seam_mesh_1}, the target of `h7` corresponds to two
For example in \cgalFigureRef{fig_Seam_mesh_1}, the target of `h7` corresponds to two
vertices in the seam mesh, on either side of the virtual border created by the seam edges.
For this reason, a vertex `v` of the seam mesh is internally represented as a halfedge `h`
of the seam mesh. To obtain a canonical definition, the halfedge `h` is defined as the halfedge
@ -612,7 +612,7 @@ For vertices `v` in the underlying mesh that are not on a seam edge, we choose
\subsubsection BGLSeamMeshTraversal Seam Mesh Traversal
Using the function `next(halfedge_descriptor, FaceGraph)`, we can walk around a face but also around
a border of a mesh. For the seam mesh `sm` from Figure \cgalFigureRef{fig_Seam_mesh_1},
a border of a mesh. For the seam mesh `sm` from \cgalFigureRef{fig_Seam_mesh_1},
we have `opposite(h2, sm) == h3*`, and it holds that `face(h3*, sm) == null_face()`.
We can walk along this virtual border: starting at `h3*` and repeatedly calling `next(..,sm)`,
we will traverse `h6*`, `h7*`, `h2*`, before reaching `h3*` again.

View File

@ -19,7 +19,8 @@ INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/IO/polygon_mesh_io.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/METIS/partition_graph.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/METIS/partition_dual_graph.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/alpha_expansion_graphcut.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/graph_traits_inheritance_macros.h
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/graph_traits_inheritance_macros.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/dijkstra_shortest_path.h
EXAMPLE_PATH += ${CGAL_Surface_mesh_skeletonization_EXAMPLE_DIR} \

View File

@ -467,6 +467,9 @@ the requirement for traversal of all faces in a graph.
/// \defgroup PkgBGLPartition Partitioning Operations
/// \ingroup PkgBGLRef
/// \defgroup PkgBGLTraversal Graph Traversal
/// \ingroup PkgBGLRef
/// \defgroup PkgBGLIOFct I/O Functions
/// \ingroup PkgBGLRef
@ -586,6 +589,12 @@ Methods to split a mesh into subdomains, using the library
implementation.
*/
/*!
\addtogroup PkgBGLTraversal
Methods to traverse a graph, for example to find the shortest path between two vertices.
*/
/*!
\addtogroup PkgBGLIOFct
@ -762,6 +771,9 @@ user might encounter.
\cgalCRPSection{Conversion Functions}
- `CGAL::split_graph_into_polylines()`
\cgalCRPSection{Graph Traversal}
- `CGAL::dijkstra_shortest_path()`
\cgalCRPSection{Graph Adaptors}
- `CGAL::Dual`
- `CGAL::Face_filtered_graph`

View File

@ -22,6 +22,7 @@
\example BGL_surface_mesh/prim.cpp
\example BGL_surface_mesh/gwdwg.cpp
\example BGL_surface_mesh/seam_mesh.cpp
\example BGL_surface_mesh/shortest_path.cpp
\example BGL_surface_mesh/write_inp.cpp
\example BGL_surface_mesh/surface_mesh_dual.cpp
\example BGL_surface_mesh/connected_components.cpp

View File

@ -7,7 +7,7 @@ project(BGL_OpenMesh_Examples)
# CGAL and its components
find_package(CGAL REQUIRED)
find_package(OpenMesh)
find_package(OpenMesh QUIET)
if(OpenMesh_FOUND)
include(CGAL_OpenMesh_support)
create_single_source_cgal_program("TriMesh.cpp")

View File

@ -9,6 +9,7 @@ create_single_source_cgal_program("seam_mesh.cpp")
create_single_source_cgal_program("write_inp.cpp")
create_single_source_cgal_program("surface_mesh_dual.cpp")
create_single_source_cgal_program("connected_components.cpp")
create_single_source_cgal_program("shortest_path.cpp")
find_package(METIS QUIET)
include(CGAL_METIS_support)

View File

@ -0,0 +1,83 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/boost/graph/dijkstra_shortest_path.h>
#include <CGAL/IO/polygon_mesh_io.h>
#include <string>
#include <vector>
#include <fstream>
#include <exception>
#include <algorithm>
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
using Point = K::Point_3;
using Mesh = CGAL::Surface_mesh<Point>;
using vertex_descriptor = boost::graph_traits<Mesh>::vertex_descriptor;
using edge_descriptor = boost::graph_traits<Mesh>::edge_descriptor;
using halfedge_descriptor = boost::graph_traits<Mesh>::halfedge_descriptor;
namespace params = CGAL::parameters;
// Example main
int main(int argc, char** argv)
{
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/elephant.off");
// Try building a surface_mesh
Mesh sm;
bool ok = CGAL::IO::read_polygon_mesh(filename, sm);
if (!ok || !sm.is_valid() || sm.is_empty())
{
std::cerr << "Error: Invalid facegraph" << std::endl;
std::cerr << "Filename = " << filename << std::endl;
return EXIT_FAILURE;
}
const std::size_t i0 = 0;
const std::size_t i1 = num_vertices(sm) / 2;
// Get the vertex descriptors of the source and target vertices
const vertex_descriptor vs = *vertices(sm).first;
vertex_descriptor vt;
std::size_t vid = 0;
for (const vertex_descriptor v : vertices(sm))
{
if (vid++ == i1)
{
vt = v;
break;
}
}
std::list<halfedge_descriptor> halfedge_sequence;
CGAL::dijkstra_shortest_path(vs, vt, sm,
std::back_inserter(halfedge_sequence));
assert(source(halfedge_sequence.front(), sm)==vs);
assert(target(halfedge_sequence.back(), sm)==vt);
// dump
std::cout << "Shortest path between vertices " << i0 << " and " << i1
<< " is made of " << halfedge_sequence.size() << " halfedges." << std::endl;
// Get the property map of the points of the mesh
auto vpmap = get(CGAL::vertex_point, sm);
std::ofstream out("shortest_path.polylines.txt");
out << halfedge_sequence.size()+1 << " " << get(vpmap, source(halfedge_sequence.front(),sm));
for (const halfedge_descriptor he : halfedge_sequence)
{
const vertex_descriptor v = target(he, sm);
out << " " << get(vpmap, v);
}
out << std::endl;
out.close();
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,160 @@
// Copyright (c) 2025 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) : Jane Tournois, Andreas Fabri
//
#ifndef CGAL_BOOST_GRAPH_DIJKSTRA_SHORTEST_PATH_H
#define CGAL_BOOST_GRAPH_DIJKSTRA_SHORTEST_PATH_H
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <CGAL/Named_function_parameters.h>
#include <CGAL/boost/graph/named_params_helper.h>
#include <boost/property_map/property_map.hpp>
#include <CGAL/boost/graph/properties.h>
#include <list>
#include <unordered_map>
namespace CGAL {
namespace internal {
/// An exception used while catching a throw that stops Dijkstra's algorithm
/// once the shortest path to a target has been found.
class Dijkstra_end_exception : public std::exception
{
const char* what() const throw ()
{
return "Dijkstra shortest path: reached the target vertex.";
}
};
/// Visitor to stop Dijkstra's algorithm once the given target turns 'BLACK',
/// that is when the target has been examined through all its incident edges and
/// the shortest path is thus known.
template<typename Graph, typename VertexEdgeMap>
class Stop_at_target_Dijkstra_visitor : public boost::default_dijkstra_visitor
{
using vertex_descriptor = typename boost::graph_traits<Graph>::vertex_descriptor;
using edge_descriptor = typename boost::graph_traits<Graph>::edge_descriptor;
public:
vertex_descriptor destination_vd;
VertexEdgeMap& relaxed_edges;
Stop_at_target_Dijkstra_visitor(vertex_descriptor destination_vd,
VertexEdgeMap& relaxed_edges)
: destination_vd(destination_vd), relaxed_edges(relaxed_edges)
{}
void edge_relaxed(const edge_descriptor& e, const Graph& g) const
{
relaxed_edges[target(e, g)] = e;
}
void finish_vertex(const vertex_descriptor& vd, const Graph& /* g*/) const
{
if (vd == destination_vd)
throw Dijkstra_end_exception();
}
};
} // namespace internal
/*!
* \ingroup PkgBGLTraversal
* computes the shortest path between two vertices in a graph `g`, where the vertices must belong to the same connected component of `g`.
*
* @tparam Graph a model of the concept `HalfedgeListGraph`
* @tparam OutputIterator an output iterator with value type `boost::graph_traits<Graph>::%halfedge_descriptor`
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
*
* @param vs source vertex
* @param vt target vertex
* @param g the graph
* @param halfedge_sequence_oit the output iterator holding the output sequence
* of halfedges that form the shortest path from `vs` to `vt` on `g`
* @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{edge_weight_map}
* \cgalParamDescription{a property map associating to each edge in the graph its weight or "length".
* The weights must all be non-negative.}
* \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<PolygonMesh>::%edge_descriptor`
* as key type and a value type which as specified in the named parameter `distance_map`of the function
<A href="https://www.boost.org/doc/libs/release/libs/graph/doc/dijkstra_shortest_paths.html">`boost::graph::dijkstra_shortest_paths()`</A>,
with any model of `RingNumberType` fulfilling the requirements. }
* \cgalParamDefault{`get(boost::edge_weight, mesh)`}
* \cgalParamNEnd
*
* \cgalParamNBegin{vertex_index_map}
* \cgalParamDescription{a property map associating to each vertex of `g` a unique index between `0` and `num_vertices(g) - 1`}
* \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
* as key type and `std::size_t` as value type}
* \cgalParamDefault{an automatically indexed internal map}
* \cgalParamNEnd
* \cgalNamedParamsEnd
*/
template<typename Graph,
typename OutputIterator,
typename NamedParameters = parameters::Default_named_parameters>
OutputIterator dijkstra_shortest_path(
const typename boost::graph_traits<Graph>::vertex_descriptor vs,//source
const typename boost::graph_traits<Graph>::vertex_descriptor vt,//target
const Graph& g,
OutputIterator halfedge_sequence_oit,
const NamedParameters& np = parameters::default_values())
{
using vertex_descriptor = typename boost::graph_traits<Graph>::vertex_descriptor;
using halfedge_descriptor = typename boost::graph_traits<Graph>::halfedge_descriptor;
using edge_descriptor = typename boost::graph_traits<Graph>::edge_descriptor;
using Pred_umap = std::unordered_map<vertex_descriptor, vertex_descriptor>;
using Pred_pmap = boost::associative_property_map<Pred_umap>;
using parameters::get_parameter;
using parameters::choose_parameter;
const auto w_map = choose_parameter(get_parameter(np, internal_np::edge_weight),
get(boost::edge_weight, g));
const auto vim = get_initialized_vertex_index_map(g, np);
Pred_umap predecessor;
Pred_pmap pred_pmap(predecessor);
using VEMap = std::unordered_map<vertex_descriptor, edge_descriptor>;
VEMap relaxed_edges_map;
internal::Stop_at_target_Dijkstra_visitor<Graph, VEMap> vis(vt, relaxed_edges_map);
try
{
boost::dijkstra_shortest_paths(g, vs,
boost::predecessor_map(pred_pmap)
.visitor(vis)
.weight_map(w_map)
.vertex_index_map(vim));
}
catch (const internal::Dijkstra_end_exception& ){}
std::list<halfedge_descriptor> path;
vertex_descriptor t = vt;
do {
path.push_front(halfedge(relaxed_edges_map[t],g));
t = get(pred_pmap, t);
}while (t != vs);
for(auto he : path){
*halfedge_sequence_oit++ = he;
}
return halfedge_sequence_oit;
}
} // namespace CGAL
#endif //CGAL_BOOST_GRAPH_DIJKSTRA_SHORTEST_PATH_H

View File

@ -540,7 +540,7 @@ template <class Traits_, class TopTraits_, class ValidationPolicy>
}
//insert non-sipmle poloygons with holes (non incident edges may have
// common vertex, but they dont intersect at their interior
// common vertex, but they don't intersect at their interior
template <class Traits_, class TopTraits_, class ValidationPolicy>
void Gps_on_surface_base_2<Traits_, TopTraits_, ValidationPolicy>::
_insert(const Polygon_with_holes_2 & pgn, Arrangement_on_surface_2 & arr)

View File

@ -407,7 +407,7 @@ is_crossover_outer_boundary(const typename Traits_2::Polygon_with_holes_2& pgn,
Vertex_const_handle cver;
Point_2 second_point;
if (cmp_endpoints(*next) == SMALLER) {
// next curve's minimum is the joint vertex. Look if it's max exists in
// next curve's minimum is the joint vertex. Look if its max exists in
// the arrangement and insert lexicographically
second_point = max_functor(*next);
obj = pl.locate(second_point);
@ -639,8 +639,7 @@ bool are_holes_and_boundary_pairwise_disjoint
typedef typename Polygon_set_2::Arrangement_on_surface_2
Arrangement_2;
/* Should be perfored more efficeintly than using sweep and than
* difference().
/* Should be perfored more efficiently than using sweep and then difference().
*
* Use sweep to find intersections on the interior of curves (not on vertices)
* and overlapping edges which are not allowed (note that 0/1 dimension
@ -758,7 +757,7 @@ bool are_holes_and_boundary_pairwise_disjoint
/* A valid polygon with holes is :
* 1 - Has empty or closed boundary and all the holes are closed
* 2 - The PWH is relatively simple polygon (holes are simple...)
* 3 - Has it's boundary oriented counterclockwise and the holes oriented
* 3 - Has its boundary oriented counterclockwise and the holes oriented
* clockwise
* 4 - All the segments (boundary and holes) do not cross or intersect in their
* relative interior

View File

@ -227,7 +227,7 @@ int main(int argc, char *argv[])
write_complement_to_file(out, p1);
write_complement_to_file(out, p2);
std::cout<<argv[3] <<
" was generated successfully, dont forget to add it to test_bop.cmd"
" was generated successfully, don't forget to add it to test_bop.cmd"
<< std::endl;
return (0);
@ -239,7 +239,7 @@ int main(int argc, char *argv[])
write_complement_to_file(out, p1);
write_complement_to_file(out, pwh2);
std::cout<<argv[3] <<
" was generated successfully, dont forget to add it to test_bop.cmd"
" was generated successfully, don't forget to add it to test_bop.cmd"
<< std::endl;
return (0);
@ -251,7 +251,7 @@ int main(int argc, char *argv[])
write_complement_to_file(out, pwh1);
write_complement_to_file(out, p2);
std::cout<<argv[3] <<
" was generated successfully, dont forget to add it to test_bop.cmd"
" was generated successfully, don't forget to add it to test_bop.cmd"
<< std::endl;
return (0);
@ -263,7 +263,7 @@ int main(int argc, char *argv[])
write_complement_to_file(out, pwh1);
write_complement_to_file(out, pwh2);
std::cout<<argv[3] <<
" was generated successfully, dont forget to add it to test_bop.cmd"
" was generated successfully, don't forget to add it to test_bop.cmd"
<< std::endl;
return (0);

View File

@ -30,7 +30,7 @@ specialization of the algorithm for the case when the center
coordinates and radii of the input spheres are floating-point numbers.
This specialized algorithm uses floating-point arithmetic only, is
very fast and especially tuned for stability and robustness. Still,
it's output may be incorrect in some (rare) cases; termination is
its output may be incorrect in some (rare) cases; termination is
guaranteed.
When default constructed, an instance of type

View File

@ -47,7 +47,7 @@ namespace CGAL {
//
// E* = { y | (y - c)^T M'/alpha (y - c) + mu <= 0 }.
//
// Expanding the later and comparing with the original form we
// Expanding the latter and comparing with the original form we
// obtain
//
// c = - M'^{-1} m

View File

@ -268,7 +268,7 @@ as follows:
A note on performance: The algorithm sorts and partitions the input
sequences. It is clearly costly to copy a large box compared to a
simple pointer. However, the algorithm benefits from memory locality
in the later stages when it copies the boxes, while the pointers would
in the latter stages when it copies the boxes, while the pointers would
refer to boxes that become wildly scattered in memory. These two
effects, copying costs and memory locality, counteract each other. For
small box sizes, i.e., small dimension, memory locality wins and one

View File

@ -382,7 +382,7 @@ int Polynomial<NT>::getTrueDegree() const {
return -1; // Zero polynomial
}
//get i'th Coeff. We check whether i is not greater than the
//get i-th Coeff. We check whether i is not greater than the
// true degree and if not then return coeff[i] o/w 0
template <class NT>
NT Polynomial<NT>::getCoeffi(int i) const {

View File

@ -69,7 +69,7 @@ public:
// the array seq is not used!
// Hence, one must test these special cases
Polynomial<NT> * seq; // array of polynomials of length "len+1"
Polynomial<NT> g;//GCD of input polynomial P and it's derivative P'
Polynomial<NT> g;//GCD of input polynomial P and its derivative P'
NT cont;//Content of the square-free part of input polynomial P
//Thus P = g * cont * seq[0]
static const int N_STOP_ITER = 10000; // Stop IterE after this many iterations.

View File

@ -88,11 +88,10 @@ read_vtk_image_data(vtkImageData* vtk_image, Image_3::Own owning = Image_3::OWN_
// If there is more than a scalar per point, vtk_image->data is not immediately
// interpretable in Image_3->data
CGAL_assertion(owning == Image_3::OWN_THE_DATA || cn == 1);
CGAL_assertion(vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples() == dims[0]*dims[1]*dims[2]);
CGAL_assertion(vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples() == static_cast<vtkIdType>(image->xdim*image->ydim*image->zdim));
if(owning == Image_3::OWN_THE_DATA) {
int dims_n = dims[0]*dims[1]*dims[2];
std::size_t dims_n = image->xdim*image->ydim*image->zdim;
image->data = ::ImageIO_alloc(dims_n * image->wdim);
// std::cerr << "GetNumberOfTuples() = " << vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples() << "\n"
@ -110,7 +109,7 @@ read_vtk_image_data(vtkImageData* vtk_image, Image_3::Own owning = Image_3::OWN_
char* src = static_cast<char*>(vtk_image->GetPointData()->GetScalars()->GetVoidPointer(0));
char* dest = static_cast<char*>(image->data);
for(int i=0; i<dims_n; ++i)
for(std::size_t i=0; i<dims_n; ++i)
{
// multiply by image->wdim because we casted to char* and not the actual data type
memcpy(dest + image->wdim*i, src + cn*image->wdim*i, image->wdim);

View File

@ -25,6 +25,7 @@ namespace CGAL {
template <class R_ >
class CircleC2
{
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT;
typedef typename R_::RT RT;
typedef typename R_::Circle_2 Circle_2;
@ -49,8 +50,8 @@ public:
base = Rep(center, squared_radius, orient);
}
bool operator==(const CircleC2 &s) const;
bool operator!=(const CircleC2 &s) const;
Boolean operator==(const CircleC2& s) const;
Boolean operator!=(const CircleC2& s) const;
const Point_2 & center() const
{
@ -69,6 +70,25 @@ public:
};
template < class R >
typename R::Boolean
CircleC2<R>::operator==(const CircleC2<R> &t) const
{
if (CGAL::identical(base, t.base))
return true;
return center() == t.center() &&
squared_radius() == t.squared_radius() &&
orientation() == t.orientation();
}
template < class R >
typename R::Boolean
CircleC2<R>::operator!=(const CircleC2<R> &t) const
{
return !(*this == t);
}
} //namespace CGAL
#endif // CGAL_CARTESIAN_CIRCLE_2_H

View File

@ -23,6 +23,8 @@ namespace CGAL {
template <class R_ >
class CircleC3 {
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::Sphere_3 Sphere_3;
typedef typename R_::Plane_3 Plane_3;
typedef typename R_::Point_3 Point_3;
@ -130,12 +132,12 @@ public:
return diametral_sphere();
}
Point_3 center() const
decltype(auto) center() const
{
return diametral_sphere().center();
}
FT squared_radius() const
decltype(auto) squared_radius() const
{
return diametral_sphere().squared_radius();
}
@ -155,7 +157,7 @@ public:
return CGAL_PI * CGAL_PI * 4.0 * to_double(squared_radius());
}
FT area_divided_by_pi() const
decltype(auto) area_divided_by_pi() const
{
return squared_radius();
}
@ -200,15 +202,15 @@ public:
(x+mx).sup(),(y+my).sup(),(z+mz).sup());
}
bool operator==(const CircleC3 &) const;
bool operator!=(const CircleC3 &) const;
Boolean operator==(const CircleC3 &) const;
Boolean operator!=(const CircleC3 &) const;
bool has_on(const Point_3 &p) const;
bool has_on_bounded_side(const Point_3 &p) const;
bool has_on_unbounded_side(const Point_3 &p) const;
Boolean has_on(const Point_3 &p) const;
Boolean has_on_bounded_side(const Point_3 &p) const;
Boolean has_on_unbounded_side(const Point_3 &p) const;
Bounded_side bounded_side(const Point_3 &p) const;
bool is_degenerate() const
Boolean is_degenerate() const
{
return diametral_sphere().is_degenerate();
}
@ -217,7 +219,7 @@ public:
template < class R >
inline
bool
typename R::Boolean
CircleC3<R>::
has_on(const typename CircleC3<R>::Point_3 &p) const
{
@ -227,7 +229,7 @@ has_on(const typename CircleC3<R>::Point_3 &p) const
template < class R >
inline
bool
typename R::Boolean
CircleC3<R>::
has_on_bounded_side(const typename CircleC3<R>::Point_3 &p) const
{
@ -237,7 +239,7 @@ has_on_bounded_side(const typename CircleC3<R>::Point_3 &p) const
template < class R >
inline
bool
typename R::Boolean
CircleC3<R>::
has_on_unbounded_side(const typename CircleC3<R>::Point_3 &p) const
{
@ -246,8 +248,7 @@ has_on_unbounded_side(const typename CircleC3<R>::Point_3 &p) const
}
template < class R >
CGAL_KERNEL_INLINE
Bounded_side
typename R::Bounded_side
CircleC3<R>::
bounded_side(const typename CircleC3<R>::Point_3 &p) const
{
@ -256,8 +257,7 @@ bounded_side(const typename CircleC3<R>::Point_3 &p) const
}
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
CircleC3<R>::operator==(const CircleC3<R> &t) const
{
if (CGAL::identical(base, t.base))
@ -283,8 +283,7 @@ CircleC3<R>::operator==(const CircleC3<R> &t) const
}
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
CircleC3<R>::operator!=(const CircleC3<R> &t) const
{
return !(*this == t);

View File

@ -26,6 +26,8 @@ template < class R_ >
class DirectionC2
{
typedef DirectionC2<R_> Self;
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT;
typedef FT RT;
typedef typename R_::Point_2 Point_2;
@ -49,8 +51,8 @@ public:
DirectionC2(const FT &x, const FT &y)
: base{x, y} {}
bool operator==(const DirectionC2 &d) const;
bool operator!=(const DirectionC2 &d) const;
Boolean operator==(const DirectionC2 &d) const;
Boolean operator!=(const DirectionC2 &d) const;
Vector_2 to_vector() const;
@ -66,7 +68,7 @@ public:
template < class R >
inline
bool
typename R::Boolean
DirectionC2<R>::operator==(const DirectionC2<R> &d) const
{
if (CGAL::identical(base, d.base))
@ -76,7 +78,7 @@ DirectionC2<R>::operator==(const DirectionC2<R> &d) const
template < class R >
inline
bool
typename R::Boolean
DirectionC2<R>::operator!=(const DirectionC2<R> &d) const
{
return !( *this == d );

View File

@ -26,6 +26,8 @@ namespace CGAL {
template < class R_ >
class Iso_cuboidC3
{
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::FT FT;
typedef typename R_::Iso_cuboid_3 Iso_cuboid_3;
typedef typename R_::Point_3 Point_3;
@ -98,8 +100,8 @@ public:
Construct_point_3()(max_hx/hw, max_hy/hw, max_hz/hw)));
}
typename R::Boolean operator==(const Iso_cuboidC3& s) const;
typename R::Boolean operator!=(const Iso_cuboidC3& s) const;
Boolean operator==(const Iso_cuboidC3& s) const;
Boolean operator!=(const Iso_cuboidC3& s) const;
const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
@ -118,11 +120,11 @@ public:
}
Bounded_side bounded_side(const Point_3& p) const;
typename R::Boolean has_on(const Point_3& p) const;
typename R::Boolean has_on_boundary(const Point_3& p) const;
typename R::Boolean has_on_bounded_side(const Point_3& p) const;
typename R::Boolean has_on_unbounded_side(const Point_3& p) const;
typename R::Boolean is_degenerate() const;
Boolean has_on(const Point_3& p) const;
Boolean has_on_boundary(const Point_3& p) const;
Boolean has_on_bounded_side(const Point_3& p) const;
Boolean has_on_unbounded_side(const Point_3& p) const;
Boolean is_degenerate() const;
const FT & xmin() const;
const FT & ymin() const;
const FT & zmin() const;
@ -267,7 +269,7 @@ Iso_cuboidC3<R>::volume() const
template < class R >
CGAL_KERNEL_MEDIUM_INLINE
Bounded_side
typename R::Bounded_side
Iso_cuboidC3<R>::
bounded_side(const typename Iso_cuboidC3<R>::Point_3& p) const
{

View File

@ -24,6 +24,7 @@ namespace CGAL {
template < class R_ >
class LineC3
{
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT;
typedef typename R_::Point_3 Point_3;
typedef typename R_::Vector_3 Vector_3;
@ -65,8 +66,8 @@ public:
LineC3(const Point_3 &p, const Direction_3 &d)
{ *this = R().construct_line_3_object()(p, d); }
bool operator==(const LineC3 &l) const;
bool operator!=(const LineC3 &l) const;
typename R::Boolean operator==(const LineC3 &l) const;
typename R::Boolean operator!=(const LineC3 &l) const;
Plane_3 perpendicular_plane(const Point_3 &p) const;
Line_3 opposite() const;
@ -88,13 +89,13 @@ public:
Point_3 point(const FT i) const;
bool has_on(const Point_3 &p) const;
bool is_degenerate() const;
Boolean has_on(const Point_3 &p) const;
Boolean is_degenerate() const;
};
template < class R >
inline
bool
typename R::Boolean
LineC3<R>::operator==(const LineC3<R> &l) const
{
if (CGAL::identical(base, l.base))
@ -104,7 +105,7 @@ LineC3<R>::operator==(const LineC3<R> &l) const
template < class R >
inline
bool
typename R::Boolean
LineC3<R>::operator!=(const LineC3<R> &l) const
{
return !(*this == l);
@ -135,7 +136,7 @@ LineC3<R>::opposite() const
template < class R >
inline
bool
typename R::Boolean
LineC3<R>::
has_on(const typename LineC3<R>::Point_3 &p) const
{
@ -144,7 +145,7 @@ has_on(const typename LineC3<R>::Point_3 &p) const
template < class R >
inline
bool
typename R::Boolean
LineC3<R>::is_degenerate() const
{
return to_vector() == NULL_VECTOR;

View File

@ -169,7 +169,9 @@ inline
typename PlaneC3<R>::Point_3
PlaneC3<R>::point() const
{
return point_on_plane(*this);
FT x, y, z;
point_on_planeC3(a(), b(), c(), d(), x, y, z);
return R().construct_point_3_object()(x, y, z);
}
template < class R >
@ -178,7 +180,13 @@ typename PlaneC3<R>::Point_3
PlaneC3<R>::
projection(const typename PlaneC3<R>::Point_3 &p) const
{
return projection_plane(p, *this);
FT x, y, z;
projection_planeC3(a(), b(), c(), d(),
R().compute_x_3_object()(p),
R().compute_y_3_object()(p),
R().compute_z_3_object()(p),
x, y, z);
return R().construct_point_3_object()(x, y, z);
}
template < class R >

View File

@ -107,6 +107,15 @@ public:
return base.cartesian_end();
}
typename R_::Boolean operator==(const PointC3 &p) const
{
return base == p.base;
}
typename R_::Boolean operator!=(const PointC3 &p) const
{
return !(*this == p);
}
int dimension() const
{
return base.dimension();

View File

@ -25,6 +25,7 @@ namespace CGAL {
template < class R_ >
class SegmentC3
{
typedef typename R_::Boolean Boolean;
typedef typename R_::Point_3 Point_3;
typedef typename R_::Direction_3 Direction_3;
typedef typename R_::Vector_3 Vector_3;
@ -44,11 +45,11 @@ public:
SegmentC3(const Point_3 &sp, const Point_3 &ep)
: base{sp, ep} {}
bool has_on(const Point_3 &p) const;
bool collinear_has_on(const Point_3 &p) const;
Boolean has_on(const Point_3 &p) const;
Boolean collinear_has_on(const Point_3 &p) const;
bool operator==(const SegmentC3 &s) const;
bool operator!=(const SegmentC3 &s) const;
Boolean operator==(const SegmentC3 &s) const;
Boolean operator!=(const SegmentC3 &s) const;
const Point_3 & source() const
{
@ -73,12 +74,12 @@ public:
Line_3 supporting_line() const;
Segment_3 opposite() const;
bool is_degenerate() const;
Boolean is_degenerate() const;
};
template < class R >
inline
bool
typename R::Boolean
SegmentC3<R>::operator==(const SegmentC3<R> &s) const
{
if (CGAL::identical(base, s.base))
@ -88,7 +89,7 @@ SegmentC3<R>::operator==(const SegmentC3<R> &s) const
template < class R >
inline
bool
typename R::Boolean
SegmentC3<R>::operator!=(const SegmentC3<R> &s) const
{
return !(*this == s);
@ -184,7 +185,7 @@ SegmentC3<R>::opposite() const
template < class R >
inline
bool
typename R::Boolean
SegmentC3<R>::is_degenerate() const
{
return source() == target();
@ -192,7 +193,7 @@ SegmentC3<R>::is_degenerate() const
template < class R >
inline
bool
typename R::Boolean
SegmentC3<R>::
has_on(const typename SegmentC3<R>::Point_3 &p) const
{
@ -201,7 +202,7 @@ has_on(const typename SegmentC3<R>::Point_3 &p) const
template < class R >
inline
bool
typename R::Boolean
SegmentC3<R>::
collinear_has_on(const typename SegmentC3<R>::Point_3 &p) const
{

View File

@ -27,6 +27,8 @@ namespace CGAL {
template <class R_>
class SphereC3
{
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::FT FT;
// https://doc.cgal.org/latest/Manual/devman_code_format.html#secprogramming_conventions
typedef typename R_::Point_3 Point_3_;
@ -124,17 +126,17 @@ public:
//! precond: ! x.is_degenerate() (when available)
// Returns R::ON_POSITIVE_SIDE, R::ON_ORIENTED_BOUNDARY or
// R::ON_NEGATIVE_SIDE
typename R::Boolean has_on(const Circle_3 &p) const;
typename R::Boolean has_on(const Point_3_ &p) const;
typename R::Boolean has_on_boundary(const Point_3_ &p) const;
typename R::Boolean has_on_positive_side(const Point_3_ &p) const;
typename R::Boolean has_on_negative_side(const Point_3_ &p) const;
Boolean has_on(const Circle_3 &p) const;
Boolean has_on(const Point_3_ &p) const;
Boolean has_on_boundary(const Point_3_ &p) const;
Boolean has_on_positive_side(const Point_3_ &p) const;
Boolean has_on_negative_side(const Point_3_ &p) const;
typename R_::Bounded_side bounded_side(const Point_3_ &p) const;
Bounded_side bounded_side(const Point_3_ &p) const;
//! precond: ! x.is_degenerate() (when available)
// Returns R::ON_BOUNDED_SIDE, R::ON_BOUNDARY or R::ON_UNBOUNDED_SIDE
typename R::Boolean has_on_bounded_side(const Point_3_ &p) const;
typename R::Boolean has_on_unbounded_side(const Point_3_ &p) const;
Boolean has_on_bounded_side(const Point_3_ &p) const;
Boolean has_on_unbounded_side(const Point_3_ &p) const;
};
template < class R >
@ -163,6 +165,7 @@ typename R::Oriented_side
SphereC3<R>::
oriented_side(const typename SphereC3<R>::Point_3_ &p) const
{
typedef typename R::Oriented_side Oriented_side;
return enum_cast<Oriented_side>(bounded_side(p)) * orientation();
}
@ -172,6 +175,7 @@ typename R::Bounded_side
SphereC3<R>::
bounded_side(const typename SphereC3<R>::Point_3_ &p) const
{
typedef typename R::Bounded_side Bounded_side;
return enum_cast<Bounded_side>(compare(squared_radius(),
squared_distance(center(), p)));
}

View File

@ -143,7 +143,7 @@ oriented_side(const typename TetrahedronC3<R>::Point_3 &p) const
{
typename R::Orientation o = orientation();
if (o != ZERO)
return enum_cast<Oriented_side>(bounded_side(p)) * o;
return enum_cast<typename R::Oriented_side>(bounded_side(p)) * o;
CGAL_kernel_assertion (!is_degenerate());
return ON_ORIENTED_BOUNDARY;

View File

@ -25,6 +25,7 @@ namespace CGAL {
template <class R_>
class TriangleC3
{
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT;
typedef typename R_::Point_3 Point_3;
typedef typename R_::Vector_3 Vector_3;
@ -44,13 +45,13 @@ public:
TriangleC3(const Point_3 &p, const Point_3 &q, const Point_3 &r)
: base{p, q, r} {}
bool operator==(const TriangleC3 &t) const;
bool operator!=(const TriangleC3 &t) const;
Boolean operator==(const TriangleC3 &t) const;
Boolean operator!=(const TriangleC3 &t) const;
Plane_3 supporting_plane() const;
bool has_on(const Point_3 &p) const;
bool is_degenerate() const;
Boolean has_on(const Point_3 &p) const;
Boolean is_degenerate() const;
const Point_3 & vertex(int i) const;
const Point_3 & operator[](int i) const;
@ -59,7 +60,7 @@ public:
};
template < class R >
bool
typename R::Boolean
TriangleC3<R>::operator==(const TriangleC3<R> &t) const
{
if (CGAL::identical(base, t.base))
@ -75,7 +76,7 @@ TriangleC3<R>::operator==(const TriangleC3<R> &t) const
template < class R >
inline
bool
typename R::Boolean
TriangleC3<R>::operator!=(const TriangleC3<R> &t) const
{
return !(*this == t);
@ -118,7 +119,7 @@ TriangleC3<R>::supporting_plane() const
template < class R >
inline
bool
typename R::Boolean
TriangleC3<R>::
has_on(const typename TriangleC3<R>::Point_3 &p) const
{
@ -127,7 +128,7 @@ has_on(const typename TriangleC3<R>::Point_3 &p) const
}
template < class R >
bool
typename R::Boolean
TriangleC3<R>::is_degenerate() const
{
return collinear(vertex(0),vertex(1),vertex(2));

View File

@ -107,7 +107,7 @@ public:
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
operator==(const VectorC2<R> &v, const VectorC2<R> &w)
{
return w.x() == v.x() && w.y() == v.y();
@ -115,7 +115,7 @@ operator==(const VectorC2<R> &v, const VectorC2<R> &w)
template < class R >
inline
bool
typename R::Boolean
operator!=(const VectorC2<R> &v, const VectorC2<R> &w)
{
return !(v == w);
@ -123,7 +123,7 @@ operator!=(const VectorC2<R> &v, const VectorC2<R> &w)
template < class R >
inline
bool
typename R::Boolean
operator==(const VectorC2<R> &v, const Null_vector &)
{
return CGAL_NTS is_zero(v.x()) && CGAL_NTS is_zero(v.y());
@ -131,7 +131,7 @@ operator==(const VectorC2<R> &v, const Null_vector &)
template < class R >
inline
bool
typename R::Boolean
operator==(const Null_vector &n, const VectorC2<R> &v)
{
return v == n;
@ -139,7 +139,7 @@ operator==(const Null_vector &n, const VectorC2<R> &v)
template < class R >
inline
bool
typename R::Boolean
operator!=(const VectorC2<R> &v, const Null_vector &n)
{
return !(v == n);
@ -147,7 +147,7 @@ operator!=(const VectorC2<R> &v, const Null_vector &n)
template < class R >
inline
bool
typename R::Boolean
operator!=(const Null_vector &n, const VectorC2<R> &v)
{
return !(v == n);

View File

@ -142,15 +142,15 @@ public:
template < class R >
inline
bool
typename R::Boolean
operator==(const VectorC3<R> &v, const VectorC3<R> &w)
{
return w.x() == v.x() && w.y() == v.y() && w.z() == v.z();
return CGAL_AND_3(w.x() == v.x(), w.y() == v.y(), w.z() == v.z());
}
template < class R >
inline
bool
typename R::Boolean
operator!=(const VectorC3<R> &v, const VectorC3<R> &w)
{
return !(v == w);
@ -158,16 +158,15 @@ operator!=(const VectorC3<R> &v, const VectorC3<R> &w)
template < class R >
inline
bool
typename R::Boolean
operator==(const VectorC3<R> &v, const Null_vector &)
{
return CGAL_NTS is_zero(v.x()) && CGAL_NTS is_zero(v.y()) &&
CGAL_NTS is_zero(v.z());
return CGAL_AND_3(CGAL_NTS is_zero(v.x()), CGAL_NTS is_zero(v.y()), CGAL_NTS is_zero(v.z()));
}
template < class R >
inline
bool
typename R::Boolean
operator==(const Null_vector &n, const VectorC3<R> &v)
{
return v == n;
@ -175,7 +174,7 @@ operator==(const Null_vector &n, const VectorC3<R> &v)
template < class R >
inline
bool
typename R::Boolean
operator!=(const VectorC3<R> &v, const Null_vector &n)
{
return !(v == n);
@ -183,7 +182,7 @@ operator!=(const VectorC3<R> &v, const Null_vector &n)
template < class R >
inline
bool
typename R::Boolean
operator!=(const Null_vector &n, const VectorC3<R> &v)
{
return !(v == n);

View File

@ -17,7 +17,6 @@
#ifndef CGAL_CARTESIAN_BASIC_CONSTRUCTIONS_3_H
#define CGAL_CARTESIAN_BASIC_CONSTRUCTIONS_3_H
#include <CGAL/Cartesian/point_constructions_3.h>
#include <CGAL/Cartesian/plane_constructions_3.h>
#include <CGAL/Cartesian/ft_constructions_3.h>

File diff suppressed because it is too large Load Diff

View File

@ -1,50 +0,0 @@
// Copyright (c) 2000
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). 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) : Herve Bronnimann
#ifndef CGAL_CARTESIAN_POINT_CONSTRUCTIONS_3_H
#define CGAL_CARTESIAN_POINT_CONSTRUCTIONS_3_H
#include <CGAL/Cartesian/Point_3.h>
#include <CGAL/constructions/kernel_ftC3.h>
namespace CGAL {
template <class K>
CGAL_KERNEL_LARGE_INLINE
PointC3<K>
point_on_plane(const PlaneC3<K> &p)
{
typename K::FT x, y, z;
point_on_planeC3(p.a(), p.b(), p.c(), p.d(), x, y, z);
return PointC3<K>(x, y, z);
}
template <class K>
CGAL_KERNEL_LARGE_INLINE
PointC3<K>
projection_plane(const PointC3<K> &p,
const PlaneC3<K> &h)
{
typename K::FT x, y, z;
projection_planeC3(h.a(), h.b(), h.c(), h.d(),
p.x(), p.y(), p.z(),
x, y, z);
return PointC3<K>(x, y, z);
}
} //namespace CGAL
#endif // CGAL_CARTESIAN_POINT_CONSTRUCTIONS_3_H

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class K >
inline
bool
typename K::Boolean
equal_xy(const PointC2<K> &p, const PointC2<K> &q)
{
return CGAL_AND( p.x() == q.x() , p.y() == q.y() );
@ -34,7 +34,7 @@ equal_xy(const PointC2<K> &p, const PointC2<K> &q)
// Unused, undocumented, un-functorized.
template < class K >
inline
Comparison_result
typename K::Comparison_result
compare_deltax_deltay(const PointC2<K>& p,
const PointC2<K>& q,
const PointC2<K>& r,
@ -46,7 +46,7 @@ compare_deltax_deltay(const PointC2<K>& p,
template < class K >
inline
Comparison_result
typename K::Comparison_result
compare_lexicographically_yx(const PointC2<K> &p,
const PointC2<K> &q)
{

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class K >
inline
bool
typename K::Boolean
equal_xy(const PointC3<K> &p, const PointC3<K> &q)
{
return K().equal_xy_3_object()(p, q);
@ -32,7 +32,7 @@ equal_xy(const PointC3<K> &p, const PointC3<K> &q)
template < class K >
inline
bool
typename K::Boolean
equal_xyz(const PointC3<K> &p, const PointC3<K> &q)
{
return p.x() == q.x() && p.y() == q.y() && p.z() == q.z();
@ -40,7 +40,7 @@ equal_xyz(const PointC3<K> &p, const PointC3<K> &q)
template < class K >
inline
Comparison_result
typename K::Comparison_result
compare_xy(const PointC3<K> &p, const PointC3<K> &q)
{
return K().compare_xy_3_object()(p, q);
@ -48,7 +48,7 @@ compare_xy(const PointC3<K> &p, const PointC3<K> &q)
template < class K >
inline
Comparison_result
typename K::Comparison_result
compare_lexicographically_xy(const PointC3<K> &p, const PointC3<K> &q)
{
return K().compare_xy_3_object()(p, q);
@ -56,7 +56,7 @@ compare_lexicographically_xy(const PointC3<K> &p, const PointC3<K> &q)
template < class K >
inline
bool
typename K::Boolean
lexicographically_xy_smaller_or_equal(const PointC3<K> &p,
const PointC3<K> &q)
{
@ -65,7 +65,7 @@ lexicographically_xy_smaller_or_equal(const PointC3<K> &p,
template < class K >
inline
bool
typename K::Boolean
lexicographically_xy_smaller(const PointC3<K> &p,
const PointC3<K> &q)
{
@ -74,7 +74,7 @@ lexicographically_xy_smaller(const PointC3<K> &p,
template < class K >
inline
bool
typename K::Boolean
strict_dominance(const PointC3<K> &p,
const PointC3<K> &q)
{
@ -84,7 +84,7 @@ strict_dominance(const PointC3<K> &p,
template < class K >
inline
bool
typename K::Boolean
dominance(const PointC3<K> &p,
const PointC3<K> &q)
{

View File

@ -421,6 +421,7 @@ typename Same_uncertainty_nt<Angle, FT>::type
angleC2(const FT &ux, const FT &uy,
const FT &vx, const FT &vy)
{
typedef typename Same_uncertainty_nt<Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign(ux*vx + uy*vy));
}
@ -431,6 +432,7 @@ angleC2(const FT &px, const FT &py,
const FT &qx, const FT &qy,
const FT &rx, const FT &ry)
{
typedef typename Same_uncertainty_nt<Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-qx)+(py-qy)*(ry-qy)));
}
@ -442,6 +444,7 @@ angleC2(const FT &px, const FT &py,
const FT &rx, const FT &ry,
const FT &sx, const FT &sy)
{
typedef typename Same_uncertainty_nt<Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-sx)+(py-qy)*(ry-sy)));
}
@ -508,6 +511,7 @@ side_of_bounded_circleC2(const FT &px, const FT &py,
const FT &rx, const FT &ry,
const FT &tx, const FT &ty)
{
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
return enum_cast<Bounded_side>( side_of_oriented_circleC2(px,py,qx,qy,rx,ry,tx,ty)
* orientationC2(px,py,qx,qy,rx,ry) );
}
@ -520,8 +524,8 @@ side_of_bounded_circleC2(const FT &px, const FT &py,
const FT &tx, const FT &ty)
{
// Returns whether T lies inside or outside the circle which diameter is PQ.
return enum_cast<Bounded_side>(
CGAL_NTS compare((tx-px)*(qx-tx), (ty-py)*(ty-qy)) );
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
return enum_cast<Bounded_side>(CGAL_NTS compare((tx-px)*(qx-tx), (ty-py)*(ty-qy)) );
}
template < class FT >
@ -630,7 +634,7 @@ side_of_oriented_lineC2(const FT &a, const FT &b, const FT &c,
}
template <class FT>
Comparison_result
typename Compare<FT>::result_type
compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt,
const FT& qx, const FT& qy, const FT& qwt,
const FT& rx, const FT& ry)
@ -643,24 +647,25 @@ compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt,
template <class FT>
CGAL_KERNEL_MEDIUM_INLINE
Bounded_side
typename Same_uncertainty_nt<Bounded_side, FT>::type
power_side_of_bounded_power_circleC2(const FT &px, const FT &py, const FT &pw,
const FT &qx, const FT &qy, const FT &qw,
const FT &tx, const FT &ty, const FT &tw)
{
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
FT dpx = px - qx;
FT dpy = py - qy;
FT dtx = tx - qx;
FT dty = ty - qy;
FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy);
return enum_cast<Bounded_side>
(CGAL_NTS sign(-(CGAL_NTS square(dtx) + CGAL_NTS square(dty)-tw+qw)*dpz
return enum_cast<Bounded_side>(CGAL_NTS sign(-(CGAL_NTS square(dtx) + CGAL_NTS square(dty)-tw+qw)*dpz
+(dpz-pw+qw)*(dpx*dtx+dpy*dty)));
}
template <class FT>
Oriented_side
typename Same_uncertainty_nt<Oriented_side, FT>::type
power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt,
const FT &qx, const FT &qy, const FT &qwt,
const FT &rx, const FT &ry, const FT &rwt,
@ -685,7 +690,7 @@ power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt,
}
template <class FT>
Oriented_side
typename Same_uncertainty_nt<Oriented_side, FT>::type
power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt,
const FT &qx, const FT &qy, const FT &qwt,
const FT &tx, const FT &ty, const FT &twt)
@ -709,7 +714,7 @@ power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt,
}
template <class FT>
Oriented_side
typename Same_uncertainty_nt<Oriented_side, FT>::type
circumcenter_oriented_side_of_oriented_segmentC2(const FT& ax, const FT& ay,
const FT& bx, const FT& by,
const FT& p0x, const FT& p0y,

View File

@ -143,6 +143,7 @@ typename Same_uncertainty_nt<Angle, FT>::type
angleC3(const FT &ux, const FT &uy, const FT &uz,
const FT &vx, const FT &vy, const FT &vz)
{
typedef typename Same_uncertainty_nt<CGAL::Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign(ux*vx + uy*vy + uz*vz));
}
@ -153,6 +154,7 @@ angleC3(const FT &px, const FT &py, const FT &pz,
const FT &qx, const FT &qy, const FT &qz,
const FT &rx, const FT &ry, const FT &rz)
{
typedef typename Same_uncertainty_nt<CGAL::Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-qx)+
(py-qy)*(ry-qy)+
(pz-qz)*(rz-qz)));
@ -166,6 +168,7 @@ angleC3(const FT &px, const FT &py, const FT &pz,
const FT &rx, const FT &ry, const FT &rz,
const FT &sx, const FT &sy, const FT &sz)
{
typedef typename Same_uncertainty_nt<CGAL::Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-sx)+
(py-qy)*(ry-sy)+
(pz-qz)*(rz-sz)));
@ -220,6 +223,8 @@ coplanar_side_of_bounded_circleC3(const FT &px, const FT &py, const FT &pz,
const FT &rx, const FT &ry, const FT &rz,
const FT &tx, const FT &ty, const FT &tz)
{
typedef typename Same_uncertainty_nt<CGAL::Bounded_side, FT>::type Bounded_side;
// The approach is to compute side_of_bounded_sphere(p,q,r,t+v,t),
// with v = pq ^ pr.
// Note : since the circle defines the orientation of the plane, it can not
@ -373,6 +378,7 @@ side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz,
const FT &sx, const FT &sy, const FT &sz,
const FT &tx, const FT &ty, const FT &tz)
{
typedef typename Same_uncertainty_nt<CGAL::Bounded_side, FT>::type Bounded_side;
return enum_cast<Bounded_side>( side_of_oriented_sphereC3(px, py, pz,
qx, qy, qz,
rx, ry, rz,
@ -392,6 +398,7 @@ side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz,
const FT &tx, const FT &ty, const FT &tz)
{
// Returns whether T lies inside or outside the sphere which diameter is PQ.
typedef typename Same_uncertainty_nt<CGAL::Bounded_side, FT>::type Bounded_side;
return enum_cast<Bounded_side>( CGAL_NTS sign((tx-px)*(qx-tx)
+ (ty-py)*(qy-ty)
+ (tz-pz)*(qz-tz)) );
@ -420,9 +427,9 @@ side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz,
{
// Returns whether T lies inside or outside the sphere which equatorial
// circle is PQR.
typedef typename Same_uncertainty_nt<CGAL::Bounded_side, FT>::type Bounded_side;
// This code is inspired by the one of circumcenterC3(3 points).
FT psx = px-sx;
FT psy = py-sy;
FT psz = pz-sz;
@ -688,7 +695,7 @@ power_side_of_oriented_power_sphereC3(const FT &pwt, const FT &qwt)
}
template < class FT >
Comparison_result
typename Compare<FT>::result_type
compare_power_distanceC3(const FT &px, const FT &py, const FT &pz,
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
const FT &rx, const FT &ry, const FT &rz, const FT &rw)
@ -715,6 +722,8 @@ power_side_of_bounded_power_sphereC3(
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
const FT &sx, const FT &sy, const FT &sz, const FT &sw)
{
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
// Translate p to origin and compute determinants
FT qpx = qx-px;
FT qpy = qy-py;
@ -765,6 +774,8 @@ power_side_of_bounded_power_sphereC3(
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
const FT &rx, const FT &ry, const FT &rz, const FT &rw)
{
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
FT FT2(2);
FT dpx = px - qx;
FT dpy = py - qy;

View File

@ -64,7 +64,7 @@ In std::cerr :
Only the time needed to compute it. (it is useful to benchmark a lot of cases and redirect it on a .txt)
ATTENTION:
1) dont use ./example a b
1) don't use ./example a b
with 5 <= a <= 8 and 0 <= b <= 8, we cannot use the Circulartraits to handle the files
2) The files have to be put on a folder name DXF where the program is located

View File

@ -5,6 +5,7 @@ typedef CGAL::Exact_circular_kernel_2 Circular_k;
typedef CGAL::Point_2<Circular_k> Point_2;
typedef CGAL::Circular_arc_2<Circular_k> Circular_arc_2;
typedef CGAL::Circular_arc_point_2<Circular_k> Circular_arc_point_2;
int main()
{
@ -13,8 +14,8 @@ int main()
for(int i = 0; i <= 10; i++) {
for(int j = 0; j <= 10; j++) {
Point_2 p = Point_2(i, j);
if(Circular_k().has_on_2_object()(c,p)) {
Circular_arc_point_2 cap(Point_2(i, j));
if(Circular_k().has_on_2_object()(c,cap)) {
n++;
std::cout << "(" << i << "," << j << ")" << std::endl;
}

View File

@ -656,7 +656,7 @@ public:
return CGAL::CircularFunctors::circular_arc_bbox<CK>(*this);
}
// Dont use this function, it is only for internal use
// Don't use this function, it is only for internal use
void _setx_info(unsigned short int v_is_x_monotone,
unsigned short int v_two_end_points_on_upper_part,
unsigned short int v_is_complementary_x_monotone) const {

View File

@ -31,25 +31,29 @@ namespace CGAL {
namespace CircularFunctors {
template < class CK >
class Construct_circle_2 : public CK::Linear_kernel::Construct_circle_2
class Construct_circle_2
// : public CK::Linear_kernel::Construct_circle_2
{
typedef typename CK::Linear_kernel::Construct_circle_2 Base_functor;
typedef typename CK::FT FT;
typedef typename CK::Linear_kernel::Point_2 Point_2;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Linear_kernel::Construct_circle_2 Linear_Construct_circle_2;
public:
typedef typename Base_functor::result_type result_type;
// using Linear_Construct_circle_2::operator();
using Base_functor::operator();
template <class... Args>
decltype(auto)
operator()(const Args&... args) const
{ return Linear_Construct_circle_2()(args...); }
typedef typename CK::Circular_arc_2 Circular_arc_2;
result_type
Circle_2
operator() ( const typename CK::Polynomial_for_circles_2_2 &eq ) {
return construct_circle_2<CK>(eq);
}
result_type
decltype(auto)
operator() (const Circular_arc_2 & a) const {
return (a.rep().supporting_circle());
}

View File

@ -30,26 +30,32 @@ namespace CGAL {
namespace LinearFunctors {
template < class CK >
class Construct_line_2 : public CK::Linear_kernel::Construct_line_2
class Construct_line_2
// : public CK::Linear_kernel::Construct_line_2
{
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Line_2 Line_2;
public:
typedef typename CK::Linear_kernel::Construct_line_2::result_type
result_type;
using CK::Linear_kernel::Construct_line_2::operator();
typedef typename CK::Linear_kernel::Construct_line_2 Linear_Construct_circle_2;
result_type operator() (const Line_arc_2 & a) const
public:
// using CK::Linear_kernel::Construct_line_2::operator();
template <class... Args>
decltype(auto)
operator()(const Args&... args) const
{ return Linear_Construct_circle_2()(args...); }
decltype(auto) operator() (const Line_arc_2 & a) const
{
return (a.rep().supporting_line());
}
result_type
Line_2
operator() ( const typename CK::Polynomial_1_2 &eq )
{
return construct_line_2<CK>(eq);
}
{
return construct_line_2<CK>(eq);
}
};
} // namespace LinearFunctors

View File

@ -30,148 +30,115 @@
namespace CGAL {
namespace CircularFunctors {
#define CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(V)\
template < class CK > \
class Compare_ ##V## _2 {\
/*: public CK::Linear_kernel::Compare_ ##V## _2{*/\
typedef typename CK::Comparison_result Comparison_result;\
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;\
typedef typename CK::Linear_kernel::Compare_ ##V## _2 Linear_Compare_ ##V## _2;\
public:\
template <class... Args>\
Comparison_result\
operator()(const Args&... args) const\
{ return Linear_Compare_ ##V## _2()(args...); }\
/*using CK::Linear_kernel::Compare_ ##V## _2::operator();*/\
Comparison_result\
operator() (const Circular_arc_point_2 &p0,\
const Circular_arc_point_2 &p1) const\
{ return CircularFunctors::compare_ ##V <CK>(p0, p1); }\
};\
template < class CK >
class Compare_x_2
: public CK::Linear_kernel::Compare_x_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Point_2 Point_2;
CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(x)
CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(y)
CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(xy)
public:
typedef typename CK::Linear_kernel::Compare_x_2::result_type result_type;
using CK::Linear_kernel::Compare_x_2::operator();
result_type
operator() (const Circular_arc_point_2 &p0,
const Circular_arc_point_2 &p1) const
{ return CircularFunctors::compare_x<CK>(p0, p1);}
};
template < class CK >
class Compare_y_2
: public CK::Linear_kernel::Compare_y_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Point_2 Point_2;
public:
typedef typename CK::Linear_kernel::Compare_y_2::result_type result_type;
using CK::Linear_kernel::Compare_y_2::operator();
result_type
operator() (const Circular_arc_point_2 &p0,
const Circular_arc_point_2 &p1) const
{return CircularFunctors::compare_y<CK>(p0, p1);}
};
template < class CK >
class Compare_xy_2
: public CK::Linear_kernel::Compare_xy_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Point_2 Point_2;
public:
typedef typename CK::Linear_kernel::Compare_xy_2::result_type result_type;
using CK::Linear_kernel::Compare_xy_2::operator();
result_type
operator() (const Circular_arc_point_2 &p0,
const Circular_arc_point_2 &p1) const
{ return CircularFunctors::compare_xy<CK>(p0, p1);}
};
#undef CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_
template < class CK >
class In_x_range_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef bool result_type;
result_type
Boolean
operator()(const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::point_in_x_range<CK>(a, p); }
result_type
Boolean
operator()(const Line_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::point_in_x_range<CK>(a, p); }
};
template < class CK >
class Has_on_2
: public CK::Linear_kernel::Has_on_2
// : public CK::Linear_kernel::Has_on_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Line_2 Line_2;
typedef typename CK::Linear_kernel::Has_on_2 Linear_Has_on_2;
public:
typedef typename CK::Linear_kernel::Has_on_2::result_type result_type;
// using CK::Linear_kernel::Has_on_2::operator();
using CK::Linear_kernel::Has_on_2::operator();
template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const
{ return Linear_Has_on_2()(a, b); }
result_type
Boolean
operator()(const Circle_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::has_on<CK>(a, p); }
result_type
Boolean
operator()(const Line_2 &a, const Circular_arc_point_2 &p) const
{ return LinearFunctors::has_on<CK>(a, p); }
result_type
Boolean
operator()(const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::has_on<CK>(a, p); }
result_type
Boolean
operator()(const Line_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::has_on<CK>(a, p); }
};
template < class CK >
class Compare_y_to_right_2
{
typedef typename CK::Comparison_result Comparison_result;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef CGAL::Comparison_result result_type;
result_type
Comparison_result
operator()(const Circular_arc_2 &a1,
const Circular_arc_2 &a2,
const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type
Comparison_result
operator()(const Line_arc_2 &a1,
const Line_arc_2 &a2,
const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type
Comparison_result
operator()(const Line_arc_2 &a1,
const Circular_arc_2 &a2,
const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type
Comparison_result
operator()(const Circular_arc_2 &a1,
const Line_arc_2 &a2,
const Circular_arc_point_2 &p) const
@ -179,21 +146,16 @@ namespace CircularFunctors {
return CGAL::SMALLER;
return CGAL::LARGER;
}
};
template < class CK >
class Equal_2
: public CK::Linear_kernel::Equal_2
// : public CK::Linear_kernel::Equal_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef typename CK::Linear_kernel LK;
typedef typename LK::Equal_2 LK_Equal_2;
typedef typename CK::Point_2 Point_2;
typedef typename CK::Vector_2 Vector_2;
typedef typename CK::Direction_2 Direction_2;
@ -204,69 +166,78 @@ namespace CircularFunctors {
typedef typename CK::Iso_rectangle_2 Iso_rectangle_2;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Linear_kernel::Equal_2 Linear_Equal_2;
typedef typename CK::Linear_kernel::Equal_2::result_type result_type;
using CK::Linear_kernel::Equal_2::operator();
public:
// using CK::Linear_kernel::Equal_2::operator();
result_type
template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const {
return Linear_Equal_2()(a, b);
}
Boolean
operator() (const Circular_arc_point_2 &p0,
const Circular_arc_point_2 &p1) const
{ return CircularFunctors::equal<CK>(p0, p1); }
result_type
Boolean
operator() (const Circular_arc_2 &a0, const Circular_arc_2 &a1) const
{ return CircularFunctors::equal<CK>(a0, a1); }
result_type
Boolean
operator() (const Line_arc_2 &a0, const Line_arc_2 &a1) const
{ return CircularFunctors::equal<CK>(a0, a1); }
};
template < class CK >
class Compare_y_at_x_2 : public CK::Linear_kernel::Compare_y_at_x_2
class Compare_y_at_x_2
// : public CK::Linear_kernel::Compare_y_at_x_2
{
typedef typename CK::Comparison_result Comparison_result;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Linear_kernel::Compare_y_at_x_2 Linear_Compare_y_at_x_2;
public:
typedef typename CK::Linear_kernel::Compare_y_at_x_2::result_type result_type;
// using CK::Linear_kernel::Compare_y_at_x_2::operator();
using CK::Linear_kernel::Compare_y_at_x_2::operator();
template <class... Args>
Comparison_result
operator()(const Args&... args) const
{ return Linear_Compare_y_at_x_2()(args...); }
result_type
Comparison_result
operator() (const Circular_arc_point_2 &p,
const Circular_arc_2 &A1) const
{ return CircularFunctors::compare_y_at_x<CK>(p, A1); }
result_type
Comparison_result
operator() (const Circular_arc_point_2 &p,
const Line_arc_2 &A1) const
{ return CircularFunctors::compare_y_at_x<CK>(p, A1); }
};
template < class CK >
class Do_overlap_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef bool result_type;
result_type
Boolean
operator() (const Circular_arc_2 &A1, const Circular_arc_2 &A2) const
{ return CircularFunctors::do_overlap<CK>(A1, A2); }
result_type
Boolean
operator() (const Line_arc_2 &A1, const Line_arc_2 &A2) const
{ return CircularFunctors::do_overlap<CK>(A1, A2); }
};
template < class CK >
class Make_x_monotone_2
{
@ -274,9 +245,6 @@ namespace CircularFunctors {
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef void result_type; //!!!
template < class OutputIterator >
OutputIterator
operator()(const Circular_arc_2 &A, OutputIterator res) const
@ -290,7 +258,6 @@ namespace CircularFunctors {
{
return CircularFunctors::make_x_monotone<CK>(A,res);
}
};
template < class CK >
@ -300,9 +267,6 @@ namespace CircularFunctors {
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef void result_type; //!!!
template < class OutputIterator >
OutputIterator
operator()(const Circular_arc_2 &A, OutputIterator res) const
@ -326,19 +290,21 @@ namespace CircularFunctors {
{ *res++ = make_object(A);
return res;
}
};
template < class CK >
class Do_intersect_2
: public CK::Linear_kernel::Do_intersect_2
// : public CK::Linear_kernel::Do_intersect_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Linear_kernel::Do_intersect_2 Linear_Do_intersect_2;
public:
typedef typename CK::Linear_kernel::Do_intersect_2::result_type result_type;
template <class T1, class T2>
result_type
operator()(const T1& t1, const T2& t2) const
{ return Intersections::internal::do_intersect(t1, t2, CK()); }
template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const
{ return Intersections::internal::do_intersect(a, b, CK()); }
};
template < class CK >
@ -347,14 +313,12 @@ namespace CircularFunctors {
//using the Lazy_kernel as linear kernel.
//: public CK::Linear_kernel::Intersect_2
{
typedef typename CK::Circle_2 Circle;
typedef typename CK::Circular_arc_2 Circular_arc;
typedef typename CK::Line_arc_2 Line_arc;
typedef typename CK::Line_2 Line;
public:
//using CK::Linear_kernel::Intersect_2::operator();
template<class A, class B>
@ -460,7 +424,6 @@ namespace CircularFunctors {
*res++=typename CK::Linear_kernel::Intersect_2()(l1, l2);
return res;
}
};
template < class CK >
@ -470,61 +433,61 @@ namespace CircularFunctors {
typename CK::Polynomial_1_2
operator() ( const typename CK::Line_2 & l )
{
return LinearFunctors::get_equation<CK>(l);
}
{
return LinearFunctors::get_equation<CK>(l);
}
typename CK::Polynomial_for_circles_2_2
operator() ( const typename CK::Circle_2 & c )
{
return CircularFunctors::get_equation<CK>(c);
}
{
return CircularFunctors::get_equation<CK>(c);
}
};
template < class CK >
class Split_2
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef void result_type;
result_type
void
operator()(const Circular_arc_2 &A,
const Circular_arc_point_2 &p,
Circular_arc_2 &ca1, Circular_arc_2 &ca2) const
{ return CircularFunctors::split<CK>(A, p, ca1, ca2); }
result_type
void
operator()(const Line_arc_2 &A,
const Circular_arc_point_2 &p,
Line_arc_2 &ca1, Line_arc_2 &ca2) const
{ return CircularFunctors::split<CK>(A, p, ca1, ca2); }
};
template < class CK >
class Is_vertical_2
: public CK::Linear_kernel::Is_vertical_2
// : public CK::Linear_kernel::Is_vertical_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Linear_kernel::Is_vertical_2 Linear_Is_vertical_2;
public:
// using CK::Linear_kernel::Is_vertical_2::operator();
typedef typename CK::Linear_kernel::Is_vertical_2::result_type result_type;
template <typename A>
Boolean
operator()(const A& a) const
{ return Linear_Is_vertical_2()(a); }
using CK::Linear_kernel::Is_vertical_2::operator();
result_type
Boolean
operator()(const Circular_arc_2 &A) const
{ return CircularFunctors::is_vertical<CK>(A); }
result_type
Boolean
operator()(const Line_arc_2 &A) const
{ return CircularFunctors::is_vertical<CK>(A); }
@ -533,56 +496,51 @@ namespace CircularFunctors {
template < class CK >
class Construct_circular_arc_2
{
typedef typename CK::FT FT;
typedef typename CK::RT RT;
typedef typename CK::Point_2 Point_2;
typedef typename CK::Line_2 Line_2;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Kernel_base::Circular_arc_2 RCircular_arc_2;
typedef typename Circular_arc_2::Rep Rep;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef Circular_arc_2 result_type;
result_type
Circular_arc_2
operator()(void)
{ return Rep(); }
result_type
Circular_arc_2
operator()(const Circle_2 &c) const
{ return Rep(c); }
result_type
Circular_arc_2
operator()(const Circle_2 &support,
const Circular_arc_point_2 &source,
const Circular_arc_point_2 &target) const
{ return Rep(support,source,target); }
// Not Documented
result_type
Circular_arc_2
operator()(const Circle_2 &support,
const Line_2 &l1, bool b1,
const Line_2 &l2, bool b2) const
{ return Rep(support,l1,b1,l2,b2); }
// Not Documented
result_type
Circular_arc_2
operator()(const Circle_2 &c,
const Circle_2 &c1, bool b_1,
const Circle_2 &c2, bool b_2) const
{ return Rep(c,c1,b_1,c2,b_2); }
result_type
Circular_arc_2
operator()(const Point_2 &begin,
const Point_2 &middle,
const Point_2 &end) const
{ return Rep(begin,middle,end); }
// Not Documented
result_type
Circular_arc_2
operator()(const Point_2 &begin,
const Point_2 &end,
const FT& bulge) const
@ -600,47 +558,44 @@ namespace CircularFunctors {
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Segment_2 Segment_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Kernel_base::Line_arc_2 RLine_arc_2;
typedef typename Line_arc_2::Rep Rep;
public:
typedef Line_arc_2 result_type;
result_type
Line_arc_2
operator()(void)
{ return Rep(); }
// Not Documented
result_type
Line_arc_2
operator()(const Line_2 &support,
const Circle_2 &c1,const bool b1,
const Circle_2 &c2,const bool b2) const
{ return Rep(support,c1,b1,c2,b2); }
// Not Documented
result_type
Line_arc_2
operator()(const Line_2 &support,
const Line_2 &l1,
const Line_2 &l2) const
{ return Rep(support,l1,l2); }
result_type
Line_arc_2
operator()(const Line_2 &support,
const Circular_arc_point_2 &p1,
const Circular_arc_point_2 &p2) const
{ return Rep(support,p1,p2); }
// result_type
// Line_arc_2
// operator()(const Line_2 &support,
// const Point_2 &p1,
// const Point_2 &p2) const
// { return Rep(support,p1,p2); }
result_type
Line_arc_2
operator()(const Segment_2 &s) const
{ return Rep(s); }
result_type
Line_arc_2
operator()(const Point_2 &p1,
const Point_2 &p2) const
{ return Rep(p1,p2); }
@ -652,40 +607,32 @@ namespace CircularFunctors {
{
typedef typename CK::Point_2 Point_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Kernel_base::Circular_arc_point_2
RCircular_arc_point_2;
typedef typename Circular_arc_point_2::Rep Rep;
typedef typename Circular_arc_point_2::Root_for_circles_2_2
Root_for_circles_2_2;
public:
typedef Circular_arc_point_2 result_type;
result_type
Circular_arc_point_2
operator()(void)
{ return Rep(); }
result_type
Circular_arc_point_2
operator()(const Root_for_circles_2_2 & np) const
{ return Rep(np); }
result_type
Circular_arc_point_2
operator()(const Point_2 & p) const
{ return Rep(p); }
};
template <class CK>
class Compute_circular_x_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Root_of_2 Root_of_2;
public:
typedef const Root_of_2& result_type;
result_type operator() (const Circular_arc_point_2 & a) const
decltype(auto) operator() (const Circular_arc_point_2 & a) const
{
return (a.rep().x());
}
@ -696,13 +643,9 @@ namespace CircularFunctors {
class Compute_circular_y_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Root_of_2 Root_of_2;
public:
typedef const Root_of_2& result_type;
result_type operator() (const Circular_arc_point_2 & a) const
decltype(auto) operator() (const Circular_arc_point_2 & a) const
{
return (a.rep().y());
}
@ -714,17 +657,14 @@ namespace CircularFunctors {
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef const Circular_arc_point_2 & result_type;
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{
return (a.rep().left());
}
result_type operator() (const Line_arc_2 & a) const
decltype(auto) operator() (const Line_arc_2& a) const
{
return (a.rep().left());
}
@ -736,18 +676,14 @@ namespace CircularFunctors {
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{
return (a.rep().right());
}
result_type operator() (const Line_arc_2 & a) const
decltype(auto) operator() (const Line_arc_2& a) const
{
return (a.rep().right());
}
@ -759,16 +695,12 @@ namespace CircularFunctors {
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{ return a.rep().source(); }
result_type operator() (const Line_arc_2 & a) const
decltype(auto) operator() (const Line_arc_2& a) const
{ return a.rep().source();}
};
@ -779,16 +711,12 @@ namespace CircularFunctors {
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{ return a.rep().target();}
result_type operator() (const Line_arc_2 & a) const
decltype(auto) operator() (const Line_arc_2& a) const
{ return a.rep().target();}
};
@ -796,19 +724,17 @@ namespace CircularFunctors {
template <class CK>
class Is_x_monotone_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef bool result_type;
result_type operator() (const Circular_arc_2 & a) const
Boolean operator() (const Circular_arc_2 & a) const
{
return (a.rep().is_x_monotone());
}
result_type operator() (const Line_arc_2 & a) const
Boolean operator() (const Line_arc_2 & a) const
{
return (a.rep().is_x_monotone());
}
@ -818,19 +744,17 @@ namespace CircularFunctors {
template <class CK>
class Is_y_monotone_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef bool result_type;
result_type operator() (const Circular_arc_2 & a) const
Boolean operator() (const Circular_arc_2& a) const
{
return (a.rep().is_y_monotone());
}
result_type operator() (const Line_arc_2 & a) const
Boolean operator() (const Line_arc_2& a) const
{
return (a.rep().is_y_monotone());
}
@ -839,48 +763,58 @@ namespace CircularFunctors {
template <class CK>
class Construct_bbox_2
: public CK::Linear_kernel::Construct_bbox_2
// : public CK::Linear_kernel::Construct_bbox_2
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Linear_kernel::Construct_bbox_2 Linear_Construct_bbox_2;
public:
// using CK::Linear_kernel::Construct_bbox_2::operator();
typedef typename CK::Linear_kernel::Construct_bbox_2::result_type result_type;
using CK::Linear_kernel::Construct_bbox_2::operator();
template <typename A>
decltype(auto)
operator()(const A& a) const
{ return Linear_Construct_bbox_2()(a); }
result_type operator() (const Circular_arc_point_2 & a) const
decltype(auto) operator() (const Circular_arc_point_2& a) const
{
return a.rep().bbox();
}
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{
return a.rep().bbox();
}
result_type operator() (const Line_arc_2 & a) const
decltype(auto) operator() (const Line_arc_2& a) const
{
return a.rep().bbox();
}
};
template <class CK>
class Bounded_side_2
: public CK::Linear_kernel::Bounded_side_2
// : public CK::Linear_kernel::Bounded_side_2
{
typedef typename CK::Bounded_side Bounded_side;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Linear_kernel::Bounded_side_2 Linear_Bounded_side_2;
public:
typedef typename CK::Linear_kernel::Bounded_side_2::result_type result_type;
// using CK::Linear_kernel::Bounded_side_2::operator();
using CK::Linear_kernel::Bounded_side_2::operator();
template <typename A, typename B>
Bounded_side
operator()(const A& a, const B& b) const
{ return Linear_Bounded_side_2()(a, b); }
result_type
Bounded_side
operator()(const Circle_2& c, const Circular_arc_point_2& p) const
{ return CircularFunctors::bounded_side<CK>(c,p); }
@ -888,17 +822,23 @@ namespace CircularFunctors {
template <class CK>
class Has_on_bounded_side_2
: public CK::Linear_kernel::Has_on_bounded_side_2
// : public CK::Linear_kernel::Has_on_bounded_side_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Linear_kernel::Has_on_bounded_side_2 Linear_Has_on_bounded_side_2;
public:
typedef typename CK::Linear_kernel::Has_on_bounded_side_2::result_type result_type;
// using CK::Linear_kernel::Has_on_bounded_side_2::operator();
using CK::Linear_kernel::Has_on_bounded_side_2::operator();
template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const
{ return Linear_Has_on_bounded_side_2()(a, b); }
result_type
Boolean
operator()(const Circle_2& c, const Circular_arc_point_2& p) const
{ return CK().bounded_side_2_object()(c,p) == ON_BOUNDED_SIDE; }
@ -906,20 +846,25 @@ namespace CircularFunctors {
template <class CK>
class Has_on_unbounded_side_2
: public CK::Linear_kernel::Has_on_unbounded_side_2
// : public CK::Linear_kernel::Has_on_unbounded_side_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Linear_kernel::Has_on_unbounded_side_2 Linear_Has_on_unbounded_side_2;
public:
typedef typename CK::Linear_kernel::Has_on_unbounded_side_2::result_type result_type;
// using CK::Linear_kernel::Has_on_unbounded_side_2::operator();
using CK::Linear_kernel::Has_on_unbounded_side_2::operator();
template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const
{ return Linear_Has_on_unbounded_side_2()(a, b); }
result_type
Boolean
operator()(const Circle_2& c, const Circular_arc_point_2& p) const
{ return CK().bounded_side_2_object()(c,p) == ON_UNBOUNDED_SIDE; }
};
#ifndef CGAL_NO_DEPRECATED_CODE
@ -927,31 +872,21 @@ namespace CircularFunctors {
class Construct_supporting_circle_2
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circle_2 Circle_2;
public:
typedef Circle_2 result_type;
CGAL_DEPRECATED result_type operator() (const Circular_arc_2 & a) const
CGAL_DEPRECATED decltype(auto) operator() (const Circular_arc_2 & a) const
{
return a.rep().supporting_circle();
}
};
template <class CK>
class Construct_supporting_line_2
{
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Line_2 Line_2;
typedef typename CK::Circle_2 Circle_2;
public:
typedef Line_2 result_type;
CGAL_DEPRECATED result_type operator() (const Line_arc_2 & a) const
CGAL_DEPRECATED decltype(auto) operator() (const Line_arc_2 & a) const
{
return a.rep().supporting_line();
}
@ -960,24 +895,28 @@ namespace CircularFunctors {
template <typename CK>
class Construct_center_2
: public CK::Linear_kernel::Construct_center_2
// : public CK::Linear_kernel::Construct_center_2
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
public:
typedef typename CK::Linear_kernel::Construct_center_2::result_type result_type;
using CK::Linear_kernel::Construct_center_2::operator();
result_type
typedef typename CK::Linear_kernel::Construct_center_2 Linear_Construct_center_2;
public:
// using CK::Linear_kernel::Construct_center_2::operator();
template <typename A>
decltype(auto)
operator()(const A& a) const
{ return Linear_Construct_center_2()(a); }
decltype(auto)
operator()(const Circular_arc_2& c) const
{ return c.rep().center(); }
};
template <typename CK>
class Compute_squared_radius_2
{
private:
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Linear_kernel LK;
typedef typename LK::Compute_squared_radius_2 LK_Compute_squared_radius_2;

View File

@ -54,7 +54,7 @@ namespace Intersections { \
} \
template <class K> \
inline \
bool \
typename K::Boolean \
do_intersect(const A <K> &c1, const B <K> &c2) \
{ \
return typename K::Do_intersect_2()(c1, c2); \

View File

@ -33,6 +33,7 @@ namespace Bbox_functors {
template <class BK>
class Compare_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_x_2
{
typedef typename BK::Comparison_result Comparison_result;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Point_2 Point_2;
typedef typename BK::Circular_kernel::
@ -40,12 +41,9 @@ class Compare_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Comp
typedef CK_Compare_x_2 Base;
public:
typedef typename CK_Compare_x_2::result_type result_type;
using Base::operator();
result_type
Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{
Bbox_2 bb1=a.bbox(),bb2=b.bbox();
@ -65,16 +63,15 @@ public:
template <class BK>
class Compare_y_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_y_2
{
typedef typename BK::Comparison_result Comparison_result;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Point_2 Point_2;
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Compare_y_2 CK_Compare_y_2;
typedef CK_Compare_y_2 Base;
public:
typedef typename CK_Compare_y_2::result_type result_type;
result_type
Comparison_result
operator() (const Point_2 &p0,
const Point_2 &p1) const
{
@ -83,7 +80,7 @@ public:
using Base::operator();
result_type
Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{
Bbox_2 bb1=a.bbox(),bb2=b.bbox();
@ -105,17 +102,15 @@ class Compare_xy_2 : public BK::Circular_kernel:: template Base< BK >::Type::Com
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Compare_xy_2 CK_Compare_xy_2;
typedef CK_Compare_xy_2 Base;
typedef typename BK::Comparison_result Comparison_result;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Point_2 Point_2;
public:
typedef typename Base::result_type result_type;
using Base::operator();
public:
result_type
Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{
typename BK::Compare_x_2 compx;
@ -137,20 +132,18 @@ class In_x_range_2 : public BK::Circular_kernel:: template Base< BK >::Type::In_
typedef typename BK::Circular_kernel::
template Base< BK >::Type::In_x_range_2 CK_In_x_range_2;
typedef CK_In_x_range_2 Base;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Line_arc_2 Line_arc_2;
public:
typedef typename CK_In_x_range_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Boolean
_in_x_range_2(const Arc_2 &a, const Circular_arc_point_2 &p) const
{
@ -179,42 +172,36 @@ private:
}
public:
result_type
Boolean
operator()( const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{
CGAL_precondition( a.is_x_monotone());
return _in_x_range_2(a,p);
}
result_type
Boolean
operator()( const Line_arc_2 &a, const Circular_arc_point_2 &p) const
{ return _in_x_range_2(a,p);}
};
template <class BK>
class Compare_y_at_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_y_at_x_2
{
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Compare_y_at_x_2 CK_Compare_y_at_x_2;
typedef CK_Compare_y_at_x_2 Base;
typedef typename BK::Comparison_result Comparison_result;
typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Line_arc_2 Line_arc_2;
public:
typedef typename CK_Compare_y_at_x_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Comparison_result
_compare_y_at_x_2(const Circular_arc_point_2 &p,const Arc_2 &a) const
{
CGAL_precondition_code(bool tmp=In_x_range_2<BK>()(a,p));
@ -232,41 +219,36 @@ private:
}
public:
result_type
Comparison_result
operator()( const Circular_arc_point_2 &p,const Circular_arc_2 &a ) const
{
CGAL_precondition( a.is_x_monotone());
return _compare_y_at_x_2(p,a);
}
result_type
Comparison_result
operator()( const Circular_arc_point_2 &p,const Line_arc_2 &a ) const
{return _compare_y_at_x_2(p,a);}
};
template <class BK>
class Has_on_2 : public BK::Circular_kernel:: template Base< BK >::Type::Has_on_2
{
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Has_on_2 CK_Has_on_2;
typedef CK_Has_on_2 Base;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Line_arc_2 Line_arc_2;
public:
typedef typename CK_Has_on_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Boolean
_has_on_2(const Arc_2 &a, const Circular_arc_point_2 &p) const
{
Bbox_2 bb1=a.bbox(),bb2=p.bbox();
@ -278,27 +260,26 @@ private:
}
public:
result_type
Boolean
operator()( const Circular_arc_2 &a,const Circular_arc_point_2 &p ) const
{
CGAL_precondition( a.is_x_monotone());
return _has_on_2(a,p);
}
result_type
Boolean
operator()( const Line_arc_2 &a, const Circular_arc_point_2 &p ) const
{return _has_on_2(a,p);}
};
template <class BK>
class Equal_2
: public BK::Circular_kernel:: template Base< BK >::Type::Equal_2
{
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Equal_2 CK_Equal_2;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Point_2 Point_2;
typedef typename BK::Direction_2 Direction_2;
@ -315,15 +296,11 @@ class Equal_2
typedef CK_Equal_2 Base;
public:
typedef typename CK_Equal_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Boolean
_equal_2(const Arc_2 &a,const Arc_2 &b) const
{
Bbox_2 bb11=a.source().bbox(),
@ -346,8 +323,7 @@ private:
}
public:
result_type
Boolean
operator()( const Circular_arc_point_2 &a ,
const Circular_arc_point_2 &b) const
{
@ -361,14 +337,15 @@ public:
/* WAS THAT HERE FOR OTHER COMPILERS THAN VC* ???
// redefine to solve ambiguous call error
result_type
Boolean
operator()( const Point_2 &a ,
const Point_2 &b) const
{
return CK_Equal_2()( a, b);
}
*/
result_type
Boolean
operator()( const Circular_arc_2 &a , const Circular_arc_2 &b ) const
{
CGAL_precondition( a.is_x_monotone());
@ -377,17 +354,17 @@ public:
return _equal_2(a,b);
}
result_type
Boolean
operator()( const Line_arc_2 &a ,
const Line_arc_2 &b ) const
{ return _equal_2(a,b);}
result_type
Boolean
operator()( const Circular_arc_2 & ,
const Line_arc_2 & ) const
{ return false;}
result_type
Boolean
operator()( const Line_arc_2 & ,
const Circular_arc_2 & ) const
{ return false;}
@ -401,19 +378,17 @@ class Do_overlap_2 : public BK::Circular_kernel:: template Base< BK >::Type::Do_
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Do_overlap_2 CK_Do_overlap_2;
typedef CK_Do_overlap_2 Base;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Line_arc_2 Line_arc_2;
public:
typedef typename CK_Do_overlap_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Boolean
_do_overlap_2(const Arc_2 &a, const Arc_2 &b) const
{
Bbox_2 bb1=a.bbox(),bb2=b.bbox();
@ -424,10 +399,8 @@ private:
return false;
}
public:
result_type
Boolean
operator()( const Circular_arc_2 &a , const Circular_arc_2 &b ) const
{
CGAL_precondition( a.is_x_monotone());
@ -435,28 +408,26 @@ public:
return _do_overlap_2(a,b);
}
result_type
Boolean
operator()( const Line_arc_2 &a ,
const Line_arc_2 &b ) const
{ return _do_overlap_2(a,b);}
result_type
Boolean
operator()( const Circular_arc_2 & ,
const Line_arc_2 & ) const
{ return false;}
result_type
Boolean
operator()( const Line_arc_2 & ,
const Circular_arc_2 & ) const
{ return false;}
};
template < class BK >
class Intersect_2 : public BK::Circular_kernel:: template Base< BK >::Type::Intersect_2
{
public:
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Intersect_2 CK_Intersect_2;
@ -466,6 +437,7 @@ public:
typedef typename BK::Circle_2 Circle;
typedef typename BK::Line_2 Line_2;
public:
using CK_Intersect_2::operator();
template < class OutputIterator >

View File

@ -24,7 +24,7 @@ for which we refer the user to the \ref chapterkernel23 "2D and 3D Linear Kernel
\section sectionSKobjects Spherical Kernel Objects
New main geometric objects are introduced by `Spherical_kernel_3`:
circular arcs ((model of `SphericalKernel::CircularArc_3`), points
circular arcs (model of `SphericalKernel::CircularArc_3`), points
of circular arcs (model of `SphericalKernel::CircularArcPoint_3`),
and line segments (model of `SphericalKernel::LineArc_3`) whose
endpoints are points of this new type.

View File

@ -25,7 +25,7 @@ operator()(const AlgebraicKernelForSpheres::Polynomial_for_spheres_2_3 &p,
OutputIterator res);
/*!
Computes the `i`th `x`-critical point of polynomial `p`.
Computes the `i`-th `x`-critical point of polynomial `p`.
*/
template < class OutputIterator >
AlgebraicKernelForSpheres::Root_for_spheres_2_3

View File

@ -25,7 +25,7 @@ operator()(const AlgebraicKernelForSpheres::Polynomial_for_spheres_2_3 &p,
OutputIterator res);
/*!
Computes the `i`th `y`-critical point of polynomial `p`.
Computes the `i`-th `y`-critical point of polynomial `p`.
*/
template < class OutputIterator >
AlgebraicKernelForSpheres::Root_for_spheres_2_3

View File

@ -25,7 +25,7 @@ operator()(const AlgebraicKernelForSpheres::Polynomial_for_spheres_2_3 &p,
OutputIterator res);
/*!
Computes the `i`th `z`-critical point of polynomial `p`.
Computes the `i`-th `z`-critical point of polynomial `p`.
*/
template < class OutputIterator >
AlgebraicKernelForSpheres::Root_for_spheres_2_3

View File

@ -1,3 +1,4 @@
Algebraic_foundations
Circular_kernel_2
Kernel_23
Number_types

View File

@ -211,7 +211,7 @@ public:
const Root_for_spheres_2_3 & coordinates() const { return get_pointee_or_identity(base); }
const CGAL::Bbox_3 bbox() const {
CGAL::Bbox_3 bbox() const {
return get_pointee_or_identity(base).bbox();
}

View File

@ -168,7 +168,7 @@ namespace CGAL {
return begin_less_xyz_than_end() ? target() : source();
}
const CGAL::Bbox_3 bbox() const {
CGAL::Bbox_3 bbox() const {
return source().bbox() + target().bbox();
}

View File

@ -85,7 +85,7 @@ namespace CGAL {
template < class SK >
inline
typename SK::Linear_kernel::Bounded_side_3::result_type
typename SK::Bounded_side
bounded_side(const typename SK::Sphere_3 &s,
const typename SK::Circular_arc_point_3 &p) {
typedef typename SK::Algebraic_kernel Algebraic_kernel;
@ -99,7 +99,7 @@ namespace CGAL {
template < class SK >
inline
typename SK::Linear_kernel::Bounded_side
typename SK::Bounded_side
bounded_side(const typename SK::Circle_3 &c,
const typename SK::Circular_arc_point_3 &p) {
typedef typename SK::Algebraic_kernel Algebraic_kernel;
@ -471,7 +471,7 @@ namespace CGAL {
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK>());
}
// At the moment we dont need those functions
// At the moment we don't need those functions
// But in the future maybe (some make_x_monotone? etc..)
template <class SK>
typename SK::Circular_arc_point_3

View File

@ -46,7 +46,7 @@ intersection(const A <K> &c1, const B <K> &c2, OutputIterator res) \
} \
template <class K> \
inline \
bool \
typename K::Boolean \
do_intersect(const A <K> &c1, const B <K> &c2) \
{ \
return typename K::Do_intersect_3()(c1, c2); \
@ -61,7 +61,7 @@ intersection(const A <K> &c1, const B <K> &c2, const C <K> &c3, OutputIterator r
} \
template <class K> \
inline \
bool \
typename K::Boolean \
do_intersect(const A <K> &c1, const B <K> &c2, const C <K> &c3) \
{ \
return typename K::Do_intersect_3()(c1, c2, c3); \

View File

@ -654,7 +654,7 @@ void _test_bounded_side(SK sk) {
}
}
// we dont need to test bounded_side(Circle, Circular_arc_point) because
// we don't need to test bounded_side(Circle, Circular_arc_point) because
// bounded_side(Circle, Circular_arc_point) = bounded_side(Sphere, Circular_arc_point) +
// has_on_3(supporting_plane, circular_arc_point) which has already been tested
std::cout << "Testing bounded_side(Circle, Circular_arc_point)..." << std::endl;

View File

@ -10,7 +10,7 @@ This component implements the algorithm described in \cgalCite{cgal:lm-clscm-12}
\section Classification_Organization Package Organization
%Classification of data sets is achieved as follows (see Figure \cgalFigureRef{Classification_organization_fig}):
%Classification of data sets is achieved as follows (see \cgalFigureRef{Classification_organization_fig}):
- some analysis is performed on the input data set;
- features are computed based on this analysis;
@ -314,7 +314,7 @@ Though it is possible to set them up one by one, \cgal also provides a method [t
- the same mechanism is repeated until all features' ranges have been tested. Weights are only changed one by one, the other ones are kept to the values that gave the latest best score.
This usually converges to a satisfying solution (see Figure \cgalFigureRef{Classification_trainer_fig}). The number of trials is user defined, set to 300 by default. Using at least 10 times the number of features is advised (for example, at least 300 iterations if 30 features are used). If the solution is not satisfying, more inliers can be selected, for example, in a region that the user identifies as misclassified with the current configuration. The training algorithm keeps, as initialization, the best weights found at the previous round and carries on trying new weights by taking new inliers into account.
This usually converges to a satisfying solution (see \cgalFigureRef{Classification_trainer_fig}). The number of trials is user defined, set to 300 by default. Using at least 10 times the number of features is advised (for example, at least 300 iterations if 30 features are used). If the solution is not satisfying, more inliers can be selected, for example, in a region that the user identifies as misclassified with the current configuration. The training algorithm keeps, as initialization, the best weights found at the previous round and carries on trying new weights by taking new inliers into account.
\cgalFigureBegin{Classification_trainer_fig,classif_training.png}
Example of evolution of the mean intersection-over-union. The purple curve is the score computed at the current iteration, green curve is the best score found so far.
@ -322,7 +322,7 @@ Example of evolution of the mean intersection-over-union. The purple curve is th
\subsubsection Classification_sowf_result Result
Figure \cgalFigureRef{Classification_sowf_result_fig} shows an example of output on a defect-laden point set. The accuracy on this example is 0.97 with a mean intersection-over-union of 0.85 (see section \ref Classification_evaluation).
\cgalFigureRef{Classification_sowf_result_fig} shows an example of output on a defect-laden point set. The accuracy on this example is 0.97 with a mean intersection-over-union of 0.85 (see section \ref Classification_evaluation).
\cgalFigureBegin{Classification_sowf_result_fig,noise_outliers.png}
Example of classification on a point set with medium noise and outliers (left: input, right: output). _Ground_ is orange, _roofs_ are pink, _vegetation_ is green. Outliers are classified with an additional label _outlier_ in black.
@ -398,7 +398,7 @@ smoothing by providing a model of `CGAL::Classification::NeighborQuery`.
- `CGAL::Classification::classify_with_graphcut()`: this method
offers the best quality but requires longer computation time (see
Figure \cgalFigureRef{Classification_image}, bottom-right). The
\cgalFigureRef{Classification_image}, bottom-right). The
total energy that is minimized is the sum of the partial data term
\f$E_{di}(x_i)\f$ and of a pairwise interaction energy defined by the
standard Potts model \cgalCite{cgal:l-mrfmi-09} :

View File

@ -969,7 +969,7 @@ namespace CGAL {
{ return mnb_used_marks; }
/** Test if a given mark is reserved.
* @return true iff the mark is reserved (ie in used).
* @return true iff the mark is reserved (i.e. in used).
*/
bool is_reserved(size_type amark) const
{

View File

@ -64,7 +64,7 @@
* darts have the same info.
*
* internal::Test_is_same_attribute_functor<Map1, Map2> to test if two
* i-attributes of two darts are isomorphic (ie they have the same info).
* i-attributes of two darts are isomorphic (i.e. they have the same info).
*
* internal::Test_is_same_attribute_point_functor<Map1, Map2, i> to test if
* the point of two i-attributes are equal.
@ -208,7 +208,7 @@ template<typename CMap>
struct Test_is_valid_attribute_functor
{
/** Test the validity of a i-cell-attribute.
* ie all the darts belonging to a i-cell are linked to the same attribute.
* In other words, all the darts belonging to a i-cell are linked to the same attribute.
* @param adart a dart.
* @param amark a mark used to mark darts of the i-cell.
* @return true iff all the darts of the i-cell link to the same attribute.

View File

@ -159,7 +159,7 @@ namespace CGAL
};
//count the number of time a given type have been found
//within a tuple, until reaching position the k'th type of the tuple.
//within a tuple, until reaching position the k-th type of the tuple.
//dim is the total size of the tuple
template <class Type,int k,class T,
int dim=CGAL::internal::My_length<T>::value-1>
@ -191,7 +191,7 @@ namespace CGAL
};
//count the number of time a type different from Type have been found
//within a tuple, until reaching position the k'th type of the tuple.
//within a tuple, until reaching position the k-th type of the tuple.
//dim is the total size of the tuple
template <class Type, int k,class T,
int dim=CGAL::internal::My_length<T>::value-1>
@ -339,7 +339,7 @@ namespace CGAL
};
//Same as Foreach_static excepted that Functor
//is called for case k only if the k'th type in the tuple
//is called for case k only if the k-th type in the tuple
//is different from Void. Note that to the converse of Foreach_static
//Functor are called from n =0 to k
template <class Functor,class T,int n=0, int startn=0>
@ -365,7 +365,7 @@ namespace CGAL
};
//Same as Foreach_static_restricted excepted that Functor
//is called for case k only if the k'th type in the tuple
//is called for case k only if the k-th type in the tuple
//is different from Void and k!=j.
template <class Functor,int j,class T,int n=0>
struct Foreach_static_restricted_except;

View File

@ -45,6 +45,7 @@
#include <boost/mpl/has_xxx.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/range/has_range_iterator.hpp>
#include <type_traits>
@ -69,6 +70,8 @@ template<class VertexPointMap,class Base_traits> class Extreme_points_traits_ada
namespace Convex_hull_3 {
namespace internal {
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_nested_type_Collinear_3, Collinear_3, false)
// wrapper used as a MutableFaceGraph to extract extreme points
template <class OutputIterator>
struct Output_iterator_wrapper
@ -993,7 +996,8 @@ void convex_hull_3(InputIterator first, InputIterator beyond,
template <class InputIterator, class PolygonMesh, class Traits>
void convex_hull_3(InputIterator first, InputIterator beyond,
PolygonMesh& polyhedron,
const Traits& traits)
const Traits& traits,
std::enable_if_t<Convex_hull_3::internal::Has_nested_type_Collinear_3<Traits>::value>* = 0)
{
typedef typename Traits::Point_3 Point_3;
typedef std::list<Point_3> Point_3_list;

View File

@ -20,7 +20,7 @@ typedef K::Segment_3 Segment_3;
typedef CGAL::Creator_uniform_3<NT,Point_3> Creator;
typedef CGAL::Random_points_in_sphere_3<Point_3,Creator> Generator;
const unsigned int num = 40;
const unsigned int num = 400000;
template <class Facet_handle>
void compute_plane_equation(Facet_handle f)
@ -135,9 +135,9 @@ int main()
std::cerr << "Testing coplanar hull" << std::endl;
test_coplanar_hull();
std::cerr << "Testing 500 random points" << std::endl;
std::cerr << "Testing " << num << " random points" << std::endl;
std::vector<Point_3> points;
Generator g(500);
Generator g(1);
std::copy_n( g, num, std::back_inserter(points));
assert(points.size() == num);

View File

@ -203,7 +203,7 @@ public:
Simplex_iterator(Delaunay* x, Base_iterator y,
Delaunay_voronoi_kind z = NEAREST) : Base_iterator(y), DT(x)
/* if the facet is not nil we set the current marker to
the facet and insert all it's neighbors into the
the facet and insert all its neighbors into the
candidates stack */
{ CGAL_assertion(base() != Base_iterator());
tf = (z == NEAREST ? lower_hull : upper_hull);
@ -262,7 +262,7 @@ public:
Simplex_const_iterator(const Delaunay* x, Base_iterator y,
Delaunay_voronoi_kind z = NEAREST) : Base_iterator(y), DT(x)
/* if the facet is not nil we set the current marker to
the facet and insert all it's neighbors into the
the facet and insert all its neighbors into the
candidates stack */
{ CGAL_assertion(base() != Base_iterator());
tf = (z == NEAREST ? lower_hull : upper_hull);

File diff suppressed because one or more lines are too long

View File

@ -225,7 +225,7 @@ functionalities for circles, circular arcs living on a 3D sphere
\cgal currently provides several models for the \cgal 2D and 3D kernel
concept, and one model for the 2D circular and the 3D spherical kernel
concepts.. Those are again parameterized and differ in their
concepts. Those are again parameterized and differ in their
representation of the geometric objects and the exchangeability of
the types involved.
In the first four cases the kernels are parameterized by a number type, which
@ -233,7 +233,7 @@ is used to store coordinates and which determines the basic arithmetic
of the kernel primitives.
In the last two cases, the circular and spherical kernel are also
parametrized by Algebraic Kernels, which, along with Algebraic
parameterized by Algebraic Kernels, which, along with Algebraic
Foundations, is the third distinct high level of genericity in
\cgal. The algebraic foundations in \cgal is a collection of concepts
representing algebraic structures, and are motivated by well-known

View File

@ -288,7 +288,7 @@ for more information.
On some platforms, linking with `libunwind` was responsible for an increase of the runtime of the final application.
If you experience such an issue, we recommend to compile \ceres without `glog` support.
\attention In the master branch of \ceres `glog` was dropped as a dependecy and `abseil` was added instead. It is not compatible with \visualstudio 2017 or earlier versions.
\attention In the master branch of \ceres `glog` was dropped as a dependency and `abseil` was added instead. It is not compatible with \visualstudio 2017 or earlier versions.
\subsection thirdpartyGLPK GLPK

View File

@ -2,7 +2,7 @@
\page usage Using %CGAL on Unix (Linux, macOS, ...)
\cgalAutoToc
Since \cgal version 5.0, \cgal is header-only be default, which means
Since \cgal version 5.0, \cgal is header-only by default, which means
that there is <b>no need to build \cgal before it can be used</b>.
However, some dependencies of \cgal might still need to be installed.
@ -45,7 +45,7 @@ or to build your own project using \cgal, see Section \ref secoptional3rdpartyso
\section secgettingcgal Downloading CGAL
\cgal can be obtained through different channels. We recommend using a package manager as
this will ensure that all essential third party dependencies are present, and with the correct versions.
this will ensure that all essential third-party dependencies are present, and with the correct versions.
You may also download the sources of \cgal directly, but it is then your responsibility to independently
acquire these dependencies.
@ -180,7 +180,7 @@ all the required dependencies. This typically happens if you have installed depe
at non-standard locations.
Although the command line tool `cmake` accepts CMake variables as arguments of the form
`-D<VAR>:<TYPE>=<VALUE>`, this is only useful if you already know which variables
need to be explicitly defined. or this reason, the simplest way to manually set the missing variables
need to be explicitly defined. For this reason, the simplest way to manually set the missing variables
is to run the graphical user interface of CMake, `cmake-gui`.
cd CGAL-\cgalReleaseNumber/examples/Triangulation_2

View File

@ -71,6 +71,7 @@
\package_listing{Triangulation_on_sphere_2}
\package_listing{Periodic_2_triangulation_2}
\package_listing{Hyperbolic_triangulation_2}
\package_listing{Triangulation_on_hyperbolic_surface_2}
\package_listing{Periodic_4_hyperbolic_triangulation_2}
\package_listing{Triangulation_3}
\package_listing{TDS_3}
@ -93,6 +94,7 @@
\package_listing{Skin_surface_3}
\package_listing{SMDS_3}
\package_listing{Mesh_3}
\package_listing{Isosurfacing_3}
\package_listing{Tetrahedral_remeshing}
\package_listing{Periodic_3_mesh_3}
\package_listing{Alpha_wrap_3}

View File

@ -22,7 +22,6 @@
@article{ cgal:afh-pdecm-02,
author = "P. K. Agarwal and E. Flato and D. Halperin",
title = "Polygon Decomposition for Efficient Construction of {Minkowski} Sums",
@ -130,6 +129,21 @@
,update = "04.04 kettner"
}
@book{cgal:b-gdg-83,
title={The Geometry of Discrete Groups},
author={Beardon, A.F.},
series={Graduate texts in mathematics},
year={1983},
publisher={Springer}
}
@book{cgal:b-gscrs-92,
title={Geometry and Spectra of Compact Riemann Surfaces},
author={Peter Buser},
year={1992},
publisher={Springer}
}
@article{ cgal:bbp-iayed-01
,author = "H. Br{\"o}nnimann and C. Burnikel and S. Pion"
,title = "Interval arithmetic yields efficient dynamic filters
@ -387,6 +401,12 @@ Boissonnat}
organization={ACM}
}
@techreport{ cgal:c-mcctci-95,
title={Marching Cubes 33: Construction of Topologically Correct Isosurfaces},
author={Chernyaev, Evgeni},
year={1995}
}
@inproceedings{cgal::c-mssbo-04,
author={Chen, L.},
title={{Mesh Smoothing Schemes based on Optimal Delaunay Triangulations}},
@ -643,6 +663,17 @@ note="Conference version: Symp. on Geometry Processing 2003"
, year = 2009
}
@article{cgal:dljjaw-sisp-15,
title={A survey on Implicit Surface Polygonization},
author={De Ara{\'u}jo, Bruno Rodrigues and Lopes, Daniel S and Jepp, Pauline and Jorge, Joaquim A and Wyvill, Brian},
journal={ACM Computing Surveys (CSUR)},
volume={47},
number={4},
pages={1--39},
year={2015},
publisher={ACM New York, NY, USA}
}
@article{cgal:dfg-cvtaa-99t,
title={{Centroidal Voronoi Tessellations: Applications and Algorithms}},
author={Du, Q. and Faber, V. and Gunzburger, M.},
@ -689,6 +720,33 @@ Mourrain and Monique Teillaud"
keywords = "Convex hull problem, Frame, Linear programming, Data envelopment analysis, Redundancy"
}
@inproceedings{despre2020flipping,
title={Flipping geometric triangulations on hyperbolic surfaces},
author={Despr{\'e}, Vincent and Schlenker, Jean-Marc and Teillaud, Monique},
booktitle={36th International Symposium on Computational Geometry},
year={2020},
url={https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SoCG.2020.35}
}
@article{despre2022experimental,
title={Experimental analysis of {Delaunay} flip algorithms on genus two hyperbolic surfaces},
author={Despr{\'e}, Vincent and Dubois, Lo{\"\i}c and Kolbe, Benedikt and Teillaud, Monique},
year={2022},
url={https://inria.hal.science/hal-03665888v1/document}
}
@article{aigon2005hyperbolic,
title={Hyperbolic octagons and {Teichm{\"u}ller} space in genus 2},
author={Aigon-Dupuy, Aline and Buser, Peter and Cibils, Michel and K{\"u}nzle, Alfred F and Steiner, Frank},
journal={Journal of mathematical physics},
volume={46},
number={3},
year={2005},
publisher={AIP Publishing},
url = {https://doi.org/10.1063/1.1850177}
}
@article{cgal:dl-cginc-19,
author = {Despr\'{e}, Vincent and Lazarus, Francis},
title = {Computing the Geometric Intersection Number of Curves},
@ -909,6 +967,17 @@ Teillaud"
pages = "19--27",
year = "2003"}
@inproceedings{ cgal:g-ctcmi-16,
title={Construction of Topologically Correct and Manifold Isosurfaces},
author={Grosso, Roberto},
booktitle={Computer Graphics Forum},
volume={35},
number={5},
pages={187--196},
year={2016},
organization={Wiley Online Library}
}
@inproceedings{ cgal:g-frseb-99
,author = "B. G{\"a}rtner"
,title = "Fast and robust smallest enclosing balls"
@ -1248,6 +1317,14 @@ Teillaud"
,update = "01.06 hoffmann"
}
@inproceedings{ cgal:jlsw-dchd-02,
title={Dual contouring of Hermite Data},
author={Ju, Tao and Losasso, Frank and Schaefer, Scott and Warren, Joe},
booktitle={Proceedings of the 29th annual conference on Computer graphics and interactive techniques},
pages={339--346},
year={2002}
}
@incollection{ cgal:k-dat-96
,author = "Keffer, T."
,title = "The Design and Architecture of {T}ools.h{\tt ++}"
@ -2386,6 +2463,46 @@ location = {Salt Lake City, Utah, USA}
,update = "98.01 kettner"
}
@article{cgal:vc-acvdupmc-04,
author = {Valette, Sébastien and Chassery, Jean-Marc},
doi = {10.1111/j.1467-8659.2004.00769.x},
hal_id = {hal-00534535},
hal_version = {v1},
journal = {Computer Graphics Forum},
note = {Eurographics 2004 proceedings},
number = {3},
pages = {381-389},
pdf = {https://hal.archives-ouvertes.fr/hal-00534535/file/valette.pdf},
publisher = {Wiley},
title = {Approximated Centroidal Voronoi Diagrams for Uniform Polygonal Mesh Coarsening},
url = {https://hal.archives-ouvertes.fr/hal-00534535},
volume = {23},
year = {2004}
}
@inproceedings{cgal:audette2011approach,
title={Approach-guided controlled resolution brain meshing for fe-based interactive neurosurgery simulation},
author={Audette, M and Rivi{\`e}re, D and Ewend, M and Enquobahrie, A and Valette, S},
booktitle={Workshop on Mesh Processing in Medical Image Analysis, in conjunction with MICCAI 2011},
pages={176--186},
year={2011}
}
@article{cgal:vcp-grtmmdvd-08,
author = {Valette, Sébastien and Chassery, Jean-Marc and Prost, Rémy},
doi = {10.1109/TVCG.2007.70430},
hal_id = {hal-00537025},
hal_version = {v1},
journal = {IEEE Transactions on Visualization and Computer Graphics},
number = {2},
pages = {369--381},
pdf = {https://hal.archives-ouvertes.fr/hal-00537025/file/VCP08TVCG.pdf},
publisher = {Institute of Electrical and Electronics Engineers},
title = {Generic remeshing of 3D triangular meshes with metric-dependent discrete Voronoi Diagrams},
url = {https://hal.archives-ouvertes.fr/hal-00537025},
volume = {14},
year = {2008}
}
@techreport{cgal:vla-lod-15,
title={LOD Generation for Urban Scenes},
@ -3111,14 +3228,12 @@ pages = "207--221"
bibsource = {dblp computer science bibliography, https://dblp.org/}
}
@inproceedings {dunyach2013curvRemesh,
booktitle = {Eurographics 2013 - Short Papers},
title = {{Adaptive Remeshing for Real-Time Mesh Deformation}},
author = {Dunyach, Marion and Vanderhaeghe, David and Barthe, Loïc and Botsch, Mario},
year = {2013},
publisher = {The Eurographics Association},
ISSN = {1017-4656},
DOI = {10.2312/conf/EG2013/short/029-032}
@inproceedings{dunyach2013curvRemesh,
title={Adaptive remeshing for real-time mesh deformation},
author={Dunyach, Marion and Vanderhaeghe, David and Barthe, Loïc and Botsch, Mario},
booktitle={Eurographics 2013},
year={2013},
organization={The Eurographics Association}
}
@book{botsch2010PMP,

View File

@ -222,7 +222,7 @@ ALIASES = "cgal=%CGAL" \
# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
# FortranFree, unknown formatted Fortran: Fortran. In the latter case the parser
# tries to guess whether the code is fixed or free formatted code, this is the
# default for Fortran type files). For instance to make doxygen treat .inc files
# as Fortran files (default is PHP), and .f files as C (default is Fortran),

View File

@ -98,14 +98,14 @@ $(document).ready(function() {
if(window.location.href.includes("doc.cgal.org")){
var url='https://doc.cgal.org/latest/Manual/menu_version.js';
var script = document.createElement("script"); // Make a script DOM node
script.src = url; // Set it's src to the provided URL
script.src = url; // Set its src to the provided URL
document.head.appendChild(script);
}
else
{
var url='../Manual/menu_version.js';
var script = document.createElement("script"); // Make a script DOM node
script.src = url; // Set it's src to the provided URL
script.src = url; // Set its src to the provided URL
document.head.appendChild(script);
}
})();

View File

@ -213,7 +213,7 @@ ALIASES = "cgal=%CGAL" \
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# Fortran. In the latter case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.

View File

@ -98,14 +98,14 @@ $(document).ready(function() {
if(window.location.href.includes("doc.cgal.org")){
var url='https://doc.cgal.org/latest/Manual/menu_version.js';
var script = document.createElement("script"); // Make a script DOM node
script.src = url; // Set it's src to the provided URL
script.src = url; // Set its src to the provided URL
document.head.appendChild(script);
}
else
{
var url='../Manual/menu_version.js';
var script = document.createElement("script"); // Make a script DOM node
script.src = url; // Set it's src to the provided URL
script.src = url; // Set its src to the provided URL
document.head.appendChild(script);
}
})();

View File

@ -222,7 +222,7 @@ ALIASES = "cgal=%CGAL" \
# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
# FortranFree, unknown formatted Fortran: Fortran. In the latter case the parser
# tries to guess whether the code is fixed or free formatted code, this is the
# default for Fortran type files). For instance to make doxygen treat .inc files
# as Fortran files (default is PHP), and .f files as C (default is Fortran),

View File

@ -98,14 +98,14 @@ $(document).ready(function() {
if(window.location.href.includes("doc.cgal.org")){
var url='https://doc.cgal.org/latest/Manual/menu_version.js';
var script = document.createElement("script"); // Make a script DOM node
script.src = url; // Set it's src to the provided URL
script.src = url; // Set its src to the provided URL
document.head.appendChild(script);
}
else
{
var url='../Manual/menu_version.js';
var script = document.createElement("script"); // Make a script DOM node
script.src = url; // Set it's src to the provided URL
script.src = url; // Set its src to the provided URL
document.head.appendChild(script);
}
})();

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