From 0530e82ca435c5da89565f7a26ec77c90531f04c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 20 Mar 2006 14:38:45 +0000 Subject: [PATCH] - fix a desynch between the doc and code: is_marked->is_in_domain, in the face base type --- Mesh_2/demo/Mesh_2/mesh_demo.C | 38 +++++++++---------- .../include/CGAL/Delaunay_mesh_face_base_2.h | 22 +++++++---- Mesh_2/include/CGAL/Delaunay_mesher_2.h | 12 +++--- Mesh_2/include/CGAL/Double_map.h | 8 ++-- .../CGAL/Mesh_2/Refine_edges_visitor.h | 10 ++--- Mesh_2/include/CGAL/Mesh_2/Refine_faces.h | 16 ++++---- 6 files changed, 58 insertions(+), 48 deletions(-) diff --git a/Mesh_2/demo/Mesh_2/mesh_demo.C b/Mesh_2/demo/Mesh_2/mesh_demo.C index 6ab6d346e83..9a9dc145c9f 100644 --- a/Mesh_2/demo/Mesh_2/mesh_demo.C +++ b/Mesh_2/demo/Mesh_2/mesh_demo.C @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -189,13 +189,13 @@ struct Edge_to_segment { }; template -class Show_marked_faces : public CGAL::Qt_widget_layer +class Show_in_domain_faces : public CGAL::Qt_widget_layer { Tr *cdt; CGAL::Color color; public: - Show_marked_faces(Tr *t, CGAL::Color c=CGAL::GREEN, - QObject* parent = 0, const char* name = 0) + Show_in_domain_faces(Tr *t, CGAL::Color c=CGAL::GREEN, + QObject* parent = 0, const char* name = 0) : Qt_widget_layer(parent, name), cdt(t), color(c) @@ -212,7 +212,7 @@ public: for(Face_iterator fit=cdt->finite_faces_begin(); fit!=cdt->finite_faces_end(); ++fit) - if(fit->is_marked()) + if(fit->is_in_domain()) *widget << cdt->triangle(fit); widget->setFillColor(old_fill_color); widget->setLineWidth(old_line_width); @@ -571,9 +571,9 @@ public: CGAL::BLUE,1, this, "Show triangulation edges"); - show_marked = - new Show_marked_faces(&cdt, CGAL::GREEN, - this, "Show marked faces"); + show_in_domain = + new Show_in_domain_faces(&cdt, CGAL::GREEN, + this, "Show in_domain faces"); show_constraints = new CGAL::Qt_layer_show_triangulation_constraints @@ -614,7 +614,7 @@ public: #ifdef CGAL_MESH_2_DEBUG_DRAW widget->attach(new CGAL::Debug_layer()); #endif - widget->attach(show_marked); + widget->attach(show_in_domain); widget->attach(show_bad_faces); widget->attach(show_triangulation); widget->attach(show_constraints); @@ -774,17 +774,17 @@ public: connect(pbShowConstraints, SIGNAL(stateChanged(int)), show_constraints, SLOT(stateChanged(int))); - QToolButton *pbShowMarked + QToolButton *pbShowInDomain = new QToolButton(QPixmap( (const char**)marked_xpm ), - "Show marked faces", + "Show faces in domain", "Display faces that will be refined", this, SLOT(fake_slot()), toolbarLayers, - "show marked"); - pbShowMarked->setToggleButton(true); - pbShowMarked->setOn(true); - connect(pbShowMarked, SIGNAL(stateChanged(int)), - show_marked, SLOT(stateChanged(int))); + "show in domain"); + pbShowInDomain->setToggleButton(true); + pbShowInDomain->setOn(true); + connect(pbShowInDomain, SIGNAL(stateChanged(int)), + show_in_domain, SLOT(stateChanged(int))); QToolButton *pbShowCircles = new QToolButton(QPixmap( (const char**)circle_xpm ), @@ -802,7 +802,7 @@ public: QButtonGroup *bgLayers = new QButtonGroup("Layers", 0, "layers"); bgLayers->insert(pbShowPoints); - bgLayers->insert(pbShowMarked); + bgLayers->insert(pbShowInDomain); bgLayers->insert(pbShowTriangulation); bgLayers->insert(pbShowConstraints); bgLayers->insert(pbShowSeeds); @@ -992,7 +992,7 @@ public slots: Face_handle fh = cdt.locate(p); criteria.set_point(p); - if( (fh!=NULL) && (!cdt.is_infinite(fh)) && fh->is_marked() ) + if( (fh!=NULL) && (!cdt.is_infinite(fh)) && fh->is_in_domain() ) { Criteria::Quality q; if(criteria.is_bad_object().operator()(fh, q) != @@ -1404,7 +1404,7 @@ private: CGAL::Qt_layer_show_triangulation_constraints* show_constraints; CGAL::Qt_layer_show_circles* show_circles; CGAL::Qt_widget_show_mouse_coordinates* show_coordinates; - Show_marked_faces* show_marked; + Show_in_domain_faces* show_in_domain; bool nb_of_clusters_has_to_be_updated; QLabel *nb_of_clusters; diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h index 715567b1e85..c014ec1e013 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under @@ -41,15 +41,15 @@ public: }; protected: - bool marked; + bool in_domain; public: - Delaunay_mesh_face_base_2(): Fb(), marked(false) {}; + Delaunay_mesh_face_base_2(): Fb(), in_domain(false) {}; Delaunay_mesh_face_base_2(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2) - : Fb(v0,v1,v2), marked(false) {}; + : Fb(v0,v1,v2), in_domain(false) {}; Delaunay_mesh_face_base_2(Vertex_handle v0, Vertex_handle v1, @@ -57,13 +57,21 @@ public: Face_handle n0, Face_handle n1, Face_handle n2) - : Fb(v0,v1,v2,n0,n1,n2), marked(false) {}; + : Fb(v0,v1,v2,n0,n1,n2), in_domain(false) {}; inline - bool is_marked() const { return marked; }; + bool is_in_domain() const { return in_domain; }; inline - void set_marked(const bool b) { marked=b; }; + void set_in_domain(const bool b) { in_domain=b; }; + + /** compatibility with CGAL-3.2 */ + inline + bool is_marked() const { return in_domain; }; + + /** compatibility with CGAL-3.2 */ + inline + void set_marked(const bool b) { in_domain=b; }; }; }; // namespace CGAL diff --git a/Mesh_2/include/CGAL/Delaunay_mesher_2.h b/Mesh_2/include/CGAL/Delaunay_mesher_2.h index b1295a04b2b..cba14e89f67 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesher_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesher_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2004-2005 INRIA Sophia-Antipolis (France). +// Copyright (c) 2004-2006 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under @@ -157,7 +157,7 @@ public: for(typename Tr::All_faces_iterator it=tr.all_faces_begin(); it!=tr.all_faces_end(); ++it) - it->set_marked(!mark); + it->set_in_domain(!mark); for(Seeds_it sit=begin; sit!=end; ++sit) { @@ -180,7 +180,7 @@ public: for(typename Tr::All_faces_iterator fit=tr.all_faces_begin(); fit!=tr.all_faces_end(); ++fit) - fit->set_marked(true); + fit->set_in_domain(true); propagate_marks(tr.infinite_face(), false); } @@ -191,7 +191,7 @@ public: // std::deque, which is the default // But it should be fixed by VC++7 know. [Laurent Rineau 2003/03/24] std::queue*/> face_queue; - fh->set_marked(mark); + fh->set_in_domain(mark); face_queue.push(fh); while( !face_queue.empty() ) { @@ -200,9 +200,9 @@ public: for(int i=0;i<3;i++) { const Face_handle& nb = fh->neighbor(i); - if( !fh->is_constrained(i) && (mark != nb->is_marked()) ) + if( !fh->is_constrained(i) && (mark != nb->is_in_domain()) ) { - nb->set_marked(mark); + nb->set_in_domain(mark); face_queue.push(nb); } } diff --git a/Mesh_2/include/CGAL/Double_map.h b/Mesh_2/include/CGAL/Double_map.h index ff17341bc46..03350054944 100644 --- a/Mesh_2/include/CGAL/Double_map.h +++ b/Mesh_2/include/CGAL/Double_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under @@ -43,8 +43,10 @@ public: typedef typename Reverse_func::iterator reverse_iterator; typedef std::map Direct_func; - typedef std::pair Direct_entry; - typedef std::pair Reverse_entry; + typedef typename Direct_func::value_type Direct_entry; + // std::pair + typedef typename Reverse_func::value_type Reverse_entry; + // std::pair ; typedef typename Direct_func::size_type size_type; diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h index 9f4b6767070..091d1142726 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h @@ -1,4 +1,4 @@ -// Copyright (c) 2004 INRIA Sophia-Antipolis (France). +// Copyright (c) 2004-2006 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under @@ -70,8 +70,8 @@ public: va = fh->vertex(Tr::cw (edge_index)); vb = fh->vertex(Tr::ccw(edge_index)); - mark_at_right = fh->is_marked(); - mark_at_left = fh->neighbor(edge_index)->is_marked(); + mark_at_right = fh->is_in_domain(); + mark_at_left = fh->neighbor(edge_index)->is_in_domain(); } void before_insertion(const Edge&, const Point& p, Zone& z) @@ -97,13 +97,13 @@ public: // [va,v] do { if( !tr.is_infinite(fc) ) - fc->set_marked(mark_at_right); + fc->set_in_domain(mark_at_right); ++fc; } while ( fc->vertex(tr.ccw(fc->index(v))) != vb ); // we are now at the left of [va,vb] do { if( !tr.is_infinite(fc) ) - fc->set_marked(mark_at_left); + fc->set_in_domain(mark_at_left); ++fc; } while ( fc != fcbegin ); diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h b/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h index 5df3511169f..aafbeee0ce7 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h @@ -1,4 +1,4 @@ -// Copyright (c) 2004 INRIA Sophia-Antipolis (France). +// Copyright (c) 2004-2006 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under @@ -87,7 +87,7 @@ public: /** \Name MESHER_LEVEL FUNCTIONS */ - /** Scans all marked faces and put them in the map if they are + /** Scans all faces in domain and put them in the map if they are bad. */ void scan_triangulation_impl() { @@ -96,7 +96,7 @@ public: fit != triangulation_ref_impl().finite_faces_end(); ++fit) { - if( fit->is_marked() ) + if( fit->is_in_domain() ) { Quality q; Mesh_2::Face_badness badness = is_bad(fit, q); @@ -174,9 +174,9 @@ public: fh_it != zone.faces.end(); ++fh_it) { - if(*fh_it != fh && (*fh_it)->is_marked() ) + if(*fh_it != fh && (*fh_it)->is_in_domain() ) remove_bad_face(*fh_it); - (*fh_it)->set_marked(false); + (*fh_it)->set_in_domain(false); } } @@ -186,7 +186,7 @@ public: typename Tr::Face_circulator fc = triangulation_ref_impl().incident_faces(v), fcbegin(fc); do { - fc->set_marked(true); + fc->set_in_domain(true); } while (++fc != fcbegin); compute_new_bad_faces(v); } @@ -255,7 +255,7 @@ push_in_bad_faces(Face_handle fh, const Quality& q) CGAL_assertion( orientation(fh->vertex(0)->point(), fh->vertex(1)->point(), fh->vertex(2)->point()) != COLLINEAR ); - CGAL_assertion(fh->is_marked()); + CGAL_assertion(fh->is_in_domain()); bad_faces.insert(fh, q); } @@ -280,7 +280,7 @@ compute_new_bad_faces(Vertex_handle v) typename Tr::Face_circulator fc = v->incident_faces(), fcbegin(fc); do { if(!triangulation_ref_impl().is_infinite(fc)) - if( fc->is_marked() ) + if( fc->is_in_domain() ) { Quality q; Mesh_2::Face_badness badness = is_bad(fc, q);