mirror of https://github.com/CGAL/cgal
Mesh_2: Fixes of write_VTU
This commit is contained in:
parent
299a89f212
commit
1cecefe1c8
|
|
@ -6,6 +6,8 @@ namespace IO {
|
||||||
//!
|
//!
|
||||||
//! The faces output are those for which `DelaunayMeshFaceBase_2::is_in_domain()` returns `true`,
|
//! The faces output are those for which `DelaunayMeshFaceBase_2::is_in_domain()` returns `true`,
|
||||||
//! the edges are those for which `ConstrainedTriangulationFaceBase_2::is_constrained()` returns `true`.
|
//! the edges are those for which `ConstrainedTriangulationFaceBase_2::is_constrained()` returns `true`.
|
||||||
|
//!\attention To read a binary file, the flag `std::ios::binary` must be set during the creation of `os`.
|
||||||
|
//!
|
||||||
//! \tparam CDT a `Constrained_Delaunay_triangulation_2` with face type model of `DelaunayMeshFaceBase_2`.
|
//! \tparam CDT a `Constrained_Delaunay_triangulation_2` with face type model of `DelaunayMeshFaceBase_2`.
|
||||||
//!
|
//!
|
||||||
//! \param os the stream used for writing.
|
//! \param os the stream used for writing.
|
||||||
|
|
@ -23,9 +25,12 @@ void write_VTU(std::ostream& os,
|
||||||
//! \brief writes the faces of a domain and its constrained edges embedded in
|
//! \brief writes the faces of a domain and its constrained edges embedded in
|
||||||
//! a 2D constrained Delaunay triangulation using the `PolyData` XML
|
//! a 2D constrained Delaunay triangulation using the `PolyData` XML
|
||||||
//! format.
|
//! format.
|
||||||
//! The faces output are those for which `get(ipm, f)` returns
|
//! The faces output are those for which `get(ipm, f)` returns
|
||||||
//! `true` where `f` is a `CDT::Face_handle`,
|
//! `true` where `f` is a `CDT::Face_handle`,
|
||||||
//! the edges are those for which `ConstrainedTriangulationFaceBase_2::is_constrained()` returns `true`.
|
//! the edges are those for which `ConstrainedTriangulationFaceBase_2::is_constrained()` returns `true`.
|
||||||
|
//!
|
||||||
|
//!\attention To read a binary file, the flag `std::ios::binary` must be set during the creation of `os`.
|
||||||
|
//!
|
||||||
//! \tparam CDT a `Constrained_Delaunay_triangulation_2` with face
|
//! \tparam CDT a `Constrained_Delaunay_triangulation_2` with face
|
||||||
//! type model of `DelaunayMeshFaceBase_2`.
|
//! type model of `DelaunayMeshFaceBase_2`.
|
||||||
//! \tparam InDomainPmap a class model of `ReadWritePropertyMap` with
|
//! \tparam InDomainPmap a class model of `ReadWritePropertyMap` with
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ template <class FT>
|
||||||
void write_vector(std::ostream& os,
|
void write_vector(std::ostream& os,
|
||||||
const std::vector<FT>& vect)
|
const std::vector<FT>& vect)
|
||||||
{
|
{
|
||||||
|
if(vect.empty())
|
||||||
|
return;
|
||||||
const char* buffer = reinterpret_cast<const char*>(&(vect[0]));
|
const char* buffer = reinterpret_cast<const char*>(&(vect[0]));
|
||||||
std::size_t size = vect.size()*sizeof(FT);
|
std::size_t size = vect.size()*sizeof(FT);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue