From 8520a51402c8daf1443ba8a067c5261038a9d2bf Mon Sep 17 00:00:00 2001 From: Thien Hoang Date: Mon, 5 Aug 2019 10:33:22 +0700 Subject: [PATCH] Fix ref man --- .../CGAL/Curves_on_surface_topology.h | 20 ++++++- .../CGAL/Path_on_surface.h | 8 +-- .../CGAL/Shortest_noncontractible_cycle.h | 57 ------------------- .../Concepts/WeightFunctor.h | 2 +- 4 files changed, 24 insertions(+), 63 deletions(-) delete mode 100644 Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Shortest_noncontractible_cycle.h diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Curves_on_surface_topology.h b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Curves_on_surface_topology.h index 3333408992a..c2ba51aa0ab 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Curves_on_surface_topology.h +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Curves_on_surface_topology.h @@ -32,7 +32,25 @@ namespace Surface_mesh_topology { /*! returns `true` if the closed path `p` is contractible. * @pre `p` must be a closed path on `amesh`. */ - bool is_contractible(const Path_on_surface& p) const; + bool is_contractible(const Path_on_surface& p) const; + + /*! returns the edgewidth of the unweighted mesh + */ + Path_on_surface compute_edgewidth() const; + + /*! returns the edgewidth of the weighted mesh + */ + template + Path_on_surface compute_edgewidth(const WeightFunctor& wf) const; + + /*! returns the shortest noncontractible cycle containing the 0-cell of `dh` on the unweighted mesh + */ + Path_on_surface compute_shortest_noncontractible_cycle_with_basepoint(Dart_handle dh) const; + + /*! returns the shortest noncontractible cycle containing the 0-cell of `dh` on the weighted mesh + */ + template + Path_on_surface compute_shortest_noncontractible_cycle_with_basepoint(Dart_handle dh, const WeightFunctor& wf) const; }; } diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Path_on_surface.h b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Path_on_surface.h index 2f4b159fdb5..39ca841f152 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Path_on_surface.h +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Path_on_surface.h @@ -39,12 +39,12 @@ namespace Surface_mesh_topology { /// clears this path. void clear(); - /// returns `true` iff `hd` can be added at the end of this path. - bool can_be_pushed(halfedge_descriptor hd) const; + /// returns `true` iff `hd` can be added at the end of this path. If `flip` is true, `hd`'d direction is reversed before checking + bool can_be_pushed(halfedge_descriptor hd, bool flip=false) const; - /// adds `hd` at the end of this path. + /// adds `hd` at the end of this path. If `flip` is true, the reverse of `hd` is considered. /// @pre `can_be_pushed(hd)` - void push_back(halfedge_descriptor hd); + void push_back(halfedge_descriptor hd, bool flip=false); /// returns `true` iff the dart/halfedge with index `i` can be added at the end of this path. /// If Mesh is a `Polyhedron_3`, takes time proportional to the number of darts/halfedges. diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Shortest_noncontractible_cycle.h b/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Shortest_noncontractible_cycle.h deleted file mode 100644 index 34e6c0474ba..00000000000 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/CGAL/Shortest_noncontractible_cycle.h +++ /dev/null @@ -1,57 +0,0 @@ -namespace CGAL { -namespace Surface_mesh_topology { - -/*! - \ingroup PkgSurfaceMeshTopologyClasses - - The class `Shortest_noncontractible_cycle` provides methods to find shortest non-contractible cycles on the surface. The input mesh can be `Combinatorial_map`, `Generalized_map`, `Surface_mesh`, `Polyhedron_3` or a linear cell complex. In the unweighted case, all edges have weight of 1. Otherwise, a weight functor must be provided. Often times, the functor measures the distance between two endpoints of the edge containing the given dart. - - \tparam Mesh_ a model of `GenericMap` or of `FaceGraph` - \tparam Weight_ a model of `WeightFunctor` -*/ - -template -class Shortest_noncontractible_cycle { - -public: - - /// Default weight functor is used in the unweighted case. - /// Every edge has weight of 1. - struct Default_weight_functor { - /// Number type of the weight - using Weight_t = unsigned int; - - /// Return 1 for any edge's weight - template - Weight_t operator()(T); - }; - - /// The weight functor used. - /// If the template parameter `Weight_` is void, set as `Default_weight_functor`; otherwise set as `Weight_` - using Weight = unspecified_type; - - /// Number type of the weights. - using Distance_type = Weight::Weight_t; - - /// Dart_handle of the input mesh. - /// If the template parameter `Mesh_` is a model of `GenericMap`, set as \link GenericMap::Dart_handle `Mesh::Dart_handle`\endlink ; otherwise set as `boost::graph_traits::halfedge_descriptor` - using Dart_handle_orig = unspecified_type; - - /// The cycle type is a container of dart handles of the original mesh. - using Path = std::vector; - - /// Constructor takes the input map and the weight functor. If not specified, the functor is default to its default constructor. - Shortest_noncontractible_cycle(Mesh_& mesh, const Weight& wf = Weight()); - - /// Find the shortest non-contractible cycle through a vertex. - /// The vertex is depicted by `root_vertex`, a \link GenericMap::Dart_handle `Dart_handle` \endlink of the input mesh. The cycle found is returned in `cycle`. The total length of the cycle is calculated by adding up the weights of all edges in the cycle and is returned through the pointer `length`. - bool find_cycle(Dart_handle_orig root_vertex, Path& cycle, Distance_type* length = NULL); - - /// Find the edge width of the whole mesh - /// The edge width is returned in `cycle`. The total length of the cycle is calculated by adding up the weights of all edges in the cycle and is returned through the pointer `length`. - void edge_width(Path& cycle, Distance_type* length = NULL); - -}; - -} -} diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/Concepts/WeightFunctor.h b/Surface_mesh_topology/doc/Surface_mesh_topology/Concepts/WeightFunctor.h index 40ed000b5e5..e120cac62f9 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/Concepts/WeightFunctor.h +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/Concepts/WeightFunctor.h @@ -4,7 +4,7 @@ The concept `WeightFunctor` defines a functor to calculate the weight of an edge -\cgalHasModel \link CGAL::Surface_mesh_topology::Shortest_noncontractible_cycle::Default_weight_functor `CGAL::Surface_mesh_topology::Shortest_noncontractible_cycle::Default_weight_functor` \endlink +\cgalHasModel \link CGAL::Surface_mesh_topology::internal::Shortest_noncontractible_cycle::Default_weight_functor `Default_weight_functor` \endlink */ class WeightFunctor {