From 43e96bfe2ad2e9fbc492f415de92455af7dbf0e6 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 24 Mar 2022 15:29:53 +0100 Subject: [PATCH] wip simplicial Cb and Vb --- .../Concepts/SimplicialMeshCellBase_3.h | 22 ++---------- SMDS_3/examples/SMDS_3/c3t3_example.cpp | 2 +- .../CGAL/Mesh_complex_3_in_triangulation_3.h | 4 +-- .../CGAL/Simplicial_mesh_cell_base_3.h | 26 ++++---------- .../CGAL/Simplicial_mesh_vertex_base_3.h | 36 +++++++++++++++++-- SMDS_3/test/SMDS_3/test_simplicial_cb_vb.cpp | 2 +- .../Remeshing_cell_base_3.h | 22 ++---------- .../Remeshing_triangulation_3.h | 2 +- ...tetrahedral_remeshing_simplicial_cb_vb.cpp | 2 +- 9 files changed, 51 insertions(+), 67 deletions(-) diff --git a/SMDS_3/doc/SMDS_3/Concepts/SimplicialMeshCellBase_3.h b/SMDS_3/doc/SMDS_3/Concepts/SimplicialMeshCellBase_3.h index 457331e065e..9ae4b76e9de 100644 --- a/SMDS_3/doc/SMDS_3/Concepts/SimplicialMeshCellBase_3.h +++ b/SMDS_3/doc/SMDS_3/Concepts/SimplicialMeshCellBase_3.h @@ -36,35 +36,17 @@ public: /// @{ /*! -The bare point type, required to match the `Point_3` type -of the 3D triangulation traits in which the mesh is embedded. -*/ -typedef unspecified_type Point_3; - -/*! -The point type, required to match the `Point` type -of the 3D triangulation in which the mesh is embedded. -*/ -typedef unspecified_type Point; - -/*! -Type of indices for cells of the input complex. +Type of indices for cells of the mesh complex. Must match the type `MeshDomain_3::Subdomain_index` in the context of mesh generation. */ typedef unspecified_type Subdomain_index; /*! -Type of indices for surface patches of the input complex. +Type of indices for surface patches of the mesh complex. Must match the type `MeshDomain_3::Surface_patch_index` in the context of mesh generation. */ typedef unspecified_type Surface_patch_index; -/*! - Type of indices to be stored at mesh vertices to characterize the lowest dimensional face - of the input complex on which a possible future Steiner vertex lies. - Must match the type `MeshDomain_3::Index` in the context of mesh generation. -*/ -typedef unspecified_type Index; /// @} diff --git a/SMDS_3/examples/SMDS_3/c3t3_example.cpp b/SMDS_3/examples/SMDS_3/c3t3_example.cpp index 282797bb529..7f3b9aed695 100644 --- a/SMDS_3/examples/SMDS_3/c3t3_example.cpp +++ b/SMDS_3/examples/SMDS_3/c3t3_example.cpp @@ -21,7 +21,7 @@ using Surface_patch_index = unsigned char; using Curve_index = char; using Corner_index = short; -using Cb = CGAL::Simplicial_mesh_cell_base_3; +using Cb = CGAL::Simplicial_mesh_cell_base_3; using Vb = CGAL::Simplicial_mesh_vertex_base_3; diff --git a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h index 737281db52e..efa09daf890 100644 --- a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h +++ b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h @@ -143,12 +143,12 @@ namespace CGAL { \tparam CurveIndex Type of indices for curves (i.e. \f$ 1\f$-dimensional features) of the discretized geometric domain. It must be a model of `CopyConstructible`, `Assignable`, `DefaultConstructible` and - `LessThanComparable`. The default constructed value must be the value of an edge which + `LessThanComparable`. The default constructed value must be the value for an edge which does not approximate a 1-dimensional feature of the geometric domain. It must match the `Curve_index` types of the model of the `MeshDomainWithFeatures_3` concept when used for mesh generation. - Those two last template parameters defaults to `int`, so that they can be ignored + Those two last template parameters default to `int`, so that they can be ignored if the domain used for mesh generation does not include 0 and 1-dimensionnal features (i.e is a model of the concept `MeshDomain_3`). diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h index 7e10e2c25d4..43b177b7c26 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h @@ -29,8 +29,6 @@ #include #include -#include - #ifdef CGAL_LINKED_WITH_TBB # include #endif @@ -40,8 +38,7 @@ namespace CGAL { // Class Simplicial_mesh_cell_3 // Cell base class used for tetrahedral remeshing // Adds information to Cb about the cell of the input complex containing it -template< class Point_3, - class Subdomain_index_, +template< class Subdomain_index_, class Surface_patch_index_, class TDS> class Simplicial_mesh_cell_3 @@ -57,7 +54,6 @@ public: // Index Type using Subdomain_index = Subdomain_index_; using Surface_patch_index = Surface_patch_index_; - using Index = boost::variant; public: // Constructors @@ -286,10 +282,8 @@ public: static std::string io_signature() { - using Geom_traits = typename Kernel_traits::type; return - Get_io_signature()() + "+" + - Get_io_signature >()() + Get_io_signature()() + "+(" + Get_io_signature()() + ")[4]"; } @@ -379,9 +373,6 @@ It is designed to serve as cell base class for.3D simplicial mesh data structure It stores and gives access to data about the complex the cell belongs to, such as the subdomain it belongs to or surface it takes part to. -\tparam Gt is the geometric traits class. -It must be a model of the concept `RemeshingTriangulationTraits_3` - \tparam Subdomain_index Type of indices for subdomains of the discretized geometric domain. Must be a model of `CopyConstructible`, `Assignable`, `DefaultConstructible` and `EqualityComparable`. The default constructed value must match the label @@ -405,21 +396,19 @@ default parameter value `void`. \cgalModels `SimplicialMeshCellBase_3` \sa `CGAL::Mesh_complex_3_in_triangulation_3` -\sa `CGAL::Mesh_cell_base_3` +\sa \link Mesh_cell_base_3 `CGAL::Mesh_cell_base_3`\endlink \sa `MeshDomain_3` \sa `MeshDomainWithFeatures_3` */ -template< class Gt, - typename Subdomain_index, +template< typename Subdomain_index, typename Surface_patch_index, class TDS = void > class Simplicial_mesh_cell_base_3; // Specialization for void. -template -class Simplicial_mesh_cell_base_3 +class Simplicial_mesh_cell_base_3 { public: typedef internal::Dummy_tds_3 Triangulation_data_structure; @@ -429,8 +418,7 @@ public: template struct Rebind_TDS { - typedef Simplicial_mesh_cell_3 Other; }; diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h index 8e65f1f71de..b544c5e7721 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h @@ -199,7 +199,7 @@ public: v.index()); return os; } -}; // end class Mesh_vertex_3 +}; // end class Simplicial_mesh_vertex_3 /*! @@ -212,7 +212,37 @@ It stores and gives access to data about the complex the vertex belongs to, such index of the subcomplex it belongs to. \tparam Gt is the geometric traits class. -It must be a model of the concept `RemeshingTriangulationTraits_3` +It must be a model of the concept `TriangulationTraits_3` + +\tparam Subdomain_index Type of indices for subdomains of the discretized geometric domain. +Must be a model of `CopyConstructible`, `Assignable`, `DefaultConstructible` +and `EqualityComparable`. The default constructed value must match the label +of the exterior of the domain (which contains at least the unbounded component). + It must match the `Subdomain_index` of the model + of the `MeshDomain_3` concept when used for mesh generation. + +\tparam Surface_patch_index Type of indices for surface patches (boundaries and interfaces) +of the discretized geometric domain. +Must be a model of `CopyConstructible`, `Assignable`, `DefaultConstructible` +and `EqualityComparable`. The default constructed value must be the index value +assigned to a non surface facet. + It must match the `Surface_patch_index` of the model + of the `MeshDomain_3` concept when used for mesh generation. + +\tparam Curve_index Type of indices for curves (i.e. \f$ 1\f$-dimensional features) +of the discretized geometric domain. +Must be a model of `CopyConstructible`, `Assignable`, `DefaultConstructible` and +`LessThanComparable`. The default constructed value must be the value for an edge which +does not approximate a 1-dimensional feature of the geometric domain. + It must match the `Curve_index` types of the model + of the `MeshDomainWithFeatures_3` concept when used for mesh generation. + +\tparam Corner_index Type of indices for corners (i.e.\f$ 0\f$--dimensional features) +of the discretized geometric domain. +It must be a model of `CopyConstructible`, `Assignable`, `DefaultConstructible` and +`LessThanComparable`. + It must match the `Corner_index` of the model + of the `MeshDomainWithFeatures_3` concept when used for mesh generation. \tparam Vb is the vertex base class. It has to be a model of the concept `TriangulationVertexBase_3` and defaults to @@ -221,7 +251,7 @@ of the concept `TriangulationVertexBase_3` and defaults to \cgalModels `SimplicialMeshVertexBase_3` \sa `CGAL::Mesh_complex_3_in_triangulation_3` -\sa `CGAL::Mesh_vertex_base_3` +\sa \link Mesh_vertex_base_3 `CGAL::Mesh_vertex_base_3`\endlink \sa `MeshDomain_3` \sa `MeshDomainWithFeatures_3` */ diff --git a/SMDS_3/test/SMDS_3/test_simplicial_cb_vb.cpp b/SMDS_3/test/SMDS_3/test_simplicial_cb_vb.cpp index fe1dd351fd1..3a946441ed9 100644 --- a/SMDS_3/test/SMDS_3/test_simplicial_cb_vb.cpp +++ b/SMDS_3/test/SMDS_3/test_simplicial_cb_vb.cpp @@ -19,7 +19,7 @@ using Surface_patch_index = std::pair; using Curve_index = char; using Corner_index = short; -using Cb = CGAL::Simplicial_mesh_cell_base_3; +using Cb = CGAL::Simplicial_mesh_cell_base_3; using Vb = CGAL::Simplicial_mesh_vertex_base_3; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/Remeshing_cell_base_3.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/Remeshing_cell_base_3.h index 338501dc3ab..484cfd51926 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/Remeshing_cell_base_3.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/Remeshing_cell_base_3.h @@ -21,15 +21,6 @@ namespace CGAL { namespace Tetrahedral_remeshing { -namespace internal -{ -struct Fake_MD_C -{ - typedef int Subdomain_index; - typedef int Surface_patch_index; - typedef int Index; -}; -} /*! \ingroup PkgTetrahedralRemeshingClasses @@ -38,23 +29,16 @@ The class `Remeshing_cell_base_3` is a model of the concept `MeshCellBase_3`. It is designed to serve as cell base class for the 3D triangulation used in the tetrahedral remeshing process. -\tparam Gt is the geometric traits class. -It has to be a model of the concept `RemeshingTriangulationTraits_3`. - -\tparam Cb is a cell base class from which `Remeshing_cell_base_3` derives. -It must be a model of the `TriangulationCellBase_3` concept. -It has the default value `Triangulation_cell_base_3`. +\todo indices \cgalModels `SimplicialMeshCellBase_3` */ -template using Remeshing_cell_base_3 - = CGAL::Simplicial_mesh_cell_base_3; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/Remeshing_triangulation_3.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/Remeshing_triangulation_3.h index 9cdfd3127a7..e81b088e185 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/Remeshing_triangulation_3.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/Remeshing_triangulation_3.h @@ -58,7 +58,7 @@ and `Parallel_if_available_tag`. template, - typename Cb = Remeshing_cell_base_3 + typename Cb = Remeshing_cell_base_3<> > class Remeshing_triangulation_3 : public CGAL::Triangulation_3 > diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_simplicial_cb_vb.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_simplicial_cb_vb.cpp index 1eff52059a0..e2b8212e58c 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_simplicial_cb_vb.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_simplicial_cb_vb.cpp @@ -17,7 +17,7 @@ using Surface_patch_index = std::pair; using Curve_index = char; using Corner_index = short; -using Cb = CGAL::Simplicial_mesh_cell_base_3; +using Cb = CGAL::Simplicial_mesh_cell_base_3; using Vb = CGAL::Simplicial_mesh_vertex_base_3;