This commit is contained in:
Andreas Fabri 2025-12-03 14:01:24 +01:00 committed by GitHub
commit 7e3ae12e1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
55 changed files with 135 additions and 269 deletions

View File

@ -1252,9 +1252,7 @@ void Scene::cutting_plane(bool override)
return; return;
} }
// Should not be here CGAL_unreachable();
std::cerr << "Unknown cut_plane type" << std::endl;
CGAL_assertion(false);
} }
} }

View File

@ -1665,13 +1665,8 @@ public:
const Polynomial_2& f = ca1.polynomial_2(); const Polynomial_2& f = ca1.polynomial_2();
const Polynomial_2& g = ca2.polynomial_2(); const Polynomial_2& g = ca2.polynomial_2();
if(f == g) { CGAL_assertion_msg(f != g, "both curves are equal, but have different representations!");
// both curves are equal, but have different representations!
// std::cout <<"f: " << f <<std::endl;
// std::cout <<"g: " << g <<std::endl;
CGAL_assertion(false);
return false;
}
Gcd_cache_2& gcd_cache = _m_kernel->gcd_cache_2(); Gcd_cache_2& gcd_cache = _m_kernel->gcd_cache_2();
typedef typename Curve_analysis_2::size_type size_type; typedef typename Curve_analysis_2::size_type size_type;
Polynomial_2 gcd = gcd_cache(std::make_pair(f,g)); Polynomial_2 gcd = gcd_cache(std::make_pair(f,g));

View File

@ -890,7 +890,7 @@ private:
break; break;
} }
default:{ default:{
CGAL_assertion(false); // !!! Never reached CGAL_unreachable();
} }
} }
} }

View File

@ -212,7 +212,7 @@ public:
exact_ = Exact_squared_radius()( to_exact(*data().p0),to_exact(*data().p1),to_exact(*data().p2) ); exact_ = Exact_squared_radius()( to_exact(*data().p0),to_exact(*data().p1),to_exact(*data().p2) );
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
} }
} }
@ -229,7 +229,7 @@ public:
approx_ = Approx_squared_radius()( to_approx(*data().p0),to_approx(*data().p1),to_approx(*data().p2) ); approx_ = Approx_squared_radius()( to_approx(*data().p0),to_approx(*data().p1),to_approx(*data().p2) );
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
} }
} }

View File

@ -205,7 +205,7 @@ public:
exact_ = Exact_squared_radius()( to_exact(*data().p0),to_exact(*data().p1),to_exact(*data().p2),to_exact(*data().p3) ); exact_ = Exact_squared_radius()( to_exact(*data().p0),to_exact(*data().p1),to_exact(*data().p2),to_exact(*data().p3) );
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
} }
} }
@ -224,7 +224,7 @@ public:
approx_ = Approx_squared_radius()( to_approx(*data().p0),to_approx(*data().p1),to_approx(*data().p2),to_approx(*data().p3) ); approx_ = Approx_squared_radius()( to_approx(*data().p0),to_approx(*data().p1),to_approx(*data().p2),to_approx(*data().p3) );
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
} }
} }

View File

@ -605,10 +605,9 @@ public:
case CGAL_TD_VERTEX: case CGAL_TD_VERTEX:
return TD_VERTEX; return TD_VERTEX;
default: default:
CGAL_assertion(false); CGAL_unreachable();
return TD_TRAPEZOID;
}
} }
}
/*! Access trapezoid type flag. */ /*! Access trapezoid type flag. */
CGAL_TD_INLINE unsigned char type_flag() const CGAL_TD_INLINE unsigned char type_flag() const

View File

@ -80,13 +80,6 @@ bool is_index_map_valid(const CGAL::internal_np::face_index_t, FaceIndexProperty
return is_index_map_valid(face_index_map, num_faces(g), faces(g)); return is_index_map_valid(face_index_map, num_faces(g), faces(g));
} }
template <typename PropertyTag, typename IndexPropertyMap, typename Graph>
void initialize_index_map(const PropertyTag, IndexPropertyMap, const Graph&)
{
// Unknown parameter; should never be here.
CGAL_assertion(false);
}
template <typename IndexPropertyMap, template <typename IndexPropertyMap,
typename Graph, typename Graph,
bool is_writable = CGAL::internal::Is_writable_property_map<IndexPropertyMap>::value> bool is_writable = CGAL::internal::Is_writable_property_map<IndexPropertyMap>::value>
@ -120,12 +113,6 @@ struct Index_map_initializer
put(face_index_map, fd, i++); put(face_index_map, fd, i++);
} }
template <typename PropertyTag>
void operator()(const PropertyTag, IndexPropertyMap, const Graph&)
{
// Unknown parameter; should never be here.
CGAL_assertion(false);
}
}; };
template <typename IndexPropertyMap, typename Graph> template <typename IndexPropertyMap, typename Graph>

View File

@ -46,7 +46,7 @@ public:
// https://github.com/boostorg/core/issues/148 // https://github.com/boostorg/core/issues/148
Image(const Image&) Image(const Image&)
{ {
CGAL_assertion(false); CGAL_unreachable();
} }
Image () : m_width(0), m_height(0), m_depth(0) Image () : m_width(0), m_height(0), m_depth(0)

View File

@ -169,13 +169,8 @@ namespace CGAL {
{ {
// Allocate a dart for null_dart_descriptor // Allocate a dart for null_dart_descriptor
CGAL_assertion(mdarts.empty()); // the compact container is empty CGAL_assertion(mdarts.empty()); // the compact container is empty
Dart_index local_null_dart_descriptor = mdarts.emplace(); CGAL_assertion_code( Dart_index local_null_dart_descriptor = ) mdarts.emplace();
if(local_null_dart_descriptor!=0) CGAL_assertion_msg(local_null_dart_descriptor ==0, "[ERROR] fatal in Combinatorial_map_storage_with_index::init_storage");
{
std::cerr<<"[ERROR] fatal in Combinatorial_map_storage_with_index::init_storage"
<<std::endl;
CGAL_assertion(false);
}
} }
void clear_storage() void clear_storage()

View File

@ -91,10 +91,8 @@ public:
DirectionOutputIterator operator()(const unsigned int cone_number, DirectionOutputIterator operator()(const unsigned int cone_number,
const Direction_2& initial_direction, const Direction_2& initial_direction,
DirectionOutputIterator result) { DirectionOutputIterator result) {
if (cone_number<2) {
std::cout << "The number of cones must be larger than 1!" << std::endl; CGAL_assertion_msg(cone_number>1, "The number of cones must be larger than 1");
CGAL_assertion(false);
}
*result++ = initial_direction; *result++ = initial_direction;

View File

@ -99,10 +99,7 @@ public:
): cone_number(k), cones_choice(cones_selected), rays(std::vector<Direction_2>(k)) ): cone_number(k), cones_choice(cones_selected), rays(std::vector<Direction_2>(k))
{ {
if (k<2) { CGAL_assertion_msg(k>1, "The number of cones must be larger than 1");
std::cout << "The number of cones must be larger than 1!" << std::endl;
CGAL_assertion(false);
}
/* Initialize a functor, specialization will happen here depending on the kernel type to /* Initialize a functor, specialization will happen here depending on the kernel type to
compute the cone boundaries either exactly or inexactly */ compute the cone boundaries either exactly or inexactly */

View File

@ -93,10 +93,7 @@ public:
): cone_number(k), cones_choice(cones_selected), rays(std::vector<Direction_2>(k)) ): cone_number(k), cones_choice(cones_selected), rays(std::vector<Direction_2>(k))
{ {
if (k<2) { CGAL_assertion_msg(k>1, "The number of cones must be larger than 1");
std::cout << "The number of cones must be larger than 1!" << std::endl;
CGAL_assertion(false);
}
/* Initialize a functor, specialization will happen here depending on the kernel type to /* Initialize a functor, specialization will happen here depending on the kernel type to
compute the cone boundaries either exactly or inexactly */ compute the cone boundaries either exactly or inexactly */

View File

@ -876,7 +876,6 @@ Aff_transformation_repH2<R>::homogeneous(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return RT(0);
} }
template < class R > template < class R >
@ -920,7 +919,6 @@ Translation_repH2<R>::homogeneous(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return RT(0);
} }
template < class R > template < class R >
@ -955,7 +953,6 @@ Translation_repH2<R>::cartesian(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return FT(0);
} }
template < class R > template < class R >
@ -991,7 +988,6 @@ homogeneous(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return RT(0);
} }
template < class R > template < class R >
@ -1027,7 +1023,6 @@ cartesian(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return FT(0);
} }
template < class R > template < class R >
@ -1063,7 +1058,6 @@ homogeneous(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return RT(0);
} }
template <class R> template <class R>
@ -1099,7 +1093,6 @@ cartesian(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return FT(0);
} }
template < class R > template < class R >
@ -1136,7 +1129,6 @@ homogeneous(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return RT(0);
} }
template <class R> template <class R>
@ -1173,7 +1165,6 @@ cartesian(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return FT(0);
} }
} //namespace CGAL } //namespace CGAL

View File

@ -737,7 +737,6 @@ homogeneous(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return RT0;
} }
template < class R > template < class R >
@ -895,7 +894,6 @@ Translation_repH3<R>::homogeneous(int i, int j) const
} }
} }
CGAL_unreachable(); CGAL_unreachable();
return RT0;
} }
template < class R > template < class R >

View File

@ -22,6 +22,7 @@
#include <CGAL/Segment_2.h> #include <CGAL/Segment_2.h>
#include <CGAL/Point_2.h> #include <CGAL/Point_2.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/number_utils.h> #include <CGAL/number_utils.h>
#include <CGAL/Intersections_2/Line_2_Line_2.h> #include <CGAL/Intersections_2/Line_2_Line_2.h>
#include <CGAL/Intersection_traits_2.h> #include <CGAL/Intersection_traits_2.h>
@ -185,8 +186,7 @@ Ray_2_Ray_2_pair<K>::intersection_type() const
} }
} }
default: default:
CGAL_kernel_assertion(false); // should not be reached: CGAL_unreachable();
return _result;
} }
} }

View File

@ -23,6 +23,7 @@
#include <CGAL/Point_2.h> #include <CGAL/Point_2.h>
#include <CGAL/Line_2.h> #include <CGAL/Line_2.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/number_utils.h> #include <CGAL/number_utils.h>
#include <CGAL/Intersections_2/Line_2_Line_2.h> #include <CGAL/Intersections_2/Line_2_Line_2.h>
#include <CGAL/Intersection_traits_2.h> #include <CGAL/Intersection_traits_2.h>
@ -203,8 +204,7 @@ Ray_2_Segment_2_pair<K>::intersection_type() const
} }
} }
default: default:
CGAL_kernel_assertion(false); // should not be reached: CGAL_unreachable();
return _result;
} }
} }

View File

@ -21,6 +21,7 @@
#include <CGAL/Segment_2.h> #include <CGAL/Segment_2.h>
#include <CGAL/Point_2.h> #include <CGAL/Point_2.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/number_utils.h> #include <CGAL/number_utils.h>
#include <CGAL/predicates_on_points_2.h> #include <CGAL/predicates_on_points_2.h>
#include <CGAL/Line_2.h> #include <CGAL/Line_2.h>
@ -141,8 +142,7 @@ seg_seg_do_intersect_crossing(
default: default:
CGAL_unreachable(); CGAL_unreachable();
} }
CGAL_kernel_assertion(false); CGAL_unreachable();
return S2S2_inter_info(false);
} }
// used internally by Arr_segment_traits_2template <class K> // used internally by Arr_segment_traits_2template <class K>
@ -202,8 +202,7 @@ seg_seg_do_intersect_contained(
default: default:
CGAL_unreachable(); CGAL_unreachable();
} }
CGAL_kernel_assertion(false); CGAL_unreachable();
return S2S2_inter_info(false);
} }
// used internally by Arr_segment_traits_2 // used internally by Arr_segment_traits_2
@ -319,8 +318,7 @@ do_intersect_with_info(const typename K::Segment_2 &seg1,
CGAL_unreachable(); CGAL_unreachable();
} }
CGAL_kernel_assertion(false); CGAL_unreachable();
return S2S2_inter_info(false);
} }

View File

@ -15,6 +15,7 @@
#include <CGAL/enum.h> #include <CGAL/enum.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
namespace Intersections { namespace Intersections {
@ -57,13 +58,11 @@ do_intersect(const typename K::Triangle_3& t,
case POSITIVE: return (orientation(p,q,c,a) != NEGATIVE); case POSITIVE: return (orientation(p,q,c,a) != NEGATIVE);
case NEGATIVE: return (orientation(p,q,c,a) != POSITIVE); case NEGATIVE: return (orientation(p,q,c,a) != POSITIVE);
case COPLANAR: return true; case COPLANAR: return true;
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
} }

View File

@ -15,6 +15,7 @@
#include <CGAL/enum.h> #include <CGAL/enum.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
namespace Intersections { namespace Intersections {
@ -43,8 +44,7 @@ do_intersect(const typename K::Triangle_3& t,
case ON_ORIENTED_BOUNDARY: case ON_ORIENTED_BOUNDARY:
return true; return true;
default:// should not happen. default:// should not happen.
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
} }

View File

@ -15,6 +15,7 @@
#include <CGAL/enum.h> #include <CGAL/enum.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
namespace Intersections { namespace Intersections {
@ -59,12 +60,10 @@ do_intersect(const typename K::Triangle_3& t,
return (coplanar_orientation(c,a,p) != POSITIVE); return (coplanar_orientation(c,a,p) != POSITIVE);
case COLLINEAR: return true; case COLLINEAR: return true;
default: // should not happen. default: // should not happen.
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
default: // should not happen. default: // should not happen.
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
} }

View File

@ -15,6 +15,7 @@
#include <CGAL/enum.h> #include <CGAL/enum.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
namespace Intersections { namespace Intersections {
@ -139,9 +140,8 @@ do_intersect_coplanar(const typename K::Triangle_3& t,
// a is isolated on the positive side // a is isolated on the positive side
return visitor.result(coplanar_orientation(*a,*c,p) != POSITIVE); return visitor.result(coplanar_orientation(*a,*c,p) != POSITIVE);
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return visitor.result(false);
} }
case NEGATIVE: case NEGATIVE:
@ -165,9 +165,8 @@ do_intersect_coplanar(const typename K::Triangle_3& t,
// a is isolated on the negative side // a is isolated on the negative side
return visitor.result(coplanar_orientation(*b,*a,p) != POSITIVE); return visitor.result(coplanar_orientation(*b,*a,p) != POSITIVE);
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return visitor.result(false);
} }
case COLLINEAR: case COLLINEAR:
@ -190,14 +189,12 @@ do_intersect_coplanar(const typename K::Triangle_3& t,
return visitor.result(coplanar_orientation(*a,*c,p) != POSITIVE); return visitor.result(coplanar_orientation(*a,*c,p) != POSITIVE);
// case pqc == COLLINEAR is imposiible // case pqc == COLLINEAR is imposiible
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return visitor.result(false);
} }
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return visitor.result(false);
} }
} }
@ -262,9 +259,8 @@ do_intersect(const typename K::Triangle_3& t,
return visitor.result(true); return visitor.result(true);
} }
// case COPLANAR: should not happen // case COPLANAR: should not happen
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return visitor.result(false);
} }
case NEGATIVE: case NEGATIVE:
@ -292,9 +288,8 @@ do_intersect(const typename K::Triangle_3& t,
// case COPLANAR: should not happen // case COPLANAR: should not happen
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return visitor.result(false);
} }
case COPLANAR: // p belongs to the triangle's supporting plane case COPLANAR: // p belongs to the triangle's supporting plane
@ -316,14 +311,12 @@ do_intersect(const typename K::Triangle_3& t,
// case COPLANAR: should not happen // case COPLANAR: should not happen
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return visitor.result(false);
} }
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return visitor.result(false);
} }
} }

View File

@ -15,7 +15,7 @@
#include <CGAL/enum.h> #include <CGAL/enum.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
namespace Intersections { namespace Intersections {
namespace internal { namespace internal {
@ -79,9 +79,8 @@ bool do_intersect_coplanar(const typename K::Point_3& A,
// a is isolated on the positive side // a is isolated on the positive side
return coplanar_orientation(*a,*b,q) != NEGATIVE return coplanar_orientation(*a,*b,q) != NEGATIVE
&& coplanar_orientation(*c,*a,p) != NEGATIVE; && coplanar_orientation(*c,*a,p) != NEGATIVE;
default:// should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
case NEGATIVE: case NEGATIVE:
switch ( pqb ) { switch ( pqb ) {
@ -109,9 +108,8 @@ bool do_intersect_coplanar(const typename K::Point_3& A,
return coplanar_orientation(*a,*b,p) != NEGATIVE return coplanar_orientation(*a,*b,p) != NEGATIVE
&& coplanar_orientation(*c,*a,q) != NEGATIVE; && coplanar_orientation(*c,*a,q) != NEGATIVE;
default:// should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
case COLLINEAR: case COLLINEAR:
switch ( pqb ) { switch ( pqb ) {
@ -139,14 +137,11 @@ bool do_intersect_coplanar(const typename K::Point_3& A,
// case pqc == COLLINEAR is impossible since the triangle is // case pqc == COLLINEAR is impossible since the triangle is
// assumed to be non flat // assumed to be non flat
default:// should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
default:// should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
} }
@ -215,9 +210,8 @@ do_intersect(const typename K::Triangle_3& t,
return orientation(p,q,a,b) != POSITIVE return orientation(p,q,a,b) != POSITIVE
&& orientation(p,q,b,c) != POSITIVE && orientation(p,q,b,c) != POSITIVE
&& orientation(p,q,c,a) != POSITIVE; && orientation(p,q,c,a) != POSITIVE;
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
case NEGATIVE: case NEGATIVE:
switch ( abcq ) { switch ( abcq ) {
@ -237,9 +231,8 @@ do_intersect(const typename K::Triangle_3& t,
&& orientation(q,p,b,c) != POSITIVE && orientation(q,p,b,c) != POSITIVE
&& orientation(q,p,c,a) != POSITIVE; && orientation(q,p,c,a) != POSITIVE;
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
case COPLANAR: // p belongs to the triangle's supporting plane case COPLANAR: // p belongs to the triangle's supporting plane
switch ( abcq ) { switch ( abcq ) {
@ -259,13 +252,11 @@ do_intersect(const typename K::Triangle_3& t,
// supporting plane // supporting plane
return do_intersect_coplanar(t,s,k); return do_intersect_coplanar(t,s,k);
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
} }

View File

@ -15,6 +15,7 @@
#include <CGAL/enum.h> #include <CGAL/enum.h>
#include <CGAL/kernel_assertions.h> #include <CGAL/kernel_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/Uncertain.h> #include <CGAL/Uncertain.h>
namespace CGAL { namespace CGAL {
@ -304,21 +305,18 @@ do_intersect(const typename K::Triangle_3& t1,
case COPLANAR: case COPLANAR:
return do_intersect_coplanar(t1,t2,k); return do_intersect_coplanar(t1,t2,k);
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
break; break;
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
break; break;
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
const Point_3* s_min2; const Point_3* s_min2;
@ -429,21 +427,18 @@ do_intersect(const typename K::Triangle_3& t1,
// since the triangles are assumed to be non-flat // since the triangles are assumed to be non-flat
return do_intersect_coplanar(t1,t2,k); return do_intersect_coplanar(t1,t2,k);
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
break; break;
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
break; break;
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return false;
} }
return (orientation(*s_min1,*t_min1,*s_min2,*t_min2) != POSITIVE) && return (orientation(*s_min1,*t_min1,*s_min2,*t_min2) != POSITIVE) &&

View File

@ -418,8 +418,7 @@ private:
return true; return true;
} }
CGAL_assertion(false); CGAL_unreachable();
return false;
} }
IVertex non_collinear_vertex(const PFace& pface, const IEdge& iedge) const { IVertex non_collinear_vertex(const PFace& pface, const IEdge& iedge) const {

View File

@ -728,7 +728,7 @@ end()
endPolygonMesh(transform_matrix); endPolygonMesh(transform_matrix);
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
} }
dockWidget->hide(); dockWidget->hide();

View File

@ -379,11 +379,6 @@ public Q_SLOTS:
selection_item->poly_item_changed(); selection_item->poly_item_changed();
selection_item->changed_with_poly_item(); selection_item->changed_with_poly_item();
} }
else
{
std::cerr << "Something's gone wrong.\n";
CGAL_assertion(false);
}
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }

View File

@ -190,13 +190,9 @@ namespace CGAL {
{ {
// Allocate a dart for null_dart_descriptor // Allocate a dart for null_dart_descriptor
CGAL_assertion(mdarts.empty()); // the compact container is empty CGAL_assertion(mdarts.empty()); // the compact container is empty
Dart_index local_null_dart_descriptor = mdarts.emplace(); CGAL_assertion_code( Dart_index local_null_dart_descriptor = ) mdarts.emplace();
if(local_null_dart_descriptor!=0) CGAL_assertion_msg(local_null_dart_descriptor==0,
{ "[ERROR] fatal in CMap_linear_cell_complex_storage_with_index::init_storage");
std::cerr<<"[ERROR] fatal in CMap_linear_cell_complex_storage_with_index::init_storage"
<<std::endl;
CGAL_assertion(false);
}
} }
void clear_storage() void clear_storage()

View File

@ -73,10 +73,8 @@ public:
} }
Intrusive_list(const Intrusive_list& ) Intrusive_list(const Intrusive_list& ) = delete;
{
CGAL_assertion(false);
}
#ifdef CGAL_CONSTRUCT_INTRUSIVE_LIST_RANGE_CONSTRUCTOR #ifdef CGAL_CONSTRUCT_INTRUSIVE_LIST_RANGE_CONSTRUCTOR
template <typename IT> template <typename IT>

View File

@ -100,9 +100,7 @@ public:
break; break;
default: default:
// Should not happen // Should not happen
CGAL_assertion(false); CGAL_unreachable();
return CGAL::NULL_VECTOR;
break;
} }
return CGAL::NULL_VECTOR; return CGAL::NULL_VECTOR;

View File

@ -387,9 +387,8 @@ ts_intersection(const typename K::Triangle_3 &t,
// Mesh_3, because if the intersection is not a point, it is // Mesh_3, because if the intersection is not a point, it is
// ignored anyway. // ignored anyway.
return result_type(); return result_type();
default: // should not happen. default:
CGAL_kernel_assertion(false); CGAL_unreachable();
return result_type();
} }
} }
} }

View File

@ -976,12 +976,7 @@ Mesh_domain_with_polyline_features_3<MD_>::
point_corner_index(const Point_3& p) const point_corner_index(const Point_3& p) const
{ {
typename Corners::const_iterator p_index_it = corners_.find(p); typename Corners::const_iterator p_index_it = corners_.find(p);
if ( p_index_it == corners_.end() ) CGAL_assertion( p_index_it != corners_.end());
{
CGAL_assertion(false);
return Index();
}
return p_index_it->second; return p_index_it->second;
} }

View File

@ -169,6 +169,7 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot,
auto it = std::min_element(volumes.begin(), volumes.end()); auto it = std::min_element(volumes.begin(), volumes.end());
typename std::iterator_traits<decltype(it)>::difference_type d = std::distance(volumes.begin(), it); typename std::iterator_traits<decltype(it)>::difference_type d = std::distance(volumes.begin(), it);
CGAL_assertion(d == 0 || d == 1 || d == 2);
#ifdef CGAL_OPTIMAL_BOUNDING_BOX_DEBUG_PP #ifdef CGAL_OPTIMAL_BOUNDING_BOX_DEBUG_PP
std::cout << "volumes: " << volumes[0] << " " << volumes[1] << " " << volumes[2] << std::endl; std::cout << "volumes: " << volumes[0] << " " << volumes[1] << " " << volumes[2] << std::endl;
@ -212,10 +213,6 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot,
rot = opt * rot; rot = opt * rot;
} }
else
{
CGAL_assertion(false);
}
} }
// This operation makes no sense if an exact number type is used, so skip it, if so // This operation makes no sense if an exact number type is used, so skip it, if so

View File

@ -1137,11 +1137,7 @@ private:
} }
while(circ != done); while(circ != done);
if(voronoi_points.size() < 3) CGAL_assertion(! (voronoi_points.size() < 3));
{
CGAL_assertion(false);
return 0.0;
}
// sum up areas // sum up areas
FT area = 0.0; FT area = 0.0;

View File

@ -126,9 +126,8 @@ intersection_type(
// p sees the triangle in counterclockwise order // p sees the triangle in counterclockwise order
return find_intersection(p,q,a,b,c,h_2,tm2,false,true); return find_intersection(p,q,a,b,c,h_2,tm2,false,true);
default: // should not happen. default:
CGAL_assertion(false); CGAL_unreachable();
return result_type(EMPTY,GT::null_halfedge(),false,false);
} }
case NEGATIVE: case NEGATIVE:
switch ( abcq ) { switch ( abcq ) {
@ -143,9 +142,8 @@ intersection_type(
// q belongs to the triangle's supporting plane // q belongs to the triangle's supporting plane
// p sees the triangle in clockwise order // p sees the triangle in clockwise order
return find_intersection(q,p,a,b,c,h_2,tm2,false,true); return find_intersection(q,p,a,b,c,h_2,tm2,false,true);
default: // should not happen. default:
CGAL_assertion(false); CGAL_unreachable();
return result_type(EMPTY,GT::null_halfedge(),false,false);
} }
case COPLANAR: // p belongs to the triangle's supporting plane case COPLANAR: // p belongs to the triangle's supporting plane
switch ( abcq ) { switch ( abcq ) {
@ -163,13 +161,11 @@ intersection_type(
return result_type(COPLANAR_TRIANGLES,GT::null_halfedge(),true,true); return result_type(COPLANAR_TRIANGLES,GT::null_halfedge(),true,true);
return result_type(EMPTY,GT::null_halfedge(),true,true); return result_type(EMPTY,GT::null_halfedge(),true,true);
default: // should not happen. default:
CGAL_assertion(false); CGAL_unreachable();
return result_type(EMPTY,GT::null_halfedge(),false,false);
} }
default: // should not happen. default:
CGAL_assertion(false); CGAL_unreachable();
return result_type(EMPTY,GT::null_halfedge(),false,false);
} }
} }

View File

@ -1961,7 +1961,7 @@ private:
else if(is_on_mesh(h)) nb_mesh++; else if(is_on_mesh(h)) nb_mesh++;
else if(is_on_border(h)) nb_border++; else if(is_on_border(h)) nb_border++;
else if(is_an_isolated_constraint(h)) nb_isolated++; else if(is_an_isolated_constraint(h)) nb_isolated++;
else CGAL_assertion(false); else CGAL_unreachable();
} }
CGAL_USE(nb_border); CGAL_USE(nb_border);
CGAL_USE(nb_mesh); CGAL_USE(nb_mesh);

View File

@ -641,9 +641,7 @@ public:
CGAL_SDG_DEBUG(std::cout << "ON_BOUNDED_SIDE" << std::endl;); CGAL_SDG_DEBUG(std::cout << "ON_BOUNDED_SIDE" << std::endl;);
return ON_BOUNDED_SIDE; return ON_BOUNDED_SIDE;
default: default:
CGAL_SDG_DEBUG(std::cout << "error: should never reach here";); CGAL_unreachable();
CGAL_assertion( false );
return ON_BOUNDARY;
} }
} }

View File

@ -780,7 +780,7 @@ private:
// philaris: execution should never reach here // philaris: execution should never reach here
// philaris: code added to avoid warnings on some compilers // philaris: code added to avoid warnings on some compilers
CGAL_assertion( false ); CGAL_assertion(false);
return ZERO; return ZERO;
} // end of case where segment is neither horizontal nor vertical } // end of case where segment is neither horizontal nor vertical
@ -877,7 +877,7 @@ private:
otherpnt = seg.source(); otherpnt = seg.source();
} else { } else {
// unreachable // unreachable
CGAL_assertion( false ); CGAL_assertion(false);
} }
lhor = compute_horizontal_side_line( lhor = compute_horizontal_side_line(
@ -1138,7 +1138,7 @@ private:
otherpnt = seg.source(); otherpnt = seg.source();
} else { } else {
// unreachable // unreachable
CGAL_assertion( false ); CGAL_assertion(false);
} }
lhor = compute_horizontal_side_line( lhor = compute_horizontal_side_line(

View File

@ -592,8 +592,8 @@ private:
const unsigned int bq = bearing(lq); const unsigned int bq = bearing(lq);
const unsigned int br = bearing(lr); const unsigned int br = bearing(lr);
const unsigned int bdiff = bearing_diff(bq, br); const unsigned int bdiff = bearing_diff(bq, br);
CGAL_assertion( bdiff != 0 ); CGAL_assertion( bdiff > 0 );
CGAL_assertion( bdiff != 7 ); CGAL_assertion( bdiff < 7 );
if (bdiff == 1) { if (bdiff == 1) {
compute_pss_corner_and_pt(p, q, r, lq, lr, bq, br); compute_pss_corner_and_pt(p, q, r, lq, lr, bq, br);
@ -605,8 +605,6 @@ private:
compute_pss_side_p_known(p, q, r, lq, lr, bq, br); compute_pss_side_p_known(p, q, r, lq, lr, bq, br);
} else if (bdiff == 6) { } else if (bdiff == 6) {
compute_pss_lines_side(p, lq, lr, (br+1)%8); compute_pss_lines_side(p, lq, lr, (br+1)%8);
} else {
CGAL_assertion( false );
} }
CGAL_assertion_code( is_v_computed = true ); CGAL_assertion_code( is_v_computed = true );
CGAL_assertion( oriented_side_of_line(lq, this->point()) != ZERO ); CGAL_assertion( oriented_side_of_line(lq, this->point()) != ZERO );

View File

@ -1106,8 +1106,7 @@ private:
const Bearing bq = bearing(lq); const Bearing bq = bearing(lq);
const Bearing br = bearing(lr); const Bearing br = bearing(lr);
const Bearing bdiff = bearing_diff(bq, br); const Bearing bdiff = bearing_diff(bq, br);
CGAL_assertion( bdiff != 0 ); CGAL_assertion( bdiff > 0 && bdiff < 7 );
CGAL_assertion( bdiff != 7 );
if (bdiff == 1) { if (bdiff == 1) {
compute_pss_corner_and_pt(p, lq, lr, bq, br); compute_pss_corner_and_pt(p, lq, lr, bq, br);
@ -1119,9 +1118,8 @@ private:
compute_pss_side_p_known(p, q, r, lq, lr, bq, br); compute_pss_side_p_known(p, q, r, lq, lr, bq, br);
} else if (bdiff == 6) { } else if (bdiff == 6) {
compute_pss_lines_side(p, lq, lr, (br+1)%8); compute_pss_lines_side(p, lq, lr, (br+1)%8);
} else {
CGAL_assertion( false );
} }
CGAL_assertion( oriented_side_of_line(lq, this->point()) != ZERO ); CGAL_assertion( oriented_side_of_line(lq, this->point()) != ZERO );
CGAL_assertion( oriented_side_of_line(lr, this->point()) != ZERO ); CGAL_assertion( oriented_side_of_line(lr, this->point()) != ZERO );
} }

View File

@ -148,7 +148,7 @@ public:
case TRISEGMENT_COLLINEARITY_02: case TRISEGMENT_COLLINEARITY_02:
return e(2); return e(2);
default: default:
CGAL_assertion(false); CGAL_unreachable();
return e(0); // arbitrary, meaningless value because a const& is expected return e(0); // arbitrary, meaningless value because a const& is expected
} }
} }
@ -166,8 +166,7 @@ public:
case TRISEGMENT_COLLINEARITY_02: case TRISEGMENT_COLLINEARITY_02:
return w(2); return w(2);
default: default:
CGAL_assertion(false); CGAL_unreachable();
return w(0); // arbitrary, meaningless value because a const& is expected
} }
} }

View File

@ -556,6 +556,7 @@ public:
erase_control_vertex(vd); // also erase from being control erase_control_vertex(vd); // also erase from being control
typename std::vector<vertex_descriptor>::iterator it = std::find(roi.begin(), roi.end(), vd); typename std::vector<vertex_descriptor>::iterator it = std::find(roi.begin(), roi.end(), vd);
CGAL_assertion_msg(it != roi.end(), "inconsistency between is_roi_map, and roi vector");
if(it != roi.end()) if(it != roi.end())
{ {
is_roi_map[id(vd)] = false; is_roi_map[id(vd)] = false;
@ -564,8 +565,6 @@ public:
need_preprocess_both(); need_preprocess_both();
return true; return true;
} }
CGAL_assertion(false); // inconsistency between is_roi_map, and roi vector!
return false; return false;
} }

View File

@ -205,7 +205,7 @@ public:
V1_max = zmax; V1_max = zmax;
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
} }
switch (second_longest_axis) switch (second_longest_axis)
{ {
@ -225,7 +225,7 @@ public:
V2_max = zmax; V2_max = zmax;
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
} }
// Project onto longest bounding box axes, // Project onto longest bounding box axes,

View File

@ -122,8 +122,7 @@ void find_start_cone(const ConeMap& cmap,
return; return;
} }
std::cerr << "Error: did not find first cone" << std::endl; CGAL_postcondition_msg(false,"Error: did not find first cone");
CGAL_postcondition(false);
} }
// Locate the cone tagged 'First_unique_cone' in the seam mesh. // Locate the cone tagged 'First_unique_cone' in the seam mesh.
@ -143,8 +142,7 @@ void find_start_cone(const ConeMap& cmap,
return; return;
} }
std::cerr << "Error: did not find first cone" << std::endl; CGAL_postcondition_msg(false,"Error: did not find first cone");
CGAL_postcondition(false);
} }
/// Check the validity of the input cones in the `Seam_mesh` mesh. /// Check the validity of the input cones in the `Seam_mesh` mesh.

View File

@ -35,17 +35,8 @@ namespace internal {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// Get_beta /// Get_beta
template<typename HEG, unsigned int i> template<typename HEG, unsigned int i>
struct Get_beta struct Get_beta;
{
typedef typename boost::graph_traits<HEG>::halfedge_descriptor Dart_const_descriptor;
static Dart_const_descriptor value(const HEG& /*heg*/, Dart_const_descriptor /*dh*/)
{
std::cout<<"ERROR Get_beta<HEG, "<<i<<">"<<std::endl;
CGAL_assertion(false);
return nullptr;
}
};
template<typename HEG> template<typename HEG>
struct Get_beta<HEG, 0> struct Get_beta<HEG, 0>
{ {

View File

@ -1118,8 +1118,8 @@ insert_dim_up(Vertex_handle w, bool orient)
} }
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
break; } }
return v; return v;
} }

View File

@ -880,13 +880,9 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3,
{ {
const auto intersection = proj.value().first; const auto intersection = proj.value().first;
using Segment = typename Tr::Geom_traits::Segment_3; using Segment = typename Tr::Geom_traits::Segment_3;
if (const Segment* s = std::get_if<Segment>(&intersection)) const Segment* s = std::get_if<Segment>(&intersection);
return CGAL::midpoint(s->source(), s->target()); CGAL_assertion(s != nullptr);
else return CGAL::midpoint(s->source(), s->target());
{
CGAL_assertion(false);
return std::nullopt;
}
}; };
const auto n = vertices_normals.at(v).at(si); const auto n = vertices_normals.at(v).at(si);

View File

@ -844,7 +844,7 @@ void set_index(typename C3t3::Vertex_handle v, const C3t3& c3t3)
case -1://far points from concurrent Mesh_3 case -1://far points from concurrent Mesh_3
break; break;
default: default:
CGAL_assertion(false); CGAL_unreachable();
} }
} }

View File

@ -496,8 +496,7 @@ public:
pit = propagate_conflicts(p,fh,2,pit); pit = propagate_conflicts(p,fh,2,pit);
return pit; return pit;
} }
CGAL_assertion(false); CGAL_unreachable();
return std::make_pair(fit,eit);
} }
template <class OutputItFaces> template <class OutputItFaces>

View File

@ -417,8 +417,7 @@ public:
pit = propagate_conflicts(p,fh,2,pit); pit = propagate_conflicts(p,fh,2,pit);
return pit; return pit;
} }
CGAL_assertion(false); CGAL_unreachable();
return std::make_pair(fit,eit);
} }
template <class OutputItFaces> template <class OutputItFaces>

View File

@ -640,8 +640,7 @@ public:
} }
return make_triple(fit, eit, vit); return make_triple(fit, eit, vit);
} }
CGAL_assertion(false); CGAL_unreachable();
return make_triple(fit, eit, vit);
} }
template <class OutputItFaces, class OutputItBoundaryEdges> template <class OutputItFaces, class OutputItBoundaryEdges>

View File

@ -1497,8 +1497,7 @@ insert(const Point& p, Locate_type lt, Face_handle loc, int li)
case VERTEX: case VERTEX:
return loc->vertex(li); return loc->vertex(li);
} }
CGAL_assertion(false); // locate step failed CGAL_unreachable();
return Vertex_handle();
} }

View File

@ -251,8 +251,7 @@ private:
Vertex_handle Vertex_handle
nearest_vertex_dispatch(const Point&, Face_handle, Tag_true) const nearest_vertex_dispatch(const Point&, Face_handle, Tag_true) const
{ {
CGAL_assertion(false); CGAL_unreachable();
return Vertex_handle();
} }
void locate_in_all(const Point& p, void locate_in_all(const Point& p,

View File

@ -944,9 +944,7 @@ private:
default: default:
CGAL_unreachable(); CGAL_unreachable();
} }
//should not be reached
CGAL_unreachable(); CGAL_unreachable();
return false;
} }
bool cell_has_edge(const Cell_handle ch, const Edge& e) const bool cell_has_edge(const Cell_handle ch, const Edge& e) const
@ -1057,7 +1055,7 @@ private:
} while (++circ != end); } while (++circ != end);
std::cerr << "There is no facet shared by e and v" << std::endl; std::cerr << "There is no facet shared by e and v" << std::endl;
CGAL_unreachable(); CGAL_assertion(false);
return Facet(Cell_handle(), 0); return Facet(Cell_handle(), 0);
} }
@ -1074,7 +1072,7 @@ private:
} while (++circ != end); } while (++circ != end);
std::cerr << "There is no cell shared by e and v" << std::endl; std::cerr << "There is no cell shared by e and v" << std::endl;
CGAL_unreachable(); CGAL_assertion(false);
return Cell_handle(); return Cell_handle();
} }

View File

@ -780,7 +780,7 @@ march_locate_2D(Face_handle f,
} }
} }
CGAL_precondition(false); CGAL_assertion(false);
} }
} }
@ -972,9 +972,7 @@ march_locate_2D(Face_handle f,
} }
default: default:
{ {
// impossible CGAL_unreachable();
CGAL_assertion(false);
return f;
} }
} }

View File

@ -238,7 +238,6 @@ private:
} }
CGAL_unreachable(); CGAL_unreachable();
return false;
} }
}; };