diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h index c1f95b8e4bc..c6758faf5d5 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h @@ -1680,7 +1680,7 @@ bool IO_base_test::read_xcurve(InputStream_& is, read_point(is, p2); assert(p1 != p2); - unsigned int flag; + unsigned int flag = static_cast(-1); is >> flag; if (flag == 1) { X_monotone_curve_2::Direction_3 normal; diff --git a/Documentation/doc/Documentation/fig/toolchain.png b/Documentation/doc/Documentation/fig/toolchain.png new file mode 100644 index 00000000000..d8c5188a3cd Binary files /dev/null and b/Documentation/doc/Documentation/fig/toolchain.png differ diff --git a/Documentation/doc/Documentation/windows.txt b/Documentation/doc/Documentation/windows.txt index 50eed1cbc9e..b11742cbf7b 100644 --- a/Documentation/doc/Documentation/windows.txt +++ b/Documentation/doc/Documentation/windows.txt @@ -92,6 +92,11 @@ When you hit the *Configure* button, you must:
  • select *Specify toolchain file for cross compilation* (the file `vcpkg.cmake` within the directory where you have installed `vcpkg`, e.g. `C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake`).
  • + +\cgalFigureBegin{toolchain,toolchain.png} +The box to check to get to the toolchain option +\cgalFigureEnd + Once the configuration process is done, tick *Advanced* and *Grouped* in `cmake-gui`. You will see entries for where header files and libraries are taken from. diff --git a/Generator/doc/Generator/CGAL/random_polygon_2.h b/Generator/doc/Generator/CGAL/random_polygon_2.h index e10aaba751e..6025350bb99 100644 --- a/Generator/doc/Generator/CGAL/random_polygon_2.h +++ b/Generator/doc/Generator/CGAL/random_polygon_2.h @@ -21,13 +21,17 @@ generated polygons is not known since it depends on the generated points. - `PointGenerator::value_type` is equivalent to `Traits::Point_2` and `OutputIterator::value_type`. - The default traits class `Default_traits` is the kernel in which `Traits::Point_2` is defined. \sa `CGAL::Random_points_in_disc_2` \sa `CGAL::Random_points_in_square_2` +\cgalHeading{Preconditions} + +- The number of unique points in the first \f$ n\f$ points generated by `pg` is at least `3`. +- The unique points in the first \f$ n\f$ points generated by `pg` do not all lie on the same line. + \cgalHeading{Implementation} The implementation is based on the method of eliminating self-intersections in diff --git a/Generator/include/CGAL/Random_polygon_2_sweep.h b/Generator/include/CGAL/Random_polygon_2_sweep.h index 6a059662ba6..2aa4102bbb1 100644 --- a/Generator/include/CGAL/Random_polygon_2_sweep.h +++ b/Generator/include/CGAL/Random_polygon_2_sweep.h @@ -154,7 +154,7 @@ bool Less_segments:: less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const { #if defined(CGAL_POLY_GENERATOR_DEBUG) - std::cout << "less_than_in_tree" << std::endl; + std::cout << "less_than_in_tree; new: " << new_edge.as_int() << " tree edge: " << tree_edge.as_int() << std::endl; #endif CGAL_polygon_precondition( m_vertex_data->edges[tree_edge.as_int()].is_in_tree); @@ -179,6 +179,52 @@ less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const m_vertex_data->point(mid), m_vertex_data->point(right))); m_vertex_data->is_simple_result = false; + + // need to handle the specific combinations: + // as the standard x;x+k swap (see below) will not work + if (m_vertex_data->edges[tree_edge.as_int()].is_left_to_right) + { + // x+1 x x+2 + // This is actually already handled in the insertion event, when the orientation returns "COPLANAR" + // but leaving the code below for completion. + if (m_vertex_data->next(mid) == left || m_vertex_data->next(mid) == right) + { + // swap mid & left + m_vertex_data->conflict1 = m_vertex_data->prev(mid); + m_vertex_data->conflict2 = left; + return true; + } + // x-2 x x-1 + else if (m_vertex_data->prev(mid) == left || m_vertex_data->prev(mid) == right) + { + // swap mid & right + m_vertex_data->conflict1 = left; + m_vertex_data->conflict2 = mid; + return true; + } + } + else // right to left + { + // x+2 x x+1 + if (m_vertex_data->next(mid) == left || m_vertex_data->next(mid) == right) + { + // swap mid & right + m_vertex_data->conflict1 = m_vertex_data->prev(mid); + m_vertex_data->conflict2 = right; + return true; + } + // x-1 x x-2 + // This is actually already handled in the insertion event, when the orientation returns "COPLANAR" + // but leaving the code below for completion. + else if (m_vertex_data->prev(mid) == left || m_vertex_data->prev(mid) == right) + { + // swap mid & left + m_vertex_data->conflict1 = right; + m_vertex_data->conflict2 = mid; + return true; + } + } + Vertex_index mid_succ = m_vertex_data->next(mid); if (mid_succ.as_int() <= (std::min)(left.as_int(), right.as_int())) { @@ -515,6 +561,15 @@ check_simple_polygon(Iterator points_begin, Iterator points_end, typedef Iterator ForwardIterator; typedef std::set > Tree; + +#if defined(CGAL_POLY_GENERATOR_DEBUG) + Iterator it; + std::cout << "In check_simple_polygon the points are: " << std::endl; + for(it = points_begin; it != points_end; it++) + std::cout << *it << " "; + std::cout << std::endl; +#endif + i_generator_polygon::Vertex_data vertex_data(points_begin, points_end, polygon_traits); Tree tree(&vertex_data); @@ -556,8 +611,8 @@ void make_simple_polygon(Iterator points_begin, Iterator points_end, swap_interval = check_simple_polygon(points_begin, points_end, polygon_traits); #if defined(CGAL_POLY_GENERATOR_DEBUG) - std::cout << swap_interval.first << " " - << swap_interval.second << std::endl; + std::cout << "To swap: " << swap_interval.first << " " + << swap_interval.second << std::endl; CGAL_polygon_assertion(swap_interval.first >= -1 && swap_interval.second >= -1 && swap_interval.first < size && diff --git a/Generator/include/CGAL/random_polygon_2.h b/Generator/include/CGAL/random_polygon_2.h index 993d77e7e62..ea04e8fdda2 100644 --- a/Generator/include/CGAL/random_polygon_2.h +++ b/Generator/include/CGAL/random_polygon_2.h @@ -46,6 +46,21 @@ OutputIterator random_polygon_2(std::size_t n, OutputIterator result, copy_n_unique(pg, n, std::back_inserter(vertices), traits); CGAL_assertion(!duplicate_points(vertices.begin(), vertices.end(), traits)); + CGAL_precondition_code(auto d = std::distance(vertices.begin(), vertices.end());) + CGAL_precondition(d > 2); + + CGAL_precondition_code(const Point_2& p = *(vertices.begin());) + CGAL_precondition_code(const Point_2& q = *(std::next(vertices.begin()));) + CGAL_precondition_code(auto third_it = std::next(vertices.begin(), 2);) + CGAL_precondition_code(bool all_collinear = true;) + CGAL_precondition_code(do {) + CGAL_precondition_code( if(traits.orientation_2_object()(p, q, *third_it) != CGAL::COLLINEAR) {) + CGAL_precondition_code( all_collinear = false;) + CGAL_precondition_code( break;) + CGAL_precondition_code( }) + CGAL_precondition_code(} while(++third_it != vertices.end());) + CGAL_precondition(!all_collinear); + #ifndef CGAL_DONT_SHUFFLE_IN_RANDOM_POLYGON_2 CGAL::cpp98::random_shuffle(vertices.begin(), vertices.end()); #endif diff --git a/Generator/test/Generator/random_poly_test.cpp b/Generator/test/Generator/random_poly_test.cpp index 41988dfaed6..7f06652e516 100644 --- a/Generator/test/Generator/random_poly_test.cpp +++ b/Generator/test/Generator/random_poly_test.cpp @@ -22,56 +22,82 @@ // Random Simple Polygons: Test Program // ============================================================================ +#define CGAL_DONT_SHUFFLE_IN_RANDOM_POLYGON_2 + #include #include + #include #include #include + +#include +#include +#include +#include #include -typedef CGAL::Simple_cartesian< double > CR; -typedef CGAL::Point_2< CR > CPoint_2; -typedef std::list CContainer; -typedef CGAL::Polygon_2 CPolygon_2; -typedef CGAL::Creator_uniform_2 CCreator; -typedef CGAL::Random_points_in_square_2 CPoint_generator; +template +void test_fold() +{ + // (-5, -7) is on [(-9, 5); (-2, -16)] + std::array input {typename K::Point_2{-5,-7},{7,-85},{-9,5},{-2,-16}}; -typedef CGAL::Homogeneous< double > HR; -typedef CGAL::Point_2< HR > HPoint_2; -typedef std::list HContainer; -typedef CGAL::Polygon_2 HPolygon_2; -typedef CGAL::Creator_uniform_2 HCreator; -typedef CGAL::Random_points_in_square_2 HPoint_generator; + int i = 0; + do + { + std::cout << "permutation #" << i++ << std::endl; + for(const auto& pt : input) + std::cout << " (" << pt << ")"; + std::cout << std::endl; -int main() { + CGAL::Polygon_2 polygon; + CGAL::random_polygon_2(input.size(), std::back_inserter(polygon), input.begin()); - CPolygon_2 polygon1; + if (! polygon.is_simple()) + { + std::cerr << "ERROR: polygon is not simple." << std::endl; + assert(false); + } + } + while(std::next_permutation(input.begin(), input.end())); +} + +template +void test_random() +{ + typedef CGAL::Point_2< K > Point_2; + typedef std::list Container; + typedef CGAL::Polygon_2 Polygon_2; + typedef CGAL::Creator_uniform_2 Creator; + typedef CGAL::Random_points_in_square_2 Point_generator; + + Polygon_2 polygon; int n = 50; // create a polygon - CGAL::random_polygon_2(n, std::back_inserter(polygon1), - CPoint_generator(0.5)); + CGAL::random_polygon_2(n, std::back_inserter(polygon), Point_generator(0.5)); // make sure it is simple - if (! polygon1.is_simple()) + if (! polygon.is_simple()) { std::cerr << "ERROR: polygon is not simple." << std::endl; - return 1; + assert(false); } - - HPolygon_2 polygon2; - - // create a polygon - CGAL::random_polygon_2(n, std::back_inserter(polygon2), - HPoint_generator(0.5)); - - // make sure it is simple - if (! polygon1.is_simple()) - { - std::cerr << "ERROR: polygon is not simple." << std::endl; - return 1; - } - return 0; } -// EOF +int main() +{ + typedef CGAL::Simple_cartesian CK; + typedef CGAL::Homogeneous HK; + + test_random(); + test_random(); + + test_fold(); + test_fold(); + + std::cout << "Done!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/Installation/cmake/modules/FindGMP.cmake b/Installation/cmake/modules/FindGMP.cmake index 663203d11c9..3a1d355d41f 100644 --- a/Installation/cmake/modules/FindGMP.cmake +++ b/Installation/cmake/modules/FindGMP.cmake @@ -31,20 +31,35 @@ if( NOT GMP_in_cache ) DOC "The directory containing the GMP header files" ) - find_library(GMP_LIBRARIES NAMES gmp libgmp-10 mpir + find_library(GMP_LIBRARY_RELEASE NAMES gmp libgmp-10 mpir HINTS ENV GMP_LIB_DIR ENV GMP_DIR ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib PATH_SUFFIXES lib - DOC "Path to the GMP library" + DOC "Path to the Release GMP library" ) - if ( GMP_LIBRARIES ) - get_filename_component(GMP_LIBRARIES_DIR ${GMP_LIBRARIES} PATH CACHE ) + find_library(GMP_LIBRARY_DEBUG NAMES gmpd gmp libgmp-10 mpir + HINTS ENV GMP_LIB_DIR + ENV GMP_DIR + ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib + PATH_SUFFIXES lib + DOC "Path to the Debug GMP library" + ) + + get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(IS_MULTI_CONFIG) + set(GMP_LIBRARIES debug ${GMP_LIBRARY_DEBUG} optimized ${GMP_LIBRARY_RELEASE}) + else() + if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set(GMP_LIBRARIES ${GMP_LIBRARY_DEBUG}) + else() + set(GMP_LIBRARIES ${GMP_LIBRARY_RELEASE}) + endif() endif() # Attempt to load a user-defined configuration for GMP if couldn't be found - if ( NOT GMP_INCLUDE_DIR OR NOT GMP_LIBRARIES_DIR ) + if ( NOT GMP_INCLUDE_DIR OR NOT GMP_LIBRARIES) include( GMPConfig OPTIONAL ) endif() diff --git a/Interpolation/examples/Interpolation/interpolation_vertex_with_info_2.cpp b/Interpolation/examples/Interpolation/interpolation_vertex_with_info_2.cpp index 6e5dd160759..83180cc3732 100644 --- a/Interpolation/examples/Interpolation/interpolation_vertex_with_info_2.cpp +++ b/Interpolation/examples/Interpolation/interpolation_vertex_with_info_2.cpp @@ -38,38 +38,6 @@ typedef CGAL::Interpolation_traits_2 Traits; typedef std::vector > Coordinate_vector; -template -struct Value_function -{ - typedef V argument_type; - typedef std::pair result_type; - - result_type operator()(const argument_type& a) const { - return result_type(a->info().value, true); - } -}; - -template -struct Gradient_function - : public std::iterator -{ - - typedef V argument_type; - typedef std::pair result_type; - - result_type operator()(const argument_type& a) const { - return std::make_pair(a->info().gradient, a->info().gradient != CGAL::NULL_VECTOR); - } - - const Gradient_function& operator=(const std::pair& p) const { - p.first->info().gradient = p.second; - return *this; - } - - const Gradient_function& operator++(int) const { return *this; } - const Gradient_function& operator*() const { return *this; } -}; - int main() { //number of sample points: @@ -94,9 +62,15 @@ int main() Delaunay_triangulation T; - // Note that a supported alternative to creating the functors below is to use lambdas - Value_function value_function; - Gradient_function gradient_function; + auto value_function = [](const Vertex_handle& a) -> std::pair + { + return std::make_pair(a->info().value, true); + }; + + auto gradient_function = [](const Vertex_handle& a) -> std::pair + { + return std::make_pair(a->info().gradient, a->info().gradient != CGAL::NULL_VECTOR); + }; //parameters for quadratic function: Coord_type alpha = Coord_type(1.0), diff --git a/Interpolation/examples/Interpolation/sibson_interpolation_rn_vertex_with_info_2.cpp b/Interpolation/examples/Interpolation/sibson_interpolation_rn_vertex_with_info_2.cpp index d86378ebf04..edd2c6698e2 100644 --- a/Interpolation/examples/Interpolation/sibson_interpolation_rn_vertex_with_info_2.cpp +++ b/Interpolation/examples/Interpolation/sibson_interpolation_rn_vertex_with_info_2.cpp @@ -8,6 +8,8 @@ #include #include +#include + #include #include #include @@ -38,44 +40,26 @@ typedef CGAL::Triangulation_data_structure_2 Tds; typedef CGAL::Regular_triangulation_2 Regular_triangulation; typedef Regular_triangulation::Vertex_handle Vertex_handle; -template -struct Value_function -{ - typedef V argument_type; - typedef std::pair result_type; - - result_type operator()(const argument_type& a) const { - return result_type(a->info().value, true); - } -}; - -template -struct Gradient_function - : public std::iterator -{ - typedef V argument_type; - typedef std::pair result_type; - - result_type operator()(const argument_type& a) const { - return std::make_pair(a->info().gradient, a->info().gradient != CGAL::NULL_VECTOR); - } - - const Gradient_function& operator=(const std::pair& p) const { - p.first->info().gradient = p.second; - return *this; - } - - const Gradient_function& operator++(int) const { return *this; } - const Gradient_function& operator*() const { return *this; } -}; - int main() { Regular_triangulation rt; - // Note that a supported alternative to creating the functors below is to use lambdas - Value_function value_function; - Gradient_function gradient_function; + auto value_function = [](const Vertex_handle& a) -> std::pair + { + return std::make_pair(a->info().value, true); + }; + + auto gradient_function = [](const Vertex_handle& a) -> std::pair + { + return std::make_pair(a->info().gradient, a->info().gradient != CGAL::NULL_VECTOR); + }; + + auto gradient_output_iterator + = boost::make_function_output_iterator + ([](const std::pair& p) + { + p.first->info().gradient = p.second; + }); // parameters for spherical function: Coord_type a(0.25), bx(1.3), by(-0.7), c(0.2); @@ -89,7 +73,7 @@ int main() } CGAL::sibson_gradient_fitting_rn_2(rt, - gradient_function, + gradient_output_iterator, CGAL::Identity >(), value_function, Traits()); diff --git a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h index 1b1285a577a..ac40ac15e57 100644 --- a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h +++ b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h @@ -249,6 +249,7 @@ struct Enriched_pixel { Domain_type domain; Image_word_type word; bool on_edge_of_the_cube; + bool on_corner_of_the_cube; }; // end struct template Enriched_pixel } // end namespace internal @@ -536,17 +537,21 @@ polylines_to_protect double x = pixel[0] * vx + tx; double y = pixel[1] * vy + ty; double z = pixel[2] * vz + tz; - square[ii][jj].on_edge_of_the_cube = - ( ( ( 0 == pixel[0] || (xdim - 1) == pixel[0] ) ? 1 : 0 ) - + - ( ( 0 == pixel[1] || (ydim - 1) == pixel[1] ) ? 1 : 0 ) - + - ( ( 0 == pixel[2] || (zdim - 1) == pixel[2] ) ? 1 : 0 ) > 1 ); + short sum_faces = ((0 == pixel[0] || (xdim - 1) == pixel[0]) ? 1 : 0) + + ((0 == pixel[1] || (ydim - 1) == pixel[1]) ? 1 : 0) + + ((0 == pixel[2] || (zdim - 1) == pixel[2]) ? 1 : 0); + square[ii][jj].on_edge_of_the_cube = (sum_faces > 1); + square[ii][jj].on_corner_of_the_cube = (sum_faces > 2); + #ifdef CGAL_MESH_3_DEBUG_POLYLINES_TO_PROTECT if(square[ii][jj].on_edge_of_the_cube) { std::cerr << " Pixel(" << pixel[0] << ", " << pixel[1] << ", " << pixel[2] << ") is on edge\n"; } + if (square[ii][jj].on_corner_of_the_cube) { + std::cerr << " Pixel(" << pixel[0] << ", " << pixel[1] << ", " + << pixel[2] << ") is on corner\n"; + } #endif // CGAL_MESH_3_DEBUG_POLYLINES_TO_PROTECT square[ii][jj].point = Point_3(x, y, z); @@ -582,10 +587,10 @@ polylines_to_protect bool out01 = null(square[0][1].domain); bool out11 = null(square[1][1].domain); - bool on_edge00 = square[0][0].on_edge_of_the_cube; - bool on_edge10 = square[1][0].on_edge_of_the_cube; - bool on_edge01 = square[0][1].on_edge_of_the_cube; - bool on_edge11 = square[1][1].on_edge_of_the_cube; + bool is_corner00 = square[0][0].on_corner_of_the_cube; + bool is_corner10 = square[1][0].on_corner_of_the_cube; + bool is_corner01 = square[0][1].on_corner_of_the_cube; + bool is_corner11 = square[1][1].on_corner_of_the_cube; // // Protect the edges of the cube @@ -593,26 +598,26 @@ polylines_to_protect if(pix00[axis_xx] == 0 && ! ( out00 && out01 ) ) { - g_manip.try_add_edge(g_manip.get_vertex(p00, on_edge00), - g_manip.get_vertex(p01, on_edge01)); + g_manip.try_add_edge(g_manip.get_vertex(p00, is_corner00), + g_manip.get_vertex(p01, is_corner01)); } if(pix11[axis_xx] == image_dims[axis_xx]-1 && ! ( out10 && out11 ) ) { - g_manip.try_add_edge(g_manip.get_vertex(p10, on_edge10), - g_manip.get_vertex(p11, on_edge11)); + g_manip.try_add_edge(g_manip.get_vertex(p10, is_corner10), + g_manip.get_vertex(p11, is_corner11)); } if(pix00[axis_yy] == 0 && ! ( out00 && out10 ) ) { - g_manip.try_add_edge(g_manip.get_vertex(p00, on_edge00), - g_manip.get_vertex(p10, on_edge10)); + g_manip.try_add_edge(g_manip.get_vertex(p00, is_corner00), + g_manip.get_vertex(p10, is_corner10)); } if(pix11[axis_yy] == image_dims[axis_yy]-1 && ! ( out01 && out11 ) ) { - g_manip.try_add_edge(g_manip.get_vertex(p01, on_edge01), - g_manip.get_vertex(p11, on_edge11)); + g_manip.try_add_edge(g_manip.get_vertex(p01, is_corner01), + g_manip.get_vertex(p11, is_corner11)); } } // end of scope for outIJ and on_edgeIJ diff --git a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp index ea903b9b412..9b38258e409 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp @@ -114,32 +114,35 @@ int main(int argc, const char** argv) * */ ); - // OR call the ICP registration method from pointmatcher and apply the transformation to pwn2 - bool converged = - CGAL::pointmatcher::register_point_sets - (pwns1, pwns2, - params::point_map(Point_map()).normal_map(Normal_map()) - .point_set_filters(point_set_1_filters) - .matcher(matcher) - .outlier_filters(outlier_filters) - .error_minimizer(error_minimizer) - .transformation_checkers(transformation_checkers) - .inspector(inspector) - .logger(logger), - params::point_map(Point_map()).normal_map(Normal_map()) - .point_set_filters(point_set_2_filters) - .transformation(res.first) /* pass the above computed transformation as initial transformation. - * as a result, the registration will require less iterations to converge. - * */ - ); - - if (converged) - std::cerr << "Success" << std::endl; - else + bool converged = false; + do { - std::cerr << "Failure" << std::endl; - return EXIT_FAILURE; + // OR call the ICP registration method from pointmatcher and apply the transformation to pwn2 + converged = + CGAL::pointmatcher::register_point_sets + (pwns1, pwns2, + params::point_map(Point_map()).normal_map(Normal_map()) + .point_set_filters(point_set_1_filters) + .matcher(matcher) + .outlier_filters(outlier_filters) + .error_minimizer(error_minimizer) + .transformation_checkers(transformation_checkers) + .inspector(inspector) + .logger(logger), + params::point_map(Point_map()).normal_map(Normal_map()) + .point_set_filters(point_set_2_filters) + .transformation(res.first) /* pass the above computed transformation as initial transformation. + * as a result, the registration will require less iterations to converge. + * */ + ); + + // Algorithm may randomly not converge, repeat until it does + if (converged) + std::cerr << "Success" << std::endl; + else + std::cerr << "Did not converge, try again" << std::endl; } + while (!converged); std::ofstream out("pwns2_aligned.ply"); if (!out || diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h index 03a6856f162..0d77320370f 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h @@ -74,6 +74,8 @@ struct Vertex_index { explicit Vertex_index(Index_t i): m_i(i) {} Index_t as_int() const {return m_i;} Vertex_index operator++() {++m_i; return *this; } + bool operator==(const Vertex_index& other) const { return (m_i == other.m_i); } + private: Index_t m_i; }; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp index 0cb165c03f6..1507a23a34f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp @@ -772,6 +772,7 @@ bool Scene_edit_box_item::eventFilter(QObject *obj, QEvent *event) int type, picked; d->picked_pixel = e->pos(); d->picking(type, picked, viewer); + viewer->makeCurrent(); if(type !=-1) { bool found = false;