21 #ifndef EMODNET_QMGC_CORNER_VERTICES_ARE_CONSTRAINED_VERTEX_MAP_H 22 #define EMODNET_QMGC_CORNER_VERTICES_ARE_CONSTRAINED_VERTEX_MAP_H 24 #include "tin_creation/tin_creation_cgal_types.h" 36 template <
class Polyhedron>
39 typedef typename boost::graph_traits<Polyhedron>::vertex_descriptor key_type;
40 typedef typename boost::graph_traits<Polyhedron>::halfedge_descriptor HalfedgeDescriptor;
41 typedef bool value_type;
42 typedef value_type reference;
43 typedef typename Polyhedron::Point_3 Point_3;
45 const Polyhedron *m_pPolyPtr;
52 boost::optional<HalfedgeDescriptor> he = CGAL::is_border( vertex, *m.m_pPolyPtr ) ;
56 if ( (*he)->next()->is_border() ) {
60 Point_3 p0 = vertex->point() ;
61 Point_3 p1 = (*he)->opposite()->vertex()->point() ;
64 double diffX = fabs( p1.x() - p0.x() ) ;
65 double diffY = fabs( p1.y() - p0.y() ) ;
67 Point_3 p2 = (*he)->next()->vertex()->point() ;
69 double diffXNext = fabs( p2.x() - p0.x() ) ;
70 double diffYNext = fabs( p2.y() - p0.y() ) ;
72 return ( ( diffX < diffY ) && ( diffXNext > diffYNext ) ) ||
73 ( ( diffX > diffY ) && ( diffXNext < diffYNext ) ) ;
85 #endif // EMODNET_QMGC_CORNER_VERTICES_ARE_CONSTRAINED_VERTEX_MAP_H BGL property map indicating whether a given vertex is one of the 4 corners of the tile...
Definition: corner_vertices_are_constrained_vertex_map.h:37
Set of miscellaneous functions extending the functionality of the CGAL library.