From ce1c890cb0ec71294a56f23199e9aa0a55b25ed4 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 10 Oct 2025 09:42:43 +0200 Subject: [PATCH] order of parameter for lcc vtk functions --- .../linear_cell_complex_3_vtk_io.cpp | 33 +++++++++++-------- .../include/CGAL/Linear_cell_complex/IO/VTK.h | 31 ++++++++--------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_vtk_io.cpp b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_vtk_io.cpp index d1c040ac29c..8bd7b39e38d 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_vtk_io.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_vtk_io.cpp @@ -1,26 +1,31 @@ #include #include -#include #include #include int main() { CGAL::Linear_cell_complex_for_combinatorial_map<3> lcc; - CGAL::load_combinatorial_map("data/beam-with-mixed-cells.3map", lcc); + std::ifstream is("data/beam-with-mixed-cells.3map"); + if(!is) + { + std::cout<<"Error opening data/beam-with-mixed-cells.3map."< volume_scalars; - for(auto it=lcc.template one_dart_per_cell<3>().begin(), - itend=lcc.template one_dart_per_cell<3>().end(); it!=itend; ++it) - { - std::size_t nbv=lcc.template one_dart_per_incident_cell<0,3>(it).size(); - volume_scalars.push_back(nbv); - } + is>>lcc; + // Compute per-volume vertex count + std::vector volume_scalars; + for(auto it=lcc.template one_dart_per_cell<3>().begin(), + itend=lcc.template one_dart_per_cell<3>().end(); it!=itend; ++it) + { + std::size_t nbv=lcc.template one_dart_per_incident_cell<0,3>(it).size(); + volume_scalars.push_back(nbv); + } - if(!CGAL::IO::write_VTK("beam-with-mixed-cells.vtk", lcc, nullptr, - &volume_scalars)) - { return EXIT_FAILURE; } + if(!CGAL::IO::write_VTK("beam-with-mixed-cells.vtk", lcc, nullptr, + &volume_scalars)) + { std::cout<<"Error for write_VTK."< -bool read_VTK(LCC& alcc, - const char* filename, +bool read_VTK(const char* filename, LCC& alcc, std::vector* vertex_scalars, std::vector* volume_scalars) { @@ -614,25 +613,21 @@ bool read_VTK(LCC& alcc, } template -bool read_VTK(LCC& alcc, - const char* filename) -{ return read_VTK - (alcc, filename, nullptr, nullptr); } +bool read_VTK(const char* filename, LCC& alcc) +{ return read_VTK(filename, alcc, nullptr, nullptr); } template -bool read_VTK(LCC& alcc, - const char* filename, - std::vector* vertex_scalars) +bool read_VTK(const char* filename, LCC& alcc, + std::vector* vertex_scalars) { return read_VTK - (alcc, filename, vertex_scalars, nullptr); } + (filename, alcc, vertex_scalars, nullptr); } template -bool read_VTK(LCC& alcc, - const char* filename, - std::nullptr_t, - std::vector* volume_scalars) +bool read_VTK(const char* filename, LCC& alcc, + std::nullptr_t, + std::vector* volume_scalars) { return read_VTK - (alcc, filename, nullptr, volume_scalars); } + (filename, alcc, nullptr, volume_scalars); } //////////////////////////////////////////////////////////////////////////////////// template inline bool write_VTK_with_fct(const char* filename, const LCC& alcc, @@ -691,14 +686,14 @@ bool write_VTK(const char* filename, const LCC& alcc, template bool write_VTK(const char* filename, const LCC& alcc) { - return write_VTK(alcc, filename, nullptr, nullptr); + return write_VTK(filename, alcc, nullptr, nullptr); } template bool write_VTK(const char* filename, const LCC& alcc, const std::vector* vertex_scalars) { - return write_VTK(alcc, filename, vertex_scalars, + return write_VTK(filename, alcc, vertex_scalars, nullptr); } @@ -707,7 +702,7 @@ bool write_VTK(const char* filename, const LCC& alcc, std::nullptr_t, const std::vector* volume_scalars) { - return write_VTK(alcc, filename, nullptr, + return write_VTK(filename, alcc, nullptr, volume_scalars); } ////////////////////////////////////////////////////////////////////////////////////