CGAL 5.6 - Surface Mesh Topology
Loading...
Searching...
No Matches
Surface_mesh_topology/path_simplicity_double_torus_2.cpp
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include <CGAL/Curves_on_surface_topology.h>
#include <CGAL/Path_on_surface.h>
#include <CGAL/draw_face_graph_with_paths.h>
void create_path(Path_on_surface<LCC_3_cmap>& p)
{
p.push_back_by_index(682); // Its starting dart
for (int i=0; i<11; ++i)
{ p.extend_positive_turn(2); } // Extend the path
for (int i=0; i<5; ++i)
for (int i=0; i<2; ++i)
for (int i=0; i<5; ++i)
for (int i=0; i<2; ++i)
for (int i=0; i<2; ++i)
for (int i=0; i<8; ++i)
for (int i=0; i<4; ++i)
for (int i=0; i<5; ++i)
for (int i=0; i<5; ++i)
for (int i=0; i<3; ++i)
for (int i=0; i<11; ++i)
}
int main(int argc, char** argv)
{
bool draw=(argc>1?std::string(argv[1])=="-draw":false);
LCC_3_cmap lcc;
if (!CGAL::load_off(lcc, CGAL::data_file_path("meshes/double-torus-example.off").c_str()))
{
std::cout<<"ERROR reading file data/double-torus.off"<<std::endl;
exit(EXIT_FAILURE);
}
create_path(p);
bool res=cst.is_homotopic_to_simple_cycle(p);
std::cout<<"Path p (pink) "<<(res?"IS":"IS NOT")
<<" simple."<<std::endl;
if (draw)
{ CGAL::draw(lcc, {p}); }
return EXIT_SUCCESS;
}
The class Curves_on_surface_topology provides methods to compute shortest non contractible cycles and...
Definition: Curves_on_surface_topology.h:13
The class Path_on_surface represents a walk in a mesh which is either a model of CombinatorialMap,...
Definition: Path_on_surface.h:13
void extend_positive_turn(std::size_t nb)
adds the dart/halfedge obtained by turning nb times around the target vertex of the last dart/halfedg...
void push_back_by_index(std::size_t i)
adds the dart/halfedge with index i at the end of this path.
void draw(const LCC &alcc)
void draw(const SM &asm)
Definition: Curves_on_surface_topology.h:3