13 #include <CGAL/boost/graph/internal/helpers.h>
14 #include <boost/graph/graph_traits.hpp>
15 #include <CGAL/boost/graph/iterator.h>
17 #include <CGAL/boost/graph/Euler_operations.h>
19 #include <CGAL/boost/graph/helpers.h>
42 template<
typename MutableFaceGraph,
typename Po
intMap >
47 typename boost::graph_traits< MutableFaceGraph >::halfedge_descriptor &h)
52 typedef boost::graph_traits< MutableFaceGraph > GraphTraits;
53 typedef typename GraphTraits::halfedge_descriptor halfedge_descriptor;
55 typedef typename GraphTraits::face_descriptor face_descriptor;
58 if(h == boost::graph_traits< MutableFaceGraph >::null_halfedge())
61 halfedge_descriptor opp_h =
opposite(h, g);
63 if(CGAL::is_border(h, g))
65 if(!CGAL::is_triangle(opp_h, g))
68 else if(CGAL::is_border(opp_h, g))
70 if(!CGAL::is_triangle(h, g))
75 if(!CGAL::is_triangle(h, g) || !CGAL::is_triangle(opp_h, g))
83 typedef CGAL::Halfedge_around_face_iterator< MutableFaceGraph >
84 Halfedge_around_face_iterator;
89 Point((gt.get_x(
get(pm, vs)) + gt.get_x(
get(pm, vt))) * 0.5f,
90 (gt.get_y(
get(pm, vs)) + gt.get_y(
get(pm, vt))) * 0.5f,
91 (gt.get_z(
get(pm, vs)) + gt.get_z(
get(pm, vt))) * 0.5f));
93 std::vector< vertex_descriptor > face_vertices;
96 if(CGAL::is_border(h, g))
101 halfedge_descriptor h1 =
next(opp_h, g), h2 =
prev(opp_h, g);
106 CGAL::internal::set_border(h1, g);
107 CGAL::internal::set_border(h2, g);
109 face_vertices.push_back(opp_v);
110 face_vertices.push_back(vt);
111 face_vertices.push_back(midpoint_vertex);
114 face_vertices.clear();
115 face_vertices.push_back(opp_v);
116 face_vertices.push_back(midpoint_vertex);
117 face_vertices.push_back(vs);
120 else if(CGAL::is_border(opp_h, g))
125 halfedge_descriptor h1 =
next(h, g), h2 =
prev(h, g);
130 CGAL::internal::set_border(h1, g);
131 CGAL::internal::set_border(h2, g);
133 face_vertices.push_back(opp_v);
134 face_vertices.push_back(vs);
135 face_vertices.push_back(midpoint_vertex);
137 face_vertices.clear();
138 face_vertices.push_back(opp_v);
139 face_vertices.push_back(midpoint_vertex);
140 face_vertices.push_back(vt);
147 halfedge_descriptor h1 =
next(h, g), h2 =
prev(h, g);
148 halfedge_descriptor h3 =
next(opp_h, g), h4 =
prev(opp_h, g);
150 CGAL::internal::set_border(h1, g);
151 CGAL::internal::set_border(h2,
155 CGAL::internal::set_border(h3, g);
156 CGAL::internal::set_border(h4, g);
158 face_vertices.push_back(vs);
159 face_vertices.push_back(midpoint_vertex);
160 face_vertices.push_back(
163 face_vertices.clear();
164 face_vertices.push_back(opp_v1);
165 face_vertices.push_back(midpoint_vertex);
166 face_vertices.push_back(vt);
169 Halfedge_around_face_iterator hi, he;
171 for(boost::tie(hi, he) = CGAL::halfedges_around_face(
halfedge(f1, g), g);
175 if(CGAL::is_border_edge(*hi, g))
178 CGAL::internal::set_border(
opposite(*hi, g), g);
179 auto h_if_exist =
halfedge(vs, opp_v2, g);
180 if(h_if_exist.second && (
target(*hi, g) == midpoint_vertex) &&
186 for(boost::tie(hi, he) = CGAL::halfedges_around_face(
halfedge(f2, g), g);
190 if(CGAL::is_border_edge(*hi, g))
193 CGAL::internal::set_border(
opposite(*hi, g), g);
194 auto h_if_exist =
halfedge(opp_v2, vt, g);
195 if(h_if_exist.second && (
source(*hi, g) == midpoint_vertex) &&
203 face_vertices.clear();
204 face_vertices.push_back(vt);
205 face_vertices.push_back(midpoint_vertex);
206 face_vertices.push_back(
209 for(boost::tie(hi, he) = CGAL::halfedges_around_face(
halfedge(f1, g), g);
213 if(CGAL::is_border_edge(*hi, g))
216 CGAL::internal::set_border(
opposite(*hi, g), g);
222 face_vertices.clear();
223 face_vertices.push_back(opp_v2);
224 face_vertices.push_back(midpoint_vertex);
225 face_vertices.push_back(vs);
227 for(boost::tie(hi, he) = CGAL::halfedges_around_face(
halfedge(f1, g), g);
231 if(CGAL::is_border_edge(*hi, g))
233 std::cout <<
"border!" << std::endl;