Update branch from master after trailing whitespaces and tabs removal

This commit is contained in:
Sébastien Loriot 2020-03-26 19:25:47 +01:00
commit 38789af55d
16 changed files with 862 additions and 850 deletions

View File

@ -39,7 +39,7 @@ public:
typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real_1; typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real_1;
Bitstream_coefficient_kernel_at_alpha_rep() {} Bitstream_coefficient_kernel_at_alpha_rep() : _m_kernel(nullptr) {}
Bitstream_coefficient_kernel_at_alpha_rep(Algebraic_kernel_d_1* kernel, Bitstream_coefficient_kernel_at_alpha_rep(Algebraic_kernel_d_1* kernel,
Algebraic_real_1 alpha) Algebraic_real_1 alpha)
@ -136,19 +136,19 @@ public:
: public CGAL::cpp98::unary_function<Coefficient,Bigfloat_interval> { : public CGAL::cpp98::unary_function<Coefficient,Bigfloat_interval> {
Convert_to_bfi(Algebraic_kernel_d_1* kernel, Convert_to_bfi(Algebraic_kernel_d_1* kernel,
Algebraic_real_1 alpha) Algebraic_real_1 alpha)
: _m_kernel(kernel), _m_alpha(alpha) {} : _m_kernel(kernel), _m_alpha(alpha) {}
Bigfloat_interval operator() (Coefficient f) const { Bigfloat_interval operator() (Coefficient f) const {
typename CGAL::Polynomial_traits_d<Coefficient> typename CGAL::Polynomial_traits_d<Coefficient>
::template Rebind<Bigfloat_interval,1>::Other::Type f_bfi; ::template Rebind<Bigfloat_interval,1>::Other::Type f_bfi;
typename Algebraic_kernel_d_1::Approximate_relative_1 approx_alpha typename Algebraic_kernel_d_1::Approximate_relative_1 approx_alpha
=_m_kernel->approximate_relative_1_object(); =_m_kernel->approximate_relative_1_object();
typedef typename Algebraic_kernel_d_1::Bound Bound; typedef typename Algebraic_kernel_d_1::Bound Bound;
Bigfloat_interval alpha_bfi, f_alpha_bfi; Bigfloat_interval alpha_bfi, f_alpha_bfi;
long p = CGAL::get_precision(Bigfloat_interval()); long p = CGAL::get_precision(Bigfloat_interval());
@ -156,19 +156,19 @@ public:
long wbit = 0; long wbit = 0;
while(true) { while(true) {
CGAL::set_precision(Bigfloat_interval(),prec); CGAL::set_precision(Bigfloat_interval(),prec);
f_bfi = this->_convert_polynomial_to_bfi(f); f_bfi = this->_convert_polynomial_to_bfi(f);
std::pair<Bound,Bound> alpha_bounds std::pair<Bound,Bound> alpha_bounds
= approx_alpha(_m_alpha,prec); = approx_alpha(_m_alpha,prec);
alpha_bfi = CGAL::hull alpha_bfi = CGAL::hull
(CGAL::convert_to_bfi(alpha_bounds.first), (CGAL::convert_to_bfi(alpha_bounds.first),
CGAL::convert_to_bfi(alpha_bounds.second)); CGAL::convert_to_bfi(alpha_bounds.second));
f_alpha_bfi = f_bfi.evaluate(alpha_bfi); f_alpha_bfi = f_bfi.evaluate(alpha_bfi);
if(!CGAL::singleton(f_alpha_bfi)) { if(!CGAL::singleton(f_alpha_bfi)) {
long ceil = CGAL::internal::ceil_log2_abs(f_alpha_bfi); long ceil = CGAL::internal::ceil_log2_abs(f_alpha_bfi);

View File

@ -41,8 +41,8 @@ int main()
int n; int n;
is >> n; is >> n;
std::cout << "Reading " << n << " points " << std::endl; std::cout << "Reading " << n << " points " << std::endl;
Bare_point bp;
for( ; n>0 ; n--) { for( ; n>0 ; n--) {
Bare_point bp;
is >> bp; is >> bp;
Weighted_point p(bp, 0.0001 * random.get_double(0., 0.015625)); // arbitrary weights Weighted_point p(bp, 0.0001 * random.get_double(0., 0.015625)); // arbitrary weights
pts.push_back(p); pts.push_back(p);

View File

@ -60,7 +60,7 @@ private:
void Cone_spanners_ipelet::protected_run(int fn) void Cone_spanners_ipelet::protected_run(int fn)
{ {
std::vector<Point_2> lst; std::vector<Point_2> lst;
int number_of_cones; int number_of_cones = 0;
switch (fn){ switch (fn){
case 0: case 0:
case 1: case 1:

View File

@ -312,15 +312,12 @@ class ConicCPA2
PT center () const PT center () const
{ {
CGAL_kernel_precondition (type != PARABOLA); CGAL_kernel_precondition (type != PARABOLA);
// PT p;
// replaced previous line by following hack (no idea const FT two = FT(2);
// why original version doesn't work) const FT div = -det();
typename DA::Point p;
FT two = FT(2); return PT((two*s()*u() - t()*v()) / div,
FT div = -det(); (two*r()*v() - t()*u()) / div);
dao.set( p, (two*s()*u() - t()*v()) / div,
(two*r()*v() - t()*u()) / div);
return p;
} }
Conic_type conic_type () const Conic_type conic_type () const

View File

@ -229,8 +229,8 @@ template < class FT >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
void void
bisector_of_pointsC2(const FT &px, const FT &py, bisector_of_pointsC2(const FT &px, const FT &py,
const FT &qx, const FT &qy, const FT &qx, const FT &qy,
FT &a, FT &b, FT& c ) FT &a, FT &b, FT& c )
{ {
a = 2 * (px - qx); a = 2 * (px - qx);
b = 2 * (py - qy); b = 2 * (py - qy);
@ -242,8 +242,8 @@ template < class FT >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
void void
bisector_of_linesC2(const FT &pa, const FT &pb, const FT &pc, bisector_of_linesC2(const FT &pa, const FT &pb, const FT &pc,
const FT &qa, const FT &qb, const FT &qc, const FT &qa, const FT &qb, const FT &qc,
FT &a, FT &b, FT &c) FT &a, FT &b, FT &c)
{ {
// We normalize the equations of the 2 lines, and we then add them. // We normalize the equations of the 2 lines, and we then add them.
FT n1 = CGAL_NTS sqrt(CGAL_NTS square(pa) + CGAL_NTS square(pb)); FT n1 = CGAL_NTS sqrt(CGAL_NTS square(pa) + CGAL_NTS square(pb));
@ -276,15 +276,12 @@ line_get_pointC2(const FT &a, const FT &b, const FT &c, const FT &i,
{ {
if (CGAL_NTS is_zero(b)) if (CGAL_NTS is_zero(b))
{ {
// Laurent Rineau, 2018/12/07: I add this CGAL_assume to calm // Silence a warning for MSVC 2017
// down a warning from MSVC 2017:
// > include\cgal\constructions\kernel_ftc2.h(287) : // > include\cgal\constructions\kernel_ftc2.h(287) :
// > warning C4723: potential divide by 0 // > warning C4723: potential divide by 0
// The test `!boost::is_integral<FT>::value` is there to avoid #if defined(BOOST_MSVC)
// that `a != 0` is tested on anything but integral types, for #pragma warning(suppress:4723)
// performance reasons. #endif
CGAL_assume(!boost::is_integral<FT>::value || a != FT(0));
x = -c/a; x = -c/a;
y = 1 - i * a; y = 1 - i * a;
} }
@ -299,8 +296,8 @@ template < class FT >
inline inline
void void
perpendicular_through_pointC2(const FT &la, const FT &lb, perpendicular_through_pointC2(const FT &la, const FT &lb,
const FT &px, const FT &py, const FT &px, const FT &py,
FT &a, FT &b, FT &c) FT &a, FT &b, FT &c)
{ {
a = -lb; a = -lb;
b = la; b = la;
@ -311,8 +308,8 @@ template < class FT >
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
void void
line_project_pointC2(const FT &la, const FT &lb, const FT &lc, line_project_pointC2(const FT &la, const FT &lb, const FT &lc,
const FT &px, const FT &py, const FT &px, const FT &py,
FT &x, FT &y) FT &x, FT &y)
{ {
if (certainly(is_zero(la))) // horizontal line if (certainly(is_zero(la))) // horizontal line
{ {

View File

@ -79,9 +79,15 @@ int main()
Convex_hull_d::Point_const_iterator pit; Convex_hull_d::Point_const_iterator pit;
Convex_hull_d::Vertex_iterator vit; Convex_hull_d::Vertex_iterator vit;
Convex_hull_d::Simplex_iterator sit; Convex_hull_d::Simplex_iterator sit;
for (pit = T1.points_begin(); pit != T1.points_end(); pit++) *pit; for (pit = T1.points_begin(); pit != T1.points_end(); pit++) {
for (vit = T1.vertices_begin(); vit != T1.vertices_end(); vit++) *vit; const Point& p = *pit;
for (sit = T1.simplices_begin(); sit != T1.simplices_end(); sit++) *sit; CGAL_USE(p);
}
for (vit = T1.vertices_begin(); vit != T1.vertices_end(); vit++)
*vit;
for (sit = T1.simplices_begin(); sit != T1.simplices_end(); sit++)
*sit;
T1.is_valid(); T1.is_valid();
T1.clear(2); T1.clear(2);
CGAL_TEST(T1.number_of_vertices()==0); CGAL_TEST(T1.number_of_vertices()==0);

View File

@ -41,7 +41,8 @@ fct(const P& )
{ {
std::map<Descriptor,int> M; std::map<Descriptor,int> M;
Descriptor d; Descriptor d;
M.find(d); typename std::map<Descriptor,int>::const_iterator it = M.find(d);
CGAL_USE(it);
boost::unordered_map<Descriptor, int> U; boost::unordered_map<Descriptor, int> U;
U[d] = 12; U[d] = 12;
@ -56,7 +57,9 @@ void fct2()
{ // For dart handle { // For dart handle
std::map<dh, int> M; std::map<dh, int> M;
dh e; dh e;
M.find(e); typename std::map<dh, int>::const_iterator it = M.find(e);
CGAL_USE(it);
boost::unordered_map<dh, int> U; boost::unordered_map<dh, int> U;
U[e] = 12; U[e] = 12;
} }
@ -64,7 +67,9 @@ void fct2()
{ // For vertex attribute handle { // For vertex attribute handle
std::map<vh, int> M; std::map<vh, int> M;
vh e; vh e;
M.find(e); typename std::map<vh, int>::const_iterator it = M.find(e);
CGAL_USE(it);
boost::unordered_map<vh, int> U; boost::unordered_map<vh, int> U;
U[e] = 12; U[e] = 12;
} }

View File

@ -1373,7 +1373,6 @@ private:
std::size_t vertex_id(const std::size_t& i) const std::size_t vertex_id(const std::size_t& i) const
{ {
CGAL_precondition(i >= 0);
CGAL_precondition((infinite_ && i < 3) || i < 4); CGAL_precondition((infinite_ && i < 3) || i < 4);
return vertices_[i]; return vertices_[i];
} }

View File

@ -174,9 +174,9 @@ Vertex_handle new_vertex(const Point& p)
void link_as_target_and_append(Vertex_handle v, Halfedge_handle e) void link_as_target_and_append(Vertex_handle v, Halfedge_handle e)
{ CGAL_NEF_TRACEN(" link as target and append " { CGAL_NEF_TRACEN(" link as target and append "
<< e->source()->point() << "->" << e->source()->point() << "->"
<< v->point()); << v->point());
G.link_as_target_and_append(v,e); } G.link_as_target_and_append(v,e); }
Halfedge_handle new_halfedge_pair_at_source(Vertex_handle v) Halfedge_handle new_halfedge_pair_at_source(Vertex_handle v)
{ CGAL_NEF_TRACEN(" new halfedge pair at source " << v->point()); { CGAL_NEF_TRACEN(" new halfedge pair at source " << v->point());
@ -235,13 +235,13 @@ void starting_segment(Vertex_handle v, IT it) const
if(se->source()->point() != v->point()) { if(se->source()->point() != v->point()) {
se = se->twin(); se = se->twin();
if(se->source()->point() != v->point()) { if(se->source()->point() != v->point()) {
G.supp_object(v,si._from) = si._o; G.supp_object(v,si._from) = si._o;
return; return;
} }
} }
G.supp_object(v,si._from) = make_object(se->source()); G.supp_object(v,si._from) = make_object(se->source());
CGAL_NEF_TRACEN("starting_segment " << si._from << ":"<< CGAL_NEF_TRACEN("starting_segment " << si._from << ":"<<
v->point() << " " << se->source()->point()); v->point() << " " << se->source()->point());
} else if(CGAL::assign(sl, si._o)) { } else if(CGAL::assign(sl, si._o)) {
G.supp_object(v,si._from) = si._o; G.supp_object(v,si._from) = si._o;
} else } else
@ -258,15 +258,15 @@ void ending_segment(Vertex_handle v, IT it) const
if(se->source()->point() != v->point()) { if(se->source()->point() != v->point()) {
se = se->twin(); se = se->twin();
if(se->source()->point() != v->point()) { if(se->source()->point() != v->point()) {
G.supp_object(v,si._from) = si._o; G.supp_object(v,si._from) = si._o;
return; return;
} }
} }
G.supp_object(v,si._from) = make_object(se->source()); G.supp_object(v,si._from) = make_object(se->source());
CGAL_NEF_TRACEN("ending_segment " << si._from << ":"<< CGAL_NEF_TRACEN("ending_segment " << si._from << ":"<<
v->point() << ":" << v->point() << ":" <<
se->source()->point() << "->" << se->source()->point() << "->" <<
se->twin()->source()->point()); se->twin()->source()->point());
} else if(CGAL::assign(sl, si._o)) { } else if(CGAL::assign(sl, si._o)) {
G.supp_object(v,si._from) = si._o; G.supp_object(v,si._from) = si._o;
} else } else
@ -292,7 +292,7 @@ void assert_equal_marks(Vertex_handle v1, Vertex_handle v2) const
CGAL_NEF_TRACEV(G.mark(v1,0));CGAL_NEF_TRACEV(G.mark(v1,1)); CGAL_NEF_TRACEV(G.mark(v1,0));CGAL_NEF_TRACEV(G.mark(v1,1));
CGAL_NEF_TRACEV(G.mark(v2,0));CGAL_NEF_TRACEV(G.mark(v2,1)); CGAL_NEF_TRACEV(G.mark(v2,0));CGAL_NEF_TRACEV(G.mark(v2,1));
CGAL_assertion(G.mark(v1,0)==G.mark(v2,0)&& CGAL_assertion(G.mark(v1,0)==G.mark(v2,0)&&
G.mark(v1,1)==G.mark(v2,1)); } G.mark(v1,1)==G.mark(v2,1)); }
void discard_info(Vertex_handle v) const void discard_info(Vertex_handle v) const
{ G.discard_info(v); } { G.discard_info(v); }
@ -301,7 +301,7 @@ void assert_equal_marks(Halfedge_handle e1, Halfedge_handle e2) const
CGAL_USE(e1); CGAL_USE(e1);
CGAL_USE(e2); CGAL_USE(e2);
CGAL_assertion(G.mark(e1,0)==G.mark(e2,0) && CGAL_assertion(G.mark(e1,0)==G.mark(e2,0) &&
G.mark(e1,1)==G.mark(e2,1)); G.mark(e1,1)==G.mark(e2,1));
} }
void discard_info(Halfedge_handle e) const void discard_info(Halfedge_handle e) const
@ -540,8 +540,13 @@ public:
Mark m[2]; Mark m[2];
Object_handle o_supp[2]; Object_handle o_supp[2];
SHalfedge_handle e_below; SHalfedge_handle e_below;
vertex_info() vertex_info()
{ o_supp[0]=o_supp[1]=Object_handle(); } {
m[0]=m[1]=Mark();
o_supp[0]=o_supp[1]=Object_handle();
}
LEDA_MEMORY(vertex_info) LEDA_MEMORY(vertex_info)
}; // vertex_info }; // vertex_info
@ -708,8 +713,8 @@ public:
Sphere_segment segment(SM_const_decorator , Sphere_segment segment(SM_const_decorator ,
SHalfedge_const_handle e) const SHalfedge_const_handle e) const
{ return K.construct_segment(e->source()->point(), { return K.construct_segment(e->source()->point(),
e->target()->point(), e->target()->point(),
e->circle()); } e->circle()); }
Sphere_segment trivial_segment(SM_const_decorator , Sphere_segment trivial_segment(SM_const_decorator ,
SVertex_const_handle v) const SVertex_const_handle v) const
@ -757,12 +762,12 @@ public:
and the two halfspheres incident to it.}*/ and the two halfspheres incident to it.}*/
void subdivide(const Map* M0, const Map* M1, void subdivide(const Map* M0, const Map* M1,
bool with_trivial_segments = false); bool with_trivial_segments = false);
template <typename Association> template <typename Association>
void subdivide(const Map* M0, const Map* M1, void subdivide(const Map* M0, const Map* M1,
Association& A, Association& A,
bool with_trivial_segments = false); bool with_trivial_segments = false);
/*{\Mop constructs the overlay of the sphere maps |M0| and |M1| in /*{\Mop constructs the overlay of the sphere maps |M0| and |M1| in
|M|, where all objects (vertices, halfedges, faces) of |M| are |M|, where all objects (vertices, halfedges, faces) of |M| are
\emph{enriched} by the marks of the supporting objects of the two \emph{enriched} by the marks of the supporting objects of the two
@ -810,9 +815,9 @@ public:
template <typename Below_accessor, typename Halfsphere_geometry> template <typename Below_accessor, typename Halfsphere_geometry>
void create_face_objects(SHalfedge_iterator e_start, SHalfedge_iterator e_end, void create_face_objects(SHalfedge_iterator e_start, SHalfedge_iterator e_end,
SVertex_iterator v_start, SVertex_iterator v_end, SVertex_iterator v_start, SVertex_iterator v_end,
const Below_accessor& D, const Below_accessor& D,
const Halfsphere_geometry& SG); const Halfsphere_geometry& SG);
template <typename Below_accessor> template <typename Below_accessor>
void complete_face_support(SVertex_iterator v_start, SVertex_iterator v_end, void complete_face_support(SVertex_iterator v_start, SVertex_iterator v_end,
@ -842,9 +847,9 @@ create_from_segments(Forward_iterator start, Forward_iterator end)
CGAL_forall_iterators(it,L) From_input[it]=true; CGAL_forall_iterators(it,L) From_input[it]=true;
Seg_list L_pos,L_neg; Seg_list L_pos,L_neg;
partition_to_halfsphere(L.begin(), L.end(), L_pos, From_input, partition_to_halfsphere(L.begin(), L.end(), L_pos, From_input,
Sphere_circle(0,0,1), Sphere_circle(1,0,0), true); Sphere_circle(0,0,1), Sphere_circle(1,0,0), true);
partition_to_halfsphere(L.begin(), L.end(), L_neg, From_input, partition_to_halfsphere(L.begin(), L.end(), L_neg, From_input,
Sphere_circle(0,0,-1), Sphere_circle(1,0,0), true); Sphere_circle(0,0,-1), Sphere_circle(1,0,0), true);
typedef SMO_from_segs<Self,Seg_iterator> SM_output; typedef SMO_from_segs<Self,Seg_iterator> SM_output;
typedef typename Sphere_kernel::Positive_halfsphere_geometry PH_geometry; typedef typename Sphere_kernel::Positive_halfsphere_geometry PH_geometry;
@ -915,9 +920,9 @@ create_from_circles(Forward_iterator start, Forward_iterator end)
CGAL_forall_iterators(it,L) From_input[it]=true; CGAL_forall_iterators(it,L) From_input[it]=true;
Seg_list L_pos,L_neg; Seg_list L_pos,L_neg;
partition_to_halfsphere(L.begin(), L.end(), L_pos, From_input, partition_to_halfsphere(L.begin(), L.end(), L_pos, From_input,
Sphere_circle(0,0,1), Sphere_circle(1,0,0), true); Sphere_circle(0,0,1), Sphere_circle(1,0,0), true);
partition_to_halfsphere(L.begin(), L.end(), L_neg, From_input, partition_to_halfsphere(L.begin(), L.end(), L_neg, From_input,
Sphere_circle(0,0,-1), Sphere_circle(1,0,0), true); Sphere_circle(0,0,-1), Sphere_circle(1,0,0), true);
typedef SMO_from_segs<Self,Seg_iterator> SM_output; typedef SMO_from_segs<Self,Seg_iterator> SM_output;
typedef typename Sphere_kernel::Positive_halfsphere_geometry PH_geometry; typedef typename Sphere_kernel::Positive_halfsphere_geometry PH_geometry;
@ -1077,15 +1082,15 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
if((chsp&48)!=48) if((chsp&48)!=48)
if(i.z() > 0) chsp|=16; if(i.z() > 0) chsp|=16;
else if(i.z() < 0) chsp|=32; else if(i.z() < 0) chsp|=32;
} else if((chsp&51)!=51 && it->source().y()!=0) { } else if((chsp&51)!=51 && it->source().y()!=0) {
Sphere_point i = intersection(it->sphere_circle(), Sphere_circle(0,1,0)); Sphere_point i = intersection(it->sphere_circle(), Sphere_circle(0,1,0));
CGAL_NEF_TRACEN("intersection " << i); CGAL_NEF_TRACEN("intersection " << i);
if(!it->has_on_after_intersection(i)) i=i.antipode(); if(!it->has_on_after_intersection(i)) i=i.antipode();
if((chsp&3)!=3) if((chsp&3)!=3)
if(i.x() > 0) chsp|=1; if(i.x() > 0) chsp|=1;
else if(i.x() < 0) chsp|=2; else if(i.x() < 0) chsp|=2;
if((chsp&48)!=48) if((chsp&48)!=48)
if(i.z() > 0) chsp|=16; if(i.z() > 0) chsp|=16;
else if(i.z() < 0) chsp|=32; else if(i.z() < 0) chsp|=32;
} else if((chsp&15)!=15 && it->source().z()!=0) { } else if((chsp&15)!=15 && it->source().z()!=0) {
Sphere_point i = intersection(it->sphere_circle(), Sphere_circle(0,0,1)); Sphere_point i = intersection(it->sphere_circle(), Sphere_circle(0,0,1));
@ -1094,7 +1099,7 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
if((chsp&3)!=3) if((chsp&3)!=3)
if(i.x() > 0) chsp|=1; if(i.x() > 0) chsp|=1;
else if(i.x() < 0) chsp|=2; else if(i.x() < 0) chsp|=2;
if((chsp&12)!=12) if((chsp&12)!=12)
if(i.y() > 0) chsp|=4; if(i.y() > 0) chsp|=4;
else if(i.y() < 0) chsp|=8; else if(i.y() < 0) chsp|=8;
} }
@ -1154,22 +1159,22 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
CGAL_forall_iterators(it,L) { CGAL_forall_iterators(it,L) {
if(!compute_halfsphere[0][0]) if(!compute_halfsphere[0][0])
if(it->source().hx()>0 || it->target().hx()>0) if(it->source().hx()>0 || it->target().hx()>0)
compute_halfsphere[0][0] = true; compute_halfsphere[0][0] = true;
if(!compute_halfsphere[0][1]) if(!compute_halfsphere[0][1])
if(it->source().hx()<0 || it->target().hx()<0) if(it->source().hx()<0 || it->target().hx()<0)
compute_halfsphere[0][1] = true; compute_halfsphere[0][1] = true;
if(!compute_halfsphere[1][0]) if(!compute_halfsphere[1][0])
if(it->source().hy()>0 || it->target().hy()>0) if(it->source().hy()>0 || it->target().hy()>0)
compute_halfsphere[1][0] = true; compute_halfsphere[1][0] = true;
if(!compute_halfsphere[1][1]) if(!compute_halfsphere[1][1])
if(it->source().hy()<0 || it->target().hy()<0) if(it->source().hy()<0 || it->target().hy()<0)
compute_halfsphere[1][1] = true; compute_halfsphere[1][1] = true;
if(!compute_halfsphere[2][0]) if(!compute_halfsphere[2][0])
if(it->source().hz()>0 || it->target().hz()>0) if(it->source().hz()>0 || it->target().hz()>0)
compute_halfsphere[2][0] = true; compute_halfsphere[2][0] = true;
if(!compute_halfsphere[2][1]) if(!compute_halfsphere[2][1])
if(it->source().hz()<0 || it->target().hz()<0) if(it->source().hz()<0 || it->target().hz()<0)
compute_halfsphere[2][1] = true; compute_halfsphere[2][1] = true;
} }
CGAL_NEF_TRACEN("compute_halfsphere (after vertices)"); CGAL_NEF_TRACEN("compute_halfsphere (after vertices)");
@ -1181,8 +1186,8 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
CGAL_forall_iterators(it,L) { CGAL_forall_iterators(it,L) {
if((it->source().hz()==0 && it->target().hz()==0) if((it->source().hz()==0 && it->target().hz()==0)
|| it->is_long()) { || it->is_long()) {
compute_halfsphere[2][0] = true; compute_halfsphere[2][0] = true;
break; break;
} }
} }
} }
@ -1195,8 +1200,8 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
if(!compute_halfsphere[2][1]) { if(!compute_halfsphere[2][1]) {
CGAL_forall_iterators(it,L) { CGAL_forall_iterators(it,L) {
if(it->is_long() || (it->source().hz()==0 && it->target().hz()==0)) { if(it->is_long() || (it->source().hz()==0 && it->target().hz()==0)) {
compute_halfsphere[2][1] = true; compute_halfsphere[2][1] = true;
break; break;
} }
} }
} }
@ -1207,8 +1212,8 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
if(!compute_halfsphere[0][0]) { if(!compute_halfsphere[0][0]) {
CGAL_forall_iterators(it,L) { CGAL_forall_iterators(it,L) {
if((it->source().hx()==0 && it->target().hx()==0) || it->is_long()) { if((it->source().hx()==0 && it->target().hx()==0) || it->is_long()) {
compute_halfsphere[0][0] = true; compute_halfsphere[0][0] = true;
break; break;
} }
} }
} }
@ -1221,8 +1226,8 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
if(!compute_halfsphere[0][1]) { if(!compute_halfsphere[0][1]) {
CGAL_forall_iterators(it,L) { CGAL_forall_iterators(it,L) {
if((it->source().hx()==0 && it->target().hx()==0) || it->is_long()) { if((it->source().hx()==0 && it->target().hx()==0) || it->is_long()) {
compute_halfsphere[0][1] = true; compute_halfsphere[0][1] = true;
break; break;
} }
} }
} }
@ -1234,8 +1239,8 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
if(!compute_halfsphere[1][0]) { if(!compute_halfsphere[1][0]) {
CGAL_forall_iterators(it,L) { CGAL_forall_iterators(it,L) {
if((it->source().hy()==0 && it->target().hy()==0) || it->is_long()) { if((it->source().hy()==0 && it->target().hy()==0) || it->is_long()) {
compute_halfsphere[1][0] = true; compute_halfsphere[1][0] = true;
break; break;
} }
} }
} }
@ -1248,8 +1253,8 @@ check_sphere(const Seg_list& L, bool compute_halfsphere[3][2]) const {
if(!compute_halfsphere[1][1]) { if(!compute_halfsphere[1][1]) {
CGAL_forall_iterators(it,L) { CGAL_forall_iterators(it,L) {
if((it->source().hy()==0 && it->target().hy()==0) || it->is_long()) { if((it->source().hy()==0 && it->target().hy()==0) || it->is_long()) {
compute_halfsphere[1][1] = true; compute_halfsphere[1][1] = true;
break; break;
} }
} }
} }
@ -1275,7 +1280,7 @@ create(const Sphere_circle& c)
template <typename Map> template <typename Map>
void SM_overlayer<Map>:: void SM_overlayer<Map>::
subdivide(const Map* M0, const Map* M1, subdivide(const Map* M0, const Map* M1,
bool with_trivial_segments) { bool with_trivial_segments) {
PI[0] = SM_const_decorator(M0); PI[0] = SM_const_decorator(M0);
PI[1] = SM_const_decorator(M1); PI[1] = SM_const_decorator(M1);
bool compute_halfsphere[3][2]; bool compute_halfsphere[3][2];
@ -1296,20 +1301,20 @@ subdivide(const Map* M0, const Map* M1,
CGAL_forall_sedges(e,PI[i]) { CGAL_forall_sedges(e,PI[i]) {
if ( e->source() == e->target() ) { if ( e->source() == e->target() ) {
if(with_trivial_segments) { if(with_trivial_segments) {
CGAL_NEF_TRACEN("trivial segment " << e->source()->point()); CGAL_NEF_TRACEN("trivial segment " << e->source()->point());
v = e->source(); v = e->source();
L.push_back(trivial_segment(PI[i],v)); L.push_back(trivial_segment(PI[i],v));
From[--L.end()] = Seg_info(v,i); From[--L.end()] = Seg_info(v,i);
} else { } else {
CGAL_NEF_TRACEN("once around " << e->source()->point()); CGAL_NEF_TRACEN("once around " << e->source()->point());
Seg_pair p = two_segments(PI[i],e); Seg_pair p = two_segments(PI[i],e);
L.push_back(p.first); L.push_back(p.first);
L.push_back(p.second); L.push_back(p.second);
From[--L.end()] = From[--(--L.end())] = Seg_info(e,i); From[--L.end()] = From[--(--L.end())] = Seg_info(e,i);
} }
} else { } else {
CGAL_NEF_TRACEN("normal segment " << e->source()->point() CGAL_NEF_TRACEN("normal segment " << e->source()->point()
<< "->" << e->twin()->source()->point()); << "->" << e->twin()->source()->point());
L.push_back(segment(PI[i],e)); L.push_back(segment(PI[i],e));
From[--L.end()] = Seg_info(e,i); From[--L.end()] = Seg_info(e,i);
} }
@ -1345,39 +1350,39 @@ subdivide(const Map* M0, const Map* M1,
switch(cs) { switch(cs) {
case 1: case 1:
partition_to_halfsphere(L.begin(), L.end(), L_pos, From, partition_to_halfsphere(L.begin(), L.end(), L_pos, From,
Sphere_circle(1,0,0), Sphere_circle(0,0,-1), Sphere_circle(1,0,0), Sphere_circle(0,0,-1),
compute_halfsphere[0][1]); compute_halfsphere[0][1]);
break; break;
case 0: case 0:
partition_to_halfsphere(L.begin(), L.end(), L_neg, From, partition_to_halfsphere(L.begin(), L.end(), L_neg, From,
Sphere_circle(-1,0,0), Sphere_circle(0,0,-1), Sphere_circle(-1,0,0), Sphere_circle(0,0,-1),
compute_halfsphere[0][0]); compute_halfsphere[0][0]);
break; break;
case 3: case 3:
partition_to_halfsphere(L.begin(), L.end(), L_pos, From, partition_to_halfsphere(L.begin(), L.end(), L_pos, From,
Sphere_circle(0,1,0), Sphere_circle(1,0,0), Sphere_circle(0,1,0), Sphere_circle(1,0,0),
compute_halfsphere[1][1]); compute_halfsphere[1][1]);
break; break;
case 2: case 2:
partition_to_halfsphere(L.begin(), L.end(), L_neg, From, partition_to_halfsphere(L.begin(), L.end(), L_neg, From,
Sphere_circle(0,-1,0), Sphere_circle(1,0,0), Sphere_circle(0,-1,0), Sphere_circle(1,0,0),
compute_halfsphere[1][0]); compute_halfsphere[1][0]);
break; break;
case 5: case 5:
partition_to_halfsphere(L.begin(), L.end(), L_pos, From, partition_to_halfsphere(L.begin(), L.end(), L_pos, From,
Sphere_circle(0,0,1), Sphere_circle(1,0,0), Sphere_circle(0,0,1), Sphere_circle(1,0,0),
compute_halfsphere[2][1]); compute_halfsphere[2][1]);
break; break;
case 4: case 4:
partition_to_halfsphere(L.begin(), L.end(), L_neg, From, partition_to_halfsphere(L.begin(), L.end(), L_neg, From,
Sphere_circle(0,0,-1), Sphere_circle(1,0,0), Sphere_circle(0,0,-1), Sphere_circle(1,0,0),
compute_halfsphere[2][0]); compute_halfsphere[2][0]);
break; break;
case -1: case -1:
partition_to_halfsphere(L.begin(), L.end(), L_pos, From, partition_to_halfsphere(L.begin(), L.end(), L_pos, From,
Sphere_circle(0,0,1), Sphere_circle(1,0,0), true); Sphere_circle(0,0,1), Sphere_circle(1,0,0), true);
partition_to_halfsphere(L.begin(), L.end(), L_neg, From, partition_to_halfsphere(L.begin(), L.end(), L_neg, From,
Sphere_circle(0,0,-1), Sphere_circle(1,0,0), true); Sphere_circle(0,0,-1), Sphere_circle(1,0,0), true);
break; break;
default: CGAL_error_msg( "wrong value"); default: CGAL_error_msg( "wrong value");
} }
@ -1409,7 +1414,7 @@ subdivide(const Map* M0, const Map* M1,
if(compute_halfsphere[cs][0]) { if(compute_halfsphere[cs][0]) {
PH_geometry phg(cs); PH_geometry phg(cs);
Positive_halfsphere_sweep SP( Positive_halfsphere_sweep SP(
Input_range(L_pos.begin(),L_pos.end()),O,phg); Input_range(L_pos.begin(),L_pos.end()),O,phg);
SP.sweep(); SP.sweep();
v=--this->svertices_end(); e=--this->shalfedges_end(); v=--this->svertices_end(); e=--this->shalfedges_end();
#ifdef CGAL_NEF3_TIMER_SPHERE_SWEEPS #ifdef CGAL_NEF3_TIMER_SPHERE_SWEEPS
@ -1446,7 +1451,7 @@ subdivide(const Map* M0, const Map* M1,
PH_geometry(cs)); PH_geometry(cs));
if(compute_halfsphere[cs][1]) if(compute_halfsphere[cs][1])
create_face_objects(e, this->shalfedges_end(), v, this->svertices_end(), O, create_face_objects(e, this->shalfedges_end(), v, this->svertices_end(), O,
NH_geometry(cs)); NH_geometry(cs));
CGAL_forall_sedges(e,*this) { CGAL_forall_sedges(e,*this) {
e->circle() = Sphere_circle(e->source()->point(), e->twin()->source()->point()); e->circle() = Sphere_circle(e->source()->point(), e->twin()->source()->point());
@ -1467,8 +1472,8 @@ subdivide(const Map* M0, const Map* M1,
CGAL_NEF_TRACEN("mohs[3]=" << mohs[3]); CGAL_NEF_TRACEN("mohs[3]=" << mohs[3]);
CGAL_NEF_TRACEN("compute_halfsphrere\n cs = " << cs << CGAL_NEF_TRACEN("compute_halfsphrere\n cs = " << cs <<
"\n [cs][0] = " << compute_halfsphere[cs][0] << "\n [cs][0] = " << compute_halfsphere[cs][0] <<
"\n [cs][1] = " << compute_halfsphere[cs][1]); "\n [cs][1] = " << compute_halfsphere[cs][1]);
/* /*
SVertex_iterator svii; SVertex_iterator svii;
CGAL_forall_svertices(svii, *this) { CGAL_forall_svertices(svii, *this) {
@ -1490,10 +1495,10 @@ subdivide(const Map* M0, const Map* M1,
*/ */
if(compute_halfsphere[cs][0]) if(compute_halfsphere[cs][0])
complete_face_support(this->svertices_begin(), v, O, mohs, 0, complete_face_support(this->svertices_begin(), v, O, mohs, 0,
compute_halfsphere[cs][1]); compute_halfsphere[cs][1]);
if(compute_halfsphere[cs][1]) if(compute_halfsphere[cs][1])
complete_face_support(v, this->svertices_end(), O, mohs, 1, complete_face_support(v, this->svertices_end(), O, mohs, 1,
compute_halfsphere[cs][0]); compute_halfsphere[cs][0]);
complete_sface_marks(); complete_sface_marks();
@ -1528,8 +1533,8 @@ template <typename Map>
template <typename Association> template <typename Association>
void SM_overlayer<Map>:: void SM_overlayer<Map>::
subdivide(const Map* M0, const Map* M1, subdivide(const Map* M0, const Map* M1,
Association& A, Association& A,
bool with_trivial_segments) bool with_trivial_segments)
{ {
PI[0] = SM_const_decorator(M0); PI[0] = SM_const_decorator(M0);
PI[1] = SM_const_decorator(M1); PI[1] = SM_const_decorator(M1);
@ -1552,19 +1557,19 @@ subdivide(const Map* M0, const Map* M1,
CGAL_forall_sedges(e,PI[i]) { CGAL_forall_sedges(e,PI[i]) {
if ( e->source() == e->target() ) { if ( e->source() == e->target() ) {
if(with_trivial_segments) { if(with_trivial_segments) {
CGAL_NEF_TRACEN("trivial segment " << e->source()->point()); CGAL_NEF_TRACEN("trivial segment " << e->source()->point());
v = e->source(); v = e->source();
L.push_back(trivial_segment(PI[i],v)); L.push_back(trivial_segment(PI[i],v));
From[--L.end()] = Seg_info(v,i); From[--L.end()] = Seg_info(v,i);
} else { } else {
CGAL_NEF_TRACEN("once around " << e->source()->point()); CGAL_NEF_TRACEN("once around " << e->source()->point());
Seg_pair p = two_segments(PI[i],e); Seg_pair p = two_segments(PI[i],e);
L.push_back(p.first); L.push_back(p.first);
L.push_back(p.second); L.push_back(p.second);
From[--L.end()] = From[--(--L.end())] = Seg_info(e,i); From[--L.end()] = From[--(--L.end())] = Seg_info(e,i);
} }
} else { } else {
CGAL_NEF_TRACEN("normal segment " << e->source()->point()); CGAL_NEF_TRACEN("normal segment " << e->source()->point());
L.push_back(segment(PI[i],e)); L.push_back(segment(PI[i],e));
From[--L.end()] = Seg_info(e,i); From[--L.end()] = Seg_info(e,i);
} }
@ -1602,39 +1607,39 @@ subdivide(const Map* M0, const Map* M1,
switch(cs) { switch(cs) {
case 1: case 1:
partition_to_halfsphere(L.begin(), L.end(), L_pos, From, partition_to_halfsphere(L.begin(), L.end(), L_pos, From,
Sphere_circle(1,0,0), Sphere_circle(0,0,-1), Sphere_circle(1,0,0), Sphere_circle(0,0,-1),
compute_halfsphere[0][1]); compute_halfsphere[0][1]);
break; break;
case 0: case 0:
partition_to_halfsphere(L.begin(), L.end(), L_neg, From, partition_to_halfsphere(L.begin(), L.end(), L_neg, From,
Sphere_circle(-1,0,0), Sphere_circle(0,0,-1), Sphere_circle(-1,0,0), Sphere_circle(0,0,-1),
compute_halfsphere[0][0]); compute_halfsphere[0][0]);
break; break;
case 3: case 3:
partition_to_halfsphere(L.begin(), L.end(), L_pos, From, partition_to_halfsphere(L.begin(), L.end(), L_pos, From,
Sphere_circle(0,1,0), Sphere_circle(1,0,0), Sphere_circle(0,1,0), Sphere_circle(1,0,0),
compute_halfsphere[1][1]); compute_halfsphere[1][1]);
break; break;
case 2: case 2:
partition_to_halfsphere(L.begin(), L.end(), L_neg, From, partition_to_halfsphere(L.begin(), L.end(), L_neg, From,
Sphere_circle(0,-1,0), Sphere_circle(1,0,0), Sphere_circle(0,-1,0), Sphere_circle(1,0,0),
compute_halfsphere[1][0]); compute_halfsphere[1][0]);
break; break;
case 5: case 5:
partition_to_halfsphere(L.begin(), L.end(), L_pos, From, partition_to_halfsphere(L.begin(), L.end(), L_pos, From,
Sphere_circle(0,0,1), Sphere_circle(1,0,0), Sphere_circle(0,0,1), Sphere_circle(1,0,0),
compute_halfsphere[2][1]); compute_halfsphere[2][1]);
break; break;
case 4: case 4:
partition_to_halfsphere(L.begin(), L.end(), L_neg, From, partition_to_halfsphere(L.begin(), L.end(), L_neg, From,
Sphere_circle(0,0,-1), Sphere_circle(1,0,0), Sphere_circle(0,0,-1), Sphere_circle(1,0,0),
compute_halfsphere[2][0]); compute_halfsphere[2][0]);
break; break;
case -1: case -1:
partition_to_halfsphere(L.begin(), L.end(), L_pos, From, partition_to_halfsphere(L.begin(), L.end(), L_pos, From,
Sphere_circle(0,0,1), Sphere_circle(1,0,0), true); Sphere_circle(0,0,1), Sphere_circle(1,0,0), true);
partition_to_halfsphere(L.begin(), L.end(), L_neg, From, partition_to_halfsphere(L.begin(), L.end(), L_neg, From,
Sphere_circle(0,0,-1), Sphere_circle(1,0,0), true); Sphere_circle(0,0,-1), Sphere_circle(1,0,0), true);
break; break;
default: CGAL_error_msg( "wrong value"); default: CGAL_error_msg( "wrong value");
} }
@ -1673,20 +1678,20 @@ subdivide(const Map* M0, const Map* M1,
for(Seg_iterator it=L_pos.begin(); it!=L_pos.end();++it) { for(Seg_iterator it=L_pos.begin(); it!=L_pos.end();++it) {
CGAL_NEF_TRACEN("pos " << *it); CGAL_NEF_TRACEN("pos " << *it);
if(phg.compare_xy(it->target(),it->source())<0) { if(phg.compare_xy(it->target(),it->source())<0) {
Object_handle o = From[it]._o; Object_handle o = From[it]._o;
if(CGAL::assign(se, o)) { if(CGAL::assign(se, o)) {
if(it->sphere_circle() == se->circle()) if(it->sphere_circle() == se->circle())
From[it] = Seg_info(se->twin(), From[it]._from); From[it] = Seg_info(se->twin(), From[it]._from);
} else if(CGAL::assign(sl, o)) { } else if(CGAL::assign(sl, o)) {
if(it->sphere_circle() == sl->circle()) if(it->sphere_circle() == sl->circle())
From[it] = Seg_info(sl->twin(), From[it]._from); From[it] = Seg_info(sl->twin(), From[it]._from);
} }
} }
} }
*/ */
Positive_halfsphere_sweep SP( Positive_halfsphere_sweep SP(
Input_range(L_pos.begin(),L_pos.end()),O,phg); Input_range(L_pos.begin(),L_pos.end()),O,phg);
SP.sweep(); SP.sweep();
v=--this->svertices_end(); e=--this->shalfedges_end(); v=--this->svertices_end(); e=--this->shalfedges_end();
#ifdef CGAL_NEF3_TIMER_SPHERE_SWEEPS #ifdef CGAL_NEF3_TIMER_SPHERE_SWEEPS
@ -1703,14 +1708,14 @@ subdivide(const Map* M0, const Map* M1,
for(Seg_iterator it=L_neg.begin(); it!=L_neg.end();++it) { for(Seg_iterator it=L_neg.begin(); it!=L_neg.end();++it) {
CGAL_NEF_TRACEN("neg " << *it); CGAL_NEF_TRACEN("neg " << *it);
if(nhg.compare_xy(it->target(),it->source())<0) { if(nhg.compare_xy(it->target(),it->source())<0) {
Object_handle o = From[it]._o; Object_handle o = From[it]._o;
if(CGAL::assign(se, o)) { if(CGAL::assign(se, o)) {
if(it->sphere_circle() == se->circle()) if(it->sphere_circle() == se->circle())
From[it] = Seg_info(se->twin(), From[it]._from); From[it] = Seg_info(se->twin(), From[it]._from);
} else if(CGAL::assign(sl, o)) { } else if(CGAL::assign(sl, o)) {
if(it->sphere_circle() == sl->circle()) if(it->sphere_circle() == sl->circle())
From[it] = Seg_info(sl->twin(), From[it]._from); From[it] = Seg_info(sl->twin(), From[it]._from);
} }
} }
} }
*/ */
@ -1742,7 +1747,7 @@ subdivide(const Map* M0, const Map* M1,
PH_geometry(cs)); PH_geometry(cs));
if(compute_halfsphere[cs][1]) if(compute_halfsphere[cs][1])
create_face_objects(e, this->shalfedges_end(), v, this->svertices_end(), O, create_face_objects(e, this->shalfedges_end(), v, this->svertices_end(), O,
NH_geometry(cs)); NH_geometry(cs));
CGAL_forall_sedges(e,*this) { CGAL_forall_sedges(e,*this) {
e->circle() = Sphere_circle(e->source()->point(), e->twin()->source()->point()); e->circle() = Sphere_circle(e->source()->point(), e->twin()->source()->point());
@ -1763,8 +1768,8 @@ subdivide(const Map* M0, const Map* M1,
CGAL_NEF_TRACEN("mohs[3]=" << mohs[3]); CGAL_NEF_TRACEN("mohs[3]=" << mohs[3]);
CGAL_NEF_TRACEN("compute_halfsphrere\n cs = " << cs << CGAL_NEF_TRACEN("compute_halfsphrere\n cs = " << cs <<
"\n [cs][0] = " << compute_halfsphere[cs][0] << "\n [cs][0] = " << compute_halfsphere[cs][0] <<
"\n [cs][1] = " << compute_halfsphere[cs][1]); "\n [cs][1] = " << compute_halfsphere[cs][1]);
/* /*
SVertex_iterator svii; SVertex_iterator svii;
CGAL_forall_svertices(svii, *this) { CGAL_forall_svertices(svii, *this) {
@ -1786,10 +1791,10 @@ subdivide(const Map* M0, const Map* M1,
*/ */
if(compute_halfsphere[cs][0]) if(compute_halfsphere[cs][0])
complete_face_support(this->svertices_begin(), v, O, mohs, 0, complete_face_support(this->svertices_begin(), v, O, mohs, 0,
compute_halfsphere[cs][1]); compute_halfsphere[cs][1]);
if(compute_halfsphere[cs][1]) if(compute_halfsphere[cs][1])
complete_face_support(v, this->svertices_end(), O, mohs, 1, complete_face_support(v, this->svertices_end(), O, mohs, 1,
compute_halfsphere[cs][0]); compute_halfsphere[cs][0]);
complete_sface_marks(); complete_sface_marks();
@ -1840,40 +1845,40 @@ transfer_data(Association& A) {
Object_handle o0 = supp_object(sv,0), o1 = supp_object(sv,1); Object_handle o0 = supp_object(sv,0), o1 = supp_object(sv,1);
if(o0.empty()) { if(o0.empty()) {
if(CGAL::assign(sv1, o1)) if(CGAL::assign(sv1, o1))
A.handle_support(sv, sv1); A.handle_support(sv, sv1);
else else
continue; continue;
} else if(CGAL::assign(se0, o0)) { } else if(CGAL::assign(se0, o0)) {
if(o1.empty()) if(o1.empty())
continue; continue;
else if(assign(se1, o1)) else if(assign(se1, o1))
A.handle_support(sv, se0, se1); A.handle_support(sv, se0, se1);
else if(CGAL::assign(sv1, o1)) else if(CGAL::assign(sv1, o1))
A.handle_support(sv, se0, sv1); A.handle_support(sv, se0, sv1);
else if(CGAL::assign(sl1, o1)) else if(CGAL::assign(sl1, o1))
A.handle_support(sv, se0, sl1); A.handle_support(sv, se0, sl1);
else else
CGAL_error_msg( "wrong handle"); CGAL_error_msg( "wrong handle");
} else if(CGAL::assign(sv0, o0)) { } else if(CGAL::assign(sv0, o0)) {
if(o1.empty()) if(o1.empty())
A.handle_support(sv, sv0); A.handle_support(sv, sv0);
else if(CGAL::assign(se1, o1)) else if(CGAL::assign(se1, o1))
A.handle_support(sv, sv0, se1); A.handle_support(sv, sv0, se1);
else if(CGAL::assign(sv1, o1)) else if(CGAL::assign(sv1, o1))
A.handle_support(sv, sv0, sv1); A.handle_support(sv, sv0, sv1);
else if(CGAL::assign(sl1, o1)) else if(CGAL::assign(sl1, o1))
A.handle_support(sv, sv0, sl1); A.handle_support(sv, sv0, sl1);
else else
CGAL_error_msg( "wrong handle"); CGAL_error_msg( "wrong handle");
} else if(CGAL::assign(sl0, o0)) { } else if(CGAL::assign(sl0, o0)) {
if(o1.empty()) if(o1.empty())
continue; continue;
else if(CGAL::assign(sv1, o1)) else if(CGAL::assign(sv1, o1))
A.handle_support(sv, sl0, sv1); A.handle_support(sv, sl0, sv1);
else if(CGAL::assign(se1, o1)) else if(CGAL::assign(se1, o1))
A.handle_support(sv, sl0, se1); A.handle_support(sv, sl0, se1);
else if(CGAL::assign(sl1, o1)) else if(CGAL::assign(sl1, o1))
A.handle_support(sv, sl0, sl1); A.handle_support(sv, sl0, sl1);
} else } else
CGAL_error_msg( "wrong handle"); CGAL_error_msg( "wrong handle");
} }
@ -1883,29 +1888,29 @@ transfer_data(Association& A) {
Object_handle o0 = supp_object(se,0), o1 = supp_object(se,1); Object_handle o0 = supp_object(se,0), o1 = supp_object(se,1);
if(o0.empty()) { if(o0.empty()) {
if(assign(se1, o1)) if(assign(se1, o1))
A.handle_support(se, se1); A.handle_support(se, se1);
else if(assign(sl1, o1)) else if(assign(sl1, o1))
A.handle_support(se, sl1); A.handle_support(se, sl1);
else else
continue; // CGAL_error_msg( "wrong handle"); continue; // CGAL_error_msg( "wrong handle");
} else if(assign(se0, o0)) { } else if(assign(se0, o0)) {
if(o1.empty()) if(o1.empty())
A.handle_support(se, se0); A.handle_support(se, se0);
else if(assign(se1, o1)) else if(assign(se1, o1))
A.handle_support(se, se0, se1); A.handle_support(se, se0, se1);
else if(assign(sl1, o1)) else if(assign(sl1, o1))
A.handle_support(se, se0, sl1); A.handle_support(se, se0, sl1);
else else
CGAL_error_msg( "wrong handle"); CGAL_error_msg( "wrong handle");
} else if(assign(sl0, o0)) { } else if(assign(sl0, o0)) {
if(o1.empty()) if(o1.empty())
A.handle_support(se, sl0); A.handle_support(se, sl0);
else if(assign(se1, o1)) else if(assign(se1, o1))
A.handle_support(se, sl0, se1); A.handle_support(se, sl0, se1);
else if(assign(sl1, o1)) else if(assign(sl1, o1))
A.handle_support(se, sl0, sl1); A.handle_support(se, sl0, sl1);
else else
CGAL_error_msg( "wrong handle"); CGAL_error_msg( "wrong handle");
} else } else
CGAL_error_msg( "wrong handle"); CGAL_error_msg( "wrong handle");
} }
@ -1937,9 +1942,9 @@ template <typename Map>
template <typename Iterator, typename T> template <typename Iterator, typename T>
void SM_overlayer<Map>:: void SM_overlayer<Map>::
partition_to_halfsphere(Iterator start, Iterator beyond, Seg_list& L, partition_to_halfsphere(Iterator start, Iterator beyond, Seg_list& L,
CGAL::Unique_hash_map<Iterator,T>& M, CGAL::Unique_hash_map<Iterator,T>& M,
Sphere_circle xycircle, Sphere_circle yzcircle, Sphere_circle xycircle, Sphere_circle yzcircle,
bool include_equator) const bool include_equator) const
{ CGAL_NEF_TRACEN("partition_to_halfsphere "); { CGAL_NEF_TRACEN("partition_to_halfsphere ");
// CGAL_assertion(pos!=0); // CGAL_assertion(pos!=0);
Sphere_segment s1,s2; Sphere_segment s1,s2;
@ -1949,12 +1954,12 @@ partition_to_halfsphere(Iterator start, Iterator beyond, Seg_list& L,
int i = start->intersection(xycircle,s1,s2); int i = start->intersection(xycircle,s1,s2);
CGAL_NEF_TRACEN("segment " << start->source() << " " << start->target()); CGAL_NEF_TRACEN("segment " << start->source() << " " << start->target());
if (i>1) { if (i>1) {
L.push_back(s2); M[--L.end()] = M[start]; L.push_back(s2); M[--L.end()] = M[start];
CGAL_NEF_TRACEN(">1 " << s2.source() << " " << s2.target()); CGAL_NEF_TRACEN(">1 " << s2.source() << " " << s2.target());
} }
if (i>0) { if (i>0) {
L.push_back(s1); M[--L.end()] = M[start]; L.push_back(s1); M[--L.end()] = M[start];
CGAL_NEF_TRACEN(">0 " << s1.source() << " " << s1.target()); CGAL_NEF_TRACEN(">0 " << s1.source() << " " << s1.target());
} }
++start; ++start;
} }
@ -1982,28 +1987,28 @@ partition_to_halfsphere(Iterator start, Iterator beyond, Seg_list& L,
bool added=false; bool added=false;
int n1 = it->intersection(yzcircle,s1,s2); int n1 = it->intersection(yzcircle,s1,s2);
if (n1 > 1 && !s2.is_degenerate()) { if (n1 > 1 && !s2.is_degenerate()) {
M[ L.insert(it,s2) ] = M[it]; M[ L.insert(it,s2) ] = M[it];
added=true; added=true;
CGAL_NEF_TRACEN(">1 " << s2.source() << " " << s2.target()); CGAL_NEF_TRACEN(">1 " << s2.source() << " " << s2.target());
} }
if (n1 > 0 && !s1.is_degenerate()) { if (n1 > 0 && !s1.is_degenerate()) {
M[ L.insert(it,s1) ] = M[it]; M[ L.insert(it,s1) ] = M[it];
added = true; added = true;
CGAL_NEF_TRACEN(">1 " << s1.source() << " " << s1.target()); CGAL_NEF_TRACEN(">1 " << s1.source() << " " << s1.target());
} }
int n2 = it->intersection(yzcircle.opposite(),s1,s2); int n2 = it->intersection(yzcircle.opposite(),s1,s2);
if (n2 > 1 && !s2.is_degenerate()) { if (n2 > 1 && !s2.is_degenerate()) {
M[ L.insert(it,s2) ] = M[it]; M[ L.insert(it,s2) ] = M[it];
added=true; added=true;
CGAL_NEF_TRACEN(">1 " << s2.source() << " " << s2.target()); CGAL_NEF_TRACEN(">1 " << s2.source() << " " << s2.target());
} }
if (n2 > 0 && !s1.is_degenerate()) { if (n2 > 0 && !s1.is_degenerate()) {
M[ L.insert(it,s1) ] = M[it]; M[ L.insert(it,s1) ] = M[it];
added=true; added=true;
CGAL_NEF_TRACEN(">1 " << s1.source() << " " << s1.target()); CGAL_NEF_TRACEN(">1 " << s1.source() << " " << s1.target());
} }
if(added) { if(added) {
itl = it; --it; M[itl] = T(); L.erase(itl); itl = it; --it; M[itl] = T(); L.erase(itl);
} }
// at least one item was appended // at least one item was appended
} }
@ -2057,16 +2062,16 @@ create_face_objects(SHalfedge_iterator e_start, SHalfedge_iterator e_end,
CGAL_NEF_TRACEN(""); CGAL_NEF_TRACEN("");
CGAL_NEF_TRACEN(" face cycle numbering "<<i); CGAL_NEF_TRACEN(" face cycle numbering "<<i);
CGAL_For_all(hfc,hend) { CGAL_For_all(hfc,hend) {
SFaceCycle[hfc]=i; // assign face cycle number SFaceCycle[hfc]=i; // assign face cycle number
if (hfc->twin()->source() == e_min->twin()->source()) { if (hfc->twin()->source() == e_min->twin()->source()) {
Sphere_point p1 = hfc->source()->point(), Sphere_point p1 = hfc->source()->point(),
p2 = hfc->twin()->source()->point(), p2 = hfc->twin()->source()->point(),
p3 = hfc->snext()->twin()->source()->point(); p3 = hfc->snext()->twin()->source()->point();
if ( SG.orientation(p1,p2,p3) <= 0 ) if ( SG.orientation(p1,p2,p3) <= 0 )
e_min = hfc; e_min = hfc;
} else if ( SG.compare_xy(hfc->twin()->source()->point(), e_min->twin()->source()->point()) < 0 ) } else if ( SG.compare_xy(hfc->twin()->source()->point(), e_min->twin()->source()->point()) < 0 )
e_min = hfc; e_min = hfc;
CGAL_NEF_TRACEN(PH(hfc)); CGAL_NEF_TRACEN(PH(hfc));
} CGAL_NEF_TRACEN(""); } CGAL_NEF_TRACEN("");
MinimalSHalfedge.push_back(e_min); MinimalSHalfedge.push_back(e_min);
++i; ++i;
@ -2076,12 +2081,12 @@ create_face_objects(SHalfedge_iterator e_start, SHalfedge_iterator e_end,
SHalfedge_handle e = MinimalSHalfedge[j]; SHalfedge_handle e = MinimalSHalfedge[j];
CGAL_NEF_TRACEN(" face cycle "<<j<<" minimal halfedge "<<PH(e)); CGAL_NEF_TRACEN(" face cycle "<<j<<" minimal halfedge "<<PH(e));
Sphere_point p1 = e->source()->point(), Sphere_point p1 = e->source()->point(),
p2 = e->twin()->source()->point(), p2 = e->twin()->source()->point(),
p3 = e->snext()->twin()->source()->point(); p3 = e->snext()->twin()->source()->point();
if ( SG.orientation(p1,p2,p3) > 0 ) { // left_turn => outer face cycle if ( SG.orientation(p1,p2,p3) > 0 ) { // left_turn => outer face cycle
SFace_handle f = this->new_sface(); SFace_handle f = this->new_sface();
link_as_face_cycle(e,f); link_as_face_cycle(e,f);
CGAL_NEF_TRACEN(" creating new face object "<<&*f<<" bd "<<&*e); CGAL_NEF_TRACEN(" creating new face object "<<&*f<<" bd "<<&*e);
} }
} }
@ -2091,7 +2096,7 @@ create_face_objects(SHalfedge_iterator e_start, SHalfedge_iterator e_end,
CGAL_NEF_TRACEN("linking hole "<<PH(e)); CGAL_NEF_TRACEN("linking hole "<<PH(e));
SFace_handle f = determine_face(e,MinimalSHalfedge,SFaceCycle,D); SFace_handle f = determine_face(e,MinimalSHalfedge,SFaceCycle,D);
if(f != SFace_handle()) if(f != SFace_handle())
link_as_face_cycle(e,f); link_as_face_cycle(e,f);
} }
} }
@ -2117,52 +2122,52 @@ complete_face_support(SVertex_iterator v_start, SVertex_iterator v_end,
SHalfedge_handle e_below = halfedge_below(v); SHalfedge_handle e_below = halfedge_below(v);
if ( v == v_start ) { if ( v == v_start ) {
for (int i=0; i<2; ++i){ for (int i=0; i<2; ++i){
m_buffer[i] = mohs[offset+2*i]; m_buffer[i] = mohs[offset+2*i];
} }
} else if ( e_below != SHalfedge_handle() ) { } else if ( e_below != SHalfedge_handle() ) {
for (int i=0; i<2; ++i) { for (int i=0; i<2; ++i) {
CGAL_NEF_TRACEN("edge below "<< PH(e_below) << " " << mark(e_below,i)); CGAL_NEF_TRACEN("edge below "<< PH(e_below) << " " << mark(e_below,i));
m_buffer[i] = incident_mark(e_below,i); m_buffer[i] = incident_mark(e_below,i);
} }
} else { // e_below does not exist } else { // e_below does not exist
// CGAL_assertion( v->point().hz() == 0 && // CGAL_assertion( v->point().hz() == 0 &&
// ( offset == 0 ? (v->point().hx() >= 0) : (v->point().hx()<=0)) ); // ( offset == 0 ? (v->point().hx() >= 0) : (v->point().hx()<=0)) );
if(!is_isolated(v)) { if(!is_isolated(v)) {
if(!both) { if(!both) {
for (int i=0; i<2; ++i) for (int i=0; i<2; ++i)
m_buffer[i] = mohs[offset+2*i]; m_buffer[i] = mohs[offset+2*i];
CGAL_NEF_TRACEN("no edge below "); CGAL_NEF_TRACEN("no edge below ");
} else { } else {
for (int i=0; i<2; ++i) for (int i=0; i<2; ++i)
m_buffer[i] = incident_mark(first_out_edge(v)->sprev(),i); m_buffer[i] = incident_mark(first_out_edge(v)->sprev(),i);
} }
} }
} CGAL_NEF_TRACEN(" faces right-below "<<m_buffer[0]<<" "<<m_buffer[1]); } CGAL_NEF_TRACEN(" faces right-below "<<m_buffer[0]<<" "<<m_buffer[1]);
for (int i=0; i<2; ++i) { for (int i=0; i<2; ++i) {
Object_handle o = supp_object(v,i); Object_handle o = supp_object(v,i);
if ( o.empty() ) { if ( o.empty() ) {
CGAL_NEF_TRACEN("no vertex support"); CGAL_NEF_TRACEN("no vertex support");
mark(v,i) = m_buffer[i]; continue; mark(v,i) = m_buffer[i]; continue;
} }
SVertex_const_handle vs; SVertex_const_handle vs;
SHalfedge_const_handle es; SHalfedge_const_handle es;
SHalfloop_const_handle ls; SHalfloop_const_handle ls;
if ( CGAL::assign(vs,o) ) { if ( CGAL::assign(vs,o) ) {
CGAL_NEF_TRACEN("support by svertex"); CGAL_NEF_TRACEN("support by svertex");
mark(v,i) = vs->mark(); continue; mark(v,i) = vs->mark(); continue;
} }
if ( CGAL::assign(es,supp_object(v,i)) ) { if ( CGAL::assign(es,supp_object(v,i)) ) {
CGAL_NEF_TRACEN("support by sedge"); CGAL_NEF_TRACEN("support by sedge");
if ( es->source()->point() == v->point() ) if ( es->source()->point() == v->point() )
{ mark(v,i) = es->source()->mark(); continue; } { mark(v,i) = es->source()->mark(); continue; }
if ( es->target()->point() == v->point() ) if ( es->target()->point() == v->point() )
{ mark(v,i) = es->target()->mark(); continue; } { mark(v,i) = es->target()->mark(); continue; }
mark(v,i) = es->mark(); continue; mark(v,i) = es->mark(); continue;
} }
if ( CGAL::assign(ls,o) ) { if ( CGAL::assign(ls,o) ) {
mark(v,i) = ls->mark(); mark(v,i) = ls->mark();
CGAL_NEF_TRACEN("loop " << ls->circle()); continue; } CGAL_NEF_TRACEN("loop " << ls->circle()); continue; }
CGAL_error_msg("wrong handle"); CGAL_error_msg("wrong handle");
} CGAL_NEF_TRACEN(" vertex marks "<<mark(v,0)<<" "<<mark(v,1)); } CGAL_NEF_TRACEN(" vertex marks "<<mark(v,0)<<" "<<mark(v,1));
@ -2176,7 +2181,7 @@ complete_face_support(SVertex_iterator v_start, SVertex_iterator v_end,
SHalfedge_const_handle ei; SHalfedge_const_handle ei;
if ( CGAL::assign(ei,supp_object(e,i)) ) { if ( CGAL::assign(ei,supp_object(e,i)) ) {
if (!equal_not_opposite(ei->circle(),e->circle())) if (!equal_not_opposite(ei->circle(),e->circle()))
ei = ei->twin(); ei = ei->twin();
CGAL_assertion( ei->circle() == e->circle() ); CGAL_assertion( ei->circle() == e->circle() );
CGAL_NEF_TRACEN(" supporting edge "<<i<<" "<<PH(ei)); CGAL_NEF_TRACEN(" supporting edge "<<i<<" "<<PH(ei));
incident_mark(e->twin(),i) = incident_mark(e->twin(),i) =
@ -2187,18 +2192,18 @@ complete_face_support(SVertex_iterator v_start, SVertex_iterator v_end,
} }
SHalfloop_const_handle li; SHalfloop_const_handle li;
if ( CGAL::assign(li,supp_object(e,i)) ) { if ( CGAL::assign(li,supp_object(e,i)) ) {
if (!equal_not_opposite(li->circle(),e->circle())) if (!equal_not_opposite(li->circle(),e->circle()))
li = li->twin(); li = li->twin();
CGAL_assertion( li->circle() == e->circle() ); CGAL_assertion( li->circle() == e->circle() );
CGAL_NEF_TRACEN(" supporting loop "<<i<<" "<<PH(li)); CGAL_NEF_TRACEN(" supporting loop "<<i<<" "<<PH(li));
incident_mark(e->twin(),i) = incident_mark(e->twin(),i) =
li->twin()->incident_sface()->mark(); li->twin()->incident_sface()->mark();
mark(e,i) = mark(e->twin(),i) = li->mark(); mark(e,i) = mark(e->twin(),i) = li->mark();
incident_mark(e,i) = m_buffer[i] = incident_mark(e,i) = m_buffer[i] =
li->incident_sface()->mark(); li->incident_sface()->mark();
} }
} else { CGAL_NEF_TRACEN(" support from face below "<<i); } else { CGAL_NEF_TRACEN(" support from face below "<<i);
incident_mark(e->twin(),i) = mark(e,i) = mark(e->twin(),i) = incident_mark(e->twin(),i) = mark(e,i) = mark(e->twin(),i) =
incident_mark(e,i) = m_buffer[i]; incident_mark(e,i) = m_buffer[i];
} }
} CGAL_NEF_TRACEN(" face marks "<<m_buffer[0]<<" "<<m_buffer[1]); } CGAL_NEF_TRACEN(" face marks "<<m_buffer[0]<<" "<<m_buffer[1]);
@ -2329,27 +2334,27 @@ void SM_overlayer<Map>::simplify()
en = e; ++en; if ( en==e->twin() ) ++en; en = e; ++en; if ( en==e->twin() ) ++en;
CGAL_NEF_TRACEN("can simplify ? " << PH(e)); CGAL_NEF_TRACEN("can simplify ? " << PH(e));
CGAL_NEF_TRACEN(e->mark() << " " << CGAL_NEF_TRACEN(e->mark() << " " <<
e->incident_sface()->mark() << " " << e->incident_sface()->mark() << " " <<
e->twin()->incident_sface()->mark()); e->twin()->incident_sface()->mark());
if (( e->mark() == e->incident_sface()->mark() && if (( e->mark() == e->incident_sface()->mark() &&
e->mark() == e->twin()->incident_sface()->mark())){ e->mark() == e->twin()->incident_sface()->mark())){
CGAL_NEF_TRACEN("deleting "<<PH(e)); CGAL_NEF_TRACEN("deleting "<<PH(e));
if ( !UF.same_set(Pitem[e->incident_sface()], if ( !UF.same_set(Pitem[e->incident_sface()],
Pitem[e->twin()->incident_sface()]) ) { Pitem[e->twin()->incident_sface()]) ) {
UF.unify_sets( Pitem[e->incident_sface()], UF.unify_sets( Pitem[e->incident_sface()],
Pitem[e->twin()->incident_sface()] ); Pitem[e->twin()->incident_sface()] );
CGAL_NEF_TRACEN("unioning disjoint faces"); CGAL_NEF_TRACEN("unioning disjoint faces");
} }
CGAL_NEF_TRACEN("is_closed_at_source " << is_closed_at_source(e) << CGAL_NEF_TRACEN("is_closed_at_source " << is_closed_at_source(e) <<
" " << is_closed_at_source(e->twin())); " " << is_closed_at_source(e->twin()));
if ( is_closed_at_source(e) ) if ( is_closed_at_source(e) )
Vitem[e->source()] = Pitem[e->incident_sface()]; Vitem[e->source()] = Pitem[e->incident_sface()];
if ( is_closed_at_source(e->twin())) if ( is_closed_at_source(e->twin()))
Vitem[e->target()] = Pitem[e->incident_sface()]; Vitem[e->target()] = Pitem[e->incident_sface()];
delete_edge_pair(e); delete_edge_pair(e);
} }
@ -2370,13 +2375,13 @@ void SM_overlayer<Map>::simplify()
if ( is_isolated(v) ) { if ( is_isolated(v) ) {
if(Vitem[v] != nullptr) { if(Vitem[v] != nullptr) {
set_face(v,*(UF.find(Vitem[v]))); set_face(v,*(UF.find(Vitem[v])));
CGAL_NEF_TRACEN("incident face of " << PH(v) << " set to " << &*(v->incident_sface())); CGAL_NEF_TRACEN("incident face of " << PH(v) << " set to " << &*(v->incident_sface()));
} }
else { else {
set_face(v, *(UF.find(Pitem[v->incident_sface()]))); set_face(v, *(UF.find(Pitem[v->incident_sface()])));
CGAL_NEF_TRACEN("isolated svertex " << PH(v) << CGAL_NEF_TRACEN("isolated svertex " << PH(v) <<
" already has incident face " << &*(v->incident_sface())); " already has incident face " << &*(v->incident_sface()));
} }
if ( v->mark() == v->incident_sface()->mark() ) { if ( v->mark() == v->incident_sface()->mark() ) {

View File

@ -91,12 +91,14 @@ void test_lazy_exact_nt() {
assert( cast ( (i*i+i) / i-i ) == LR(1)); assert( cast ( (i*i+i) / i-i ) == LR(1));
assert( cast ( (i*i+r) / i-i ) == LR(1)); assert( cast ( (i*i+r) / i-i ) == LR(1));
assert( cast ( (i*r+r) / i-i ) == LI(1)); assert( cast ( (i*r+r) / i-i ) == LI(1));
}{ // see also Coercion_traits_test.C }
{ // see also Coercion_traits_test.C
#ifdef CGAL_USE_LEDA #ifdef CGAL_USE_LEDA
#ifdef CGAL_USE_CORE #ifdef CGAL_USE_CORE
typedef CGAL::Lazy_exact_nt<leda_integer > T1; CGAL_assertion_code(typedef CGAL::Lazy_exact_nt<leda_integer> T1;)
typedef CGAL::Lazy_exact_nt<CORE::Expr > T2; CGAL_assertion_code(typedef CGAL::Lazy_exact_nt<CORE::Expr> T2;)
typedef CGAL::Coercion_traits<T1,T2> CT; CGAL_assertion_code(typedef CGAL::Coercion_traits<T1, T2> CT;)
CGAL_static_assertion((boost::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_false>::value)); CGAL_static_assertion((boost::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_false>::value));
CGAL_static_assertion((boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_false>::value)); CGAL_static_assertion((boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_false>::value));
#endif #endif

View File

@ -147,10 +147,8 @@ update_new_point(
typedef typename rich_grid_internal::Rich_point<Kernel> Rich_point; typedef typename rich_grid_internal::Rich_point<Kernel> Rich_point;
CGAL_assertion_code( unsigned int size = static_cast<unsigned int>(rich_point_set.size()) ); CGAL_assertion_code( unsigned int size = static_cast<unsigned int>(rich_point_set.size()) );
CGAL_point_set_processing_precondition(father_index >= 0 && CGAL_point_set_processing_precondition(father_index < size);
father_index < size); CGAL_point_set_processing_precondition(mother_index < size);
CGAL_point_set_processing_precondition(mother_index >= 0 &&
mother_index < size);
// 1, get neighbor information from the two "parent points" // 1, get neighbor information from the two "parent points"
Rich_point& new_v = rich_point_set[new_point_index]; Rich_point& new_v = rich_point_set[new_point_index];

View File

@ -207,9 +207,6 @@ MainWindow::MainWindow()
this->addRecentFiles(this->menuFile, this->actionQuit); this->addRecentFiles(this->menuFile, this->actionQuit);
connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString))); connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString)));
// QObject::connect(thresholdSlider, SIGNAL(valueChanged(int)), this, SLOT(set_Threshold(int)));
} }

View File

@ -279,14 +279,6 @@
<include location="../icons/Triangulation_2.qrc" /> <include location="../icons/Triangulation_2.qrc" />
<include location="../icons/Input.qrc" /> <include location="../icons/Input.qrc" />
</resources> </resources>
<connections>
<connection>
<sender>thresholdSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>MainWindow</receiver>
<slot>setThreshold(int)</slot>
</connection>
</connections>
<slots> <slots>
<slot>setThreshold(int)</slot> <slot>setThreshold(int)</slot>
</slots> </slots>

View File

@ -109,7 +109,7 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
MScalar mg_; MScalar mg_;
MPoly mF1,mF2,mG_; MPoly mF1,mF2,mG_;
typename CRT::Scalar_type p,q,pq,s,t; typename CRT::Scalar_type p(0),q(0),pq,s,t;
Poly Gs,H1s,H2s, Gs_old; // s =^ star Poly Gs,H1s,H2s, Gs_old; // s =^ star
#ifdef CGAL_MODULAR_GCD_TIMER #ifdef CGAL_MODULAR_GCD_TIMER
timer_init.stop(); timer_init.stop();
@ -123,7 +123,7 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
do{ do{
int current_prime = -1; int current_prime = -1;
prime_index++; prime_index++;
if(prime_index >= 2000){ if(prime_index >= 2000){
std::cerr<<"primes in the array exhausted"<<std::endl; std::cerr<<"primes in the array exhausted"<<std::endl;
current_prime = internal::get_next_lower_prime(current_prime); current_prime = internal::get_next_lower_prime(current_prime);
} }

View File

@ -204,7 +204,7 @@ namespace CGAL {
FT get_z(const Point_3& p){ return m_traits.compute_z_3_object()(p); } FT get_z(const Point_3& p){ return m_traits.compute_z_3_object()(p); }
FT get_coord(const Point_3& p, unsigned int d) FT get_coord(const Point_3& p, unsigned int d)
{ {
CGAL_assertion(d >= 0 && d < 3); CGAL_assertion(d < 3);
switch (d) switch (d)
{ {
case 0: return get_x(p); case 0: return get_x(p);

View File

@ -1,6 +1,6 @@
/********************************************************************* /*********************************************************************
* 25 - 02 - 97 * 25 - 02 - 97
* gestion des fichiers image ELF * gestion des fichiers image ELF
* *
*********************************************************************/ *********************************************************************/
@ -14,6 +14,20 @@
namespace CGAL { namespace CGAL {
namespace Total { namespace Total {
namespace internal {
//To avoid "fopen may be unsafe" on Visual.
bool open_file(FILE **fin, const char* filename)
{
#if defined(BOOST_MSVC)
return (fopen_s(fin, filename, "rw") == 0);
#else
*fin = fopen(filename, "rw");
return (fin != NULL);
#endif
}
} // namespace internal
void permuteLong(char *a) void permuteLong(char *a)
{ {
@ -54,7 +68,7 @@ for(i=0;i<nb;i++) permuteShort( (char *) &a[i]);
void permuteFloat(char *a ) void permuteFloat(char *a )
{ {
char tmp; char tmp;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
tmp=a[0]; a[0]=a[3]; a[3]=tmp; tmp=a[0]; a[0]=a[3]; a[3]=tmp;
@ -65,7 +79,7 @@ tmp=a[1]; a[1]=a[2]; a[2]=tmp;
void permuteFloatTab(float *a, int nb) void permuteFloatTab(float *a, int nb)
{ {
int i; int i;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
for(i=0;i<nb;i++) permuteFloat((char *) &a[i]); for(i=0;i<nb;i++) permuteFloat((char *) &a[i]);
@ -75,7 +89,7 @@ for(i=0;i<nb;i++) permuteFloat((char *) &a[i]);
void permuteDouble(char *a ) void permuteDouble(char *a )
{ {
char tmp; char tmp;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
tmp=a[0]; a[0]=a[3]; a[3]=tmp; tmp=a[0]; a[0]=a[3]; a[3]=tmp;
@ -86,7 +100,7 @@ tmp=a[1]; a[1]=a[2]; a[2]=tmp;
void permuteDoubleTab(double *a, int nb) void permuteDoubleTab(double *a, int nb)
{ {
int i; int i;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
for(i=0;i<nb;i++) permuteDouble((char *) &a[i]); for(i=0;i<nb;i++) permuteDouble((char *) &a[i]);
@ -99,7 +113,7 @@ int lire_longueur_trace(const char * nomfich, long * long_trace)
FILE *fin; FILE *fin;
int flag=0; int flag=0;
if ( (fin=fopen(nomfich,"rw"))!=NULL ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,4,0); fseek(fin,4,0);
if (fread(long_trace,4,1,fin) != 1) { if (fread(long_trace,4,1,fin) != 1) {
@ -118,7 +132,7 @@ int lire_nb_trace(const char * nomfich, long * nb_trace)
FILE *fin; FILE *fin;
int flag=0; int flag=0;
if ( (fin=fopen(nomfich,"rw"))!=NULL ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,8,0); fseek(fin,8,0);
if (fread(nb_trace,4,1,fin) != 1) { if (fread(nb_trace,4,1,fin) != 1) {
@ -137,7 +151,7 @@ int lire_nb_plan(const char * nomfich, long * nb_plan)
FILE *fin; FILE *fin;
int flag=0; int flag=0;
if ( (fin=fopen(nomfich,"rw"))!=NULL ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,12,0); fseek(fin,12,0);
if (fread(nb_plan,4,1,fin) != 1) { if (fread(nb_plan,4,1,fin) != 1) {
@ -157,7 +171,7 @@ int lire_nb_octet(const char * nomfich, long * nb_octet)
FILE *fin; FILE *fin;
int flag=0; int flag=0;
if ( (fin=fopen(nomfich,"rw"))!=NULL ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,36,0); fseek(fin,36,0);
if (fread(nb_octet,4,1,fin) != 1) { if (fread(nb_octet,4,1,fin) != 1) {
@ -177,7 +191,7 @@ int lire_longueur_entete(const char * nomfich, long * long_entete)
FILE *fin; FILE *fin;
int flag=0; int flag=0;
if ( (fin=fopen(nomfich,"rw"))!=NULL ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,72,0); fseek(fin,72,0);
if (fread(long_entete,4,1,fin) != 1) { if (fread(long_entete,4,1,fin) != 1) {