mirror of https://github.com/CGAL/cgal
Use vertex_around_target (and add halfedge(vertex_descriptor)
This commit is contained in:
parent
3e6a99b327
commit
6899d73e71
|
|
@ -1,9 +1,11 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Triangulation_2.h>
|
||||
#include <CGAL/boost/graph/graph_traits_Triangulation_2.h>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
|
||||
#include <CGAL/boost/graph/dijkstra_shortest_paths.h>
|
||||
#include <boost/graph/filtered_graph.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
typedef K::Point_2 Point;
|
||||
|
|
@ -116,7 +118,14 @@ main(int,char*[])
|
|||
|
||||
typedef boost::property_map<Triangulation, boost::vertex_point_t>::type Ppmap;
|
||||
Ppmap ppmap = get(boost::vertex_point, t);
|
||||
|
||||
|
||||
BOOST_FOREACH(vertex_descriptor vd, vertices_around_target(*vertices(t).first, t)){
|
||||
std::cout << ppmap[vd] << std::endl;
|
||||
}
|
||||
|
||||
ppmap[*(++vertices(t).first)] = Point(78,12);
|
||||
std::cout << ppmap[*(++vertices(t).first)] << std::endl;
|
||||
std::cout << " changed point of vertex " << ppmap[*(++vertices(t).first)] << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -397,12 +397,26 @@ namespace CGAL {
|
|||
template <class Gt, class Tds>
|
||||
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor
|
||||
halfedge(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::face_descriptor f,
|
||||
const Triangulation_2<Gt,Tds>& g)
|
||||
const Triangulation_2<Gt,Tds>& g)
|
||||
{
|
||||
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor halfedge_descriptor;
|
||||
return halfedge_descriptor(f,0);
|
||||
}
|
||||
|
||||
|
||||
template <class Gt, class Tds>
|
||||
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor
|
||||
halfedge(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::vertex_descriptor v,
|
||||
const Triangulation_2<Gt,Tds>& g)
|
||||
{
|
||||
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor halfedge_descriptor;
|
||||
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::face_descriptor face_descriptor;
|
||||
face_descriptor fd = v->face();
|
||||
int i = fd->index(v);
|
||||
return halfedge_descriptor(fd,g.ccw(i));
|
||||
}
|
||||
|
||||
|
||||
template <class Gt, class Tds>
|
||||
inline std::pair<
|
||||
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::vertex_iterator,
|
||||
|
|
|
|||
Loading…
Reference in New Issue