mirror of https://github.com/CGAL/cgal
Fixes for vertex/cell classes of SMDS_3 and Tetrahedral_remeshing (#7610)
## Summary of Changes The main point of this PR is to restore the API of `Remeshing_cell_base_3` to the initial state (since CGAL 5.1), which was changed with the introduction of SMDS_3 in CGAL 5.6 (https://github.com/CGAL/cgal/pull/5693). In CGAL 5.5, the class `Remeshing_cell_base_3` is templated by a geom traits and a cell base. In CGAL 5.6, the class became templated by only two index types, removing the possibility to derive from custom (TDS) base cell types. Also: - Decompactify Simplicial_cell_base_3, allowing a cell base to be used - Changed the API of Remeshing_vertex_base_3 to match that of Remeshing_cell_base_3 (and other CGAL triangulations): a Gt and a Vb - Proper rebind mechanism for VB/CB of SMDS_3 / Tetrahedral remeshing - Various fixes of the SMDS_3 / Tetrahedral_remeshing doc. TODO: - [x] Announce the breaking changes in CHANGES.md - [x] Introduce Compact_simplicial_cell_base_3? ## Release Management * Affected package(s): `SMDS_3`, `Tetrahedral_remeshing` * Issue(s) solved (if any): - * Feature/Small Feature (if any): n/a * License and copyright ownership: no change
This commit is contained in:
commit
3a54848e18
|
|
@ -35,6 +35,18 @@ Release date: October 2023
|
||||||
- Removed the class templates `Gray_image_mesh_domain_3`, `Implicit_mesh_domain_3`, and `Labeled_image_mesh_domain_3`
|
- Removed the class templates `Gray_image_mesh_domain_3`, `Implicit_mesh_domain_3`, and `Labeled_image_mesh_domain_3`
|
||||||
which are deprecated since CGAL-4.13.
|
which are deprecated since CGAL-4.13.
|
||||||
|
|
||||||
|
### [Tetrahedral Remeshing](https://doc.cgal.org/6.0/Manual/packages.html#PkgTetrahedralRemeshing)
|
||||||
|
- **Breaking change**: The template parameters of
|
||||||
|
`CGAL::Tetrahedral_remeshing::Remeshing_cell_base_3`
|
||||||
|
have been modified, reverting changes introduced in CGAL 5.6.
|
||||||
|
- **Breaking change**: The vertex base of
|
||||||
|
`CGAL::Tetrahedral_remeshing::Remeshing_vertex_base_3`
|
||||||
|
must now be a model of the concept ` SimplicialMeshVertexBase_3` (and not only `TriangulationVertexBase_3`).
|
||||||
|
|
||||||
|
### [3D Simplicial Mesh Data Structure](https://doc.cgal.org/6.0/Manual/packages.html#PkgSMDS3)
|
||||||
|
- **Breaking change**: The template parameters of
|
||||||
|
`CGAL::Simplicial_mesh_cell_base_3`
|
||||||
|
have been modified to enable passing a geometric traits and a custom cell base class.
|
||||||
|
|
||||||
[Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6)
|
[Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6)
|
||||||
-----------
|
-----------
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,12 @@
|
||||||
|
|
||||||
The concept `SimplicialMeshCellBase_3` describes the requirements
|
The concept `SimplicialMeshCellBase_3` describes the requirements
|
||||||
for the `TriangulationDataStructure_3::Cell` type of the triangulation
|
for the `TriangulationDataStructure_3::Cell` type of the triangulation
|
||||||
used in the 3D simplicial mesh data structure. The type `SimplicialMeshCellBase_3`
|
used in a 3D simplicial mesh data structure.
|
||||||
refines the concept `TriangulationCellBase_3`
|
|
||||||
and must be copy constructible.
|
The type `SimplicialMeshCellBase_3` refines the concept `TriangulationCellBase_3`
|
||||||
The concept `SimplicialMeshCellBase_3`
|
and must be copy constructible. The concept `SimplicialMeshCellBase_3` includes a way to store and
|
||||||
includes a way to store and retrieve
|
retrieve if a given cell of the triangulation is inside a subdomain or not, and which subdomain it
|
||||||
if a given cell of the triangulation is inside a subdomain or not,
|
belongs to in case of a multi-domain.
|
||||||
and which subdomain it belongs to
|
|
||||||
in case of a multi-domain.
|
|
||||||
|
|
||||||
Moreover, this concept adds four markers per cell to mark the facets
|
Moreover, this concept adds four markers per cell to mark the facets
|
||||||
of the triangulation that are surface facets.
|
of the triangulation that are surface facets.
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
The concept `SimplicialMeshVertexBase_3` describes the requirements
|
The concept `SimplicialMeshVertexBase_3` describes the requirements
|
||||||
for the `Vertex` type of the triangulation
|
for the `Vertex` type of the triangulation
|
||||||
used in the 3D simplicial mesh data structure. The type `SimplicialMeshVertexBase_3`
|
used in a 3D simplicial mesh data structure. The type `SimplicialMeshVertexBase_3`
|
||||||
refines the concept `TriangulationVertexBase_3`.
|
refines the concept `TriangulationVertexBase_3`.
|
||||||
It provides additional members to store and retrieve
|
It provides additional members to store and retrieve
|
||||||
information about the location of the vertex with respect
|
information about the location of the vertex with respect
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ using Surface_patch_index = unsigned char;
|
||||||
using Curve_index = char;
|
using Curve_index = char;
|
||||||
using Corner_index = short;
|
using Corner_index = short;
|
||||||
|
|
||||||
using Cb = CGAL::Simplicial_mesh_cell_base_3<Subdomain_index, Surface_patch_index>;
|
using Cb = CGAL::Simplicial_mesh_cell_base_3<K, Subdomain_index, Surface_patch_index>;
|
||||||
using Vb = CGAL::Simplicial_mesh_vertex_base_3<K, Subdomain_index, Surface_patch_index,
|
using Vb = CGAL::Simplicial_mesh_vertex_base_3<K, Subdomain_index, Surface_patch_index,
|
||||||
Curve_index, Corner_index>;
|
Curve_index, Corner_index>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,391 @@
|
||||||
|
// Copyright (c) 2006-2007 INRIA Sophia-Antipolis (France).
|
||||||
|
// Copyright (c) 2008,2011 GeometryFactory Sarl (France)
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// This file is part of CGAL (www.cgal.org).
|
||||||
|
//
|
||||||
|
// $URL$
|
||||||
|
// $Id$
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||||
|
//
|
||||||
|
// Author(s) : Laurent Rineau, Stephane Tayeb, Andreas Fabri, Jane Tournois
|
||||||
|
|
||||||
|
#ifndef CGAL_COMPACT_SIMPLICIAL_MESH_CELL_BASE_3_H
|
||||||
|
#define CGAL_COMPACT_SIMPLICIAL_MESH_CELL_BASE_3_H
|
||||||
|
|
||||||
|
#include <CGAL/license/SMDS_3.h>
|
||||||
|
|
||||||
|
#include <CGAL/array.h>
|
||||||
|
#include <CGAL/assertions.h>
|
||||||
|
#include <CGAL/basic.h>
|
||||||
|
#include <CGAL/Has_timestamp.h>
|
||||||
|
#include <CGAL/tags.h>
|
||||||
|
#include <CGAL/TDS_3/internal/Dummy_tds_3.h>
|
||||||
|
|
||||||
|
#include <CGAL/SMDS_3/io_signature.h>
|
||||||
|
|
||||||
|
namespace CGAL {
|
||||||
|
|
||||||
|
// Adds information to Cb about the cell of the input complex containing it
|
||||||
|
template <typename Subdomain_index_,
|
||||||
|
typename Surface_patch_index_,
|
||||||
|
typename TDS>
|
||||||
|
class Compact_simplicial_mesh_cell_3
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using Triangulation_data_structure = TDS;
|
||||||
|
|
||||||
|
using Vertex_handle = typename TDS::Vertex_handle;
|
||||||
|
using Cell_handle = typename TDS::Cell_handle;
|
||||||
|
using Vertex = typename TDS::Vertex;
|
||||||
|
using Cell = typename TDS::Cell;
|
||||||
|
using TDS_data = typename TDS::Cell_data;
|
||||||
|
|
||||||
|
// Index Type
|
||||||
|
using Subdomain_index = Subdomain_index_;
|
||||||
|
using Surface_patch_index = Surface_patch_index_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Constructors
|
||||||
|
Compact_simplicial_mesh_cell_3()
|
||||||
|
: time_stamp_(std::size_t(-1))
|
||||||
|
{}
|
||||||
|
|
||||||
|
Compact_simplicial_mesh_cell_3(const Compact_simplicial_mesh_cell_3& rhs)
|
||||||
|
: N(rhs.N)
|
||||||
|
, V(rhs.V)
|
||||||
|
, time_stamp_(rhs.time_stamp_)
|
||||||
|
, subdomain_index_(rhs.subdomain_index_)
|
||||||
|
{
|
||||||
|
for(int i=0; i <4; i++){
|
||||||
|
surface_index_table_[i] = rhs.surface_index_table_[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Compact_simplicial_mesh_cell_3(Vertex_handle v0,
|
||||||
|
Vertex_handle v1,
|
||||||
|
Vertex_handle v2,
|
||||||
|
Vertex_handle v3)
|
||||||
|
: V(CGAL::make_array(v0, v1, v2, v3))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Compact_simplicial_mesh_cell_3(Vertex_handle v0,
|
||||||
|
Vertex_handle v1,
|
||||||
|
Vertex_handle v2,
|
||||||
|
Vertex_handle v3,
|
||||||
|
Cell_handle n0,
|
||||||
|
Cell_handle n1,
|
||||||
|
Cell_handle n2,
|
||||||
|
Cell_handle n3)
|
||||||
|
: N(CGAL::make_array(n0, n1, n2, n3))
|
||||||
|
, V(CGAL::make_array(v0, v1, v2, v3))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// ACCESS FUNCTIONS
|
||||||
|
Vertex_handle vertex(int i) const
|
||||||
|
{
|
||||||
|
CGAL_precondition( i >= 0 && i <= 3 );
|
||||||
|
return V[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool has_vertex(Vertex_handle v) const
|
||||||
|
{
|
||||||
|
return (V[0] == v) || (V[1] == v) || (V[2]== v) || (V[3]== v);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool has_vertex(Vertex_handle v, int & i) const
|
||||||
|
{
|
||||||
|
if (v == V[0]) { i = 0; return true; }
|
||||||
|
if (v == V[1]) { i = 1; return true; }
|
||||||
|
if (v == V[2]) { i = 2; return true; }
|
||||||
|
if (v == V[3]) { i = 3; return true; }
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int index(Vertex_handle v) const
|
||||||
|
{
|
||||||
|
if (v == V[0]) { return 0; }
|
||||||
|
if (v == V[1]) { return 1; }
|
||||||
|
if (v == V[2]) { return 2; }
|
||||||
|
CGAL_assertion( v == V[3] );
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
Cell_handle neighbor(int i) const
|
||||||
|
{
|
||||||
|
CGAL_precondition( i >= 0 && i <= 3);
|
||||||
|
return N[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool has_neighbor(Cell_handle n) const
|
||||||
|
{
|
||||||
|
return (N[0] == n) || (N[1] == n) || (N[2] == n) || (N[3] == n);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool has_neighbor(Cell_handle n, int & i) const
|
||||||
|
{
|
||||||
|
if(n == N[0]){ i = 0; return true; }
|
||||||
|
if(n == N[1]){ i = 1; return true; }
|
||||||
|
if(n == N[2]){ i = 2; return true; }
|
||||||
|
if(n == N[3]){ i = 3; return true; }
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int index(Cell_handle n) const
|
||||||
|
{
|
||||||
|
if (n == N[0]) return 0;
|
||||||
|
if (n == N[1]) return 1;
|
||||||
|
if (n == N[2]) return 2;
|
||||||
|
CGAL_assertion( n == N[3] );
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// SETTING
|
||||||
|
void set_neighbor(int i, Cell_handle n)
|
||||||
|
{
|
||||||
|
CGAL_precondition( i >= 0 && i <= 3);
|
||||||
|
CGAL_precondition( this != n.operator->() );
|
||||||
|
N[i] = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_neighbors()
|
||||||
|
{
|
||||||
|
N[0] = N[1] = N[2] = N[3] = Cell_handle();
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_neighbors(Cell_handle n0, Cell_handle n1,
|
||||||
|
Cell_handle n2, Cell_handle n3)
|
||||||
|
{
|
||||||
|
CGAL_precondition( this != n0.operator->() );
|
||||||
|
CGAL_precondition( this != n1.operator->() );
|
||||||
|
CGAL_precondition( this != n2.operator->() );
|
||||||
|
CGAL_precondition( this != n3.operator->() );
|
||||||
|
N[0] = n0;
|
||||||
|
N[1] = n1;
|
||||||
|
N[2] = n2;
|
||||||
|
N[3] = n3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// CHECKING
|
||||||
|
|
||||||
|
// the following trivial is_valid allows
|
||||||
|
// the user of derived cell base classes
|
||||||
|
// to add their own purpose checking
|
||||||
|
bool is_valid(bool = false, int = 0) const
|
||||||
|
{ return true; }
|
||||||
|
|
||||||
|
// For use by Compact_container.
|
||||||
|
void * for_compact_container() const { return N[0].for_compact_container(); }
|
||||||
|
void for_compact_container(void *p) { N[0].for_compact_container(p); }
|
||||||
|
|
||||||
|
// TDS internal data access functions.
|
||||||
|
TDS_data& tds_data() { return _tds_data; }
|
||||||
|
const TDS_data& tds_data() const { return _tds_data; }
|
||||||
|
|
||||||
|
// We must override the functions that modify the vertices.
|
||||||
|
// And if the point inside a vertex is modified, we fail,
|
||||||
|
// but there's not much we can do for this now.
|
||||||
|
void set_vertex(int i, Vertex_handle v)
|
||||||
|
{
|
||||||
|
CGAL_precondition( i >= 0 && i <= 3);
|
||||||
|
V[i] = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_vertices()
|
||||||
|
{
|
||||||
|
V[0] = V[1] = V[2] = V[3] = Vertex_handle();
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_vertices(Vertex_handle v0, Vertex_handle v1,
|
||||||
|
Vertex_handle v2, Vertex_handle v3)
|
||||||
|
{
|
||||||
|
V[0] = v0;
|
||||||
|
V[1] = v1;
|
||||||
|
V[2] = v2;
|
||||||
|
V[3] = v3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns the index of the cell of the input complex that contains the cell
|
||||||
|
Subdomain_index subdomain_index() const { return subdomain_index_; }
|
||||||
|
|
||||||
|
// Sets the index of the cell of the input complex that contains the cell
|
||||||
|
void set_subdomain_index(const Subdomain_index& index)
|
||||||
|
{ subdomain_index_ = index; }
|
||||||
|
|
||||||
|
/// Set surface index of \c facet to \c index
|
||||||
|
void set_surface_patch_index(const int facet, const Surface_patch_index& index)
|
||||||
|
{
|
||||||
|
CGAL_precondition(facet>=0 && facet<4);
|
||||||
|
surface_index_table_[facet] = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns surface index of facet \c facet
|
||||||
|
Surface_patch_index surface_patch_index(const int facet) const
|
||||||
|
{
|
||||||
|
CGAL_precondition(facet>=0 && facet<4);
|
||||||
|
return surface_index_table_[facet];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns true if facet lies on a surface patch
|
||||||
|
bool is_facet_on_surface(const int facet) const
|
||||||
|
{
|
||||||
|
CGAL_precondition(facet>=0 && facet<4);
|
||||||
|
return ( !( Surface_patch_index() == surface_index_table_[facet] ));
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------
|
||||||
|
// Backward Compatibility
|
||||||
|
// -----------------------------------
|
||||||
|
#ifndef CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX
|
||||||
|
typedef Surface_patch_index Surface_index;
|
||||||
|
|
||||||
|
void set_surface_index(const int facet, const Surface_index& index)
|
||||||
|
{ set_surface_patch_index(facet,index); }
|
||||||
|
|
||||||
|
/// Returns surface index of facet \c facet
|
||||||
|
Surface_index surface_index(const int facet) const
|
||||||
|
{ return surface_patch_index(facet); }
|
||||||
|
#endif // CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX
|
||||||
|
// -----------------------------------
|
||||||
|
// End backward Compatibility
|
||||||
|
// -----------------------------------
|
||||||
|
|
||||||
|
static
|
||||||
|
std::string io_signature()
|
||||||
|
{
|
||||||
|
return
|
||||||
|
Get_io_signature<Subdomain_index>()()
|
||||||
|
+ "+(" + Get_io_signature<Surface_patch_index>()() + ")[4]";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// For the determinism of Compact_container iterators
|
||||||
|
///@{
|
||||||
|
typedef Tag_true Has_timestamp;
|
||||||
|
|
||||||
|
std::size_t time_stamp() const {
|
||||||
|
return time_stamp_;
|
||||||
|
}
|
||||||
|
void set_time_stamp(const std::size_t& ts) {
|
||||||
|
time_stamp_ = ts;
|
||||||
|
}
|
||||||
|
///@}
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Stores surface_index for each facet of the cell
|
||||||
|
std::array<Surface_patch_index, 4> surface_index_table_ = {};
|
||||||
|
|
||||||
|
std::array<Cell_handle, 4> N;
|
||||||
|
std::array<Vertex_handle, 4> V;
|
||||||
|
|
||||||
|
std::size_t time_stamp_;
|
||||||
|
|
||||||
|
// The index of the cell of the input complex that contains me
|
||||||
|
Subdomain_index subdomain_index_ = {};
|
||||||
|
|
||||||
|
TDS_data _tds_data;
|
||||||
|
|
||||||
|
public:
|
||||||
|
friend std::istream& operator>>(std::istream &is, Compact_simplicial_mesh_cell_3 &c)
|
||||||
|
{
|
||||||
|
Subdomain_index index;
|
||||||
|
if(IO::is_ascii(is))
|
||||||
|
is >> index;
|
||||||
|
else
|
||||||
|
read(is, index);
|
||||||
|
|
||||||
|
if(is)
|
||||||
|
{
|
||||||
|
c.set_subdomain_index(index);
|
||||||
|
for(int i = 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
Surface_patch_index i2;
|
||||||
|
if(IO::is_ascii(is))
|
||||||
|
is >> IO::iformat(i2);
|
||||||
|
else
|
||||||
|
read(is, i2);
|
||||||
|
|
||||||
|
c.set_surface_patch_index(i, i2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend
|
||||||
|
std::ostream& operator<<(std::ostream &os, const Compact_simplicial_mesh_cell_3&c)
|
||||||
|
{
|
||||||
|
if(IO::is_ascii(os))
|
||||||
|
os << c.subdomain_index();
|
||||||
|
else
|
||||||
|
write(os, c.subdomain_index());
|
||||||
|
|
||||||
|
for(int i = 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
if(IO::is_ascii(os))
|
||||||
|
os << ' ' << IO::oformat(c.surface_patch_index(i));
|
||||||
|
else
|
||||||
|
write(os, c.surface_patch_index(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup PkgSMDS3Classes
|
||||||
|
|
||||||
|
The class `Compact_simplicial_mesh_cell_base_3`
|
||||||
|
is a model of the concept `SimplicialMeshCellBase_3`.
|
||||||
|
It is designed to serve as cell base class for.3D simplicial mesh data structures.
|
||||||
|
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.
|
||||||
|
It is more compact in memory than `CGAL::Simplicial_mesh_cell_base_3`.
|
||||||
|
|
||||||
|
\tparam SubdomainIndex 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 `MeshDomain_3::Subdomain_index` when used for mesh generation.
|
||||||
|
|
||||||
|
\tparam SurfacePatchIndex 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 `MeshDomain_3::Surface_patch_index` when used for mesh generation.
|
||||||
|
|
||||||
|
\cgalModels{SimplicialMeshCellBase_3}
|
||||||
|
|
||||||
|
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
|
||||||
|
\sa \link Mesh_cell_base_3 `CGAL::Mesh_cell_base_3`\endlink
|
||||||
|
\sa `MeshDomain_3`
|
||||||
|
\sa `MeshDomainWithFeatures_3`
|
||||||
|
*/
|
||||||
|
template <typename SubdomainIndex,
|
||||||
|
typename SurfacePatchIndex>
|
||||||
|
class Compact_simplicial_mesh_cell_base_3
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
#ifdef DOXYGEN_RUNNING
|
||||||
|
typedef unspecified_type Triangulation_data_structure;
|
||||||
|
#else
|
||||||
|
typedef internal::Dummy_tds_3 Triangulation_data_structure;
|
||||||
|
#endif
|
||||||
|
typedef Triangulation_data_structure::Vertex_handle Vertex_handle;
|
||||||
|
typedef Triangulation_data_structure::Cell_handle Cell_handle;
|
||||||
|
|
||||||
|
public:
|
||||||
|
template <typename TDS2>
|
||||||
|
struct Rebind_TDS
|
||||||
|
{
|
||||||
|
typedef Compact_simplicial_mesh_cell_3<SubdomainIndex,
|
||||||
|
SurfacePatchIndex,
|
||||||
|
TDS2> Other;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
|
#endif // CGAL_COMPACT_SIMPLICIAL_MESH_CELL_BASE_3_H
|
||||||
|
|
@ -32,187 +32,94 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
// Class Simplicial_mesh_cell_3
|
/*!
|
||||||
// Cell base class used for tetrahedral remeshing
|
\ingroup PkgSMDS3Classes
|
||||||
// Adds information to Cb about the cell of the input complex containing it
|
|
||||||
template< class Subdomain_index_,
|
The class `Simplicial_mesh_cell_base_3`
|
||||||
class Surface_patch_index_,
|
is a model of the concept `SimplicialMeshCellBase_3`.
|
||||||
class TDS>
|
It is designed to serve as cell base class for 3D simplicial mesh data structures.
|
||||||
class Simplicial_mesh_cell_3
|
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 `TriangulationTraits_3`
|
||||||
|
|
||||||
|
\tparam SubdomainIndex 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 `MeshDomain_3::Subdomain_index` when used for mesh generation.
|
||||||
|
|
||||||
|
\tparam SurfacePatchIndex 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 `MeshDomain_3::Surface_patch_index` when used for mesh generation.
|
||||||
|
|
||||||
|
\tparam Cb is the cell base class from which `Simplicial_mesh_cell_base_3` derives.
|
||||||
|
It must be a model of the concept `TriangulationCellBase_3`.
|
||||||
|
|
||||||
|
\cgalModels{SimplicialMeshCellBase_3}
|
||||||
|
|
||||||
|
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
|
||||||
|
\sa \link Mesh_cell_base_3 `CGAL::Mesh_cell_base_3`\endlink
|
||||||
|
\sa `MeshDomain_3`
|
||||||
|
\sa `MeshDomainWithFeatures_3`
|
||||||
|
*/
|
||||||
|
template <typename Gt,
|
||||||
|
typename SubdomainIndex,
|
||||||
|
typename SurfacePatchIndex,
|
||||||
|
typename Cb = Triangulation_cell_base_3<Gt> >
|
||||||
|
class Simplicial_mesh_cell_base_3
|
||||||
|
: public Cb
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using Triangulation_data_structure = TDS;
|
using Vertex_handle = typename Cb::Vertex_handle;
|
||||||
using Vertex_handle = typename TDS::Vertex_handle;
|
using Cell_handle = typename Cb::Cell_handle;
|
||||||
using Cell_handle = typename TDS::Cell_handle;
|
|
||||||
using Vertex = typename TDS::Vertex;
|
using Geom_traits = Gt;
|
||||||
using Cell = typename TDS::Cell;
|
|
||||||
using TDS_data = typename TDS::Cell_data;
|
|
||||||
|
|
||||||
// Index Type
|
// Index Type
|
||||||
using Subdomain_index = Subdomain_index_;
|
using Subdomain_index = SubdomainIndex;
|
||||||
using Surface_patch_index = Surface_patch_index_;
|
using Surface_patch_index = SurfacePatchIndex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructors
|
template <typename TDS2>
|
||||||
Simplicial_mesh_cell_3()
|
struct Rebind_TDS
|
||||||
|
{
|
||||||
|
using Cb2 = typename Cb::template Rebind_TDS<TDS2>::Other;
|
||||||
|
using Other = Simplicial_mesh_cell_base_3<Gt,
|
||||||
|
SubdomainIndex,
|
||||||
|
SurfacePatchIndex,
|
||||||
|
Cb2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
Simplicial_mesh_cell_base_3()
|
||||||
: time_stamp_(std::size_t(-1))
|
: time_stamp_(std::size_t(-1))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Simplicial_mesh_cell_3(const Simplicial_mesh_cell_3& rhs)
|
Simplicial_mesh_cell_base_3(const Simplicial_mesh_cell_base_3& rhs)
|
||||||
: N(rhs.N)
|
: Cb(static_cast<const Cb&>(rhs)),
|
||||||
, V(rhs.V)
|
time_stamp_(rhs.time_stamp_),
|
||||||
, time_stamp_(rhs.time_stamp_)
|
subdomain_index_(rhs.subdomain_index_)
|
||||||
, subdomain_index_(rhs.subdomain_index_)
|
|
||||||
{
|
{
|
||||||
for(int i=0; i <4; i++){
|
for(int i=0; i <4; ++i)
|
||||||
surface_index_table_[i] = rhs.surface_index_table_[i];
|
surface_index_table_[i] = rhs.surface_index_table_[i];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Simplicial_mesh_cell_3(Vertex_handle v0,
|
Simplicial_mesh_cell_base_3(Vertex_handle v0, Vertex_handle v1,
|
||||||
Vertex_handle v1,
|
|
||||||
Vertex_handle v2,
|
|
||||||
Vertex_handle v3)
|
|
||||||
: V(CGAL::make_array(v0, v1, v2, v3))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Simplicial_mesh_cell_3(Vertex_handle v0,
|
|
||||||
Vertex_handle v1,
|
|
||||||
Vertex_handle v2,
|
|
||||||
Vertex_handle v3,
|
|
||||||
Cell_handle n0,
|
|
||||||
Cell_handle n1,
|
|
||||||
Cell_handle n2,
|
|
||||||
Cell_handle n3)
|
|
||||||
: N(CGAL::make_array(n0, n1, n2, n3))
|
|
||||||
, V(CGAL::make_array(v0, v1, v2, v3))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// ACCESS FUNCTIONS
|
|
||||||
Vertex_handle vertex(int i) const
|
|
||||||
{
|
|
||||||
CGAL_precondition( i >= 0 && i <= 3 );
|
|
||||||
return V[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool has_vertex(Vertex_handle v) const
|
|
||||||
{
|
|
||||||
return (V[0] == v) || (V[1] == v) || (V[2]== v) || (V[3]== v);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool has_vertex(Vertex_handle v, int & i) const
|
|
||||||
{
|
|
||||||
if (v == V[0]) { i = 0; return true; }
|
|
||||||
if (v == V[1]) { i = 1; return true; }
|
|
||||||
if (v == V[2]) { i = 2; return true; }
|
|
||||||
if (v == V[3]) { i = 3; return true; }
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index(Vertex_handle v) const
|
|
||||||
{
|
|
||||||
if (v == V[0]) { return 0; }
|
|
||||||
if (v == V[1]) { return 1; }
|
|
||||||
if (v == V[2]) { return 2; }
|
|
||||||
CGAL_assertion( v == V[3] );
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
Cell_handle neighbor(int i) const
|
|
||||||
{
|
|
||||||
CGAL_precondition( i >= 0 && i <= 3);
|
|
||||||
return N[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool has_neighbor(Cell_handle n) const
|
|
||||||
{
|
|
||||||
return (N[0] == n) || (N[1] == n) || (N[2] == n) || (N[3] == n);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool has_neighbor(Cell_handle n, int & i) const
|
|
||||||
{
|
|
||||||
if(n == N[0]){ i = 0; return true; }
|
|
||||||
if(n == N[1]){ i = 1; return true; }
|
|
||||||
if(n == N[2]){ i = 2; return true; }
|
|
||||||
if(n == N[3]){ i = 3; return true; }
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index(Cell_handle n) const
|
|
||||||
{
|
|
||||||
if (n == N[0]) return 0;
|
|
||||||
if (n == N[1]) return 1;
|
|
||||||
if (n == N[2]) return 2;
|
|
||||||
CGAL_assertion( n == N[3] );
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
// SETTING
|
|
||||||
void set_neighbor(int i, Cell_handle n)
|
|
||||||
{
|
|
||||||
CGAL_precondition( i >= 0 && i <= 3);
|
|
||||||
CGAL_precondition( this != n.operator->() );
|
|
||||||
N[i] = n;
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_neighbors()
|
|
||||||
{
|
|
||||||
N[0] = N[1] = N[2] = N[3] = Cell_handle();
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_neighbors(Cell_handle n0, Cell_handle n1,
|
|
||||||
Cell_handle n2, Cell_handle n3)
|
|
||||||
{
|
|
||||||
CGAL_precondition( this != n0.operator->() );
|
|
||||||
CGAL_precondition( this != n1.operator->() );
|
|
||||||
CGAL_precondition( this != n2.operator->() );
|
|
||||||
CGAL_precondition( this != n3.operator->() );
|
|
||||||
N[0] = n0;
|
|
||||||
N[1] = n1;
|
|
||||||
N[2] = n2;
|
|
||||||
N[3] = n3;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CHECKING
|
|
||||||
|
|
||||||
// the following trivial is_valid allows
|
|
||||||
// the user of derived cell base classes
|
|
||||||
// to add their own purpose checking
|
|
||||||
bool is_valid(bool = false, int = 0) const
|
|
||||||
{ return true; }
|
|
||||||
|
|
||||||
// For use by Compact_container.
|
|
||||||
void * for_compact_container() const { return N[0].for_compact_container(); }
|
|
||||||
void for_compact_container(void *p) { N[0].for_compact_container(p); }
|
|
||||||
|
|
||||||
// TDS internal data access functions.
|
|
||||||
TDS_data& tds_data() { return _tds_data; }
|
|
||||||
const TDS_data& tds_data() const { return _tds_data; }
|
|
||||||
|
|
||||||
// We must override the functions that modify the vertices.
|
|
||||||
// And if the point inside a vertex is modified, we fail,
|
|
||||||
// but there's not much we can do for this now.
|
|
||||||
void set_vertex(int i, Vertex_handle v)
|
|
||||||
{
|
|
||||||
CGAL_precondition( i >= 0 && i <= 3);
|
|
||||||
V[i] = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_vertices()
|
|
||||||
{
|
|
||||||
V[0] = V[1] = V[2] = V[3] = Vertex_handle();
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_vertices(Vertex_handle v0, Vertex_handle v1,
|
|
||||||
Vertex_handle v2, Vertex_handle v3)
|
Vertex_handle v2, Vertex_handle v3)
|
||||||
{
|
: Cb(v0, v1, v2, v3)
|
||||||
V[0] = v0;
|
{ }
|
||||||
V[1] = v1;
|
|
||||||
V[2] = v2;
|
Simplicial_mesh_cell_base_3(Vertex_handle v0, Vertex_handle v1,
|
||||||
V[3] = v3;
|
Vertex_handle v2, Vertex_handle v3,
|
||||||
}
|
Cell_handle n0, Cell_handle n1,
|
||||||
|
Cell_handle n2, Cell_handle n3)
|
||||||
|
: Cb(v0, v1, v2, v3, n0, n1, n2, n3)
|
||||||
|
{ }
|
||||||
|
|
||||||
// Returns the index of the cell of the input complex that contains the cell
|
// Returns the index of the cell of the input complex that contains the cell
|
||||||
Subdomain_index subdomain_index() const { return subdomain_index_; }
|
Subdomain_index subdomain_index() const { return subdomain_index_; }
|
||||||
|
|
@ -284,25 +191,22 @@ private:
|
||||||
/// Stores surface_index for each facet of the cell
|
/// Stores surface_index for each facet of the cell
|
||||||
std::array<Surface_patch_index, 4> surface_index_table_ = {};
|
std::array<Surface_patch_index, 4> surface_index_table_ = {};
|
||||||
|
|
||||||
std::array<Cell_handle, 4> N;
|
|
||||||
std::array<Vertex_handle, 4> V;
|
|
||||||
|
|
||||||
std::size_t time_stamp_;
|
std::size_t time_stamp_;
|
||||||
|
|
||||||
// The index of the cell of the input complex that contains me
|
// The index of the cell of the input complex that contains me
|
||||||
Subdomain_index subdomain_index_ = {};
|
Subdomain_index subdomain_index_ = {};
|
||||||
|
|
||||||
TDS_data _tds_data;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
friend std::istream& operator>>(std::istream &is, Simplicial_mesh_cell_3 &c)
|
friend std::istream& operator>>(std::istream& is,
|
||||||
|
Simplicial_mesh_cell_base_3& c)
|
||||||
{
|
{
|
||||||
Subdomain_index index;
|
Subdomain_index index;
|
||||||
if(IO::is_ascii(is))
|
if(IO::is_ascii(is))
|
||||||
is >> index;
|
is >> index;
|
||||||
else
|
else
|
||||||
read(is, index);
|
read(is, index);
|
||||||
|
|
||||||
if(is) {
|
if(is) {
|
||||||
c.set_subdomain_index(index);
|
c.set_subdomain_index(index);
|
||||||
for(int i = 0; i < 4; ++i)
|
for(int i = 0; i < 4; ++i)
|
||||||
|
|
@ -321,12 +225,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
friend
|
friend
|
||||||
std::ostream& operator<<(std::ostream &os, const Simplicial_mesh_cell_3&c)
|
std::ostream& operator<<(std::ostream& os,
|
||||||
|
const Simplicial_mesh_cell_base_3& c)
|
||||||
{
|
{
|
||||||
if(IO::is_ascii(os))
|
if(IO::is_ascii(os))
|
||||||
os << c.subdomain_index();
|
os << c.subdomain_index();
|
||||||
else
|
else
|
||||||
write(os, c.subdomain_index());
|
write(os, c.subdomain_index());
|
||||||
|
|
||||||
for(int i = 0; i < 4; ++i)
|
for(int i = 0; i < 4; ++i)
|
||||||
{
|
{
|
||||||
if(IO::is_ascii(os))
|
if(IO::is_ascii(os))
|
||||||
|
|
@ -334,57 +240,11 @@ public:
|
||||||
else
|
else
|
||||||
write(os, c.surface_patch_index(i));
|
write(os, c.surface_patch_index(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end class Simplicial_mesh_cell_3
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\ingroup PkgSMDS3Classes
|
|
||||||
|
|
||||||
The class `Simplicial_mesh_cell_base_3`
|
|
||||||
is a model of the concept `SimplicialMeshCellBase_3`.
|
|
||||||
It is designed to serve as cell base class for.3D simplicial mesh data structures.
|
|
||||||
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 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.
|
|
||||||
|
|
||||||
\cgalModels{SimplicialMeshCellBase_3}
|
|
||||||
|
|
||||||
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
|
|
||||||
\sa \link Mesh_cell_base_3 `CGAL::Mesh_cell_base_3`\endlink
|
|
||||||
\sa `MeshDomain_3`
|
|
||||||
\sa `MeshDomainWithFeatures_3`
|
|
||||||
*/
|
|
||||||
template <typename Subdomain_index,
|
|
||||||
typename Surface_patch_index>
|
|
||||||
class Simplicial_mesh_cell_base_3
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
template <typename TDS2>
|
|
||||||
struct Rebind_TDS
|
|
||||||
{
|
|
||||||
typedef Simplicial_mesh_cell_3<Subdomain_index,
|
|
||||||
Surface_patch_index,
|
|
||||||
TDS2> Other;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
|
|
||||||
#endif // CGAL_SIMPLICIAL_MESH_CELL_BASE_3_H
|
#endif // CGAL_SIMPLICIAL_MESH_CELL_BASE_3_H
|
||||||
|
|
|
||||||
|
|
@ -29,21 +29,68 @@
|
||||||
#include <CGAL/variant.h>
|
#include <CGAL/variant.h>
|
||||||
#include <CGAL/Has_timestamp.h>
|
#include <CGAL/Has_timestamp.h>
|
||||||
|
|
||||||
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
//Class Simplicial_mesh_vertex_3
|
// Adds information to Vb about the localization of the vertex in regards to the 3D input complex.
|
||||||
//Adds information to Vb about the localization of the vertex in regards
|
|
||||||
//to the 3D input complex.
|
/*!
|
||||||
//\cgalModels{SimplicialMeshVertexBase_3}
|
\ingroup PkgSMDS3Classes
|
||||||
template<class GT,
|
|
||||||
typename Subdomain_index,
|
The class `Simplicial_mesh_vertex_base_3` is a model of the concept
|
||||||
typename Surface_patch_index,
|
`SimplicialMeshVertexBase_3`.
|
||||||
typename Curve_index,
|
It is designed to serve as vertex base class for 3D simplicial mesh data structures.
|
||||||
typename Corner_index,
|
It stores and gives access to data about the complex the vertex belongs to, such as the
|
||||||
class Vb>
|
index of the subcomplex it belongs to.
|
||||||
class Simplicial_mesh_vertex_3
|
|
||||||
|
\tparam Gt is the geometric traits class.
|
||||||
|
It must be a model of the concept `TriangulationTraits_3`
|
||||||
|
|
||||||
|
\tparam SubdomainIndex 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 `MeshDomain_3::Subdomain_index` when used for mesh generation.
|
||||||
|
|
||||||
|
\tparam SurfacePatchIndex 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 `MeshDomain_3::Surface_patch_index` when used for mesh generation.
|
||||||
|
|
||||||
|
\tparam CurveIndex 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 `MeshDomainWithFeatures_3::Curve_index` when used for mesh generation.
|
||||||
|
|
||||||
|
\tparam CornerIndex 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 `MeshDomainWithFeatures_3::Corner_index` when used for mesh generation.
|
||||||
|
|
||||||
|
\tparam Vb is the vertex base class from which `Simplicial_mesh_vertex_base_3` derives.
|
||||||
|
It must be a model of the concept `TriangulationVertexBase_3`.
|
||||||
|
|
||||||
|
\cgalModels{SimplicialMeshVertexBase_3}
|
||||||
|
|
||||||
|
\sa `CGAL::Mesh_complex_3_in_triangulation_3`
|
||||||
|
\sa \link Mesh_vertex_base_3 `CGAL::Mesh_vertex_base_3`\endlink
|
||||||
|
\sa `MeshDomain_3`
|
||||||
|
\sa `MeshDomainWithFeatures_3`
|
||||||
|
*/
|
||||||
|
template<typename Gt,
|
||||||
|
typename SubdomainIndex,
|
||||||
|
typename SurfacePatchIndex,
|
||||||
|
typename CurveIndex,
|
||||||
|
typename CornerIndex,
|
||||||
|
typename Vb = CGAL::Triangulation_vertex_base_3<Gt> >
|
||||||
|
class Simplicial_mesh_vertex_base_3
|
||||||
: public Vb
|
: public Vb
|
||||||
{
|
{
|
||||||
private :
|
private :
|
||||||
|
|
@ -53,11 +100,30 @@ public:
|
||||||
using Vertex_handle = typename Vb::Vertex_handle;
|
using Vertex_handle = typename Vb::Vertex_handle;
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
using Index = Variant_with_no_duplicate_t<Subdomain_index, Surface_patch_index, Curve_index, Corner_index>;
|
using Subdomain_index = SubdomainIndex;
|
||||||
using FT = typename GT::FT;
|
using Surface_patch_index = SurfacePatchIndex;
|
||||||
|
using Curve_index = CurveIndex;
|
||||||
|
using Corner_index = CornerIndex;
|
||||||
|
|
||||||
// Constructor
|
using Index = Variant_with_no_duplicate_t<Subdomain_index, Surface_patch_index, Curve_index, Corner_index>;
|
||||||
Simplicial_mesh_vertex_3()
|
|
||||||
|
using FT = typename Gt::FT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
template <typename TDS2>
|
||||||
|
struct Rebind_TDS
|
||||||
|
{
|
||||||
|
using Vb2 = typename Vb::template Rebind_TDS<TDS2>::Other;
|
||||||
|
using Other = Simplicial_mesh_vertex_base_3<Gt,
|
||||||
|
SubdomainIndex,
|
||||||
|
SurfacePatchIndex,
|
||||||
|
CurveIndex,
|
||||||
|
CornerIndex,
|
||||||
|
Vb2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
Simplicial_mesh_vertex_base_3()
|
||||||
: Vb()
|
: Vb()
|
||||||
, number_of_incident_facets_(0)
|
, number_of_incident_facets_(0)
|
||||||
, number_of_components_(0)
|
, number_of_components_(0)
|
||||||
|
|
@ -155,8 +221,8 @@ private:
|
||||||
std::size_t time_stamp_;
|
std::size_t time_stamp_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
friend std::istream& operator>>(std::istream& is,
|
||||||
friend std::istream& operator>>(std::istream &is, Simplicial_mesh_vertex_3& v)
|
Simplicial_mesh_vertex_base_3& v)
|
||||||
{
|
{
|
||||||
is >> static_cast<Cmvb3_base&>(v);
|
is >> static_cast<Cmvb3_base&>(v);
|
||||||
int dimension;
|
int dimension;
|
||||||
|
|
@ -181,7 +247,8 @@ public:
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend std::ostream& operator<<(std::ostream &os, const Simplicial_mesh_vertex_3& v)
|
friend std::ostream& operator<<(std::ostream& os,
|
||||||
|
const Simplicial_mesh_vertex_base_3& v)
|
||||||
{
|
{
|
||||||
os << static_cast<const Cmvb3_base&>(v);
|
os << static_cast<const Cmvb3_base&>(v);
|
||||||
if(IO::is_ascii(os)) {
|
if(IO::is_ascii(os)) {
|
||||||
|
|
@ -200,89 +267,8 @@ public:
|
||||||
v.index());
|
v.index());
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
}; // end class Simplicial_mesh_vertex_3
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\ingroup PkgSMDS3Classes
|
|
||||||
|
|
||||||
The class `Simplicial_mesh_vertex_base_3` is a model of the concept
|
|
||||||
`SimplicialMeshVertexBase_3`.
|
|
||||||
It is designed to serve as vertex base class for 3D simplicial mesh data structures.
|
|
||||||
It stores and gives access to data about the complex the vertex belongs to, such as the
|
|
||||||
index of the subcomplex it belongs to.
|
|
||||||
|
|
||||||
\tparam Gt is the geometric traits class.
|
|
||||||
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
|
|
||||||
`Triangulation_vertex_base_3<Gt>`.
|
|
||||||
|
|
||||||
\cgalModels{SimplicialMeshVertexBase_3}
|
|
||||||
|
|
||||||
\sa `CGAL::Mesh_complex_3_in_triangulation_3`
|
|
||||||
\sa \link Mesh_vertex_base_3 `CGAL::Mesh_vertex_base_3`\endlink
|
|
||||||
\sa `MeshDomain_3`
|
|
||||||
\sa `MeshDomainWithFeatures_3`
|
|
||||||
*/
|
|
||||||
template<class Gt,
|
|
||||||
typename Subdomain_index,
|
|
||||||
typename Surface_patch_index,
|
|
||||||
typename Curve_index,
|
|
||||||
typename Corner_index,
|
|
||||||
class Vb = Triangulation_vertex_base_3<Gt> >
|
|
||||||
struct Simplicial_mesh_vertex_base_3
|
|
||||||
{
|
|
||||||
using Triangulation_data_structure = internal::Dummy_tds_3;
|
|
||||||
using Vertex_handle = typename Triangulation_data_structure::Vertex_handle;
|
|
||||||
using Cell_handle = typename Triangulation_data_structure::Cell_handle;
|
|
||||||
|
|
||||||
template < class TDS3 >
|
|
||||||
struct Rebind_TDS {
|
|
||||||
using Vb3 = typename Vb::template Rebind_TDS<TDS3>::Other;
|
|
||||||
using Other = Simplicial_mesh_vertex_3 <Gt,
|
|
||||||
Subdomain_index,
|
|
||||||
Surface_patch_index,
|
|
||||||
Curve_index,
|
|
||||||
Corner_index,
|
|
||||||
Vb3>;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
} // end namespace CGAL
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // CGAL_SIMPLICIAL_MESH_VERTEX_BASE_3_H
|
#endif // CGAL_SIMPLICIAL_MESH_VERTEX_BASE_3_H
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ using Surface_patch_index = std::pair<int, int>;
|
||||||
using Curve_index = char;
|
using Curve_index = char;
|
||||||
using Corner_index = short;
|
using Corner_index = short;
|
||||||
|
|
||||||
using Cb = CGAL::Simplicial_mesh_cell_base_3<Subdomain_index, Surface_patch_index>;
|
using Cb = CGAL::Simplicial_mesh_cell_base_3<K, Subdomain_index, Surface_patch_index>;
|
||||||
using Vb = CGAL::Simplicial_mesh_vertex_base_3<K, Subdomain_index, Surface_patch_index,
|
using Vb = CGAL::Simplicial_mesh_vertex_base_3<K, Subdomain_index, Surface_patch_index,
|
||||||
Curve_index, Corner_index>;
|
Curve_index, Corner_index>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,36 +15,63 @@
|
||||||
|
|
||||||
#include <CGAL/license/Tetrahedral_remeshing.h>
|
#include <CGAL/license/Tetrahedral_remeshing.h>
|
||||||
|
|
||||||
#include <CGAL/Simplicial_mesh_cell_base_3.h>
|
#include <CGAL/Compact_simplicial_mesh_cell_base_3.h>
|
||||||
|
|
||||||
namespace CGAL
|
#include <CGAL/assertions.h>
|
||||||
{
|
|
||||||
namespace Tetrahedral_remeshing
|
|
||||||
{
|
|
||||||
|
|
||||||
template<typename Subdomain_index,
|
namespace CGAL {
|
||||||
typename Surface_patch_index,
|
namespace Tetrahedral_remeshing {
|
||||||
typename TDS>
|
|
||||||
class Remeshing_cell_3
|
/*!
|
||||||
: public CGAL::Simplicial_mesh_cell_3<Subdomain_index,
|
\ingroup PkgTetrahedralRemeshingClasses
|
||||||
Surface_patch_index,
|
|
||||||
TDS>
|
The class `Remeshing_cell_base_3` is a model of the concept `RemeshingCellBase_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 `SimplicialMeshCellBase_3` concept.
|
||||||
|
|
||||||
|
\cgalModels{RemeshingCellBase_3}
|
||||||
|
|
||||||
|
*/
|
||||||
|
template<typename Gt,
|
||||||
|
typename Cb = CGAL::Compact_simplicial_mesh_cell_base_3<
|
||||||
|
int /*Subdomain_index*/,
|
||||||
|
int /*Surface_patch_index*/> >
|
||||||
|
class Remeshing_cell_base_3
|
||||||
|
: public Cb
|
||||||
{
|
{
|
||||||
private:
|
public:
|
||||||
using Base = CGAL::Simplicial_mesh_cell_3<Subdomain_index,
|
using FT = typename Gt::FT;
|
||||||
Surface_patch_index,
|
|
||||||
TDS>;
|
using Vertex_handle = typename Cb::Vertex_handle;
|
||||||
|
using Cell_handle = typename Cb::Cell_handle;
|
||||||
|
|
||||||
|
using Geom_traits = Gt;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Base::Base;
|
template <typename TDS2>
|
||||||
|
struct Rebind_TDS
|
||||||
|
{
|
||||||
|
using Cb2 = typename Cb::template Rebind_TDS<TDS2>::Other;
|
||||||
|
using Other = Remeshing_cell_base_3<Gt, Cb2>;
|
||||||
|
};
|
||||||
|
|
||||||
void set_sliver_value(double value)
|
public:
|
||||||
|
using Cb::Cb; // constructors
|
||||||
|
|
||||||
|
public:
|
||||||
|
void set_sliver_value(const FT value)
|
||||||
{
|
{
|
||||||
sliver_cache_validity_ = true;
|
sliver_cache_validity_ = true;
|
||||||
sliver_value_ = value;
|
sliver_value_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
double sliver_value() const
|
FT sliver_value() const
|
||||||
{
|
{
|
||||||
CGAL_assertion(is_cache_valid());
|
CGAL_assertion(is_cache_valid());
|
||||||
return sliver_value_;
|
return sliver_value_;
|
||||||
|
|
@ -54,50 +81,11 @@ public:
|
||||||
void reset_cache_validity() const { sliver_cache_validity_ = false; }
|
void reset_cache_validity() const { sliver_cache_validity_ = false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double sliver_value_ = 0.;
|
FT sliver_value_ = 0.;
|
||||||
mutable bool sliver_cache_validity_ = false;
|
mutable bool sliver_cache_validity_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
} // namespace Tetrahedral_remeshing
|
||||||
\ingroup PkgTetrahedralRemeshingClasses
|
} // namespace CGAL
|
||||||
|
|
||||||
The class `Remeshing_cell_base_3` is a model of the concept `SimplicialMeshCellBase_3`.
|
|
||||||
It is designed to serve as cell base class for the 3D triangulation
|
|
||||||
used in the tetrahedral remeshing process.
|
|
||||||
|
|
||||||
\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.
|
|
||||||
|
|
||||||
\cgalModels{RemeshingCellBase_3,SimplicialMeshCellBase_3}
|
|
||||||
|
|
||||||
*/
|
|
||||||
template<typename Subdomain_index = int,
|
|
||||||
typename Surface_patch_index = int>
|
|
||||||
class Remeshing_cell_base_3
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
template <typename TDS2>
|
|
||||||
struct Rebind_TDS
|
|
||||||
{
|
|
||||||
typedef Remeshing_cell_3<Subdomain_index,
|
|
||||||
Surface_patch_index,
|
|
||||||
TDS2> Other;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}//end namespace Tetrahedral_remeshing
|
|
||||||
}//end namespace CGAL
|
|
||||||
|
|
||||||
#endif //CGAL_TET_ADAPTIVE_REMESHING_CELL_BASE_3_H
|
#endif //CGAL_TET_ADAPTIVE_REMESHING_CELL_BASE_3_H
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,14 @@ triangulation data structure.
|
||||||
Possible values are `Sequential_tag` (the default), `Parallel_tag`,
|
Possible values are `Sequential_tag` (the default), `Parallel_tag`,
|
||||||
and `Parallel_if_available_tag`.
|
and `Parallel_if_available_tag`.
|
||||||
|
|
||||||
\tparam Vb is a model of `RemeshingVertexBase_3`. It has the default value ` Remeshing_vertex_base_3<Gt>`.
|
\tparam Vb must be a model of `RemeshingVertexBase_3`.
|
||||||
\tparam Cb is a model of `RemeshingCellBase_3`. It has the default value ` Remeshing_cell_base_3<Gt>`.
|
|
||||||
|
|
||||||
|
\tparam Cb must be model of `RemeshingCellBase_3`.
|
||||||
*/
|
*/
|
||||||
template<typename Gt,
|
template<typename Gt,
|
||||||
typename Concurrency_tag = CGAL::Sequential_tag,
|
typename Concurrency_tag = CGAL::Sequential_tag,
|
||||||
typename Vb = Remeshing_vertex_base_3<Gt>,
|
typename Vb = Remeshing_vertex_base_3<Gt>,
|
||||||
typename Cb = Remeshing_cell_base_3<>
|
typename Cb = Remeshing_cell_base_3<Gt>
|
||||||
>
|
>
|
||||||
class Remeshing_triangulation_3
|
class Remeshing_triangulation_3
|
||||||
: public CGAL::Triangulation_3<Gt, CGAL::Triangulation_data_structure_3<Vb,Cb> >
|
: public CGAL::Triangulation_3<Gt, CGAL::Triangulation_data_structure_3<Vb,Cb> >
|
||||||
|
|
|
||||||
|
|
@ -17,43 +17,46 @@
|
||||||
|
|
||||||
#include <CGAL/Simplicial_mesh_vertex_base_3.h>
|
#include <CGAL/Simplicial_mesh_vertex_base_3.h>
|
||||||
|
|
||||||
namespace CGAL
|
namespace CGAL {
|
||||||
{
|
namespace Tetrahedral_remeshing {
|
||||||
namespace Tetrahedral_remeshing
|
|
||||||
{
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup PkgTetrahedralRemeshingClasses
|
\ingroup PkgTetrahedralRemeshingClasses
|
||||||
|
|
||||||
The class `Remeshing_vertex_base_3` is a model of the concept `MeshVertexBase_3`.
|
The class `Remeshing_vertex_base_3` is a model of the concept `RemeshingVertexBase_3`.
|
||||||
It is designed to serve as vertex base class for the 3D triangulation
|
It is designed to serve as vertex base class for the 3D triangulation
|
||||||
used in the tetrahedral remeshing process.
|
used in the tetrahedral remeshing process.
|
||||||
|
|
||||||
\tparam Gt is the geometric traits class.
|
\tparam Gt is the geometric traits class.
|
||||||
It has to be a model of the concept `RemeshingTriangulationTraits_3`.
|
It must be a model of the concept `RemeshingTriangulationTraits_3`.
|
||||||
|
|
||||||
\tparam Vb is a vertex base class from which `Remeshing_vertex_base_3` derives.
|
\tparam Vb is a vertex base class from which `Remeshing_vertex_base_3` derives.
|
||||||
It must be a model of the `TriangulationVertexBase_3` concept.
|
It must be a model of the concept `SimplicialMeshVertexBase_3`.
|
||||||
It has the default value `Triangulation_vertex_base_3<Gt>`.
|
|
||||||
|
|
||||||
\cgalModels{RemeshingVertexBase_3,SimplicialMeshVertexBase_3}
|
\cgalModels{RemeshingVertexBase_3,SimplicialMeshVertexBase_3}
|
||||||
*/
|
*/
|
||||||
template<typename GT,
|
template<typename Gt,
|
||||||
typename Subdomain_index = int,
|
typename Vb = CGAL::Simplicial_mesh_vertex_base_3<Gt,
|
||||||
typename Surface_patch_index = int,
|
int /*Subdomain_index*/,
|
||||||
typename Curve_index = int,
|
int /*Surface_patch_index*/,
|
||||||
typename Corner_index = int,
|
int /*Curve_index*/,
|
||||||
typename Vb = CGAL::Triangulation_vertex_base_3<GT> >
|
int /*Corner_index*/> >
|
||||||
using Remeshing_vertex_base_3
|
class Remeshing_vertex_base_3
|
||||||
= CGAL::Simplicial_mesh_vertex_base_3<GT,
|
: public Vb
|
||||||
Subdomain_index,
|
{
|
||||||
Surface_patch_index,
|
public:
|
||||||
Curve_index,
|
template <typename TDS2>
|
||||||
Corner_index,
|
struct Rebind_TDS
|
||||||
Vb>;
|
{
|
||||||
|
using Vb2 = typename Vb::template Rebind_TDS<TDS2>::Other;
|
||||||
|
using Other = Remeshing_vertex_base_3<Gt, Vb2>;
|
||||||
|
};
|
||||||
|
|
||||||
}//end namespace Tetrahedral_remeshing
|
public:
|
||||||
|
using Vb::Vb; // constructors
|
||||||
|
};
|
||||||
|
|
||||||
}//end namespace CGAL
|
} // namespace Tetrahedral_remeshing
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif //CGAL_TET_ADAPTIVE_REMESHING_VERTEX_BASE_3_H
|
#endif //CGAL_TET_ADAPTIVE_REMESHING_VERTEX_BASE_3_H
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace CGAL
|
||||||
* subdomains throughout the remeshing process.
|
* subdomains throughout the remeshing process.
|
||||||
*
|
*
|
||||||
* Subdomains are defined by indices that
|
* Subdomains are defined by indices that
|
||||||
* are stored in the cells of the input triangulation, following the `MeshCellBase_3`
|
* are stored in the cells of the input triangulation, following the `SimplicialMeshCellBase_3`
|
||||||
* concept (refined by `RemeshingCellBase_3`).
|
* concept (refined by `RemeshingCellBase_3`).
|
||||||
* The surfacic interfaces between subdomains are formed by facets whose two incident cells
|
* The surfacic interfaces between subdomains are formed by facets whose two incident cells
|
||||||
* have different subdomain indices.
|
* have different subdomain indices.
|
||||||
|
|
@ -302,14 +302,14 @@ void tetrahedral_isotropic_remeshing(
|
||||||
* @tparam Tr is the underlying triangulation for `Mesh_complex_3_in_triangulation_3`.
|
* @tparam Tr is the underlying triangulation for `Mesh_complex_3_in_triangulation_3`.
|
||||||
* It can be instantiated with any 3D regular triangulation of CGAL provided
|
* It can be instantiated with any 3D regular triangulation of CGAL provided
|
||||||
* that its vertex and cell base classes are models of the concepts
|
* that its vertex and cell base classes are models of the concepts
|
||||||
* `MeshVertexBase_3` (refined by `RemeshingCellBase_3`)
|
* `SimplicialMeshCellBase_3` (refined by `RemeshingCellBase_3`)
|
||||||
* and `MeshCellBase_3` (refined by `RemeshingVertexBase_3`), respectively.
|
* and `SimplicialMeshVertexBase_3` (refined by `RemeshingVertexBase_3`), respectively.
|
||||||
* @tparam CornerIndex is the type of the indices for feature corners.
|
* @tparam CornerIndex is the type of the indices for feature corners.
|
||||||
* If `c3t3` has been generated using `CGAL::make_mesh_3()`, it must match
|
* If `c3t3` has been generated using `CGAL::make_mesh_3()`, it must match
|
||||||
* the `Corner_index` type of the model of the `MeshDomainWithFeatures_3` concept used for mesh generation.
|
* `MeshDomainWithFeatures_3::Corner_index`.
|
||||||
* @tparam CurveIndex is the type of the indices for feature curves.
|
* @tparam CurveIndex is the type of the indices for feature curves.
|
||||||
* If `c3t3` has been generated using `CGAL::make_mesh_3()`, it must match
|
* If `c3t3` has been generated using `CGAL::make_mesh_3()`, it must match
|
||||||
* the `Curve_index` type of the model of the `MeshDomainWithFeatures_3` concept used for mesh generation.
|
* `MeshDomainWithFeatures_3::Curve_index`.
|
||||||
*
|
*
|
||||||
* @param c3t3 the complex containing the triangulation to be remeshed.
|
* @param c3t3 the complex containing the triangulation to be remeshed.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue