Merge pull request #5693 from janetournois/Mesh_data_structure_3-new_package-jtournois

SMDS_3: Mesh_data_structure_3 - new package for C3T3
This commit is contained in:
Laurent Rineau 2022-06-29 09:14:38 +02:00
commit 499b7794c9
166 changed files with 15309 additions and 3499 deletions

View File

@ -24,7 +24,6 @@
#include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/property_map.h>
#include <boost/utility/enable_if.hpp>
#include <boost/iterator/function_output_iterator.hpp>
#include <unordered_map>
@ -213,36 +212,6 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
}
} // end of namespace internal
namespace impl
{
template<typename PMAP>
struct Output_iterator_functor
{
typedef typename boost::property_traits<PMAP>::key_type input_t;
typedef typename boost::property_traits<PMAP>::value_type output_t;
PMAP map;
Output_iterator_functor(PMAP map)
:map(map)
{
}
void operator()(const typename std::pair<input_t, output_t>& pair)
{
put(map, pair.first, pair.second);
}
};
template<typename PMAP>
boost::function_output_iterator<Output_iterator_functor<PMAP> > make_functor(PMAP map)
{
return boost::make_function_output_iterator(Output_iterator_functor<PMAP>(map));
}
inline Emptyset_iterator make_functor(const internal_np::Param_not_found&)
{
return Emptyset_iterator();
}
}//end of impl
/*!
\ingroup PkgBGLHelperFct

View File

@ -13,7 +13,11 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/optional.hpp>
#include <CGAL/iterator.h>
#include <CGAL/property_map.h>
#include <CGAL/boost/graph/iterator.h>
#include <CGAL/Named_function_parameters.h>
#include <boost/iterator/function_output_iterator.hpp>
namespace CGAL {
@ -200,6 +204,38 @@ adjust_incoming_halfedge(typename boost::graph_traits<Graph>::vertex_descriptor
} // internal
namespace impl
{
template<typename PMAP>
struct Output_iterator_functor
{
typedef typename boost::property_traits<PMAP>::key_type input_t;
typedef typename boost::property_traits<PMAP>::value_type output_t;
PMAP map;
Output_iterator_functor(PMAP map)
:map(map)
{
}
void operator()(const typename std::pair<input_t, output_t>& pair)
{
put(map, pair.first, pair.second);
}
};
template<typename PMAP>
boost::function_output_iterator<Output_iterator_functor<PMAP> > make_functor(PMAP map)
{
return boost::make_function_output_iterator(Output_iterator_functor<PMAP>(map));
}
inline Emptyset_iterator make_functor(const internal_np::Param_not_found&)
{
return Emptyset_iterator();
}
}//end of impl
} // CGAL

File diff suppressed because it is too large Load Diff

View File

@ -90,6 +90,7 @@
\package_listing{Mesh_2}
\package_listing{Surface_mesher}
\package_listing{Skin_surface_3}
\package_listing{SMDS_3}
\package_listing{Mesh_3}
\package_listing{Tetrahedral_remeshing}
\package_listing{Periodic_3_mesh_3}

View File

@ -2,6 +2,19 @@ Release History
===============
[Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6)
-----------
Release date: Dec 2022
### [3D Simplicial Mesh Data Structure](https://doc.cgal.org/5.6/Manual/packages.html#PkgSMDS3) (new package)
- This new package wraps all the existing code that deals with a `MeshComplex_3InTriangulation_3`
to describe 3D simplicial meshess, and makes the data structure independent
from the tetrahedral mesh generation package.
[Release 5.5](https://github.com/CGAL/cgal/releases/tag/v5.5)
-----------
@ -247,6 +260,7 @@ Release date: January 2022
- Added support for the [OSQP solver](https://osqp.org/). This solver enables to efficiently compute
the convex Quadratic Programming (QP) problems arising in the context of several packages.
[Release 5.3](https://github.com/CGAL/cgal/releases/tag/v5.3)
-----------

View File

@ -0,0 +1,53 @@
// Copyright (C) 2020 GeometryFactory Sarl
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
#ifndef CGAL_SMDS_3_MESH_COMPLEX_3_IN_TRIANGULATION_3_FWD_H
#define CGAL_SMDS_3_MESH_COMPLEX_3_IN_TRIANGULATION_3_FWD_H
/// \file Mesh_complex_3_in_triangulation_3_fwd.h
/// Forward declarations of the SMDS_3 package.
#ifndef DOXYGEN_RUNNING
namespace CGAL {
// fwdS for the public interface
template <typename Tr,
typename CornerIndex = int,
typename CurveIndex = int>
class Mesh_complex_3_in_triangulation_3;
namespace IO {
template <class C3T3>
void output_to_medit(std::ostream& os,
const C3T3& c3t3,
bool rebind = false,
bool show_patches = false
#ifndef DOXYGEN_RUNNING
, bool all_vertices = true
, bool all_cells = false
#endif
);
} //namespace IO
namespace SMDS_3 {
template<class Tr>
bool build_triangulation_from_file(std::istream& is,
Tr& tr,
bool verbose = false,
bool replace_domain_0 = false,
bool allow_non_manifold = false);
} // namespace SMDS_3
} // namespace CGAL
#endif
#endif /* CGAL_SMDS_3_MESH_COMPLEX_3_IN_TRIANGULATION_3_FWD_H */

View File

@ -0,0 +1,54 @@
// Copyright (c) 2016 GeometryFactory SARL (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Andreas Fabri
//
// Warning: this file is generated, see include/CGAL/licence/README.md
#ifndef CGAL_LICENSE_SMDS_3_H
#define CGAL_LICENSE_SMDS_3_H
#include <CGAL/config.h>
#include <CGAL/license.h>
#ifdef CGAL_SMDS_3_COMMERCIAL_LICENSE
# if CGAL_SMDS_3_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
# if defined(CGAL_LICENSE_WARNING)
CGAL_pragma_warning("Your commercial license for CGAL does not cover "
"this release of the 3D Mesh Data Structure package.")
# endif
# ifdef CGAL_LICENSE_ERROR
# error "Your commercial license for CGAL does not cover this release \
of the 3D Mesh Data Structure package. \
You get this error, as you defined CGAL_LICENSE_ERROR."
# endif // CGAL_LICENSE_ERROR
# endif // CGAL_SMDS_3_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
#else // no CGAL_SMDS_3_COMMERCIAL_LICENSE
# if defined(CGAL_LICENSE_WARNING)
CGAL_pragma_warning("\nThe macro CGAL_SMDS_3_COMMERCIAL_LICENSE is not defined."
"\nYou use the CGAL 3D Simplicial Mesh Data Structure package under "
"the terms of the GPLv3+.")
# endif // CGAL_LICENSE_WARNING
# ifdef CGAL_LICENSE_ERROR
# error "The macro CGAL_SMDS_3_COMMERCIAL_LICENSE is not defined.\
You use the CGAL 3D Simplicial Mesh Data Structure package under the terms of \
the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR."
# endif // CGAL_LICENSE_ERROR
#endif // no CGAL_SMDS_3_COMMERCIAL_LICENSE
#endif // CGAL_LICENSE_SMDS_3_H

View File

@ -91,6 +91,7 @@ Surface_sweep_2 2D Intersection of Curves
TDS_2 2D Triangulation Data Structure
TDS_3 3D Triangulation Data Structure
Three Three
SMDS_3 3D Simplicial Mesh Data Structure
Triangulation_2 2D Triangulation
Triangulation_on_sphere_2 2D Triangulation on Sphere
Triangulation_3 3D Triangulations

View File

@ -1,34 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgMesh3MeshClasses
The class `Compact_mesh_cell_base_3<Gt, MD>` is a model of the concept `MeshCellBase_3`.
It is designed to serve as cell base class for the 3D triangulation
used in the 3D mesh generation process. It is more compact in memory than
`Mesh_cell_base_3`.
\tparam Gt is the geometric traits class.
It has to be a model of the concept `MeshTriangulationTraits_3`.
\tparam MD provides the types of indices used to identify
the faces of the input complex. It has to be a model
of the concept `MeshDomain_3`.
\tparam Tds is the triangulation data structure class to which cells
belong. That parameter is only used by the rebind mechanism (see
`::TriangulationDSCellBase_3::Rebind_TDS`). Users should always use the
default parameter value `void`.
\cgalModels `MeshCellBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
\sa `CGAL::Mesh_cell_base_3<Gt, MD, Cb>`
*/
template< typename Gt, typename MD, typename Tds = void >
class Compact_mesh_cell_base_3 {
public:
}; /* end Compact_mesh_cell_base_3 */
} /* end namespace CGAL */

View File

@ -1,14 +0,0 @@
namespace CGAL{
namespace IO {
/**
* \ingroup PkgMesh3IOFunctions
* @brief outputs mesh to avizo format
* @param os the stream
* @param c3t3 the mesh complex
* \see \ref IOStreamAvizo
*/
template <class C3T3>
void
output_to_avizo(std::ostream& os,
const C3T3& c3t3);
}}

View File

@ -1,21 +0,0 @@
namespace CGAL {
namespace IO {
/// \ingroup PkgMesh3IOFunctions
///
/// \brief outputs a mesh complex to the medit (`.mesh`) file format.
/// See \cgalCite{frey:inria-00069921} for a comprehensive description of this file format.
///
/// \param os the output stream
/// \param c3t3 the mesh complex
/// \param rebind if set to `true`, labels of cells are rebinded into `[1..nb_of_labels]`
/// \param show_patches if set to `true`, patches are labeled with different labels than
/// cells. If set to `false`, each surface facet is written twice,
/// using the label of each adjacent cell.
///
template <class C3T3>
void output_to_medit(std::ostream& os,
const C3T3& c3t3,
bool rebind = false,
bool show_patches = false);
}} // end namespace CGAL::IO

View File

@ -1,20 +0,0 @@
namespace CGAL{
namespace IO {
/**
* \ingroup PkgMesh3IOFunctions
* @brief outputs a mesh complex to tetgen format
* @param filename the path to the output file
* @param c3t3 the mesh
* @param rebind if true, labels of cells are rebinded into [1..nb_of_labels]
* @param show_patches if true, patches are labeled with different labels than
* cells. If false, each surface facet is written twice, using label of
* each adjacent cell.
* \see \ref IOStreamTetgen
*/
template <class C3T3>
void
output_to_tetgen(std::string filename,
const C3T3& c3t3,
bool rebind = false,
bool show_patches = false);
} }

View File

@ -1,16 +0,0 @@
namespace CGAL {
//! \ingroup PkgMesh3Functions
//!
//! \brief builds a `TriangleMesh` from the surface facets, with a consistent orientation at the interface of two subdomains.
//!
//! This function exports the surface as a `TriangleMesh` and appends it to `graph`, using
//! `orient_polygon_soup()`.
//!
//! @tparam C3T3 a model of `MeshComplexWithFeatures_3InTriangulation_3`.
//! @tparam TriangleMesh a model of `MutableFaceGraph` with an internal point property map. The point type should be compatible with the one used in `C3T3`.
//!
//! @param c3t3 an instance of `C3T3`.
//! @param graph an instance of `TriangleMesh`.
template<class C3T3, class TriangleMesh>
void facets_in_complex_3_to_triangle_mesh(const C3T3& c3t3, TriangleMesh& graph);
}

View File

@ -1,18 +0,0 @@
namespace CGAL{
namespace IO {
//! \ingroup PkgMesh3IOFunctions
//!
//! \brief writes a tetrahedron mesh using the `UnstructuredGrid` XML format.
//!
//! \tparam C3T3 a model of `MeshComplexWithFeatures_3InTriangulation_3`.
//!
//! \param os the stream used for writing.
//! \param c3t3 the instance of `C3T3` to be written.
//! \param mode decides if the data should be written in binary (`IO::BINARY`)
//! or in ASCII (`IO::ASCII`).
//!
template <class C3T3>
void output_to_vtu(std::ostream& os,
const C3T3& c3t3,
IO::Mode mode = BINARY);
} }

View File

@ -1,40 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgMesh3MeshClasses
<!-- Meta-comment: this class cannot be deprecated by
Compact_mesh_cell_base_3, because the later has a different API.
-- Laurent Rineau, 2013/10/16
\deprecated This class is deprecated since \cgal 4.3. Use
`CGAL::Compact_mesh_cell_base_3<Gt,MD,Tds>` instead.
-->
The class `Mesh_cell_base_3<Gt, MD, Cb>` is a model of the concept `MeshCellBase_3`.
It is designed to serve as cell base class for the 3D triangulation
used in the 3D mesh generation process.
\tparam Gt is the geometric traits class.
It has to be a model of the concept `MeshTriangulationTraits_3`.
\tparam MD provides the types of indices used to identify
the faces of the input complex. It has to be a model
of the concept `MeshDomain_3`.
\tparam Cb is the cell base class. It has to be a model
of the concept `RegularTriangulationCellBaseWithWeightedCircumcenter_3` and defaults to
`Regular_triangulation_cell_base_with_weighted_circumcenter_3<Gt>`.
\cgalModels `MeshCellBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
\sa `CGAL::Compact_mesh_cell_base_3<Gt, MD, Tds>`
*/
template< typename Gt, typename MD, typename Cb >
class Mesh_cell_base_3 : public Cb {
public:
}; /* end Mesh_cell_base_3 */
} /* end namespace CGAL */

View File

@ -1,119 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgMesh3MeshClasses
The class `Mesh_complex_3_in_triangulation_3` implements a data structure
to store the 3D restricted Delaunay triangulation used by a mesh
generation process.
This class is a model of the concept
`MeshComplexWithFeatures_3InTriangulation_3`.
\tparam Tr can be instantiated with any 3D
regular triangulation of \cgal provided that its
vertex and cell base class are models of the concepts
`MeshVertexBase_3` and `MeshCellBase_3`, respectively.
\tparam CornerIndex is the type of the indices for corners. It must match the `Corner_index` of the model
of the `MeshDomainWithFeatures_3` concept used for mesh generation.
\tparam CurveIndex is the type of the indices for curves.
It must match the `Curve_index` types of the model
of the `MeshDomainWithFeatures_3` concept used for mesh generation.
Those two last template parameters defaults 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`).
\cgalModels `MeshComplexWithFeatures_3InTriangulation_3`
\sa `CGAL::make_mesh_3()`
\sa `CGAL::refine_mesh_3()`
\sa `MeshComplex_3InTriangulation_3`
\sa `MeshComplexWithFeatures_3InTriangulation_3`
\sa `MeshCellBase_3`,
\sa `MeshVertexBase_3`
*/
template< typename Tr, typename CornerIndex, typename CurveIndex >
class Mesh_complex_3_in_triangulation_3 {
public:
/// \name Types
/// @{
/*!
%Index type.
*/
typedef Tr::Vertex::Index Index;
/*!
Surface index type.
*/
typedef Tr::Cell::Surface_patch_index Surface_patch_index;
/*!
Subdomain index type.
*/
typedef Tr::Cell::Subdomain_index Subdomain_index;
/*!
Corner index type.
*/
typedef CornerIndex Corner_index;
/*!
Curve index type.
*/
typedef CurveIndex Curve_index;
/// @}
/// \name Operations
/// @{
/*!
The tetrahedral mesh generation algorithm implemented in `CGAL::make_mesh_3()`
and `CGAL::refine_mesh_3()` does not guarantee that all the points inserted
by the algorithm are actually present in the final mesh.
In most cases, all points are used, but if the geometry of the object
has small features, compared to the size of the simplices (triangles and tetrahedra),
it might be that the Delaunay facets that are selected in the restricted Delaunay
triangulation miss some vertices of the triangulation.
The concurrent version of the tetrahedral mesh generation algorithm
also inserts a small set of auxiliary vertices that belong to the triangulation
but are isolated from the complex at the end of the meshing process.
This function removes these so-called \em isolated vertices, that belong to the
triangulation but not to any cell of the `C3T3`, from the triangulation.
*/
void remove_isolated_vertices();
/*!
Outputs the mesh to `os`
in medit format.
*/
void output_to_medit(std::ofstream& os);
/**
* Outputs the outer boundary of the entire domain with facets oriented outward.
*/
std::ostream& output_boundary_to_off(std::ostream& out) const;
/**
* Outputs the outer boundary of the selected subdomain with facets oriented outward.
*/
std::ostream& output_boundary_to_off(std::ostream& out, Subdomain_index subdomain) const;
/**
* Outputs the surface facets with a consistent orientation at the interface of two subdomains.
*/
std::ostream& output_facets_in_complex_to_off(std::ostream& out) const;
/// @}
}; /* end Mesh_complex_3_in_triangulation_3 */
} /* end namespace CGAL */

View File

@ -1,32 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgMesh3MeshClasses
The class `Mesh_vertex_base_3` is a model of the concept `MeshVertexBase_3`.
It is designed to serve as vertex base class for the 3D triangulation
used in a 3D mesh generation process.
\tparam Gt is the geometric traits class.
It must be a model of the concept `MeshTriangulationTraits_3`.
\tparam MD provides the types of indices
used to identify
the faces of the input complex. It must be a model
of the concept `MeshDomain_3`.
\tparam Vb is the vertex base class. It has to be a model
of the concept `RegularTriangulationVertexBase_3` and defaults to
`Regular_triangulation_vertex_base_3<Gt>`.
\cgalModels `MeshVertexBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
*/
template< typename Gt, typename MD, typename Vb >
class Mesh_vertex_base_3 : public Vb {
public:
}; /* end Mesh_vertex_base_3 */
} /* end namespace CGAL */

View File

@ -33,7 +33,10 @@ traverse the resulting mesh data structure or can be written to a file
\tparam C3T3 is required to be a model of
the concept `MeshComplex_3InTriangulation_3`. This is the return type.
the concept `MeshComplex_3InTriangulation_3`,
and a model of `MeshComplexWithFeatures_3InTriangulation_3`
if the domain is a model of `MeshDomainWithFeatures_3`.
This is the return type.
The type `C3T3` is in particular required to provide a nested type
`C3T3::Triangulation` for the 3D triangulation
embedding the mesh. The vertex and cell base classes of the

View File

@ -39,7 +39,9 @@ not change from one refinement to the next one.
\tparam C3T3 is required to be a model of
the concept
`MeshComplex_3InTriangulation_3`.
`MeshComplex_3InTriangulation_3`,
and a model of `MeshComplexWithFeatures_3InTriangulation_3`
if the domain is a model of `MeshDomainWithFeatures_3`.
The argument `c3t3` is passed by
reference as this object is modified by the refinement process. As the
refinement process only adds points to the triangulation, all

View File

@ -5,7 +5,8 @@
The concept `MeshCellBase_3` describes the requirements
for the `Cell` type of the triangulation
used in the 3D mesh generation process. The type `MeshCellBase_3`
refines the concept `RegularTriangulationCellBaseWithWeightedCircumcenter_3`
refines the concepts `SimplicialMeshCellBase_3` and
`RegularTriangulationCellBaseWithWeightedCircumcenter_3`
and must be copy constructible.
The concept `MeshCellBase_3`
includes a way to store and retrieve
@ -40,6 +41,7 @@ and `is_facet_visited(1)` in parallel must be safe)
Moreover, the parallel algorithms require an erase counter in
each cell (see below).
\cgalRefines `SimplicialMeshCellBase_3`
\cgalRefines `RegularTriangulationCellBaseWithWeightedCircumcenter_3`
\cgalRefines `CopyConstructible`
@ -172,9 +174,25 @@ void increment_erase_counter();
/*! \name Internal
These functions are used internally by mesh optimizers.
The class should provide storage, accessors and modificators for two `Vertex_handle`
and two `Cell_handle`.*/
and two `Cell_handle`, and a cache value for sliverity.*/
/// @{
/*!
*/
void set_sliver_value(double value);
/*!
*/
double sliver_value() const;
/*!
*/
bool is_cache_valid() const;
/*!
*/
void reset_cache_validity() const;
/*!
*/

View File

@ -124,7 +124,7 @@ following operators:
`template<typename OutputIterator>`
<br>
`OutputIterator operator()(int n, OutputIterator pts)`
`OutputIterator operator()(OutputIterator pts, int n)`
Those two operators output a set of (`n`) surface points to the
output iterator `pts`, as objects of type `std::pair<Point_3,

View File

@ -4,8 +4,9 @@
The concept `MeshVertexBase_3` describes the requirements
for the `Vertex` type of the triangulation
used by a 3D mesh generation process. The type `MeshVertexBase_3` refines both
the concept `RegularTriangulationVertexBase_3` and the concept `SurfaceMeshVertexBase_3`.
used by a 3D mesh generation process. The type `MeshVertexBase_3` refines
the concepts `RegularTriangulationVertexBase_3`,
`SimplicialMeshVertexBase_3`, and `SurfaceMeshVertexBase_3`.
It provides additional members to store and retrieve
information about the location of the vertex with respect
to the input domain describing the domain to be discretized.
@ -19,6 +20,7 @@ and two `Vertex_handle` called 'intrusive'.
The parallel algorithms require an erase counter in
each cell (see below).
\cgalRefines `SimplicialMeshVertexBase_3`
\cgalRefines `RegularTriangulationVertexBase_3`
\cgalRefines `SurfaceMeshVertexBase_3`

View File

@ -6,8 +6,10 @@ ALIASES += "cgalDescribePolylineType=A polyline is defined as a sequence of poin
INPUT += \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_complex_mesh_domain_3.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_vertex_base_3.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_cell_base_3.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Compact_mesh_cell_base_3.h
PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation"
HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \
${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \

View File

@ -566,10 +566,10 @@ for more details.
\section Mesh_3_section_io Input/Output
Several file formats are supported for writing a mesh:
- \ref IOStreamVTK, using `CGAL::IO::output_to_vtu()`
- \ref IOStreamAvizo, using `CGAL::IO::output_to_avizo()`
- \ref IOStreamMedit, using `CGAL::IO::output_to_medit()`
- \ref IOStreamTetgen, using `CGAL::IO::output_to_tetgen()`
- \ref IOStreamMedit, using \link CGAL::IO::write_MEDIT() `CGAL::IO::write_MEDIT()`\endlink
- \ref IOStreamVTK, using \link CGAL::IO::output_to_vtu() `CGAL::IO::output_to_vtu()`\endlink
- \ref IOStreamAvizo, using \link CGAL::IO::output_to_avizo `CGAL::IO::output_to_avizo()`\endlink
- \ref IOStreamTetgen, using \link CGAL::IO::output_to_tetgen `CGAL::IO::output_to_tetgen()`\endlink
\section Mesh_3_section_examples Examples

View File

@ -29,7 +29,7 @@
/// \defgroup PkgMesh3IOFunctions Input/Output Functions
/// \ingroup PkgMesh3Ref
/// The free functions that can be used to read and write meshes.
/// See \ref PkgSMDS3IOFunctions from \ref PkgSMDS3
/*!
\addtogroup PkgMesh3Ref
@ -57,8 +57,6 @@
Here are the main concepts of this package:
- `MeshTriangulationTraits_3`
- `MeshComplex_3InTriangulation_3`
- `MeshComplexWithFeatures_3InTriangulation_3`
- `MeshDomain_3`
- `MeshDomainWithFeatures_3`
- `MeshCriteria_3`
@ -80,7 +78,6 @@ related to the template parameters of some models of the main concepts:
\cgalCRPSection{Classes}
- `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
- `CGAL::Mesh_triangulation_3<MD,Gt,Concurrency_tag,Vertex_base,Cell_base>`
- `CGAL::Mesh_vertex_base_3<Gt,MD,Vb>`
- `CGAL::Compact_mesh_cell_base_3<Gt,MD,Tds>`
@ -114,7 +111,6 @@ and their associated classes:
- `CGAL::perturb_mesh_3()`
- `CGAL::lloyd_optimize_mesh_3()`
- `CGAL::odt_optimize_mesh_3()`
- `CGAL::facets_in_complex_3_to_triangle_mesh()`
- `CGAL::Mesh_3::generate_label_weights()`
\cgalCRPSection{CGAL::parameters Functions}
@ -137,9 +133,4 @@ and their associated classes:
- `CGAL::Mesh_optimization_return_code`
- `CGAL::Mesh_facet_topology`
\cgalCRPSection{Input/Output Functions}
- `CGAL::IO::output_to_medit()`
- `CGAL::IO::output_to_vtu()`
*/

View File

@ -13,3 +13,5 @@ Polyhedron
Miscellany
Mesh_2
Polygon_mesh_processing
SMDS_3

View File

@ -49,7 +49,8 @@ int main(int argc, char*argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -81,7 +81,8 @@ int main(int argc, char*argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -97,7 +97,8 @@ int main(int argc, char* argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -54,7 +54,8 @@ int main(int argc, char* argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -63,7 +63,8 @@ int main(int argc, char* argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -11,7 +11,7 @@
#include <CGAL/make_mesh_3.h>
#include <CGAL/Image_3.h>
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;

View File

@ -102,7 +102,8 @@ int main(int argc, char* argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -59,7 +59,9 @@ int main(int argc, char* argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
std::ofstream bin_file("out.binary.cgal", std::ios_base::binary);
CGAL::IO::save_binary_file(bin_file, c3t3);

View File

@ -91,7 +91,8 @@ int main()
// Output
std::ofstream medit_file("out_cubes_intersection.mesh");
CGAL::IO::output_to_medit(medit_file, c3t3);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -178,7 +178,8 @@ int main()
// Output
std::ofstream medit_file("out_cubes_intersection_with_features.mesh");
CGAL::IO::output_to_medit(medit_file, c3t3);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -13,7 +13,7 @@
#include <CGAL/make_mesh_3.h>
// Ouput
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
// Read 1D features from input file
#include "read_polylines.h"

View File

@ -67,7 +67,7 @@ int main()
// Output
std::ofstream medit_file("out.mesh");
CGAL::IO::output_to_medit(medit_file, c3t3);
CGAL::IO::write_MEDIT(medit_file, c3t3);
return 0;
}

View File

@ -69,7 +69,8 @@ int main()
// Output
std::ofstream medit_file("out.mesh");
CGAL::IO::output_to_medit(medit_file, c3t3);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -55,7 +55,7 @@ int main()
// Output
std::ofstream medit_file("out_wo.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
// Perturbation (5s, 12degree)
@ -66,7 +66,8 @@ int main()
// Output
medit_file.open("out_optimized.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -52,7 +52,8 @@ int main()
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -69,7 +69,8 @@ int main()
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;
}

View File

@ -59,10 +59,12 @@ int main(int argc, char* argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
std::ofstream medit_file_bis("out_bis.mesh");
c3t3_bis.output_to_medit(medit_file_bis);
CGAL::IO::write_MEDIT(medit_file_bis, c3t3_bis);
medit_file_bis.close();
return 0;
}

View File

@ -59,10 +59,12 @@ int main(int argc, char*argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
std::ofstream medit_file_bis("out_bis.mesh");
c3t3_bis.output_to_medit(medit_file_bis);
CGAL::IO::write_MEDIT(medit_file_bis, c3t3_bis);
medit_file_bis.close();
return 0;
}

View File

@ -80,7 +80,8 @@ int main()
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return EXIT_SUCCESS;
}

View File

@ -109,7 +109,8 @@ int main()
//// Output
//std::ofstream medit_file("out.mesh");
//c3t3.output_to_medit(medit_file);
//CGAL::IO::write_MEDIT(medit_file, c3t3);
//medit_file.close();
return EXIT_SUCCESS;
}

View File

@ -8,6 +8,7 @@
#include <CGAL/Polyhedral_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/refine_mesh_3.h>
#include <CGAL/IO/File_medit.h>
// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
@ -61,7 +62,7 @@ int main(int argc, char*argv[])
// Output
std::ofstream medit_file("out_1.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
// Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets
@ -72,7 +73,8 @@ int main(int argc, char*argv[])
// Output
medit_file.open("out_2.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return EXIT_SUCCESS;
}

View File

@ -61,7 +61,7 @@ int main(int argc, char*argv[])
// Output
std::ofstream medit_file("out_1.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
// Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets
@ -72,7 +72,8 @@ int main(int argc, char*argv[])
// Output
medit_file.open("out_2.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return EXIT_SUCCESS;
}

View File

@ -66,7 +66,7 @@ int main(int argc, char*argv[])
std::ofstream file("out.vtu");
CGAL::IO::output_to_vtu(file, c3t3);
// Could be replaced by:
// c3t3.output_to_medit(file);
// CGAL::IO::write_MEDIT(file, c3t3);
return EXIT_SUCCESS;
}

View File

@ -67,7 +67,7 @@ int main(int argc, char*argv[])
std::ofstream file("out-sm.vtu");
CGAL::IO::output_to_vtu(file, c3t3, CGAL::IO::ASCII);
// Could be replaced by:
// c3t3.output_to_medit(file);
// CGAL::IO::write_MEDIT(file, c3t3);
return EXIT_SUCCESS;
}

View File

@ -80,7 +80,8 @@ int main(int argc, char*argv[])
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return EXIT_SUCCESS;
}

View File

@ -88,7 +88,7 @@ int main()
CGAL::parameters::no_features());
std::ofstream medit_file("out-no-protection.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
c3t3.clear();
@ -97,7 +97,7 @@ int main()
// Output
medit_file.open("out-with-protection.mesh");
c3t3.output_to_medit(medit_file);
CGAL::IO::write_MEDIT(medit_file, c3t3);
medit_file.close();
return 0;

View File

@ -16,7 +16,6 @@
#include <CGAL/license/Mesh_3.h>
#include <CGAL/Mesh_3/config.h>
#include <CGAL/array.h>
@ -28,7 +27,7 @@
#include <CGAL/Has_timestamp.h>
#include <CGAL/Regular_triangulation_cell_base_3.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#include <boost/type_traits/is_same.hpp>
@ -709,6 +708,32 @@ public:
}; // end class Compact_mesh_cell_3
/*!
\ingroup PkgMesh3MeshClasses
The class `Compact_mesh_cell_base_3<GT, MD>` is a model of the concept `MeshCellBase_3`.
It is designed to serve as cell base class for the 3D triangulation
used in the 3D mesh generation process. It is more compact in memory than
`Mesh_cell_base_3`.
\tparam GT is the geometric traits class.
It has to be a model of the concept `MeshTriangulationTraits_3`.
\tparam MD provides the types of indices used to identify
the faces of the input complex. It has to be a model
of the concept `MeshDomain_3`.
\tparam TDS is the triangulation data structure class to which cells
belong. That parameter is only used by the rebind mechanism (see
`::TriangulationDSCellBase_3::Rebind_TDS`). Users should always use the
default parameter value `void`.
\cgalModels `MeshCellBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
\sa `CGAL::Mesh_cell_base_3<GT, MD, Cb>`
*/
template< class GT,
class MD,
class TDS = void >

View File

@ -33,8 +33,8 @@
#include <functional>
#include <CGAL/Mesh_3/internal/Handle_IO_for_pair_of_int.h>
#include <CGAL/Mesh_3/internal/indices_management.h>
#include <CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h>
#include <CGAL/SMDS_3/internal/indices_management.h>
// support for `CGAL::Image_3`
#include <CGAL/Image_3.h>

View File

@ -13,126 +13,8 @@
#ifndef CGAL_MESH_3_DUMP_C3T3_H
#define CGAL_MESH_3_DUMP_C3T3_H
#include <CGAL/license/Mesh_3.h>
#include <CGAL/license/SMDS_3.h>
#include <CGAL/disable_warnings.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h>
#include <CGAL/IO/File_medit.h>
#include <CGAL/is_streamable.h>
#include <fstream>
#include <string>
namespace CGAL {
template <typename C3t3,
bool is_streamable =
is_streamable<typename C3t3::Triangulation::Vertex>::value &&
is_streamable<typename C3t3::Triangulation::Cell>::value
&&
(is_streamable<typename C3t3::Surface_patch_index>::value ||
Output_rep<typename C3t3::Surface_patch_index>::is_specialized)
&&
(is_streamable<typename C3t3::Subdomain_index>::value ||
Output_rep<typename C3t3::Subdomain_index>::is_specialized)
>
struct Dump_c3t3 {
void dump_c3t3(const C3t3& c3t3, std::string prefix) const
{
std::clog<<"======dump c3t3===== to: " << prefix << std::endl;
std::ofstream medit_file((prefix+".mesh").c_str());
medit_file.precision(17);
CGAL::IO::output_to_medit(medit_file, c3t3, false /*rebind*/, true /*show_patches*/);
medit_file.close();
std::string bin_filename = prefix;
bin_filename += ".binary.cgal";
std::ofstream bin_file(bin_filename.c_str(),
std::ios_base::binary | std::ios_base::out);
std::string signature = CGAL::Get_io_signature<C3t3>()();
CGAL_assertion(signature != std::string());
bin_file << "binary CGAL c3t3 " << signature << "\n";
CGAL::IO::set_binary_mode(bin_file);
bin_file << c3t3;
}
}; // end struct template Dump_c3t3<C3t3, bool>
template <typename C3t3>
struct Dump_c3t3<C3t3, false>
{
void dump_c3t3(const C3t3&, std::string) {
std::cerr << "Warning " << __FILE__ << ":" << __LINE__ << "\n"
<< " the c3t3 object of following type:\n"
<< typeid(C3t3).name() << std::endl
<< " cannot be dumped because some types are not streamable:\n";
if(!is_streamable<typename C3t3::Triangulation::Vertex>::value) {
std::cerr << " - C3t3::Triangulation::Vertex is not streamble\n";
std::cerr << " "
<< typeid(typename C3t3::Triangulation::Vertex).name()
<< "\n";
}
if(!is_streamable<typename C3t3::Triangulation::Cell>::value) {
std::cerr << " - C3t3::Triangulation::Cell is not streamble\n";
std::cerr << " "
<< typeid(typename C3t3::Triangulation::Cell).name()
<< "\n";
}
if(!is_streamable<typename C3t3::Surface_patch_index>::value &&
!CGAL::Output_rep<typename C3t3::Surface_patch_index>::is_specialized)
{
std::cerr << " - C3t3::Surface_patch_index is not streamable\n";
std::cerr << " "
<< typeid(typename C3t3::Surface_patch_index).name()
<< "\n";
}
if(!is_streamable<typename C3t3::Subdomain_index>::value &&
!CGAL::Output_rep<typename C3t3::Subdomain_index>::is_specialized)
{
std::cerr << " - C3t3::Subdomain_index is not streamable\n";
std::cerr << " "
<< typeid(typename C3t3::Subdomain_index).name()
<< "\n";
}
}
}; // end struct template specialization Dump_c3t3<C3t3, false>
template <typename C3t3>
void dump_c3t3_edges(const C3t3& c3t3, std::string prefix)
{
typename C3t3::Triangulation::Geom_traits::Construct_point_3 cp =
c3t3.triangulation().geom_traits().construct_point_3_object();
std::ofstream file((prefix+".polylines.txt").c_str());
file.precision(17);
for(typename C3t3::Edges_in_complex_iterator
edge_it = c3t3.edges_in_complex_begin(),
end = c3t3.edges_in_complex_end();
edge_it != end; ++edge_it)
{
const typename C3t3::Triangulation::Cell_handle c = edge_it->first;
const int i = edge_it->second;
const int j = edge_it->third;
const typename C3t3::Triangulation::Weighted_point& ei = c3t3.triangulation().point(c, i);
const typename C3t3::Triangulation::Weighted_point& ej = c3t3.triangulation().point(c, j);
file << "2 " << cp(ei) << " " << cp(ej) << "\n";
}
}
template <typename C3t3>
void dump_c3t3(const C3t3& c3t3, std::string prefix)
{
if(!prefix.empty()) {
Dump_c3t3<C3t3> dump;
dump.dump_c3t3(c3t3, prefix);
}
}
} // end namespace CGAL
#include <CGAL/enable_warnings.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
#endif // CGAL_MESH_3_DUMP_C3T3_H

View File

@ -18,13 +18,13 @@
#ifndef CGAL_MESH_3_MESH_SURFACE_CELL_BASE_3_H
#define CGAL_MESH_3_MESH_SURFACE_CELL_BASE_3_H
#include <CGAL/license/Triangulation_3.h>
#include <CGAL/license/SMDS_3.h>
#include <CGAL/Mesh_3/config.h>
#include <CGAL/Regular_triangulation_cell_base_3.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#ifdef CGAL_LINKED_WITH_TBB
# include <atomic>

View File

@ -36,7 +36,7 @@
#include <CGAL/Mesh_error_code.h>
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
#include <CGAL/Mesh_3/Refine_facets_3.h>
#include <CGAL/Mesh_3/Refine_facets_manifold_base.h>

View File

@ -28,11 +28,11 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/Mesh_3/config.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#ifdef CGAL_MESH_3_DUMP_FEATURES_PROTECTION_ITERATIONS
# include <CGAL/IO/File_binary_mesh_3.h>
#endif
#include <CGAL/Mesh_3/utilities.h>
#include <CGAL/SMDS_3/utilities.h>
#include <CGAL/Mesh_3/Triangulation_helpers.h>
#include <CGAL/iterator.h>
#include <CGAL/Mesh_error_code.h>
@ -108,7 +108,7 @@ void debug_dump_c3t3(const std::string filename, const C3t3& c3t3)
template <typename C3T3, typename MeshDomain, typename SizingFunction>
class Protect_edges_sizing_field
: public CGAL::Mesh_3::internal::Debug_messages_tools
: public CGAL::SMDS_3::internal::Debug_messages_tools
{
typedef Protect_edges_sizing_field Self;

View File

@ -38,7 +38,7 @@
#ifdef CGAL_MESH_3_PROFILING
#include <CGAL/Mesh_3/Profiling_tools.h>
#endif
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
#include <CGAL/Object.h>

View File

@ -12,21 +12,20 @@
#ifndef CGAL_MESH_3_CONFIG_H
#define CGAL_MESH_3_CONFIG_H 1
#include <CGAL/license/Triangulation_3.h>
#include <CGAL/license/Mesh_3.h>
#include <CGAL/config.h>
//#define CGAL_MESH_3_VERBOSE 1
// Use optimisations of Mesh_3
# define CGAL_INTRUSIVE_LIST 1
# define CGAL_CONSTRUCT_INTRUSIVE_LIST_RANGE_CONSTRUCTOR 1
# define CGAL_MESH_3_NEW_GET_FACETS 1
# define CGAL_MESH_3_GET_FACETS_USING_INTRUSIVE_LIST 1
# define CGAL_MESH_3_SIZING_FIELD_INEXACT_LOCATE 1
# define FORCE_STRUCTURAL_FILTERING 1
# define CGAL_NEW_INCIDENT_SLIVERS 1
# define CGAL_INTRUSIVE_LIST 1
//experimental
# define CGAL_FASTER_BUILD_QUEUE 1

View File

@ -22,7 +22,7 @@
#include <CGAL/enum.h>
#include <CGAL/tags.h>
#include <CGAL/Mesh_3/Has_features.h>
#include <CGAL/SMDS_3/Has_features.h>
#include <boost/type_traits/is_same.hpp>
namespace CGAL {

View File

@ -13,351 +13,8 @@
#ifndef CGAL_MESH_3_IO_SIGNATURE_H
#define CGAL_MESH_3_IO_SIGNATURE_H
#include <CGAL/license/Triangulation_3.h>
#define CGAL_MESH_3_IO_H // the old include macro, tested by other files
#include <CGAL/Point_3.h>
#include <CGAL/Weighted_point_3.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_vertex_base_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/Triangulation_cell_base_3.h>
#include <CGAL/Triangulation_cell_base_with_info_3.h>
#include <CGAL/Regular_triangulation_3.h>
#include <CGAL/Regular_triangulation_cell_base_3.h>
#include <CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h>
#ifdef CGAL_PERIODIC_3_MESH_3_CONFIG_H
#include <CGAL/Periodic_3_triangulation_3.h>
#include <CGAL/Periodic_3_regular_triangulation_3.h>
#endif
#include <boost/variant.hpp>
#include <boost/tuple/tuple.hpp>
#include <utility>
namespace CGAL {
// SFINAE test
template <typename T, typename U>
class has_io_signature
{
private:
template <U> struct helper;
template <typename V> static char check(helper<&V::io_signature> *);
template <typename V> static char (&check(...))[2];
public:
enum { value = (sizeof(check<T>(0)) == sizeof(char)) };
};
template <class T, bool has_io_signature>
struct Get_io_signature_aux
{
std::string operator() () const
{
return T::io_signature();
}
}; // end struct template Get_io_signature_aux
template <class T>
struct Get_io_signature_aux<T, false>
{
std::string operator()() const
{
std::cerr << "Type without signature: " << typeid(T).name() << std::endl;
return std::string();
}
}; // end template partial specialization Get_io_signature_aux<T, false>
template <class T>
struct Get_io_signature
: public Get_io_signature_aux<
T,
(has_io_signature<T, std::string (T::*)() >::value ||
has_io_signature<T, std::string (T::*)() const >::value ||
has_io_signature<T, std::string (*)() >::value ) // signature for
// static mem func
>
{
};
template <>
struct Get_io_signature<int>
{
std::string operator()() {
return "i";
}
};
template <>
struct Get_io_signature<unsigned int>
{
std::string operator()() {
return "ui";
}
};
template <>
struct Get_io_signature<char>
{
std::string operator()() {
return "c";
}
};
template <>
struct Get_io_signature<unsigned char>
{
std::string operator()() {
return "uc";
}
};
template <>
struct Get_io_signature<signed char>
{
std::string operator()() {
return "sc";
}
};
template <>
struct Get_io_signature<short int>
{
std::string operator()() {
return "s";
}
};
template <>
struct Get_io_signature<unsigned short int>
{
std::string operator()() {
return "us";
}
};
template <>
struct Get_io_signature<double>
{
std::string operator()() {
return "d";
}
};
template <typename T, typename U>
struct Get_io_signature<boost::variant<T,U> >
{
std::string operator()() {
return std::string("boost::variant<") +
Get_io_signature<T>()() + "," +
Get_io_signature<U>()() + ">";
}
};
template <typename T, typename U>
struct Get_io_signature<std::pair<T,U> >
{
std::string operator()() {
return std::string("std::pair<") +
Get_io_signature<T>()() + "," +
Get_io_signature<U>()() + ">";
}
};
template <typename T, typename U>
struct Get_io_signature<boost::tuple<T,U> >
{
std::string operator()() {
return std::string("std::pair<") +
Get_io_signature<T>()() + "," +
Get_io_signature<U>()() + ">";
}
};
template <typename T, typename U, typename V>
struct Get_io_signature<boost::variant<T,U,V> >
{
std::string operator()() {
return std::string("boost::variant<") +
Get_io_signature<T>()() + "," +
Get_io_signature<U>()() + "," +
Get_io_signature<V>()() + ">";
}
};
template <typename T, typename U,
typename V, typename W>
struct Get_io_signature<boost::variant<T,U,V,W> >
{
std::string operator()() {
return std::string("boost::variant<") +
Get_io_signature<T>()() + "," +
Get_io_signature<U>()() + "," +
Get_io_signature<V>()() + "," +
Get_io_signature<W>()() + ">";
}
};
template <class Kernel>
struct Get_io_signature<Point_3<Kernel> >
{
std::string operator()() {
return "Point_3";
}
};
template <class K>
struct Get_io_signature<Weighted_point_3<K> >
{
std::string operator()() {
return std::string("Weighted_point<") + Get_io_signature<Point_3<K> >()() + ">";
}
};
#ifdef CGAL_TRIANGULATION_3_H
template <class Gt, class Tds>
struct
Get_io_signature<Triangulation_3<Gt, Tds > >
{
std::string operator()() {
return std::string("Triangulation_3(") +
Get_io_signature<typename Tds::Vertex::Point>()() +
",Vb(" + Get_io_signature<typename Tds::Vertex>()() +
"),Cb(" + Get_io_signature<typename Tds::Cell>()() +
"))";
}
};
#endif
#ifdef CGAL_DELAUNAY_TRIANGULATION_3_H
template <class Gt, class Tds>
struct
Get_io_signature<Delaunay_triangulation_3<Gt, Tds> >
{
std::string operator()() {
return Get_io_signature<Triangulation_3<Gt, Tds> >()();
}
};
#endif
#ifdef CGAL_REGULAR_TRIANGULATION_3_H
template <class Gt, class Tds>
struct
Get_io_signature<Regular_triangulation_3<Gt, Tds> >
{
std::string operator()() {
return Get_io_signature<Triangulation_3<Gt, Tds> >()();
}
};
#endif
#ifdef CGAL_PERIODIC_3_TRIANGULATION_3_H
template <class Gt, class Tds>
struct
Get_io_signature<Periodic_3_triangulation_3<Gt, Tds> >
{
std::string operator()() {
return std::string("Periodic_3_triangulation_3(") +
Get_io_signature<typename Tds::Vertex::Point>()() +
",Vb(" + Get_io_signature<typename Tds::Vertex>()() +
"),Cb(" + Get_io_signature<typename Tds::Cell>()() +
"))";
}
};
#endif
#ifdef CGAL_PERIODIC_3_REGULAR_TRIANGULATION_3_H
template <class Gt, class Tds>
struct
Get_io_signature<Periodic_3_regular_triangulation_3<Gt, Tds> >
{
std::string operator()() {
return Get_io_signature<Periodic_3_triangulation_3<Gt, Tds> >()();
}
};
#endif
#ifdef CGAL_TRIANGULATION_VERTEX_BASE_3_H
template <class Gt, class Vb>
struct Get_io_signature<Triangulation_vertex_base_3<Gt, Vb> >
{
std::string operator()() {
return "Tvb_3";
}
};
#endif
#ifdef CGAL_REGULAR_TRIANGULATION_VERTEX_BASE_3_H
template <class Gt, class Vb>
struct Get_io_signature<Regular_triangulation_vertex_base_3<Gt, Vb> >
{
// identical to Triangulation_vertex_base_3
std::string operator()() {
return "Tvb_3";
}
};
#endif
#ifdef CGAL_TRIANGULATION_VERTEX_BASE_WITH_INFO_3_H
template <class Info, class Gt, class Vb>
struct
Get_io_signature<Triangulation_vertex_base_with_info_3<Info, Gt, Vb> >
{
std::string operator()() {
return Get_io_signature<Vb>()();
}
};
#endif
#ifdef CGAL_TRIANGULATION_CELL_BASE_3_H
template <class Gt, class Cb>
struct
Get_io_signature<Triangulation_cell_base_3<Gt, Cb> >
{
std::string operator()() {
return "Tcb_3";
}
};
#endif
#ifdef CGAL_TRIANGULATION_CELL_BASE_WITH_INFO_3_H
template <class Info, class Gt, class Cb>
struct
Get_io_signature<Triangulation_cell_base_with_info_3<Info, Gt, Cb> >
{
std::string operator()() {
return Get_io_signature<Cb>()();
}
};
#endif
#ifdef CGAL_REGULAR_TRIANGULATION_CELL_BASE_3_H
template <class Gt, class Cb, class Container>
struct
Get_io_signature<Regular_triangulation_cell_base_3<Gt, Cb, Container> >
{
std::string operator()() {
return "RTcb_3";
}
};
#endif
#ifdef CGAL_REGULAR_TRIANGULATION_CELL_BASE_WITH_CIRCUMCENTER_3_H
template <class Gt, class Cb>
struct
Get_io_signature<Regular_triangulation_cell_base_with_weighted_circumcenter_3<Gt, Cb> >
{
std::string operator()() {
return "RTWWCcb_3";
}
};
#endif
} // end namespace CGAL
#include <CGAL/license/SMDS_3.h>
#include <CGAL/SMDS_3/io_signature.h>
#endif // CGAL_MESH_3_IO_SIGNATURE_H

View File

@ -15,7 +15,7 @@
#ifndef CGAL_MESH_CELL_BASE_3_H
#define CGAL_MESH_CELL_BASE_3_H
#include <CGAL/license/Triangulation_3.h>
#include <CGAL/license/Mesh_3.h>
// #define CGAL_DEPRECATED_HEADER "<CGAL/Mesh_cell_base_3.h>"
@ -27,7 +27,7 @@
#include <CGAL/Regular_triangulation_cell_base_3.h>
#include <CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h>
#include <CGAL/Mesh_3/Mesh_surface_cell_base_3.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#include <CGAL/tags.h>
#include <boost/type_traits/is_convertible.hpp>
@ -95,14 +95,46 @@ protected:
// Class Mesh_cell_base_3
// Cell base class used in 3D meshing process.
// Adds information to Cb about the cell of the input complex containing it
/*!
\ingroup PkgMesh3MeshClasses
<!-- Meta-comment: this class cannot be deprecated by
Compact_mesh_cell_base_3, because the latter has a different API.
-- Laurent Rineau, 2013/10/16
\deprecated This class is deprecated since \cgal 4.3. Use
`CGAL::Compact_mesh_cell_base_3<GT,MD,Tds>` instead.
-->
The class `Mesh_cell_base_3<GT, MD, Cb>` is a model of the concept `MeshCellBase_3`.
It is designed to serve as cell base class for the 3D triangulation
used in the 3D mesh generation process.
\tparam GT is the geometric traits class.
It has to be a model of the concept `MeshTriangulationTraits_3`.
\tparam MD provides the types of indices used to identify
the faces of the input complex. It has to be a model
of the concept `MeshDomain_3`.
\tparam Cb is the cell base class. It has to be a model
of the concept `RegularTriangulationCellBaseWithWeightedCircumcenter_3` and defaults to
`Regular_triangulation_cell_base_with_weighted_circumcenter_3<GT>`.
\cgalModels `MeshCellBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
\sa `CGAL::Compact_mesh_cell_base_3<GT, MD, Tds>`
*/
template< class GT,
class MD,
class Cb= CGAL::Regular_triangulation_cell_base_with_weighted_circumcenter_3<
GT, CGAL::Regular_triangulation_cell_base_3<GT> > >
class Mesh_cell_base_3
: public Mesh_3::Mesh_surface_cell_base_3<GT, MD, Cb>,
public Mesh_cell_base_3_base<
: public Mesh_3::Mesh_surface_cell_base_3<GT, MD, Cb>
#ifndef DOXYGEN_RUNNING
, public Mesh_cell_base_3_base<
typename Mesh_3::Mesh_surface_cell_base_3<GT, MD, Cb>::Tds::Concurrency_tag>
#endif
{
typedef typename GT::FT FT;

View File

@ -1,857 +0,0 @@
// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
// Copyright (c) 2010-2013 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) : Stephane Tayeb, Clement Jamin
//
//******************************************************************************
// File Description :
//******************************************************************************
#ifndef CGAL_MESH_COMPLEX_3_IN_TRIANGULATION_3_H
#define CGAL_MESH_COMPLEX_3_IN_TRIANGULATION_3_H
#include <CGAL/license/Triangulation_3.h>
#include <CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h>
#include <CGAL/disable_warnings.h>
#include <CGAL/iterator.h>
#include <CGAL/Mesh_3/utilities.h>
#include <CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h>
#include <CGAL/Mesh_3/internal/Boundary_of_subdomain_of_complex_3_in_triangulation_3_to_off.h>
#include <CGAL/Time_stamper.h>
#include <boost/bimap/bimap.hpp>
#include <boost/bimap/multiset_of.hpp>
#include <CGAL/boost/iterator/transform_iterator.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/mpl/if.hpp>
#include <boost/unordered_map.hpp>
namespace CGAL {
template <typename Tr,
typename CornerIndex,
typename CurveIndex>
class Mesh_complex_3_in_triangulation_3 :
public Mesh_3::Mesh_complex_3_in_triangulation_3_base<
Tr, typename Tr::Concurrency_tag>
, public CGAL::Mesh_3::internal::Debug_messages_tools
{
public:
typedef typename Tr::Concurrency_tag Concurrency_tag;
private:
typedef Mesh_complex_3_in_triangulation_3<
Tr,CornerIndex,CurveIndex> Self;
typedef Mesh_3::Mesh_complex_3_in_triangulation_3_base<
Tr,Concurrency_tag> Base;
public:
typedef typename Base::size_type size_type;
typedef typename Tr::Point Point;
typedef typename Base::Edge Edge;
typedef typename Base::Facet Facet;
typedef typename Base::Vertex_handle Vertex_handle;
typedef typename Base::Cell_handle Cell_handle;
typedef CornerIndex Corner_index;
typedef CurveIndex Curve_index;
typedef CGAL::Hash_handles_with_or_without_timestamps Hash_fct;
#ifndef CGAL_NO_DEPRECATED_CODE
typedef CurveIndex Curve_segment_index;
#endif
typedef typename Base::Triangulation Triangulation;
typedef typename Base::Subdomain_index Subdomain_index;
using Base::surface_patch_index;
private:
// Type to store the edges:
// - a set of std::pair<Vertex_handle,Vertex_handle> (ordered at insertion)
// - which allows fast lookup from one Vertex_handle
// - each element of the set has an associated info (Curve_index) value
typedef boost::bimaps::bimap<
boost::bimaps::multiset_of<Vertex_handle>,
boost::bimaps::multiset_of<Vertex_handle>,
boost::bimaps::set_of_relation<>,
boost::bimaps::with_info<Curve_index> > Edge_map;
typedef typename Edge_map::value_type Internal_edge;
// Type to store the corners
typedef boost::unordered_map<Vertex_handle,
Corner_index,
Hash_fct> Corner_map;
// Type to store far vertices
typedef std::vector<Vertex_handle> Far_vertices_vec;
public:
/**
* Constructor
*/
Mesh_complex_3_in_triangulation_3() = default;
/**
* Copy constructor
*/
Mesh_complex_3_in_triangulation_3(const Self& rhs);
/**
* Move constructor
*/
Mesh_complex_3_in_triangulation_3(Self&& rhs)
: Base(std::move(rhs))
, edges_(std::move(rhs.edges_))
, corners_(std::move(rhs.corners_))
, far_vertices_(std::move(rhs.far_vertices_))
{}
/**
* Assignement operator, also serves as move-assignement
*/
Self& operator=(Self rhs)
{
swap(rhs);
return *this;
}
/**
* Swaps this & rhs
*/
void swap(Self& rhs)
{
Base::swap(rhs);
edges_.swap(rhs.edges_);
corners_.swap(rhs.corners_);
far_vertices_.swap(rhs.far_vertices_);
}
/**
* Clears data of c3t3
*/
void clear()
{
Base::clear();
edges_.clear();
corners_.clear();
far_vertices_.clear();
}
/// Import Base functions
using Base::is_in_complex;
using Base::add_to_complex;
using Base::remove_from_complex;
using Base::triangulation;
using Base::set_surface_patch_index;
/**
* Add edge e to complex, with Curve_index index
*/
void add_to_complex(const Edge& e,
const Curve_index& index)
{
add_to_complex(e.first->vertex(e.second),
e.first->vertex(e.third),
index);
}
/**
* Add edge (v1,v2) to complex, with Curve_index index
*/
void add_to_complex(const Vertex_handle& v1,
const Vertex_handle& v2,
const Curve_index& index)
{
add_to_complex(make_internal_edge(v1,v2), index);
}
/**
* Mark vertex \c v as a corner of the complex
*/
void add_to_complex(const Vertex_handle& v, const Corner_index& index)
{
v->set_dimension(0);
corners_.insert(std::make_pair(v,index));
}
/**
* Remove edge \c e from complex
*/
void remove_from_complex(const Edge& e)
{
remove_from_complex(e.first->vertex(e.second), e.first->vertex(e.third));
}
/**
* Remove edge (v1,v2) from complex
*/
void remove_from_complex(const Vertex_handle& v1, const Vertex_handle& v2)
{
remove_from_complex(make_internal_edge(v1,v2));
}
/**
* Remove vertex \c v from complex
*/
void remove_from_complex(const Vertex_handle& v)
{
corners_.erase(v);
v->set_dimension(-1);
}
std::size_t number_of_far_points() const
{
return far_vertices_.size();
}
void add_far_point(const Point &p)
{
far_vertices_.push_back(triangulation().insert(p));
}
void add_far_point(Vertex_handle vh)
{
far_vertices_.push_back(vh);
}
void remove_isolated_vertex(Vertex_handle v)
{
Triangulation& tr = triangulation();
std::vector<Cell_handle> new_cells;
new_cells.reserve(32);
tr.remove_and_give_new_cells(v, std::back_inserter(new_cells));
typename std::vector<Cell_handle>::iterator nc_it = new_cells.begin();
typename std::vector<Cell_handle>::iterator nc_it_end = new_cells.end();
for (; nc_it != nc_it_end; ++nc_it)
{
Cell_handle c = *nc_it;
for (int i = 0; i < 4; ++i)
{
Facet mirror_facet = tr.mirror_facet(std::make_pair(c, i));
if (is_in_complex(mirror_facet))
{
set_surface_patch_index(c, i,
surface_patch_index(mirror_facet));
c->set_facet_surface_center(i,
mirror_facet.first->get_facet_surface_center(mirror_facet.second));
}
}
/*int i_inf;
if (c->has_vertex(tr.infinite_vertex(), i_inf))
{
Facet mirror_facet = tr.mirror_facet(std::make_pair(c, i_inf));
if (is_in_complex(mirror_facet))
{
set_surface_patch_index(c, i_inf,
surface_patch_index(mirror_facet));
}
}*/
}
}
void remove_far_points()
{
//triangulation().remove(far_vertices_.begin(), far_vertices_.end());
typename Far_vertices_vec::const_iterator it = far_vertices_.begin();
typename Far_vertices_vec::const_iterator it_end = far_vertices_.end();
for ( ; it != it_end ; ++it)
{
remove_isolated_vertex(*it);
}
far_vertices_.clear();
}
void remove_isolated_vertices()
{
Triangulation& tr = triangulation();
for (Vertex_handle v : tr.finite_vertex_handles())
v->set_meshing_info(0);
for (typename Base::Cells_in_complex_iterator c = this->cells_in_complex_begin();
c != this->cells_in_complex_end();
++c)
{
for (int i = 0; i < 4; ++i)
{
Vertex_handle vi = c->vertex(i);
vi->set_meshing_info(vi->meshing_info() + 1);
}
}
for (typename Base::Facets_in_complex_iterator fit = this->facets_in_complex_begin();
fit != this->facets_in_complex_end();
++fit)
{
Facet f = *fit;
for (int i = 1; i < 4; ++i)
{
Vertex_handle vi = f.first->vertex((f.second + i) % 4);
vi->set_meshing_info(vi->meshing_info() + 1);
}
}
std::vector<Vertex_handle> isolated;
for (Vertex_handle v : tr.finite_vertex_handles())
{
if (v->meshing_info() == 0.)
isolated.push_back(v);
}
#ifdef CGAL_MESH_3_VERBOSE
std::cout << "Remove " << isolated.size() << " isolated vertices...";
std::cout.flush();
#endif
CGAL_assertion(far_vertices_.size() <= isolated.size());
far_vertices_.clear();
for (Vertex_handle v : isolated)
remove_isolated_vertex(v);
#ifdef CGAL_MESH_3_VERBOSE
std::cout << "\nRemove " << isolated.size() << " isolated vertices done." << std::endl;
#endif
}
/**
* Returns the number of edges of c3t3
*/
size_type number_of_edges_in_complex() const
{
return edges_.size();
}
size_type number_of_edges() const
{
return edges_.size();
}
/**
* Returns the number of corners of c3t3
*/
size_type number_of_vertices_in_complex() const
{
return corners_.size();
}
size_type number_of_corners() const
{
return corners_.size();
}
void rescan_after_load_of_triangulation();
/**
* Returns true if edge \c e is in complex
*/
bool is_in_complex(const Edge& e) const
{
return is_in_complex(e.first->vertex(e.second), e.first->vertex(e.third));
}
/**
* Returns true if edge (v1,v2) is in C3T3
*/
bool is_in_complex(const Vertex_handle& v1, const Vertex_handle& v2) const
{
return is_in_complex(make_internal_edge(v1,v2));
}
/**
* Returns true if \c v is a 0-dimensionnal feature in the c3t3
*/
bool is_in_complex(const Vertex_handle& v) const
{
return (corners_.find(v) != corners_.end());
}
/**
* Returns Curve_index of edge \c e
*/
Curve_index curve_index(const Edge& e) const
{
return curve_index(e.first->vertex(e.second),
e.first->vertex(e.third));
}
Curve_index curve_index(const Vertex_handle& v1,
const Vertex_handle& v2) const
{
return curve_index(make_internal_edge(v1,v2));
}
#ifndef CGAL_NO_DEPRECATED_CODE
CGAL_DEPRECATED
Curve_index curve_segment_index(const Edge& e) const
{
return curve_index(e);
}
CGAL_DEPRECATED
Curve_index curve_segment_index(const Vertex_handle& v1,
const Vertex_handle& v2) const
{
return curve_index(v1, v2);
}
#endif // CGAL_NO_DEPRECATED_CODE
/**
* Returns Corner_index of vertex \c v
*/
Corner_index corner_index(const Vertex_handle& v) const
{
typename Corner_map::const_iterator it = corners_.find(v);
if ( corners_.end() != it ) { return it->second; }
return Corner_index();
}
/**
* Outputs the outer boundary of the entire domain with facets oriented outward.
*/
std::ostream& output_boundary_to_off(std::ostream& out) const
{
internal::output_boundary_of_c3t3_to_off(*this, 0, out, false);
return out;
}
/**
* Outputs the outer boundary of the selected subdomain with facets oriented outward.
*/
std::ostream& output_boundary_to_off(std::ostream& out, Subdomain_index subdomain) const
{
output_boundary_of_c3t3_to_off(*this, subdomain, out);
return out;
}
/**
* Outputs the surface facets with a consistent orientation at the interface of two subdomains.
*/
std::ostream& output_facets_in_complex_to_off(std::ostream& out) const
{
internal::output_facets_in_complex_to_off(*this, out);
return out;
}
/**
* Fills \c out with incident edges (1-dimensional features of \c v.
* OutputIterator value type is std::pair<Vertex_handle,Curve_index>
* \pre v->in_dimension() < 2
*/
template <typename OutputIterator>
OutputIterator
adjacent_vertices_in_complex(const Vertex_handle& v, OutputIterator out) const;
// -----------------------------------
// Undocumented
// -----------------------------------
/**
* Returns true if c3t3 is valid
*/
bool is_valid(bool verbose = false) const;
// -----------------------------------
// Complex traversal
// -----------------------------------
private:
class Edge_iterator_not_in_complex
{
const Self& c3t3_;
const Curve_index index_;
public:
Edge_iterator_not_in_complex(const Self& c3t3,
const Curve_index& index = Curve_index())
: c3t3_(c3t3)
, index_(index) { }
template <typename Iterator>
bool operator()(Iterator it) const
{
if ( index_ == Curve_index() ) { return ! c3t3_.is_in_complex(*it); }
else { return c3t3_.curve_index(*it) != index_; }
}
};
class Vertex_iterator_not_in_complex
{
const Self& c3t3_;
const Corner_index index_;
public:
Vertex_iterator_not_in_complex(const Self& c3t3,
const Corner_index& index = Corner_index())
: c3t3_(c3t3)
, index_(index) { }
template <typename ItMap>
bool operator()(const ItMap it) const
{
if ( index_ == Corner_index() ) { return false; }
else { return it->second != index_; }
}
};
// Filtered iterator
typedef Filter_iterator<
typename Corner_map::const_iterator,
Vertex_iterator_not_in_complex > Vertex_map_filter_iterator;
// Iterator type to get the first element of pair
typedef boost::transform_iterator <
Mesh_3::internal::First_of<typename Vertex_map_filter_iterator::value_type>,
Vertex_map_filter_iterator > Vertex_map_iterator_first;
// Iterator type to remove a level of referencing
class Vertex_map_iterator_first_dereference
: public boost::iterator_adaptor <
Vertex_map_iterator_first_dereference,
Vertex_map_iterator_first,
typename Vertex_map_iterator_first::value_type::value_type,
boost::use_default,
typename Vertex_map_iterator_first::value_type::reference >
{
typedef Vertex_map_iterator_first_dereference Self;
typedef boost::iterator_adaptor <
Vertex_map_iterator_first_dereference,
Vertex_map_iterator_first,
typename Vertex_map_iterator_first::value_type::value_type,
boost::use_default,
typename Vertex_map_iterator_first::value_type::reference > iterator_adaptor_;
public:
typedef typename Vertex_map_iterator_first::reference pointer;
typedef typename iterator_adaptor_::reference reference;
Vertex_map_iterator_first_dereference() : Self::iterator_adaptor_() { }
template < typename Iterator >
Vertex_map_iterator_first_dereference(Iterator i)
: Self::iterator_adaptor_(typename Self::iterator_adaptor_::base_type(i))
{ }
pointer operator->() const { return *(this->base()); }
reference operator*() const { return **(this->base()); }
operator Vertex_handle() { return Vertex_handle(*(this->base())); }
};
public:
/// Iterator type to visit the edges of the 1D complex.
typedef Filter_iterator<
typename Triangulation::Finite_edges_iterator,
Edge_iterator_not_in_complex > Edges_in_complex_iterator;
/// Returns a Facets_in_complex_iterator to the first facet of the 1D complex
Edges_in_complex_iterator edges_in_complex_begin() const
{
return CGAL::filter_iterator(this->triangulation().finite_edges_end(),
Edge_iterator_not_in_complex(*this),
this->triangulation().finite_edges_begin());
}
/// Returns a Facets_in_complex_iterator to the first facet of the 1D complex
Edges_in_complex_iterator
edges_in_complex_begin(const Curve_index& index) const
{
return CGAL::filter_iterator(this->triangulation().finite_edges_end(),
Edge_iterator_not_in_complex(*this,index),
this->triangulation().finite_edges_begin());
}
/// Returns past-the-end iterator on facet of the 1D complex
Edges_in_complex_iterator edges_in_complex_end(const Curve_index& = Curve_index()) const
{
return CGAL::filter_iterator(this->triangulation().finite_edges_end(),
Edge_iterator_not_in_complex(*this));
}
/// Iterator type to visit the edges of the 0D complex.
typedef Vertex_map_iterator_first_dereference Vertices_in_complex_iterator;
/// Returns a Vertices_in_complex_iterator to the first vertex of the 0D complex
Vertices_in_complex_iterator vertices_in_complex_begin() const
{
return CGAL::filter_iterator(corners_.end(),
Vertex_iterator_not_in_complex(*this),
corners_.begin());
}
/// Returns a Vertices_in_complex_iterator to the first vertex of the 0D complex
Vertices_in_complex_iterator
vertices_in_complex_begin(const Corner_index& index) const
{
return CGAL::filter_iterator(corners_.end(),
Vertex_iterator_not_in_complex(*this,index),
corners_.begin());
}
/// Returns past-the-end iterator on facet of the 0D complex
Vertices_in_complex_iterator vertices_in_complex_end() const
{
return CGAL::filter_iterator(corners_.end(),
Vertex_iterator_not_in_complex(*this));
}
private:
/**
* Creates an Internal_edge object (i.e a pair of ordered Vertex_handle)
*/
Internal_edge make_internal_edge(const Vertex_handle& v1,
const Vertex_handle& v2) const
{
if ( v1 < v2 ) { return Internal_edge(v1,v2); }
else { return Internal_edge(v2,v1); }
}
/**
* Returns true if \c edge is in C3T3
*/
bool is_in_complex(const Internal_edge& edge) const
{
return (curve_index(edge) != Curve_index() );
}
/**
* Add edge \c edge to complex, with Curve_index index
*/
void add_to_complex(const Internal_edge& edge, const Curve_index& index)
{
CGAL_precondition(!is_in_complex(edge));
#if CGAL_MESH_3_PROTECTION_DEBUG & 1
std::cerr << "Add edge ( " << disp_vert(edge.left)
<< " , " << disp_vert(edge.right) << " ), curve_index=" << index
<< " to c3t3.\n";
#endif // CGAL_MESH_3_PROTECTION_DEBUG
std::pair<typename Edge_map::iterator, bool> it = edges_.insert(edge);
it.first->info = index;
}
/**
* Remove edge \c edge from complex
*/
void remove_from_complex(const Internal_edge& edge)
{
edges_.erase(edge);
}
/**
* Returns Curve_index of edge \c edge
*/
Curve_index curve_index(const Internal_edge& edge) const
{
typename Edge_map::const_iterator it = edges_.find(edge);
if ( edges_.end() != it ) { return it->info; }
return Curve_index();
}
private:
Edge_map edges_;
Corner_map corners_;
Far_vertices_vec far_vertices_;
};
template <typename Tr, typename CI_, typename CSI_>
Mesh_complex_3_in_triangulation_3<Tr,CI_,CSI_>::
Mesh_complex_3_in_triangulation_3(const Self& rhs)
: Base(rhs)
, edges_()
, corners_()
{
// Copy edges
for ( typename Edge_map::const_iterator it = rhs.edges_.begin(),
end = rhs.edges_.end() ; it != end ; ++it )
{
const Vertex_handle& va = it->right;
const Vertex_handle& vb = it->left;
Vertex_handle new_va;
this->triangulation().is_vertex(rhs.triangulation().point(va), new_va);
Vertex_handle new_vb;
this->triangulation().is_vertex(rhs.triangulation().point(vb), new_vb);
this->add_to_complex(make_internal_edge(new_va,new_vb), it->info);
}
// Copy corners
for ( typename Corner_map::const_iterator it = rhs.corners_.begin(),
end = rhs.corners_.end() ; it != end ; ++it )
{
Vertex_handle new_v;
this->triangulation().is_vertex(rhs.triangulation().point(it->first), new_v);
this->add_to_complex(new_v, it->second);
}
// Parse vertices to identify far vertices
if (rhs.far_vertices_.size() > 0)
{
Triangulation &tr = triangulation();
typename Tr::Finite_vertices_iterator vit = tr.finite_vertices_begin();
for(typename Tr::Finite_vertices_iterator end = tr.finite_vertices_end();
vit != end ; ++vit)
{
if (vit->in_dimension() == -1)
far_vertices_.push_back(vit);
}
CGAL_assertion(far_vertices_.size() == rhs.far_vertices_.size());
}
}
template <typename Tr, typename CI_, typename CSI_>
template <typename OutputIterator>
OutputIterator
Mesh_complex_3_in_triangulation_3<Tr,CI_,CSI_>::
adjacent_vertices_in_complex(const Vertex_handle& v, OutputIterator out) const
{
CGAL_precondition(v->in_dimension() < 2);
typedef typename Edge_map::right_const_iterator Rcit;
typedef typename Edge_map::left_const_iterator Lcit;
// Add edges containing v is on the left
std::pair<Rcit,Rcit> range_right = edges_.right.equal_range(v);
for ( Rcit rit = range_right.first ; rit != range_right.second ; ++rit )
{
*out++ = std::make_pair(rit->second, rit->info);
}
// Add edges containing v on the right
std::pair<Lcit,Lcit> range_left = edges_.left.equal_range(v);
for ( Lcit lit = range_left.first ; lit != range_left.second ; ++lit )
{
*out++ = std::make_pair(lit->second, lit->info);
}
return out;
}
template <typename Tr, typename CI_, typename CSI_>
bool
Mesh_complex_3_in_triangulation_3<Tr,CI_,CSI_>::
is_valid(bool verbose) const
{
typedef typename Tr::Weighted_point Weighted_point;
typedef boost::unordered_map<Vertex_handle, int, Hash_fct> Vertex_map;
Vertex_map vertex_map;
// Fill map counting neighbor number for each vertex of an edge
for ( typename Edge_map::const_iterator it = edges_.begin(),
end = edges_.end() ; it != end ; ++it )
{
const Vertex_handle& v1 = it->right;
if ( vertex_map.find(v1) == vertex_map.end() ) { vertex_map[v1] = 1; }
else { vertex_map[v1] += 1; }
const Vertex_handle& v2 = it->left;
if ( vertex_map.find(v2) == vertex_map.end() ) { vertex_map[v2] = 1; }
else { vertex_map[v2] += 1; }
}
// Verify that each vertex has 2 neighbors if it's not a corner
for ( typename Vertex_map::iterator vit = vertex_map.begin(),
vend = vertex_map.end() ; vit != vend ; ++vit )
{
if ( vit->first->in_dimension() != 0 && vit->second != 2 )
{
if(verbose)
std::cerr << "Validity error: vertex " << (void*)(&*vit->first)
<< " (" << this->triangulation().point(vit->first) << ") "
<< "is not a corner (dimension " << vit->first->in_dimension()
<< ") but has " << vit->second << " neighbor(s)!\n";
return false;
}
}
// Verify that balls of each edge intersect
for ( typename Edge_map::const_iterator it = edges_.begin(),
end = edges_.end() ; it != end ; ++it )
{
typename Tr::Geom_traits::Compute_weight_3 cw =
this->triangulation().geom_traits().compute_weight_3_object();
typename Tr::Geom_traits::Construct_point_3 cp =
this->triangulation().geom_traits().construct_point_3_object();
typename Tr::Geom_traits::Construct_sphere_3 sphere =
this->triangulation().geom_traits().construct_sphere_3_object();
typename Tr::Geom_traits::Do_intersect_3 do_intersect =
this->triangulation().geom_traits().do_intersect_3_object();
const Weighted_point& itrwp = this->triangulation().point(it->right);
const Weighted_point& itlwp = this->triangulation().point(it->left);
if ( ! do_intersect(sphere(cp(itrwp), cw(itrwp)), sphere(cp(itlwp), cw(itlwp))) )
{
std::cerr << "Points p[" << disp_vert(it->right) << "], dim=" << it->right->in_dimension()
<< " and q[" << disp_vert(it->left) << "], dim=" << it->left->in_dimension()
<< " form an edge but do not intersect !\n";
return false;
}
}
return true;
}
template <typename Tr, typename CI_, typename CSI_>
void
Mesh_complex_3_in_triangulation_3<Tr,CI_,CSI_>::
rescan_after_load_of_triangulation() {
corners_.clear();
for(typename Tr::Finite_vertices_iterator
vit = this->triangulation().finite_vertices_begin(),
end = this->triangulation().finite_vertices_end();
vit != end; ++vit)
{
if ( vit->in_dimension() == 0 ) {
add_to_complex(vit, Corner_index(1));
}
}
Base::rescan_after_load_of_triangulation();
}
template <typename Tr, typename CI_, typename CSI_>
std::ostream &
operator<< (std::ostream& os,
const Mesh_complex_3_in_triangulation_3<Tr,CI_,CSI_> &c3t3)
{
// TODO: implement edge saving
typedef typename Mesh_complex_3_in_triangulation_3<Tr,CI_,CSI_>::Concurrency_tag Concurrency_tag;
return os << static_cast<
const Mesh_3::Mesh_complex_3_in_triangulation_3_base<Tr, Concurrency_tag>&>(c3t3);
}
template <typename Tr, typename CI_, typename CSI_>
std::istream &
operator>> (std::istream& is,
Mesh_complex_3_in_triangulation_3<Tr,CI_,CSI_> &c3t3)
{
// TODO: implement edge loading
typedef typename Mesh_complex_3_in_triangulation_3<Tr,CI_,CSI_>::Concurrency_tag Concurrency_tag;
is >> static_cast<
Mesh_3::Mesh_complex_3_in_triangulation_3_base<Tr, Concurrency_tag>&>(c3t3);
c3t3.rescan_after_load_of_triangulation();
return is;
}
} //namespace CGAL
#include <CGAL/enable_warnings.h>
#endif // CGAL_MESH_COMPLEX_3_IN_TRIANGULATION_3_H

View File

@ -29,7 +29,7 @@
#include <CGAL/is_streamable.h>
#include <CGAL/Real_timer.h>
#include <CGAL/property_map.h>
#include <CGAL/Mesh_3/internal/indices_management.h>
#include <CGAL/SMDS_3/internal/indices_management.h>
#include <vector>
#include <set>

View File

@ -28,7 +28,7 @@
#include <CGAL/Mesh_vertex_base_3.h>
#include <CGAL/Compact_mesh_cell_base_3.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
namespace CGAL {

View File

@ -20,12 +20,12 @@
#ifndef CGAL_COMPACT_MESH_VERTEX_BASE_3_H
#define CGAL_COMPACT_MESH_VERTEX_BASE_3_H
#include <CGAL/license/Triangulation_3.h>
#include <CGAL/license/Mesh_3.h>
#include <CGAL/Regular_triangulation_vertex_base_3.h>
#include <CGAL/Mesh_3/internal/indices_management.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/internal/indices_management.h>
#include <CGAL/SMDS_3/io_signature.h>
#include <CGAL/Has_timestamp.h>
#include <CGAL/tags.h>
#include <atomic>
@ -289,6 +289,30 @@ public:
}
}; // end class Mesh_vertex_3
/*!
\ingroup PkgMesh3MeshClasses
The class `Mesh_vertex_base_3` is a model of the concept `MeshVertexBase_3`.
It is designed to serve as vertex base class for the 3D triangulation
used in a 3D mesh generation process.
\tparam GT is the geometric traits class.
It must be a model of the concept `MeshTriangulationTraits_3`.
\tparam MD provides the types of indices
used to identify
the faces of the input complex. It must be a model
of the concept `MeshDomain_3`.
\tparam Vb is the vertex base class. It has to be a model
of the concept `RegularTriangulationVertexBase_3` and defaults to
`Regular_triangulation_vertex_base_3<GT>`.
\cgalModels `MeshVertexBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
*/
template<class GT,
class MD,
class Vb = Regular_triangulation_vertex_base_3<GT> >

View File

@ -59,9 +59,9 @@
// To handle I/O for Surface_patch_index if that is a pair of `int` (the
// default)
#include <CGAL/Mesh_3/internal/Handle_IO_for_pair_of_int.h>
#include <CGAL/SMDS_3/internal/Handle_IO_for_pair_of_int.h>
#include <CGAL/Mesh_3/internal/indices_management.h>
#include <CGAL/SMDS_3/internal/indices_management.h>
namespace CGAL {

View File

@ -1,187 +0,0 @@
// Copyright (c) 2009-2017 GeometryFactory (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) : Maxime Gimeno,
// Mael Rouxel-Labbé
#ifndef CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H
#define CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H
#include <CGAL/license/Triangulation_3.h>
#include <CGAL/array.h>
#include <CGAL/boost/graph/Euler_operations.h>
#include <CGAL/Cartesian_converter.h>
#include <CGAL/Kernel_traits.h>
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup.h>
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
#include <CGAL/Time_stamper.h>
#include <boost/tuple/tuple.hpp>
#include <algorithm>
#include <cstddef>
#include <iterator>
#include <unordered_map>
#include <vector>
namespace CGAL {
namespace Mesh_3 {
namespace internal {
template <class Polygon>
void resize(Polygon& p, std::size_t size)
{
p.resize(size);
}
template <std::size_t N, class INT>
void resize(std::array<INT, N>&, std::size_t CGAL_assertion_code(size))
{
CGAL_assertion(size == N);
}
template<class C3T3, class PointContainer, class FaceContainer>
void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3,
const typename C3T3::Subdomain_index sd_index,
PointContainer& points,
FaceContainer& faces,
const bool normals_point_outside_of_the_subdomain = true,
const bool export_all_facets = false)
{
typedef typename PointContainer::value_type Point_3;
typedef typename FaceContainer::value_type Face;
typedef typename C3T3::Triangulation Tr;
typedef typename Tr::Cell_handle Cell_handle;
typedef typename Tr::Weighted_point Weighted_point;
typedef typename C3T3::Facets_in_complex_iterator Ficit;
typedef std::unordered_map<Point_3, std::size_t> PIM;
typedef typename C3T3::size_type size_type;
// triangulation point to range point
CGAL::Cartesian_converter<typename CGAL::Kernel_traits<typename Tr::Geom_traits::Point_3>::type,
typename CGAL::Kernel_traits<Point_3>::type> t2r;
size_type nf = c3t3.number_of_facets_in_complex();
faces.reserve(faces.size() + nf);
points.reserve(points.size() + nf/2); // approximating Euler
PIM p_to_ids;
std::size_t inum = 0;
for(Ficit fit = c3t3.facets_in_complex_begin(),
end = c3t3.facets_in_complex_end(); fit != end; ++fit)
{
Cell_handle c = fit->first;
int s = fit->second;
Face f;
resize(f, 3);
typename C3T3::Subdomain_index cell_sdi = c3t3.subdomain_index(c);
typename C3T3::Subdomain_index opp_sdi = c3t3.subdomain_index(c->neighbor(s));
if(!export_all_facets && cell_sdi != sd_index && opp_sdi != sd_index)
continue;
for(std::size_t i=1; i<4; ++i)
{
CGAL_assertion_code(typedef typename Tr::Vertex_handle Vertex_handle;)
CGAL_assertion_code(Vertex_handle v = c->vertex((s+i)&3);)
CGAL_assertion(v != Vertex_handle() && !c3t3.triangulation().is_infinite(v));
const Weighted_point& wp = c3t3.triangulation().point(c, (s+i)&3);
const Point_3& bp = t2r(c3t3.triangulation().geom_traits().construct_point_3_object()(wp));
auto insertion_res = p_to_ids.emplace(bp, inum);
if(insertion_res.second) // new point
{
points.push_back(bp);
++inum;
}
f[i-1] = insertion_res.first->second;
}
if(export_all_facets)
{
if((cell_sdi > opp_sdi) == (s%2 == 1))
std::swap(f[0], f[1]);
}
else
{
if(((cell_sdi == sd_index) == (s%2 == 1)) == normals_point_outside_of_the_subdomain)
std::swap(f[0], f[1]);
}
faces.push_back(f);
}
}
template<class C3T3, class PointContainer, class FaceContainer>
void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3,
PointContainer& points,
FaceContainer& faces)
{
typedef typename C3T3::Subdomain_index Subdomain_index;
Subdomain_index useless = Subdomain_index();
facets_in_complex_3_to_triangle_soup(c3t3, useless, points, faces,
true/*point outward*/, true /*extract all facets*/);
}
} // end namespace internal
} // end namespace Mesh_3
//! \ingroup PkgMesh3Functions
//!
//! \brief builds a `TriangleMesh` from the surface facets, with a consistent orientation
//! at the interface of two subdomains.
//!
//! This function exports the surface as a `TriangleMesh` and appends it to `graph`, using
//! `orient_polygon_soup()`.
//!
//! @tparam C3T3 a model of `MeshComplexWithFeatures_3InTriangulation_3`.
//! @tparam TriangleMesh a model of `MutableFaceGraph` with an internal point property map.
//! The point type should be compatible with the one used in `C3T3`.
//!
//! @param c3t3 an instance of `C3T3`.
//! @param graph an instance of `TriangleMesh`.
template<class C3T3, class TriangleMesh>
void facets_in_complex_3_to_triangle_mesh(const C3T3& c3t3, TriangleMesh& graph)
{
namespace PMP = CGAL::Polygon_mesh_processing;
typedef typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type VertexPointMap;
typedef typename boost::property_traits<VertexPointMap>::value_type Point_3;
typedef std::array<std::size_t, 3> Face;
std::vector<Face> faces;
std::vector<Point_3> points;
Mesh_3::internal::facets_in_complex_3_to_triangle_soup(c3t3, points, faces);
if(!PMP::is_polygon_soup_a_polygon_mesh(faces))
PMP::orient_polygon_soup(points, faces);
CGAL_postcondition(PMP::is_polygon_soup_a_polygon_mesh(faces));
PMP::polygon_soup_to_polygon_mesh(points, faces, graph);
}
} // namespace CGAL
#endif // CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H

View File

@ -26,7 +26,7 @@
#include <CGAL/refine_mesh_3.h>
#include <CGAL/tags.h>
#include <CGAL/Mesh_3/Protect_edges_sizing_field.h>
#include <CGAL/Mesh_3/Has_features.h>
#include <CGAL/SMDS_3/Has_features.h>
#include <CGAL/Mesh_3/C3T3_helpers.h>
#include <boost/mpl/has_xxx.hpp>

View File

@ -24,10 +24,10 @@
#include <CGAL/config.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/Mesh_3/config.h>
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/Mesh_3/Mesher_3.h>
#include <CGAL/Mesh_error_code.h>
#include <CGAL/optimize_mesh_3.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
#include <boost/parameter/preprocessor.hpp>

View File

@ -31,6 +31,7 @@ Principal_component_analysis_LGPL
Profiling_tools
Property_map
Random_numbers
SMDS_3
STL_Extension
Solver_interface
Spatial_searching

View File

@ -23,16 +23,12 @@ if ( CGAL_FOUND )
endif()
create_single_source_cgal_program( "test_boost_has_xxx.cpp" )
create_single_source_cgal_program( "test_c3t3.cpp" )
create_single_source_cgal_program( "test_mesh_capsule_var_distance_bound.cpp" )
create_single_source_cgal_program( "test_implicit_multi_domain_to_labeling_function_wrapper.cpp" )
create_single_source_cgal_program( "test_c3t3_io.cpp" )
create_single_source_cgal_program( "test_c3t3_with_features.cpp" )
create_single_source_cgal_program( "test_criteria.cpp" )
create_single_source_cgal_program( "test_domain_with_polyline_features.cpp" )
create_single_source_cgal_program( "test_labeled_mesh_domain_3.cpp" )
create_single_source_cgal_program( "test_mesh_criteria_creation.cpp" )
create_single_source_cgal_program( "test_c3t3_into_facegraph.cpp" )
create_single_source_cgal_program( "test_without_detect_features.cpp" )
if(CGAL_ImageIO_USE_ZLIB)
create_single_source_cgal_program( "test_meshing_3D_image.cpp" )
@ -52,7 +48,6 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "test_meshing_unit_tetrahedron.cpp" )
create_single_source_cgal_program( "test_meshing_with_default_edge_size.cpp" )
create_single_source_cgal_program( "test_meshing_determinism.cpp" )
create_single_source_cgal_program( "test_c3t3_extract_subdomains_boundaries.cpp" )
create_single_source_cgal_program( "test_mesh_3_issue_1554.cpp" )
create_single_source_cgal_program( "test_mesh_polyhedral_domain_with_features_deprecated.cpp" )
create_single_source_cgal_program( "test_meshing_with_one_step.cpp" )
@ -60,16 +55,12 @@ if ( CGAL_FOUND )
foreach(target
test_boost_has_xxx
test_c3t3
test_mesh_capsule_var_distance_bound
test_implicit_multi_domain_to_labeling_function_wrapper
test_c3t3_io
test_c3t3_with_features
test_criteria
test_domain_with_polyline_features
test_labeled_mesh_domain_3
test_mesh_criteria_creation
test_c3t3_into_facegraph
test_without_detect_features
test_meshing_3D_image
test_meshing_3D_image_deprecated
@ -85,7 +76,6 @@ if ( CGAL_FOUND )
test_meshing_unit_tetrahedron
test_meshing_with_default_edge_size
test_meshing_determinism
test_c3t3_extract_subdomains_boundaries
test_mesh_3_issue_1554
test_mesh_polyhedral_domain_with_features_deprecated
test_mesh_cell_base_3

View File

@ -60,9 +60,10 @@ int main()
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
// // Output
// std::ofstream medit_file("out.mesh");
// CGAL::IO::write_MEDIT(medit_file, c3t3);
// medit_file.close();
return 0;
}

View File

@ -4,7 +4,7 @@
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_3/tet_soup_to_c3t3.h>
#include <CGAL/SMDS_3/tet_soup_to_c3t3.h>
#include <CGAL/Mesh_3/Robust_intersection_traits_3.h>
#include <CGAL/Polyhedral_mesh_domain_with_features_3.h>
#include <CGAL/Mesh_cell_base_3.h>
@ -49,7 +49,7 @@ int main (int argc, char** argv){
return 1;
}
C3t3 c3t3;
if(CGAL::build_triangulation_from_file<C3t3::Triangulation, true>(in, c3t3.triangulation()))
if(CGAL::SMDS_3::build_triangulation_from_file(in, c3t3.triangulation()))
{
for( C3t3::Triangulation::Finite_cells_iterator
cit = c3t3.triangulation().finite_cells_begin();

View File

@ -44,7 +44,10 @@ int main()
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
// // Output
// std::ofstream medit_file("out.mesh");
// CGAL::IO::write_MEDIT(medit_file, c3t3);
// medit_file.close();
return EXIT_SUCCESS;
}

View File

@ -76,7 +76,7 @@ void test()
no_perturb(),
no_exude());
std::ostringstream oss;
c3t3.output_to_medit(oss);
CGAL::IO::write_MEDIT(oss, c3t3);
output_c3t3.push_back(oss.str()); //[5*i]
oss.clear();
Polyhedron out_poly;
@ -88,7 +88,7 @@ void test()
//LLOYD (1)
CGAL::lloyd_optimize_mesh_3(c3t3, domain, max_iteration_number = nb_lloyd);
c3t3.output_to_medit(oss);
CGAL::IO::write_MEDIT(oss, c3t3);
output_c3t3.push_back(oss.str());//[i*5+1]
oss.clear();
CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, out_poly);
@ -99,7 +99,7 @@ void test()
//ODT (2)
CGAL::odt_optimize_mesh_3(c3t3, domain, max_iteration_number = nb_odt);
c3t3.output_to_medit(oss);
CGAL::IO::write_MEDIT(oss, c3t3);
output_c3t3.push_back(oss.str());//[i*5+2]
oss.clear();
CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, out_poly);
@ -110,7 +110,7 @@ void test()
//PERTURB (3)
CGAL::perturb_mesh_3(c3t3, domain, sliver_bound=perturb_bound);
c3t3.output_to_medit(oss);
CGAL::IO::write_MEDIT(oss, c3t3);
output_c3t3.push_back(oss.str());//[i*5+3]
oss.clear();
CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, out_poly);
@ -121,7 +121,7 @@ void test()
//EXUDE (4)
CGAL::exude_mesh_3(c3t3, sliver_bound=exude_bound);
c3t3.output_to_medit(oss);
CGAL::IO::write_MEDIT(oss, c3t3);
output_c3t3.push_back(oss.str());//[i*5+4]
oss.clear();
CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, out_poly);

View File

@ -15,14 +15,14 @@
// File Description :
//******************************************************************************
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#include "test_meshing_utilities.h"
#include <CGAL/Polyhedral_mesh_domain_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <boost/type_traits/is_same.hpp>
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
#include <CGAL/disable_warnings.h>

View File

@ -136,7 +136,7 @@ struct Polyhedron_with_features_tester : public Tester<K>
Polyhedral_tag()); //, 1099, 1099, 1158, 1158, 4902, 4902);
std::ofstream out_medit("test-medit.mesh");
CGAL::IO::output_to_medit(out_medit, c3t3);
CGAL::IO::write_MEDIT(out_medit, c3t3);
CGAL::IO::output_to_tetgen("test-tetgen", c3t3);
std::ofstream out_binary("test-binary.mesh.cgal",
std::ios_base::out|std::ios_base::binary);

View File

@ -89,11 +89,12 @@ int main(int argc, char** argv)
// CGAL::Mesh_3::internal::init_c3t3_with_features(c3t3, domain, criteria);
// Output
std::ofstream medit_file("out-mesh-polylines.mesh");
c3t3.output_to_medit(medit_file);
std::ofstream binary_file("out-mesh-polylines.binary.cgal", std::ios::binary|std::ios::out);
CGAL::IO::save_binary_file(binary_file, c3t3);
// // Output
// std::ofstream medit_file("out-mesh-polylines.mesh");
// CGAL::IO::write_MEDIT(medit_file, c3t3);
// std::ofstream binary_file("out-mesh-polylines.binary.cgal", std::ios::binary|std::ios::out);
// CGAL::IO::save_binary_file(binary_file, c3t3);
std::cout << "Number of vertices in c3t3: "
<< c3t3.triangulation().number_of_vertices() << std::endl;
assert(c3t3.triangulation().number_of_vertices() > 900);

View File

@ -6,7 +6,7 @@
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Polyhedral_mesh_domain_with_features_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
#include <sstream>

View File

@ -72,9 +72,10 @@ int main(int argc, char*argv[])
assert(c3t3.triangulation().number_of_vertices() > 200);
// Output
mesher.display_number_of_bad_elements();
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);
medit_file.close();
// std::ofstream medit_file("out.mesh");
// CGAL::IO::write_MEDIT(medit_file, c3t3);
// medit_file.close();
return EXIT_SUCCESS;
}

View File

@ -22,7 +22,7 @@ struct Tester {
// Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
int operator()(const std::string fname, const std::string out_fname)
int operator()(const std::string fname, const std::string /*out_fname*/)
{
std::ifstream input(fname);
using namespace CGAL::parameters;
@ -52,9 +52,10 @@ struct Tester {
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
// Output
std::ofstream medit_file(out_fname);
c3t3.output_to_medit(medit_file);
// // Output
// std::ofstream medit_file(out_fname);
// CGAL::IO::write_MEDIT(medit_file, c3t3);
return EXIT_SUCCESS;
}
};

View File

@ -308,7 +308,7 @@ void output_to_medit(std::ostream& os,
#endif
CGAL_precondition(c3t3.triangulation().is_1_cover());
typedef CGAL::Mesh_3::Medit_pmap_generator<C3T3, rebind, no_patch> Generator;
typedef CGAL::SMDS_3::Medit_pmap_generator<C3T3, rebind, no_patch> Generator;
typedef typename Generator::Cell_pmap Cell_pmap;
typedef typename Generator::Facet_pmap Facet_pmap;
typedef typename Generator::Facet_pmap_twice Facet_pmap_twice;

View File

@ -31,12 +31,12 @@
#include <CGAL/license/Periodic_3_mesh_3.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#ifdef CGAL_MESH_3_DUMP_FEATURES_PROTECTION_ITERATIONS
#include <CGAL/IO/File_binary_mesh_3.h>
#endif
#include <CGAL/Mesh_3/Protect_edges_sizing_field.h>
#include <CGAL/Mesh_3/utilities.h>
#include <CGAL/SMDS_3/utilities.h>
#include <CGAL/Mesh_3/Triangulation_helpers.h>
#include <CGAL/enum.h>
@ -75,7 +75,7 @@ namespace Periodic_3_mesh_3 {
template <typename C3T3, typename MeshDomain, typename SizingFunction>
class Protect_edges_sizing_field
: public CGAL::Mesh_3::internal::Debug_messages_tools
: public CGAL::SMDS_3::internal::Debug_messages_tools
{
typedef Protect_edges_sizing_field Self;

View File

@ -38,7 +38,7 @@
#include <CGAL/Cartesian_converter.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Kernel_traits.h>
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#include <CGAL/tags.h>
#include <iostream>

View File

@ -21,7 +21,7 @@
#include <CGAL/Periodic_3_mesh_3/config.h>
#include <CGAL/Mesh_3/C3T3_helpers.h>
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/SMDS_3/Dump_c3t3.h>
#include <CGAL/Mesh_3/Triangulation_helpers.h>
#include <CGAL/refine_mesh_3.h>
#include <CGAL/Time_stamper.h>

View File

@ -22,6 +22,7 @@ Modular_arithmetic
Number_types
Periodic_3_mesh_3
Periodic_3_triangulation_3
Polygon_mesh_processing
Principal_component_analysis
Principal_component_analysis_LGPL
Profiling_tools
@ -31,6 +32,8 @@ STL_Extension
Solver_interface
Spatial_sorting
Stream_support
SMDS_3
TDS_3
Triangulation_3
Union_find

View File

@ -21,6 +21,7 @@
#include <CGAL/boost/graph/Euler_operations.h>
#include <CGAL/boost/graph/iterator.h>
#include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/boost/graph/internal/helpers.h>
#include <CGAL/Dynamic_property_map.h>
#include <CGAL/property_map.h>
@ -74,9 +75,13 @@ public:
m_pm(pm)
{ }
template <typename PolygonMesh, typename VertexPointMap>
template <typename PolygonMesh, typename VertexPointMap,
typename V2V, //pointindex-2-vertex
typename F2F> //polygonindex-2-face
void operator()(PolygonMesh& pmesh,
VertexPointMap vpm,
V2V i2v,
F2F i2f,
const bool insert_isolated_vertices = true)
{
typedef typename boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;
@ -109,6 +114,7 @@ public:
vertices[i] = add_vertex(pmesh);
PM_Point pi = convert_to_pm_point<PM_Point>(get(m_pm, m_points[i]));
put(vpm, vertices[i], pi);
*i2v++ = std::make_pair(i, vertices[i]);
}
for(std::size_t i = 0, end = m_polygons.size(); i < end; ++i)
@ -121,9 +127,10 @@ public:
for(std::size_t j = 0; j < size; ++j)
vr[j] = vertices[polygon[j] ];
CGAL_assertion_code(typename boost::graph_traits<PolygonMesh>::face_descriptor fd =)
typename boost::graph_traits<PolygonMesh>::face_descriptor fd =
CGAL::Euler::add_face(vr, pmesh);
CGAL_assertion(fd != boost::graph_traits<PolygonMesh>::null_face());
*i2f++ = std::make_pair(i, fd);
}
}
@ -131,7 +138,11 @@ public:
void operator()(PolygonMesh& pmesh,
const bool insert_isolated_vertices = true)
{
return operator()(pmesh, get(CGAL::vertex_point, pmesh), insert_isolated_vertices);
return operator()(pmesh,
get(CGAL::vertex_point, pmesh),
CGAL::Emptyset_iterator(),
CGAL::Emptyset_iterator(),
insert_isolated_vertices);
}
private:
@ -250,6 +261,23 @@ bool is_polygon_soup_a_polygon_mesh(const PolygonRange& polygons)
* of the vertex point map associated to the polygon mesh}
* \cgalParamDefault{`CGAL::Identity_property_map`}
* \cgalParamNEnd
*
* \cgalParamNBegin{point_to_vertex_output_iterator}
* \cgalParamDescription{an `OutputIterator` containing the pairs source-vertex-index
* from `points`, target-vertex.}
* \cgalParamType{a class model of `OutputIterator` accepting
* `std::pair<int, boost::graph_traits<PolygonMesh>::%vertex_descriptor>`}
* \cgalParamDefault{`Emptyset_iterator`}
* \cgalParamNEnd
*
* \cgalParamNBegin{polygon_to_face_output_iterator}
* \cgalParamDescription{an `OutputIterator` containing the pairs polygon-index
* from `polygons`, target-face.}
* \cgalParamType{a class model of `OutputIterator` accepting
* `std::pair<int, boost::graph_traits<PolygonMesh>::%face_descriptor>`}
* \cgalParamDefault{`Emptyset_iterator`}
* \cgalParamNEnd
*
* \cgalNamedParamsEnd
*
* @param np_pm an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
@ -292,7 +320,11 @@ void polygon_soup_to_polygon_mesh(const PointRange& points,
get_property_map(CGAL::vertex_point, out));
internal::PS_to_PM_converter<PointRange, PolygonRange, Point_map> converter(points, polygons, pm);
converter(out, vpm);
converter(out, vpm,
choose_parameter(get_parameter(np_ps, internal_np::point_to_vertex_output_iterator),
impl::make_functor(get_parameter(np_ps, internal_np::vertex_to_vertex_map))),
choose_parameter(get_parameter(np_ps, internal_np::polygon_to_face_output_iterator),
impl::make_functor(get_parameter(np_ps, internal_np::face_to_face_map))));
}
} // namespace Polygon_mesh_processing

View File

@ -10,7 +10,7 @@
// Jane Tournois
//
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#include <QtCore/qglobal.h>
#include "Scene_surface_mesh_item.h"
@ -37,7 +37,7 @@
#include <CGAL/boost/graph/Euler_operations.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/Complex_3_in_triangulation_3_to_vtk.h>
#include <CGAL/Mesh_3/tet_soup_to_c3t3.h>
#include <CGAL/SMDS_3/tet_soup_to_c3t3.h>
#include <CGAL/IO/output_to_vtu.h>
#include <CGAL/boost/graph/io.h>
@ -377,7 +377,7 @@ public:
if (is_c3t3)
{
typedef std::array<int, 3> Facet; // 3 = id
typedef std::array<int, 5> Tet_with_ref; // first 4 = id, fifth = reference
typedef std::array<int, 4> Tet; // first 4 = id, fifth = reference
Scene_c3t3_item* c3t3_item = new Scene_c3t3_item();
c3t3_item->set_valid(false);
//build a triangulation from data:
@ -388,7 +388,8 @@ public:
double *p = dataP->GetPoint(i);
points.push_back(Tr::Point(p[0],p[1],p[2]));
}
std::vector<Tet_with_ref> finite_cells;
std::vector<Tet> finite_cells;
std::vector<C3t3::Subdomain_index> subdomains;
bool has_mesh_domain = data->GetCellData()->HasArray("MeshDomain");
vtkDataArray* domains = data->GetCellData()->GetArray("MeshDomain");
for(int i = 0; i< data->GetNumberOfCells(); ++i)
@ -396,12 +397,15 @@ public:
if(data->GetCellType(i) != 10 )
continue;
vtkIdList* pids = data->GetCell(i)->GetPointIds();
Tet_with_ref cell;
Tet cell;
for(int j = 0; j<4; ++j)
cell[j] = pids->GetId(j);
cell[4] = has_mesh_domain ? static_cast<int>(domains->GetComponent(i,0))
:1;
finite_cells.push_back(cell);
const auto si = has_mesh_domain
? static_cast<int>(domains->GetComponent(i, 0))
: 1;
subdomains.push_back(si);
}
std::map<Facet, int> border_facets;
//Preprocessing for build_triangulation
@ -420,9 +424,11 @@ public:
std::swap(finite_cells[i][1], finite_cells[i][3]);
}
}
std::vector<typename Tr::Vertex_handle> new_vertices;
CGAL::build_triangulation<Tr, true>(c3t3_item->c3t3().triangulation(),
points, finite_cells, border_facets, new_vertices);
CGAL::SMDS_3::build_triangulation_with_subdomains_range(
c3t3_item->c3t3().triangulation(),
points, finite_cells, subdomains, border_facets,
false, false, true);
for( C3t3::Triangulation::Finite_cells_iterator
cit = c3t3_item->c3t3().triangulation().finite_cells_begin();

View File

@ -1,6 +1,6 @@
#include <CGAL/Mesh_3/io_signature.h>
#include <CGAL/SMDS_3/io_signature.h>
#include "Scene_c3t3_item.h"
#include <CGAL/Mesh_3/tet_soup_to_c3t3.h>
#include <CGAL/SMDS_3/tet_soup_to_c3t3.h>
#include <CGAL/Three/Polyhedron_demo_io_plugin_interface.h>
#include <CGAL/Three/Three.h>
#include <CGAL/IO/File_avizo.h>
@ -129,13 +129,11 @@ Polyhedron_demo_c3t3_binary_io_plugin::load(
item->setName(fileinfo.baseName());
item->set_valid(false);
if(CGAL::build_triangulation_from_file<C3t3::Triangulation, true>(in, item->c3t3().triangulation(), true))
if(CGAL::SMDS_3::build_triangulation_from_file(in, item->c3t3().triangulation(),
/*verbose = */true, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true))
{
item->c3t3().rescan_after_load_of_triangulation(); //fix counters for facets and cells
for( C3t3::Triangulation::Finite_cells_iterator
cit = item->c3t3().triangulation().finite_cells_begin();
cit != item->c3t3().triangulation().finite_cells_end();
++cit)
for( C3t3::Cell_handle cit : item->c3t3().triangulation().finite_cell_handles())
{
CGAL_assertion(cit->subdomain_index() >= 0);
if(cit->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index())
@ -152,22 +150,19 @@ Polyhedron_demo_c3t3_binary_io_plugin::load(
//if there is no facet in the complex, we add the border facets.
if(item->c3t3().number_of_facets_in_complex() == 0)
{
for( C3t3::Triangulation::Finite_facets_iterator
fit = item->c3t3().triangulation().finite_facets_begin();
fit != item->c3t3().triangulation().finite_facets_end();
++fit)
for( C3t3::Facet fit : item->c3t3().triangulation().finite_facets())
{
typedef C3t3::Triangulation::Cell_handle Cell_handle;
Cell_handle c = fit->first;
Cell_handle nc = c->neighbor(fit->second);
Cell_handle c = fit.first;
Cell_handle nc = c->neighbor(fit.second);
// By definition, Subdomain_index() is supposed to be the id of the exterior
if(c->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index() &&
nc->subdomain_index() == C3t3::Triangulation::Cell::Subdomain_index())
{
// Color the border facet with the index of its cell
item->c3t3().add_to_complex(c, fit->second, c->subdomain_index());
item->c3t3().add_to_complex(c, fit.second, c->subdomain_index());
}
}
}
@ -236,7 +231,9 @@ save(QFileInfo fileinfo, QList<Scene_item *> &items)
else if (fileinfo.suffix() == "mesh")
{
std::ofstream medit_file (qPrintable(path));
c3t3_item->c3t3().output_to_medit(medit_file,true,true);
CGAL::IO::write_MEDIT(medit_file, c3t3_item->c3t3(),
CGAL::parameters::rebind_labels(true)
.show_patches(true));
items.pop_front();
return true;
}

View File

@ -210,9 +210,18 @@ bool Scene_c3t3_item::is_facet_oriented(const T3::Facet& f)const
return (index % 2 == 1) == d->c3t3.is_in_complex(cell);
}
QString Scene_c3t3_item::toolTip() const {
return tr("<p><b>3D complex in a 3D triangulation</b></p>"
"<p>Number of vertices: %1<br />"
"Number of surface facets: %2<br />"
"Number of volume tetrahedra: %3</p>%4")
.arg(c3t3().triangulation().number_of_vertices())
.arg(c3t3().number_of_facets_in_complex())
.arg(c3t3().number_of_cells_in_complex())
.arg(property("toolTip").toString());
}
QMenu* Scene_c3t3_item::contextMenu()
{
const char* prop_name = "Menu modified by Scene_c3t3_item.";
QMenu* menu = Scene_triangulation_3_item::contextMenu();
@ -278,6 +287,26 @@ bool Scene_c3t3_item::load_binary(std::istream& is)
return false;
}
void Scene_c3t3_item::compute_bbox() const
{
if (isEmpty())
_bbox = Bbox();
else
{
CGAL::Bbox_3 result;//default is [+infinity; -infinity]
for (Tr::Cell_handle c : c3t3().cells_in_complex())
{
Tr::Vertex_handle v = (c->vertex(0) != c3t3().triangulation().infinite_vertex())
? c->vertex(0)
: c->vertex(1);
result += v->point().bbox();
}
_bbox = Bbox(result.xmin(), result.ymin(), result.zmin(),
result.xmax(), result.ymax(), result.zmax());
}
}
void Scene_c3t3_item::export_facets_in_complex()
{
SMesh outmesh;

View File

@ -59,6 +59,8 @@ using namespace CGAL::Three;
}
bool load_binary(std::istream& is) override;
void compute_bbox() const override;
bool is_valid() const;//true if the c3t3 is correct, false if it was made from a .mesh, for example
void set_valid(bool);
QMenu* contextMenu() override;
@ -95,6 +97,7 @@ using namespace CGAL::Three;
bool do_take_vertex(const T3::Vertex_handle &)const override;
bool is_facet_oriented(const T3::Facet&)const override;
bool is_surface()const override;
QString toolTip() const override;
void common_constructor(bool is_surface);
};

View File

@ -1,5 +1,5 @@
/*!
\ingroup PkgMesh3Concepts
\ingroup PkgSMDS3Concepts
\cgalConcept
The concept `MeshComplexWithFeatures_3InTriangulation_3` describes a data structure

View File

@ -1,5 +1,5 @@
/*!
\ingroup PkgMesh3Concepts
\ingroup PkgSMDS3Concepts
\cgalConcept
The concept `MeshComplex_3InTriangulation_3` describes a data structure
@ -46,7 +46,7 @@ The data structure encodes the final mesh at the end of the meshing process.
\sa `MeshDomain_3`
\sa `MeshComplexWithFeatures_3InTriangulation_3`
\sa `CGAL::make_mesh_3()`
\sa \link CGAL::make_mesh_3() `CGAL::make_mesh_3()`\endlink
*/

View File

@ -0,0 +1,80 @@
/*!
\ingroup PkgSMDS3Concepts
\cgalConcept
The concept `SimplicialMeshCellBase_3` describes the requirements
for the `TriangulationDataStructure_3::Cell` type of the triangulation
used in the 3D simplicial mesh data structure. The type `SimplicialMeshCellBase_3`
refines the concept `TriangulationCellBase_3`
and must be copy constructible.
The concept `SimplicialMeshCellBase_3`
includes a way to store and retrieve
if a given cell of the triangulation is inside a subdomain or not,
and which subdomain it belongs to
in case of a multi-domain.
Moreover, this concept adds four markers per cell to mark the facets
of the triangulation that are surface facets.
\cgalRefines `TriangulationCellBase_3 `
\cgalRefines `CopyConstructible`
\cgalHasModel `CGAL::Compact_mesh_cell_base_3`
\cgalHasModel `CGAL::Mesh_cell_base_3`
\cgalHasModel `CGAL::Simplicial_mesh_cell_base_3`
\cgalHasModel `CGAL::Tetrahedral_remeshing::Remeshing_cell_base_3`
*/
class SimplicialMeshCellBase_3 {
public:
/// \name Types
/// @{
/*!
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 mesh complex.
Must match the type `MeshDomain_3::Surface_patch_index` in the context of mesh generation.
*/
typedef unspecified_type Surface_patch_index;
/// @}
/// \name Operations
/// @{
/*!
returns the index of the input subdomain that contains the cell.
*/
Subdomain_index subdomain_index();
/*!
Sets the subdomain index of the cell.
*/
void set_subdomain_index(Subdomain_index index);
/*!
returns `true` iff `facet(i)` is a surface facet.
*/
bool is_facet_on_surface(int i);
/*!
returns `Surface_patch_index` of facet `i`.
*/
Surface_patch_index surface_patch_index(int i);
/*!
sets `Surface_patch_index` of facet `i` to `index`.
*/
void set_surface_patch_index(int i, Surface_patch_index index);
/// @}
}; /* end SimplicialMeshCellBase_3 */

View File

@ -0,0 +1,91 @@
/*!
\ingroup PkgSMDS3Concepts
\cgalConcept
The concept `SimplicialMeshVertexBase_3` describes the requirements
for the `Vertex` type of the triangulation
used in the 3D simplicial mesh data structure. The type `SimplicialMeshVertexBase_3`
refines the concept `TriangulationVertexBase_3`.
It provides additional members to store and retrieve
information about the location of the vertex with respect
to the input domain describing the discretized domain.
More specifically, the concept `SimplicialMeshVertexBase_3` provides read-write access
to an integer representing the dimension of the lowest dimensional face
of the input 3D complex on which the vertex lies,
and to an index characteristic of this face.
\cgalRefines `TriangulationVertexBase_3`
\cgalHasModel `CGAL::Mesh_vertex_base_3`
\cgalHasModel `CGAL::Simplicial_mesh_vertex_base_3`
\cgalHasModel `CGAL::Tetrahedral_remeshing::Remeshing_vertex_base_3`
*/
class SimplicialMeshVertexBase_3 {
public:
/// \name Types
/// @{
/*!
Index type.
*/
typedef unspecified_type Index;
/*!
Numerical type.
*/
typedef unspecified_type FT;
/// @}
/// \name Operations
/// @{
/*!
Returns the dimension of the lowest dimensional face of the input 3D complex that contains the vertex.
*/
int in_dimension() const;
/*!
Sets the dimension of the lowest dimensional face of the input 3D complex that contains the vertex.
*/
void set_dimension(int);
/*!
Returns the index of the lowest dimensional face of the input 3D complex that contains the vertex.
*/
Index index();
/*!
Sets the index of the lowest dimensional face of the input 3D complex that contains the vertex.
*/
void set_index(Index);
/*!
Returns `true` if the cache is valid.
*/
bool is_c2t3_cache_valid();
/*!
Invalidates the cache.
*/
void invalidate_c2t3_cache();
/*!
Returns the cached number of facets of the complex incident to the vertex.
*/
int cached_number_of_incident_facets();
/*!
This method concerns the adjacency
graph of the facets of the complex incident to the vertex
and returns a cached value for the number of connected components this graph.
*/
int cached_number_of_components();
/// @}
}; /* end SimplicialMeshVertexBase_3 */

View File

@ -0,0 +1,12 @@
@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS}
PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Simplicial Mesh Data Structures"
#custom options
EXTRACT_ALL = false
HIDE_UNDOC_CLASSES = true
HIDE_UNDOC_MEMBERS = true
WARN_IF_UNDOCUMENTED = false
EXCLUDE = ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/internal/SMDS_3

View File

@ -0,0 +1,78 @@
/// \defgroup PkgSMDS3Ref 3D Simplicial Mesh Data Structures Reference
/// \defgroup PkgSMDS3Concepts Concepts
/// \ingroup PkgSMDS3Ref
/// The main concepts of this package.
/// \defgroup PkgSMDS3Classes Classes
/// \ingroup PkgSMDS3Ref
/// The classes describing a 3D simplicial mesh data structure.
/// \defgroup PkgSMDS3Functions Functions
/// \ingroup PkgSMDS3Ref
/// The functions to work with the 3D mesh data structures.
/// \defgroup PkgSMDS3ExportFunctions Export Functions
/// \ingroup PkgSMDS3Ref
/// The free functions that can be used to export meshes to given output file formats.
/// \defgroup PkgSMDS3IOFunctions Input/Output Functions
/// \ingroup PkgSMDS3Ref
/// The free functions that can be used to read and write meshes.
/*!
\addtogroup PkgSMDS3Ref
\cgalPkgDescriptionBegin{3D Simplicial Mesh Data Structure,PkgSMDS3}
\cgalPkgPicture{knot_small.png}
\cgalPkgSummaryBegin
\cgalPkgAuthors{Pierre Alliez, Clément Jamin, Laurent Rineau, Stéphane Tayeb, Jane Tournois, Mariette Yvinec}
\cgalPkgDesc{This package provides a data structure to store three-dimensional
simplicial meshes and their subcomplexes.
It provides an API for tetrahedral meshes generated with %CGAL or not,
to be processed with %CGAL 3D mesh generation and remeshing algorithms,
along with iterators, IO functions, and additional helper functions.
}
\cgalPkgManuals{Chapter_3D_Simplicial_Mesh_Data_Structure,PkgSMDS3Ref}
\cgalPkgSummaryEnd
\cgalPkgShortInfoBegin
\cgalPkgSince{5.6}
\cgalPkgDependsOn{\ref PkgTriangulation3}
\cgalPkgBib{cgal:ajrtty-mds3}
\cgalPkgLicense{\ref licensesGPL "GPL"}
\cgalPkgDemo{Polyhedron demo,polyhedron_3.zip}
\cgalPkgShortInfoEnd
\cgalPkgDescriptionEnd
\cgalClassifedRefPages
\cgalCRPSection{Concepts}
- `MeshComplex_3InTriangulation_3`
- `MeshComplexWithFeatures_3InTriangulation_3`
- `SimplicialMeshCellBase_3`
- `SimplicialMeshVertexBase_3`
\cgalCRPSection{Classes}
- `CGAL::Mesh_complex_3_in_triangulation_3`
- `CGAL::Simplicial_mesh_vertex_base_3`
- `CGAL::Simplicial_mesh_cell_base_3`
\cgalCRPSection{Function Templates}
- `CGAL::facets_in_complex_3_to_triangle_mesh()`
- `CGAL::tetrahedron_soup_to_triangulation_3()`
\cgalCRPSection{Input/Output Functions}
- `CGAL::IO::write_MEDIT()`
- `CGAL::IO::read_MEDIT()`
- `CGAL::IO::output_to_vtu()`
- `CGAL::IO::output_to_tetgen()`
- `CGAL::IO::save_binary_file()`
- `CGAL::IO::load_binary_file()`
- `CGAL::IO::output_to_medit()` (deprecated)
*/

Some files were not shown because too many files have changed in this diff Show More