cgal/Stream_support/include/CGAL
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
..
IO Fix writing 64 bits integer into PLY files (#9175) 2025-12-26 12:10:15 +01:00
Stream_support/internal fix macro name 2025-12-15 10:55:53 +00:00