IO: read_PLY() for Epeck

This commit is contained in:
Andreas Fabri 2023-11-20 13:09:59 +00:00
parent b6d9c444f8
commit 2d72f21107
2 changed files with 29 additions and 1 deletions

View File

@ -253,6 +253,29 @@ public:
} }
}; };
template <typename Index, typename PropertyMap>
class Double_coordinate_printer
: public Abstract_property_printer<Index>
{
PropertyMap m_pmap;
public:
Double_coordinate_printer(const PropertyMap& pmap) : m_pmap(pmap) { }
virtual void print(std::ostream& stream, const Index& index)
{
write(stream, to_double(get(m_pmap, index).x()));
if (get_mode(stream) == CGAL::IO::ASCII) {
stream << " ";
}
write(stream, to_double(get(m_pmap, index).y()));
if (get_mode(stream) == CGAL::IO::ASCII) {
stream << " ";
}
write(stream, to_double(get(m_pmap, index).z()));
}
};
template <typename Index, template <typename Index,
typename PropertyMap, typename PropertyMap,
typename Type = typename boost::property_traits<PropertyMap>::value_type> typename Type = typename boost::property_traits<PropertyMap>::value_type>

View File

@ -449,14 +449,19 @@ bool fill_simplex_specific_header(std::ostream& os,
os << "property float x" << std::endl os << "property float x" << std::endl
<< "property float y" << std::endl << "property float y" << std::endl
<< "property float z" << std::endl; << "property float z" << std::endl;
printers.push_back(new Property_printer<VIndex, Point_map>(sm.points()));
} }
else else
{ {
os << "property double x" << std::endl os << "property double x" << std::endl
<< "property double y" << std::endl << "property double y" << std::endl
<< "property double z" << std::endl; << "property double z" << std::endl;
printers.push_back(new Double_coordinate_printer<VIndex, Point_map>(sm.points()));
} }
printers.push_back(new Property_printer<VIndex, Point_map>(sm.points()));
return true; return true;
} }