1 #ifndef CGAL_SKIN_SURFACE_WRITER_H 2 #define CGAL_SKIN_SURFACE_WRITER_H 5 #include <CGAL/IO/Polyhedron_iostream.h> 6 #include <CGAL/subdivide_skin_surface_mesh_3.h> 7 #include <CGAL/Skin_surface_refinement_policy_3.h> 9 template <
class SkinSurface,
class Polyhedron>
11 void write_polyhedron_with_normals(SkinSurface &skin,
15 typedef typename Polyhedron::Vertex_iterator Vertex_iterator;
16 typedef typename Polyhedron::Facet_iterator Facet_iterator;
17 typedef typename Polyhedron::Halfedge_around_facet_circulator HFC;
18 typedef typename Polyhedron::Vertex_handle Vertex_handle;
19 typedef typename Polyhedron::Traits::Vector_3 Vector;
21 CGAL::Skin_surface_refinement_policy_3<SkinSurface, Polyhedron> policy(skin);
24 out <<
"NOFF " << p.size_of_vertices ()
25 <<
" " << p.size_of_facets()
26 <<
" " << p.size_of_halfedges()
32 for (Vertex_iterator vit = p.vertices_begin();
33 vit != p.vertices_end(); vit ++) {
34 Vector n = policy.normal(vit);
36 out << vit->point() <<
" " << n << std::endl;
40 CGAL::Inverse_index<Vertex_handle> index(p.vertices_begin(),
42 for(Facet_iterator fi = p.facets_begin();
43 fi != p.facets_end(); ++fi) {
44 HFC hc = fi->facet_begin();
46 std::size_t n = circulator_size(hc);
49 Vertex_handle vh = (*hc).vertex();
50 out <<
" " << index[vh];
51 }
while (++hc != hc_end);
56 #endif // CGAL_SKIN_SURFACE_WRITER_H