cgal/Stream_support
Sebastien Loriot 62a006b736
Fix writing 64 bits integer into PLY files (#9175)
## Summary of Changes

The PLY file format does not support 64 bits (signed/unsigned) integers.

In the overload of the writer specific to `Surface_mesh`, we try to
write all property maps with value types compatible with the PLY file
format (char, uchar, etc.).

We also tolerate 64 bits signed / unsigned integers, but used to cast it
to int32 / uint32:

```cpp
    {
      Int64_map pmap;
      boost::tie(pmap, okay) = sm.template property_map<Simplex,boost::int64_t>(prop[i]);
      if(okay)
      {
        os << "property int " << name << std::endl;
        printers.push_back(new internal::Simple_property_printer<Simplex,Int64_map,boost::int32_t>(pmap));
        continue;
      }
    }
```

In https://github.com/CGAL/cgal/pull/6575, the code was factorized, but
the conversion to 32 bits was accidentally lost
(aa9f5215c4).
Hence, we were writing 8 bytes values (while announcing 4 bytes values)
and writing a property map with value type a 64 bits integers (or a
range of 64 bits integers) would make the file unreadable.

The PR re-introduces the conversions, and also removes the recursion of
the function.

The bug is from CGAL 5.5, but we have recent changes to PLY I/O
introducing named parameters and whatnot that make it a little tedious
to backport so I will wait to see if there is a need.

## Release Management

* Affected package(s): `Surface_mesh`
* Issue(s) solved (if any): -
* Feature/Small Feature (if any): -
* License and copyright ownership: no change
2025-12-26 12:10:15 +01:00
..
benchmark/Stream_support update our CMake version 3.18...3.31 2025-02-04 14:32:37 +01:00
doc/Stream_support [Small Feature] VTK IO support for Linear_cell_complex (#8998) 2025-12-03 11:50:01 +01:00
examples/Stream_support The example can also read in a polygon with 3D points 2025-09-17 15:27:23 +01:00
include/CGAL Fix writing 64 bits integer into PLY files (#9175) 2025-12-26 12:10:15 +01:00
package_info/Stream_support Fix dependencies 2025-09-26 16:16:27 +01:00
test/Stream_support Merge remote-tracking branch 'cgal/main' into Point_set-reduce_dependencies-GF 2025-11-20 10:14:49 +00:00