CGAL 6.1.1 - Surface Mesh Topology

Loading...
Searching...
No Matches
Surface_mesh_topology/path_homotopy_with_symbols_2.cpp
#include <CGAL/Polygonal_schema.h>
#include <CGAL/Path_on_surface.h>
#include <CGAL/Curves_on_surface_topology.h>
#include <iostream>
#include <cstdlib>
typedef CGAL::Surface_mesh_topology::Polygonal_schema_with_combinatorial_map<> PS;
int main()
{
PS ps;
ps.add_facet("a b -a c"); // First facet, giving directly its sequence of edges
ps.add_facet("d -c e -b"); // Second facet
ps.init_facet(); // Third facet
ps.add_edges_to_facet("f"); // Here, each edge is added one at a time
ps.add_edges_to_facet("-d");
ps.add_edges_to_facet("-f");
ps.add_edges_to_facet("-e");
ps.finish_facet();
ps.perforate_facet("f");
std::cout<<"Number of cells of the combinatorial maps: ";
ps.display_characteristics(std::cout)<<std::endl;
CGAL::Surface_mesh_topology::Path_on_surface<PS> p(ps);
p.push_back_by_label("a b -a e -b d");
CGAL::Surface_mesh_topology::Curves_on_surface_topology<PS> cst(ps);
bool res=cst.is_contractible(p);
std::cout<<"Path "<<(res?"IS":"IS NOT")<<" contractible."<<std::endl;
return EXIT_SUCCESS;
}
CGAL::Surface_mesh_topology::Curves_on_surface_topology
The class Curves_on_surface_topology provides methods to compute shortest non contractible cycles and...
Definition: Curves_on_surface_topology.h:13
CGAL::Surface_mesh_topology::Curves_on_surface_topology::is_contractible
bool is_contractible(const Path_on_surface< Mesh > &p) const
returns true if the closed path p is contractible.
CGAL::Surface_mesh_topology::Path_on_surface
The class Path_on_surface represents a walk in a mesh which is either a model of CombinatorialMap,...
Definition: Path_on_surface.h:13
CGAL::Surface_mesh_topology::Path_on_surface::push_back_by_label
void push_back_by_label(const std::string &s)
adds successively all darts/halfedges in s (a sequence of labels separated by spaces) at the end of t...
CGAL::Surface_mesh_topology::Polygonal_schema_with_combinatorial_map
The class Polygonal_schema_with_combinatorial_map is a model of PolygonalSchema using Combinatorial_m...
Definition: Polygonal_schema.h:15