Merge remote-tracking branch 'cgal/master' into pr/afabri/8528

This commit is contained in:
Laurent Rineau 2024-10-17 00:19:50 +02:00
commit 96cd3e6f09
190 changed files with 1520 additions and 566 deletions

1
.gitattributes vendored
View File

@ -58,7 +58,6 @@ Scripts/developer_scripts/check_svn_keywords text eol=lf
Scripts/developer_scripts/create_cgal_test text eol=lf
Scripts/developer_scripts/create_cgal_test_with_cmake text eol=lf
Scripts/developer_scripts/create_internal_release text eol=lf
Scripts/developer_scripts/create_macosx_installer text eol=lf
Scripts/developer_scripts/create_new_release text eol=lf
Scripts/developer_scripts/detect_files_with_mixed_eol_styles text eol=lf
Scripts/developer_scripts/detect_packages_licenses text eol=lf

2
.gitignore vendored
View File

@ -1058,7 +1058,7 @@ cmake_install.cmake
*~
.#*
# MacOS file https://en.wikipedia.org/wiki/.DS_Store
# macOS file https://en.wikipedia.org/wiki/.DS_Store
.DS_Store
# Binaries:

View File

@ -551,7 +551,7 @@ public:
traits.intersection(query, singleton_data());
break;
default: // if(size() >= 2)
root_node()->template traversal_with_priority_and_group_traversal(m_primitives, query, traits, m_primitives.size(), 0, group_traversal_bound);
root_node()->traversal_with_priority_and_group_traversal(m_primitives, query, traits, m_primitives.size(), 0, group_traversal_bound);
}
}

View File

@ -56,7 +56,7 @@ public:
/**
* @brief General traversal query
* @param query the query
* @param traits the traversal traits that define the traversal behaviour
* @param traits the traversal traits that define the traversal behavior
* @param nb_primitives the number of primitive
*
* General traversal query. The traits class allows using it for the various

View File

@ -65,7 +65,7 @@ class Bitstream_descartes;
/*
* \brief Thrown whenever a non-specialised virtual member function is called
* \brief Thrown whenever a non-specialized virtual member function is called
*/
class Virtual_method_exception {};
@ -128,7 +128,7 @@ public:
/*!
* Constructor computing an interval containing all real roots of \c f,
* and initialising the Bitstream Descartes tree
* and initializing the Bitstream Descartes tree
*/
Generic_descartes_rep(Bitstream_descartes_type type,
Polynomial f,
@ -170,7 +170,7 @@ public:
/*!
* Constructor that copies the Bitstream tree given from outside
* and initialising the Bitstream Descartes tree
* and initializing the Bitstream Descartes tree
* The tree must "fit" to the polynomial
*/
Generic_descartes_rep(Bitstream_descartes_type type,
@ -367,7 +367,7 @@ public:
/*!
* \brief When does the isolation algorithm terminate?
*
* This method must be specialised by derived classes
* This method must be specialized by derived classes
*/
virtual bool termination_condition() {
throw Virtual_method_exception();
@ -378,7 +378,7 @@ public:
* \brief gives an opportunity to process the nodes after
* the subdivision steps are finished
*
* This method must be specialised by derived classes, but can
* This method must be specialized by derived classes, but can
* remain empty in many cases.
*/
virtual void process_nodes() {
@ -389,7 +389,7 @@ public:
/*! \brief returns whether the \c i th root is definitely a simple root
* of the isolated polynomial
*
* Must be specialised by derived class
* Must be specialized by derived class
*/
virtual bool is_certainly_simple_root(int) const {
throw Virtual_method_exception();
@ -399,7 +399,7 @@ public:
/*! \brief returns whether the \c i th root is definitely a multiple root
* of the isolated polynomial
*
* Must be specialised by derived class
* Must be specialized by derived class
*/
virtual bool is_certainly_multiple_root(int) const {
throw Virtual_method_exception();
@ -1082,7 +1082,7 @@ protected:
* variant of the Bitstream Descartes method: The Square_free_descartes_tag
* starts the usual Bitstream method for square free integer polynomials.
* With the M_k_descartes tag, it is able to handle one multiple root in
* favourable situations, the Backshear_descartes_tag allows to isolate
* favorable situations, the Backshear_descartes_tag allows to isolate
* even more complicated polynomials, if the multiple roots with even
* multiplicity can be refined from outside. See the corresponding
* constructors for more information.

View File

@ -865,7 +865,7 @@ public:
by trying randomly and checking. This randomization means
the same polynomial and same initial interval may give rise
to different intervals each time this class is used.
As indicated in the paper, we favour subdivision ratios
As indicated in the paper, we favor subdivision ratios
with a small denominator. Hence we first try denominator
2 (subdivision at midpoint), then denominator 16, and
only then the "proper" denominator prescribed by theory.

View File

@ -469,7 +469,7 @@ public:
* (\c SHEAR_ONLY_AT_IRRATIONAL_STRATEGY)
* is to \c shear the curve
* if a degenerate situation is detected during the analysis,
* except at rational x-coordinates where the curve can be analysed
* except at rational x-coordinates where the curve can be analyzed
* more directly. The analysis
* is then performed in the sheared system, and finally translated back
* into the original system.

View File

@ -140,7 +140,7 @@ public:
virtual ~LRU_hashed_map()
{ }
/*! \brief implements cache-like behaviour of the map
/*! \brief implements cache-like behavior of the map
*
* If the object is not in the map, it is constructed using \c Creator
* and added to the map
@ -312,7 +312,7 @@ public:
~LRU_hashed_map_with_kernel()
{ }
/*! \brief implements cache-like behaviour of the map
/*! \brief implements cache-like behavior of the map
*
* If the object is not in the map, it is constructed using \c Creator
* and added to the map

View File

@ -25,7 +25,7 @@ namespace CGAL {
/*!
* \brief Exception class for not sufficiently generic positions.
*
* Must be thrown whenever a curve cannot be analysed because its position
* Must be thrown whenever a curve cannot be analyzed because its position
* is not "good enough".
*/
class Non_generic_position_exception {
@ -40,7 +40,7 @@ namespace CGAL {
/*!
* \brief Exception class for not sufficiently generic positions.
*
* Must be thrown whenever a curve cannot be analysed because its position
* Must be thrown whenever a curve cannot be analyzed because its position
* is not "good enough".
*/
template<typename Polynomial>

View File

@ -76,7 +76,7 @@
/**
* If set, the curve and curve pair analysis are using specialized code
* to analyse conic curves, i.e. curves of degree 2
* to analyze conic curves, i.e. curves of degree 2
*/
#ifndef CGAL_ACK_USE_SPECIAL_TREATMENT_FOR_CONIX
#define CGAL_ACK_USE_SPECIAL_TREATMENT_FOR_CONIX 0

View File

@ -330,7 +330,7 @@ template<typename Arithmetic_kernel> void test_routine() {
#endif
}
{ // More tests...just analyse some curves and compute their segments
{ // More tests...just analyze some curves and compute their segments
Poly_int2 f = from_string<Poly_int2>("P[8(0,P[8(0,24)(1,-8)(2,-162)(3,204)(4,106)(5,-340)(6,240)(7,-72)(8,8)])(1,P[6(0,-60)(1,8)(2,304)(3,-400)(4,148)(5,8)(6,-8)])(2,P[6(0,18)(1,80)(2,-165)(3,-132)(4,367)(5,-212)(6,38)])(3,P[4(0,-30)(1,-136)(2,264)(3,-72)(4,-26)])(4,P[4(0,-15)(1,36)(2,89)(3,-144)(4,49)])(5,P[2(0,30)(1,-24)(2,-6)])(6,P[2(0,-6)(1,-28)(2,22)])(8,P[0(0,3)])]");
Curve_analysis_2 curve= construct_curve_2(f);
#if CGAL_ACK_DEBUG_FLAG

View File

@ -1638,7 +1638,7 @@ compute_edge_status( const Cell_handle& c,
last=ccirc;
while (is_infinite(ccirc) ) ++ccirc; //skip infinite incident cells
alpha = (*ccirc).get_alpha();
as.set_alpha_mid(alpha); // initialise as.alpha_mid to alpha value of an incident cell
as.set_alpha_mid(alpha); // initialize as.alpha_mid to alpha value of an incident cell
as.set_alpha_max(alpha); // same for as.alpha_max
while (++ccirc != last)
{

View File

@ -218,7 +218,7 @@ test_filtration(AS &A, bool verbose)
typename AS::NT alpha;
if(verbose) {
std::cerr << std::endl;
std::cerr << "Analyse filtration " << std::endl;
std::cerr << "Analyze filtration " << std::endl;
}
for (; filtre_it != filtration.end(); filtre_it++) {
if(assign(vertex, *filtre_it)) {

View File

@ -40,7 +40,7 @@ namespace {
Flag(bool init) : v{ init } {}
};
// EXTENDED AOS for analysing the arrangement
// EXTENDED AOS for analyzing the arrangement
using Ext_dcel = CGAL::Arr_extended_dcel<Geom_traits, Flag, Flag, Flag>;
using Ext_topol_traits =
CGAL::Arr_spherical_topology_traits_2<Geom_traits, Ext_dcel>;

View File

@ -339,7 +339,7 @@ public:
if (! valid)
return;
// Analyze the behaviour of the rational function at x = -oo (the source).
// Analyze the behavior of the rational function at x = -oo (the source).
Algebraic y0;
const Arr_parameter_space inf_s =
_analyze_at_minus_infinity (_numer, _denom, y0);
@ -351,7 +351,7 @@ public:
else // if (inf_s == ARR_INTERIOR)
_ps = Point_2 (0, y0);
// Analyze the behaviour of the rational function at x = +oo (the target).
// Analyze the behavior of the rational function at x = +oo (the target).
const Arr_parameter_space inf_t =
_analyze_at_plus_infinity (_numer, _denom, y0);
@ -735,7 +735,7 @@ public:
*/
Self split_at_pole (const Algebraic& x0)
{
// Analyze the behaviour of the function near the given pole.
// Analyze the behavior of the function near the given pole.
const std::pair<CGAL::Sign, CGAL::Sign> signs = _analyze_near_pole (x0);
const CGAL::Sign sign_left = signs.first;
const CGAL::Sign sign_right = signs.second;

View File

@ -450,7 +450,7 @@ public:
_info = (_info | IS_DIRECTED_RIGHT);
// Analyze the behaviour of the rational function at x = -oo (the source).
// Analyze the behavior of the rational function at x = -oo (the source).
Algebraic_real_1 y0;
const Arr_parameter_space inf_s = _analyze_at_minus_infinity(P, Q, y0);
@ -460,7 +460,7 @@ public:
_info = (_info | SRC_AT_Y_PLUS_INFTY);
else // if (inf_s == ARR_INTERIOR)
_ps = Algebraic_point_2(); //the point is a dummy
//Analyze the behaviour of the rational function at x = +oo (the target).
//Analyze the behavior of the rational function at x = +oo (the target).
const Arr_parameter_space inf_t = _analyze_at_plus_infinity(P, Q, y0);
if (inf_t == ARR_BOTTOM_BOUNDARY)
@ -949,7 +949,7 @@ public:
Self split_at_pole(const Algebraic_real_1& x0)
{
// Analyze the behaviour of the function near the given pole.
// Analyze the behavior of the function near the given pole.
const std::pair<CGAL::Sign, CGAL::Sign> signs = _analyze_near_pole(x0);
const CGAL::Sign sign_left = signs.first;
const CGAL::Sign sign_right = signs.second;

View File

@ -1578,7 +1578,7 @@ public:
return res;
}
// otherwise: both ends have asymptotic behaviour
// otherwise: both ends have asymptotic behavior
if (ps_y1 == ps_y2) { // need special y-comparison
if (ce1 == ce2) { // both ends approach asymptote from one side
Comparison_result res = m_self->compare_x_near_boundary_2_object()(xcv1, xcv2, ce2);

View File

@ -24,7 +24,7 @@
* \brief
* defines class Curve_renderer_traits.
*
* provides specialisations of Curve_renderer_traits for different number
* provides specializations of Curve_renderer_traits for different number
* types compatible with the curve renderer
*/

View File

@ -733,7 +733,7 @@ struct Graph_with_descriptor_with_graph_property_map {
}
}; // class Graph_with_descriptor_with_graph_property_map
//specialisation for lvaluepropertymaps
//specialization for lvaluepropertymaps
template <typename Graph, typename PM>
struct Graph_with_descriptor_with_graph_property_map<Graph, PM, boost::lvalue_property_map_tag> {

View File

@ -542,13 +542,13 @@ boundary of each input (linear) polygon as a cyclic sequence of single
(\f$x\f$-monotone) polylines. By default, `UsePolylines` is set to
`CGAL::Tag_true`, which implies that the boundary of the each input
(linear) polygon is treated as a cyclic sequence of (\f$x\f$-monotone)
polylines. In most cases this behaviour is superior (that is, less
polylines. In most cases this behavior is superior (that is, less
time-consuming) because the number of events handled as part of the
execution of the plane-sweep algorithm is reduced. In cases where the
boundaries of the input polygons frequently intersect, treating them
as polylines may become less efficient. In these cases substitute the
`UsePolylines` template parameter with `CGAL::Tag_false` to restore
the original behaviour (where the boundary of each input linear
the original behavior (where the boundary of each input linear
polygon is treated as a cyclic sequence of single \f$x\f$-monotone
segments).

View File

@ -5,7 +5,7 @@ namespace CGAL {
\ingroup PkgBoundingVolumesRef
The class `Min_sphere_annulus_d_traits_2` is a traits class for the \f$ d\f$-dimensional
optimisation algorithms using the two-dimensional \cgal kernel.
optimization algorithms using the two-dimensional \cgal kernel.
\tparam K must bea model for `Kernel`.
\tparam ET NT are models for `RingNumberType`. Their default type is `K::RT`.

View File

@ -5,7 +5,7 @@ namespace CGAL {
\ingroup PkgBoundingVolumesRef
The class `Min_sphere_annulus_d_traits_3` is a traits class for the \f$ d\f$-dimensional
optimisation algorithms using the three-dimensional \cgal kernel.
optimization algorithms using the three-dimensional \cgal kernel.
\tparam K must be a model for `Kernel`.
\tparam ET NT are models for `RingNumberType`. Their default type is `K::RT`.

View File

@ -5,7 +5,7 @@ namespace CGAL {
\ingroup PkgBoundingVolumesRef
The class `Min_sphere_annulus_d_traits_d` is a traits class for the \f$ d\f$-dimensional
optimisation algorithms using the \f$ d\f$-dimensional \cgal kernel.
optimization algorithms using the \f$ d\f$-dimensional \cgal kernel.
\tparam K must be a model for `Kernel`.
\tparam ET NT are models for `RingNumberType`. Their default type is `K::RT`.

View File

@ -71,7 +71,7 @@ namespace CGAL {
std::vector<const Point *> P; // input points
int n; // number of input points, i.e., P.size()
// This class comes in two flavours:
// This class comes in two flavors:
//
// (i) When Embed is false, the input points are taken to be
// ordinary points in R^{d_P}, where d_P is the dimension of the

View File

@ -33,7 +33,7 @@ namespace CGAL_MINIBALL_NAMESPACE {
// they are convertible to double.
// This is indeed the least invasive fix dropint the function that were
// defined here and cause linkage bug.
// You can still have a behaviour of instantiating only if a type
// You can still have a behavior of instantiating only if a type
// is convertibale to double (by using type_traits together with _if)
// but until "the whole design should be overhauled at some point"
// this is fine.

View File

@ -376,7 +376,7 @@ min_rectangle_2(
// quadruple of points defining the current rectangle
ForwardIterator curr[4];
// initialised to the points defining the bounding box
// initialized to the points defining the bounding box
convex_bounding_box_2(f, l, curr, t);
// curr[i] can be advanced (cyclically) until it reaches limit[i]
@ -482,7 +482,7 @@ min_parallelogram_2(ForwardIterator f,
// quadruple of points defining the bounding box
ForwardIterator curr[4];
// initialised to the points defining the bounding box
// initialized to the points defining the bounding box
convex_bounding_box_2(first, l, curr, t);
@ -659,7 +659,7 @@ min_strip_2(ForwardIterator f,
// quadruple of points defining the bounding box
ForwardIterator curr[4];
// initialised to the points defining the bounding box
// initialized to the points defining the bounding box
convex_bounding_box_2(first, l, curr, t);
ForwardIterator low = curr[0];

View File

@ -135,7 +135,7 @@ rectangular_3_center_2_type1(
rad = sdist(v(r, 2), v(r, 0));
// init to prevent default constructor requirement
Point bestpoint = *f;
// (initialisation avoids warning)
// (initialization avoids warning)
unsigned int bestrun = 0;
// two cases: top-left & bottom-right or top-right & bottom-left

View File

@ -11,7 +11,7 @@
// release : $CGAL_Revision: CGAL-wip $
// release_date : $CGAL_Date$
//
// chapter : $CGAL_Chapter: Optimisation $
// chapter : $CGAL_Chapter: Geometric Optimization $
// package : $CGAL_Package: MinSphere $
// file : min_sphere_test.C
// source : web/Optimisation/Min_sphere_d.aw

View File

@ -12,7 +12,7 @@
// release : $CGAL_Revision: CGAL-wip $
// release_date : $CGAL_Date$
//
// chapter : $CGAL_Chapter: Optimisation $
// chapter : $CGAL_Chapter: Geometric Optimization $
// package : $CGAL_Package: MinSphere $
// file : min_sphere_traits_2_test.C
// source : web/Optimisation/Min_sphere_d.aw

View File

@ -11,7 +11,7 @@
// release : $CGAL_Revision: CGAL-wip $
// release_date : $CGAL_Date$
//
// chapter : $CGAL_Chapter: Optimisation $
// chapter : $CGAL_Chapter: Geometric Optimization $
// package : $CGAL_Package: MinSphere $
// file : min_sphere_traits_3_test.C
// source : web/Optimisation/Min_sphere_d.aw

View File

@ -13,7 +13,7 @@
//
// file : test/Min_annulus_d/test_Min_annulus_d.h
// package : $CGAL_Package: Min_annulus_d $
// chapter : Geometric Optimisation
// chapter : Geometric Optimization
//
// source : web/Min_annulus_d.aw
// revision : $Id$

View File

@ -13,7 +13,7 @@
//
// file : test/Min_annulus_d/test_Min_annulus_d_2.cpp
// package : $CGAL_Package: Min_annulus_d $
// chapter : Geometric Optimisation
// chapter : Geometric Optimization
//
// revision : $Id$
// revision_date : $Date$

View File

@ -13,7 +13,7 @@
//
// file : test/Min_annulus_d/test_Min_annulus_d_3.cpp
// package : $CGAL_Package: Min_annulus_d $
// chapter : Geometric Optimisation
// chapter : Geometric Optimization
//
// revision : $Id$
// revision_date : $Date$

View File

@ -13,7 +13,7 @@
//
// file : test/Min_annulus_d/test_Min_annulus_d_d.cpp
// package : $CGAL_Package: Min_annulus_d $
// chapter : Geometric Optimisation
// chapter : Geometric Optimization
//
// revision : $Id$
// revision_date : $Date$

View File

@ -13,7 +13,7 @@
//
// file : test/Min_circle_2/test_Min_circle_2.C
// package : $CGAL_Package: Min_circle_2 $
// chapter : Geometric Optimisation
// chapter : Geometric Optimization
//
// source : web/Min_circle_2.aw
// revision : $Id$

View File

@ -13,7 +13,7 @@
//
// file : test/Min_ellipse_2/test_Min_ellipse_2.C
// package : $CGAL_Package: Min_ellipse_2 $
// chapter : Geometric Optimisation
// chapter : Geometric Optimization
//
// source : web/Min_ellipse_2.aw
// revision : $Id$

View File

@ -21,7 +21,7 @@
#include <CGAL/ImageIO.h>
/* read analyse format header
/* read analyze format header
return:
-1: error

View File

@ -108,8 +108,8 @@ typedef std::uint32_t CGAL_UINT32;
*/
/*
* Bitmapfileheader defines a single bitmap image. Its analogue in the
* Windows SDK is the Bitmapfileheader. Its analogues in the OS/2 Toolkit are
* Bitmapfileheader defines a single bitmap image. Its analog in the
* Windows SDK is the Bitmapfileheader. Its analogs in the OS/2 Toolkit are
* the Bitmapfileheader and Bitmapfileheader2 structures.
*
* A BITMAPHEADER structure is always concatenated to the end of a
@ -128,7 +128,7 @@ typedef struct Bitmapfileheader
/*
* BITMAPARRAYHEADER is used to establish a linked list of Bitmapfileheader
* structures for a bitmap file with multiple images in it. There is no
* equivalent structure in the Windows SDK. Its analogues in the OS/2 toolkit
* equivalent structure in the Windows SDK. Its analogs in the OS/2 toolkit
* are the BITMAPARRAYFILEHEADER and BITMAPARRAYFILEHEADER2 structures.
*
* A Bitmapfileheader structure is always concatenated to the end of a
@ -145,9 +145,9 @@ typedef struct BITMAPARRAYHEADER
/*
* BITMAPHEADER defines the properties of a bitmap. Its analogues in the
* BITMAPHEADER defines the properties of a bitmap. Its analogs in the
* Windows SDK are the BITMAPCOREINFOHEADER and BITMAPINFOHEADER structures.
* Its analogues in the OS/2 Toolkit are the BITMAPINFOHEADER and
* Its analogs in the OS/2 Toolkit are the BITMAPINFOHEADER and
* BITMAPINFOHEADER2 structures.
*
* A color table is concatenated to this structure. The number of elements in
@ -188,8 +188,8 @@ typedef struct BITMAPHEADER
/*
* RGB defines a single color palette entry. Its analogues in the Windows SDK
* are the RGBTRIPLE and RGBQUAD structures. Its analogues in the OS/2
* RGB defines a single color palette entry. Its analogs in the Windows SDK
* are the RGBTRIPLE and RGBQUAD structures. Its analogs in the OS/2
* Toolkit are the RGB and RGB2 structure.
*/
typedef struct RGB

View File

@ -283,7 +283,7 @@ RFcoefficientType * InitRecursiveCoefficients( double x,
b0 /= x;
b1 /= x;
/*--- normalisation ---*/
/*--- normalization ---*/
switch ( derivative ) {
default :
CGAL_FALLTHROUGH;

View File

@ -662,7 +662,7 @@ namespace CGAL {
}
/** Create a new dart and add it to the map.
* The marks of the darts are initialised with mmask_marks, i.e. the dart
* The marks of the darts are initialized with mmask_marks, i.e. the dart
* is unmarked for all the marks.
* @return a Dart_descriptor on the new dart.
*/
@ -4111,7 +4111,7 @@ namespace CGAL {
}
if (ah != null_descriptor)
{
// We initialise the 0-atttrib to ah
// We initialize the 0-atttrib to ah
internal::Set_i_attribute_of_dart_functor<Self, 0>::
run(*this, d1, ah);
}

View File

@ -228,7 +228,7 @@ struct Call_functor_if_both_attributes_have_point
const Pointconverter&)
{ return Map2::null_descriptor; }
};
// Specialisation with i==0 and both attributes have points.
// Specialization with i==0 and both attributes have points.
template< typename Map1, typename Map2, typename Pointconverter >
struct Call_functor_if_both_attributes_have_point<Map1, Map2, 0,
Pointconverter, true, true>
@ -285,7 +285,7 @@ struct Copy_attribute_functor_if_nonvoid
cmap2.template set_attribute<i>(dh2, res);
}
};
// Specialisation when attr1 is void, and attr2 is non void i==0. Nothing to
// Specialization when attr1 is void, and attr2 is non void i==0. Nothing to
// copy, but if 0-attributes has point and i==0, we need to create
// vertex attributes.
template<typename Map1, typename Map2, typename Converters,
@ -310,7 +310,7 @@ struct Copy_attribute_functor_if_nonvoid<Map1, Map2, Converters,
set_attribute<0>(dh2, cmap2.template create_attribute<0>());
}
};
// Specialisation when attr1 is void, and attr2 is non void i!=0.
// Specialization when attr1 is void, and attr2 is non void i!=0.
// Nothing to do.
template<typename Map1, typename Map2, typename Converters, unsigned int i,
typename Pointconverter, typename Attr2>
@ -360,7 +360,7 @@ struct Copy_dart_info_functor_if_nonvoid
const DartInfoConverter& converter)
{ converter(map1, map2, dh1, dh2); }
};
// Specialisation when Info1 is void.
// Specialization when Info1 is void.
template<typename Map1, typename Map2, typename DartInfoConverter,
typename Info2>
struct Copy_dart_info_functor_if_nonvoid<Map1, Map2, DartInfoConverter,
@ -373,7 +373,7 @@ struct Copy_dart_info_functor_if_nonvoid<Map1, Map2, DartInfoConverter,
const DartInfoConverter&)
{}
};
// Specialisation when Info2 is void.
// Specialization when Info2 is void.
template<typename Map1, typename Map2, typename DartInfoConverter,
typename Info1>
struct Copy_dart_info_functor_if_nonvoid<Map1, Map2, DartInfoConverter,
@ -386,7 +386,7 @@ struct Copy_dart_info_functor_if_nonvoid<Map1, Map2, DartInfoConverter,
const DartInfoConverter&)
{}
};
// Specialisation when both Info1 and Info2 are void.
// Specialization when both Info1 and Info2 are void.
template<typename Map1, typename Map2, typename DartInfoConverter>
struct Copy_dart_info_functor_if_nonvoid<Map1, Map2, DartInfoConverter,
CGAL::Void, CGAL::Void>

View File

@ -36,7 +36,7 @@ namespace CGAL
{
static bool run(const CMap& amap, typename CMap::Dart_const_descriptor adart)
{
// TODO? Optimisation for dim-2, and to not test all the darts of the cell?
// TODO? Optimization for dim-2, and to not test all the darts of the cell?
bool res = true;
for ( CGAL::CMap_dart_const_iterator_of_cell<CMap,i> it(amap, adart);
res && it.cont(); ++it )
@ -462,7 +462,7 @@ namespace CGAL
{
static bool run(const CMap& amap, typename CMap::Dart_const_descriptor adart)
{
// TODO ? Optimisation possible to not test all the darts of the cell ?
// TODO ? Optimization possible to not test all the darts of the cell ?
bool res = true;
for ( CGAL::CMap_dart_const_iterator_of_cell<CMap,i> it(amap, adart);
res && it.cont(); ++it )

View File

@ -156,7 +156,7 @@ namespace CGAL {
}
protected:
/** Default constructor: no real initialisation,
/** Default constructor: no real initialization,
* because this is done in the combinatorial map class.
*/
Dart_without_info()
@ -300,7 +300,7 @@ namespace CGAL {
{ return Base::operator==(other) && minfo==other.minfo; }
protected:
/** Default constructor: no real initialisation,
/** Default constructor: no real initialization,
* because this is done in the combinatorial or generalized map class.
*/
Dart()=default; // default => zero-initializing built-in types

View File

@ -115,7 +115,7 @@ public:
#if defined(CGAL_USE_LEDA) || defined(CGAL_USE_CORE)
/*
The specialised functor for computing the directions of cone boundaries exactly
The specialized functor for computing the directions of cone boundaries exactly
with a given cone number and a given initial direction.
*/
template <>

View File

@ -199,7 +199,7 @@ protected:
std::vector<typename Graph_::vertex_descriptor> S(vit, ve);
std::sort(S.begin (), S.end (), orderD1);
// Step 2: Initialise an empty set to store vertices sorted by orderD2
// Step 2: initialize an empty set to store vertices sorted by orderD2
typedef CGAL::ThetaDetail::Plane_scan_tree<typename Graph_::vertex_descriptor,
typename Graph_::vertex_descriptor,
Less_by_direction,

View File

@ -185,7 +185,7 @@ protected:
std::vector<typename Graph_::vertex_descriptor> S(vit, ve);
std::sort(S.begin (), S.end (), orderD1);
// Step 2: Initialise an empty set to store vertices sorted by orderD2
// Step 2: initialize an empty set to store vertices sorted by orderD2
Point_set pst(orderD2);
// Step 3: visit S in orderD1

View File

@ -93,7 +93,7 @@ std::string gnuplot_vertex_list (const Graph& g);
/* This struct is defined to use partial specialization to generate arrow styles differently for
* directed and undirected graphs.
* Note: Need to use structs because C++ before 11 doesn't allow partial specialisation
* Note: Need to use structs because C++ before 11 doesn't allow partial specialization
* for functions
*/
template <typename Graph, typename Directedness=typename Graph::directed_selector>

View File

@ -17,7 +17,7 @@ configuration.
create <B>a single executable</B> for 'source' linked with
compilations of all other source files
(`*.cc`, `*.cp`, `*.cxx`, `*.cpp`, `*.CPP`, `*.c++`, or `*.C`).
This behaviour is usually needed for (graphical) demos.
This behavior is usually needed for (graphical) demos.
If the parameter is not given, the script creates <B>one executable for each given
source file</B>.

View File

@ -47,7 +47,7 @@ also avoid CMake to link with the native threads support library on your system.
Much of the \cgal code contains assert statements for preconditions, and postconditions of functions
as well as in the code. These assertions can be switched on and off per package
and the user can change the error behaviour. For details see Section \ref secchecks
and the user can change the error behavior. For details see Section \ref secchecks
of Chapter \ref Chapter_STL_Extensions_for_CGAL.
\section Preliminaries_flags Compile-time Flags to Control Inlining

View File

@ -15,7 +15,7 @@ supporting C++17 or later.
| | `Clang` \cgalFootnote{<A HREF="https://clang.llvm.org/">\cgalFootnoteCode{https://clang.llvm.org/}</A>} compiler version 15.0.7 |
| \ms Windows | \gnu `g++` 11.4.0 or later\cgalFootnote{<A HREF="https://gcc.gnu.org/">\cgalFootnoteCode{https://gcc.gnu.org/}</A>} |
| | \ms Visual `C++` 15.9, 16.10, 17.0 (\visualstudio 2017, 2019, and 2022)\cgalFootnote{<A HREF="https://visualstudio.microsoft.com/">\cgalFootnoteCode{https://visualstudio.microsoft.com/}</A>} |
| MacOS X | \gnu `g++` 11.4.0 or later\cgalFootnote{<A HREF="https://gcc.gnu.org/">\cgalFootnoteCode{https://gcc.gnu.org/}</A>} |
| macOS | \gnu `g++` 11.4.0 or later\cgalFootnote{<A HREF="https://gcc.gnu.org/">\cgalFootnoteCode{https://gcc.gnu.org/}</A>} |
| | Apple `Clang` compiler versions 10.0.1, 12.0.5, and 15.0.0 |
<!-- Windows supported version are also listed on windows.html (must change both) -->

View File

@ -193,7 +193,7 @@ An example of a raster image with a rainbow ramp representing height
is given in \cgalFigureRef{TutorialGISFigRastering}.
\cgalFigureBegin{TutorialGISFigRastering, raster.jpg}
Raster visualisation of height using a rainbow ramp, ranging from
Raster visualization of height using a rainbow ramp, ranging from
light blue for low values to dark red for high values.
\cgalFigureEnd

View File

@ -38,7 +38,7 @@ other contexts can be done by obtaining a commercial license from
[GeometryFactory](https://www.geometryfactory.com). For more details
see the \ref license "License" page.
<h2>Acknowledgement</h2>
<h2>Acknowledgment</h2>
We provide bibtex entries for each package so that you can cite \cgal correctly in your publications,
see the page \ref how_to_cite_cgal.

View File

@ -101937,7 +101937,7 @@ used in many computational geometry algorithms. Contains C++ code."
@inproceedings{mp-drlvd-84
, author = "T. Matsuyama and T. Phillips"
, title = "Digital Realization of the Labelled {Voronoi} Diagram and its Application to Closed Boundary Detection"
, title = "Digital Realization of the Labeled {Voronoi} Diagram and its Application to Closed Boundary Detection"
, booktitle = "Proc. IEEE Internat. Conf. Pattern Recogn."
, year = 1984
, pages = "478--480"
@ -116182,7 +116182,7 @@ dither and stipple patterns."
@techreport{plvt-edecl-96
, author = "P. Parodi and R. Lancewicki and A. Vijh and J. K. Tsotsos"
, title = "Empirically-derived Estimates of the Complexity of Labelling Line Drawings of Polyhedral Scenes"
, title = "Empirically-derived Estimates of the Complexity of Labeling Line Drawings of Polyhedral Scenes"
, number = "RBCV-TR-96-52"
, institution = "Dept. Comput. Sci., Univ. Toronto"
, address = "Toronto, ON"
@ -116759,7 +116759,7 @@ dither and stipple patterns."
@article{p-rflg-72
, author = "T. Pavlidis"
, title = "Representation of figures by labelled graphs"
, title = "Representation of figures by labeled graphs"
, journal = "Pattern Recogn."
, volume = 4
, year = 1972
@ -133630,7 +133630,7 @@ Contains C code."
@inproceedings{sc-aipta-86
, author = "J. K. Sircar and J. A. Cerbrian"
, title = "Application of image processing techniques to the automated labelling of raster digitized contours"
, title = "Application of image processing techniques to the automated labeling of raster digitized contours"
, booktitle = "Proc. 2nd Internat. Sympos. Spatial Data Handling"
, year = 1986
, pages = "171--184"

View File

@ -1377,7 +1377,7 @@ struct Ith {
typedef T2 result_type;
// We keep a Sign member object
// for future utilisation, in case
// for future utilization, in case
// we have pairs of 2 T2 objects e.g.
// for a numeric_point vector returned
// from a construction of a possible

View File

@ -24,7 +24,7 @@ namespace CGAL {
* - GMap_cell_iterator<Map,i,dim>: one dart per each i-cell
* - GMap_one_dart_per_incident_cell_iterator<Map,Ite,i,dim>
* - GMap_one_dart_per_cell_iterator<Map,Ite,i,dim>
* - one specialisation of the CMap_cell_iterator for the
* - one specialization of the CMap_cell_iterator for the
* GMap_dart_iterator_basic_of_all iterator
*/

View File

@ -249,7 +249,7 @@ namespace CGAL {
class GMap_dart_iterator_basic_of_two_alpha;
/* Class CMap_dart_iterator_basic_of_two_alpha<Ai,1>: to iterate
* on the darts of the orbit <Ai,Ai+1>: Ai<Ai+1<=dimension.
* specialisation because here Aio(Ai+1) is not an involution.
* specialization because here Aio(Ai+1) is not an involution.
* Basic classes do not guaranty correct marks (i.e. do not unmark darts in
* the destructor, possible problem with the rewind). If you are not sure,
* use CMap_dart_iterator_basic_of_two_alpha.

View File

@ -568,7 +568,7 @@ namespace CGAL {
}
/** Create a new dart and add it to the map.
* The marks of the darts are initialised with mmask_marks, i.e. the dart
* The marks of the darts are initialized with mmask_marks, i.e. the dart
* is unmarked for all the marks.
* @return a Dart_descriptor on the new dart.
*/
@ -3352,7 +3352,7 @@ namespace CGAL {
}
if (ah != null_descriptor)
{
// We initialise the 0-atttrib to ah
// We initialize the 0-atttrib to ah
CGAL::internal::Set_i_attribute_of_dart_functor<Self, 0>::
run(*this, d1, ah);
mark(*it, amark);
@ -3471,7 +3471,7 @@ namespace CGAL {
<CGAL::internal::GMap_group_attribute_functor_of_dart<Self>, 0>::
run(*this,d1,d2);
// We initialise the 0-atttrib to ah
// We initialize the 0-atttrib to ah
CGAL::internal::Set_i_attribute_of_dart_functor<Self, 0>::
run(*this, d2, ah);
}

View File

@ -35,7 +35,7 @@ namespace CGAL
{
static bool run(const GMap& amap, typename GMap::Dart_const_descriptor adart)
{
// TODO? Optimisation for dim-2, and to not test all the darts of the cell?
// TODO? Optimization for dim-2, and to not test all the darts of the cell?
bool res = true;
for ( CGAL::GMap_dart_const_iterator_of_cell<GMap,i> it(amap, adart);
res && it.cont(); ++it )
@ -258,7 +258,7 @@ namespace CGAL
{
static bool run(const GMap& amap, typename GMap::Dart_const_descriptor adart)
{
// TODO ? Optimisation possible to not test all the darts of the cell ?
// TODO ? Optimization possible to not test all the darts of the cell ?
bool res = true;
for ( CGAL::GMap_dart_const_iterator_of_cell<GMap,i> it(amap, adart);
res && it.cont(); ++it )

View File

@ -15,7 +15,7 @@ a <I>state</I> that uniquely determines the subsequent numbers being
produced.
It can be very useful, e.g. for debugging, to reproduce a sequence of
random numbers. This can be done by either initialising with a fixed
random numbers. This can be done by either initializing with a fixed
seed, or by using the state functions as described below.
\note A `Random` object is not deterministic when used by several threads at

View File

@ -62,7 +62,7 @@ public:
const double& size() const { return second; }
const double& sine() const { return first; }
// q1<q2 means q1 is prioritised over q2
// q1<q2 means q1 is prioritized over q2
// ( q1 == *this, q2 == q )
bool operator<(const Quality& q) const
{

View File

@ -1225,7 +1225,7 @@ Vec Camera::pivotPoint() const { return frame()->pivotPoint(); }
/*! Sets the Camera's position() and orientation() from an OpenGL ModelView
matrix.
This enables a Camera initialisation from an other OpenGL application. \p
This enables a Camera initialization from an other OpenGL application. \p
modelView is a 16 GLdouble vector representing a valid OpenGL ModelView matrix,
such as one can get using: \code GLdouble mvm[16];
glGetDoublev(GL_MODELVIEW_MATRIX, mvm);

View File

@ -604,7 +604,7 @@ public:
// This guard is needed here because, rr==ll==begin, might be true
// at this point, causing the decrement to result in undefined
// behaviour.
// behavior.
// [Fernando Cacciola]
if ( ll < rr )
{

View File

@ -17,6 +17,7 @@
#define CGAL_HASH_MAP_INTERNAL_CHAINED_MAP_H
#include <CGAL/memory.h>
#include <CGAL/assertions.h>
#include <iostream>
#include <limits>
#include <type_traits>

View File

@ -1,3 +1,5 @@
Hash_map
Installation
Kernel_23
Profiling_tools
STL_Extension

View File

@ -1915,7 +1915,7 @@ Release date: April 2018
after the observer is notified that the edge has been removed. This is
symmetric (opposite) to the order of notification when an edge is inserted.
The user can restore old (non-symmetric) behaviour by defining the macro:
The user can restore old (non-symmetric) behavior by defining the macro:
`CGAL_NON_SYMETRICAL_OBSERVER_EDGE_REMOVAL_BACKWARD_COMPATIBILITY`
@ -3456,7 +3456,7 @@ Release date: October 2013
vertices which would move of very small displacements.
- Introduce new data structures and options for speed-up and
compacity. Note that `Compact_mesh_cell_base_3` and
`Mesh_vertex_base_3` are now our favoured implementations of the
`Mesh_vertex_base_3` are now our favored implementations of the
concepts MeshCellBase\_3 and MeshVertexBase\_3.
- Introduce a new constructor for `Polyhedral_mesh_domain_3` that
takes a bounding polyhedron to be meshed along with a polyhedral
@ -4567,9 +4567,9 @@ fixes for this release.
- The new macro CGAL\_NO\_DEPRECATED\_CODE can be defined to disable
deprecated code, helping users discover if they rely on code that
may be removed in subsequent releases.
- Assertion behaviour: It is not possible anymore to set the CONTINUE
- Assertion behavior: It is not possible anymore to set the CONTINUE
mode for assertion failures. Functions that allow to change the
assertion behaviour are now declared in
assertion behavior are now declared in
`<CGAL/assertions_behaviour.h>`.
- Qt3 based demos are still there but the documentation has been
removed as the CGAL::Qt\_Widget will be deprecated.
@ -5118,7 +5118,7 @@ static runtime (/ML).
- 2D Placement of Streamlines (new package)
Visualizing vector fields is important for many application domains.
A good way to do it is to generate streamlines that describe the
flow behaviour. This package implements the "Farthest Point Seeding"
flow behavior. This package implements the "Farthest Point Seeding"
algorithm for placing streamlines in 2D vector fields. It generates
a list of streamlines corresponding to an input flow using a
specified separating distance. The algorithm uses a Delaunay
@ -5140,7 +5140,7 @@ static runtime (/ML).
structures. The package supports exact or inexact operations on
primitives which move along polynomial trajectories.
- Smallest Enclosing Ellipsoid (new package)
This algorithm is new in the chapter Geometric Optimisation.
This algorithm is new in the chapter Geometric Optimization.
- 2D Arrangement (major revision)
This package can be used to construct, maintain, alter, and display
arrangements in the plane. Once an arrangement is constructed, the
@ -5155,9 +5155,9 @@ static runtime (/ML).
construction history of the arrangement, such that it is possible to
obtain the originating curve of an arrangement subcurve.
- Geometric Optimisation (major revision)
- Geometric Optimization (major revision)
The underlying QP solver which is the foundation for several
algorithms in the Geometric Optimisation chapter has been completely
algorithms in the Geometric Optimization chapter has been completely
rewritten.
- 3D Triangulation (new functionality)
Regular\_triangulation\_3 now offers vertex removal.
@ -5483,7 +5483,7 @@ The following functionality has been added or changed:
Face\_handle or Vertex\_handle.
- New classes Triangulation\_vertex\_base\_with\_info\_2 (and 3)
and Triangulation\_face\_base\_with\_info\_2 (and 3) to make
easier the customisation of base classes in most cases.
easier the customization of base classes in most cases.
- 2D Triangulation
- Regular triangulation provides an easy access to hidden points.
- The Triangulation\_hierarchy\_2, which provide an efficient
@ -5985,7 +5985,7 @@ kernels themselves can be used as traits classes in many instances.
- The traits class requirements have been changed.
- The simplicity test has a completely new implementation.
- Properties like convexity, simplicity and area can now be cached
by polygons. You need to set a flag to select this behaviour.
by polygons. You need to set a flag to select this behavior.
@ -6158,7 +6158,7 @@ The following functionality has been added:
stored within a class, debugging is easier using this kernel. This
kernel can also be faster in some cases than the reference-counted
Cartesian kernel.
- New optimisation algorithms
- New optimization algorithms
- Min\_annulus\_d - Algorithm for computing the smallest enclosing
annulus of points in arbitrary dimension
- Polytope\_distance\_d - Algorithm for computing the (squared)
@ -6215,7 +6215,7 @@ The following functionality has been added:
triangulations.
- Triangulations in 3D were added, both Delaunay triangulations and
regular triangulations.
- Min\_quadrilateral optimisations have been added. These are
- Min\_quadrilateral optimizations have been added. These are
algorithms to compute the minimum enclosing rectangle/parallelogram
(arbitrary orientation) and the minimum enclosing strip of a convex
point set.

View File

@ -3,8 +3,6 @@
# CORE_INCLUDE_DIR - the CORE include directory
# CORE_LIBRARIES - Libraries needed to use CORE
# TODO: support Windows and MacOSX
# CORE needs GMP
include(FindPackageHandleStandardArgs)

View File

@ -5,8 +5,6 @@
# GMP_LIBRARIES_DIR - directory where the GMP libraries are located
# GMP_LIBRARIES - Link these to use GMP
# TODO: support MacOSX
include(FindPackageHandleStandardArgs)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)

View File

@ -4,8 +4,6 @@
# GMPXX_INCLUDE_DIR - the GMPXX include directory
# GMPXX_LIBRARIES - Libraries needed to use GMPXX
# TODO: support Windows and MacOSX
# GMPXX needs GMP
find_package( GMP QUIET )

View File

@ -4,8 +4,6 @@
# MPFR_LIBRARIES_DIR - Directory where the MPFR libraries are located
# MPFR_LIBRARIES - the MPFR libraries
# TODO: support MacOSX
include(FindPackageHandleStandardArgs)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)

View File

@ -243,20 +243,6 @@
# define CGAL_SUNPRO_INITIALIZE(C)
#endif
//----------------------------------------------------------------------//
// MacOSX specific.
//----------------------------------------------------------------------//
#ifdef __APPLE__
# if defined(__GNUG__) && (__GNUG__ == 4) && (__GNUC_MINOR__ == 0) \
&& defined(__OPTIMIZE__) && !defined(CGAL_NO_WARNING_FOR_MACOSX_GCC_4_0_BUG)
# warning "Your configuration may exhibit run-time errors in CGAL code"
# warning "This appears with g++ 4.0 on MacOSX when optimizing"
# warning "You can disable this warning using -DCGAL_NO_WARNING_FOR_MACOSX_GCC_4_0_BUG"
# warning "For more information, see https://www.cgal.org/FAQ.html#mac_optimization_bug"
# endif
#endif
//-------------------------------------------------------------------//
// When the global min and max are no longer defined (as macros)
// because of NOMINMAX flag definition, we define our own global

View File

@ -9,7 +9,7 @@
//
// Author(s) : Andreas Fabri
//
// Warning: this file is generated, see include/CGAL/licence/README.md
// Warning: this file is generated, see include/CGAL/license/README.md
// not entirely true due to the backward compatibility issue
#ifndef CGAL_LICENSE_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_H

View File

@ -156,9 +156,9 @@ public:
Pl pl(pl0, pl1, pl2);
P pl3 = pl0 + FT(this->r.get_double()) * V(pl1 - pl0) + FT(this->r.get_double()) * V(pl1 - pl0);
if(pl.has_on(l1))
Base::template check_intersection(L(pl3, l1), pl, L(pl3, l1)); // both points on the plane
Base::check_intersection(L(pl3, l1), pl, L(pl3, l1)); // both points on the plane
else
Base::template check_intersection(L(pl3, l1), pl, pl3); // single point on the plane
Base::check_intersection(L(pl3, l1), pl, pl3); // single point on the plane
if(pl.oriented_side(l0) != pl.oriented_side(l1)) // l0 xor l1 on pl is fine
{

View File

@ -19,7 +19,7 @@ protected:
// typedef typename boost::property_traits<VertexPropertyMap>::value_type vpm_value_type;
// typedef typename boost::property_traits<VertexPropertyMap>::key_type vpm_key_type;
//vertex indices are initialised to -1
//vertex indices are initialized to -1
static void reset_ring_indices(std::vector < Vertex * >&vces,
VertexPropertyMap& vpm);

View File

@ -41,7 +41,6 @@
#include <CGAL/linear_least_squares_fitting_2.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2_algorithms.h>
// Boost includes.
#include <boost/iterator/function_output_iterator.hpp>

View File

@ -205,13 +205,6 @@ public:
}
};
struct Reconstructed_model {
std::vector<PFace> pfaces;
void clear() {
pfaces.clear();
}
};
private:
std::vector<Support_plane> m_support_planes;
std::vector<typename Support_plane::Data> m_initial_support_planes;
@ -239,7 +232,6 @@ private:
std::vector<std::size_t> m_face2sp;
std::vector<std::set<std::size_t> > m_sp2input_polygon;
std::map<std::size_t, std::size_t> m_input_polygon_map; // Maps index of input polygon onto support plane indices.
Reconstructed_model m_reconstructed_model;
public:
Data_structure(const Parameters& parameters, const std::string &prefix) : to_exact(), from_exact(), m_parameters(parameters), m_prefix(prefix) {
@ -266,7 +258,6 @@ public:
m_volumes.clear();
m_pface_neighbors.clear();
m_input_polygon_map.clear();
m_reconstructed_model.clear();
}
void precompute_iedge_data() {
@ -594,9 +585,6 @@ public:
const std::vector<std::size_t> &face(std::size_t face_index) const { return m_face2vertices[face_index]; }
const Point_3& vertex(std::size_t vertex_index) const { return m_vertices[vertex_index]; }
Reconstructed_model& reconstructed_model() { return m_reconstructed_model; }
const Reconstructed_model& reconstructed_model() const { return m_reconstructed_model; }
/*******************************
** SUPPORT PLANES **
********************************/

View File

@ -17,14 +17,14 @@
// CGAL includes.
#include <CGAL/Timer.h>
#include <CGAL/optimal_bounding_box.h>
#include <CGAL/Boolean_set_operations_2.h>
//#include <CGAL/optimal_bounding_box.h>
//#include <CGAL/Boolean_set_operations_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/intersections.h>
#include <CGAL/min_quadrilateral_2.h>
#include <CGAL/Aff_transformation_2.h>
#include <boost/optional/optional_io.hpp>
//#include <CGAL/Aff_transformation_2.h>
//#include <boost/optional/optional_io.hpp>
// Internal includes.
#include <CGAL/KSP/utils.h>
@ -74,7 +74,7 @@ private:
using From_exact = CGAL::Cartesian_converter<Intersection_kernel, Kernel>;
using Bbox_3 = CGAL::Bbox_3;
using OBB_traits = CGAL::Oriented_bounding_box_traits_3<Kernel>;
//using OBB_traits = CGAL::Oriented_bounding_box_traits_3<Kernel>;
using Parameters = KSP::internal::Parameters_3<FT>;

View File

@ -566,7 +566,15 @@ public:
#ifndef DOXYGEN_RUNNING
void partition(std::size_t k, FT& partition_time, FT& finalization_time, FT& conformal_time) {
m_volumes.clear();
if (!m_volumes.empty()) {
for (Sub_partition& node : m_partition_nodes) {
node.m_data->reset_to_initialization();
node.face_neighbors.clear();
node.face2vertices.clear();
node.volumes.clear();
}
m_volumes.clear();
}
Timer timer;
timer.start();
partition_time = 0;
@ -2271,6 +2279,7 @@ private:
m_points.clear();
m_points.reserve(count);
m_polygons.clear();
m_polygons.reserve(m_input_polygons.size());
To_exact to_exact;
@ -2313,6 +2322,7 @@ private:
max_count = (std::max<std::size_t>)(max_count, node);
}
m_partition_nodes.clear();
m_partition_nodes.resize(leaf_count);
m_node2partition.resize(max_count + 1, std::size_t(-1));

View File

@ -1,20 +1,16 @@
Algebraic_foundations
Arithmetic_kernel
Arrangement_on_surface_2
BGL
Boolean_set_operations_2
Bounding_volumes
CGAL_Core
Cartesian_kernel
Circulator
Combinatorial_map
Convex_hull_2
Convex_hull_3
Distance_2
Distance_3
Filtered_kernel
Generalized_map
HalfedgeDS
Hash_map
Homogeneous_kernel
Installation
@ -27,7 +23,6 @@ Kinetic_space_partition
Linear_cell_complex
Modular_arithmetic
Number_types
Optimal_bounding_box
Orthtree
Point_set_3
Point_set_processing_3
@ -43,7 +38,5 @@ Solver_interface
Spatial_sorting
Stream_support
Surface_mesh
Surface_sweep_2
TDS_2
Triangulation_2
Union_find

View File

@ -25,23 +25,23 @@ int main() {
auto param = CGAL::parameters::maximum_distance(0.5)
.maximum_angle(10)
.k_neighbors(12)
.minimum_region_size(50);
.minimum_region_size(250);
// Algorithm.
KSR ksr(point_set, param);
ksr.detection_and_partition(1, param);
std::cout << ksr.detect_planar_shapes() << " planar shapes detected" << std::endl;
std::cout << ksr.detected_planar_shapes().size() << " planar shapes detected" << std::endl;
std::vector<Point_3> vtx;
std::vector<std::vector<std::size_t> > polylist;
ksr.reconstruct_with_ground(0.5, std::back_inserter(vtx), std::back_inserter(polylist));
ksr.reconstruct_with_ground(0.7, std::back_inserter(vtx), std::back_inserter(polylist));
if (polylist.size() > 0) {
std::cout << polylist.size() << " faces in reconstruction" << std::endl;
CGAL::IO::write_polygon_soup("building_0.5.ply", vtx, polylist);
CGAL::IO::write_polygon_soup("building_0.7.ply", vtx, polylist);
return EXIT_SUCCESS;
}
else {

View File

@ -13,19 +13,19 @@
#include "include/Parameters.h"
#include "include/Terminal_parser.h"
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using FT = typename Kernel::FT;
using Point_3 = typename Kernel::Point_3;
using Vector_3 = typename Kernel::Vector_3;
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using FT = typename Kernel::FT;
using Point_3 = typename Kernel::Point_3;
using Vector_3 = typename Kernel::Vector_3;
using Segment_3 = typename Kernel::Segment_3;
using Point_set = CGAL::Point_set_3<Point_3>;
using Point_map = typename Point_set::Point_map;
using Normal_map = typename Point_set::Vector_map;
using Point_set = CGAL::Point_set_3<Point_3>;
using Point_map = typename Point_set::Point_map;
using Normal_map = typename Point_set::Vector_map;
using KSR = CGAL::Kinetic_surface_reconstruction_3<Kernel, Point_set, Point_map, Normal_map>;
using Parameters = CGAL::KSR::All_parameters<FT>;
using Parameters = CGAL::KSR::All_parameters<FT>;
using Terminal_parser = CGAL::KSR::Terminal_parser<FT>;
using Timer = CGAL::Real_timer;
@ -50,10 +50,10 @@ void parse_terminal(Terminal_parser& parser, Parameters& parameters) {
parser.add_str_parameter("-data", parameters.data);
// Shape detection.
parser.add_val_parameter("-kn" , parameters.k_neighbors);
parser.add_val_parameter("-dist" , parameters.maximum_distance);
parser.add_val_parameter("-kn", parameters.k_neighbors);
parser.add_val_parameter("-dist", parameters.maximum_distance);
parser.add_val_parameter("-angle", parameters.maximum_angle);
parser.add_val_parameter("-minp" , parameters.min_region_size);
parser.add_val_parameter("-minp", parameters.min_region_size);
// Shape regularization.
@ -167,10 +167,18 @@ int main(const int argc, const char** argv) {
// Algorithm.
KSR ksr(point_set, param);
FT max_d, max_dev;
std::size_t num;
ksr.estimate_detection_parameters(max_d, max_dev, num);
std::cout << "d: " << max_d << std::endl;
std::cout << "dev: " << max_dev << std::endl;
std::cout << "num: " << num << std::endl;
Timer timer;
timer.start();
std::size_t num_shapes = ksr.detect_planar_shapes(param);
std::cout << num_shapes << " detected planar shapes" << std::endl;
FT after_shape_detection = timer.time();
@ -198,12 +206,12 @@ int main(const int argc, const char** argv) {
FT after_reconstruction = timer.time();
if (polylist.size() > 0)
CGAL::IO::write_polygon_soup("polylist_" + std::to_string(parameters.graphcut_lambda) + (parameters.use_ground ? "_g" : "_") + ".off", vtx, polylist);
CGAL::IO::write_polygon_soup("building_c_" + std::to_string(parameters.graphcut_lambda) + (parameters.use_ground ? "_g" : "_") + ".off", vtx, polylist);
timer.stop();
const FT time = static_cast<FT>(timer.time());
std::vector<FT> lambdas{0.3, 0.5, 0.6, 0.7, 0.73, 0.75, 0.77, 0.8, 0.9, 0.95, 0.99};
std::vector<FT> lambdas{ 0.3, 0.5, 0.6, 0.7, 0.73, 0.75, 0.77, 0.8, 0.9, 0.95, 0.99 };
bool non_empty = false;
@ -214,7 +222,6 @@ int main(const int argc, const char** argv) {
vtx.clear();
polylist.clear();
if (parameters.use_ground)
ksr.reconstruct_with_ground(l, std::back_inserter(vtx), std::back_inserter(polylist));
else
@ -223,7 +230,7 @@ int main(const int argc, const char** argv) {
if (polylist.size() > 0) {
non_empty = true;
CGAL::IO::write_polygon_soup("polylist_" + std::to_string(l) + (parameters.use_ground ? "_g" : "_") + ".off", vtx, polylist);
CGAL::IO::write_polygon_soup("building_c_" + std::to_string(l) + (parameters.use_ground ? "_g" : "_") + ".off", vtx, polylist);
}
}

View File

@ -94,6 +94,9 @@ public:
const NamedParameters& np = CGAL::parameters::default_values()) : m_points(points), m_ground_polygon_index(-1), m_kinetic_partition(np) {
m_verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false);
m_debug = parameters::choose_parameter(parameters::get_parameter(np, internal_np::debug), false);
m_point_map = Point_set_processing_3_np_helper<Point_range, NamedParameters, Point_map>::get_point_map(m_points, np);
m_normal_map = Point_set_processing_3_np_helper<Point_range, NamedParameters, Normal_map>::get_normal_map(m_points, np);
}
/*!
@ -133,7 +136,7 @@ public:
\cgalParamNBegin{minimum_region_size}
\cgalParamDescription{Shape detection: minimum number of 3D points a region must have}
\cgalParamType{`std::size_t`}
\cgalParamDefault{1% of input points}
\cgalParamDefault{0.5% of input points}
\cgalParamNEnd
\cgalParamNBegin{angle_tolerance}
\cgalParamDescription{Shape regularization: maximum allowed angle in degrees between plane normals used for parallelism, orthogonality, and axis symmetry}
@ -189,9 +192,6 @@ public:
m_regions.clear();
m_planar_regions.clear();
m_point_map = Point_set_processing_3_np_helper<Point_range, CGAL_NP_CLASS, Point_map>::get_point_map(m_points, np);
m_normal_map = Point_set_processing_3_np_helper<Point_range, CGAL_NP_CLASS, Normal_map>::get_normal_map(m_points, np);
create_planar_shapes(np);
CGAL_assertion(m_planes.size() == m_polygons.size());
@ -266,7 +266,7 @@ public:
\cgalParamNBegin{minimum_region_size}
\cgalParamDescription{Shape detection: minimum number of 3D points a region must have}
\cgalParamType{`std::size_t`}
\cgalParamDefault{1% of input points}
\cgalParamDefault{0.5% of input points}
\cgalParamNEnd
\cgalParamNBegin{angle_tolerance}
\cgalParamDescription{Shape regularization: maximum allowed angle in degrees between plane normals used for parallelism, orthogonality, and axis symmetry}
@ -323,6 +323,31 @@ public:
partition(k);
}
void estimate_detection_parameters(FT& max_distance, FT& normal_dev, std::size_t& min_inliers) {
if (!m_neighbor_query) {
m_neighbor_query = std::unique_ptr<Neighbor_query>(new Neighbor_query(m_points, parameters::point_map(m_point_map).k_neighbors(12)));
m_sorting = std::unique_ptr<Sorting>(new Sorting(m_points, *m_neighbor_query, parameters::point_map(m_point_map)));
m_sorting->sort();
}
max_distance = 4 * m_sorting->mean_distance();
normal_dev = m_sorting->mean_deviation();
min_inliers = m_points.size() * 0.005; // difficult to estimate as it depends on the kind of data, e.g., object scan vs. large scale urban acquisition
}
std::size_t estimate_max_subdivision_depth() {
std::size_t max_depth = 1;
std::size_t num_shapes = m_polygon_indices.size();
if (num_shapes > 60)
while (num_shapes > 20) {
max_depth++;
num_shapes >>= 3;
}
return max_depth;
}
/*!
\brief initializes the kinetic partition.
@ -347,8 +372,6 @@ public:
*/
template<typename CGAL_NP_TEMPLATE_PARAMETERS>
void initialize_partition(const CGAL_NP_CLASS& np = parameters::default_values()) {
m_kinetic_partition.insert(m_polygon_pts, m_polygon_indices, np);
m_kinetic_partition.initialize(np);
}
@ -408,6 +431,9 @@ public:
*/
template<class OutputPointIterator, class OutputPolygonIterator>
void reconstruct_with_ground(FT lambda, OutputPointIterator pit, OutputPolygonIterator polyit) {
if (m_kinetic_partition.number_of_volumes() == 0)
return;
KSR_3::Graphcut<Kernel> gc(lambda);
// add ground consideration here
@ -482,6 +508,9 @@ public:
*/
template<class OutputPointIterator, class OutputPolygonIterator>
void reconstruct(FT lambda, std::map<typename KSP::Face_support, bool> external_nodes, OutputPointIterator pit, OutputPolygonIterator polyit) {
if (m_kinetic_partition.number_of_volumes() == 0)
return;
KSR_3::Graphcut<Kernel> gc(lambda);
// add node consideration here
@ -565,6 +594,9 @@ private:
bool m_verbose;
bool m_debug;
std::unique_ptr<Neighbor_query> m_neighbor_query;
std::unique_ptr<Sorting> m_sorting;
Point_range &m_points;
Point_map m_point_map;
Normal_map m_normal_map;
@ -619,7 +651,9 @@ private:
m_face_inliers.clear();
auto face_range = m_lcc.template one_dart_per_cell<2>();
m_faces_lcc.clear();
m_faces_lcc.reserve(face_range.size());
m_attrib2index_lcc.clear();
for (auto& d : face_range) {
typename LCC::Dart_descriptor dh = m_lcc.dart_descriptor(d);
@ -643,9 +677,13 @@ private:
// Create value arrays for graph cut
m_face_inliers.resize(m_faces_lcc.size());
m_face_area.resize(m_faces_lcc.size());
m_face_area_lcc.clear();
m_face_area_lcc.resize(m_faces_lcc.size());
m_face_neighbors_lcc.clear();
m_face_neighbors_lcc.resize(m_faces_lcc.size(), std::pair<int, int>(-1, -1));
m_neighbors2index_lcc.clear();
m_cost_matrix.clear();
m_cost_matrix.resize(2);
m_cost_matrix[0].resize(m_kinetic_partition.number_of_volumes() + 6, 0);
m_cost_matrix[1].resize(m_kinetic_partition.number_of_volumes() + 6, 0);
@ -1534,7 +1572,7 @@ private:
// Start extraction of a border from each dart (each dart is a 1/n-edge)
// Search starting darts by searching faces
//borders contains Attribute<0> handles casted to std::size_t
std::vector<bool> processed(m_lcc.number_of_darts(), false);
std::vector<bool> processed(m_lcc.upper_bound_on_dart_ids(), false);
borders_per_region.resize(region_index.size());
@ -1687,13 +1725,8 @@ private:
m_volumes[i] = 0;
}
// std::size_t count_faces = 0;
// std::size_t count_points = 0;
From_exact from_exact;
// std::size_t idx = 0;
for (std::size_t i = 0; i < m_faces_lcc.size(); i++) {
std::size_t v[] = { std::size_t(-1), std::size_t(-1) };
Point_3 c[2];
@ -1776,17 +1809,40 @@ private:
}
if (m_verbose) std::cout << "* getting planar shapes using region growing" << std::endl;
FT xmin, ymin, zmin, xmax, ymax, zmax;
auto pit = m_points.begin();
const Point_3& p = get(m_point_map, *pit);
xmin = xmax = p.x();
ymin = ymax = p.y();
zmin = zmax = p.z();
pit++;
while (pit != m_points.end()) {
const Point_3& p = get(m_point_map, *pit);
xmin = (std::min)(xmin, p.x());
xmax = (std::max)(xmax, p.x());
ymin = (std::min)(ymin, p.y());
ymax = (std::max)(ymax, p.y());
zmin = (std::min)(zmin, p.z());
zmax = (std::max)(zmax, p.z());
pit++;
}
FT diag = CGAL::sqrt((xmax - xmin) * (xmax - xmin) + (ymax - ymin) * (ymax - ymin) + (zmax - zmin) * (zmax - zmin));
// Parameters.
const std::size_t k = parameters::choose_parameter(parameters::get_parameter(np, internal_np::k_neighbors), 12);
const FT max_distance_to_plane = parameters::choose_parameter(parameters::get_parameter(np, internal_np::maximum_distance), FT(1));
const FT max_distance_to_plane = parameters::choose_parameter(parameters::get_parameter(np, internal_np::maximum_distance), diag * 0.02);
const FT max_accepted_angle = parameters::choose_parameter(parameters::get_parameter(np, internal_np::maximum_angle), FT(15));
const std::size_t min_region_size = parameters::choose_parameter(parameters::get_parameter(np, internal_np::minimum_region_size), 50);
const std::size_t min_region_size = parameters::choose_parameter(parameters::get_parameter(np, internal_np::minimum_region_size), m_points.size() * 0.005);
m_detection_distance_tolerance = max_distance_to_plane;
// Region growing.
Neighbor_query neighbor_query = CGAL::Shape_detection::Point_set::make_k_neighbor_query(
m_points, CGAL::parameters::k_neighbors(k));
if (!m_neighbor_query) {
m_neighbor_query = std::unique_ptr<Neighbor_query>(new Neighbor_query(m_points, parameters::point_map(m_point_map).k_neighbors(k)));
}
Region_type region_type = CGAL::Shape_detection::Point_set::make_least_squares_plane_fit_region(
m_points,
@ -1795,11 +1851,13 @@ private:
maximum_angle(max_accepted_angle).
minimum_region_size(min_region_size));
Sorting sorting = CGAL::Shape_detection::Point_set::make_least_squares_plane_fit_sorting(m_points, neighbor_query);
sorting.sort();
if (!m_sorting) {
m_sorting = std::unique_ptr<Sorting>(new Sorting(m_points, *m_neighbor_query, parameters::point_map(m_point_map)));
m_sorting->sort();
}
Region_growing region_growing(
m_points, sorting.ordered(), neighbor_query, region_type);
m_points, m_sorting->ordered(), *m_neighbor_query, region_type);
region_growing.detect(std::back_inserter(m_regions));
std::size_t unassigned = 0;
@ -1818,12 +1876,15 @@ private:
std::size_t num_shapes = m_regions.size();
if (m_regions.empty())
return;
const bool regularize_axis_symmetry = parameters::choose_parameter(parameters::get_parameter(np, internal_np::regularize_axis_symmetry), false);
const bool regularize_coplanarity = parameters::choose_parameter(parameters::get_parameter(np, internal_np::regularize_coplanarity), false);
const bool regularize_coplanarity = parameters::choose_parameter(parameters::get_parameter(np, internal_np::regularize_coplanarity), true);
const bool regularize_orthogonality = parameters::choose_parameter(parameters::get_parameter(np, internal_np::regularize_orthogonality), false);
const bool regularize_parallelism = parameters::choose_parameter(parameters::get_parameter(np, internal_np::regularize_parallelism), false);
const FT angle_tolerance = parameters::choose_parameter(parameters::get_parameter(np, internal_np::angle_tolerance), 25);
const FT maximum_offset = parameters::choose_parameter(parameters::get_parameter(np, internal_np::maximum_offset), 0.01);
const FT angle_tolerance = parameters::choose_parameter(parameters::get_parameter(np, internal_np::angle_tolerance), 5);
const FT maximum_offset = parameters::choose_parameter(parameters::get_parameter(np, internal_np::maximum_offset), max_distance_to_plane * 0.5);
// Regularize detected planes.
@ -1936,6 +1997,8 @@ private:
}
num_shapes = m_planar_regions.size();
m_kinetic_partition = KSP(m_polygon_pts, m_polygon_indices);
}
void map_points_to_faces(const std::size_t polygon_index, const std::vector<Point_3>& pts, std::vector<std::pair<typename LCC::Dart_descriptor, std::vector<std::size_t> > >& face_to_points) {
@ -2041,14 +2104,14 @@ private:
// 4 xmin
// 5 zmax
const double force = static_cast<double>(m_total_inliers * 3);
// 0 - cost for labelled as outside
// 0 - cost for labeled as outside
cost_matrix[0][0] = 0;
cost_matrix[0][1] = 0;
cost_matrix[0][2] = 0;
cost_matrix[0][3] = 0;
cost_matrix[0][4] = 0;
cost_matrix[0][5] = 0;
// 1 - cost for labelled as inside
// 1 - cost for labeled as inside
cost_matrix[1][0] = 0;
cost_matrix[1][1] = 0;
cost_matrix[1][2] = 0;

View File

@ -1,20 +1,16 @@
Algebraic_foundations
Arithmetic_kernel
Arrangement_on_surface_2
BGL
Boolean_set_operations_2
Bounding_volumes
Cartesian_kernel
CGAL_Core
Circulator
Combinatorial_map
Convex_hull_2
Convex_hull_3
Distance_2
Distance_3
Filtered_kernel
Generalized_map
HalfedgeDS
Hash_map
Homogeneous_kernel
Installation
@ -28,7 +24,6 @@ Kinetic_surface_reconstruction
Linear_cell_complex
Modular_arithmetic
Number_types
Optimal_bounding_box
Orthtree
Point_set_3
Point_set_processing_3
@ -48,9 +43,7 @@ Spatial_sorting
Stream_support
Surface_mesh
Surface_mesh_segmentation
Surface_sweep_2
TDS_2
TDS_3
Triangulation_2
Triangulation_3
Union_find

View File

@ -66,7 +66,7 @@
<item row="3" column="0">
<widget class="QLabel" name="runLloyd_label">
<property name="text">
<string>Run Lloyd Optimisation</string>
<string>Run Lloyd Optimization</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

View File

@ -280,7 +280,7 @@ private:
//according to the tag, a,b,c dim change but not the scale. We look for the max dimension of the whole image.
//A high scale factor will often go with a low dimension, to compensate it. So we don't want a max being the
//higher scale * the higher dim, hence the tag specialisation.
//higher scale * the higher dim, hence the tag specialization.
//TODO: set the scale factors according to the dimensipon to avoid doing that.
double compute_maxDim(x_tag) const
{

View File

@ -65,6 +65,15 @@ if(TARGET CGAL::Eigen3_support)
features_detection_plugin PRIVATE scene_points_with_normal_item
CGAL::Eigen3_support)
qt6_wrap_ui(kinetic_surface_reconstruction_pluginUI_FILES Kinetic_surface_reconstruction_plugin.ui)
cgal_lab_plugin(
kinetic_surface_reconstruction_plugin Kinetic_surface_reconstruction_plugin
${kinetic_surface_reconstruction_pluginUI_FILES} KEYWORDS PointSetProcessing)
target_link_libraries(
kinetic_surface_reconstruction_plugin PRIVATE scene_points_with_normal_item
CGAL::Eigen3_support scene_polygon_soup_item
scene_surface_mesh_item scene_points_with_normal_item)
cgal_lab_plugin(point_set_smoothing_plugin Point_set_smoothing_plugin
KEYWORDS PointSetProcessing)
target_link_libraries(

View File

@ -0,0 +1,602 @@
#include "ui_Kinetic_surface_reconstruction_plugin.h"
#include "Color_map.h"
#include "Color_ramp.h"
#include "id_printing.h"
#include "Messages_interface.h"
#include "Scene.h"
#include "Scene_polygon_soup_item.h"
#include "Scene_surface_mesh_item.h"
#include "Scene_points_with_normal_item.h"
#include <CGAL/Three/CGAL_Lab_plugin_interface.h>
#include <CGAL/Three/CGAL_Lab_plugin_helper.h>
#include <CGAL/Three/Three.h>
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/Dynamic_property_map.h>
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
#include <CGAL/Polygon_mesh_processing/repair_polygon_soup.h>
#include <CGAL/Kinetic_surface_reconstruction_3.h>
#include <QAbstractItemView>
#include <QAction>
#include <QApplication>
#include <QColor>
#include <QColorDialog>
#include <QInputDialog>
#include <QMainWindow>
#include <QMessageBox>
#include <QSlider>
#include <QObject>
#include <QPalette>
#include <QStyleFactory>
#include <boost/algorithm/clamp.hpp>
#include <boost/range/value_type.hpp>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <typeinfo>
using namespace CGAL::Three;
using FT = typename Kernel::FT;
using Point_3 = typename Kernel::Point_3;
using Vector_3 = typename Kernel::Vector_3;
using Segment_3 = typename Kernel::Segment_3;
using Point_map = typename Point_set::Point_map;
using Normal_map = typename Point_set::Vector_map;
using KSR = CGAL::Kinetic_surface_reconstruction_3<CGAL::Epick, Point_set, Point_map, Normal_map>;
Viewer_interface* (&getActiveViewer)() = Three::activeViewer;
class DockWidget
: public QDockWidget,
public Ui::KineticSurfaceReconstructionWidget
{
public:
DockWidget(const QString& name, QWidget* parent)
: QDockWidget(name, parent)
{
setupUi(this);
}
};
class Kinetic_surface_reconstruction_plugin
: public QObject,
public CGAL_Lab_plugin_helper
{
Q_OBJECT
Q_INTERFACES(CGAL::Three::CGAL_Lab_plugin_interface)
Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.PluginInterface/1.0")
private:
QAction* actionKineticSurfaceReconstruction;
DockWidget* dock_widget;
Scene_points_with_normal_item* m_pwn_item = nullptr;
// A dock widget allows switching between items which makes managing parameters and intermediate results a mess.
// I could create a map from item to KSR and also reference intermediate results (in case they are recalculated with changed parameters)?
KSR *m_ksr = nullptr;
bool m_known_file = false;
public:
virtual ~Kinetic_surface_reconstruction_plugin() {
if (m_ksr)
delete m_ksr;
m_ksr = nullptr;
}
bool applicable(QAction*) const override
{
Scene_item* item = scene->item(scene->mainSelectionIndex());
if (!item)
return false;
Scene_points_with_normal_item* pwn_item = qobject_cast<Scene_points_with_normal_item*>(item);
if (pwn_item != nullptr && pwn_item->has_normals())
return true;
else
return false;
}
QList<QAction*> actions() const override
{
return QList<QAction*>() << actionKineticSurfaceReconstruction;
}
void init(QMainWindow* mw,
Scene_interface* sc,
Messages_interface*) override
{
this->scene = sc;
this->mw = mw;
// Main action
actionKineticSurfaceReconstruction = new QAction(QString("Kinetic Surface Reconstruction"), mw);
actionKineticSurfaceReconstruction->setObjectName("actionKineticSurfaceReconstruction");
connect(actionKineticSurfaceReconstruction, SIGNAL(triggered()),
this, SLOT(openDialog()));
Scene* scene_item = static_cast<Scene*>(scene);
connect(scene_item, SIGNAL(itemIndexSelected(int)),
this, SLOT(onItemIndexSelected(int)));
// Dock Widget
dock_widget = new DockWidget("Kinetic Surface Reconstruction", mw);
addDockWidget(dock_widget);
dock_widget->setVisible(false);
//dock_widget->setEnabled(false);
connect(dock_widget->sdRunButton, SIGNAL(clicked(bool)), this, SLOT(run_detection()));
connect(dock_widget->partRunButton, SIGNAL(clicked(bool)), this, SLOT(run_partition()));
connect(dock_widget->recRunButton, SIGNAL(clicked(bool)), this, SLOT(run_reconstruction()));
connect(dock_widget->partSubdivisionCheck, SIGNAL(stateChanged(int)), this, SLOT(onSubdivisionStateChanged(int)));
connect(dock_widget, SIGNAL(visibilityChanged(bool)), this, SLOT(onVisibilityChanged(bool)));
}
private Q_SLOTS:
void openDialog()
{
if (!dock_widget->isVisible())
dock_widget->show();
dock_widget->raise();
}
void closure() override
{
dock_widget->hide();
if (m_ksr) {
delete m_ksr;
m_ksr = nullptr;
}
}
void onItemIndexSelected(int item_index) {
if (!dock_widget->isVisible())
return;
Scene_points_with_normal_item *selection = qobject_cast<Scene_points_with_normal_item*>(scene->item(item_index));
if (selection == nullptr) {
// Keep old reference if no new point cloud has been selected.
if (m_pwn_item == nullptr)
dock_widget->setEnabled(false);
return;
}
if (m_pwn_item == selection) {
// The point cloud may have normals added after loading.
if (m_pwn_item->has_normals()) {
enable_detection(true);
enable_regularization(true);
}
return;
}
QObject* scene_obj = dynamic_cast<QObject*>(scene);
if (m_pwn_item) {
disconnect(m_pwn_item, nullptr, this, SLOT(onItemChanged()));
if (scene_obj)
disconnect(scene_obj, SIGNAL(itemAboutToBeDestroyed(CGAL::Three::Scene_item*)), this, SLOT(onItemDestroyed(CGAL::Three::Scene_item*)));
}
m_pwn_item = selection;
connect(m_pwn_item, SIGNAL(itemChanged()), this, SLOT(onItemChanged()));
if (scene_obj)
connect(scene_obj, SIGNAL(itemAboutToBeDestroyed(CGAL::Three::Scene_item*)), this, SLOT(onItemDestroyed(CGAL::Three::Scene_item*)));
if (m_ksr) {
delete m_ksr;
m_ksr = nullptr;
}
dock_widget->setEnabled(true);
if (m_pwn_item && m_pwn_item->has_normals()) {
enable_detection(true);
enable_regularization(true);
}
else {
enable_detection(false);
enable_regularization(false);
}
enable_partition(false);
enable_reconstruction(false);
prefill_parameters();
}
void onItemChanged() {
// Enable detection if the point set item has normals now
assert(m_pwn_item);
if (m_pwn_item->has_normals())
enable_detection(true);
}
void onItemDestroyed(CGAL::Three::Scene_item* item) {
if (m_pwn_item == item) {
m_pwn_item = nullptr;
if (m_ksr) {
delete m_ksr;
m_ksr = nullptr;
}
enable_detection(false);
enable_regularization(false);
enable_partition(false);
enable_reconstruction(false);
dock_widget->hide();
}
}
void run_detection() {
assert(m_pwn_item);
if (!m_pwn_item->has_normals())
return;
m_ksr->detect_planar_shapes(CGAL::parameters::maximum_distance(dock_widget->sdMaxDistanceBox->value())
.maximum_angle(dock_widget->sdMaxAngleBox->value())
.k_neighbors(dock_widget->sdkNeighborsBox->value())
.minimum_region_size(dock_widget->sdMinRegionSizeBox->value())
.regularize_parallelism(dock_widget->srParallelismCheck->isChecked())
.regularize_coplanarity(dock_widget->srCoplanarityCheck->isChecked())
.regularize_orthogonality(dock_widget->srOrthogonalityCheck->isChecked())
.regularize_axis_symmetry(false)
.angle_tolerance(dock_widget->srAngleToleranceBox->value())
.maximum_offset(dock_widget->srMaxOffsetBox->value()));
CGAL::Three::Three::information(QString::number(m_ksr->detected_planar_shapes().size()) + " regularized planar shapes detected");
if (m_ksr->detected_planar_shapes().empty()) {
enable_partition(false);
enable_reconstruction(false);
return;
}
const std::vector<CGAL::Epick::Plane_3> &planes = m_ksr->detected_planar_shapes();
const std::vector<std::vector<std::size_t>> &regions = m_ksr->detected_planar_shape_indices();
SMesh* mesh = new SMesh();
std::vector<std::vector<CGAL::Epick::Point_3> > polys;
for (std::size_t i = 0; i < regions.size(); i++)
convex_hull(regions[i], planes[i], polys);
for (std::size_t i = 0; i < polys.size(); i++) {
std::vector<typename SMesh::Vertex_index> vtx(polys[i].size());
for (std::size_t j = 0; j < polys[i].size(); j++)
vtx[j] = mesh->add_vertex(polys[i][j]);
mesh->add_face(vtx);
}
Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item(mesh);
new_item->setName(tr("%1 convex shapes d%2 a%3").arg(m_pwn_item->name()).arg(dock_widget->sdMaxDistanceBox->value()).arg(dock_widget->sdMaxAngleBox->value()));
new_item->setColor(Qt::darkCyan);
scene->addItem(new_item);
if (!m_known_file) {
std::size_t max_depth = m_ksr->estimate_max_subdivision_depth();
dock_widget->partReorientCheck->setChecked(true);
dock_widget->partSubdivisionCheck->setChecked(true);
dock_widget->partMaxDepthBox->setValue(max_depth);
dock_widget->partPolygonsPerNodeBox->setValue(40);
dock_widget->partKBox->setValue(2);
}
enable_partition(true);
enable_reconstruction(false);
}
void run_partition() {
assert(m_pwn_item);
assert(m_ksr);
assert(!m_ksr->detected_planar_shapes().empty());
m_ksr->initialize_partition(CGAL::parameters::reorient_bbox(dock_widget->partReorientCheck->checkState() == Qt::Checked)
.max_octree_depth(dock_widget->partSubdivisionCheck->checkState() == Qt::Checked ? dock_widget->partMaxDepthBox->value() : 0)
.max_octree_node_size(dock_widget->partPolygonsPerNodeBox->value()));
m_ksr->partition(dock_widget->partKBox->value());
CGAL::Three::Three::information(QString::number(m_ksr->kinetic_partition().number_of_volumes()) + " volumes in partition");
if (m_ksr->kinetic_partition().number_of_volumes() != 0)
enable_reconstruction(true);
else std::cout << "kinetic partition is empty!" << std::endl;
}
void run_reconstruction() {
assert(m_pwn_item);
assert(m_ksr);
assert(m_ksr->kinetic_partition().number_of_volumes() != 0);
std::vector<Point_3> vtx;
std::vector<std::vector<std::size_t> > polylist;
std::map<typename KSR::KSP::Face_support, bool> external_nodes;
if (dock_widget->recGroundCheck->checkState() == Qt::Checked) {
external_nodes[KSR::KSP::Face_support::ZMIN] = false;
m_ksr->reconstruct_with_ground(dock_widget->recLambdaBox->value(), std::back_inserter(vtx), std::back_inserter(polylist));
}
else {
m_ksr->reconstruct(dock_widget->recLambdaBox->value(), external_nodes, std::back_inserter(vtx), std::back_inserter(polylist));
}
if (!polylist.empty())
{
// Add polygon mesh to scene
Scene_polygon_soup_item* new_item = new Scene_polygon_soup_item();
new_item->load(vtx, polylist);
new_item->setName(tr("%1 ksr lambda %2").arg(m_pwn_item->name()).arg(dock_widget->recLambdaBox->value()));
new_item->setColor(Qt::darkGray);
new_item->invalidateOpenGLBuffers();
scene->addItem(new_item);
}
}
void onSubdivisionStateChanged(int state) {
dock_widget->partMaxDepthBox->setEnabled(state != 0);
dock_widget->partPolygonsPerNodeBox->setEnabled(state != 0);
}
void onVisibilityChanged(bool) {
if (!dock_widget->isVisible())
return;
std::cout << "in visibility changed" << std::endl;
}
private:
void convex_hull(const std::vector<std::size_t>& region, const CGAL::Epick::Plane_3& plane, std::vector<std::vector<CGAL::Epick::Point_3> > &polys) {
if (m_pwn_item == nullptr)
return;
Point_set* points = m_pwn_item->point_set();
std::vector<CGAL::Epick::Point_2> pts2d;
pts2d.reserve(region.size());
for (const std::size_t idx : region) {
CGAL_assertion(idx < points->size());
const auto& p = points->point(idx);
const auto q = plane.projection(p);
const auto point = plane.to_2d(q);
pts2d.push_back(point);
}
CGAL_assertion(pts2d.size() == region.size());
std::vector<CGAL::Epick::Point_2> ch;
CGAL::convex_hull_2(pts2d.begin(), pts2d.end(), std::back_inserter(ch));
std::vector<CGAL::Epick::Point_3> polygon;
for (const auto& p : ch) {
const auto point = plane.to_3d(p);
polygon.push_back(point);
}
polys.push_back(polygon);
}
void enable_detection(bool enable) {
dock_widget->shapeDetectionGroup->setEnabled(enable);
dock_widget->sdRunButton->setEnabled(enable);
}
void enable_regularization(bool enable) {
dock_widget->shapeRegularizationGroup->setEnabled(enable);
}
void enable_partition(bool enable) {
dock_widget->kineticPartitionGroup->setEnabled(enable);
dock_widget->partRunButton->setEnabled(enable);
}
void enable_reconstruction(bool enable) {
dock_widget->kineticReconstructionGroup->setEnabled(enable);
dock_widget->recRunButton->setEnabled(enable);
}
void prefill_parameters() {
if (m_pwn_item == nullptr)
return;
std::string filename = m_pwn_item->name().toStdString();
m_known_file = true;
if (m_ksr) {
delete m_ksr;
m_ksr = nullptr;
}
Point_set* points = m_pwn_item->point_set();
m_ksr = new KSR(*points);
if (filename == "foam_box" || filename == "foam_box_new") {
// Shape detection parameters
dock_widget->sdMaxDistanceBox->setValue(0.05);
dock_widget->sdMaxAngleBox->setValue(15);
dock_widget->sdMinRegionSizeBox->setValue(250);
dock_widget->sdkNeighborsBox->setValue(12);
// Shape regularization parameters
dock_widget->srParallelismCheck->setChecked(true);
dock_widget->srOrthogonalityCheck->setChecked(false);
dock_widget->srCoplanarityCheck->setChecked(true);
dock_widget->srAngleToleranceBox->setValue(10);
dock_widget->srMaxOffsetBox->setValue(0.01);
// Partition parameters
dock_widget->partReorientCheck->setChecked(false);
dock_widget->partSubdivisionCheck->setChecked(true);
dock_widget->partMaxDepthBox->setValue(3);
dock_widget->partPolygonsPerNodeBox->setValue(40);
dock_widget->partKBox->setValue(2);
// Reconstruction parameters
dock_widget->recGroundCheck->setChecked(false);
dock_widget->recLambdaBox->setValue(0.7);
}
else if (filename == "lans") {
// Shape detection parameters
dock_widget->sdMaxDistanceBox->setValue(0.15);
dock_widget->sdMaxAngleBox->setValue(20);
dock_widget->sdMinRegionSizeBox->setValue(300);
dock_widget->sdkNeighborsBox->setValue(12);
// Shape regularization parameters
dock_widget->srParallelismCheck->setChecked(true);
dock_widget->srOrthogonalityCheck->setChecked(false);
dock_widget->srCoplanarityCheck->setChecked(true);
dock_widget->srAngleToleranceBox->setValue(8);
dock_widget->srMaxOffsetBox->setValue(0.08);
// Partition parameters
dock_widget->partReorientCheck->setChecked(false);
dock_widget->partSubdivisionCheck->setChecked(true);
dock_widget->partMaxDepthBox->setValue(3);
dock_widget->partPolygonsPerNodeBox->setValue(40);
dock_widget->partKBox->setValue(2);
// Reconstruction parameters
dock_widget->recGroundCheck->setChecked(false);
dock_widget->recLambdaBox->setValue(0.7);
}
else if (filename == "building_c_1M") {
// Shape detection parameters
dock_widget->sdMaxDistanceBox->setValue(1.1);
dock_widget->sdMaxAngleBox->setValue(26);
dock_widget->sdMinRegionSizeBox->setValue(500);
dock_widget->sdkNeighborsBox->setValue(15);
// Shape regularization parameters
dock_widget->srParallelismCheck->setChecked(true);
dock_widget->srOrthogonalityCheck->setChecked(false);
dock_widget->srCoplanarityCheck->setChecked(true);
dock_widget->srAngleToleranceBox->setValue(3);
dock_widget->srMaxOffsetBox->setValue(0.5);
// Partition parameters
dock_widget->partReorientCheck->setChecked(false);
dock_widget->partSubdivisionCheck->setChecked(true);
dock_widget->partMaxDepthBox->setValue(3);
dock_widget->partPolygonsPerNodeBox->setValue(40);
dock_widget->partKBox->setValue(2);
// Reconstruction parameters
dock_widget->recGroundCheck->setChecked(true);
dock_widget->recLambdaBox->setValue(0.77);
}
else if (filename == "dragon") {
// Shape detection parameters
dock_widget->sdMaxDistanceBox->setValue(0.7);
dock_widget->sdMaxAngleBox->setValue(26);
dock_widget->sdMinRegionSizeBox->setValue(150);
dock_widget->sdkNeighborsBox->setValue(10);
// Shape regularization parameters
dock_widget->srParallelismCheck->setChecked(false);
dock_widget->srOrthogonalityCheck->setChecked(false);
dock_widget->srCoplanarityCheck->setChecked(false);
dock_widget->srAngleToleranceBox->setValue(0);
dock_widget->srMaxOffsetBox->setValue(0);
// Partition parameters
dock_widget->partReorientCheck->setChecked(false);
dock_widget->partSubdivisionCheck->setChecked(true);
dock_widget->partMaxDepthBox->setValue(3);
dock_widget->partPolygonsPerNodeBox->setValue(40);
dock_widget->partKBox->setValue(1);
// Reconstruction parameters
dock_widget->recGroundCheck->setChecked(false);
dock_widget->recLambdaBox->setValue(0.75);
}
else if (filename == "full_thing_pds_1M") {
// Shape detection parameters
dock_widget->sdMaxDistanceBox->setValue(0.3);
dock_widget->sdMaxAngleBox->setValue(36);
dock_widget->sdMinRegionSizeBox->setValue(30);
dock_widget->sdkNeighborsBox->setValue(12);
// Shape regularization parameters
dock_widget->srParallelismCheck->setChecked(true);
dock_widget->srOrthogonalityCheck->setChecked(false);
dock_widget->srCoplanarityCheck->setChecked(true);
dock_widget->srAngleToleranceBox->setValue(3);
dock_widget->srMaxOffsetBox->setValue(0.05);
// Partition parameters
dock_widget->partReorientCheck->setChecked(false);
dock_widget->partSubdivisionCheck->setChecked(true);
dock_widget->partMaxDepthBox->setValue(3);
dock_widget->partPolygonsPerNodeBox->setValue(40);
dock_widget->partKBox->setValue(3);
// Reconstruction parameters
dock_widget->recGroundCheck->setChecked(false);
dock_widget->recLambdaBox->setValue(0.5);
}
else if (filename == "hilbert_cube2_pds_100k") {
// Shape detection parameters
dock_widget->sdMaxDistanceBox->setValue(0.3);
dock_widget->sdMaxAngleBox->setValue(10);
dock_widget->sdMinRegionSizeBox->setValue(10);
dock_widget->sdkNeighborsBox->setValue(12);
// Shape regularization parameters
dock_widget->srParallelismCheck->setChecked(true);
dock_widget->srOrthogonalityCheck->setChecked(true);
dock_widget->srCoplanarityCheck->setChecked(true);
dock_widget->srAngleToleranceBox->setValue(5);
dock_widget->srMaxOffsetBox->setValue(0.03);
// Partition parameters
dock_widget->partReorientCheck->setChecked(false);
dock_widget->partSubdivisionCheck->setChecked(true);
dock_widget->partMaxDepthBox->setValue(3);
dock_widget->partPolygonsPerNodeBox->setValue(40);
dock_widget->partKBox->setValue(4);
// Reconstruction parameters
dock_widget->recGroundCheck->setChecked(false);
dock_widget->recLambdaBox->setValue(0.5);
}
else if (filename == "Meetingroom_3M") {
// Shape detection parameters
dock_widget->sdMaxDistanceBox->setValue(0.03);
dock_widget->sdMaxAngleBox->setValue(19);
dock_widget->sdMinRegionSizeBox->setValue(100);
dock_widget->sdkNeighborsBox->setValue(15);
// Shape regularization parameters
dock_widget->srParallelismCheck->setChecked(true);
dock_widget->srOrthogonalityCheck->setChecked(true);
dock_widget->srCoplanarityCheck->setChecked(true);
dock_widget->srAngleToleranceBox->setValue(10);
dock_widget->srMaxOffsetBox->setValue(0.03);
// Partition parameters
dock_widget->partReorientCheck->setChecked(false);
dock_widget->partSubdivisionCheck->setChecked(true);
dock_widget->partMaxDepthBox->setValue(3);
dock_widget->partPolygonsPerNodeBox->setValue(40);
dock_widget->partKBox->setValue(3);
// Reconstruction parameters
dock_widget->recGroundCheck->setChecked(false);
dock_widget->recLambdaBox->setValue(0.5);
}
else {
m_known_file = false;
FT max_distance, max_angle;
std::size_t min_region_size;
m_ksr->estimate_detection_parameters(max_distance, max_angle, min_region_size);
dock_widget->sdMaxDistanceBox->setValue(max_distance);
dock_widget->sdMaxAngleBox->setValue(max_angle);
dock_widget->sdMinRegionSizeBox->setValue(min_region_size);
dock_widget->sdkNeighborsBox->setValue(12);
dock_widget->srCoplanarityCheck->setChecked(true);
dock_widget->srMaxOffsetBox->setValue(max_distance * 0.5);
}
}
};
#include "Kinetic_surface_reconstruction_plugin.moc"

View File

@ -0,0 +1,425 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KineticSurfaceReconstructionWidget</class>
<widget class="QDockWidget" name="KineticSurfaceReconstructionWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>372</width>
<height>590</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>372</width>
<height>590</height>
</size>
</property>
<property name="windowTitle">
<string>Kinetic Surface Reconstruction</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout">
<item row="12" column="0">
<widget class="QPushButton" name="partRunButton">
<property name="text">
<string>partition</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QGroupBox" name="shapeDetectionGroup">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Shape Detection</string>
</property>
<layout class="QGridLayout" name="gridLayout_sd">
<item row="2" column="0">
<widget class="QLabel" name="sdMaxAngleLabel">
<property name="text">
<string>Maximum angle</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="sdMaxDistanceLabel">
<property name="text">
<string>Maximum distance</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="sdMinRegionSizeBox">
<property name="toolTip">
<string>Smallest allowed size for a primitive</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>50</number>
</property>
<property name="value">
<number>500</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="sdMinRegionSizeLabel">
<property name="text">
<string>Minimum region size</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="DoubleEdit" name="sdMaxDistanceBox">
<property name="toolTip">
<string>Maximum distance from a point to a plane.</string>
</property>
<property name="text">
<string>1.0</string>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="DoubleEdit" name="sdMaxAngleBox">
<property name="toolTip">
<string>Maximum angle in degrees between the normal of a point and the normal of a plane.</string>
</property>
<property name="text">
<string>25</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="sdkNeighborsLabel">
<property name="text">
<string>k neighbors</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="sdkNeighborsBox">
<property name="toolTip">
<string>K neighborhood of a point considered for region growing</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
<property name="value">
<number>12</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="9" column="0">
<widget class="QGroupBox" name="shapeRegularizationGroup">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Shape Regularization</string>
</property>
<layout class="QGridLayout" name="gridLayout_sr">
<item row="2" column="1">
<widget class="DoubleEdit" name="srMaxOffsetBox">
<property name="toolTip">
<string>Maximum allowed orthogonal distance between two parallel planes such that they are considered to be coplanar.</string>
</property>
<property name="text">
<string>25</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="srAngleToleranceLabel">
<property name="text">
<string>Angle tolerance</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="DoubleEdit" name="srAngleToleranceBox">
<property name="toolTip">
<string>Maximum allowed angle in degrees between plane normals used for parallelism and orthogonality.</string>
</property>
<property name="text">
<string>1.0</string>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="srMaxOffsetLabel">
<property name="text">
<string>Maximum offset</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="srParallelismCheck">
<property name="toolTip">
<string>Planes, which are detected as near parallel, are made exactly parallel.</string>
</property>
<property name="text">
<string>Parallelism</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="srCoplanarityCheck">
<property name="toolTip">
<string>Parallel planes, which are detected as near coplanar, are made exactly coplanar.</string>
</property>
<property name="text">
<string>Coplanarity</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="srOrthogonalityCheck">
<property name="toolTip">
<string>Planes, which are detected as near orthogonal, are made exactly orthogonal.</string>
</property>
<property name="text">
<string>Orthogonality</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="13" column="0">
<widget class="QGroupBox" name="kineticReconstructionGroup">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Kinetic Surface Reconstruction</string>
</property>
<layout class="QGridLayout" name="gridLayout_rec">
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="recGroundCheck">
<property name="toolTip">
<string>Estimates a ground level from the detected shapes. Sets the outside label of all faces on the bounding box below the ground level to inside.</string>
</property>
<property name="text">
<string>Estimate ground</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="recLambdaLabel">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Lambda</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_rec"/>
</item>
<item row="1" column="1">
<widget class="DoubleEdit" name="recLambdaBox">
<property name="toolTip">
<string>Lambda trades data faithfulness for low complexity in the energy minimization.</string>
</property>
<property name="text">
<string>0.7</string>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="11" column="0">
<widget class="QGroupBox" name="kineticPartitionGroup">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Kinetic Space Partition</string>
</property>
<layout class="QGridLayout" name="gridLayout_part">
<item row="1" column="0">
<widget class="QLabel" name="partKLabel">
<property name="text">
<string>K</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="partMaxDepthLabel">
<property name="text">
<string>Maximum depth</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="partKBox">
<property name="toolTip">
<string>Maximum number of intersections that can occur for a polygon before its expansion stops</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_part">
<item>
<widget class="QCheckBox" name="partReorientCheck">
<property name="toolTip">
<string>Aligns the x-axis of the bounding box with the direction of the largest variation in horizontal direction of the input data while maintaining the z-axis.</string>
</property>
<property name="text">
<string>Bounding box reorientation</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="partSubdivisionCheck">
<property name="toolTip">
<string>The kinetic partition is split into subpartitions using an octree if the number of intersecting polygons per node is larger than specified.</string>
</property>
<property name="text">
<string>Subdivision</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="partMaxDepthBox">
<property name="toolTip">
<string>Maximum octree depth for subdivision</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="partPolygonsPerNodeLabel">
<property name="text">
<string>Polygons per Node</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="partPolygonsPerNodeBox">
<property name="toolTip">
<string>Maximum number of intersecting polygons for an octree node before it is split</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>40</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="15" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="0">
<widget class="QPushButton" name="sdRunButton">
<property name="text">
<string>detect and regularize</string>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QPushButton" name="recRunButton">
<property name="text">
<string>reconstruct</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>DoubleEdit</class>
<extends>QLineEdit</extends>
<header>CGAL_double_edit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -287,6 +287,7 @@ void CGAL_Lab_point_set_normal_estimation_plugin::on_actionNormalEstimation_trig
// Updates scene
item->invalidateOpenGLBuffers();
scene->itemChanged(index);
item->itemChanged();
QApplication::restoreOverrideCursor();
}

View File

@ -15,6 +15,7 @@ CGAL::Three::Scene_item::Scene_item(int buffers_size, int vaos_size)
are_buffers_filled(false),
rendering_mode(FlatPlusEdges),
defaultContextMenu(nullptr),
context_menu_outdated(false),
buffersSize(buffers_size),
vaosSize(vaos_size),
vaos(vaos_size)
@ -94,6 +95,11 @@ QString CGAL::Three::Scene_item::renderingModeName() const
}
QMenu* CGAL::Three::Scene_item::contextMenu()
{
if (context_menu_outdated && defaultContextMenu) {
delete defaultContextMenu;
defaultContextMenu = nullptr;
}
if(defaultContextMenu) {
defaultContextMenu->setTitle(name());
return defaultContextMenu;
@ -111,14 +117,17 @@ QMenu* CGAL::Three::Scene_item::contextMenu()
slotName(RenderingMode(mode)));
defaultContextMenu->actions().last()->setProperty("is_groupable", true);
}
context_menu_outdated = false;
return defaultContextMenu;
}
void CGAL::Three::Scene_item::resetMenu()
{
delete defaultContextMenu;
defaultContextMenu = nullptr;
context_menu_outdated = true;
}
CGAL::Three::Scene_group_item* CGAL::Three::Scene_item::parentGroup() const {
return parent_group;
}

View File

@ -850,6 +850,7 @@ QMenu* Scene_points_with_normal_item::contextMenu()
container->menuAction()->setProperty("is_groupable", true);
container->addAction(sliderAction);
menu->addMenu(container);
d->normal_Slider->show();
}
QMenu *container = new QMenu(tr("Points Size"));
QWidgetAction *sliderAction = new QWidgetAction(nullptr);
@ -861,6 +862,7 @@ QMenu* Scene_points_with_normal_item::contextMenu()
container->menuAction()->setProperty("is_groupable", true);
container->addAction(sliderAction);
menu->addMenu(container);
d->point_Slider->show();
d->actionDeleteSelection = menu->addAction(tr("Delete Selection"));
d->actionDeleteSelection->setObjectName("actionDeleteSelection");

View File

@ -144,15 +144,15 @@ protected:
void paintEvent(QPaintEvent *)override;
void paintGL()override;
//!Defines the behaviour for the mouse press events
//!Defines the behavior for the mouse press events
void mousePressEvent(QMouseEvent*)override;
void mouseDoubleClickEvent(QMouseEvent*)override;
void wheelEvent(QWheelEvent *)override;
//!Defines the behaviour for the key press events
//!Defines the behavior for the key press events
void keyPressEvent(QKeyEvent*)override;
//!Deal with context menu events
void contextMenuEvent(QContextMenuEvent*)override;
//!Defines the behaviour for the key release events
//!Defines the behavior for the key release events
void keyReleaseEvent(QKeyEvent *)override;
protected:

View File

@ -2780,7 +2780,7 @@ void MainWindow::sierpinski_carpet_copy_attributes_and_embed_vertex
LCC::Helper::Foreach_enabled_attributes_except
<CGAL::internal::Group_attribute_functor_of_dart<LCC>, 0>::
run(*(scene.lcc),sierpinskiCarpetSurfaces[0],it);
// We initialise the 0-atttrib to ah
// We initialize the 0-atttrib to ah
scene.lcc->set_dart_attribute<0>(it, ah);
}
}

View File

@ -252,7 +252,7 @@ Before applying the sew operation, the eight vertices of the first cube are colo
\subsection Linear_cell_complexAutomaticAttributesManagement Automatic Attribute Management
\anchor ssecAttributesManagement
The following example illustrates the use of the automatic attributes management for a linear cell complex. An off file is loaded into a 2D linear cell complex embedded in 3D. Then, a certain percentage of edges is removed from the linear cell complex. The same method is applied twice: the first time by using the automatic attributes management (which is the default behaviour) and the second time by calling first \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink to disable the automatic updating of attributes.
The following example illustrates the use of the automatic attributes management for a linear cell complex. An off file is loaded into a 2D linear cell complex embedded in 3D. Then, a certain percentage of edges is removed from the linear cell complex. The same method is applied twice: the first time by using the automatic attributes management (which is the default behavior) and the second time by calling first \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink to disable the automatic updating of attributes.
We can observe that the second run is faster than the first one. Indeed, updating attribute for each edge removal give a bigger complexity. Moreover, the gain increases when the percentage of removed edges increases.

Binary file not shown.

View File

@ -1 +0,0 @@
Foundation for Research and Technology-Hellas (Greece).

View File

@ -1,3 +0,0 @@
Package for MacOSX support.
Contains scripts and icon files needed for creating demos
in the MacOSX operating system.

View File

@ -1 +0,0 @@
Menelaos Karavelas <mkaravel@tem.uoc.gr>

View File

@ -1,102 +0,0 @@
#!/bin/sh
# Copyright (c) 2005,2006,2013
# Foundation for Research and Technology-Hellas (Greece).
# All rights reserved.
#
# This file is part of CGAL (www.cgal.org); you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; version 3 of the License,
# or (at your option) any later version.
#
# Licensees holding a valid commercial license may use this file in
# accordance with the commercial license agreement provided with the software.
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $URL$
# $Id$
# SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
#
# Authors: Herve Bronnimann
# Menelaos Karavelas
# Eric Berberich <eric.berberich@cgal.org>
# This script creates the appropriate directory structure so that a CGAL
# Qt demo can be run on MacOSX
usage()
{
echo "Usage: cgal_make_macosx_app executable"
}
case $# in
0) usage
exit 1
esac
for i do
if [ -x "$i" ] ; then
EXECUTABLE=$i
else
usage
exit 1
fi
done
if [ -z "$EXECUTABLE.app" ] ; then
mkdir $EXECUTABLE.app
fi
test -d $EXECUTABLE.app/Contents/MacOS/ || mkdir -p $EXECUTABLE.app/Contents/MacOS/
strip $EXECUTABLE
cp $EXECUTABLE $EXECUTABLE.app/Contents/MacOS/$EXECUTABLE
rm -f $EXECUTABLE.app/Contents/PkgInfo
echo "APPL????" > $EXECUTABLE.app/Contents/PkgInfo
rm -f $EXECUTABLE.app/Contents/Info.plist
cat > $EXECUTABLE.app/Contents/Info.plist <<ENDINFO
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM
"file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version=\"0.9\">
<dict>
<key>CFBundleIconFile</key>
<string>cgal_app.icns</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>Created by CGAL</string>
<key>CFBundleSignature</key>
<string>ttxt</string>
<key>CFBundleExecutable</key>
<string>$EXECUTABLE</string>
ENDINFO
if [ -d "help" ] ; then
cat >> $EXECUTABLE.app/Contents/Info.plist <<ENDINFO
<key>CFBundleHelpBookFolder</key>
<string>Help</string>
<key>CFBundleHelpBookName</key>
<string>Help</string>
ENDINFO
test -d $EXECUTABLE.app/Contents/Resources/Help || mkdir -p $EXECUTABLE.app/Contents/Resources/Help
cp -r help/* $EXECUTABLE.app/Contents/Resources/Help
ln -s index.html $EXECUTABLE.app/Contents/Resources/Help/Help.html
fi
cat >> $EXECUTABLE.app/Contents/Info.plist <<ENDINFO
<key>NOTE</key>
<string>This file was generated by CGAL/scripts/cgal_make_macosx_app.</string>
</dict>
</plist>
ENDINFO
test -d $EXECUTABLE.app/Contents/Resources || mkdir -p $EXECUTABLE.app/Contents/Resources
DIR=$( cd "$( dirname "$0" )" && pwd )
cp $DIR/../auxiliary/cgal_app.icns $EXECUTABLE.app/Contents/Resources
echo "created $EXECUTABLE.app ..."

View File

@ -10,7 +10,7 @@ namespace CGAL {
`monotone_matrix_search()` and `sorted_matrix_search()`
are techniques that deal with the problem of efficiently finding
largest entries in matrices with certain structural properties. Many
concrete problems can be modelled as matrix search problems, and for
concrete problems can be modeled as matrix search problems, and for
some of them we provide explicit solutions that allow you to solve
them without knowing about the matrix search technique. Examples are,
the computation of all furthest neighbors for the vertices of a convex

View File

@ -58,7 +58,7 @@ public:
const double& size() const { return second; }
const double& sine() const { return first; }
// q1<q2 means q1 is prioritised over q2
// q1<q2 means q1 is prioritized over q2
// ( q1 == *this, q2 == q )
bool operator<(const Quality& q) const
{

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