mirror of https://github.com/CGAL/cgal
IO: read_PLY() for Epeck
This commit is contained in:
parent
b6d9c444f8
commit
2d72f21107
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue