mirror of https://github.com/CGAL/cgal
Update licences; move undocumented files to internal (both directory and namespace)
This commit is contained in:
parent
62167eb065
commit
1dbc088459
|
|
@ -795,7 +795,8 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Items, typename Alloc, typename Storage, class Map>
|
template <typename Items, typename Alloc, typename Storage, class Map>
|
||||||
struct Get_map<CGAL::Polygonal_schema_with_combinatorial_map<Items, Alloc, Storage>, Map>
|
struct Get_map<CGAL::Surface_mesh_topology::
|
||||||
|
Polygonal_schema_with_combinatorial_map<Items, Alloc, Storage>, Map>
|
||||||
{
|
{
|
||||||
typedef Map type;
|
typedef Map type;
|
||||||
typedef const Map& storage_type;
|
typedef const Map& storage_type;
|
||||||
|
|
@ -814,7 +815,8 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Items, typename Alloc, typename Storage, class Map>
|
template <typename Items, typename Alloc, typename Storage, class Map>
|
||||||
struct Get_map<CGAL::Polygonal_schema_with_generalized_map<Items, Alloc, Storage>, Map>
|
struct Get_map<CGAL::Surface_mesh_topology::
|
||||||
|
Polygonal_schema_with_generalized_map<Items, Alloc, Storage>, Map>
|
||||||
{
|
{
|
||||||
typedef Map type;
|
typedef Map type;
|
||||||
typedef const Map& storage_type;
|
typedef const Map& storage_type;
|
||||||
|
|
|
||||||
|
|
@ -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 <CGAL/config.h>
|
||||||
|
#include <CGAL/license.h>
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
@ -5,9 +5,10 @@
|
||||||
#include <CGAL/draw_face_graph_with_paths.h>
|
#include <CGAL/draw_face_graph_with_paths.h>
|
||||||
|
|
||||||
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3_cmap;
|
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<LCC_3_cmap>& p)
|
void create_path_1(Path_on_surface<LCC_3_cmap>& p)
|
||||||
{
|
{
|
||||||
p.push_back_by_index(14); // Its starting dart
|
p.push_back_by_index(14); // Its starting dart
|
||||||
for (int i=0; i<7; ++i)
|
for (int i=0; i<7; ++i)
|
||||||
|
|
@ -15,11 +16,11 @@ void create_path_1(CGAL::Path_on_surface<LCC_3_cmap>& p)
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void create_path_2(CGAL::Path_on_surface<LCC_3_cmap>& p)
|
void create_path_2(Path_on_surface<LCC_3_cmap>& p)
|
||||||
{ p.push_back_by_index({202, 206, 335, 317, 322, 69, 62, 414}); }
|
{ p.push_back_by_index({202, 206, 335, 317, 322, 69, 62, 414}); }
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void create_path_3(CGAL::Path_on_surface<LCC_3_cmap>& p)
|
void create_path_3(Path_on_surface<LCC_3_cmap>& p)
|
||||||
{
|
{
|
||||||
p.push_back_by_index(470); // Its starting dart
|
p.push_back_by_index(470); // Its starting dart
|
||||||
for (int i=0; i<13; ++i)
|
for (int i=0; i<13; ++i)
|
||||||
|
|
@ -36,8 +37,8 @@ int main()
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> p1(lcc), p2(lcc), p3(lcc);
|
Path_on_surface<LCC_3_cmap> p1(lcc), p2(lcc), p3(lcc);
|
||||||
create_path_1(p1);
|
create_path_1(p1);
|
||||||
create_path_2(p2);
|
create_path_2(p2);
|
||||||
create_path_3(p3);
|
create_path_3(p3);
|
||||||
|
|
@ -55,7 +56,7 @@ int main()
|
||||||
<<" homotopic with path p3 (orange)."<<std::endl;
|
<<" homotopic with path p3 (orange)."<<std::endl;
|
||||||
|
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
std::vector<CGAL::Path_on_surface<LCC_3_cmap> > paths={p1, p2, p3};
|
std::vector<Path_on_surface<LCC_3_cmap> > paths={p1, p2, p3};
|
||||||
CGAL::draw(lcc, paths); // Enable only if CGAL was compiled with Qt5
|
CGAL::draw(lcc, paths); // Enable only if CGAL was compiled with Qt5
|
||||||
#endif // CGAL_USE_BASIC_VIEWER
|
#endif // CGAL_USE_BASIC_VIEWER
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@
|
||||||
#include <CGAL/draw_face_graph_with_paths.h>
|
#include <CGAL/draw_face_graph_with_paths.h>
|
||||||
|
|
||||||
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3_cmap;
|
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<LCC_3_cmap>& p)
|
void create_path_1(Path_on_surface<LCC_3_cmap>& p)
|
||||||
{
|
{
|
||||||
p.push_back_by_index(0); // Its starting dart
|
p.push_back_by_index(0); // Its starting dart
|
||||||
for (int i=0; i<4; ++i)
|
for (int i=0; i<4; ++i)
|
||||||
|
|
@ -15,7 +16,7 @@ void create_path_1(CGAL::Path_on_surface<LCC_3_cmap>& p)
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void create_path_2(CGAL::Path_on_surface<LCC_3_cmap>& p)
|
void create_path_2(Path_on_surface<LCC_3_cmap>& p)
|
||||||
{
|
{
|
||||||
p.push_back_by_index(1); // Its starting dart
|
p.push_back_by_index(1); // Its starting dart
|
||||||
for (int i=0; i<4; ++i)
|
for (int i=0; i<4; ++i)
|
||||||
|
|
@ -32,8 +33,8 @@ int main()
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> p1(lcc), p2(lcc);
|
Path_on_surface<LCC_3_cmap> p1(lcc), p2(lcc);
|
||||||
create_path_1(p1);
|
create_path_1(p1);
|
||||||
create_path_2(p2);
|
create_path_2(p2);
|
||||||
|
|
||||||
|
|
@ -46,7 +47,7 @@ int main()
|
||||||
<<" homotopic with path p2 (green)."<<std::endl;
|
<<" homotopic with path p2 (green)."<<std::endl;
|
||||||
|
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
std::vector<CGAL::Path_on_surface<LCC_3_cmap> > paths={p1, p2};
|
std::vector<Path_on_surface<LCC_3_cmap> > paths={p1, p2};
|
||||||
CGAL::draw(lcc, paths); // Enable only if CGAL was compiled with Qt5
|
CGAL::draw(lcc, paths); // Enable only if CGAL was compiled with Qt5
|
||||||
#endif // CGAL_USE_BASIC_VIEWER
|
#endif // CGAL_USE_BASIC_VIEWER
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,10 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
typedef CGAL::Polygonal_schema_with_combinatorial_map<> CMap;
|
using namespace CGAL::Surface_mesh_topology;
|
||||||
typedef CGAL::Polygonal_schema_with_generalized_map<> GMap;
|
|
||||||
|
typedef Polygonal_schema_with_combinatorial_map<> CMap;
|
||||||
|
typedef Polygonal_schema_with_generalized_map<> GMap;
|
||||||
|
|
||||||
template<typename Map>
|
template<typename Map>
|
||||||
void construct_map_from_edges()
|
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("a b c -a -b");
|
||||||
cm.add_facet("-c d e -d -e");
|
cm.add_facet("-c d e -d -e");
|
||||||
|
|
||||||
CGAL::Path_on_surface<Map> p(cm); p.push_back_by_label("a b d e");
|
Path_on_surface<Map> p(cm); p.push_back_by_label("a b d e");
|
||||||
|
|
||||||
std::cout<<"Map valid="<<cm.is_valid()<<std::flush;
|
std::cout<<"Map valid="<<cm.is_valid()<<std::flush;
|
||||||
cm.display_characteristics(std::cout);
|
cm.display_characteristics(std::cout);
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,10 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||||
typedef Kernel::Point_3 Point_3;
|
typedef Kernel::Point_3 Point_3;
|
||||||
typedef CGAL::Surface_mesh<Point_3> SM;
|
typedef CGAL::Surface_mesh<Point_3> SM;
|
||||||
|
|
||||||
|
using namespace CGAL::Surface_mesh_topology;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void create_path_1(CGAL::Path_on_surface<SM>& p)
|
void create_path_1(Path_on_surface<SM>& p)
|
||||||
{
|
{
|
||||||
p.push_back_by_index(88); // Its starting dart
|
p.push_back_by_index(88); // Its starting dart
|
||||||
for (int i=0; i<3; ++i)
|
for (int i=0; i<3; ++i)
|
||||||
|
|
@ -16,7 +18,7 @@ void create_path_1(CGAL::Path_on_surface<SM>& p)
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void create_path_2(CGAL::Path_on_surface<SM>& p)
|
void create_path_2(Path_on_surface<SM>& p)
|
||||||
{
|
{
|
||||||
p.push_back_by_index(300); // Its starting dart
|
p.push_back_by_index(300); // Its starting dart
|
||||||
for (int i=0; i<3; ++i)
|
for (int i=0; i<3; ++i)
|
||||||
|
|
@ -24,7 +26,7 @@ void create_path_2(CGAL::Path_on_surface<SM>& p)
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void create_path_3(CGAL::Path_on_surface<SM>& p)
|
void create_path_3(Path_on_surface<SM>& p)
|
||||||
{
|
{
|
||||||
p.push_back_by_index(87); // Its starting dart
|
p.push_back_by_index(87); // Its starting dart
|
||||||
p.extend_positive_turn(1); // Extend the path
|
p.extend_positive_turn(1); // Extend the path
|
||||||
|
|
@ -45,8 +47,8 @@ int main()
|
||||||
}
|
}
|
||||||
in>>sm;
|
in>>sm;
|
||||||
|
|
||||||
CGAL::Curves_on_surface_topology<SM> cst(sm);
|
Curves_on_surface_topology<SM> cst(sm);
|
||||||
CGAL::Path_on_surface<SM> p1(sm), p2(sm), p3(sm);
|
Path_on_surface<SM> p1(sm), p2(sm), p3(sm);
|
||||||
create_path_1(p1);
|
create_path_1(p1);
|
||||||
create_path_2(p2);
|
create_path_2(p2);
|
||||||
create_path_3(p3);
|
create_path_3(p3);
|
||||||
|
|
@ -60,7 +62,7 @@ int main()
|
||||||
<<" base point homotopic with path p3 (orange)."<<std::endl;
|
<<" base point homotopic with path p3 (orange)."<<std::endl;
|
||||||
|
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
std::vector<CGAL::Path_on_surface<SM> > paths={p1, p2, p3};
|
std::vector<Path_on_surface<SM> > paths={p1, p2, p3};
|
||||||
CGAL::draw(sm, paths); // Enable only if CGAL was compiled with Qt5
|
CGAL::draw(sm, paths); // Enable only if CGAL was compiled with Qt5
|
||||||
#endif // CGAL_USE_BASIC_VIEWER
|
#endif // CGAL_USE_BASIC_VIEWER
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/Linear_cell_complex_constructors.h>
|
#include <CGAL/Linear_cell_complex_constructors.h>
|
||||||
#include <CGAL/Curves_on_surface_topology.h>
|
#include <CGAL/Curves_on_surface_topology.h>
|
||||||
|
#include <CGAL/Path_on_surface.h>
|
||||||
|
|
||||||
/* If you want to use a viewer, you can use qglviewer. */
|
/* If you want to use a viewer, you can use qglviewer. */
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
#include <CGAL/draw_face_graph_with_paths.h>
|
#include <CGAL/draw_face_graph_with_paths.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <CGAL/Path_generators.h>
|
|
||||||
#include <CGAL/Path_on_surface.h>
|
|
||||||
|
|
||||||
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3_cmap;
|
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)
|
[[ noreturn ]] void usage(int /*argc*/, char** argv)
|
||||||
{
|
{
|
||||||
|
|
@ -117,7 +117,7 @@ int main(int argc, char** argv)
|
||||||
lcc.display_characteristics(std::cout) << ", valid="
|
lcc.display_characteristics(std::cout) << ", valid="
|
||||||
<< lcc.is_valid() << std::endl;
|
<< lcc.is_valid() << std::endl;
|
||||||
|
|
||||||
CGAL::Curves_on_surface_topology<LCC_3_cmap> cst(lcc, time);
|
Curves_on_surface_topology<LCC_3_cmap> cst(lcc, time);
|
||||||
std::cout<<"Reduced map: ";
|
std::cout<<"Reduced map: ";
|
||||||
cst.get_map().display_characteristics(std::cout)
|
cst.get_map().display_characteristics(std::cout)
|
||||||
<< ", valid="<< cst.get_map().is_valid() << std::endl;
|
<< ", valid="<< cst.get_map().is_valid() << std::endl;
|
||||||
|
|
@ -137,16 +137,16 @@ int main(int argc, char** argv)
|
||||||
length=static_cast<unsigned int>(random.get_int(l1, l2+1));
|
length=static_cast<unsigned int>(random.get_int(l1, l2+1));
|
||||||
defo=static_cast<unsigned int>(random.get_int(d1, d2+1));
|
defo=static_cast<unsigned int>(random.get_int(d1, d2+1));
|
||||||
|
|
||||||
std::vector<CGAL::Path_on_surface<LCC_3_cmap> > paths;
|
std::vector<Path_on_surface<LCC_3_cmap> > paths;
|
||||||
std::vector<CGAL::Path_on_surface<LCC_3_cmap> > transformed_paths;
|
std::vector<Path_on_surface<LCC_3_cmap> > transformed_paths;
|
||||||
|
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> path1(lcc);
|
Path_on_surface<LCC_3_cmap> path1(lcc);
|
||||||
path1.generate_random_closed_path(length, random);
|
path1.generate_random_closed_path(length, random);
|
||||||
|
|
||||||
std::cout<<"Path1 size: "<<path1.length()<<" (from "<<length<<" darts); ";
|
std::cout<<"Path1 size: "<<path1.length()<<" (from "<<length<<" darts); ";
|
||||||
paths.push_back(path1);
|
paths.push_back(path1);
|
||||||
|
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> path2(path1);
|
Path_on_surface<LCC_3_cmap> path2(path1);
|
||||||
path2.update_path_randomly(defo, random);
|
path2.update_path_randomly(defo, random);
|
||||||
std::cout<<"Path2 size: "<<path2.length()<<" (from "<<defo<<" deformations): ";
|
std::cout<<"Path2 size: "<<path2.length()<<" (from "<<defo<<" deformations): ";
|
||||||
paths.push_back(path2);
|
paths.push_back(path2);
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,18 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
typedef CGAL::Polygonal_schema_with_combinatorial_map<> PS;
|
using namespace CGAL::Surface_mesh_topology;
|
||||||
|
typedef Polygonal_schema_with_combinatorial_map<> PS;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
PS ps;
|
PS ps;
|
||||||
ps.add_facet("a b -a -b c d -c -d");
|
ps.add_facet("a b -a -b c d -c -d");
|
||||||
|
|
||||||
CGAL::Path_on_surface<PS> p1(ps); p1.push_back_by_label("a");
|
Path_on_surface<PS> p1(ps); p1.push_back_by_label("a");
|
||||||
CGAL::Path_on_surface<PS> p2(ps); p2.push_back_by_label("b c a -c -b");
|
Path_on_surface<PS> p2(ps); p2.push_back_by_label("b c a -c -b");
|
||||||
|
|
||||||
CGAL::Curves_on_surface_topology<PS> cst(ps);
|
Curves_on_surface_topology<PS> cst(ps);
|
||||||
|
|
||||||
bool res1=cst.are_freely_homotopic(p1, p2);
|
bool res1=cst.are_freely_homotopic(p1, p2);
|
||||||
std::cout<<"Paths p1 and p2 "<<(res1?"ARE":"ARE NOT")
|
std::cout<<"Paths p1 and p2 "<<(res1?"ARE":"ARE NOT")
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
typedef CGAL::Polygonal_schema_with_combinatorial_map<> PS;
|
typedef CGAL::Surface_mesh_topology::Polygonal_schema_with_combinatorial_map<> PS;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
@ -23,10 +23,10 @@ int main()
|
||||||
std::cout<<"Number of cells of the combinatorial maps: ";
|
std::cout<<"Number of cells of the combinatorial maps: ";
|
||||||
ps.display_characteristics(std::cout)<<std::endl;
|
ps.display_characteristics(std::cout)<<std::endl;
|
||||||
|
|
||||||
CGAL::Path_on_surface<PS> p(ps);
|
CGAL::Surface_mesh_topology::Path_on_surface<PS> p(ps);
|
||||||
p.push_back_by_label("a b -a e -b d");
|
p.push_back_by_label("a b -a e -b d");
|
||||||
|
|
||||||
CGAL::Curves_on_surface_topology<PS> cst(ps);
|
CGAL::Surface_mesh_topology::Curves_on_surface_topology<PS> cst(ps);
|
||||||
bool res=cst.is_contractible(p);
|
bool res=cst.is_contractible(p);
|
||||||
std::cout<<"Path "<<(res?"IS":"IS NOT")<<" contractible."<<std::endl;
|
std::cout<<"Path "<<(res?"IS":"IS NOT")<<" contractible."<<std::endl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
#include <CGAL/Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
|
|
||||||
#include <CGAL/Curves_on_surface_topology.h>
|
#include <CGAL/Curves_on_surface_topology.h>
|
||||||
#include <CGAL/Path_generators.h>
|
|
||||||
#include <CGAL/Path_on_surface.h>
|
#include <CGAL/Path_on_surface.h>
|
||||||
#include <CGAL/boost/graph/io.h>
|
#include <CGAL/boost/graph/io.h>
|
||||||
#include <CGAL/Face_graph_wrapper.h>
|
#include <CGAL/Face_graph_wrapper.h>
|
||||||
|
|
@ -17,17 +16,20 @@ typedef Kernel::Point_3 Point_3;
|
||||||
typedef CGAL::Surface_mesh<Point_3> SM;
|
typedef CGAL::Surface_mesh<Point_3> SM;
|
||||||
|
|
||||||
static unsigned int seed; // Use the same seed for the two tests
|
static unsigned int seed; // Use the same seed for the two tests
|
||||||
|
|
||||||
|
using namespace CGAL::Surface_mesh_topology;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
template<class FaceGraph>
|
template<class FaceGraph>
|
||||||
void test(const FaceGraph& mesh)
|
void test(const FaceGraph& mesh)
|
||||||
{
|
{
|
||||||
CGAL::Random random(seed);
|
CGAL::Random random(seed);
|
||||||
CGAL::Curves_on_surface_topology<FaceGraph> cst(mesh);
|
Curves_on_surface_topology<FaceGraph> cst(mesh);
|
||||||
|
|
||||||
CGAL::Path_on_surface<FaceGraph> p1(mesh); // A first path
|
Path_on_surface<FaceGraph> p1(mesh); // A first path
|
||||||
p1.generate_random_closed_path(10, random);
|
p1.generate_random_closed_path(10, random);
|
||||||
|
|
||||||
CGAL::Path_on_surface<FaceGraph> p2(mesh); // A second path
|
Path_on_surface<FaceGraph> p2(mesh); // A second path
|
||||||
p2.generate_random_closed_path(10, random);
|
p2.generate_random_closed_path(10, random);
|
||||||
|
|
||||||
bool res1=cst.is_contractible(p1);
|
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."<<std::endl;
|
std::cout<<"Path p1 "<<(res2?"IS":"IS NOT")<<" homotopic with path p2."<<std::endl;
|
||||||
|
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
std::vector<CGAL::Path_on_surface<FaceGraph> > paths={p1, p2};
|
std::vector<Path_on_surface<FaceGraph> > paths={p1, p2};
|
||||||
CGAL::draw(mesh, paths); // Enable only if CGAL was compiled with Qt5 */
|
CGAL::draw(mesh, paths); // Enable only if CGAL was compiled with Qt5 */
|
||||||
#endif // CGAL_USE_BASIC_VIEWER
|
#endif // CGAL_USE_BASIC_VIEWER
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
// This file is part of CGAL (www.cgal.org).
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
// You can redistribute it and/or modify it under the terms of the GNU
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
// General Public License as published by the Free Software Foundation,
|
||||||
// or (at your option) any later version.
|
// either version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Licensees holding a valid commercial license may use this file in
|
// Licensees holding a valid commercial license may use this file in
|
||||||
// accordance with the commercial license agreement provided with the software.
|
// accordance with the commercial license agreement provided with the software.
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
//
|
//
|
||||||
// $URL$
|
// $URL$
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
||||||
//
|
//
|
||||||
#ifndef CGAL_HOMOTOPY_TESTER_H
|
#ifndef CGAL_CURVES_ON_SURFACE_TOPOLOGY_H
|
||||||
#define CGAL_HOMOTOPY_TESTER_H 1
|
#define CGAL_CURVES_ON_SURFACE_TOPOLOGY_H 1
|
||||||
|
|
||||||
// Should be defined before to include Path_on_surface_with_rle.h
|
// Should be defined before to include Path_on_surface_with_rle.h
|
||||||
// If nothing is defined, use V1
|
// 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_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)
|
#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 <CGAL/license/Surface_mesh_topology.h>
|
||||||
|
|
||||||
#include <CGAL/Union_find.h>
|
#include <CGAL/Union_find.h>
|
||||||
#include <CGAL/Random.h>
|
#include <CGAL/Random.h>
|
||||||
#include <CGAL/Path_on_surface.h>
|
#include <CGAL/Path_on_surface.h>
|
||||||
#include <CGAL/Path_on_surface_with_rle.h>
|
#include <CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h>
|
||||||
#include <CGAL/Path_generators.h>
|
#include <CGAL/Surface_mesh_topology/internal/Path_generators.h>
|
||||||
#include <CGAL/Combinatorial_map_operations.h>
|
#include <CGAL/Combinatorial_map_operations.h>
|
||||||
#include <CGAL/Timer.h>
|
#include <CGAL/Timer.h>
|
||||||
#include <CGAL/Face_graph_wrapper.h>
|
#include <CGAL/Face_graph_wrapper.h>
|
||||||
|
|
@ -40,6 +42,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
namespace Surface_mesh_topology {
|
||||||
|
|
||||||
struct CMap_for_homotopy_tester_items
|
struct CMap_for_homotopy_tester_items
|
||||||
{
|
{
|
||||||
|
|
@ -324,7 +327,7 @@ CMap_for_homotopy_tester;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
internal::Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
||||||
pt=transform_original_path_into_quad_surface_with_rle(p);
|
pt=transform_original_path_into_quad_surface_with_rle(p);
|
||||||
|
|
||||||
pt.canonize();
|
pt.canonize();
|
||||||
|
|
@ -379,9 +382,9 @@ CMap_for_homotopy_tester;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
internal::Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
||||||
pt1=transform_original_path_into_quad_surface_with_rle(p1);
|
pt1=transform_original_path_into_quad_surface_with_rle(p1);
|
||||||
Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
internal::Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
||||||
pt2=transform_original_path_into_quad_surface_with_rle(p2);
|
pt2=transform_original_path_into_quad_surface_with_rle(p2);
|
||||||
pt1.canonize();
|
pt1.canonize();
|
||||||
pt2.canonize();
|
pt2.canonize();
|
||||||
|
|
@ -501,11 +504,11 @@ CMap_for_homotopy_tester;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
internal::Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
||||||
transform_original_path_into_quad_surface_with_rle
|
transform_original_path_into_quad_surface_with_rle
|
||||||
(const Path_on_surface<Mesh>& path) const
|
(const Path_on_surface<Mesh>& path) const
|
||||||
{
|
{
|
||||||
Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
internal::Path_on_surface_with_rle<CMap_for_homotopy_tester>
|
||||||
res(m_map
|
res(m_map
|
||||||
#ifdef CGAL_PWRLE_TURN_V2
|
#ifdef CGAL_PWRLE_TURN_V2
|
||||||
, m_dart_ids
|
, m_dart_ids
|
||||||
|
|
@ -1158,7 +1161,8 @@ CMap_for_homotopy_tester;
|
||||||
#endif // CGAL_PWRLE_TURN_V2
|
#endif // CGAL_PWRLE_TURN_V2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Surface_mesh_topology
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_HOMOTOPY_TESTER_H //
|
#endif // CGAL_CURVES_ON_SURFACE_TOPOLOGY_H //
|
||||||
// EOF //
|
// EOF //
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
// This file is part of CGAL (www.cgal.org).
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
// You can redistribute it and/or modify it under the terms of the GNU
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
// General Public License as published by the Free Software Foundation,
|
||||||
// or (at your option) any later version.
|
// either version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Licensees holding a valid commercial license may use this file in
|
// Licensees holding a valid commercial license may use this file in
|
||||||
// accordance with the commercial license agreement provided with the software.
|
// accordance with the commercial license agreement provided with the software.
|
||||||
|
|
@ -14,17 +14,20 @@
|
||||||
//
|
//
|
||||||
// $URL$
|
// $URL$
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
||||||
//
|
//
|
||||||
#ifndef CGAL_PATH_ON_SURFACE_H
|
#ifndef CGAL_PATH_ON_SURFACE_H
|
||||||
#define CGAL_PATH_ON_SURFACE_H 1
|
#define CGAL_PATH_ON_SURFACE_H 1
|
||||||
|
|
||||||
|
#include <CGAL/license/Surface_mesh_topology.h>
|
||||||
|
|
||||||
#include <CGAL/Combinatorial_map_operations.h>
|
#include <CGAL/Combinatorial_map_operations.h>
|
||||||
#include <CGAL/Combinatorial_map.h>
|
#include <CGAL/Combinatorial_map.h>
|
||||||
#include <CGAL/Random.h>
|
#include <CGAL/Random.h>
|
||||||
#include <CGAL/Face_graph_wrapper.h>
|
#include <CGAL/Face_graph_wrapper.h>
|
||||||
|
#include <CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h>
|
||||||
#include <boost/algorithm/searching/knuth_morris_pratt.hpp>
|
#include <boost/algorithm/searching/knuth_morris_pratt.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
@ -34,14 +37,12 @@
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
namespace Surface_mesh_topology {
|
||||||
template<typename Mesh>
|
|
||||||
class Path_on_surface_with_rle;
|
|
||||||
|
|
||||||
template<typename Mesh>
|
template<typename Mesh>
|
||||||
class Path_on_surface
|
class Path_on_surface
|
||||||
{
|
{
|
||||||
friend class Path_on_surface_with_rle<Mesh>;
|
friend class internal::Path_on_surface_with_rle<Mesh>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Path_on_surface<Mesh> Self;
|
typedef Path_on_surface<Mesh> Self;
|
||||||
|
|
@ -51,7 +52,7 @@ public:
|
||||||
Path_on_surface(const Mesh& amap) : m_map(amap), m_is_closed(false)
|
Path_on_surface(const Mesh& amap) : m_map(amap), m_is_closed(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Path_on_surface(const Path_on_surface_with_rle<Mesh>& apath) :
|
Path_on_surface(const internal::Path_on_surface_with_rle<Mesh>& apath) :
|
||||||
m_map(apath.get_map()),
|
m_map(apath.get_map()),
|
||||||
m_is_closed(apath.is_closed())
|
m_is_closed(apath.is_closed())
|
||||||
{
|
{
|
||||||
|
|
@ -937,6 +938,7 @@ protected:
|
||||||
bool m_is_closed; /// True iff the path is a cycle
|
bool m_is_closed; /// True iff the path is a cycle
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Surface_mesh_topology
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_PATH_ON_SURFACE_H //
|
#endif // CGAL_PATH_ON_SURFACE_H //
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
// This file is part of CGAL (www.cgal.org).
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
// You can redistribute it and/or modify it under the terms of the GNU
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
// General Public License as published by the Free Software Foundation,
|
||||||
// or (at your option) any later version.
|
// either version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Licensees holding a valid commercial license may use this file in
|
// Licensees holding a valid commercial license may use this file in
|
||||||
// accordance with the commercial license agreement provided with the software.
|
// accordance with the commercial license agreement provided with the software.
|
||||||
|
|
@ -14,25 +14,28 @@
|
||||||
//
|
//
|
||||||
// $URL$
|
// $URL$
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
||||||
//
|
//
|
||||||
#ifndef CGAL_POLYGONAL_SCHEMA_H
|
#ifndef CGAL_POLYGONAL_SCHEMA_H
|
||||||
#define CGAL_POLYGONAL_SCHEMA_H 1
|
#define CGAL_POLYGONAL_SCHEMA_H 1
|
||||||
|
|
||||||
|
#include <CGAL/license/Surface_mesh_topology.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <initializer_list>
|
||||||
#include <CGAL/assertions.h>
|
#include <CGAL/assertions.h>
|
||||||
#include <CGAL/memory.h>
|
#include <CGAL/memory.h>
|
||||||
#include <CGAL/Polygonal_schema_min_items.h>
|
#include <CGAL/Polygonal_schema_min_items.h>
|
||||||
#include <CGAL/Combinatorial_map.h>
|
#include <CGAL/Combinatorial_map.h>
|
||||||
#include <CGAL/Generalized_map.h>
|
#include <CGAL/Generalized_map.h>
|
||||||
#include <initializer_list>
|
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
namespace Surface_mesh_topology {
|
||||||
|
|
||||||
namespace internal
|
namespace internal
|
||||||
{
|
{
|
||||||
|
|
@ -46,141 +49,143 @@ namespace CGAL {
|
||||||
|
|
||||||
return std::string("-")+s;
|
return std::string("-")+s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Map, class Combinatorial_data_structure=
|
||||||
|
typename Map::Combinatorial_data_structure>
|
||||||
|
struct Polygonal_schema_tools
|
||||||
|
{};
|
||||||
|
template<class CMap>
|
||||||
|
struct Polygonal_schema_tools<CMap, Combinatorial_map_tag>
|
||||||
|
{
|
||||||
|
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<std::string, Dart_handle>& edge_label_to_dart)
|
||||||
|
{
|
||||||
|
if (dart_same_label!=NULL && dart_opposite_label!=NULL)
|
||||||
|
{
|
||||||
|
std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<<s
|
||||||
|
<<" and "<<internal::opposite_label(s)<<" are already added in the surface."
|
||||||
|
<<" This label can not be use anymore."<<std::endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dart_same_label!=NULL)
|
||||||
|
{
|
||||||
|
std::cerr<<"Polygonal_schema ERROR: "<<"label "<<s
|
||||||
|
<<" is already added in the surface."
|
||||||
|
<<" Since the surface is orientable, this label can not be use anymore."<<std::endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dart_handle res=cmap.create_dart();
|
||||||
|
edge_label_to_dart[s]=res;
|
||||||
|
|
||||||
|
cmap.info(res).m_label=new char[s.size()+1];
|
||||||
|
strncpy(cmap.info(res).m_label, s.c_str(), s.size()+1); // +1 to copy also the \0 char
|
||||||
|
|
||||||
|
if (prev_dart!=cmap.null_handle)
|
||||||
|
{ cmap.template link_beta<1>(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<class GMap>
|
||||||
|
struct Polygonal_schema_tools<GMap, Generalized_map_tag>
|
||||||
|
{
|
||||||
|
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<std::string, Dart_handle>& edge_label_to_dart)
|
||||||
|
{
|
||||||
|
if (dart_same_label!=NULL && dart_opposite_label!=NULL)
|
||||||
|
{
|
||||||
|
std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<<s
|
||||||
|
<<" and "<<internal::opposite_label(s)<<" are already added in the surface."
|
||||||
|
<<" This label can not be use anymore."<<std::endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dart_handle res=gmap.create_dart();
|
||||||
|
Dart_handle dh2=gmap.create_dart();
|
||||||
|
|
||||||
|
gmap.template link_alpha<0>(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 Combinatorial_map_tag;
|
||||||
struct Generalized_map_tag;
|
struct Generalized_map_tag;
|
||||||
|
|
||||||
template<class Map, class Combinatorial_data_structure=
|
|
||||||
typename Map::Combinatorial_data_structure>
|
|
||||||
struct Polygonal_schema_tools
|
|
||||||
{};
|
|
||||||
template<class CMap>
|
|
||||||
struct Polygonal_schema_tools<CMap, Combinatorial_map_tag>
|
|
||||||
{
|
|
||||||
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<std::string, Dart_handle>& edge_label_to_dart)
|
|
||||||
{
|
|
||||||
if (dart_same_label!=NULL && dart_opposite_label!=NULL)
|
|
||||||
{
|
|
||||||
std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<<s
|
|
||||||
<<" and "<<internal::opposite_label(s)<<" are already added in the surface."
|
|
||||||
<<" This label can not be use anymore."<<std::endl;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dart_same_label!=NULL)
|
|
||||||
{
|
|
||||||
std::cerr<<"Polygonal_schema ERROR: "<<"label "<<s
|
|
||||||
<<" is already added in the surface."
|
|
||||||
<<" Since the surface is orientable, this label can not be use anymore."<<std::endl;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
Dart_handle res=cmap.create_dart();
|
|
||||||
edge_label_to_dart[s]=res;
|
|
||||||
|
|
||||||
cmap.info(res).m_label=new char[s.size()+1];
|
|
||||||
strncpy(cmap.info(res).m_label, s.c_str(), s.size()+1); // +1 to copy also the \0 char
|
|
||||||
|
|
||||||
if (prev_dart!=cmap.null_handle)
|
|
||||||
{ cmap.template link_beta<1>(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<class GMap>
|
|
||||||
struct Polygonal_schema_tools<GMap, Generalized_map_tag>
|
|
||||||
{
|
|
||||||
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<std::string, Dart_handle>& edge_label_to_dart)
|
|
||||||
{
|
|
||||||
if (dart_same_label!=NULL && dart_opposite_label!=NULL)
|
|
||||||
{
|
|
||||||
std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<<s
|
|
||||||
<<" and "<<internal::opposite_label(s)<<" are already added in the surface."
|
|
||||||
<<" This label can not be use anymore."<<std::endl;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
Dart_handle res=gmap.create_dart();
|
|
||||||
Dart_handle dh2=gmap.create_dart();
|
|
||||||
|
|
||||||
gmap.template link_alpha<0>(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 >
|
template < class BaseModel >
|
||||||
class Polygonal_schema_base: public 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_same_label=get_dart_labeled(s);
|
||||||
Dart_handle dart_opposite_label=get_dart_labeled(internal::opposite_label(s));
|
Dart_handle dart_opposite_label=get_dart_labeled(internal::opposite_label(s));
|
||||||
|
|
||||||
Dart_handle cur=Polygonal_schema_tools<Map>::
|
Dart_handle cur=internal::Polygonal_schema_tools<Map>::
|
||||||
add_edge_to_face(*this, s, prev_dart, dart_same_label, dart_opposite_label,
|
add_edge_to_face(*this, s, prev_dart, dart_same_label, dart_opposite_label,
|
||||||
edge_label_to_dart);
|
edge_label_to_dart);
|
||||||
|
|
||||||
|
|
@ -335,7 +340,7 @@ namespace CGAL {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string get_label(Dart_handle dh) const
|
std::string get_label(Dart_handle dh) const
|
||||||
{ return Polygonal_schema_tools<Map>::get_label(dh); }
|
{ return internal::Polygonal_schema_tools<Map>::get_label(dh); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// For each edge label, its corresponding dart. Stores both association a -a, to allow
|
// 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
|
} //namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_POLYGONAL_SCHEMA_H //
|
#endif // CGAL_POLYGONAL_SCHEMA_H //
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
// This file is part of CGAL (www.cgal.org).
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
// You can redistribute it and/or modify it under the terms of the GNU
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
// General Public License as published by the Free Software Foundation,
|
||||||
// or (at your option) any later version.
|
// either version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Licensees holding a valid commercial license may use this file in
|
// Licensees holding a valid commercial license may use this file in
|
||||||
// accordance with the commercial license agreement provided with the software.
|
// accordance with the commercial license agreement provided with the software.
|
||||||
|
|
@ -14,16 +14,19 @@
|
||||||
//
|
//
|
||||||
// $URL$
|
// $URL$
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
||||||
//
|
//
|
||||||
#ifndef CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H
|
#ifndef CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H
|
||||||
#define CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H 1
|
#define CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H 1
|
||||||
|
|
||||||
|
#include <CGAL/license/Surface_mesh_topology.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
namespace Surface_mesh_topology {
|
||||||
|
|
||||||
/** @file Polygonal_schema_min_items.h
|
/** @file Polygonal_schema_min_items.h
|
||||||
* Definition of min item class for Polygonal_schema.
|
* Definition of min item class for Polygonal_schema.
|
||||||
|
|
@ -50,6 +53,7 @@ namespace CGAL {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Surface_mesh_topology
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H
|
#endif // CGAL_POLYGONAL_SCHEMA_MIN_ITEMS_H
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) 2017 CNRS and LIRIS' Establishments (France).
|
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
// This file is part of CGAL (www.cgal.org).
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
// You can redistribute it and/or modify it under the terms of the GNU
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
// General Public License as published by the Free Software Foundation,
|
||||||
// or (at your option) any later version.
|
// either version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Licensees holding a valid commercial license may use this file in
|
// Licensees holding a valid commercial license may use this file in
|
||||||
// accordance with the commercial license agreement provided with the software.
|
// accordance with the commercial license agreement provided with the software.
|
||||||
|
|
@ -14,20 +14,23 @@
|
||||||
//
|
//
|
||||||
// $URL$
|
// $URL$
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
||||||
//
|
//
|
||||||
#ifndef CGAL_PATH_GENERATORS_H
|
#ifndef CGAL_PATH_GENERATORS_H
|
||||||
#define CGAL_PATH_GENERATORS_H 1
|
#define CGAL_PATH_GENERATORS_H 1
|
||||||
|
|
||||||
|
#include <CGAL/license/Surface_mesh_topology.h>
|
||||||
|
|
||||||
#include <CGAL/Random.h>
|
#include <CGAL/Random.h>
|
||||||
#include<unordered_set>
|
#include <unordered_set>
|
||||||
#include<unordered_map>
|
#include <unordered_map>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
namespace Surface_mesh_topology {
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
template<typename Path>
|
template<typename Path>
|
||||||
void create_braket_positive(Path& p, std::size_t length, CGAL::Random& random,
|
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.clear();
|
||||||
path.initialize_random_starting_dart(random);
|
path.initialize_random_starting_dart(random);
|
||||||
path.extend_straight_positive(nb1-1);
|
path.extend_straight_positive(nb1-1);
|
||||||
CGAL::create_braket_positive(path, nb2);
|
create_braket_positive(path, nb2);
|
||||||
path.extend_straight_positive(nb3);
|
path.extend_straight_positive(nb3);
|
||||||
path.generate_random_path(random.get_int(0, 15), random);
|
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());
|
CGAL_assertion(p.is_closed());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace internal
|
||||||
|
} // namespace Surface_mesh_topology
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_PATH_GENERATORS_H //
|
#endif // CGAL_PATH_GENERATORS_H //
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
// This file is part of CGAL (www.cgal.org).
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
// You can redistribute it and/or modify it under the terms of the GNU
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
// General Public License as published by the Free Software Foundation,
|
||||||
// or (at your option) any later version.
|
// either version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Licensees holding a valid commercial license may use this file in
|
// Licensees holding a valid commercial license may use this file in
|
||||||
// accordance with the commercial license agreement provided with the software.
|
// accordance with the commercial license agreement provided with the software.
|
||||||
|
|
@ -14,13 +14,15 @@
|
||||||
//
|
//
|
||||||
// $URL$
|
// $URL$
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
||||||
//
|
//
|
||||||
#ifndef CGAL_PATH_ON_SURFACE_WITH_RLE_H
|
#ifndef CGAL_PATH_ON_SURFACE_WITH_RLE_H
|
||||||
#define CGAL_PATH_ON_SURFACE_WITH_RLE_H 1
|
#define CGAL_PATH_ON_SURFACE_WITH_RLE_H 1
|
||||||
|
|
||||||
|
#include <CGAL/license/Surface_mesh_topology.h>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
@ -32,10 +34,13 @@
|
||||||
#include <boost/unordered_set.hpp>
|
#include <boost/unordered_set.hpp>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
namespace Surface_mesh_topology {
|
||||||
|
|
||||||
template<typename Map_>
|
template<typename Map_>
|
||||||
class Path_on_surface;
|
class Path_on_surface;
|
||||||
|
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
// A flat is a sequence of darts given by its two extremities: begin and end,
|
// 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).
|
// with +2 turns (if length>0) or -2 turns (if length<0).
|
||||||
// length==0 => begin==end.
|
// length==0 => begin==end.
|
||||||
|
|
@ -1740,6 +1745,8 @@ protected:
|
||||||
#endif //CGAL_PWRLE_TURN_V2
|
#endif //CGAL_PWRLE_TURN_V2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace internal
|
||||||
|
} // namespace Surface_mesh_topology
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_PATH_ON_SURFACE_WITH_RLE_H //
|
#endif // CGAL_PATH_ON_SURFACE_WITH_RLE_H //
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
// This file is part of CGAL (www.cgal.org).
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
// You can redistribute it and/or modify it under the terms of the GNU
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
// General Public License as published by the Free Software Foundation,
|
||||||
// or (at your option) any later version.
|
// either version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Licensees holding a valid commercial license may use this file in
|
// Licensees holding a valid commercial license may use this file in
|
||||||
// accordance with the commercial license agreement provided with the software.
|
// accordance with the commercial license agreement provided with the software.
|
||||||
|
|
@ -14,12 +14,15 @@
|
||||||
//
|
//
|
||||||
// $URL$
|
// $URL$
|
||||||
// $Id$
|
// $Id$
|
||||||
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
|
||||||
|
//
|
||||||
#ifndef CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H
|
#ifndef CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H
|
||||||
#define CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H
|
#define CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H
|
||||||
|
|
||||||
|
#include <CGAL/license/Surface_mesh_topology.h>
|
||||||
|
|
||||||
#include <CGAL/draw_linear_cell_complex.h>
|
#include <CGAL/draw_linear_cell_complex.h>
|
||||||
|
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
|
|
@ -27,8 +30,8 @@
|
||||||
#include <CGAL/Random.h>
|
#include <CGAL/Random.h>
|
||||||
#include <CGAL/Path_on_surface.h>
|
#include <CGAL/Path_on_surface.h>
|
||||||
|
|
||||||
namespace CGAL
|
namespace CGAL {
|
||||||
{
|
|
||||||
// Specialisation for face graph; otherwise use the LCC_geom_utils of LCC.
|
// Specialisation for face graph; otherwise use the LCC_geom_utils of LCC.
|
||||||
template<class Mesh, class Kernel>
|
template<class Mesh, class Kernel>
|
||||||
struct LCC_geom_utils<CGAL::Face_graph_wrapper<Mesh>, Kernel, 3>
|
struct LCC_geom_utils<CGAL::Face_graph_wrapper<Mesh>, Kernel, 3>
|
||||||
|
|
@ -99,7 +102,7 @@ public:
|
||||||
/// usefull for very big object where this time could be long)
|
/// usefull for very big object where this time could be long)
|
||||||
Face_graph_with_path_viewer(QWidget* parent,
|
Face_graph_with_path_viewer(QWidget* parent,
|
||||||
const Mesh& amesh,
|
const Mesh& amesh,
|
||||||
const std::vector<Path_on_surface<Mesh> >* paths=NULL,
|
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh> >* paths=NULL,
|
||||||
std::size_t amark=LCC::INVALID_MARK,
|
std::size_t amark=LCC::INVALID_MARK,
|
||||||
const char* title="", bool anofaces=false,
|
const char* title="", bool anofaces=false,
|
||||||
const DrawingFunctorLCC& drawing_functor=DrawingFunctorLCC()) :
|
const DrawingFunctorLCC& drawing_functor=DrawingFunctorLCC()) :
|
||||||
|
|
@ -332,7 +335,7 @@ protected:
|
||||||
const typename Get_map<Mesh, Mesh>::storage_type lcc;
|
const typename Get_map<Mesh, Mesh>::storage_type lcc;
|
||||||
bool m_nofaces;
|
bool m_nofaces;
|
||||||
const DrawingFunctorLCC& m_drawing_functor;
|
const DrawingFunctorLCC& m_drawing_functor;
|
||||||
const std::vector<Path_on_surface<Mesh> >* m_paths;
|
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh> >* m_paths;
|
||||||
unsigned int m_current_path;
|
unsigned int m_current_path;
|
||||||
unsigned int m_current_dart;
|
unsigned int m_current_dart;
|
||||||
bool m_draw_marked_darts;
|
bool m_draw_marked_darts;
|
||||||
|
|
@ -341,7 +344,7 @@ protected:
|
||||||
|
|
||||||
template<class Mesh, class DrawingFunctor>
|
template<class Mesh, class DrawingFunctor>
|
||||||
void draw(const Mesh& alcc,
|
void draw(const Mesh& alcc,
|
||||||
const std::vector<Path_on_surface<Mesh> >& paths,
|
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh> >& paths,
|
||||||
const char* title="Mesh Viewer",
|
const char* title="Mesh Viewer",
|
||||||
std::size_t amark=-1,
|
std::size_t amark=-1,
|
||||||
bool nofill=false,
|
bool nofill=false,
|
||||||
|
|
@ -369,7 +372,7 @@ void draw(const Mesh& alcc,
|
||||||
|
|
||||||
template<class Mesh>
|
template<class Mesh>
|
||||||
void draw(const Mesh& alcc,
|
void draw(const Mesh& alcc,
|
||||||
const std::vector<Path_on_surface<Mesh> >& paths,
|
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh> >& paths,
|
||||||
const char* title="LCC Viewer",
|
const char* title="LCC Viewer",
|
||||||
std::size_t amark=-1,
|
std::size_t amark=-1,
|
||||||
bool nofill=false)
|
bool nofill=false)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2017 CNRS and LIRIS' Establishments (France).
|
// Copyright (c) 2019 CNRS and LIRIS' Establishments (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
// 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
|
#ifndef CGAL_CREATION_OF_TEST_CASES_FOR_PATHS_H
|
||||||
#define CGAL_CREATION_OF_TEST_CASES_FOR_PATHS_H 1
|
#define CGAL_CREATION_OF_TEST_CASES_FOR_PATHS_H 1
|
||||||
|
|
||||||
#include<CGAL/Path_generators.h>
|
#include<CGAL/Surface_mesh_topology/internal/Path_generators.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/Linear_cell_complex_constructors.h>
|
#include <CGAL/Linear_cell_complex_constructors.h>
|
||||||
#include <CGAL/Path_on_surface.h>
|
#include <CGAL/Path_on_surface.h>
|
||||||
#include <CGAL/Path_on_surface_with_rle.h>
|
#include <CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
typedef CGAL::Combinatorial_map<2> CMap;
|
typedef CGAL::Combinatorial_map<2> CMap;
|
||||||
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3;
|
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3;
|
||||||
|
using namespace CGAL::Surface_mesh_topology;
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
bool basic_tests()
|
bool basic_tests()
|
||||||
{
|
{
|
||||||
|
|
@ -15,7 +16,7 @@ bool basic_tests()
|
||||||
CMap cmap;
|
CMap cmap;
|
||||||
cmap.make_combinatorial_hexahedron();
|
cmap.make_combinatorial_hexahedron();
|
||||||
|
|
||||||
CGAL::Path_on_surface<CMap> p1(cmap);
|
Path_on_surface<CMap> p1(cmap);
|
||||||
p1.initialize_random_starting_dart();
|
p1.initialize_random_starting_dart();
|
||||||
p1.extend_straight_positive(3);
|
p1.extend_straight_positive(3);
|
||||||
if (!p1.is_valid() || p1.length()!=4 || !p1.is_closed() || !p1.is_simple())
|
if (!p1.is_valid() || p1.length()!=4 || !p1.is_closed() || !p1.is_simple())
|
||||||
|
|
@ -25,14 +26,14 @@ bool basic_tests()
|
||||||
res=false;
|
res=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface<CMap> p2(p1);
|
Path_on_surface<CMap> p2(p1);
|
||||||
if (p1!=p2 || !p1.are_paths_equals(p2))
|
if (p1!=p2 || !p1.are_paths_equals(p2))
|
||||||
{
|
{
|
||||||
std::cerr<<"path_tests ERROR: p1!=p2 || !p1.are_paths_equals(p2)."<<std::endl;
|
std::cerr<<"path_tests ERROR: p1!=p2 || !p1.are_paths_equals(p2)."<<std::endl;
|
||||||
res=false;
|
res=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface<CMap> p3(cmap);
|
Path_on_surface<CMap> p3(cmap);
|
||||||
p3.push_back(cmap.beta<2>(p1.front()));
|
p3.push_back(cmap.beta<2>(p1.front()));
|
||||||
p3.extend_straight_negative(3);
|
p3.extend_straight_negative(3);
|
||||||
if (p3.length()!=4 || !p3.is_closed())
|
if (p3.length()!=4 || !p3.is_closed())
|
||||||
|
|
@ -58,7 +59,7 @@ bool basic_tests()
|
||||||
res=false;
|
res=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface<CMap> p4(p3);
|
Path_on_surface<CMap> p4(p3);
|
||||||
p4.reverse();
|
p4.reverse();
|
||||||
if (p3!=p4 || !p3.are_paths_equals(p4))
|
if (p3!=p4 || !p3.are_paths_equals(p4))
|
||||||
{
|
{
|
||||||
|
|
@ -66,7 +67,7 @@ bool basic_tests()
|
||||||
res=false;
|
res=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface<CMap> p5(cmap);
|
Path_on_surface<CMap> p5(cmap);
|
||||||
p5.push_back(cmap.beta<2>(p1.front()));
|
p5.push_back(cmap.beta<2>(p1.front()));
|
||||||
for (int i=0; i<3; ++i)
|
for (int i=0; i<3; ++i)
|
||||||
{ p5.extend_positive_turn(); }
|
{ p5.extend_positive_turn(); }
|
||||||
|
|
@ -79,7 +80,7 @@ bool basic_tests()
|
||||||
|
|
||||||
p1.push_around_face(0);
|
p1.push_around_face(0);
|
||||||
|
|
||||||
CGAL::Path_on_surface<CMap> p6(cmap);
|
Path_on_surface<CMap> p6(cmap);
|
||||||
p6.push_back(p1.front());
|
p6.push_back(p1.front());
|
||||||
p6.extend_straight_positive(2);
|
p6.extend_straight_positive(2);
|
||||||
p6.extend_positive_turn(1);
|
p6.extend_positive_turn(1);
|
||||||
|
|
@ -90,21 +91,21 @@ bool basic_tests()
|
||||||
res=false;
|
res=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface_with_rle<CMap> p7(p6);
|
internal::Path_on_surface_with_rle<CMap> p7(p6);
|
||||||
if (!p7.is_valid() || p7.size_of_list()!=2)
|
if (!p7.is_valid() || p7.size_of_list()!=2)
|
||||||
{
|
{
|
||||||
std::cerr<<"path_tests ERROR: !p7.is_valid() || size_of_list()!=2."<<std::endl;
|
std::cerr<<"path_tests ERROR: !p7.is_valid() || size_of_list()!=2."<<std::endl;
|
||||||
res=false;
|
res=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface<CMap> p8(p7);
|
Path_on_surface<CMap> p8(p7);
|
||||||
if (!p8.is_valid() || p6!=p8 || !p6.are_paths_equals(p8))
|
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)."<<std::endl;
|
std::cerr<<"path_tests ERROR: !p8.is_valid() || p6!=p8 || !p6.are_paths_equals(p8)."<<std::endl;
|
||||||
res=false;
|
res=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface<CMap> p9(cmap);
|
Path_on_surface<CMap> p9(cmap);
|
||||||
p9.push_back(p1.front());
|
p9.push_back(p1.front());
|
||||||
if (!p9.can_be_pushed(cmap.beta<1,2,1>(p9.back()))) // 1st
|
if (!p9.can_be_pushed(cmap.beta<1,2,1>(p9.back()))) // 1st
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/Linear_cell_complex_constructors.h>
|
#include <CGAL/Linear_cell_complex_constructors.h>
|
||||||
#include <CGAL/Path_generators.h>
|
|
||||||
#include <CGAL/Path_on_surface.h>
|
#include <CGAL/Path_on_surface.h>
|
||||||
#include <CGAL/Path_on_surface_with_rle.h>
|
#include <CGAL/Surface_mesh_topology/internal/Path_generators.h>
|
||||||
|
#include <CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|
@ -42,15 +42,17 @@ enum Transformation // enum for the type of transformations
|
||||||
FULL_SIMPLIFICATION
|
FULL_SIMPLIFICATION
|
||||||
};
|
};
|
||||||
|
|
||||||
|
using namespace CGAL::Surface_mesh_topology;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void transform_path(CGAL::Path_on_surface<LCC_3_cmap>& path, Transformation t,
|
void transform_path(Path_on_surface<LCC_3_cmap>& path, Transformation t,
|
||||||
bool use_only_positive,
|
bool use_only_positive,
|
||||||
bool use_only_negative,
|
bool use_only_negative,
|
||||||
bool draw=false,
|
bool draw=false,
|
||||||
std::size_t repeat=0) // If 0, repeat as long as there is one modifcation;
|
std::size_t repeat=0) // If 0, repeat as long as there is one modifcation;
|
||||||
// otherwise repeat the given number of times
|
// otherwise repeat the given number of times
|
||||||
{
|
{
|
||||||
std::vector<CGAL::Path_on_surface<LCC_3_cmap> > v;
|
std::vector<Path_on_surface<LCC_3_cmap> > v;
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
if (draw)
|
if (draw)
|
||||||
{
|
{
|
||||||
|
|
@ -59,15 +61,15 @@ void transform_path(CGAL::Path_on_surface<LCC_3_cmap>& path, Transformation t,
|
||||||
}
|
}
|
||||||
#endif // CGAL_USE_BASIC_VIEWER
|
#endif // CGAL_USE_BASIC_VIEWER
|
||||||
|
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> prevp=path;
|
Path_on_surface<LCC_3_cmap> prevp=path;
|
||||||
CGAL::Path_on_surface_with_rle<LCC_3_cmap> curp(path.get_map());
|
internal::Path_on_surface_with_rle<LCC_3_cmap> curp(path.get_map());
|
||||||
std::size_t nb=0;
|
std::size_t nb=0;
|
||||||
bool modified=false;
|
bool modified=false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
curp=CGAL::Path_on_surface_with_rle<LCC_3_cmap>(prevp,
|
curp=internal::Path_on_surface_with_rle<LCC_3_cmap>(prevp,
|
||||||
use_only_positive,
|
use_only_positive,
|
||||||
use_only_negative);
|
use_only_negative);
|
||||||
modified=false;
|
modified=false;
|
||||||
/* curp->display_negative_turns();
|
/* curp->display_negative_turns();
|
||||||
std::cout<<" "; curp->display_positive_turns();
|
std::cout<<" "; curp->display_positive_turns();
|
||||||
|
|
@ -87,7 +89,7 @@ void transform_path(CGAL::Path_on_surface<LCC_3_cmap>& path, Transformation t,
|
||||||
|
|
||||||
if (modified)
|
if (modified)
|
||||||
{
|
{
|
||||||
prevp=CGAL::Path_on_surface<LCC_3_cmap>(curp);
|
prevp=Path_on_surface<LCC_3_cmap>(curp);
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
if (draw) { v.push_back(prevp); }
|
if (draw) { v.push_back(prevp); }
|
||||||
#endif // CGAL_USE_BASIC_VIEWER
|
#endif // CGAL_USE_BASIC_VIEWER
|
||||||
|
|
@ -115,7 +117,7 @@ void transform_path(CGAL::Path_on_surface<LCC_3_cmap>& path, Transformation t,
|
||||||
path.swap(prevp);
|
path.swap(prevp);
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
bool unit_test(CGAL::Path_on_surface<LCC_3_cmap>& path, Transformation t,
|
bool unit_test(Path_on_surface<LCC_3_cmap>& path, Transformation t,
|
||||||
std::size_t repeat,
|
std::size_t repeat,
|
||||||
const char* msg, const char* expected_result,
|
const char* msg, const char* expected_result,
|
||||||
bool draw, int testtorun,
|
bool draw, int testtorun,
|
||||||
|
|
@ -163,7 +165,7 @@ bool test_all_cases_spurs_and_bracket(bool draw, int testtorun)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> path(lcc);
|
Path_on_surface<LCC_3_cmap> path(lcc);
|
||||||
|
|
||||||
generate_one_positive_spur(path); // Test 0
|
generate_one_positive_spur(path); // Test 0
|
||||||
if (!unit_test(path, REDUCTION, 1, "Positive spur (2^6 1 0 2^4)",
|
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"<<std::endl;
|
std::cout<<"PROBLEM reading file ./data/cube-mesh-5-5.off"<<std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> path(lcc);
|
Path_on_surface<LCC_3_cmap> path(lcc);
|
||||||
|
|
||||||
generate_one_l_shape(path); // Test 9
|
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)",
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> path(lcc);
|
Path_on_surface<LCC_3_cmap> path(lcc);
|
||||||
bool res=true;
|
bool res=true;
|
||||||
|
|
||||||
CGAL::Random random(nbtests); // fix seed
|
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 ... )",
|
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))
|
"2 2 2 2 2 2 1", draw, testtorun, true, false))
|
||||||
{ res=false; }
|
{ res=false; }
|
||||||
|
|
||||||
random=CGAL::Random(nbtests);
|
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 ... )",
|
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))
|
"2 1 2 2 2 2 2", draw, testtorun, true, false))
|
||||||
{ res=false; }
|
{ res=false; }
|
||||||
|
|
||||||
random=CGAL::Random(nbtests);
|
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 ...)",
|
if (!unit_test(path, FULL_SIMPLIFICATION, 0, "(2^4 1 2^12 1 2^8 ...)",
|
||||||
"2 1 2", draw, testtorun, true, false))
|
"2 1 2", draw, testtorun, true, false))
|
||||||
{ res=false; }
|
{ res=false; }
|
||||||
|
|
||||||
random=CGAL::Random(nbtests);
|
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 ...)",
|
if (!unit_test(path, FULL_SIMPLIFICATION, 0, "(2^4 1 2^12 1 2^8 ...)",
|
||||||
"1 2 2 2", draw, testtorun, true, false))
|
"1 2 2 2", draw, testtorun, true, false))
|
||||||
{ res=false; }
|
{ res=false; }
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#include <CGAL/Linear_cell_complex_for_generalized_map.h>
|
#include <CGAL/Linear_cell_complex_for_generalized_map.h>
|
||||||
#include <CGAL/Linear_cell_complex_constructors.h>
|
#include <CGAL/Linear_cell_complex_constructors.h>
|
||||||
#include <CGAL/Curves_on_surface_topology.h>
|
#include <CGAL/Curves_on_surface_topology.h>
|
||||||
#include <CGAL/Path_generators.h>
|
#include <CGAL/Surface_mesh_topology/internal/Path_generators.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|
@ -36,9 +36,11 @@ typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3,
|
||||||
static int nbtests=0;
|
static int nbtests=0;
|
||||||
static int starting_seed;
|
static int starting_seed;
|
||||||
|
|
||||||
|
using namespace CGAL::Surface_mesh_topology;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
bool unit_test_canonize(CGAL::Curves_on_surface_topology<LCC_3_cmap>& cst,
|
bool unit_test_canonize(Curves_on_surface_topology<LCC_3_cmap>& cst,
|
||||||
std::vector<CGAL::Path_on_surface<LCC_3_cmap> >& paths,
|
std::vector<Path_on_surface<LCC_3_cmap> >& paths,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
bool draw, int testtorun)
|
bool draw, int testtorun)
|
||||||
{
|
{
|
||||||
|
|
@ -82,7 +84,7 @@ bool unit_test_canonize(CGAL::Curves_on_surface_topology<LCC_3_cmap>& cst,
|
||||||
bool test_double_torus_quad(bool draw, int testtorun)
|
bool test_double_torus_quad(bool draw, int testtorun)
|
||||||
{
|
{
|
||||||
bool res=true;
|
bool res=true;
|
||||||
std::vector<CGAL::Path_on_surface<LCC_3_cmap> > paths;
|
std::vector<Path_on_surface<LCC_3_cmap> > paths;
|
||||||
|
|
||||||
// Test 0 (double torus, three G1 cycles)
|
// 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"<<std::endl;
|
std::cout<<"PROBLEM reading file ./data/double-torus.off"<<std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CGAL::Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
||||||
|
|
||||||
for (unsigned int i=0; i<3; ++i)
|
for (unsigned int i=0; i<3; ++i)
|
||||||
{
|
{
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> p(lcc);
|
Path_on_surface<LCC_3_cmap> p(lcc);
|
||||||
CGAL::generate_g1_double_torus(p, i);
|
CGAL::generate_g1_double_torus(p, i);
|
||||||
paths.push_back(p);
|
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"<<std::endl; // ./data/double-torus-smooth.off"<<std::endl;
|
std::cout<<"PROBLEM reading file ./data/double-torus.off"<<std::endl; // ./data/double-torus-smooth.off"<<std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CGAL::Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
||||||
|
|
||||||
if (testtorun==-1 || nbtests==testtorun)
|
if (testtorun==-1 || nbtests==testtorun)
|
||||||
{
|
{
|
||||||
CGAL::Random random(starting_seed+nbtests);
|
CGAL::Random random(starting_seed+nbtests);
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> p(lcc);
|
Path_on_surface<LCC_3_cmap> 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);
|
paths.push_back(p);
|
||||||
|
|
||||||
p.update_path_randomly(random);
|
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"<<std::endl; // 3torus.off
|
std::cout<<"PROBLEM reading file ./data/3torus-smooth.off"<<std::endl; // 3torus.off
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CGAL::Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
Curves_on_surface_topology<LCC_3_cmap> cst(lcc);
|
||||||
|
|
||||||
if (testtorun==-1 || nbtests==testtorun)
|
if (testtorun==-1 || nbtests==testtorun)
|
||||||
{
|
{
|
||||||
CGAL::Random random(starting_seed+nbtests);
|
CGAL::Random random(starting_seed+nbtests);
|
||||||
CGAL::Path_on_surface<LCC_3_cmap> p(lcc);
|
Path_on_surface<LCC_3_cmap> 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);
|
paths.push_back(p);
|
||||||
|
|
||||||
p.update_path_randomly(random);
|
p.update_path_randomly(random);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue