#include #include #include #include #include #include typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Polyhedron_3 Polyhedron; typedef boost::graph_traits GraphTraits; typedef GraphTraits::vertex_descriptor vertex_descriptor; typedef GraphTraits::halfedge_descriptor halfedge_descriptor; typedef CGAL::Halfedge_around_target_iterator halfedge_around_target_iterator; template struct Source { const G* g; Source() : g(nullptr) {} Source(const G& g) : g(&g) {} typedef typename boost::graph_traits::vertex_descriptor result_type; typedef typename boost::graph_traits::halfedge_descriptor argument_type; result_type operator()(argument_type h) const { return source(h, *g); } }; int main(int argc, char** argv) { std::ifstream in((argc>1)?argv[1]:CGAL::data_file_path("meshes/cube_poly.off")); Polyhedron P; in >> P; GraphTraits::vertex_descriptor vd = *(vertices(P).first); typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; halfedge_around_target_iterator hb,he; std::tie(hb,he) = halfedges_around_target(halfedge(vd,P),P); adjacent_vertex_iterator avib, avie; avib = boost::make_transform_iterator(hb, Source(P)); avie = boost::make_transform_iterator(he, Source(P)); std::list V; std::copy(avib,avie, std::back_inserter(V)); return 0; }