Clean ups; Removed unused types and variables; Fixed limit => boundary terminology

This commit is contained in:
Efi Fogel 2021-08-10 10:49:11 +03:00
parent 0861536c60
commit bfc5b7e6f8
8 changed files with 36 additions and 114 deletions

View File

@ -44,9 +44,9 @@ int main() {
std::cout << " feature above: ";
if (CGAL::assign(hh, curr.second))
std::cout << '[' << hh->curve() << ']\n';
std::cout << '[' << hh->curve() << "]\n";
else if (CGAL::assign(vh, curr.second))
std::cout << '(' << vh->point() << ')\n';
std::cout << '(' << vh->point() << ")\n";
else if (CGAL::assign(fh, curr.second)) std::cout << "NONE\n";
else std::cout << "EMPTY\n";
}

View File

@ -13,11 +13,11 @@ typedef Arr_with_hist::Curve_handle Curve_handle;
typedef CGAL::Arr_trapezoid_ric_point_location<Arr_with_hist> Point_location;
int main() {
// Insert s1, s2, and s3 incrementally.
// Insert 3 curves incrementally.
Arr_with_hist arr;
Curve_handle s1 = insert(arr, Segment(Point(0, 3), Point(4, 3)));
Curve_handle s2 = insert(arr, Segment(Point(3, 2), Point(3, 5)));
Curve_handle s3 = insert(arr, Segment(Point(2, 3), Point(5, 3)));
insert(arr, Segment(Point(0, 3), Point(4, 3)));
insert(arr, Segment(Point(3, 2), Point(3, 5)));
insert(arr, Segment(Point(2, 3), Point(5, 3)));
// Insert three additional segments aggregately.
Segment segs[] = {Segment(Point(2, 6), Point(7, 1)),

View File

@ -39,7 +39,7 @@ int main(int argc, char* argv[]) {
// There should be vit->degree()/2 lines intersecting at the current
// vertex. We print their primal points and their indices.
auto circ = vit->incident_halfedges();
for (auto d = 0; d < vit->degree() / 2; ++d) {
for (size_t d = 0; d < vit->degree() / 2; ++d) {
k = circ->curve().data(); // The index of the primal point.
std::cout << "Point no. " << k+1 << ": (" << points[k] << "), ";
++circ;

View File

@ -1030,7 +1030,7 @@ public:
Parameter_space_in_y_2 parameter_space_in_y_2_object() const
{ return Parameter_space_in_y_2(); }
/*! A function object that compares the x-limits of arc ends on the
/*! A function object that compares the x-limits of line ends on the
* boundary of the parameter space
*/
class Compare_x_on_boundary_2 {

View File

@ -2052,12 +2052,14 @@ public:
// << " " << cv2 << "," << cv2_to_right << "," << std::endl
// << " " << p << ")" << std::endl;
auto equal = m_self->equal_2_object();
auto min_vertex = m_self->construct_min_vertex_2_object();
auto max_vertex = m_self->construct_max_vertex_2_object();
const auto q = (cv_to_right) ? min_vertex(cv) : max_vertex(cv);
const auto q1 = (cv1_to_right) ? min_vertex(cv1) : max_vertex(cv1);
const auto q2 = (cv2_to_right) ? min_vertex(cv2) : max_vertex(cv2);
CGAL_assertion_code
(auto equal = m_self->equal_2_object();
const auto q = (cv_to_right) ? min_vertex(cv) : max_vertex(cv);
const auto q1 = (cv1_to_right) ? min_vertex(cv1) : max_vertex(cv1);
const auto q2 = (cv2_to_right) ? min_vertex(cv2) : max_vertex(cv2);
)
CGAL_assertion(equal(p, q));
CGAL_assertion(equal(p, q1));
CGAL_assertion(equal(p, q2));
@ -2316,7 +2318,7 @@ public:
auto is_on_y_identification = m_self->is_on_y_identification_2_object();
auto cmp_y_near_bd = m_self->compare_y_near_boundary_2_object();
auto psy = ps_in_y(cv, ARR_MAX_END);
CGAL_assertion_code(auto psy = ps_in_y(cv, ARR_MAX_END));
CGAL_assertion(psy == ARR_INTERIOR);
auto on_y_idnt1 = is_on_y_identification(cv1);
@ -2386,7 +2388,7 @@ public:
auto cmp_y_near_bd = m_self->compare_y_near_boundary_2_object();
// Precondition
auto psy = ps_in_y(cv, ARR_MIN_END);
CGAL_assertion_code(auto psy = ps_in_y(cv, ARR_MIN_END));
CGAL_assertion(psy == ARR_INTERIOR);
auto on_y_idnt = is_on_y_identification(cv);
@ -2465,7 +2467,7 @@ public:
auto cmp_y_near_bd = m_self->compare_y_near_boundary_2_object();
// Precondition
auto psy = ps_in_y(cv, ARR_MIN_END);
CGAL_assertion_code(auto psy = ps_in_y(cv, ARR_MIN_END));
CGAL_assertion(psy == ARR_INTERIOR);
auto on_y_idnt = is_on_y_identification(cv);
@ -2539,7 +2541,7 @@ public:
auto is_on_y_identification = m_self->is_on_y_identification_2_object();
auto cmp_y_near_bd = m_self->compare_y_near_boundary_2_object();
auto psy = ps_in_y(cv, ARR_MIN_END);
CGAL_assertion_code(auto psy = ps_in_y(cv, ARR_MIN_END));
CGAL_assertion(psy == ARR_INTERIOR);
auto on_y_idnt1 = is_on_y_identification(cv1);
@ -2632,7 +2634,7 @@ public:
auto is_on_y_identification = m_self->is_on_y_identification_2_object();
auto cmp_y_near_bd = m_self->compare_y_near_boundary_2_object();
auto psy = ps_in_y(cv, ARR_MAX_END);
CGAL_assertion_code(auto psy = ps_in_y(cv, ARR_MAX_END));
CGAL_assertion(psy == ARR_INTERIOR);
auto on_y_idnt = is_on_y_identification(cv);
@ -2658,7 +2660,7 @@ public:
// psx == ARR_RIGHT_BOUNDARY)
auto res = cmp_y_near_bd(cv, cv2, ARR_MAX_END);
if (res == EQUAL) cv_equal_cv2 == true;
if (res == EQUAL) cv_equal_cv2 = true;
return (res == SMALLER);
}
@ -2711,7 +2713,7 @@ public:
auto is_on_y_identification = m_self->is_on_y_identification_2_object();
auto cmp_y_near_bd = m_self->compare_y_near_boundary_2_object();
auto psy = ps_in_y(cv, ARR_MAX_END);
CGAL_assertion_code(auto psy = ps_in_y(cv, ARR_MAX_END));
CGAL_assertion(psy == ARR_INTERIOR);
auto on_y_idnt = is_on_y_identification(cv);
@ -2763,7 +2765,6 @@ public:
Arr_boundary_cond_tag) const
{
auto cmp_y_at_x_left = m_self->compare_y_at_x_left_2_object();
auto cmp_y_at_x_right = m_self->compare_y_at_x_right_2_object();
auto res1 = cmp_y_at_x_left(cv, cv1, p);
auto res2 = cmp_y_at_x_left(cv, cv2, p);
@ -2772,13 +2773,11 @@ public:
if (cv_equal_cv1 || cv_equal_cv2) return false;
auto res = cmp_y_at_x_left(cv1, cv2, p);
if (res == LARGER)
// cv1 is above cv2
return (res1 == LARGER || res2 == SMALLER);
// cv1 is above cv2
if (res == LARGER) return (res1 == LARGER || res2 == SMALLER);
if (res == SMALLER)
// cv1 is below cv2
return (res1 == LARGER && res2 == SMALLER);
// cv1 is below cv2
if (res == SMALLER) return (res1 == LARGER && res2 == SMALLER);
// res == EQUAL && res1 != EQUAL && res2 != EQUAL
return true;
@ -3096,7 +3095,7 @@ public:
* Dispatch calls to traits that handle open and close boundaries, resp.
* The only reason for this dispatcher is the poor choice of different
* names for the Traits functors that handle close and open boundaries:
* Open boundary traits use: Compare_x_at_limit_2
* Open boundary traits use: Compare_x_near_boundary_2
* Close boundary traits use: Compare_x_on_boundary_2
*/
Comparison_result cmp_x_on_bnd(const Point_2& p,
@ -3111,7 +3110,7 @@ public:
* Dispatch calls to traits that handle open and close boundaries, resp.
* The only reason for this dispatcher is the poor choice of different
* names for the Traits functors that handle close and open boundaries:
* Open boundary traits use: Compare_x_at_limit_2
* Open boundary traits use: Compare_x_near_boundary_2
* Close boundary traits use: Compare_x_on_boundary_2
*/
Comparison_result cmp_x_on_bnd(const X_monotone_curve_2& c1,
@ -3177,14 +3176,6 @@ public:
// px1, px2, py1 are interior
if (py1 == ARR_INTERIOR) {
CGAL_assertion(py2 != ARR_INTERIOR);
#if 0
// This code is retained (commented out) because in the future, when
// Compare_x_at_limit_2 and Compare_x_on_boundary will be consolidated,
// say, to Compare_x_on_boundary, it will replace the call below.
typedef typename Self::Compare_x_on_boundary_2 Compare_x_on_boundary_2;
Compare_x_on_boundary_2 cmp_x_on_bnd =
m_self.compare_x_on_boundary_2_object();
#endif
const Point_2& c1_max = m_self.construct_max_vertex_2_object()(c1);
Comparison_result res = cmp_x_on_bnd(c1_max, c2, ARR_MAX_END);
if (res != EQUAL) return res;
@ -3195,14 +3186,6 @@ public:
// px1, px2, py2 are interior
if (py2 == ARR_INTERIOR) {
CGAL_assertion(py1 != ARR_INTERIOR);
#if 0
// This code is retained (commented out) because in the future, when
// Compare_x_at_limit_2 and Compare_x_on_boundary will be consolidated,
// say, to Compare_x_on_boundary, it will replace the call below.
typedef typename Self::Compare_x_on_boundary_2 Compare_x_on_boundary_2;
Compare_x_on_boundary_2 cmp_x_on_bnd =
m_self.compare_x_on_boundary_2_object();
#endif
const Point_2& c2_max = m_self.construct_max_vertex_2_object()(c2);
Comparison_result res = cmp_x_on_bnd(c2_max, c1, ARR_MAX_END);
if (res != EQUAL) return CGAL::opposite(res);
@ -3211,14 +3194,6 @@ public:
}
// Both py1 and py2 not interior
#if 0
// This code is retained (commented out) because in the future, when
// Compare_x_at_limit_2 and Compare_x_on_boundary will be consolidated,
// say, to Compare_x_on_boundary, it will replace the call below.
typedef typename Self::Compare_x_on_boundary_2 Compare_x_on_boundary_2;
Compare_x_on_boundary_2 cmp_x_on_bnd =
m_self.compare_x_on_boundary_2_object();
#endif
Comparison_result res = cmp_x_on_bnd(c1, ARR_MAX_END, c2, ARR_MAX_END);
if (res != EQUAL) return res;
@ -3351,14 +3326,6 @@ public:
//
if (min_py1 == ARR_INTERIOR) {
CGAL_assertion(min_py2 != ARR_INTERIOR);
#if 0
// This code is retained (commented out) because in the future, when
// Compare_x_at_limit_2 and Compare_x_on_boundary will be consolidated,
// say, to Compare_x_on_boundary, it will replace the call below.
typedef typename Self::Compare_x_on_boundary_2 Compare_x_on_boundary_2;
Compare_x_on_boundary_2 cmp_x_on_bnd =
m_self.compare_x_on_boundary_2_object();
#endif
const Point_2& c1_min = m_self.construct_min_vertex_2_object()(c1);
Comparison_result res = cmp_x_on_bnd(c1_min, c2, ARR_MIN_END);
if (res != EQUAL) return res;
@ -3368,14 +3335,6 @@ public:
if (min_py2 == ARR_INTERIOR) {
CGAL_assertion(min_py1 != ARR_INTERIOR);
#if 0
// This code is retained (commented out) because in the future, when
// Compare_x_at_limit_2 and Compare_x_on_boundary will be consolidated,
// say, to Compare_x_on_boundary, it will replace the call below.
typedef typename Self::Compare_x_on_boundary_2 Compare_x_on_boundary_2;
Compare_x_on_boundary_2 cmp_x_on_bnd =
m_self.compare_x_on_boundary_2_object();
#endif
const Point_2& c2_min = m_self.construct_min_vertex_2_object()(c2);
Comparison_result res = cmp_x_on_bnd(c2_min, c1, ARR_MIN_END);
@ -3385,14 +3344,6 @@ public:
}
// Both min_py1 and min_py2 not interior
#if 0
// This code is retained (commented out) because in the future, when
// Compare_x_at_limit_2 and Compare_x_on_boundary will be consolidated,
// say, to Compare_x_on_boundary, it will replace the call below.
typedef typename Self::Compare_x_on_boundary_2 Compare_x_on_boundary_2;
Compare_x_on_boundary_2 cmp_x_on_bnd =
m_self.compare_x_on_boundary_2_object();
#endif
Comparison_result res = cmp_x_on_bnd(c1, ARR_MIN_END, c2, ARR_MIN_END);
if (res != EQUAL) return res;

View File

@ -1011,7 +1011,7 @@ public:
compare_x_near_boundary_2)
CGAL_precondition(Kernel_arc_2_equals_Arc_2 ||
dynamic_cast< const Kernel_arc_2* >(this) != nullptr);
return compare_x_near_limit_2(
return compare_x_near_boundary_2(
p, *dynamic_cast< const Kernel_arc_2* >(this), ce
);
}
@ -1037,7 +1037,7 @@ public:
compare_x_near_boundary_2)
CGAL_precondition(Kernel_arc_2_equals_Arc_2 ||
dynamic_cast< const Kernel_arc_2* >(this) != nullptr);
return compare_x_near_limit_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2, ce);
return compare_x_near_boundary_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2, ce);
}
/*!\brief

View File

@ -99,10 +99,6 @@ public:
}
};
// TODO implement Compare_y_limit_on_boundary_2
template < class CurvedKernelViaAnalysis_2, class FunctorBase >
class Compare_y_near_boundary_2 :
public FunctorBase::Compare_y_near_boundary_2 {

View File

@ -100,8 +100,6 @@ ARE_MERGEABLE=10
MERGE=11
ASSERTIONS=12
CONSTRUCTOR=13
COMPARE_X_AT_LIMIT=14
COMPARE_X_NEAR_LIMIT=15
COMPARE_X_ON_BOUNDARY=16
COMPARE_X_NEAR_BOUNDARY=17
COMPARE_Y_NEAR_BOUNDARY=18
@ -499,13 +497,6 @@ execute_commands_new_structure()
commands_indicator[COMPARE]=0
commands_indicator[VERTEX]=0
commands_indicator[IS_VERTICAL]=0
commands_indicator[COMPARE_X_AT_LIMIT]=0
commands_indicator[COMPARE_X_NEAR_LIMIT]=0
commands_indicator[COMPARE_X_ON_BOUNDARY]=0
commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0
commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0
commands_indicator[PARAMETER_SPACE_X]=0
commands_indicator[PARAMETER_SPACE_Y]=0
commands_indicator[COMPARE_Y_AT_X]=0
commands_indicator[COMPARE_Y_AT_X_LEFT]=0
commands_indicator[COMPARE_Y_AT_X_RIGHT]=0
@ -516,6 +507,11 @@ execute_commands_new_structure()
commands_indicator[MERGE]=0
commands_indicator[ASSERTIONS]=0
commands_indicator[CONSTRUCTOR]=0
commands_indicator[COMPARE_X_ON_BOUNDARY]=0
commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0
commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0
commands_indicator[PARAMETER_SPACE_X]=0
commands_indicator[PARAMETER_SPACE_Y]=0
commands_indicator[EQUAL]=0
commands_indicator[PUSH_BACK]=0
commands_indicator[PUSH_FRONT]=0
@ -544,14 +540,6 @@ execute_commands_new_structure()
run_trapped_test test_traits data/$1/points \
data/$1/xcurves data/$1/curves data/$1/is_vertical $2
fi
if [ ${commands_indicator[$COMPARE_X_AT_LIMIT]} -ne 0 ] ; then
run_trapped_test test_traits data/$1/points \
data/$1/xcurves data/$1/curves data/$1/compare_x_at_limit $2
fi
if [ ${commands_indicator[$COMPARE_X_NEAR_LIMIT]} -ne 0 ] ; then
run_trapped_test test_traits data/$1/points \
data/$1/xcurves data/$1/curves data/$1/compare_x_near_limit $2
fi
if [ ${commands_indicator[$COMPARE_X_ON_BOUNDARY]} -ne 0 ] ; then
run_trapped_test test_traits data/$1/points \
data/$1/xcurves data/$1/curves data/$1/compare_x_on_boundary $2
@ -650,8 +638,6 @@ execute_commands_traits_adaptor()
commands_indicator[PARAMETER_SPACE_X]=0
commands_indicator[PARAMETER_SPACE_Y]=0
commands_indicator[COMPARE_X_AT_LIMIT]=0
commands_indicator[COMPARE_X_NEAR_LIMIT]=0
commands_indicator[COMPARE_X_ON_BOUNDARY]=0
commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0
commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0
@ -686,17 +672,6 @@ execute_commands_traits_adaptor()
data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \
data/test_adaptor/$1/parameter_space_y $2
fi
if [ ${commands_indicator[$COMPARE_X_AT_LIMIT]} -ne 0 ] ; then
run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \
data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \
data/test_adaptor/$1/compare_x_at_limit $2
fi
if [ ${commands_indicator[$COMPARE_X_NEAR_LIMIT]} -ne 0 ] ; then
run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \
data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \
data/test_adaptor/$1/compare_x_near_limit $2
fi
if [ ${commands_indicator[$COMPARE_X_ON_BOUNDARY]} -ne 0 ] ; then
run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \
data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \
@ -1328,7 +1303,7 @@ test_linear_traits()
IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT INTERSECT \
SPLIT MERGE \
PARAMETER_SPACE_X PARAMETER_SPACE_Y \
COMPARE_X_AT_LIMIT COMPARE_X_NEAR_LIMIT COMPARE_Y_NEAR_BOUNDARY
COMPARE_X_ON_BOUNDARY COMPARE_X_NEAR_BOUNDARY COMPARE_Y_NEAR_BOUNDARY
else
echo " ERROR: not executed test_traits linear_traits" >> $ERRORFILE
fi
@ -1570,7 +1545,7 @@ test_rational_arc_traits()
execute_commands_new_structure rational_arcs rational_arc_traits \
VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT SPLIT MERGE \
COMPARE_X_AT_LIMIT COMPARE_X_NEAR_LIMIT COMPARE_Y_NEAR_BOUNDARY
COMPARE_X_ON_BOUNDARY COMPARE_X_NEAR_BOUNDARY COMPARE_Y_NEAR_BOUNDARY
else
echo " ERROR: not executed test_traits rational_arc_traits" >> $ERRORFILE
fi