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 new file mode 100644 index 00000000000..3e1172b4158 --- /dev/null +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/basic_example_surface_mesh_topology.cpp @@ -0,0 +1,59 @@ +#include +#include +#include + +#include +#include + +/* If you want to use a viewer, you can use qglviewer. Enable only if CGAL + was compile with Qt5. */ +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<2,3> LCC_3_cmap; + +/////////////////////////////////////////////////////////////////////////////// +int main() +{ + LCC_3_cmap lcc; + if (!CGAL::load_off(lcc, "data/double-torus-example.off")) + { + std::cout<<"ERROR reading file data/double-torus-example.off"< smct(lcc); + + CGAL::Path_on_surface p1(lcc); // A first path + p1.push_back_by_index(14); // Its starting dart + for (int i=0; i<7; ++i) + { p1.extend_positive_turn(2); } // Extend the path + + CGAL::Path_on_surface p2(lcc); // A second path + std::vector indices={56,59,303,305,314,335,206,202}; // All the indices of the darts + for (int i=0; i p3(lcc); // A third path + p3.push_back_by_index(470); // Its starting dart + for (int i=0; i<15; ++i) + { p3.extend_positive_turn(2); } // Extend the path + + bool res1=smct.is_contractible(p1); + std::cout<<"First path p1 "<<(res1?"IS":"IS NOT")<<" contractible."< > paths; + paths.push_back(p1); + paths.push_back(p2); + paths.push_back(p3); + CGAL::draw(lcc, paths); // Enable only if CGAL was compiled with Qt5 +#endif // CGAL_USE_BASIC_VIEWER + + return EXIT_SUCCESS; +}