diff --git a/AABB_tree/demo/AABB_tree/Scene.cpp b/AABB_tree/demo/AABB_tree/Scene.cpp index 7a416bbde35..6303fb2140b 100644 --- a/AABB_tree/demo/AABB_tree/Scene.cpp +++ b/AABB_tree/demo/AABB_tree/Scene.cpp @@ -1297,7 +1297,7 @@ void Scene::refine_loop() return; } std::cout << "Loop subdivision..."; - CGAL::Subdivision_method_3::Loop_subdivision(*m_pPolyhedron, 1); + CGAL::Subdivision_method_3::Loop_subdivision(*m_pPolyhedron); std::cout << "done (" << m_pPolyhedron->size_of_facets() << " facets)" << std::endl; clear_internal_data(); diff --git a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp index 8505b99ed49..87dfc24553f 100644 --- a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h index c5c388d4304..ccebce05bb8 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h @@ -31,10 +31,18 @@ #include #include #if BOOST_VERSION >= 105000 -#include +# if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable: 4996) +# endif +# include +# if defined(BOOST_MSVC) +# pragma warning(pop) +# endif #else -#include +# include #endif + #include namespace CGAL { diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Algebraic_kernel_d.txt b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Algebraic_kernel_d.txt index 52cdc3b4292..d6082d26967 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Algebraic_kernel_d.txt +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Algebraic_kernel_d.txt @@ -325,27 +325,27 @@ efficiency. The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1` using `AlgebraicKernel_d_1::Construct_algebraic_real_1`: -\cgalExample{Algebraic_kernel_d/Construct_algebraic_real_1.cpp} +\cgalExample{Algebraic_kernel_d/Construct_algebraic_real_1.cpp} \subsection CGALAK1Solving Solving Univariate Polynomials The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1` -using `AlgebraicKernel_d_1::Solve_1`: \cgalExample{Algebraic_kernel_d/Solve_1.cpp} +using `AlgebraicKernel_d_1::Solve_1`: \cgalExample{Algebraic_kernel_d/Solve_1.cpp} \subsection CGALAK1EGCompare_1 Comparison and Approximation of Algebraic Real Numbers The following example illustrates the comparison of `AlgebraicKernel_d_1::Algebraic_real_1` numbers: -\cgalExample{Algebraic_kernel_d/Compare_1.cpp} +\cgalExample{Algebraic_kernel_d/Compare_1.cpp} \subsection CGALAK1EGIsolate_1 Isolation of Algebraic Real Numbers with respect to roots of other polynomials The following example illustrates the isolation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers: -\cgalExample{Algebraic_kernel_d/Isolate_1.cpp} +\cgalExample{Algebraic_kernel_d/Isolate_1.cpp} \subsection CGALAK1EGSign_at_1 Interplay with Polynomials The following example illustrates the sign evaluation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers in polynomials: -\cgalExample{Algebraic_kernel_d/Sign_at_1.cpp} +\cgalExample{Algebraic_kernel_d/Sign_at_1.cpp} \section Algebraic_kernel_dDesign Design and Implementation History diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index cc8ba6b58cb..8c338f83e35 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -1524,17 +1524,11 @@ compute_intermediate_values_and_slices() const { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Prepare intermediate slices.." << std::flush; #endif + std::size_t size = event_x_coordinates().size()+1; this->ptr()->intermediate_values=std::vector(); this->ptr()->intermediate_slices=std::vector(); - - for(size_type i=0; - i<=static_cast(event_x_coordinates().size()); - i++) { - this->ptr()->intermediate_values.get().push_back(Lazy_bound()); - this->ptr()->intermediate_slices.get().push_back - (Lazy_status_line_CPA_1()); - } - + this->ptr()->intermediate_values.get().resize(size); + this->ptr()->intermediate_slices.get().resize(size); #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "done" << std::endl; #endif diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt index 719b0deceed..ad8d8120b55 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt @@ -2209,10 +2209,10 @@ representing line segments. A polyline can be constructed given one of the following inputs: -- A range of \a points, where two succeeding points in the +- A range of points, where two succeeding points in the range represent the endpoints of a segment of the polyline. -- A range of \a segments. Note that , if the types +- A range of segments. Note that , if the types `SubcurveTraits_2::Curve_2` and `SubcurveTraits_2::X_monotone_curve_2` are not the same, then when `Make_x_monotone_2` is invoked the segments that compose the polyline will be broken into \f$x\f$-monotone diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h index cc860dbf95b..38b372ad59d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h @@ -167,7 +167,7 @@ virtual void before_detach (); issued immediately after the observer has been detached from its arrangement instance. */ -virtual void after_attach (); +virtual void after_detach (); /// @} diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index 1baad5bed5f..fc61895ed77 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -197,7 +197,7 @@ function(run_test_alt name datafile) set(command ${name} ${datafile} ${ARGN}) string(MAKE_C_IDENTIFIER "${name} ${ARGV4} ${ARGV5}" test_name) add_test(NAME ${test_name} COMMAND ${command} - WORKING_DIRECTORY ${CGAL_CURRENT_SOURCE_DIR}) + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) set_property(TEST "${test_name}" APPEND PROPERTY DEPENDS "compilation_of__${name}") if(POLICY CMP0066) # CMake 3.7 or later diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 6ba2f1ba2d6..d069c70ee55 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -708,6 +708,7 @@ user might encounter. ## I/O Functions ## - \link PkgBGLIOFct CGAL::read_off() \endlink - \link PkgBGLIOFct CGAL::write_off() \endlink +- \link PkgBGLIOFct CGAL::write_wrl() \endlink */ diff --git a/BGL/doc/BGL/fig/hexahedron.png b/BGL/doc/BGL/fig/hexahedron.png new file mode 100644 index 00000000000..34a4fb17085 Binary files /dev/null and b/BGL/doc/BGL/fig/hexahedron.png differ diff --git a/BGL/doc/BGL/fig/tetrahedron.png b/BGL/doc/BGL/fig/tetrahedron.png new file mode 100644 index 00000000000..b0cb6a42259 Binary files /dev/null and b/BGL/doc/BGL/fig/tetrahedron.png differ diff --git a/BGL/examples/BGL_surface_mesh/gwdwg.cpp b/BGL/examples/BGL_surface_mesh/gwdwg.cpp index b857d5a774d..07ed87cc639 100644 --- a/BGL/examples/BGL_surface_mesh/gwdwg.cpp +++ b/BGL/examples/BGL_surface_mesh/gwdwg.cpp @@ -25,10 +25,10 @@ int main() Point_3(1,-1,-1), Point_3(1,1,-1), Point_3(-1,1,-1), + Point_3(-1,1,1), Point_3(-1,-1,1), Point_3(1,-1,1), Point_3(1,1,1), - Point_3(-1,1,1), sm ); @@ -45,10 +45,10 @@ int main() Point_3(0.5,-0.5,-0.5), Point_3(0.5,0.5,-0.5), Point_3(-0.5,0.5,-0.5), + Point_3(-0.5,0.5,0.5), Point_3(-0.5,-0.5,0.5), Point_3(0.5,-0.5,0.5), Point_3(0.5,0.5,0.5), - Point_3(-0.5,0.5,0.5), poly ); pvertex_descriptor pvd = * vertices(pmesh).first; diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index 874141e8776..eb63b9dc6df 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -585,8 +585,16 @@ add_face(const VertexRange& vr, Graph& g) std::vector vertices(vr.begin(), vr.end()); // quick and dirty copy unsigned int n = (unsigned int)vertices.size(); + //check that every vertex is unique + std::sort(vertices.begin(), vertices.end()); + if(std::adjacent_find(vertices.begin(), vertices.end()) != vertices.end()){ + return boost::graph_traits::null_face(); + } + std::copy(vr.begin(), vr.end(), vertices.begin()); // don't allow degenerated faces - CGAL_assertion(n > 2); + if(n <= 2){ + return boost::graph_traits::null_face(); + } std::vector halfedges(n); std::vector is_new(n); diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 7ed5fbf1447..d574d7cc9ca 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -837,6 +837,8 @@ make_quad(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) * \ingroup PkgBGLHelperFct * \brief Creates an isolated hexahedron * with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`. + * \image html hexahedron.png + * \image latex hexahedron.png * \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, `p2`, and `p3`. **/ template @@ -868,16 +870,16 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, ppmap[v6] = p6; ppmap[v7] = p7; - halfedge_descriptor ht = internal::make_quad(v7, v4, v5, v6, g); - halfedge_descriptor hb = prev(internal::make_quad(v1, v0, v3, v2, g),g); + halfedge_descriptor ht = internal::make_quad(v4, v5, v6, v7, g); + halfedge_descriptor hb = prev(internal::make_quad(v0, v3, v2, v1, g),g); for(int i=0; i <4; i++){ halfedge_descriptor h = halfedge(add_edge(g),g); set_target(h,target(hb,g),g); set_next(h,opposite(hb,g),g); - set_next(opposite(next(ht,g),g),h,g); + set_next(opposite(prev(ht,g),g),h,g); h = opposite(h,g); - set_target(h,target(ht,g),g); - set_next(h,opposite(ht,g),g); + set_target(h,source(prev(ht,g),g),g); + set_next(h,opposite(next(next(ht,g),g),g),g); set_next(opposite(next(hb,g),g),h,g); hb = next(hb,g); ht = prev(ht,g); @@ -892,6 +894,8 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, * \ingroup PkgBGLHelperFct * \brief Creates an isolated tetrahedron * with its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`. + * \image html tetrahedron.png + * \image latex tetrahedron.png * \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, and `p2`. **/ template diff --git a/BGL/include/CGAL/boost/graph/io.h b/BGL/include/CGAL/boost/graph/io.h index 2ad04ff8fe8..60dcfca72ad 100644 --- a/BGL/include/CGAL/boost/graph/io.h +++ b/BGL/include/CGAL/boost/graph/io.h @@ -36,6 +36,89 @@ #include namespace CGAL { + /*! + \ingroup PkgBGLIOFct + writes the graph `g` in the wrl format (VRML 2.0). + + \cgalNamedParamsBegin + * \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `g`. + * If this parameter is omitted, an internal property map for + * `CGAL::vertex_point_t` should be available in `FaceGraph`\cgalParamEnd + * \cgalNamedParamsEnd + */ +template +bool write_wrl(std::ostream& os, + const FaceGraph& g, + const NamedParameters& np) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; + typedef typename boost::graph_traits::vertices_size_type vertices_size_type; + + typename Polygon_mesh_processing::GetVertexPointMap::const_type + vpm = choose_param(get_param(np, internal_np::vertex_point), + get_const_property_map(CGAL::vertex_point, g)); + + boost::container::flat_map reindex; + int n = 0; + + os << "#VRML V2.0 utf8\n" + "Group {\n" + "children [\n" + "Shape {\n" + "appearance DEF A1 Appearance {\n" + "material Material {\n" + "diffuseColor .6 .5 .9\n" + "}\n" + "}\n" + "appearance\n" + "Appearance {\n" + "material DEF Material Material {}\n" + "}\n" + "}\n" + "Group {\n" + "children [\n" + "Shape {\n" + "appearance Appearance { material USE Material }\n" + "geometry IndexedFaceSet {\n" + "convex FALSE\n" + "solid FALSE\n" + "coord Coordinate {\n" + "point [\n"; + + BOOST_FOREACH(vertex_descriptor v, vertices(g)){ + os << get(vpm,v) << ",\n"; + reindex[v]=n++; + } + os << "] #point\n" + "} #coord Coordinate\n" + "coordIndex [\n"; + BOOST_FOREACH(face_descriptor f, faces(g)){ + BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f,g),g)){ + os << reindex[v] << ","; + } + os << "-1,\n"; + } + + os << "] #coordIndex\n" + "} #geometry\n" + "} #Shape\n" + "] #children\n" + "} #group\n" + "]\n" + "}\n"; + + return os.good(); +} + +template +bool write_wrl(std::ostream& os, + const FaceGraph& g) +{ + return write_wrl(os, g, + parameters::all_default()); +} + /*! \ingroup PkgBGLIOFct writes the graph `g` in the OFF format. diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 8b6ef06e78d..0949c353647 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -97,6 +97,8 @@ create_single_source_cgal_program( "test_graph_traits.cpp" ) create_single_source_cgal_program( "test_Properties.cpp" ) +create_single_source_cgal_program( "test_wrl.cpp" ) + if(OpenMesh_FOUND) target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES}) target_link_libraries( test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES}) diff --git a/BGL/test/BGL/test_helpers.cpp b/BGL/test/BGL/test_helpers.cpp index e4d0e145829..3ba16eb4d6e 100644 --- a/BGL/test/BGL/test_helpers.cpp +++ b/BGL/test/BGL/test_helpers.cpp @@ -132,7 +132,7 @@ int main() assert(CGAL::is_triangle_mesh(m)); assert(CGAL::is_valid_polygon_mesh(m)); m.clear(); - hd = CGAL::make_hexahedron(a,b,c,d,aa,bb,cc,dd,m); + hd = CGAL::make_hexahedron(a,b,c,d,dd,aa,bb,cc,m); assert(CGAL::is_hexahedron(hd,m)); assert(CGAL::is_quad_mesh(m)); assert(CGAL::is_valid_polygon_mesh(m)); diff --git a/BGL/test/BGL/test_wrl.cpp b/BGL/test/BGL/test_wrl.cpp new file mode 100644 index 00000000000..f8a29ee8533 --- /dev/null +++ b/BGL/test/BGL/test_wrl.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_3 Point; +typedef CGAL::Surface_mesh Mesh; + +int main() +{ + Mesh sm; + + CGAL::make_tetrahedron(Point(0,0,0), Point(1,0,0), Point(1,1,0), Point(0,0,1), sm); + CGAL::write_wrl(std::cout, sm); + return 0; +} diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt index f62ef5d35b8..ff6ffd789b8 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt @@ -74,7 +74,7 @@ polygon vertices is referred to as the polygon (outer) boundary.
  • A polygon whose curves are pairwise disjoint in their interior, and whose vertices' degree equals two is defined as a Simple polygon. Such a polygon has a well-defined interior and exterior and is topologically equivalent to a disk. Note that while traversing the edges of the relatively simple polygon illustrated above (B), no curve is crossed over. -
  • A Relatively simple polygon allows vertices with a degree\f$\gt 2\f$, but all of its edges are disjoint in their interior. Furthermore, it must be an orientable polygon. Namely when it is inserted into an arrangement and its outer boundary is traversed, the same face is adjacent to all of the halfedges (no crossing over any curve during the traversal). +
  • A Relatively simple polygon allows vertices with a degree\f$> 2\f$, but all of its edges are disjoint in their interior. Furthermore, it must be an orientable polygon. Namely when it is inserted into an arrangement and its outer boundary is traversed, the same face is adjacent to all of the halfedges (no crossing over any curve during the traversal). Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previously traversed curve, and is therefore neither simple nor relatively simple.
  • A polygon in our context must be relatively simple and its outer boundary vertices must be ordered in a counterclockwise direction around the interior of the polygon. diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h index c53940face3..535dc70d085 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h @@ -13,28 +13,28 @@ x\in\E^d \mid x^T E x + x^T e + \eta\leq 0 \}\f$, where \f$ E\f$ is some positive definite matrix from the set \f$ \mathbb{R}^{d\times d}\f$, \f$ e\f$ is some real \f$ d\f$-vector, and \f$ \eta\in\mathbb{R}\f$. A pointset \f$ P\subseteq \E^d\f$ is called full-dimensional if its affine hull has dimension \f$ d\f$. -For a finite, full-dimensional pointset \f$ P\f$ we denote by \f$ \mel(P)\f$ the +For a finite, full-dimensional pointset \f$ P\f$ we denote by \f$ (P)\f$ the smallest ellipsoid that contains all points of \f$ P\f$; this ellipsoid exists and is unique. For a given finite and full-dimensional pointset \f$ P\subset \E^d\f$ and a real number \f$ \epsilon\ge 0\f$, we say that an ellipsoid \f$ {\cal -E}\subset\E^d\f$ is an \f$ (1+\epsilon)\f$-appoximation to \f$ \mel(P)\f$ if -\f$ P\subset {\cal E}\f$ and \f$ \vol({\cal E}) \leq (1+\epsilon) -\vol(\mel(P))\f$. In other words, an \f$ (1+\epsilon)\f$-approximation to -\f$ \mel(P)\f$ is an enclosing ellipsoid whose volume is by at most a +E}\subset\E^d\f$ is an \f$ (1+\epsilon)\f$-appoximation to \f$ (P)\f$ if +\f$ P\subset {\cal E}\f$ and \f$ ({\cal E}) \leq (1+\epsilon) +((P))\f$. In other words, an \f$ (1+\epsilon)\f$-approximation to +\f$ (P)\f$ is an enclosing ellipsoid whose volume is by at most a factor of \f$ 1+\epsilon\f$ larger than the volume of the smallest enclosing ellipsoid of \f$ P\f$. Given this notation, an object of class `Approximate_min_ellipsoid_d` represents an -\f$ (1+\epsilon)\f$-approximation to \f$ \mel(P)\f$ for a given finite and +\f$ (1+\epsilon)\f$-approximation to \f$ (P)\f$ for a given finite and full-dimensional multiset of points \f$ P\subset\E^d\f$ and a real constant \f$ \epsilon>0\f$.\cgalFootnote{A multiset is a set where elements may have multiplicity greater than \f$ 1\f$.} When an `Approximate_min_ellipsoid_d` object is constructed, an iterator over the points \f$ P\f$ and the number \f$ \epsilon\f$ have to be specified; the number \f$ \epsilon\f$ defines the desired approximation ratio \f$ 1+\epsilon\f$. The underlying algorithm will then -try to compute an \f$ (1+\epsilon)\f$-approximation to \f$ \mel(P)\f$, and one of +try to compute an \f$ (1+\epsilon)\f$-approximation to \f$ (P)\f$, and one of the following two cases takes place.
    • The algorithm determines that \f$ P\f$ is not full-dimensional (see @@ -44,7 +44,7 @@ the following two cases takes place. in all cases decide correctly whether \f$ P\f$ is full-dimensional or not. If `is_full_dimensional()` returns `false`, the points lie in such a "thin" subspace of \f$ \E^d\f$ that the algorithm is -incapable of computing an approximation to \f$ \mel(P)\f$. More +incapable of computing an approximation to \f$ (P)\f$. More precisely, if `is_full_dimensional()` returns `false`, there exist two parallel hyperplanes in \f$ \E^d\f$ with the points \f$ P\f$ in between so that the distance \f$ \delta\f$ between the hyperplanes is @@ -55,7 +55,7 @@ If \f$ P\f$ is not full-dimensional, linear algebra techniques should be used to determine an affine subspace \f$ S\f$ of \f$ \E^d\f$ that contains the points \f$ P\f$ as a (w.r.t.\ \f$ S\f$) full-dimensional pointset; once \f$ S\f$ is determined, the algorithm can be invoked again to compute an -approximation to (the lower-dimensional) \f$ \mel(P)\f$ in \f$ S\f$. Since +approximation to (the lower-dimensional) \f$ (P)\f$ in \f$ S\f$. Since `is_full_dimensional()` might (due to rounding errors, see above) return `false` even though \f$ P\f$ is full-dimensional, the lower-dimensional subspace \f$ S\f$ containing \f$ P\f$ need not exist. @@ -66,7 +66,7 @@ ellipsoid of the projected points within \f$ H\f$; the fitting can be done for instance using the `linear_least_squares_fitting()` function from the \cgal package `Principal_component_analysis`.
    • The algorithm determines that \f$ P\f$ is full-dimensional. In this -case, it provides an approximation \f$ {\cal E}\f$ to \f$ \mel(P)\f$, but +case, it provides an approximation \f$ {\cal E}\f$ to \f$ (P)\f$, but depending on the input problem (i.e., on the pair \f$ (P,\epsilon)\f$), it may not have achieved the desired approximation ratio but merely some worse approximation ratio \f$ 1+\epsilon'>1+\epsilon\f$. The @@ -126,7 +126,7 @@ Cholesky-decomposition. The algorithm's running time is To illustrate the usage of `Approximate_min_ellipsoid_d` we give two examples in 2D. The first program generates a random set \f$ P\subset\E^2\f$ and outputs the -points and a \f$ 1.01\f$-approximation of \f$ \mel(P)\f$ as an EPS-file, which +points and a \f$ 1.01\f$-approximation of \f$ (P)\f$ as an EPS-file, which you can view using gv, for instance. (In both examples you can change the variables `n` and `d` to experiment with the code.) @@ -204,7 +204,7 @@ typedef unspecified_type Axis_direction_iterator; /*! initializes `ame` to an \f$ (1+\epsilon)\f$-approximation of -\f$ \mel(P)\f$ with \f$ P\f$ being the set of points in the range +\f$ (P)\f$ with \f$ P\f$ being the set of points in the range [`first`,`last`). The number \f$ \epsilon\f$ in this will be at most `eps`, if possible. However, due to the limited precision in the algorithm's underlying arithmetic, it @@ -260,7 +260,7 @@ unsigned int number_of_points( ) const; returns a number \f$ \epsilon'\f$ such that the computed approximation is (under exact arithmetic) guaranteed to be an \f$ (1+\epsilon')\f$-approximation to -\f$ \mel(P)\f$. +\f$ (P)\f$. \pre `ame.is_full_dimensional() == true`. \post \f$ \epsilon'>0\f$. */ @@ -404,7 +404,7 @@ bool is_full_dimensional( ) const; /// An object `ame` is valid iff
      • `ame` contains all points of /// its defining set \f$ P\f$,
      • `ame` is an \f$ /// (1+\epsilon')\f$-approximation to the smallest ellipsoid \f$ -/// \mel(P)\f$ of \f$ P\f$,
      • The ellipsoid represented by `ame` +/// (P)\f$ of \f$ P\f$,
      • The ellipsoid represented by `ame` /// fulfills the inclusion ( \ref eqapproximate_min_ellipsoid_incl /// ).
      /// @{ @@ -426,7 +426,7 @@ bool is_valid( bool verbose = false) const; /*! Writes the points \f$ P\f$ and the computed approximation to -\f$ \mel(P)\f$ as an EPS-file under pathname `name`. \pre The dimension of points \f$ P\f$ must be \f$ 2\f$. +\f$ (P)\f$ as an EPS-file under pathname `name`. \pre The dimension of points \f$ P\f$ must be \f$ 2\f$. Note: this routine is provided as a debugging routine; future version of \cgal might not provide it anymore. diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2.h index 3a15bef505b..4348f8a5f80 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2.h @@ -360,7 +360,20 @@ class Min_ellipse_2 { // default constructor inline - Min_ellipse_2( const Traits& traits = Traits()) + Min_ellipse_2() + : n_support_points( 0) + { + // allocate support points' array + support_points = new Point[ 5]; + + // initialize ellipse + tco.ellipse.set(); + + CGAL_optimisation_postcondition( is_empty()); + } + + inline + Min_ellipse_2( const Traits& traits ) : tco( traits), n_support_points( 0) { // allocate support points' array diff --git a/CGAL_ImageIO/include/CGAL/ImageIO_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO_impl.h index da049f853db..6e8ec0ffb05 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO_impl.h @@ -168,7 +168,7 @@ unsigned int ImageIO_limit_len(size_t to_be_read) CGAL_INLINE_FUNCTION size_t ImageIO_write(const _image *im, const void *buf, size_t len) { size_t to_be_written = len; - int l = -1; + std::ptrdiff_t l = -1; char *b = (char*)buf; switch(im->openMode) { diff --git a/CGAL_ImageIO/include/CGAL/read_vtk_image_data.h b/CGAL_ImageIO/include/CGAL/read_vtk_image_data.h index 2c28a44c25a..c592d3a0be2 100644 --- a/CGAL_ImageIO/include/CGAL/read_vtk_image_data.h +++ b/CGAL_ImageIO/include/CGAL/read_vtk_image_data.h @@ -63,6 +63,7 @@ read_vtk_image_data(vtkImageData* vtk_image) _image* image = ::_initImage(); const int* dims = vtk_image->GetDimensions(); const double* spacing = vtk_image->GetSpacing(); + const double* offset = vtk_image->GetOrigin(); image->vectMode = VM_SCALAR; image->xdim = dims[0]; image->ydim = dims[1]; @@ -71,6 +72,9 @@ read_vtk_image_data(vtkImageData* vtk_image) image->vx = spacing[0]; image->vy = spacing[1]; image->vz = spacing[2]; + image->tx = offset[0]; + image->ty = offset[1]; + image->tz = offset[2]; image->endianness = ::_getEndianness(); int vtk_type = vtk_image->GetScalarType(); if(vtk_type == VTK_SIGNED_CHAR) vtk_type = VTK_CHAR; diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h index 48dba7821ae..9373f9feeda 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h @@ -28,6 +28,7 @@ #include #include +#include namespace CGAL { @@ -284,7 +285,16 @@ line_get_pointC2(const FT &a, const FT &b, const FT &c, int i, { if (CGAL_NTS is_zero(b)) { - x = (-b-c)/a + i * b; + // Laurent Rineau, 2018/12/07: I add this CGAL_assume to calm + // down a warning from MSVC 2017: + // > include\cgal\constructions\kernel_ftc2.h(287) : + // > warning C4723: potential divide by 0 + // The test `!boost::is_integral::value` is there to avoid + // that `a != 0` is tested on anything but integral types, for + // performance reasons. + CGAL_assume(!boost::is_integral::value || a != FT(0)); + + x = -c/a; y = 1 - i * a; } else diff --git a/Classification/include/CGAL/Classification/ETHZ_random_forest_classifier.h b/Classification/include/CGAL/Classification/ETHZ_random_forest_classifier.h index cf3ae810df9..1587baf4b9b 100644 --- a/Classification/include/CGAL/Classification/ETHZ_random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/ETHZ_random_forest_classifier.h @@ -38,6 +38,7 @@ # pragma warning(disable:4267) # pragma warning(disable:4275) # pragma warning(disable:4251) +# pragma warning(disable:4996) #endif #include diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 3e630a9ae3e..c45057f806d 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -93,7 +93,7 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_INC_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_INC_PATH += ${CGAL_PACKAGE_DIR}/include/\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgDescriptionBegin{2}=\\details \"\n") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgManuals{2}=
      \"\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgManuals{2}=
      \"\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "INPUT = ${CGAL_PACKAGE_DOC_DIR}\n") if(NOT EXISTS "${CGAL_PACKAGE_DOC_DIR}/CGAL") # This package has in-source documentation. diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 49b2e2c11b3..e3f372bcf3d 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -250,9 +250,9 @@ ALIASES = "sc{1}=\1
      \image html \2 \n \image latex \2 \"\" width=2.1cm \n \image html \3 \n \image latex \3 \"\" width=2.1cm \n \image html \4 \n \image latex \4 \"\" width=2.1cm \n \image html \5 \n \image latex \5 \"\" width=2.1cm \n \image html \6 \n \image latex \6 \"\" width=2.1cm \n \image html \7 \n \image latex \7 \"\" width=2.1cm \n \image html \8 \n \image latex \8 \"\" width=2.1cm \n
      \htmlonly
      \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \ "cgalFigureBegin{9}=\anchor fig__\1 \n
      \image html \2 \n \image latex \2 \"\" width=1.9cm \n \image html \3 \n \image latex \3 \"\" width=1.9cm \n \image html \4 \n \image latex \4 \"\" width=1.9cm \n \image html \5 \n \image latex \5 \"\" width=1.9cm \n \image html \6 \n \image latex \6 \"\" width=1.9cm \n \image html \7 \n \image latex \7 \"\" width=1.9cm \n \image html \8 \n \image latex \8 \"\" width=1.9cm \n \image html \9 \n \image latex \9 \"\" width=1.9cm \n
      \htmlonly
      \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \ "cgalFigureBegin{10}=\anchor fig__\1 \n
      \image html \2 \n \image latex \2 \"\" width=1.6cm \n \image html \3 \n \image latex \3 \"\" width=1.6cm \n \image html \4 \n \image latex \4 \"\" width=1.6cm \n \image html \5 \n \image latex \5 \"\" width=1.6cm \n \image html \6 \n \image latex \6 \"\" width=1.6cm \n \image html \7 \n \image latex \7 \"\" width=1.6cm \n \image html \8 \n \image latex \8 \"\" width=1.6cm \n \image html \9 \n \image latex \9 \"\" width=1.6cm \n \image html \10 \n \image latex \10 \"\" width=1.6cm \n
      \htmlonly
      \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \ - "cgalFigureEnd=\htmlonly
      \endhtmlonly
      " \ + "cgalFigureEnd=\htmlonly

      \endhtmlonly" \ "cgalFigureCaptionBegin{1}=\htmlonly
      \endhtmlonly \ref fig__\1" \ - "cgalFigureCaptionEnd=\htmlonly
      \endhtmlonly
      " \ + "cgalFigureCaptionEnd=\htmlonly

      \endhtmlonly" \ "cgalConcept=\details
      \n \brief" \ "cgalConceptNamespace=\details
      \n \brief" \ "cgalRefines=\xrefitem refines \"Refines\" \"Refinement Relationships\"" \ diff --git a/Documentation/doc/resources/1.8.13/deprecated.html b/Documentation/doc/resources/1.8.13/deprecated.html index 4d8329a9fb2..823d7ea093c 100644 --- a/Documentation/doc/resources/1.8.13/deprecated.html +++ b/Documentation/doc/resources/1.8.13/deprecated.html @@ -1,4 +1,4 @@ - + diff --git a/Documentation/doc/resources/1.8.13/header.html b/Documentation/doc/resources/1.8.13/header.html index ea550ad48c8..f5ed0edf20d 100644 --- a/Documentation/doc/resources/1.8.13/header.html +++ b/Documentation/doc/resources/1.8.13/header.html @@ -1,5 +1,5 @@ - + diff --git a/Documentation/doc/resources/1.8.13/header_package.html b/Documentation/doc/resources/1.8.13/header_package.html index c8e2578351f..46521a96a54 100644 --- a/Documentation/doc/resources/1.8.13/header_package.html +++ b/Documentation/doc/resources/1.8.13/header_package.html @@ -1,5 +1,5 @@ - + diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index 9bc583f5cd8..56a2538e6dc 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -242,29 +242,29 @@ ALIASES = "sc{1}=\1File \ref \1 \include \1" \ "cgalFigureAnchor{1}=\anchor fig__\1" \ "cgalFigureRef{1}=\ref fig__\1" \ - "cgalFigureBegin{2}=\anchor fig__\1 ^^ \image html \2 ^^ \image latex \2 \"\" width=15cm ^^ \htmlonly
      \endhtmlonly \latexonly ^^ \endlatexonly ^^ \ref fig__\1" \ - "cgalFigureBegin{3}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=7.5cm ^^ \image html \3 ^^ \image latex \3 \"\" width=7.5cm ^^
      \htmlonly
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ - "cgalFigureBegin{4}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=5cm ^^ \image html \3 ^^ \image latex \3 \"\" width=5cm ^^ \image html \4 ^^ \image latex \4 \"\" width=5cm ^^
      \htmlonly
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ - "cgalFigureBegin{5}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=3.75cm ^^ \image html \3 ^^ \image latex \3 \"\" width=3.75cm ^^ \image html \4 ^^ \image latex \4 \"\" width=3.75cm ^^ \image html \5 ^^ \image latex \5 \"\" width=3.75cm ^^
      \htmlonly
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ - "cgalFigureBegin{6}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=3cm ^^ \image html \3 ^^ \image latex \3 \"\" width=3cm ^^ \image html \4 ^^ \image latex \4 \"\" width=3cm ^^ \image html \5 ^^ \image latex \5 \"\" width=3cm ^^ \image html \6 ^^ \image latex \6 \"\" width=3cm ^^
      \htmlonly
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ - "cgalFigureBegin{7}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=2.5cm ^^ \image html \3 ^^ \image latex \3 \"\" width=2.5cm ^^ \image html \4 ^^ \image latex \4 \"\" width=2.5cm ^^ \image html \5 ^^ \image latex \5 \"\" width=2.5cm ^^ \image html \6 ^^ \image latex \6 \"\" width=2.5cm ^^ \image html \7 ^^ \image latex \7 \"\" width=2.5cm ^^
      \htmlonly
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ - "cgalFigureBegin{8}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=2.1cm ^^ \image html \3 ^^ \image latex \3 \"\" width=2.1cm ^^ \image html \4 ^^ \image latex \4 \"\" width=2.1cm ^^ \image html \5 ^^ \image latex \5 \"\" width=2.1cm ^^ \image html \6 ^^ \image latex \6 \"\" width=2.1cm ^^ \image html \7 ^^ \image latex \7 \"\" width=2.1cm ^^ \image html \8 ^^ \image latex \8 \"\" width=2.1cm ^^
      \htmlonly
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ - "cgalFigureBegin{9}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=1.9cm ^^ \image html \3 ^^ \image latex \3 \"\" width=1.9cm ^^ \image html \4 ^^ \image latex \4 \"\" width=1.9cm ^^ \image html \5 ^^ \image latex \5 \"\" width=1.9cm ^^ \image html \6 ^^ \image latex \6 \"\" width=1.9cm ^^ \image html \7 ^^ \image latex \7 \"\" width=1.9cm ^^ \image html \8 ^^ \image latex \8 \"\" width=1.9cm ^^ \image html \9 ^^ \image latex \9 \"\" width=1.9cm ^^
      \htmlonly
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ - "cgalFigureBegin{10}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=1.6cm ^^ \image html \3 ^^ \image latex \3 \"\" width=1.6cm ^^ \image html \4 ^^ \image latex \4 \"\" width=1.6cm ^^ \image html \5 ^^ \image latex \5 \"\" width=1.6cm ^^ \image html \6 ^^ \image latex \6 \"\" width=1.6cm ^^ \image html \7 ^^ \image latex \7 \"\" width=1.6cm ^^ \image html \8 ^^ \image latex \8 \"\" width=1.6cm ^^ \image html \9 ^^ \image latex \9 \"\" width=1.6cm ^^ \image html \10 ^^ \image latex \10 \"\" width=1.6cm ^^
      \htmlonly
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ - "cgalFigureEnd=\htmlonly
      \endhtmlonly
      " \ - "cgalFigureCaptionBegin{1}=\htmlonly
      \endhtmlonly \ref fig__\1" \ - "cgalFigureCaptionEnd=\htmlonly
      \endhtmlonly
      " \ + "cgalFigureBegin{2}=\anchor fig__\1 ^^ \image html \2 ^^ \image latex \2 \"\" width=15cm ^^ \htmlonly[block]
      \endhtmlonly \latexonly ^^ \endlatexonly ^^ \ref fig__\1" \ + "cgalFigureBegin{3}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=7.5cm ^^ \image html \3 ^^ \image latex \3 \"\" width=7.5cm ^^
      \htmlonly[block]
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ + "cgalFigureBegin{4}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=5cm ^^ \image html \3 ^^ \image latex \3 \"\" width=5cm ^^ \image html \4 ^^ \image latex \4 \"\" width=5cm ^^
      \htmlonly[block]
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ + "cgalFigureBegin{5}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=3.75cm ^^ \image html \3 ^^ \image latex \3 \"\" width=3.75cm ^^ \image html \4 ^^ \image latex \4 \"\" width=3.75cm ^^ \image html \5 ^^ \image latex \5 \"\" width=3.75cm ^^
      \htmlonly[block]
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ + "cgalFigureBegin{6}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=3cm ^^ \image html \3 ^^ \image latex \3 \"\" width=3cm ^^ \image html \4 ^^ \image latex \4 \"\" width=3cm ^^ \image html \5 ^^ \image latex \5 \"\" width=3cm ^^ \image html \6 ^^ \image latex \6 \"\" width=3cm ^^
      \htmlonly[block]
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ + "cgalFigureBegin{7}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=2.5cm ^^ \image html \3 ^^ \image latex \3 \"\" width=2.5cm ^^ \image html \4 ^^ \image latex \4 \"\" width=2.5cm ^^ \image html \5 ^^ \image latex \5 \"\" width=2.5cm ^^ \image html \6 ^^ \image latex \6 \"\" width=2.5cm ^^ \image html \7 ^^ \image latex \7 \"\" width=2.5cm ^^
      \htmlonly[block]
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ + "cgalFigureBegin{8}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=2.1cm ^^ \image html \3 ^^ \image latex \3 \"\" width=2.1cm ^^ \image html \4 ^^ \image latex \4 \"\" width=2.1cm ^^ \image html \5 ^^ \image latex \5 \"\" width=2.1cm ^^ \image html \6 ^^ \image latex \6 \"\" width=2.1cm ^^ \image html \7 ^^ \image latex \7 \"\" width=2.1cm ^^ \image html \8 ^^ \image latex \8 \"\" width=2.1cm ^^
      \htmlonly[block]
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ + "cgalFigureBegin{9}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=1.9cm ^^ \image html \3 ^^ \image latex \3 \"\" width=1.9cm ^^ \image html \4 ^^ \image latex \4 \"\" width=1.9cm ^^ \image html \5 ^^ \image latex \5 \"\" width=1.9cm ^^ \image html \6 ^^ \image latex \6 \"\" width=1.9cm ^^ \image html \7 ^^ \image latex \7 \"\" width=1.9cm ^^ \image html \8 ^^ \image latex \8 \"\" width=1.9cm ^^ \image html \9 ^^ \image latex \9 \"\" width=1.9cm ^^
      \htmlonly[block]
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ + "cgalFigureBegin{10}=\anchor fig__\1 ^^
      \image html \2 ^^ \image latex \2 \"\" width=1.6cm ^^ \image html \3 ^^ \image latex \3 \"\" width=1.6cm ^^ \image html \4 ^^ \image latex \4 \"\" width=1.6cm ^^ \image html \5 ^^ \image latex \5 \"\" width=1.6cm ^^ \image html \6 ^^ \image latex \6 \"\" width=1.6cm ^^ \image html \7 ^^ \image latex \7 \"\" width=1.6cm ^^ \image html \8 ^^ \image latex \8 \"\" width=1.6cm ^^ \image html \9 ^^ \image latex \9 \"\" width=1.6cm ^^ \image html \10 ^^ \image latex \10 \"\" width=1.6cm ^^
      \htmlonly[block]
      \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ + "cgalFigureEnd=\htmlonly[block]
      \endhtmlonly
      " \ + "cgalFigureCaptionBegin{1}=\htmlonly[block]
      \endhtmlonly \ref fig__\1" \ + "cgalFigureCaptionEnd=\htmlonly[block]
      \endhtmlonly
      " \ "cgalConcept=\details
      ^^ \brief" \ "cgalConceptNamespace=\details
      ^^ \brief" \ "cgalRefines=\xrefitem refines \"Refines\" \"Refinement Relationships\"" \ "cgalModels=\xrefitem models \"Is Model Of\" \"Is Model Relationships\"" \ "cgalGeneralizes=\xrefitem generalizes \"Generalizes\" \"Generalization Relationships\"" \ "cgalHasModel=\xrefitem hasModels \"Has Models\" \"Has Model Relationships\"" \ - "cgalDebugBegin=\htmlonly
      Debugging Support
      \endhtmlonly ^^" \ - "cgalDebugEnd=\htmlonly
      \endhtmlonly" \ + "cgalDebugBegin=\htmlonly[block]
      Debugging Support
      \endhtmlonly ^^" \ + "cgalDebugEnd=\htmlonly[block]
      \endhtmlonly" \ "cgalDebugFunction=This is a function for debugging purpose." \ - "cgalAdvancedBegin=\htmlonly
      Advanced
      \endhtmlonly ^^" \ - "cgalAdvancedEnd=\htmlonly
      \endhtmlonly" \ + "cgalAdvancedBegin=\htmlonly[block]
      Advanced
      \endhtmlonly ^^" \ + "cgalAdvancedEnd=\htmlonly[block]
      \endhtmlonly" \ "cgalAdvancedFunction=This is an advanced function." \ "cgalAdvancedClass=This is an advanced class." \ "cgalRequiresCPP11=\warning This function requires a C++11 compiler." \ @@ -287,11 +287,11 @@ ALIASES = "sc{1}=\1 \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \ "cgalPkgBib{1}=BibTeX: \1-${CGAL_RELEASE_YEAR_ID}
      " \ "cgalFootnote{1}=\1" \ - "cgalAutoToc=\htmlonly
      \endhtmlonly" \ + "cgalAutoToc=\htmlonly[block]
      \endhtmlonly" \ "cgalTagTrue=\link CGAL::Tag_true `CGAL::Tag_true`\endlink" \ "cgalTagFalse=\link CGAL::Tag_false `CGAL::Tag_false`\endlink" \ "cgalHeading{1}= \1
      " \ - "cgalClassifedRefPages=\htmlonly

      Classified Reference Pages

      \endhtmlonly" \ + "cgalClassifedRefPages=\htmlonly[block]

      Classified Reference Pages

      \endhtmlonly" \ "cgalCite{1}=\cite \1" # This tag can be used to specify a number of word-keyword mappings (TCL only). diff --git a/Documentation/doc/resources/1.8.14/deprecated.html b/Documentation/doc/resources/1.8.14/deprecated.html index 60d1c4e90bc..a8baa72c005 100644 --- a/Documentation/doc/resources/1.8.14/deprecated.html +++ b/Documentation/doc/resources/1.8.14/deprecated.html @@ -1,4 +1,4 @@ - + diff --git a/Documentation/doc/resources/1.8.14/header.html b/Documentation/doc/resources/1.8.14/header.html index ea550ad48c8..f5ed0edf20d 100644 --- a/Documentation/doc/resources/1.8.14/header.html +++ b/Documentation/doc/resources/1.8.14/header.html @@ -1,5 +1,5 @@ - + diff --git a/Documentation/doc/resources/1.8.14/header_package.html b/Documentation/doc/resources/1.8.14/header_package.html index 7adad539ace..df3a1bcba36 100644 --- a/Documentation/doc/resources/1.8.14/header_package.html +++ b/Documentation/doc/resources/1.8.14/header_package.html @@ -1,5 +1,5 @@ - + diff --git a/Documentation/doc/resources/1.8.4/deprecated.html b/Documentation/doc/resources/1.8.4/deprecated.html index 4d8329a9fb2..823d7ea093c 100644 --- a/Documentation/doc/resources/1.8.4/deprecated.html +++ b/Documentation/doc/resources/1.8.4/deprecated.html @@ -1,4 +1,4 @@ - + diff --git a/Documentation/doc/resources/1.8.4/header.html b/Documentation/doc/resources/1.8.4/header.html index 890229ec02c..4b0aae2bff8 100644 --- a/Documentation/doc/resources/1.8.4/header.html +++ b/Documentation/doc/resources/1.8.4/header.html @@ -1,4 +1,4 @@ - + diff --git a/Documentation/doc/resources/1.8.4/header_package.html b/Documentation/doc/resources/1.8.4/header_package.html index 051c01002f6..37a9f67fdca 100644 --- a/Documentation/doc/resources/1.8.4/header_package.html +++ b/Documentation/doc/resources/1.8.4/header_package.html @@ -1,4 +1,4 @@ - + diff --git a/Documentation/doc/scripts/html_output_post_processing.py b/Documentation/doc/scripts/html_output_post_processing.py index c2a0b34941f..e89c7e7b61a 100755 --- a/Documentation/doc/scripts/html_output_post_processing.py +++ b/Documentation/doc/scripts/html_output_post_processing.py @@ -62,7 +62,7 @@ def conceptify_ns(d): def write_out_html(d, fn): f = codecs.open(fn, 'w', encoding='utf-8') # this is the normal doxygen doctype, which is thrown away by pyquery - f.write('\n') + f.write('\n') f.write('') f.write(d.html()) f.write('\n') diff --git a/Generator/doc/Generator/Generator.txt b/Generator/doc/Generator/Generator.txt index 138c4a7a7a5..cadcc924ab8 100644 --- a/Generator/doc/Generator/Generator.txt +++ b/Generator/doc/Generator/Generator.txt @@ -277,7 +277,7 @@ triangle (2D and 3D) and in tetrahedra (3D). Basically, in order to generate a random point in a \f$N\f$-simplex (a triangle for \f$N = 2\f$, and tetrahedron for \f$N = 3\f$), we generate numbers \f$a_1,a_2,\ldots,a_N\f$ identically and independently uniformly distributed in \f$(0,1)\f$, we sort them, we let \f$a_0 = 0\f$ and \f$a_{N+1} = 1\f$, -and then \f$a_{i+1}−a_i\f$, for \f$i = 1,\ldots,N\f$ becomes its +and then \f$a_{i+1}-a_i\f$, for \f$i = 1,\ldots,N\f$ becomes its barycentric coordinates with respect to the simplex. Maxime Gimemo introduced the random generators on 2D and 3D triangle meshes. diff --git a/Generator/include/CGAL/point_generators_d.h b/Generator/include/CGAL/point_generators_d.h index 1cc01033b5d..c7f40cbf5a7 100644 --- a/Generator/include/CGAL/point_generators_d.h +++ b/Generator/include/CGAL/point_generators_d.h @@ -151,6 +151,7 @@ void Random_points_in_cube_d

      :: generate_point() { typedef typename Kernel_traits

      ::Kernel::RT RT; + CGAL_assume(dimension>0); std::vector coord(dimension); for(int i=0; id_range * ( 2 * this->_rnd.get_double() - 1.0)); diff --git a/Generator/test/Generator/generic_random_test.cpp b/Generator/test/Generator/generic_random_test.cpp index 7ea066f4233..3090ddbfc80 100644 --- a/Generator/test/Generator/generic_random_test.cpp +++ b/Generator/test/Generator/generic_random_test.cpp @@ -288,8 +288,10 @@ int main() Polyhedron polyhedron; // A cube - make_hexahedron(Point_3(-0.5,-0.5,-0.5), Point_3(0.5,-0.5,-0.5), Point_3(0.5,0.5,-0.5), Point_3(-0.5,0.5,-0.5), - Point_3(-0.5,0.5,0.5), Point_3(-0.5,-0.5,0.5), Point_3(0.5,-0.5,0.5), Point_3(0.5,0.5,0.5), + make_hexahedron( + Point_3(-0.5,-0.5,-0.5), Point_3(0.5,-0.5,-0.5), Point_3(0.5,0.5,-0.5), + Point_3(-0.5,0.5,-0.5), Point_3(-0.5,0.5,0.5), Point_3(-0.5,-0.5,0.5), + Point_3(0.5,-0.5,0.5), Point_3(0.5,0.5,0.5), polyhedron); boost::graph_traits::halfedge_descriptor facets[6]; diff --git a/Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h b/Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h index d189bb8367f..a93f3b86950 100644 --- a/Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h +++ b/Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h @@ -363,19 +363,6 @@ operator<<(Geomview_stream& gs, const Bbox_2& b); Geomview_stream& operator<<(Geomview_stream& gs, const Bbox_3& b); -/*! - Inserts the bounding box `b` into the stream `gs`. - \relates Geomview_stream -*/ -Geomview_stream& -operator<<(Geomview_stream& gs, const Bbox_3& b); - -/*! - Inserts the bounding box `b` into the stream `gs`. - \relates Geomview_stream -*/ -Geomview_stream& -operator<<(Geomview_stream& gs, const Bbox_3& b); /// @} diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 672d71541a4..86dd48044b6 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -54,6 +54,10 @@ Release date: March 2019 `Arr_polyline_traits_2`, `Arr_polycurve_traits_2`, and `Arr_polycurve_basic_traits_2`. +### CGAL and the Boost Graph Library (BGL) + +- Add function `write_wrl()` for writing into VRML 2.0 format. + Release 4.13 ------------ diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index 79bef011112..2f0aec7163a 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -42,7 +42,7 @@ endif() # Process a list, and replace items contains a file pattern (like # `*.off`) by the sublist that corresponds to the globbing of the -# pattern in the directory `${CGAL_CURRENT_SOURCE_DIR}`. +# pattern in the directory `${CMAKE_CURRENT_SOURCE_DIR}`. # # # For example: the `file @@ -71,7 +71,7 @@ function(expand_list_with_globbing list_name) list(GET input_list ${n} item_n) # message(STATUS "argument ${n} is ${item_n}") if(item_n MATCHES ".*\\*.*") - file(GLOB files RELATIVE ${CGAL_CURRENT_SOURCE_DIR} ${item_n}) + file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${item_n}) list(APPEND output_list ${files}) else() list(APPEND output_list ${item_n}) @@ -97,7 +97,7 @@ function(cgal_setup_test_properties test_name) endif() set_property(TEST "${test_name}" APPEND PROPERTY LABELS "${PROJECT_NAME}") - # message(STATUS " working dir: ${CGAL_CURRENT_SOURCE_DIR}") + # message(STATUS " working dir: ${CMAKE_CURRENT_SOURCE_DIR}") set_property(TEST "${test_name}" PROPERTY WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) if(exe_name) @@ -198,7 +198,7 @@ function(cgal_add_test exe_name) return() endif() # message("Add test ${test_name}") - set(cin_file "${CGAL_CURRENT_SOURCE_DIR}/${exe_name}.cin") + set(cin_file "${CMAKE_CURRENT_SOURCE_DIR}/${exe_name}.cin") if(NOT ARGS AND EXISTS ${cin_file}) add_test(NAME ${test_name} COMMAND ${TIME_COMMAND} ${CMAKE_COMMAND} @@ -213,11 +213,11 @@ function(cgal_add_test exe_name) else() if(NOT ARGS AND NOT cgal_add_test_TEST_NAME) if(ARGC GREATER 2 AND ARGV2) - set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${ARGV2}.cmd") + set(cmd_file "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV2}.cmd") elseif(ARGC GREATER 1 AND ARGV1 AND NOT EXISTS ${cmd_file}) - set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${ARGV1}.cmd") + set(cmd_file "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV1}.cmd") elseif(NOT EXISTS ${cmd_file}) - set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${exe_name}.cmd") + set(cmd_file "${CMAKE_CURRENT_SOURCE_DIR}/${exe_name}.cmd") endif() if(EXISTS ${cmd_file}) file(STRINGS "${cmd_file}" CMD_LINES) diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index 5128023cc5d..0187802b524 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -9,11 +9,6 @@ include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) cgal_setup_module_path() -# Save the current source directory. That variable can be changed by -# a `CMakeLists.txt`, for `CMakeLists.txt` files that are created in -# the binary directory. -set(CGAL_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - if(NOT USE_CGAL_FILE_INCLUDED) set(USE_CGAL_FILE_INCLUDED 1) diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index ad0de1806ca..0cb7f0326bb 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -11,11 +11,6 @@ get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) set(CGAL_HEADER_ONLY TRUE) -# Save the current source directory. That variable can be changed by -# a `CMakeLists.txt`, for `CMakeLists.txt` files that are created in -# the binary directory. -set(CGAL_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - function(cgal_detect_branch_build VAR_NAME) if(IS_DIRECTORY ${CGAL_CONFIG_DIR}/../../../../Installation/package_info/Installation/) set(${VAR_NAME} TRUE PARENT_SCOPE) @@ -73,6 +68,9 @@ include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) include(${CGAL_MODULES_DIR}/CGAL_Common.cmake) +set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake) + + if(CGAL_BUILDING_LIBS) foreach(comp ${CGAL_FIND_COMPONENTS}) if(CGAL_${comp}_FOUND) @@ -146,8 +144,6 @@ endforeach() # Temporary? Change the CMAKE module path cgal_setup_module_path() -set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake) - include("${CGAL_MODULES_DIR}/CGAL_parse_version_h.cmake") cgal_parse_version_h( "${CGAL_INSTALLATION_PACKAGE_DIR}/include/CGAL/version.h" "CGAL_VERSION_NAME" diff --git a/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h b/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h index 2bfe86e437a..a0778b4c18e 100644 --- a/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h +++ b/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h @@ -199,7 +199,7 @@ Monge_via_jet_fitting(); This operator performs all the computations. The \f$ N\f$ input points are given by the `InputIterator` parameters which value-type are `Data_kernel::Point_3`, `d` is the degree of the fitted -polynomial, `d'` is the degree of the expected Monge +polynomial, \c d' is the degree of the expected Monge coefficients. \pre \f$ N \geq N_{d}:=(d+1)(d+2)/2\f$, \f$ 1 \leq d' \leq\min(d,4) \f$. */ template Monge_form diff --git a/Jet_fitting_3/doc/Jet_fitting_3/Jet_fitting_3.txt b/Jet_fitting_3/doc/Jet_fitting_3/Jet_fitting_3.txt index 36d39ebf838..d89781711dc 100644 --- a/Jet_fitting_3/doc/Jet_fitting_3/Jet_fitting_3.txt +++ b/Jet_fitting_3/doc/Jet_fitting_3/Jet_fitting_3.txt @@ -77,13 +77,11 @@ the surface can locally be written as the graph of a bivariate function. Letting \f$ h.o.t.\f$ stand for higher order terms, one has : -\f[ -\begin{equation} +\f{equation}{ z(x,y)=J_{B,d}(x,y) + h.o.t. \ ; \quad J_{B,d}(x,y)=\ccSum{k=0}{d}{(\ccSum{i=0}{i}{ \frac{B_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!}})}. -\end{equation} -\f] +\f} The degree \f$ d\f$ polynomial \f$ J_{B,d}\f$ is the Taylor expansion of the function \f$ z\f$, and is called its \f$ d\f$-jet. Notice that a \f$ d\f$-jet contains @@ -343,12 +341,10 @@ The fitting process consists of finding the coefficients \f$ A_{i,j}\f$ of the degree \f$ d\f$ polynomial \anchor eqanswer -\f[ -\begin{equation} +\f{equation}{ J_{A,d}= \ccSum{k=0}{d}{(\ccSum{i=0}{k}{ \frac{A_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!}})}. -\end{equation} -\f] +\f} Denote \f$ p_i=(x_i,y_i,z_i), \ i=1,\ldots , N\f$ the coordinates of the sample points of \f$ P^+\f$. @@ -362,7 +358,7 @@ given by A = & (A_{0,0}, A_{1,0},A_{0,1}, \ldots , A_{0,d})^T \\ Z= &(z_1, z_2,\ldots , z_N)^T \\ M= &(1,x_i,\ y_i,\ \frac{x_i^2}{2},\ldots , -\ \frac{x_iy_i^{d-1}}{(d-1)!},\ \frac{y_i^d}{d!})_{i=1,...,N}\\ +\ \frac{x_iy_i^{d-1}}{(d-1)!},\ \frac{y_i^d}{d!})_{i=1,...,N} \f} The equations for interpolation become \f$ MA=Z\f$. For approximation, the @@ -395,8 +391,7 @@ The number \f$ r\f$, which is the number of non zero singular values, is strictly lower than \f$ N_d\f$ if the system is under constrained. In any case, the unique solution which minimize \f$ ||A||_2\f$ is given by: -\f[ -\begin{equation} +\f{equation}{ A= V \left( \begin{array}{cc} D_r^{-1} & 0_{N_d-r,\ r}\\ @@ -404,8 +399,7 @@ D_r^{-1} & 0_{N_d-r,\ r}\\ \end{array} \right) U^TZ. -\end{equation} -\f] +\f} One can provide the condition number of the matrix \f$ M\f$ (after preconditioning) which is the ratio of the maximal and the minimal @@ -491,22 +485,18 @@ We use explicit formula. The implicit equation of the fitted polynomial surface in the fitting-basis with origin the point \f$ (0,0,A_{0,0})\f$ is \f$ Q=0\f$ with -\f[ -\begin{equation} +\f{equation}{ Q=-w-A_{0,0} +\ccSum{i,j}{}{\frac{A_{i,j}u^iv^j}{i!j!}}. -\end{equation} -\f] +\f} The equation in the Monge basis is obtained by substituting \f$ (u,v,w)\f$ by \f$ P^T_{F\rightarrow M}(x,y,z)\f$. Denote \f$ f(x,y,z)=0\f$ this implicit equation. By definition of the Monge basis, we have locally (at \f$ (0,0,0)\f$) -\f[ -\begin{equation} +\f{equation}{ f(x,y,z)=0 \Leftrightarrow z=g(x,y) -\end{equation} -\f] +\f} and the Taylor expansion of \f$ g\f$ at \f$ (0,0)\f$ are the Monge coefficients sought. @@ -526,7 +516,7 @@ f_{0,0,1} ^{2}}} \\ &b_1=g_{2,1}=-{\frac {- f_{0,1,1} f_{2,0,0} + f_{2,1,0} f_{0,0,1} }{ f_{0,0,1} ^{2}}} \\ -& .... \\ +& .... \f} diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_io.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_io.h index bf7dacd2f97..765527e0a58 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_io.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_io.h @@ -40,7 +40,7 @@ _test_io_for(const T& t) } std::ifstream iFile(TEST_FILENAME, std::ios::in); - T u; + T u = t; iFile >> u; assert(!iFile.fail()); assert(u == t); diff --git a/Kernel_23/test/Kernel_23/issue_129.cpp b/Kernel_23/test/Kernel_23/issue_129.cpp index cb9ae603e25..06b6c674782 100644 --- a/Kernel_23/test/Kernel_23/issue_129.cpp +++ b/Kernel_23/test/Kernel_23/issue_129.cpp @@ -28,7 +28,7 @@ int main() { try { - CGAL::Point_3 a, b, c, d; + CGAL::Point_3 a(CGAL::ORIGIN), b(a), c(a), d(a); CGAL::squared_radius(a, b, c, d); } catch(...) {} return EXIT_SUCCESS; diff --git a/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Vector_d.h b/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Vector_d.h index d09974defaa..541a6f73f8a 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Vector_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Vector_d.h @@ -96,8 +96,8 @@ InputIterator first, InputIterator last); introduces a variable `v` of type `Vector_d` in dimension `d` initialized to the vector with homogeneous coordinates as defined by -`H = set [first,last)` and `D`: \f$ (\pmH[0], -\pmH[1], \ldots, \pmH[d-1], \pmD)\f$. The sign +`H = set [first,last)` and `D`: \f$ (\pm H_0, +\pm H_1, \ldots, \pm H_{D-1}, \pm H_D)\f$. The sign chosen is the sign of \f$ D\f$. \pre `D` is non-zero, the iterator range defines a \f$ d\f$-tuple of `RT`. diff --git a/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp b/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp index abb6cdf0909..9255e725f81 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp @@ -314,7 +314,9 @@ struct Tester // Test edge iterators //------------------------------------------------------- std::cout << "Test edge iterators\n"; - const Edge& edge_to_modify = *(c3t3.edges_in_complex_begin()); + typename C3t3::Edges_in_complex_iterator eit = c3t3.edges_in_complex_begin(); + assert(eit != c3t3.edges_in_complex_end()); + const Edge& edge_to_modify = *eit; c3t3.remove_from_complex(edge_to_modify); c3t3.add_to_complex(edge_to_modify,curve_index_bis); diff --git a/Mesher_level/include/CGAL/Double_map.h b/Mesher_level/include/CGAL/Double_map.h index 517cb223b13..7de1f9d66e6 100644 --- a/Mesher_level/include/CGAL/Double_map.h +++ b/Mesher_level/include/CGAL/Double_map.h @@ -40,8 +40,15 @@ #endif #ifdef CGAL_USE_BOOST_BIMAP +# if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable: 4996) +# endif #include #include +# if defined(BOOST_MSVC) +# pragma warning(pop) +# endif #endif namespace CGAL { diff --git a/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h b/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h index e7904529787..f0527bb932b 100644 --- a/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h +++ b/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h @@ -71,6 +71,23 @@ VVector convert(const CGAL::Vector_3& v) CGAL::to_double(v.y()), CGAL::to_double(v.z())); } +template +VVector normalize_and_convert(const CGAL::Vector_3& v) +{ + typename R::FT xa = CGAL::abs(v.x()); + typename R::FT ya = CGAL::abs(v.y()); + typename R::FT za = CGAL::abs(v.z()); + typename R::FT m = (std::max)((std::max)(xa,ya),za); + if (m==0) { + return VVector(0,0,0); + } else { + double xd = CGAL::to_double(v.x()/m); + double yd = CGAL::to_double(v.y()/m); + double zd = CGAL::to_double(v.z()/m); + VVector u(xd,yd,zd); + return u / CGAL_NTS sqrt(u*u) ; // normalize + } +} const double refinement_angle = 0.1; const double shrink_fac = 0.995; @@ -80,8 +97,7 @@ class Approximator { public: static VPoint approximate(const CGAL::Sphere_point& p) { - VVector v = convert(p-CGAL::ORIGIN); - v = v / CGAL_NTS sqrt(v*v) ; // normalize + VVector v = normalize_and_convert(p-CGAL::ORIGIN); return CGAL::ORIGIN+v; } diff --git a/Nef_S2/include/CGAL/Nef_polyhedron_S2.h b/Nef_S2/include/CGAL/Nef_polyhedron_S2.h index e4036996f70..c980fabd6f3 100644 --- a/Nef_S2/include/CGAL/Nef_polyhedron_S2.h +++ b/Nef_S2/include/CGAL/Nef_polyhedron_S2.h @@ -350,6 +350,11 @@ public: f->mark() == true); } + bool is_sphere() const + { + return is_plane(); + } + void extract_complement() { CGAL_NEF_TRACEN("extract complement"); if ( this->is_shared() ) clone_rep(); @@ -390,7 +395,7 @@ public: CGAL_forall_svertices(v,D) v->mark() = true; CGAL_forall_sedges(e,D) e->mark() = true; CGAL_forall_sfaces(f,D) f->mark() = false; - if ( D.has_shalfloop() ) D.shalfloop()->mark() = D.shalfoop()->twin() = true; + if ( D.has_shalfloop() ) D.shalfloop()->mark() = D.shalfoop()->twin()->mark() = true; D.simplify(); } diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Vector/array.h b/NewKernel_d/include/CGAL/NewKernel_d/Vector/array.h index 2a80ddf7e41..6f9aa5bb3f2 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Vector/array.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Vector/array.h @@ -70,6 +70,7 @@ template struct Array_vector { CGAL_assertion(d<=d_); //TODO: optimize for forward iterators Vector a; + CGAL_assume(f!=e); std::copy(f,e,a.begin()); return a; } diff --git a/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/Concepts/OptimalTransportationReconstructionTraits_2.h b/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/Concepts/OptimalTransportationReconstructionTraits_2.h index 04c9035a830..54551b8a64d 100644 --- a/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/Concepts/OptimalTransportationReconstructionTraits_2.h +++ b/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/Concepts/OptimalTransportationReconstructionTraits_2.h @@ -149,7 +149,6 @@ public: /// @{ Construct_point_2 construct_point_2_object(); Construct_vector_2 construct_vector_2_object(); - Construct_vector_2 construct_vector_2_object(); Construct_line_2 construct_line_2_object(); Construct_translated_point_2 construct_translated_point_2_object(); Construct_scaled_vector_2 construct_scaled_vector_2_object(); diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index 05b76b7b2ec..ef21d9dc89b 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -772,7 +772,6 @@ get_positions_with_vertex_at_extremity(const Bare_point& known_point, << " inverted order ? " << std::boolalpha << inverted_return_order << std::endl; #endif - CGAL_precondition(known_point != Bare_point()); CGAL_precondition(!domain_.is_loop(curve_index)); CGAL_precondition(extremity_points.size() == 2); diff --git a/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h index 31f5fb4b8cc..8aeb4874ea2 100644 --- a/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h @@ -33,6 +33,11 @@ namespace CGAL { +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4003) // not enough actual parameters for macro +#endif + // see CGAL_PRAGMA_DIAG_PUSH // see @@ -120,6 +125,10 @@ BOOST_PARAMETER_FUNCTION( CGAL_PRAGMA_DIAG_POP +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + } // namespace CGAL #endif // CGAL_OPTIMIZE_PERIODIC_3_MESH_3_H diff --git a/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h index c39ed5d3d6b..16e854200c5 100644 --- a/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h @@ -116,7 +116,6 @@ void project_points(C3T3& c3t3, const Weighted_point& vh_wp = c3t3.triangulation().point(vh); const Bare_point& vh_p = cp(vh_wp); const Bare_point new_point = helper.project_on_surface(vh, vh_p); - CGAL_assertion(new_point != Bare_point()); const FT sq_d = CGAL::squared_distance(new_point, vh_p); @@ -144,6 +143,11 @@ void project_points(C3T3& c3t3, } // namespace internal +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4003) // not enough actual parameters for macro +#endif + // see CGAL_PRAGMA_DIAG_PUSH // see @@ -181,6 +185,10 @@ BOOST_PARAMETER_FUNCTION( CGAL_PRAGMA_DIAG_POP +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + /** * @brief This function refines the mesh c3t3 wrt domain & criteria * diff --git a/Point_set_3/include/CGAL/Point_set_3/IO.h b/Point_set_3/include/CGAL/Point_set_3/IO.h index 287cf45e728..6c534f4c84c 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO.h @@ -156,7 +156,7 @@ private: virtual void assign (PLY_element& element, typename Point_set::Index index) { - Type t; + Type t{}; element.assign (t, m_name.c_str()); put(m_pmap, index, t); } diff --git a/Point_set_shape_detection_3/doc/Point_set_shape_detection_3/Concepts/ShapeDetectionTraits.h b/Point_set_shape_detection_3/doc/Point_set_shape_detection_3/Concepts/ShapeDetectionTraits.h index 44db0198c28..acbb8d24111 100644 --- a/Point_set_shape_detection_3/doc/Point_set_shape_detection_3/Concepts/ShapeDetectionTraits.h +++ b/Point_set_shape_detection_3/doc/Point_set_shape_detection_3/Concepts/ShapeDetectionTraits.h @@ -35,7 +35,7 @@ public: /// The circle type, only required if you want to detect tori typedef unspecified_type Circle_2; /// The 2D vector type, only required if you want to detect tori - typedef unspecified_type Vector_3; + typedef unspecified_type Vector_2; /// The number type of the Cartesian coordinates of types Point_3 typedef unspecified_type FT; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index 0dcfea83909..c7ba7288508 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -440,6 +440,58 @@ corefine_and_compute_boolean_operations( return CGAL::make_array(true, true, true, true); } + // handle case of empty meshes (isolated vertices are ignored) + if (faces(tm1).empty()) + { + if(faces(tm2).empty()) + { + for (int i=0; i<4; ++i) + if (output[i] != boost::none) + clear(*(*output[i])); + return CGAL::make_array(true, true, true, true); + } + // tm2 is not empty + if (output[Corefinement::UNION] != boost::none) + if (&tm2 != *output[Corefinement::UNION]) + copy_face_graph(tm2, + *(*output[Corefinement::UNION]), + parameters::vertex_point_map(vpm2), + parameters::vertex_point_map(*cpp11::get(vpm_out_tuple))); + if (output[Corefinement::INTERSECTION] != boost::none) + clear(*(*output[Corefinement::INTERSECTION])); + if (output[Corefinement::TM1_MINUS_TM2] != boost::none) + clear(*(*output[Corefinement::TM1_MINUS_TM2])); + if (output[Corefinement::TM2_MINUS_TM1] != boost::none) + if (&tm2 != *output[Corefinement::TM2_MINUS_TM1]) + copy_face_graph(tm2, + *(*output[Corefinement::TM2_MINUS_TM1]), + parameters::vertex_point_map(vpm2), + parameters::vertex_point_map(*cpp11::get(vpm_out_tuple))); + return CGAL::make_array(true, true, true, true); + } + else + if (faces(tm2).empty()) + { + // tm1 is not empty + if (output[Corefinement::UNION] != boost::none) + if (&tm1 != *output[Corefinement::UNION]) + copy_face_graph(tm1, + *(*output[Corefinement::UNION]), + parameters::vertex_point_map(vpm1), + parameters::vertex_point_map(*cpp11::get(vpm_out_tuple))); + if (output[Corefinement::INTERSECTION] != boost::none) + clear(*(*output[Corefinement::INTERSECTION])); + if (output[Corefinement::TM2_MINUS_TM1] != boost::none) + clear(*(*output[Corefinement::TM2_MINUS_TM1])); + if (output[Corefinement::TM1_MINUS_TM2] != boost::none) + if (&tm1 != *output[Corefinement::TM1_MINUS_TM2]) + copy_face_graph(tm1, + *(*output[Corefinement::TM1_MINUS_TM2]), + parameters::vertex_point_map(vpm1), + parameters::vertex_point_map(*cpp11::get(vpm_out_tuple))); + return CGAL::make_array(true, true, true, true); + } + // Edge is-constrained maps //for input meshes typedef typename boost::lookup_named_param_def < diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h index 7b79a6c68b5..2bfb06cdd15 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h @@ -115,13 +115,15 @@ void fill_pairs(const Halfedge& he, ++set_it->second.first; // increase the multiplicity if(set_it->second.first == 2) { + set_it->second.second = halfedge_pairs.size(); // set the id of the pair in the vector + halfedge_pairs.push_back( std::make_pair(set_it->first, he) ); if ( get(vpmap, source(he,pmesh))==get(vpmap, target(set_it->first,pmesh)) && get(vpmap, target(he,pmesh))==get(vpmap, source(set_it->first,pmesh)) ) { - set_it->second.second = halfedge_pairs.size(); // set the id of the pair in the vector - halfedge_pairs.push_back( std::make_pair(set_it->first, he) ); manifold_halfedge_pairs.push_back(true); } + else + manifold_halfedge_pairs.push_back(false); } else if ( set_it->second.first > 2 ) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp index 975c1dbee5b..f2cdf958b64 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp @@ -118,6 +118,20 @@ void test_surface_mesh_cc(const char* fname) std::cout << "OK\n"; } +void bug_test() +{ + typedef CGAL::Simple_cartesian K; + typedef K::Point_3 Point_3; + CGAL::Surface_mesh tm; + + CGAL::make_triangle(Point_3(0,0,0), Point_3(1,0,0), Point_3(0,1,0), tm); + CGAL::make_triangle(Point_3(0,0,0), Point_3(1,0,0), Point_3(0,1,0), tm); + CGAL::make_triangle(Point_3(0,0,0), Point_3(1,0,0), Point_3(0,1,0), tm); + CGAL::make_triangle(Point_3(0,0,0), Point_3(1,0,0), Point_3(0,1,0), tm); + + CGAL::Polygon_mesh_processing::stitch_borders(tm); +} + int main() { test_stitch_boundary_cycles("data_stitching/boundary_cycle.off"); @@ -150,5 +164,7 @@ int main() test_surface_mesh("data_stitching/non_manifold.off"); test_surface_mesh_cc("data_stitching/nm_cubes.off"); + bug_test(); + return EXIT_SUCCESS; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index 02d6b4919e1..72bc215411d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -1,5 +1,8 @@ #ifdef _MSC_VER # pragma warning(disable:4244) // conversion with loss of data +# pragma warning(disable:4996) // boost_1_65_1\boost/iostreams/positioning.hpp(96): + // warning C4996: 'std::fpos<_Mbstatet>::seekpos': warning STL4019: + // The member std::fpos::seekpos() is non-Standard #endif #include "Volume_plane.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp index 4896ba5ef3c..8b74d786c4a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp @@ -34,6 +34,8 @@ typedef Kernel::Point_3 Point; namespace euler = CGAL::Euler; using namespace CGAL::Three; +namespace params = CGAL::parameters; + class Q_DECL_EXPORT Basic_generator_plugin : public QObject, public Polyhedron_demo_plugin_helper @@ -548,7 +550,7 @@ void Basic_generator_plugin::generateSphere() typedef typename boost::property_map::type VPMap; if(precision !=0) CGAL::Subdivision_method_3::Sqrt3_subdivision(sphere, - precision); + params::number_of_iterations(precision)); VPMap vpmap = get(CGAL::vertex_point, sphere); //emplace the points back on the sphere BOOST_FOREACH(typename boost::graph_traits::vertex_descriptor vd, vertices(sphere)) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp index e2ad0cc4d68..3e72878e7ea 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp @@ -877,7 +877,7 @@ Polyhedron_demo_mean_curvature_flow_skeleton_plugin::createContractedItem(Scene_ { if(!item) return; - if(item->mcs == NULL) + if(item->mcs != NULL) delete item->mcs; double omega_H = ui->omega_H->value(); double omega_P = ui->omega_P->value(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp index c5c3067099e..2b54e27cf3e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp @@ -11,7 +11,10 @@ #include "Scene_surface_mesh_item.h" #include "SMesh_type.h" #include + using namespace CGAL::Three; +namespace params = CGAL::parameters; + class Polyhedron_demo_subdivision_methods_plugin : public QObject, public Polyhedron_demo_plugin_helper @@ -81,7 +84,7 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_loop(FaceGraphItem* item, time.start(); messages->information("Loop subdivision..."); QApplication::setOverrideCursor(Qt::WaitCursor); - CGAL::Subdivision_method_3::Loop_subdivision(*graph, nb_steps); + CGAL::Subdivision_method_3::Loop_subdivision(*graph, params::number_of_iterations(nb_steps)); messages->information(QString("ok (%1 ms)").arg(time.elapsed())); QApplication::restoreOverrideCursor(); item->invalidateOpenGLBuffers(); @@ -113,7 +116,7 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_catmullclark(FaceGraphIte time.start(); messages->information("Catmull-Clark subdivision..."); QApplication::setOverrideCursor(Qt::WaitCursor); - CGAL::Subdivision_method_3::CatmullClark_subdivision(*graph, nb_steps); + CGAL::Subdivision_method_3::CatmullClark_subdivision(*graph, params::number_of_iterations(nb_steps)); messages->information(QString("ok (%1 ms)").arg(time.elapsed())); QApplication::restoreOverrideCursor(); item->invalidateOpenGLBuffers(); @@ -143,7 +146,7 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_sqrt3(FaceGraphItem* item time.start(); messages->information("Sqrt-3 subdivision..."); QApplication::setOverrideCursor(Qt::WaitCursor); - CGAL::Subdivision_method_3::Sqrt3_subdivision(*graph, nb_steps); + CGAL::Subdivision_method_3::Sqrt3_subdivision(*graph, params::number_of_iterations(nb_steps)); messages->information(QString("ok (%1 ms)").arg(time.elapsed())); QApplication::restoreOverrideCursor(); item->invalidateOpenGLBuffers(); @@ -175,7 +178,7 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_doosabin(FaceGraphItem* i time.start(); messages->information("Doo-Sabin subdivision..."); QApplication::setOverrideCursor(Qt::WaitCursor); - CGAL::Subdivision_method_3::DooSabin_subdivision(*graph, nb_steps); + CGAL::Subdivision_method_3::DooSabin_subdivision(*graph, params::number_of_iterations(nb_steps)); messages->information(QString("ok (%1 ms)").arg(time.elapsed())); QApplication::restoreOverrideCursor(); item->invalidateOpenGLBuffers(); diff --git a/Principal_component_analysis/demo/Principal_component_analysis/Scene.cpp b/Principal_component_analysis/demo/Principal_component_analysis/Scene.cpp index 38a89df8036..129799a7aa3 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/Scene.cpp +++ b/Principal_component_analysis/demo/Principal_component_analysis/Scene.cpp @@ -225,7 +225,7 @@ void Scene::refine_loop() return; } std::cout << "Loop subdivision..."; - CGAL::Subdivision_method_3::Loop_subdivision(*m_pPolyhedron, 1); + CGAL::Subdivision_method_3::Loop_subdivision(*m_pPolyhedron); std::cout << "done (" << m_pPolyhedron->size_of_facets() << " facets)" << std::endl; } diff --git a/QP_solver/doc/QP_solver/CGAL/QP_solution.h b/QP_solver/doc/QP_solver/CGAL/QP_solution.h index b3b9776dbfe..c323a4fd101 100644 --- a/QP_solver/doc/QP_solver/CGAL/QP_solution.h +++ b/QP_solver/doc/QP_solver/CGAL/QP_solution.h @@ -495,9 +495,9 @@ then \f$\lambda_i\geq 0\f$ (\f$\lambda_i\leq 0\f$, respectively).

    • \f[ \begin{array}{llll} -&&\geq 0 & \mbox{if \f$u_j=\infty\f$} \\ +&&\geq 0 & \mbox{if $u_j=\infty$} \\ \qplambda^T A_j &\quad \\ -&&\leq 0 & \mbox{if \f$l_j=-\infty\f$.} +&&\leq 0 & \mbox{if $l_j=-\infty$}. \end{array} \f]
    • \f[\qplambda^T\qpb \quad<\quad \ccSum{j: \qplambda^TA_j <0}{}{ \qplambda^TA_j u_j } @@ -508,12 +508,12 @@ then \f$\lambda_i\geq 0\f$ (\f$\lambda_i\leq 0\f$, respectively). that there is a feasible solution \f$\qpx\f$. Then we get \f[ \begin{array}{lcll} -0 &\geq& \qplambda^T(A\qpx -\qpb) & \mbox{(by \f$A\qpx\qprel \qpb\f$ and 1.)} \\ +0 &\geq& \qplambda^T(A\qpx -\qpb) & \mbox{(by $A\qpx\qprel \qpb$ and 1.)} \\ &=& \ccSum{j: \qplambda^TA_j <0}{}{ \qplambda^TA_j x_j } \quad+\quad \ccSum{j: \qplambda^TA_j >0}{}{ \qplambda^TA_j x_j} - \qplambda^T \qpb \\ &\geq& \ccSum{j: \qplambda^TA_j <0}{}{ \qplambda^TA_j u_j } \quad+\quad \ccSum{j: \qplambda^TA_j >0}{}{ \qplambda^TA_j l_j} - \qplambda^T \qpb & -\mbox{(by \f$\qpl\leq \qpx \leq \qpu\f$ and 2.)} \\ +\mbox{(by $\qpl\leq \qpx \leq \qpu$ and 2.)} \\ &>& 0 & \mbox{(by 3.)}, \end{array} \f] @@ -547,9 +547,9 @@ solution of (QP). The program (QP) is unbounded if an \f$n\f$-vector then \f$(A\qpw)_i\leq 0\f$ (\f$(A\qpw)_i\geq 0, (A\qpw)_i=0\f$, respectively).
    • \f[ \begin{array}{llll} -&&\geq 0 & \mbox{if \f$l_j\f$ is finite} \\ +&&\geq 0 & \mbox{if $l_j$ is finite} \\ w_j &\quad \\ -&&\leq 0 & \mbox{if \f$u_j\f$ is finite.} +&&\leq 0 & \mbox{if $u_j$ is finite.} \end{array} \f]
    • \f$\qpw^TD\qpw=0\f$ and \f$(\qpc^T+2{\qpx^*}^TD)\qpw<0\f$. diff --git a/QP_solver/doc/QP_solver/Doxyfile.in b/QP_solver/doc/QP_solver/Doxyfile.in index b3330c4cb4e..5d8e054a416 100644 --- a/QP_solver/doc/QP_solver/Doxyfile.in +++ b/QP_solver/doc/QP_solver/Doxyfile.in @@ -1,3 +1,5 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - Linear and Quadratic Programming Solver" + +EXCLUDE = ${CGAL_PACKAGE_DOC_DIR}/fig_src diff --git a/QP_solver/doc/QP_solver/QP_solver.txt b/QP_solver/doc/QP_solver/QP_solver.txt index c7850995e6d..b61aa94727e 100644 --- a/QP_solver/doc/QP_solver/QP_solver.txt +++ b/QP_solver/doc/QP_solver/QP_solver.txt @@ -528,7 +528,7 @@ when we use the homogeneous representations of the points: if \f$ q_1,\ldots,q_n,q\in\mathbb{R}^{d+1}\f$ are homogeneous coordinates for \f$ p_1,\ldots,p_n,p\f$ with positive homogenizing coordinates \f$ h_1,\ldots,h_n,h\f$, we have -\f[$q_j = h_j \cdot (p_j \mid 1) \mbox{~for all $j$, and~} q = h \cdot +\f[q_j = h_j \cdot (p_j \mid 1) \mbox{~for all $j$, and~} q = h \cdot (p\mid 1).\f] Now, nonnegative \f$\lambda_1,\ldots,\lambda_n\f$ are suitable coefficients for a convex combination if and only if \f[\ccSum{j=1}{n}{~ \lambda_j(p_j \mid 1)} = (p\mid 1), \f] diff --git a/Ridges_3/doc/Ridges_3/Ridges_3.txt b/Ridges_3/doc/Ridges_3/Ridges_3.txt index ab9993f0822..8bbb53826c8 100644 --- a/Ridges_3/doc/Ridges_3/Ridges_3.txt +++ b/Ridges_3/doc/Ridges_3/Ridges_3.txt @@ -113,20 +113,16 @@ The Taylor expansion of \f$ k_1\f$ (resp. \f$ k_2\f$) along the max by \f$ x\f$ (resp. \f$ y\f$) are: \anchor eqtaylor_along_line -\f[ -\begin{equation} +\f{equation}{ k_1(x) = k_1 + b_0x + \frac{P_1}{2(k_1-k_2)}x^2 + ... , \quad \quad \quad P_1= 3b_1^2+(k_1-k_2)(c_0-3k_1^3). -\end{equation} -\f] +\f} \anchor eqtaylor_along_red_line -\f[ -\begin{equation} +\f{equation}{ k_2(y) = k_2 + b_3y + \frac{P_2}{2(k_2-k_1)}y^2 + ... , \quad \quad \quad P_2= 3b_2^2+(k_2-k_1)(c_4-3k_2^3). -\end{equation} -\f] +\f} Notice also that switching from one to the other of the two afore-mentioned coordinate systems reverts the sign of all the odd diff --git a/STL_Extension/include/CGAL/In_place_list.h b/STL_Extension/include/CGAL/In_place_list.h index face144af5e..25c8aed4c57 100644 --- a/STL_Extension/include/CGAL/In_place_list.h +++ b/STL_Extension/include/CGAL/In_place_list.h @@ -58,6 +58,10 @@ public: template < class T > class In_place_list_base { public: + In_place_list_base() + : next_link(NULL), prev_link(NULL) + {} + T* next_link; // forward pointer T* prev_link; // backwards pointer //friend class internal::In_place_list_iterator; diff --git a/Scripts/developer_scripts/git-show-content b/Scripts/developer_scripts/git-show-content index b72e089e828..3c96f2efa27 100755 --- a/Scripts/developer_scripts/git-show-content +++ b/Scripts/developer_scripts/git-show-content @@ -3,9 +3,24 @@ zmodload zsh/stat set -e -git=git +if [ "x$1" = "x--help" -o "x$1" = "x-h" ]; then + cat < /dev/null 2>&1 gzip -f bundle diff --git a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/sdg-filtered-traits.cpp b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/sdg-filtered-traits.cpp index 6945fb1c3a5..13e05eb5087 100644 --- a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/sdg-filtered-traits.cpp +++ b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/sdg-filtered-traits.cpp @@ -26,7 +26,8 @@ int main() assert( ifs ); SDG2 sdg; - SDG2::Site_2 site; + SDG2::Site_2 site = + SDG2::Site_2::construct_site_2(K::Point_2(CGAL::ORIGIN)); // read the sites and insert them in the segment Delaunay graph while ( ifs >> site ) { diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/include/test_info.h b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/include/test_info.h index 3db6956d14b..9ba280559d7 100644 --- a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/include/test_info.h +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/include/test_info.h @@ -17,7 +17,8 @@ bool test_info(SDG& sdg, const char* fname) assert( ifs ); sdg.clear(); - typename SDG::Site_2 site; + typename SDG::Site_2 site = + SDG::Site_2::construct_site_2(typename SDG::Point_2(CGAL::ORIGIN)); // read the sites and insert them in the segment Delaunay graph int info_id = 1; diff --git a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-filtered-traits-linf.cpp b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-filtered-traits-linf.cpp index 1b1777855a0..b7f9642ab6b 100644 --- a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-filtered-traits-linf.cpp +++ b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-filtered-traits-linf.cpp @@ -30,7 +30,8 @@ int main( int argc, char *argv[] ) assert( ifs ); SDG2 sdg; - SDG2::Site_2 site; + SDG2::Site_2 site = + SDG2::Site_2::construct_site_2(Rep::Point_2(CGAL::ORIGIN)); // read the sites and insert them in the segment Delaunay graph while ( ifs >> site ) { diff --git a/Spatial_searching/doc/Spatial_searching/CGAL/Splitters.h b/Spatial_searching/doc/Spatial_searching/CGAL/Splitters.h index 5f6fe92cb62..19a379dfad3 100644 --- a/Spatial_searching/doc/Spatial_searching/CGAL/Splitters.h +++ b/Spatial_searching/doc/Spatial_searching/CGAL/Splitters.h @@ -160,7 +160,7 @@ namespace CGAL { Implements the midpoint of max spread splitting rule. A rectangle is cut through \f$ (\mathrm{Mind}+\mathrm{Maxd})/2\f$ orthogonal -to the dimension with the maximum point spread \f$ [\mathrm{Mind},\matrm{Maxd}]\f$. +to the dimension with the maximum point spread \f$ [\mathrm{Mind},\mathrm{Maxd}]\f$. \cgalHeading{Parameters} diff --git a/Spatial_searching/include/CGAL/Kd_tree_rectangle.h b/Spatial_searching/include/CGAL/Kd_tree_rectangle.h index 1eb6efad609..042dbb088f0 100644 --- a/Spatial_searching/include/CGAL/Kd_tree_rectangle.h +++ b/Spatial_searching/include/CGAL/Kd_tree_rectangle.h @@ -166,6 +166,7 @@ namespace CGAL { inline FT min_coord(int i) const { + CGAL_assume(i -void CatmullClark_subdivision(PolygonMesh& pmesh, int step = 1) { +CGAL_DEPRECATED_MSG("you are using the deprecated API of CatmullClark_subdivision(), please update your code") +void CatmullClark_subdivision(PolygonMesh& pmesh, int step) { PQQ(pmesh, CatmullClark_mask_3(&pmesh, get(vertex_point,pmesh)), step); } +#endif #endif /*! @@ -138,14 +141,22 @@ void CatmullClark_subdivision(PolygonMesh& pmesh, const NamedParameters& np) { internal::PQQ_1step(pmesh, vpm, mask); } +template +void CatmullClark_subdivision(PolygonMesh& pmesh) +{ + CatmullClark_subdivision(pmesh, CGAL::parameters::all_default()); +} // ----------------------------------------------------------------------------- #ifndef DOXYGEN_RUNNING // backward compatibility +#ifndef CGAL_NO_DEPRECATED_CODE template -void Loop_subdivision(PolygonMesh& pmesh, int step = 1) { +CGAL_DEPRECATED_MSG("you are using the deprecated API of Loop_subdivision(), please update your code") +void Loop_subdivision(PolygonMesh& pmesh, int step) { PTQ(pmesh, Loop_mask_3(&pmesh, get(vertex_point,pmesh)) , step); } +#endif #endif /*! @@ -183,15 +194,23 @@ void Loop_subdivision(PolygonMesh& pmesh, const NamedParameters& np) { internal::PTQ_1step(pmesh, vpm, mask); } +template +void Loop_subdivision(PolygonMesh& pmesh) +{ + Loop_subdivision(pmesh, CGAL::parameters::all_default()); +} // ----------------------------------------------------------------------------- #ifndef DOXYGEN_RUNNING // backward compatibility +#ifndef CGAL_NO_DEPRECATED_CODE template -void DooSabin_subdivision(PolygonMesh& pmesh, int step = 1) { +CGAL_DEPRECATED_MSG("you are using the deprecated API of DooSabin_subdivision(), please update your code") +void DooSabin_subdivision(PolygonMesh& pmesh, int step) { DQQ(pmesh, DooSabin_mask_3(&pmesh, get(vertex_point, pmesh)), step); } #endif +#endif /*! * @@ -227,16 +246,24 @@ void DooSabin_subdivision(PolygonMesh& pmesh, const NamedParameters& np) { for(unsigned int i = 0; i < step; i++) internal::DQQ_1step(pmesh, vpm, mask); } - + +template +void DooSabin_subdivision(PolygonMesh& pmesh) +{ + DooSabin_subdivision(pmesh, CGAL::parameters::all_default()); +} // ----------------------------------------------------------------------------- #ifndef DOXYGEN_RUNNING // backward compatibility +#ifndef CGAL_NO_DEPRECATED_CODE template -void Sqrt3_subdivision(PolygonMesh& pmesh, int step = 1) { +CGAL_DEPRECATED_MSG("you are using the deprecated API of Sqrt3_subdivision(), please update your code") +void Sqrt3_subdivision(PolygonMesh& pmesh, int step) { Sqrt3(pmesh, Sqrt3_mask_3(&pmesh, get(vertex_point,pmesh)), step); } #endif +#endif /*! * @@ -277,7 +304,12 @@ void Sqrt3_subdivision(PolygonMesh& pmesh, const NamedParameters& np) { for(unsigned int i = 0; i < step; i++) internal::Sqrt3_1step(pmesh, vpm, mask, (i%2==1)); } - + +template +void Sqrt3_subdivision(PolygonMesh& pmesh) +{ + Sqrt3_subdivision(pmesh, CGAL::parameters::all_default()); +} /// @} } // namespace Subdivision_method_3 diff --git a/Subdivision_method_3/test/Subdivision_method_3/test_Subdivision_method_3.cpp b/Subdivision_method_3/test/Subdivision_method_3/test_Subdivision_method_3.cpp index 7b0e8f399e5..b467aea5e90 100644 --- a/Subdivision_method_3/test/Subdivision_method_3/test_Subdivision_method_3.cpp +++ b/Subdivision_method_3/test/Subdivision_method_3/test_Subdivision_method_3.cpp @@ -57,7 +57,7 @@ void test_Subdivision_surface_3() { Polyhedron P; mesh >> P; - Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); + Subdivision_method_3::CatmullClark_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -68,7 +68,7 @@ void test_Subdivision_surface_3() { Polyhedron P; mesh >> P; - Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); + Subdivision_method_3::CatmullClark_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -80,7 +80,7 @@ void test_Subdivision_surface_3() { Polyhedron P; mesh >> P; - Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); + Subdivision_method_3::Loop_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -91,7 +91,7 @@ void test_Subdivision_surface_3() { Polyhedron P; mesh >> P; - Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); + Subdivision_method_3::Loop_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -102,7 +102,7 @@ void test_Subdivision_surface_3() { Polyhedron P; mesh >> P; - Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); + Subdivision_method_3::DooSabin_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -113,7 +113,7 @@ void test_Subdivision_surface_3() { Polyhedron P; mesh >> P; - Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); + Subdivision_method_3::Sqrt3_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } } @@ -129,7 +129,7 @@ void test_Subdivision_surface_3_SM() { Polyhedron P; mesh >> P; - Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); + Subdivision_method_3::CatmullClark_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -140,7 +140,7 @@ void test_Subdivision_surface_3_SM() { Polyhedron P; mesh >> P; - Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); + Subdivision_method_3::CatmullClark_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -152,7 +152,7 @@ void test_Subdivision_surface_3_SM() { Polyhedron P; mesh >> P; - Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); + Subdivision_method_3::Loop_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -163,7 +163,7 @@ void test_Subdivision_surface_3_SM() { Polyhedron P; mesh >> P; - Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); + Subdivision_method_3::Loop_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -174,7 +174,7 @@ void test_Subdivision_surface_3_SM() { Polyhedron P; mesh >> P; - Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); + Subdivision_method_3::DooSabin_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P, true)); } @@ -185,7 +185,7 @@ void test_Subdivision_surface_3_SM() { Polyhedron P; mesh >> P; - Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); + Subdivision_method_3::DooSabin_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -196,7 +196,7 @@ void test_Subdivision_surface_3_SM() { Polyhedron P; mesh >> P; - Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); + Subdivision_method_3::Sqrt3_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } @@ -207,7 +207,7 @@ void test_Subdivision_surface_3_SM() { Polyhedron P; mesh >> P; - Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); + Subdivision_method_3::Sqrt3_subdivision(P); assert(CGAL::is_valid_polygon_mesh(P)); } } @@ -284,7 +284,7 @@ void test_Subdivision_surface_3_SM_NP() { Polyhedron P; mesh >> P; - Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); + Subdivision_method_3::DooSabin_subdivision(P,Subdivision_method_3::parameters::number_of_iterations(TEST_DEPTH)); assert(CGAL::is_valid_polygon_mesh(P)); } diff --git a/Subdivision_method_3/test/Subdivision_method_3/test_deprecated_Subdivision_method_3.cpp b/Subdivision_method_3/test/Subdivision_method_3/test_deprecated_Subdivision_method_3.cpp new file mode 100644 index 00000000000..c8a6c85c632 --- /dev/null +++ b/Subdivision_method_3/test/Subdivision_method_3/test_deprecated_Subdivision_method_3.cpp @@ -0,0 +1,362 @@ +#include +// ============================================================================ +// +// Copyright (c) 2005-2006, 2017 Le-Jeng Shiue +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : $CGAL_Revision: $ +// release_date : $CGAL_Date: $ +// +// file : test/Subdivision_method_3/test_Subdivision_method_3.C +// package : Subdivision_method_3 +// chapter : Subdivision Method +// +// revision : $Id$ +// revision_date : $Date$ +// +// author(s) : Le-Jeng Shiue +// +// Test subdivision methods +// ============================================================================ + +#include +#include +#include + +#include + +#include +#include +#include + +using namespace std; +using namespace CGAL; + +#define TEST_DEPTH (3) + +//#define TESTMESH_GENERAL "data/??.off" + +#define TESTMESH_QUAD "data/corner.off" +#define TESTMESH_QUAD_OPEN "data/corner_with_hole.off" + +#define TESTMESH_TRI "data/quint_tris.off" +#define TESTMESH_TRI_OPEN "data/nefertiti.off" + +void test_Subdivision_surface_3() { + typedef CGAL::Simple_cartesian Kernel; + typedef CGAL::Polyhedron_3 Polyhedron; + + // test Catmull-Clark subdivision on quad mesh + { + ifstream mesh(TESTMESH_QUAD); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Catmull-Clark subdivision on 'opened' quad mesh + { + ifstream mesh(TESTMESH_QUAD_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + + // test Loop subdivision on tri mesh + { + ifstream mesh(TESTMESH_TRI); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Loop subdivision on 'opened' tri mesh + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Doo-Sabin subdivision on general mesh + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Sqrt-3 subdivision on tri mesh + { + ifstream mesh(TESTMESH_TRI); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } +} + +void test_Subdivision_surface_3_SM() { + typedef CGAL::Simple_cartesian Kernel; + typedef CGAL::Surface_mesh Polyhedron; + + // test Catmull-Clark subdivision on quad mesh + { + ifstream mesh(TESTMESH_QUAD); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Catmull-Clark subdivision on 'opened' quad mesh + { + ifstream mesh(TESTMESH_QUAD_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + + // test Loop subdivision on tri mesh + { + ifstream mesh(TESTMESH_TRI); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Loop subdivision on 'opened' tri mesh + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Doo-Sabin subdivision on general mesh + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P, true)); + } + + // test Doo-Sabin subdivision on 'opened' quad mesh + { + ifstream mesh(TESTMESH_QUAD_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Sqrt-3 subdivision on tri mesh + { + ifstream mesh(TESTMESH_TRI); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Sqrt-3 subdivision on 'opened' tri mesh + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } +} + +void test_Subdivision_surface_3_SM_NP() { + typedef CGAL::Simple_cartesian Kernel; + typedef CGAL::Surface_mesh Polyhedron; + + // test Catmull-Clark subdivision on quad mesh + { + ifstream mesh(TESTMESH_QUAD); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::CatmullClark_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) + .number_of_iterations(TEST_DEPTH)); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Catmull-Clark subdivision on 'opened' quad mesh + { + ifstream mesh(TESTMESH_QUAD_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::CatmullClark_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) + .number_of_iterations(TEST_DEPTH)); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + + // test Loop subdivision on tri mesh + { + ifstream mesh(TESTMESH_TRI); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Loop_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) + .number_of_iterations(TEST_DEPTH)); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Loop subdivision on 'opened' tri mesh + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Loop_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) + .number_of_iterations(TEST_DEPTH)); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Doo-Sabin subdivision on 'opened' tri mesh + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::DooSabin_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) + .number_of_iterations(TEST_DEPTH)); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Doo-Sabin subdivision on 'opened' quad mesh + { + ifstream mesh(TESTMESH_QUAD_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Sqrt-3 subdivision on tri mesh + { + ifstream mesh(TESTMESH_TRI); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Sqrt3_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) + .number_of_iterations(TEST_DEPTH)); + + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Sqrt-3 subdivision on 'opened' tri mesh + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + Subdivision_method_3::Sqrt3_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) + .number_of_iterations(TEST_DEPTH)); + + std::ofstream out("out_0.off"); + out << P; + + assert(CGAL::is_valid_polygon_mesh(P)); + } + + // test Sqrt-3 subdivision on 'opened' tri mesh & with external property map + { + ifstream mesh(TESTMESH_TRI_OPEN); + + Polyhedron P; + mesh >> P; + + typedef Kernel::Point_3 Point; + typedef Kernel::Vector_3 Vector; + + typedef boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef boost::unordered_map Point_pmap; + typedef boost::associative_property_map APM; + typedef boost::property_map::type VPM; + + Point_pmap um; + APM apm(um); + VPM vpm = get(vertex_point, P); + + // some arbitrary new coordinates (different from the internal vpm) + BOOST_FOREACH(vertex_descriptor vd, vertices(P)) { + boost::property_traits::reference pt = get(vpm, vd); + Vector v = pt - Point(0., 0., -3.); + put(apm, vd, pt + 0.5*v); + } + + Subdivision_method_3::Sqrt3_subdivision(P, + Subdivision_method_3::parameters::vertex_point_map(apm) + .number_of_iterations(TEST_DEPTH)); + + assert(CGAL::is_valid_polygon_mesh(P)); + } +} + +int main() { + test_Subdivision_surface_3(); + test_Subdivision_surface_3_SM(); + test_Subdivision_surface_3_SM_NP(); + std::cerr << "Done" << std::endl; + return 0; +} +// EOF // diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index fe4b88c0899..fa336e2f9da 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -2159,10 +2159,18 @@ private: //------------------------------------------------------- private data std::string off; is >> sm_skip_comments; is >> off; - CGAL_assertion( (off == "OFF") || (off == "COFF") || (off == "NOFF") || (off == "CNOFF")); - + if(! ( + (off == "OFF") || (off == "COFF") || (off == "NOFF") || (off == "CNOFF") + ) + ) + { + is.setstate(std::ios::failbit); + return false; + } is >> n >> f >> e; - + if(!is){ + return false; + } sm.reserve(sm.num_vertices()+n, sm.num_faces()+2*f, sm.num_edges()+e); std::vector vertexmap(n); P p; @@ -2219,6 +2227,10 @@ private: //------------------------------------------------------- private data for(int i=0; i < f; i++){ is >> sm_skip_comments; is >> d; + if(!is){ + sm.clear(); + return false; + } vr.resize(d); for(std::size_t j=0; j> vi; @@ -2555,6 +2567,11 @@ void Surface_mesh

      :: collect_garbage(F& funct) { + if (!has_garbage()) + { + return; + } + int i, i0, i1, nV(num_vertices()), nE(num_edges()), diff --git a/Surface_mesh_deformation/doc/Surface_mesh_deformation/Surface_mesh_deformation.txt b/Surface_mesh_deformation/doc/Surface_mesh_deformation/Surface_mesh_deformation.txt index b5df4208507..9368c7905a8 100644 --- a/Surface_mesh_deformation/doc/Surface_mesh_deformation/Surface_mesh_deformation.txt +++ b/Surface_mesh_deformation/doc/Surface_mesh_deformation/Surface_mesh_deformation.txt @@ -255,12 +255,10 @@ The Laplacian representation (referred to as Laplace coordinatesencode the local neighborhood of a vertex in the surface mesh. In this representation, a vertex \f$ \mathbf{v}_i \f$ is associated a 3D vector defined as: -\f[ -\begin{equation} +\f{equation}{ L(\mathbf{v}_i) = \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} w_{ij}(\mathbf{v}_i - \mathbf{v}_j), \label{eq:lap_open} -\end{equation} -\f] +\f} where: - \f$N(\mathbf{v}_i)\f$ denotes the set of vertices adjacent to \f$\mathbf{v}_i\f$; @@ -282,12 +280,10 @@ Laplacian representation of \f$ v_i \f$ with uniform weights: the red square ver Considering a surface mesh with \f$n\f$ vertices, it is possible to define its Laplacian representation \f$\Delta\f$ as a \f$n \times 3\f$ matrix: -\f[ -\begin{equation} +\f{equation}{ \mathbf{L}\mathbf{V} = \Delta, \label{eq:lap_system} -\end{equation} -\f] +\f} where: - \f$\mathbf{L}\f$ is a \f$n \times n\f$ sparse matrix, referred to as the Laplacian matrix. Its elements \f$ m_{ij} \f$, \f$i,j \in \{1 \dots n\} \f$ are defined as follows: @@ -313,8 +309,7 @@ This package supports hard constraints, that is, target positions of control ver Given a surface mesh deformation system with a ROI made of \f$ n \f$ vertices and \f$ k \f$ control vertices, we consider the following linear system: -\f[ -\begin{equation} +\f{equation}{ \left[ \begin{array}{ccc} \mathbf{L}_f\\ @@ -329,8 +324,7 @@ Given a surface mesh deformation system with a ROI made of \f$ n \f$ vertices an \end{array} \right], \label{eq:lap_energy_system} -\end{equation} -\f] +\f} where: - \f$\mathbf{V}\f$ is a \f$n \times 3\f$ matrix denoting the unknowns of the system that represent the vertex coordinates after deformation. The system is built so that the \f$ k \f$ last rows correspond to the control vertices. @@ -348,14 +342,12 @@ preserves the Laplacian representation of the surface mesh restricted to the unc Given a surface mesh \f$M\f$ with \f$ n \f$ vertices \f$ \{\mathbf{v}_i\} i \in \{1 \dots n \} \f$ and some deformation constraints, we consider the following energy function: -\f[ -\begin{equation} +\f{equation}{ \sum_{\mathbf{v}_i \in M} \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} w_{ij} \left\| (\mathbf{v}'_i - \mathbf{v}'_j) - \mathbf{R}_i(\mathbf{v}_i - \mathbf{v}_j) \right\|^2, \label{eq:arap_energy} -\end{equation} -\f] +\f} where: - \f$\mathbf{R}_i\f$ is a \f$ 3 \times 3 \f$ rotation matrix @@ -387,12 +379,10 @@ Each such term of the energy is minimized by using a two-step optimization appro In the first step, the positions of the vertices are considered as fixed so that the rotation matrices are the only unknowns. For the vertex \f$\mathbf{v}_i\f$, we consider the covariance matrix \f$\mathbf{S}_i\f$: -\f[ -\begin{equation} +\f{equation}{ \mathbf{S}_i = \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} w_{ij} (\mathbf{v}_i - \mathbf{v}_j)(\mathbf{v}'_i - \mathbf{v}'_j)^T, \label{eq:cov_matrix} -\end{equation} -\f] +\f} It was shown \cgalCite{Sorkine2009LeastSquaresRigid} that minimizing the energy contribution of \f$\mathbf{v}_i\f$ in Eq. \f$\eqref{eq:arap_energy}\f$ is equivalent to maximizing the trace of the matrix @@ -404,13 +394,11 @@ In the second step, the rotation matrices are substituted into the partial deriv with respect to \f$\mathbf{v}'_i\f$. Assuming the weights are symmetric, setting the derivative to zero results in the following equation: -\f[ -\begin{equation} +\f{equation}{ \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} w_{ij}(\mathbf{v}'_i - \mathbf{v}'_j) = \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} w_{ij} \frac{(\mathbf{R}_i + \mathbf{R}_j)}{2} (\mathbf{v}_i - \mathbf{v}_j). \label{eq:lap_ber} -\end{equation} -\f] +\f} The left-hand side of this equation corresponds to the one of Eq.\f$\eqref{eq:lap_open}\f$, and we can set \f$\Delta\f$ to be the right-hand side. @@ -428,13 +416,11 @@ The original algorithm \cgalCite{Sorkine2007AsRigidAs} we described assumes that - the weight between two vertices is symmetric. In order to support asymmetric weights in our implementation, we slightly change Eq. \f$\eqref{eq:lap_ber}\f$ to: -\f[ -\begin{equation} +\f{equation}{ \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} (w_{ij} + w_{ji})(\mathbf{v}'_i - \mathbf{v}'_j) = \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} (w_{ij}\mathbf{R}_i + w_{ji}\mathbf{R}_j)(\mathbf{v}_i - \mathbf{v}_j). \label{eq:lap_ber_asym} -\end{equation} -\f] +\f} - The energy contribution of each vertex is positive. If the weight between two vertices is always positive, this is always the case. However, when using the cotangent weighting scheme (the default in our implementation), if the sum of the angles opposite to an edge is greater than \f$ \pi \f$, @@ -448,14 +434,12 @@ A method minimizing another energy function is described next to avoid the latte The elastic energy function proposed by \cgalCite{Chao2010SimpleGeomModel} additionally takes into account all the opposite edges in the facets incident to a vertex. The energy function to minimize becomes: -\f[ -\begin{equation} +\f{equation}{ \sum_{\mathbf{v}_i \in M} \sum_{(\mathbf{v}_j, \mathbf{v}_k) \in E(\mathbf{v}_i)} w_{jk} \left\| (\mathbf{v}'_j - \mathbf{v}'_k) - \mathbf{R}_i(\mathbf{v}_j - \mathbf{v}_k) \right\|^2, \label{eq:arap_energy_rims} -\end{equation} -\f] +\f} where \f$E(\mathbf{v}_i)\f$ consists of the set of edges incident to \f$\mathbf{v}_i\f$ (the spokes) and the set of edges in the link (the rims) of \f$\mathbf{v}_i\f$ in the surface mesh \f$M\f$ @@ -470,23 +454,19 @@ The method to get the new positions of the unconstrained vertices is similar to method explained in \ref SMD_Overview_ARAP. For the first step, the Eq. \f$\eqref{eq:cov_matrix}\f$ is modified to take into account the edges in \f$E(\mathbf{v}_i)\f$: -\f[ -\begin{equation} +\f{equation}{ \mathbf{S}_i = \sum_{(\mathbf{v}_j, \mathbf{v}_k) \in E(\mathbf{v}_i)} w_{jk} (\mathbf{v}_j - \mathbf{v}_k)(\mathbf{v}'_j - \mathbf{v}'_k)^T, \label{eq:cov_matrix_sr} -\end{equation} -\f] +\f} For the second step, setting partial derivative of Eq. \f$\eqref{eq:arap_energy_rims}\f$ to zero with respect to \f$\mathbf{v}_i\f$ gives the following equation: -\f[ -\begin{equation} +\f{equation}{ \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} (w_{ij} + w_{ji})(\mathbf{v}'_i - \mathbf{v}'_j) = \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} \frac{w_{ij}(\mathbf{R}_i + \mathbf{R}_j + \mathbf{R}_m) + w_{ji}(\mathbf{R}_i + \mathbf{R}_j + \mathbf{R}_n)}{3} (\mathbf{v}_i - \mathbf{v}_j). \label{eq:lap_ber_rims} -\end{equation} -\f] +\f} where \f$\mathbf{R}_m\f$ and \f$\mathbf{R}_n\f$ are the rotation matrices of the vertices \f$\mathbf{v}_m\f$, \f$\mathbf{v}_n\f$ which are the opposite vertices of the edge \f$\mathbf{v}_i \mathbf{v}_j\f$ @@ -504,14 +484,12 @@ The implementation in this package uses the cotangent weights by default (negati \subsection SMD_Overview_SRE_ARAP Smoothed Rotation Enhanced As-Rigid-As Possible (SR_ARAP) Deformation Using 1-ring elements, SR-ARAP adds a bending element to Eq. \f$\eqref{eq:arap_energy}\f$: -\f[ -\begin{equation} +\f{equation}{ \sum_{\mathbf{v}_i \in M} \sum_{\mathbf{v}_j \in N(\mathbf{v}_i)} w_{ij} \left\| (\mathbf{v}'_i - \mathbf{v}'_j) - \mathbf{R}_i(\mathbf{v}_i - \mathbf{v}_j) \right\|^2 + \alpha A \left\| \mathbf{R}_i - \mathbf{R}_j \right\|^2_F \label{eq:sre_arap_energy} -\end{equation} -\f] +\f} where - \f$\alpha=0.02\f$ is a weighting coefficient. diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index cc403bb788a..ba18f094c0b 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -93,8 +93,8 @@ template < class Refs, class Point, class ID, class vertex_descriptor> struct Skel_HDS_vertex_type : public HalfedgeDS_vertex_max_base_with_id { typedef HalfedgeDS_vertex_max_base_with_id Base; - Skel_HDS_vertex_type() : Base (), is_fixed(false) {} - Skel_HDS_vertex_type( Point const& p) : Base(p), is_fixed(false) {} + Skel_HDS_vertex_type() : Base (), pole(ORIGIN), is_fixed(false) {} + Skel_HDS_vertex_type( Point const& p) : Base(p), pole(ORIGIN), is_fixed(false) {} std::vector vertices; Point pole; bool is_fixed; diff --git a/Triangulation_2/include/CGAL/Triangulation_line_face_circulator_2.h b/Triangulation_2/include/CGAL/Triangulation_line_face_circulator_2.h index 12d7220fdbc..2572e4fdbc2 100644 --- a/Triangulation_2/include/CGAL/Triangulation_line_face_circulator_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_line_face_circulator_2.h @@ -266,7 +266,7 @@ Triangulation_line_face_circulator_2(const Point& pp, int in; switch(pqs) { case LEFT_TURN: - *this = Line_face_circulator(); + pos = Face_handle(); return; case COLLINEAR: fn = fc->neighbor(i); @@ -306,7 +306,7 @@ Triangulation_line_face_circulator_2(const Point& pp, // if line (p,q) does not intersect the convex hull in an edge // the circulator has a singular value - *this=Line_face_circulator(); + pos=Face_handle(); return; } @@ -368,7 +368,7 @@ Triangulation_line_face_circulator_2(const Point& pp, return; } else { // singular value - *this = Line_face_circulator(); + pos=Face_handle(); return; } case LEFT_TURN : diff --git a/Visibility_2/doc/Visibility_2/visibility_2.txt b/Visibility_2/doc/Visibility_2/visibility_2.txt index 34fa2d8674e..c72f5d03f29 100644 --- a/Visibility_2/doc/Visibility_2/visibility_2.txt +++ b/Visibility_2/doc/Visibility_2/visibility_2.txt @@ -129,7 +129,6 @@ does not require preprocessing is advantageous. The following example shows how to obtain the regularized and non-regularized visibility regions. \cgalFigureBegin{simple_example, simple_example.png} - The visibility region of \f$ q \f$ in a simple polygon: (1) non-regularized visibility; and (2) regularized visibility. \cgalFigureEnd \cgalExample{Visibility_2/simple_polygon_visibility_2.cpp}