mirror of https://github.com/CGAL/cgal
property map to get the target point of a halfedge
This commit is contained in:
parent
daca1eabbf
commit
aa97a337c7
|
|
@ -30,8 +30,7 @@ namespace CGAL{
|
||||||
//property map
|
//property map
|
||||||
template <class Polyhedron>
|
template <class Polyhedron>
|
||||||
struct Triangle_from_facet_property_map{
|
struct Triangle_from_facet_property_map{
|
||||||
Triangle_from_facet_property_map(){}
|
Triangle_from_facet_property_map(Polyhedron* = NULL){}
|
||||||
Triangle_from_facet_property_map(Polyhedron&){}
|
|
||||||
//classical typedefs
|
//classical typedefs
|
||||||
typedef typename boost::mpl::if_<
|
typedef typename boost::mpl::if_<
|
||||||
typename boost::is_const<Polyhedron>::type,
|
typename boost::is_const<Polyhedron>::type,
|
||||||
|
|
@ -59,6 +58,7 @@ get(const Triangle_from_facet_property_map<Polyhedron>&,
|
||||||
|
|
||||||
template <class Polyhedron>
|
template <class Polyhedron>
|
||||||
struct Segment_from_halfedge_property_map{
|
struct Segment_from_halfedge_property_map{
|
||||||
|
Segment_from_halfedge_property_map(Polyhedron* = NULL){}
|
||||||
//classical typedefs
|
//classical typedefs
|
||||||
typedef typename boost::mpl::if_<
|
typedef typename boost::mpl::if_<
|
||||||
typename boost::is_const<Polyhedron>::type,
|
typename boost::is_const<Polyhedron>::type,
|
||||||
|
|
@ -85,8 +85,7 @@ get(const Segment_from_halfedge_property_map<Polyhedron>&,
|
||||||
//property map to access a point from a Facet
|
//property map to access a point from a Facet
|
||||||
template <class Polyhedron>
|
template <class Polyhedron>
|
||||||
struct One_point_from_facet_property_map{
|
struct One_point_from_facet_property_map{
|
||||||
One_point_from_facet_property_map(){}
|
One_point_from_facet_property_map(Polyhedron* = NULL){}
|
||||||
One_point_from_facet_property_map(Polyhedron&){}
|
|
||||||
//classical typedefs
|
//classical typedefs
|
||||||
typedef typename boost::mpl::if_<
|
typedef typename boost::mpl::if_<
|
||||||
typename boost::is_const<Polyhedron>::type,
|
typename boost::is_const<Polyhedron>::type,
|
||||||
|
|
@ -106,6 +105,29 @@ get(const One_point_from_facet_property_map<Polyhedron>&,
|
||||||
return f.halfedge()->vertex()->point();
|
return f.halfedge()->vertex()->point();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//property map to access a point from a Halfedge
|
||||||
|
template <class Polyhedron>
|
||||||
|
struct One_point_from_halfedge_property_map{
|
||||||
|
One_point_from_halfedge_property_map(Polyhedron* = NULL){}
|
||||||
|
//classical typedefs
|
||||||
|
typedef typename boost::mpl::if_<
|
||||||
|
typename boost::is_const<Polyhedron>::type,
|
||||||
|
const typename Polyhedron::Halfedge,
|
||||||
|
typename Polyhedron::Halfedge >::type key_type;
|
||||||
|
typedef typename Polyhedron::Traits::Kernel::Point_3 value_type;
|
||||||
|
typedef const value_type& reference;
|
||||||
|
typedef boost::lvalue_property_map_tag category;
|
||||||
|
};
|
||||||
|
//get function for property map
|
||||||
|
template <class Polyhedron>
|
||||||
|
inline
|
||||||
|
typename One_point_from_halfedge_property_map<Polyhedron>::reference
|
||||||
|
get(const One_point_from_halfedge_property_map<Polyhedron>&,
|
||||||
|
typename One_point_from_halfedge_property_map<Polyhedron>::key_type& h)
|
||||||
|
{
|
||||||
|
return h.vertex()->point();
|
||||||
|
}
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
||||||
#endif //CGAL_POLYHEDRON_SIMPLEX_PROPERTY_MAP_H
|
#endif //CGAL_POLYHEDRON_SIMPLEX_PROPERTY_MAP_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue