CGAL 6.2 - Linear Cell Complex: Linear_cell_complex/linear_cell_complex_3_vtk_io.cpp

CGAL 6.2 - Linear Cell Complex

Loading...
Searching...
No Matches
Linear_cell_complex/linear_cell_complex_3_vtk_io.cpp
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex/IO/VTK.h>
#include <vector>
#include <cstdlib>
int main()
{
CGAL::Linear_cell_complex_for_combinatorial_map<3> lcc;
std::ifstream is("data/beam-with-mixed-cells.3map");
if(!is)
{
std::cout<<"Error opening data/beam-with-mixed-cells.3map."<<std::endl;
return EXIT_FAILURE;
}
is>>lcc;
// Compute per-volume vertex count
std::vector<std::size_t> 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))
{
std::cout<<"Error for write_VTK."<<std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
CGAL::Linear_cell_complex_for_combinatorial_map
The class Linear_cell_complex_for_combinatorial_map represents a linear cell complex in dimension d,...
Definition: Linear_cell_complex_for_combinatorial_map.h:29
CGAL::IO::write_VTK
bool write_VTK(const char *filename, const LCC &alcc, const std::vector< VertexScalarType > *vertex_scalars=nullptr, const std::vector< VolumeScalarType > *volume_scalars=nullptr)
Writes a 3D Linear_cell_complex to a VTK legacy ASCII file.