write_vtu -> write_VTU

This commit is contained in:
Sébastien Loriot 2021-05-04 15:12:36 +02:00
parent 22be8671f7
commit 12f0e412b5
8 changed files with 23 additions and 17 deletions

View File

@ -24,7 +24,7 @@
#include <CGAL/Random.h> #include <CGAL/Random.h>
#include <CGAL/point_generators_2.h> #include <CGAL/point_generators_2.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
#include <CGAL/IO/write_vtu.h> #include <CGAL/IO/write_VTU.h>
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
#include <CGAL/IO/WKT.h> #include <CGAL/IO/WKT.h>
#endif #endif
@ -788,7 +788,7 @@ MainWindow::saveConstraints(QString fileName)
output << cdt; output << cdt;
else if (output) else if (output)
{ {
CGAL::IO::write_vtu(output, cdt); CGAL::IO::write_VTU(output, cdt);
} }
} }

View File

@ -10,11 +10,11 @@ namespace IO {
//! //!
//! \param os the stream used for writing. //! \param os the stream used for writing.
//! \param tr the triangulated domain to be written. //! \param tr the triangulated domain to be written.
//! \param mode decides if the data should be written in binary (`IO::BINARY`) //! \param mode decides if the data should be written in binary (`BINARY`)
//! or in ASCII (`IO::ASCII`). //! or in ASCII (`ASCII`).
//! //!
template <class CDT> template <class CDT>
void write_vtu(std::ostream& os, void write_VTU(std::ostream& os,
const CDT& tr, const CDT& tr,
IO::Mode mode = IO::BINARY); IO::Mode mode = IO::BINARY);
} } } }

View File

@ -328,7 +328,7 @@ in the Reference Manual.
\section secMesh_2_IO Input/Output \section secMesh_2_IO Input/Output
It is possible to export the result of a meshing in VTU, using the function `CGAL::IO::write_vtu()`. It is possible to export the result of a meshing in VTU, using the function `CGAL::IO::write_VTU()`.
For more information about this format, see \ref IOStreamVTK. For more information about this format, see \ref IOStreamVTK.
*/ */
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -64,7 +64,7 @@ The package can handle intersecting input constraints and set no restriction on
- `CGAL::lloyd_optimize_mesh_2` - `CGAL::lloyd_optimize_mesh_2`
\cgalCRPSection{I/O Functions} \cgalCRPSection{I/O Functions}
- `CGAL::IO::write_vtu()` - `CGAL::IO::write_VTU()`
\cgalCRPSection{Enumerations} \cgalCRPSection{Enumerations}
- `CGAL::Mesh_optimization_return_code` - `CGAL::Mesh_optimization_return_code`

View File

@ -301,10 +301,10 @@ write_attributes_2(std::ostream& os,
} }
template <class CDT> template <class CDT>
void write_vtu_with_attributes(std::ostream& os, void write_VTU_with_attributes(std::ostream& os,
const CDT& tr, const CDT& tr,
std::vector<std::pair<const char*, const std::vector<double>*> >& attributes, std::vector<std::pair<const char*, const std::vector<double>*> >& attributes,
IO::Mode mode = IO::BINARY) IO::Mode mode = BINARY)
{ {
typedef typename CDT::Vertex_handle Vertex_handle; typedef typename CDT::Vertex_handle Vertex_handle;
std::map<Vertex_handle, std::size_t> V; std::map<Vertex_handle, std::size_t> V;
@ -336,7 +336,7 @@ void write_vtu_with_attributes(std::ostream& os,
os << " <Piece NumberOfPoints=\"" << tr.number_of_vertices() os << " <Piece NumberOfPoints=\"" << tr.number_of_vertices()
<< "\" NumberOfCells=\"" << number_of_triangles + std::distance(tr.constrained_edges_begin(), tr.constrained_edges_end()) << "\">\n"; << "\" NumberOfCells=\"" << number_of_triangles + std::distance(tr.constrained_edges_begin(), tr.constrained_edges_end()) << "\">\n";
std::size_t offset = 0; std::size_t offset = 0;
const bool binary = (mode == IO::BINARY); const bool binary = (mode == BINARY);
write_cdt_points_tag(os,tr,V,binary,offset); write_cdt_points_tag(os,tr,V,binary,offset);
write_cells_tag_2(os,tr,number_of_triangles, V,binary,offset); write_cells_tag_2(os,tr,number_of_triangles, V,binary,offset);
if(attributes.empty()) if(attributes.empty())
@ -363,18 +363,24 @@ void write_vtu_with_attributes(std::ostream& os,
} // namespace internal } // namespace internal
template <class CDT> template <class CDT>
void write_vtu(std::ostream& os, void write_VTU(std::ostream& os,
const CDT& tr, const CDT& tr,
IO::Mode mode = BINARY) Mode mode = BINARY)
{ {
std::vector<std::pair<const char*, const std::vector<double>*> > dummy_atts; std::vector<std::pair<const char*, const std::vector<double>*> > dummy_atts;
internal::write_vtu_with_attributes(os, tr, dummy_atts, mode); internal::write_VTU_with_attributes(os, tr, dummy_atts, mode);
} }
} // namespace IO } // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE #ifndef CGAL_NO_DEPRECATED_CODE
using IO::write_vtu; template <class CDT>
void write_vtu(std::ostream& os,
const CDT& tr,
IO::Mode mode = IO::BINARY)
{
IO::write_VTU(os, tr, mode);
}
#endif #endif
} //end CGAL } //end CGAL

View File

@ -14,5 +14,5 @@ namespace IO {
template <class C3T3> template <class C3T3>
void output_to_vtu(std::ostream& os, void output_to_vtu(std::ostream& os,
const C3T3& c3t3, const C3T3& c3t3,
IO::Mode mode = IO::BINARY); IO::Mode mode = BINARY);
} } } }

View File

@ -125,7 +125,7 @@ template <typename PointRange,
// Write header // Write header
os << "ply" << std::endl os << "ply" << std::endl
<< ((get_mode(os) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl << ((get_mode(os) == BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl
<< "comment Generated by the CGAL library" << std::endl << "comment Generated by the CGAL library" << std::endl
<< "element vertex " << points.size() << std::endl; << "element vertex " << points.size() << std::endl;

View File

@ -474,7 +474,7 @@ A precise specification of those formats is available at
The following \cgal data structures can be exported into the `.VTU` file format: The following \cgal data structures can be exported into the `.VTU` file format:
- `CGAL::Mesh_complex_3_in_triangulation_3`, using \link PkgMesh3IOFunctions `CGAL::IO::output_to_vtu()` \endlink - `CGAL::Mesh_complex_3_in_triangulation_3`, using \link PkgMesh3IOFunctions `CGAL::IO::output_to_vtu()` \endlink
- `CGAL::Constrained_Delaunay_triangulation_2`, using the function \link PkgMesh2IO `CGAL::IO::write_vtu()` \endlink - `CGAL::Constrained_Delaunay_triangulation_2`, using the function \link PkgMesh2IO `CGAL::IO::write_VTU()` \endlink
\section IOStreamAvizo Avizo File Format \section IOStreamAvizo Avizo File Format