- fix a desynch between the doc and code: is_marked->is_in_domain, in the

face base type
This commit is contained in:
Laurent Rineau 2006-03-20 14:38:45 +00:00
parent 90d529cfd3
commit 0530e82ca4
6 changed files with 58 additions and 48 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). // Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France).
// All rights reserved. // All rights reserved.
// //
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or // This file is part of CGAL (www.cgal.org); you can redistribute it and/or
@ -189,12 +189,12 @@ struct Edge_to_segment {
}; };
template <class Tr> template <class Tr>
class Show_marked_faces : public CGAL::Qt_widget_layer class Show_in_domain_faces : public CGAL::Qt_widget_layer
{ {
Tr *cdt; Tr *cdt;
CGAL::Color color; CGAL::Color color;
public: public:
Show_marked_faces(Tr *t, CGAL::Color c=CGAL::GREEN, Show_in_domain_faces(Tr *t, CGAL::Color c=CGAL::GREEN,
QObject* parent = 0, const char* name = 0) QObject* parent = 0, const char* name = 0)
: Qt_widget_layer(parent, name), : Qt_widget_layer(parent, name),
cdt(t), cdt(t),
@ -212,7 +212,7 @@ public:
for(Face_iterator fit=cdt->finite_faces_begin(); for(Face_iterator fit=cdt->finite_faces_begin();
fit!=cdt->finite_faces_end(); fit!=cdt->finite_faces_end();
++fit) ++fit)
if(fit->is_marked()) if(fit->is_in_domain())
*widget << cdt->triangle(fit); *widget << cdt->triangle(fit);
widget->setFillColor(old_fill_color); widget->setFillColor(old_fill_color);
widget->setLineWidth(old_line_width); widget->setLineWidth(old_line_width);
@ -571,9 +571,9 @@ public:
CGAL::BLUE,1, CGAL::BLUE,1,
this, this,
"Show triangulation edges"); "Show triangulation edges");
show_marked = show_in_domain =
new Show_marked_faces<Tr>(&cdt, CGAL::GREEN, new Show_in_domain_faces<Tr>(&cdt, CGAL::GREEN,
this, "Show marked faces"); this, "Show in_domain faces");
show_constraints = show_constraints =
new CGAL::Qt_layer_show_triangulation_constraints<Tr> new CGAL::Qt_layer_show_triangulation_constraints<Tr>
@ -614,7 +614,7 @@ public:
#ifdef CGAL_MESH_2_DEBUG_DRAW #ifdef CGAL_MESH_2_DEBUG_DRAW
widget->attach(new CGAL::Debug_layer()); widget->attach(new CGAL::Debug_layer());
#endif #endif
widget->attach(show_marked); widget->attach(show_in_domain);
widget->attach(show_bad_faces); widget->attach(show_bad_faces);
widget->attach(show_triangulation); widget->attach(show_triangulation);
widget->attach(show_constraints); widget->attach(show_constraints);
@ -774,17 +774,17 @@ public:
connect(pbShowConstraints, SIGNAL(stateChanged(int)), connect(pbShowConstraints, SIGNAL(stateChanged(int)),
show_constraints, SLOT(stateChanged(int))); show_constraints, SLOT(stateChanged(int)));
QToolButton *pbShowMarked QToolButton *pbShowInDomain
= new QToolButton(QPixmap( (const char**)marked_xpm ), = new QToolButton(QPixmap( (const char**)marked_xpm ),
"Show marked faces", "Show faces in domain",
"Display faces that will be refined", "Display faces that will be refined",
this, SLOT(fake_slot()), this, SLOT(fake_slot()),
toolbarLayers, toolbarLayers,
"show marked"); "show in domain");
pbShowMarked->setToggleButton(true); pbShowInDomain->setToggleButton(true);
pbShowMarked->setOn(true); pbShowInDomain->setOn(true);
connect(pbShowMarked, SIGNAL(stateChanged(int)), connect(pbShowInDomain, SIGNAL(stateChanged(int)),
show_marked, SLOT(stateChanged(int))); show_in_domain, SLOT(stateChanged(int)));
QToolButton *pbShowCircles QToolButton *pbShowCircles
= new QToolButton(QPixmap( (const char**)circle_xpm ), = new QToolButton(QPixmap( (const char**)circle_xpm ),
@ -802,7 +802,7 @@ public:
QButtonGroup *bgLayers = QButtonGroup *bgLayers =
new QButtonGroup("Layers", 0, "layers"); new QButtonGroup("Layers", 0, "layers");
bgLayers->insert(pbShowPoints); bgLayers->insert(pbShowPoints);
bgLayers->insert(pbShowMarked); bgLayers->insert(pbShowInDomain);
bgLayers->insert(pbShowTriangulation); bgLayers->insert(pbShowTriangulation);
bgLayers->insert(pbShowConstraints); bgLayers->insert(pbShowConstraints);
bgLayers->insert(pbShowSeeds); bgLayers->insert(pbShowSeeds);
@ -992,7 +992,7 @@ public slots:
Face_handle fh = cdt.locate(p); Face_handle fh = cdt.locate(p);
criteria.set_point(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; Criteria::Quality q;
if(criteria.is_bad_object().operator()(fh, q) != if(criteria.is_bad_object().operator()(fh, q) !=
@ -1404,7 +1404,7 @@ private:
CGAL::Qt_layer_show_triangulation_constraints<Tr>* show_constraints; CGAL::Qt_layer_show_triangulation_constraints<Tr>* show_constraints;
CGAL::Qt_layer_show_circles<Tr>* show_circles; CGAL::Qt_layer_show_circles<Tr>* show_circles;
CGAL::Qt_widget_show_mouse_coordinates* show_coordinates; CGAL::Qt_widget_show_mouse_coordinates* show_coordinates;
Show_marked_faces<Tr>* show_marked; Show_in_domain_faces<Tr>* show_in_domain;
bool nb_of_clusters_has_to_be_updated; bool nb_of_clusters_has_to_be_updated;
QLabel *nb_of_clusters; QLabel *nb_of_clusters;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). // Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France).
// All rights reserved. // All rights reserved.
// //
// This file is part of CGAL (www.cgal.org); you may redistribute it under // This file is part of CGAL (www.cgal.org); you may redistribute it under
@ -41,15 +41,15 @@ public:
}; };
protected: protected:
bool marked; bool in_domain;
public: 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, Delaunay_mesh_face_base_2(Vertex_handle v0,
Vertex_handle v1, Vertex_handle v1,
Vertex_handle v2) Vertex_handle v2)
: Fb(v0,v1,v2), marked(false) {}; : Fb(v0,v1,v2), in_domain(false) {};
Delaunay_mesh_face_base_2(Vertex_handle v0, Delaunay_mesh_face_base_2(Vertex_handle v0,
Vertex_handle v1, Vertex_handle v1,
@ -57,13 +57,21 @@ public:
Face_handle n0, Face_handle n0,
Face_handle n1, Face_handle n1,
Face_handle n2) Face_handle n2)
: Fb(v0,v1,v2,n0,n1,n2), marked(false) {}; : Fb(v0,v1,v2,n0,n1,n2), in_domain(false) {};
inline inline
bool is_marked() const { return marked; }; bool is_in_domain() const { return in_domain; };
inline 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 }; // namespace CGAL

View File

@ -1,4 +1,4 @@
// Copyright (c) 2004-2005 INRIA Sophia-Antipolis (France). // Copyright (c) 2004-2006 INRIA Sophia-Antipolis (France).
// All rights reserved. // All rights reserved.
// //
// This file is part of CGAL (www.cgal.org); you may redistribute it under // 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(); for(typename Tr::All_faces_iterator it=tr.all_faces_begin();
it!=tr.all_faces_end(); it!=tr.all_faces_end();
++it) ++it)
it->set_marked(!mark); it->set_in_domain(!mark);
for(Seeds_it sit=begin; sit!=end; ++sit) for(Seeds_it sit=begin; sit!=end; ++sit)
{ {
@ -180,7 +180,7 @@ public:
for(typename Tr::All_faces_iterator fit=tr.all_faces_begin(); for(typename Tr::All_faces_iterator fit=tr.all_faces_begin();
fit!=tr.all_faces_end(); fit!=tr.all_faces_end();
++fit) ++fit)
fit->set_marked(true); fit->set_in_domain(true);
propagate_marks(tr.infinite_face(), false); propagate_marks(tr.infinite_face(), false);
} }
@ -191,7 +191,7 @@ public:
// std::deque, which is the default // std::deque, which is the default
// But it should be fixed by VC++7 know. [Laurent Rineau 2003/03/24] // But it should be fixed by VC++7 know. [Laurent Rineau 2003/03/24]
std::queue<Face_handle/*, std::list<Face_handle>*/> face_queue; std::queue<Face_handle/*, std::list<Face_handle>*/> face_queue;
fh->set_marked(mark); fh->set_in_domain(mark);
face_queue.push(fh); face_queue.push(fh);
while( !face_queue.empty() ) while( !face_queue.empty() )
{ {
@ -200,9 +200,9 @@ public:
for(int i=0;i<3;i++) for(int i=0;i<3;i++)
{ {
const Face_handle& nb = fh->neighbor(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); face_queue.push(nb);
} }
} }

View File

@ -1,4 +1,4 @@
// Copyright (c) 2003-2004 INRIA Sophia-Antipolis (France). // Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France).
// All rights reserved. // All rights reserved.
// //
// This file is part of CGAL (www.cgal.org); you may redistribute it under // 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 typename Reverse_func::iterator reverse_iterator;
typedef std::map <Key, reverse_iterator, Direct_compare> Direct_func; typedef std::map <Key, reverse_iterator, Direct_compare> Direct_func;
typedef std::pair<Key, reverse_iterator> Direct_entry; typedef typename Direct_func::value_type Direct_entry;
typedef std::pair<Data, Key> Reverse_entry; // std::pair<Key, reverse_iterator>
typedef typename Reverse_func::value_type Reverse_entry;
// std::pair<Data, Key> ;
typedef typename Direct_func::size_type size_type; typedef typename Direct_func::size_type size_type;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2004 INRIA Sophia-Antipolis (France). // Copyright (c) 2004-2006 INRIA Sophia-Antipolis (France).
// All rights reserved. // All rights reserved.
// //
// This file is part of CGAL (www.cgal.org); you may redistribute it under // 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)); va = fh->vertex(Tr::cw (edge_index));
vb = fh->vertex(Tr::ccw(edge_index)); vb = fh->vertex(Tr::ccw(edge_index));
mark_at_right = fh->is_marked(); mark_at_right = fh->is_in_domain();
mark_at_left = fh->neighbor(edge_index)->is_marked(); mark_at_left = fh->neighbor(edge_index)->is_in_domain();
} }
void before_insertion(const Edge&, const Point& p, Zone& z) void before_insertion(const Edge&, const Point& p, Zone& z)
@ -97,13 +97,13 @@ public:
// [va,v] // [va,v]
do { do {
if( !tr.is_infinite(fc) ) if( !tr.is_infinite(fc) )
fc->set_marked(mark_at_right); fc->set_in_domain(mark_at_right);
++fc; ++fc;
} while ( fc->vertex(tr.ccw(fc->index(v))) != vb ); } while ( fc->vertex(tr.ccw(fc->index(v))) != vb );
// we are now at the left of [va,vb] // we are now at the left of [va,vb]
do { do {
if( !tr.is_infinite(fc) ) if( !tr.is_infinite(fc) )
fc->set_marked(mark_at_left); fc->set_in_domain(mark_at_left);
++fc; ++fc;
} while ( fc != fcbegin ); } while ( fc != fcbegin );

View File

@ -1,4 +1,4 @@
// Copyright (c) 2004 INRIA Sophia-Antipolis (France). // Copyright (c) 2004-2006 INRIA Sophia-Antipolis (France).
// All rights reserved. // All rights reserved.
// //
// This file is part of CGAL (www.cgal.org); you may redistribute it under // This file is part of CGAL (www.cgal.org); you may redistribute it under
@ -87,7 +87,7 @@ public:
/** \Name MESHER_LEVEL FUNCTIONS */ /** \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. */ bad. */
void scan_triangulation_impl() void scan_triangulation_impl()
{ {
@ -96,7 +96,7 @@ public:
fit != triangulation_ref_impl().finite_faces_end(); fit != triangulation_ref_impl().finite_faces_end();
++fit) ++fit)
{ {
if( fit->is_marked() ) if( fit->is_in_domain() )
{ {
Quality q; Quality q;
Mesh_2::Face_badness badness = is_bad(fit, q); Mesh_2::Face_badness badness = is_bad(fit, q);
@ -174,9 +174,9 @@ public:
fh_it != zone.faces.end(); fh_it != zone.faces.end();
++fh_it) ++fh_it)
{ {
if(*fh_it != fh && (*fh_it)->is_marked() ) if(*fh_it != fh && (*fh_it)->is_in_domain() )
remove_bad_face(*fh_it); 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 = typename Tr::Face_circulator fc =
triangulation_ref_impl().incident_faces(v), fcbegin(fc); triangulation_ref_impl().incident_faces(v), fcbegin(fc);
do { do {
fc->set_marked(true); fc->set_in_domain(true);
} while (++fc != fcbegin); } while (++fc != fcbegin);
compute_new_bad_faces(v); 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(), CGAL_assertion( orientation(fh->vertex(0)->point(),
fh->vertex(1)->point(), fh->vertex(1)->point(),
fh->vertex(2)->point()) != COLLINEAR ); fh->vertex(2)->point()) != COLLINEAR );
CGAL_assertion(fh->is_marked()); CGAL_assertion(fh->is_in_domain());
bad_faces.insert(fh, q); 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); typename Tr::Face_circulator fc = v->incident_faces(), fcbegin(fc);
do { do {
if(!triangulation_ref_impl().is_infinite(fc)) if(!triangulation_ref_impl().is_infinite(fc))
if( fc->is_marked() ) if( fc->is_in_domain() )
{ {
Quality q; Quality q;
Mesh_2::Face_badness badness = is_bad(fc, q); Mesh_2::Face_badness badness = is_bad(fc, q);