From 1dbc088459e5a65ead49dd29cf732f107020b76f Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 20 Jun 2019 16:51:53 +0200 Subject: [PATCH] Update licences; move undocumented files to internal (both directory and namespace) --- .../include/CGAL/Face_graph_wrapper.h | 6 +- .../CGAL/license/Surface_mesh_topology.h | 63 ++++ .../basic_example_surface_mesh_topology.cpp | 13 +- .../basic_example_torus.cpp | 11 +- .../map_2_constructor.cpp | 8 +- .../open_path_homotopy.cpp | 14 +- .../Surface_mesh_topology/path_homotopy.cpp | 16 +- .../path_homotopy_with_symbols.cpp | 9 +- .../path_homotopy_with_symbols_2.cpp | 6 +- ...e_mesh_topology_with_sm_and_polyhedron.cpp | 12 +- .../include/CGAL/Curves_on_surface_topology.h | 34 ++- .../include/CGAL/Path_on_surface.h | 22 +- .../include/CGAL/Polygonal_schema.h | 282 +++++++++--------- .../include/CGAL/Polygonal_schema_min_items.h | 14 +- .../internal}/Path_generators.h | 25 +- .../internal}/Path_on_surface_with_rle.h | 17 +- .../include/CGAL/draw_face_graph_with_paths.h | 25 +- .../Creation_of_test_cases_for_paths.h | 4 +- .../test/Surface_mesh_topology/path_tests.cpp | 21 +- .../path_with_rle_deformation_tests.cpp | 38 +-- .../Surface_mesh_topology/test_homotopy.cpp | 26 +- 21 files changed, 388 insertions(+), 278 deletions(-) create mode 100644 Installation/include/CGAL/license/Surface_mesh_topology.h rename Surface_mesh_topology/include/CGAL/{ => Surface_mesh_topology/internal}/Path_generators.h (91%) rename Surface_mesh_topology/include/CGAL/{ => Surface_mesh_topology/internal}/Path_on_surface_with_rle.h (99%) diff --git a/Combinatorial_map/include/CGAL/Face_graph_wrapper.h b/Combinatorial_map/include/CGAL/Face_graph_wrapper.h index 189c0a4e668..566c1fa2513 100644 --- a/Combinatorial_map/include/CGAL/Face_graph_wrapper.h +++ b/Combinatorial_map/include/CGAL/Face_graph_wrapper.h @@ -795,7 +795,8 @@ protected: }; template - struct Get_map, Map> + struct Get_map, Map> { typedef Map type; typedef const Map& storage_type; @@ -814,7 +815,8 @@ protected: }; template - struct Get_map, Map> + struct Get_map, Map> { typedef Map type; typedef const Map& storage_type; diff --git a/Installation/include/CGAL/license/Surface_mesh_topology.h b/Installation/include/CGAL/license/Surface_mesh_topology.h new file mode 100644 index 00000000000..9be9986b569 --- /dev/null +++ b/Installation/include/CGAL/license/Surface_mesh_topology.h @@ -0,0 +1,63 @@ +// Copyright (c) 2016 GeometryFactory SARL (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// Author(s) : Andreas Fabri +// +// Warning: this file is generated, see include/CGAL/licence/README.md + +#ifndef CGAL_LICENSE_SURFACE_MESH_TOPOLOGY_H +#define CGAL_LICENSE_SURFACE_MESH_TOPOLOGY_H + +#include +#include + +#ifdef CGAL_SURFACE_MESH_TOPOLOGY_COMMERCIAL_LICENSE + +# if CGAL_SURFACE_MESH_TOPOLOGY_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE + +# if defined(CGAL_LICENSE_WARNING) + + CGAL_pragma_warning("Your commercial license for CGAL does not cover " + "this release of the Surface Mesh Topology package.") +# endif + +# ifdef CGAL_LICENSE_ERROR +# error "Your commercial license for CGAL does not cover this release \ + of the Surface Mesh Topology package. \ + You get this error, as you defined CGAL_LICENSE_ERROR." +# endif // CGAL_LICENSE_ERROR + +# endif // CGAL_SURFACE_MESH_TOPOLOGY_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE + +#else // no CGAL_SURFACE_MESH_TOPOLOGY_COMMERCIAL_LICENSE + +# if defined(CGAL_LICENSE_WARNING) + CGAL_pragma_warning("\nThe macro CGAL_SURFACE_MESH_TOPOLOGY_COMMERCIAL_LICENSE is not defined." + "\nYou use the CGAL Surface Mesh Topology package under " + "the terms of the GPLv3+.") +# endif // CGAL_LICENSE_WARNING + +# ifdef CGAL_LICENSE_ERROR +# error "The macro CGAL_SURFACE_MESH_TOPOLOGY_COMMERCIAL_LICENSE is not defined.\ + You use the CGAL Surface Mesh Topology package under the terms of \ + the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR." +# endif // CGAL_LICENSE_ERROR + +#endif // no CGAL_SURFACE_MESH_TOPOLOGY_COMMERCIAL_LICENSE + +#endif // CGAL_LICENSE_SURFACE_MESH_TOPOLOGY_H diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_surface_mesh_topology.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_surface_mesh_topology.cpp index 7070206c78f..0a5185dd78f 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_surface_mesh_topology.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_surface_mesh_topology.cpp @@ -5,9 +5,10 @@ #include typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3_cmap; +using namespace CGAL::Surface_mesh_topology; /////////////////////////////////////////////////////////////////////////////// -void create_path_1(CGAL::Path_on_surface& p) +void create_path_1(Path_on_surface& p) { p.push_back_by_index(14); // Its starting dart for (int i=0; i<7; ++i) @@ -15,11 +16,11 @@ void create_path_1(CGAL::Path_on_surface& p) } /////////////////////////////////////////////////////////////////////////////// -void create_path_2(CGAL::Path_on_surface& p) +void create_path_2(Path_on_surface& p) { p.push_back_by_index({202, 206, 335, 317, 322, 69, 62, 414}); } /////////////////////////////////////////////////////////////////////////////// -void create_path_3(CGAL::Path_on_surface& p) +void create_path_3(Path_on_surface& p) { p.push_back_by_index(470); // Its starting dart for (int i=0; i<13; ++i) @@ -36,8 +37,8 @@ int main() exit(EXIT_FAILURE); } - CGAL::Curves_on_surface_topology cst(lcc); - CGAL::Path_on_surface p1(lcc), p2(lcc), p3(lcc); + Curves_on_surface_topology cst(lcc); + Path_on_surface p1(lcc), p2(lcc), p3(lcc); create_path_1(p1); create_path_2(p2); create_path_3(p3); @@ -55,7 +56,7 @@ int main() <<" homotopic with path p3 (orange)."< > paths={p1, p2, p3}; + std::vector > paths={p1, p2, p3}; CGAL::draw(lcc, paths); // Enable only if CGAL was compiled with Qt5 #endif // CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_torus.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_torus.cpp index 98f0067112e..e8a697ccf32 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_torus.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_torus.cpp @@ -5,9 +5,10 @@ #include typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3_cmap; +using namespace CGAL::Surface_mesh_topology; /////////////////////////////////////////////////////////////////////////////// -void create_path_1(CGAL::Path_on_surface& p) +void create_path_1(Path_on_surface& p) { p.push_back_by_index(0); // Its starting dart for (int i=0; i<4; ++i) @@ -15,7 +16,7 @@ void create_path_1(CGAL::Path_on_surface& p) } /////////////////////////////////////////////////////////////////////////////// -void create_path_2(CGAL::Path_on_surface& p) +void create_path_2(Path_on_surface& p) { p.push_back_by_index(1); // Its starting dart for (int i=0; i<4; ++i) @@ -32,8 +33,8 @@ int main() exit(EXIT_FAILURE); } - CGAL::Curves_on_surface_topology cst(lcc); - CGAL::Path_on_surface p1(lcc), p2(lcc); + Curves_on_surface_topology cst(lcc); + Path_on_surface p1(lcc), p2(lcc); create_path_1(p1); create_path_2(p2); @@ -46,7 +47,7 @@ int main() <<" homotopic with path p2 (green)."< > paths={p1, p2}; + std::vector > paths={p1, p2}; CGAL::draw(lcc, paths); // Enable only if CGAL was compiled with Qt5 #endif // CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/map_2_constructor.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/map_2_constructor.cpp index 34d2c0d00f5..065c18cf7b5 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/map_2_constructor.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/map_2_constructor.cpp @@ -3,8 +3,10 @@ #include #include -typedef CGAL::Polygonal_schema_with_combinatorial_map<> CMap; -typedef CGAL::Polygonal_schema_with_generalized_map<> GMap; +using namespace CGAL::Surface_mesh_topology; + +typedef Polygonal_schema_with_combinatorial_map<> CMap; +typedef Polygonal_schema_with_generalized_map<> GMap; template void construct_map_from_edges() @@ -14,7 +16,7 @@ void construct_map_from_edges() cm.add_facet("a b c -a -b"); cm.add_facet("-c d e -d -e"); - CGAL::Path_on_surface p(cm); p.push_back_by_label("a b d e"); + Path_on_surface p(cm); p.push_back_by_label("a b d e"); std::cout<<"Map valid="< SM; +using namespace CGAL::Surface_mesh_topology; + /////////////////////////////////////////////////////////////////////////////// -void create_path_1(CGAL::Path_on_surface& p) +void create_path_1(Path_on_surface& p) { p.push_back_by_index(88); // Its starting dart for (int i=0; i<3; ++i) @@ -16,7 +18,7 @@ void create_path_1(CGAL::Path_on_surface& p) } /////////////////////////////////////////////////////////////////////////////// -void create_path_2(CGAL::Path_on_surface& p) +void create_path_2(Path_on_surface& p) { p.push_back_by_index(300); // Its starting dart for (int i=0; i<3; ++i) @@ -24,7 +26,7 @@ void create_path_2(CGAL::Path_on_surface& p) } /////////////////////////////////////////////////////////////////////////////// -void create_path_3(CGAL::Path_on_surface& p) +void create_path_3(Path_on_surface& p) { p.push_back_by_index(87); // Its starting dart p.extend_positive_turn(1); // Extend the path @@ -45,8 +47,8 @@ int main() } in>>sm; - CGAL::Curves_on_surface_topology cst(sm); - CGAL::Path_on_surface p1(sm), p2(sm), p3(sm); + Curves_on_surface_topology cst(sm); + Path_on_surface p1(sm), p2(sm), p3(sm); create_path_1(p1); create_path_2(p2); create_path_3(p3); @@ -60,7 +62,7 @@ int main() <<" base point homotopic with path p3 (orange)."< > paths={p1, p2, p3}; + std::vector > paths={p1, p2, p3}; CGAL::draw(sm, paths); // Enable only if CGAL was compiled with Qt5 #endif // CGAL_USE_BASIC_VIEWER diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy.cpp index 6efac25e6a3..9034161a142 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy.cpp @@ -1,16 +1,16 @@ #include #include #include +#include /* If you want to use a viewer, you can use qglviewer. */ #ifdef CGAL_USE_BASIC_VIEWER #include #endif -#include -#include - typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3_cmap; +using namespace CGAL::Surface_mesh_topology; + /////////////////////////////////////////////////////////////////////////////// [[ noreturn ]] void usage(int /*argc*/, char** argv) { @@ -117,7 +117,7 @@ int main(int argc, char** argv) lcc.display_characteristics(std::cout) << ", valid=" << lcc.is_valid() << std::endl; - CGAL::Curves_on_surface_topology cst(lcc, time); + Curves_on_surface_topology cst(lcc, time); std::cout<<"Reduced map: "; cst.get_map().display_characteristics(std::cout) << ", valid="<< cst.get_map().is_valid() << std::endl; @@ -137,16 +137,16 @@ int main(int argc, char** argv) length=static_cast(random.get_int(l1, l2+1)); defo=static_cast(random.get_int(d1, d2+1)); - std::vector > paths; - std::vector > transformed_paths; + std::vector > paths; + std::vector > transformed_paths; - CGAL::Path_on_surface path1(lcc); + Path_on_surface path1(lcc); path1.generate_random_closed_path(length, random); std::cout<<"Path1 size: "< path2(path1); + Path_on_surface path2(path1); path2.update_path_randomly(defo, random); std::cout<<"Path2 size: "< #include -typedef CGAL::Polygonal_schema_with_combinatorial_map<> PS; +using namespace CGAL::Surface_mesh_topology; +typedef Polygonal_schema_with_combinatorial_map<> PS; int main() { PS ps; ps.add_facet("a b -a -b c d -c -d"); - CGAL::Path_on_surface p1(ps); p1.push_back_by_label("a"); - CGAL::Path_on_surface p2(ps); p2.push_back_by_label("b c a -c -b"); + Path_on_surface p1(ps); p1.push_back_by_label("a"); + Path_on_surface p2(ps); p2.push_back_by_label("b c a -c -b"); - CGAL::Curves_on_surface_topology cst(ps); + Curves_on_surface_topology cst(ps); bool res1=cst.are_freely_homotopic(p1, p2); std::cout<<"Paths p1 and p2 "<<(res1?"ARE":"ARE NOT") diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy_with_symbols_2.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy_with_symbols_2.cpp index a3a9b1c530a..358ab9f79f6 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy_with_symbols_2.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy_with_symbols_2.cpp @@ -4,7 +4,7 @@ #include #include -typedef CGAL::Polygonal_schema_with_combinatorial_map<> PS; +typedef CGAL::Surface_mesh_topology::Polygonal_schema_with_combinatorial_map<> PS; int main() { @@ -23,10 +23,10 @@ int main() std::cout<<"Number of cells of the combinatorial maps: "; ps.display_characteristics(std::cout)< p(ps); + CGAL::Surface_mesh_topology::Path_on_surface p(ps); p.push_back_by_label("a b -a e -b d"); - CGAL::Curves_on_surface_topology cst(ps); + CGAL::Surface_mesh_topology::Curves_on_surface_topology cst(ps); bool res=cst.is_contractible(p); std::cout<<"Path "<<(res?"IS":"IS NOT")<<" contractible."< #include -#include #include #include #include @@ -17,17 +16,20 @@ typedef Kernel::Point_3 Point_3; typedef CGAL::Surface_mesh SM; static unsigned int seed; // Use the same seed for the two tests + +using namespace CGAL::Surface_mesh_topology; + /////////////////////////////////////////////////////////////////////////////// template void test(const FaceGraph& mesh) { CGAL::Random random(seed); - CGAL::Curves_on_surface_topology cst(mesh); + Curves_on_surface_topology cst(mesh); - CGAL::Path_on_surface p1(mesh); // A first path + Path_on_surface p1(mesh); // A first path p1.generate_random_closed_path(10, random); - CGAL::Path_on_surface p2(mesh); // A second path + Path_on_surface p2(mesh); // A second path p2.generate_random_closed_path(10, random); bool res1=cst.is_contractible(p1); @@ -37,7 +39,7 @@ void test(const FaceGraph& mesh) std::cout<<"Path p1 "<<(res2?"IS":"IS NOT")<<" homotopic with path p2."< > paths={p1, p2}; + std::vector > paths={p1, p2}; CGAL::draw(mesh, paths); // Enable only if CGAL was compiled with Qt5 */ #endif // CGAL_USE_BASIC_VIEWER } diff --git a/Surface_mesh_topology/include/CGAL/Curves_on_surface_topology.h b/Surface_mesh_topology/include/CGAL/Curves_on_surface_topology.h index f324cb1e92c..edb991d8d1c 100644 --- a/Surface_mesh_topology/include/CGAL/Curves_on_surface_topology.h +++ b/Surface_mesh_topology/include/CGAL/Curves_on_surface_topology.h @@ -1,10 +1,10 @@ // Copyright (c) 2019 CNRS and LIRIS' Establishments (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. @@ -14,12 +14,12 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0+ +// SPDX-License-Identifier: GPL-3.0+ // // Author(s) : Guillaume Damiand // -#ifndef CGAL_HOMOTOPY_TESTER_H -#define CGAL_HOMOTOPY_TESTER_H 1 +#ifndef CGAL_CURVES_ON_SURFACE_TOPOLOGY_H +#define CGAL_CURVES_ON_SURFACE_TOPOLOGY_H 1 // Should be defined before to include Path_on_surface_with_rle.h // If nothing is defined, use V1 @@ -27,11 +27,13 @@ // #define CGAL_PWRLE_TURN_V2 // Compute turns by using an id of darts, given by an hash-table (built and given by Curves_on_surface_topology) #define CGAL_PWRLE_TURN_V3 // Compute turns by using an id of darts, associated in Info of Darts (build by Curves_on_surface_topology) +#include + #include #include #include -#include -#include +#include +#include #include #include #include @@ -40,6 +42,7 @@ #include namespace CGAL { +namespace Surface_mesh_topology { struct CMap_for_homotopy_tester_items { @@ -324,7 +327,7 @@ CMap_for_homotopy_tester; } else { - Path_on_surface_with_rle + internal::Path_on_surface_with_rle pt=transform_original_path_into_quad_surface_with_rle(p); pt.canonize(); @@ -379,9 +382,9 @@ CMap_for_homotopy_tester; } else { - Path_on_surface_with_rle + internal::Path_on_surface_with_rle pt1=transform_original_path_into_quad_surface_with_rle(p1); - Path_on_surface_with_rle + internal::Path_on_surface_with_rle pt2=transform_original_path_into_quad_surface_with_rle(p2); pt1.canonize(); pt2.canonize(); @@ -501,11 +504,11 @@ CMap_for_homotopy_tester; return res; } - Path_on_surface_with_rle + internal::Path_on_surface_with_rle transform_original_path_into_quad_surface_with_rle (const Path_on_surface& path) const { - Path_on_surface_with_rle + internal::Path_on_surface_with_rle res(m_map #ifdef CGAL_PWRLE_TURN_V2 , m_dart_ids @@ -1158,7 +1161,8 @@ CMap_for_homotopy_tester; #endif // CGAL_PWRLE_TURN_V2 }; +} // namespace Surface_mesh_topology } // namespace CGAL -#endif // CGAL_HOMOTOPY_TESTER_H // +#endif // CGAL_CURVES_ON_SURFACE_TOPOLOGY_H // // EOF // diff --git a/Surface_mesh_topology/include/CGAL/Path_on_surface.h b/Surface_mesh_topology/include/CGAL/Path_on_surface.h index 3a353bd0dee..2d62b408a36 100644 --- a/Surface_mesh_topology/include/CGAL/Path_on_surface.h +++ b/Surface_mesh_topology/include/CGAL/Path_on_surface.h @@ -1,10 +1,10 @@ // Copyright (c) 2019 CNRS and LIRIS' Establishments (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. @@ -14,17 +14,20 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0+ +// SPDX-License-Identifier: GPL-3.0+ // // Author(s) : Guillaume Damiand // #ifndef CGAL_PATH_ON_SURFACE_H #define CGAL_PATH_ON_SURFACE_H 1 +#include + #include #include #include #include +#include #include #include #include @@ -34,14 +37,12 @@ #include namespace CGAL { - -template -class Path_on_surface_with_rle; +namespace Surface_mesh_topology { template class Path_on_surface { - friend class Path_on_surface_with_rle; + friend class internal::Path_on_surface_with_rle; public: typedef Path_on_surface Self; @@ -51,7 +52,7 @@ public: Path_on_surface(const Mesh& amap) : m_map(amap), m_is_closed(false) {} - Path_on_surface(const Path_on_surface_with_rle& apath) : + Path_on_surface(const internal::Path_on_surface_with_rle& apath) : m_map(apath.get_map()), m_is_closed(apath.is_closed()) { @@ -937,6 +938,7 @@ protected: bool m_is_closed; /// True iff the path is a cycle }; +} // namespace Surface_mesh_topology } // namespace CGAL #endif // CGAL_PATH_ON_SURFACE_H // diff --git a/Surface_mesh_topology/include/CGAL/Polygonal_schema.h b/Surface_mesh_topology/include/CGAL/Polygonal_schema.h index b4e22dbca80..c0246dd0921 100644 --- a/Surface_mesh_topology/include/CGAL/Polygonal_schema.h +++ b/Surface_mesh_topology/include/CGAL/Polygonal_schema.h @@ -1,10 +1,10 @@ // Copyright (c) 2019 CNRS and LIRIS' Establishments (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. @@ -14,25 +14,28 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0+ +// SPDX-License-Identifier: GPL-3.0+ // // Author(s) : Guillaume Damiand // #ifndef CGAL_POLYGONAL_SCHEMA_H #define CGAL_POLYGONAL_SCHEMA_H 1 +#include + #include #include #include #include +#include #include #include #include #include #include -#include namespace CGAL { +namespace Surface_mesh_topology { namespace internal { @@ -46,141 +49,143 @@ namespace CGAL { return std::string("-")+s; } + + template + struct Polygonal_schema_tools + {}; + template + struct Polygonal_schema_tools + { + typedef typename CMap::Dart_handle Dart_handle; + + static Dart_handle + add_edge_to_face(CMap& cmap, const std::string& s, + Dart_handle prev_dart, + Dart_handle dart_same_label, + Dart_handle dart_opposite_label, + std::unordered_map& edge_label_to_dart) + { + if (dart_same_label!=NULL && dart_opposite_label!=NULL) + { + std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<(prev_dart, res); } + + if (dart_opposite_label!=NULL) + { cmap.template link_beta<2>(res, dart_opposite_label); } + + return res; + } + + std::string get_label(CMap& cmap, Dart_handle dh) const + { + CGAL_assertion(cmap.info(dh).m_label!=NULL); + return std::string(cmap.info(dh).m_label); + } + }; + template + struct Polygonal_schema_tools + { + typedef typename GMap::Dart_handle Dart_handle; + + // In a GMap, if an edge is 2-free, only one of its two dart has one label. + // Otherwise, d has one label and alpha<0,2>(d) the opposite label. + static Dart_handle + add_edge_to_face(GMap& gmap, const std::string& s, + Dart_handle prev_dart, + Dart_handle dart_same_label, + Dart_handle dart_opposite_label, + std::unordered_map& edge_label_to_dart) + { + if (dart_same_label!=NULL && dart_opposite_label!=NULL) + { + std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<(res, dh2); + if (prev_dart!=gmap.null_handle) + { gmap.template link_alpha<1>(res, gmap.template alpha<0>(prev_dart)); } + + if (dart_same_label!=NULL) + { // Here dart_same_label!=NULL + std::string s2=internal::opposite_label(s); + edge_label_to_dart[s2]=dh2; + gmap.info(dh2).m_label=new char[s2.size()+1]; + strncpy(gmap.info(dh2).m_label, s2.c_str(), s2.size()+1); // +1 to copy also the \0 char + + gmap.template sew<2>(res, dart_same_label); + } + else + { // Here either dart_opposite_label!=NULL, or both are NULL + edge_label_to_dart[s]=res; + gmap.info(res).m_label=new char[s.size()+1]; + strncpy(gmap.info(res).m_label, s.c_str(), s.size()+1); // +1 to copy also the \0 char + + if (dart_opposite_label!=NULL) + { + std::string s2=internal::opposite_label(s); + edge_label_to_dart[s2]=res; + gmap.info(res).m_label=new char[s2.size()+1]; + strncpy(gmap.info(res).m_label, s2.c_str(), s2.size()+1); // +1 to copy also the \0 char + + gmap.template sew<2>(dh2, dart_opposite_label); + } + } + + return res; + } + + std::string get_label(GMap& gmap, Dart_handle dh) const + { + char* label=gmap.info(dh).m_label; + + if (label==NULL) + { + if (!gmap.is_free<2>(dh)) + { label=gmap.info(gmap.template alpha<2>(dh)).m_label; } + else + { + return internal::opposite_label + (std::string(gmap.info(gmap.template alpha<0>(dh)))); + } + } + CGAL_assertion(label!=NULL); + return std::string(label); + } + }; + } + // end namespace internal struct Combinatorial_map_tag; struct Generalized_map_tag; - template - struct Polygonal_schema_tools - {}; - template - struct Polygonal_schema_tools - { - typedef typename CMap::Dart_handle Dart_handle; - - static Dart_handle - add_edge_to_face(CMap& cmap, const std::string& s, - Dart_handle prev_dart, - Dart_handle dart_same_label, - Dart_handle dart_opposite_label, - std::unordered_map& edge_label_to_dart) - { - if (dart_same_label!=NULL && dart_opposite_label!=NULL) - { - std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<(prev_dart, res); } - - if (dart_opposite_label!=NULL) - { cmap.template link_beta<2>(res, dart_opposite_label); } - - return res; - } - - std::string get_label(CMap& cmap, Dart_handle dh) const - { - CGAL_assertion(cmap.info(dh).m_label!=NULL); - return std::string(cmap.info(dh).m_label); - } - }; - template - struct Polygonal_schema_tools - { - typedef typename GMap::Dart_handle Dart_handle; - - // In a GMap, if an edge is 2-free, only one of its two dart has one label. - // Otherwise, d has one label and alpha<0,2>(d) the opposite label. - static Dart_handle - add_edge_to_face(GMap& gmap, const std::string& s, - Dart_handle prev_dart, - Dart_handle dart_same_label, - Dart_handle dart_opposite_label, - std::unordered_map& edge_label_to_dart) - { - if (dart_same_label!=NULL && dart_opposite_label!=NULL) - { - std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<(res, dh2); - if (prev_dart!=gmap.null_handle) - { gmap.template link_alpha<1>(res, gmap.template alpha<0>(prev_dart)); } - - if (dart_same_label!=NULL) - { // Here dart_same_label!=NULL - std::string s2=internal::opposite_label(s); - edge_label_to_dart[s2]=dh2; - gmap.info(dh2).m_label=new char[s2.size()+1]; - strncpy(gmap.info(dh2).m_label, s2.c_str(), s2.size()+1); // +1 to copy also the \0 char - - gmap.template sew<2>(res, dart_same_label); - } - else - { // Here either dart_opposite_label!=NULL, or both are NULL - edge_label_to_dart[s]=res; - gmap.info(res).m_label=new char[s.size()+1]; - strncpy(gmap.info(res).m_label, s.c_str(), s.size()+1); // +1 to copy also the \0 char - - if (dart_opposite_label!=NULL) - { - std::string s2=internal::opposite_label(s); - edge_label_to_dart[s2]=res; - gmap.info(res).m_label=new char[s2.size()+1]; - strncpy(gmap.info(res).m_label, s2.c_str(), s2.size()+1); // +1 to copy also the \0 char - - gmap.template sew<2>(dh2, dart_opposite_label); - } - } - - return res; - } - - std::string get_label(GMap& gmap, Dart_handle dh) const - { - char* label=gmap.info(dh).m_label; - - if (label==NULL) - { - if (!gmap.is_free<2>(dh)) - { label=gmap.info(gmap.template alpha<2>(dh)).m_label; } - else - { - return internal::opposite_label - (std::string(gmap.info(gmap.template alpha<0>(dh)))); - } - } - CGAL_assertion(label!=NULL); - return std::string(label); - } - }; - template < class BaseModel > class Polygonal_schema_base: public BaseModel { @@ -239,7 +244,7 @@ namespace CGAL { Dart_handle dart_same_label=get_dart_labeled(s); Dart_handle dart_opposite_label=get_dart_labeled(internal::opposite_label(s)); - Dart_handle cur=Polygonal_schema_tools:: + Dart_handle cur=internal::Polygonal_schema_tools:: add_edge_to_face(*this, s, prev_dart, dart_same_label, dart_opposite_label, edge_label_to_dart); @@ -335,7 +340,7 @@ namespace CGAL { } std::string get_label(Dart_handle dh) const - { return Polygonal_schema_tools::get_label(dh); } + { return internal::Polygonal_schema_tools::get_label(dh); } protected: // For each edge label, its corresponding dart. Stores both association a -a, to allow @@ -459,6 +464,7 @@ namespace CGAL { {} }; +} //namespace Surface_mesh_topology } //namespace CGAL #endif // CGAL_POLYGONAL_SCHEMA_H // diff --git a/Surface_mesh_topology/include/CGAL/Polygonal_schema_min_items.h b/Surface_mesh_topology/include/CGAL/Polygonal_schema_min_items.h index 1ba2d008eec..157d4fb13b8 100644 --- a/Surface_mesh_topology/include/CGAL/Polygonal_schema_min_items.h +++ b/Surface_mesh_topology/include/CGAL/Polygonal_schema_min_items.h @@ -1,10 +1,10 @@ // Copyright (c) 2019 CNRS and LIRIS' Establishments (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. @@ -14,16 +14,19 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0+ +// SPDX-License-Identifier: GPL-3.0+ // // Author(s) : Guillaume Damiand // #ifndef CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H #define CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H 1 +#include + #include namespace CGAL { +namespace Surface_mesh_topology { /** @file Polygonal_schema_min_items.h * Definition of min item class for Polygonal_schema. @@ -50,6 +53,7 @@ namespace CGAL { }; }; +} // namespace Surface_mesh_topology } // namespace CGAL #endif // CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H diff --git a/Surface_mesh_topology/include/CGAL/Path_generators.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_generators.h similarity index 91% rename from Surface_mesh_topology/include/CGAL/Path_generators.h rename to Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_generators.h index 97d4bd25001..00b04341d2c 100644 --- a/Surface_mesh_topology/include/CGAL/Path_generators.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_generators.h @@ -1,10 +1,10 @@ -// Copyright (c) 2017 CNRS and LIRIS' Establishments (France). +// Copyright (c) 2019 CNRS and LIRIS' Establishments (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. @@ -14,20 +14,23 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0+ +// SPDX-License-Identifier: GPL-3.0+ // // Author(s) : Guillaume Damiand // #ifndef CGAL_PATH_GENERATORS_H #define CGAL_PATH_GENERATORS_H 1 +#include + #include -#include -#include +#include +#include #include namespace CGAL { - +namespace Surface_mesh_topology { +namespace internal { template void create_braket_positive(Path& p, std::size_t length, CGAL::Random& random, @@ -80,7 +83,7 @@ void generate_random_positive_bracket(Path& path, path.clear(); path.initialize_random_starting_dart(random); path.extend_straight_positive(nb1-1); - CGAL::create_braket_positive(path, nb2); + create_braket_positive(path, nb2); path.extend_straight_positive(nb3); path.generate_random_path(random.get_int(0, 15), random); } @@ -223,6 +226,8 @@ void generate_random_closed_path(Path& p, std::size_t nb, CGAL_assertion(p.is_closed()); } +} // namespace internal +} // namespace Surface_mesh_topology } // namespace CGAL #endif // CGAL_PATH_GENERATORS_H // diff --git a/Surface_mesh_topology/include/CGAL/Path_on_surface_with_rle.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h similarity index 99% rename from Surface_mesh_topology/include/CGAL/Path_on_surface_with_rle.h rename to Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h index 1d8c0fb7ec2..05f2e125d31 100644 --- a/Surface_mesh_topology/include/CGAL/Path_on_surface_with_rle.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h @@ -1,10 +1,10 @@ // Copyright (c) 2019 CNRS and LIRIS' Establishments (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. @@ -14,13 +14,15 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0+ +// SPDX-License-Identifier: GPL-3.0+ // // Author(s) : Guillaume Damiand // #ifndef CGAL_PATH_ON_SURFACE_WITH_RLE_H #define CGAL_PATH_ON_SURFACE_WITH_RLE_H 1 +#include + #include #include #include @@ -32,10 +34,13 @@ #include namespace CGAL { +namespace Surface_mesh_topology { template class Path_on_surface; +namespace internal { + // A flat is a sequence of darts given by its two extremities: begin and end, // with +2 turns (if length>0) or -2 turns (if length<0). // length==0 => begin==end. @@ -1740,6 +1745,8 @@ protected: #endif //CGAL_PWRLE_TURN_V2 }; +} // namespace internal +} // namespace Surface_mesh_topology } // namespace CGAL #endif // CGAL_PATH_ON_SURFACE_WITH_RLE_H // diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 6e7018d3018..966ed8a023d 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -1,10 +1,10 @@ // Copyright (c) 2019 CNRS and LIRIS' Establishments (France). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. @@ -14,12 +14,15 @@ // // $URL$ // $Id$ +// SPDX-License-Identifier: GPL-3.0+ // // Author(s) : Guillaume Damiand - +// #ifndef CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H #define CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H +#include + #include #ifdef CGAL_USE_BASIC_VIEWER @@ -27,8 +30,8 @@ #include #include -namespace CGAL -{ +namespace CGAL { + // Specialisation for face graph; otherwise use the LCC_geom_utils of LCC. template struct LCC_geom_utils, Kernel, 3> @@ -99,7 +102,7 @@ public: /// usefull for very big object where this time could be long) Face_graph_with_path_viewer(QWidget* parent, const Mesh& amesh, - const std::vector >* paths=NULL, + const std::vector >* paths=NULL, std::size_t amark=LCC::INVALID_MARK, const char* title="", bool anofaces=false, const DrawingFunctorLCC& drawing_functor=DrawingFunctorLCC()) : @@ -332,7 +335,7 @@ protected: const typename Get_map::storage_type lcc; bool m_nofaces; const DrawingFunctorLCC& m_drawing_functor; - const std::vector >* m_paths; + const std::vector >* m_paths; unsigned int m_current_path; unsigned int m_current_dart; bool m_draw_marked_darts; @@ -341,7 +344,7 @@ protected: template void draw(const Mesh& alcc, - const std::vector >& paths, + const std::vector >& paths, const char* title="Mesh Viewer", std::size_t amark=-1, bool nofill=false, @@ -369,7 +372,7 @@ void draw(const Mesh& alcc, template void draw(const Mesh& alcc, - const std::vector >& paths, + const std::vector >& paths, const char* title="LCC Viewer", std::size_t amark=-1, bool nofill=false) diff --git a/Surface_mesh_topology/test/Surface_mesh_topology/Creation_of_test_cases_for_paths.h b/Surface_mesh_topology/test/Surface_mesh_topology/Creation_of_test_cases_for_paths.h index 54a7b10f0b0..c83e4be62da 100644 --- a/Surface_mesh_topology/test/Surface_mesh_topology/Creation_of_test_cases_for_paths.h +++ b/Surface_mesh_topology/test/Surface_mesh_topology/Creation_of_test_cases_for_paths.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017 CNRS and LIRIS' Establishments (France). +// Copyright (c) 2019 CNRS and LIRIS' Establishments (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -21,7 +21,7 @@ #ifndef CGAL_CREATION_OF_TEST_CASES_FOR_PATHS_H #define CGAL_CREATION_OF_TEST_CASES_FOR_PATHS_H 1 -#include +#include namespace CGAL { diff --git a/Surface_mesh_topology/test/Surface_mesh_topology/path_tests.cpp b/Surface_mesh_topology/test/Surface_mesh_topology/path_tests.cpp index cbe791da7a7..8493a637e04 100644 --- a/Surface_mesh_topology/test/Surface_mesh_topology/path_tests.cpp +++ b/Surface_mesh_topology/test/Surface_mesh_topology/path_tests.cpp @@ -1,13 +1,14 @@ #include #include #include -#include +#include #include /////////////////////////////////////////////////////////////////////////////// typedef CGAL::Combinatorial_map<2> CMap; typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3; +using namespace CGAL::Surface_mesh_topology; /////////////////////////////////////////////////////////////////////////////// bool basic_tests() { @@ -15,7 +16,7 @@ bool basic_tests() CMap cmap; cmap.make_combinatorial_hexahedron(); - CGAL::Path_on_surface p1(cmap); + Path_on_surface p1(cmap); p1.initialize_random_starting_dart(); p1.extend_straight_positive(3); if (!p1.is_valid() || p1.length()!=4 || !p1.is_closed() || !p1.is_simple()) @@ -25,14 +26,14 @@ bool basic_tests() res=false; } - CGAL::Path_on_surface p2(p1); + Path_on_surface p2(p1); if (p1!=p2 || !p1.are_paths_equals(p2)) { std::cerr<<"path_tests ERROR: p1!=p2 || !p1.are_paths_equals(p2)."< p3(cmap); + Path_on_surface p3(cmap); p3.push_back(cmap.beta<2>(p1.front())); p3.extend_straight_negative(3); if (p3.length()!=4 || !p3.is_closed()) @@ -58,7 +59,7 @@ bool basic_tests() res=false; } - CGAL::Path_on_surface p4(p3); + Path_on_surface p4(p3); p4.reverse(); if (p3!=p4 || !p3.are_paths_equals(p4)) { @@ -66,7 +67,7 @@ bool basic_tests() res=false; } - CGAL::Path_on_surface p5(cmap); + Path_on_surface p5(cmap); p5.push_back(cmap.beta<2>(p1.front())); for (int i=0; i<3; ++i) { p5.extend_positive_turn(); } @@ -79,7 +80,7 @@ bool basic_tests() p1.push_around_face(0); - CGAL::Path_on_surface p6(cmap); + Path_on_surface p6(cmap); p6.push_back(p1.front()); p6.extend_straight_positive(2); p6.extend_positive_turn(1); @@ -90,21 +91,21 @@ bool basic_tests() res=false; } - CGAL::Path_on_surface_with_rle p7(p6); + internal::Path_on_surface_with_rle p7(p6); if (!p7.is_valid() || p7.size_of_list()!=2) { std::cerr<<"path_tests ERROR: !p7.is_valid() || size_of_list()!=2."< p8(p7); + Path_on_surface p8(p7); if (!p8.is_valid() || p6!=p8 || !p6.are_paths_equals(p8)) { std::cerr<<"path_tests ERROR: !p8.is_valid() || p6!=p8 || !p6.are_paths_equals(p8)."< p9(cmap); + Path_on_surface p9(cmap); p9.push_back(p1.front()); if (!p9.can_be_pushed(cmap.beta<1,2,1>(p9.back()))) // 1st { diff --git a/Surface_mesh_topology/test/Surface_mesh_topology/path_with_rle_deformation_tests.cpp b/Surface_mesh_topology/test/Surface_mesh_topology/path_with_rle_deformation_tests.cpp index 679cf517bae..c8a9204820b 100644 --- a/Surface_mesh_topology/test/Surface_mesh_topology/path_with_rle_deformation_tests.cpp +++ b/Surface_mesh_topology/test/Surface_mesh_topology/path_with_rle_deformation_tests.cpp @@ -1,8 +1,8 @@ #include #include -#include #include -#include +#include +#include #include #include @@ -42,15 +42,17 @@ enum Transformation // enum for the type of transformations FULL_SIMPLIFICATION }; +using namespace CGAL::Surface_mesh_topology; + /////////////////////////////////////////////////////////////////////////////// -void transform_path(CGAL::Path_on_surface& path, Transformation t, +void transform_path(Path_on_surface& path, Transformation t, bool use_only_positive, bool use_only_negative, bool draw=false, std::size_t repeat=0) // If 0, repeat as long as there is one modifcation; // otherwise repeat the given number of times { - std::vector > v; + std::vector > v; #ifdef CGAL_USE_BASIC_VIEWER if (draw) { @@ -59,15 +61,15 @@ void transform_path(CGAL::Path_on_surface& path, Transformation t, } #endif // CGAL_USE_BASIC_VIEWER - CGAL::Path_on_surface prevp=path; - CGAL::Path_on_surface_with_rle curp(path.get_map()); + Path_on_surface prevp=path; + internal::Path_on_surface_with_rle curp(path.get_map()); std::size_t nb=0; bool modified=false; do { - curp=CGAL::Path_on_surface_with_rle(prevp, - use_only_positive, - use_only_negative); + curp=internal::Path_on_surface_with_rle(prevp, + use_only_positive, + use_only_negative); modified=false; /* curp->display_negative_turns(); std::cout<<" "; curp->display_positive_turns(); @@ -87,7 +89,7 @@ void transform_path(CGAL::Path_on_surface& path, Transformation t, if (modified) { - prevp=CGAL::Path_on_surface(curp); + prevp=Path_on_surface(curp); #ifdef CGAL_USE_BASIC_VIEWER if (draw) { v.push_back(prevp); } #endif // CGAL_USE_BASIC_VIEWER @@ -115,7 +117,7 @@ void transform_path(CGAL::Path_on_surface& path, Transformation t, path.swap(prevp); } /////////////////////////////////////////////////////////////////////////////// -bool unit_test(CGAL::Path_on_surface& path, Transformation t, +bool unit_test(Path_on_surface& path, Transformation t, std::size_t repeat, const char* msg, const char* expected_result, bool draw, int testtorun, @@ -163,7 +165,7 @@ bool test_all_cases_spurs_and_bracket(bool draw, int testtorun) return false; } - CGAL::Path_on_surface path(lcc); + Path_on_surface path(lcc); generate_one_positive_spur(path); // Test 0 if (!unit_test(path, REDUCTION, 1, "Positive spur (2^6 1 0 2^4)", @@ -236,7 +238,7 @@ bool test_all_cases_l_shape(bool draw, int testtorun) std::cout<<"PROBLEM reading file ./data/cube-mesh-5-5.off"< path(lcc); + Path_on_surface path(lcc); generate_one_l_shape(path); // Test 9 if (!unit_test(path, PUSH, 1, "L-shape (-2^2 -3 -2^8 -1 -2^5 -3 -2^3)", @@ -325,29 +327,29 @@ bool test_some_random_paths_on_cube(bool draw, int testtorun) return false; } - CGAL::Path_on_surface path(lcc); + Path_on_surface path(lcc); bool res=true; CGAL::Random random(nbtests); // fix seed - generate_random_positive_bracket(path, 2, 6, 3, random); // Test 17 + internal::generate_random_positive_bracket(path, 2, 6, 3, random); // Test 17 if (!unit_test(path, FULL_SIMPLIFICATION, 0, "(2^1 1 2^6 1 2^3 ... )", "2 2 2 2 2 2 1", draw, testtorun, true, false)) { res=false; } random=CGAL::Random(nbtests); - generate_random_positive_bracket(path, 3, 8, 4, random); // Test 18 + internal::generate_random_positive_bracket(path, 3, 8, 4, random); // Test 18 if (!unit_test(path, FULL_SIMPLIFICATION, 0, "(2^2 1 2^8 1 2^4 ... )", "2 1 2 2 2 2 2", draw, testtorun, true, false)) { res=false; } random=CGAL::Random(nbtests); - generate_random_positive_bracket(path, 5, 12, 8, random); // Test 19 + internal::generate_random_positive_bracket(path, 5, 12, 8, random); // Test 19 if (!unit_test(path, FULL_SIMPLIFICATION, 0, "(2^4 1 2^12 1 2^8 ...)", "2 1 2", draw, testtorun, true, false)) { res=false; } random=CGAL::Random(nbtests); - generate_random_positive_bracket(path, 5, 12, 8, random); // Test 20 + internal::generate_random_positive_bracket(path, 5, 12, 8, random); // Test 20 if (!unit_test(path, FULL_SIMPLIFICATION, 0, "(2^4 1 2^12 1 2^8 ...)", "1 2 2 2", draw, testtorun, true, false)) { res=false; } diff --git a/Surface_mesh_topology/test/Surface_mesh_topology/test_homotopy.cpp b/Surface_mesh_topology/test/Surface_mesh_topology/test_homotopy.cpp index cfafc383a4f..75bc0fb9081 100644 --- a/Surface_mesh_topology/test/Surface_mesh_topology/test_homotopy.cpp +++ b/Surface_mesh_topology/test/Surface_mesh_topology/test_homotopy.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include @@ -36,9 +36,11 @@ typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, static int nbtests=0; static int starting_seed; +using namespace CGAL::Surface_mesh_topology; + /////////////////////////////////////////////////////////////////////////////// -bool unit_test_canonize(CGAL::Curves_on_surface_topology& cst, - std::vector >& paths, +bool unit_test_canonize(Curves_on_surface_topology& cst, + std::vector >& paths, const char* msg, bool draw, int testtorun) { @@ -82,7 +84,7 @@ bool unit_test_canonize(CGAL::Curves_on_surface_topology& cst, bool test_double_torus_quad(bool draw, int testtorun) { bool res=true; - std::vector > paths; + std::vector > paths; // Test 0 (double torus, three G1 cycles) { @@ -92,11 +94,11 @@ bool test_double_torus_quad(bool draw, int testtorun) std::cout<<"PROBLEM reading file ./data/double-torus.off"< cst(lcc); + Curves_on_surface_topology cst(lcc); for (unsigned int i=0; i<3; ++i) { - CGAL::Path_on_surface p(lcc); + Path_on_surface p(lcc); CGAL::generate_g1_double_torus(p, i); paths.push_back(p); } @@ -116,14 +118,14 @@ bool test_double_torus_quad(bool draw, int testtorun) std::cout<<"PROBLEM reading file ./data/double-torus.off"< cst(lcc); + Curves_on_surface_topology cst(lcc); if (testtorun==-1 || nbtests==testtorun) { CGAL::Random random(starting_seed+nbtests); - CGAL::Path_on_surface p(lcc); + Path_on_surface p(lcc); - generate_random_closed_path(p, random.get_int(5, 20), random); // random path, length between 30 and 500 + internal::generate_random_closed_path(p, random.get_int(5, 20), random); // random path, length between 5 and 20 paths.push_back(p); p.update_path_randomly(random); @@ -148,14 +150,14 @@ bool test_double_torus_quad(bool draw, int testtorun) std::cout<<"PROBLEM reading file ./data/3torus-smooth.off"< cst(lcc); + Curves_on_surface_topology cst(lcc); if (testtorun==-1 || nbtests==testtorun) { CGAL::Random random(starting_seed+nbtests); - CGAL::Path_on_surface p(lcc); + Path_on_surface p(lcc); - generate_random_closed_path(p, random.get_int(5, 200), random); // random path, length between 30 and 500 + internal::generate_random_closed_path(p, random.get_int(5, 200), random); // random path, length between 5 and 200 paths.push_back(p); p.update_path_randomly(random);