mirror of https://github.com/CGAL/cgal
Made all members of the cell-extension records unique (e.g., added 'env_'); this enables the simultaneous extensions required by other packages; for example, having a lower envelope diagram with history.
This commit is contained in:
parent
09761aa0c3
commit
b6fb9a5aa1
File diff suppressed because it is too large
Load Diff
|
|
@ -166,21 +166,21 @@ public:
|
||||||
// get a face with 2 surfaces defined over it, and compute the arrangement
|
// get a face with 2 surfaces defined over it, and compute the arrangement
|
||||||
// of the/ envelope of these surfaces over the face
|
// of the/ envelope of these surfaces over the face
|
||||||
void resolve(Face_handle face, Minimization_diagram_2& result) {
|
void resolve(Face_handle face, Minimization_diagram_2& result) {
|
||||||
CGAL_assertion(face->get_aux_is_set(0));
|
CGAL_assertion(face->aux_is_set(0));
|
||||||
CGAL_assertion(face->get_aux_is_set(1));
|
CGAL_assertion(face->aux_is_set(1));
|
||||||
|
|
||||||
// we are interested with the envelope's shape over the current face,
|
// we are interested with the envelope's shape over the current face,
|
||||||
// so we only need to check the first surface from each group, since
|
// so we only need to check the first surface from each group, since
|
||||||
// all the surfaces in a group overlap over the current face.
|
// all the surfaces in a group overlap over the current face.
|
||||||
const Xy_monotone_surface_3& surf1 = get_aux_surface(face, 0);
|
const Xy_monotone_surface_3& surf1 = aux_surface(face, 0);
|
||||||
const Xy_monotone_surface_3& surf2 = get_aux_surface(face, 1);
|
const Xy_monotone_surface_3& surf2 = aux_surface(face, 1);
|
||||||
|
|
||||||
// find the projected intersections of the surfaces. if none - we have
|
// find the projected intersections of the surfaces. if none - we have
|
||||||
// a simple case:
|
// a simple case:
|
||||||
// need only resolve non-intersecting and return
|
// need only resolve non-intersecting and return
|
||||||
std::list<std::variant<Intersection_curve, Point_2>> inter_objs;
|
std::list<std::variant<Intersection_curve, Point_2>> inter_objs;
|
||||||
|
|
||||||
get_projected_intersections(surf1, surf2, std::back_inserter(inter_objs));
|
projected_intersections(surf1, surf2, std::back_inserter(inter_objs));
|
||||||
|
|
||||||
if (inter_objs.size() == 0) {
|
if (inter_objs.size() == 0) {
|
||||||
// here for resolve we can compare the surfaces over the edges only
|
// here for resolve we can compare the surfaces over the edges only
|
||||||
|
|
@ -234,7 +234,7 @@ public:
|
||||||
// projected intersection that created it.
|
// projected intersection that created it.
|
||||||
Halfedges_w_type_list result_new_edges;
|
Halfedges_w_type_list result_new_edges;
|
||||||
// 3. the collection of faces that form the face before any insertion
|
// 3. the collection of faces that form the face before any insertion
|
||||||
Faces_list result_face_parts;
|
Faces_list result_face_parts;
|
||||||
// 4. the collection of special vertices, which contains:
|
// 4. the collection of special vertices, which contains:
|
||||||
// - new vertices that were created inside the original face
|
// - new vertices that were created inside the original face
|
||||||
// (both isolated and not isolated)
|
// (both isolated and not isolated)
|
||||||
|
|
@ -289,8 +289,7 @@ public:
|
||||||
|
|
||||||
// in order to use resolve_minimal_face with intersection halfedge, we
|
// in order to use resolve_minimal_face with intersection halfedge, we
|
||||||
// go over the new edges, and set data over their faces
|
// go over the new edges, and set data over their faces
|
||||||
typename Halfedges_w_type_list::iterator new_edge_it;
|
for (auto new_edge_it = result_new_edges.begin();
|
||||||
for (new_edge_it = result_new_edges.begin();
|
|
||||||
new_edge_it != result_new_edges.end(); ++new_edge_it) {
|
new_edge_it != result_new_edges.end(); ++new_edge_it) {
|
||||||
Halfedge_handle new_he = (*new_edge_it).first;
|
Halfedge_handle new_he = (*new_edge_it).first;
|
||||||
Halfedge_handle new_he_twin = new_he->twin();
|
Halfedge_handle new_he_twin = new_he->twin();
|
||||||
|
|
@ -298,10 +297,10 @@ public:
|
||||||
Multiplicity itype = (*new_edge_it).second;
|
Multiplicity itype = (*new_edge_it).second;
|
||||||
#endif
|
#endif
|
||||||
// set sources of the new edge
|
// set sources of the new edge
|
||||||
new_he->set_aux_source(0, face->get_aux_source(0));
|
new_he->set_aux_source(0, face->aux_source(0));
|
||||||
new_he->set_aux_source(1, face->get_aux_source(1));
|
new_he->set_aux_source(1, face->aux_source(1));
|
||||||
new_he_twin->set_aux_source(0, face->get_aux_source(0));
|
new_he_twin->set_aux_source(0, face->aux_source(0));
|
||||||
new_he_twin->set_aux_source(1, face->get_aux_source(1));
|
new_he_twin->set_aux_source(1, face->aux_source(1));
|
||||||
|
|
||||||
// set data on new edges
|
// set data on new edges
|
||||||
new_he->set_decision(EQUAL);
|
new_he->set_decision(EQUAL);
|
||||||
|
|
@ -312,7 +311,7 @@ public:
|
||||||
// to f1, not only the opposite
|
// to f1, not only the opposite
|
||||||
Face_handle f1 = new_he->face(), f2 = new_he_twin->face();
|
Face_handle f1 = new_he->face(), f2 = new_he_twin->face();
|
||||||
Comparison_result res;
|
Comparison_result res;
|
||||||
if (! f1->is_decision_set() && !f2->is_decision_set()) {
|
if (! f1->is_decision_set() && ! f2->is_decision_set()) {
|
||||||
res = resolve_minimal_face(f1, &new_he);
|
res = resolve_minimal_face(f1, &new_he);
|
||||||
copy_data_by_comparison_result(face, f1, res);
|
copy_data_by_comparison_result(face, f1, res);
|
||||||
}
|
}
|
||||||
|
|
@ -324,7 +323,7 @@ public:
|
||||||
if (! f2->is_decision_set()) {
|
if (! f2->is_decision_set()) {
|
||||||
#ifdef CGAL_ENVELOPE_SAVE_COMPARISONS
|
#ifdef CGAL_ENVELOPE_SAVE_COMPARISONS
|
||||||
if (itype != 0) {
|
if (itype != 0) {
|
||||||
res = convert_decision_to_comparison_result(f1->get_decision());
|
res = convert_decision_to_comparison_result(f1->decision());
|
||||||
res = resolve_by_intersection_type(res, itype);
|
res = resolve_by_intersection_type(res, itype);
|
||||||
CGAL_expensive_assertion_code
|
CGAL_expensive_assertion_code
|
||||||
(Comparison_result tmp_res =
|
(Comparison_result tmp_res =
|
||||||
|
|
@ -340,7 +339,7 @@ public:
|
||||||
if (! f1->is_decision_set()) {
|
if (! f1->is_decision_set()) {
|
||||||
#ifdef CGAL_ENVELOPE_SAVE_COMPARISONS
|
#ifdef CGAL_ENVELOPE_SAVE_COMPARISONS
|
||||||
if (itype != 0) {
|
if (itype != 0) {
|
||||||
res = convert_decision_to_comparison_result(f2->get_decision());
|
res = convert_decision_to_comparison_result(f2->decision());
|
||||||
res = resolve_by_intersection_type(res, itype);
|
res = resolve_by_intersection_type(res, itype);
|
||||||
CGAL_expensive_assertion_code
|
CGAL_expensive_assertion_code
|
||||||
(Comparison_result tmp_res = resolve_minimal_face(f1, &new_he));
|
(Comparison_result tmp_res = resolve_minimal_face(f1, &new_he));
|
||||||
|
|
@ -357,8 +356,7 @@ public:
|
||||||
// we also need to check the faces incident to the halfedges in
|
// we also need to check the faces incident to the halfedges in
|
||||||
// special_edges since the envelope data over them should be computed
|
// special_edges since the envelope data over them should be computed
|
||||||
// using compare_left/right versions
|
// using compare_left/right versions
|
||||||
Halfedges_list_iterator special_edge_it;
|
for (auto special_edge_it = result_special_edges.begin();
|
||||||
for (special_edge_it = result_special_edges.begin();
|
|
||||||
special_edge_it != result_special_edges.end(); ++special_edge_it) {
|
special_edge_it != result_special_edges.end(); ++special_edge_it) {
|
||||||
// we assume that the halfedge given points to the correct face
|
// we assume that the halfedge given points to the correct face
|
||||||
// (which is inside the original face)
|
// (which is inside the original face)
|
||||||
|
|
@ -372,17 +370,17 @@ public:
|
||||||
// take care for the edge, if necessary
|
// take care for the edge, if necessary
|
||||||
if (! special_he->is_decision_set() &&
|
if (! special_he->is_decision_set() &&
|
||||||
can_copy_decision_from_face_to_edge(special_he)) {
|
can_copy_decision_from_face_to_edge(special_he)) {
|
||||||
// if (!special_he->get_aux_is_set(0) || !special_he->get_aux_is_set(1))
|
// if (!special_he->aux_is_set(0) || !special_he->aux_is_set(1))
|
||||||
// {
|
// {
|
||||||
// // this can only happen when the edge is fake, since the edge is on
|
// // this can only happen when the edge is fake, since the edge is on
|
||||||
//// the face's boundary
|
//// the face's boundary
|
||||||
// CGAL_assertion(special_he->get_is_fake());
|
// CGAL_assertion(special_he->is_fake());
|
||||||
// special_he->set_aux_source(0, face->get_aux_source(0));
|
// special_he->set_aux_source(0, face->aux_source(0));
|
||||||
// special_he->set_aux_source(1, face->get_aux_source(1));
|
// special_he->set_aux_source(1, face->aux_source(1));
|
||||||
// special_he->twin()->set_aux_source(0, face->get_aux_source(0));
|
// special_he->twin()->set_aux_source(0, face->aux_source(0));
|
||||||
// special_he->twin()->set_aux_source(1, face->get_aux_source(1));
|
// special_he->twin()->set_aux_source(1, face->aux_source(1));
|
||||||
// }
|
// }
|
||||||
//if (special_he->get_is_fake())
|
//if (special_he->is_fake())
|
||||||
//{
|
//{
|
||||||
// // this edge is not fake anymore, as it coincides with a projected
|
// // this edge is not fake anymore, as it coincides with a projected
|
||||||
// // intersection
|
// // intersection
|
||||||
|
|
@ -400,22 +398,19 @@ public:
|
||||||
++special_vertex_it) {
|
++special_vertex_it) {
|
||||||
Vertex_handle special_v = *special_vertex_it;
|
Vertex_handle special_v = *special_vertex_it;
|
||||||
if (! special_v->is_decision_set()) {
|
if (! special_v->is_decision_set()) {
|
||||||
if (special_v->get_aux_is_set(0) && special_v->get_aux_is_set(1))
|
if (special_v->aux_is_set(0) && special_v->aux_is_set(1))
|
||||||
set_data_by_comparison_result(special_v, EQUAL);
|
set_data_by_comparison_result(special_v, EQUAL);
|
||||||
else
|
else
|
||||||
// this is a new vertex inside the face, so we need to update its
|
// this is a new vertex inside the face, so we need to update its
|
||||||
// aux source information from face also (done in method)
|
// aux source information from face also (done in method)
|
||||||
copy_all_data_to_vertex(face, special_v);
|
copy_all_data_to_vertex(face, special_v);
|
||||||
}
|
}
|
||||||
else
|
else CGAL_assertion(special_v->aux_is_set(0) && special_v->aux_is_set(1));
|
||||||
CGAL_assertion(special_v->get_aux_is_set(0) && \
|
|
||||||
special_v->get_aux_is_set(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// assert all new faces got data set, if not, then maybe no curve cuts
|
// assert all new faces got data set, if not, then maybe no curve cuts
|
||||||
// the face, and should use regular resolve_minimal_face
|
// the face, and should use regular resolve_minimal_face
|
||||||
typename std::list<Face_handle>::iterator new_face_it;
|
for (auto new_face_it = result_face_parts.begin();
|
||||||
for (new_face_it = result_face_parts.begin();
|
|
||||||
new_face_it != result_face_parts.end(); ++new_face_it) {
|
new_face_it != result_face_parts.end(); ++new_face_it) {
|
||||||
Face_handle new_face = *new_face_it;
|
Face_handle new_face = *new_face_it;
|
||||||
if (! new_face->is_decision_set()) {
|
if (! new_face->is_decision_set()) {
|
||||||
|
|
@ -433,12 +428,12 @@ public:
|
||||||
// get an edge with 2 surfaces defined over it, and split it to get the shape
|
// get an edge with 2 surfaces defined over it, and split it to get the shape
|
||||||
// of the envelope of these surfaces over the edge
|
// of the envelope of these surfaces over the edge
|
||||||
void resolve(Halfedge_handle edge, Minimization_diagram_2& result) {
|
void resolve(Halfedge_handle edge, Minimization_diagram_2& result) {
|
||||||
const Xy_monotone_surface_3& surf1 = get_aux_surface(edge, 0);
|
const Xy_monotone_surface_3& surf1 = aux_surface(edge, 0);
|
||||||
const Xy_monotone_surface_3& surf2 = get_aux_surface(edge, 1);
|
const Xy_monotone_surface_3& surf2 = aux_surface(edge, 1);
|
||||||
|
|
||||||
// find the projected intersections
|
// find the projected intersections
|
||||||
std::list<std::variant<Intersection_curve, Point_2>> inter_objs;
|
std::list<std::variant<Intersection_curve, Point_2>> inter_objs;
|
||||||
get_projected_intersections(surf1, surf2, std::back_inserter(inter_objs));
|
projected_intersections(surf1, surf2, std::back_inserter(inter_objs));
|
||||||
|
|
||||||
if (inter_objs.size() == 0) {
|
if (inter_objs.size() == 0) {
|
||||||
resolve_minimal_edge(edge, edge);
|
resolve_minimal_edge(edge, edge);
|
||||||
|
|
@ -560,8 +555,7 @@ public:
|
||||||
(original_src->is_at_open_boundary() && is_min_end_at_inf))
|
(original_src->is_at_open_boundary() && is_min_end_at_inf))
|
||||||
{
|
{
|
||||||
source_is_special = true;
|
source_is_special = true;
|
||||||
if (split_points.front().third == true)
|
if (split_points.front().third == true) ++overlaps;
|
||||||
overlaps++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if target is a special vertex, by checking the last point in
|
// check if target is a special vertex, by checking the last point in
|
||||||
|
|
@ -687,8 +681,8 @@ public:
|
||||||
void resolve(Vertex_handle vertex) {
|
void resolve(Vertex_handle vertex) {
|
||||||
// it is enough to compare only one surface from each group (because they
|
// it is enough to compare only one surface from each group (because they
|
||||||
// all overlap over the vertex), but set all the group
|
// all overlap over the vertex), but set all the group
|
||||||
const Xy_monotone_surface_3& surf1 = get_aux_surface(vertex, 0);
|
const Xy_monotone_surface_3& surf1 = aux_surface(vertex, 0);
|
||||||
const Xy_monotone_surface_3& surf2 = get_aux_surface(vertex, 1);
|
const Xy_monotone_surface_3& surf2 = aux_surface(vertex, 1);
|
||||||
const Point_2& point_2 = vertex->point();
|
const Point_2& point_2 = vertex->point();
|
||||||
Comparison_result cur_res =
|
Comparison_result cur_res =
|
||||||
compare_distance_to_envelope(point_2, surf1, surf2);
|
compare_distance_to_envelope(point_2, surf1, surf2);
|
||||||
|
|
@ -754,8 +748,8 @@ protected:
|
||||||
|
|
||||||
if (success) return res;
|
if (success) return res;
|
||||||
|
|
||||||
const Xy_monotone_surface_3& surf1 = get_aux_surface(face, 0);
|
const Xy_monotone_surface_3& surf1 = aux_surface(face, 0);
|
||||||
const Xy_monotone_surface_3& surf2 = get_aux_surface(face, 1);
|
const Xy_monotone_surface_3& surf2 = aux_surface(face, 1);
|
||||||
|
|
||||||
Ccb_halfedge_circulator hec;
|
Ccb_halfedge_circulator hec;
|
||||||
if (he == nullptr) {
|
if (he == nullptr) {
|
||||||
|
|
@ -767,7 +761,7 @@ protected:
|
||||||
Ccb_halfedge_circulator curr = hec;
|
Ccb_halfedge_circulator curr = hec;
|
||||||
do {
|
do {
|
||||||
Halfedge_handle he = hec;
|
Halfedge_handle he = hec;
|
||||||
if(he->is_fictitious()) ++hec;
|
if (he->is_fictitious()) ++hec;
|
||||||
else {
|
else {
|
||||||
found_edge = true;
|
found_edge = true;
|
||||||
const X_monotone_curve_2& cv = hec->curve();
|
const X_monotone_curve_2& cv = hec->curve();
|
||||||
|
|
@ -775,7 +769,7 @@ protected:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(curr != hec);
|
while (curr != hec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! found_edge) {
|
if (! found_edge) {
|
||||||
|
|
@ -801,7 +795,7 @@ protected:
|
||||||
CGAL_assertion_code(Ccb_halfedge_circulator hec_begin = hec;
|
CGAL_assertion_code(Ccb_halfedge_circulator hec_begin = hec;
|
||||||
++hec;
|
++hec;
|
||||||
while (hec != hec_begin) {
|
while (hec != hec_begin) {
|
||||||
if(hec->is_fictitious()) {
|
if (hec->is_fictitious()) {
|
||||||
++hec;
|
++hec;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -857,9 +851,9 @@ protected:
|
||||||
// find intersections between 2 xy-monotone surfaces
|
// find intersections between 2 xy-monotone surfaces
|
||||||
// use caching for repeating questions of same pair of surfaces
|
// use caching for repeating questions of same pair of surfaces
|
||||||
template <typename OutputIterator>
|
template <typename OutputIterator>
|
||||||
OutputIterator get_projected_intersections(const Xy_monotone_surface_3& s1,
|
OutputIterator projected_intersections(const Xy_monotone_surface_3& s1,
|
||||||
const Xy_monotone_surface_3& s2,
|
const Xy_monotone_surface_3& s2,
|
||||||
OutputIterator o) {
|
OutputIterator o) {
|
||||||
return m_traits->construct_projected_intersections_2_object()(s1, s2, o);
|
return m_traits->construct_projected_intersections_2_object()(s1, s2, o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -893,9 +887,8 @@ protected:
|
||||||
|
|
||||||
// helper method to get the surfaces we need to work on
|
// helper method to get the surfaces we need to work on
|
||||||
template <typename FeatureHandle>
|
template <typename FeatureHandle>
|
||||||
const Xy_monotone_surface_3& get_aux_surface(FeatureHandle fh,
|
const Xy_monotone_surface_3& aux_surface(FeatureHandle fh, unsigned int id) {
|
||||||
unsigned int id) {
|
const Object& o = fh->aux_source(id);
|
||||||
const Object& o = fh->get_aux_source(id);
|
|
||||||
CGAL_assertion(!o.is_empty());
|
CGAL_assertion(!o.is_empty());
|
||||||
|
|
||||||
// aux source of a face must be a face!
|
// aux source of a face must be a face!
|
||||||
|
|
@ -904,30 +897,30 @@ protected:
|
||||||
// this is why we start with a check for a face, then halfedge
|
// this is why we start with a check for a face, then halfedge
|
||||||
// and last vertex
|
// and last vertex
|
||||||
Face_handle f;
|
Face_handle f;
|
||||||
if (assign(f, o)) return f->get_env_data();
|
if (assign(f, o)) return f->env_data_front();
|
||||||
|
|
||||||
Halfedge_handle h;
|
Halfedge_handle h;
|
||||||
if (assign(h, o)) return h->get_env_data();
|
if (assign(h, o)) return h->env_data_front();
|
||||||
|
|
||||||
Vertex_handle v;
|
Vertex_handle v;
|
||||||
CGAL_assertion_code(bool b =)
|
CGAL_assertion_code(bool b =)
|
||||||
assign(v, o);
|
assign(v, o);
|
||||||
CGAL_assertion(b);
|
CGAL_assertion(b);
|
||||||
return v->get_env_data();
|
return v->env_data_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool can_copy_decision_from_face_to_edge(Halfedge_handle h) {
|
bool can_copy_decision_from_face_to_edge(Halfedge_handle h) {
|
||||||
// can copy decision from face to its incident edge if the aux
|
// can copy decision from face to its incident edge if the aux
|
||||||
// envelopes are continuous over the face and edge
|
// envelopes are continuous over the face and edge
|
||||||
return (h->get_has_equal_aux_data_in_face(0) &&
|
return (h->has_equal_aux_data_in_face(0) &&
|
||||||
h->get_has_equal_aux_data_in_face(1));
|
h->has_equal_aux_data_in_face(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool can_copy_decision_from_edge_to_vertex(Halfedge_handle h) {
|
bool can_copy_decision_from_edge_to_vertex(Halfedge_handle h) {
|
||||||
// can copy decision from face to its incident edge if the aux
|
// can copy decision from face to its incident edge if the aux
|
||||||
// envelopes are continuous over the face and edge
|
// envelopes are continuous over the face and edge
|
||||||
return (h->get_has_equal_aux_data_in_target(0) &&
|
return (h->has_equal_aux_data_in_target(0) &&
|
||||||
h->get_has_equal_aux_data_in_target(1));
|
h->has_equal_aux_data_in_target(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -957,7 +950,7 @@ protected:
|
||||||
if (! vh->is_decision_set() && has_equal_aux_data_with_face(vh))
|
if (! vh->is_decision_set() && has_equal_aux_data_with_face(vh))
|
||||||
// can copy the data from the face, since we already took care of
|
// can copy the data from the face, since we already took care of
|
||||||
// the vertices of projected intersections
|
// the vertices of projected intersections
|
||||||
vh->set_decision(face->get_decision());
|
vh->set_decision(face->decision());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -966,21 +959,18 @@ protected:
|
||||||
Ccb_halfedge_circulator hec_begin = hec;
|
Ccb_halfedge_circulator hec_begin = hec;
|
||||||
do {
|
do {
|
||||||
Halfedge_handle hh = hec;
|
Halfedge_handle hh = hec;
|
||||||
if (hh->is_fictitious()) {
|
if (hh->is_fictitious()) continue;
|
||||||
++hec;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
CGAL_assertion(face == hh->face());
|
CGAL_assertion(face == hh->face());
|
||||||
// if it is a vertical decomposition edge, copy data from face
|
// if it is a vertical decomposition edge, copy data from face
|
||||||
/*if (!hh->is_decision_set() && hh->get_is_fake())
|
/* if (!hh->is_decision_set() && hh->is_fake()) {
|
||||||
{
|
* hh->set_decision(face->decision());
|
||||||
hh->set_decision(face->get_decision());
|
* hh->twin()->set_decision(face->decision());
|
||||||
hh->twin()->set_decision(face->get_decision());
|
* }
|
||||||
}*/
|
*/
|
||||||
if (! hh->is_decision_set() && can_copy_decision_from_face_to_edge(hh)) {
|
if (! hh->is_decision_set() && can_copy_decision_from_face_to_edge(hh)) {
|
||||||
// copy the decision from face to the edge
|
// copy the decision from face to the edge
|
||||||
hh->set_decision(face->get_decision());
|
hh->set_decision(face->decision());
|
||||||
hh->twin()->set_decision(hh->get_decision());
|
hh->twin()->set_decision(hh->decision());
|
||||||
}
|
}
|
||||||
// TODO: is this correct? shouldn't we split the edge first?
|
// TODO: is this correct? shouldn't we split the edge first?
|
||||||
// I think it is correct, because there is no intersection (of
|
// I think it is correct, because there is no intersection (of
|
||||||
|
|
@ -992,19 +982,18 @@ protected:
|
||||||
// from the face to the edge, the envelope goes closer), then if the
|
// from the face to the edge, the envelope goes closer), then if the
|
||||||
// second map wins on the face, it wins on the edge also
|
// second map wins on the face, it wins on the edge also
|
||||||
else if (! hh->is_decision_set() &&
|
else if (! hh->is_decision_set() &&
|
||||||
face->get_decision() == DAC_DECISION_SECOND &&
|
face->decision() == DAC_DECISION_SECOND &&
|
||||||
hh->get_has_equal_aux_data_in_face(0) &&
|
hh->has_equal_aux_data_in_face(0) &&
|
||||||
! hh->get_has_equal_aux_data_in_face(1)) {
|
! hh->has_equal_aux_data_in_face(1)) {
|
||||||
hh->set_decision(DAC_DECISION_SECOND);
|
hh->set_decision(DAC_DECISION_SECOND);
|
||||||
hh->twin()->set_decision(DAC_DECISION_SECOND);
|
hh->twin()->set_decision(DAC_DECISION_SECOND);
|
||||||
|
|
||||||
}
|
}
|
||||||
// if the second map is continuous, but the first isn't, then if the
|
// if the second map is continuous, but the first isn't, then if the
|
||||||
// first map wins on the face, it wins on the edge also
|
// first map wins on the face, it wins on the edge also
|
||||||
else if (! hh->is_decision_set() &&
|
else if (! hh->is_decision_set() &&
|
||||||
face->get_decision() == DAC_DECISION_FIRST &&
|
face->decision() == DAC_DECISION_FIRST &&
|
||||||
! hh->get_has_equal_aux_data_in_face(0) &&
|
! hh->has_equal_aux_data_in_face(0) &&
|
||||||
hh->get_has_equal_aux_data_in_face(1)) {
|
hh->has_equal_aux_data_in_face(1)) {
|
||||||
hh->set_decision(DAC_DECISION_FIRST);
|
hh->set_decision(DAC_DECISION_FIRST);
|
||||||
hh->twin()->set_decision(DAC_DECISION_FIRST);
|
hh->twin()->set_decision(DAC_DECISION_FIRST);
|
||||||
}
|
}
|
||||||
|
|
@ -1014,9 +1003,7 @@ protected:
|
||||||
// conclude from one edge, bt can conclude from the other
|
// conclude from one edge, bt can conclude from the other
|
||||||
conclude_decision_to_vertex(hh->source(), hh->twin(), face, false);
|
conclude_decision_to_vertex(hh->source(), hh->twin(), face, false);
|
||||||
conclude_decision_to_vertex(hh->target(), hh, face, true);
|
conclude_decision_to_vertex(hh->target(), hh, face, true);
|
||||||
|
} while (++hec != hec_begin);
|
||||||
hec++;
|
|
||||||
} while(hec != hec_begin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to conclude the decision from the halfedge or the face to the vertex
|
// try to conclude the decision from the halfedge or the face to the vertex
|
||||||
|
|
@ -1028,23 +1015,23 @@ protected:
|
||||||
Face_handle fh, bool try_vertex_face) {
|
Face_handle fh, bool try_vertex_face) {
|
||||||
if (vh->is_decision_set()) return;
|
if (vh->is_decision_set()) return;
|
||||||
|
|
||||||
// first, we try to copy decision from edge, then from face
|
// first, we try to copy decision from edge, then from face
|
||||||
if (hh->is_decision_set() && can_copy_decision_from_edge_to_vertex(hh))
|
if (hh->is_decision_set() && can_copy_decision_from_edge_to_vertex(hh))
|
||||||
vh->set_decision(hh->get_decision());
|
vh->set_decision(hh->decision());
|
||||||
|
|
||||||
// if the first map is continuous, but the second isn't (i.e. when we move
|
// if the first map is continuous, but the second isn't (i.e. when we move
|
||||||
// from the edge to the vertex, the envelope goes closer), then if the
|
// from the edge to the vertex, the envelope goes closer), then if the
|
||||||
// second map wins on the edge, it wins on the vertex also
|
// second map wins on the edge, it wins on the vertex also
|
||||||
else if (hh->get_decision() == DAC_DECISION_SECOND &&
|
else if (hh->decision() == DAC_DECISION_SECOND &&
|
||||||
hh->get_has_equal_aux_data_in_target(0) &&
|
hh->has_equal_aux_data_in_target(0) &&
|
||||||
! hh->get_has_equal_aux_data_in_target(1))
|
! hh->has_equal_aux_data_in_target(1))
|
||||||
vh->set_decision(DAC_DECISION_SECOND);
|
vh->set_decision(DAC_DECISION_SECOND);
|
||||||
|
|
||||||
// if the second map is continuous, but the first isn't, then if the
|
// if the second map is continuous, but the first isn't, then if the
|
||||||
// first map wins on the edge, it wins on the vertex also
|
// first map wins on the edge, it wins on the vertex also
|
||||||
else if (hh->get_decision() == DAC_DECISION_FIRST &&
|
else if (hh->decision() == DAC_DECISION_FIRST &&
|
||||||
! hh->get_has_equal_aux_data_in_target(0) &&
|
! hh->has_equal_aux_data_in_target(0) &&
|
||||||
hh->get_has_equal_aux_data_in_target(1))
|
hh->has_equal_aux_data_in_target(1))
|
||||||
vh->set_decision(DAC_DECISION_FIRST);
|
vh->set_decision(DAC_DECISION_FIRST);
|
||||||
|
|
||||||
// check if we can copy from the face
|
// check if we can copy from the face
|
||||||
|
|
@ -1056,15 +1043,17 @@ protected:
|
||||||
if (has_equal_aux_data_in_target_and_face(hh)) {
|
if (has_equal_aux_data_in_target_and_face(hh)) {
|
||||||
// can copy the data from the face, since we already took care of
|
// can copy the data from the face, since we already took care of
|
||||||
// the vertices of projected intersections
|
// the vertices of projected intersections
|
||||||
vh->set_decision(fh->get_decision());
|
vh->set_decision(fh->decision());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: this is for checking
|
// todo: this is for checking
|
||||||
template <typename InputIterator>
|
template <typename InputIterator>
|
||||||
bool has_equal_data(const InputIterator& begin1, const InputIterator& end1,
|
bool has_equal_env_data(const InputIterator& begin1,
|
||||||
const InputIterator& begin2, const InputIterator& end2) {
|
const InputIterator& end1,
|
||||||
|
const InputIterator& begin2,
|
||||||
|
const InputIterator& end2) {
|
||||||
// insert the input data objects into a set
|
// insert the input data objects into a set
|
||||||
std::set<Xy_monotone_surface_3> first(begin1, end1);
|
std::set<Xy_monotone_surface_3> first(begin1, end1);
|
||||||
std::set<Xy_monotone_surface_3> second(begin2, end2);
|
std::set<Xy_monotone_surface_3> second(begin2, end2);
|
||||||
|
|
@ -1078,29 +1067,29 @@ protected:
|
||||||
|
|
||||||
// todo: this is for checking
|
// todo: this is for checking
|
||||||
template <typename FeatureHandle>
|
template <typename FeatureHandle>
|
||||||
void get_aux_data_iterators(unsigned int id, FeatureHandle fh,
|
void aux_data_iterators(unsigned int id, FeatureHandle fh,
|
||||||
Envelope_data_iterator& begin,
|
Envelope_data_iterator& begin,
|
||||||
Envelope_data_iterator& end) {
|
Envelope_data_iterator& end) {
|
||||||
Halfedge_handle h;
|
Halfedge_handle h;
|
||||||
Vertex_handle v;
|
Vertex_handle v;
|
||||||
Face_handle f;
|
Face_handle f;
|
||||||
|
|
||||||
const Object& o = fh->get_aux_source(id);
|
const Object& o = fh->aux_source(id);
|
||||||
CGAL_assertion(!o.is_empty());
|
CGAL_assertion(!o.is_empty());
|
||||||
|
|
||||||
if (assign(v, o)) {
|
if (assign(v, o)) {
|
||||||
begin = v->begin_data();
|
begin = v->begin_env_data();
|
||||||
end = v->end_data();
|
end = v->end_env_data();
|
||||||
}
|
}
|
||||||
else if (assign(h, o)) {
|
else if (assign(h, o)) {
|
||||||
begin = h->begin_data();
|
begin = h->begin_env_data();
|
||||||
end = h->end_data();
|
end = h->end_env_data();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CGAL_assertion(assign(f, o));
|
CGAL_assertion(assign(f, o));
|
||||||
assign(f, o);
|
assign(f, o);
|
||||||
begin = f->begin_data();
|
begin = f->begin_env_data();
|
||||||
end = f->end_data();
|
end = f->end_env_data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1109,9 +1098,9 @@ protected:
|
||||||
bool has_equal_aux_data(unsigned int id, FeatureHandle1 fh1,
|
bool has_equal_aux_data(unsigned int id, FeatureHandle1 fh1,
|
||||||
FeatureHandle2 fh2) {
|
FeatureHandle2 fh2) {
|
||||||
Envelope_data_iterator begin1, end1, begin2, end2;
|
Envelope_data_iterator begin1, end1, begin2, end2;
|
||||||
get_aux_data_iterators(id, fh1, begin1, end1);
|
aux_data_iterators(id, fh1, begin1, end1);
|
||||||
get_aux_data_iterators(id, fh2, begin2, end2);
|
aux_data_iterators(id, fh2, begin2, end2);
|
||||||
bool has_eq = has_equal_data(begin1, end1, begin2, end2);
|
bool has_eq = has_equal_env_data(begin1, end1, begin2, end2);
|
||||||
return has_eq;
|
return has_eq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1122,7 +1111,6 @@ protected:
|
||||||
has_equal_aux_data(1, fh1, fh2));
|
has_equal_aux_data(1, fh1, fh2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// check if we can copy the decision made on a boundary edge to the face
|
// check if we can copy the decision made on a boundary edge to the face
|
||||||
// if so, res will contain this decision's comparison result
|
// if so, res will contain this decision's comparison result
|
||||||
bool can_copy_decision_from_boundary_edge(Face_handle face,
|
bool can_copy_decision_from_boundary_edge(Face_handle face,
|
||||||
|
|
@ -1138,37 +1126,33 @@ protected:
|
||||||
hec_begin = hec;
|
hec_begin = hec;
|
||||||
do {
|
do {
|
||||||
Halfedge_handle hh = hec;
|
Halfedge_handle hh = hec;
|
||||||
if(hh->is_fictitious()) {
|
if (hh->is_fictitious()) continue;
|
||||||
++hec;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (can_copy_decision_from_face_to_edge(hh) &&
|
if (can_copy_decision_from_face_to_edge(hh) &&
|
||||||
hh->is_decision_set() &&
|
hh->is_decision_set() &&
|
||||||
hh->get_decision() != DAC_DECISION_BOTH) {
|
hh->decision() != DAC_DECISION_BOTH) {
|
||||||
res = convert_decision_to_comparison_result(hh->get_decision());
|
res = convert_decision_to_comparison_result(hh->decision());
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
// if the first map is continuous, but the second isn't (i.e. when we
|
// if the first map is continuous, but the second isn't (i.e. when we
|
||||||
// move from the edge to the face, the envelope goes farther), then
|
// move from the edge to the face, the envelope goes farther), then
|
||||||
// if the first map wins on the edge, it wins on the face also
|
// if the first map wins on the edge, it wins on the face also
|
||||||
else if (hh->is_decision_set() &&
|
else if (hh->is_decision_set() &&
|
||||||
hh->get_decision() == DAC_DECISION_FIRST &&
|
hh->decision() == DAC_DECISION_FIRST &&
|
||||||
hh->get_has_equal_aux_data_in_face(0) &&
|
hh->has_equal_aux_data_in_face(0) &&
|
||||||
! hh->get_has_equal_aux_data_in_face(1)) {
|
! hh->has_equal_aux_data_in_face(1)) {
|
||||||
res = convert_decision_to_comparison_result(DAC_DECISION_FIRST);
|
res = convert_decision_to_comparison_result(DAC_DECISION_FIRST);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
// if the second map is continuous, but the first isn't, then if the
|
// if the second map is continuous, but the first isn't, then if the
|
||||||
// second map wins on the edge, it wins on the face also
|
// second map wins on the edge, it wins on the face also
|
||||||
else if (hh->is_decision_set() &&
|
else if (hh->is_decision_set() &&
|
||||||
hh->get_decision() == DAC_DECISION_SECOND &&
|
hh->decision() == DAC_DECISION_SECOND &&
|
||||||
!hh->get_has_equal_aux_data_in_face(0) &&
|
!hh->has_equal_aux_data_in_face(0) &&
|
||||||
hh->get_has_equal_aux_data_in_face(1)) {
|
hh->has_equal_aux_data_in_face(1)) {
|
||||||
res = convert_decision_to_comparison_result(DAC_DECISION_SECOND);
|
res = convert_decision_to_comparison_result(DAC_DECISION_SECOND);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
hec++;
|
} while ((++hec != hec_begin) && ! result);
|
||||||
} while(hec != hec_begin && !result);
|
|
||||||
if (result) return true;
|
if (result) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1182,33 +1166,30 @@ protected:
|
||||||
Halfedge_handle hh = hec;
|
Halfedge_handle hh = hec;
|
||||||
if (can_copy_decision_from_face_to_edge(hh) &&
|
if (can_copy_decision_from_face_to_edge(hh) &&
|
||||||
hh->is_decision_set() &&
|
hh->is_decision_set() &&
|
||||||
hh->get_decision() != DAC_DECISION_BOTH) {
|
hh->decision() != DAC_DECISION_BOTH) {
|
||||||
res = convert_decision_to_comparison_result(hh->get_decision());
|
res = convert_decision_to_comparison_result(hh->decision());
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
// if the first map is continuous, but the second isn't (i.e. when we
|
// if the first map is continuous, but the second isn't (i.e. when we
|
||||||
// move from the edge to the face, the envelope goes farther), then
|
// move from the edge to the face, the envelope goes farther), then
|
||||||
// if the first map wins on the edge, it wins on the face also
|
// if the first map wins on the edge, it wins on the face also
|
||||||
else if (hh->is_decision_set() &&
|
else if (hh->is_decision_set() &&
|
||||||
hh->get_decision() == DAC_DECISION_FIRST &&
|
hh->decision() == DAC_DECISION_FIRST &&
|
||||||
hh->get_has_equal_aux_data_in_face(0) &&
|
hh->has_equal_aux_data_in_face(0) &&
|
||||||
! hh->get_has_equal_aux_data_in_face(1)) {
|
! hh->has_equal_aux_data_in_face(1)) {
|
||||||
res = convert_decision_to_comparison_result(DAC_DECISION_FIRST);
|
res = convert_decision_to_comparison_result(DAC_DECISION_FIRST);
|
||||||
|
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
// if the second map is continuous, but the first isn't, then if the
|
// if the second map is continuous, but the first isn't, then if the
|
||||||
// second map wins on the edge, it wins on the face also
|
// second map wins on the edge, it wins on the face also
|
||||||
else if (hh->is_decision_set() &&
|
else if (hh->is_decision_set() &&
|
||||||
hh->get_decision() == DAC_DECISION_SECOND &&
|
hh->decision() == DAC_DECISION_SECOND &&
|
||||||
! hh->get_has_equal_aux_data_in_face(0) &&
|
! hh->has_equal_aux_data_in_face(0) &&
|
||||||
hh->get_has_equal_aux_data_in_face(1)) {
|
hh->has_equal_aux_data_in_face(1)) {
|
||||||
res = convert_decision_to_comparison_result(DAC_DECISION_SECOND);
|
res = convert_decision_to_comparison_result(DAC_DECISION_SECOND);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
} while ((++hec != hec_begin) && ! result);
|
||||||
hec++;
|
|
||||||
} while(hec != hec_begin && !result);
|
|
||||||
if (result) return true;
|
if (result) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1228,13 +1209,13 @@ protected:
|
||||||
|
|
||||||
bool has_equal_aux_data_with_face(Vertex_handle v) {
|
bool has_equal_aux_data_with_face(Vertex_handle v) {
|
||||||
CGAL_assertion(v->is_isolated());
|
CGAL_assertion(v->is_isolated());
|
||||||
return (v->get_has_equal_aux_data_in_face(0) &&
|
return (v->has_equal_aux_data_in_face(0) &&
|
||||||
v->get_has_equal_aux_data_in_face(1));
|
v->has_equal_aux_data_in_face(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool has_equal_aux_data_in_target_and_face(Halfedge_handle h) {
|
bool has_equal_aux_data_in_target_and_face(Halfedge_handle h) {
|
||||||
return (h->get_has_equal_aux_data_in_target_and_face(0) &&
|
return (h->has_equal_aux_data_in_target_and_face(0) &&
|
||||||
h->get_has_equal_aux_data_in_target_and_face(1));
|
h->has_equal_aux_data_in_target_and_face(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the aux data on the endpoint vertices of the edge
|
// check the aux data on the endpoint vertices of the edge
|
||||||
|
|
@ -1246,20 +1227,20 @@ protected:
|
||||||
can_copy_decision_from_edge_to_vertex(edge->twin()))
|
can_copy_decision_from_edge_to_vertex(edge->twin()))
|
||||||
// can copy the data from the edge, since we already took care of
|
// can copy the data from the edge, since we already took care of
|
||||||
// the vertices of projected intersections
|
// the vertices of projected intersections
|
||||||
edge->source()->set_decision(edge->get_decision());
|
edge->source()->set_decision(edge->decision());
|
||||||
// if the first map is continuous, but the second isn't (i.e. when we move
|
// if the first map is continuous, but the second isn't (i.e. when we move
|
||||||
// from the edge to the vertex, the envelope goes closer), then if the
|
// from the edge to the vertex, the envelope goes closer), then if the
|
||||||
// second map wins on the edge, it wins on the vertex also
|
// second map wins on the edge, it wins on the vertex also
|
||||||
else if (edge->get_decision() == DAC_DECISION_SECOND &&
|
else if (edge->decision() == DAC_DECISION_SECOND &&
|
||||||
edge->twin()->get_has_equal_aux_data_in_target(0) &&
|
edge->twin()->has_equal_aux_data_in_target(0) &&
|
||||||
!edge->twin()->get_has_equal_aux_data_in_target(1)) {
|
!edge->twin()->has_equal_aux_data_in_target(1)) {
|
||||||
edge->source()->set_decision(DAC_DECISION_SECOND);
|
edge->source()->set_decision(DAC_DECISION_SECOND);
|
||||||
}
|
}
|
||||||
// if the second map is continuous, but the first isn't, then if the
|
// if the second map is continuous, but the first isn't, then if the
|
||||||
// first map wins on the edge, it wins on the vertex also
|
// first map wins on the edge, it wins on the vertex also
|
||||||
else if (edge->get_decision() == DAC_DECISION_FIRST &&
|
else if (edge->decision() == DAC_DECISION_FIRST &&
|
||||||
!edge->twin()->get_has_equal_aux_data_in_target(0) &&
|
!edge->twin()->has_equal_aux_data_in_target(0) &&
|
||||||
edge->twin()->get_has_equal_aux_data_in_target(1)) {
|
edge->twin()->has_equal_aux_data_in_target(1)) {
|
||||||
edge->source()->set_decision(DAC_DECISION_FIRST);
|
edge->source()->set_decision(DAC_DECISION_FIRST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1268,20 +1249,20 @@ protected:
|
||||||
can_copy_decision_from_edge_to_vertex(edge))
|
can_copy_decision_from_edge_to_vertex(edge))
|
||||||
// can copy the data from the edge, since we already took care of
|
// can copy the data from the edge, since we already took care of
|
||||||
// the vertices of projected intersections
|
// the vertices of projected intersections
|
||||||
edge->target()->set_decision(edge->get_decision());
|
edge->target()->set_decision(edge->decision());
|
||||||
// if the first map is continuous, but the second isn't (i.e. when we move
|
// if the first map is continuous, but the second isn't (i.e. when we move
|
||||||
// from the edge to the vertex, the envelope goes closer), then if the
|
// from the edge to the vertex, the envelope goes closer), then if the
|
||||||
// second map wins on the edge, it wins on the vertex also
|
// second map wins on the edge, it wins on the vertex also
|
||||||
else if (edge->get_decision() == DAC_DECISION_SECOND &&
|
else if (edge->decision() == DAC_DECISION_SECOND &&
|
||||||
edge->get_has_equal_aux_data_in_target(0) &&
|
edge->has_equal_aux_data_in_target(0) &&
|
||||||
!edge->get_has_equal_aux_data_in_target(1)) {
|
!edge->has_equal_aux_data_in_target(1)) {
|
||||||
edge->target()->set_decision(DAC_DECISION_SECOND);
|
edge->target()->set_decision(DAC_DECISION_SECOND);
|
||||||
}
|
}
|
||||||
// if the second map is continuous, but the first isn't, then if the
|
// if the second map is continuous, but the first isn't, then if the
|
||||||
// first map wins on the edge, it wins on the vertex also
|
// first map wins on the edge, it wins on the vertex also
|
||||||
else if (edge->get_decision() == DAC_DECISION_FIRST &&
|
else if (edge->decision() == DAC_DECISION_FIRST &&
|
||||||
!edge->get_has_equal_aux_data_in_target(0) &&
|
!edge->has_equal_aux_data_in_target(0) &&
|
||||||
edge->get_has_equal_aux_data_in_target(1)) {
|
edge->has_equal_aux_data_in_target(1)) {
|
||||||
edge->target()->set_decision(DAC_DECISION_FIRST);
|
edge->target()->set_decision(DAC_DECISION_FIRST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1454,8 +1435,7 @@ protected:
|
||||||
CGAL_assertion(tmp == copied_prev_v2);
|
CGAL_assertion(tmp == copied_prev_v2);
|
||||||
|
|
||||||
bool new_face;
|
bool new_face;
|
||||||
if (is_outer_ccb)
|
if (is_outer_ccb) {
|
||||||
{
|
|
||||||
// if it is the first face created, and the last halfedge to
|
// if it is the first face created, and the last halfedge to
|
||||||
// insert, this is a regular outer ccb, with no special
|
// insert, this is a regular outer ccb, with no special
|
||||||
// degeneracies (around the current vertices, at least)
|
// degeneracies (around the current vertices, at least)
|
||||||
|
|
@ -1469,8 +1449,8 @@ protected:
|
||||||
copied_prev_v2->next(),
|
copied_prev_v2->next(),
|
||||||
new_face,
|
new_face,
|
||||||
dummy_swapped_predecessors);
|
dummy_swapped_predecessors);
|
||||||
// TODO EBEB 2012-08-06 do we have to care if order has been swapped,
|
// TODO EBEB 2012-08-06 do we have to care if order has been
|
||||||
// or do we have to disallow swapping?
|
// swapped, or do we have to disallow swapping?
|
||||||
|
|
||||||
CGAL_assertion(new_face);
|
CGAL_assertion(new_face);
|
||||||
}
|
}
|
||||||
|
|
@ -1503,8 +1483,8 @@ protected:
|
||||||
copied_prev_he->next(),
|
copied_prev_he->next(),
|
||||||
new_face,
|
new_face,
|
||||||
dummy_swapped_predecessors);
|
dummy_swapped_predecessors);
|
||||||
// TODO EBEB 2012-08-06 do we have to care if order has been swapped,
|
// TODO EBEB 2012-08-06 do we have to care if order has been
|
||||||
// or do we have to disallow swapping?
|
// swapped, or do we have to disallow swapping?
|
||||||
|
|
||||||
CGAL_assertion(new_face);
|
CGAL_assertion(new_face);
|
||||||
copied_new_he = copied_new_he->twin();
|
copied_new_he = copied_new_he->twin();
|
||||||
|
|
@ -1522,9 +1502,7 @@ protected:
|
||||||
copied_prev_he = copied_new_he;
|
copied_prev_he = copied_new_he;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hec++;
|
} while (++hec != hec_begin);
|
||||||
} while(hec != hec_begin);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_ccb_unbounded(Ccb_halfedge_circulator hec,
|
void copy_ccb_unbounded(Ccb_halfedge_circulator hec,
|
||||||
|
|
@ -1543,8 +1521,7 @@ protected:
|
||||||
non_fict = hec;
|
non_fict = hec;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++hec;
|
} while (++hec != hec_end);
|
||||||
} while(hec != hec_end);
|
|
||||||
|
|
||||||
// Find an anchor halfedge he_from along the original CCB and locate
|
// Find an anchor halfedge he_from along the original CCB and locate
|
||||||
// its image he_to in the target CCB.
|
// its image he_to in the target CCB.
|
||||||
|
|
@ -1712,26 +1689,26 @@ protected:
|
||||||
// aux data of face "from"
|
// aux data of face "from"
|
||||||
void copy_data_by_comparison_result(Face_handle from, Face_handle to,
|
void copy_data_by_comparison_result(Face_handle from, Face_handle to,
|
||||||
Comparison_result res) {
|
Comparison_result res) {
|
||||||
CGAL_assertion_msg(from->get_aux_is_set(0), "aux_data(0) is not set");
|
CGAL_assertion_msg(from->aux_is_set(0), "aux_data(0) is not set");
|
||||||
CGAL_assertion_msg(from->get_aux_is_set(1), "aux_data(1) is not set");
|
CGAL_assertion_msg(from->aux_is_set(1), "aux_data(1) is not set");
|
||||||
to->set_aux_source(0, from->get_aux_source(0));
|
to->set_aux_source(0, from->aux_source(0));
|
||||||
to->set_aux_source(1, from->get_aux_source(1));
|
to->set_aux_source(1, from->aux_source(1));
|
||||||
to->set_decision(res);
|
to->set_decision(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set envelope data in vertex "v" according to the comparison result of the
|
// set envelope data in vertex "v" according to the comparison result of the
|
||||||
// aux data of "v"
|
// aux data of "v"
|
||||||
void set_data_by_comparison_result(Vertex_handle v, Comparison_result res) {
|
void set_data_by_comparison_result(Vertex_handle v, Comparison_result res) {
|
||||||
CGAL_assertion_msg(v->get_aux_is_set(0), "aux_data(0) is not set");
|
CGAL_assertion_msg(v->aux_is_set(0), "aux_data(0) is not set");
|
||||||
CGAL_assertion_msg(v->get_aux_is_set(1), "aux_data(1) is not set");
|
CGAL_assertion_msg(v->aux_is_set(1), "aux_data(1) is not set");
|
||||||
v->set_decision(res);
|
v->set_decision(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set envelope data in halfedge "h" according to the comparison result of
|
// set envelope data in halfedge "h" according to the comparison result of
|
||||||
// the aux data of "h"
|
// the aux data of "h"
|
||||||
void set_data_by_comparison_result(Halfedge_handle h, Comparison_result res) {
|
void set_data_by_comparison_result(Halfedge_handle h, Comparison_result res) {
|
||||||
CGAL_assertion_msg(h->get_aux_is_set(0), "aux_data(0) is not set");
|
CGAL_assertion_msg(h->aux_is_set(0), "aux_data(0) is not set");
|
||||||
CGAL_assertion_msg(h->get_aux_is_set(1), "aux_data(1) is not set");
|
CGAL_assertion_msg(h->aux_is_set(1), "aux_data(1) is not set");
|
||||||
h->set_decision(res);
|
h->set_decision(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1741,38 +1718,38 @@ protected:
|
||||||
// Vertex_handle
|
// Vertex_handle
|
||||||
template <typename FeatureHabdle>
|
template <typename FeatureHabdle>
|
||||||
void copy_all_data_to_vertex(FeatureHabdle from, Vertex_handle to) {
|
void copy_all_data_to_vertex(FeatureHabdle from, Vertex_handle to) {
|
||||||
CGAL_assertion_msg(from->get_aux_is_set(0), "aux_data(0) is not set");
|
CGAL_assertion_msg(from->aux_is_set(0), "aux_data(0) is not set");
|
||||||
CGAL_assertion_msg(from->get_aux_is_set(1), "aux_data(1) is not set");
|
CGAL_assertion_msg(from->aux_is_set(1), "aux_data(1) is not set");
|
||||||
CGAL_assertion_msg(!to->is_decision_set(), "data is set in new vertex");
|
CGAL_assertion_msg(!to->is_decision_set(), "data is set in new vertex");
|
||||||
to->set_aux_source(0, from->get_aux_source(0));
|
to->set_aux_source(0, from->aux_source(0));
|
||||||
to->set_aux_source(1, from->get_aux_source(1));
|
to->set_aux_source(1, from->aux_source(1));
|
||||||
to->set_decision(EQUAL);
|
to->set_decision(EQUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void deal_with_new_vertex(Halfedge_handle orig_he, Vertex_handle new_v)
|
// void deal_with_new_vertex(Halfedge_handle orig_he, Vertex_handle new_v)
|
||||||
// {
|
// {
|
||||||
// const Xy_monotone_surface_3& surf1 = get_aux_surface(orig_he, 0);
|
// const Xy_monotone_surface_3& surf1 = aux_surface(orig_he, 0);
|
||||||
// const Xy_monotone_surface_3& surf2 = get_aux_surface(orig_he, 1);
|
// const Xy_monotone_surface_3& surf2 = aux_surface(orig_he, 1);
|
||||||
|
|
||||||
// const Point_2& p = new_v->point();
|
// const Point_2& p = new_v->point();
|
||||||
// Comparison_result res = compare_distance_to_envelope(p, surf1, surf2);
|
// Comparison_result res = compare_distance_to_envelope(p, surf1, surf2);
|
||||||
// new_v->set_aux_source(0, orig_he->get_aux_source(0));
|
// new_v->set_aux_source(0, orig_he->aux_source(0));
|
||||||
// new_v->set_aux_source(1, orig_he->get_aux_source(1));
|
// new_v->set_aux_source(1, orig_he->aux_source(1));
|
||||||
// new_v->set_decision(res);
|
// new_v->set_decision(res);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Comparison_result resolve_minimal_edge(Halfedge_handle orig_he,
|
Comparison_result resolve_minimal_edge(Halfedge_handle orig_he,
|
||||||
Halfedge_handle new_he) {
|
Halfedge_handle new_he) {
|
||||||
// find and set the envelope data on the new edge
|
// find and set the envelope data on the new edge
|
||||||
const Xy_monotone_surface_3& surf1 = get_aux_surface(orig_he, 0);
|
const Xy_monotone_surface_3& surf1 = aux_surface(orig_he, 0);
|
||||||
const Xy_monotone_surface_3& surf2 = get_aux_surface(orig_he, 1);
|
const Xy_monotone_surface_3& surf2 = aux_surface(orig_he, 1);
|
||||||
Comparison_result res =
|
Comparison_result res =
|
||||||
compare_distance_to_envelope(new_he->curve(), surf1, surf2);
|
compare_distance_to_envelope(new_he->curve(), surf1, surf2);
|
||||||
|
|
||||||
// the observer keeps this information when splitting an edge
|
// the observer keeps this information when splitting an edge
|
||||||
CGAL_assertion(new_he->get_aux_is_set(0) && new_he->get_aux_is_set(1));
|
CGAL_assertion(new_he->aux_is_set(0) && new_he->aux_is_set(1));
|
||||||
CGAL_assertion(new_he->twin()->get_aux_is_set(0) && \
|
CGAL_assertion(new_he->twin()->aux_is_set(0) && \
|
||||||
new_he->twin()->get_aux_is_set(1));
|
new_he->twin()->aux_is_set(1));
|
||||||
|
|
||||||
new_he->set_decision(res);
|
new_he->set_decision(res);
|
||||||
new_he->twin()->set_decision(res);
|
new_he->twin()->set_decision(res);
|
||||||
|
|
@ -1856,8 +1833,8 @@ protected:
|
||||||
CGAL_assertion(map_halfedges.is_defined(org_he));
|
CGAL_assertion(map_halfedges.is_defined(org_he));
|
||||||
CGAL_assertion(org_he->target() == new_he->source());
|
CGAL_assertion(org_he->target() == new_he->source());
|
||||||
|
|
||||||
if ((map_halfedges[org_he])->get_has_equal_aux_data_in_face(0) &&
|
if ((map_halfedges[org_he])->has_equal_aux_data_in_face(0) &&
|
||||||
(map_halfedges[org_he])->get_has_equal_aux_data_in_face(1))
|
(map_halfedges[org_he])->has_equal_aux_data_in_face(1))
|
||||||
(*special_vertices)[org_he->target()] =
|
(*special_vertices)[org_he->target()] =
|
||||||
special_vertices->default_value();
|
special_vertices->default_value();
|
||||||
|
|
||||||
|
|
@ -1882,8 +1859,9 @@ protected:
|
||||||
(*vertices_to_halfedges)[org_he->target()] = correct_side_he;
|
(*vertices_to_halfedges)[org_he->target()] = correct_side_he;
|
||||||
|
|
||||||
//BZBZ
|
//BZBZ
|
||||||
/* CGAL_assertion(vertices_to_halfedges->is_defined(correct_side_he->source()) &&
|
// CGAL_assertion
|
||||||
vertices_to_halfedges->is_defined(correct_side_he->next()->target()));*/
|
// (vertices_to_halfedges->is_defined(correct_side_he->source()) &&
|
||||||
|
// vertices_to_halfedges->is_defined(correct_side_he->next()->target()));
|
||||||
(*vertices_to_halfedges)[correct_side_he->next()->target()] =
|
(*vertices_to_halfedges)[correct_side_he->next()->target()] =
|
||||||
correct_side_he->next();
|
correct_side_he->next();
|
||||||
|
|
||||||
|
|
@ -2435,8 +2413,7 @@ protected:
|
||||||
Vertex_handle left_v, Halfedge_handle left_he,
|
Vertex_handle left_v, Halfedge_handle left_he,
|
||||||
Vertex_handle right_v, Halfedge_handle right_he) {
|
Vertex_handle right_v, Halfedge_handle right_he) {
|
||||||
// insert the curve only if the face is ok
|
// insert the curve only if the face is ok
|
||||||
if (is_face_ok(face))
|
if (is_face_ok(face)) {
|
||||||
{
|
|
||||||
CGAL_assertion(copied_arr.is_valid());
|
CGAL_assertion(copied_arr.is_valid());
|
||||||
Result base_result = insert_visitor.found_subcurve(cv, face,
|
Result base_result = insert_visitor.found_subcurve(cv, face,
|
||||||
left_v, left_he,
|
left_v, left_he,
|
||||||
|
|
@ -2486,17 +2463,17 @@ protected:
|
||||||
// since we have in the new edge aux sources as in the face,
|
// since we have in the new edge aux sources as in the face,
|
||||||
// we can copy the vertex-face flags from the vertex
|
// we can copy the vertex-face flags from the vertex
|
||||||
result_new_he->set_is_equal_aux_data_in_target
|
result_new_he->set_is_equal_aux_data_in_target
|
||||||
(0, cur_t->get_is_equal_aux_data_in_face(0));
|
(0, cur_t->is_equal_aux_data_in_face(0));
|
||||||
result_new_he->set_is_equal_aux_data_in_target
|
result_new_he->set_is_equal_aux_data_in_target
|
||||||
(1, cur_t->get_is_equal_aux_data_in_face(1));
|
(1, cur_t->is_equal_aux_data_in_face(1));
|
||||||
result_new_he->set_has_equal_aux_data_in_target
|
result_new_he->set_has_equal_aux_data_in_target
|
||||||
(0, cur_t->get_has_equal_aux_data_in_face(0));
|
(0, cur_t->has_equal_aux_data_in_face(0));
|
||||||
result_new_he->set_has_equal_aux_data_in_target
|
result_new_he->set_has_equal_aux_data_in_target
|
||||||
(1, cur_t->get_has_equal_aux_data_in_face(1));
|
(1, cur_t->has_equal_aux_data_in_face(1));
|
||||||
result_new_he->set_has_equal_aux_data_in_target_and_face
|
result_new_he->set_has_equal_aux_data_in_target_and_face
|
||||||
(0, cur_t->get_has_equal_aux_data_in_face(0));
|
(0, cur_t->has_equal_aux_data_in_face(0));
|
||||||
result_new_he->set_has_equal_aux_data_in_target_and_face
|
result_new_he->set_has_equal_aux_data_in_target_and_face
|
||||||
(1, cur_t->get_has_equal_aux_data_in_face(1));
|
(1, cur_t->has_equal_aux_data_in_face(1));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CGAL_assertion(copied_b_he->target() == cur_t);
|
CGAL_assertion(copied_b_he->target() == cur_t);
|
||||||
|
|
@ -2505,20 +2482,20 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
bool flag;
|
bool flag;
|
||||||
flag = (b_he->get_is_equal_aux_data_in_face(0) &&
|
flag = (b_he->is_equal_aux_data_in_face(0) &&
|
||||||
b_he->get_is_equal_aux_data_in_target(0));
|
b_he->is_equal_aux_data_in_target(0));
|
||||||
result_new_he->set_is_equal_aux_data_in_target(0, flag);
|
result_new_he->set_is_equal_aux_data_in_target(0, flag);
|
||||||
|
|
||||||
flag = (b_he->get_is_equal_aux_data_in_face(1) &&
|
flag = (b_he->is_equal_aux_data_in_face(1) &&
|
||||||
b_he->get_is_equal_aux_data_in_target(1));
|
b_he->is_equal_aux_data_in_target(1));
|
||||||
result_new_he->set_is_equal_aux_data_in_target(1, flag);
|
result_new_he->set_is_equal_aux_data_in_target(1, flag);
|
||||||
|
|
||||||
flag = b_he->get_has_equal_aux_data_in_target_and_face(0);
|
flag = b_he->has_equal_aux_data_in_target_and_face(0);
|
||||||
//CGAL_assertion(flag == parent->has_equal_aux_data(0, b_he->face(), b_he->target()));
|
//CGAL_assertion(flag == parent->has_equal_aux_data(0, b_he->face(), b_he->target()));
|
||||||
result_new_he->set_has_equal_aux_data_in_target(0, flag);
|
result_new_he->set_has_equal_aux_data_in_target(0, flag);
|
||||||
result_new_he->set_has_equal_aux_data_in_target_and_face(0, flag);
|
result_new_he->set_has_equal_aux_data_in_target_and_face(0, flag);
|
||||||
|
|
||||||
flag = b_he->get_has_equal_aux_data_in_target_and_face(1);
|
flag = b_he->has_equal_aux_data_in_target_and_face(1);
|
||||||
//CGAL_assertion(flag == parent->has_equal_aux_data(1, b_he->face(), b_he->target()));
|
//CGAL_assertion(flag == parent->has_equal_aux_data(1, b_he->face(), b_he->target()));
|
||||||
result_new_he->set_has_equal_aux_data_in_target(1, flag);
|
result_new_he->set_has_equal_aux_data_in_target(1, flag);
|
||||||
result_new_he->set_has_equal_aux_data_in_target_and_face(1, flag);
|
result_new_he->set_has_equal_aux_data_in_target_and_face(1, flag);
|
||||||
|
|
@ -2544,17 +2521,17 @@ protected:
|
||||||
// since we have in the new edge aux sources as in the face,
|
// since we have in the new edge aux sources as in the face,
|
||||||
// we can copy the vertex-face flags from the vertex
|
// we can copy the vertex-face flags from the vertex
|
||||||
result_new_he->twin()->set_is_equal_aux_data_in_target
|
result_new_he->twin()->set_is_equal_aux_data_in_target
|
||||||
(0, cur_t->get_is_equal_aux_data_in_face(0));
|
(0, cur_t->is_equal_aux_data_in_face(0));
|
||||||
result_new_he->twin()->set_is_equal_aux_data_in_target
|
result_new_he->twin()->set_is_equal_aux_data_in_target
|
||||||
(1, cur_t->get_is_equal_aux_data_in_face(1));
|
(1, cur_t->is_equal_aux_data_in_face(1));
|
||||||
result_new_he->twin()->set_has_equal_aux_data_in_target
|
result_new_he->twin()->set_has_equal_aux_data_in_target
|
||||||
(0, cur_t->get_has_equal_aux_data_in_face(0));
|
(0, cur_t->has_equal_aux_data_in_face(0));
|
||||||
result_new_he->twin()->set_has_equal_aux_data_in_target
|
result_new_he->twin()->set_has_equal_aux_data_in_target
|
||||||
(1, cur_t->get_has_equal_aux_data_in_face(1));
|
(1, cur_t->has_equal_aux_data_in_face(1));
|
||||||
result_new_he->twin()->set_has_equal_aux_data_in_target_and_face
|
result_new_he->twin()->set_has_equal_aux_data_in_target_and_face
|
||||||
(0, cur_t->get_has_equal_aux_data_in_face(0));
|
(0, cur_t->has_equal_aux_data_in_face(0));
|
||||||
result_new_he->twin()->set_has_equal_aux_data_in_target_and_face
|
result_new_he->twin()->set_has_equal_aux_data_in_target_and_face
|
||||||
(1, cur_t->get_has_equal_aux_data_in_face(1));
|
(1, cur_t->has_equal_aux_data_in_face(1));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CGAL_assertion(copied_b_he->target() == cur_t);
|
CGAL_assertion(copied_b_he->target() == cur_t);
|
||||||
|
|
@ -2562,20 +2539,20 @@ protected:
|
||||||
Halfedge_handle b_he = map_halfedges[copied_b_he];
|
Halfedge_handle b_he = map_halfedges[copied_b_he];
|
||||||
|
|
||||||
bool flag;
|
bool flag;
|
||||||
flag = (b_he->get_is_equal_aux_data_in_face(0) &&
|
flag = (b_he->is_equal_aux_data_in_face(0) &&
|
||||||
b_he->get_is_equal_aux_data_in_target(0));
|
b_he->is_equal_aux_data_in_target(0));
|
||||||
result_new_he->twin()->set_is_equal_aux_data_in_target(0, flag);
|
result_new_he->twin()->set_is_equal_aux_data_in_target(0, flag);
|
||||||
|
|
||||||
flag = (b_he->get_is_equal_aux_data_in_face(1) &&
|
flag = (b_he->is_equal_aux_data_in_face(1) &&
|
||||||
b_he->get_is_equal_aux_data_in_target(1));
|
b_he->is_equal_aux_data_in_target(1));
|
||||||
result_new_he->twin()->set_is_equal_aux_data_in_target(1, flag);
|
result_new_he->twin()->set_is_equal_aux_data_in_target(1, flag);
|
||||||
|
|
||||||
flag = b_he->get_has_equal_aux_data_in_target_and_face(0);
|
flag = b_he->has_equal_aux_data_in_target_and_face(0);
|
||||||
//CGAL_assertion(flag == parent->has_equal_aux_data(0, b_he->face(), b_he->target()));
|
// CGAL_assertion(flag == parent->has_equal_aux_data(0, b_he->face(), b_he->target()));
|
||||||
result_new_he->twin()->set_has_equal_aux_data_in_target(0, flag);
|
result_new_he->twin()->set_has_equal_aux_data_in_target(0, flag);
|
||||||
result_new_he->twin()->set_has_equal_aux_data_in_target_and_face(0, flag);
|
result_new_he->twin()->set_has_equal_aux_data_in_target_and_face(0, flag);
|
||||||
|
|
||||||
flag = b_he->get_has_equal_aux_data_in_target_and_face(1);
|
flag = b_he->has_equal_aux_data_in_target_and_face(1);
|
||||||
//CGAL_assertion(flag == parent->has_equal_aux_data(1, b_he->face(), b_he->target()));
|
//CGAL_assertion(flag == parent->has_equal_aux_data(1, b_he->face(), b_he->target()));
|
||||||
result_new_he->twin()->set_has_equal_aux_data_in_target(1, flag);
|
result_new_he->twin()->set_has_equal_aux_data_in_target(1, flag);
|
||||||
result_new_he->twin()->set_has_equal_aux_data_in_target_and_face(1, flag);
|
result_new_he->twin()->set_has_equal_aux_data_in_target_and_face(1, flag);
|
||||||
|
|
@ -2898,10 +2875,10 @@ protected:
|
||||||
virtual void after_split_face(Face_handle org_f, Face_handle new_f, bool)
|
virtual void after_split_face(Face_handle org_f, Face_handle new_f, bool)
|
||||||
override {
|
override {
|
||||||
// update the new face's aux_data from original face
|
// update the new face's aux_data from original face
|
||||||
if (org_f->get_aux_is_set(0))
|
if (org_f->aux_is_set(0))
|
||||||
new_f->set_aux_source(0, org_f->get_aux_source(0));
|
new_f->set_aux_source(0, org_f->aux_source(0));
|
||||||
if (org_f->get_aux_is_set(1))
|
if (org_f->aux_is_set(1))
|
||||||
new_f->set_aux_source(1, org_f->get_aux_source(1));
|
new_f->set_aux_source(1, org_f->aux_source(1));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,135 +60,117 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*
|
/* void print_face(Face_handle fh) {
|
||||||
void print_face(Face_handle fh)
|
* std::cout << (fh->is_unbounded() ? "unbounded" : "bounded");
|
||||||
{
|
*
|
||||||
std::cout << (fh->is_unbounded() ? "unbounded" : "bounded");
|
* if (fh->env_is_set()) {
|
||||||
|
* std::cout << " #data= " << fh->env_data_size();
|
||||||
if (fh->get_is_set())
|
* if (fh->env_data_size() > 0)
|
||||||
{
|
* std::cout << " data= " << fh->env_data_front();
|
||||||
std::cout << " #data= " << fh->number_of_data_objects();
|
* }
|
||||||
if (fh->number_of_data_objects() > 0)
|
*
|
||||||
std::cout << " data= " << fh->get_env_data();
|
* if (fh->aux_is_set(0)) {
|
||||||
}
|
* std::cout << " #data1= " << number_of_aux_data_objects(fh, 0);
|
||||||
|
* if (number_of_aux_data_objects(fh, 0)>0)
|
||||||
if (fh->get_aux_is_set(0))
|
* std::cout << " data#1= " << aux_data(fh, 0);
|
||||||
{
|
* }
|
||||||
std::cout << " #data1= " << get_number_of_aux_data_objects(fh, 0);
|
* if (fh->aux_is_set(1)) {
|
||||||
if (get_number_of_aux_data_objects(fh, 0)>0)
|
* std::cout << " #data2= " << number_of_aux_data_objects(fh, 1);
|
||||||
std::cout << " data#1= " << get_aux_data(fh, 0);
|
* if (number_of_aux_data_objects(fh, 1)>0)
|
||||||
}
|
* std::cout << " data#2= " << aux_data(fh, 1);
|
||||||
if (fh->get_aux_is_set(1))
|
* }
|
||||||
{
|
* std::cout << std::endl;
|
||||||
std::cout << " #data2= " << get_number_of_aux_data_objects(fh, 1);
|
* }
|
||||||
if (get_number_of_aux_data_objects(fh, 1)>0)
|
*
|
||||||
std::cout << " data#2= " << get_aux_data(fh, 1);
|
* // print the aux data in the faces of md
|
||||||
}
|
* void print_faces(Minimization_diagram_2& md) {
|
||||||
std::cout << std::endl;
|
* Face_iterator fit = md.faces_begin();
|
||||||
}
|
* for(; fit != md.faces_end(); ++fit) {
|
||||||
|
* Face_handle fh = fit;
|
||||||
// print the aux data in the faces of md
|
* print_face(fh);
|
||||||
void print_faces(Minimization_diagram_2& md)
|
* }
|
||||||
{
|
* std::cout << std::endl;
|
||||||
Face_iterator fit = md.faces_begin();
|
* }
|
||||||
for(; fit != md.faces_end(); ++fit)
|
*
|
||||||
{
|
* void print_vertices(Minimization_diagram_2& md) {
|
||||||
Face_handle fh = fit;
|
* Vertex_iterator vit = md.vertices_begin();
|
||||||
print_face(fh);
|
* for(; vit != md.vertices_end(); ++vit) {
|
||||||
}
|
* Vertex_handle vh = vit;
|
||||||
std::cout << std::endl;
|
* std::cout << vh->point();
|
||||||
}
|
*
|
||||||
|
* if (vh->env_is_set()) {
|
||||||
void print_vertices(Minimization_diagram_2& md)
|
* std::cout << " #data= " << vh->env_data_size();
|
||||||
{
|
* if (vh->env_data_size() > 0)
|
||||||
Vertex_iterator vit = md.vertices_begin();
|
* std::cout << " data= " << vh->env_data_front();
|
||||||
for(; vit != md.vertices_end(); ++vit)
|
* }
|
||||||
{
|
*
|
||||||
Vertex_handle vh = vit;
|
* if (vh->aux_is_set(0)) {
|
||||||
std::cout << vh->point();
|
* std::cout << " #data1= " << number_of_aux_data_objects(vh, 0);
|
||||||
|
* if (number_of_aux_data_objects(vh, 0)>0)
|
||||||
if (vh->get_is_set())
|
* std::cout << " data#1= " << aux_data(vh, 0);
|
||||||
{
|
* }
|
||||||
std::cout << " #data= " << vh->number_of_data_objects();
|
* if (vh->aux_is_set(1)) {
|
||||||
if (vh->number_of_data_objects() > 0)
|
* std::cout << " #data2= " << number_of_aux_data_objects(vh, 1);
|
||||||
std::cout << " data= " << vh->get_env_data();
|
* if (number_of_aux_data_objects(vh, 1)>0)
|
||||||
}
|
* std::cout << " data#2= " << aux_data(vh, 1);
|
||||||
|
* }
|
||||||
if (vh->get_aux_is_set(0))
|
* std::cout << std::endl;
|
||||||
{
|
* }
|
||||||
std::cout << " #data1= " << get_number_of_aux_data_objects(vh, 0);
|
* std::cout << std::endl;
|
||||||
if (get_number_of_aux_data_objects(vh, 0)>0)
|
* }
|
||||||
std::cout << " data#1= " << get_aux_data(vh, 0);
|
*
|
||||||
}
|
* void print_edges(Minimization_diagram_2& md) {
|
||||||
if (vh->get_aux_is_set(1))
|
* Halfedge_iterator hit = md.halfedges_begin();
|
||||||
{
|
* for(; hit != md.halfedges_end(); ++hit, ++hit) {
|
||||||
std::cout << " #data2= " << get_number_of_aux_data_objects(vh, 1);
|
* Halfedge_handle hh = hit;
|
||||||
if (get_number_of_aux_data_objects(vh, 1)>0)
|
* std::cout << hh->curve();
|
||||||
std::cout << " data#2= " << get_aux_data(vh, 1);
|
*
|
||||||
}
|
* if (hh->env_is_set()) {
|
||||||
std::cout << std::endl;
|
* std::cout << " #data= " << hh->env_data_size();
|
||||||
}
|
* if (hh->env_data_size() > 0)
|
||||||
std::cout << std::endl;
|
* std::cout << " data= " << hh->env_data_front();
|
||||||
}
|
* }
|
||||||
|
*
|
||||||
void print_edges(Minimization_diagram_2& md)
|
* if (hh->aux_is_set(0)) {
|
||||||
{
|
* std::cout << " #data1= " << number_of_aux_data_objects(hh, 0);
|
||||||
Halfedge_iterator hit = md.halfedges_begin();
|
* if (number_of_aux_data_objects(hh, 0)>0)
|
||||||
for(; hit != md.halfedges_end(); ++hit, ++hit)
|
* std::cout << " data#1= " << aux_data(hh, 0);
|
||||||
{
|
* }
|
||||||
Halfedge_handle hh = hit;
|
* if (hh->aux_is_set(1)) {
|
||||||
std::cout << hh->curve();
|
* std::cout << " #data2= " << number_of_aux_data_objects(hh, 1);
|
||||||
|
*
|
||||||
if (hh->get_is_set())
|
* if (number_of_aux_data_objects(hh, 1)>0)
|
||||||
{
|
* std::cout << " data#2= " << aux_data(hh, 1);
|
||||||
std::cout << " #data= " << hh->number_of_data_objects();
|
* }
|
||||||
if (hh->number_of_data_objects() > 0)
|
* std::cout << std::endl;
|
||||||
std::cout << " data= " << hh->get_env_data();
|
* }
|
||||||
}
|
* std::cout << std::endl;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
if (hh->get_aux_is_set(0))
|
|
||||||
{
|
|
||||||
std::cout << " #data1= " << get_number_of_aux_data_objects(hh, 0);
|
|
||||||
if (get_number_of_aux_data_objects(hh, 0)>0)
|
|
||||||
std::cout << " data#1= " << get_aux_data(hh, 0);
|
|
||||||
}
|
|
||||||
if (hh->get_aux_is_set(1))
|
|
||||||
{
|
|
||||||
std::cout << " #data2= " << get_number_of_aux_data_objects(hh, 1);
|
|
||||||
|
|
||||||
if (get_number_of_aux_data_objects(hh, 1)>0)
|
|
||||||
std::cout << " data#2= " << get_aux_data(hh, 1);
|
|
||||||
}
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void post_test_assertions(Minimization_diagram_2& md) {
|
void post_test_assertions(Minimization_diagram_2& md) {
|
||||||
// check that all data is filled in result
|
// check that all data is filled in result
|
||||||
for (auto fi = md.faces_begin(); fi != md.faces_end(); ++fi) {
|
for (auto fi = md.faces_begin(); fi != md.faces_end(); ++fi) {
|
||||||
Face_handle fh = fi;
|
Face_handle fh = fi;
|
||||||
CGAL_assertion_msg(fh->get_aux_is_set(0),
|
CGAL_assertion_msg(fh->aux_is_set(0),
|
||||||
"data from md1 on face is not set");
|
"data from md1 on face is not set");
|
||||||
CGAL_assertion_msg(fh->get_aux_is_set(1),
|
CGAL_assertion_msg(fh->aux_is_set(1),
|
||||||
"data from md2 on face is not set");
|
"data from md2 on face is not set");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto hi = md.halfedges_begin(); hi != md.halfedges_end(); ++hi) {
|
for (auto hi = md.halfedges_begin(); hi != md.halfedges_end(); ++hi) {
|
||||||
Halfedge_handle hh = hi;
|
Halfedge_handle hh = hi;
|
||||||
CGAL_assertion_msg(hh->get_aux_is_set(0),
|
CGAL_assertion_msg(hh->aux_is_set(0),
|
||||||
"data from md1 on halfedge is not set");
|
"data from md1 on halfedge is not set");
|
||||||
CGAL_assertion_msg(hh->get_aux_is_set(1),
|
CGAL_assertion_msg(hh->aux_is_set(1),
|
||||||
"data from md2 on halfedge is not set");
|
"data from md2 on halfedge is not set");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto vi = md.vertices_begin(); vi != md.vertices_end(); ++vi) {
|
for (auto vi = md.vertices_begin(); vi != md.vertices_end(); ++vi) {
|
||||||
Vertex_handle vh = vi;
|
Vertex_handle vh = vi;
|
||||||
CGAL_assertion_msg(vh->get_aux_is_set(0),
|
CGAL_assertion_msg(vh->aux_is_set(0),
|
||||||
"data from md1 on vertex is not set");
|
"data from md1 on vertex is not set");
|
||||||
CGAL_assertion_msg(vh->get_aux_is_set(1),
|
CGAL_assertion_msg(vh->aux_is_set(1),
|
||||||
"data from md2 on vertex is not set");
|
"data from md2 on vertex is not set");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -196,37 +178,37 @@ public:
|
||||||
protected:
|
protected:
|
||||||
// helper methods
|
// helper methods
|
||||||
template <typename FeatureHandle>
|
template <typename FeatureHandle>
|
||||||
Xy_monotone_surface_3 get_aux_data(FeatureHandle fh, unsigned int id) {
|
Xy_monotone_surface_3 aux_data(FeatureHandle fh, unsigned int id) {
|
||||||
const Object& o = fh->get_aux_source(id);
|
const Object& o = fh->aux_source(id);
|
||||||
Xy_monotone_surface_3 data;
|
Xy_monotone_surface_3 data;
|
||||||
|
|
||||||
Halfedge_handle h;
|
Halfedge_handle h;
|
||||||
Vertex_handle v;
|
Vertex_handle v;
|
||||||
Face_handle f;
|
Face_handle f;
|
||||||
if (assign(v, o)) data = v->get_env_data();
|
if (assign(v, o)) data = v->env_data_front();
|
||||||
else if (assign(h, o)) data = h->get_env_data();
|
else if (assign(h, o)) data = h->env_data_front();
|
||||||
else {
|
else {
|
||||||
CGAL_assertion(assign(f, o));
|
CGAL_assertion(assign(f, o));
|
||||||
assign(f, o);
|
assign(f, o);
|
||||||
data = f->get_env_data();
|
data = f->env_data_front();
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FeatureHandle>
|
template <typename FeatureHandle>
|
||||||
int get_number_of_aux_data_objects(FeatureHandle fh, unsigned int id) {
|
int number_of_aux_data_objects(FeatureHandle fh, unsigned int id) {
|
||||||
const Object& o = fh->get_aux_source(id);
|
const Object& o = fh->aux_source(id);
|
||||||
int data;
|
int data;
|
||||||
|
|
||||||
Halfedge_handle h;
|
Halfedge_handle h;
|
||||||
Vertex_handle v;
|
Vertex_handle v;
|
||||||
Face_handle f;
|
Face_handle f;
|
||||||
if (assign(v, o)) data = v->number_of_data_objects();
|
if (assign(v, o)) data = v->env_data_size();
|
||||||
else if (assign(h, o)) data = h->number_of_data_objects();
|
else if (assign(h, o)) data = h->env_data_size();
|
||||||
else {
|
else {
|
||||||
CGAL_assertion(assign(f, o));
|
CGAL_assertion(assign(f, o));
|
||||||
assign(f, o);
|
assign(f, o);
|
||||||
data = f->number_of_data_objects();
|
data = f->env_data_size();
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,10 +92,10 @@ public:
|
||||||
//res_v->set_is_intersection(false);
|
//res_v->set_is_intersection(false);
|
||||||
|
|
||||||
if (v1->is_isolated() && v2->is_isolated()) {
|
if (v1->is_isolated() && v2->is_isolated()) {
|
||||||
res_v->set_is_equal_aux_data_in_face(0, v1->get_is_equal_data_in_face());
|
res_v->set_is_equal_aux_data_in_face(0, v1->is_equal_env_data_in_face());
|
||||||
res_v->set_is_equal_aux_data_in_face(1, v2->get_is_equal_data_in_face());
|
res_v->set_is_equal_aux_data_in_face(1, v2->is_equal_env_data_in_face());
|
||||||
res_v->set_has_equal_aux_data_in_face(0, v1->get_has_equal_data_in_face());
|
res_v->set_has_equal_aux_data_in_face(0, v1->has_equal_env_data_in_face());
|
||||||
res_v->set_has_equal_aux_data_in_face(1, v2->get_has_equal_data_in_face());
|
res_v->set_has_equal_aux_data_in_face(1, v2->has_equal_env_data_in_face());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,9 +125,9 @@ public:
|
||||||
// the res_v is also isolated, and we should update the is_equal/has_equal
|
// the res_v is also isolated, and we should update the is_equal/has_equal
|
||||||
// data in face information
|
// data in face information
|
||||||
res_v->set_is_equal_aux_data_in_face(0, true);
|
res_v->set_is_equal_aux_data_in_face(0, true);
|
||||||
res_v->set_is_equal_aux_data_in_face(1, v2->get_is_equal_data_in_face());
|
res_v->set_is_equal_aux_data_in_face(1, v2->is_equal_env_data_in_face());
|
||||||
res_v->set_has_equal_aux_data_in_face(0, !f1->has_no_data());
|
res_v->set_has_equal_aux_data_in_face(0, ! f1->has_no_env_data());
|
||||||
res_v->set_has_equal_aux_data_in_face(1, v2->get_has_equal_data_in_face());
|
res_v->set_has_equal_aux_data_in_face(1, v2->has_equal_env_data_in_face());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,10 +140,10 @@ public:
|
||||||
if (v1->is_isolated()) {
|
if (v1->is_isolated()) {
|
||||||
// the res_v is also isolated, and we should update the is_equal/has_equal
|
// the res_v is also isolated, and we should update the is_equal/has_equal
|
||||||
// data in face information
|
// data in face information
|
||||||
res_v->set_is_equal_aux_data_in_face(0, v1->get_is_equal_data_in_face());
|
res_v->set_is_equal_aux_data_in_face(0, v1->is_equal_env_data_in_face());
|
||||||
res_v->set_is_equal_aux_data_in_face(1, true);
|
res_v->set_is_equal_aux_data_in_face(1, true);
|
||||||
res_v->set_has_equal_aux_data_in_face(0, v1->get_has_equal_data_in_face());
|
res_v->set_has_equal_aux_data_in_face(0, v1->has_equal_env_data_in_face());
|
||||||
res_v->set_has_equal_aux_data_in_face(1, !f2->has_no_data());
|
res_v->set_has_equal_aux_data_in_face(1, ! f2->has_no_env_data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -157,19 +157,19 @@ public:
|
||||||
res_h->twin()->set_aux_source(1, m_2.non_const_handle(h2->twin()));
|
res_h->twin()->set_aux_source(1, m_2.non_const_handle(h2->twin()));
|
||||||
|
|
||||||
// update is_equal/has_equal data in face
|
// update is_equal/has_equal data in face
|
||||||
res_h->set_is_equal_aux_data_in_face(0, h1->get_is_equal_data_in_face());
|
res_h->set_is_equal_aux_data_in_face(0, h1->is_equal_env_data_in_face());
|
||||||
res_h->set_is_equal_aux_data_in_face(1, h2->get_is_equal_data_in_face());
|
res_h->set_is_equal_aux_data_in_face(1, h2->is_equal_env_data_in_face());
|
||||||
res_h->set_has_equal_aux_data_in_face(0, h1->get_has_equal_data_in_face());
|
res_h->set_has_equal_aux_data_in_face(0, h1->has_equal_env_data_in_face());
|
||||||
res_h->set_has_equal_aux_data_in_face(1, h2->get_has_equal_data_in_face());
|
res_h->set_has_equal_aux_data_in_face(1, h2->has_equal_env_data_in_face());
|
||||||
|
|
||||||
res_h->twin()->set_is_equal_aux_data_in_face(0, h1->twin()->
|
res_h->twin()->set_is_equal_aux_data_in_face(0, h1->twin()->
|
||||||
get_is_equal_data_in_face());
|
is_equal_env_data_in_face());
|
||||||
res_h->twin()->set_is_equal_aux_data_in_face(1, h2->twin()->
|
res_h->twin()->set_is_equal_aux_data_in_face(1, h2->twin()->
|
||||||
get_is_equal_data_in_face());
|
is_equal_env_data_in_face());
|
||||||
res_h->twin()->set_has_equal_aux_data_in_face(0, h1->twin()->
|
res_h->twin()->set_has_equal_aux_data_in_face(0, h1->twin()->
|
||||||
get_has_equal_data_in_face());
|
has_equal_env_data_in_face());
|
||||||
res_h->twin()->set_has_equal_aux_data_in_face(1, h2->twin()->
|
res_h->twin()->set_has_equal_aux_data_in_face(1, h2->twin()->
|
||||||
get_has_equal_data_in_face());
|
has_equal_env_data_in_face());
|
||||||
|
|
||||||
// update is_equal/has_equal data in target
|
// update is_equal/has_equal data in target
|
||||||
update_halfedge_flags_on_edge(res_h, m_1.non_const_handle(h1), 0);
|
update_halfedge_flags_on_edge(res_h, m_1.non_const_handle(h1), 0);
|
||||||
|
|
@ -197,17 +197,17 @@ public:
|
||||||
res_h->twin()->set_aux_source(1, m_2.non_const_handle(f2));
|
res_h->twin()->set_aux_source(1, m_2.non_const_handle(f2));
|
||||||
|
|
||||||
// update is_equal/has_equal data in face
|
// update is_equal/has_equal data in face
|
||||||
res_h->set_is_equal_aux_data_in_face(0, h1->get_is_equal_data_in_face());
|
res_h->set_is_equal_aux_data_in_face(0, h1->is_equal_env_data_in_face());
|
||||||
res_h->set_is_equal_aux_data_in_face(1, true);
|
res_h->set_is_equal_aux_data_in_face(1, true);
|
||||||
res_h->set_has_equal_aux_data_in_face(0, h1->get_has_equal_data_in_face());
|
res_h->set_has_equal_aux_data_in_face(0, h1->has_equal_env_data_in_face());
|
||||||
res_h->set_has_equal_aux_data_in_face(1, !f2->has_no_data());
|
res_h->set_has_equal_aux_data_in_face(1, ! f2->has_no_env_data());
|
||||||
|
|
||||||
res_h->twin()->set_is_equal_aux_data_in_face(0, h1->twin()->
|
res_h->twin()->set_is_equal_aux_data_in_face(0, h1->twin()->
|
||||||
get_is_equal_data_in_face());
|
is_equal_env_data_in_face());
|
||||||
res_h->twin()->set_is_equal_aux_data_in_face(1, true);
|
res_h->twin()->set_is_equal_aux_data_in_face(1, true);
|
||||||
res_h->twin()->set_has_equal_aux_data_in_face(0, h1->twin()->
|
res_h->twin()->set_has_equal_aux_data_in_face(0, h1->twin()->
|
||||||
get_has_equal_data_in_face());
|
has_equal_env_data_in_face());
|
||||||
res_h->twin()->set_has_equal_aux_data_in_face(1, !f2->has_no_data());
|
res_h->twin()->set_has_equal_aux_data_in_face(1, ! f2->has_no_env_data());
|
||||||
|
|
||||||
// update is_equal/has_equal data in target for the first source map
|
// update is_equal/has_equal data in target for the first source map
|
||||||
update_halfedge_flags_on_edge(res_h, m_1.non_const_handle(h1), 0);
|
update_halfedge_flags_on_edge(res_h, m_1.non_const_handle(h1), 0);
|
||||||
|
|
@ -234,14 +234,16 @@ public:
|
||||||
|
|
||||||
// update halfedge-face flags of the new halfedge
|
// update halfedge-face flags of the new halfedge
|
||||||
res_h->set_is_equal_aux_data_in_face(0, true);
|
res_h->set_is_equal_aux_data_in_face(0, true);
|
||||||
res_h->set_is_equal_aux_data_in_face(1, h2->get_is_equal_data_in_face());
|
res_h->set_is_equal_aux_data_in_face(1, h2->is_equal_env_data_in_face());
|
||||||
res_h->set_has_equal_aux_data_in_face(0, !f1->has_no_data());
|
res_h->set_has_equal_aux_data_in_face(0, ! f1->has_no_env_data());
|
||||||
res_h->set_has_equal_aux_data_in_face(1, h2->get_has_equal_data_in_face());
|
res_h->set_has_equal_aux_data_in_face(1, h2->has_equal_env_data_in_face());
|
||||||
|
|
||||||
res_h->twin()->set_is_equal_aux_data_in_face(0, true);
|
res_h->twin()->set_is_equal_aux_data_in_face(0, true);
|
||||||
res_h->twin()->set_is_equal_aux_data_in_face(1, h2->twin()->get_is_equal_data_in_face());
|
res_h->twin()->set_is_equal_aux_data_in_face
|
||||||
res_h->twin()->set_has_equal_aux_data_in_face(0, !f1->has_no_data());
|
(1, h2->twin()->is_equal_env_data_in_face());
|
||||||
res_h->twin()->set_has_equal_aux_data_in_face(1, h2->twin()->get_has_equal_data_in_face());
|
res_h->twin()->set_has_equal_aux_data_in_face(0, ! f1->has_no_env_data());
|
||||||
|
res_h->twin()->set_has_equal_aux_data_in_face
|
||||||
|
(1, h2->twin()->has_equal_env_data_in_face());
|
||||||
|
|
||||||
// update is_equal/has_equal data in target for the second source map
|
// update is_equal/has_equal data in target for the second source map
|
||||||
update_halfedge_flags_on_edge(res_h, m_2.non_const_handle(h2), 1);
|
update_halfedge_flags_on_edge(res_h, m_2.non_const_handle(h2), 1);
|
||||||
|
|
@ -261,8 +263,9 @@ protected:
|
||||||
template <typename Halfedge_handle_t>
|
template <typename Halfedge_handle_t>
|
||||||
void copy_halfedge_target_info(Halfedge_handle_t from,
|
void copy_halfedge_target_info(Halfedge_handle_t from,
|
||||||
Res_halfedge_handle to, unsigned int id) {
|
Res_halfedge_handle to, unsigned int id) {
|
||||||
to->set_is_equal_aux_data_in_target(id, from->get_is_equal_data_in_target());
|
to->set_is_equal_aux_data_in_target(id, from->is_equal_env_data_in_target());
|
||||||
to->set_has_equal_aux_data_in_target(id, from->get_has_equal_data_in_target());
|
to->set_has_equal_aux_data_in_target
|
||||||
|
(id, from->has_equal_env_data_in_target());
|
||||||
}
|
}
|
||||||
void set_halfedge_target_info(Res_halfedge_handle to, unsigned int id,
|
void set_halfedge_target_info(Res_halfedge_handle to, unsigned int id,
|
||||||
bool info) {
|
bool info) {
|
||||||
|
|
@ -274,16 +277,17 @@ protected:
|
||||||
void copy_halfedge_target_info_from_halfedge_face_info(Halfedge_handle_t from,
|
void copy_halfedge_target_info_from_halfedge_face_info(Halfedge_handle_t from,
|
||||||
Res_halfedge_handle to,
|
Res_halfedge_handle to,
|
||||||
unsigned int id) {
|
unsigned int id) {
|
||||||
to->set_is_equal_aux_data_in_target(id, from->get_is_equal_data_in_face());
|
to->set_is_equal_aux_data_in_target(id, from->is_equal_env_data_in_face());
|
||||||
to->set_has_equal_aux_data_in_target(id, from->get_has_equal_data_in_face());
|
to->set_has_equal_aux_data_in_target(id, from->has_equal_env_data_in_face());
|
||||||
to->set_has_equal_aux_data_in_target_and_face(id, from->get_has_equal_data_in_face());
|
to->set_has_equal_aux_data_in_target_and_face
|
||||||
|
(id, from->has_equal_env_data_in_face());
|
||||||
}
|
}
|
||||||
template <typename Vertex_handle_t>
|
template <typename Vertex_handle_t>
|
||||||
void copy_halfedge_target_info_from_vertex_face_info(Vertex_handle_t from,
|
void copy_halfedge_target_info_from_vertex_face_info(Vertex_handle_t from,
|
||||||
Res_halfedge_handle to,
|
Res_halfedge_handle to,
|
||||||
unsigned int id) {
|
unsigned int id) {
|
||||||
to->set_is_equal_aux_data_in_target(id, from->get_is_equal_data_in_face());
|
to->set_is_equal_aux_data_in_target(id, from->is_equal_env_data_in_face());
|
||||||
to->set_has_equal_aux_data_in_target(id, from->get_has_equal_data_in_face());
|
to->set_has_equal_aux_data_in_target(id, from->has_equal_env_data_in_face());
|
||||||
}
|
}
|
||||||
|
|
||||||
// find a halfedge that v is its target and f is its face
|
// find a halfedge that v is its target and f is its face
|
||||||
|
|
@ -309,8 +313,7 @@ protected:
|
||||||
traversed_vertices[Vertex_face_pair(v, hh->face())] = hh;
|
traversed_vertices[Vertex_face_pair(v, hh->face())] = hh;
|
||||||
// check for reult
|
// check for reult
|
||||||
if (hh->face() == f) result = hh;
|
if (hh->face() == f) result = hh;
|
||||||
++vc;
|
} while (++vc != vc_begin);
|
||||||
} while (vc != vc_begin);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// take it from the map
|
// take it from the map
|
||||||
|
|
@ -329,21 +332,21 @@ protected:
|
||||||
if(new_h->target()->is_at_open_boundary()) return;
|
if(new_h->target()->is_at_open_boundary()) return;
|
||||||
Vertex_handle vh;
|
Vertex_handle vh;
|
||||||
Halfedge_handle hh;
|
Halfedge_handle hh;
|
||||||
const Object& trg_src = new_h->target()->get_aux_source(id);
|
const Object& trg_src = new_h->target()->aux_source(id);
|
||||||
if (assign(vh, trg_src)) {
|
if (assign(vh, trg_src)) {
|
||||||
// vh is the target of on_edge, and we can copy the halfedge-target information
|
// vh is the target of on_edge, and we can copy the halfedge-target
|
||||||
// from on_edge
|
// information from on_edge
|
||||||
copy_halfedge_target_info(on_edge, new_h, id);
|
copy_halfedge_target_info(on_edge, new_h, id);
|
||||||
new_h->set_has_equal_aux_data_in_target_and_face
|
new_h->set_has_equal_aux_data_in_target_and_face
|
||||||
(id, on_edge->get_has_equal_data_in_target_and_face());
|
(id, on_edge->has_equal_env_data_in_target_and_face());
|
||||||
}
|
}
|
||||||
else if (assign(hh, trg_src)) {
|
else if (assign(hh, trg_src)) {
|
||||||
// hh is the "HEMSHECH" of on_edge, so we need to set halfedge_target
|
// hh is the "HEMSHECH" of on_edge, so we need to set halfedge_target
|
||||||
// information to true
|
// information to true
|
||||||
set_halfedge_target_info(new_h, id, true);
|
set_halfedge_target_info(new_h, id, true);
|
||||||
// and target-face information using the original halfedge-face information
|
// and target-face information using the original halfedge-face information
|
||||||
new_h->set_has_equal_aux_data_in_target_and_face
|
new_h->set_has_equal_aux_data_in_target_and_face
|
||||||
(id, on_edge->get_has_equal_data_in_face());
|
(id, on_edge->has_equal_env_data_in_face());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// this cannot happen, since we need to touch an edge
|
// this cannot happen, since we need to touch an edge
|
||||||
|
|
@ -361,34 +364,38 @@ protected:
|
||||||
Halfedge_handle hh;
|
Halfedge_handle hh;
|
||||||
Face_handle fh;
|
Face_handle fh;
|
||||||
// update target
|
// update target
|
||||||
const Object& trg_src = new_h->target()->get_aux_source(id);
|
const Object& trg_src = new_h->target()->aux_source(id);
|
||||||
if (assign(vh, trg_src)) {
|
if (assign(vh, trg_src)) {
|
||||||
if (vh->is_isolated()) {
|
if (vh->is_isolated()) {
|
||||||
copy_halfedge_target_info_from_vertex_face_info(vh, new_h, id);
|
copy_halfedge_target_info_from_vertex_face_info(vh, new_h, id);
|
||||||
// the target-face information is taken from vertex-face information too
|
// the target-face information is taken from vertex-face information too
|
||||||
new_h->set_has_equal_aux_data_in_target_and_face
|
new_h->set_has_equal_aux_data_in_target_and_face
|
||||||
(id, vh->get_has_equal_data_in_face());
|
(id, vh->has_equal_env_data_in_face());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// we have a vertex vh on the boundary of the face in_face
|
// we have a vertex vh on the boundary of the face in_face
|
||||||
// todo: get rid of this calculations: (using unknown value for
|
// todo: get rid of this calculations: (using unknown value for
|
||||||
// has_equal flag)
|
// has_equal flag)
|
||||||
/*CGAL_assertion_code(
|
// CGAL_assertion_code(
|
||||||
bool calc_is_equal = vh->is_equal_data(in_face->begin_data(), in_face->end_data());
|
// bool calc_is_equal = vh->is_equal_env_data(in_face->begin_env_data(),
|
||||||
)*/
|
// in_face->end_env_data());
|
||||||
//bool calc_has_equal = vh->has_equal_data(in_face->begin_data(), in_face->end_data());
|
// )
|
||||||
|
//
|
||||||
|
// bool calc_has_equal = vh->has_equal_env_data(in_face->begin_env_data(),
|
||||||
|
// in_face->end_env_data());
|
||||||
|
|
||||||
// find the halfedge with target vh on the boundary of in_face
|
// find the halfedge with target vh on the boundary of in_face
|
||||||
Halfedge_handle h_of_vh_and_in_face =
|
Halfedge_handle h_of_vh_and_in_face =
|
||||||
find_halfedge_by_vertex_and_face(vh, in_face);
|
find_halfedge_by_vertex_and_face(vh, in_face);
|
||||||
// is_equal relationship is easy:
|
// is_equal relationship is easy:
|
||||||
bool is_equal = h_of_vh_and_in_face->get_is_equal_data_in_face() &&
|
bool is_equal = h_of_vh_and_in_face->is_equal_env_data_in_face() &&
|
||||||
h_of_vh_and_in_face->get_is_equal_data_in_target();
|
h_of_vh_and_in_face->is_equal_env_data_in_target();
|
||||||
//CGAL_assertion(is_equal == calc_is_equal);
|
//CGAL_assertion(is_equal == calc_is_equal);
|
||||||
|
|
||||||
// has_equal relationship is problematic in one case:
|
// has_equal relationship is problematic in one case:
|
||||||
bool has_equal =
|
bool has_equal =
|
||||||
h_of_vh_and_in_face->get_has_equal_data_in_target_and_face();
|
h_of_vh_and_in_face->has_equal_env_data_in_target_and_face();
|
||||||
|
|
||||||
/*CGAL_assertion(has_equal == calc_has_equal);
|
/*CGAL_assertion(has_equal == calc_has_equal);
|
||||||
if(has_equal != calc_has_equal)
|
if(has_equal != calc_has_equal)
|
||||||
|
|
@ -419,8 +426,8 @@ protected:
|
||||||
// the face data
|
// the face data
|
||||||
CGAL_assertion(fh == in_face);
|
CGAL_assertion(fh == in_face);
|
||||||
new_h->set_is_equal_aux_data_in_target(id, true);
|
new_h->set_is_equal_aux_data_in_target(id, true);
|
||||||
new_h->set_has_equal_aux_data_in_target(id, !fh->has_no_data());
|
new_h->set_has_equal_aux_data_in_target(id, ! fh->has_no_env_data());
|
||||||
new_h->set_has_equal_aux_data_in_target_and_face(id, !fh->has_no_data());
|
new_h->set_has_equal_aux_data_in_target_and_face(id, ! fh->has_no_env_data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*! data container */
|
/*! data container */
|
||||||
Data_container m_data;
|
Data_container m_env_data;
|
||||||
|
|
||||||
/*! Indicates that the data (surfaces) have been set already */
|
/*! Indicates that the data (surfaces) have been set already */
|
||||||
bool m_is_set;
|
bool m_is_set;
|
||||||
|
|
@ -48,14 +48,14 @@ public:
|
||||||
Dcel_info() : m_is_set(false), m_decision(DAC_DECISION_NOT_SET) {}
|
Dcel_info() : m_is_set(false), m_decision(DAC_DECISION_NOT_SET) {}
|
||||||
|
|
||||||
/*! \brief returns true iff data has been set already */
|
/*! \brief returns true iff data has been set already */
|
||||||
bool get_is_set() const { return m_is_set; }
|
bool env_is_set() const { return m_is_set; }
|
||||||
|
|
||||||
/*! \brief resets the flag */
|
/*! \brief resets the flag */
|
||||||
void set_is_set(bool flag) { m_is_set = flag; }
|
void set_is_set(bool flag) { m_is_set = flag; }
|
||||||
|
|
||||||
bool is_decision_set() { return (m_decision != DAC_DECISION_NOT_SET); }
|
bool is_decision_set() { return (m_decision != DAC_DECISION_NOT_SET); }
|
||||||
|
|
||||||
Dac_decision get_decision() const { return m_decision; }
|
Dac_decision decision() const { return m_decision; }
|
||||||
|
|
||||||
void set_decision(Comparison_result comp)
|
void set_decision(Comparison_result comp)
|
||||||
{ m_decision = enum_cast<Dac_decision>(comp); }
|
{ m_decision = enum_cast<Dac_decision>(comp); }
|
||||||
|
|
@ -63,55 +63,56 @@ public:
|
||||||
void set_decision(Dac_decision dec) { m_decision = dec; }
|
void set_decision(Dac_decision dec) { m_decision = dec; }
|
||||||
|
|
||||||
/*! User-friendly interface: */
|
/*! User-friendly interface: */
|
||||||
size_t number_of_surfaces() const { return m_data.size(); }
|
size_t number_of_surfaces() const { return m_env_data.size(); }
|
||||||
|
|
||||||
Data_const_iterator surfaces_begin() const { return m_data.begin(); }
|
Data_const_iterator surfaces_begin() const { return m_env_data.begin(); }
|
||||||
|
|
||||||
Data_const_iterator surfaces_end() const { return m_data.end(); }
|
Data_const_iterator surfaces_end() const { return m_env_data.end(); }
|
||||||
|
|
||||||
/*! Obtain the first Xy-monotone surface associated with the face.
|
/*! Obtain the first Xy-monotone surface associated with the face.
|
||||||
* \pre number_of_surfaces() is not 0.
|
* \pre number_of_surfaces() is not 0.
|
||||||
*/
|
*/
|
||||||
const Data& surface() const {
|
const Data& surface() const {
|
||||||
CGAL_precondition(m_data.size() > 0);
|
CGAL_precondition(m_env_data.size() > 0);
|
||||||
return m_data.front();
|
return m_env_data.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Obtain the number of data objects associated with the face.
|
/*! Obtain the number of data objects associated with the cell.
|
||||||
*/
|
*/
|
||||||
int number_of_data_objects() const { return static_cast<int>(m_data.size()); }
|
int env_data_size() const
|
||||||
|
{ return static_cast<int>(m_env_data.size()); }
|
||||||
|
|
||||||
/*! Check whether the data is set to be empty
|
/*! Check whether the data is set to be empty
|
||||||
*/
|
*/
|
||||||
bool has_no_data() const
|
bool has_no_env_data() const
|
||||||
{ return (m_is_set && (number_of_data_objects() == 0)); }
|
{ return (m_is_set && (env_data_size() == 0)); }
|
||||||
|
|
||||||
/*! Obtain the first data object associated with the face.
|
/*! Obtain the first data object associated with the cell.
|
||||||
* \pre number_of_data_objects() is not 0.
|
* \pre m_env_data.size() is not 0.
|
||||||
*/
|
*/
|
||||||
const Data& get_env_data() const {
|
const Data& env_data_front() const {
|
||||||
CGAL_precondition(m_data.size() > 0);
|
CGAL_precondition(m_env_data.size() > 0);
|
||||||
return m_data.front();
|
return m_env_data.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Obtain the data iterators (const version).
|
/*! Obtain the data iterators (const version).
|
||||||
*/
|
*/
|
||||||
Data_const_iterator begin_data() const { return m_data.begin(); }
|
Data_const_iterator begin_env_data() const { return m_env_data.begin(); }
|
||||||
|
|
||||||
Data_const_iterator end_data() const { return m_data.end(); }
|
Data_const_iterator end_env_data() const { return m_env_data.end(); }
|
||||||
|
|
||||||
/*! Obtain the data iterators (non-const version).
|
/*! Obtain the data iterators (non-const version).
|
||||||
*/
|
*/
|
||||||
Data_iterator begin_data() { return m_data.begin(); }
|
Data_iterator begin_env_data() { return m_env_data.begin(); }
|
||||||
|
|
||||||
Data_iterator end_data() { return m_data.end(); }
|
Data_iterator end_env_data() { return m_env_data.end(); }
|
||||||
|
|
||||||
/*! Set a data object to the face.
|
/*! Set a data object to the face.
|
||||||
* \param data The data object to set.
|
* \param data The data object to set.
|
||||||
*/
|
*/
|
||||||
void set_env_data(const Data& data) {
|
void set_env_data(const Data& data) {
|
||||||
clear_data();
|
clear_env_data();
|
||||||
add_data(data);
|
add_env_data(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Set a range of data objects to the face.
|
/*! Set a range of data objects to the face.
|
||||||
|
|
@ -120,22 +121,22 @@ public:
|
||||||
*/
|
*/
|
||||||
template <typename InputIterator>
|
template <typename InputIterator>
|
||||||
void set_env_data(InputIterator begin, InputIterator end) {
|
void set_env_data(InputIterator begin, InputIterator end) {
|
||||||
clear_data();
|
clear_env_data();
|
||||||
add_data(begin, end);
|
add_env_data(begin, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! set the data to be empty.
|
/*! set the data to be empty.
|
||||||
*/
|
*/
|
||||||
void set_no_data() {
|
void set_no_env_data() {
|
||||||
clear_data();
|
clear_env_data();
|
||||||
m_is_set = true;
|
m_is_set = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Add a data object to the face.
|
/*! Add a data object to the face.
|
||||||
* \param data The additional data object.
|
* \param data The additional data object.
|
||||||
*/
|
*/
|
||||||
void add_data(const Data& data) {
|
void add_env_data(const Data& data) {
|
||||||
m_data.push_back(data);
|
m_env_data.push_back(data);
|
||||||
m_is_set = true;
|
m_is_set = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,15 +145,15 @@ public:
|
||||||
* \param end A past-the-end iterator for the data range.
|
* \param end A past-the-end iterator for the data range.
|
||||||
*/
|
*/
|
||||||
template <typename InputIterator>
|
template <typename InputIterator>
|
||||||
void add_data(InputIterator begin, InputIterator end) {
|
void add_env_data(InputIterator begin, InputIterator end) {
|
||||||
for (auto it = begin; it != end; it++) m_data.push_back(*it);
|
for (auto it = begin; it != end; ++it) m_env_data.push_back(*it);
|
||||||
m_is_set = true;
|
m_is_set = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Clear the data objects.
|
/*! Clear the data objects.
|
||||||
*/
|
*/
|
||||||
void clear_data() {
|
void clear_env_data() {
|
||||||
m_data.clear();
|
m_env_data.clear();
|
||||||
m_is_set = false;
|
m_is_set = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -160,23 +161,23 @@ public:
|
||||||
* set of data objects
|
* set of data objects
|
||||||
*/
|
*/
|
||||||
template <typename InputIterator>
|
template <typename InputIterator>
|
||||||
bool is_equal_data(InputIterator begin, InputIterator end) const {
|
bool is_equal_env_data(InputIterator begin, InputIterator end) const {
|
||||||
if (! get_is_set()) return false;
|
if (! env_is_set()) return false;
|
||||||
|
|
||||||
// insert the input data objects into a set
|
// insert the input data objects into a set
|
||||||
std::set<Data> input_data(begin, end);
|
std::set<Data> input_data(begin, end);
|
||||||
std::set<Data> my_data(begin_data(), end_data());
|
std::set<Data> my_data(begin_env_data(), end_env_data());
|
||||||
if (input_data.size() != my_data.size()) return false;
|
if (input_data.size() != my_data.size()) return false;
|
||||||
return (my_data == input_data);
|
return (my_data == input_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename InputIterator>
|
template <typename InputIterator>
|
||||||
bool has_equal_data(InputIterator begin, InputIterator end) const {
|
bool has_equal_env_data(InputIterator begin, InputIterator end) const {
|
||||||
if (! get_is_set()) return false;
|
if (! env_is_set()) return false;
|
||||||
|
|
||||||
// insert the input data objects into a set
|
// insert the input data objects into a set
|
||||||
std::set<Data> input_data(begin, end);
|
std::set<Data> input_data(begin, end);
|
||||||
std::set<Data> my_data(begin_data(), end_data());
|
std::set<Data> my_data(begin_env_data(), end_env_data());
|
||||||
std::list<Data> intersection;
|
std::list<Data> intersection;
|
||||||
std::set_intersection(my_data.begin(), my_data.end(),
|
std::set_intersection(my_data.begin(), my_data.end(),
|
||||||
input_data.begin(), input_data.end(),
|
input_data.begin(), input_data.end(),
|
||||||
|
|
@ -185,7 +186,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/*! Place holder for the source of the overlay data */
|
/*! Place holder for the source of the overlay data */
|
||||||
Object m_aux_source[2];
|
Object m_aux_source[2];
|
||||||
|
|
||||||
|
|
@ -202,14 +202,14 @@ public:
|
||||||
m_aux_source[id] = o;
|
m_aux_source[id] = o;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Object& get_aux_source(unsigned int id) {
|
const Object& aux_source(unsigned int id) {
|
||||||
CGAL_precondition(id < 2);
|
CGAL_precondition(id < 2);
|
||||||
CGAL_precondition (!m_aux_source[id].is_empty());
|
CGAL_precondition (!m_aux_source[id].is_empty());
|
||||||
return m_aux_source[id];
|
return m_aux_source[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief returns true iff the point has been set already */
|
/*! \brief returns true iff the point has been set already */
|
||||||
bool get_aux_is_set(unsigned int id) const {
|
bool aux_is_set(unsigned int id) const {
|
||||||
CGAL_precondition(id < 2);
|
CGAL_precondition(id < 2);
|
||||||
return (! m_aux_source[id].is_empty());
|
return (! m_aux_source[id].is_empty());
|
||||||
}
|
}
|
||||||
|
|
@ -251,35 +251,25 @@ public:
|
||||||
/*! Constructor */
|
/*! Constructor */
|
||||||
Envelope_pm_vertex() : Dcel_info<Vertex_data>(), flags(0) {}
|
Envelope_pm_vertex() : Dcel_info<Vertex_data>(), flags(0) {}
|
||||||
|
|
||||||
/*void set_is_fake(bool b)
|
/* void set_is_fake(bool b) { set_bit(IS_FAKE, b); }
|
||||||
{
|
* bool is_fake() const { return get_bit(IS_FAKE); }
|
||||||
set_bit(IS_FAKE, b);
|
*/
|
||||||
}
|
|
||||||
bool get_is_fake() const
|
|
||||||
{
|
|
||||||
return get_bit(IS_FAKE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* void set_is_intersection(bool b)
|
/* void set_is_intersection(bool b) { set_bit(IS_INTERSECTION, b); }
|
||||||
{
|
* bool is_intersection() const { return get_bit(IS_FAKE); }
|
||||||
set_bit(IS_INTERSECTION, b);
|
*/
|
||||||
}*/
|
|
||||||
/*bool get_is_intersection() const
|
|
||||||
{
|
|
||||||
return get_bit(IS_FAKE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
void set_is_equal_data_in_face(bool b) { set_bit(IS_EQUAL, b); }
|
void set_is_equal_env_data_in_face(bool b) { set_bit(IS_EQUAL, b); }
|
||||||
bool get_is_equal_data_in_face() const { return get_bit(IS_EQUAL); }
|
bool is_equal_env_data_in_face() const { return get_bit(IS_EQUAL); }
|
||||||
|
|
||||||
void set_has_equal_data_in_face(bool b) { set_bit(HAS_EQUAL, b); }
|
void set_has_equal_env_data_in_face(bool b) { set_bit(HAS_EQUAL, b); }
|
||||||
bool get_has_equal_data_in_face() const { return get_bit(HAS_EQUAL); }
|
bool has_equal_env_data_in_face() const { return get_bit(HAS_EQUAL); }
|
||||||
|
|
||||||
void set_is_equal_aux_data_in_face(unsigned int id, bool b) {
|
void set_is_equal_aux_data_in_face(unsigned int id, bool b) {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
set_bit(IS_EQUAL_AUX+id, b);
|
set_bit(IS_EQUAL_AUX+id, b);
|
||||||
}
|
}
|
||||||
bool get_is_equal_aux_data_in_face(unsigned int id) const {
|
bool is_equal_aux_data_in_face(unsigned int id) const {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
return get_bit(IS_EQUAL_AUX+id);
|
return get_bit(IS_EQUAL_AUX+id);
|
||||||
}
|
}
|
||||||
|
|
@ -288,7 +278,7 @@ public:
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
set_bit(HAS_EQUAL_AUX+id, b);
|
set_bit(HAS_EQUAL_AUX+id, b);
|
||||||
}
|
}
|
||||||
bool get_has_equal_aux_data_in_face(unsigned int id) const {
|
bool has_equal_aux_data_in_face(unsigned int id) const {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
return get_bit(HAS_EQUAL_AUX+id);
|
return get_bit(HAS_EQUAL_AUX+id);
|
||||||
}
|
}
|
||||||
|
|
@ -359,26 +349,21 @@ public:
|
||||||
|
|
||||||
Envelope_pm_halfedge() : Dcel_info<Halfedge_data>(), flags(0) {}
|
Envelope_pm_halfedge() : Dcel_info<Halfedge_data>(), flags(0) {}
|
||||||
|
|
||||||
/* void set_is_fake(bool b)
|
/* void set_is_fake(bool b) { set_bit(IS_FAKE, b); }
|
||||||
{
|
* bool is_fake() const { return get_bit(IS_FAKE); }
|
||||||
set_bit(IS_FAKE, b);
|
*/
|
||||||
}
|
|
||||||
bool get_is_fake() const
|
|
||||||
{
|
|
||||||
return get_bit(IS_FAKE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
void set_is_equal_data_in_face(bool b) { set_bit(IS_EQUAL_FACE, b); }
|
void set_is_equal_env_data_in_face(bool b) { set_bit(IS_EQUAL_FACE, b); }
|
||||||
bool get_is_equal_data_in_face() const { return get_bit(IS_EQUAL_FACE); }
|
bool is_equal_env_data_in_face() const { return get_bit(IS_EQUAL_FACE); }
|
||||||
|
|
||||||
void set_has_equal_data_in_face(bool b) { set_bit(HAS_EQUAL_FACE, b); }
|
void set_has_equal_env_data_in_face(bool b) { set_bit(HAS_EQUAL_FACE, b); }
|
||||||
bool get_has_equal_data_in_face() const { return get_bit(HAS_EQUAL_FACE); }
|
bool has_equal_env_data_in_face() const { return get_bit(HAS_EQUAL_FACE); }
|
||||||
|
|
||||||
void set_is_equal_aux_data_in_face(unsigned int id, bool b) {
|
void set_is_equal_aux_data_in_face(unsigned int id, bool b) {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
set_bit(IS_EQUAL_AUX_FACE+id, b);
|
set_bit(IS_EQUAL_AUX_FACE+id, b);
|
||||||
}
|
}
|
||||||
bool get_is_equal_aux_data_in_face(unsigned int id) const {
|
bool is_equal_aux_data_in_face(unsigned int id) const {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
return get_bit(IS_EQUAL_AUX_FACE+id);
|
return get_bit(IS_EQUAL_AUX_FACE+id);
|
||||||
}
|
}
|
||||||
|
|
@ -387,22 +372,22 @@ public:
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
set_bit(HAS_EQUAL_AUX_FACE+id, b);
|
set_bit(HAS_EQUAL_AUX_FACE+id, b);
|
||||||
}
|
}
|
||||||
bool get_has_equal_aux_data_in_face(unsigned int id) const {
|
bool has_equal_aux_data_in_face(unsigned int id) const {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
return get_bit(HAS_EQUAL_AUX_FACE+id);
|
return get_bit(HAS_EQUAL_AUX_FACE+id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_is_equal_data_in_target(bool b) { set_bit(IS_EQUAL_TARGET, b); }
|
void set_is_equal_env_data_in_target(bool b) { set_bit(IS_EQUAL_TARGET, b); }
|
||||||
bool get_is_equal_data_in_target() const { return get_bit(IS_EQUAL_TARGET); }
|
bool is_equal_env_data_in_target() const { return get_bit(IS_EQUAL_TARGET); }
|
||||||
|
|
||||||
void set_has_equal_data_in_target(bool b) { set_bit(HAS_EQUAL_TARGET, b); }
|
void set_has_equal_env_data_in_target(bool b) { set_bit(HAS_EQUAL_TARGET, b); }
|
||||||
bool get_has_equal_data_in_target() const { return get_bit(HAS_EQUAL_TARGET); }
|
bool has_equal_env_data_in_target() const { return get_bit(HAS_EQUAL_TARGET); }
|
||||||
|
|
||||||
void set_is_equal_aux_data_in_target(unsigned int id, bool b) {
|
void set_is_equal_aux_data_in_target(unsigned int id, bool b) {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
set_bit(IS_EQUAL_AUX_TARGET+id, b);
|
set_bit(IS_EQUAL_AUX_TARGET+id, b);
|
||||||
}
|
}
|
||||||
bool get_is_equal_aux_data_in_target(unsigned int id) const {
|
bool is_equal_aux_data_in_target(unsigned int id) const {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
return get_bit(IS_EQUAL_AUX_TARGET+id);
|
return get_bit(IS_EQUAL_AUX_TARGET+id);
|
||||||
}
|
}
|
||||||
|
|
@ -411,21 +396,21 @@ public:
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
set_bit(HAS_EQUAL_AUX_TARGET+id, b);
|
set_bit(HAS_EQUAL_AUX_TARGET+id, b);
|
||||||
}
|
}
|
||||||
bool get_has_equal_aux_data_in_target(unsigned int id) const {
|
bool has_equal_aux_data_in_target(unsigned int id) const {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
return get_bit(HAS_EQUAL_AUX_TARGET+id);
|
return get_bit(HAS_EQUAL_AUX_TARGET+id);
|
||||||
}
|
}
|
||||||
// access to flags that contain relation between target and face
|
// access to flags that contain relation between target and face
|
||||||
void set_has_equal_data_in_target_and_face(bool b)
|
void set_has_equal_env_data_in_target_and_face(bool b)
|
||||||
{ set_bit(HAS_EQUAL_F_T, b); }
|
{ set_bit(HAS_EQUAL_F_T, b); }
|
||||||
bool get_has_equal_data_in_target_and_face() const
|
bool has_equal_env_data_in_target_and_face() const
|
||||||
{ return get_bit(HAS_EQUAL_F_T); }
|
{ return get_bit(HAS_EQUAL_F_T); }
|
||||||
|
|
||||||
void set_has_equal_aux_data_in_target_and_face(unsigned int id, bool b) {
|
void set_has_equal_aux_data_in_target_and_face(unsigned int id, bool b) {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
set_bit(HAS_EQUAL_AUX_F_T+id, b);
|
set_bit(HAS_EQUAL_AUX_F_T+id, b);
|
||||||
}
|
}
|
||||||
bool get_has_equal_aux_data_in_target_and_face(unsigned int id) const {
|
bool has_equal_aux_data_in_target_and_face(unsigned int id) const {
|
||||||
CGAL_assertion(id < 2);
|
CGAL_assertion(id < 2);
|
||||||
return get_bit(HAS_EQUAL_AUX_F_T+id);
|
return get_bit(HAS_EQUAL_AUX_F_T+id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,34 +124,37 @@ public:
|
||||||
Xy_monotone_surface_3& prev_surface = surfaces[j];
|
Xy_monotone_surface_3& prev_surface = surfaces[j];
|
||||||
|
|
||||||
std::vector<std::variant<Intersection_curve,Point_2>> inter_objs;
|
std::vector<std::variant<Intersection_curve,Point_2>> inter_objs;
|
||||||
traits.construct_projected_intersections_2_object()(cur_surface, prev_surface, std::back_inserter(inter_objs));
|
traits.construct_projected_intersections_2_object()
|
||||||
|
(cur_surface, prev_surface, std::back_inserter(inter_objs));
|
||||||
|
|
||||||
// we collect all intersections and use sweep to insert them
|
// we collect all intersections and use sweep to insert them
|
||||||
for (std::size_t k = 0; k < inter_objs.size(); ++k) {
|
for (std::size_t k = 0; k < inter_objs.size(); ++k) {
|
||||||
if (const Point_2* point = std::get_if<Point_2>(&inter_objs[k])) {
|
if (const Point_2* point = std::get_if<Point_2>(&inter_objs[k])) {
|
||||||
#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
||||||
std::cout << "intersection between surfaces is a point: "
|
std::cout << "intersection between surfaces is a point: "
|
||||||
<< point << std::endl;
|
<< point << std::endl;
|
||||||
#endif
|
#endif
|
||||||
//insert_vertex(result, point, pl);
|
//insert_vertex(result, point, pl);
|
||||||
points_col.push_back(*point);
|
points_col.push_back(*point);
|
||||||
}
|
}
|
||||||
else if (const auto* curve =
|
else if (const auto* curve =
|
||||||
std::get_if<Intersection_curve>(&inter_objs[k])) {
|
std::get_if<Intersection_curve>(&inter_objs[k])) {
|
||||||
curves_col.push_back(curve->first);
|
curves_col.push_back(curve->first);
|
||||||
/*#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
/* #ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
||||||
std::cout << "intersection between surfaces is a curve: " << curve.first << std::endl;
|
* std::cout << "intersection between surfaces is a curve: "
|
||||||
#endif
|
* << curve.first << std::endl;
|
||||||
std::list<Object> objs;
|
* #endif
|
||||||
traits.make_x_monotone_2_object()(curve.first, std::back_inserter(objs));
|
* std::list<Object> objs;
|
||||||
std::list<Object>::iterator itr;
|
* traits.make_x_monotone_2_object()(curve.first,
|
||||||
for(itr = objs.begin(); itr != objs.end(); ++itr)
|
* std::back_inserter(objs));
|
||||||
{
|
* std::list<Object>::iterator itr;
|
||||||
X_monotone_curve_2 curr_cv;
|
* for(itr = objs.begin(); itr != objs.end(); ++itr) {
|
||||||
assert(assign(curr_cv, *itr));
|
* X_monotone_curve_2 curr_cv;
|
||||||
assign(curr_cv, *itr);
|
* assert(assign(curr_cv, *itr));
|
||||||
curves_col.push_back(curr_cv);
|
* assign(curr_cv, *itr);
|
||||||
}*/
|
* curves_col.push_back(curr_cv);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
//insert(result, curve.first, pl);
|
//insert(result, curve.first, pl);
|
||||||
}
|
}
|
||||||
else assert_msg(false, "wrong intersection type");
|
else assert_msg(false, "wrong intersection type");
|
||||||
|
|
@ -167,7 +170,8 @@ public:
|
||||||
|
|
||||||
m_result = &result;
|
m_result = &result;
|
||||||
|
|
||||||
// now, foreach vertex, edge and face, we should determine which surfaces are minimal over it.
|
// now, foreach vertex, edge and face, we should determine which surfaces
|
||||||
|
// are minimal over it.
|
||||||
|
|
||||||
// update vertices' data
|
// update vertices' data
|
||||||
for (auto vi = result.vertices_begin(); vi != result.vertices_end(); ++vi) {
|
for (auto vi = result.vertices_begin(); vi != result.vertices_end(); ++vi) {
|
||||||
|
|
@ -242,16 +246,16 @@ protected:
|
||||||
template <typename SurfaceIterator>
|
template <typename SurfaceIterator>
|
||||||
void set_minimum_over_vertex(const Vertex_handle& v,
|
void set_minimum_over_vertex(const Vertex_handle& v,
|
||||||
SurfaceIterator begin, SurfaceIterator end) {
|
SurfaceIterator begin, SurfaceIterator end) {
|
||||||
if (begin == end) v->set_no_data();
|
if (begin == end) v->set_no_env_data();
|
||||||
else {
|
else {
|
||||||
auto si = begin;
|
auto si = begin;
|
||||||
// we set the first surface as the minimum, and then compare all the others
|
// we set the first surface as the minimum, and then compare all the others
|
||||||
v->set_env_data(*si);
|
v->set_env_data(*si);
|
||||||
++si;
|
++si;
|
||||||
for (; si != end; ++si) {
|
for (; si != end; ++si) {
|
||||||
Comparison_result cr =
|
auto cr = traits.compare_z_at_xy_3_object()(v->point(),
|
||||||
traits.compare_z_at_xy_3_object()(v->point(), v->get_env_data(), *si);
|
v->env_data_front(), *si);
|
||||||
if (cr == EQUAL) v->add_data(*si);
|
if (cr == EQUAL) v->add_env_data(*si);
|
||||||
// this erases all surfaces from vertex's list
|
// this erases all surfaces from vertex's list
|
||||||
else if (cr == LARGER) v->set_env_data(*si);
|
else if (cr == LARGER) v->set_env_data(*si);
|
||||||
// else - new surface has no affect on the envelope
|
// else - new surface has no affect on the envelope
|
||||||
|
|
@ -264,7 +268,7 @@ protected:
|
||||||
template <typename SurfaceIterator>
|
template <typename SurfaceIterator>
|
||||||
void set_minimum_over_edge(const Halfedge_handle& h, SurfaceIterator begin,
|
void set_minimum_over_edge(const Halfedge_handle& h, SurfaceIterator begin,
|
||||||
SurfaceIterator end) {
|
SurfaceIterator end) {
|
||||||
if (begin == end) h->set_no_data();
|
if (begin == end) h->set_no_env_data();
|
||||||
else {
|
else {
|
||||||
if (h != current_edge) compute_point_in_current_edge(h);
|
if (h != current_edge) compute_point_in_current_edge(h);
|
||||||
|
|
||||||
|
|
@ -273,16 +277,15 @@ protected:
|
||||||
h->set_env_data(*si);
|
h->set_env_data(*si);
|
||||||
++si;
|
++si;
|
||||||
for (; si != end; ++si) {
|
for (; si != end; ++si) {
|
||||||
Comparison_result cr =
|
auto cr = traits.compare_z_at_xy_3_object()(current_point_inside_edge,
|
||||||
traits.compare_z_at_xy_3_object()(current_point_inside_edge,
|
h->env_data_front(), *si);
|
||||||
h->get_env_data(), *si);
|
if (cr == EQUAL) h->add_env_data(*si);
|
||||||
if (cr == EQUAL) h->add_data(*si);
|
|
||||||
// this erases all surfaces from halfedge's list
|
// this erases all surfaces from halfedge's list
|
||||||
else if (cr == LARGER) h->set_env_data(*si);
|
else if (cr == LARGER) h->set_env_data(*si);
|
||||||
// else - new surface has no affect on the envelope
|
// else - new surface has no affect on the envelope
|
||||||
}
|
}
|
||||||
// set twin's data
|
// set twin's data
|
||||||
h->twin()->set_env_data(h->begin_data(), h->end_data());
|
h->twin()->set_env_data(h->begin_env_data(), h->end_env_data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -295,7 +298,7 @@ protected:
|
||||||
if (face->is_unbounded() || begin == end) {
|
if (face->is_unbounded() || begin == end) {
|
||||||
// a special case - no surface over the unbounded face, and when there
|
// a special case - no surface over the unbounded face, and when there
|
||||||
// are no surfaces at all
|
// are no surfaces at all
|
||||||
face->set_no_data();
|
face->set_no_env_data();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
auto si = begin;
|
auto si = begin;
|
||||||
|
|
@ -303,9 +306,8 @@ protected:
|
||||||
face->set_env_data(*si);
|
face->set_env_data(*si);
|
||||||
++si;
|
++si;
|
||||||
for (; si != end; ++si) {
|
for (; si != end; ++si) {
|
||||||
Comparison_result cr =
|
auto cr = compare_surfaces_over_face(face, face->env_data_front(), *si);
|
||||||
compare_surfaces_over_face(face, face->get_env_data(), *si);
|
if (cr == EQUAL) face->add_env_data(*si);
|
||||||
if (cr == EQUAL) face->add_data(*si);
|
|
||||||
// this erases all surfaces from face's list
|
// this erases all surfaces from face's list
|
||||||
else if (cr == LARGER) face->set_env_data(*si);
|
else if (cr == LARGER) face->set_env_data(*si);
|
||||||
// else - new surface has no affect on the envelope
|
// else - new surface has no affect on the envelope
|
||||||
|
|
@ -329,7 +331,8 @@ protected:
|
||||||
cur_res = traits.compare_z_at_xy_3_object()(current_point,surf1,surf2);
|
cur_res = traits.compare_z_at_xy_3_object()(current_point,surf1,surf2);
|
||||||
|
|
||||||
#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
||||||
std::cout << "for comparison inside face, current result = " << cur_res << std::endl;
|
std::cout << "for comparison inside face, current result = " << cur_res
|
||||||
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return cur_res;
|
return cur_res;
|
||||||
|
|
@ -366,7 +369,7 @@ protected:
|
||||||
assert(! face->is_unbounded());
|
assert(! face->is_unbounded());
|
||||||
|
|
||||||
#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
||||||
std::cout << "in compute point inside face" << std::endl;
|
std::cout << "in compute point inside face" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// 1. find an edge on the outer ccb of the face that is not vertical
|
// 1. find an edge on the outer ccb of the face that is not vertical
|
||||||
|
|
@ -374,12 +377,12 @@ protected:
|
||||||
Ccb_halfedge_circulator hec_begin = hec;
|
Ccb_halfedge_circulator hec_begin = hec;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
do {
|
do {
|
||||||
if (!traits.is_vertical_2_object()(hec->curve())) {
|
if (! traits.is_vertical_2_object()(hec->curve())) {
|
||||||
found = true;
|
found = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
hec++;
|
++hec;
|
||||||
} while(hec != hec_begin && !found);
|
} while ((hec != hec_begin) && ! found);
|
||||||
assert(found);
|
assert(found);
|
||||||
|
|
||||||
Halfedge_handle found_hh = hec;
|
Halfedge_handle found_hh = hec;
|
||||||
|
|
@ -388,10 +391,10 @@ protected:
|
||||||
// (we use the middle of the curve)
|
// (we use the middle of the curve)
|
||||||
Point_2 shoot_source = traits.construct_middle_point(found_hh->curve());
|
Point_2 shoot_source = traits.construct_middle_point(found_hh->curve());
|
||||||
|
|
||||||
// 3. ray shoot up or down, into the face
|
// 3. ray shoot up or down, into the face and find the intersection point
|
||||||
// and find the intersection point of the ray. the segment between
|
// of the ray. the segment between the point from which we shoot,
|
||||||
// the point from which we shoot, and the intersection point lies
|
// and the intersection point lies inside the face.
|
||||||
// inside the face. we take its middle point as a point inside the face
|
// we take its middle point as a point inside the face
|
||||||
bool shoot_up = true;
|
bool shoot_up = true;
|
||||||
// TODO_NEW_DESIGN - check this
|
// TODO_NEW_DESIGN - check this
|
||||||
// if (traits.compare_x(found_hh->source()->point(), found_hh->target()->point()) == LARGER)
|
// if (traits.compare_x(found_hh->source()->point(), found_hh->target()->point()) == LARGER)
|
||||||
|
|
@ -418,20 +421,19 @@ protected:
|
||||||
|
|
||||||
Point_2 res_point = traits.construct_middle_point(shoot_source, shoot_target);
|
Point_2 res_point = traits.construct_middle_point(shoot_source, shoot_target);
|
||||||
|
|
||||||
#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
#ifdef CGAL_DEBUG_ENVELOPE_TEST_3
|
||||||
std::cout << "finished computing point in face" << std::endl;
|
std::cout << "finished computing point in face" << std::endl;
|
||||||
|
|
||||||
// just for checking, locate res_point in env to find face
|
// just for checking, locate res_point in env to find face
|
||||||
Object test_pl_obj = pl.locate(res_point);
|
Object test_pl_obj = pl.locate(res_point);
|
||||||
Face_const_handle test_fh;
|
Face_const_handle test_fh;
|
||||||
assert(assign(test_fh, test_pl_obj));
|
assert(assign(test_fh, test_pl_obj));
|
||||||
assert(test_fh == face);
|
assert(test_fh == face);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return res_point;
|
return res_point;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// compute a point inside the face saved in current_face
|
// compute a point inside the face saved in current_face
|
||||||
// and put the result into current_point
|
// and put the result into current_point
|
||||||
void compute_point_in_current_face(Face_handle face) {
|
void compute_point_in_current_face(Face_handle face) {
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public:
|
||||||
void create_face (Face_handle1 f1, Face_handle2 f2, Res_face_handle res_f) {
|
void create_face (Face_handle1 f1, Face_handle2 f2, Res_face_handle res_f) {
|
||||||
res_f->set_aux_source(0, f1);
|
res_f->set_aux_source(0, f1);
|
||||||
res_f->set_aux_source(1, f2);
|
res_f->set_aux_source(1, f2);
|
||||||
assert_msg(f1->is_equal_data(f2->begin_data(), f2->end_data()),
|
assert_msg(f1->is_equal_env_data(f2->begin_env_data(), f2->end_env_data()),
|
||||||
"data different over face");
|
"data different over face");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ public:
|
||||||
Res_vertex_handle res_v) {
|
Res_vertex_handle res_v) {
|
||||||
res_v->set_aux_source(0, h1);
|
res_v->set_aux_source(0, h1);
|
||||||
res_v->set_aux_source(1, h2);
|
res_v->set_aux_source(1, h2);
|
||||||
assert_msg(h1->is_equal_data(h2->begin_data(), h2->end_data()),
|
assert_msg(h1->is_equal_env_data(h2->begin_env_data(), h2->end_env_data()),
|
||||||
"data different over vertex");
|
"data different over vertex");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,40 +72,40 @@ public:
|
||||||
Res_vertex_handle res_v) {
|
Res_vertex_handle res_v) {
|
||||||
res_v->set_aux_source(0, v1);
|
res_v->set_aux_source(0, v1);
|
||||||
res_v->set_aux_source(1, v2);
|
res_v->set_aux_source(1, v2);
|
||||||
assert_msg(v1->is_equal_data(v2->begin_data(), v2->end_data()),
|
assert_msg(v1->is_equal_env_data(v2->begin_env_data(), v2->end_env_data()),
|
||||||
"data different over vertex");
|
"data different over vertex");
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_vertex(Vertex_handle1 v1, Halfedge_handle2 h2,
|
void create_vertex(Vertex_handle1 v1, Halfedge_handle2 h2,
|
||||||
Res_vertex_handle res_v) {
|
Res_vertex_handle res_v) {
|
||||||
res_v->set_aux_source(0, v1);
|
res_v->set_aux_source(0, v1);
|
||||||
res_v->set_aux_source(1, h2);
|
res_v->set_aux_source(1, h2);
|
||||||
assert_msg(v1->is_equal_data(h2->begin_data(), h2->end_data()),
|
assert_msg(v1->is_equal_env_data(h2->begin_env_data(), h2->end_env_data()),
|
||||||
"data different over vertex");
|
"data different over vertex");
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_vertex(Halfedge_handle1 h1, Vertex_handle2 v2,
|
void create_vertex(Halfedge_handle1 h1, Vertex_handle2 v2,
|
||||||
Res_vertex_handle res_v) {
|
Res_vertex_handle res_v) {
|
||||||
res_v->set_aux_source(0, h1);
|
res_v->set_aux_source(0, h1);
|
||||||
res_v->set_aux_source(1, v2);
|
res_v->set_aux_source(1, v2);
|
||||||
assert_msg(h1->is_equal_data(v2->begin_data(), v2->end_data()),
|
assert_msg(h1->is_equal_env_data(v2->begin_env_data(), v2->end_env_data()),
|
||||||
"data different over vertex");
|
"data different over vertex");
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_vertex(Face_handle1 f1, Vertex_handle2 v2,
|
void create_vertex(Face_handle1 f1, Vertex_handle2 v2,
|
||||||
Res_vertex_handle res_v) {
|
Res_vertex_handle res_v) {
|
||||||
res_v->set_aux_source(0, f1);
|
res_v->set_aux_source(0, f1);
|
||||||
res_v->set_aux_source(1, v2);
|
res_v->set_aux_source(1, v2);
|
||||||
assert_msg(f1->is_equal_data(v2->begin_data(), v2->end_data()),
|
assert_msg(f1->is_equal_env_data(v2->begin_env_data(), v2->end_env_data()),
|
||||||
"data different over vertex");
|
"data different over vertex");
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_vertex(Vertex_handle1 v1, Face_handle2 f2,
|
void create_vertex(Vertex_handle1 v1, Face_handle2 f2,
|
||||||
Res_vertex_handle res_v) {
|
Res_vertex_handle res_v) {
|
||||||
res_v->set_aux_source(0, v1);
|
res_v->set_aux_source(0, v1);
|
||||||
res_v->set_aux_source(1, f2);
|
res_v->set_aux_source(1, f2);
|
||||||
assert_msg(v1->is_equal_data(f2->begin_data(), f2->end_data()),
|
assert_msg(v1->is_equal_env_data(f2->begin_env_data(), f2->end_env_data()),
|
||||||
"data different over vertex");
|
"data different over vertex");
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_edge(Halfedge_handle1 h1, Halfedge_handle2 h2,
|
void create_edge(Halfedge_handle1 h1, Halfedge_handle2 h2,
|
||||||
|
|
@ -116,8 +116,8 @@ public:
|
||||||
res_h->twin()->set_aux_source(0, h1->twin());
|
res_h->twin()->set_aux_source(0, h1->twin());
|
||||||
res_h->twin()->set_aux_source(1, h2->twin());
|
res_h->twin()->set_aux_source(1, h2->twin());
|
||||||
|
|
||||||
assert_msg(h1->is_equal_data(h2->begin_data(), h2->end_data()),
|
assert_msg(h1->is_equal_env_data(h2->begin_env_data(), h2->end_env_data()),
|
||||||
"data different over edge");
|
"data different over edge");
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_edge(Halfedge_handle1 h1, Face_handle2 f2,
|
void create_edge(Halfedge_handle1 h1, Face_handle2 f2,
|
||||||
|
|
@ -128,8 +128,8 @@ public:
|
||||||
res_h->twin()->set_aux_source(0, h1->twin());
|
res_h->twin()->set_aux_source(0, h1->twin());
|
||||||
res_h->twin()->set_aux_source(1, f2);
|
res_h->twin()->set_aux_source(1, f2);
|
||||||
|
|
||||||
assert_msg(h1->is_equal_data(f2->begin_data(), f2->end_data()),
|
assert_msg(h1->is_equal_env_data(f2->begin_env_data(), f2->end_env_data()),
|
||||||
"data different over edge");
|
"data different over edge");
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_edge(Face_handle1 f1, Halfedge_handle2 h2,
|
void create_edge(Face_handle1 f1, Halfedge_handle2 h2,
|
||||||
|
|
@ -139,11 +139,9 @@ public:
|
||||||
|
|
||||||
res_h->twin()->set_aux_source(0, f1);
|
res_h->twin()->set_aux_source(0, f1);
|
||||||
res_h->twin()->set_aux_source(1, h2->twin());
|
res_h->twin()->set_aux_source(1, h2->twin());
|
||||||
assert_msg(f1->is_equal_data(h2->begin_data(), h2->end_data()),
|
assert_msg(f1->is_equal_env_data(h2->begin_env_data(), h2->end_env_data()),
|
||||||
"data different over edge");
|
"data different over edge");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -176,9 +176,8 @@ public:
|
||||||
Vertex_handle vh = vi;
|
Vertex_handle vh = vi;
|
||||||
// first we find the surfaces that are defined over the vertex
|
// first we find the surfaces that are defined over the vertex
|
||||||
std::list<Xy_monotone_surface_3> defined_surfaces;
|
std::list<Xy_monotone_surface_3> defined_surfaces;
|
||||||
typename Traits::Is_defined_over is_defined_over =
|
auto is_defined_over = traits.is_defined_over_object();
|
||||||
traits.is_defined_over_object();
|
for (std::size_t i=0; i<number_of_surfaces; ++i)
|
||||||
for(std::size_t i=0; i<number_of_surfaces; ++i)
|
|
||||||
if (is_defined_over(vh->point(), surfaces[i]))
|
if (is_defined_over(vh->point(), surfaces[i]))
|
||||||
defined_surfaces.push_back(surfaces[i]);
|
defined_surfaces.push_back(surfaces[i]);
|
||||||
|
|
||||||
|
|
@ -229,7 +228,7 @@ public:
|
||||||
// foreach face in the test envelope, compute a point inside the face,
|
// foreach face in the test envelope, compute a point inside the face,
|
||||||
// locate it in the other envelope and compare the surfaces over the 2 faces
|
// locate it in the other envelope and compare the surfaces over the 2 faces
|
||||||
Md2_point_location pl(env);
|
Md2_point_location pl(env);
|
||||||
bool eq, result = true;
|
bool result = true;
|
||||||
for (auto fi = test_env.faces_begin(); fi != test_env.faces_end(); ++fi) {
|
for (auto fi = test_env.faces_begin(); fi != test_env.faces_end(); ++fi) {
|
||||||
Face_handle fh = fi;
|
Face_handle fh = fi;
|
||||||
if (! fh->is_unbounded()) {
|
if (! fh->is_unbounded()) {
|
||||||
|
|
@ -237,8 +236,9 @@ public:
|
||||||
auto pl_obj = pl.locate(inside_test);
|
auto pl_obj = pl.locate(inside_test);
|
||||||
// faces of env must contain the faces of test
|
// faces of env must contain the faces of test
|
||||||
const Face_const_handle* pl_fh = std::get_if<Face_const_handle>(&pl_obj);
|
const Face_const_handle* pl_fh = std::get_if<Face_const_handle>(&pl_obj);
|
||||||
assert(pl_fh!=nullptr);
|
assert(pl_fh != nullptr);
|
||||||
eq = fh->is_equal_data((*pl_fh)->begin_data(), (*pl_fh)->end_data());
|
auto eq = fh->is_equal_env_data((*pl_fh)->begin_env_data(),
|
||||||
|
(*pl_fh)->end_env_data());
|
||||||
assert(eq);
|
assert(eq);
|
||||||
result &= eq;
|
result &= eq;
|
||||||
}
|
}
|
||||||
|
|
@ -265,16 +265,16 @@ protected:
|
||||||
template <typename SurfaceIterator>
|
template <typename SurfaceIterator>
|
||||||
void set_minimum_over_vertex(Vertex_handle v, SurfaceIterator begin,
|
void set_minimum_over_vertex(Vertex_handle v, SurfaceIterator begin,
|
||||||
SurfaceIterator end) {
|
SurfaceIterator end) {
|
||||||
if (begin == end) v->set_no_data();
|
if (begin == end) v->set_no_env_data();
|
||||||
else {
|
else {
|
||||||
auto si = begin;
|
auto si = begin;
|
||||||
// we set the first surface as the minimum, and then compare all the others
|
// we set the first surface as the minimum, and then compare all the others
|
||||||
v->set_env_data(*si);
|
v->set_env_data(*si);
|
||||||
++si;
|
++si;
|
||||||
for (; si != end; ++si) {
|
for (; si != end; ++si) {
|
||||||
Comparison_result cr =
|
auto cr = traits.compare_z_at_xy_3_object()(v->point(),
|
||||||
traits.compare_z_at_xy_3_object()(v->point(), v->get_env_data(), *si);
|
v->env_data_front(), *si);
|
||||||
if (cr == EQUAL) v->add_data(*si);
|
if (cr == EQUAL) v->add_env_data(*si);
|
||||||
// this erases all surfaces from vertex's list
|
// this erases all surfaces from vertex's list
|
||||||
else if (cr == LARGER) v->set_env_data(*si);
|
else if (cr == LARGER) v->set_env_data(*si);
|
||||||
// else - new surface has no affect on the envelope
|
// else - new surface has no affect on the envelope
|
||||||
|
|
@ -287,7 +287,7 @@ protected:
|
||||||
template <typename SurfaceIterator>
|
template <typename SurfaceIterator>
|
||||||
void set_minimum_over_edge(const Halfedge_handle& h, SurfaceIterator begin,
|
void set_minimum_over_edge(const Halfedge_handle& h, SurfaceIterator begin,
|
||||||
SurfaceIterator end) {
|
SurfaceIterator end) {
|
||||||
if (begin == end) h->set_no_data();
|
if (begin == end) h->set_no_env_data();
|
||||||
else {
|
else {
|
||||||
if (h != current_edge) compute_point_in_current_edge(h);
|
if (h != current_edge) compute_point_in_current_edge(h);
|
||||||
|
|
||||||
|
|
@ -296,16 +296,15 @@ protected:
|
||||||
h->set_env_data(*si);
|
h->set_env_data(*si);
|
||||||
++si;
|
++si;
|
||||||
for (; si != end; ++si) {
|
for (; si != end; ++si) {
|
||||||
Comparison_result cr =
|
auto cr = traits.compare_z_at_xy_3_object()(current_point_inside_edge,
|
||||||
traits.compare_z_at_xy_3_object()(current_point_inside_edge,
|
h->env_data_front(), *si);
|
||||||
h->get_env_data(), *si);
|
if (cr == EQUAL) h->add_env_data(*si);
|
||||||
if (cr == EQUAL) h->add_data(*si);
|
|
||||||
// this erases all surfaces from halfedge's list
|
// this erases all surfaces from halfedge's list
|
||||||
else if (cr == LARGER) h->set_env_data(*si);
|
else if (cr == LARGER) h->set_env_data(*si);
|
||||||
// else - new surface has no affect on the envelope
|
// else - new surface has no affect on the envelope
|
||||||
}
|
}
|
||||||
// set twin's data
|
// set twin's data
|
||||||
h->twin()->set_env_data(h->begin_data(), h->end_data());
|
h->twin()->set_env_data(h->begin_env_data(), h->end_env_data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fill the face with the surface on the envelope
|
// fill the face with the surface on the envelope
|
||||||
|
|
@ -317,7 +316,7 @@ protected:
|
||||||
if (face->is_unbounded() || begin == end) {
|
if (face->is_unbounded() || begin == end) {
|
||||||
// a special case - no surface over the unbounded face, and when there
|
// a special case - no surface over the unbounded face, and when there
|
||||||
// are no surfaces at all
|
// are no surfaces at all
|
||||||
face->set_no_data();
|
face->set_no_env_data();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
auto si = begin;
|
auto si = begin;
|
||||||
|
|
@ -326,9 +325,8 @@ protected:
|
||||||
face->set_env_data(*si);
|
face->set_env_data(*si);
|
||||||
++si;
|
++si;
|
||||||
for (; si != end; ++si) {
|
for (; si != end; ++si) {
|
||||||
Comparison_result cr =
|
auto cr = compare_surfaces_over_face(face, face->env_data_front(), *si);
|
||||||
compare_surfaces_over_face(face, face->get_env_data(), *si);
|
if (cr == EQUAL) face->add_env_data(*si);
|
||||||
if (cr == EQUAL) face->add_data(*si);
|
|
||||||
// this erases all surfaces from face's list
|
// this erases all surfaces from face's list
|
||||||
else if (cr == LARGER) face->set_env_data(*si);
|
else if (cr == LARGER) face->set_env_data(*si);
|
||||||
// else - new surface has no affect on the envelope
|
// else - new surface has no affect on the envelope
|
||||||
|
|
@ -392,10 +390,9 @@ protected:
|
||||||
<< cur_res << std::endl;
|
<< cur_res << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cur_res != EQUAL)
|
if (cur_res != EQUAL) found_not_equal = true;
|
||||||
found_not_equal = true;
|
++hec;
|
||||||
hec++;
|
} while ((hec != hec_begin) && ! found_not_equal);
|
||||||
} while(hec != hec_begin && !found_not_equal);
|
|
||||||
// std::cout << "for comparison on vertices, result = " << cur_res
|
// std::cout << "for comparison on vertices, result = " << cur_res
|
||||||
// << std::endl;
|
// << std::endl;
|
||||||
|
|
||||||
|
|
@ -482,11 +479,11 @@ protected:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
result &= tmp_result;
|
result &= tmp_result;
|
||||||
hec++;
|
++hec;
|
||||||
} while(hec != hec_begin && result);
|
} while ((hec != hec_begin) && result);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == false) return result;
|
if (! result) return result;
|
||||||
|
|
||||||
// check vertices on holes boundary
|
// check vertices on holes boundary
|
||||||
Hole_iterator hi;
|
Hole_iterator hi;
|
||||||
|
|
@ -502,9 +499,9 @@ protected:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
result &= tmp_result;
|
result &= tmp_result;
|
||||||
hec++;
|
++hec;
|
||||||
} while(hec != hec_begin && result);
|
} while ((hec != hec_begin) && result);
|
||||||
if (result == false) return result;
|
if (! result) return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -540,8 +537,8 @@ protected:
|
||||||
found = true;
|
found = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
hec++;
|
++hec;
|
||||||
} while (hec != hec_begin && !found);
|
} while ((hec != hec_begin) && !found);
|
||||||
assert(found);
|
assert(found);
|
||||||
|
|
||||||
Halfedge_handle found_hh = hec;
|
Halfedge_handle found_hh = hec;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue