cgal/Stream_support/include/CGAL/IO
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
..
3MF
LAS Spelling correction 2025-12-03 12:20:10 +01:00
OBJ
OFF Use CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT 2025-10-25 11:00:50 +01:00
OI issue #8515 Spelling mistakes found checking `en-GB` to `en-US` 2024-10-05 11:28:29 +02:00
PLY Fix a warning 2025-12-17 12:33:40 +01:00
STL
VRML issue #8515 Spelling mistakes found checking `en-GB` to `en-US` 2024-10-05 11:28:29 +02:00
VTK Mesh_2: Fixes of write_VTU 2025-03-07 07:37:28 +00:00
WKT
XYZ cleanup 2025-10-31 09:40:05 +01:00
3MF.h
Color.h Incorrect documentation of color components in Stream_support 2024-09-21 18:52:13 +02:00
GOCAD.h Apply suggestions from code review 2025-10-22 11:17:31 +02:00
Generic_writer.h Apply suggestions from code review 2025-10-22 11:17:31 +02:00
Istream_iterator.h
LAS.h Document a @param 2025-11-20 14:02:31 +00:00
OBJ.h merge cgal/main 2025-11-13 08:48:43 +00:00
OFF.h Merge remote-tracking branch 'cgal/main' into Point_set-reduce_dependencies-GF 2025-11-20 10:14:49 +00:00
OI.h
Ostream_iterator.h
PLY.h Fix anchor 2025-11-25 16:39:10 +00:00
STL.h robustify normal computation for STL 2025-10-30 12:03:22 +01:00
VRML.h
VTK.h include for boost range 2025-10-15 16:49:15 +02:00
Verbose_ostream.h
WKT.h Merge remote-tracking branch 'cgal/6.1.x-branch' into 'cgal/main' 2025-12-19 17:37:15 +01:00
XYZ.h cleanup 2025-10-31 09:40:05 +01:00
binary_file_io.h
helpers.h
io.h merge 2025-09-26 17:18:25 +01:00
io_tags.h rewrite/refactor a lot of the code 2025-01-22 16:03:26 +01:00
polygon_soup_io.h cleanup 2025-10-15 16:23:59 +01:00
read_las_points.h Move LAS 2025-10-30 14:51:26 +01:00
read_off_points.h R/W for points in OFF format is now in CGAL/IO/OFF.h 2025-10-25 09:58:21 +01:00
read_ply_points.h forward declarations must come first 2025-10-30 17:46:45 +01:00
read_points.h move read_points.h 2025-10-31 10:54:27 +01:00
read_xyz_points.h XYZ 2025-10-30 15:05:58 +01:00
trace.h
write_las_points.h Move LAS 2025-10-30 14:51:26 +01:00
write_off_points.h fix 2025-10-25 10:17:18 +01:00
write_ply_points.h Add forwarding include files 2025-10-24 15:49:55 +01:00
write_points.h move read_points.h 2025-10-31 10:54:27 +01:00
write_xyz_points.h XYZ 2025-10-30 15:05:58 +01:00