diff --git a/Algebraic_kernel_d/benchmark/Algebraic_kernel_d/Algebraic_kernel_d_1.cpp b/Algebraic_kernel_d/benchmark/Algebraic_kernel_d/Algebraic_kernel_d_1.cpp index 375abcf07a6..d0be0c268ed 100644 --- a/Algebraic_kernel_d/benchmark/Algebraic_kernel_d/Algebraic_kernel_d_1.cpp +++ b/Algebraic_kernel_d/benchmark/Algebraic_kernel_d/Algebraic_kernel_d_1.cpp @@ -336,7 +336,7 @@ void single_benchmark( std::string filename, std::string isolator, int samples = single_benchmark< Coeff, Boundary, Rep_class, CGAL::CGALi::Bitstream_descartes< typename CGAL::Polynomial< Coeff >, Boundary > >( filename, samples ); else - CGAL_error( "Unknown isolator class" ); + CGAL_error_msg( "Unknown isolator class" ); } template< class Coeff_ > @@ -352,7 +352,7 @@ void single_benchmark( std::string filename, std::string rep_class, std::string single_benchmark< Coeff, Boundary, CGAL::CGALi::Algebraic_real_rep_bfi< Coeff, Boundary > >( filename, isolator, samples ); else - CGAL_error( "Unknown rep class" ); + CGAL_error_msg( "Unknown rep class" ); } int main( int argc, char** argv ) { @@ -368,7 +368,7 @@ int main( int argc, char** argv ) { // single_benchmark< CGAL::Sqrt_extension< leda_integer, leda_integer > >( argv[4], argv[2], argv[3], samples ); single_benchmark< CGAL::Sqrt_extension< CORE::BigInt, CORE::BigInt > >( argv[4], argv[2], argv[3], samples ); else - CGAL_error( "Unknown coefficient type" ); + CGAL_error_msg( "Unknown coefficient type" ); } else { std::cerr << "No parameters found" << std::endl; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2.h index 97f699e3202..3e6e36aa105 100755 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2.h @@ -308,7 +308,7 @@ public: Comparison_result operator()(const Xy_coordinate_2& xy1, const Xy_coordinate_2& xy2) const { - CGAL_error("Compare_y_2 functor not yet implemented"); + CGAL_error_msg("Compare_y_2 functor not yet implemented"); return CGAL::EQUAL; } }; @@ -785,7 +785,7 @@ public: // check if there is an event of curve p at r.x() if(cv_line.is_event()) { if(cv_line_r.is_event()) - CGAL_error("you're lucky )) this is not an easy \ + CGAL_error_msg("you're lucky )) this is not an easy \ case.."); //std::cout << "sign at event of curve p\n"; // this is an event of curve p but not of r.curve() -> diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2/Xy_coordinate_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2/Xy_coordinate_2.h index e087e7a4ec4..f771458ebf4 100755 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2/Xy_coordinate_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2/Xy_coordinate_2.h @@ -247,7 +247,7 @@ public: * TODO: Loos-algorithm */ X_coordinate_1 y() const { - CGAL_error("Not yet implemented"); + CGAL_error_msg("Not yet implemented"); return this->ptr()->_m_x; } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_pure.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_pure.h index 5c8147d0d5b..d0e1dea4a19 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_pure.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_pure.h @@ -440,7 +440,7 @@ operator >> (std::istream& is, break; } default:{ - CGAL_error("ALGEBRAIC_TYPE unexpected!" ); + CGAL_error_msg("ALGEBRAIC_TYPE unexpected!" ); } } return is; diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h index 2f5090bda85..d588b35dce4 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h @@ -53,7 +53,7 @@ namespace CGALi { class Test_to_double { public: void operator() (::CGAL::Null_functor) { - CGAL_error("To_double functor not implemented"); + CGAL_error_msg("To_double functor not implemented"); } }; @@ -90,7 +90,7 @@ namespace CGALi { class Test_to_Interval { public: void operator() (::CGAL::Null_functor) { - CGAL_error("To_Interval not implemented"); + CGAL_error_msg("To_Interval not implemented"); // ok, nothing to test } }; diff --git a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h index 644c20857a2..7082787dbff 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h @@ -17,25 +17,27 @@ // Author(s) : Monique Teillaud, Sylvain Pion // Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 +// RTD (FET Open) Project under Contract No IST-2000-26473 +// (ECG - Effective Computational Geometry for Curves and Surfaces) +// and a STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTIONS_ON_ROOTS_AND_POLYNOMIALS_2_H #define CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTIONS_ON_ROOTS_AND_POLYNOMIALS_2_H +#include + namespace CGAL { namespace AlgebraicFunctors { template < class AK, class OutputIterator > - inline + inline OutputIterator solve( const typename AK::Polynomial_for_circles_2_2 & e1, const typename AK::Polynomial_for_circles_2_2 & e2, OutputIterator res ) { - assert( ! (e1 == e2) ); // polynomials of this type cannot be multiple + CGAL_precondition( ! (e1 == e2) ); // polynomials of this type cannot be multiple // of one another if they are not equal typedef typename AK::FT FT; @@ -58,8 +60,8 @@ namespace CGAL { const FT y_base = ((e1.b() + e2.b()) + dy*diff_sqr_rad / dist2) / 2; if (sign_disc == ZERO) { - // one double root, - // no need to care about the boolean of the Root_of + // one double root, + // no need to care about the boolean of the Root_of *res++ = std::make_pair ( Root_for_circles_2_2 (Root_of_2(x_base), Root_of_2(y_base)), @@ -74,49 +76,49 @@ namespace CGAL { if (sign_dy == ZERO) { const FT y_root_coeff = dx / (2 * dist2); if(sign_dx == NEGATIVE) { - * res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(x_base), + * res++ = std::make_pair + ( Root_for_circles_2_2(Root_of_2(x_base), make_root_of_2(y_base, y_root_coeff, disc)), static_cast(1) ); - + * res++ = std::make_pair ( Root_for_circles_2_2(Root_of_2(x_base), make_root_of_2(y_base, -y_root_coeff, disc)), static_cast(1) ); } else { - * res++ = std::make_pair - ( Root_for_circles_2_2(Root_of_2(x_base), + * res++ = std::make_pair + ( Root_for_circles_2_2(Root_of_2(x_base), make_root_of_2(y_base, -y_root_coeff, disc)), static_cast(1) ); - + * res++ = std::make_pair ( Root_for_circles_2_2(Root_of_2(x_base), make_root_of_2(y_base, y_root_coeff, disc)), static_cast(1) ); } - return res; + return res; } if (sign_dx == ZERO) { const FT x_root_coeff = dy / (2 * dist2); if(sign_dy == POSITIVE) { - * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), + * res++ = std::make_pair + ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), Root_of_2(y_base)), static_cast(1) ); - + * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), Root_of_2(y_base)), static_cast(1) ); } else { - * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), + * res++ = std::make_pair + ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), Root_of_2(y_base)), static_cast(1) ); - + * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), Root_of_2(y_base)), static_cast(1) ); } @@ -127,22 +129,22 @@ namespace CGAL { const FT y_root_coeff = dx / (2 * dist2); if (sign_dy == POSITIVE) { - * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), + * res++ = std::make_pair + ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), make_root_of_2(y_base, y_root_coeff, disc)), static_cast(1) ); - + * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), make_root_of_2(y_base, -y_root_coeff, disc)), static_cast(1) ); } else { * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), + ( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc), make_root_of_2(y_base, -y_root_coeff, disc)), static_cast(1) ); - * res++ = std::make_pair - ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), + * res++ = std::make_pair + ( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc), make_root_of_2(y_base, y_root_coeff, disc)), static_cast(1) ); } @@ -151,13 +153,13 @@ namespace CGAL { } template < class AK > - inline + inline Sign sign_at( const typename AK::Polynomial_for_circles_2_2 & equation, const typename AK::Root_for_circles_2_2 & r) { typedef typename AK::Root_of_2 Root_of_2; - Comparison_result c = compare(square(r.x() - equation.a()), - equation.r_sq() - + Comparison_result c = compare(square(r.x() - equation.a()), + equation.r_sq() - square(r.y() - equation.b())); if(c == EQUAL) return ZERO; if(c == LARGER) return POSITIVE; @@ -167,7 +169,7 @@ namespace CGAL { template typename AK::Root_for_circles_2_2 - x_critical_point(const typename AK::Polynomial_for_circles_2_2 & c, + x_critical_point(const typename AK::Polynomial_for_circles_2_2 & c, bool i) { typedef typename AK::Root_of_2 Root_of_2; @@ -180,7 +182,7 @@ namespace CGAL { template OutputIterator - x_critical_points(const typename AK::Polynomial_for_circles_2_2 & c, + x_critical_points(const typename AK::Polynomial_for_circles_2_2 & c, OutputIterator res) { typedef typename AK::Root_of_2 Root_of_2; @@ -191,13 +193,13 @@ namespace CGAL { make_root_of_2(c.a(),FT(-1),c.r_sq()), c.b()); *res++ = Root_for_circles_2_2( make_root_of_2(c.a(),FT(1),c.r_sq()), c.b()); - + return res; } template typename AK::Root_for_circles_2_2 - y_critical_point(const typename AK::Polynomial_for_circles_2_2 &c, + y_critical_point(const typename AK::Polynomial_for_circles_2_2 &c, bool i) { typedef typename AK::Root_of_2 Root_of_2; @@ -207,19 +209,19 @@ namespace CGAL { const Root_of_2 b1 = make_root_of_2(c.b(),FT(i?-1:1),c.r_sq()); return Root_for_circles_2_2(c.a(),b1); } - + template OutputIterator - y_critical_points(const typename AK::Polynomial_for_circles_2_2 & c, + y_critical_points(const typename AK::Polynomial_for_circles_2_2 & c, OutputIterator res) { typedef typename AK::Root_of_2 Root_of_2; typedef typename AK::FT FT; typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2; - *res++ = Root_for_circles_2_2(c.a(), + *res++ = Root_for_circles_2_2(c.a(), make_root_of_2(c.b(),-1,c.r_sq())); - *res++ = Root_for_circles_2_2(c.a(), + *res++ = Root_for_circles_2_2(c.a(), make_root_of_2(c.b(),1,c.r_sq())); return res; diff --git a/Apollonius_graph_2/generators/include/CGAL/Apollonius_graph_2/random_integral_sites_in_square_2.h b/Apollonius_graph_2/generators/include/CGAL/Apollonius_graph_2/random_integral_sites_in_square_2.h index fe289889340..e55424e3b89 100644 --- a/Apollonius_graph_2/generators/include/CGAL/Apollonius_graph_2/random_integral_sites_in_square_2.h +++ b/Apollonius_graph_2/generators/include/CGAL/Apollonius_graph_2/random_integral_sites_in_square_2.h @@ -38,7 +38,7 @@ public: double x = random_integer(r_, b_, true); double y = random_integer(r_, b_, true); double w = random_integer(r_, B_, false); - assert( w >= 0 ); + CGAL_assertion( w >= 0 ); typename Site_2::Point_2 p(x, y); return Site_2(p, w); diff --git a/Apollonius_graph_2/generators/include/CGAL/random_integer.h b/Apollonius_graph_2/generators/include/CGAL/random_integer.h index 3f5ef12edc1..5c6a33cee8a 100644 --- a/Apollonius_graph_2/generators/include/CGAL/random_integer.h +++ b/Apollonius_graph_2/generators/include/CGAL/random_integer.h @@ -3,7 +3,6 @@ #include #include -#include #include // type "man {rand, random, drand48}" for C functions that produce @@ -18,11 +17,11 @@ CGAL_BEGIN_NAMESPACE // powers of 2 from 2^0 to 2^53 double P2[54]={1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, - 512.0, 1024.0, 2048.0, 4096.0, 8192.0, 16384.0, 32768.0, + 512.0, 1024.0, 2048.0, 4096.0, 8192.0, 16384.0, 32768.0, 65536.0, 131072.0, 262144.0, 524288.0, 1048576.0, 2097152.0, 4194304.0, 8388608.0, 16777216.0, 33554432.0, 67108864.0, 134217728.0, 268435456.0, 536870912.0, - 1073741824.0, 2147483648.0, 4294967296.0, 8589934592.0, + 1073741824.0, 2147483648.0, 4294967296.0, 8589934592.0, 17179869184.0, 34359738368.0, 68719476736.0, 137438953472.0, 274877906944.0, 549755813888.0, 1099511627776.0, 2199023255552.0, 4398046511104.0, @@ -85,7 +84,7 @@ double random_even_integer(Random& r, unsigned int b, // b is required to be at least 1 and at most 52 // and if allow_negative is true then the range includes negative // numbers as well and becomes: [-2^b + 1, 2^b - 1). - assert( b >= 0 && b <= 52 ); + CGAL_precondition( b >= 0 && b <= 52 ); if ( b == 0 ) { return 0; } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/new_traits/Conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/new_traits/Conflict_2.h index 386d2d02227..d098208fe24 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/new_traits/Conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/new_traits/Conflict_2.h @@ -79,7 +79,7 @@ protected: case (2) : return radical_side(p1, p3, p2, 3); case (3) : return radical_side(p1, p2, p3, 3); default : - CGAL_assertion_msg(false, "Case should not hapen"); + CGAL_error_msg( "Case should not hapen"); return ZERO; } } @@ -153,7 +153,7 @@ protected: } else if (i == 3) { ool = ordered_on_line(p1, p3, p2); } else { - CGAL_assertion_msg(false, "this does not happen."); + CGAL_error_msg( "this does not happen."); ool = false; } diff --git a/Apollonius_graph_2/include/CGAL/Parabola_2.h b/Apollonius_graph_2/include/CGAL/Parabola_2.h index d5499efc23f..925cae5bc65 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_2.h @@ -136,7 +136,7 @@ protected: std::vector< Point_2 > compute_points(const FT &d) const { - assert(d >= 0); + CGAL_assertion(d >= 0); FT d1 = distance(o, c) + d; FT d2 = distance(o, l) + d; d2 = d1; diff --git a/Approximate_min_ellipsoid_d/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_configure.h b/Approximate_min_ellipsoid_d/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_configure.h index b54d885c2aa..78bfe08ea71 100644 --- a/Approximate_min_ellipsoid_d/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_configure.h +++ b/Approximate_min_ellipsoid_d/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_configure.h @@ -13,14 +13,14 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Kaspar Fischer #ifndef CGAL_APPROX_MIN_ELL_CONFIGURE_H #define CGAL_APPROX_MIN_ELL_CONFIGURE_H -#include +#include #include #include @@ -51,7 +51,7 @@ // (Todo: these routines turned out to not be the most useful for // debugging; one could improve this, but it's only debugging, so who // cares ...) -// +// // - CGAL_APPEL_ASSERT(expr): Asserts that the expression expr evaluates // to true. This only happens when the assertion mode is enabled. This // macro should only be used for cheap assertions (which do not heavily @@ -91,15 +91,15 @@ // #ifdef CGAL_APPEL_ASSERTION_MODE - #define CGAL_APPEL_ASSERT(expr) assert(expr) + #define CGAL_APPEL_ASSERT(expr) CGAL_assertion(expr) #else - #define CGAL_APPEL_ASSERT(expr) + #define CGAL_APPEL_ASSERT(expr) #endif #ifdef CGAL_APPEL_EXP_ASSERTION_MODE #define CGAL_APPEL_ASSERT_EXPENSIVE(expr) CGAL_assertion(expr) #else - #define CGAL_APPEL_ASSERT_EXPENSIVE(expr) + #define CGAL_APPEL_ASSERT_EXPENSIVE(expr) #endif #ifdef CGAL_APPEL_LOG_MODE @@ -111,13 +111,13 @@ Logger::instance().log(channel,s.str()); \ } #else - #define CGAL_APPEL_LOG(channel,expr) + #define CGAL_APPEL_LOG(channel,expr) #endif #if defined(CGAL_APPEL_ASSERTION_MODE)||defined(CGAL_APPEL_EXP_ASSERTION_MODE) #define CGAL_APPEL_IF_ASSERTIONS(expr) expr #else - #define CGAL_APPEL_IF_ASSERTIONS(expr) + #define CGAL_APPEL_IF_ASSERTIONS(expr) #endif #ifdef CGAL_APPEL_TIMER_MODE @@ -149,16 +149,16 @@ #define CGAL_APPEL_TIMER_STRING(timer) \ CGAL::Approximate_min_ellipsoid_d_impl::Timer::instance().lapse(timer) #else - #define CGAL_APPEL_TIME(expr) - #define CGAL_APPEL_TIMER_START(timer) - #define CGAL_APPEL_TIMER_PRINT(channel,timer,msg) - #define CGAL_APPEL_TIMER_STRING(timer) + #define CGAL_APPEL_TIME(expr) + #define CGAL_APPEL_TIMER_START(timer) + #define CGAL_APPEL_TIMER_PRINT(channel,timer,msg) + #define CGAL_APPEL_TIMER_STRING(timer) #endif #ifdef CGAL_APPEL_STATS_MODE #define CGAL_APPEL_IF_STATS(expr) expr #else - #define CGAL_APPEL_IF_STATS(expr) + #define CGAL_APPEL_IF_STATS(expr) #endif #include diff --git a/Approximate_min_ellipsoid_d/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_debug.h b/Approximate_min_ellipsoid_d/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_debug.h index 2fa8003aab3..e87fd456538 100644 --- a/Approximate_min_ellipsoid_d/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_debug.h +++ b/Approximate_min_ellipsoid_d/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_debug.h @@ -214,7 +214,7 @@ namespace CGAL { // fetch current usage: rusage now; int status = getrusage(RUSAGE_SELF,&now); - assert(status == 0); + CGAL_assertion(status == 0); // save it: timers[std::string(timer_name)] = now.ru_utime; @@ -223,12 +223,12 @@ namespace CGAL { float lapse(const char *name) { // assert that start(name) has been called before: - assert(timers.find(std::string(name)) != timers.end()); + CGAL_assertion(timers.find(std::string(name)) != timers.end()); // get current usage: rusage now; int status = getrusage(RUSAGE_SELF,&now); - assert(status == 0); + CGAL_assertion(status == 0); // compute elapsed usage: now.ru_utime -= (*timers.find(std::string(name))).second; diff --git a/Arrangement_2/demo/Arrangement_2/demo_tab.h b/Arrangement_2/demo/Arrangement_2/demo_tab.h index 65ea40d85c9..ac84fb037d2 100644 --- a/Arrangement_2/demo/Arrangement_2/demo_tab.h +++ b/Arrangement_2/demo/Arrangement_2/demo_tab.h @@ -1357,7 +1357,7 @@ public: return lm_pl->locate(pt); // doesnt suppose to reach there - CGAL_assertion(false); + CGAL_error(); return CGAL::Object(); } @@ -1384,7 +1384,7 @@ public: } // doesnt suppose to reach there - CGAL_assertion(false); + CGAL_error(); return CGAL::Object(); } @@ -1411,7 +1411,7 @@ public: } // doesnt suppose to reach there - CGAL_assertion(false); + CGAL_error(); return CGAL::Object(); } diff --git a/Arrangement_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_2/include/CGAL/Arr_circular_line_arc_traits_2.h index 995470b08dc..e7060376ec5 100644 --- a/Arrangement_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -338,7 +338,7 @@ namespace CGAL { return object_to_object_variant (container, res); } - CGAL_assertion(false); + CGAL_error(); return res;//for no warning } diff --git a/Arrangement_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h b/Arrangement_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h index f428808d082..7481a4eabab 100644 --- a/Arrangement_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h +++ b/Arrangement_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h @@ -143,7 +143,7 @@ protected: virtual void _create_points_set (Points_set & /* points */) { std::cerr << "should not reach here!"<< std::endl; - CGAL_assertion(false); + CGAL_error(); } }; diff --git a/Arrangement_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_functions.h b/Arrangement_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_functions.h index 602af036f51..97197743c80 100644 --- a/Arrangement_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_functions.h +++ b/Arrangement_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_functions.h @@ -90,7 +90,7 @@ Object Arr_trapezoid_ric_point_location return (CGAL::make_object (vh)); } else - CGAL_assertion(false); + CGAL_error(); break; } @@ -104,7 +104,7 @@ Object Arr_trapezoid_ric_point_location { //ixx std::cerr << "curve is: "< } default: CGAL_TRAP_PRINT_DEBUG("DEFAULT"); - CGAL_assertion(false); + CGAL_error(); break; } @@ -181,7 +181,7 @@ Object Arr_trapezoid_ric_point_location return (CGAL::make_object (vh)); } else - CGAL_assertion(false); + CGAL_error(); break; case TD::CURVE: @@ -202,7 +202,7 @@ Object Arr_trapezoid_ric_point_location return (_check_isolated_for_vertical_ray_shoot(h, p, shoot_up)); default: - CGAL_assertion(false); + CGAL_error(); break; } diff --git a/Arrangement_2/include/CGAL/Arr_traits_2/Bezier_bounding_rational_traits.h b/Arrangement_2/include/CGAL/Arr_traits_2/Bezier_bounding_rational_traits.h index dfe53ba357c..1be89f3de09 100644 --- a/Arrangement_2/include/CGAL/Arr_traits_2/Bezier_bounding_rational_traits.h +++ b/Arrangement_2/include/CGAL/Arr_traits_2/Bezier_bounding_rational_traits.h @@ -363,7 +363,7 @@ public: bool can_refine_pt = can_refine(cp, left, right); if (!can_refine) { - CGAL_assertion(false); + CGAL_error(); } */ @@ -1023,28 +1023,28 @@ private: res = intersection (skew1a, skew2a); if (!assign(p, res)) { - CGAL_assertion(false); + CGAL_error(); } aux_vec.push_back(p); res = intersection (skew1a, skew2b); if (!assign(p, res)) { - CGAL_assertion(false); + CGAL_error(); } aux_vec.push_back(p); res = intersection (skew1b, skew2a); if (!assign(p, res)) { - CGAL_assertion(false); + CGAL_error(); } aux_vec.push_back(p); res = intersection (skew1b, skew2b); if (!assign(p, res)) { - CGAL_assertion(false); + CGAL_error(); } aux_vec.push_back(p); diff --git a/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_sl_visitor.h b/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_sl_visitor.h index bf80bde524d..7b50bfb841c 100644 --- a/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_sl_visitor.h +++ b/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_sl_visitor.h @@ -511,7 +511,7 @@ public: case NO_BOUNDARY: default: // doesn't suppose to reach here at all. - CGAL_assertion(false); + CGAL_error(); } } diff --git a/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_visitor.h b/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_visitor.h index b2dfec425ac..8875f806297 100644 --- a/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_visitor.h +++ b/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_visitor.h @@ -514,7 +514,7 @@ public: case NO_BOUNDARY: default: // doesn't suppose to reach here at all. - CGAL_assertion(false); + CGAL_error(); } } diff --git a/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_2_debug.h b/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_2_debug.h index 73da1b20b04..737b3af4106 100644 --- a/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_2_debug.h +++ b/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_2_debug.h @@ -142,7 +142,7 @@ PrintInfinityType(Boundary_type x, Boundary_type y) case AFTER_DISCONTINUITY: case BEFORE_SINGULARITY: case AFTER_SINGULARITY: - CGAL_assertion(false); + CGAL_error(); } } diff --git a/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_event.h b/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_event.h index 7746d445334..fd8d0a8a72f 100644 --- a/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_event.h +++ b/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_event.h @@ -629,7 +629,7 @@ Print() case BEFORE_DISCONTINUITY: case AFTER_DISCONTINUITY: case BEFORE_SINGULARITY: - case AFTER_SINGULARITY: CGAL_assertion(false); break; + case AFTER_SINGULARITY: CGAL_error(); break; case MINUS_INFINITY: std::cout<<" X = -00 "; break; case PLUS_INFINITY: std::cout<<" X = +00 "; break; @@ -639,12 +639,12 @@ Print() case BEFORE_DISCONTINUITY: case AFTER_DISCONTINUITY: case BEFORE_SINGULARITY: - case AFTER_SINGULARITY: CGAL_assertion(false); break; + case AFTER_SINGULARITY: CGAL_error(); break; case MINUS_INFINITY: std::cout<<" Y = -00 "; break; case PLUS_INFINITY: std::cout<<" Y = +00 "; break; case NO_BOUNDARY: - CGAL_assertion(false); + CGAL_error(); } } } diff --git a/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_functors.h b/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_functors.h index f99d1fc7ca8..97e565212c4 100644 --- a/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_functors.h +++ b/Arrangement_2/include/CGAL/Sweep_line_2/Sweep_line_functors.h @@ -204,13 +204,13 @@ public: CGAL_assertion(boundary_in_y == PLUS_INFINITY); return LARGER; default: - CGAL_assertion(false); + CGAL_error(); break; } //doesnt suppose to reach here (all options have been handles by now) - CGAL_assertion(false); + CGAL_error(); return SMALLER; } diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/demo_tab.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/demo_tab.h index d06e9d12302..6217e8b10c3 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/demo_tab.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/demo_tab.h @@ -1357,7 +1357,7 @@ public: return lm_pl->locate(pt); // doesnt suppose to reach there - CGAL_assertion(false); + CGAL_error(); return CGAL::Object(); } @@ -1384,7 +1384,7 @@ public: } // doesnt suppose to reach there - CGAL_assertion(false); + CGAL_error(); return CGAL::Object(); } @@ -1411,7 +1411,7 @@ public: } // doesnt suppose to reach there - CGAL_assertion(false); + CGAL_error(); return CGAL::Object(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h index 995470b08dc..e7060376ec5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -338,7 +338,7 @@ namespace CGAL { return object_to_object_variant (container, res); } - CGAL_assertion(false); + CGAL_error(); return res;//for no warning } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h index 633cab9a7bb..f7466992457 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_bounding_rational_traits.h @@ -1263,28 +1263,28 @@ private: res = f_intersect (skew1a, skew2a); if (! assign (p, res)) { - CGAL_assertion(false); + CGAL_error(); } aux_vec.push_back(p); res = f_intersect (skew1a, skew2b); if (! assign(p, res)) { - CGAL_assertion(false); + CGAL_error(); } aux_vec.push_back(p); res = f_intersect (skew1b, skew2a); if (! assign(p, res)) { - CGAL_assertion(false); + CGAL_error(); } aux_vec.push_back(p); res = f_intersect (skew1b, skew2b); if (!assign(p, res)) { - CGAL_assertion(false); + CGAL_error(); } aux_vec.push_back(p); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h index f428808d082..7481a4eabab 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h @@ -143,7 +143,7 @@ protected: virtual void _create_points_set (Points_set & /* points */) { std::cerr << "should not reach here!"<< std::endl; - CGAL_assertion(false); + CGAL_error(); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h index 17430eacc56..ea4b6072d4f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h @@ -90,7 +90,7 @@ Object Arr_trapezoid_ric_point_location return (CGAL::make_object (vh)); } else - CGAL_assertion(false); + CGAL_error(); break; } @@ -104,7 +104,7 @@ Object Arr_trapezoid_ric_point_location { //ixx std::cerr << "curve is: "< } default: CGAL_TRAP_PRINT_DEBUG("DEFAULT"); - CGAL_assertion(false); + CGAL_error(); break; } @@ -181,7 +181,7 @@ Object Arr_trapezoid_ric_point_location return (CGAL::make_object (vh)); } else - CGAL_assertion(false); + CGAL_error(); break; case TD::CURVE: @@ -202,7 +202,7 @@ Object Arr_trapezoid_ric_point_location return (_check_isolated_for_vertical_ray_shoot(h, p, shoot_up)); default: - CGAL_assertion(false); + CGAL_error(); break; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h index 7ea9e58a4b5..a871c6b0ed4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h @@ -554,7 +554,7 @@ public: const Halfedge * /* e2 */) const { // This function is never called in case of an arrangement on a sphere: - CGAL_assertion(false); + CGAL_error(); return false; } @@ -645,7 +645,7 @@ public: Halfedge * split_fictitious_edge(Halfedge * /* e */, Vertex * /* v */) { // There are no fictitious halfedges: - CGAL_assertion(false); + CGAL_error(); return NULL; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_qdx_batched_pl_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_qdx_batched_pl_helper.h index 3e70f696c05..1ab0bf34135 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_qdx_batched_pl_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_qdx_batched_pl_helper.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Baruch Zukerman // Ron Wein @@ -40,30 +40,30 @@ template class Arr_qdx_batched_pl_helper { public: - + typedef Traits_ Traits_2; typedef Arrangement_ Arrangement_2; - + typedef typename Arrangement_2::Face_const_handle Face_const_handle; - + typedef Sweep_line_empty_visitor Base_visitor; typedef typename Base_visitor::Event Event; typedef typename Base_visitor::Subcurve Subcurve; - + protected: - + typedef typename Arrangement_2::Topology_traits Topology_traits; - typedef typename Arrangement_2::Halfedge_const_handle + typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - + // Data members: const Topology_traits *m_top_traits;// The topology-traits class. #if 0 Halfedge_const_handle m_top_fict; // The current top fictitious halfedge. #endif public: - + /*! * Constructor. * \param arr The arrangement. @@ -71,29 +71,27 @@ public: Arr_qdx_batched_pl_helper (const Arrangement_2 *arr) : m_top_traits (arr->topology_traits()) {} - + /// \name Notification functions. //@{ - + /* A notification issued before the sweep process starts. */ void before_sweep (); - + /*! * A notification invoked after the sweep-line finishes handling the given * event. */ void after_handle_event (Event* event); //@} - + /*! Get the current top face. */ Face_const_handle top_face () const { #if 0 return (m_top_fict->face()); #endif - std::cout << "Arr_qdx_batched_pl_helper::top_face not yet implemenet" - << std::endl; - assert(false); + CGAL_error( "Arr_qdx_batched_pl_helper::top_face not yet implemented" ); return; } }; @@ -112,26 +110,24 @@ void Arr_qdx_batched_pl_helper::before_sweep () // Initialize the fictitious halfedge lying on the top edge of the // fictitious face. We start from the leftmost halfedge, which is // incident to the top-left vertex and directed from right to left. - Vertex_const_handle v_tl = + Vertex_const_handle v_tl = Vertex_const_handle (m_top_traits->top_left_vertex()); - + m_top_fict = v_tl->incident_halfedges(); if (m_top_fict->direction() == LEFT_TO_RIGHT) m_top_fict = m_top_fict->next()->twin(); - + CGAL_assertion_code ( - Vertex_const_handle v_tr = + Vertex_const_handle v_tr = Vertex_const_handle (m_top_traits->top_right_vertex()); ); CGAL_assertion ((m_top_fict->source() == v_tr) || (m_top_fict->source()->boundary_in_x() == NO_BOUNDARY && m_top_fict->source()->boundary_in_y() == PLUS_INFINITY)); - + return; #endif - std::cout << "Arr_qdx_batched_pl_helper::before_sweep not yet implemenet" - << std::endl; - assert(false); + CGAL_error("Arr_qdx_batched_pl_helper::before_sweep not yet implemented" ); return; } @@ -149,18 +145,16 @@ void Arr_qdx_batched_pl_helper::after_handle_event // edge we keep. if (event->is_finite()) return; - + if (event->boundary_in_x() != NO_BOUNDARY) return; - + if (event->boundary_in_y() == PLUS_INFINITY) m_top_fict = m_top_fict->twin()->next()->twin(); - + return; #endif - std::cout << "Arr_qdx_batched_pl_helper::after_handle_event not yet implemenet" - << std::endl; - assert(false); + CGAL_error( "Arr_qdx_batched_pl_helper::after_handle_event not yet implemented" ); return; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_qdx_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_qdx_topology_traits_2_impl.h index 8ef2120122c..dd96d9f9767 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_qdx_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_qdx_topology_traits_2_impl.h @@ -675,7 +675,7 @@ locate_curve_end (const X_monotone_curve_2& cv, Curve_end ind, break; } default: - CGAL_assertion(false); // cannot happen + CGAL_error(); // cannot happen break; } } @@ -1242,7 +1242,7 @@ bool Arr_qdx_topology_traits_2::is_unbounded } /* NOT REACHED */ - CGAL_assertion(false); + CGAL_error(); return false; } case 2: @@ -1251,11 +1251,11 @@ bool Arr_qdx_topology_traits_2::is_unbounded return false; default: //std::cout << "More than two outer_ccbs! Not nice!" << std::endl; - CGAL_assertion(false); + CGAL_error(); } /* should not be reached */ - CGAL_assertion(false); + CGAL_error(); return (false); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_torus_batched_pl_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_torus_batched_pl_helper.h index 8bf4c2444c1..d139ef91f35 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_torus_batched_pl_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_torus_batched_pl_helper.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Baruch Zukerman // Ron Wein @@ -40,30 +40,30 @@ template class Arr_torus_batched_pl_helper { public: - + typedef Traits_ Traits_2; typedef Arrangement_ Arrangement_2; - + typedef typename Arrangement_2::Face_const_handle Face_const_handle; - + typedef Sweep_line_empty_visitor Base_visitor; typedef typename Base_visitor::Event Event; typedef typename Base_visitor::Subcurve Subcurve; - + protected: - + typedef typename Arrangement_2::Topology_traits Topology_traits; - typedef typename Arrangement_2::Halfedge_const_handle + typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - + // Data members: const Topology_traits *m_top_traits;// The topology-traits class. #if 0 Halfedge_const_handle m_top_fict; // The current top fictitious halfedge. #endif public: - + /*! * Constructor. * \param arr The arrangement. @@ -71,29 +71,27 @@ public: Arr_torus_batched_pl_helper (const Arrangement_2 *arr) : m_top_traits (arr->topology_traits()) {} - + /// \name Notification functions. //@{ - + /* A notification issued before the sweep process starts. */ void before_sweep (); - + /*! * A notification invoked after the sweep-line finishes handling the given * event. */ void after_handle_event (Event* event); //@} - + /*! Get the current top face. */ Face_const_handle top_face () const { #if 0 return (m_top_fict->face()); #endif - std::cout << "Arr_torus_batched_pl_helper::top_face not yet implemenet" - << std::endl; - assert(false); + CGAL_error( "Arr_torus_batched_pl_helper::top_face not yet implemented" ); return; } }; @@ -112,26 +110,24 @@ void Arr_torus_batched_pl_helper::before_sweep () // Initialize the fictitious halfedge lying on the top edge of the // fictitious face. We start from the leftmost halfedge, which is // incident to the top-left vertex and directed from right to left. - Vertex_const_handle v_tl = + Vertex_const_handle v_tl = Vertex_const_handle (m_top_traits->top_left_vertex()); - + m_top_fict = v_tl->incident_halfedges(); if (m_top_fict->direction() == LEFT_TO_RIGHT) m_top_fict = m_top_fict->next()->twin(); - + CGAL_assertion_code ( - Vertex_const_handle v_tr = + Vertex_const_handle v_tr = Vertex_const_handle (m_top_traits->top_right_vertex()); ); CGAL_assertion ((m_top_fict->source() == v_tr) || (m_top_fict->source()->boundary_in_x() == NO_BOUNDARY && m_top_fict->source()->boundary_in_y() == PLUS_INFINITY)); - + return; #endif - std::cout << "Arr_torus_batched_pl_helper::before_sweep not yet implemenet" - << std::endl; - assert(false); + CGAL_error( "Arr_torus_batched_pl_helper::before_sweep not yet implemented" ); return; } @@ -149,18 +145,16 @@ void Arr_torus_batched_pl_helper::after_handle_event // edge we keep. if (event->is_finite()) return; - + if (event->boundary_in_x() != NO_BOUNDARY) return; - + if (event->boundary_in_y() == PLUS_INFINITY) m_top_fict = m_top_fict->twin()->next()->twin(); - + return; #endif - std::cout << "Arr_torus_batched_pl_helper::after_handle_event not yet implemenet" - << std::endl; - assert(false); + CGAL_error( "Arr_torus_batched_pl_helper::after_handle_event not yet implemenet" ); return; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_torus_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_torus_topology_traits_2_impl.h index 99a7e83c9c7..cde628d390c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_torus_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_torus_topology_traits_2_impl.h @@ -707,7 +707,7 @@ Arr_torus_topology_traits_2::hole_creation_after_edge_removal // status: to implement std::cout << "Arr_torus_topology_traits_2 hole_creation" << std::endl; - CGAL_assertion(false); // hole_creation not finally implemented for torus + CGAL_error(); // hole_creation not finally implemented for torus CGAL_precondition (! he->is_on_inner_ccb()); CGAL_precondition (! he->opposite()->is_on_inner_ccb()); @@ -844,7 +844,7 @@ bool Arr_torus_topology_traits_2::is_in_face std::cout << "TODO: Arr_torus_topology_traits_2::is_in_face" << std::endl; - CGAL_assertion(false); // is_in_face not implemented for torus + CGAL_error(); // is_in_face not implemented for torus // TODO is_in_face NEEDED for incremental insertion return false; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h index 4d970961295..c7c8e08fe7e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h @@ -329,7 +329,7 @@ before_handle_event (Event* event) case NO_BOUNDARY: default: // We are not supposed to reach here at all. - CGAL_assertion(false); + CGAL_error(); } return; diff --git a/Arrangement_on_surface_2/include/CGAL/Basic_sweep_line_2.h b/Arrangement_on_surface_2/include/CGAL/Basic_sweep_line_2.h index 617ea9ef362..414a525e50e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Basic_sweep_line_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Basic_sweep_line_2.h @@ -547,7 +547,7 @@ protected: bool /* is_new */, Tag_false ) { - CGAL_assertion(false); + CGAL_error(); } #ifdef VERBOSE diff --git a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_2_debug.h b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_2_debug.h index 8ecf0e8bc3b..151b6a4390f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_2_debug.h +++ b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_2_debug.h @@ -109,7 +109,7 @@ void Basic_sweep_line_2::PrintInfinityType return; case NO_BOUNDARY: default: - CGAL_assertion(false); + CGAL_error(); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_event.h b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_event.h index c5651012a98..b59783bce5d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_event.h +++ b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_event.h @@ -582,7 +582,7 @@ public: break; case NO_BOUNDARY: default: - CGAL_assertion(false); + CGAL_error(); } } } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h index fcb4d777813..88935c13937 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h @@ -825,7 +825,7 @@ Traits_test::translate_enumerator(std::string & str_value) } else if (str_value == "EQUAL" ) { return static_cast(CGAL::EQUAL); } - CGAL_assertion(false); + CGAL_error(); return static_cast(-220776); // My birthday :-) } @@ -916,7 +916,7 @@ bool Traits_test::boundary_in_x_wrapper(std::istringstream & str_strea template bool Traits_test::boundary_in_x_wrapper_imp(std::istringstream & , CGAL::Tag_false) { - CGAL_assertion(false); + CGAL_error(); return false; } @@ -943,7 +943,7 @@ bool Traits_test::boundary_in_x_wrapper_imp(std::istringstream & str_s } } //should not get here - CGAL_assertion(false); + CGAL_error(); return false; } @@ -959,7 +959,7 @@ bool Traits_test::boundary_in_y_wrapper(std::istringstream & str_strea template bool Traits_test::boundary_in_y_wrapper_imp(std::istringstream &, CGAL::Tag_false) { - CGAL_assertion(false); + CGAL_error(); return false; } @@ -986,7 +986,7 @@ bool Traits_test::boundary_in_y_wrapper_imp(std::istringstream & str_s } } //should not get here - CGAL_assertion(false); + CGAL_error(); return false; } @@ -1179,7 +1179,7 @@ compare_y_at_x_left_wrapper_imp(std::istringstream & , CGAL::Tag_false) { // std::istringstream dummy_stream(str_stream); //to avoid warnings of unused variable - CGAL_assertion(false); + CGAL_error(); return false; } @@ -1489,7 +1489,7 @@ Traits_test:: are_mergeable_wrapper_imp(std::istringstream & , CGAL::Tag_false) { // std::istringstream dummy_stream = str_stream; //to avoid warnings of unused variable - CGAL_assertion(false); + CGAL_error(); return false; } @@ -1525,7 +1525,7 @@ bool Traits_test::merge_wrapper_imp(std::istringstream & , CGAL::Tag_false) { // std::istringstream dummy_stream(str_stream); //to avoid warnings of unused variable - CGAL_assertion(false); + CGAL_error(); return false; } diff --git a/Benchmark/src/Benchmark/Polynomial_visitor.cpp b/Benchmark/src/Benchmark/Polynomial_visitor.cpp index fa6f9b80726..78218300506 100644 --- a/Benchmark/src/Benchmark/Polynomial_visitor.cpp +++ b/Benchmark/src/Benchmark/Polynomial_visitor.cpp @@ -66,7 +66,7 @@ void Polynomial_visitor::end_polynomial() { if( assign( coeff, it->coefficient ) ) \ polygon_rep.push_back( std::make_pair( it->exponent_vector, coeff ) ); \ else \ - CGAL_error("cannot happen"); \ + CGAL_error_msg("cannot happen"); \ } \ object_container.push_back( \ make_object( \ @@ -78,7 +78,7 @@ void Polynomial_visitor::end_polynomial() { CGAL_BENCHMARK_POLYNOMIAL_VISITOR_CHECK_TYPE( int, Integer ) CGAL_BENCHMARK_POLYNOMIAL_VISITOR_CHECK_TYPE( CGAL_Sqrt_extension, Sqrt_ext_int_int ) default: - CGAL_error("if you can read this, something went wrong"); + CGAL_error_msg("if you can read this, something went wrong"); } #undef CGAL_BENCHMARK_POLYNOMIAL_VISITOR_CHECK_TYPE coefficient_numbertype = Not_supported; @@ -104,7 +104,7 @@ Polynomial_visitor::begin_monom( std::string coefficient ) CGAL_BENCHMARK_POLYNOMIAL_VISITOR_CHECK_TYPE( int, Integer ) CGAL_BENCHMARK_POLYNOMIAL_VISITOR_CHECK_TYPE( CGAL_Sqrt_extension, Sqrt_ext_int_int ) default: - CGAL_error("if you can read this, something went wrong"); + CGAL_error_msg("if you can read this, something went wrong"); } inside_monom = true; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_utils.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_utils.h index 9b09a4e6c6e..01226ebdfa1 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_utils.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_utils.h @@ -641,7 +641,7 @@ get_boundary_of_polygon(Face_const_iterator f) const ++ccb_circ; } while(ccb_circ != ccb_end); - CGAL_assertion(false); + CGAL_error(); return Ccb_halfedge_const_circulator(); } diff --git a/Cartesian_kernel/include/CGAL/Cartesian_converter.h b/Cartesian_kernel/include/CGAL/Cartesian_converter.h index b925daa68e2..e4f0d8ce77d 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian_converter.h +++ b/Cartesian_kernel/include/CGAL/Cartesian_converter.h @@ -114,7 +114,7 @@ public: } return make_object(res); } - CGAL_assertion_msg(false,"Cartesian_converter is unable to determine what is wrapped in the Object"); + CGAL_error_msg("Cartesian_converter is unable to determine what is wrapped in the Object"); return Object(); } diff --git a/Circular_kernel_2/include/CGAL/Arr_circular_arc_traits_checker.h b/Circular_kernel_2/include/CGAL/Arr_circular_arc_traits_checker.h index f6e48ce68ca..55d36f374fb 100644 --- a/Circular_kernel_2/include/CGAL/Arr_circular_arc_traits_checker.h +++ b/Circular_kernel_2/include/CGAL/Arr_circular_arc_traits_checker.h @@ -69,7 +69,7 @@ struct Predicate_checker { << a1.first << std::endl; std::cerr << " Arguments for P2 are : " << a1.second << std::endl; - CGAL_assertion(false); // message... a1, a2 + CGAL_error(); // message... a1, a2 } return r1; @@ -98,7 +98,7 @@ struct Predicate_checker { std::cerr << " Arguments for P2 are : " << a1.second << std::endl << a2.second << std::endl; - CGAL_assertion(false); // message... a1, a2 + CGAL_error(); // message... a1, a2 } return r1; @@ -131,7 +131,7 @@ struct Predicate_checker { << a1.second << std::endl << a2.second << std::endl << a3.second << std::endl; - CGAL_assertion(false); // message... a1, a2 + CGAL_error(); // message... a1, a2 } return r1; @@ -407,7 +407,7 @@ public: vp1.push_back(*pp1); } else - CGAL_assertion(false); + CGAL_error(); } for(unsigned i=0; i (container, res); } - CGAL_assertion(false); + CGAL_error(); return res;//for no warning } diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h index 5b83dadec96..30a0aa4c284 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h @@ -478,7 +478,7 @@ private: return cmp_y > 0; // There remains the case : - assert(cmp_begin == 0 && cmp_end == 0); + CGAL_assertion(cmp_begin == 0 && cmp_end == 0); return cmp_y != 0; // full circle or half circle. } diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h index 5d2d272a68f..baf19130713 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h @@ -1492,7 +1492,7 @@ template < class CK, class OutputIterator > } // We need to split - //assert(!A.is_x_monotone()); + //CGAL_assertion(!A.is_x_monotone()); if (cmp_begin_y > 0) { *res++ = S_pair @@ -1562,7 +1562,7 @@ template < class CK, class OutputIterator > } else { // cmp_begin_y == 0 if ( compare(A.source().x(),A.supporting_circle().center().x())< 0) { - assert (cmp_end_y >= 0); + CGAL_assertion(cmp_end_y >= 0); *res++ = std::make_pair (make_object(Circular_arc_2 (A.supporting_circle(), A.source(), @@ -1578,8 +1578,8 @@ template < class CK, class OutputIterator > true); } else { - assert( compare(A.source().x(),A.supporting_circle().center().x())< 0); - assert (cmp_end_y != LARGER); + CGAL_assertion( compare(A.source().x(),A.supporting_circle().center().x())< 0); + CGAL_assertion(cmp_end_y != LARGER); *res++ = std::make_pair (make_object(Circular_arc_2 (A.supporting_circle(), A.source(), diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_converter.h b/Circular_kernel_2/include/CGAL/Circular_kernel_converter.h index c6825d52731..7a2af11aeea 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_converter.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_converter.h @@ -190,7 +190,7 @@ public: object_cast(&obj)) { return make_object(operator()(*ptr)); } - CGAL_assertion_msg(false,"CircularK_converter is unable to determine what is wrapped in the Object"); + CGAL_error_msg("CircularK_converter is unable to determine what is wrapped in the Object"); return Object(); } diff --git a/Circular_kernel_2/include/CGAL/Filtered_bbox_circular_kernel_2/bbox_filtered_predicates.h b/Circular_kernel_2/include/CGAL/Filtered_bbox_circular_kernel_2/bbox_filtered_predicates.h index f22b87a5d4d..16cfc72e79a 100644 --- a/Circular_kernel_2/include/CGAL/Filtered_bbox_circular_kernel_2/bbox_filtered_predicates.h +++ b/Circular_kernel_2/include/CGAL/Filtered_bbox_circular_kernel_2/bbox_filtered_predicates.h @@ -666,7 +666,7 @@ class Do_overlap_2 { const Rcirc_arc_2 *tmp_arc; tmp_arc=object_cast(&vec.at(i)); - assert(tmp_arc!=NULL); + CGAL_assertion(tmp_arc!=NULL); *res++ = make_object( Circular_arc_2(*tmp_arc) ); } @@ -746,7 +746,7 @@ class Do_overlap_2 { const std::pair *tmp_point; tmp_point=object_cast >(&vec.at(i)); - assert(tmp_point!=NULL); + CGAL_assertion(tmp_point!=NULL); *res++ = make_object( std::make_pair(Circular_arc_point_2(tmp_point->first),tmp_point->second)); } @@ -781,7 +781,7 @@ class Do_overlap_2 { const std::pair *tmp_point; tmp_point=object_cast >(&vec.at(i)); - assert(tmp_point!=NULL); + CGAL_assertion(tmp_point!=NULL); *res++ = make_object( std::make_pair(Circular_arc_point_2(tmp_point->first),tmp_point->second)); } } @@ -815,7 +815,7 @@ class Do_overlap_2 { const std::pair *tmp_point; tmp_point=object_cast >(&vec.at(i)); - assert(tmp_point!=NULL); + CGAL_assertion(tmp_point!=NULL); *res++ = make_object( std::make_pair(Circular_arc_point_2(tmp_point->first),tmp_point->second)); } diff --git a/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/Circular_arc_with_hexagon_2.h b/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/Circular_arc_with_hexagon_2.h index fd0236df11d..616a638839a 100644 --- a/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/Circular_arc_with_hexagon_2.h +++ b/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/Circular_arc_with_hexagon_2.h @@ -193,7 +193,7 @@ public: void construct_hexagons() const { - assert(has_no_hexagons()); + CGAL_assertion(has_no_hexagons()); typedef typename boost::mpl::if_, \ Hexagon_construction_with_interval_2, \ diff --git a/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/hexagon_filtered_predicates.h b/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/hexagon_filtered_predicates.h index 3d6e721f56f..61f4e0a6d91 100644 --- a/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/hexagon_filtered_predicates.h +++ b/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/hexagon_filtered_predicates.h @@ -508,7 +508,7 @@ class Do_overlap_2 tmp_arc=object_cast(&vec.at(i)); - assert(tmp_arc!=NULL); + CGAL_assertion(tmp_arc!=NULL); *res++ = make_object( Circular_arc_2(*tmp_arc) ); } diff --git a/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/hexagon_primitives.h b/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/hexagon_primitives.h index 4163b89c7dd..b868305054e 100644 --- a/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/hexagon_primitives.h +++ b/Circular_kernel_2/include/CGAL/Filtered_hexagon_circular_kernel_2/hexagon_primitives.h @@ -137,8 +137,8 @@ CGAL::Polygon_2 < CGAL::Simple_cartesian< double > > // For these and the is_on_ booleans it is required to use a lazy nt - assert(a->is_x_monotone()); - assert(a->is_y_monotone()); + CGAL_assertion(a->is_x_monotone()); + CGAL_assertion(a->is_y_monotone()); CGAL::Bbox_2 left_bb(a->left().bbox()), diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h b/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h index 95f9a2dde02..a8166089273 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h @@ -37,13 +37,13 @@ public: typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; - - + + typedef std::list > Polygon; typedef std::list Polygons; typedef std::list Circles; typedef std::list > Centers_and_radii; - + private: void @@ -53,102 +53,102 @@ private: double xmin, ymin; double xmax, ymax; is >> n; - assert(n == 9); + CGAL_assertion(n == 9); char c; is >> c; - assert(c == '$'); + CGAL_assertion(c == '$'); std::string str; is >> str; if(str == std::string("EXTMIN")){ is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> xmin; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> ymin; } is >> n; - assert(n == 9); + CGAL_assertion(n == 9); is >> c; - assert(c == '$'); + CGAL_assertion(c == '$'); is >> str; if(str == "EXTMAX"){ is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> xmax; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> ymax; } } - - + + void skip_header(std::istream& is) { int n; is >> n; - assert(n == 0); + CGAL_assertion(n == 0); std::string str; is >> str; - assert(str == "SECTION"); + CGAL_assertion(str == "SECTION"); is >> n; - assert(n == 2); + CGAL_assertion(n == 2); is >> str; if(str == "HEADER"){ header(is); } is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; - assert(str == "ENDSEC"); + CGAL_assertion(str == "ENDSEC"); } - - - - void + + + + void read_circle(std::istream& is, Circle_2& circ) { int n; double cx, cy, r; std::string str; is >> n; - assert(n == 8); + CGAL_assertion(n == 8); is >> n; - assert(n == 0); - + CGAL_assertion(n == 0); + is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> cx; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> cy; is >> n; - assert(n == 40); + CGAL_assertion(n == 40); is >> r; FT rft(r); circ = typename K::Construct_circle_2()(Point_2(cx,cy), rft); } - void + void read_center_and_radius(std::istream& is, Point_2& center, FT& rft) { int n; double cx, cy, r; std::string str; is >> n; - assert(n == 8); + CGAL_assertion(n == 8); is >> n; - assert(n == 0); - + CGAL_assertion(n == 0); + is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> cx; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> cy; is >> n; - assert(n == 40); + CGAL_assertion(n == 40); is >> r; center = typename K::Construct_point_2()(cx,cy); @@ -167,7 +167,7 @@ read_polygon(std::istream& is, Polygon& poly) is >> n; if(n != 0){ int m; - is >> m; + is >> m; } } while(n != 0); @@ -175,30 +175,30 @@ read_polygon(std::istream& is, Polygon& poly) is >> str; if(str == "VERTEX"){ is >> n; - assert(n == 8); + CGAL_assertion(n == 8); is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> x; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> y; is >> n; len = 0; if(n == 42){ is >> len; } else { - assert(n == 0); + CGAL_assertion(n == 0); } poly.push_back(std::make_pair(typename K::Construct_point_2()(x,y), len)); } - + } while (str != "SEQEND"); is >> n; - assert(n == 8); + CGAL_assertion(n == 8); is >> n; - assert(n == 0); + CGAL_assertion(n == 0); } @@ -211,15 +211,15 @@ read_entities(std::istream& is, Polygons& polys, Circles& circles) //double x, y; std::string str; is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; - assert(str == "SECTION"); + CGAL_assertion(str == "SECTION"); is >> n; is >> str; - assert(str == "ENTITIES"); + CGAL_assertion(str == "ENTITIES"); do { is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; if(str == "POLYLINE"){ Polygon p; @@ -227,19 +227,18 @@ read_entities(std::istream& is, Polygons& polys, Circles& circles) read_polygon(is, polys.back()); } else if(str == "CIRCLE"){ Circle_2 c; - read_circle(is,c); + read_circle(is,c); circles.push_back(c); } else if(str == "ENDSEC"){ - + } else { - std::cerr << "unknown entity" << std::endl; - std::exit(0); + CGAL_error_msg( "unknown entity" ); } } while(str != "ENDSEC"); is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; - assert(str == "EOF"); + CGAL_assertion(str == "EOF"); } void @@ -249,15 +248,15 @@ read_entities(std::istream& is, Polygons& polys, Centers_and_radii& car) //double x, y; std::string str; is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; - assert(str == "SECTION"); + CGAL_assertion(str == "SECTION"); is >> n; is >> str; - assert(str == "ENTITIES"); + CGAL_assertion(str == "ENTITIES"); do { is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; if(str == "POLYLINE"){ Polygon p; @@ -266,19 +265,18 @@ read_entities(std::istream& is, Polygons& polys, Centers_and_radii& car) } else if(str == "CIRCLE"){ Point_2 center; FT radius; - read_center_and_radius(is,center, radius); + read_center_and_radius(is,center, radius); car.push_back(std::make_pair(center, radius)); } else if(str == "ENDSEC"){ - + } else { - std::cerr << "unknown entity" << std::endl; - std::exit(0); + CGAL_error_msg( "unknown entity" ); } } while(str != "ENDSEC"); is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; - assert(str == "EOF"); + CGAL_assertion(str == "EOF"); } public: diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h index b3da31d970b..800cd108b5a 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h @@ -39,12 +39,12 @@ public: typedef CGAL::Triple Triple; typedef Triple Point_2_and_bulge; typedef Triple Circle_2; - - + + typedef std::list Polygon; typedef std::list Polygons; typedef std::list Circles; - + private: @@ -55,81 +55,81 @@ private: double xmin, ymin; double xmax, ymax; is >> n; - assert(n == 9); + CGAL_assertion(n == 9); char c; is >> c; - assert(c == '$'); + CGAL_assertion(c == '$'); std::string str; is >> str; if(str == std::string("EXTMIN")){ is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> xmin; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> ymin; } is >> n; - assert(n == 9); + CGAL_assertion(n == 9); is >> c; - assert(c == '$'); + CGAL_assertion(c == '$'); is >> str; if(str == "EXTMAX"){ is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> xmax; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> ymax; } } - - + + void skip_header(std::istream& is) { int n; is >> n; - assert(n == 0); + CGAL_assertion(n == 0); std::string str; is >> str; - assert(str == "SECTION"); + CGAL_assertion(str == "SECTION"); is >> n; - assert(n == 2); + CGAL_assertion(n == 2); is >> str; if(str == "HEADER"){ header(is); } is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; - assert(str == "ENDSEC"); + CGAL_assertion(str == "ENDSEC"); } - - - - void + + + + void read_circle(std::istream& is, Circle_2& circ) { int n; double cx, cy, r; std::string str; is >> n; - assert(n == 8); + CGAL_assertion(n == 8); is >> n; - assert(n == 0); - + CGAL_assertion(n == 0); + is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> cx; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> cy; is >> n; - assert(n == 40); + CGAL_assertion(n == 40); is >> r; FT rft(r); - + circ = Circle_2(cx,cy,rft); } @@ -145,7 +145,7 @@ read_polygon(std::istream& is, Polygon& poly) is >> n; if(n != 0){ int m; - is >> m; + is >> m; } } while(n != 0); @@ -153,30 +153,30 @@ read_polygon(std::istream& is, Polygon& poly) is >> str; if(str == "VERTEX"){ is >> n; - assert(n == 8); + CGAL_assertion(n == 8); is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> n; - assert(n == 10); + CGAL_assertion(n == 10); is >> x; is >> n; - assert(n == 20); + CGAL_assertion(n == 20); is >> y; is >> n; len = 0; if(n == 42){ is >> len; } else { - assert(n == 0); + CGAL_assertion(n == 0); } poly.push_back(Point_2_and_bulge(x,y, len)); } - + } while (str != "SEQEND"); is >> n; - assert(n == 8); + CGAL_assertion(n == 8); is >> n; - assert(n == 0); + CGAL_assertion(n == 0); } @@ -189,15 +189,15 @@ read_entities(std::istream& is, Polygons& polys, Circles& circles) //double x, y; std::string str; is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; - assert(str == "SECTION"); + CGAL_assertion(str == "SECTION"); is >> n; is >> str; - assert(str == "ENTITIES"); + CGAL_assertion(str == "ENTITIES"); do { is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; if(str == "POLYLINE"){ Polygon p; @@ -205,19 +205,18 @@ read_entities(std::istream& is, Polygons& polys, Circles& circles) read_polygon(is, polys.back()); } else if(str == "CIRCLE"){ Circle_2 c; - read_circle(is,c); + read_circle(is,c); circles.push_back(c); } else if(str == "ENDSEC"){ - + } else { - std::cerr << "unknown entity" << std::endl; - std::exit(0); + CGAL_error_msg( "unknown entity" ); } } while(str != "ENDSEC"); is >> n; - assert(n == 0); + CGAL_assertion(n == 0); is >> str; - assert(str == "EOF"); + CGAL_assertion(str == "EOF"); } diff --git a/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_constructions.h b/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_constructions.h index 0c442cdcdc1..9c25fcbb9b9 100644 --- a/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_constructions.h +++ b/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_constructions.h @@ -121,7 +121,7 @@ public: } else{ std::cout << "UNEXPECTED CONSTRUCT_INTERSECTIONS_2 PRODUCT" << std::endl; std::cout << lv.approx()[i].type().name() << std::endl; - CGAL_assertion(false); + CGAL_error(); } } @@ -189,7 +189,7 @@ public: ++it; } else { - CGAL_assertion_msg(false, "UNEXPECTED MAKE_X_MONOTONE PRODUCT"); + CGAL_error_msg( "UNEXPECTED MAKE_X_MONOTONE PRODUCT"); } } @@ -258,7 +258,7 @@ public: ++it; } else{ - CGAL_assertion_msg(false, "UNEXPECTED ADVANCED_MAKE_X_MONOTONE PRODUCT"); + CGAL_error_msg( "UNEXPECTED ADVANCED_MAKE_X_MONOTONE PRODUCT"); } } @@ -271,7 +271,7 @@ public: for (std::vector::iterator oit = exact_objects.begin(); oit != exact_objects.end(); ++oit){ - CGAL_assertion_msg(false, "Unfinished code !!!"); + CGAL_error_msg( "Unfinished code !!!"); //*it = std::make_pair(make_lazy_CK((*oit).first),(*oit).second); ++it; } diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h index de8a7771636..65f16973715 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h @@ -51,7 +51,7 @@ namespace CGAL { private: const Sphere_3& get_ref_sphere(const typename SK::Circle_on_reference_sphere_3& C){return C.reference_sphere();} - Sphere_3 get_ref_sphere(const typename SK::Circle_3& C){CGAL_assertion(false);} + Sphere_3 get_ref_sphere(const typename SK::Circle_3& C){CGAL_error();} typedef Triple Rep; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h index b6c2500d19b..35e30274957 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h @@ -166,8 +166,8 @@ namespace CGAL { CGAL_kernel_precondition(!SK().has_on_3_object()(p2,l)); typename SK::Point_3 point1, point2; // l must intersect p1 and p2 - assert(assign(point1,SK().intersect_3_object()(l, p1))); - assert(assign(point2,SK().intersect_3_object()(l, p2))); + CGAL_assertion(assign(point1,SK().intersect_3_object()(l, p1))); + CGAL_assertion(assign(point2,SK().intersect_3_object()(l, p2))); assign(point1,SK().intersect_3_object()(l, p1)); assign(point2,SK().intersect_3_object()(l, p2)); // the source and target must be different diff --git a/Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h b/Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h index 25f8d27829a..15444dcfcc4 100644 --- a/Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h +++ b/Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h @@ -250,7 +250,7 @@ template struct Convex_hull_d_traits_3 if(s == e){ pl = Hyperplane_d( A[0], A[1], A[2] ); } else { - CGAL_assertion(false); + CGAL_error(); } } } diff --git a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index dfa321fd9b7..fa5c9492340 100755 --- a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -562,7 +562,7 @@ public: CGAL_precondition(bnd1_y * bnd2_y < 0 || bnd1_y == bnd2_y); if(is_singular(bnd1_y) != is_singular(bnd2_y)) { // only one curve end lies at singularity (another at +/-oo) - CGAL_error("SINGULARITY + INF comparison is not yet implemented"); + CGAL_error_msg("SINGULARITY + INF comparison is not yet implemented"); } Curve_kernel_2 kernel_2; if(is_singular(bnd1_y) && is_singular(bnd2_y)) { @@ -668,7 +668,7 @@ public: // report x-range assert violation if the point lies on disc in // x but neither of arc's ends do if(!(eq_min || eq_max)) - CGAL_error("Target point is not within the arc's x-range"); + CGAL_error_msg("Target point is not within the arc's x-range"); } else // we should be able to access x-coord when point is on disc in_x_range = is_in_x_range(p.x(), &eq_min, &eq_max); @@ -801,7 +801,7 @@ public: return CGAL::LARGER; if(is_singular(bndp_y)) // singularity in y - CGAL_error("Handling singularity in y is not yet implemented"); + CGAL_error_msg("Handling singularity in y is not yet implemented"); // vertical line immediately to the left of p: if p lies on boundary // get the vertical line over the last interval; otherwise @@ -867,7 +867,7 @@ public: return CGAL::SMALLER; if(is_singular(bndp_y)) // singularity in y - CGAL_error("Handling singularity in y is not yet implemented"); + CGAL_error_msg("Handling singularity in y is not yet implemented"); // vertical line immediately to the right of p: if p lies on boundary // get the vertical line over the first interval; otherwise @@ -1069,7 +1069,7 @@ public: return false; if(!curve().is_identical(cv2.curve())) - CGAL_error("Not yet implemented"); + CGAL_error_msg("Not yet implemented"); // LARGER source and smaller target Point_2 src = (_same_arc_compare_xy(_minpoint(), cv2._minpoint(), @@ -1267,7 +1267,7 @@ public: return true; if(!curve().is_identical(cv2.curve())) { - CGAL_error("do_overlap() for non-coprime curves is not yet " + CGAL_error_msg("do_overlap() for non-coprime curves is not yet " "implemented for "); } if(is_vertical() != cv2.is_vertical()) @@ -1311,7 +1311,7 @@ public: return (_same_arc_compare_xy(_minpoint(), cv2._maxpoint(), false, true) == CGAL::SMALLER); } - CGAL_error("bogus comparison result"); + CGAL_error_msg("bogus comparison result"); return false; } diff --git a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index b538f9176e6..26bc0a1e0d2 100755 --- a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -322,7 +322,7 @@ private: if(type != CGAL::NO_BOUNDARY && this->ptr()->_m_boundary_in_y != CGAL::NO_BOUNDARY) - CGAL_error("Denied to set the boundary condition in x while the " + CGAL_error_msg("Denied to set the boundary condition in x while the " "boundary condition in y is set"); this->ptr()->_m_boundary_in_x = type; } @@ -334,7 +334,7 @@ private: if(type != CGAL::NO_BOUNDARY && this->ptr()->_m_boundary_in_x != CGAL::NO_BOUNDARY) - CGAL_error("Denied to set the boundary condition in y while the " + CGAL_error_msg("Denied to set the boundary condition in y while the " "boundary condition in x is set"); this->ptr()->_m_boundary_in_y = type; } diff --git a/Developers_manual/doc_tex/Developers_manual/checks.tex b/Developers_manual/doc_tex/Developers_manual/checks.tex index 2ed260b2179..93415bf80dc 100644 --- a/Developers_manual/doc_tex/Developers_manual/checks.tex +++ b/Developers_manual/doc_tex/Developers_manual/checks.tex @@ -25,7 +25,7 @@ Much of the {\cgal} code contains checks. Some are there to check if the code behaves correctly, others check if the user calls routines in an acceptable manner. We describe the different categories of checks (Section~\ref{sec:checks_categories}), the usage of checks -(Section~\ref{sec:checks_using}), and a more selective means of controlling +(Section~\ref{sec:checks_using}), and a more selective means of controlling checks (Section~\ref{sec:checks_controlling}). Finally, a statement about exception handling is given (Section~\ref{sec:exception_handling}). @@ -39,38 +39,48 @@ react after the error (application processes are killed). \section{Categories of checks\label{sec:checks_categories}} \ccIndexSubitemBegin{checks}{types of} -There are four types of checks. +There are four types of checks. % \begin{itemize} -\item \textbf{Preconditions}\ccIndexMainItemDef{preconditions} +\item \textbf{Preconditions}\ccIndexMainItemDef{preconditions} check if a routine has been called in a proper fashion. If a precondition fails it is the responsibility of the caller (usually the user of the library) to fix the problem. -\item \textbf{Postconditions}\ccIndexMainItemDef{postconditions} +\item \textbf{Postconditions}\ccIndexMainItemDef{postconditions} check if a routine does what it promises to do. If a postcondition fails it is the fault of this routine, so the author of the code is responsible. -\item \textbf{Assertions}\ccIndexMainItemDef{assertions} +\item \textbf{Assertions}\ccIndexMainItemDef{assertions} are other checks that do not fit in the above two categories, \eg~they can be used to check invariants. \item \textbf{Warnings}\ccIndexMainItemDef{warnings} are checks for which it is not so severe if they fail. \end{itemize} + +The addording macro names all have the format \ccc{CGAL_} where +\ccc{} can be one of +\begin{itemize} + \item \ccc{precondition} + \item \ccc{postcondition} + \item \ccc{assertion} + \item \ccc{warning} +\end{itemize} + % Failures of the first three types are errors and lead to a halt of the program, failures of the last one only lead to a warning. Checks of all four categories can be marked with one or both of the following -attributes. +attributes: % \begin{itemize} -\item \emph{Expensive}\ccIndexSubitemDef{checks}{expensive} +\item \textbf{Expensive}\ccIndexSubitemDef{checks}{expensive} checks take considerable time to compute. ``Considerable'' is an imprecise phrase. Checks that add less than 10 percent to the execution time of their routine are not expensive. Checks that can double the execution time are. Somewhere in between lies the border line. -\item \emph{Exactness}\ccIndexSubitemDef{checks}{exactness}% +\item \textbf{Exactness}\ccIndexSubitemDef{checks}{exactness}% \ccIndexSubitem{exactness}{checking} checks rely on exact arithmetic. For example, if the intersection of two lines is computed, the postcondition of @@ -78,7 +88,14 @@ attributes. lines. However, if the computation is done with \ccc{double}s as the number type, this may not be the case, due to roundoff errors. \end{itemize} -% + +The format is one of +\begin{itemize} + \item \ccc{CGAL_expensive_} + \item \ccc{CGAL_exactness_} + \item \ccc{CGAL_expensive_exactness_} +\end{itemize} + \ccIndexSubitem{checks}{default} By default, all standard checks (without any attribute) are enabled, while expensive and exactness checks are disabled. How this can be @@ -86,6 +103,10 @@ changed and how checks are actually used in the code are described in the next section. \ccIndexSubitemEnd{checks}{types of} +Additionally, we provide macros \ccc{CGAL_error()} and \ccc{CGAL_error_msg(MSG_TEXT)} +which are equivalent to always-failing assertions. However, +they cannot be disabled. + % ----------------------------------------------------------------------------- \section{Using checks\label{sec:checks_using}} @@ -112,7 +133,7 @@ the check fails, an error message similar to % is written to the standard error stream and the program is aborted. If an additional explanantion should be given to the user,% -\ccIndexSubitem{checks}{adding failure message to} +\ccIndexSubitem{checks}{adding failure message to} macros \ccc{CGAL__msg(,)} can be used. The text in \ccc{} is just appended to the failure message given above. @@ -149,12 +170,12 @@ The flag \ccc{CGAL_NDEBUG} disables all checks in \cgal\ but does not affect the standard \ccc{assert} macro. \ccIndexSubitemEnd{checks}{disabling} -To enable expensive and exactness checks, respectively, the compile-time +To enable expensive and exactness checks, respectively, the compile-time flags \ccc{CGAL_CHECK_EXPENSIVE}% -\index{CGAL_CHECK_EXPENSIVE flag@{\tt CGAL\_CHECK\_EXPENSIVE} flag} +\index{CGAL_CHECK_EXPENSIVE flag@{\tt CGAL\_CHECK\_EXPENSIVE} flag} \ccIndexSubsubitem{checks}{expensive}{enabling} -and \ccc{CGAL_CHECK_EXACTNESS} -\index{CGAL_CHECK_EXACTNESS flag@{\tt CGAL\_CHECK\_EXACTNESS} flag} +and \ccc{CGAL_CHECK_EXACTNESS} +\index{CGAL_CHECK_EXACTNESS flag@{\tt CGAL\_CHECK\_EXACTNESS} flag} \ccIndexSubsubitem{checks}{exactness}{enabling} have to be supplied. However, exactness checks should only be turned on if the computation is done with some exact number type.% @@ -252,12 +273,12 @@ Requirements: \begin{itemize} \item Write pre- and postcondition checkers for your functions wherever possible. - \item Use the \cgal\ preprocessor macros (Sections~\ref{sec:checks_using} + \item Use the \cgal\ preprocessor macros (Sections~\ref{sec:checks_using} and~\ref{sec:checks_controlling}) exclusively throughout your code (instead of, for example, the \ccc{assert} macro or the \ccc{std::abort} or - \ccc{std::exit} functions) for all checks - to assure that all \cgal\ invariant tests can be handled in a uniform + \ccc{std::exit} functions) for all checks + to assure that all \cgal\ invariant tests can be handled in a uniform way. \end{itemize} diff --git a/Envelope_3/include/CGAL/Env_sphere_traits_3.h b/Envelope_3/include/CGAL/Env_sphere_traits_3.h index b2dff5ab5a6..7f3fa235909 100644 --- a/Envelope_3/include/CGAL/Env_sphere_traits_3.h +++ b/Envelope_3/include/CGAL/Env_sphere_traits_3.h @@ -1049,7 +1049,7 @@ public: return SMALLER; } else - CGAL_assertion(false); + CGAL_error(); return EQUAL; } diff --git a/Envelope_3/include/CGAL/Env_triangle_traits_3.h b/Envelope_3/include/CGAL/Env_triangle_traits_3.h index 0ab54552e22..1f635cd3972 100644 --- a/Envelope_3/include/CGAL/Env_triangle_traits_3.h +++ b/Envelope_3/include/CGAL/Env_triangle_traits_3.h @@ -1281,7 +1281,7 @@ public: points_on_plane[n_points_on_plane++] = i; } - assert (n_points_on_plane + + CGAL_assertion(n_points_on_plane + n_points_on_positive + n_points_on_negative == 3); // if all vertices of tri lie on the same size (positive/negative) of pl, @@ -1330,10 +1330,10 @@ public: } - assert( n_points_on_plane == 0 ); - assert( n_points_on_positive + n_points_on_negative == 3 ); - assert( n_points_on_positive != 0 ); - assert( n_points_on_negative != 0 ); + CGAL_assertion( n_points_on_plane == 0 ); + CGAL_assertion( n_points_on_positive + n_points_on_negative == 3 ); + CGAL_assertion( n_points_on_positive != 0 ); + CGAL_assertion( n_points_on_negative != 0 ); // now it known that there is an intersection between 2 segments of tri // and pl, it is also known which segments are those. @@ -1352,7 +1352,7 @@ public: inter_points[n_inter_points++] = inter_point; } - assert( n_inter_points == 2 ); + CGAL_assertion( n_inter_points == 2 ); return make_object(Segment_3(inter_points[0], inter_points[1])); } diff --git a/Envelope_3/include/CGAL/Envelope_3/Env_plane_traits_3_functions.h b/Envelope_3/include/CGAL/Envelope_3/Env_plane_traits_3_functions.h index f60ef9c4d08..a020756c421 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Env_plane_traits_3_functions.h +++ b/Envelope_3/include/CGAL/Envelope_3/Env_plane_traits_3_functions.h @@ -79,7 +79,7 @@ Object half_plane_half_plane_proj_intersection(const typename K::Plane_3 &h1, if(assign(ray, obj)) return ray_under_linear_constraint(ray, l1, k); - CGAL_assertion(false); // doesnt suppose to reach here + CGAL_error(); // doesnt suppose to reach here return Object(); } diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h index 1c4be076ac9..115a7cd42e2 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h @@ -135,7 +135,7 @@ protected: return true; if (res == LARGER) return false; - CGAL_assertion(false); + CGAL_error(); return (p1.second == true || p2.third == true); } }; @@ -290,7 +290,7 @@ public: insert (copied_face_arr, curve.first, pl, zone_visitor); } else - CGAL_assertion_msg(false, "wrong projected intersection type"); + CGAL_error_msg( "wrong projected intersection type"); } zone_visitor.finish(); @@ -567,7 +567,7 @@ public: } else - CGAL_assertion_msg(false, "wrong projected intersection type"); + CGAL_error_msg( "wrong projected intersection type"); } // if there aren't any split points, we can finish @@ -976,7 +976,7 @@ protected: const Xy_monotone_surface_3&, Tag_false) { - CGAL_assertion(false); // doesnt' suppose to reach here at all!!! + CGAL_error(); // doesnt' suppose to reach here at all!!! return SMALLER; } diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_overlay_functor.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_overlay_functor.h index 92f2fa216c4..d030b52be6f 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_overlay_functor.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_overlay_functor.h @@ -374,7 +374,7 @@ protected: } else // this cannot happen, since we need to touch an edge - CGAL_assertion(false); + CGAL_error(); } // update halfedge-target flags of new_h that is created inside face in_face diff --git a/Envelope_3/test/Envelope_3/Envelope_test_3.h b/Envelope_3/test/Envelope_3/Envelope_test_3.h index 1ca15cfef35..52cbba9175f 100644 --- a/Envelope_3/test/Envelope_3/Envelope_test_3.h +++ b/Envelope_3/test/Envelope_3/Envelope_test_3.h @@ -465,7 +465,7 @@ protected: shoot_target = (env.non_const_handle(shoot_vh))->point(); } else - CGAL_assertion(false); // it cannot be the unbounded face + CGAL_error(); // it cannot be the unbounded face Point_2 res_point = traits.construct_middle_point(shoot_source, shoot_target); diff --git a/Envelope_3/test/Envelope_3/Envelope_triangles_test_3.h b/Envelope_3/test/Envelope_3/Envelope_triangles_test_3.h index 287f32aecca..412e230e0ac 100644 --- a/Envelope_3/test/Envelope_3/Envelope_triangles_test_3.h +++ b/Envelope_3/test/Envelope_3/Envelope_triangles_test_3.h @@ -620,7 +620,7 @@ protected: shoot_target = (env.non_const_handle(shoot_vh))->point(); } else - CGAL_assertion(false); // it cannot be the unbounded face + CGAL_error(); // it cannot be the unbounded face Point_2 res_point = traits.construct_middle_point(shoot_source, shoot_target); diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index cad4ebf7693..6de341a749b 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -1330,7 +1330,7 @@ struct Ith { else if(const Pair_type_2 *p2 = object_cast(&v[i])) return p2->first; - CGAL_assertion_msg(false, " Unexpected encapsulated type "); + CGAL_error_msg( " Unexpected encapsulated type "); } }; diff --git a/Filtered_kernel/include/CGAL/Static_filter_error.h b/Filtered_kernel/include/CGAL/Static_filter_error.h index d89fa4dc48b..af711f944c7 100644 --- a/Filtered_kernel/include/CGAL/Static_filter_error.h +++ b/Filtered_kernel/include/CGAL/Static_filter_error.h @@ -112,7 +112,7 @@ struct Static_filter_error Sfe operator- (const Sfe &f) const { return *this + f; } Sfe operator- () const { return *this; } - // Sfe operator/ (const Sfe &) const { CGAL_assertion(false); } + // Sfe operator/ (const Sfe &) const { CGAL_error(); } // Division not supported. Sfe& operator+=(const Sfe &f) { return *this = *this + f; } @@ -128,7 +128,7 @@ struct Static_filter_error { Sfe e = *this + f; std::cerr << "Static error is : " << e.error() << std::endl; - CGAL_assertion(false); + CGAL_error(); return false; } bool operator> (const Sfe &f) const { return *this < f; } diff --git a/Geomview/src/CGAL/Geomview_stream.cpp b/Geomview/src/CGAL/Geomview_stream.cpp index 4902052dd5d..2912740c38b 100644 --- a/Geomview/src/CGAL/Geomview_stream.cpp +++ b/Geomview/src/CGAL/Geomview_stream.cpp @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri, Herve Bronnimann, Sylvain Pion @@ -68,19 +68,16 @@ void Geomview_stream::setup_geomview(const char *machine, const char *login) std::cout << "Starting Geomview..." << std::flush; if (pipe(pipe_out) < 0) { - std::cerr << "out pipe failed" << std::endl; - std::exit(-1); + CGAL_error_msg( "out pipe failed" ); } if (pipe(pipe_in) < 0) { - std::cerr << "in pipe failed" << std::endl; - std::exit(-1); + CGAL_error_msg( "in pipe failed" ); } switch (pid = fork()){ case -1: - std::cerr << "fork failed" << std::endl; - std::exit(-1); + CGAL_error_msg( "fork failed" ); case 0: // The child process close(pipe_out[1]); // does not write to the out pipe, close(pipe_in[0]); // does not read from the in pipe. @@ -105,9 +102,9 @@ void Geomview_stream::setup_geomview(const char *machine, const char *login) std::cerr << "execl geomview failed" << std::endl; switch(errno) { case EACCES: - std::cerr << "please check your environment variable PATH" + std::cerr << "please check your environment variable PATH" << std::endl; - std::cerr << "make sure the file `geomview' is contained in it" + std::cerr << "make sure the file `geomview' is contained in it" << std::endl; std::cerr << "and is executable" << std::endl; break; @@ -115,10 +112,10 @@ void Geomview_stream::setup_geomview(const char *machine, const char *login) std::cerr << "too many links for filename `geomview'" << std::endl; break; default: - std::cerr << "error number " << errno << " (check `man execlp')" + std::cerr << "error number " << errno << " (check `man execlp')" << std::endl; }; - std::exit(-1); + CGAL_error(); default: // The parent process close(pipe_out[0]); // does not read from the out pipe, close(pipe_in[1]); // does not write to the in pipe. @@ -217,9 +214,7 @@ Geomview_stream& Geomview_stream::operator<<(const std::string & s) { if ((int)s.length() != ::write(out, s.data(), s.length())) { - std::cerr << "write problem in the pipe while sending data to geomview" - << std::endl; - std::exit(-1); + CGAL_error_msg( "write problem in the pipe while sending data to geomview" ); } trace(s); @@ -501,7 +496,7 @@ char* Geomview_stream::nth(char* s, int count) { s++; // skip first character (always a parenthesis) - + // Skip "count" words. for(; count != 0; count--) { while (*s == ' ') // skip whitespaces @@ -512,7 +507,7 @@ Geomview_stream::nth(char* s, int count) } while (*s == ' ') // skip whitespaces s++; - + // Now we have the beginning of the searched sub-expression. int j = 1; if (*s == '(') // Case of a well-parenthesed expression. @@ -529,7 +524,7 @@ Geomview_stream::nth(char* s, int count) else // Case of a word terminated by ' ' or ')'. while (s[j] != ' ' && s[j] != ')') j++; - + s[j] = '\0'; return s; } diff --git a/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h b/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h index 8c423664af3..c20d9e3ebc2 100644 --- a/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h +++ b/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h @@ -295,7 +295,7 @@ natural_neighbor_coordinates_2(const Dt& dt, Vertex_circulator vc = dt.incident_vertices(vh), done(vc); do{ - assert(!dt.is_infinite(vc)); + CGAL_assertion(!dt.is_infinite(vc)); t2.insert(vc->point()); } while(++vc!=done); diff --git a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h index 8a58eb48a7b..5713c1876e8 100644 --- a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h +++ b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h @@ -387,7 +387,7 @@ regular_neighbor_coordinates_2(const Rt& rt, Vertex_circulator vc = rt.incident_vertices(vh), done(vc); do{ - assert(!rt.is_infinite(vc)); + CGAL_assertion(!rt.is_infinite(vc)); t2.insert(vc->point()); } while(++vc!=done); diff --git a/Interpolation/include/CGAL/surface_neighbors_3.h b/Interpolation/include/CGAL/surface_neighbors_3.h index 8d6a5ffebff..e673faf29e8 100644 --- a/Interpolation/include/CGAL/surface_neighbors_3.h +++ b/Interpolation/include/CGAL/surface_neighbors_3.h @@ -76,7 +76,7 @@ surface_neighbors_3(InputIterator first, InputIterator beyond, done(vc); do{ *out++= vc->point(); - assert(! it.is_infinite(vc)); + CGAL_assertion(! it.is_infinite(vc)); } while(vc++!=done); diff --git a/Interval_skip_list/include/CGAL/Interval_skip_list_interval.h b/Interval_skip_list/include/CGAL/Interval_skip_list_interval.h index e726903313e..2dcf8f22173 100644 --- a/Interval_skip_list/include/CGAL/Interval_skip_list_interval.h +++ b/Interval_skip_list/include/CGAL/Interval_skip_list_interval.h @@ -13,13 +13,14 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri #ifndef CGAL_INTERVAL_SKIP_LIST_INTERVAL_H #define CGAL_INTERVAL_SKIP_LIST_INTERVAL_H +#include #include #include @@ -40,8 +41,8 @@ namespace CGAL { public: Interval_skip_list_interval(){} - Interval_skip_list_interval(const Value& inf_, - const Value& sup_, + Interval_skip_list_interval(const Value& inf_, + const Value& sup_, bool lb = true, bool rb = true); @@ -56,15 +57,15 @@ namespace CGAL { bool contains(const Value& V) const; // true iff this contains (l,r) - bool contains_interval(const Value& l, const Value& r) const; + bool contains_interval(const Value& l, const Value& r) const; - bool operator==(const Interval_skip_list_interval& I) const + bool operator==(const Interval_skip_list_interval& I) const { - return ( (inf() == I.inf()) && (sup() == I.sup()) && + return ( (inf() == I.inf()) && (sup() == I.sup()) && (inf_closed() == I.inf_closed()) && (sup_closed() == I.sup_closed()) ); } - bool operator!=(const Interval_skip_list_interval& I) const + bool operator!=(const Interval_skip_list_interval& I) const { return ! (*this == I); } @@ -73,7 +74,7 @@ namespace CGAL { template - std::ostream& operator<<(std::ostream& os, + std::ostream& operator<<(std::ostream& os, const Interval_skip_list_interval& i) { os << (i.inf_closed()?"[":"(") << i.inf() << ", " << i.sup() << (i.sup_closed()?"]":")"); @@ -83,22 +84,18 @@ namespace CGAL { template Interval_skip_list_interval::Interval_skip_list_interval( - const Value& i, - const Value& s, + const Value& i, + const Value& s, bool lb, bool rb) : lbound_(lb), rbound_(rb), inf_(i), sup_(s) { - if ( inf_ > sup_ ) - { - std::cerr << "Error: " << *this << std::endl; - std::exit(1); - } + CGAL_precondition( !(inf_ > sup_) ); } template bool - Interval_skip_list_interval::contains_interval(const Value& i, + Interval_skip_list_interval::contains_interval(const Value& i, const Value& s) const // true iff this contains (l,r) { diff --git a/Jet_fitting_3/include/CGAL/Lapack/Linear_algebra_lapack.h b/Jet_fitting_3/include/CGAL/Lapack/Linear_algebra_lapack.h index 305c4078a10..8f25c03da63 100644 --- a/Jet_fitting_3/include/CGAL/Lapack/Linear_algebra_lapack.h +++ b/Jet_fitting_3/include/CGAL/Lapack/Linear_algebra_lapack.h @@ -136,7 +136,7 @@ public: LAPACK::dgelss(&m, &n, &nrhs, M.matrix(), &lda, B.vector(), &ldb, sing_values, &rcond, &rank, work, &lwork, &info); - assert(info==0); + CGAL_assertion(info==0); FT cond_nb = sing_values[0]/sing_values[n-1]; diff --git a/Kernel_23/include/CGAL/Object.h b/Kernel_23/include/CGAL/Object.h index db3059b2e5c..e2f754c043d 100644 --- a/Kernel_23/include/CGAL/Object.h +++ b/Kernel_23/include/CGAL/Object.h @@ -95,7 +95,7 @@ class Object #ifdef _MSC_VER } catch (...) { - CGAL_assertion_msg(false, "ERROR : YOUR COMPILER MUST SUPPORT RTTI"); + CGAL_error_msg( "Your compiler must support RTTI"); } #endif return true; diff --git a/Kernel_d/include/CGAL/Kernel_d/debug.h b/Kernel_d/include/CGAL/Kernel_d/debug.h index e22ca34520c..9dc6f4551a9 100644 --- a/Kernel_d/include/CGAL/Kernel_d/debug.h +++ b/Kernel_d/include/CGAL/Kernel_d/debug.h @@ -89,7 +89,7 @@ namespace { std::cerr << " COND: " << #cond << std::endl; \ std::cerr << " POSITION: " << __FILE__ << " at line "<< __LINE__ \ << std::endl; \ - CGAL_assertion(false); \ + CGAL_error(); \ } #endif diff --git a/Kinetic_data_structures/hidden/include/CGAL/Updatable_Delaunay_triangulation_2.h b/Kinetic_data_structures/hidden/include/CGAL/Updatable_Delaunay_triangulation_2.h index f830965813f..0037a14c58c 100644 --- a/Kinetic_data_structures/hidden/include/CGAL/Updatable_Delaunay_triangulation_2.h +++ b/Kinetic_data_structures/hidden/include/CGAL/Updatable_Delaunay_triangulation_2.h @@ -64,7 +64,7 @@ template struct Updatable_Delaunay_triangulation_2 { typedef typename IndirectKernel::Point_2 Point_key; - + typedef typename Kinetic::Suggested_exact_simulation_traits_base SimTraits_base; @@ -73,7 +73,7 @@ struct Updatable_Delaunay_triangulation_2 { typedef CGAL::Interval_nt_advanced INT; - + /*typedef CGAL::Gmpq NT; typedef CGAL::POLYNOMIAL::Polynomial Function; @@ -90,7 +90,7 @@ struct Updatable_Delaunay_triangulation_2 { typedef typename CGAL::Kinetic::Cartesian_kinetic_kernel Kinetic_kernel; typedef IndirectKernel Indirect_kernel; - + typedef Updatable_delaunay_triangulation_table_2 Update_information; @@ -122,7 +122,7 @@ struct Updatable_Delaunay_triangulation_2 { struct Simulation_traits { typedef SimTraits_base P; - + struct Sillyness { typedef Kinetic_kernel KK; typedef Simulator S; @@ -130,7 +130,7 @@ struct Updatable_Delaunay_triangulation_2 { }; typedef typename Sillyness::KK Kinetic_kernel; typedef typename Sillyness::S Simulator; - + typedef Update_information Active_points_2_table; Active_points_2_table* active_points_2_table_handle() { return ap_.get(); @@ -138,14 +138,14 @@ struct Updatable_Delaunay_triangulation_2 { const Active_points_2_table* active_points_2_table_handle() const { return ap_.get(); } - + typedef CGAL::Simple_cartesian Static_kernel; typedef typename Kinetic::Cartesian_instantaneous_kernel Instantaneous_kernel; Instantaneous_kernel instantaneous_kernel_object() const { return Instantaneous_kernel(ap_, Static_kernel()); } - + typename Simulator::Handle simulator_handle() { return sim_; } @@ -159,7 +159,7 @@ struct Updatable_Delaunay_triangulation_2 { typedef typename Simulator::Time Time; - Simulation_traits(Indirect_kernel ik, + Simulation_traits(Indirect_kernel ik, double lb, double ub): sim_(new Simulator(lb, ub)){ ap_=new Active_points_2_table(ik, kinetic_kernel_object()); @@ -231,10 +231,10 @@ struct Updatable_Delaunay_triangulation_2 { - + struct Traits: public Default_traits { typedef Default_traits P; - + typedef typename Simulation_traits::Simulator::Time Time; struct Certificate_data{}; typedef std::pair Certificate_pair; @@ -251,7 +251,7 @@ struct Updatable_Delaunay_triangulation_2 { Cert_tuple tuple(Point_key ks[4]) const { return Cert_tuple(ks); } - + #ifndef NDEBUG Cert_tuple tuple(typename Default_traits::Edge e) const { Point_key ks[4]; @@ -264,7 +264,7 @@ struct Updatable_Delaunay_triangulation_2 { else return Cert_tuple(ks); } #endif - + void point_changed(Point_key ){ //ui()->point_changed(k); } @@ -281,7 +281,7 @@ struct Updatable_Delaunay_triangulation_2 { Certificate_pair return_pair(Time rt) const { return Certificate_pair(rt, Certificate_data()); } - + double rational_current_time() const { return CGAL::to_interval(current_time()).first; @@ -293,9 +293,9 @@ struct Updatable_Delaunay_triangulation_2 { Update_information* ui() { return P::active_points_2_table_handle().get(); } - - bool hull_certificate_failure_time(typename Default_traits::Edge, Point_key [3], + + bool hull_certificate_failure_time(typename Default_traits::Edge, Point_key [3], Time, Certificate_data) { return false; } @@ -343,10 +343,10 @@ struct Updatable_Delaunay_triangulation_2 { } else { ect= current_time().refiner().check_.failure_time(); } - + check_cert= ui()->in_circle_object()(ui()->exact_point(ct[0]), ui()->exact_point(ct[1]), - ui()->exact_point(ct[2]), + ui()->exact_point(ct[2]), ui()->exact_point(ct[3]), ect, 1); check_failure_time= check_cert.failure_time(); @@ -363,7 +363,7 @@ struct Updatable_Delaunay_triangulation_2 { //if (bt <0) { bt= CGAL::to_interval(current_time()).first; //} - + #ifdef MOVE_ALL if (!disable_filter_1_ && !ui()->can_fail(ct, bt)) { CGAL_postcondition(check_failure_time > 1); @@ -384,7 +384,7 @@ struct Updatable_Delaunay_triangulation_2 { if (found) { CGAL_UD_DEBUG("Will activate " << std::endl); return false; - } + } } } else { end_time= check_activation(ct, end_time); @@ -394,10 +394,10 @@ struct Updatable_Delaunay_triangulation_2 { CGAL_postcondition(check_failure_time > 1); return false; } - - + + #endif - + typename Update_information::Certificate_function cf; typename Update_information::Certificate_derivitive cfp; @@ -408,7 +408,7 @@ struct Updatable_Delaunay_triangulation_2 { if (!(ui()->is_active(ct[0]) || ui()->is_active(ct[1]) || ui()->is_active(ct[2]) || ui()->is_active(ct[3]))) { isc= Update_information::NO_FAILURE; - } else + } else #endif #endif { @@ -425,7 +425,7 @@ struct Updatable_Delaunay_triangulation_2 { } //typename Update_information::Certificate_evaluator se(cf); - + typename Update_information::Certificate_acceleration cfpp= cfp.prime(); if (!disable_filter_3_) { isc= ui()->Newton_isolate(cf, cfp, cfpp, @@ -445,7 +445,7 @@ struct Updatable_Delaunay_triangulation_2 { CGAL_UD_DEBUG("Refining current time to " << current_time() << std::endl); bt= CGAL::to_interval(current_time()).first; if (!disable_filter_3_) { - isc= ui()->Newton_isolate(cf, cfp, cfpp, + isc= ui()->Newton_isolate(cf, cfp, cfpp, bt > CGAL::to_interval(current_time()).second, bt, end_time, ft); } @@ -457,7 +457,7 @@ struct Updatable_Delaunay_triangulation_2 { } } - if (isc == Update_information::NO_FAILURE) { + if (isc == Update_information::NO_FAILURE) { CGAL_UD_DEBUG("No root" << std::endl << std::endl); CGAL_assertion(check_failure_time >=1); return false; @@ -470,7 +470,7 @@ struct Updatable_Delaunay_triangulation_2 { /* Check if the curren time is exact, if so check if I am positive at it*/ - if (isc == Update_information::CERTAIN_FAILURE + if (isc == Update_information::CERTAIN_FAILURE && CGAL::compare(rett, current_time()) == CGAL::LARGER) { #ifndef NDEBUG @@ -520,30 +520,30 @@ struct Updatable_Delaunay_triangulation_2 { ++stat_unfailing_exact_certificate_functions_; return false; } - + #if 0 CGAL_UD_DEBUG("Initial points are " << std:: endl); - + typename Indirect_kernel::Current_coordinates ic= ui()->initial_coordinates_object(); typename Indirect_kernel::Current_coordinates fc= ui()->final_coordinates_object(); { CGAL::Protect_FPU_rounding prot; CGAL_UD_DEBUG(ic(ct[0]) << ": " - << ic(ct[1]) << ": " - << ic(ct[2]) << ": " + << ic(ct[1]) << ": " + << ic(ct[2]) << ": " << ic(ct[3]) << std::endl); CGAL_UD_DEBUG("Final points are " << std:: endl); CGAL_UD_DEBUG(fc(ct[0]) << ": " - << fc(ct[1]) << ": " - << fc(ct[2]) << ": " + << fc(ct[1]) << ": " + << fc(ct[2]) << ": " << fc(ct[3]) << std::endl); - CGAL_UD_DEBUG("Initial incircle is " + CGAL_UD_DEBUG("Initial incircle is " << ui()->eval_incircle(INT(ic(ct[0])[0]), INT(ic(ct[0])[1]), INT(ic(ct[1])[0]), INT(ic(ct[1])[1]), INT(ic(ct[2])[0]), INT(ic(ct[2])[1]), INT(ic(ct[3])[0]), INT(ic(ct[3])[1])) << std::endl); - CGAL_UD_DEBUG("Final incircle is " + CGAL_UD_DEBUG("Final incircle is " << ui()->eval_incircle(INT(fc(ct[0])[0]), INT(fc(ct[0])[1]), INT(fc(ct[1])[0]), INT(fc(ct[1])[1]), INT(fc(ct[2])[0]), INT(fc(ct[2])[1]), @@ -555,9 +555,9 @@ struct Updatable_Delaunay_triangulation_2 { bool certificate_failure_time( #ifndef NDEBUG - typename Default_traits::Edge e, + typename Default_traits::Edge e, #else - typename Default_traits::Edge, + typename Default_traits::Edge, #endif Certificate_data , Time &rett, Certificate_data) { ++stat_certificate_advances_; @@ -591,7 +591,7 @@ struct Updatable_Delaunay_triangulation_2 { // this depends on being the last event of the batch whose time is computed const Time& net= P::simulator_handle()->next_event_time(); - + double lb= CGAL::to_interval(net).first; CGAL_UD_DEBUG("Advancing certificate for " << ct << " to " << lb @@ -600,10 +600,10 @@ struct Updatable_Delaunay_triangulation_2 { #ifndef MOVE_ALL //end_time= check_activation(ct, end_time); #endif - + typename Update_information::Certificate_function cf(curt.refiner().certificate_function(), true); - - + + bool wrap_this_into_newton; // done twiceish CGAL::Protect_FPU_rounding prot; @@ -611,12 +611,12 @@ struct Updatable_Delaunay_triangulation_2 { //CGAL::Sign sn= curt.refiner().sign_at(INT(lb,lb)); { INT lbv= cf(lb); - + //ui()->sign_at(ct[0],ct[1],ct[2],ct[3], INT(lb, lb)); if (lbv.inf()<=0) { CGAL_UD_DEBUG("Not positive at " << lb << std::endl); lb= CGAL::to_interval(curt).first; - } + } } { @@ -627,7 +627,7 @@ struct Updatable_Delaunay_triangulation_2 { CGAL_UD_DEBUG("No root in interval." << std::endl); CGAL_postcondition(check_failure_time > 1); return false; - } + } } typename Update_information::Certificate_derivitive cfp(curt.refiner().certificate_derivitive(), true); @@ -639,7 +639,7 @@ struct Updatable_Delaunay_triangulation_2 { } } - + INT ft; typename Update_information::Isolate_result isc; { @@ -647,10 +647,10 @@ struct Updatable_Delaunay_triangulation_2 { //ui()->certificate_function(ct[0], ct[1], ct[2], ct[3], cf); ; //typename Update_information::Certificate_evaluator se(cf); - + typename Update_information::Certificate_acceleration cfpp(cfp.prime()); if (!disable_filter_3_) { - isc= ui()->Newton_isolate(cf, cfp, cfpp, + isc= ui()->Newton_isolate(cf, cfp, cfpp, lb > CGAL::to_interval(current_time()).second, lb, end_time, ft); } else { @@ -662,10 +662,10 @@ struct Updatable_Delaunay_triangulation_2 { } CGAL_UD_DEBUG("Newton isolate got " << isc << " with interval " << ft << std::endl); } - - - if (isc == Update_information::NO_FAILURE) { + + + if (isc == Update_information::NO_FAILURE) { CGAL_UD_DEBUG("No root there." << std::endl); CGAL_postcondition(check_failure_time > 1); return false; @@ -680,7 +680,7 @@ struct Updatable_Delaunay_triangulation_2 { && ft.inf() <= CGAL::to_interval(curt).second || isc == Update_information::POSSIBLE_FAILURE || curt.refiner().has_exact_root()) { - + curt.exact_root(); CGAL_UD_DEBUG("Have to generate exact certificate" << std::endl); Exact_certificate ec= curt.refiner().exact_certificate(); @@ -707,7 +707,7 @@ struct Updatable_Delaunay_triangulation_2 { } } - + CGAL::Comparison_result compare_concurrent(Event_key a, Edge, @@ -738,10 +738,10 @@ struct Updatable_Delaunay_triangulation_2 { struct Visitor: public CGAL::Kinetic::Delaunay_triangulation_visitor_base_2 { - - + + Visitor(Simulation_traits tr): tr_(tr) { - } + } Update_information* ui() { return tr_.active_points_2_table_handle(); @@ -751,7 +751,7 @@ struct Updatable_Delaunay_triangulation_2 { return tr_.active_points_2_table_handle(); } - + #ifndef MOVE_ALL #if 0 @@ -768,9 +768,9 @@ struct Updatable_Delaunay_triangulation_2 { vhs[2]= TDS_helper::destination(e); vhs[3]= TDS_helper::mirror_vertex(e); CGAL_UD_DEBUG("Trying " << pts[0] << " " << pts[1] << " " << pts[2] << " " << pts[3] << std::endl); - - if ( active.find(pts[0]) != active.end() - && active.find(pts[1]) != active.end() + + if ( active.find(pts[0]) != active.end() + && active.find(pts[1]) != active.end() && active.find(pts[2]) != active.end() && active.find(pts[3]) != active.end()) { return false; @@ -795,7 +795,7 @@ struct Updatable_Delaunay_triangulation_2 { } else { CGAL::Protect_FPU_rounding prot; ++stat_interval_predicate_evaluations_; - + ok= ( ui()->sign_at(pts[0], pts[1], pts[2], pts[3], active) == CGAL::POSITIVE); } if (!ok) { @@ -811,7 +811,7 @@ struct Updatable_Delaunay_triangulation_2 { } } #else - // fix update + // fix update bool test_and_add(Edge e) { ++stat_point_predicate_evaluations_; if (!compute_ok(e, ui()->final_kernel_object())) { @@ -822,7 +822,7 @@ struct Updatable_Delaunay_triangulation_2 { return true; } else return false; } - + /*bool test_and_add_one(Edge e, std::vector &active) const { ++stat_point_predicate_evaluations_; if (!compute_ok(e, ui()->final_kernel_object())) { @@ -836,7 +836,7 @@ struct Updatable_Delaunay_triangulation_2 { #endif #endif - template + template void initialize_events(const TDS &triangulation, Indirect_kernel fk) { if (stat_number_of_edges_==0) { @@ -852,7 +852,7 @@ struct Updatable_Delaunay_triangulation_2 { std::set active; std::vector new_active; std::vector edges; - for (typename TDS::Finite_edges_iterator it= triangulation.finite_edges_begin(); + for (typename TDS::Finite_edges_iterator it= triangulation.finite_edges_begin(); it != triangulation.finite_edges_end(); ++it){ if (test_and_add<0>(*it, active, new_active)) { ++stat_number_of_bad_edges_; @@ -883,7 +883,7 @@ struct Updatable_Delaunay_triangulation_2 { #else*/ //std::vector active; - for (typename TDS::Finite_edges_iterator it= triangulation.finite_edges_begin(); + for (typename TDS::Finite_edges_iterator it= triangulation.finite_edges_begin(); it != triangulation.finite_edges_end(); ++it){ if (test_and_add(*it)) { ++stat_number_of_bad_edges_; @@ -897,15 +897,15 @@ struct Updatable_Delaunay_triangulation_2 { } - + void after_flip(Edge ) { } - - - + + + #ifndef MOVE_ALL bool is_active(Point_key k) const { return ui()->is_active(k); @@ -921,7 +921,7 @@ struct Updatable_Delaunay_triangulation_2 { void reset() { ui()->reset(); } - + Static_point_2 initial(Point_key pk) const { return ui()->ik_.current_coordinates_object()(pk); } @@ -936,7 +936,7 @@ struct Updatable_Delaunay_triangulation_2 { ui()->write_stats(out); } - Simulation_traits tr_; + Simulation_traits tr_; }; @@ -977,7 +977,7 @@ struct Updatable_Delaunay_triangulation_2 { - + struct Final_event: public CGAL::Kinetic::Free_event_base { typedef typename Simulation_traits::Active_points_2_table::Key Table_key; @@ -986,31 +986,31 @@ struct Updatable_Delaunay_triangulation_2 { tr_(tr), kdel_(kdel){ } - + std::ostream & write(std::ostream&out) const { out << "Final event "; return out; } - void process() { + void process() { kdel_->write_stats(std::cout); kdel_->visitor().stats_write(std::cout); - + tr_.simulator_handle()->set_interval(1,2); tr_.active_points_2_table_handle()->set_is_editing(Update_information::LOGGED); - - for (typename Simulation_traits::Active_points_2_table::Key_iterator - it = tr_.active_points_2_table_handle()->keys_begin(); + + for (typename Simulation_traits::Active_points_2_table::Key_iterator + it = tr_.active_points_2_table_handle()->keys_begin(); it != tr_.active_points_2_table_handle()->keys_end(); ++it) { - if (!kdel_->visitor().is_active(*it)) { + if (!kdel_->visitor().is_active(*it)) { tr_.active_points_2_table_handle()->set(*it, interpolate_12(initial(*it), final(*it))); } else { Kinetic_point_2 np(ENT(final(*it).x()), ENT(final(*it).y())); tr_.active_points_2_table_handle()->set(*it,np); - + } } @@ -1033,21 +1033,21 @@ struct Updatable_Delaunay_triangulation_2 { #endif - - template + + template Updatable_Delaunay_triangulation_2(It b, It e) { - + typename Indirect_kernel::Key_range rg= ik_.new_point_2s(b,e); tr_= Simulation_traits(ik_, 0,0); Triangulation tr(ik_); tr.insert(rg.first, rg.second); - + Traits traits(tr_); - - + + kdel_= new KDel(traits, tr, Visitor(tr_)); kdel_->clear_stats(); kdel_->visitor().stats_clear(); @@ -1056,7 +1056,7 @@ struct Updatable_Delaunay_triangulation_2 { kdel_->set_has_certificates(true, KDel::HAS_NO_FAILURES); #endif } - + const Triangulation &triangulation() const { return kdel_->triangulation(0); } @@ -1080,12 +1080,12 @@ struct Updatable_Delaunay_triangulation_2 { char *argv[1]={"UpdateDel"}; typename Qt_gui::Handle qtsim= new Qt_gui(1, argv, tr_.simulator_handle()); - + typename Qt_mps::Handle qtmps= new Qt_mps(qtsim, tr_); //qtmps->set_point_size(10); typename Qt_triangulation::Handle qtdel = new Qt_triangulation(kdel_, - tr_.instantaneous_kernel_object(), + tr_.instantaneous_kernel_object(), qtsim); #ifndef MOVE_ALL tr_.simulator_handle()->new_final_event(Final_event(tr_, @@ -1094,7 +1094,7 @@ struct Updatable_Delaunay_triangulation_2 { std::cout << "Green edges just flipped, grey edges will not flip until" << " their certificate changes and black edges will flip." << std::endl; - + qtsim->begin_event_loop(); kdel_->visitor().stats_write(std::cout); ik_.swap(fk); @@ -1134,10 +1134,10 @@ struct Updatable_Delaunay_triangulation_2 { typename Indirect_kernel::Current_coordinates cc = ik_.current_coordinates_object(); for (typename KDel::Triangulation::Edge_iterator it - = kdel_->triangulation().edges_begin(); + = kdel_->triangulation().edges_begin(); it != kdel_->triangulation().edges_end(); ++it){ if (!compute_ok(*it, ik_)) { - std::cout << "Problem with edge " + std::cout << "Problem with edge " << it->first->vertex((it->second+1)%3)->point() << " " << it->first->vertex((it->second+2)%3)->point() << " " << cc(it->first->vertex((it->second+1)%3)->point()) << ": " @@ -1150,10 +1150,9 @@ struct Updatable_Delaunay_triangulation_2 { static void read(std::string name, Points &points) { std::ifstream in(name.c_str()); if (!in) { - std::cerr << "Error opening file " << name << std::endl; - exit(1); + CGAL_error_msg( std::string("Error opening file ") + name ); } - + while (true) { char ln[10000]; in.getline(ln, 10000); @@ -1178,9 +1177,9 @@ struct Updatable_Delaunay_triangulation_2 { }; } - + static bool compute_ok(const Edge &e, Indirect_kernel sk) { - //typename Indirect_kernel::Current_coordinates + //typename Indirect_kernel::Current_coordinates //cc= sk.current_coordinates_object(); Point_key ks[4]; ks[0]= TDS_helper::origin(e)->point(); @@ -1192,27 +1191,27 @@ struct Updatable_Delaunay_triangulation_2 { return true; } } - + typename Indirect_kernel::Side_of_oriented_circle_2 soc = sk.side_of_oriented_circle_2_object(); - + CGAL::Oriented_side s=soc(ks[0], ks[1], ks[2], ks[3]); - + if (s== CGAL::ON_ORIENTED_BOUNDARY) { - CGAL_UD_DEBUG("Degeneracy with edge " + CGAL_UD_DEBUG("Degeneracy with edge " << ks[0] << " " << ks[2] << std::endl); } return s!= CGAL::ON_NEGATIVE_SIDE; } - - static int run(int , char *[], int , int , + + static int run(int , char *[], int , int , int , std::string ifile, std::string ffile) { //typedef CGAL::Kinetic::Inexact_simulation_traits_2 Traits; - + CGAL_SET_LOG_LEVEL(CGAL::Kinetic::Log::SOME); diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/Two_list_pointer_event_queue.h b/Kinetic_data_structures/include/CGAL/Kinetic/Two_list_pointer_event_queue.h index 5fdd9b19181..1ce4f6341ae 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/Two_list_pointer_event_queue.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/Two_list_pointer_event_queue.h @@ -752,7 +752,7 @@ protected: int count=0; Iterator it= source.begin(); while (it != source.end()) { - // assert(it->time() >= a); + // CGAL_assertion(it->time() >= a); if (leq_ub(it->time())) { Item *i= &*it; @@ -908,7 +908,7 @@ protected: void grow_front() { //++growth__; //std::cout << "Growing front from " << ub_ << std::endl; - //assert(is_valid()); + //CGAL_assertion(is_valid()); CGAL_precondition(!back_.empty()); CGAL_precondition(front_.empty()); CGAL_assertion_code(unsigned int sz= front_.size()+back_.size()+ inf_.size()); diff --git a/Kinetic_data_structures/include/CGAL/Polynomial/internal/macros.h b/Kinetic_data_structures/include/CGAL/Polynomial/internal/macros.h index 009fbb349ad..da089b1abf6 100644 --- a/Kinetic_data_structures/include/CGAL/Polynomial/internal/macros.h +++ b/Kinetic_data_structures/include/CGAL/Polynomial/internal/macros.h @@ -14,7 +14,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Daniel Russel diff --git a/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.cpp b/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.cpp index 10bd9a939ef..34bf311bcd0 100644 --- a/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.cpp +++ b/Mesh_2/demo/Mesh_2/Qt_widget_style_editor.cpp @@ -82,7 +82,7 @@ Qt_widget_style_editor::Qt_widget_style_editor(Style* style, this, SLOT(pointstyle(int))); break; default: - CGAL_assertion(false); + CGAL_error(); break; } diff --git a/Mesh_2/demo/Mesh_2/mesh_demo.cpp b/Mesh_2/demo/Mesh_2/mesh_demo.cpp index faf504e0a44..12c40c41f5c 100644 --- a/Mesh_2/demo/Mesh_2/mesh_demo.cpp +++ b/Mesh_2/demo/Mesh_2/mesh_demo.cpp @@ -1059,7 +1059,7 @@ public slots: emit( insertedInput() ); } else // obj should be a polygon or a point! - CGAL_assertion(false); + CGAL_error(); updatePointCounter(); widget->redraw(); } diff --git a/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_configure.h b/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_configure.h index 87479063b29..e3b7f99eef3 100644 --- a/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_configure.h +++ b/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_configure.h @@ -66,7 +66,7 @@ // Define some assertion macros used in the code. #ifdef CGAL_MINIBALL_DEBUG - #define CGAL_MINIBALL_ASSERT(expr) assert(expr) + #define CGAL_MINIBALL_ASSERT(expr) CGAL_assertion(expr) #define CGAL_MINIBALL_DO_DEBUG(expr) expr #else #define CGAL_MINIBALL_ASSERT(expr) ; diff --git a/Nef_2/demo/Nef_2/nef_2.cpp b/Nef_2/demo/Nef_2/nef_2.cpp index 67b67d02aed..eedd3b09ec9 100644 --- a/Nef_2/demo/Nef_2/nef_2.cpp +++ b/Nef_2/demo/Nef_2/nef_2.cpp @@ -750,7 +750,7 @@ private: return (*it).N; ++it; } - CGAL_assertion(false); + CGAL_error(); return Nef_polyhedron(); // kill warning. } diff --git a/Nef_2/include/CGAL/Bounded_kernel.h b/Nef_2/include/CGAL/Bounded_kernel.h index 9df21061657..570b2474381 100644 --- a/Nef_2/include/CGAL/Bounded_kernel.h +++ b/Nef_2/include/CGAL/Bounded_kernel.h @@ -107,7 +107,7 @@ public: Point_2 epoint(const Standard_FT& m1, const Standard_FT& n1, const Standard_FT& m2, const Standard_FT& n2) const { - CGAL_assertion_msg(false, "Bounded_kernel::epoint(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::epoint(..) should not be called"); return Point_2(); } @@ -122,7 +122,7 @@ public: Point_2 construct_point(const Standard_line_2& , Point_type& ) const { - CGAL_assertion_msg(false, "Bounded_kernel::construct_point(Line,Point_type) should not be called"); + CGAL_error_msg( "Bounded_kernel::construct_point(Line,Point_type) should not be called"); return Point_2(); } @@ -131,14 +131,14 @@ public: const Standard_point_2& , Point_type& t) const { - CGAL_assertion_msg(false, "Bounded_kernel::construct_point(Point,Point) should not be called"); + CGAL_error_msg( "Bounded_kernel::construct_point(Point,Point) should not be called"); return Point_2(); } Point_2 construct_point(const Standard_line_2& ) const { - CGAL_assertion_msg(false, "Bounded_kernel::construct_point(Line) should not be called"); + CGAL_error_msg( "Bounded_kernel::construct_point(Line) should not be called"); return Point_2(); } @@ -146,21 +146,21 @@ public: construct_point(const Standard_point_2& , const Standard_point_2& ) const { - CGAL_assertion_msg(false, "Bounded_kernel::construct_point(Point,Point) should not be called"); + CGAL_error_msg( "Bounded_kernel::construct_point(Point,Point) should not be called"); return Point_2(); } Point_2 construct_point(const Standard_point_2& , const Standard_direction_2& ) const { - CGAL_assertion_msg(false, "Bounded_kernel::construct_point(Point,Direction) should not be called"); + CGAL_error_msg( "Bounded_kernel::construct_point(Point,Direction) should not be called"); return Point_2(); } Point_2 construct_opposite_point(const Standard_line_2& l) const { - CGAL_assertion_msg(false, "Bounded_kernel::construct_opposite_point(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::construct_opposite_point(..) should not be called"); return Point_2(); } @@ -186,21 +186,21 @@ public: Standard_line_2 standard_line(const Point_2& p) const { - CGAL_assertion_msg(false, "Bounded_kernel::standard_line(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::standard_line(..) should not be called"); return Standard_line_2(); } Standard_ray_2 standard_ray(const Point_2& p) const { - CGAL_assertion_msg(false, "Bounded_kernel::standard_ray(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::standard_ray(..) should not be called"); return Standard_ray_2(); } Point_2 NE() const { - CGAL_assertion_msg(false, "Bounded_kernel::NE(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::NE(..) should not be called"); return Point_2(); } @@ -208,7 +208,7 @@ public: Point_2 SE() const { - CGAL_assertion_msg(false, "Bounded_kernel::SE(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::SE(..) should not be called"); return Point_2(); } @@ -216,7 +216,7 @@ public: Point_2 NW() const { - CGAL_assertion_msg(false, "Bounded_kernel::NW(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::NW(..) should not be called"); return Point_2(); } @@ -224,7 +224,7 @@ public: Point_2 SW() const { - CGAL_assertion_msg(false, "Bounded_kernel::SW(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::SW(..) should not be called"); return Point_2(); } @@ -232,7 +232,7 @@ public: Line_2 upper() const { - CGAL_assertion_msg(false, "Bounded_kernel::upper(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::upper(..) should not be called"); return Line_2(); } @@ -240,7 +240,7 @@ public: Line_2 lower() const { - CGAL_assertion_msg(false, "Bounded_kernel::lower(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::lower(..) should not be called"); return Line_2(); } @@ -248,7 +248,7 @@ public: Line_2 left() const { - CGAL_assertion_msg(false, "Bounded_kernel::left(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::left(..) should not be called"); return Line_2(); } @@ -257,7 +257,7 @@ public: Line_2 right() const { - CGAL_assertion_msg(false, "Bounded_kernel::right(..) should not be called"); + CGAL_error_msg( "Bounded_kernel::right(..) should not be called"); return Line_2(); } @@ -367,7 +367,7 @@ public: CGAL::Object result = _intersect(l1, l2); if ( !CGAL::assign(p, result) ) - CGAL_assertion_msg(false,"intersection: no intersection."); + CGAL_error_msg("intersection: no intersection."); return p; } diff --git a/Nef_2/include/CGAL/Extended_cartesian.h b/Nef_2/include/CGAL/Extended_cartesian.h index 8bbcfda0b26..04b1be53101 100644 --- a/Nef_2/include/CGAL/Extended_cartesian.h +++ b/Nef_2/include/CGAL/Extended_cartesian.h @@ -369,7 +369,7 @@ and |s2|.}*/ CGAL::Object result = _intersect(l1, l2); if ( !CGAL::assign(p, result) ) - CGAL_assertion_msg(false,"intersection: no intersection."); + CGAL_error_msg("intersection: no intersection."); return p; } diff --git a/Nef_2/include/CGAL/Extended_homogeneous.h b/Nef_2/include/CGAL/Extended_homogeneous.h index de8aff85a55..9fe1faade22 100644 --- a/Nef_2/include/CGAL/Extended_homogeneous.h +++ b/Nef_2/include/CGAL/Extended_homogeneous.h @@ -432,7 +432,7 @@ on the extended geometric objects.}*/ CGAL::Object result = _intersect(_line(s1),_line(s2)); if ( !CGAL::assign(p, result) ) - CGAL_assertion_msg(false,"intersection: no intersection."); + CGAL_error_msg("intersection: no intersection."); simplify(p); return p; } diff --git a/Nef_2/include/CGAL/Filtered_extended_homogeneous.h b/Nef_2/include/CGAL/Filtered_extended_homogeneous.h index cff76fe9ddb..a483deca93f 100644 --- a/Nef_2/include/CGAL/Filtered_extended_homogeneous.h +++ b/Nef_2/include/CGAL/Filtered_extended_homogeneous.h @@ -1039,7 +1039,7 @@ Point_type determine_type(const Standard_line_2& l) const abscissa_distance(l) > Standard_FT(0))) { return TOPFRAME; } - CGAL_assertion_msg(false," determine_type: degenerate line."); + CGAL_error_msg(" determine_type: degenerate line."); return (Point_type)-1; // never come here } diff --git a/Nef_2/include/CGAL/Nef_2/Bounding_box_2.h b/Nef_2/include/CGAL/Nef_2/Bounding_box_2.h index 1add1ca227e..8dd9b95d92c 100644 --- a/Nef_2/include/CGAL/Nef_2/Bounding_box_2.h +++ b/Nef_2/include/CGAL/Nef_2/Bounding_box_2.h @@ -37,11 +37,11 @@ class Bounding_box_2 { public: template Bounding_box_2(Vertex_iterator , Vertex_iterator ) { - CGAL_assertion_msg(false, "dummy interface"); + CGAL_error_msg( "dummy interface"); } Point intersection_ray_bbox(const SPoint& , const SDirection& ) { - CGAL_assertion_msg(false, "dummy interface"); + CGAL_error_msg( "dummy interface"); return Point(); } }; @@ -104,7 +104,7 @@ class Bounding_box_2 Kernel K; return K.construct_point(minmax); } - CGAL_assertion_msg(false, "code not robust - l2 must be constructed to" + CGAL_error_msg( "code not robust - l2 must be constructed to" " be non-collinear with l1"); return Point(); } diff --git a/Nef_2/include/CGAL/Nef_2/Constrained_triang_traits.h b/Nef_2/include/CGAL/Nef_2/Constrained_triang_traits.h index f747f50fad9..cdf1fc3d964 100644 --- a/Nef_2/include/CGAL/Nef_2/Constrained_triang_traits.h +++ b/Nef_2/include/CGAL/Nef_2/Constrained_triang_traits.h @@ -38,11 +38,6 @@ CGAL_BEGIN_NAMESPACE -inline void CGAL_error_handler(int n, const char* s) -{ std::cerr << s << std::endl; - std::exit(n); -} - struct Do_nothing { Do_nothing() {} template @@ -105,11 +100,11 @@ public: int s = 0; if ( p == point(source(e1)) ) s = orientation(e2,p); else if ( p == point(source(e2)) ) s = - orientation(e1,p); - else CGAL_error_handler(1,"compare error in sweep."); + else CGAL_error_msg("compare error in sweep."); if ( s || source(e1) == target(e1) || source(e2) == target(e2) ) return ( s < 0 ); s = orientation(e2,point(target(e1))); - if (s==0) CGAL_error_handler(1,"parallel edges not allowed."); + if (s==0) CGAL_error_msg("parallel edges not allowed."); return ( s < 0 ); } @@ -236,7 +231,7 @@ public: { // we triangulate the interior of the whole chain between // target(e_upper) and target(e_lower) - assert(source(e_upper)==source(e_lower)); + CGAL_assertion(source(e_upper)==source(e_lower)); CGAL_NEF_TRACE("triangulate_between\n "< FT(0))) { return TOPFRAME; } - CGAL_assertion_msg(false," determine_type: degenerate line."); + CGAL_error_msg(" determine_type: degenerate line."); return (Point_type)-1; // never come here } diff --git a/Nef_2/include/CGAL/Nef_2/PM_persistent_PL.h b/Nef_2/include/CGAL/Nef_2/PM_persistent_PL.h index bc343b32a3b..1584808c8b7 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_persistent_PL.h +++ b/Nef_2/include/CGAL/Nef_2/PM_persistent_PL.h @@ -82,7 +82,7 @@ struct PM_persistent_PL_traits if ( cmpX > 0 ) return EndingNonVertical; int cmpY = pK->compare_y(p_u, p_v); - assert(cmpY != 0); + CGAL_assertion(cmpY != 0); if ( cmpY < 0 ) return StartingVertical; return EndingVertical; } @@ -173,14 +173,14 @@ struct PM_persistent_PL_traits { /* we only get an L_plus (non-nil) if L is ABOVE a vertex in which case we want to extract the face from the edge below (p+epsilon) available via L_plus. */ - if (!L_plus.is_nil()) { assert(L_plus.is_edge()); + if (!L_plus.is_nil()) { CGAL_assertion(L_plus.is_edge()); return Object_handle(Edge(L_plus)); } else { if ( L.is_edge() ) { return Object_handle(Edge(L)); } if ( L.is_node() ) { - Node v(L); assert( v != Node() ); + Node v(L); CGAL_assertion( v != Node() ); return Object_handle(v); } return Object_handle(); diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index 6d3e6d3c214..8881c957793 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Michael Seel #ifndef CGAL_PM_POINT_LOCATOR_H @@ -31,7 +31,7 @@ #include #ifdef CGAL_USE_LEDA -#include +#include # if __LEDA__ > 410 && __LEDA__ < 441 # define CGAL_USING_PPL # include @@ -46,16 +46,16 @@ template < class Node, class Object> struct Project_halfedge_point { typedef Node argument_type; typedef Object result_type; - Object& operator()( Node& x) const { + Object& operator()( Node& x) const { return x.vertex()->point(); } - const Object& operator()( const Node& x) const { - return x.vertex()->point(); + const Object& operator()( const Node& x) const { + return x.vertex()->point(); } }; -/*{\Moptions print_title=yes }*/ -/*{\Msubst +/*{\Moptions print_title=yes }*/ +/*{\Msubst PM_decorator_#PMD Geometry_#GEO }*/ @@ -86,7 +86,7 @@ public: typedef typename Decorator::Plane_map Plane_map; /*{\Mtypemember the plane map type decorated by |Decorator|.}*/ typedef typename Decorator::Mark Mark; - /*{\Mtypemember the attribute of all objects (vertices, edges, + /*{\Mtypemember the attribute of all objects (vertices, edges, faces).}*/ typedef Geometry_ Geometry; @@ -98,26 +98,26 @@ public: /*{\Mtypemember the segment type of the geometry kernel.}*/ typedef typename Geometry_::Direction_2 Direction; - /*{\Mtext Local types are handles, iterators and circulators of the - following kind: |Vertex_const_handle|, |Vertex_const_iterator|, - |Halfedge_const_handle|, |Halfedge_const_iterator|, |Face_const_handle|, + /*{\Mtext Local types are handles, iterators and circulators of the + following kind: |Vertex_const_handle|, |Vertex_const_iterator|, + |Halfedge_const_handle|, |Halfedge_const_iterator|, |Face_const_handle|, |Face_const_iterator|.}*/ typedef CGAL::Object_handle Object_handle; /*{\Mtypemember a generic handle to an object of the underlying plane map. The kind of the object |(vertex, halfedge,face)| can be determined and - the object assigned by the three functions:\\ - |bool assign(Vertex_const_handle& h, Object_handle o)|\\ - |bool assign(Halfedge_const_handle& h, Object_handle o)|\\ - |bool assign(Face_const_handle& h, Object_handle o)|\\ where each + the object assigned by the three functions:\\ + |bool assign(Vertex_const_handle& h, Object_handle o)|\\ + |bool assign(Halfedge_const_handle& h, Object_handle o)|\\ + |bool assign(Face_const_handle& h, Object_handle o)|\\ where each function returns |true| iff the assignment of |o| to |h| was valid.}*/ - typedef typename PM_decorator_::Vertex_handle Vertex_handle; - typedef typename PM_decorator_::Halfedge_handle Halfedge_handle; - typedef typename PM_decorator_::Face_handle Face_handle; - typedef typename PM_decorator_::Vertex_const_handle Vertex_const_handle; - typedef typename PM_decorator_::Halfedge_const_handle Halfedge_const_handle; - typedef typename PM_decorator_::Face_const_handle Face_const_handle; + typedef typename PM_decorator_::Vertex_handle Vertex_handle; + typedef typename PM_decorator_::Halfedge_handle Halfedge_handle; + typedef typename PM_decorator_::Face_handle Face_handle; + typedef typename PM_decorator_::Vertex_const_handle Vertex_const_handle; + typedef typename PM_decorator_::Halfedge_const_handle Halfedge_const_handle; + typedef typename PM_decorator_::Face_const_handle Face_const_handle; typedef typename PM_decorator_::Vertex_iterator Vertex_iterator; typedef typename PM_decorator_::Halfedge_iterator Halfedge_iterator; typedef typename PM_decorator_::Face_iterator Face_iterator; @@ -140,7 +140,7 @@ public: using Base::number_of_halfedges; using Base::number_of_faces; - Halfedge_const_handle out_wedge(Vertex_const_handle v, + Halfedge_const_handle out_wedge(Vertex_const_handle v, const Direction& d, bool& collinear) const /*{\Xop returns a halfedge |e| bounding a wedge in between two neighbored edges in the adjacency list of |v| which contains |d|. @@ -148,7 +148,7 @@ public: into the interior of such a wedge then |e| is the first edge hit when |d| is rotated clockwise. \precond |v| is not isolated.}*/ { CGAL_NEF_TRACEN("out_wedge "<(P)), K(k) {} /*{\Mcreate constructs a point locator working on |P|.}*/ /*{\Moptions constref=no}*/ @@ -186,28 +186,27 @@ public: const Mark& mark(Object_handle h) const /*{\Mop returns the mark associated to the object |h|.}*/ - { Vertex_const_handle v; - Halfedge_const_handle e; + { Vertex_const_handle v; + Halfedge_const_handle e; Face_const_handle f; if ( assign(v,h) ) return mark(v); if ( assign(e,h) ) return mark(e); if ( assign(f,h) ) return mark(f); - CGAL_assertion_msg(0, - "PM_point_locator::mark: Object_handle holds no object."); + CGAL_error_msg("PM_point_locator::mark: Object_handle holds no object."); #if !defined(__BORLANDC__) return mark(v); // never reached #endif } - + Object_handle locate(const Segment& s) const /*{\Mop returns a generic handle |h| to an object (vertex, halfedge, face) of the underlying plane map |P| which contains the point |p = s.source()| in its relative interior. |s.target()| must be a point such that |s| intersects the $1$-skeleton of |P|.}*/ { CGAL_NEF_TRACEN("locate naivly "<number_of_vertices() == 0) - CGAL_assertion_msg(0,"PM_naive_point_locator: plane map is empty."); + if (this->number_of_vertices() == 0) + CGAL_error_msg("PM_naive_point_locator: plane map is empty."); Point p = K.source(s); Vertex_const_iterator vit; for(vit = this->vertices_begin(); vit != this->vertices_end(); ++vit) { @@ -216,7 +215,7 @@ public: Halfedge_const_iterator eit; for(eit = this->halfedges_begin(); eit != this->halfedges_end(); ++(++eit)) { // we only have to check each second halfedge - if ( K.contains(segment(eit),p) ) + if ( K.contains(segment(eit),p) ) return Object_handle(eit); } Vertex_const_handle v_res; @@ -235,7 +234,7 @@ public: bool dummy; e_res = out_wedge(vit,dso,dummy); Halfedge_around_vertex_const_circulator el(e_res),ee(el); - CGAL_For_all(el,ee) + CGAL_For_all(el,ee) visited[el] = visited[twin(el)] = true; /* e_res is now the counterclockwise maximal halfedge out of v just before s */ @@ -254,11 +253,11 @@ public: int o1 = K.orientation(ss,se); int o2 = K.orientation(ss,te); if ( o1 == -o2 && // internal intersection - K.orientation(se,te,K.source(ss)) != - K.orientation(se,te,K.target(ss)) ) { + K.orientation(se,te,K.source(ss)) != + K.orientation(se,te,K.target(ss)) ) { CGAL_NEF_TRACEN(" location via halfedge "< 0 ? eit : twin(eit)); // o2>0 => te left of s and se right of s => p left of e visited[eit] = visited[twin(eit)] = true; @@ -273,7 +272,7 @@ public: return Object_handle((Face_const_handle)(face(v_res))); } - + template Object_handle ray_shoot(const Segment& s, const Object_predicate& M) const /*{\Mop returns an |Object_handle o| which can be converted to a @@ -286,18 +285,18 @@ public: object. The operation returns the null handle |NULL| if the ray shoot along |s| does not hit any object |h| of |P| with |M(h)|.}*/ { CGAL_NEF_TRACEN("naive ray_shoot "<vertices_begin(); v != this->vertices_end(); ++v) { Point pv = point(v); @@ -311,7 +310,7 @@ public: // now we know that v is not marked but on s bool collinear; Halfedge_const_handle e = out_wedge(v,d,collinear); - if ( collinear ) { + if ( collinear ) { if ( M(e) ) { h = Object_handle(e); ss = K.construct_segment(p,pv); @@ -339,10 +338,10 @@ public: // o2 > 0 => te left of s and se right of s => p left of e if ( M(e_res) ) { h = Object_handle(e_res); - ss = K.construct_segment(p,p_res); + ss = K.construct_segment(p,p_res); } else if ( M(face(twin(e_res))) ) { h = Object_handle(face(twin(e_res))); - ss = K.construct_segment(p,p_res); + ss = K.construct_segment(p,p_res); } } } @@ -369,13 +368,13 @@ public: }; // PM_naive_point_locator -/*{\Moptions print_title=yes }*/ -/*{\Msubst +/*{\Moptions print_title=yes }*/ +/*{\Msubst PM_decorator_#PMD Geometry_#GEO }*/ -/*{\Manpage {PM_point_locator}{PMD,GEO} -{Point location in plane maps via LMWT}{PL}}*/ +/*{\Manpage {PM_point_locator}{PMD,GEO} +{Point location in plane maps via LMWT}{PL}}*/ /*{\Mdefinition An instance |\Mvar| of data type |\Mname| encapsulates point location queries within a plane map |P|. The two template parameters are specified via concepts. |PMD| must be a model @@ -387,14 +386,14 @@ appendix. For a specification of plane maps see also the concept of /*{\Mgeneralization PMD^#PM_naive_point_locator}*/ template -class PM_point_locator : public +class PM_point_locator : public PM_naive_point_locator { protected: typedef PM_naive_point_locator Base; typedef PM_point_locator Self; Base CT; #ifdef CGAL_USING_PPL - typedef PM_persistent_PL_traits PMPPLT; + typedef PM_persistent_PL_traits PMPPLT; typedef PointLocator PMPP_locator; PMPP_locator* pPPL; #define LOCATE_IN_TRIANGULATION pPPL->locate_down @@ -412,12 +411,12 @@ public: typedef typename Base::Segment Segment; typedef typename Base::Direction Direction; typedef typename Base::Object_handle Object_handle; - typedef typename Base::Vertex_handle Vertex_handle; - typedef typename Base::Halfedge_handle Halfedge_handle; - typedef typename Base::Face_handle Face_handle; - typedef typename Base::Vertex_const_handle Vertex_const_handle; - typedef typename Base::Halfedge_const_handle Halfedge_const_handle; - typedef typename Base::Face_const_handle Face_const_handle; + typedef typename Base::Vertex_handle Vertex_handle; + typedef typename Base::Halfedge_handle Halfedge_handle; + typedef typename Base::Face_handle Face_handle; + typedef typename Base::Vertex_const_handle Vertex_const_handle; + typedef typename Base::Halfedge_const_handle Halfedge_const_handle; + typedef typename Base::Face_const_handle Face_const_handle; typedef typename Base::Vertex_iterator Vertex_iterator; typedef typename Base::Halfedge_iterator Halfedge_iterator; typedef typename Base::Face_iterator Face_iterator; @@ -440,13 +439,13 @@ public: struct CT_link_to_original : Decorator { // CT decorator const Decorator& Po; - CT_link_to_original(const Decorator& P, const Decorator& Poi) + CT_link_to_original(const Decorator& P, const Decorator& Poi) : Decorator(P), Po(Poi) {} void operator()(Vertex_handle vn, Vertex_const_handle vo) const { Face_const_handle f; if ( Po.is_isolated(vo) ) f = Po.face(vo); geninfo::create(info(vn)); - geninfo::access(info(vn)) = VF_pair(vo,f); + geninfo::access(info(vn)) = VF_pair(vo,f); CGAL_NEF_TRACEN("linking to org "<::create(info(e)); geninfo::create(info(twin(e))); - geninfo::access(info(e)).first = - geninfo::access(info(twin(e))).first = + geninfo::access(info(e)).first = + geninfo::access(info(twin(e))).first = Halfedge_const_handle(); - geninfo::access(info(e)).second = + geninfo::access(info(e)).second = geninfo::access(info(twin(e))).second = f; CGAL_NEF_TRACEN("CT_new_edge "<number_of_vertices() < 2 ) return; std::list S; - /* We maintain a stack |S| of edges containing diagonals + /* We maintain a stack |S| of edges containing diagonals which might have to be flipped. */ int flip_count = 0; Halfedge_iterator e; for (e = CT.halfedges_begin(); e != CT.halfedges_end(); ++(++e)) { Halfedge_const_handle e_org = input_halfedge(e); - if ( e_org != Halfedge_const_handle() ) + if ( e_org != Halfedge_const_handle() ) continue; S.push_back(e); } @@ -562,7 +561,7 @@ protected: Halfedge_handle e = S.front(); S.pop_front(); Halfedge_handle r = twin(e); Halfedge_const_handle e_org = input_halfedge(e); - if ( e_org != Halfedge_const_handle() ) + if ( e_org != Halfedge_const_handle() ) continue; Halfedge_handle e1 = next(r); Halfedge_handle e3 = next(e); @@ -581,11 +580,11 @@ protected: CGAL_NEF_TRACEN("flipping diagonal of quadilateral"<K.orientation(segment(e),p); if ( orientation_ == 0 ) return Object_handle(e); if ( orientation_ < 0 ) return Object_handle(face(twin(e))); if ( orientation_ > 0 ) return Object_handle(face(e)); - } + } CGAL_assertion(!check_tag(typename Is_extended_kernel::value_type())); return Face_const_handle(faces_begin()); - // assert(0); return h; // compiler warning + // CGAL_assertion(0); return h; // compiler warning } - bool ray_shoot_from_outer_facet(Segment& , object_kind& , - Vertex_const_handle &, + bool ray_shoot_from_outer_facet(Segment& , object_kind& , + Vertex_const_handle &, Halfedge_const_handle& , const Tag_true& ) const { return false; } - bool ray_shoot_from_outer_facet(Segment& s, object_kind& current, - Vertex_const_handle &v, + bool ray_shoot_from_outer_facet(Segment& s, object_kind& current, + Vertex_const_handle &v, Halfedge_const_handle& e, const Tag_false& ) const { CGAL_NEF_TRACEN("target on outer facet"); @@ -665,7 +664,7 @@ public: CGAL_For_all(circ, end) { // std::cerr << s << std::endl; // std::cerr << point(source(circ)) << "->" << point(target(circ)) << std::endl; - Object o = intersection(s, Segment(point(source(circ)), + Object o = intersection(s, Segment(point(source(circ)), point(target(circ)))); if(assign(i,o)) { @@ -678,7 +677,7 @@ public: } else if(i == point(target(circ))) { current = VERTEX; v = target(circ); - } else { + } else { current = EDGE_CROSSING; e = circ; } @@ -696,7 +695,7 @@ public: Object_handle ray_shoot(const Segment& ss, const Object_predicate& M) const /*{\Mop returns an |Object_handle o| which can be converted to a |Vertex_const_handle|, |Halfedge_const_handle|, |Face_const_handle| - |h| as described above. The object predicate |M| has to have + |h| as described above. The object predicate |M| has to have function operators\\ |bool operator() (const Vertex_/ Halfedge_/Face_const_handle&) const|.\\ The object returned is intersected by the segment |s| and has minimal @@ -707,7 +706,7 @@ public: CGAL_NEF_TRACEN("ray_shoot "<K.is_degenerate(s) ); Point p = this->K.source(s); - Direction d = this->K.construct_direction(p,s.target()); + Direction d = this->K.construct_direction(p,s.target()); Vertex_const_handle v; Halfedge_const_handle e; object_kind current; @@ -720,14 +719,14 @@ public: int orientation_ = this->K.orientation( segment(e), p); if ( orientation_ == 0 ) { // p on segment CGAL_NEF_TRACEN("on edge "<K.orientation(CT.segment(e),s.target())>0) ) // not left_turn - e = CT.twin(e); + e = CT.twin(e); } } else { // p not on segment, thus in triangle @@ -737,8 +736,8 @@ public: if ( M(input_face(e)) ) // face mark return Object_handle(input_face(e)); - Point p1 = CT.point(CT.source(e)), - p2 = CT.point(CT.target(e)), + Point p1 = CT.point(CT.source(e)), + p2 = CT.point(CT.target(e)), p3 = CT.point(CT.target(next(e))); int or1 = this->K.orientation(p,s.target(),p1); int or2 = this->K.orientation(p,s.target(),p2); @@ -761,7 +760,7 @@ public: } else { if(check_tag(typename Is_extended_kernel::value_type())) { - CGAL_assertion_msg(false, "code is only for Bounded_kernel"); + CGAL_error_msg( "code is only for Bounded_kernel"); } if(!ray_shoot_from_outer_facet(s,current,v,e,typename Is_extended_kernel::value_type())) return Object_handle(); @@ -792,7 +791,7 @@ public: break; case EDGE_CROSSING: { CGAL_NEF_TRACEN("crossing edge "<K.orientation(CT.segment(e),s.target()) == 0 ) + if ( this->K.orientation(CT.segment(e),s.target()) == 0 ) return Object_handle(); Halfedge_const_handle e_org = input_halfedge(e); if ( e_org != Halfedge_const_handle() ) { // not a CT edge @@ -803,11 +802,11 @@ public: CGAL_NEF_TRACEN("v_cand "<K.orientation(p,s.target(),CT.point(v_cand)); switch( orientation_ ) { - case 0: + case 0: v = v_cand; current = VERTEX; break; - case +1: + case +1: e = CT.twin(CT.next(e)); current = EDGE_CROSSING; break; - case -1: + case -1: e = CT.twin(CT.previous(e)); current = EDGE_CROSSING; break; } } @@ -817,43 +816,43 @@ public: { CGAL_NEF_TRACEN("collinear edge "<K.strictly_ordered_along_line( - CT.point(CT.source(e)),s.target(),CT.point(CT.target(e))) ) + CT.point(CT.source(e)),s.target(),CT.point(CT.target(e))) ) return Object_handle(); v = CT.target(e); current = VERTEX; } break; - } - // assert(0); return h; // compiler warning + } + // CGAL_error(); return h; // compiler warning } - bool within_outer_cycle(Vertex_const_handle , + bool within_outer_cycle(Vertex_const_handle , const Point& , const Tag_true& ) const { return true; } - bool within_outer_cycle(Vertex_const_handle v, + bool within_outer_cycle(Vertex_const_handle v, const Point& q, const Tag_false& ) const { typedef Project_halfedge_point Project; - typedef Circulator_project Circulator; typedef Container_from_circulator Container; - + Halfedge_const_handle e_min = CT.twin(CT.first_out_edge(v)); Halfedge_around_face_const_circulator circ(e_min); Circulator c(circ); - Container ct(c); + Container ct(c); if(is_empty_range(ct.begin(), ct.end()) || bounded_side_2(ct.begin(), ct.end(),q) == CGAL::ON_UNBOUNDED_SIDE) return false; - + return true; } @@ -898,14 +897,14 @@ PM_point_locator:: CT.clear(); delete &(CT.plane_map()); #ifdef CGAL_USING_PPL - delete pPPL; pPPL=0; + delete pPPL; pPPL=0; #endif } template -typename PM_point_locator::Object_handle +typename PM_point_locator::Object_handle PM_point_locator::walk_in_triangulation(const Point& q) const -{ +{ CGAL_NEF_TRACEN("walk in triangulation "<::walk_in_triangulation(const Point& q) const object_kind current = VERTEX; while (true) switch ( current ) { case VERTEX: - { + { CGAL_NEF_TRACEN("vertex "<::walk_in_triangulation(const Point& q) const Vertex_const_handle v_cand = CT.target(CT.next(e)); int orientation_ = this->K.orientation(p,q,CT.point(v_cand)); switch( orientation_ ) { - case 0: // collinear - if ( this->K.strictly_ordered_along_line(p,q,CT.point(v_cand)) ) + case 0: // collinear + if ( this->K.strictly_ordered_along_line(p,q,CT.point(v_cand)) ) return Object_handle(e); v = v_cand; current = VERTEX; break; case +1: // left_turn e = twin(next(e)); current = EDGE_CROSSING; break; - case -1: + case -1: e = twin(previous(e)); current = EDGE_CROSSING; break; } } @@ -957,7 +956,7 @@ PM_point_locator::walk_in_triangulation(const Point& q) const case EDGE_COLLINEAR: { CGAL_NEF_TRACEN("collinear edge "<K.strictly_ordered_along_line( - CT.point(CT.source(e)),q,CT.point(CT.target(e))) ) + CT.point(CT.source(e)),q,CT.point(CT.target(e))) ) return Object_handle(e); v = CT.target(e); current = VERTEX; } diff --git a/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h b/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h index 45814ebf9df..866dd82269f 100644 --- a/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h +++ b/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h @@ -350,7 +350,7 @@ public: } // if (sit != nil) - assert(sit_pred); + CGAL_assertion(sit_pred); GO.halfedge_below(v,Edge_of[sit_pred]); if ( Isos_of[event] != 0 ) { const IsoList& IL = *(Isos_of[event]); @@ -375,13 +375,13 @@ public: sit = YS.insert_at(s_sit, next_seg, s_sit); else sit = YS.insert_at(s_sit, next_seg, CGAL_LEDA_SCOPE::seq_item(nil)); - assert(YS.succ(sit)==s_sit); + CGAL_assertion(YS.succ(sit)==s_sit); if ( YS.min_item() != p_sit && orientation(p_sit, source(next_seg) ) == 0 && orientation(p_sit, target(next_seg) ) == 0 ) YS.change_inf(p_sit, sit); - assert(YS.succ(p_sit)==sit); + CGAL_assertion(YS.succ(p_sit)==sit); XS.insert(target(next_seg), sit); GO.starting_segment(v,original(next_seg)); @@ -404,7 +404,7 @@ public: sit_first = YS.succ(sit_pred); - assert(sit_pred); assert(sit_pred_succ); + CGAL_assertion(sit_pred); CGAL_assertion(sit_pred_succ); CGAL_LEDA_SCOPE::seq_item xit = YS.inf(sit_pred); if ( xit ) { ISegment s1 = YS.key(sit_pred); @@ -757,7 +757,7 @@ public: } // if (sit != ss_iterator() ) - assert( sit_pred != YS.end() ); + CGAL_assertion( sit_pred != YS.end() ); GO.halfedge_below(v,sit_pred->second); if ( event->second != 0 ) { const IsoList& IL = *(event->second); diff --git a/Nef_2/include/CGAL/Nef_polyhedron_2.h b/Nef_2/include/CGAL/Nef_polyhedron_2.h index d4e25b71c8c..f72b87b842f 100644 --- a/Nef_2/include/CGAL/Nef_polyhedron_2.h +++ b/Nef_2/include/CGAL/Nef_polyhedron_2.h @@ -869,7 +869,7 @@ public: void init_locator() const { const_cast(this)->ptr()->init_locator(); } const Locator& locator() const - { assert(ptr()->pl_); return *(ptr()->pl_); } + { CGAL_assertion(ptr()->pl_); return *(ptr()->pl_); } bool contains(Object_handle h) const diff --git a/Nef_3/Minkowski/include/CGAL/Nef_3/Ray_hit_generator.h b/Nef_3/Minkowski/include/CGAL/Nef_3/Ray_hit_generator.h index 3308ff70e38..74e509ec7c6 100644 --- a/Nef_3/Minkowski/include/CGAL/Nef_3/Ray_hit_generator.h +++ b/Nef_3/Minkowski/include/CGAL/Nef_3/Ray_hit_generator.h @@ -128,7 +128,7 @@ class Ray_hit_generator : public Modifier_base { return v; } - CGAL_assertion_msg(false, "ray should hit vertex, edge, or facet"); + CGAL_error_msg( "ray should hit vertex, edge, or facet"); return Vertex_handle(); } diff --git a/Nef_3/Minkowski/include/CGAL/Nef_3/Ray_hit_generator2.h b/Nef_3/Minkowski/include/CGAL/Nef_3/Ray_hit_generator2.h index 22117514114..ea2b03935eb 100644 --- a/Nef_3/Minkowski/include/CGAL/Nef_3/Ray_hit_generator2.h +++ b/Nef_3/Minkowski/include/CGAL/Nef_3/Ray_hit_generator2.h @@ -143,7 +143,7 @@ class Ray_hit_generator2 : public Modifier_base { return v; } - CGAL_assertion_msg(false, "ray should hit vertex, edge, or facet"); + CGAL_error_msg( "ray should hit vertex, edge, or facet"); return Vertex_handle(); } diff --git a/Nef_3/Minkowski/include/CGAL/Nef_3/Reflex_edge_searcher.h b/Nef_3/Minkowski/include/CGAL/Nef_3/Reflex_edge_searcher.h index 72a9f79eb5b..e677c91e3b6 100644 --- a/Nef_3/Minkowski/include/CGAL/Nef_3/Reflex_edge_searcher.h +++ b/Nef_3/Minkowski/include/CGAL/Nef_3/Reflex_edge_searcher.h @@ -106,7 +106,7 @@ class Reflex_edge_searcher : public Modifier_base void handle_new_edge(Halfedge_handle e) { if(normalized(e->point()) == dir || normalized(e->twin()->point()) == dir) { - CGAL_assertion_msg(false, "should not happen"); + CGAL_error_msg( "should not happen"); return; } diff --git a/Nef_3/Minkowski/include/CGAL/Nef_3/SNC_walls.h b/Nef_3/Minkowski/include/CGAL/Nef_3/SNC_walls.h index d802ec55c8a..b54a041cd52 100644 --- a/Nef_3/Minkowski/include/CGAL/Nef_3/SNC_walls.h +++ b/Nef_3/Minkowski/include/CGAL/Nef_3/SNC_walls.h @@ -101,7 +101,7 @@ class SNC_walls : public SNC_decorator { SM_walls SW(new_vertex(ip),fh->mark()); SW.extend_vertex_by_inner_walls(vh, vi, Sphere_point(CGAL::ORIGIN-vec)); break; - default : CGAL_assertion_msg(false, "not implemented yet"); + default : CGAL_error_msg( "not implemented yet"); } return Vertex_handle(); } diff --git a/Nef_3/Minkowski/include/CGAL/Nef_3/Single_wall_creator.h b/Nef_3/Minkowski/include/CGAL/Nef_3/Single_wall_creator.h index 2b04393f379..0f6fb9c2ec8 100644 --- a/Nef_3/Minkowski/include/CGAL/Nef_3/Single_wall_creator.h +++ b/Nef_3/Minkowski/include/CGAL/Nef_3/Single_wall_creator.h @@ -154,7 +154,7 @@ class Single_wall_creator : public Modifier_base { "->" << sh1->twin()->source()->point() ); return false; } - CGAL_assertion_msg(false, "should not happen on one side only"); + CGAL_error_msg( "should not happen on one side only"); } } diff --git a/Nef_3/Minkowski/include/CGAL/Nef_3/trunk_offset.h b/Nef_3/Minkowski/include/CGAL/Nef_3/trunk_offset.h index c681be7e989..2a5d5536e6b 100644 --- a/Nef_3/Minkowski/include/CGAL/Nef_3/trunk_offset.h +++ b/Nef_3/Minkowski/include/CGAL/Nef_3/trunk_offset.h @@ -33,7 +33,7 @@ public: case 0: return CGAL::compare_x(v1, v2) == SMALLER; case 1: return CGAL::compare_y(v1, v2) == SMALLER; case 2: return CGAL::compare_z(v1, v2) == SMALLER; - default: CGAL_assertion(false); + default: CGAL_error(); } return false; } @@ -57,7 +57,7 @@ public: CGAL::to_interval(v2.y()).first; case 2: return CGAL::to_interval(v1.z()).second < CGAL::to_interval(v2.z()).first; - default: CGAL_assertion(false); + default: CGAL_error(); } return false; } diff --git a/Nef_3/Minkowski/include/CGAL/Nef_S2/Gaussian_map.h b/Nef_3/Minkowski/include/CGAL/Nef_S2/Gaussian_map.h index 2128fccf64a..a266d930b29 100644 --- a/Nef_3/Minkowski/include/CGAL/Nef_S2/Gaussian_map.h +++ b/Nef_3/Minkowski/include/CGAL/Nef_S2/Gaussian_map.h @@ -1146,7 +1146,7 @@ class Gausian_map : return Object_handle(SVertex_const_handle(sfc->source())); } } - CGAL_assertion_msg(false,"line should not be executed"); + CGAL_error_msg("line should not be executed"); return Object_handle(); } @@ -1189,7 +1189,7 @@ class Gausian_map : return Object_handle(SVertex_const_handle(sfc->source())); } } - CGAL_assertion_msg(false,"line should not be executed"); + CGAL_error_msg("line should not be executed"); return Object_handle(); } diff --git a/Nef_3/Minkowski/include/CGAL/Nef_S2/SM_walls.h b/Nef_3/Minkowski/include/CGAL/Nef_S2/SM_walls.h index 3cecd0f6390..6311e23a564 100644 --- a/Nef_3/Minkowski/include/CGAL/Nef_S2/SM_walls.h +++ b/Nef_3/Minkowski/include/CGAL/Nef_S2/SM_walls.h @@ -90,7 +90,7 @@ class SM_walls : SM_decorator { if(seg.has_on(c.orthogonal_vector())) return sh; } - CGAL_assertion_msg(false, "should not be executed"); + CGAL_error_msg( "should not be executed"); return SHalfedge_handle(); } @@ -197,11 +197,11 @@ class SM_walls : SM_decorator { SHalfloop_handle sl; if(assign(sl, o)) - CGAL_assertion_msg(false, "not implemented yet"); + CGAL_error_msg( "not implemented yet"); SFace_handle sf; if(assign(sf, o)) - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); CGAL_NEF_TRACEN("did not find anything"); @@ -237,10 +237,10 @@ class SM_walls : SM_decorator { /* if(assign(se,o)) - CGAL_assertion_msg(false,"wrong handle"); + CGAL_error_msg("wrong handle"); if(assign(sl,o)) - CGAL_assertion_msg(false,"wrong handle"); + CGAL_error_msg("wrong handle"); */ // CGAL_NEF_SETDTHREAD(1); return true; @@ -273,9 +273,9 @@ class SM_walls : SM_decorator { SHalfloop_handle sl; if(assign(sl, o)) - CGAL_assertion_msg(false, "not implemented yet"); + CGAL_error_msg( "not implemented yet"); - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); return false; } @@ -331,7 +331,7 @@ class SM_walls : SM_decorator { return sv; } - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); return SVertex_handle(); } @@ -409,7 +409,7 @@ class SM_walls : SM_decorator { return sv; } - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); return SVertex_handle(); } diff --git a/Nef_3/Visual_hull/Nef_3/visual_hull_creator.h b/Nef_3/Visual_hull/Nef_3/visual_hull_creator.h index 5a7b63b13de..fb56b2fecc6 100644 --- a/Nef_3/Visual_hull/Nef_3/visual_hull_creator.h +++ b/Nef_3/Visual_hull/Nef_3/visual_hull_creator.h @@ -81,7 +81,7 @@ class visual_hull_creator : public CGAL::Modifier_base { if(!compute_halfsphere[2][0]) return Plane_3(Point_3(0,0,room_min.hz(),room_min.hw()),Vector_3(0,0,-1)); - CGAL_assertion_msg(false,"wrong sphere map"); + CGAL_error_msg("wrong sphere map"); return Plane_3(); } diff --git a/Nef_3/demo/Nef_3/include/CGAL/Nef_3/visual_hull_creator.h b/Nef_3/demo/Nef_3/include/CGAL/Nef_3/visual_hull_creator.h index 002ce537b97..b777d4faf5b 100644 --- a/Nef_3/demo/Nef_3/include/CGAL/Nef_3/visual_hull_creator.h +++ b/Nef_3/demo/Nef_3/include/CGAL/Nef_3/visual_hull_creator.h @@ -79,7 +79,7 @@ class visual_hull_creator : public CGAL::Modifier_base { if(!compute_halfsphere[2][0]) return Plane_3(Point_3(0,0,room_min.hz(),room_min.hw()),Vector_3(0,0,-1)); - CGAL_assertion_msg(false,"wrong sphere map"); + CGAL_error_msg("wrong sphere map"); return Plane_3(); } diff --git a/Nef_3/include/CGAL/Nef_3/Bounding_box_3.h b/Nef_3/include/CGAL/Nef_3/Bounding_box_3.h index 6edc9f87252..7fbf7dee860 100644 --- a/Nef_3/include/CGAL/Nef_3/Bounding_box_3.h +++ b/Nef_3/include/CGAL/Nef_3/Bounding_box_3.h @@ -38,7 +38,7 @@ public Box_intersection_d::Box_d< double, 3> { public: Bounding_box_3() : Base(false) { - CGAL_assertion_msg(false, "code not stable"); + CGAL_error_msg( "code not stable"); } Bounding_box_3(double q[3]) : Base(q,q) {} diff --git a/Nef_3/include/CGAL/Nef_3/Infimaximal_box.h b/Nef_3/include/CGAL/Nef_3/Infimaximal_box.h index 8b5b122fc83..0c5a6cb484a 100644 --- a/Nef_3/include/CGAL/Nef_3/Infimaximal_box.h +++ b/Nef_3/include/CGAL/Nef_3/Infimaximal_box.h @@ -476,7 +476,7 @@ class Infimaximal_box { RT(p.hy()[0]*p.hz()[1]-p.hz()[0]*p.hy()(1),-p.hy()(1)*p.hw()[0]), RT(0,-p.hz()[1]*p.hw()[0]), RT(p.hw()[0]*p.hz()[1])); - default: CGAL_assertion_msg(false, "wrong value"); + default: CGAL_error_msg( "wrong value"); } return Point_3(); } @@ -514,10 +514,10 @@ class Infimaximal_box { if(-s1->hz()(1) != s1->hw()) continue; if(-t1->hz()(1) != t1->hw()) continue; return s1; - default: CGAL_assertion_msg(false, "wrong value"); + default: CGAL_error_msg( "wrong value"); } } - CGAL_assertion_msg(false, "this line of shall not be reached"); + CGAL_error_msg( "this line of shall not be reached"); return s1; } diff --git a/Nef_3/include/CGAL/Nef_3/K3_tree.h b/Nef_3/include/CGAL/Nef_3/K3_tree.h index be19d22a6b8..2f699fd1d67 100644 --- a/Nef_3/include/CGAL/Nef_3/K3_tree.h +++ b/Nef_3/include/CGAL/Nef_3/K3_tree.h @@ -100,7 +100,7 @@ public: case 0: return CGAL::compare_x(v1->point(), v2->point()) == SMALLER; case 1: return CGAL::compare_y(v1->point(), v2->point()) == SMALLER; case 2: return CGAL::compare_z(v1->point(), v2->point()) == SMALLER; - default: CGAL_assertion(false); + default: CGAL_error(); } return false; } @@ -113,7 +113,7 @@ public: case 0: return CGAL::compare_x(v1->point(), v2->point()) == SMALLER; case 1: return CGAL::compare_y(v1->point(), v2->point()) == SMALLER; case 2: return CGAL::compare_z(v1->point(), v2->point()) == SMALLER; - default: CGAL_assertion(false); + default: CGAL_error(); } return false; } @@ -138,7 +138,7 @@ public: CGAL::to_interval(v2->point().y()).first; case 2: return CGAL::to_interval(v1->point().z()).second < CGAL::to_interval(v2->point().z()).first; - default: CGAL_assertion(false); + default: CGAL_error(); } return false; } @@ -154,7 +154,7 @@ public: CGAL::to_interval(v2->point().y()).first; case 2: return CGAL::to_interval(v1->point().z()).second < CGAL::to_interval(v2->point().z()).first; - default: CGAL_assertion(false); + default: CGAL_error(); } return false; } @@ -721,7 +721,7 @@ public: objects.push_back(Object_handle(th)); } } else - CGAL_assertion_msg(false, "wrong value"); + CGAL_error_msg( "wrong value"); } else objects.push_back(Object_handle(Halffacet_handle(f))); #else @@ -806,7 +806,7 @@ typename Object_list::difference_type n_vertices = std::distance(objects.begin() #endif #ifdef CGAL_NEF3_FACET_WITH_BOX else if(CGAL::assign(pf, *o)) { - CGAL_assertion_msg(false, "wrong type"); + CGAL_error_msg( "wrong type"); } #endif else diff --git a/Nef_3/include/CGAL/Nef_3/Nef_box.h b/Nef_3/include/CGAL/Nef_3/Nef_box.h index 4edc688e205..925ead772de 100644 --- a/Nef_3/include/CGAL/Nef_3/Nef_box.h +++ b/Nef_3/include/CGAL/Nef_3/Nef_box.h @@ -139,17 +139,17 @@ class Nef_box : public Box_intersection_d::Box_d< double, 3 > { } Halffacet_handle get_halffacet() { - assert( type == FACET ); + CGAL_assertion( type == FACET ); return f; } Halfedge_handle get_halfedge() { - assert( type == EDGE ); + CGAL_assertion( type == EDGE ); return e; } Vertex_handle get_vertex() { - assert (type == VERTEX); + CGAL_assertion(type == VERTEX); return v; } }; diff --git a/Nef_3/include/CGAL/Nef_3/Polygon_constructor.h b/Nef_3/include/CGAL/Nef_3/Polygon_constructor.h index f8aa3076a71..269831809c8 100644 --- a/Nef_3/include/CGAL/Nef_3/Polygon_constructor.h +++ b/Nef_3/include/CGAL/Nef_3/Polygon_constructor.h @@ -77,7 +77,7 @@ class Polygon_constructor : public Modifier_base { return Sphere_circle(Sphere_point(ORIGIN+(*pprev-*pcur)), Sphere_point(ORIGIN+(*pnext-*pcur))); } - CGAL_assertion_msg(false, "all points lie on a common line"); + CGAL_error_msg( "all points lie on a common line"); return Sphere_circle(); } diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index cd9b7b9cb5d..68cd50fc640 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -493,7 +493,7 @@ public: // piercing point of the |ray| on the local (virtual) view of |e| // \precondition |ray| target belongs to |e|. } - CGAL_assertion(false); + CGAL_error(); SM_const_decorator SD; if( SD.is_isolated(e)) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_constructor.h b/Nef_3/include/CGAL/Nef_3/SNC_constructor.h index cc7f2aac81f..f50ef49e1ba 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_constructor.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_constructor.h @@ -108,7 +108,7 @@ struct circle_lt { if(x[0] > zero) return (y[0]>y[1]); else return (y[0]sncp()->new_vertex( p, true); SM_decorator D(&*v); @@ -731,7 +731,7 @@ public: SM_const_decorator E(&*e1->source()); if(E.is_isolated(e0)) { if(E.is_isolated(e1)) { - CGAL_assertion_msg(false, "not implemented, yet"); + CGAL_error_msg( "not implemented, yet"); } else { std::swap(e0, e1); @@ -865,7 +865,7 @@ public: << ", " << (std::distance(seb[1], see[1])) ); if(E.is_isolated(e1)) { - CGAL_assertion_msg(false, "not implemented, yet"); + CGAL_error_msg( "not implemented, yet"); return D.sphere_map(); } @@ -1021,7 +1021,7 @@ public: CGAL_NEF_TRACEN("++os1 " << os1 ); if(os1 == ON_ORIENTED_BOUNDARY) { - CGAL_assertion_msg(false, "not implemented, yet"); // don't forget empty_c + CGAL_error_msg( "not implemented, yet"); // don't forget empty_c ++svc; scb[0] = scb[1] = sce[0] = sce[1] = svc; if(svc != send) { @@ -1064,7 +1064,7 @@ public: empty_c[1-i] = true; done = true; } else { - CGAL_assertion_msg(false, "not implemented, yet"); + CGAL_error_msg( "not implemented, yet"); CGAL_assertion(os0 != os1); i = os1 == ON_POSITIVE_SIDE ? 0 : 1; sce[1-i] = scb[i] = svc; @@ -1083,7 +1083,7 @@ public: sce[1-i] = scb[i] = svc; if(os1 == ON_ORIENTED_BOUNDARY) { - CGAL_assertion_msg(false, "degenerate case not handled"); + CGAL_error_msg( "degenerate case not handled"); ++scb[i]; CGAL_assertion(svc->circle().has_on(sv[0]->point()) == 1-i); equator[1-i] = equator[3-i] == true; diff --git a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h index 0bd5f58e82f..23993501001 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h @@ -615,7 +615,7 @@ class SNC_decorator : public SNC_const_decorator { // piercing point of the |ray| on the local (virtual) view of |e| // \precondition |ray| target belongs to |e|. } - CGAL_assertion(false); + CGAL_error(); SM_decorator SD; if( SD.is_isolated(e)) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_external_structure.h b/Nef_3/include/CGAL/Nef_3/SNC_external_structure.h index 9df914f7fbd..c2ebcacbd80 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_external_structure.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_external_structure.h @@ -1221,7 +1221,7 @@ public: else if(CGAL::assign(l, o)) h = l->circle().opposite().plane_through(l->incident_sface()->center_vertex()->point()); else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); D.create_facet_objects(h,it->second.begin(),it->second.end()); } diff --git a/Nef_3/include/CGAL/Nef_3/SNC_k3_tree_traits.h b/Nef_3/include/CGAL/Nef_3/SNC_k3_tree_traits.h index 7700c617e6e..f7c71505c14 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_k3_tree_traits.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_k3_tree_traits.h @@ -50,7 +50,7 @@ class ComparePoints { case 2: CGAL_NEF_TRACEN("compare_z " << p1 << ", " << p2 << "=" << (int) CGAL::compare_z(p1, p2)); return CGAL::compare_z(p1, p2); - default: CGAL_assertion(false); + default: CGAL_error(); } return CGAL::EQUAL; } @@ -94,7 +94,7 @@ class ComparePoints, Coordinate> { CGAL::to_interval(p1.z()).first) return CGAL::LARGER; return CGAL::EQUAL; - default: CGAL_assertion(false); + default: CGAL_error(); } return CGAL::EQUAL; } @@ -397,7 +397,7 @@ Side_of_plane::operator() OnSideMapRC[&(v->point().hw())] = cr == LARGER ? ON_POSITIVE_SIDE : cr == SMALLER ? ON_NEGATIVE_SIDE : ON_ORIENTED_BOUNDARY; break; - default: CGAL_assertion_msg(false, "wrong value"); + default: CGAL_error_msg( "wrong value"); } return OnSideMapRC[&(v->point().hw())]; } else { @@ -412,7 +412,7 @@ Side_of_plane::operator() #ifdef CGAL_NEF_EXPLOIT_REFERENCE_COUNTING } #endif - CGAL_assertion_msg(false, "should not be reached"); + CGAL_error_msg( "should not be reached"); } /* @@ -448,7 +448,7 @@ Side_of_plane::operator() OnSideMap[v] = cr == LARGER ? ON_POSITIVE_SIDE : cr == SMALLER ? ON_NEGATIVE_SIDE : ON_ORIENTED_BOUNDARY; break; - default: CGAL_assertion_msg(false, "wrong value"); + default: CGAL_error_msg( "wrong value"); } if(!OnSideMap.is_defined(vt)) switch(depth%3) { @@ -467,7 +467,7 @@ Side_of_plane::operator() OnSideMap[vt] = cr == LARGER ? ON_POSITIVE_SIDE : cr == SMALLER ? ON_NEGATIVE_SIDE : ON_ORIENTED_BOUNDARY; break; - default: CGAL_assertion_msg(false, "wrong value"); + default: CGAL_error_msg( "wrong value"); } Oriented_side src_side = OnSideMap[v]; Oriented_side tgt_side = OnSideMap[vt]; @@ -515,7 +515,7 @@ Side_of_plane::operator() side = cr == LARGER ? ON_POSITIVE_SIDE : cr == SMALLER ? ON_NEGATIVE_SIDE : ON_ORIENTED_BOUNDARY; break; - default: CGAL_assertion_msg(false, "wrong value"); + default: CGAL_error_msg( "wrong value"); } #ifdef CGAL_NEF_EXPLOIT_REFERENCE_COUNTING if(reference_counted) @@ -558,7 +558,7 @@ template Oriented_side Side_of_plane::operator() (const Point_3& pop, Partial_facet& pf, Depth depth) { - CGAL_assertion_msg(false, "not implemented yet"); + CGAL_error_msg( "not implemented yet"); return ON_ORIENTED_BOUNDARY; } @@ -591,7 +591,7 @@ Side_of_plane::operator() if(f->b.max_coord(2) < pop.z()) return ON_NEGATIVE_SIDE; break; - default: CGAL_assertion_msg(false, "wrong value"); + default: CGAL_error_msg( "wrong value"); } return ON_ORIENTED_BOUNDARY; #else diff --git a/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h b/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h index 02c4b13619a..c61eb193b54 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h @@ -365,7 +365,7 @@ public: CGAL_NEF_TRACEN("add triangle " << tr); } } else - CGAL_assertion_msg(false, "wrong value"); + CGAL_error_msg( "wrong value"); } else { CGAL_NEF_TRACEN("add facet " << f->plane()); objects.push_back(Object_handle(Halffacet_handle(f))); @@ -747,7 +747,7 @@ public: } #endif } - else CGAL_assertion_msg(false, "wrong handle type"); + else CGAL_error_msg( "wrong handle type"); } if( CGAL::assign( v, result)) { @@ -759,7 +759,7 @@ public: return sf->volume(); std::cerr << "Abbruch " << std::endl; return Object_handle(); - CGAL_assertion_msg(false, "wrong handle type"); + CGAL_error_msg( "wrong handle type"); /* SHalfedge_handle se; CGAL_assertion(CGAL::assign(se,so)); @@ -788,7 +788,7 @@ public: return Object_handle(f->incident_volume()); #ifdef CGAL_NEF3_FACET_WITH_BOX } else if( CGAL::assign(pf, *o)) { - CGAL_assertion_msg(false, "should not be executed"); + CGAL_error_msg( "should not be executed"); Halffacet_handle f = pf.f; if(f->plane().oriented_side(p) == ON_NEGATIVE_SIDE) f = f->twin(); @@ -808,7 +808,7 @@ public: return Object_handle(e->incident_sface()->volume()); return get_visible_facet(e,Ray_3(s.source(),s.to_vector()))->incident_volume(); } - CGAL_assertion_msg(false, "wrong handle type"); + CGAL_error_msg( "wrong handle type"); return Object_handle(); } } @@ -870,7 +870,7 @@ public: } #ifdef CGAL_NEF3_FACET_WITH_BOX else if( CGAL::assign(pf, *o)) { - CGAL_assertion_msg(false, "not implemented yet"); + CGAL_error_msg( "not implemented yet"); } #endif #ifdef CGAL_NEF3_TRIANGULATE_FACETS @@ -938,7 +938,7 @@ public: } #ifdef CGAL_NEF3_FACET_WITH_BOX else if( CGAL::assign(pf, *o)) { - CGAL_assertion_msg(false, "not implemented yet"); + CGAL_error_msg( "not implemented yet"); } #endif #ifdef CGAL_NEF3_TRIANGULATE_FACETS @@ -995,7 +995,7 @@ public: } #ifdef CGAL_NEF3_FACET_WITH_BOX else if( CGAL::assign(pf, *o)) { - CGAL_assertion_msg(false, "not implemented yet"); + CGAL_error_msg( "not implemented yet"); } #endif #ifdef CGAL_NEF3_TRIANGULATE_FACETS diff --git a/Nef_3/include/CGAL/Nef_3/SNC_simplify.h b/Nef_3/include/CGAL/Nef_3/SNC_simplify.h index d5d19a179f4..14d361d0313 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_simplify.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_simplify.h @@ -731,7 +731,7 @@ class SNC_simplify SHalfloop_handle sl(fci); sl->set_index(index); } else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); } } diff --git a/Nef_3/include/CGAL/Nef_3/SNC_structure.h b/Nef_3/include/CGAL/Nef_3/SNC_structure.h index fd94ff9f2b0..2782f6d4ecb 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_structure.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_structure.h @@ -517,7 +517,7 @@ public: SHalfloop_handle l(fc); isolated_vertices.push_back(l->incident_sface()->center_vertex()->point()); } else - CGAL_assertion_msg(false, "wrong value"); + CGAL_error_msg( "wrong value"); } } diff --git a/Nef_3/include/CGAL/Nef_3/Visualizor.h b/Nef_3/include/CGAL/Nef_3/Visualizor.h index 031ed409bee..00c0eda8e73 100644 --- a/Nef_3/include/CGAL/Nef_3/Visualizor.h +++ b/Nef_3/include/CGAL/Nef_3/Visualizor.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Michael Seel // Miguel Granados @@ -54,7 +54,7 @@ namespace OGL { // Drawable double types: // ---------------------------------------------------------------------------- - typedef CGAL::Simple_cartesian DKernel; + typedef CGAL::Simple_cartesian DKernel; typedef DKernel::Point_3 Double_point; typedef DKernel::Vector_3 Double_vector; typedef DKernel::Segment_3 Double_segment; @@ -92,7 +92,7 @@ namespace OGL { typedef const double* const_double_ptr; double coords_[3]; public: - Double_triple() + Double_triple() { coords_[0]=coords_[1]=coords_[2]=0.0; } Double_triple(double x, double y, double z) { coords_[0]=x; coords_[1]=y; coords_[2]=z; } @@ -106,9 +106,9 @@ namespace OGL { coords_[1]=t.coords_[1]; coords_[2]=t.coords_[2]; return *this; } - operator double_ptr() const + operator double_ptr() const { return const_cast(*this).coords_; } - double operator[](unsigned i) + double operator[](unsigned i) { CGAL_assertion(i<3); return coords_[i]; } }; // Double_triple @@ -138,19 +138,19 @@ namespace OGL { void push_back_vertex(double x, double y, double z) { coords_.push_back(Double_triple(x,y,z)); } - DFacet(const DFacet& f) + DFacet(const DFacet& f) { coords_ = f.coords_; fc_ends_ = f.fc_ends_; normal_ = f.normal_; mark_ = f.mark_; } - DFacet& operator=(const DFacet& f) + DFacet& operator=(const DFacet& f) { coords_ = f.coords_; fc_ends_ = f.fc_ends_; normal_ = f.normal_; mark_ = f.mark_; - return *this; + return *this; } ~DFacet() @@ -158,7 +158,7 @@ namespace OGL { void push_back_vertex(const Double_point& p) { push_back_vertex(p.x(),p.y(),p.z()); } - + void set_normal(double x, double y, double z, bool m) { double l = sqrt(x*x + y*y + z*z); normal_ = Double_triple(x/l,y/l,z/l); mark_ = m; } @@ -167,21 +167,21 @@ namespace OGL { double dy() const { return normal_[1]; } double dz() const { return normal_[2]; } bool mark() const { return mark_; } - double* normal() const + double* normal() const { return static_cast(normal_); } void new_facet_cycle() { fc_ends_.push_back(coords_.size()); } - + unsigned number_of_facet_cycles() const { return fc_ends_.size(); } - Coord_iterator facet_cycle_begin(unsigned i) + Coord_iterator facet_cycle_begin(unsigned i) { CGAL_assertion(imark() ? ct : cf; glPointSize(10); glColor3ub(c.red(), c.green(), c.blue()); glBegin(GL_POINTS); glVertex3d(v->x(),v->y(),v->z()); - glEnd(); + glEnd(); } void draw(Edge_iterator e) const { CGAL_NEF_TRACEN("drawing edge "<<*e); Double_point p = e->source(), q = e->target(); - CGAL::Color cf(CGAL_NEF3_MARKED_EDGE_COLOR), + CGAL::Color cf(CGAL_NEF3_MARKED_EDGE_COLOR), ct(CGAL_NEF3_UNMARKED_EDGE_COLOR); // more blue-ish CGAL::Color c = e->mark() ? ct : cf; glLineWidth(5); @@ -337,7 +336,7 @@ namespace OGL { gluTessBeginContour(tess_); CGAL_NEF_TRACEN(" Begin Contour"); // put all vertices in facet cycle into contour: - for(cit = f->facet_cycle_begin(i); + for(cit = f->facet_cycle_begin(i); cit != f->facet_cycle_end(i); ++cit) { gluTessVertex(tess_, *cit, *cit); CGAL_NEF_TRACEN(" add Vertex"); @@ -351,7 +350,7 @@ namespace OGL { } void construct_axes() const - { + { glLineWidth(2.0); // red x-axis glColor3f(1.0,0.0,0.0); @@ -359,7 +358,7 @@ namespace OGL { glVertex3f(0.0,0.0,0.0); glVertex3f(5.0,0.0,0.0); glEnd(); - // green y-axis + // green y-axis glColor3f(0.0,1.0,0.0); glBegin(GL_LINES); glVertex3f(0.0,0.0,0.0); @@ -389,12 +388,12 @@ namespace OGL { glNewList(object_list_, GL_COMPILE); Vertex_iterator v; CGAL_forall_iterators(v,vertices_) draw(v); - glEndList(); + glEndList(); glNewList(object_list_+1, GL_COMPILE); Edge_iterator e; CGAL_forall_iterators(e,edges_) draw(e); - glEndList(); + glEndList(); glNewList(object_list_+2, GL_COMPILE); Halffacet_iterator f; @@ -407,17 +406,17 @@ namespace OGL { } - void initialize() + void initialize() { if (init_) return; init_ = true; - axes_ = false; - object_list_ = glGenLists(4); CGAL_assertion(object_list_); + axes_ = false; + object_list_ = glGenLists(4); CGAL_assertion(object_list_); fill_display_lists(); } void draw( GLdouble z_vec[3]) const - { + { if (!is_initialized()) const_cast(*this).initialize(); double l = (std::max)( (std::max)( bbox().xmax() - bbox().xmin(), bbox().ymax() - bbox().ymin()), @@ -429,11 +428,11 @@ namespace OGL { -(bbox().ymax() + bbox().ymin()) / 2.0, -(bbox().zmax() + bbox().zmin()) / 2.0); if ( surface_ ) { - //glEnable(GL_LIGHTING); + //glEnable(GL_LIGHTING); glCallList(object_list_+2); // facets //glDisable(GL_LIGHTING); } - // move edges and vertices a bit towards the view-point, + // move edges and vertices a bit towards the view-point, // i.e., 1/100th of the unit vector in camera space double f = l / 4.0 / 100.0; glTranslated( z_vec[0] * f, z_vec[1] * f, z_vec[2] * f); @@ -447,11 +446,11 @@ namespace OGL { os << "OGL::Polyhedron" << std::endl; os << "Vertices:" << std::endl; Vertex_iterator v; - CGAL_forall_iterators(v,vertices_) + CGAL_forall_iterators(v,vertices_) os << " "<<*v<<", mark="<mark()< polyhedra_; static std::vector titles_; -static Polyhedron& add_polyhedron() -{ polyhedra_.push_back(Polyhedron()); +static Polyhedron& add_polyhedron() +{ polyhedra_.push_back(Polyhedron()); return polyhedra_.back(); } static void show (int mode) @@ -538,8 +537,8 @@ static void show (int mode) case FULLSCREEN: glutFullScreen(); break; - case QUIT: - exit(0); + case QUIT: + std::exit(0); } } @@ -565,16 +564,16 @@ static void mouse (int button, int state, int x, int y) } -static Affine_3 virtual_sphere_transformation( double old_x, double old_y, +static Affine_3 virtual_sphere_transformation( double old_x, double old_y, double new_x, double new_y) { if ( old_x == new_x && old_y == new_y)// zero rotation. return Affine_3( IDENTITY); // Determine the projected vectors on the `sphere'. double dd = old_x * old_x + old_y * old_y; - Double_vector v_old( old_x, old_y, + Double_vector v_old( old_x, old_y, ((dd < 0.5) ? std::sqrt(1-dd) : 0.5 / std::sqrt(dd))); dd = new_x * new_x + new_y * new_y; - Double_vector v_new( new_x, new_y, + Double_vector v_new( new_x, new_y, ((dd < 0.5) ? std::sqrt(1-dd) : 0.5 / std::sqrt(dd))); Double_vector axis = cross_product( v_old, v_new); double angle = 0.0; @@ -647,7 +646,7 @@ static void initialize_olg() glLoadIdentity(); /* GLfloat light_ambient[4] = { 1.0, 1.0, 1.0, 1.0 }; - GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; // white diffuse light + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; // white diffuse light GLfloat light_position[] = { 2.0, 3.0, -4.0, 0.0 }; // infinite location //GLfloat light_position[] = { 3.0, 5.0, 4.5, 1.0}; @@ -664,7 +663,7 @@ static void initialize_olg() //GLfloat mat_specular[4] = { 1.0, 1.0, 1.0, 1.0 }; GLfloat mat_specular[4] = { 0.3, 0.3, 0.3, 1.0 }; GLfloat mat_shininess[] = { 100.0 }; - + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient ); //glMaterialfv(GL_BACK, GL_AMBIENT, mat_back_ambient ); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse ); @@ -693,7 +692,7 @@ static void draw() double w = double( window_width) / double( window_height); if ( perspective) { double s = (eye - znear) / eye; - glFrustum( -wsize*w*s, wsize*w*s, -wsize*s, wsize*s, + glFrustum( -wsize*w*s, wsize*w*s, -wsize*s, wsize*s, eye-znear, eye+zfar); glTranslated( 0.0, 0.0, -eye); } else { @@ -703,7 +702,7 @@ static void draw() double h = double( window_height) / double( window_width); if ( perspective) { double s = (eye - znear) / eye; - glFrustum( -wsize*s, wsize*s, -wsize*h*s, wsize*h*s, + glFrustum( -wsize*s, wsize*s, -wsize*h*s, wsize*h*s, eye-znear, eye+zfar); glTranslated( 0.0, 0.0, -eye); } else { @@ -717,7 +716,7 @@ static void draw() rotation.m(0,2), rotation.m(1,2), rotation.m(2,2), 0.0, rotation.m(0,3), rotation.m(1,3), rotation.m(2,3), 1.0}; glMultMatrixd( M); - + glScaled(s,s,s); GLdouble z_vec[3] = { rotation.m(2,0) / s, @@ -746,7 +745,7 @@ static void reshape(int width, int height) static void start_viewer() -{ +{ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowSize(window_width, window_height); glutInitWindowPosition(0,0); @@ -797,7 +796,7 @@ static void start_viewer() // ---------------------------------------------------------------------------- template -class Visualizor_OpenGL_3 { +class Visualizor_OpenGL_3 { typedef typename Nef_polyhedron::SNC_structure SNC_structure; typedef CGAL::SNC_decorator Base; typedef CGAL::SNC_FM_decorator FM_decorator; @@ -805,17 +804,17 @@ class Visualizor_OpenGL_3 { CGAL::OGL::Polyhedron* ppoly_; public: - typedef typename SNC_structure::Vertex_const_iterator Vertex_const_iterator; - typedef typename SNC_structure::Halfedge_const_iterator Halfedge_const_iterator; - typedef typename SNC_structure::Halffacet_const_iterator Halffacet_const_iterator; + typedef typename SNC_structure::Vertex_const_iterator Vertex_const_iterator; + typedef typename SNC_structure::Halfedge_const_iterator Halfedge_const_iterator; + typedef typename SNC_structure::Halffacet_const_iterator Halffacet_const_iterator; typedef typename SNC_structure::Halffacet_cycle_const_iterator Halffacet_cycle_const_iterator; typedef typename SNC_structure::Object_const_handle Object_const_handle; - typedef typename SNC_structure::SHalfedge_const_handle SHalfedge_const_handle; - typedef typename SNC_structure::SHalfloop_const_handle SHalfloop_const_handle; + typedef typename SNC_structure::SHalfedge_const_handle SHalfedge_const_handle; + typedef typename SNC_structure::SHalfloop_const_handle SHalfloop_const_handle; - typedef typename SNC_structure::Vertex_const_handle Vertex_const_handle; - typedef typename SNC_structure::Halfedge_const_handle Halfedge_const_handle; + typedef typename SNC_structure::Vertex_const_handle Vertex_const_handle; + typedef typename SNC_structure::Halfedge_const_handle Halfedge_const_handle; typedef typename SNC_structure::Halffacet_const_handle Halffacet_const_handle; typedef typename SNC_structure::Point_3 Point_3; @@ -823,16 +822,16 @@ public: typedef typename SNC_structure::Segment_3 Segment_3; typedef typename SNC_structure::Plane_3 Plane_3; typedef typename SNC_structure::Mark Mark; - typedef typename SNC_structure::SHalfedge_around_facet_const_circulator + typedef typename SNC_structure::SHalfedge_around_facet_const_circulator SHalfedge_around_facet_const_circulator; - + Nef_polyhedron N; - Visualizor_OpenGL_3(const Nef_polyhedron& Nef) : N(Nef) { - ppoly_ = & CGAL::OGL::add_polyhedron(); + Visualizor_OpenGL_3(const Nef_polyhedron& Nef) : N(Nef) { + ppoly_ = & CGAL::OGL::add_polyhedron(); } - + OGL::Double_point double_point(const Point_3& p) const { return OGL::Double_point(CGAL::to_double(p.x()), CGAL::to_double(p.y()), @@ -843,19 +842,19 @@ public: double_point(s.target())); } void draw(Vertex_const_handle v) const - { + { Point_3 bp = v->point(); CGAL_NEF_TRACEN("vertex " << bp); - ppoly_->push_back(double_point(bp), v->mark()); + ppoly_->push_back(double_point(bp), v->mark()); } void draw(Halfedge_const_handle e) const - { + { Vertex_const_handle s = e->source(); Vertex_const_handle t = e->twin()->source(); Segment_3 seg(s->point(), t->point()); CGAL_NEF_TRACEN("edge " << seg); - ppoly_->push_back(double_segment(seg), e->mark()); + ppoly_->push_back(double_segment(seg), e->mark()); } void draw(Halffacet_const_handle f) const @@ -873,9 +872,9 @@ public: } } Vector_3 v = f->plane().orthogonal_vector(); - g.set_normal(CGAL::to_double(v.x()), - CGAL::to_double(v.y()), - CGAL::to_double(v.z()), + g.set_normal(CGAL::to_double(v.x()), + CGAL::to_double(v.y()), + CGAL::to_double(v.z()), f->mark()); ppoly_->push_back(g); } @@ -904,8 +903,8 @@ public: } } return bbox; - } - + } + void set_R(const Bbox_3 bbox) const { if(N.is_standard_kernel()) return; double size = abs(bbox.xmin()); @@ -918,7 +917,7 @@ public: CGAL_NEF_TRACEN("set infi box size to " << size); } - void draw() const { + void draw() const { Bbox_3 bbox(bounded_bbox()); ppoly_->bbox() = bbox; set_R(bbox); diff --git a/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Nef_3/include/CGAL/Nef_polyhedron_3.h index a6de0e60f15..6841cc3abd1 100644 --- a/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -589,7 +589,7 @@ protected: Triangulation_handler2 th(f); th.handle_triangles(B, VI); } else - CGAL_assertion_msg(false, "wrong value"); + CGAL_error_msg( "wrong value"); } else { @@ -688,7 +688,7 @@ protected: omit_vertex[sl->incident_sface()->center_vertex()]; --nov; } else - CGAL_assertion_msg(false, "wrong handle type"); + CGAL_error_msg( "wrong handle type"); } } @@ -1569,7 +1569,7 @@ protected: if(li2 != corner_list.end()) delete_list.push_back(*li2); break; - default: CGAL_assertion_msg(false, "wrong value"); + default: CGAL_error_msg( "wrong value"); } Vertex_handle v = snc().new_vertex(v1->point(), (*li)->mark()); SM_overlayer O(&*v); diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_constrained_triang_traits.h b/Nef_S2/include/CGAL/Nef_S2/SM_constrained_triang_traits.h index b3ba0244c27..0614331ed0a 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_constrained_triang_traits.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_constrained_triang_traits.h @@ -229,7 +229,7 @@ public: { // we triangulate the interior of the whole chain between // target(e_upper) and target(e_lower) - assert(e_upper->source()==e_lower->source()); + CGAL_assertion(e_upper->source()==e_lower->source()); CGAL_NEF_TRACE("triangulate_between\n "<twin(); diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h index b2039b3c2dc..138bf25b630 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h @@ -176,7 +176,7 @@ void trivial_segment(Vertex_handle v, IT it) const CGAL_assertion(sv->point() == v->point()); G.supp_object(v,si._from) = si._o; } else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); CGAL_NEF_TRACEN("trivial_segment " << si._from << ":" << v->point()); // debug(); @@ -201,7 +201,7 @@ void starting_segment(Vertex_handle v, IT it) const } else if(CGAL::assign(sl, si._o)) { G.supp_object(v,si._from) = si._o; } else - CGAL_assertion_msg(false, "wrong object"); + CGAL_error_msg( "wrong object"); // debug(); } @@ -226,7 +226,7 @@ void ending_segment(Vertex_handle v, IT it) const } else if(CGAL::assign(sl, si._o)) { G.supp_object(v,si._from) = si._o; } else - CGAL_assertion_msg(false, "wrong object"); + CGAL_error_msg( "wrong object"); // debug(); } @@ -1681,7 +1681,7 @@ transfer_data(Association& A) { else if(CGAL::assign(sl1, o1)) A.handle_support(sv, se0, sl1); else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); } else if(CGAL::assign(sv0, o0)) { if(o1 == NULL) A.handle_support(sv, sv0); @@ -1692,7 +1692,7 @@ transfer_data(Association& A) { else if(CGAL::assign(sl1, o1)) A.handle_support(sv, sv0, sl1); else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); } else if(CGAL::assign(sl0, o0)) { if(o1 == NULL) continue; @@ -1703,7 +1703,7 @@ transfer_data(Association& A) { else if(CGAL::assign(sl1, o1)) A.handle_support(sv, sl0, sl1); } else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); } CGAL_forall_sedges(se, *this) { @@ -1715,7 +1715,7 @@ transfer_data(Association& A) { else if(assign(sl1, o1)) A.handle_support(se, sl1); else - continue; // CGAL_assertion_msg(false, "wrong handle"); + continue; // CGAL_error_msg( "wrong handle"); } else if(assign(se0, o0)) { if(o1 == NULL) A.handle_support(se, se0); @@ -1724,7 +1724,7 @@ transfer_data(Association& A) { else if(assign(sl1, o1)) A.handle_support(se, se0, sl1); else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); } else if(assign(sl0, o0)) { if(o1 == NULL) A.handle_support(se, sl0); @@ -1733,9 +1733,9 @@ transfer_data(Association& A) { else if(assign(sl1, o1)) A.handle_support(se, sl0, sl1); else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); } else - CGAL_assertion_msg(false, "wrong handle"); + CGAL_error_msg( "wrong handle"); } } diff --git a/Number_types/include/CGAL/Lazy_exact_nt.h b/Number_types/include/CGAL/Lazy_exact_nt.h index a280bcd41a6..cbb1b08ca81 100644 --- a/Number_types/include/CGAL/Lazy_exact_nt.h +++ b/Number_types/include/CGAL/Lazy_exact_nt.h @@ -140,7 +140,7 @@ struct Lazy_exact_Ex_Cst : public Lazy_exact_nt_rep this->et = new ET(e); } - void update_exact() { CGAL_assertion(false); } + void update_exact() { CGAL_error(); } }; // Construction from a Lazy_exact_nt (which keeps the lazyness). diff --git a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h index 851064d31b5..7fd83c8c956 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h +++ b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h @@ -162,7 +162,7 @@ public: static void check_roots(const Self& a, const Self b ) { if(a.is_extended() && b.is_extended()){ if (a.root() != b.root()){ - //CGAL_error("Interoperation of incompatible algebraic extensions"); + //CGAL_error_msg("Interoperation of incompatible algebraic extensions"); throw std::range_error("Interoperation of incompatible algebraic extensions"); } } diff --git a/Number_types/include/CGAL/Sqrt_extension/io.h b/Number_types/include/CGAL/Sqrt_extension/io.h index fb8718321e7..4d58e8b048e 100644 --- a/Number_types/include/CGAL/Sqrt_extension/io.h +++ b/Number_types/include/CGAL/Sqrt_extension/io.h @@ -49,18 +49,17 @@ swallow(is, 'T'); swallow(is, '['); is >> iformat(a0); do c = is.get(); while (isspace(c)); -// TODO: Replace CGAL_assertion_msg( false, ... ) with CGAL_error -if (c != ',') CGAL_error( "input error: , expected" ); +if (c != ',') CGAL_error_msg( "input error: , expected" ); is >> iformat(a1); do c = is.get(); while (isspace(c)); -if (c != ',') CGAL_error( "input error: , expected" ); +if (c != ',') CGAL_error_msg( "input error: , expected" ); is >> iformat(root); do c = is.get(); while (isspace(c)); -if (c != ']') CGAL_error( "input error: ] expected" ); +if (c != ']') CGAL_error_msg( "input error: ] expected" ); -if ( root < ROOT(0)) CGAL_error("input error: non-negative root expected"); +if ( root < ROOT(0)) CGAL_error_msg("input error: non-negative root expected"); if ( root == ROOT(0)) result = EXT(a0); diff --git a/Number_types/src/CGAL/MP_Float.cpp b/Number_types/src/CGAL/MP_Float.cpp index da6637d893d..8001d6bfbea 100644 --- a/Number_types/src/CGAL/MP_Float.cpp +++ b/Number_types/src/CGAL/MP_Float.cpp @@ -277,7 +277,7 @@ INTERN_MP_FLOAT::square(const MP_Float &a) if (tmp > 0 && tmp0 < 0 && tmp1 < 0) { // If my calculations are correct, this case should never happen. - CGAL_assertion(false); + CGAL_error(); } else if (tmp < 0 && tmp0 > 0 && tmp1 > 0) carry2 = 1; diff --git a/Number_types/test/Number_types/Interval_nt_new.cpp b/Number_types/test/Number_types/Interval_nt_new.cpp index fcf09a777a9..162da81cc5c 100644 --- a/Number_types/test/Number_types/Interval_nt_new.cpp +++ b/Number_types/test/Number_types/Interval_nt_new.cpp @@ -8,7 +8,7 @@ { \ bool b = false; \ try{(void) expr;}catch(error){ b = true;} \ - if(!b) CGAL_error( "Expr should throw expetion"); \ + if(!b) CGAL_error_msg( "Expr should throw expetion"); \ } namespace CGAL { diff --git a/Number_types/test/Number_types/include/CGAL/_test_real_embeddable.h b/Number_types/test/Number_types/include/CGAL/_test_real_embeddable.h index 64722aad5cf..64dd8616fb7 100644 --- a/Number_types/test/Number_types/include/CGAL/_test_real_embeddable.h +++ b/Number_types/test/Number_types/include/CGAL/_test_real_embeddable.h @@ -60,7 +60,7 @@ CGAL_BEGIN_NAMESPACE class Test_to_double { public: void operator() (CGAL::Null_functor) { - CGAL_error("To_double functor not implemented"); + CGAL_error_msg("To_double functor not implemented"); } }; @@ -110,7 +110,7 @@ CGAL_BEGIN_NAMESPACE class Test_to_interval< Type, CGAL::Null_tag> { public: void operator() (CGAL::Null_functor) { - CGAL_assertion_msg(false, "To_Interval not implemented"); + CGAL_error_msg( "To_Interval not implemented"); // ok, nothing to test } }; diff --git a/OpenNL/include/CGAL/OpenNL/bicgstab.h b/OpenNL/include/CGAL/OpenNL/bicgstab.h index 5ff4808c1ed..87cfbf57bb0 100644 --- a/OpenNL/include/CGAL/OpenNL/bicgstab.h +++ b/OpenNL/include/CGAL/OpenNL/bicgstab.h @@ -88,7 +88,7 @@ public: // Solve the sparse linear system "A*x = b". Return true on success. bool solve(const MATRIX &A, const VECTOR& b, VECTOR& x) { - assert (A.dimension() > 0); + CGAL_assertion(A.dimension() > 0); unsigned int n = A.dimension() ; // (Square) matrix dimension unsigned int max_iter = max_iter_ ; // Max number of iterations @@ -112,7 +112,7 @@ public: BLAS::copy(r,d); BLAS::copy(d,h); BLAS::copy(h,rT); - //assert( ! IsZero( BLAS::dot(rT,rT) ) ); + //CGAL_assertion( ! IsZero( BLAS::dot(rT,rT) ) ); rTh=BLAS::dot(rT,h); // rTh = (rT|h) rTr=BLAS::dot(r,r); // Current error rTr = (r|r) @@ -215,7 +215,7 @@ public: // Solve the sparse linear system "A*x = b". Return true on success. bool solve(const MATRIX &A, const PC_MATRIX &C, const VECTOR& b, VECTOR& x) { - assert(A.dimension() > 0); + CGAL_assertion(A.dimension() > 0); unsigned int n = A.dimension() ; // (Square) matrix dimension unsigned int max_iter = max_iter_ ; // Max number of iterations @@ -240,7 +240,7 @@ public: mult(C,r,d); BLAS::copy(d,h); BLAS::copy(h,rT); - //assert( ! IsZero( BLAS::dot(rT,rT) ) ); + //CGAL_assertion( ! IsZero( BLAS::dot(rT,rT) ) ); rTh=BLAS::dot(rT,h); // rTh = (rT|h) rTr=BLAS::dot(r,r); // Current error rTr = (r|r) diff --git a/OpenNL/include/CGAL/OpenNL/blas.h b/OpenNL/include/CGAL/OpenNL/blas.h index d8ef784149c..4b90ac7655b 100644 --- a/OpenNL/include/CGAL/OpenNL/blas.h +++ b/OpenNL/include/CGAL/OpenNL/blas.h @@ -1,11 +1,11 @@ /* * author: Bruno Levy, INRIA, project ALICE * website: http://www.loria.fr/~levy/software - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -28,12 +28,14 @@ * * Laurent Saboret 01/2005: Change for CGAL: * - Added OpenNL namespace - */ + * Andreas Meyer 2007 changes for CGAL: + * - replaced assert with CGAL_assertion/CGAL_error etc. +*/ #ifndef __OPENNL_BLAS__ #define __OPENNL_BLAS__ -#include +#include namespace OpenNL { @@ -43,25 +45,25 @@ template class BLAS { public: typedef VECTOR VectorType ; typedef typename VECTOR::CoeffType CoeffType ; - + /** y <- y + a*x */ static void axpy(CoeffType a, const VectorType& x, VectorType& y) { - assert(false) ; + CGAL_error(); } /** x <- a*x */ static void scal(CoeffType a, VectorType& x) { - assert(false) ; + CGAL_error(); } /** y = x */ static void copy(const VectorType& x, VectorType& y) { - assert(false) ; + CGAL_error(); } /** returns x^t * y */ static CoeffType dot(const VectorType& x, const VectorType& y) { - assert(false) ; + CGAL_error(); } } ; diff --git a/OpenNL/include/CGAL/OpenNL/conjugate_gradient.h b/OpenNL/include/CGAL/OpenNL/conjugate_gradient.h index 4cbc737efb9..2f60e3dacb0 100644 --- a/OpenNL/include/CGAL/OpenNL/conjugate_gradient.h +++ b/OpenNL/include/CGAL/OpenNL/conjugate_gradient.h @@ -89,7 +89,7 @@ public: // Return true on success bool solve(const MATRIX &A, const VECTOR& b, VECTOR& x) { - assert(A.dimension() > 0); + CGAL_assertion(A.dimension() > 0); unsigned int n = A.dimension() ; // (Square) matrix dimension unsigned int max_iter = max_iter_ ; // Max number of iterations @@ -205,7 +205,7 @@ public: // Return true on success bool solve(const MATRIX &A, const PC_MATRIX &C, const VECTOR& b, VECTOR& x) { - assert (A.dimension() > 0); + CGAL_assertion(A.dimension() > 0); unsigned int n = A.dimension() ; // (Square) matrix dimension unsigned int max_iter = max_iter_ ; // Max number of iterations @@ -231,7 +231,7 @@ public: CoeffType rr=BLAS::dot(r,r); // Current error rr = (r|r) while ( rr>err && its < max_iter) { mult(A,d,Ad); - assert( ! IsZero( BLAS::dot(d,Ad) ) ); + CGAL_assertion( ! IsZero( BLAS::dot(d,Ad) ) ); alpha=rh/BLAS::dot(d,Ad); BLAS::axpy(-alpha,d,x); BLAS::axpy(-alpha,Ad,r); diff --git a/OpenNL/include/CGAL/OpenNL/full_vector.h b/OpenNL/include/CGAL/OpenNL/full_vector.h index c62bc163575..6b3556b3f89 100644 --- a/OpenNL/include/CGAL/OpenNL/full_vector.h +++ b/OpenNL/include/CGAL/OpenNL/full_vector.h @@ -96,11 +96,11 @@ public: // Preconditions: // * 0 <= i < dimension() const T& operator[](unsigned int i) const { - assert(i < dimension_) ; + CGAL_assertion(i < dimension_) ; return coeff_[i] ; } T& operator[](unsigned int i) { - assert(i < dimension_) ; + CGAL_assertion(i < dimension_) ; return coeff_[i] ; } @@ -116,7 +116,7 @@ public: /** y <- y + a*x */ static void axpy(CoeffType a, const VectorType& x, VectorType& y) { - assert(x.dimension() == y.dimension()) ; + CGAL_assertion(x.dimension() == y.dimension()) ; for(unsigned int i=0; i #include -#include #include namespace OpenNL { @@ -72,11 +71,11 @@ public: typedef COEFFTYPE NT; typedef MATRIX Matrix ; typedef VECTOR Vector ; - + // Private types private: typedef Jacobi_Preconditioner Preconditioner ; - typedef Solver_preconditioned_BICGSTAB + typedef Solver_preconditioned_BICGSTAB Preconditioned_solver ; typedef Solver_BICGSTAB Solver ; @@ -93,12 +92,12 @@ public: bool linear_solver (const Matrix& A, const Vector& B, Vector& X, NT& D) { D = 1; // OpenNL does not support homogeneous coordinates - + // Solve using BICGSTAB solver with preconditioner Preconditioned_solver preconditioned_solver ; NT omega = 1.5; Preconditioner C(A, omega); - X = B; + X = B; if (preconditioned_solver.solve(A, C, B, X)) return true; @@ -108,7 +107,7 @@ public: << "Trying BICGSTAB." << std::endl; #endif Solver solver ; - X = B; + X = B; return solver.solve(A, B, X) ; } } ; @@ -133,11 +132,11 @@ public: typedef COEFFTYPE NT; typedef MATRIX Matrix ; typedef VECTOR Vector ; - + // Private types private: typedef Jacobi_Preconditioner Preconditioner ; - typedef Solver_preconditioned_CG + typedef Solver_preconditioned_CG Preconditioned_solver ; typedef Solver_CG Solver ; @@ -154,12 +153,12 @@ public: bool linear_solver (const Matrix& A, const Vector& B, Vector& X, NT& D) { D = 1; // OpenNL does not support homogeneous coordinates - + // Solve using Conjugate Gradient solver with preconditioner Preconditioned_solver preconditioned_solver ; NT omega = 1.5; Preconditioner C(A, omega); - X = B; + X = B; if (preconditioned_solver.solve(A, C, B, X)) return true; @@ -169,7 +168,7 @@ public: << "Trying Conjugate Gradient." << std::endl; #endif Solver solver ; - X = B; + X = B; return solver.solve(A, B, X) ; } }; @@ -203,7 +202,7 @@ public: void unlock() { locked_ = false ; } bool is_locked() const { return locked_ ; } unsigned int index() const { - assert(index_ != -1) ; + CGAL_assertion(index_ != -1) ; return (unsigned int)(index_) ; } void set_index(unsigned int index_in) { @@ -242,12 +241,12 @@ public: int nb_variables() const { return nb_variables_ ; } Variable& variable(unsigned int idx) { - assert(idx < nb_variables_) ; + CGAL_assertion(idx < nb_variables_) ; return variable_[idx] ; } const Variable& variable(unsigned int idx) const { - assert(idx < nb_variables_) ; + CGAL_assertion(idx < nb_variables_) ; return variable_[idx] ; } @@ -314,7 +313,7 @@ public: norm += al_[i] * al_[i] ; } norm = sqrt(norm) ; - assert( fabs(norm)>1e-40 ); + CGAL_assertion( fabs(norm)>1e-40 ); scale_row(weight / norm) ; } @@ -379,7 +378,7 @@ public: Traits solver_traits; CoeffType D; bool success = solver_traits.linear_solver(*A_, *b_, *x_, D) ; - assert(D == 1.0); // WARNING: this library does not support homogeneous coordinates! + CGAL_assertion(D == 1.0); // WARNING: this library does not support homogeneous coordinates! vector_to_variables() ; @@ -430,7 +429,7 @@ protected: return "solved" ; } // Should not go there. - assert(false) ; + CGAL_error(); return "undefined" ; } @@ -443,7 +442,7 @@ protected: << std::endl ; std::cerr << "exiting ..." << std::endl ; } - assert(state_ == s) ; + CGAL_assertion(state_ == s) ; } void transition(State from, State to) { diff --git a/OpenNL/include/CGAL/OpenNL/preconditioner.h b/OpenNL/include/CGAL/OpenNL/preconditioner.h index 5b02db23c2c..55e0953aa42 100644 --- a/OpenNL/include/CGAL/OpenNL/preconditioner.h +++ b/OpenNL/include/CGAL/OpenNL/preconditioner.h @@ -85,15 +85,15 @@ template Preconditioner::Preconditioner( const SparseMatrix& A, CoeffType omega ) : A_(A), omega_(omega) { - //assert(A.is_square()) ; + //CGAL_assertion(A.is_square()) ; } template void Preconditioner::mult_lower_inverse( const FullVector& x, FullVector& y ) const { - //assert(A_.has_symmetric_storage()) ; - //assert(A_.rows_are_stored()) ; + //CGAL_assertion(A_.has_symmetric_storage()) ; + //CGAL_assertion(A_.rows_are_stored()) ; int n = A_.dimension() ; for(int i=0; i void Preconditioner::mult_upper_inverse( const FullVector& x, FullVector& y ) const { - //assert(A_.has_symmetric_storage()) ; - //assert(A_.columns_are_stored()) ; + //CGAL_assertion(A_.has_symmetric_storage()) ; + //CGAL_assertion(A_.columns_are_stored()) ; int n = A_.dimension() ; for(int i=n-1; i>=0; i--) { double S = 0 ; diff --git a/OpenNL/include/CGAL/OpenNL/sparse_matrix.h b/OpenNL/include/CGAL/OpenNL/sparse_matrix.h index 96a16e6b989..82346c209e9 100644 --- a/OpenNL/include/CGAL/OpenNL/sparse_matrix.h +++ b/OpenNL/include/CGAL/OpenNL/sparse_matrix.h @@ -132,7 +132,7 @@ public: // Create a square matrix initialized with zeros SparseMatrix(unsigned int dim) { - assert(dim > 0); + CGAL_assertion(dim > 0); dimension_ = dim ; row_ = new Row[dimension_] ; } @@ -140,8 +140,8 @@ public: // (added for SparseLinearAlgebraTraits_d::Matrix concept) // WARNING: this class supports square matrices only SparseMatrix (unsigned int rows, unsigned int columns ) { - assert(rows == columns); - assert(columns > 0); + CGAL_assertion(rows == columns); + CGAL_assertion(columns > 0); dimension_ = columns ; row_ = new Row[dimension_] ; } @@ -163,12 +163,12 @@ public: unsigned int column_dimension() const { return dimension(); } Row& row(unsigned int i) { - assert(i < dimension_) ; + CGAL_assertion(i < dimension_) ; return row_[i] ; } const Row& row(unsigned int i) const { - assert(i < dimension_) ; + CGAL_assertion(i < dimension_) ; return row_[i] ; } @@ -179,8 +179,8 @@ public: // * 0 <= i < row_dimension() // * 0 <= j < column_dimension() NT get_coef (unsigned int i, unsigned int j) const { - assert(i < dimension_) ; - assert(j < dimension_) ; + CGAL_assertion(i < dimension_) ; + CGAL_assertion(j < dimension_) ; return row(i).get_coef(j) ; } @@ -190,8 +190,8 @@ public: // * 0 <= i < row_dimension() // * 0 <= j < column_dimension() void add_coef(unsigned int i, unsigned int j, T val) { - assert(i < dimension_) ; - assert(j < dimension_) ; + CGAL_assertion(i < dimension_) ; + CGAL_assertion(j < dimension_) ; row(i).add_coef(j, val) ; } @@ -202,8 +202,8 @@ public: // * 0 <= i < row_dimension() // * 0 <= j < column_dimension() void set_coef(unsigned int i, unsigned int j, NT val) { - assert(i < dimension_) ; - assert(j < dimension_) ; + CGAL_assertion(i < dimension_) ; + CGAL_assertion(j < dimension_) ; row(i).set_coef(j, val) ; } @@ -229,8 +229,8 @@ private: template void mult(const SparseMatrix& M, const FullVector& x, FullVector& y) { unsigned int N = M.dimension() ; - assert(x.dimension() == N) ; - assert(y.dimension() == N) ; + CGAL_assertion(x.dimension() == N) ; + CGAL_assertion(y.dimension() == N) ; for(unsigned int i=0; i::Row& R = M.row(i) ; diff --git a/PDB/include/CGAL/PDB/Matrix.h b/PDB/include/CGAL/PDB/Matrix.h index 2b4d61bb8fe..cf55d161825 100644 --- a/PDB/include/CGAL/PDB/Matrix.h +++ b/PDB/include/CGAL/PDB/Matrix.h @@ -8,8 +8,8 @@ CGAL_PDB_BEGIN_NAMESPACE typedef TNT::Array2D Matrix; double det(const Matrix& m) { - assert(m.dim1() == 3); - assert(m.dim2() == 3); + CGAL_assertion(m.dim1() == 3); + CGAL_assertion(m.dim2() == 3); return (m[0][0]*(m[1][1]*m[2][2] - m[1][2]*m[2][1]) - m[0][1]*(m[1][0]*m[2][2] - m[1][2]*m[2][0]) + diff --git a/PDB/include/CGAL/PDB/Quaternion.h b/PDB/include/CGAL/PDB/Quaternion.h index dcd6c794749..5ed53f48f86 100644 --- a/PDB/include/CGAL/PDB/Quaternion.h +++ b/PDB/include/CGAL/PDB/Quaternion.h @@ -48,8 +48,8 @@ public: q_[1]= sf*axis[0]/n; q_[2]= sf*axis[1]/n; q_[3]= sf*axis[2]/n; - assert(q_[0]*q_[0]+ q_[1]*q_[1] + q_[2]*q_[2] + q_[3]*q_[3] < 1.1); - assert(q_[0]*q_[0]+ q_[1]*q_[1] + q_[2]*q_[2] + q_[3]*q_[3] > 0.9); + CGAL_assertion(q_[0]*q_[0]+ q_[1]*q_[1] + q_[2]*q_[2] + q_[3]*q_[3] < 1.1); + CGAL_assertion(q_[0]*q_[0]+ q_[1]*q_[1] + q_[2]*q_[2] + q_[3]*q_[3] > 0.9); } template @@ -63,12 +63,12 @@ public: Quaternion(Transform t); NT& operator[](unsigned int i) { - assert(i<4); + CGAL_assertion(i<4); return q_[i]; } NT operator[](unsigned int i) const { - assert(i<4); + CGAL_assertion(i<4); return q_[i]; } diff --git a/PDB/include/CGAL/PDB/align.h b/PDB/include/CGAL/PDB/align.h index b782a933d19..c8b65d6c360 100644 --- a/PDB/include/CGAL/PDB/align.h +++ b/PDB/include/CGAL/PDB/align.h @@ -67,7 +67,7 @@ Transform transform_taking_first_to_second(ItA pBegin, } center_q = center_q/num_q; - assert(num_p == num_q); + CGAL_assertion(num_p == num_q); std::vector p_shifted, q_shifted; p_shifted.reserve(num_p); diff --git a/PDB/include/CGAL/PDB/internal/align_points.out.h b/PDB/include/CGAL/PDB/internal/align_points.out.h index f16e8ad1c0b..d0f0acf087e 100644 --- a/PDB/include/CGAL/PDB/internal/align_points.out.h +++ b/PDB/include/CGAL/PDB/internal/align_points.out.h @@ -16,8 +16,8 @@ CGAL_PDB_BEGIN_INTERNAL_NAMESPACE template T det(const CGAL_TNT_NS::Array2D& m) { - assert(m.dim1() == 3); - assert(m.dim2() == 3); + CGAL_assertion(m.dim1() == 3); + CGAL_assertion(m.dim2() == 3); return (m[0][0]*(m[1][1]*m[2][2] - m[1][2]*m[2][1]) - m[0][1]*(m[1][0]*m[2][2] - m[1][2]*m[2][0]) + @@ -62,7 +62,7 @@ CGAL_PDB_BEGIN_INTERNAL_NAMESPACE } center_q = center_q/num_q; - assert(num_p == num_q); + CGAL_assertion(num_p == num_q); std::vector p_shifted, q_shifted; p_shifted.reserve(num_p); @@ -190,7 +190,7 @@ CGAL_PDB_BEGIN_INTERNAL_NAMESPACE best_j=0; } else if (v_i >= v_j){ dp_matrix[i][j] = DpP(ss+v_i, best_i[j-1]); - assert(v_i > v_d); + CGAL_assertion(v_i > v_d); if (v_d >= v_j) best_j=0; } else { dp_matrix[i][j] = DpP(ss+v_j, -best_j); @@ -200,16 +200,16 @@ CGAL_PDB_BEGIN_INTERNAL_NAMESPACE const double eps=.00001; for (unsigned int k=0; k< i; ++k){ - assert(dp_matrix[i-k-1][j-1].first -gap_cost*k +ss <= dp_matrix[i][j].first + eps); + CGAL_assertion(dp_matrix[i-k-1][j-1].first -gap_cost*k +ss <= dp_matrix[i][j].first + eps); if (dp_matrix[i][j].second == static_cast(k)) { - assert(std::abs(dp_matrix[i-k-1][j-1].first - gap_cost*k + ss - dp_matrix[i][j].first) < eps); + CGAL_assertion(std::abs(dp_matrix[i-k-1][j-1].first - gap_cost*k + ss - dp_matrix[i][j].first) < eps); } } for (unsigned int k=0; k< j; ++k){ - assert(dp_matrix[i-1][j-k-1].first -gap_cost*k + ss <= dp_matrix[i][j].first + eps); + CGAL_assertion(dp_matrix[i-1][j-k-1].first -gap_cost*k + ss <= dp_matrix[i][j].first + eps); if (dp_matrix[i][j].second == -static_cast(k)) { - assert( std::abs(ss - gap_cost*k + dp_matrix[i-1][j-k-1].first - dp_matrix[i][j].first) < eps); + CGAL_assertion( std::abs(ss - gap_cost*k + dp_matrix[i-1][j-k-1].first - dp_matrix[i][j].first) < eps); } } @@ -244,10 +244,10 @@ CGAL_PDB_BEGIN_INTERNAL_NAMESPACE --j; if (i==0 || j==0) break; - assert(c_m != b_m); + CGAL_assertion(c_m != b_m); --c_m; - assert(j < d_1+1); - assert(i < d_0+1); + CGAL_assertion(j < d_1+1); + CGAL_assertion(i < d_0+1); *c_m=j-1; //std::cout << i << " " << j << std::endl; } diff --git a/PDB/include/CGAL/PDB/internal/tnt/tnt_array1d.h b/PDB/include/CGAL/PDB/internal/tnt/tnt_array1d.h index 0f3a2bbaa59..7c3fa3203ef 100644 --- a/PDB/include/CGAL/PDB/internal/tnt/tnt_array1d.h +++ b/PDB/include/CGAL/PDB/internal/tnt/tnt_array1d.h @@ -141,8 +141,8 @@ template inline T& Array1D::operator[](int i) { #ifdef TNT_BOUNDS_CHECK - assert(i>= 0); - assert(i < n_); + CGAL_assertion(i>= 0); + CGAL_assertion(i < n_); #endif return data_[i]; } @@ -151,8 +151,8 @@ template inline const T& Array1D::operator[](int i) const { #ifdef TNT_BOUNDS_CHECK - assert(i>= 0); - assert(i < n_); + CGAL_assertion(i>= 0); + CGAL_assertion(i < n_); #endif return data_[i]; } diff --git a/PDB/include/CGAL/PDB/internal/tnt/tnt_array2d.h b/PDB/include/CGAL/PDB/internal/tnt/tnt_array2d.h index 53f5c19526d..b2bc98ae61c 100644 --- a/PDB/include/CGAL/PDB/internal/tnt/tnt_array2d.h +++ b/PDB/include/CGAL/PDB/internal/tnt/tnt_array2d.h @@ -138,8 +138,8 @@ template inline T* Array2D::operator[](int i) { #ifdef CGAL_TNT_BOUNDS_CHECK - assert(i >= 0); - assert(i < m_); + CGAL_assertion(i >= 0); + CGAL_assertion(i < m_); #endif return v_[i]; @@ -151,8 +151,8 @@ template inline const T* Array2D::operator[](int i) const { #ifdef CGAL_TNT_BOUNDS_CHECK - assert(i >= 0); - assert(i < m_); + CGAL_assertion(i >= 0); + CGAL_assertion(i < m_); #endif return v_[i]; diff --git a/PDB/include/CGAL/PDB/internal/tnt/tnt_cmat.h b/PDB/include/CGAL/PDB/internal/tnt/tnt_cmat.h index 9dc406db759..28aec05c7ea 100644 --- a/PDB/include/CGAL/PDB/internal/tnt/tnt_cmat.h +++ b/PDB/include/CGAL/PDB/internal/tnt/tnt_cmat.h @@ -76,9 +76,9 @@ class Matrix row_ = new T*[M]; rowm1_ = new T*[M]; - assert(v_ != NULL); - assert(row_ != NULL); - assert(rowm1_ != NULL); + CGAL_assertion(v_ != NULL); + CGAL_assertion(row_ != NULL); + CGAL_assertion(rowm1_ != NULL); T* p = v_; vm1_ = v_ - 1; @@ -260,8 +260,8 @@ class Matrix Subscript dim(Subscript d) const { #ifdef CGAL_TNT_BOUNDS_CHECK - assert( d >= 1); - assert( d <= 2); + CGAL_assertion( d >= 1); + CGAL_assertion( d <= 2); #endif return (d==1) ? m_ : ((d==2) ? n_ : 0); } @@ -275,8 +275,8 @@ class Matrix inline T* operator[](Subscript i) { #ifdef CGAL_TNT_BOUNDS_CHECK - assert(0<=i); - assert(i < m_) ; + CGAL_assertion(0<=i); + CGAL_assertion(i < m_) ; #endif return row_[i]; } @@ -284,8 +284,8 @@ class Matrix inline const T* operator[](Subscript i) const { #ifdef CGAL_TNT_BOUNDS_CHECK - assert(0<=i); - assert(i < m_) ; + CGAL_assertion(0<=i); + CGAL_assertion(i < m_) ; #endif return row_[i]; } @@ -293,8 +293,8 @@ class Matrix inline reference operator()(Subscript i) { #ifdef CGAL_TNT_BOUNDS_CHECK - assert(1<=i); - assert(i <= mn_) ; + CGAL_assertion(1<=i); + CGAL_assertion(i <= mn_) ; #endif return vm1_[i]; } @@ -302,8 +302,8 @@ class Matrix inline const_reference operator()(Subscript i) const { #ifdef CGAL_TNT_BOUNDS_CHECK - assert(1<=i); - assert(i <= mn_) ; + CGAL_assertion(1<=i); + CGAL_assertion(i <= mn_) ; #endif return vm1_[i]; } @@ -313,10 +313,10 @@ class Matrix inline reference operator()(Subscript i, Subscript j) { #ifdef CGAL_TNT_BOUNDS_CHECK - assert(1<=i); - assert(i <= m_) ; - assert(1<=j); - assert(j <= n_); + CGAL_assertion(1<=i); + CGAL_assertion(i <= m_) ; + CGAL_assertion(1<=j); + CGAL_assertion(j <= n_); #endif return rowm1_[i][j]; } @@ -326,10 +326,10 @@ class Matrix inline const_reference operator() (Subscript i, Subscript j) const { #ifdef CGAL_TNT_BOUNDS_CHECK - assert(1<=i); - assert(i <= m_) ; - assert(1<=j); - assert(j <= n_); + CGAL_assertion(1<=i); + CGAL_assertion(i <= m_) ; + CGAL_assertion(1<=j); + CGAL_assertion(j <= n_); #endif return rowm1_[i][j]; } @@ -397,8 +397,8 @@ Matrix operator+(const Matrix &A, Subscript M = A.num_rows(); Subscript N = A.num_cols(); - assert(M==B.num_rows()); - assert(N==B.num_cols()); + CGAL_assertion(M==B.num_rows()); + CGAL_assertion(N==B.num_cols()); Matrix tmp(M,N); Subscript i,j; @@ -417,8 +417,8 @@ Matrix operator-(const Matrix &A, Subscript M = A.num_rows(); Subscript N = A.num_cols(); - assert(M==B.num_rows()); - assert(N==B.num_cols()); + CGAL_assertion(M==B.num_rows()); + CGAL_assertion(N==B.num_cols()); Matrix tmp(M,N); Subscript i,j; @@ -437,8 +437,8 @@ Matrix mult_element(const Matrix &A, Subscript M = A.num_rows(); Subscript N = A.num_cols(); - assert(M==B.num_rows()); - assert(N==B.num_cols()); + CGAL_assertion(M==B.num_rows()); + CGAL_assertion(N==B.num_cols()); Matrix tmp(M,N); Subscript i,j; @@ -475,7 +475,7 @@ inline Matrix matmult(const Matrix &A, { #ifdef TNT_BOUNDS_CHECK - assert(A.num_cols() == B.num_rows()); + CGAL_assertion(A.num_cols() == B.num_rows()); #endif Subscript M = A.num_rows(); @@ -510,7 +510,7 @@ inline int matmult(Matrix& C, const Matrix &A, const Matrix &B) { - assert(A.num_cols() == B.num_rows()); + CGAL_assertion(A.num_cols() == B.num_rows()); Subscript M = A.num_rows(); Subscript N = A.num_cols(); @@ -547,7 +547,7 @@ Vector matmult(const Matrix &A, const Vector &x) { #ifdef TNT_BOUNDS_CHECK - assert(A.num_cols() == x.dim()); + CGAL_assertion(A.num_cols() == x.dim()); #endif Subscript M = A.num_rows(); diff --git a/PDB/include/CGAL/PDB/internal/tnt/tnt_vec.h b/PDB/include/CGAL/PDB/internal/tnt/tnt_vec.h index 69a946a6849..ea4224b30d1 100644 --- a/PDB/include/CGAL/PDB/internal/tnt/tnt_vec.h +++ b/PDB/include/CGAL/PDB/internal/tnt/tnt_vec.h @@ -69,9 +69,9 @@ class Vector // adjust pointers so that they are 1-offset: // v_[] is the internal contiguous array, it is still 0-offset // - assert(v_ == NULL); + CGAL_assertion(v_ == NULL); v_ = new T[N]; - assert(v_ != NULL); + CGAL_assertion(v_ != NULL); vm1_ = v_-1; n_ = N; } @@ -247,8 +247,8 @@ class Vector inline reference operator()(Subscript i) { #ifdef TNT_BOUNDS_CHECK - assert(1<=i); - assert(i <= n_) ; + CGAL_assertion(1<=i); + CGAL_assertion(i <= n_) ; #endif return vm1_[i]; } @@ -256,8 +256,8 @@ class Vector inline const_reference operator() (Subscript i) const { #ifdef TNT_BOUNDS_CHECK - assert(1<=i); - assert(i <= n_) ; + CGAL_assertion(1<=i); + CGAL_assertion(i <= n_) ; #endif return vm1_[i]; } @@ -265,8 +265,8 @@ class Vector inline reference operator[](Subscript i) { #ifdef TNT_BOUNDS_CHECK - assert(0<=i); - assert(i < n_) ; + CGAL_assertion(0<=i); + CGAL_assertion(i < n_) ; #endif return v_[i]; } @@ -274,14 +274,14 @@ class Vector inline const_reference operator[](Subscript i) const { #ifdef TNT_BOUNDS_CHECK - assert(0<=i); + CGAL_assertion(0<=i); - assert(i < n_) ; + CGAL_assertion(i < n_) ; #endif return v_[i]; } @@ -337,7 +337,7 @@ Vector operator+(const Vector &A, { Subscript N = A.dim(); - assert(N==B.dim()); + CGAL_assertion(N==B.dim()); Vector tmp(N); Subscript i; @@ -354,7 +354,7 @@ Vector operator-(const Vector &A, { Subscript N = A.dim(); - assert(N==B.dim()); + CGAL_assertion(N==B.dim()); Vector tmp(N); Subscript i; @@ -371,7 +371,7 @@ Vector operator*(const Vector &A, { Subscript N = A.dim(); - assert(N==B.dim()); + CGAL_assertion(N==B.dim()); Vector tmp(N); Subscript i; @@ -387,7 +387,7 @@ template T dot_prod(const Vector &A, const Vector &B) { Subscript N = A.dim(); - assert(N == B.dim()); + CGAL_assertion(N == B.dim()); Subscript i; T sum = 0; diff --git a/Polynomial/include/CGAL/Polynomial/polynomial_gcd.h b/Polynomial/include/CGAL/Polynomial/polynomial_gcd.h index f63d5a533b9..f5f067f530a 100644 --- a/Polynomial/include/CGAL/Polynomial/polynomial_gcd.h +++ b/Polynomial/include/CGAL/Polynomial/polynomial_gcd.h @@ -570,7 +570,7 @@ Polynomial gcdex_( // handle trivial cases if (x.is_zero()) { - if (y.is_zero()) CGAL_error("gcdex(0,0) is undefined"); + if (y.is_zero()) CGAL_error_msg("gcdex(0,0) is undefined"); xf = NT(0); yf = idiv(NT(1), y.unit_part()); return yf * y; } @@ -749,7 +749,7 @@ Polynomial pseudo_gcdex( // handle trivial cases if (x.is_zero()) { - if (y.is_zero()) CGAL_error("gcdex(0,0) is undefined"); + if (y.is_zero()) CGAL_error_msg("gcdex(0,0) is undefined"); xf = NT(0); yf = NT(1); vf = y.unit_part(); return y / vf; } diff --git a/Principal_component_analysis/demo/Principal_component_analysis/windows/2d/pca.h b/Principal_component_analysis/demo/Principal_component_analysis/windows/2d/pca.h index ecf696a2a0f..5400c3712e2 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/windows/2d/pca.h +++ b/Principal_component_analysis/demo/Principal_component_analysis/windows/2d/pca.h @@ -28,4 +28,4 @@ public: DECLARE_MESSAGE_MAP() }; -extern CpcaApp theApp; \ No newline at end of file +extern CpcaApp theApp; diff --git a/Principal_component_analysis/demo/Principal_component_analysis/windows/3d/Mesh.h b/Principal_component_analysis/demo/Principal_component_analysis/windows/3d/Mesh.h index e4d314bf659..5d97a0ef737 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/windows/3d/Mesh.h +++ b/Principal_component_analysis/demo/Principal_component_analysis/windows/3d/Mesh.h @@ -29,4 +29,4 @@ public: afx_msg void OnUpdateCameraPasteviewpoint(CCmdUI *pCmdUI); }; -extern CMeshApp theApp; \ No newline at end of file +extern CMeshApp theApp; diff --git a/Qt_widget/include/CGAL/IO/Qt_widget_get_simple_polygon.h b/Qt_widget/include/CGAL/IO/Qt_widget_get_simple_polygon.h index 23e6d0e8b2b..f3bd1fe7bad 100644 --- a/Qt_widget/include/CGAL/IO/Qt_widget_get_simple_polygon.h +++ b/Qt_widget/include/CGAL/IO/Qt_widget_get_simple_polygon.h @@ -52,7 +52,7 @@ protected: if(!this->poly.is_simple()) return; if(this->poly.is_clockwise_oriented()) this->poly.reverse_orientation (); - assert( ! this->poly.is_clockwise_oriented()); + CGAL_assertion( ! this->poly.is_clockwise_oriented()); } } Get_polygon::mousePressEvent(e); diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index 3861c31b840..61f25ca04ce 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -296,7 +296,8 @@ void warning_fail( const char*, const char*, int, const char* = ""); #endif // CGAL_KERNEL_NO_WARNINGS // CGAL error -#define CGAL_error(MSG) ::CGAL::assertion_fail( "", __FILE__, __LINE__, MSG ) +#define CGAL_error_msg(MSG) ::CGAL::assertion_fail( "", __FILE__, __LINE__, MSG ) +#define CGAL_error() ::CGAL::assertion_fail( "", __FILE__, __LINE__ ) // failure handler declarations // ========================== diff --git a/STL_Extension/include/CGAL/exceptions.h b/STL_Extension/include/CGAL/exceptions.h index 9aa48b0c8fa..7d66b26fe82 100644 --- a/STL_Extension/include/CGAL/exceptions.h +++ b/STL_Extension/include/CGAL/exceptions.h @@ -57,7 +57,7 @@ CGAL_BEGIN_NAMESPACE should not cost too much runtime overhead, maybe 10%. \see \c CGAL_test for checks that cannot be disabled and - \c CGAL_error for an unconditional error message that cannot + \c CGAL_error_msg for an unconditional error message that cannot be disabled with macros. */ //@{ @@ -112,7 +112,7 @@ public: std::string message() const { return m_msg; } }; -//! Exception thrown for \c CGAL_error. +//! Exception thrown for \c CGAL_error_msg. class Error_exception : public Failure_exception { public: Error_exception( std::string lib, diff --git a/Segment_Delaunay_graph_2/demo/Segment_Delaunay_graph_2/include/pdg_insert.h b/Segment_Delaunay_graph_2/demo/Segment_Delaunay_graph_2/include/pdg_insert.h index 8a26c91b3ba..b03d31a315d 100644 --- a/Segment_Delaunay_graph_2/demo/Segment_Delaunay_graph_2/include/pdg_insert.h +++ b/Segment_Delaunay_graph_2/demo/Segment_Delaunay_graph_2/include/pdg_insert.h @@ -27,7 +27,7 @@ int get_new_id() static int gen = 0; gen++; - assert( gen != 0 ); // guards against unwanted phenomena due to + CGAL_assertion( gen != 0 ); // guards against unwanted phenomena due to // overflow return gen; } diff --git a/Segment_Delaunay_graph_2/new_stuff/Segment_Delaunay_graph_2/Red_blue_info.h b/Segment_Delaunay_graph_2/new_stuff/Segment_Delaunay_graph_2/Red_blue_info.h index 42ecf2e96f7..5f08624f13b 100644 --- a/Segment_Delaunay_graph_2/new_stuff/Segment_Delaunay_graph_2/Red_blue_info.h +++ b/Segment_Delaunay_graph_2/new_stuff/Segment_Delaunay_graph_2/Red_blue_info.h @@ -20,7 +20,7 @@ operator<<(std::ostream& os, const Red_blue& rb) else if ( rb == PURPLE ) { os << "Purple"; } else { std::cerr << "INFO: " << static_cast(rb) << std::endl; - CGAL_assertion(false); + CGAL_error(); } return os; } diff --git a/Skin_surface_3/include/CGAL/Compute_anchor_3.h b/Skin_surface_3/include/CGAL/Compute_anchor_3.h index d7ef6ee2a70..e00a450a131 100644 --- a/Skin_surface_3/include/CGAL/Compute_anchor_3.h +++ b/Skin_surface_3/include/CGAL/Compute_anchor_3.h @@ -78,7 +78,7 @@ public: Cell_handle ch = s; return anchor_del(ch); } - CGAL_assertion(false); + CGAL_error(); return Simplex(); } Simplex anchor_vor( const Vertex_handle v ) { @@ -191,7 +191,7 @@ private: wp2 = ch->vertex((f.second+2)&3)->point(); break; default: - CGAL_assertion(false); + CGAL_error(); } return @@ -394,7 +394,7 @@ compute_anchor_vor (Vertex_handle const v) { } else if (side == ZERO) { Edge e; if (!reg.is_edge (v, *adj_vertex, e.first, e.second, e.third)) { - CGAL_assertion(false); + CGAL_error(); } equiv_anchors.push_back(Simplex(e)); } @@ -407,7 +407,7 @@ compute_anchor_vor (Vertex_handle const v) { adj_vertex--; Edge e; if (!reg.is_edge(v, *adj_vertex, e.first, e.second, e.third)) { - CGAL_assertion(false); + CGAL_error(); } s = anchor_vor(e); Simplex tmp; @@ -449,7 +449,7 @@ compute_anchor_vor (Vertex_handle const v) { if (side==ZERO) { Edge e2; if (!reg.is_edge(v, *adj_vertex, e2.first, e2.second, e2.third)) { - CGAL_assertion(false); + CGAL_error(); } equiv_anchors.push_back(e2); } diff --git a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h index f2f35769047..eef24a54cf9 100644 --- a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h +++ b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h @@ -455,7 +455,7 @@ intersect_with_transversal_segment( tet_pts[sortedV[3]]), Line(p1, p)); if ( !assign(p2, obj) ) { - CGAL_assertion_msg(false,"intersection: no intersection."); + CGAL_error_msg("intersection: no intersection."); } } else if (nIn==2) { obj = CGAL::intersection(Plane(tet_pts[sortedV[2]], @@ -464,7 +464,7 @@ intersect_with_transversal_segment( Line(tet_pts[sortedV[0]], tet_pts[sortedV[1]])); if ( !assign(p1, obj) ) { - CGAL_assertion_msg(false,"intersection: no intersection."); + CGAL_error_msg("intersection: no intersection."); } obj = CGAL::intersection(Plane(tet_pts[sortedV[0]], tet_pts[sortedV[1]], @@ -472,7 +472,7 @@ intersect_with_transversal_segment( Line(tet_pts[sortedV[2]], tet_pts[sortedV[3]])); if ( !assign(p2, obj) ) { - CGAL_assertion_msg(false,"intersection: no intersection."); + CGAL_error_msg("intersection: no intersection."); } } else if (nIn==3) { p2 = tet_pts[sortedV[3]]; @@ -481,10 +481,10 @@ intersect_with_transversal_segment( tet_pts[sortedV[2]]), Line(p2, p)); if ( !assign(p1, obj) ) { - CGAL_assertion_msg(false,"intersection: no intersection."); + CGAL_error_msg("intersection: no intersection."); } } else { - CGAL_assertion(false); + CGAL_error(); } // Find the intersection: @@ -604,7 +604,7 @@ construct_surface(const Simplex &sim, const Traits &) const { return Quadratic_surface(p0,p1,p2,p3, shrink_factor()); } } - CGAL_assertion(false); + CGAL_error(); return Quadratic_surface(); } @@ -792,7 +792,7 @@ get_weighted_circumcenter(const Simplex &s, Gt2 &traits) { } default: { - CGAL_assertion(false); + CGAL_error(); } } return result; diff --git a/Skin_surface_3/include/CGAL/Triangulation_incremental_builder_3.h b/Skin_surface_3/include/CGAL/Triangulation_incremental_builder_3.h index f35a1b8dd57..025c2520aa2 100644 --- a/Skin_surface_3/include/CGAL/Triangulation_incremental_builder_3.h +++ b/Skin_surface_3/include/CGAL/Triangulation_incremental_builder_3.h @@ -52,7 +52,7 @@ public: void end_triangulation() { construct_infinite_cells(); - assert(t.infinite_vertex()->cell() != Cell_handle()); + CGAL_assertion(t.infinite_vertex()->cell() != Cell_handle()); } Vertex_handle add_vertex(); @@ -115,10 +115,10 @@ typename Triangulation_incremental_builder_3< TDS_ >::Cell_handle Triangulation_incremental_builder_3< TDS_ >::add_cell( Vertex_handle vh0, Vertex_handle vh1, Vertex_handle vh2, Vertex_handle vh3) { - assert(vh0 != NULL); assert(vh1 != NULL); - assert(vh2 != NULL); assert(vh3 != NULL); - assert(vh0 != vh1); assert(vh0 != vh2); assert(vh0 != vh3); - assert(vh1 != vh2); assert(vh1 != vh3); assert(vh2 != vh3); + CGAL_assertion(vh0 != NULL); CGAL_assertion(vh1 != NULL); + CGAL_assertion(vh2 != NULL); CGAL_assertion(vh3 != NULL); + CGAL_assertion(vh0 != vh1); CGAL_assertion(vh0 != vh2); CGAL_assertion(vh0 != vh3); + CGAL_assertion(vh1 != vh2); CGAL_assertion(vh1 != vh3); CGAL_assertion(vh2 != vh3); Cell_handle ch = t.tds().create_cell(vh0, vh1, vh2, vh3); // Neighbors are by default set to NULL @@ -136,11 +136,11 @@ Triangulation_incremental_builder_3< TDS_ >::add_cell( Facet f = (*neighbIt).second; glue_cells(f.first, f.second, ch, i); facets.erase(neighbIt); - assert(f.first->neighbor(f.second) != NULL); - assert(ch->neighbor(i) != NULL); + CGAL_assertion(f.first->neighbor(f.second) != NULL); + CGAL_assertion(ch->neighbor(i) != NULL); } else { facets[vtriple] = Facet(ch, i); - assert(ch->neighbor(i) == NULL); + CGAL_assertion(ch->neighbor(i) == NULL); } } @@ -152,7 +152,7 @@ typename Triangulation_incremental_builder_3< TDS_ >::Cell_handle Triangulation_incremental_builder_3< TDS_ >::add_infinite_cell( Cell_handle ch0, int i) { - assert(ch0->neighbor(i) == NULL); + CGAL_assertion(ch0->neighbor(i) == NULL); Vertex_handle vh[4]; vh[i] = t.infinite_vertex(); vh[(i+1)&3] = ch0->vertex((i+1)&3); @@ -172,21 +172,21 @@ void Triangulation_incremental_builder_3< TDS_ >::glue_cells( Cell_handle ch0, int ind0, Cell_handle ch1, int ind1) { - assert(ch0->has_vertex(ch1->vertex((ind1+1)&3))); - assert(ch0->has_vertex(ch1->vertex((ind1+2)&3))); - assert(ch0->has_vertex(ch1->vertex((ind1+3)&3))); + CGAL_assertion(ch0->has_vertex(ch1->vertex((ind1+1)&3))); + CGAL_assertion(ch0->has_vertex(ch1->vertex((ind1+2)&3))); + CGAL_assertion(ch0->has_vertex(ch1->vertex((ind1+3)&3))); - assert(ch1->has_vertex(ch0->vertex((ind0+1)&3))); - assert(ch1->has_vertex(ch0->vertex((ind0+2)&3))); - assert(ch1->has_vertex(ch0->vertex((ind0+3)&3))); + CGAL_assertion(ch1->has_vertex(ch0->vertex((ind0+1)&3))); + CGAL_assertion(ch1->has_vertex(ch0->vertex((ind0+2)&3))); + CGAL_assertion(ch1->has_vertex(ch0->vertex((ind0+3)&3))); - assert(ch0->index(ch1->vertex((ind1+1)&3)) != ind0); - assert(ch0->index(ch1->vertex((ind1+2)&3)) != ind0); - assert(ch0->index(ch1->vertex((ind1+3)&3)) != ind0); + CGAL_assertion(ch0->index(ch1->vertex((ind1+1)&3)) != ind0); + CGAL_assertion(ch0->index(ch1->vertex((ind1+2)&3)) != ind0); + CGAL_assertion(ch0->index(ch1->vertex((ind1+3)&3)) != ind0); - assert(ch1->index(ch0->vertex((ind0+1)&3)) != ind1); - assert(ch1->index(ch0->vertex((ind0+2)&3)) != ind1); - assert(ch1->index(ch0->vertex((ind0+3)&3)) != ind1); + CGAL_assertion(ch1->index(ch0->vertex((ind0+1)&3)) != ind1); + CGAL_assertion(ch1->index(ch0->vertex((ind0+2)&3)) != ind1); + CGAL_assertion(ch1->index(ch0->vertex((ind0+3)&3)) != ind1); ch0->set_neighbor(ind0, ch1); ch1->set_neighbor(ind1, ch0); @@ -209,8 +209,8 @@ Triangulation_incremental_builder_3< TDS_ >::construct_infinite_cells() { int ind0 = ch_facet.second; Cell_handle ch1 = add_infinite_cell(ch0, ind0); // Index of ch1 is also ind0 - assert(ch0->neighbor(ind0) != NULL); - assert(ch1->neighbor(ind0) != NULL); + CGAL_assertion(ch0->neighbor(ind0) != NULL); + CGAL_assertion(ch1->neighbor(ind0) != NULL); for (int i=1; i<4; i++) { int i1 = (i==1?2:1); @@ -227,15 +227,15 @@ Triangulation_incremental_builder_3< TDS_ >::construct_infinite_cells() { Facet f_opp = (*ch_edge_it).second; glue_cells(f_opp.first, f_opp.second, ch1, (ind0+i)&3); ch_edges.erase(ch_edge_it); - assert(f_opp.first->neighbor(f_opp.second) != NULL); - assert(ch1->neighbor((ind0+i)&3) != NULL); + CGAL_assertion(f_opp.first->neighbor(f_opp.second) != NULL); + CGAL_assertion(ch1->neighbor((ind0+i)&3) != NULL); } else { ch_edges[Vpair(vh1,vh2)] = Facet(ch1, (ind0+i)&3); - assert(ch1->neighbor((ind0+i)&3) == NULL); + CGAL_assertion(ch1->neighbor((ind0+i)&3) == NULL); } } } - assert(ch_edges.empty()); + CGAL_assertion(ch_edges.empty()); } CGAL_END_NAMESPACE diff --git a/Skin_surface_3/include/CGAL/Voronoi_triangulator_3.h b/Skin_surface_3/include/CGAL/Voronoi_triangulator_3.h index 7cb64f9eca9..37d8454d25e 100644 --- a/Skin_surface_3/include/CGAL/Voronoi_triangulator_3.h +++ b/Skin_surface_3/include/CGAL/Voronoi_triangulator_3.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Nico Kruithof @@ -66,11 +66,11 @@ public: typedef typename Mesh_K::RT Mesh_RT; typedef typename Mesh_K::Point_3 Mesh_Point; typedef Weighted_point Mesh_Weighted_point; - + typedef typename Skin_traits_3::R2P_converter R2P_converter; typedef typename Skin_traits_3::T2P_converter T2P_converter; - Voronoi_triangulator_visitor_default() + Voronoi_triangulator_visitor_default() : r2p_converter(SkinSurfaceTraits_3().r2p_converter_object()) { } @@ -82,7 +82,7 @@ public: vh->sVor = sVor; } - void after_cell_insertion(Rt_Simplex &s, TVD_Cell_handle &ch) + void after_cell_insertion(Rt_Simplex &s, TVD_Cell_handle &ch) { CGAL_assertion(s.dimension() == 0); Rt_Vertex_handle vh = s; @@ -96,13 +96,13 @@ public: Rt_Vertex_handle vh_old; QuadrSurface *surf; - + R2P_converter r2p_converter; }; -template < +template < class SkinSurfaceTraits_3, - class VoronoiTriangulatorVisitor_ = + class VoronoiTriangulatorVisitor_ = Voronoi_triangulator_visitor_default > class Voronoi_triangulator_3 { public: @@ -117,13 +117,13 @@ private: typedef typename Regular::Edge Rt_Edge; typedef typename Regular::Facet Rt_Facet; typedef typename Regular::Cell_handle Rt_Cell_handle; - + typedef typename Regular::Finite_vertices_iterator Rt_Finite_vertices_iterator; typedef typename Regular::Finite_edges_iterator Rt_Finite_edges_iterator; typedef typename Regular::Finite_facets_iterator Rt_Finite_facets_iterator; typedef typename Regular::All_cells_iterator Rt_All_cells_iterator; typedef typename Regular::Finite_cells_iterator Rt_Finite_cells_iterator; - + typedef typename Regular::Cell_circulator Rt_Cell_circulator; typedef Simplex_3 Rt_Simplex; @@ -143,7 +143,7 @@ private: typedef typename Simplicial::All_cells_iterator TVD_All_cells_iterator; typedef typename Simplicial::Finite_cells_iterator TVD_Finite_cells_iterator; typedef typename Simplicial::Cell_circulator TVD_Cell_circulator; - + typedef typename Skin_traits_3::Triangulated_mixed_complex_kernel TVD_Geom_traits; typedef typename TVD_Geom_traits::Point_3 TVD_Point; typedef typename TVD_Geom_traits::RT TVD_RT; @@ -160,7 +160,7 @@ private: public: Voronoi_triangulator_3(Regular &T, Simplicial &sc) - : T(T), sc(sc), triangulation_incr_builder(sc), + : T(T), sc(sc), triangulation_incr_builder(sc), visitor(), compute_anchor_obj(T) { edge_index[0][0] = -1; edge_index[0][1] = 0; edge_index[0][2] = 1; edge_index[0][3] = 2; @@ -175,7 +175,7 @@ public: } Voronoi_triangulator_3(Regular &T, Simplicial &sc, Visitor &visitor) - : T(T), sc(sc), triangulation_incr_builder(sc), + : T(T), sc(sc), triangulation_incr_builder(sc), visitor(visitor), compute_anchor_obj(T) { edge_index[0][0] = -1; edge_index[0][1] = 0; edge_index[0][2] = 1; edge_index[0][3] = 2; @@ -185,7 +185,7 @@ public: edge_index[2][2] = -1; edge_index[2][3] = 5; edge_index[3][0] = 2; edge_index[3][1] = 4; edge_index[3][2] = 5; edge_index[3][3] = -1; - + build(); } @@ -201,9 +201,9 @@ private: triangulation_incr_builder.end_triangulation(); } - TVD_Vertex_handle add_vertex(Rt_Simplex &sVor); + TVD_Vertex_handle add_vertex(Rt_Simplex &sVor); TVD_Cell_handle add_cell(TVD_Vertex_handle vh[], int orient, Rt_Simplex s); - + TVD_Vertex_handle get_vertex(Rt_Simplex &sVor); @@ -219,7 +219,7 @@ private: // Reference back to the regular triangulation // std::map backRef; - + private: Regular &T; Simplicial ≻ @@ -297,7 +297,7 @@ construct_vertices() { index_2[nb].V[nb->index(fit->first)] = vh; } } - + // dimVor=1 for (eit=T.finite_edges_begin(); eit!=T.finite_edges_end(); eit++) { sVor = compute_anchor_obj.anchor_vor(*eit); @@ -312,9 +312,9 @@ construct_vertices() { v2 = eit->first->vertex(eit->third); if (v2 < v1) std::swap(v1,v2); index_1[v1].V[v2] = vh; - assert(vh == get_vertex(sVor)); + CGAL_assertion(vh == get_vertex(sVor)); } - + // dimVor=0 for (vit=T.finite_vertices_begin(); vit!=T.finite_vertices_end(); vit++) { sVor = compute_anchor_obj.anchor_vor(vit); @@ -325,7 +325,7 @@ construct_vertices() { debug_vh = vh; } index_0[vit] = vh; - assert(vh == get_vertex(sVor)); + CGAL_assertion(vh == get_vertex(sVor)); } } @@ -367,11 +367,11 @@ construct_cells() { if (j!=i) { sVor = compute_anchor_obj.anchor_vor(Rt_Edge(*adj_cell,index,(index+j)&3)); vh[1] = get_vertex(sVor); - + if ((vh[0] != vh[1]) && (vh[1] != vh[2]) && (vh[2] != vh[3])) { - + TVD_Cell_handle ch; - + ch = add_cell(vh,(index + (j==(i%3+1)? 1:0))&1,simplex); inserted_cells.push_back(ch); } @@ -391,7 +391,7 @@ add_vertex (Rt_Simplex &sVor) { TVD_Vertex_handle vh = triangulation_incr_builder.add_vertex(); vh->point() = get_anchor(sVor); - visitor.after_vertex_insertion(sVor,sVor,vh); + visitor.after_vertex_insertion(sVor,sVor,vh); return vh; } @@ -429,9 +429,9 @@ Voronoi_triangulator_3::get_vertex ( ch=sVor; return index_3[ch]; default: - assert(false); + ; } - assert(false); + CGAL_error(); return TVD_Vertex_handle(); } @@ -440,11 +440,17 @@ template typename Voronoi_triangulator_3::TVD_Cell_handle Voronoi_triangulator_3:: add_cell(TVD_Vertex_handle vh[], int orient, Rt_Simplex s) { - assert((orient==0) || (orient==1)); - assert(vh[0] != TVD_Vertex_handle()); assert(vh[1] != TVD_Vertex_handle()); - assert(vh[2] != TVD_Vertex_handle()); assert(vh[3] != TVD_Vertex_handle()); - assert(vh[1] != vh[2]); assert(vh[1] != vh[3]); assert(vh[1] != vh[4]); - assert(vh[2] != vh[3]); assert(vh[2] != vh[4]); assert(vh[3] != vh[4]); + CGAL_assertion((orient==0) || (orient==1)); + CGAL_assertion(vh[0] != TVD_Vertex_handle()); + CGAL_assertion(vh[1] != TVD_Vertex_handle()); + CGAL_assertion(vh[2] != TVD_Vertex_handle()); + CGAL_assertion(vh[3] != TVD_Vertex_handle()); + CGAL_assertion(vh[1] != vh[2]); + CGAL_assertion(vh[1] != vh[3]); + CGAL_assertion(vh[1] != vh[4]); + CGAL_assertion(vh[2] != vh[3]); + CGAL_assertion(vh[2] != vh[4]); + CGAL_assertion(vh[3] != vh[4]); TVD_Cell_handle ch; // NGHK: DEBUG: @@ -507,7 +513,7 @@ Voronoi_triangulator_3::get_anchor(R Rt_Edge e; Rt_Facet f; Rt_Cell_handle ch; - + TVD_Point vfoc, dfoc; switch (sVor.dimension()) { case 0: @@ -536,7 +542,7 @@ Voronoi_triangulator_3::get_anchor(R r2s_converter(ch->vertex(3)->point())); break; } - + return vfoc; } diff --git a/Skin_surface_3/include/CGAL/triangulate_mixed_complex_3.h b/Skin_surface_3/include/CGAL/triangulate_mixed_complex_3.h index 6ba2df5294f..3ec8ab9f000 100644 --- a/Skin_surface_3/include/CGAL/triangulate_mixed_complex_3.h +++ b/Skin_surface_3/include/CGAL/triangulate_mixed_complex_3.h @@ -535,7 +535,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } } @@ -554,7 +554,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } if (!regular.is_infinite(c2)) { @@ -562,7 +562,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } // anchor dimDel=0, dimVor=2 @@ -572,7 +572,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } else { vh = get_vertex(sDel, sVor); } @@ -590,14 +590,14 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } sDel = get_anchor_del(v2); if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } @@ -609,7 +609,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } @@ -622,7 +622,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } @@ -642,7 +642,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } } @@ -659,7 +659,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } @@ -675,7 +675,7 @@ construct_vertices() { if (anchors.find(Symb_anchor(sDel,sVor)) == anchors.end()) { vh = add_vertex(Symb_anchor(sDel,sVor)); anchors[Symb_anchor(sDel,sVor)] = vh; - assert(vh == get_vertex(sDel, sVor)); + CGAL_assertion(vh == get_vertex(sDel, sVor)); } } } @@ -1078,7 +1078,7 @@ get_weighted_circumcenter(Rt_Simplex const &s) { r2t_converter_object(ch->vertex(3)->point())); break; default: - CGAL_assertion(false); + CGAL_error(); } return result; } diff --git a/Skin_surface_3/include/CGAL/triangulate_power_diagram_3.h b/Skin_surface_3/include/CGAL/triangulate_power_diagram_3.h index 1a3b144995f..e7dd3b9d46c 100644 --- a/Skin_surface_3/include/CGAL/triangulate_power_diagram_3.h +++ b/Skin_surface_3/include/CGAL/triangulate_power_diagram_3.h @@ -386,7 +386,7 @@ construct_vertices() { if (anchors.find(sVor) == anchors.end()) { vh = add_vertex(sVor); anchors[sVor] = vh; - assert(vh == get_vertex(sVor)); + CGAL_assertion(vh == get_vertex(sVor)); } } @@ -397,7 +397,7 @@ construct_vertices() { if (anchors.find(sVor) == anchors.end()) { vh = add_vertex(sVor); anchors[sVor] = vh; - assert(vh == get_vertex(sVor)); + CGAL_assertion(vh == get_vertex(sVor)); } } @@ -408,7 +408,7 @@ construct_vertices() { if (anchors.find(sVor) == anchors.end()) { vh = add_vertex(sVor); anchors[sVor] = vh; - assert(vh == get_vertex(sVor)); + CGAL_assertion(vh == get_vertex(sVor)); } } } @@ -530,11 +530,11 @@ Power_diagram_triangulator_3< TriangulatedMixedComplex_3, TriangulatedMixedComplexObserver_3>:: add_cell(Tmc_Vertex_handle vh[], int orient, Rt_Simplex s) { - assert((orient==0) || (orient==1)); - assert(vh[0] != Tmc_Vertex_handle()); assert(vh[1] != Tmc_Vertex_handle()); - assert(vh[2] != Tmc_Vertex_handle()); assert(vh[3] != Tmc_Vertex_handle()); - assert(vh[1] != vh[2]); assert(vh[1] != vh[3]); assert(vh[1] != vh[4]); - assert(vh[2] != vh[3]); assert(vh[2] != vh[4]); assert(vh[3] != vh[4]); + CGAL_assertion((orient==0) || (orient==1)); + CGAL_assertion(vh[0] != Tmc_Vertex_handle()); CGAL_assertion(vh[1] != Tmc_Vertex_handle()); + CGAL_assertion(vh[2] != Tmc_Vertex_handle()); CGAL_assertion(vh[3] != Tmc_Vertex_handle()); + CGAL_assertion(vh[1] != vh[2]); CGAL_assertion(vh[1] != vh[3]); CGAL_assertion(vh[1] != vh[4]); + CGAL_assertion(vh[2] != vh[3]); CGAL_assertion(vh[2] != vh[4]); CGAL_assertion(vh[3] != vh[4]); Tmc_Cell_handle ch; diff --git a/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h b/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h index 4be5513c3a9..0ff418e2bba 100644 --- a/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h +++ b/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h @@ -13,14 +13,14 @@ // // $URL$ // $Id$ -// +// // // author(s) : Eli Packer #ifndef CGAL_SNAP_ROUNDING_KD_2_H #define CGAL_SNAP_ROUNDING_KD_2_H #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ private: typedef CGAL::Kdtree_interface_2d Kd_interface; typedef CGAL::Kdtree_d Kd_tree; typedef typename Kd_tree::Box Box; - typedef std::list Points_List; + typedef std::list Points_List; typedef std::pair Direction_nt_pair; typedef std::pair Kd_triple; typedef std::pair Kd_direction_nt_pair; @@ -70,7 +70,7 @@ private: typedef std::pair Point_saved_pair; typedef std::list Point_saved_pair_list; typedef typename Point_saved_pair_list::iterator Point_saved_pair_iter; - + typedef typename std::list My_point_saved_list; typedef typename My_point_saved_list::iterator My_point_saved_iter; @@ -79,10 +79,10 @@ private: typedef std::list Segment_list; typedef typename Segment_list::const_iterator Segment_const_iter; - + typedef std::list Direction_list; typedef typename Direction_list::const_iterator Direction_const_iter; - + private: Traits m_gt; const double pi, half_pi; @@ -98,7 +98,7 @@ private: typename Traits::To_double to_dbl; int tranc_angle = int(to_dbl(angle) * rad_to_deg); - + NT cosine_val = angle_to_sines_appr[90 - tranc_angle], sine_val = angle_to_sines_appr[tranc_angle]; @@ -126,7 +126,7 @@ private: //checking validity if (!tree->is_valid()) tree->dump(); - assert(tree->is_valid()); + CGAL_assertion(tree->is_valid()); typename Traits::To_double to_dbl; double buffer_angle(to_dbl(angle) - half_pi / (2 * number_of_trees)); @@ -149,10 +149,10 @@ private: inline NT max BOOST_PREVENT_MACRO_SUBSTITUTION (NT x, NT y) {return((x < y) ? y : x);} inline NT min BOOST_PREVENT_MACRO_SUBSTITUTION (NT x1, NT x2, NT x3, NT x4, NT x5, - NT x6) + NT x6) {return(min BOOST_PREVENT_MACRO_SUBSTITUTION (min BOOST_PREVENT_MACRO_SUBSTITUTION (min BOOST_PREVENT_MACRO_SUBSTITUTION (x1, x2), min BOOST_PREVENT_MACRO_SUBSTITUTION (x3, x4)),min BOOST_PREVENT_MACRO_SUBSTITUTION (x5, x6)));} - inline NT max BOOST_PREVENT_MACRO_SUBSTITUTION (NT x1, NT x2, NT x3, NT x4, NT x5, NT x6) + inline NT max BOOST_PREVENT_MACRO_SUBSTITUTION (NT x1, NT x2, NT x3, NT x4, NT x5, NT x6) {return(max BOOST_PREVENT_MACRO_SUBSTITUTION (max BOOST_PREVENT_MACRO_SUBSTITUTION (max BOOST_PREVENT_MACRO_SUBSTITUTION (x1, x2), max BOOST_PREVENT_MACRO_SUBSTITUTION (x3, x4)),max BOOST_PREVENT_MACRO_SUBSTITUTION (x5, x6)));} /*! */ @@ -160,7 +160,7 @@ private: { typedef typename Traits_::Construct_vertex_2 Construct_vertex_2; Construct_vertex_2 construct_vertex = m_gt.construct_vertex_2_object(); - + // force the segment slope to [0-180) Point_2 s = construct_vertex(seg, 0); Point_2 t = construct_vertex(seg, 1); @@ -179,7 +179,7 @@ private: v = v.perpendicular(RIGHT_TURN); Direction_2 d(v.direction()); - + return(d); } @@ -321,17 +321,14 @@ public: /*! */ Multiple_kd_tree(const Point_saved_pair_list & inp_points_list, int inp_number_of_trees, - const Segment_list & seg_list) : + const Segment_list & seg_list) : pi(3.1415), half_pi(1.57075), number_of_trees(inp_number_of_trees), input_points_list(inp_points_list) { Kd_triple kd; // check that there are at least two trees - if (number_of_trees < 1) { - std::cerr << "There must be at least one kd-tree\n"; - std::exit(1); - } + CGAL_precondition_msg(number_of_trees >= 1, "There must be at least one kd-tree" ); init_angle_to_sines_table(); @@ -387,7 +384,7 @@ public: } #ifdef CGAL_SR_DEBUG - std::cout << "Actual number of kd-trees created : " << + std::cout << "Actual number of kd-trees created : " << number_of_actual_kd_trees << std::endl; #endif @@ -471,11 +468,11 @@ public: Point_2 p1 = rec.vertex(0); Point_2 p2 = rec.vertex(2); - My_point_saved point1(p1); + My_point_saved point1(p1); My_point_saved point2(p2); Box b(point1, point2, 2); - + // the kd-tree query My_point_saved_list res; iter->first->search(std::back_inserter(res), b); diff --git a/Stream_lines_2/include/CGAL/Stream_lines_2.h b/Stream_lines_2/include/CGAL/Stream_lines_2.h index 28b124ba0a0..9d76e080874 100644 --- a/Stream_lines_2/include/CGAL/Stream_lines_2.h +++ b/Stream_lines_2/include/CGAL/Stream_lines_2.h @@ -771,7 +771,7 @@ Stream_lines_2::get_next_seed_point(FT & bool b0,b; Pq_element m_Pq_element; do{ - assert(!pq.empty()); + CGAL_assertion(!pq.empty()); m_Pq_element = pq.top(); v0 = m_Pq_element.first; v1 = m_Pq_element.second; diff --git a/Stream_lines_2/include/CGAL/Triangular_field_2.h b/Stream_lines_2/include/CGAL/Triangular_field_2.h index e3f70b3245b..52c85491e08 100644 --- a/Stream_lines_2/include/CGAL/Triangular_field_2.h +++ b/Stream_lines_2/include/CGAL/Triangular_field_2.h @@ -110,7 +110,7 @@ public: std::pair get_field(const Point_2 & p) const { - assert(is_in_domain(p)); + CGAL_assertion(is_in_domain(p)); Vector_2 v = get_vector_field(p); FT density = get_density_field(p); return std::make_pair(v, density); @@ -160,7 +160,7 @@ Triangular_field_2::get_vector_field(const const { Face_handle m_Face_handle = m_D_Ttr.locate(p); - assert(is_in_domain(p)); + CGAL_assertion(is_in_domain(p)); Vertex_handle v0 = m_Face_handle->vertex(0); Vertex_handle v1 = m_Face_handle->vertex(1); Vertex_handle v2 = m_Face_handle->vertex(2); diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/include/Parameterization_polyhedron_adaptor_ex.h b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/include/Parameterization_polyhedron_adaptor_ex.h index b5e3084b637..48ab6b4f92d 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/include/Parameterization_polyhedron_adaptor_ex.h +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/include/Parameterization_polyhedron_adaptor_ex.h @@ -29,7 +29,6 @@ #include "Polyhedron_ex.h" #include -#include // Class Parameterization_polyhedron_adaptor_ex @@ -186,8 +185,8 @@ public: Halfedge_const_handle get_halfedge( Vertex_const_handle source, Vertex_const_handle target) const { - assert(source != NULL); - assert(target != NULL); + CGAL_surface_mesh_parameterization_precondition(source != NULL); + CGAL_surface_mesh_parameterization_precondition(target != NULL); Halfedge_around_vertex_const_circulator cir = target->vertex_begin(), cir_end = cir; @@ -195,7 +194,7 @@ public: if (cir->opposite()->vertex() == source) return cir; - assert(false); // error if we reach this point + CGAL_error(); return NULL; } Halfedge_handle get_halfedge(Vertex_handle source, Vertex_handle target) @@ -526,8 +525,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // get (u,v) pair from first inner halfedge (clockwise) Halfedge_around_vertex_const_circulator cir( @@ -551,8 +550,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // first inner halfedge (for a clockwise rotation) Halfedge_around_vertex_circulator cir( @@ -585,8 +584,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // get "is parameterized" field from first inner halfedge (clockwise) Halfedge_around_vertex_const_circulator cir( @@ -610,8 +609,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // first inner halfedge (for a clockwise rotation) Halfedge_around_vertex_circulator cir( @@ -644,8 +643,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // get index from first inner halfedge (clockwise) Halfedge_around_vertex_const_circulator cir( @@ -669,8 +668,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // first inner halfedge (for a clockwise rotation) Halfedge_around_vertex_circulator cir( @@ -703,8 +702,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // get tag from first inner halfedge (clockwise) Halfedge_around_vertex_const_circulator cir( @@ -728,8 +727,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // first inner halfedge (for a clockwise rotation) Halfedge_around_vertex_circulator cir( diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/include/Polyhedron_ex.h b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/include/Polyhedron_ex.h index 3177038cca6..1a66c783ee4 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/include/Polyhedron_ex.h +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/include/Polyhedron_ex.h @@ -380,12 +380,12 @@ public: #else #define FORMAT_EPS_COORD(x) (x) #endif - + // Dump parameterized mesh to an eps file bool write_file_eps(const char *pFilename, double scale = 500.0) { - assert(pFilename != NULL); + CGAL_assertion(pFilename != NULL); std::ofstream out(pFilename); if(!out) @@ -449,12 +449,12 @@ public: double y1 = scale * pHalfedge->prev()->v(); double x2 = scale * pHalfedge->u(); double y2 = scale * pHalfedge->v(); - out << FORMAT_EPS_COORD(x1) << " " - << FORMAT_EPS_COORD(y1) << " " - << FORMAT_EPS_COORD(x2) << " " + out << FORMAT_EPS_COORD(x1) << " " + << FORMAT_EPS_COORD(y1) << " " + << FORMAT_EPS_COORD(x2) << " " << FORMAT_EPS_COORD(y2) << " E" << std::endl; } - + /* Emit EPS trailer. */ out << "grestore" << std::endl; out << std::endl; @@ -469,7 +469,7 @@ public: #else #define FORMAT_UV(x) (x) #endif - + // Dump parameterized mesh to a Wavefront OBJ file // v x y z // f 1 2 3 4 (1-based) @@ -477,7 +477,7 @@ public: // Implementation note: the UV is meaningless for a NON parameterized halfedge bool write_file_obj(const char *pFilename) { - assert(pFilename != NULL); + CGAL_assertion(pFilename != NULL); std::ofstream out(pFilename); if(!out) @@ -510,7 +510,7 @@ public: else out << "vt " << 0.0 << " " << 0.0 << std::endl; } - + // Write facets using the unique material # 1 out << "# facets" << std::endl; out << "usemtl Mat_1" << std::endl; diff --git a/Surface_mesh_parameterization/include/CGAL/Param_mesh_patch_circulators.h b/Surface_mesh_parameterization/include/CGAL/Param_mesh_patch_circulators.h index e31a8ca5482..c5a714ab3ac 100644 --- a/Surface_mesh_parameterization/include/CGAL/Param_mesh_patch_circulators.h +++ b/Surface_mesh_parameterization/include/CGAL/Param_mesh_patch_circulators.h @@ -21,6 +21,7 @@ #ifndef CGAL_PARAM_MESH_PATCH_CIRCULATORS_H #define CGAL_PARAM_MESH_PATCH_CIRCULATORS_H +#include #include #include #include @@ -148,7 +149,7 @@ public: // #endif // Check that the inherited vertex handle is valid - assert((*this)->vertex() == m_adaptor_circulator); + CGAL_surface_mesh_parameterization_assertion((*this)->vertex() == m_adaptor_circulator); // If m_center is an inner vertex, m_adaptor_circulator // already circulates over m_center's vertices @@ -188,7 +189,7 @@ public: // Special case: m_center is the extremity of the seam. // Its seam adaptor neighbor vertex is "virtually" duplicated. - assert(m_center->last_cw_neighbor() == m_center->first_cw_neighbor()); + CGAL_surface_mesh_parameterization_assertion(m_center->last_cw_neighbor() == m_center->first_cw_neighbor()); // If the previous position is the last "virtual" clockwise neighbor, // move to first "virtual" clockwise neighbor @@ -207,7 +208,7 @@ public: std::cerr << "#" << m_mesh_patch->get_vertex_index(current_decorated_vertex); std::cerr << ")\n"; #endif*/ - assert(m_mesh_patch->is_valid(current_decorated_vertex)); + CGAL_surface_mesh_parameterization_assertion(m_mesh_patch->is_valid(current_decorated_vertex)); Base::operator=(current_decorated_vertex); return *this; @@ -234,7 +235,7 @@ public: std::cerr << "#" << m_mesh_patch->get_vertex_index(current_decorated_vertex); std::cerr << ")\n"; #endif*/ - assert(m_mesh_patch->is_valid(current_decorated_vertex)); + CGAL_surface_mesh_parameterization_assertion(m_mesh_patch->is_valid(current_decorated_vertex)); Base::operator=(current_decorated_vertex); return *this; @@ -264,7 +265,7 @@ public: // #endif // Check that the inherited vertex handle is valid - assert((*this)->vertex() == m_adaptor_circulator); + CGAL_surface_mesh_parameterization_precondition((*this)->vertex() == m_adaptor_circulator); // If m_center is an inner vertex, m_adaptor_circulator // already circulates over m_center's vertices @@ -304,7 +305,7 @@ public: // Special case: m_center is the extremity of the seam. // Its seam adaptor neighbor vertex is "virtually" duplicated. - assert(m_center->last_cw_neighbor() == m_center->first_cw_neighbor()); + CGAL_surface_mesh_parameterization_assertion(m_center->last_cw_neighbor() == m_center->first_cw_neighbor()); // If the previous position is on the last "virtual" counter-clockwise // neighbor, move to first "virtual" counter-clockwise neighbor @@ -323,7 +324,7 @@ public: std::cerr << "#" << m_mesh_patch->get_vertex_index(current_decorated_vertex); std::cerr << ")\n"; #endif*/ - assert(m_mesh_patch->is_valid(current_decorated_vertex)); + CGAL_surface_mesh_parameterization_assertion(m_mesh_patch->is_valid(current_decorated_vertex)); Base::operator=(current_decorated_vertex); return *this; @@ -350,7 +351,7 @@ public: std::cerr << "#" << m_mesh_patch->get_vertex_index(current_decorated_vertex); std::cerr << ")\n"; #endif*/ - assert(m_mesh_patch->is_valid(current_decorated_vertex)); + CGAL_surface_mesh_parameterization_assertion(m_mesh_patch->is_valid(current_decorated_vertex)); Base::operator=(current_decorated_vertex); return *this; @@ -391,7 +392,8 @@ private: { // Ambiguous case: m_center is the extremity of the seam // and m_adaptor_circulator is on the seam - assert(m_center->last_cw_neighbor() != m_adaptor_circulator + CGAL_surface_mesh_parameterization_assertion( + m_center->last_cw_neighbor() != m_adaptor_circulator || m_center->first_cw_neighbor() != m_adaptor_circulator); if (m_center->first_cw_neighbor() == m_adaptor_circulator) @@ -416,7 +418,7 @@ private: // #endif // Update the inherited vertex handle - assert(m_mesh_patch->is_valid(current_decorated_vertex)); + CGAL_surface_mesh_parameterization_assertion(m_mesh_patch->is_valid(current_decorated_vertex)); Base::operator=(current_decorated_vertex); } @@ -596,7 +598,7 @@ private: } // Update the inherited vertex handle - assert(m_mesh_patch->is_valid(current_decorated_vertex)); + CGAL_surface_mesh_parameterization_assertion(m_mesh_patch->is_valid(current_decorated_vertex)); Base::operator=(current_decorated_vertex); } diff --git a/Surface_mesh_parameterization/include/CGAL/Param_mesh_patch_vertex.h b/Surface_mesh_parameterization/include/CGAL/Param_mesh_patch_vertex.h index 6d688c81982..ca9fafd8c1d 100644 --- a/Surface_mesh_parameterization/include/CGAL/Param_mesh_patch_vertex.h +++ b/Surface_mesh_parameterization/include/CGAL/Param_mesh_patch_vertex.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -21,6 +21,7 @@ #ifndef CGAL_PARAM_MESH_PATCH_VERTEX_H #define CGAL_PARAM_MESH_PATCH_VERTEX_H +#include #include #include @@ -146,7 +147,7 @@ private: }; // Param_mesh_patch_vertex -/// Param_mesh_patch_vertex_handle represents a handle to a +/// Param_mesh_patch_vertex_handle represents a handle to a /// Param_mesh_patch_vertex object, thus has the same behavior /// as Param_mesh_patch_vertex* pointer type. /// @@ -200,7 +201,7 @@ public: m_ptr = &m_vertex; } - assert(m_ptr == NULL || m_ptr == &m_vertex); + CGAL_surface_mesh_parameterization_assertion(m_ptr == NULL || m_ptr == &m_vertex); } /// Extra constructor that will create the Parameterization_mesh_patch_3::Vertex on the fly @@ -232,7 +233,7 @@ public: m_ptr = &m_vertex; } - assert(m_ptr == NULL || m_ptr == &m_vertex); + CGAL_surface_mesh_parameterization_assertion(m_ptr == NULL || m_ptr == &m_vertex); } /// operator =() @@ -249,7 +250,7 @@ public: m_ptr = &m_vertex; } - assert(m_ptr == NULL || m_ptr == &m_vertex); + CGAL_surface_mesh_parameterization_assertion(m_ptr == NULL || m_ptr == &m_vertex); return *this; } @@ -290,7 +291,7 @@ private: }; // Param_mesh_patch_vertex_handle -/// Param_mesh_patch_vertex_const_handle represents a handle to a +/// Param_mesh_patch_vertex_const_handle represents a handle to a /// Param_mesh_patch_vertex object, thus has the same behavior /// as const Param_mesh_patch_vertex* pointer type. /// @@ -344,7 +345,7 @@ public: m_ptr = &m_vertex; } - assert(m_ptr == NULL || m_ptr == &m_vertex); + CGAL_surface_mesh_parameterization_assertion(m_ptr == NULL || m_ptr == &m_vertex); } /// Extra constructor that will create the Parameterization_mesh_patch_3::Vertex on the fly @@ -378,7 +379,7 @@ public: m_ptr = &m_vertex; } - assert(m_ptr == NULL || m_ptr == &m_vertex); + CGAL_surface_mesh_parameterization_assertion(m_ptr == NULL || m_ptr == &m_vertex); } /// operator =() @@ -395,7 +396,7 @@ public: m_ptr = &m_vertex; } - assert(m_ptr == NULL || m_ptr == &m_vertex); + CGAL_surface_mesh_parameterization_assertion(m_ptr == NULL || m_ptr == &m_vertex); return *this; } diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h index 19fcbd5abed..11d4fb4a699 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -91,7 +91,7 @@ public: /// => The caller must NOT modify 'mesh' during the /// Parameterization_mesh_feature_extractor life cycle. Parameterization_mesh_feature_extractor(Adaptor& mesh) - // Store reference to adapted mesh + // Store reference to adapted mesh : m_mesh_adaptor(mesh) { // m_mesh_adaptor features are not yet computed @@ -157,7 +157,7 @@ private: /// Result is in m_nb_borders and m_skeleton. void extract_borders() { - assert(m_skeleton.size() == 0); + CGAL_surface_mesh_parameterization_precondition(m_skeleton.size() == 0); // Tag all vertices as unprocessed const int tag_free = 0; @@ -320,7 +320,8 @@ private: const int tag_free, const int tag_done) { - assert(m_mesh_adaptor.get_vertex_tag(pSeedVertex) == tag_free); + CGAL_surface_mesh_parameterization_precondition( + m_mesh_adaptor.get_vertex_tag(pSeedVertex) == tag_free); std::list vertices; vertices.push_front(pSeedVertex); diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_patch_3.h b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_patch_3.h index 90a250002b1..07cd940f379 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_patch_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_patch_3.h @@ -21,6 +21,7 @@ #ifndef CGAL_PARAMETERIZATION_MESH_PATCH_3_H #define CGAL_PARAMETERIZATION_MESH_PATCH_3_H +#include #include #include #include @@ -357,7 +358,7 @@ public: it != mesh_main_border_vertices_end(); it++) { - assert(is_vertex_on_main_border(it)); + CGAL_surface_mesh_parameterization_assertion(is_vertex_on_main_border(it)); border.push_back(it); } } @@ -372,7 +373,7 @@ public: it != adaptor_border.end(); it++) { - assert(is_vertex_on_border( Vertex_handle(*it) )); + CGAL_surface_mesh_parameterization_assertion(is_vertex_on_border( Vertex_handle(*it) )); border.push_back( Vertex_handle(*it) ); } } @@ -862,7 +863,8 @@ private: typename Adaptor::Vertex_const_handle adaptor_neighbor) const { // We need at least an inner neighbor as input - assert(m_mesh_adaptor.get_halfedge_seaming(adaptor_vertex, + CGAL_surface_mesh_parameterization_assertion( + m_mesh_adaptor.get_halfedge_seaming(adaptor_vertex, adaptor_neighbor) != BORDER || m_mesh_adaptor.get_halfedge_seaming(adaptor_neighbor, adaptor_vertex) != BORDER); @@ -925,15 +927,18 @@ private: typename Adaptor::Vertex_const_handle last_cw_neighbor, typename Adaptor::Vertex_const_handle first_cw_neighbor) const { - assert(adaptor_vertex != NULL); - assert(last_cw_neighbor != NULL || first_cw_neighbor != NULL); + CGAL_surface_mesh_parameterization_assertion(adaptor_vertex != NULL); + CGAL_surface_mesh_parameterization_assertion( + last_cw_neighbor != NULL || first_cw_neighbor != NULL); - assert(last_cw_neighbor == NULL + CGAL_surface_mesh_parameterization_assertion( + last_cw_neighbor == NULL || m_mesh_adaptor.get_halfedge_seaming(adaptor_vertex, last_cw_neighbor) == BORDER || m_mesh_adaptor.get_halfedge_seaming(last_cw_neighbor, adaptor_vertex) == BORDER); - assert(first_cw_neighbor == NULL + CGAL_surface_mesh_parameterization_assertion( + first_cw_neighbor == NULL || m_mesh_adaptor.get_halfedge_seaming(adaptor_vertex, first_cw_neighbor) == BORDER || m_mesh_adaptor.get_halfedge_seaming(first_cw_neighbor, @@ -963,7 +968,7 @@ private: } // we should not get here - assert(false); + CGAL_error(); return NULL; } } diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h b/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h index 9636da928cc..065908aa9b7 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h @@ -21,6 +21,7 @@ #ifndef CGAL_PARAMETERIZATION_POLYHEDRON_ADAPTOR3_H #define CGAL_PARAMETERIZATION_POLYHEDRON_ADAPTOR3_H +#include #include #include #include @@ -30,7 +31,6 @@ #include #include -#include CGAL_BEGIN_NAMESPACE @@ -345,8 +345,8 @@ public: typename Polyhedron::Halfedge_const_handle get_halfedge( Vertex_const_handle source, Vertex_const_handle target) const { - assert(source != NULL); - assert(target != NULL); + CGAL_surface_mesh_parameterization_precondition(source != NULL); + CGAL_surface_mesh_parameterization_precondition(target != NULL); Halfedge_around_vertex_const_circulator cir = target->vertex_begin(), cir_end = cir; @@ -354,7 +354,7 @@ public: if (cir->opposite()->vertex() == source) return cir; - assert(false); // error if we reach this point + CGAL_error(); return NULL; } typename Polyhedron::Halfedge_handle get_halfedge( @@ -724,8 +724,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // get (u,v) pair from first inner halfedge (clockwise) Halfedge_around_vertex_const_circulator cir( @@ -749,8 +749,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // first inner halfedge (for a clockwise rotation) Halfedge_around_vertex_circulator cir( @@ -783,8 +783,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // get "is parameterized" field from first inner halfedge (clockwise) Halfedge_around_vertex_const_circulator cir( @@ -808,8 +808,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // first inner halfedge (for a clockwise rotation) Halfedge_around_vertex_circulator cir( @@ -842,8 +842,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // get index from first inner halfedge (clockwise) Halfedge_around_vertex_const_circulator cir( @@ -867,8 +867,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // first inner halfedge (for a clockwise rotation) Halfedge_around_vertex_circulator cir( @@ -901,8 +901,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // get tag from first inner halfedge (clockwise) Halfedge_around_vertex_const_circulator cir( @@ -926,8 +926,8 @@ public: } else // if seam vertex { - assert(prev_vertex != NULL); - assert(next_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(prev_vertex != NULL); + CGAL_surface_mesh_parameterization_precondition(next_vertex != NULL); // first inner halfedge (for a clockwise rotation) Halfedge_around_vertex_circulator cir( diff --git a/Surface_mesh_parameterization/include/CGAL/Taucs_matrix.h b/Surface_mesh_parameterization/include/CGAL/Taucs_matrix.h index b0a64bb0c5c..9758bd43c53 100644 --- a/Surface_mesh_parameterization/include/CGAL/Taucs_matrix.h +++ b/Surface_mesh_parameterization/include/CGAL/Taucs_matrix.h @@ -21,9 +21,9 @@ #ifndef CGAL_TAUCS_MATRIX #define CGAL_TAUCS_MATRIX +#include #include -#include CGAL_BEGIN_NAMESPACE @@ -142,7 +142,7 @@ public: Taucs_matrix(int dim, ///< Matrix dimension. bool is_symmetric = false) ///< Symmetric/hermitian? { - assert(dim > 0); + CGAL_precondition(dim > 0); m_row_dimension = dim; m_column_dimension = dim; @@ -156,10 +156,10 @@ public: int columns, bool is_symmetric = false) ///< Symmetric/hermitian? { - assert(rows > 0); - assert(columns > 0); + CGAL_precondition(rows > 0); + CGAL_precondition(columns > 0); if (m_is_symmetric) { - assert(rows == columns); + CGAL_precondition(rows == columns); } m_row_dimension = rows; @@ -200,8 +200,8 @@ public: if (m_is_symmetric && (j > i)) std::swap(i, j); - assert(i < m_row_dimension); - assert(j < m_column_dimension); + CGAL_precondition(i < m_row_dimension); + CGAL_precondition(j < m_column_dimension); return m_columns[j].get_coef(i); } @@ -219,8 +219,8 @@ public: if (m_is_symmetric && (j > i)) return; - assert(i < m_row_dimension); - assert(j < m_column_dimension); + CGAL_precondition(i < m_row_dimension); + CGAL_precondition(j < m_column_dimension); m_columns[j].set_coef(i, val); } @@ -238,8 +238,8 @@ public: if (m_is_symmetric && (j > i)) return; - assert(i < m_row_dimension); - assert(j < m_column_dimension); + CGAL_precondition(i < m_row_dimension); + CGAL_precondition(j < m_column_dimension); m_columns[j].add_coef(i, val); } diff --git a/Surface_mesh_parameterization/include/CGAL/Taucs_vector.h b/Surface_mesh_parameterization/include/CGAL/Taucs_vector.h index 2aab95b7004..a2f27fe90d0 100644 --- a/Surface_mesh_parameterization/include/CGAL/Taucs_vector.h +++ b/Surface_mesh_parameterization/include/CGAL/Taucs_vector.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -21,7 +21,7 @@ #ifndef CGAL_TAUCS_VECTOR #define CGAL_TAUCS_VECTOR -#include +#include CGAL_BEGIN_NAMESPACE @@ -92,11 +92,11 @@ public: /// Preconditions: /// 0 <= i < dimension(). T operator[](int i) const { - assert(i < m_dimension); + CGAL_precondition(i < m_dimension); return m_element[i]; } T& operator[](int i) { - assert(i < m_dimension); + CGAL_precondition(i < m_dimension); return m_element[i]; } diff --git a/Surface_mesher/demo/Surface_mesher/windows/Mesh.h b/Surface_mesher/demo/Surface_mesher/windows/Mesh.h index e4d314bf659..5d97a0ef737 100644 --- a/Surface_mesher/demo/Surface_mesher/windows/Mesh.h +++ b/Surface_mesher/demo/Surface_mesher/windows/Mesh.h @@ -29,4 +29,4 @@ public: afx_msg void OnUpdateCameraPasteviewpoint(CCmdUI *pCmdUI); }; -extern CMeshApp theApp; \ No newline at end of file +extern CMeshApp theApp; diff --git a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_3.h b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_3.h index 292f348c974..84891bf45e3 100644 --- a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_3.h +++ b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_3.h @@ -585,7 +585,7 @@ public: case 2: break; default: - CGAL_assertion(false); + CGAL_error(); } const int dimension_plus_1 = tr.dimension() + 1; diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Polyhedral_oracle.h b/Surface_mesher/include/CGAL/Surface_mesher/Polyhedral_oracle.h index 26d8cc9c4e7..2844e12310e 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Polyhedral_oracle.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Polyhedral_oracle.h @@ -359,7 +359,7 @@ public: CGAL::Object intersect_line_surface(const Subfacets_tree&, const Line_3 &) const { - CGAL_assertion(false); + CGAL_error(); return CGAL::Object(); } #endif // CGAL_SURFACE_MESHER_POLYHEDRAL_SURFACE_USE_OCTREE diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher.h b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher.h index d037229fd6d..ce28c921439 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher.h @@ -561,7 +561,7 @@ namespace CGAL { std::cerr << "In is_facet_on_surface(const Facet& f, Point& center)\n" << "file " << __FILE__ << ", line " << __LINE__ << "\n"; std::cerr << "Incorrect object type: " << dual.type().name() << "\n"; - CGAL_assertion(false); + CGAL_error(); } return assign(center,intersection); diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_sweep_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_sweep_2.h index 58e4412e804..b8ee545230f 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_sweep_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_sweep_2.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Mariette Yvinec @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -44,11 +43,11 @@ public: typedef Gt Geom_traits; typedef typename Gt::Point Point; typedef typename Gt::Segment Segment; - + typedef Triangulation_2 Triangulation; typedef Constrained_triangulation_2 Ctriangulation; - - typedef typename Ctriangulation::Face_handle Face_handle; + + typedef typename Ctriangulation::Face_handle Face_handle; typedef typename Ctriangulation::Vertex_handle Vertex_handle; typedef typename Ctriangulation::Edge Edge; typedef typename Ctriangulation::Vertex Vertex; @@ -60,7 +59,7 @@ public: class Chain; class Event_less; class Status_comp; - + class Event_less : public std::binary_function { private: @@ -75,8 +74,8 @@ public: t.compare_y(p,q) == SMALLER ) ); } }; - - class Status_comp : + + class Status_comp : public std::binary_function { private: @@ -90,7 +89,7 @@ public: Point p2= s2.first; Point q1= s1.second; Point q2= s2.second; - + // one of the constraint is degenerate if ( t.compare_x(p1,q1) == EQUAL && t.compare_y(p1,q1) == EQUAL) { @@ -106,7 +105,7 @@ public: // default case return( t.orientation(p2,q2,p1) == RIGHT_TURN); } - + else if ( t.compare_x(p2,q2) == EQUAL && t.compare_y(p2,q2) == EQUAL) { // p2==q2 && p1!=q1 @@ -121,7 +120,7 @@ public: // default case return (t.orientation(p1,q1,q2) == LEFT_TURN); } - + // comparison of two non degenerate constraints else { //neither of the constraints are points @@ -141,28 +140,28 @@ public: } } // shouldn't get there - // CGAL_triangulation_assertion( false ); + // CGAL_error(); return false; } - + }; - + class Neighbor_list : public std::list { private: Ctriangulation* _tr; - + public: Neighbor_list (Ctriangulation *tr) : _tr(tr) {} bool is_removable(Face_handle fh) { return ( (*fh).vertex(1) == (*fh).vertex(2) && - (*fh).neighbor(1) != Face_handle() && + (*fh).neighbor(1) != Face_handle() && (*fh).neighbor(2) != Face_handle() ); } - void remove_flat(Face_handle fh) + void remove_flat(Face_handle fh) { CGAL_triangulation_precondition((*fh).vertex(1) == (*fh).vertex(2)); Face_handle f2= (*fh).neighbor(2); @@ -196,7 +195,7 @@ public: } return last; } - + Face_handle up_visit( Vertex_handle v, Face_handle last) { Geom_traits t=Geom_traits(); @@ -224,7 +223,7 @@ public: } return last; } - + Face_handle down_visit(Vertex_handle v, Face_handle first) { Geom_traits t=Geom_traits(); @@ -252,16 +251,16 @@ public: } return first; } - + }; - + class Chain { private: Vertex_handle rm; Neighbor_list up; Neighbor_list down; - + public: Chain(Ctriangulation* tr) : rm(), up(tr), down(tr) {} Vertex_handle right_most() { return rm;} @@ -269,18 +268,18 @@ public: Neighbor_list* down_list(){return &down;} void set_right_most(Vertex_handle v) { rm=v;} }; - + typedef std::list Out_edges; typedef std::map Event_queue; typedef std::map Sweep_status; - // should be + // should be //typedef std::map Sweep_status; - + // added to please MIPS Pro typedef typename Event_queue::iterator Event_queue_iterator; typedef typename Sweep_status::iterator Sweep_status_iterator; - - + + protected: Ctriangulation* _tr; std::list* _lc; @@ -289,27 +288,27 @@ public: Status_comp status_comp; Sweep_status status; Chain upper_chain; - + public: Constrained_triangulation_sweep_2() : _tr(NULL), _lc(), upper_chain() { } - + Constrained_triangulation_sweep_2( Ctriangulation* ct, std::list& lc) - : _tr(ct), _lc(&lc), - event_less(ct->geom_traits()), queue(event_less), + : _tr(ct), _lc(&lc), + event_less(ct->geom_traits()), queue(event_less), status_comp(ct->geom_traits()), status(status_comp), upper_chain(ct) { make_event_queue(); build_triangulation(); } - + Geom_traits geom_traits() { return _tr->geom_traits(); } Event_less xy_less() { return event_less;} - + friend class Neighbor_list; public: @@ -529,10 +528,10 @@ treat_out_edges(const Event_queue_iterator & event, if (loc == status.end()) {pc_up = & upper_chain;} else { pc_up = (Chain*)((*loc).second);} Vertex_handle v = pc_up->right_most(); - //assert (v->point() == p); + //CGAL_assertion(v->point() == p); //c= Constraint(p,p); //Sweep_status_iterator loc_bis = status.lower_bound(Constraint(p,p)); - //assert( loc == loc_bis); + //CGAL_assertion( loc == loc_bis); while( outit != (*out).end()){ c = Constraint(p,*outit); @@ -576,7 +575,7 @@ set_infinite_faces() Neighbor_list* upper_list= upper_chain.up_list(); Neighbor_list* lower_list= upper_chain.down_list(); //Triangulation may have only one vertex - if (upper_list->empty() || lower_list->empty()) + if (upper_list->empty() || lower_list->empty()) // {return upper_chain.right_most();} { _tr->set_number_of_vertices(0); @@ -584,7 +583,7 @@ set_infinite_faces() delete &(*upper_chain.right_most()); return; } - + //Triangulation has now at least two vertices Face_handle first, last; Face_handle newf, fn; @@ -594,7 +593,7 @@ set_infinite_faces() first = (lower_list->front()).first; last = (upper_list->back()).first; if (first->vertex(1) == first->vertex(2) && - last->vertex(1) == last ->vertex(2) ) { + last->vertex(1) == last ->vertex(2) ) { //dimension 1 //both test are necessary because it may remain some flat faces //in the upper chain. @@ -622,7 +621,7 @@ set_infinite_faces() first->set_neighbor(1,fn); return; } - + // good 2d triangulation _tr->set_dimension(2); lower_list->splice(lower_list->end(), *upper_list); @@ -630,10 +629,10 @@ set_infinite_faces() fn = (*(lower_list->begin())).first; in = (*(lower_list->begin())).second; lower_list->pop_front(); - newf = _tr->create_face( infinite, + newf = _tr->create_face( infinite, fn->vertex(fn->cw(in)), fn->vertex(fn->ccw(in))); - fn->set_neighbor(in,newf); + fn->set_neighbor(in,newf); newf->set_neighbor(0,fn); newf->set_constraint(0, fn->is_constrained(in)); if (lower_list->is_removable(fn)) { lower_list->remove_flat(fn); } @@ -643,10 +642,10 @@ set_infinite_faces() fn =(* (lower_list->begin())).first; in =(* (lower_list->begin())).second; lower_list->pop_front(); - newf= _tr->create_face( infinite, + newf= _tr->create_face( infinite, fn->vertex(fn->cw(in)), fn->vertex(fn->ccw(in))); - fn->set_neighbor(in,newf); + fn->set_neighbor(in,newf); newf->set_neighbor(0,fn); last->set_neighbor(2,newf); newf->set_neighbor(1,last); diff --git a/Triangulation_2/include/CGAL/Weighted_point.h b/Triangulation_2/include/CGAL/Weighted_point.h index 50ef8667b28..b80f354f182 100644 --- a/Triangulation_2/include/CGAL/Weighted_point.h +++ b/Triangulation_2/include/CGAL/Weighted_point.h @@ -37,7 +37,7 @@ public: Weighted_point (const Point &p) : Point(p), _weight(0) { - // CGAL_assertion_msg(false, "Warning : truncated weight !!!"); + // CGAL_error_msg( "Warning : truncated weight !!!"); } Weighted_point (const Point &p, const Weight &w) diff --git a/Triangulation_3/include/CGAL/Triangulation_simplex_3.h b/Triangulation_3/include/CGAL/Triangulation_simplex_3.h index 62e5182ecdc..afeb971c2c4 100644 --- a/Triangulation_3/include/CGAL/Triangulation_simplex_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_simplex_3.h @@ -183,7 +183,7 @@ operator==(Triangulation_simplex_3 s0, case (3): return (&(*s0.ch) == &(*s1.ch)); } - CGAL_assertion(false); + CGAL_error(); return false; } diff --git a/Visibility_complex_2/demo/Visibility_complex_2/Qt_widget_style_editor.cpp b/Visibility_complex_2/demo/Visibility_complex_2/Qt_widget_style_editor.cpp index d713cdf33ee..b87891b7ceb 100644 --- a/Visibility_complex_2/demo/Visibility_complex_2/Qt_widget_style_editor.cpp +++ b/Visibility_complex_2/demo/Visibility_complex_2/Qt_widget_style_editor.cpp @@ -181,7 +181,7 @@ Qt_widget_style_editor::Qt_widget_style_editor(Style* style, this, SLOT(pointstyle(int))); break; default: - CGAL_assertion(false); + CGAL_error(); break; } diff --git a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Antichain.h b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Antichain.h index 585599fc81a..0619dfff2a2 100644 --- a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Antichain.h +++ b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Antichain.h @@ -53,7 +53,7 @@ public: VC_in_place_list_base() { this->next_link=0; this->prev_link=0; - } + } ~VC_in_place_list_base() { if (this->next_link) { this->next_link->prev_link=this->prev_link; @@ -63,13 +63,13 @@ public: } this->next_link=0; this->prev_link=0; - } + } }; template < class Vertex_base_> class Vertex - : public Vertex_base_, - public VC_in_place_list_base< Vertex > + : public Vertex_base_, + public VC_in_place_list_base< Vertex > { typedef Vertex< Vertex_base_> Self; public: @@ -80,12 +80,12 @@ public: typedef typename Vertex_base_::Type Type; Vertex() {} - Vertex(Type t , Disk_handle start , - Disk_handle finish) + Vertex(Type t , Disk_handle start , + Disk_handle finish) : Vertex_base_(t,start,finish),final_antichain_(false) {} Vertex(Edge_handle start , Edge_handle finish) : Vertex_base_(start,finish),final_antichain_(false) {} - Vertex(const Bitangent_2& b) + Vertex(const Bitangent_2& b) : Vertex_base_(b),final_antichain_(false) {} Vertex( const Vertex_base_& v) // down cast : Vertex_base_(v),final_antichain_(false) {} @@ -112,18 +112,18 @@ private: template class Edge - : public Edge_base_, - public VC_in_place_list_base< Edge > + : public Edge_base_, + public VC_in_place_list_base< Edge > { typedef Edge Self; public: typedef typename Edge_base_::Vertex_handle Vertex_handle; typedef typename Edge_base_::Disk_handle Disk_handle; - Edge() {} + Edge() {} Edge(bool s, Disk_handle p) : Edge_base_(s,p) {} - Edge(Vertex_handle v0 , Vertex_handle v1 , + Edge(Vertex_handle v0 , Vertex_handle v1 , Disk_handle p) : Edge_base_(v0,v1,p) {} Edge( const Edge_base_& h) @@ -156,14 +156,14 @@ public: }; -template class VC_in_place_list +template class VC_in_place_list :public In_place_list { typedef In_place_list Base; private: // Prevent copy. VC_in_place_list(const VC_in_place_list&) {} VC_in_place_list& operator=(const VC_in_place_list&) {} -public: +public: VC_in_place_list() {} void erase(T* pos) { CGAL_precondition(pos->next_link&&pos->prev_link); @@ -177,10 +177,10 @@ public: } }; -template < class Gtr_ , +template < class Gtr_ , class It = Items , class Flip = Flip_traits > -class Antichain +class Antichain : public VC_in_place_list< Visibility_complex_2_details::Edge< typename It::template Edge_wrapper< @@ -190,7 +190,7 @@ class Antichain public: // ------------------------------------------------------------------------- typedef Gtr_ Gt; - typedef typename Gtr_::Disk Disk; + typedef typename Gtr_::Disk Disk; typedef typename Gtr_::Point_2 Point_2; typedef typename Gtr_::Bitangent_2 Bitangent_2; typedef typename Bitangent_2::Disk_handle Disk_handle; @@ -237,22 +237,22 @@ public: typedef Antichain_face_iterator Face_iterator; typedef Antichain_face_iterator + const Face&,const Face_handle> Face_const_iterator; // ------------------------------------------------------------------------- typedef Antichain_vertex_iterator + Vertex_handle, typename Ccw_traits::Sup> Vertex_iterator; typedef Antichain_vertex_iterator + const Vertex_handle, + typename Ccw_traits::Sup> Vertex_const_iterator; typedef Antichain_vertex_iterator + Vertex_handle, typename Cw_traits::Sup> Vertex_cw_iterator; typedef Antichain_vertex_iterator + typename Cw_traits::Sup> Vertex_cw_const_iterator; // ------------------------------------------------------------------------- typedef Visibility_complex_2_details::Linear_sweep_iterator Antichain(bool linear,DiskIterator first, DiskIterator last, - ConstraintIterator firstc,ConstraintIterator lastc); + ConstraintIterator firstc,ConstraintIterator lastc); // ------------------------------------------------------------------------- // Options when sweeping bool is_valid() const { return valid_; } @@ -352,31 +352,31 @@ public : // Iterator pairs for trversing the sink of the faces of the antichain // These vertices form the Greedy pseudo-triangulation Vertex_iterator vertices_begin() - { return Vertex_iterator(this,begin()); } + { return Vertex_iterator(this,begin()); } Vertex_const_iterator vertices_begin() const - { return Vertex_const_iterator(this,begin()); } + { return Vertex_const_iterator(this,begin()); } Vertex_iterator vertices_end() - { return Vertex_iterator(this,end()); } + { return Vertex_iterator(this,end()); } Vertex_const_iterator vertices_end() const - { return Vertex_const_iterator(this,end()); } + { return Vertex_const_iterator(this,end()); } // ------------------------------------------------------------------------- // Iterator pairs for trversing the sources of the faces of the antichain // These vertices form the dual Greedy pseudo-triangulation Vertex_cw_iterator cw_vertices_begin() - { return Vertex_cw_iterator(this,begin()); } + { return Vertex_cw_iterator(this,begin()); } Vertex_cw_const_iterator cw_vertices_begin() const - { return Vertex_cw_const_iterator(this,begin()); } + { return Vertex_cw_const_iterator(this,begin()); } Vertex_cw_iterator cw_vertices_end() - { return Vertex_cw_iterator(this,end()); } + { return Vertex_cw_iterator(this,end()); } Vertex_cw_const_iterator cw_vertices_end() const - { return Vertex_cw_const_iterator(this,end()); } + { return Vertex_cw_const_iterator(this,end()); } // ------------------------------------------------------------------------- - Edge_iterator edges_begin() { return begin(); } - Edge_const_iterator edges_begin() const { return begin(); } - Edge_iterator edges_end() { return end(); } - Edge_const_iterator edges_end() const { return end(); } - Edge_reverse_iterator edges_rbegin() { return rbegin(); } - Edge_reverse_iterator edges_rend() { return rend(); } + Edge_iterator edges_begin() { return begin(); } + Edge_const_iterator edges_begin() const { return begin(); } + Edge_iterator edges_end() { return end(); } + Edge_const_iterator edges_end() const { return end(); } + Edge_reverse_iterator edges_rbegin() { return rbegin(); } + Edge_reverse_iterator edges_rend() { return rend(); } // ------------------------------------------------------------------------- Face_iterator faces_begin() {return Face_iterator(this,begin());} Face_const_iterator faces_begin()const{return Face_iterator(this,begin());} @@ -393,21 +393,21 @@ public : Minimals_iterator minimals_end (Cw_traits) { return cw_minimals_end(); } // ------------------------------------------------------------------------- // Iterator pair for linear sweep - Linear_sweep_iterator sweep_begin() + Linear_sweep_iterator sweep_begin() { return Linear_sweep_iterator(this); } - Linear_sweep_const_iterator sweep_begin() const + Linear_sweep_const_iterator sweep_begin() const { return Linear_sweep_const_iterator(this); } Linear_sweep_iterator sweep_end() { return Linear_sweep_iterator(this,0); } - Linear_sweep_const_iterator sweep_end() const + Linear_sweep_const_iterator sweep_end() const { return Linear_sweep_const_iterator(this,0); } // ------------------------------------------------------------------------- // Testing minimality - template < class Tr > + template < class Tr > bool is_minimal(const Vertex_handle& v, Tr tr) const; bool is_minimal(const Vertex_handle& v) const { return is_minimal(v,Ccw_traits()); } - template < class Tr > + template < class Tr > bool is_xx_minimal(const Vertex_handle& v,Tr tr) const; bool is_right_minimal(const Vertex_handle& v) const { return is_xx_minimal(v,Right_ccw_traits()); } @@ -415,13 +415,13 @@ public : { return is_xx_minimal(v,Left_ccw_traits()); } // ------------------------------------------------------------------------- Vertex_handle pop_minimal(bool finite = false); - template < class Tr > + template < class Tr > bool is_swept_regular(const Vertex_handle& v , Tr tr) const; - template < class Tr > + template < class Tr > bool is_swept_constraint(const Vertex_handle& v , Tr tr) const; - template < class Tr > + template < class Tr > bool is_swept(const Vertex_handle& v , Tr tr) const; - bool is_swept(const Vertex_handle& v) const + bool is_swept(const Vertex_handle& v) const { return is_swept(v,Ccw_traits()); } // ------------------------------------------------------------------------- // Adding a minimal @@ -434,7 +434,7 @@ public : void erase_minimal(Vertex_handle v, Cw_traits) { minimals_cw_.erase(v); } void erase_minimal(Vertex_handle v) { erase_minimal(v, Ccw_traits()); } // Depreciated - for backward compatibility - template < class Tr > + template < class Tr > void erase_minimal(Minimals_iterator v,Tr tr) { erase_minimal(&(*v),tr); } void erase_minimal(Minimals_iterator v) { erase_minimal(v,Ccw_traits()); } // ------------------------------------------------------------------------- @@ -462,22 +462,22 @@ protected: template < class Tr > Vertex_handle compute_phi(Vertex_handle v , Tr tr) { // ------------------------------------------------------------------------- - typename Tr::Sup sup; - typename Tr::Inf inf; + typename Tr::Sup sup; + typename Tr::Inf inf; typename Tr::Set_sup set_sup; typename Tr::Set_inf set_inf; typename Tr::Splice splice; typename Tr::Cw_source_edge cw_source_edge; typename Tr::Cw_target_edge cw_target_edge; typename Tr::Ccw_source_edge ccw_source_edge; typename Tr::Ccw_target_edge ccw_target_edge; - typename Tr::CcL ccL; typename Tr::CcR ccR; + typename Tr::CcL ccL; typename Tr::CcR ccR; typename Tr::Is_left_xx is_left_xx; // ------------------------------------------------------------------------- Vertex_handle phiv; // The new Vertex that we must compute // ------------------------------------------------------------------------- // Vertex has already been swept. if (sup(v) != 0) { - phiv = sup(sup(v)); + phiv = sup(sup(v)); } // ------------------------------------------------------------------------- // The pi of the Vertex has already been swept. We use the formula: @@ -487,7 +487,7 @@ protected: if (is_on_convex_hull(v)) { if (is_left_xx(v) && ccL(v->pi()) != 0) ccR(v)->set_pi(ccL(v->pi())); - if (!is_left_xx(v) && ccR(v->pi()) != 0) + if (!is_left_xx(v) && ccR(v->pi()) != 0) ccL(v)->set_pi(ccR(v->pi())); } phiv = sup(sup(v->pi()))->pi(); @@ -499,8 +499,8 @@ protected: phiv=phiv->pi(); } // ------------------------------------------------------------------------- - // We flip v in the current pseudo-triangulation. - // To compute phi(v) we walk on the incident pseudo-triangles. + // We flip v in the current pseudo-triangulation. + // To compute phi(v) we walk on the incident pseudo-triangles. //else phiv = Chi2_strategy(this)(v,tr); else phiv = Flip_traits(this)(v,tr); // ------------------------------------------------------------------------- @@ -519,22 +519,22 @@ protected: splice(ccw_source_edge(vv->pi()),phiv->pi()); } else { CGAL_assertion(cw_source_edge(phiv)==ccw_source_edge(vv)); - splice(ccw_target_edge(vv->pi()),phiv->pi()); + splice(ccw_target_edge(vv->pi()),phiv->pi()); } vv=inf(cw_target_edge(phiv)); if (cw_target_edge(phiv)==ccw_target_edge(vv)) { splice(ccw_source_edge(vv->pi()),phiv->pi()); } else { CGAL_assertion(cw_target_edge(phiv)==ccw_source_edge(vv)); - splice(ccw_target_edge(vv->pi()),phiv->pi()); + splice(ccw_target_edge(vv->pi()),phiv->pi()); } if (sup(v->pi()) == 0) set_sup(v->pi(),new Face); set_inf(sup(v->pi()),v->pi()); - set_sup(sup(v->pi()),phiv?phiv->pi():0); + set_sup(sup(v->pi()),phiv?phiv->pi():0); } // ------------------------------------------------------------------------- CGAL_postcondition(sup(v) != 0 && (sup(sup(v)) != 0)); - return phiv; + return phiv; } // ------------------------------------------------------------------------- // Update the antichain while adding a constraint @@ -542,11 +542,11 @@ protected: template < class Tr > void sweep_regular (const Vertex_handle& v, const Tr&,bool opposite=false) const; // ------------------------------------------------------------------------- // Initialisation methods - template + template void compute_graph(DiskIterator first, DiskIterator last, ConstraintIterator firstc,ConstraintIterator lastc); struct compute_gr_aux; - template + template void compute_gr(DiskIterator first, DiskIterator last, ConstraintIterator firstc,ConstraintIterator lastc); template < class Tr > void compute_minimals(Tr tr); @@ -581,14 +581,14 @@ protected: if (f==0) f=infinite_face_; if (f!=infinite_face_) o<<"face_node_"< void graphviz_print(OutputStream& o) { - + o<<"digraph {ranksep=0.2\n"; o<<"subgraph{ordering=in;\n"; for (Edge_iterator i=edges_begin();i!=edges_end();++i) { @@ -606,7 +606,7 @@ protected: } node(o,infinite_face_,true)<<"[label=\"inf-"<object()) { @@ -644,18 +644,18 @@ public: void print(Vertex_handle v) { //std::cout << v << " " << flush; - if (v == 0) return; + if (v == 0) return; std::cout << *v << " , ("; if (v->is_left_xx()) std::cout << "+"; else std::cout << "-"; std::cout << Key[long(v->source_object())] << ","; if (v->is_xx_left()) std::cout << "+"; else std::cout << "-"; std::cout << Key[long(v->target_object())] << ")" ; /* - std::cout << " minLR(" << flush - << is_xx_minimal(v,Left_ccw_traits()) << "," << flush + std::cout << " minLR(" << flush + << is_xx_minimal(v,Left_ccw_traits()) << "," << flush << is_xx_minimal(v,Right_ccw_traits()) << ")"; - std::cout << " cw_minLR(" << flush - << is_xx_minimal(v,Left_cw_traits()) << "," << flush + std::cout << " cw_minLR(" << flush + << is_xx_minimal(v,Left_cw_traits()) << "," << flush << is_xx_minimal(v,Right_cw_traits()) << ")"; if (is_swept(v)) std::cout << " swept"; else std::cout << " not swept"; @@ -663,7 +663,7 @@ public: } void print(Edge_handle e, bool coord = true) { std::cout << e << " " << flush; - if (e == 0) return; + if (e == 0) return; if (e->object() == 0) { if (e == e->sup()->target_cusp_edge()) std::cout << "-" << Key[long(e->sup()->target_object())] << "c"; @@ -674,12 +674,12 @@ public: std::cout << Key[long(e->object())] ; } std::cout << " {"; - if (e->sign()) - std::cout << e->dl() << "," - << e->ur() << "," + if (e->sign()) + std::cout << e->dl() << "," + << e->ur() << "," << e->ul(); - else std::cout << e->dl() << "," - << e->dr() << "," + else std::cout << e->dl() << "," + << e->dr() << "," << e->ul(); std::cout << "}"; if (coord) { @@ -689,8 +689,8 @@ public: } void print(Face_handle f) { std::cout << f << " " << flush; - if (f == 0) return; - std::cout << "[" ; + if (f == 0) return; + std::cout << "[" ; print(f->bottom_edge()); std::cout << ","; print(f->top_edge()); std::cout << "]"; std::cout << " inf = " << f->inf() << " , sup = " << f->sup(); @@ -723,7 +723,7 @@ public: for (typename std::vector::iterator first=disks.begin();first!=disks.end();first++,j++) { *w<<**first; Bbox_2 bb=(*first)->bbox(); - typename CGAL::Point_2 > + typename CGAL::Point_2 > A((bb.xmin()+bb.xmax())/2,(bb.ymin()+bb.ymax())/2); std::ostringstream n; n<unlock();; app.exec(); - exit(0); + std::exit(0); } } void view_bit(Vertex_handle v) { @@ -752,19 +752,19 @@ public: for (typename std::vector::iterator first=disks.begin();first!=disks.end();first++,j++) { *w<<**first; Bbox_2 bb=(*first)->bbox(); - typename CGAL::Point_2 > + typename CGAL::Point_2 > A((bb.xmin()+bb.xmax())/2,(bb.ymin()+bb.ymax())/2); std::ostringstream n; n<get_painter().drawText(w->x_pixel(A.x())-15,w->y_pixel(A.y()),n.str()); - } + } } *w<(*v); *w<source(),100); w->unlock(); app.exec(); - exit(0); + std::exit(0); } } template void view_pt(ii i,ii ie,Vertex_handle v=0) { @@ -786,7 +786,7 @@ public: for (typename std::vector::iterator first=disks.begin();first!=disks.end();first++,j++) { *w<<(*(*first)); Bbox_2 bb=(*first)->bbox(); - typename CGAL::Point_2 > + typename CGAL::Point_2 > A((bb.xmin()+bb.xmax())/2,(bb.ymin()+bb.ymax())/2); std::ostringstream n; n<(*v); - *w<source(),100); + *w<source(),100); if (!v->is_constraint()) { *w<(*v->sup()->sup()); @@ -809,7 +809,7 @@ public: } w->unlock(); app.exec(); - exit(0); + std::exit(0); } } #endif @@ -858,7 +858,7 @@ Antichain(bool linear,DiskIterator first, DiskIterator last , compute_minimals(Ccw_traits()); compute_minimals(Cw_traits()); - for (Face_iterator f=faces_begin();f!=faces_end();++f) + for (Face_iterator f=faces_begin();f!=faces_end();++f) f->set_in_initial_antichain(true); // Create symetrical faces for the initial antichain. @@ -873,7 +873,7 @@ Antichain(bool linear,DiskIterator first, DiskIterator last , Face_handle f=v1->sup(); if (!f) { if (v1->is_constraint()) { - if (fs[i]==v1->source_cusp_face()) + if (fs[i]==v1->source_cusp_face()) f=v2->target_cusp_face(); else f=v2->source_cusp_face(); @@ -882,11 +882,11 @@ Antichain(bool linear,DiskIterator first, DiskIterator last , v1->set_sup(f); f->set_inf(v1); v2->set_inf(f); - f->set_sup(v2); + f->set_sup(v2); } } Edge_handle eo; - if (e.operator->()==e->inf()->ccw_source_edge()) + if (e.operator->()==e->inf()->ccw_source_edge()) eo=e->inf()->pi()->ccw_target_edge(); else eo=e->inf()->pi()->ccw_source_edge(); @@ -905,7 +905,7 @@ Antichain(bool linear,DiskIterator first, DiskIterator last , -template < class Gtr_ , class It , class Flip > +template < class Gtr_ , class It , class Flip > struct Antichain::compute_gr_aux { @@ -922,7 +922,7 @@ struct Antichain::compute_gr_aux { chain* left_neighbour; chain* right_neighbour; chain* currently_inserted; - Less_chain() : edg(0),left_neighbour(0), right_neighbour(0), + Less_chain() : edg(0),left_neighbour(0), right_neighbour(0), currently_inserted(0) {} void set_currently_inserted(chain *a) { currently_inserted=a; @@ -938,9 +938,9 @@ struct Antichain::compute_gr_aux { } bool leftp(Disk_handle d2) const { Bitangent_2 b(Bitangent_2::RL,edg->object(),d2); - return is_upward_directed(b); + return is_upward_directed(b); } - Comparison_result auxl (Disk_handle d,Disk_handle, + Comparison_result auxl (Disk_handle d,Disk_handle, Vertex_handle v2, Bitangent_2* blr) const { if (!v2||lb(*v2,*blr)) return SMALLER; else { if (v2->is_right_right()) { @@ -951,11 +951,11 @@ struct Antichain::compute_gr_aux { Bitangent_2 b2(Bitangent_2::RL,d,v2->target_object()); if (is_upward_directed(b2)&&lb(*v2,b2)) return LARGER; else return SMALLER; - } + } } } - Comparison_result auxr (Disk_handle d,Disk_handle, + Comparison_result auxr (Disk_handle d,Disk_handle, Vertex_handle v2, Bitangent_2* brl) const { if (!v2||lb(*brl,*v2)) return LARGER; else { if (v2->is_left_left()) { @@ -966,20 +966,20 @@ struct Antichain::compute_gr_aux { Bitangent_2 b2(Bitangent_2::LR,d,v2->target_object()); if (is_upward_directed(b2)&&lb(b2,*v2)) return SMALLER; else return LARGER; - } + } } } - + Comparison_result operator()(const chain *a, const chain * b) const { CGAL_precondition(a==currently_inserted); if (a==b) return EQUAL; - + if (a->t==chain::REGULAR_CHAIN) { // should not occur, except if insert_before and insert_after // perform assertion checking. if (b==left_neighbour) return LARGER; if (b==right_neighbour) return SMALLER; - CGAL_assertion(false); + CGAL_error(); } // a is the chain of the disk being inserted if (b->t==chain::OBJECT) { @@ -1001,7 +1001,7 @@ struct Antichain::compute_gr_aux { return LARGER; } } - case chain::VtxArcVtx: + case chain::VtxArcVtx: { constraint_entry *v1=b->iplb[0].v; constraint_entry *v2=b->iplb[1].v; @@ -1015,20 +1015,20 @@ struct Antichain::compute_gr_aux { if ((v1?v1->vtx->is_xx_left():v2->vtx->is_left_xx())) { Bitangent_2 brl(Bitangent_2::RL,a->d,d); if (!is_upward_directed(brl)) return SMALLER; - if (!v1||lb(*(v1->vtx),brl)) - return auxr(a->d,d,v2?v2->vtx:0,&brl); - else + if (!v1||lb(*(v1->vtx),brl)) + return auxr(a->d,d,v2?v2->vtx:0,&brl); + else return SMALLER; } else { Bitangent_2 blr(Bitangent_2::LR,a->d,d); if (!is_upward_directed(blr)) return LARGER; - if (!v1||lb(blr,*(v1->vtx))) - return auxl(a->d,d,v2?v2->vtx:0,&blr); - else + if (!v1||lb(blr,*(v1->vtx))) + return auxl(a->d,d,v2?v2->vtx:0,&blr); + else return LARGER; } } - case chain::VtxArcVtxArcVtx: + case chain::VtxArcVtxArcVtx: { constraint_entry *v1=b->iplb[0].v; Vertex_handle v2=b->iplb[1].v->vtx; @@ -1049,7 +1049,7 @@ struct Antichain::compute_gr_aux { if (v1&&lb(brl1,*(v1->vtx))) return SMALLER; else return LARGER; } else return auxl(a->d,d2,v3?v3->vtx:0,&blr2); } - } else return LARGER; + } else return LARGER; } else return SMALLER; } else { Bitangent_2 blr1(Bitangent_2::LR,a->d,d1); @@ -1071,7 +1071,7 @@ struct Antichain::compute_gr_aux { } } }; - typedef Multiset Ystructure; + typedef Multiset Ystructure; }; struct chain { @@ -1088,13 +1088,13 @@ struct Antichain::compute_gr_aux { IPLB(chain * c) : super(c),v(0) {}; IPLB() {super=0;v=0;} }; - + IPLB iplb[3]; // one IPLB for each vertex in the window enum chain_type { OBJECT, REGULAR_CHAIN }; - + Face_handle left; Face_handle right; @@ -1132,18 +1132,18 @@ struct Antichain::compute_gr_aux { chain() { iplb[0]=iplb[1]=iplb[2]=IPLB(this); }; - }; + }; typedef typename wrapper::Less_chain Less_chain; typedef typename wrapper::Ystructure Ystructure; struct disk_entry { Disk_handle d; - + struct side { VV constraints; }; - + side lhs; // left hand side constraints side rhs; // right hand side constraints @@ -1218,7 +1218,7 @@ compute_gr(DiskIterator first, DiskIterator last, typedef typename compute_gr_aux::Less_constraintl Less_constraintl; typedef typename compute_gr_aux::Less_constraintr Less_constraintr; - + typedef std::vector Xstructure; Xstructure XE; // the events @@ -1256,7 +1256,7 @@ compute_gr(DiskIterator first, DiskIterator last, typename Gtr_::Is_upward_directed is_upward_directed; typedef std::map VCEM; VCEM vcem; - + VV bogusvv; typename VV::iterator bogusvvi=bogusvv.end(); @@ -1326,7 +1326,7 @@ compute_gr(DiskIterator first, DiskIterator last, constraint_entry * prev_out_constraint=0; chain * prev_out_chain=&dei->second.ch; - + if (!dei->second.rhs.constraints.empty()) { typename VV::iterator i=dei->second.rhs.constraints.end(); @@ -1380,11 +1380,11 @@ compute_gr(DiskIterator first, DiskIterator last, XE.push_back(dei->second.neg); } std::sort(XE.begin(),XE.end(),Less_edge_handle()); - + Ystructure YE; // the chains intersected by the sweep line Less_chain& LC=YE.key_comp(); - + struct utils { VCEM& vcem; DDEM& dem; @@ -1412,7 +1412,7 @@ compute_gr(DiskIterator first, DiskIterator last, // called when the bottom of the window passes the first cusp void remove_chain(chain *ch) { if (ch->status!=0) return; - + constraint_entry *v=ch->iplb[0].v; Edge_handle cusp=v->vtx->target_cusp_edge(); Face_handle fdead,fcusp; @@ -1493,7 +1493,7 @@ compute_gr(DiskIterator first, DiskIterator last, if (de4->status!=0) goto extend; e=LC.edg; LC.set_pos(de4->pos); - b=LC.leftp(v2->vtx->source_object()); + b=LC.leftp(v2->vtx->source_object()); LC.set_pos(e); if (v2->vtx->is_right_left()) b=!b; if (b) { @@ -1512,10 +1512,10 @@ compute_gr(DiskIterator first, DiskIterator last, } }; - + utils U(vcem,dem,XE,YE,LC); - + Face lower_outer_face; @@ -1531,7 +1531,7 @@ compute_gr(DiskIterator first, DiskIterator last, } LC.set_pos(e); - + if (e->sign()) { // finding where to insert the new chains LC.set_currently_inserted(&de->ch); @@ -1690,7 +1690,7 @@ compute_gr(DiskIterator first, DiskIterator last, // nothing to be done with ipl[0]: the window is already beyond // the disk - + for (typename constraint_entry::IPL::iterator j=ve->ipl[1].begin(); j!=ve->ipl[1].end();j=tmp) { tmp=j; ++tmp; @@ -1713,7 +1713,7 @@ compute_gr(DiskIterator first, DiskIterator last, // entering constraints, all their chains have seen or are seeing // their windows pass a cusp, and can therefore be removed typename constraint_entry::IPL::iterator tmp; - + for (typename constraint_entry::IPL::iterator j=ve->ipl[0].begin(); j!=ve->ipl[0].end();j=tmp) { tmp=j; ++tmp; @@ -1737,13 +1737,13 @@ compute_gr(DiskIterator first, DiskIterator last, if ((*i)->vtx->source_object()==de->d) { typename constraint_entry::IPL::iterator tmp; - + for (typename constraint_entry::IPL::iterator j=ve->ipl[1].begin(); j!=ve->ipl[1].end();j=tmp) { tmp=j; ++tmp; if (dem[v->target_object()].status==0) { if (U.f1(j->super,ve,ve->target_next_out)) - U.f3(j->super); + U.f3(j->super); } else U.f2(j->super,ve); } for (typename constraint_entry::IPL::iterator j=ve->ipl[2].begin(); @@ -1760,7 +1760,7 @@ compute_gr(DiskIterator first, DiskIterator last, // entering constraints, all their chains have seen or are seeing // their windows pass a cusp, and can therefore be removed typename constraint_entry::IPL::iterator tmp; - + for (typename constraint_entry::IPL::iterator j=ve->ipl[0].begin(); j!=ve->ipl[0].end();j=tmp) { tmp=j; ++tmp; @@ -1821,7 +1821,7 @@ compute_graph(DiskIterator first, DiskIterator last, CGAL_expensive_precondition_code( Do_intersect do_intersect; ); valid_ = true; // ------------------------------------------------------------------------- - // X-structure containing the nodes of the antichain == edges of + // X-structure containing the nodes of the antichain == edges of // Visibility graph typedef std::priority_queue, @@ -1839,13 +1839,13 @@ compute_graph(DiskIterator first, DiskIterator last, typename Ccw_traits::Set_adjacent_faces_one_to_one set_adjacent_faces; // Regular edges - two per disk for (DiskIterator it = first; it != last ; ++it ) { - Edge_handle neg = new Edge(false,&(*it)); + Edge_handle neg = new Edge(false,&(*it)); Edge_handle pos = new Edge(true,&(*it)); - push_back(*neg); push_back(*pos); + push_back(*neg); push_back(*pos); XE.push(neg); XE.push(pos); set_adjacent_faces(neg,new Face,new Face,0); set_adjacent_faces(pos,new Face,0,0); - neg->dl()->set_front_view(neg); + neg->dl()->set_front_view(neg); neg->dr()->set_back_view(pos); opposite[(neg)] = pos; opposite[(pos)] = neg; @@ -1861,21 +1861,21 @@ compute_graph(DiskIterator first, DiskIterator last, Vertex_handle d = (is_upward_directed(*c)) ? &(*c) : c->pi(); push_back(*d->target_cusp_edge()); push_back(*d->source_cusp_edge()); - XE.push(d->target_cusp_edge()); + XE.push(d->target_cusp_edge()); XE.push(d->source_cusp_edge()); } if (XE.size() == 2) { valid_ = false; return; } // ------------------------------------------------------------------------- #if 0 int index = 1; - for (Edge_iterator e = edges_begin(); e != edges_end(); ++e) + for (Edge_iterator e = edges_begin(); e != edges_end(); ++e) { if (!e->sign()) { - Key[long(e->object())] = index; + Key[long(e->object())] = index; Key[long(&(*e))] = -index; } else { - Key[long(&(*e))] = +index; + Key[long(&(*e))] = +index; ++index; } } @@ -1938,7 +1938,7 @@ compute_graph(DiskIterator first, DiskIterator last, } // ----------------------------------------------------------------- // Inserting a cusp Edge from an xx-left constraint - else if (pe->sup()->is_xx_left()) { + else if (pe->sup()->is_xx_left()) { // ------------------------------------------------------------- // Find the place where to insert the constraint Face_handle right = new Face; right->set_front_view(pe); @@ -2008,7 +2008,7 @@ compute_graph(DiskIterator first, DiskIterator last, delete pe->dl(); set_adjacent_faces(pe,0,upright,upleft); } - else { + else { set_adjacent_faces(pe,pe->dl(),upright,upleft); pe->dl()->set_front_view(upright->front_view()); pe->dl()->set_back_view (upleft->back_view()); @@ -2030,7 +2030,7 @@ compute_graph(DiskIterator first, DiskIterator last, else if (pe->sup()->is_left_xx()) { // ------------------------------------------------------------- // Find the face in YE with pe->sup() as a front view. - Face_handle upleft = new Face; + Face_handle upleft = new Face; upleft->set_front_view(pe->sup()->target_cusp_edge()); typename Ystructure::iterator upleft_it = YE.find(upleft); typename Ystructure::iterator right = upleft_it; ++right; @@ -2055,7 +2055,7 @@ compute_graph(DiskIterator first, DiskIterator last, else { // ------------------------------------------------------------- // Find the face in YE with pe->sup() as a front view. - Face_handle left = new Face; + Face_handle left = new Face; left->set_front_view(pe->sup()->target_cusp_edge()); typename Ystructure::iterator left_it = YE.find(left); typename Ystructure::iterator upright = left_it; ++upright; @@ -2071,9 +2071,9 @@ compute_graph(DiskIterator first, DiskIterator last, CGAL_precondition(pe->dl() == 0 && pe->ul() == 0); // ------------------------------------------------------------- // Update the back view of left and insert the face. - YE.erase(left_it); YE.erase(upright); + YE.erase(left_it); YE.erase(upright); left->set_front_view(pe->sup()->ccw_source_edge()); - YE.insert(left); + YE.insert(left); // ------------------------------------------------------------- } // ----------------------------------------------------------------- @@ -2111,12 +2111,12 @@ void Antichain::compute_vertices(Tr) { // ------------------------------------------------------------------------- - // All the operators from this methods are taken from the algorithm traits + // All the operators from this methods are taken from the algorithm traits // class Tr. Two traits classes are given : Ccw_traits and Cw_traits to // compute G and G_* respectively typename Tr::Sup sup; typename Tr::Inf inf; typename Tr::Set_sup set_sup;// typename Tr::Set_inf set_inf; - typename Tr::Vertex_creator vc; + typename Tr::Vertex_creator vc; typename Tr::Set_adjacent_faces set_adjacent_old_faces; typename Tr::Set_adjacent_faces_one_to_one set_adjacent_faces; typename Tr::Dr dr; typename Tr::Dl dl; @@ -2144,7 +2144,7 @@ Antichain::compute_vertices(Tr) // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- - // death is the event queue. + // death is the event queue. // It contains the vertices which are about to appear. // Pushing first candidates to initialize death vertices std::set death; @@ -2166,12 +2166,12 @@ Antichain::compute_vertices(Tr) Vertex_handle vmin = *death.begin(); death.erase(death.begin()); // --------------------------------------------------------------------- - Edge_handle top = (vmin->is_constraint()) ? cw_target_edge(vmin) : + Edge_handle top = (vmin->is_constraint()) ? cw_target_edge(vmin) : inf(vmin)->top_edge(); - Edge_handle bot = (vmin->is_constraint()) ? cw_source_edge(vmin) : + Edge_handle bot = (vmin->is_constraint()) ? cw_source_edge(vmin) : inf(vmin)->bottom_edge(); // --------------------------------------------------------------------- - // A new Vertex ( == bitangent) has been found + // A new Vertex ( == bitangent) has been found // splice the two edges defining it if (vmin != sup(top)) splice(top,vmin); if (vmin != sup(bot)) splice(bot,vmin); @@ -2182,7 +2182,7 @@ Antichain::compute_vertices(Tr) else { ef[0] = dl(bot); ef[1] = dr(bot); ef[2] = ul(bot); } if (top->sign()) { ef[3] = dl(top); ef[4] = ur(top); ef[5] = ul(top); } else { ef[3] = dl(top); ef[4] = dr(top); ef[5] = ul(top); } - for (int i = 0 ; i < 6 ; i++) + for (int i = 0 ; i < 6 ; i++) if (is_candidate(ef[i], Tr()) && sup(ef[i]) != vmin) { death.erase(sup(ef[i])); if (!sup(ef[i])->is_constraint()) { @@ -2201,16 +2201,16 @@ Antichain::compute_vertices(Tr) // bot and top. bot = ccw_source_edge(vmin); top = ccw_target_edge(vmin); - if (sup(bot) != 0 && sup(bot)->is_constraint() // && + if (sup(bot) != 0 && sup(bot)->is_constraint() // && // is_minimal(sup(bot),tr) - ) + ) death.insert(sup(bot)); - if (sup(top) != 0 && sup(top)->is_constraint() // && + if (sup(top) != 0 && sup(top)->is_constraint() // && // is_minimal(sup(top),tr) ) death.insert(sup(top)); Face_handle af[] = { dl(bot) , ur(bot) , dl(top) , ur(top) }; - for (int i = 0 ; i < 4 ; i++) + for (int i = 0 ; i < 4 ; i++) if (is_candidate(af[i], Tr()) && sup(af[i]) != vmin && sup(af[i]) != vmin->pi()) { if (sup(af[i]) == 0) set_sup(af[i],vc(af[i]->bottom_edge(), @@ -2218,7 +2218,7 @@ Antichain::compute_vertices(Tr) death.insert(sup(af[i])); } // --------------------------------------------------------------------- - } // end while (death.size() != 0) + } // end while (death.size() != 0) // Recovering the initial Edge --> Face pointers with a { @@ -2239,7 +2239,7 @@ Antichain::compute_minimals(Tr tr) { // ------------------------------------------------------------------------- // Operators used in this method. - typename Tr::Sup sup; + typename Tr::Sup sup; typedef typename Tr::Right_traits Right_traits; typename Right_traits::Target_cusp_edge target_cusp_edge; typename Right_traits::Top_edge top_edge; @@ -2249,13 +2249,13 @@ Antichain::compute_minimals(Tr tr) for (Face_iterator fi = faces_begin(); fi != faces_end() ; ++fi) { Face_handle f = &(*fi); if (sup(f) != 0 && is_minimal(sup(f),tr)) { - if (!sup(f)->is_constraint() || + if (!sup(f)->is_constraint() || top_edge(f) == target_cusp_edge(sup(f))) { Vertex_handle v = sup(f); if (v != ll && v != rr) push_back_minimal(sup(f),tr); - if (ll == 0 && v->is_left_left() && + if (ll == 0 && v->is_left_left() && is_on_convex_hull(v)) ll = v; - else if (rr == 0 && v->is_right_right() && + else if (rr == 0 && v->is_right_right() && is_on_convex_hull(v)) rr = v; } } @@ -2279,12 +2279,12 @@ initialize_convex_hull(Tr /*tr*/) const typename Tr::Cw_target_edge cw_target_edge; typename Tr::Sup sup; typename Tr::Inf inf; - + Edge_handle e = infinite_face()->bottom_edge(); do { e = ccw_source_edge(sup(e)); set_adjacent_faces(e,dl(e),dr(e),infinite_face()); - } while (sup(e)&&e != infinite_face()->bottom_edge()); + } while (sup(e)&&e != infinite_face()->bottom_edge()); if (!sup(e)) { e=infinite_face()->bottom_edge(); @@ -2298,7 +2298,7 @@ initialize_convex_hull(Tr /*tr*/) const do { e = ccw_target_edge(sup(e)); set_adjacent_faces(e,infinite_face(), ur(e),ul(e)); - } while (sup(e)&&e != infinite_face()->top_edge()); + } while (sup(e)&&e != infinite_face()->top_edge()); if (!sup(e)) { e=infinite_face()->top_edge(); @@ -2316,25 +2316,25 @@ initialize_convex_hull(Tr /*tr*/) const template < class Gtr_ , class It , class Flip > template < class Tr > void -Antichain::fix_extreme_edges(Tr /*tr*/) const // warning tr is never used +Antichain::fix_extreme_edges(Tr /*tr*/) const // warning tr is never used { //-------------------------------------------------------------------------- // Operators used in this method. typename Tr::Sup sup; typename Tr::Inf inf; - typename Tr::Set_sup set_sup; typename Tr::Set_inf set_inf; + typename Tr::Set_sup set_sup; typename Tr::Set_inf set_inf; typename Tr::Dr dr; typename Tr::Dl dl; typename Tr::Ur ur; typename Tr::Ul ul; typename Tr::CcL ccL; typename Tr::CcR ccR; typename Tr::Set_adjacent_faces set_adjacent_faces; - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- Edge_handle bot = infinite_face()->top_edge(); // Bottommost edge Edge_handle top = infinite_face()->bottom_edge(); // Topmost edge set_adjacent_faces(bot,infinite_face(),ur(bot),ul(bot)); set_adjacent_faces(top,dl(top),dr(top),infinite_face()); - // ------------------------------------------------------------------------- - // A face may appear twice in the antichain due to our identification + // ------------------------------------------------------------------------- + // A face may appear twice in the antichain due to our identification // v = v->pi()->pi(). If this is the case, delete one of the two and update - // pointers. + // pointers. if (ur(bot) == dr(top) && ul(bot) != dl(top)) { Face_handle f = ul(bot); Edge_handle t = f->top_edge(); @@ -2353,7 +2353,7 @@ Antichain::fix_extreme_edges(Tr /*tr*/) const // warning tr is nev set_adjacent_faces(top,dl(top),ur(bot),ul(top)); delete f; } - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // Set the sink of the two faces on the convex-hull. if (sup(ur(bot)) != 0 && sup(ul(bot)) == 0) { Vertex_handle v = sup(ur(bot)); @@ -2477,18 +2477,18 @@ Antichain::glue() } } } - - // ------------------------------------------------------------------------- + + // ------------------------------------------------------------------------- } - + // Identifying vertices of the convex-hull template < class Gtr_ , class It , class Flip > -inline bool +inline bool Antichain:: is_on_convex_hull(Vertex_handle v) const { - return ((v->is_left_left() && v->cw_source_edge() != 0 && + return ((v->is_left_left() && v->cw_source_edge() != 0 && v->cw_source_edge()->dr() == infinite_face()) || (v->is_right_right() && v->cw_target_edge() != 0 && v->cw_target_edge()->ul() == infinite_face())); @@ -2498,23 +2498,23 @@ is_on_convex_hull(Vertex_handle v) const // Minimality Testing template < class Gtr_ , class It , class Flip > -template < class Tr > -inline bool +template < class Tr > +inline bool Antichain:: is_minimal(const Vertex_handle& v, Tr /*tr*/) const { typename Tr::Left_traits lt; typename Tr::Right_traits rt; - return (is_xx_minimal(v,lt) && + return (is_xx_minimal(v,lt) && is_xx_minimal(v,rt)); } template < class Gtr_ , class It , class Flip > -template < class Tr > -inline bool +template < class Tr > +inline bool Antichain:: is_xx_minimal(const Vertex_handle& v, Tr /*tr*/ ) const -{ +{ typename Tr::Cw_source_edge cw_source_edge; if (v == 0 || cw_source_edge(v) == 0) return false; @@ -2524,8 +2524,8 @@ is_xx_minimal(const Vertex_handle& v, Tr /*tr*/ ) const // Methods to manage the list of minimals template < class Gtr_ , class It , class Flip > -template < class Tr > -void +template < class Tr > +void Antichain::clear_minimals(Tr tr) { Minimals_iterator first = minimals_begin(tr); Minimals_iterator last = minimals_end(tr); @@ -2533,26 +2533,26 @@ Antichain::clear_minimals(Tr tr) { } template < class Gtr_ , class It , class Flip > -void +void Antichain:: push_back_minimal(Vertex_handle v,Ccw_traits) { Less_bitangent lv; Minimals_iterator w = (is_straight()) ? std::lower_bound(minimals_begin(), - minimals_end(), + minimals_end(), *v,lv) : minimals_end(); minimals_ccw_.insert(w,*v); } template < class Gtr_ , class It , class Flip > -void +void Antichain:: push_back_minimal(Vertex_handle v,Cw_traits) { Greater_bitangent lv; Minimals_iterator w = (is_straight()) ? std::lower_bound(cw_minimals_begin(), - cw_minimals_end(), + cw_minimals_end(), *v,lv) : cw_minimals_end(); minimals_cw_.insert(w,*v); @@ -2570,7 +2570,7 @@ Antichain::pop_minimal(bool finite/* = false*/) else { Vertex_handle min = pop_minimal(false); if (min != 0 && is_on_convex_hull(min)) return min; - while (minimals_begin() != minimals_end() && + while (minimals_begin() != minimals_end() && min->sup() != 0 && !is_on_convex_hull(min)) { erase_minimal(min); min = pop_minimal(false); @@ -2587,7 +2587,7 @@ Antichain::sweep(Vertex_handle v , Tr tr) { //-------------------------------------------------------------------------- // Operators used in this method. - typename Tr::Inf inf;// typename Tr::Sup sup; + typename Tr::Inf inf;// typename Tr::Sup sup; typename Tr::Cw_target_edge cw_target_edge; typename Tr::Cw_source_edge cw_source_edge; typename Tr::Ccw_target_edge ccw_target_edge; @@ -2617,7 +2617,7 @@ Antichain::sweep(Vertex_handle v , Tr tr) // opposite orientation. Adding v. typename Tr::Cw_traits cw_traits; erase_minimal(v,tr); push_back_minimal(v,cw_traits); - CGAL_assertion(v!=cwR(v)&&v!=cwL(v)); + CGAL_assertion(v!=cwR(v)&&v!=cwL(v)); if (is_minimal(cwL(v),cw_traits)) erase_minimal(cwL(v),cw_traits); if (cwR(v) != cwL(v) && is_minimal(cwR(v),cw_traits)) erase_minimal(cwR(v),cw_traits); @@ -2632,7 +2632,7 @@ Antichain::sweep(Vertex_handle v , Tr tr) sweep_regular(v, Tr()); // Modify the antichain if (!linear_space()) sweep_regular(v->pi(),Tr(),true); } - erase(cw_source_edge(v)); + erase(cw_source_edge(v)); erase(cw_target_edge(v)); if (v->is_constraint()) { erase(target_cusp_edge(v)); @@ -2641,8 +2641,8 @@ Antichain::sweep(Vertex_handle v , Tr tr) push_back(*source_cusp_edge(v->pi())); } //-------------------------------------------------------------------------- - // Pushing the two new created edges - push_back(*ccw_source_edge(v)); + // Pushing the two new created edges + push_back(*ccw_source_edge(v)); push_back(*ccw_target_edge(v)); //-------------------------------------------------------------------------- // Updating minimals @@ -2673,7 +2673,7 @@ Antichain::sweep(Vertex_handle v , Tr tr) prev=0; for (typename Face::Border_iterator i=--(faces[fi]->bottom_end()); i!=faces[fi]->top_end()&&i.operator->()!=prev;--i) { - if (inf(i.operator->())!=inf(faces[fi])) + if (inf(i.operator->())!=inf(faces[fi])) vv.push_back(inf(i.operator->())); prev=i.operator->(); CGAL_assertion(!i->is_in_antichain()); @@ -2683,7 +2683,7 @@ Antichain::sweep(Vertex_handle v , Tr tr) for (typename std::vector::iterator i=vv.begin(); i!=vv.end();++i) { if (is_on_convex_hull(*i)||(*i)->is_constraint()|| - (*i)->final_antichain()) + (*i)->final_antichain()) continue; Face_handle adj[4][3]; Edge_handle e[4]={cw_source_edge(*i),cw_target_edge(*i), @@ -2697,9 +2697,9 @@ Antichain::sweep(Vertex_handle v , Tr tr) for (int k=0;k==0;k=1) { for (int l=0;l<3;l++) skip=skip||adj[k][l]!=adj[k+2][l]; } - if (!skip) { + if (!skip) { merge(cw_source_edge(*i),ccw_source_edge(*i)); - merge(cw_target_edge(*i),ccw_target_edge(*i)); + merge(cw_target_edge(*i),ccw_target_edge(*i)); delete *i; } } @@ -2716,7 +2716,7 @@ Antichain::sweep_all_minimals(Tr tr) for (Minimals_iterator m = minimals_begin(tr); m != minimals_end(tr); ++m) mins.push_back(&(*m)); typename std::list::iterator clic = mins.begin(); - for ( ; clic != mins.end() ; ++clic) + for ( ; clic != mins.end() ; ++clic) if (is_minimal(*clic,tr)) sweep(*clic,tr); } @@ -2726,7 +2726,7 @@ void Antichain::sweep_good(Vertex_handle v,Tr tr) { typename Tr::CcR ccR; typename Tr::CcL ccL; typename Tr::Sup sup; - // typename Tr::CwR cwR; typename Tr::CwL cwL; + // typename Tr::CwR cwR; typename Tr::CwL cwL; // ------------------------------------------------------------------------- sweep(v,tr); // ------------------------------------------------------------------------- @@ -2749,7 +2749,7 @@ Antichain::sweep_good_all_minimals(Tr tr) for (Minimals_iterator m = minimals_begin(tr); m != minimals_end(tr); ++m) mins.push_back(&(*m)); typename std::list::iterator clic = mins.begin(); - for ( ; clic != mins.end() ; ++clic) + for ( ; clic != mins.end() ; ++clic) if (is_minimal(*clic,tr)) sweep_good(*clic,tr); } @@ -2757,25 +2757,25 @@ Antichain::sweep_good_all_minimals(Tr tr) template < class Gtr_ , class It , class Flip > template < class Tr > Vertex_handle -Antichain::compute_phi(Vertex_handle v, Tr tr) +Antichain::compute_phi(Vertex_handle v, Tr tr) { // ------------------------------------------------------------------------- - typename Tr::Sup sup; - typename Tr::Inf inf; + typename Tr::Sup sup; + typename Tr::Inf inf; typename Tr::Set_sup set_sup; typename Tr::Set_inf set_inf; typename Tr::Splice splice; typename Tr::Cw_source_edge cw_source_edge; typename Tr::Cw_target_edge cw_target_edge; typename Tr::Ccw_source_edge ccw_source_edge; typename Tr::Ccw_target_edge ccw_target_edge; - typename Tr::CcL ccL; typename Tr::CcR ccR; + typename Tr::CcL ccL; typename Tr::CcR ccR; typename Tr::Is_left_xx is_left_xx; // ------------------------------------------------------------------------- Vertex_handle phiv; // The new Vertex that we must compute // ------------------------------------------------------------------------- // Vertex has already been swept. if (sup(v) != 0) { - phiv = sup(sup(v)); + phiv = sup(sup(v)); } // ------------------------------------------------------------------------- // The pi of the Vertex has already been swept. We use the formula: @@ -2785,7 +2785,7 @@ Antichain::compute_phi(Vertex_handle v, Tr tr) if (is_on_convex_hull(v)) { if (is_left_xx(v) && ccL(v->pi()) != 0) ccR(v)->set_pi(ccL(v->pi())); - if (!is_left_xx(v) && ccR(v->pi()) != 0) + if (!is_left_xx(v) && ccR(v->pi()) != 0) ccL(v)->set_pi(ccR(v->pi())); } phiv = sup(sup(v->pi()))->pi(); @@ -2797,8 +2797,8 @@ Antichain::compute_phi(Vertex_handle v, Tr tr) phiv=phiv->pi(); } // ------------------------------------------------------------------------- - // We flip v in the current pseudo-triangulation. - // To compute phi(v) we walk on the incident pseudo-triangles. + // We flip v in the current pseudo-triangulation. + // To compute phi(v) we walk on the incident pseudo-triangles. //else phiv = Chi2_strategy(this)(v,tr); else phiv = Flip_traits(this)(v,tr); // ------------------------------------------------------------------------- @@ -2817,29 +2817,29 @@ Antichain::compute_phi(Vertex_handle v, Tr tr) splice(ccw_source_edge(vv->pi()),phiv->pi()); } else { CGAL_assertion(cw_source_edge(phiv)==ccw_source_edge(vv)); - splice(ccw_target_edge(vv->pi()),phiv->pi()); + splice(ccw_target_edge(vv->pi()),phiv->pi()); } vv=inf(cw_target_edge(phiv)); if (cw_target_edge(phiv)==ccw_target_edge(vv)) { splice(ccw_source_edge(vv->pi()),phiv->pi()); } else { CGAL_assertion(cw_target_edge(phiv)==ccw_source_edge(vv)); - splice(ccw_target_edge(vv->pi()),phiv->pi()); + splice(ccw_target_edge(vv->pi()),phiv->pi()); } if (sup(v->pi()) == 0) set_sup(v->pi(),new Face); set_inf(sup(v->pi()),v->pi()); - set_sup(sup(v->pi()),phiv?phiv->pi():0); + set_sup(sup(v->pi()),phiv?phiv->pi():0); } // ------------------------------------------------------------------------- CGAL_postcondition(sup(v) != 0 && (sup(sup(v)) != 0)); - return phiv; + return phiv; } #endif template < class Gtr_ , class It , class Flip > void -Antichain::set_constraint(Vertex_handle v) +Antichain::set_constraint(Vertex_handle v) { typedef Ccw_traits Tr; typename Tr::Set_sup set_sup; typename Tr::Set_inf set_inf; @@ -2860,7 +2860,7 @@ Antichain::set_constraint(Vertex_handle v) // New edge for rays emanating from b->source() where b = this // with angle \theta such that \theta(b) - \pi < \theta < \theta(b) set_target_cusp_edge(v,new Edge); - set_source_cusp_edge(v,new Edge); + set_source_cusp_edge(v,new Edge); target_cusp_edge(v)->set_sign(false); set_sup(target_cusp_edge(v),v); set_inf(target_cusp_edge(v),v->pi()); @@ -2869,17 +2869,17 @@ Antichain::set_constraint(Vertex_handle v) set_inf(source_cusp_edge(v),v->pi()); // ------------------------------------------------------------------------- // New face directed from b->target_object() to b, the sink is b - Face_handle f0 = new Face; + Face_handle f0 = new Face; set_sup(f0,v); set_inf(f0,v->pi()); - f0->set_top_edge(target_cusp_edge(v)); + f0->set_top_edge(target_cusp_edge(v)); if (is_xx_left(v)) set_adjacent_faces(target_cusp_edge(v),f0,0,0); else set_adjacent_faces(target_cusp_edge(v),0,f0,0); // New face directed from b->source_object() to b, the sink is b - Face_handle f1 = new Face; + Face_handle f1 = new Face; set_sup(f1,v); set_inf(f1,v->pi()); - f1->set_bottom_edge(source_cusp_edge(v)); + f1->set_bottom_edge(source_cusp_edge(v)); if (is_left_xx(v)) set_adjacent_faces(source_cusp_edge(v),0,0,f1); else set_adjacent_faces(source_cusp_edge(v),0,f1,0); // ------------------------------------------------------------------------- @@ -2894,7 +2894,7 @@ Antichain::set_constraint(Vertex_handle v) template < class Gtr_ , class It , class Flip > void -Antichain::remove_constraint(Vertex_handle v) +Antichain::remove_constraint(Vertex_handle v) { if (!v->is_constraint()) return; // ------------------------------------------------------------------------- @@ -2907,7 +2907,7 @@ Antichain::remove_constraint(Vertex_handle v) template < class Gtr_ , class It , class Flip > void -Antichain::add_constraint(Vertex_handle v) +Antichain::add_constraint(Vertex_handle v) { if (v->is_constraint()) return; // ------------------------------------------------------------------------- @@ -2921,7 +2921,7 @@ Antichain::add_constraint(Vertex_handle v) template < class Gtr_ , class It , class Flip > void -Antichain::unset_constraint(Vertex_handle v) +Antichain::unset_constraint(Vertex_handle v) { // ------------------------------------------------------------------------- delete v->target_cusp_face(); delete v->source_cusp_face(); @@ -2939,8 +2939,8 @@ sweep_regular(const Vertex_handle& v, const Tr&,bool opposite) const { // ------------------------------------------------------------------------- // The operators used by this method - typename Tr::Sup sup; typename Tr::Inf inf; - typename Tr::Set_inf set_inf; + typename Tr::Sup sup; typename Tr::Inf inf; + typename Tr::Set_inf set_inf; typename Tr::Set_adjacent_faces_one_to_one set_adjacent_faces_one_to_one; typename Tr::Set_adjacent_faces set_adjacent_faces; typename Tr::Dl dl; typename Tr::Dr dr; @@ -2960,13 +2960,13 @@ sweep_regular(const Vertex_handle& v, const Tr&,bool opposite) const // The six faces adjacent to v. Face_handle f0,f1,f2,f3; if (e->sign()) { f0 = ul(e); f1 = dl(e); } - else { - f0 = dl(e); if (f0 == 0 || sup(f0) == v) f0 = dl(f); - f1 = dr(e); + else { + f0 = dl(e); if (f0 == 0 || sup(f0) == v) f0 = dl(f); + f1 = dr(e); } - if (f->sign()) { - f2 = ur(f); if (f2 == 0 || sup(f2) == v) f2 = ur(e); - f3 = ul(f); + if (f->sign()) { + f2 = ur(f); if (f2 == 0 || sup(f2) == v) f2 = ur(e); + f3 = ul(f); } else { f2 = dr(f); f3 = ul(f); } Face_handle f4 = sup(v); set_inf(f4,v); @@ -2975,7 +2975,7 @@ sweep_regular(const Vertex_handle& v, const Tr&,bool opposite) const // Due to our identification pi^2(v) == v, a face can appear twice in the // antichain. As a consequence a face can appear twice in the antichain. // This implies that the pointers Edge <---> Face are not necessarily - // reversible. + // reversible. // Our solution: make the Edge --> Face pointers correct and use the // infinite face and the two Edges below. Edge_handle botf4 = f4->bottom_edge(); @@ -3006,9 +3006,9 @@ sweep_regular(const Vertex_handle& v, const Tr&,bool opposite) const if (f2 == f4) { f4->set_top_edge(ep); f4->set_bottom_edge(fp); } else { Face_handle w = (is_left_xx(v)) ? f2 : f0; - if (botf4 != 0 && w->bottom_edge() != botf4) + if (botf4 != 0 && w->bottom_edge() != botf4) f4->set_bottom_edge(botf4); - if (topf4 != 0 && w->top_edge() != topf4) + if (topf4 != 0 && w->top_edge() != topf4) f4->set_top_edge(topf4); } if (f5->bottom_edge() != e) { @@ -3037,7 +3037,7 @@ sweep_constraint(const Vertex_handle& v, const Tr&,bool opposite) const { // ------------------------------------------------------------------------- // The operators used by this method - typename Tr::Sup sup; + typename Tr::Sup sup; typename Tr::Set_adjacent_faces set_adjacent_old_faces; typename Tr::Set_adjacent_faces_one_to_one set_adjacent_faces; typename Tr::Dl dl; typename Tr::Dr dr; @@ -3087,7 +3087,7 @@ sweep_constraint(const Vertex_handle& v, const Tr&,bool opposite) const set_adjacent_old_faces(fp,f1,f2,f0); } else { set_adjacent_faces(ep,ap,f3,bp); - set_adjacent_faces(fp,f1,f2,f0); + set_adjacent_faces(fp,f1,f2,f0); } break; case Vertex::RR: @@ -3095,10 +3095,10 @@ sweep_constraint(const Vertex_handle& v, const Tr&,bool opposite) const set_adjacent_old_faces(f,f0,f2,f3); if (opposite) { set_adjacent_old_faces(ep,f0,f2,f3); - set_adjacent_old_faces(fp,f1,ap,bp); + set_adjacent_old_faces(fp,f1,ap,bp); } else { set_adjacent_faces(ep,f0,f2,f3); - set_adjacent_faces(fp,f1,ap,bp); + set_adjacent_faces(fp,f1,ap,bp); } break; case Vertex::LR: @@ -3106,10 +3106,10 @@ sweep_constraint(const Vertex_handle& v, const Tr&,bool opposite) const set_adjacent_old_faces(f,a,f2,f3); if (opposite) { set_adjacent_old_faces(ep,f2,f3,bp); - set_adjacent_old_faces(fp,f1,ap,f0); + set_adjacent_old_faces(fp,f1,ap,f0); } else { set_adjacent_faces(ep,f2,f3,bp); - set_adjacent_faces(fp,f1,ap,f0); + set_adjacent_faces(fp,f1,ap,f0); } break; case Vertex::RL: @@ -3147,7 +3147,7 @@ is_swept_regular(const Vertex_handle& v, Tr /*tr*/) const CGAL_precondition(!v->is_constraint()); // ------------------------------------------------------------------------- // The operators used by this method - typename Tr::Sup sup; + typename Tr::Sup sup; typename Tr::Dl dl; typename Tr::Dr dr; typename Tr::Ul ul; typename Tr::Ur ur; typename Tr::Cw_source_edge cw_source_edge; @@ -3164,7 +3164,7 @@ is_swept_regular(const Vertex_handle& v, Tr /*tr*/) const // cw_source_edge(v) and cw_target_edge(v) which are assumed to be correct. // ------------------------------------------------------------------------- // Checking (1). - Face_handle f4 = sup(v); + Face_handle f4 = sup(v); if (f4 == 0) return false; // ------------------------------------------------------------------------- // Checking (2). @@ -3179,13 +3179,13 @@ is_swept_regular(const Vertex_handle& v, Tr /*tr*/) const // The remaining faces adjacent to v different from inf(v). Face_handle f0,f1,f2,f3; if (e->sign()) { f0 = ul(e); f1 = dl(e); } - else { - f0 = dl(e); if (f0 == 0 || sup(f0) == v) f0 = dl(f); - f1 = dr(e); + else { + f0 = dl(e); if (f0 == 0 || sup(f0) == v) f0 = dl(f); + f1 = dr(e); } - if (f->sign()) { - f2 = ur(f); if (f2 == 0 || sup(f2) == v) f2 = ur(e); - f3 = ul(f); + if (f->sign()) { + f2 = ur(f); if (f2 == 0 || sup(f2) == v) f2 = ur(e); + f3 = ul(f); } else { f2 = dr(f); f3 = ul(f); } // ------------------------------------------------------------------------- @@ -3216,7 +3216,7 @@ is_swept_constraint(const Vertex_handle& v, Tr /*tr*/) const CGAL_precondition(v->is_constraint()); // ------------------------------------------------------------------------- // The operators used by this method - typename Tr::Sup sup; + typename Tr::Sup sup; typename Tr::Dl dl; typename Tr::Dr dr; typename Tr::Ul ul; typename Tr::Ur ur; typename Tr::Cw_source_edge cw_source_edge; @@ -3239,21 +3239,21 @@ is_swept_constraint(const Vertex_handle& v, Tr /*tr*/) const // ------------------------------------------------------------------------- // The four regular faces adjacent to v Face_handle f0,f1,f2,f3; - if (e->sign()) { + if (e->sign()) { if (ul(e) == 0 || ur(e) == 0) return false; - f0 = ul(e); f1 = dl(e); + f0 = ul(e); f1 = dl(e); } - else { + else { if (dl(e) == 0 || dr(e) == 0) return false; - f0 = dl(e); if (sup(f0) == v) f0 = dl(f); f1 = dr(e); + f0 = dl(e); if (sup(f0) == v) f0 = dl(f); f1 = dr(e); } - if (f->sign()) { + if (f->sign()) { if (ul(f) == 0 || ur(f) == 0) return false; - f2 = ur(f); if (sup(f2) == v) f2 = ur(e); f3 = ul(f); + f2 = ur(f); if (sup(f2) == v) f2 = ur(e); f3 = ul(f); } - else { + else { if (dl(f) == 0 || dr(f) == 0) return false; - f2 = dr(f); f3 = ul(f); + f2 = dr(f); f3 = ul(f); } // ------------------------------------------------------------------------- // The four degenerate faces adjacent to v @@ -3295,7 +3295,7 @@ Antichain:: is_swept(const Vertex_handle& v, Tr tr) const { if (!v->is_constraint()) return is_swept_regular(v,tr); - return (is_swept_constraint(v,tr) && is_swept_constraint(v->pi(),tr)); + return (is_swept_constraint(v,tr) && is_swept_constraint(v->pi(),tr)); } } diff --git a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Bitangent_2.h b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Bitangent_2.h index 78c1ac28e4e..c0fffec3a38 100644 --- a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Bitangent_2.h +++ b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Bitangent_2.h @@ -38,7 +38,7 @@ struct Bitangent_type_wrapper { case Bitangent_type_wrapper::LR: return Bitangent_type_wrapper::LR; case Bitangent_type_wrapper::RL: return Bitangent_type_wrapper::RL; case Bitangent_type_wrapper::RR: return Bitangent_type_wrapper::LL; - default: CGAL_assertion(false); return Bitangent_type_wrapper::LL; + default: CGAL_error(); return Bitangent_type_wrapper::LL; } } class Type_util { @@ -81,7 +81,7 @@ operator>>(std::istream &is, Bitangent_type& t) { t=Bitangent_type_wrapper::RR; return is; } if (s=="") return is; - CGAL_assertion(false); + CGAL_error(); return is; } diff --git a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Circle_traits.h b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Circle_traits.h index edbf9cd10f7..60d4fa63209 100644 --- a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Circle_traits.h +++ b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Circle_traits.h @@ -569,7 +569,7 @@ public: struct Orientation_infinite { Orientation operator() (const Bitangent_2&, const Bitangent_2&) const { - CGAL_assertion(false); + CGAL_error(); return COLLINEAR; } }; diff --git a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Ellipse_traits.h b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Ellipse_traits.h index 7bbc82208eb..a807c671f77 100644 --- a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Ellipse_traits.h +++ b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Ellipse_traits.h @@ -97,7 +97,7 @@ public: case ET::Right: return ET::Left; case ET::Above: return ET::Below; default: - CGAL_assertion(false); + CGAL_error(); return ET::Above; } } @@ -117,7 +117,7 @@ public: case ET::Right: return ET::Left; case ET::Above: return ET::Below; default: - CGAL_assertion(false); + CGAL_error(); return ET::Above; } } @@ -132,7 +132,7 @@ public: case ET::Right: return ET::Upwards; case ET::Above: return ET::Leftwards; default: - CGAL_assertion(false); + CGAL_error(); return ET::Downwards; } case RL: case RR: @@ -142,11 +142,11 @@ public: case ET::Right: return ET::Downwards; case ET::Above: return ET::Rightwards; default: - CGAL_assertion(false); + CGAL_error(); return ET::Downwards; } default: - CGAL_assertion(false); + CGAL_error(); return ET::Downwards; } } @@ -569,7 +569,7 @@ public: }; } default: - CGAL_assertion(false); + CGAL_error(); return COLLINEAR; } } @@ -618,7 +618,7 @@ public: }; case LARGER: return LARGER; default: - CGAL_assertion(false); + CGAL_error(); return EQUAL; } } @@ -635,7 +635,7 @@ public: case SMALLER: case EQUAL: return false; case LARGER: return true; default: - CGAL_assertion(false); + CGAL_error(); return false; } case Upwards: return true; @@ -644,11 +644,11 @@ public: case SMALLER: case EQUAL: return true; case LARGER: return false; default: - CGAL_assertion(false); + CGAL_error(); return false; } default: - CGAL_assertion(false); + CGAL_error(); return false; } } @@ -659,7 +659,7 @@ public: struct Orientation_infinite { Orientation operator() (const Bitangent_2&, const Bitangent_2&) const { - CGAL_assertion(false); + CGAL_error(); return COLLINEAR; } }; struct Equal_as_segments { diff --git a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Face_base.h b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Face_base.h index 39ff44831d8..ef0a40e7591 100644 --- a/Visibility_complex_2/include/CGAL/Visibility_complex_2/Face_base.h +++ b/Visibility_complex_2/include/CGAL/Visibility_complex_2/Face_base.h @@ -212,7 +212,7 @@ private: return Border_iterator(super, v->pi()->ccw_source_edge()); } - CGAL_assertion(false); + CGAL_error(); } return Border_iterator(); } @@ -234,7 +234,7 @@ private: return ++Border_iterator(super, v->cw_source_edge()); } - CGAL_assertion(false); + CGAL_error(); } return Border_iterator(super,0); } @@ -257,7 +257,7 @@ private: return Border_iterator(super, v->pi()->ccw_source_edge()); } - CGAL_assertion(false); + CGAL_error(); } return Border_iterator(); } @@ -279,7 +279,7 @@ private: return ++Border_iterator(super, v->cw_source_edge()); } - CGAL_assertion(false); + CGAL_error(); } return Border_iterator(super,0); } diff --git a/Visibility_complex_2/include/CGAL/Visibility_complex_2/function_objects.h b/Visibility_complex_2/include/CGAL/Visibility_complex_2/function_objects.h index 271dbcc300c..0359f8b26e4 100644 --- a/Visibility_complex_2/include/CGAL/Visibility_complex_2/function_objects.h +++ b/Visibility_complex_2/include/CGAL/Visibility_complex_2/function_objects.h @@ -221,7 +221,7 @@ struct Less_bitangent { Orientation op=chi3(a,upa,b); if (op == RIGHT_TURN) return false; else if (op == LEFT_TURN) return true; - CGAL_assertion(false); + CGAL_error(); return true; } }; diff --git a/Visibility_complex_2/include/CGAL/Visibility_complex_2/iterators.h b/Visibility_complex_2/include/CGAL/Visibility_complex_2/iterators.h index 025e01d3c5e..908313a2cf7 100644 --- a/Visibility_complex_2/include/CGAL/Visibility_complex_2/iterators.h +++ b/Visibility_complex_2/include/CGAL/Visibility_complex_2/iterators.h @@ -230,7 +230,7 @@ public: case TARGET_CUSP: return Base::operator->()->target_cusp_edge(); } std::cerr<<"which="<()->inf(); case SOURCE_CUSP: return Base::operator->()->source_cusp_face(); case TARGET_CUSP: return Base::operator->()->target_cusp_face(); - default: CGAL_assertion(false); + default: CGAL_error(); } return 0; } diff --git a/Width_3/include/CGAL/Width_3.h b/Width_3/include/CGAL/Width_3.h index 6c9921e1bd1..8e3fa596058 100644 --- a/Width_3/include/CGAL/Width_3.h +++ b/Width_3/include/CGAL/Width_3.h @@ -531,7 +531,7 @@ class Width_3 { < #include -#include #include #include using std::list; // to avoid compiler crash on MSVC++ @@ -31,12 +31,12 @@ CGAL_BEGIN_NAMESPACE /*======================================================================= * Kdtree_interface - - * This is the default interface of point. It assume that PT (the + * This is the default interface of point. It assume that PT (the * point type have the following properties: * default constructor * int dimension() * const coord_type & operator[]( int ) const - * ... operator=( const Pt & ) - copy operator + * ... operator=( const Pt & ) - copy operator \*=======================================================================*/ template @@ -44,7 +44,7 @@ class Kdtree_interface { public: typedef PT Point; - + static int dimension( const PT & pnt ) { // return pnt.dimensions(); @@ -53,9 +53,9 @@ public: static int compare( int d, const PT & a, const PT & b ) { - if ( a[ d ] < b[ d ] ) + if ( a[ d ] < b[ d ] ) return -1; - if ( a[ d ] > b[ d ] ) + if ( a[ d ] > b[ d ] ) return 1; return 0; @@ -73,7 +73,7 @@ class Kdtree_interface_2d { public: typedef PT Point; - + static int dimension( const PT & pnt ) { // return pnt.dimensions(); @@ -82,22 +82,22 @@ public: static int compare( int d, const PT & a, const PT & b ) { - if ( a[ d ] < b[ d ] ) + if ( a[ d ] < b[ d ] ) return -1; - if ( a[ d ] > b[ d ] ) + if ( a[ d ] > b[ d ] ) return 1; return 0; } static void copy_coord( int d, PT & a, const PT & b ) { - if ( d == 0 ) + if ( d == 0 ) a = PT( b[ 0 ], a[1] ); else - if ( d == 1 ) + if ( d == 1 ) a = PT( a[ 0 ], b[1] ); else { - assert( 0 ); + CGAL_error(); } } }; @@ -108,7 +108,7 @@ class Kdtree_interface_3d { public: typedef PT Point; - + static int dimension( const PT & pnt ) { // return pnt.dimensions(); @@ -117,40 +117,40 @@ public: static int compare( int d, const PT & a, const PT & b ) { - if ( a[ d ] < b[ d ] ) + if ( a[ d ] < b[ d ] ) return -1; - if ( a[ d ] > b[ d ] ) + if ( a[ d ] > b[ d ] ) return 1; return 0; } static void copy_coord( int d, PT & a, const PT & b ) { - if ( d == 0 ) + if ( d == 0 ) a = PT( b[ 0 ], a[1], a[ 2 ] ); else - if ( d == 1 ) + if ( d == 1 ) a = PT( a[ 0 ], b[1], a[ 2 ] ); else - if ( d == 2 ) + if ( d == 2 ) a = PT( a[ 0 ], a[1], b[ 2 ] ); else { - assert( 0 ); + CGAL_error(); } } }; /*========================================================================= - * kdtree_d - + * kdtree_d - * A the kdtree class. * * Remark: The kd-trees allocates all the memory it needs in advance, * This results in a rather efficient memory management, and a fast - * iplementation. + * iplementation. \*=========================================================================*/ template -class Kdtree_d +class Kdtree_d { class Plane; @@ -162,7 +162,7 @@ public: //------------------------------------------------------------------------- // Extended_Point_d - // A class for representing an extended d-dimal point: with - // ability to support +/- infinity. Templated by the kd-treee interface + // ability to support +/- infinity. Templated by the kd-treee interface // type. //------------------------------------------------------------------------- class ExtPoint @@ -175,33 +175,33 @@ public: int type; //signed char type; }; - + coordinate_type * p_arr; int dim; Point def_pnt; void init( int _dim ) { - assert( _dim > 0 ); + CGAL_precondition( _dim > 0 ); dim = _dim; - p_arr = (coordinate_type *)std::malloc( sizeof( coordinate_type ) + p_arr = (coordinate_type *)std::malloc( sizeof( coordinate_type ) * dim ); //printf( "p_arr(new): %p\n", (void *)p_arr ); - assert( p_arr != NULL ); - + CGAL_assertion( p_arr != NULL ); + std::memset( p_arr, 0, sizeof( coordinate_type ) * dim ); } public: enum { MINUS_INFINITY = -1, FINITE = 0, PLUS_INFINITY = 1 }; - + ExtPoint( int _type, int _dim ) { - assert( _type == MINUS_INFINITY || _type == PLUS_INFINITY ); + CGAL_precondition( _type == MINUS_INFINITY || _type == PLUS_INFINITY ); init( _dim ); - for ( int ind = 0; ind < dim; ind++ ) + for ( int ind = 0; ind < dim; ind++ ) p_arr[ ind ].type = _type; } @@ -228,7 +228,7 @@ public: term(); init( p.dim ); - + def_pnt = p.def_pnt; for ( int ind = 0; ind < dim; ind++ ) { p_arr[ ind ] = p.p_arr[ ind ]; @@ -268,7 +268,7 @@ public: void set_coord( int k, Point & point ) { - assert( 0 <= k && k < dim ); + CGAL_precondition( 0 <= k && k < dim ); p_arr[ k ].type = FINITE; //p_arr[ k ].p_pnt = &point; @@ -279,8 +279,8 @@ public: void set_coord( int k, const ExtPoint & point ) { - assert( 0 <= k && k < dim ); - assert( 0 <= k && k < point.dim ); + CGAL_precondition( 0 <= k && k < dim ); + CGAL_precondition( 0 <= k && k < point.dim ); p_arr[ k ] = point.p_arr[ k ]; if ( p_arr[ k ].type == FINITE ) { @@ -288,14 +288,14 @@ public: p_arr[ k ].p_pnt = &def_pnt; } } - + int compare( int k, const ExtPoint & point ) const - { - assert( 0 <= k && k < dim ); + { + CGAL_precondition( 0 <= k && k < dim ); // the following does not compile on msvc++... - // coordinate_type & a( p_arr[ k ] ), + // coordinate_type & a( p_arr[ k ] ), // & b( point.p_arr[ k ] ); - coordinate_type & a = p_arr[ k ]; + coordinate_type & a = p_arr[ k ]; coordinate_type & b = point.p_arr[ k ]; if ( a.type != FINITE ) { @@ -303,11 +303,11 @@ public: return a.type - b.type; } else { return a.type; - } + } } else { - if ( b.type != FINITE ) + if ( b.type != FINITE ) return -b.type; - else + else return Traits::compare( k, *a.p_pnt, *b.p_pnt ); } } @@ -321,21 +321,21 @@ public: res = compare( ind, point ); if ( res != 0 ) return res; - } + } return 0; } int compare( int k, const Point & point ) const - { - assert( 0 <= k && k < dim ); + { + CGAL_precondition( 0 <= k && k < dim ); // coordinate_type & a( p_arr[ k ] ); coordinate_type & a = p_arr[ k ]; - if ( a.type != FINITE ) + if ( a.type != FINITE ) return a.type; - else + else return Traits::compare( k, *a.p_pnt, point ); } @@ -343,10 +343,10 @@ public: { return dim; } - + int get_coord_status( int d ) const { - assert( 0 <= d && d < dim ); + CGAL_precondition( 0 <= d && d < dim ); return p_arr[ d ].type; } @@ -354,20 +354,20 @@ public: const Point * get_coord_point( int d ) const { - assert( 0 <= d && d < dim ); + CGAL_precondition( 0 <= d && d < dim ); return p_arr[ d ].p_pnt; } }; - // Box - represents an axis parallel box. - class Box + // Box - represents an axis parallel box. + class Box { public: int dim; ExtPoint left, right; - + private: friend class Plane; @@ -381,10 +381,10 @@ public: //CHECK Box() - { + { } - Box( const Box & box ) + Box( const Box & box ) { dim = box.dim; left = box.left; @@ -392,39 +392,39 @@ public: } - Box( const Point &l, const Point &r, int _dim ) + Box( const Point &l, const Point &r, int _dim ) { dim = _dim; left = ExtPoint( l, dim ); right = ExtPoint( r, dim ); } - + Box( int _dim ) : left( ExtPoint::MINUS_INFINITY, _dim ), right( ExtPoint::PLUS_INFINITY, _dim ) { dim = _dim; } - - + + // data access - void set_left( Point &l) - { - left = ExtPoint( l, dim ); + void set_left( Point &l) + { + left = ExtPoint( l, dim ); }; - - void set_right( Point &r) - { - right = ExtPoint( r, dim ); + + void set_right( Point &r) + { + right = ExtPoint( r, dim ); } - + const ExtPoint &get_left() const - { - return left; + { + return left; } - + const ExtPoint &get_right() const - { - return right; + { + return right; } @@ -433,59 +433,59 @@ public: left.set_coord( k, p ); } - + void set_coord_right( int k, Point & p ) { right.set_coord( k, p ); } - + // operations - bool is_in( const Box &o) const + bool is_in( const Box &o) const // checks if o is completely inside { int dim = left.dimension(); - + for (int i = 0; i < dim; i++) { - if ( (left.compare(i, o.get_left()) > 0 ) + if ( (left.compare(i, o.get_left()) > 0 ) || (right.compare(i, o.get_right()) < 0 ) ) return false; } - + return true; } - - - bool is_in( const Point & o ) const + + + bool is_in( const Point & o ) const // checks if o is completely inside { int dim = left.dimension(); for (int i = 0; i < dim; i++) { - if ( (left.compare( i, o ) > 0 ) || + if ( (left.compare( i, o ) > 0 ) || (right.compare( i, o ) <= 0 ) ) return false; } return true; } - - - bool is_coord_in_range( int k, const Point & o ) const + + + bool is_coord_in_range( int k, const Point & o ) const // checks if o is completely inside { - return ( ! ( (left.compare( k, o ) > 0 ) + return ( ! ( (left.compare( k, o ) > 0 ) || (right.compare( k, o ) <= 0 ) ) ); } - - + + bool is_intersect( const Box &o) const // checks if there is an intersection between o and this { int dim = left.dimension(); for (int i = 0; i < dim; i++) { - if ( (left.compare(i, o.get_right()) >= 0) || + if ( (left.compare(i, o.get_right()) >= 0) || (right.compare(i, o.get_left()) <= 0) ) return false; } @@ -497,20 +497,20 @@ public: // only in a specific coordinate... bool is_intersect_in_dim( int d, const Box & o ) const { - return (! ( (left.compare( d, o.get_right() ) >= 0 ) + return (! ( (left.compare( d, o.get_right() ) >= 0 ) || (right.compare( d, o.get_left() ) <= 0) )); } - + // checks if there is an intersection between o and this box // only in a specific coordinate... bool is_intersect_in_dim_closed( int d, const Box & o ) const { - return (! ( (left.compare( d, o.get_right() ) > 0 ) + return (! ( (left.compare( d, o.get_right() ) > 0 ) || (right.compare( d, o.get_left() ) < 0) )); } - + bool intersect(Box &o) // intersects this with o. the intersection will be in this // returns false if intersection is empty @@ -528,7 +528,7 @@ public: } return !(is_empty()); } - + bool is_empty() const // return true if this is not an interval (left[k] > right[k]) { @@ -565,7 +565,7 @@ public: } // destructor - needed in ...recursive ... DVP - ~Box() + ~Box() { left.term(); right.term(); @@ -576,61 +576,61 @@ public: private: - class Plane + class Plane { private: int coord; Point * normal; bool f_plus; // orientation of half space // is (0, 0, ... , +inifinity, 0, ..., 0) inside plane - + public: - Plane() - { + Plane() + { normal = NULL; coord = 0; } - Plane( int k, Point & p ) - { + Plane( int k, Point & p ) + { normal = &p; coord = k; } - + Plane( const Plane & p ) { coord = p.coord; normal = p.normal; } - + void dump( void ) { std::cout << "(" << coord << ": " << *normal << ")"; } - - bool is_in( const Point & p ) const + + bool is_in( const Point & p ) const { int cmp; - + cmp = Traits::compare( coord, p, *normal ); - + if ( ! f_plus ) cmp = -cmp; - + return cmp >= 0; } - + void set_plane(int k, Point &p) { coord = k; normal = &p; - //normal->copy( coord, p ); + //normal->copy( coord, p ); } - + void split( Box & region, bool f_neg ) { ExtPoint * p_p = &(region.get_vertex( ! f_neg )); - + if ( f_neg ) { if ( p_p->compare( coord, *normal ) > 0 ) p_p->set_coord( coord, *normal ); @@ -638,12 +638,12 @@ private: if ( p_p->compare( coord, *normal ) < 0 ) p_p->set_coord( coord, *normal ); } - + void orient_half_space( bool f_neg_side ) { f_plus = ! f_neg_side; } - + int get_coord() const { return coord; @@ -656,14 +656,14 @@ private: public: Plane plane; Point * pnt; - + Node * left, * right; - + enum { LEFT, RIGHT }; - const Plane & get_hs( int side ) const + const Plane & get_hs( int side ) const { - + ((Plane *)&plane)->orient_half_space( side == LEFT ); return plane; @@ -672,7 +672,7 @@ private: bool is_points_in_hs( const Plane & pl ) const { - if ( is_point() ) + if ( is_point() ) return pl.is_in( *pnt ); if ( left != NULL && ( ! left->is_points_in_hs( pl ) ) ) @@ -682,28 +682,28 @@ private: return true; } - - bool is_valid() const + + bool is_valid() const { if ( is_point() ) return true; - if ( left != NULL ) + if ( left != NULL ) if ( ! left->is_points_in_hs( get_hs( LEFT ) ) ) return false; - if ( right != NULL ) + if ( right != NULL ) if ( ! right->is_points_in_hs( get_hs( RIGHT ) ) ) return false; return true; } - + void dump( int depth ) { int ind; - + for ( ind = 0; ind < depth; ind++ ) std::cout << " "; @@ -711,29 +711,29 @@ private: std::cout << *pnt << "\n"; return; } - - plane.dump(); + + plane.dump(); std::cout << "\n"; left->dump( depth + 1 ); for ( ind = 0; ind < depth; ind++ ) std::cout << " "; std::cout << "!!!!!!!!!!!!\n"; - right->dump( depth + 1 ); + right->dump( depth + 1 ); } bool is_point() const - { - return ((left == NULL) && (right == NULL)); + { + return ((left == NULL) && (right == NULL)); } - + typedef std::back_insert_iterator back_iter; Node() : plane() - { - left = right = NULL; + { + left = right = NULL; } - + void copy_subtree_points( back_iter & result, const Box & rect ) { @@ -742,9 +742,9 @@ private: (*result++) = *pnt; return; } - if ( left != NULL ) + if ( left != NULL ) left->copy_subtree_points( result, rect ); - if ( right != NULL ) + if ( right != NULL ) right->copy_subtree_points( result, rect ); } @@ -765,11 +765,11 @@ private: //printf( "c" ); //fflush( stdout ); - assert( node != NULL ); - + CGAL_precondition( node != NULL ); + //printf( "b" ); //fflush( stdout ); - if ( rect.is_in( *p_r ) ) + if ( rect.is_in( *p_r ) ) { //printf( "5" ); //fflush( stdout ); @@ -779,8 +779,8 @@ private: //fflush( stdout ); delete p_r; return; - } - + } + //printf( "v" ); //fflush( stdout ); @@ -799,13 +799,13 @@ private: (*result++) = *pnt; return; } - + //this is not a point so it is a hypeplane if ( left != NULL ) search_recursive( result, left, rect, region, plane, true ); if ( right != NULL ) - search_recursive( result, right, rect, + search_recursive( result, right, rect, region, plane, false ); } }; @@ -813,13 +813,13 @@ private: // SunPro requires this : friend class Box; friend class Node; - + typedef Point * Point_ptr; int size; Point * p_arr_pt; Node *root; - int dim; + int dim; Node * p_node_arr; int node_count; @@ -830,8 +830,8 @@ private: p_ret = &(p_node_arr[ node_count ]); node_count++; - - assert( node_count <= ( 2 * size )); + + CGAL_assertion( node_count <= ( 2 * size )); *p_ret = Node(); @@ -854,7 +854,7 @@ private: i = left; j = right; - + while ( i < j ) { if ( comp( *(arr[ i ]), *(arr[ j ]), dim ) > 0 ) { tmp = arr[ i ]; @@ -864,40 +864,40 @@ private: if ( comp( *(arr[ i ]), *p_pivot, dim ) < 0 ) { i++; } else - if ( comp( *p_pivot, *(arr[ j ]), dim ) <= 0 ) + if ( comp( *p_pivot, *(arr[ j ]), dim ) <= 0 ) j--; } return (i > left)? i - 1 : left; } - - /* split the array into two sub-arrays, such that all the elements + + /* split the array into two sub-arrays, such that all the elements * from left to pos_mid are smaller than the elements from pos+1 to - * right. + * right. */ - static void split_arr( Point_ptr * arr, + static void split_arr( Point_ptr * arr, int left, int right, int pos_mid, int dim ) { int pos; - + if ( left >= right ) return; - + pos = partition( arr, left, right, arr[ (left + right ) / 2 ], dim ); if ( pos == pos_mid ) return; - - if ( pos < pos_mid ) + + if ( pos < pos_mid ) split_arr( arr, pos+1, right, pos_mid, dim ); else split_arr( arr, left, pos, pos_mid, dim ); } - + static Point_ptr get_max_element( Point_ptr * arr, int left, int right, int d ) @@ -905,12 +905,12 @@ private: int max_pos = left; Point mx = *(arr[ max_pos ]); - for ( int ind = left + 1; ind <= right; ind++ ) + for ( int ind = left + 1; ind <= right; ind++ ) if ( comp( mx, *(arr[ ind ]), d ) < 0 ) { mx = *(arr[ ind ]); max_pos = ind; } - + return arr[ max_pos ]; } @@ -924,28 +924,28 @@ private: if ( num < 1) return NULL; - - // if the list contains only one point, + + // if the list contains only one point, // construct a leaf for this node if ( num == 1) { //n = new node; n = malloc_node(); n->pnt = arr[ left ]; - + return n; } - - // else divide space into two regions in + + // else divide space into two regions in // dim-dim and cotinue recursively pos = (left + right) / 2; - split_arr( arr, left, right, pos, d ); + split_arr( arr, left, right, pos, d ); Point * p_median = get_max_element( arr, left, pos, d ); - + // create division plane; Plane plane( d, *p_median ); //n = new node; - // assert( n != NULL ); + // CGAL_assertion( n != NULL ); n = malloc_node(); n->plane = plane; @@ -956,25 +956,25 @@ private: // build left sub-tree n->left = build_r( arr, left, pos, next_d ); - + // build right sub-tree n->right = build_r( arr, pos + 1, right, next_d ); - + return n; } - + public: typedef list list_points; - Kdtree_d(int k = 2) - { + Kdtree_d(int k = 2) + { dim = k; - root = NULL; + root = NULL; p_arr_pt = NULL; p_node_arr = NULL; } - - ~Kdtree_d() + + ~Kdtree_d() { delete_all(); } @@ -992,11 +992,11 @@ public: } - void dump() + void dump() { root->dump( 0); } - + void delete_all() { root = NULL; @@ -1008,7 +1008,7 @@ public: delete[] p_node_arr; p_node_arr = NULL; } - + void search( std::back_insert_iterator result, Box & rect ) { @@ -1016,7 +1016,7 @@ public: return; // it is an empty tree - nothing to search in Box region = Box( dim ); - + root->search( result, rect, region ); } @@ -1027,21 +1027,21 @@ public: size = l.size(); p_arr_pt = new Point[ size ]; - assert( p_arr_pt != NULL ); + CGAL_assertion( p_arr_pt != NULL ); p_arr = new Point_ptr[ size ]; - assert( p_arr != NULL ); - + CGAL_assertion( p_arr != NULL ); + p_node_arr = new Node[ 2 * size ]; - assert( p_node_arr != NULL ); + CGAL_assertion( p_node_arr != NULL ); node_count = 0; /* fill the array */ i = 0; - for ( typename std::list::iterator j = l.begin(); - j != l.end(); - j++ ) + for ( typename std::list::iterator j = l.begin(); + j != l.end(); + j++ ) { p_arr_pt[ i ] = (*j); p_arr[ i ] = p_arr_pt + i; @@ -1051,7 +1051,7 @@ public: // recursively build the tree from the sorted list // starting to divide it in coordinate 0 root = build_r( p_arr, 0, size - 1, 0 ); - + //printf( "b\n" ); delete[] p_arr; }