From 334ff38f582fa59a37a12d698b68142a726aa5b8 Mon Sep 17 00:00:00 2001 From: Peter Hachenberger Date: Thu, 20 Mar 2003 14:24:16 +0000 Subject: [PATCH] code lines adjusted to a maximum of 80 characters --- .../include/CGAL/Nef_3/SNC_SM_overlayer.h | 59 ++++++++++++++----- .../include/CGAL/Nef_3/SNC_constructor.h | 38 ++++++++---- .../Nef_3/include/CGAL/Nef_3/SNC_decorator.h | 10 +++- 3 files changed, 75 insertions(+), 32 deletions(-) diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h index 446640742e4..26732bae1a9 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h @@ -878,8 +878,14 @@ partition_to_halfsphere(Iterator start, Iterator beyond, Seg_list& L, while ( start != beyond ) { int i = start->intersection(xycircle,s1,s2); TRACEN("segment " << start->source() << " " << start->target()); - if (i>1) { L.push_back(s2); M[--L.end()] = M[start]; TRACEN(">1 " << s2.source() << " " << s2.target()); } - if (i>0) { L.push_back(s1); M[--L.end()] = M[start]; TRACEN(">0 " << s1.source() << " " << s1.target()); } + if (i>1) { + L.push_back(s2); M[--L.end()] = M[start]; + TRACEN(">1 " << s2.source() << " " << s2.target()); + } + if (i>0) { + L.push_back(s1); M[--L.end()] = M[start]; + TRACEN(">0 " << s1.source() << " " << s1.target()); + } ++start; } // now all segments are split into hemispheres @@ -896,15 +902,27 @@ partition_to_halfsphere(Iterator start, Iterator beyond, Seg_list& L, TRACEN(" splitting xy seg "<<*it); bool added=false; int n1 = it->intersection(yzcircle,s1,s2); - if (n1 > 1 && !s2.is_degenerate()) - { M[ L.insert(it,s2) ] = M[it]; added=true; TRACEN(">1 " << s2.source() << " " << s2.target()); } - if (n1 > 0 && !s1.is_degenerate()) - { M[ L.insert(it,s1) ] = M[it]; added = true; TRACEN(">1 " << s1.source() << " " << s1.target()); } + if (n1 > 1 && !s2.is_degenerate()) { + M[ L.insert(it,s2) ] = M[it]; + added=true; + TRACEN(">1 " << s2.source() << " " << s2.target()); + } + if (n1 > 0 && !s1.is_degenerate()) { + M[ L.insert(it,s1) ] = M[it]; + added = true; + TRACEN(">1 " << s1.source() << " " << s1.target()); + } int n2 = it->intersection(yzcircle.opposite(),s1,s2); - if (n2 > 1 && !s2.is_degenerate()) - { M[ L.insert(it,s2) ] = M[it]; added=true; TRACEN(">1 " << s2.source() << " " << s2.target()); } - if (n2 > 0 && !s1.is_degenerate()) - { M[ L.insert(it,s1) ] = M[it]; added=true; TRACEN(">1 " << s1.source() << " " << s1.target()); } + if (n2 > 1 && !s2.is_degenerate()) { + M[ L.insert(it,s2) ] = M[it]; + added=true; + TRACEN(">1 " << s2.source() << " " << s2.target()); + } + if (n2 > 0 && !s1.is_degenerate()) { + M[ L.insert(it,s1) ] = M[it]; + added=true; + TRACEN(">1 " << s1.source() << " " << s1.target()); + } if(added) { itl = it; --it; L.erase(itl); M[itl] = T(); } @@ -1043,7 +1061,10 @@ complete_face_support(SVertex_iterator v_start, SVertex_iterator v_end, for (int i=0; i<2; ++i) { SObject_handle o = supp_object(v,i); - if ( o == NULL ) { TRACEN("no vertex support"); mark(v,i) = m_buffer[i]; continue; } + if ( o == NULL ) { + TRACEN("no vertex support"); + mark(v,i) = m_buffer[i]; continue; + } SVertex_handle vs; SHalfedge_handle es; SHalfloop_handle ls; @@ -1055,7 +1076,9 @@ complete_face_support(SVertex_iterator v_start, SVertex_iterator v_end, { mark(v,i) = PI[i].mark(target(es)); continue; } mark(v,i) = PI[i].mark(es); continue; } - if ( assign(ls,o) ) { mark(v,i) = PI[i].mark(ls); TRACEN("loop " << PI[i].circle(ls)); continue; } + if ( assign(ls,o) ) { + mark(v,i) = PI[i].mark(ls); + TRACEN("loop " << PI[i].circle(ls)); continue; } CGAL_nef3_assertion_msg(0,"wrong handle"); } TRACEN(" vertex marks "<::simplify() const TRACEN("unioning disjoint faces"); } - TRACEN("is_closed_at_source " << is_closed_at_source(e) << " " << is_closed_at_source(twin(e))); + TRACEN("is_closed_at_source " << is_closed_at_source(e) << + " " << is_closed_at_source(twin(e))); if ( is_closed_at_source(e) ) Vitem[source(e)] = Pitem[face(e)]; @@ -1336,7 +1362,8 @@ void SNC_SM_overlayer::simplify() const } else { set_face(v, *(UF.find(Pitem[face(v)]))); - TRACEN("isolated svertex " << PH(v) << " already has incident face " << &*(face(v))); + TRACEN("isolated svertex " << PH(v) << + " already has incident face " << &*(face(v))); } if ( mark(v) == mark(face(v)) ) { diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_constructor.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_constructor.h index 5e3aef55fe4..fd361c3abf3 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_constructor.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_constructor.h @@ -425,8 +425,8 @@ public: Plane_3 h, bool boundary) const; void create_corner_frame_point(Point_3 p, Point_3 sp1, Point_3 sp2, int max, bool boundary) const; - void create_degenerate_corner_frame_point(Point_3 p, Point_3 sp1, Point_3 sp2, - int min,int max,bool boundary) const; + void create_degenerate_corner_frame_point(Point_3 p, Point_3 sp1,Point_3 sp2, + int min,int max,bool boundary)const; }; // SNC_constructor @@ -473,10 +473,15 @@ create_vertices_of_box_with_plane(const Plane_3& h, bool b) { cross[2][(dir+2)%3] = cross[3][(dir+2)%3] = -orth_coords[dir]; for(int i=0; i<4; ++i) - if(CGAL_NTS abs(RT(cnst[dir],cross[i][dir])) < CGAL_NTS abs(RT(0,orth_coords[dir])) || - (CGAL_NTS abs(RT(cnst[dir],cross[i][dir])) == CGAL_NTS abs(RT(0,orth_coords[dir])) && dir == add_corners)) - points.push_back(Kernel::epoint(cross[i][0],cnst[0],cross[i][1],cnst[1],cross[i][2],cnst[2],cross[i][3])); - + if(CGAL_NTS abs(RT(cnst[dir],cross[i][dir])) < + CGAL_NTS abs(RT(0,orth_coords[dir])) || + (CGAL_NTS abs(RT(cnst[dir],cross[i][dir])) == + CGAL_NTS abs(RT(0,orth_coords[dir])) && + dir == add_corners)) + points.push_back(Kernel::epoint(cross[i][0],cnst[0], + cross[i][1],cnst[1], + cross[i][2],cnst[2], + cross[i][3])); } for(int i=0;i<2;i++) @@ -526,11 +531,15 @@ create_vertices_of_box_with_plane(const Plane_3& h, bool b) { CGAL_assertion(Infi_box::degree(sp2.hw()) == 0); TRACEN("sps " << sp1 << " " << sp2); - TRACEN(orth_coords[min] << "|" << orth_coords[(min+1)%3] << "|" << orth_coords[(min+2)%3]); + TRACEN(orth_coords[min] << "|" << + orth_coords[(min+1)%3] << "|" << + orth_coords[(min+2)%3]); - if(orth_coords[min]==0 && orth_coords[(min+1)%3] == orth_coords[(min+2)%3] && h.d() == 0) + if(orth_coords[min]==0 && orth_coords[(min+1)%3] == + orth_coords[(min+2)%3] && h.d() == 0) create_degenerate_corner_frame_point(*p,sp1,sp2,min, max, b); - else if(CGAL_NTS abs(p->hx()) == CGAL_NTS abs(p->hy()) && CGAL_NTS abs(p->hz()) == CGAL_NTS abs(p->hy())) + else if(CGAL_NTS abs(p->hx()) == CGAL_NTS abs(p->hy()) && + CGAL_NTS abs(p->hz()) == CGAL_NTS abs(p->hy())) create_corner_frame_point(*p,sp1,sp2,max,b); else create_frame_point(*p,sp1,sp2,h,b); @@ -743,7 +752,8 @@ create_corner_frame_point(Point_3 p, Point_3 sp1, Point_3 sp2, she[5] = SD.new_edge_pair(sv[4],SD.twin(she[1]),-1); TRACEN("2"); - SD.circle(SD.twin(she[4]))= Sphere_circle(Plane_3(SP[1],SP[4],Point_3(0,0,0))); + SD.circle(SD.twin(she[4]))= + Sphere_circle(Plane_3(SP[1],SP[4],Point_3(0,0,0))); SD.circle(she[4]) = SD.circle(SD.twin(she[4])).opposite(); SD.mark(she[4]) = boundary; @@ -834,7 +844,8 @@ create_degenerate_corner_frame_point(Point_3 p, Point_3 sp1, Point_3 sp2, she[3] = SD.new_edge_pair(sv[3],she[1],-1); she[4] = SD.new_edge_pair(sv[3],SD.twin(she[1]),1); - SD.circle(SD.twin(she[3]))= Sphere_circle(Plane_3(SP[1],SP[3],Point_3(0,0,0))); + SD.circle(SD.twin(she[3]))= + Sphere_circle(Plane_3(SP[1],SP[3],Point_3(0,0,0))); SD.circle(she[3]) = SD.circle(SD.twin(she[3])).opposite(); SD.mark(she[3]) = boundary; @@ -913,7 +924,7 @@ create_box_corner(int x, int y, int z, bool space, bool boundary) const { template typename SNC_::Vertex_handle SNC_constructor:: -create_extended_box_corner(int x,int y,int z, bool space, bool boundary) const { +create_extended_box_corner(int x,int y,int z, bool space,bool boundary) const { CGAL_nef3_assertion(CGAL_NTS abs(x) == CGAL_NTS abs(y) && CGAL_NTS abs(y) == CGAL_NTS abs(z)); @@ -939,7 +950,8 @@ create_extended_box_corner(int x,int y,int z, bool space, bool boundary) const { she[si] = SD.new_edge_pair(sv[si], sv[(si+1)%3]); for(int i=0; i<3;++i) { - SD.circle(she[i]) = Sphere_circle(Plane_3(sp[i],sp[(i+1)%3],Point_3(0,0,0))); + SD.circle(she[i]) = + Sphere_circle(Plane_3(sp[i],sp[(i+1)%3],Point_3(0,0,0))); SD.circle(SD.twin(she[i])) = SD.circle(she[i]).opposite(); SD.mark(she[i]) = boundary; } diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_decorator.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_decorator.h index 94e5801cafe..0c229379990 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_decorator.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_decorator.h @@ -381,7 +381,9 @@ public: bool is_sedge_on_infibox(SHalfedge_handle sh) { Point_3 p = point(vertex(sh)); TRACEN("Point " << p); - if(Infi_box::degree(p.hx())==0 && Infi_box::degree(p.hy())==0 && Infi_box::degree(p.hz())==0) + if(Infi_box::degree(p.hx())==0 && + Infi_box::degree(p.hy())==0 && + Infi_box::degree(p.hz())==0) return false; Sphere_circle c(sh->tmp_circle()); TRACEN("Circle " << c << " has signum " << sign_of(c)); @@ -403,7 +405,9 @@ public: Point_3 p = point(vertex(e)); - if(Infi_box::degree(p.hx())==0 && Infi_box::degree(p.hy())==0 && Infi_box::degree(p.hz())==0) + if(Infi_box::degree(p.hx())==0 && + Infi_box::degree(p.hy())==0 && + Infi_box::degree(p.hz())==0) return false; Vector_3 v(tmp_point(e)); @@ -924,7 +928,7 @@ public: Unique_hash_map SEvisited(false); Unique_hash_map SFvisited(false); - valid = valid && SD.is_valid(SVvisited, SEvisited, SFvisited, verb, level); + valid = valid && SD.is_valid(SVvisited,SEvisited,SFvisited, verb, level); }