21 #ifndef EMODNET_QMGC_CGAL_SIMPLIFICATION_CONSTRAINED_BORDERS_H 22 #define EMODNET_QMGC_CGAL_SIMPLIFICATION_CONSTRAINED_BORDERS_H 24 #include "tin_creation/tin_creation_cgal_types.h" 35 template <
class Polyhedron>
38 typedef typename boost::graph_traits<Polyhedron>::edge_descriptor key_type ;
39 typedef bool value_type ;
40 typedef value_type reference ;
41 typedef boost::readable_property_map_tag category;
42 typedef typename Polyhedron::Point_3 Point_3;
44 const Polyhedron* m_pPolyPtr ;
45 const bool m_constrainEastBorder ;
46 const bool m_constrainWestBorder ;
47 const bool m_constrainNorthBorder ;
48 const bool m_constrainSouthBorder ;
51 const bool& constrainEastBorder =
true,
52 const bool& constrainWestBorder =
true,
53 const bool& constrainNorthBorder =
true,
54 const bool& constrainSouthBorder =
true )
56 , m_constrainEastBorder(constrainEastBorder)
57 , m_constrainWestBorder(constrainWestBorder)
58 , m_constrainNorthBorder(constrainNorthBorder)
59 , m_constrainSouthBorder(constrainSouthBorder) {}
63 bool isBorder = CGAL::is_border(edge, *m.m_pPolyPtr);
65 Point_3 p0 = edge.halfedge()->vertex()->point() ;
66 Point_3 p1 = edge.halfedge()->opposite()->vertex()->point() ;
68 double diffX = fabs( p1.x() - p0.x() ) ;
69 double diffY = fabs( p1.y() - p0.y() ) ;
71 return ( m.m_constrainEastBorder && diffX < diffY && p0.x() > 0.5 ) ||
72 ( m.m_constrainWestBorder && diffX < diffY && p0.x() < 0.5 ) ||
73 ( m.m_constrainNorthBorder && diffY < diffX && p0.y() > 0.5 ) ||
74 ( m.m_constrainSouthBorder && diffY < diffX && p0.y() < 0.5 ) ;
81 #endif //EMODNET_QMGC_CGAL_SIMPLIFICATION_CONSTRAINED_BORDERS_H Set of miscellaneous functions extending the functionality of the CGAL library.
bool isBorder(typename Polyhedron::Vertex_handle &v)
Checks if a vertex in the polyhedron is in the border.
Definition: cgal_utils.h:101
BGL property map indicating whether an edge is marked as non-removable.
Definition: border_edges_are_constrained_edge_map.h:36