diff --git a/BGL/include/CGAL/boost/graph/Seam_mesh.h b/BGL/include/CGAL/boost/graph/Seam_mesh.h index 5eade0abdee..26acf07f17b 100644 --- a/BGL/include/CGAL/boost/graph/Seam_mesh.h +++ b/BGL/include/CGAL/boost/graph/Seam_mesh.h @@ -112,6 +112,10 @@ class Seam_mesh typedef Seam_mesh Self; public: + /// The underlying mesh type + typedef TM Triangle_mesh; + + // backward compatibility typedef TM TriangleMesh; public: diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Doxyfile.in b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Doxyfile.in index a75bb8163ce..5734f82fb6b 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Doxyfile.in +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Doxyfile.in @@ -2,8 +2,10 @@ PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - Planar Parameterization of Triangulated Surface Meshes" EXTRACT_ALL = false +HIDE_UNDOC_MEMBERS = true HIDE_UNDOC_CLASSES = true WARN_IF_UNDOCUMENTED = false + HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/nefertiti.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/ARAP_new.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/orbifold_new.jpg \ diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/PackageDescription.txt b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/PackageDescription.txt index 02776fd1004..ee15747fda6 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/PackageDescription.txt +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/PackageDescription.txt @@ -49,9 +49,10 @@ This \cgal package implements several parameterization methods: Conditionally guaranteed if all weights are positive and border is convex. - Floater Mean Value Coordinates \cgalCite{cgal:f-mvc-03} : One-to-one mapping is guaranteed for convex border. + - Iterative Authalic Parameterization \cgalCite{cgal:j-lrsspp-19}. - Free border: - As Rigid As Possible Parameterization \cgalCite{liu2008local} - - Least Squares Conformal Maps \cgalCite{cgal:lprm-lscm-02}. + - Least Squares Conformal Maps (LSCM) \cgalCite{cgal:lprm-lscm-02}. - Borderless: - Orbifold Tutte Embeddings \cgalCite{aigerman2015orbifold}. @@ -60,6 +61,7 @@ The following classes implement the methods listed above: - `CGAL::Surface_mesh_parameterization::Barycentric_mapping_parameterizer_3` - `CGAL::Surface_mesh_parameterization::Discrete_authalic_parameterizer_3` - `CGAL::Surface_mesh_parameterization::Discrete_conformal_map_parameterizer_3` +- `CGAL::Surface_mesh_parameterization::Iterative_authalic_parameterizer_3` - `CGAL::Surface_mesh_parameterization::LSCM_parameterizer_3` - `CGAL::Surface_mesh_parameterization::Mean_value_coordinates_parameterizer_3` - `CGAL::Surface_mesh_parameterization::Orbifold_Tutte_parameterizer_3` diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt index 383e48fa9c4..d3afaac6836 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt @@ -218,7 +218,7 @@ convex combination condition. This algorithm amounts to solve one sparse linear system for each set of parameter coordinates, with a \#vertices x \#vertices sparse and symmetric positive definite matrix (if the border vertices are eliminated from the linear system). -A coefficient \f$ (i, j)\f$ of the matrix is set to 1 for an edge linking +A coefficient \f$ (i,j)\f$ of the matrix is set to 1 for an edge linking the vertex \f$ v_i\f$ to the vertex \f$ v_j\f$, to minus the degree of the vertex \f$ v_i\f$ for a diagonal element, and to 0 for any other matrix entry. Although a bijective mapping is guaranteed when the border is convex, @@ -475,55 +475,43 @@ underlying (input) mesh. \subsection Surface_mesh_parameterizationParameterization Parameterization Methods and Guarantees -
    - -
  • Fixed boundaries - -
      - -
    • One-to-one mapping - -Tutte's theorem guarantees a one-to-one mapping provided that the weights are all positive -and the border is convex. -It is the case for Tutte Barycentric Mapping and Floater Mean Value Coordinates. -It is not always the case for Discrete Conformal Map (cotangents) and -Discrete Authalic parameterization. - -
    • Non-singularity of the matrix - -Geshorgin's theorem guarantees the convergence of the solver if the matrix is diagonal dominant. -This is the case with positive weights (Tutte Barycentric Mapping and Floater Mean Value Coordinates). - -
    - -
  • Free boundaries - -
      - -
    • One-to-one mapping - -No guarantee is provided by either LSCM or ARAP parameterizations (both global -overlaps and triangle flips can occur). - -
    • Non-singularity of the matrix - -For LSCM, the matrix of the system is the Gram matrix of a matrix with maximal rank, -and is therefore non-singular (Gram theorem). - -
    - -
  • Boundary-less - -
      - -
    • One-to-one mapping - -The Orbifold-Tutte embedding is guaranteed to exist and to be computable -via a sparse linear system. - -
    - -
+
    +
  • Fixed boundaries +
      +
    • One-to-one mapping
      + Tutte's theorem guarantees a one-to-one mapping provided that the weights are all positive + and the border is convex. + It is the case for Tutte Barycentric Mapping and Floater Mean Value Coordinates. + It is not always the case for Discrete Conformal Map (cotangents), Discrete Authalic, + and Iterative Authalic parameterizations. +
    • +
    • Non-singularity of the matrix
      + Geshorgin's theorem guarantees the convergence of the solver if the matrix is diagonal dominant. + This is the case with positive weights (Tutte Barycentric Mapping and Floater Mean Value Coordinates). +
    • +
    +
  • +
  • Free boundaries +
      +
    • One-to-one mapping
      + No guarantee is provided by either LSCM or ARAP parameterizations (both global overlaps + and triangle flips can occur). +
    • +
    • Non-singularity of the matrix
      + For LSCM, the matrix of the system is the Gram matrix of a matrix with maximal rank, + and is therefore non-singular (Gram theorem). +
    • +
    +
  • +
  • Boundary-less +
      +
    • One-to-one mapping
      + The Orbifold-Tutte embedding is guaranteed to exist and to be computable + via a sparse linear system. +
    • +
    +
  • +
\section Surface_mesh_parameterizationExtendingthe Implementation History diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index 699dfc75334..e43e0ac02d9 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -129,7 +129,7 @@ namespace Surface_mesh_parameterization { /// a random vertex is pinned. /// /// If flips are present in the initial parameterization, a post-processing step -/// is applied using `CGAL::Surface_mesh_parameterization::MVC_post_processor_3` +/// is applied using `CGAL::Surface_mesh_parameterization::MVC_post_processor_3` /// to attempt to obtain a valid final embedding. /// /// A one-to-one mapping is *not* guaranteed. @@ -162,6 +162,7 @@ namespace Surface_mesh_parameterization { /// \endcode /// /// \sa `CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3` +/// \sa `CGAL::Iterative_authalic_parameterizer_3` /// template < class TriangleMesh_, class BorderParameterizer_ = Default, @@ -194,28 +195,39 @@ public: #endif >::type Solver_traits; #else + /// Border parameterizer type typedef Border_parameterizer_ Border_parameterizer; + + /// Solver traits type typedef SolverTraits_ Solver_traits; + + /// Number type, deduced from the internal vertex point map of `Triangle_mesh` + typedef unspecified_type NT; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef typename boost::graph_traits::face_iterator face_iterator; - typedef typename boost::graph_traits::vertex_iterator vertex_iterator; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; + typedef typename boost::graph_traits::face_iterator face_iterator; + typedef typename boost::graph_traits::vertex_iterator vertex_iterator; - typedef CGAL::Halfedge_around_target_circulator halfedge_around_target_circulator; - typedef CGAL::Halfedge_around_face_circulator halfedge_around_face_circulator; + typedef CGAL::Halfedge_around_target_circulator halfedge_around_target_circulator; + typedef CGAL::Halfedge_around_face_circulator halfedge_around_face_circulator; typedef boost::unordered_set Vertex_set; typedef std::vector Faces_vector; // Traits subtypes: - typedef typename internal::Kernel_traits::Kernel Kernel; + typedef typename internal::Kernel_traits::Kernel Kernel; typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Point_3 Point_3; @@ -277,7 +289,7 @@ private: template void output_uvmap(const std::string filename, - const TriangleMesh& mesh, + const Triangle_mesh& mesh, const Vertex_set& vertices, const Faces_vector& faces, const VertexUVMap uvmap, @@ -292,7 +304,7 @@ private: typename VertexIndexMap> void output_uvmap(const std::string filename, const unsigned int iter, - const TriangleMesh& mesh, + const Triangle_mesh& mesh, const Vertex_set& vertices, const Faces_vector& faces, const VertexUVMap uvmap, @@ -331,12 +343,12 @@ private: // Private operations private: // Store the vertices and faces of the mesh in memory. - Error_code initialize_containers(const TriangleMesh& mesh, + Error_code initialize_containers(const Triangle_mesh& mesh, halfedge_descriptor bhd, Vertex_set& vertices, Faces_vector& faces) const { - internal::Containers_filler fc(mesh, vertices, &faces); + internal::Containers_filler fc(mesh, vertices, &faces); Polygon_mesh_processing::connected_component( face(opposite(bhd, mesh), mesh), mesh, @@ -351,7 +363,7 @@ private: // Initialize the UV values with a first parameterization of the input. template - Error_code compute_initial_uv_map(TriangleMesh& mesh, + Error_code compute_initial_uv_map(Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVMap uvmap, VertexIndexMap vimap) const @@ -372,11 +384,11 @@ private: // According to the paper, MVC is better for single border and LSCM is better // when there are multiple borders if(number_of_borders == 1) { - typedef Mean_value_coordinates_parameterizer_3 MVC_parameterizer; + typedef Mean_value_coordinates_parameterizer_3 MVC_parameterizer; MVC_parameterizer mvc_parameterizer; status = mvc_parameterizer.parameterize(mesh, bhd, uvmap, vimap, vpmap); } else { - typedef LSCM_parameterizer_3 LSCM_parameterizer; + typedef LSCM_parameterizer_3 LSCM_parameterizer; LSCM_parameterizer lscm_parameterizer; status = lscm_parameterizer.parameterize(mesh, bhd, uvmap, vimap, vpmap); } @@ -389,7 +401,7 @@ private: template - Error_code parameterize_border(const TriangleMesh& mesh, + Error_code parameterize_border(const Triangle_mesh& mesh, const Vertex_set& vertices, halfedge_descriptor bhd, VertexIndexMap vimap, @@ -422,14 +434,14 @@ private: } // Compute the cotangent of the angle between the vectors ij and ik. - void compute_cotangent_angle(const TriangleMesh& mesh, + void compute_cotangent_angle(const Triangle_mesh& mesh, halfedge_descriptor hd, vertex_descriptor vi, vertex_descriptor vj, vertex_descriptor vk, Cot_map ctmap) const { - typedef typename boost::property_map::const_type PPmap; const PPmap ppmap = get(vertex_point, mesh); @@ -442,7 +454,7 @@ private: } // Fill the map 'ctmap' with the cotangents of the angles of the faces of 'mesh'. - Error_code compute_cotangent_angles(const TriangleMesh& mesh, + Error_code compute_cotangent_angles(const Triangle_mesh& mesh, const Faces_vector& faces, Cot_map ctmap) const { @@ -468,8 +480,8 @@ private: return OK; } - // computes `w_ij`, the `(i, j)`-coefficient of matrix `A` for `j` neighbor vertex of `i`. - NT compute_w_ij(const TriangleMesh& mesh, + // computes `w_ij`, the `(i,j)`-coefficient of matrix `A` for `j` neighbor vertex of `i`. + NT compute_w_ij(const Triangle_mesh& mesh, halfedge_descriptor hd, const Cot_map ctmap) const { @@ -496,7 +508,7 @@ private: // \pre Line i of A must contain only zeros. template Error_code fill_linear_system_matrix(Matrix& A, - const TriangleMesh& mesh, + const Triangle_mesh& mesh, vertex_descriptor vertex, const Cot_map ct_map, VertexIndexMap vimap) const @@ -538,7 +550,7 @@ private: // after (at least two) border vertices parameterization. template - Error_code initialize_matrix_A(const TriangleMesh& mesh, + Error_code initialize_matrix_A(const Triangle_mesh& mesh, const Vertex_set& vertices, const Cot_map ctmap, VertexIndexMap vimap, @@ -695,7 +707,7 @@ private: // Compute the root that gives the lowest face energy. template - std::size_t compute_root_with_lowest_energy(const TriangleMesh& mesh, + std::size_t compute_root_with_lowest_energy(const Triangle_mesh& mesh, face_descriptor fd, const Cot_map ctmap, const Local_points& lp, @@ -722,7 +734,7 @@ private: // Compute the root that gives the lowest face energy. template - std::size_t compute_root_with_lowest_energy(const TriangleMesh& mesh, + std::size_t compute_root_with_lowest_energy(const Triangle_mesh& mesh, face_descriptor fd, const Cot_map ctmap, const Local_points& lp, @@ -748,7 +760,7 @@ private: // Compute the optimal values of the linear transformation matrices Lt. template - Error_code compute_optimal_Lt_matrices(const TriangleMesh& mesh, + Error_code compute_optimal_Lt_matrices(const Triangle_mesh& mesh, const Faces_vector& faces, const Cot_map ctmap, const Local_points& lp, @@ -874,13 +886,13 @@ private: } // Compute the local parameterization (2D) of a face and store it in memory. - void project_face(const TriangleMesh& mesh, + void project_face(const Triangle_mesh& mesh, vertex_descriptor vi, vertex_descriptor vj, vertex_descriptor vk, Local_points& lp) const { - typedef typename boost::property_map::const_type PPmap; const PPmap ppmap = get(vertex_point, mesh); @@ -900,7 +912,7 @@ private: // Utility for fill_linear_system_rhs(): // Compute the local isometric parameterization (2D) of the faces of the mesh. - Error_code compute_local_parameterization(const TriangleMesh& mesh, + Error_code compute_local_parameterization(const Triangle_mesh& mesh, const Faces_vector& faces, Local_points& lp, Lp_map lpmap) const @@ -936,9 +948,9 @@ private: return OK; } - // Compute the coefficient b_ij = (i, j) of the right hand side vector B, + // Compute the coefficient b_ij = (i,j) of the right hand side vector B, // for j neighbor vertex of i. - void compute_b_ij(const TriangleMesh& mesh, + void compute_b_ij(const Triangle_mesh& mesh, halfedge_descriptor hd, const Cot_map ctmap, const Local_points& lp, @@ -1009,7 +1021,7 @@ private: // \pre Vertex i musn't be already parameterized. // \pre Lines i of Bu and Bv must be zero. template - Error_code fill_linear_system_rhs(const TriangleMesh& mesh, + Error_code fill_linear_system_rhs(const Triangle_mesh& mesh, vertex_descriptor vertex, const Cot_map ctmap, const Local_points& lp, @@ -1053,7 +1065,7 @@ private: template - Error_code compute_rhs(const TriangleMesh& mesh, + Error_code compute_rhs(const Triangle_mesh& mesh, const Vertex_set& vertices, const Cot_map ctmap, const Local_points& lp, @@ -1091,7 +1103,7 @@ private: template - Error_code update_solution(const TriangleMesh& mesh, + Error_code update_solution(const Triangle_mesh& mesh, const Vertex_set& vertices, const Cot_map ctmap, const Local_points& lp, @@ -1147,7 +1159,7 @@ private: // Compute the current energy of a face, given a linear transformation matrix. template - NT compute_current_face_energy(const TriangleMesh& mesh, + NT compute_current_face_energy(const Triangle_mesh& mesh, face_descriptor fd, const Cot_map ctmap, const Local_points& lp, @@ -1190,7 +1202,7 @@ private: // Compute the current energy of a face. template - NT compute_current_face_energy(const TriangleMesh& mesh, + NT compute_current_face_energy(const Triangle_mesh& mesh, face_descriptor fd, const Cot_map ctmap, const Local_points& lp, @@ -1207,7 +1219,7 @@ private: // Compute the current energy of the parameterization. template - NT compute_current_energy(const TriangleMesh& mesh, + NT compute_current_energy(const Triangle_mesh& mesh, const Faces_vector& faces, const Cot_map ctmap, const Local_points& lp, @@ -1232,14 +1244,14 @@ private: // the (hopefully few) flips in the result. template - Error_code post_process(const TriangleMesh& mesh, + Error_code post_process(const Triangle_mesh& mesh, const Vertex_set& vertices, const Faces_vector& faces, halfedge_descriptor bhd, VertexUVMap uvmap, const VertexIndexMap vimap) const { - typedef MVC_post_processor_3 Post_processor; + typedef MVC_post_processor_3 Post_processor; Post_processor p; Error_code status = p.parameterize(mesh, vertices, faces, bhd, uvmap, vimap); @@ -1256,9 +1268,9 @@ private: // Public operations public: /// returns whether the 3D -> 2D mapping is one-to-one. - template - bool is_one_to_one_mapping(const TriangleMesh& mesh, - const Faces_vector& faces, + template + bool is_one_to_one_mapping(const Triangle_mesh& mesh, + const FaceRange& faces, const VertexUVMap uvmap) const { return internal::is_one_to_one_mapping(mesh, faces, uvmap); @@ -1269,14 +1281,14 @@ public: /// The result is the (u,v) pair image of each vertex of the 3D surface. /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a Boolean as value type. /// /// \param mesh a triangulated surface. @@ -1291,14 +1303,14 @@ public: template - Error_code parameterize(TriangleMesh& mesh, + Error_code parameterize(Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVMap uvmap, VertexIndexMap vimap, VertexParameterizedMap vpmap) { CGAL_precondition(is_valid_polygon_mesh(mesh)); - CGAL_precondition(bhd != boost::graph_traits::null_halfedge() && is_border(bhd, mesh)); + CGAL_precondition(bhd != boost::graph_traits::null_halfedge() && is_border(bhd, mesh)); Error_code status = OK; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h index 37839c225e9..c53c4c56d20 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h @@ -21,6 +21,7 @@ #include #include +#include #if defined(CGAL_EIGEN3_ENABLED) #include @@ -108,24 +109,32 @@ public: #endif >::type Solver_traits; #else + /// Border parameterizer type typedef Border_parameterizer_ Border_parameterizer; - typedef SolverTraits_ SolverTraits; + + /// Solver traits type + typedef SolverTraits_ Solver_traits; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; + /// Mesh vertex type + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + private: // Superclass - typedef Fixed_border_parameterizer_3 Base; // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; - typedef typename Base::NT NT; // Solver traits subtypes: @@ -139,7 +148,7 @@ public: ///< %Object that maps the surface's border to 2D space. Solver_traits sparse_la = Solver_traits()) ///< Traits object to access a sparse linear system. - : Fixed_border_parameterizer_3(border_param, sparse_la) { } @@ -149,7 +158,7 @@ public: /// returns whether the 3D -> 2D mapping is one-to-one. template - bool is_one_to_one_mapping(const TriangleMesh& mesh, + bool is_one_to_one_mapping(const Triangle_mesh& mesh, halfedge_descriptor bhd, const VertexUVMap uvmap) const { @@ -166,9 +175,9 @@ public: // Protected operations protected: /// computes `w_ij`, the coefficient of matrix `A` for `j` neighbor vertex of `i`. - virtual NT compute_w_ij(const TriangleMesh& /* mesh */, + virtual NT compute_w_ij(const Triangle_mesh& /* mesh */, vertex_descriptor /* main_vertex_v_i */, - vertex_around_target_circulator /* neighbor_vertex_v_j */ ) const + Vertex_around_target_circulator /* neighbor_vertex_v_j */ ) const { /// In the Tutte Barycentric Mapping algorithm, we have `w_ij = 1`, for `j` neighbor vertex of `i`. return 1.; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h index e1fc8804fe7..d7b10934389 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h @@ -62,29 +62,33 @@ class Circular_border_parameterizer_3 { // Public types public: - typedef TriangleMesh_ TriangleMesh; + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + /// Mesh vertex type + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; // Protected types protected: - typedef typename internal::Kernel_traits::PPM PPM; - typedef typename internal::Kernel_traits::Kernel Kernel; + typedef typename internal::Kernel_traits::PPM PPM; + typedef typename internal::Kernel_traits::Kernel Kernel; typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Vector_3 Vector_3; // Protected operations protected: - virtual NT compute_edge_length(const TriangleMesh& mesh, + virtual NT compute_edge_length(const Triangle_mesh& mesh, vertex_descriptor source, vertex_descriptor target) const = 0; // Private operations private: // Compute the total length of the border - NT compute_border_length(const TriangleMesh& mesh, + NT compute_border_length(const Triangle_mesh& mesh, halfedge_descriptor bhd) const { NT len = 0.0; @@ -103,14 +107,14 @@ public: /// `compute_edge_length()`. /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a Boolean as value type. /// /// \param mesh a triangulated surface. @@ -124,7 +128,7 @@ public: template - Error_code parameterize(const TriangleMesh& mesh, + Error_code parameterize(const Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap /* vimap */, @@ -192,20 +196,18 @@ class Circular_border_uniform_parameterizer_3 // Public types public: // We have to repeat the types exported by superclass - /// @cond SKIP_IN_MANUAL - typedef TriangleMesh_ TriangleMesh; - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - /// @endcond + typedef TriangleMesh_ Triangle_mesh; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; // Private types private: - typedef Circular_border_parameterizer_3 Base; + typedef Circular_border_parameterizer_3 Base; typedef typename Base::NT NT; // Protected operations protected: /// computes the length of an edge. - virtual NT compute_edge_length(const TriangleMesh& /* mesh */, + virtual NT compute_edge_length(const Triangle_mesh& /* mesh */, vertex_descriptor /* source */, vertex_descriptor /* target */) const { @@ -243,24 +245,22 @@ class Circular_border_arc_length_parameterizer_3 // Public types public: // We have to repeat the types exported by superclass - /// @cond SKIP_IN_MANUAL - typedef TriangleMesh_ TriangleMesh; - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - /// @endcond + typedef TriangleMesh_ Triangle_mesh; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; // Private types private: - typedef Circular_border_parameterizer_3 Base; + typedef Circular_border_parameterizer_3 Base; - typedef typename Base::PPM PPM; - typedef typename Base::NT NT; - typedef typename Base::Vector_3 Vector_3; + typedef typename Base::PPM PPM; + typedef typename Base::NT NT; + typedef typename Base::Vector_3 Vector_3; // Protected operations protected: /// computes the length of an edge. - virtual NT compute_edge_length(const TriangleMesh& mesh, + virtual NT compute_edge_length(const Triangle_mesh& mesh, vertex_descriptor source, vertex_descriptor target) const { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h index 211bcd6ad5a..61ca95aab95 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h @@ -48,7 +48,7 @@ namespace Surface_mesh_parameterization { /// This class is a strategy called by the main /// parameterization algorithm `Fixed_border_parameterizer_3::parameterize()` and it: /// - provides the template parameters `BorderParameterizer_` and `SolverTraits_`. -/// - implements `compute_w_ij()` to compute `w_ij`, the `(i, j)`-coefficient of the matrix `A` +/// - implements `compute_w_ij()` to compute `w_ij`, the `(i,j)`-coefficient of the matrix `A` /// for `j` neighbor vertex of `i`, based on Discrete Authalic Parameterization algorithm. /// /// \cgalModels `Parameterizer_3` @@ -75,8 +75,8 @@ namespace Surface_mesh_parameterization { /// \endcode /// /// \sa `CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3` -/// \sa `CGAL::Surface_mesh_parameterization::Iterative_authalic_parameterizer_3` /// \sa `CGAL::Surface_mesh_parameterization::ARAP_parameterizer_3` +/// \sa `CGAL::Surface_mesh_parameterization::Iterative_authalic_parameterizer_3` /// template < class TriangleMesh_, class BorderParameterizer_ = Default, @@ -114,23 +114,31 @@ public: #endif >::type Solver_traits; #else + /// Border parameterizer type typedef Border_parameterizer_ Border_parameterizer; + + /// Solver traits type typedef SolverTraits_ Solver_traits; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; + /// Mesh vertex type + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + // Private types private: // Superclass - typedef Fixed_border_parameterizer_3 Base; // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; + typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; // Traits subtypes: typedef typename Base::PPM PPM; @@ -150,7 +158,7 @@ public: ///< %Object that maps the surface's border to 2D space. Solver_traits sparse_la = Solver_traits()) ///< Traits object to access a sparse linear system. - : Fixed_border_parameterizer_3(border_param, sparse_la) { } @@ -159,14 +167,14 @@ public: // Protected operations protected: - /// computes `w_ij`, the (i, j), coefficient of matrix `A` for `j` neighbor vertex of `i`. + /// computes `w_ij`, the (i,j), coefficient of matrix `A` for `j` neighbor vertex of `i`. /// /// \param mesh a triangulated surface. /// \param main_vertex_v_i the vertex of `mesh` with index `i` /// \param neighbor_vertex_v_j the vertex of `mesh` with index `j` - virtual NT compute_w_ij(const TriangleMesh& mesh, + virtual NT compute_w_ij(const Triangle_mesh& mesh, vertex_descriptor main_vertex_v_i, - vertex_around_target_circulator neighbor_vertex_v_j) const + Vertex_around_target_circulator neighbor_vertex_v_j) const { const PPM ppmap = get(vertex_point, mesh); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h index a2e4566c4b9..62bf4f29b3c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h @@ -48,7 +48,7 @@ namespace Surface_mesh_parameterization { /// This class is a strategy called by the main /// parameterization algorithm `Fixed_border_parameterizer_3::parameterize()` and it: /// - provides the template parameters `BorderParameterizer_` and `SolverTraits_`. -/// - implements `compute_w_ij()` to compute `w_ij`, the `(i, j)`-coefficient of matrix `A`, +/// - implements `compute_w_ij()` to compute `w_ij`, the `(i,j)`-coefficient of matrix `A`, /// for `j` neighbor vertex of `i`, based on Discrete Conformal Map method. /// /// \cgalModels `Parameterizer_3` @@ -112,23 +112,29 @@ public: #endif >::type Solver_traits; #else + /// Border parameterizer type typedef Border_parameterizer_ Border_parameterizer; + + /// Solver traits type typedef SolverTraits_ Solver_traits; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; // Private types private: // Superclass - typedef Fixed_border_parameterizer_3 Base; // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; // Traits subtypes: typedef typename Base::Kernel Kernel; @@ -148,7 +154,7 @@ public: ///< %Object that maps the surface's border to 2D space. Solver_traits sparse_la = Solver_traits()) ///< Traits object to access a sparse linear system. - : Fixed_border_parameterizer_3(border_param, sparse_la) { } @@ -162,9 +168,9 @@ protected: /// \param mesh a triangulated surface. /// \param main_vertex_v_i the vertex of `mesh` with index `i` /// \param neighbor_vertex_v_j the vertex of `mesh` with index `j` - virtual NT compute_w_ij(const TriangleMesh& mesh, + virtual NT compute_w_ij(const Triangle_mesh& mesh, vertex_descriptor main_vertex_v_i, - vertex_around_target_circulator neighbor_vertex_v_j) const // its target is main_vertex_v_i + Vertex_around_target_circulator neighbor_vertex_v_j) const // its target is main_vertex_v_i { const PPM ppmap = get(vertex_point, mesh); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h index 872b12d829a..2beb84c35a3 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h @@ -58,7 +58,7 @@ namespace Surface_mesh_parameterization { /// Nevertheless, it implements most of the parameterization algorithm `parameterize()`. /// Subclasses are *Strategies* \cgalCite{cgal:ghjv-dpero-95} that modify the behavior of this algorithm: /// - They provide the template parameters `BorderParameterizer_` and `SolverTraits_`. -/// - They implement `compute_w_ij()` to compute `w_ij`, the `(i, j)`-coefficient of matrix `A`, +/// - They implement `compute_w_ij()` to compute `w_ij`, the `(i,j)`-coefficient of matrix `A` /// for `j` neighbor vertex of `i`. /// // @todo `Fixed_border_parameterizer_3` should remove border vertices @@ -120,34 +120,44 @@ public: #endif >::type Solver_traits; #else + /// Border parameterizer type typedef Border_parameterizer_ Border_parameterizer; + + /// Solver traits type typedef SolverTraits_ Solver_traits; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; + /// Mesh vertex type + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + /// Solver vector type + typedef typename Solver_traits::Vector Vector; + + /// Solver matrix type + typedef typename Solver_traits::Matrix Matrix; + // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - - typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; - typedef CGAL::Vertex_around_face_circulator vertex_around_face_circulator; + typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; // Protected types protected: // Traits subtypes: - typedef typename internal::Kernel_traits::Kernel Kernel; - typedef typename internal::Kernel_traits::PPM PPM; + typedef typename internal::Kernel_traits::Kernel Kernel; + typedef typename internal::Kernel_traits::PPM PPM; typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Point_3 Point_3; typedef typename Kernel::Vector_3 Vector_3; - // Solver traits subtypes: - typedef typename Solver_traits::Vector Vector; - typedef typename Solver_traits::Matrix Matrix; - // Public operations public: /// Constructor @@ -169,14 +179,14 @@ public: /// The result is the `(u,v)` pair image of each vertex of the 3D surface. /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a Boolean as value type. /// /// \param mesh a triangulated surface. @@ -192,21 +202,21 @@ public: template - Error_code parameterize(TriangleMesh& mesh, + Error_code parameterize(Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap, VertexParameterizedMap vpmap) { CGAL_precondition(is_valid_polygon_mesh(mesh)); - CGAL_precondition(bhd != boost::graph_traits::null_halfedge() && is_border(bhd, mesh)); + CGAL_precondition(bhd != boost::graph_traits::null_halfedge() && is_border(bhd, mesh)); Error_code status = OK; typedef boost::unordered_set Vertex_set; Vertex_set vertices; - internal::Containers_filler fc(mesh, vertices); + internal::Containers_filler fc(mesh, vertices); Polygon_mesh_processing::connected_component( face(opposite(bhd, mesh), mesh), mesh, @@ -301,11 +311,11 @@ protected: /// "u = constant" and "v = constant". /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// /// \param A the matrix in both linear system @@ -321,7 +331,7 @@ protected: /// \pre Border vertices must be parameterized. template void initialize_system_from_mesh_border(Matrix& A, Vector& Bu, Vector& Bv, - const TriangleMesh& mesh, + const Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap) const @@ -345,9 +355,9 @@ protected: /// \param mesh a triangulated surface. /// \param main_vertex_v_i the vertex of `mesh` with index `i` /// \param neighbor_vertex_v_j the vertex of `mesh` with index `j` - virtual NT compute_w_ij(const TriangleMesh& mesh, + virtual NT compute_w_ij(const Triangle_mesh& mesh, vertex_descriptor main_vertex_v_i, - vertex_around_target_circulator neighbor_vertex_v_j) const = 0; + Vertex_around_target_circulator neighbor_vertex_v_j) const = 0; /// Compute the line i of matrix A for i inner vertex: /// - call compute_w_ij() to compute the A coefficient w_ij for each neighbor v_j. @@ -362,7 +372,7 @@ protected: Error_code setup_inner_vertex_relations(Matrix& A, Vector&, Vector&, - const TriangleMesh& mesh, + const Triangle_mesh& mesh, vertex_descriptor vertex, VertexIndexMap vimap) const { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h index bfa67fd9452..5c4eb4f4706 100755 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h @@ -97,30 +97,35 @@ public: #endif >::type Solver_traits; #else + /// Border parameterizer type typedef Border_parameterizer_ Border_parameterizer; + + /// Solver traits type typedef SolverTraits_ Solver_traits; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::face_descriptor face_descriptor; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; - typedef CGAL::Face_around_target_circulator face_around_target_circulator; - typedef CGAL::Vertex_around_face_circulator vertex_around_face_circulator; + typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; + typedef CGAL::Face_around_target_circulator face_around_target_circulator; - typedef typename internal::Kernel_traits::Kernel Kernel; + typedef typename internal::Kernel_traits::Kernel Kernel; typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Point_3 Point_3; typedef typename Kernel::Vector_3 Vector_3; - typedef typename internal::Kernel_traits::PPM PPM; + typedef typename internal::Kernel_traits::PPM PPM; typedef typename boost::property_traits::reference PPM_ref; typedef std::unordered_set Vertex_set; @@ -130,15 +135,15 @@ private: typedef typename Solver_traits::Matrix Matrix; typedef CGAL::dynamic_vertex_property_t Vertex_double_tag; - typedef typename boost::property_map::type Vertex_Double_map; + typedef typename boost::property_map::type Vertex_Double_map; typedef CGAL::dynamic_vertex_property_t Vertex_bool_tag; - typedef typename boost::property_map::type Vertex_bool_map; + typedef typename boost::property_map::type Vertex_bool_map; typedef CGAL::dynamic_vertex_property_t Vertex_int_tag; - typedef typename boost::property_map::type Vertex_int_map; + typedef typename boost::property_map::type Vertex_int_map; typedef CGAL::dynamic_vertex_property_t Vertex_point2_tag; - typedef typename boost::property_map::type Vertex_point2_map; + typedef typename boost::property_map::type Vertex_point2_map; typedef CGAL::dynamic_face_property_t Face_NT_tag; - typedef typename boost::property_map::type Face_NT_map; + typedef typename boost::property_map::type Face_NT_map; // Fields private: @@ -171,7 +176,6 @@ public: /// Constructor /// /// \param border_parameterizer %Object that maps the surface's border to 2D space - /// \param iterations an integer number of iterations to run the parameterization /// \param sparse_la Traits object to access a sparse linear system /// Iterative_authalic_parameterizer_3(Border_parameterizer border_parameterizer = Border_parameterizer(), @@ -191,7 +195,7 @@ public: template NT compute_area_distortion(const FaceRange& face_range, const NT A_3D, - TriangleMesh& tmesh, + Triangle_mesh& tmesh, const VertexUVmap uvmap) { Face_NT_map area_2DMap = get(Face_NT_tag(), tmesh); @@ -292,7 +296,7 @@ protected: template void copy_sparse_matrix(const Matrix& src, Matrix& dest, - const TriangleMesh& tmesh, + const Triangle_mesh& tmesh, const Vertex_set& vertices, const VertexIndexMap vimap) { @@ -312,14 +316,14 @@ protected: } private: - double compute_vertex_L2(const TriangleMesh& tmesh, + double compute_vertex_L2(const Triangle_mesh& tmesh, const vertex_descriptor v) const { NT phi = 0, local_area = 0; for(face_descriptor f : CGAL::faces_around_target(halfedge(v, tmesh), tmesh)) { - if(f == boost::graph_traits::null_face()) + if(f == boost::graph_traits::null_face()) continue; phi += CGAL::square(get(m_face_L2_map, f)) * get(m_face_areas, f); @@ -330,7 +334,7 @@ private: } void compute_vertices_L2(const Vertex_set& vertices, - TriangleMesh& tmesh) + Triangle_mesh& tmesh) { m_vertex_L2_map = get(Vertex_double_tag(), tmesh); for(vertex_descriptor v : vertices) @@ -385,7 +389,7 @@ private: template NT compute_face_L2(const face_descriptor f, - const TriangleMesh& tmesh, + const Triangle_mesh& tmesh, const VertexUVMap uvmap, const PPM ppmap) const { @@ -418,7 +422,7 @@ private: template void compute_faces_L2(const FaceRange& face_range, - TriangleMesh& tmesh, + Triangle_mesh& tmesh, const VertexUVMap uvmap) { m_face_L2_map = get(Face_NT_tag(), tmesh); @@ -433,7 +437,7 @@ private: template NT initialize_faces_areas(const FaceRange& face_range, - TriangleMesh& tmesh) + Triangle_mesh& tmesh) { m_face_areas = get(Face_NT_tag(), tmesh); NT total_area = 0; @@ -490,7 +494,7 @@ private: Matrix& A_prev, Vector&, Vector&, - const TriangleMesh& tmesh, + const Triangle_mesh& tmesh, vertex_descriptor v, VertexIndexMap vimap) { @@ -613,9 +617,9 @@ private: /// \param mesh a triangulated surface. /// \param main_vertex_v_i the vertex of `mesh` with index `i` /// \param neighbor_vertex_v_j the vertex of `mesh` with index `j` - NT compute_w_ij(const TriangleMesh& tmesh, + NT compute_w_ij(const Triangle_mesh& tmesh, vertex_descriptor main_vertex_v_i, - vertex_around_target_circulator neighbor_vertex_v_j) const + Vertex_around_target_circulator neighbor_vertex_v_j) const { const PPM ppmap = get(vertex_point, tmesh); @@ -655,7 +659,7 @@ private: Error_code setup_inner_vertex_relations_cotangent(Matrix& A, Vector&, Vector&, - const TriangleMesh& tmesh, + const Triangle_mesh& tmesh, vertex_descriptor v, VertexIndexMap& vimap) { @@ -706,12 +710,12 @@ private: Error_code setup_inner_vertex_relations_MVC(Matrix& A, Vector&, Vector&, - TriangleMesh& tmesh, + Triangle_mesh& tmesh, vertex_descriptor v, VertexIndexMap& vimap) const { auto vpm = get_const_property_map(CGAL::vertex_point, tmesh); - CGAL::internal::Mean_value_weight compute_mvc(tmesh, vpm); + CGAL::internal::Mean_value_weight compute_mvc(tmesh, vpm); const int i = get(vimap, v); @@ -746,7 +750,7 @@ private: Matrix& A_prev, Vector&, Vector&, - const TriangleMesh& tmesh, + const Triangle_mesh& tmesh, vertex_descriptor v, VertexIndexMap vimap, NT gamma) @@ -806,27 +810,27 @@ public: /// "u = constant" and "v = constant". /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// /// \param A the matrix in both linear system /// \param Bu the right hand side vector in the linear system of x coordinates /// \param Bv the right hand side vector in the linear system of y coordinates - /// \param mesh a triangulated surface. - /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. + /// \param tmesh a triangulated surface + /// \param bhd a halfedge descriptor on the boundary of `mesh` + /// \param uvmap an instanciation of the class `VertexUVmap` + /// \param vimap an instanciation of the class `VertexIndexMap` /// /// \pre Vertices must be indexed (`vimap` must be initialized). /// \pre `A`, `Bu`, and `Bv` must be allocated. /// \pre Border vertices must be parameterized. template void initialize_system_from_mesh_border(Matrix& A, Vector& Bu, Vector& Bv, - const TriangleMesh& tmesh, + const Triangle_mesh& tmesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap) const @@ -853,14 +857,14 @@ public: /// The result is the `(u,v)` pair image of each vertex of the 3D surface. /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a Boolean as value type. /// /// \param tmesh a triangulated surface @@ -878,7 +882,7 @@ public: template - Error_code parameterize(TriangleMesh& tmesh, + Error_code parameterize(Triangle_mesh& tmesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap, @@ -895,7 +899,7 @@ public: std::vector cc_faces; cc_faces.reserve(num_faces(tmesh)); - internal::Containers_filler fc(tmesh, cc_vertices, &cc_faces); + internal::Containers_filler fc(tmesh, cc_vertices, &cc_faces); Polygon_mesh_processing::connected_component(face(opposite(bhd, tmesh), tmesh), tmesh, boost::make_function_output_iterator(fc)); @@ -954,7 +958,7 @@ public: { #if 0 status = setup_inner_vertex_relations(A, A_prev, Bu, Bv, tmesh, v, vimap); -#elif 0 +#elif 1 status = setup_inner_vertex_relations_cotangent(A, Bu, Bv, tmesh, v, vimap); #else status = setup_inner_vertex_relations_MVC(A, Bu, Bv, tmesh, v, vimap); @@ -1092,7 +1096,7 @@ public: template - Error_code parameterize(TriangleMesh& tmesh, + Error_code parameterize(Triangle_mesh& tmesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap, @@ -1106,7 +1110,7 @@ public: template - Error_code parameterize(TriangleMesh& tmesh, + Error_code parameterize(Triangle_mesh& tmesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap, @@ -1118,7 +1122,7 @@ public: } template - Error_code parameterize(TriangleMesh& tmesh, + Error_code parameterize(Triangle_mesh& tmesh, halfedge_descriptor bhd, VertexUVmap uvmap, const int iterations = 15) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h index 3f87d31458a..5a578b8ba8e 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h @@ -75,7 +75,7 @@ namespace Surface_mesh_parameterization { /// and `CGAL_EIGEN3_ENABLED` is defined, then an overload of `Eigen_solver_traits` /// is provided as default parameter: /// \code -/// CGAL::Eigen_solver_traits > > +/// CGAL::Eigen_solver_traits > > /// \endcode /// Otherwise, it uses CGAL's wrapping function to the OpenNL library: /// \code @@ -100,12 +100,7 @@ public: #if defined(CGAL_EIGEN3_ENABLED) // WARNING: at the moment, the choice of SolverTraits_ is completely // ignored (see LeastSquaresSolver typedef) and `OpenNL::LinearSolver` - // is used anyway. If Eigen solver traits were to be used again, there is a bug - // in the line below to be first fixed: - // `Eigen_sparse_symmetric_matrix::EigenType` is a NON SYMMETRIC - // Eigen sparse matrix, and thus SolverTraits_::Matrix will be a NON SYMMETRIC matrix - // and the whole symmetry aspect will be completely ignored. - // @fixme + // is always used... CGAL::Eigen_solver_traits< Eigen::SimplicialLDLT::EigenType> > #else @@ -113,24 +108,29 @@ public: #endif >::type Solver_traits; #else + /// The border parameterizer typedef Border_parameterizer_ Border_parameterizer; + + /// Solver traits type typedef SolverTraits_ Solver_traits; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - - typedef typename boost::graph_traits::vertex_iterator vertex_iterator; - typedef typename boost::graph_traits::face_iterator face_iterator; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; // Traits subtypes: - typedef typename internal::Kernel_traits::PPM PPM; - typedef typename internal::Kernel_traits::Kernel Kernel; + typedef typename internal::Kernel_traits::PPM PPM; + typedef typename internal::Kernel_traits::Kernel Kernel; typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Point_3 Point_3; @@ -157,7 +157,7 @@ public: /// returns whether the 3D -> 2D mapping is one-to-one. template - bool is_one_to_one_mapping(const TriangleMesh& mesh, + bool is_one_to_one_mapping(const Triangle_mesh& mesh, halfedge_descriptor bhd, const VertexUVMap uvmap) const { @@ -170,14 +170,14 @@ public: /// The result is the `(u,v)` pair image of each vertex of the 3D surface. /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a Boolean as value type. /// /// \param mesh a triangulated surface. @@ -190,20 +190,20 @@ public: /// \pre The vertices must be indexed (`vimap` must be initialized). /// template - Error_code parameterize(TriangleMesh& mesh, + Error_code parameterize(Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap, VertexParameterizedMap vpmap) { CGAL_precondition(is_valid_polygon_mesh(mesh)); - CGAL_precondition(bhd != boost::graph_traits::null_halfedge() && is_border(bhd, mesh)); + CGAL_precondition(bhd != boost::graph_traits::null_halfedge() && is_border(bhd, mesh)); // Fill containers boost::unordered_set ccvertices; std::vector ccfaces; - internal::Containers_filler fc(mesh, ccvertices, &ccfaces); + internal::Containers_filler fc(mesh, ccvertices, &ccfaces); Polygon_mesh_processing::connected_component( face(opposite(bhd, mesh), mesh), mesh, @@ -343,7 +343,7 @@ private: // in presence of degenerate triangles template Error_code setup_triangle_relations(LeastSquaresSolver& solver, - const TriangleMesh& mesh, + const Triangle_mesh& mesh, face_descriptor facet, VertexIndexMap vimap) const { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h index 70b975766b4..28af5d6f527 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h @@ -93,29 +93,33 @@ public: #endif >::type Solver_traits; #else + /// Solver traits type typedef SolverTraits_ Solver_traits; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; // Private types private: // This class - typedef MVC_post_processor_3 Self; + typedef MVC_post_processor_3 Self; // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef typename boost::graph_traits::face_iterator face_iterator; - typedef typename boost::graph_traits::vertex_iterator vertex_iterator; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; + typedef typename boost::graph_traits::face_iterator face_iterator; + typedef typename boost::graph_traits::vertex_iterator vertex_iterator; typedef boost::unordered_set Vertex_set; typedef std::vector Faces_vector; // Traits subtypes: - typedef typename internal::Kernel_traits::Kernel Kernel; + typedef typename internal::Kernel_traits::Kernel Kernel; typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Vector_2 Vector_2; @@ -189,12 +193,12 @@ private: // Private operations private: // Store the vertices and faces of the mesh in memory. - void initialize_containers(const TriangleMesh& mesh, + void initialize_containers(const Triangle_mesh& mesh, halfedge_descriptor bhd, Vertex_set& vertices, Faces_vector& faces) const { - internal::Containers_filler fc(mesh, vertices, &faces); + internal::Containers_filler fc(mesh, vertices, &faces); CGAL::Polygon_mesh_processing::connected_component( face(opposite(bhd, mesh), mesh), mesh, @@ -203,7 +207,7 @@ private: // Checks whether the polygon's border is simple. template - bool is_polygon_simple(const TriangleMesh& mesh, + bool is_polygon_simple(const Triangle_mesh& mesh, halfedge_descriptor bhd, const VertexUVMap uvmap) const { @@ -273,7 +277,7 @@ private: // Triangulate the convex hull of the border of the parameterization. template - Error_code triangulate_convex_hull(const TriangleMesh& mesh, + Error_code triangulate_convex_hull(const Triangle_mesh& mesh, halfedge_descriptor bhd, const VertexUVMap uvmap, CT& ct) const @@ -506,7 +510,7 @@ private: template - void fill_linear_system_matrix_mvc_from_mesh_halfedge(const TriangleMesh& mesh, + void fill_linear_system_matrix_mvc_from_mesh_halfedge(const Triangle_mesh& mesh, halfedge_descriptor hd, const VertexUVMap uvmap, const VertexIndexMap vimap, @@ -539,7 +543,7 @@ private: template - void fill_linear_system_matrix_mvc_from_mesh_face(const TriangleMesh& mesh, + void fill_linear_system_matrix_mvc_from_mesh_face(const Triangle_mesh& mesh, face_descriptor fd, const VertexUVMap uvmap, const VertexIndexMap vimap, @@ -562,7 +566,7 @@ private: typename VertexIndexMap, typename VertexParameterizedMap> Error_code compute_mvc_matrix(const CT& ct, - const TriangleMesh& mesh, + const Triangle_mesh& mesh, const Faces_vector& faces, const VertexUVMap uvmap, const VertexIndexMap vimap, @@ -660,7 +664,7 @@ private: typename VertexUVMap, typename VertexIndexMap, typename VertexParameterizedMap> - Error_code parameterize_convex_hull_with_MVC(const TriangleMesh& mesh, + Error_code parameterize_convex_hull_with_MVC(const Triangle_mesh& mesh, const Vertex_set& vertices, const Faces_vector& faces, const CT& ct, @@ -707,7 +711,7 @@ private: public: template - Error_code parameterize(const TriangleMesh& mesh, + Error_code parameterize(const Triangle_mesh& mesh, const Vertex_set& vertices, const Faces_vector& faces, halfedge_descriptor bhd, @@ -745,11 +749,11 @@ public: /// that is not necessarily embedded to a piece of the 2D space. /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// /// \param mesh a triangulated surface. @@ -759,7 +763,7 @@ public: /// template - Error_code parameterize(const TriangleMesh& mesh, + Error_code parameterize(const Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVMap uvmap, const VertexIndexMap vimap) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h index e54633b6f1b..796504c93f2 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h @@ -45,8 +45,8 @@ namespace Surface_mesh_parameterization { /// `Fixed_border_parameterizer_3::parameterize()`. /// - It provides default `BorderParameterizer_` and `SolverTraits_` template /// parameters. -/// - It implements `compute_w_ij()` to compute w_ij = (i, j) coefficient of matrix A -/// for j neighbor vertex of i based on Floater Mean Value Coordinates parameterization. +/// - It implements `compute_w_ij()` to compute `w_ij`, the `(i,j)` coefficient of matrix `A` +/// for `j` neighbor vertex of `i` based on Floater Mean Value Coordinates parameterization. /// - It implements an optimized version of `is_one_to_one_mapping()`. /// /// \cgalModels `Parameterizer_3` @@ -110,39 +110,48 @@ public: #endif >::type Solver_traits; #else + /// The border parameterizer typedef Border_parameterizer_ Border_parameterizer; + + /// Solver traits type typedef SolverTraits_ Solver_traits; #endif + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; + /// Mesh vertex type + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + // Private types private: // Superclass - typedef Fixed_border_parameterizer_3 Base; + typedef Fixed_border_parameterizer_3 Base; // Private types private: - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::face_descriptor face_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef typename boost::graph_traits::vertex_iterator vertex_iterator; - typedef typename boost::graph_traits::face_iterator face_iterator; - typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; + typedef typename boost::graph_traits::vertex_iterator vertex_iterator; + typedef typename boost::graph_traits::face_iterator face_iterator; + typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; // Mesh_TriangleMesh_3 subtypes: - typedef typename Base::PPM PPM; - typedef typename Base::Kernel Kernel; - typedef typename Base::NT NT; - typedef typename Base::Point_3 Point_3; - typedef typename Base::Vector_3 Vector_3; + typedef typename Base::PPM PPM; + typedef typename Base::Kernel Kernel; + typedef typename Base::NT NT; + typedef typename Base::Point_3 Point_3; + typedef typename Base::Vector_3 Vector_3; - // Solver traits subtypes: - typedef typename Solver_traits::Vector Vector; - typedef typename Solver_traits::Matrix Matrix; + typedef typename Solver_traits::Vector Vector; + typedef typename Solver_traits::Matrix Matrix; // Public operations public: @@ -151,7 +160,7 @@ public: ///< Object that maps the surface's border to 2D space. Solver_traits sparse_la = Solver_traits()) ///< Traits object to access a sparse linear system. - : Fixed_border_parameterizer_3(border_param, sparse_la) { } @@ -160,7 +169,7 @@ public: /// returns whether the 3D -> 2D mapping is one-to-one. template - bool is_one_to_one_mapping(const TriangleMesh& mesh, + bool is_one_to_one_mapping(const Triangle_mesh& mesh, halfedge_descriptor bhd, const VertexUVMap uvmap) const { @@ -181,9 +190,9 @@ protected: /// \param mesh a triangulated surface. /// \param main_vertex_v_i the vertex of `mesh` with index `i` /// \param neighbor_vertex_v_j the vertex of `mesh` with index `j` - virtual NT compute_w_ij(const TriangleMesh& mesh, + virtual NT compute_w_ij(const Triangle_mesh& mesh, vertex_descriptor main_vertex_v_i, - vertex_around_target_circulator neighbor_vertex_v_j) const + Vertex_around_target_circulator neighbor_vertex_v_j) const { const PPM ppmap = get(vertex_point, mesh); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index 925cd7bf968..3b887149ed3 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -202,7 +202,7 @@ Error_code read_cones(const TriangleMesh& tm, const char* filename, ConeOutputIt /// but is passed here as a template parameter for convenience, to avoid /// having to pass the multiple template parameters of the class `CGAL::Seam_mesh`. /// \tparam ConeInputBidirectionalIterator must be a model of `BidirectionalIterator` -/// with value type `boost::graph_traits::%vertex_descriptor`. +/// with value type `boost::graph_traits::%vertex_descriptor`. /// \tparam ConeMap must be a model of `AssociativeContainer` /// with `boost::graph_traits::%vertex_descriptor` as key type and /// \link PkgSurfaceMeshParameterizationEnums Cone_type \endlink as value type. @@ -216,13 +216,13 @@ bool locate_cones(const SeamMesh& mesh, ConeInputBidirectionalIterator first, ConeInputBidirectionalIterator beyond, ConeMap& cones) { - typedef typename SeamMesh::TriangleMesh TriangleMesh; + typedef typename SeamMesh::Triangle_mesh Triangle_mesh; - typedef typename boost::graph_traits::vertex_descriptor TM_vertex_descriptor; + typedef typename boost::graph_traits::vertex_descriptor TM_vertex_descriptor; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; // property map to go from TM_vertex_descriptor to Point_3 - typedef typename internal::Kernel_traits::PPM PM_PPM; + typedef typename internal::Kernel_traits::PPM PM_PPM; const PM_PPM pm_ppmap = get(boost::vertex_point, mesh.mesh()); // property map to go from vertex_descriptor to Point_3 @@ -264,9 +264,9 @@ bool locate_unordered_cones(const SeamMesh& mesh, CGAL_precondition(cones.empty()); CGAL_precondition(std::distance(first, beyond) == 3 || std::distance(first, beyond) == 4); - typedef typename SeamMesh::TriangleMesh TriangleMesh; + typedef typename SeamMesh::Triangle_mesh Triangle_mesh; - typedef typename boost::graph_traits::vertex_descriptor TM_vertex_descriptor; + typedef typename boost::graph_traits::vertex_descriptor TM_vertex_descriptor; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -282,7 +282,7 @@ bool locate_unordered_cones(const SeamMesh& mesh, CGAL_assertion(vertex_on_seam != vertex_descriptor()); // property map to go from TM_vertex_descriptor to Point_3 - typedef typename internal::Kernel_traits::PPM PM_PPM; + typedef typename internal::Kernel_traits::PPM PM_PPM; const PM_PPM pm_ppmap = get(boost::vertex_point, mesh.mesh()); // property map to go from vertex_descriptor to Point_3 @@ -406,12 +406,15 @@ public: #endif >::type Solver_traits; #else + /// Solver traits type typedef SolverTraits_ Solver_traits; #endif + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + private: typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename boost::graph_traits::vertex_iterator vertex_iterator; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h index d624060c8ed..729664848b6 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h @@ -67,18 +67,24 @@ class Square_border_parameterizer_3 { // Public types public: + /// Triangle mesh type + typedef TriangleMesh_ Triangle_mesh; + typedef TriangleMesh_ TriangleMesh; - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + /// Mesh vertex type + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef Halfedge_around_face_iterator halfedge_around_face_iterator; + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; // Protected types protected: + typedef Halfedge_around_face_iterator halfedge_around_face_iterator; + // Traits subtypes: - typedef typename internal::Kernel_traits::PPM PPM; - typedef typename internal::Kernel_traits::Kernel Kernel; + typedef typename internal::Kernel_traits::PPM PPM; + typedef typename internal::Kernel_traits::Kernel Kernel; typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Vector_3 Vector_3; @@ -92,14 +98,14 @@ private: // Protected operations protected: - virtual double compute_edge_length(const TriangleMesh& mesh, + virtual double compute_edge_length(const Triangle_mesh& mesh, vertex_descriptor source, vertex_descriptor target) const = 0; // Private operations private: // Compute the total length of the border. - double compute_border_length(const TriangleMesh& mesh, + double compute_border_length(const Triangle_mesh& mesh, halfedge_descriptor bhd) const { double len = 0.0; @@ -111,7 +117,7 @@ private: // Utility method for parameterize(). // Compute the mesh iterator whose offset is closest to 'value'. - halfedge_around_face_iterator closest_iterator(const TriangleMesh& mesh, + halfedge_around_face_iterator closest_iterator(const Triangle_mesh& mesh, halfedge_descriptor bhd, Offset_map& offset, double value) const @@ -138,7 +144,7 @@ private: // Set the corners by splitting the border of the mesh in four // approximately equal segments. template - halfedge_descriptor compute_offsets_without_given_vertices(const TriangleMesh& mesh, + halfedge_descriptor compute_offsets_without_given_vertices(const Triangle_mesh& mesh, halfedge_descriptor bhd, VertexParameterizedMap vpmap, Offset_map& offset) const @@ -185,7 +191,7 @@ private: // the mesh. The vertices between two given vertices vi and vj are // sent to the same side of the square. template - halfedge_descriptor compute_offsets(const TriangleMesh& mesh, + halfedge_descriptor compute_offsets(const Triangle_mesh& mesh, halfedge_descriptor bhd, VertexParameterizedMap vpmap, Offset_map& offset) @@ -249,14 +255,14 @@ public: /// (i.e.\ a (u,v) pair) on the border's shape. Mark them as parameterized. /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a Boolean as value type. /// /// \param mesh a triangulated surface. @@ -270,7 +276,7 @@ public: template - Error_code parameterize(const TriangleMesh& mesh, + Error_code parameterize(const Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVMap uvmap, VertexIndexMap /* vimap */, @@ -396,15 +402,14 @@ class Square_border_uniform_parameterizer_3 // Public types public: // We have to repeat the types exported by superclass - /// @cond SKIP_IN_MANUAL - typedef TriangleMesh_ TriangleMesh; - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - /// @endcond + typedef TriangleMesh_ TriangleMesh; + typedef TriangleMesh_ Triangle_mesh; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; // Private types private: - typedef Square_border_parameterizer_3 Base; - typedef typename Base::NT NT; + typedef Square_border_parameterizer_3 Base; + typedef typename Base::NT NT; public: virtual ~Square_border_uniform_parameterizer_3() { } @@ -426,7 +431,7 @@ public: // Protected operations protected: /// computes the length of an edge. - virtual NT compute_edge_length(const TriangleMesh& /* mesh */, + virtual NT compute_edge_length(const Triangle_mesh& /* mesh */, vertex_descriptor /* source */, vertex_descriptor /* target */) const { @@ -462,14 +467,13 @@ class Square_border_arc_length_parameterizer_3 { // Public types public: - /// @cond SKIP_IN_MANUAL - typedef TriangleMesh_ TriangleMesh; - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - /// @endcond + typedef TriangleMesh_ TriangleMesh; + typedef TriangleMesh_ Triangle_mesh; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; // Private types private: - typedef Square_border_parameterizer_3 Base; + typedef Square_border_parameterizer_3 Base; typedef typename Base::PPM PPM; typedef typename Base::NT NT; typedef typename Base::Vector_3 Vector_3; @@ -494,7 +498,7 @@ public: // Protected operations protected: /// Compute the length of an edge. - virtual NT compute_edge_length(const TriangleMesh& mesh, + virtual NT compute_edge_length(const Triangle_mesh& mesh, vertex_descriptor source, vertex_descriptor target) const { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h index b07f1038b31..4ce2b5ad1fe 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h @@ -56,16 +56,20 @@ class Two_vertices_parameterizer_3 { // Public types public: + /// Triangle mesh type typedef TriangleMesh_ TriangleMesh; - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + /// Mesh vertex type + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + /// Mesh halfedge type + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; // Private types private: // Traits subtypes: - typedef typename internal::Kernel_traits::PPM PPM; - typedef typename internal::Kernel_traits::Kernel Kernel; + typedef typename internal::Kernel_traits::PPM PPM; + typedef typename internal::Kernel_traits::Kernel Kernel; typedef typename Kernel::FT NT; typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Point_3 Point_3; @@ -92,7 +96,7 @@ public: typename VertexUVmap, typename VertexIndexMap, typename VertexParameterizedMap> - Error_code parameterize(const TriangleMesh& mesh, + Error_code parameterize(const Triangle_mesh& mesh, const VertexContainer& vertices, VertexUVmap uvmap, VertexIndexMap /* vimap */, @@ -270,14 +274,14 @@ public: /// maps two extreme vertices of the 3D mesh and mark them as parameterized. /// /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) /// as value type. /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a unique integer as value type. /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and + /// `boost::graph_traits::%vertex_descriptor` as key type and /// a Boolean as value type. /// /// \param mesh a triangulated surface. @@ -292,7 +296,7 @@ public: template - Error_code parameterize(const TriangleMesh& mesh, + Error_code parameterize(const Triangle_mesh& mesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap, @@ -300,7 +304,7 @@ public: { // Fill containers boost::unordered_set vertices; - internal::Containers_filler fc(mesh, vertices); + internal::Containers_filler fc(mesh, vertices); Polygon_mesh_processing::connected_component( face(opposite(bhd, mesh), mesh), mesh,