From a362d6d83a6fbf8238482ecdb8919cc68aeb0d66 Mon Sep 17 00:00:00 2001 From: Lingjie Zhu Date: Tue, 6 Mar 2018 10:58:24 +0800 Subject: [PATCH] update doc --- .../Concepts/ErrorMetric.h | 17 ++++++---- .../Concepts/Proxy.h | 20 ----------- .../Concepts/ProxyFitting.h | 25 -------------- .../NamedParameters.txt | 34 +++++++++---------- .../PackageDescription.txt | 14 +++----- 5 files changed, 31 insertions(+), 79 deletions(-) delete mode 100644 Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/Proxy.h delete mode 100644 Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ProxyFitting.h diff --git a/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ErrorMetric.h b/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ErrorMetric.h index 94b4b4b4656..0016b4b3aa1 100644 --- a/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ErrorMetric.h +++ b/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ErrorMetric.h @@ -2,10 +2,10 @@ \ingroup PkgTSMAConcepts \cgalConcept -The concept `ErrorMetric` computes the fitting error of a face to a `Proxy`, used in CGAL::VSA::Mesh_approximation. +The concept `ErrorMetric` computes the fitting error of a face to a `Proxy`, used in CGAL::VSA_approximation. -\cgalHasModel `CGAL::VSA::L21_metric` -\cgalHasModel `CGAL::VSA::L2_metric` +\cgalHasModel `CGAL::L21_metric` +\cgalHasModel `CGAL::L2_metric` */ class ErrorMetric { @@ -14,15 +14,20 @@ public: typedef unspecified_type FT; /// Triangle mesh face descriptor. typedef unspecified_type face_descriptor; - /// Parametrized shape proxy. + /// Parameterized shape proxy. typedef unspecified_type Proxy; /// @name Operations /// A model of this concept must provide: /// @{ - /// returns the fitting error of a face f to the proxy px. - FT operator()(const face_descriptor &f, const Proxy &px) const; + /// returns the fitting error of a face f to the Proxy px. + FT compute_error(const face_descriptor &f, const Proxy &px) const; + + /// returns the fitted proxy from a range of facets. + template + Proxy fit_proxy(const FacetIterator &beg, const FacetIterator &end) const; /// } + }; diff --git a/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/Proxy.h b/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/Proxy.h deleted file mode 100644 index fe415ae95ec..00000000000 --- a/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/Proxy.h +++ /dev/null @@ -1,20 +0,0 @@ -/*! -\ingroup PkgTSMAConcepts -\cgalConcept - -The concept `Proxy` describes the primitive shape, nested within the `ErrorMetric` and `ProxyFitting` concepts. - -It can contain anything to store the primitive shape parameters. - -\cgalHasModel `CGAL::VSA::Plane_proxy` -*/ - -class Proxy { -public: - /// @name Data members - /// @{ - - /// Anything to store the proxy shape parameters. - - /// } -}; diff --git a/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ProxyFitting.h b/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ProxyFitting.h deleted file mode 100644 index a1655700b9f..00000000000 --- a/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ProxyFitting.h +++ /dev/null @@ -1,25 +0,0 @@ -/*! -\ingroup PkgTSMAConcepts -\cgalConcept - -The concept `ProxyFitting` fits a shape primitive `Proxy` from a range of facets, used in CGAL::VSA::Mesh_approximation. - -\cgalHasModel `CGAL::VSA::L21_proxy_fitting` -\cgalHasModel `CGAL::VSA::L2_proxy_fitting` -*/ - -class ProxyFitting { -public: - /// Parametrized shape proxy. - typedef unspecified_type Proxy; - - /// @name Operations - /// A model of this concept must provide: - /// @{ - - /// returns the fitted proxy from a range of facets. - template - Proxy operator()(const FacetIterator &beg, const FacetIterator &end) const; - - /// } -}; diff --git a/Surface_mesh_approximation/doc/Surface_mesh_approximation/NamedParameters.txt b/Surface_mesh_approximation/doc/Surface_mesh_approximation/NamedParameters.txt index f08509e294d..858a0acbd30 100644 --- a/Surface_mesh_approximation/doc/Surface_mesh_approximation/NamedParameters.txt +++ b/Surface_mesh_approximation/doc/Surface_mesh_approximation/NamedParameters.txt @@ -25,21 +25,19 @@ The sequence of named parameters should start with `CGAL::VSA::parameters::`. See below a sample call of a function that uses the optional BGL named parameters. \code -// input: input triangle mesh to be approximated -// output: output polyhedron mesh -// points: output anchor points -// triangles: output triplets of indexed triangles +// tm: input triangle mesh to be approximated // method: seed initialization method // nb_proxies: number of proxies used to approximate the geometry // nb_iterations: number of iterations after initialization +// points: output anchor points +// triangles: output triplets of indexed triangles -CGAL::VSA::mesh_approximation(input, - std::back_inserter(points), - std::back_inserter(triangles), +CGAL::mesh_approximation(tm, CGAL::VSA::parameters::seeding_method(method). max_nb_proxies(nb_proxies). nb_of_iterations(nb_iterations). - output_mesh(&output)); + anchor_points(std::back_inserter(points)). + indexed_triangles(std::back_inserter(triangles))); \endcode \cgalHeading{List of Available Named Parameters} @@ -49,7 +47,7 @@ In this package, all functions optional parameters are implemented as BGL option In the following, we assume that the following types are provided as template parameters of surface mesh approximation functions and classes. Note that the type is more specific for some of these functions.
    -
  • `PolygonMesh` implements a `FaceGraph` +
  • `TriangleMesh` implements a `FaceListGraph`
  • `GeomTraits` a geometric traits class in which constructions are performed and predicates evaluated. Everywhere in this package, a \cgal `Kernel` fulfills the requirements.
@@ -64,14 +62,14 @@ Here is the list of the named parameters available in this package: \code typename CGAL::Kernel_traits< typename boost::property_traits< - typename boost::property_map::type>::value_type>::Kernel + typename boost::property_map::type>::value_type>::Kernel \endcode \cgalNPEnd \cgalNPBegin{vertex_point_map} \anchor VSA_vertex_point_map is the property map with the points associated to the vertices of the polygon mesh `pmesh`.\n \b Type: a class model of `ReadablePropertyMap` with -`boost::graph_traits::%vertex_descriptor` as key type and +`boost::graph_traits::%vertex_descriptor` as key type and `GeomTraits::Point_3` as value type. \n \b Default value is \code boost::get(CGAL::vertex_point, pmesh)\endcode \cgalNPEnd @@ -114,7 +112,7 @@ the chord subdivision threshold used in the meshing step.\n \cgalNPBegin{face_proxy_map} \anchor VSA_face_proxy_map the property map outputs the proxy index of each face of the input polygon mesh.\n -\b Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits::%face_descriptor` as key type and the value type `std::size_t`\n +\b Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits::%face_descriptor` as key type and the value type `std::size_t`\n \b Default : if this parameter is omitted, no output operation performed \cgalNPEnd @@ -124,15 +122,15 @@ an `OutputIterator` to write proxies in.\n \b Default : if this parameter is omitted, no output operation performed \cgalNPEnd -\cgalNPBegin{anchor_vertices} \anchor VSA_anchor_vertices -an `OutputIterator` to write anchor vertices in.\n -\b Type : a class model of `OutputIterator` with `boost::graph_traits::%vertex_descriptor` value type.\n +\cgalNPBegin{anchor_points} \anchor VSA_anchor_points +an `OutputIterator` to write anchor points in.\n +\b Type : a class model of `OutputIterator` with `boost::graph_traits::%vertex_descriptor` value type.\n \b Default : if this parameter is omitted, no output operation performed \cgalNPEnd -\cgalNPBegin{output_mesh} \anchor VSA_output_mesh -a pointer to `CGAL::Polyhedron_3` to write the approximated surface mesh, constructed from the indexed triangles.\n -\b Type : a pointer to `CGAL::Polyhedron_3`\n +\cgalNPBegin{indexed_triangles} \anchor VSA_indexed_triangles +an `OutputIterator` to write indexed triangles in.\n +\b Type : a class model of `OutputIterator` with `CGAL::cpp11::array` value type.\n \b Default : if this parameter is omitted, no output operation performed \cgalNPEnd diff --git a/Surface_mesh_approximation/doc/Surface_mesh_approximation/PackageDescription.txt b/Surface_mesh_approximation/doc/Surface_mesh_approximation/PackageDescription.txt index f4bd411df13..30368473c6f 100644 --- a/Surface_mesh_approximation/doc/Surface_mesh_approximation/PackageDescription.txt +++ b/Surface_mesh_approximation/doc/Surface_mesh_approximation/PackageDescription.txt @@ -32,21 +32,15 @@ The page \ref namedparameters describes their usage and provides the list of parameters used in this package. ## Concepts ## -- `Proxy` - `ErrorMetric` -- `ProxyFitting` ## Main Functions ## -- `CGAL::VSA::mesh_approximation()` -- `CGAL::VSA::mesh_segmentation()` +- `CGAL::mesh_approximation()` ## Classes ## -- `CGAL::VSA::Plane_proxy` -- `CGAL::VSA::L21_metric` -- `CGAL::VSA::L21_proxy_fitting` -- `CGAL::VSA::L2_metric` -- `CGAL::VSA::L2_proxy_fitting` -- `CGAL::VSA::Mesh_approximation` +- `CGAL::L21_metric` +- `CGAL::L2_metric` +- `CGAL::VSA_approximation` \todo add option to enforce guarantee of 2-manifold and oriented output mesh \todo add traits class to design custom proxies