#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/write_ply_points.h>
#include <utility>
#include <vector>
#include <fstream>
typedef Kernel::FT FT;
typedef std::array<unsigned char, 4> Color;
typedef std::tuple<Point, Color, int> PCI;
template< class F >
struct Output_rep< ::Color, F > {
const ::Color& c;
static const bool is_specialized = true;
Output_rep (const ::Color& c) : c(c)
{ }
std::ostream&
operator() (std::ostream& out)
const
{
out << int(c[0]) << " " << int(c[1]) << " " << int(c[2]) << " " << int(c[3]);
else
out.write(reinterpret_cast<const char*>(&c), sizeof(c));
return out;
}
};
}
int main(int, char**)
{
std::vector<PCI> points;
for (int i = 0; i < 10; ++ i)
points.push_back (std::make_tuple (Point (i / 10., i / 20., i / 30.),
static_cast<unsigned char>(192 / (i + 1)),
static_cast<unsigned char>(128 / (i + 1)),
static_cast<unsigned char>(64 / (i + 1))),
i));
std::ofstream f("out.ply", std::ios::binary);
CGAL::make_ply_point_writer (Point_map()),
std::make_tuple(Color_map(),
return EXIT_SUCCESS;
}
std::ostream & operator()(std::ostream &os) const
bool write_PLY_with_properties(std::ostream &os, const PointRange &points, PropertyHandler &&... properties)
writes the range of points with properties using Polygon File Format (PLY).
Definition: write_ply_points.h:110
std::array< T, N > make_array(const T &...)
Mode set_binary_mode(std::ios &s)
bool is_ascii(std::ios &s)
Class used to identify a PLY property as a type and a name.
Definition: read_ply_points.h:51