- Replace &* by ->handle().

This commit is contained in:
Sylvain Pion 2001-09-13 17:14:03 +00:00
parent 28f7114c42
commit 4bf48624b3
8 changed files with 54 additions and 42 deletions

View File

@ -389,9 +389,9 @@ remove(Vertex_handle v)
typename Tds::Vertex_iterator vit;
for ( vit = _tds.vertices_begin(); vit != _tds.vertices_end(); ++vit )
if ( &*vit != &*inf &&
&*vit != &*v )
insert( vit->point(), NULL, &*vit );
if ( vit->handle() != inf &&
vit->handle() != v )
insert( vit->point(), NULL, vit->handle() );
_tds.delete_vertex(v);
@ -815,10 +815,11 @@ is_valid(bool verbose, int level) const
{
Finite_cell_iterator it;
for ( it = finite_cells_begin(); it != finite_cells_end(); ++it ) {
is_valid_finite(&*it);
is_valid_finite(it->handle());
for (int i=0; i<4; i++ ) {
if ( side_of_sphere (&*it, it->vertex(it->neighbor(i)->index(&*it))
->point() ) == ON_BOUNDED_SIDE ) {
if ( side_of_sphere (it->handle(),
it->vertex(it->neighbor(i)->index(it->handle()))->point())
== ON_BOUNDED_SIDE ) {
if (verbose)
std::cerr << "non-empty sphere " << std::endl;
CGAL_triangulation_assertion(false);

View File

@ -527,11 +527,11 @@ is_valid(bool verbose, int level) const
{
Finite_cell_iterator it;
for ( it = finite_cells_begin(); it != finite_cells_end(); ++it ) {
is_valid_finite(&*it);
is_valid_finite(it->handle());
for ( i=0; i<4; i++ ) {
if ( side_of_power_sphere (&*it,
it->vertex( (it->neighbor(i))->index(&*it) )
->point() ) == ON_BOUNDED_SIDE ) {
if ( side_of_power_sphere (it->handle(),
it->vertex(it->neighbor(i)->index(it->handle()))->point() )
== ON_BOUNDED_SIDE ) {
if (verbose)
std::cerr << "non-empty sphere " << std::endl;
CGAL_triangulation_assertion(false);

View File

@ -868,7 +868,7 @@ operator<< (std::ostream& os, const Triangulation_3<GT, Tds> &tr)
// same - important for remove
for (Vertex_iterator it=tr.vertices_begin(); it!=tr.vertices_end(); ++it)
TV[i++] = &*it;
TV[i++] = it->handle();
CGAL_triangulation_assertion( i == n+1 );
@ -2111,7 +2111,7 @@ flip( Cell_handle c, int i, int j )
Cell_circulator ccir = incident_cells(c,i,j);
Cell_circulator cdone = ccir;
do {
if ( is_infinite(&*ccir) ) return false;
if ( is_infinite(ccir->handle()) ) return false;
++degree;
++ccir;
} while ( ccir != cdone );
@ -2163,7 +2163,7 @@ flip_flippable( Cell_handle c, int i, int j )
Cell_circulator ccir = incident_cells(c,i,j);
Cell_circulator cdone = ccir;
do {
CGAL_triangulation_precondition( ! is_infinite(&*ccir) );
CGAL_triangulation_precondition( ! is_infinite(ccir->handle()) );
++degree;
++ccir;
} while ( ccir != cdone );
@ -2400,7 +2400,7 @@ is_valid(bool verbose, int level) const
{
Finite_cell_iterator it;
for ( it = finite_cells_begin(); it != finite_cells_end(); ++it )
is_valid_finite(&*it, verbose, level);
is_valid_finite(it->handle(), verbose, level);
break;
}
case 2:

View File

@ -223,7 +223,7 @@ public:
void delete_cells(It begin, It end)
{
for(It i = begin; i != end; ++i)
delete_cell(&**i);
delete_cell(*i);
}
// QUERIES
@ -798,7 +798,7 @@ is_edge(Vertex_handle u, Vertex_handle v, Cell_handle &c, int &i, int &j) const
for(Cell_iterator cit = cell_container().begin(); cit != cells_end(); ++cit)
if (cit->has_vertex(u,i) && cit->has_vertex(v,j)) {
c = &*cit;
c = cit->handle();
return true;
}
return false;
@ -817,7 +817,7 @@ is_edge(Cell_handle c, int i, int j) const
if ((i>3) || (j>3)) return false;
for(Cell_iterator cit = cell_container().begin(); cit != cells_end(); ++cit)
if (&*cit == &*c)
if (cit->handle() == c)
return true;
return false;
}
@ -880,7 +880,7 @@ is_cell(Vertex_handle u, Vertex_handle v, Vertex_handle w, Vertex_handle t,
&& ( it->has_vertex(v,j) )
&& ( it->has_vertex(w,k) )
&& ( it->has_vertex(t,l) ) ) {
c = &*it;
c = it->handle();
return true;
}
}
@ -1583,12 +1583,12 @@ insert_in_edge(Vertex_handle v, Cell_handle c, int i, int j)
const Vertex_handle vj=c->vertex(j);
Cell_circulator ccir = incident_cells(c, i, j);
do {
Cell_handle cc = &*ccir;
Cell_handle cc = ccir->handle();
cells.push_back(cc);
facets.push_back(Facet(cc, cc->index(vi)));
facets.push_back(Facet(cc, cc->index(vj)));
++ccir;
} while (&*ccir != &*c);
} while (ccir->handle() != c);
star_hole_3(v, facets.begin(), facets.end(), cells.begin(), cells.end());
break;
@ -1803,8 +1803,8 @@ insert_increase_dimension(Vertex_handle v, // new vertex
it->set_vertex(3,v);
if ( ! it->has_vertex(star) ) {
Cell_handle cnew = create_cell( it->vertex(0), it->vertex(2),
it->vertex(1), star);
set_adjacency(cnew, &*it, 3, 3);
it->vertex(1), star);
set_adjacency(cnew, it->handle(), 3, 3);
new_cells.push_back(cnew);
}
}
@ -1836,7 +1836,7 @@ insert_increase_dimension(Vertex_handle v, // new vertex
// reorientation of all the cells
if (reorient)
for(it = cells_begin(); it != cells_end(); ++it)
change_orientation(&*it);
change_orientation(it->handle());
}
}// end switch
@ -2066,7 +2066,7 @@ copy_tds(const Tds & tds, Vertex_handle vert )
for (Vertex_iterator vit = tds.vertices_begin();
vit != tds.vertices_end(); ++vit)
TV[i++] = &*vit;
TV[i++] = vit->handle();
CGAL_triangulation_assertion( i == n );
std::sort(TV.begin(), TV.end(),
@ -2083,8 +2083,8 @@ copy_tds(const Tds & tds, Vertex_handle vert )
// Create the cells.
for (Cell_iterator cit = tds.cell_container().begin();
cit != tds.cells_end(); ++cit) {
F[&(*cit)] = create_cell(&*cit);
F[&(*cit)]->set_vertices(V[cit->vertex(0)],
F[cit->handle()] = create_cell(cit->handle());
F[cit->handle()]->set_vertices(V[cit->vertex(0)],
V[cit->vertex(1)],
V[cit->vertex(2)],
V[cit->vertex(3)]);

View File

@ -89,7 +89,7 @@ public:
Vertex_handle vertex(int i) const
{
return (Vertex_handle) (Vertex *) (Cb::vertex(i));
return (Vertex *) (Cb::vertex(i));
}
bool has_vertex(const Vertex_handle v) const
@ -111,7 +111,7 @@ public:
Cell_handle neighbor(int i) const
{
return (Cell_handle) (Cell *) Cb::neighbor(i);
return (Cell *) Cb::neighbor(i);
}
bool has_neighbor(const Cell_handle n) const
@ -150,6 +150,11 @@ public:
return _in_conflict_flag;
}
Cell_handle handle() const
{
return this;
}
// CHECKING
bool is_valid(int dim = 3, bool verbose = false, int level = 0) const;
@ -286,14 +291,14 @@ Triangulation_ds_cell_3<Tds>::is_valid
return false;
}
if ( &*n0->neighbor(1) != this) {
if ( n0->neighbor(1) != handle()) {
if (verbose)
std::cerr << "neighbor 0 does not have this as neighbor 1"
<< std::endl;
CGAL_triangulation_assertion(false);
return false;
}
if ( &*n1->neighbor(0) != this) {
if ( n1->neighbor(0) != handle()) {
if (verbose)
std::cerr << "neighbor 1 does not have this as neighbor 0"
<< std::endl;
@ -346,7 +351,7 @@ Triangulation_ds_cell_3<Tds>::is_valid
return false;
}
in = cw(in);
if ( &*n->neighbor(in) != this) {
if ( n->neighbor(in) != handle()) {
if (verbose)
std::cerr << "neighbor " << i
<< " does not have this as neighbor "

View File

@ -90,7 +90,7 @@ public:
do {
increment();
} while ( pos != _tds->cell_container().end()
&& &*pos > &*pos->neighbor(index) );
&& pos->neighbor(index) < pos->handle());
// reports a facet when the current cell has a pointer inferior
// to the pointer of the neighbor cell
return *this;
@ -120,7 +120,7 @@ public:
else
index--;
} while ( pos != _tds->cell_container().end()
&& &*pos > &*pos->neighbor(index) );
&& pos->neighbor(index) < pos->handle() );
// reports a facet when the current cell has a pointer inferior
// to the pointer of the neighbor cell
return *this;
@ -154,7 +154,7 @@ public:
{
// case pos == NULL should not be accessed, there is no facet
// when dimension <2
return Facet(&*pos, index);
return Facet(pos->handle(), index);
}
private:
@ -263,7 +263,7 @@ public:
do {
increment2();
} while ( pos != _tds->cell_container().end() &&
&*pos > &*pos->neighbor(3-b-e) );
pos->neighbor(3-b-e) < pos->handle() );
break;
}
case 3:
@ -313,7 +313,7 @@ public:
e = b+1; // case b==2, e==0 forbids to write e--
}
} while ( pos != _tds->cell_container().end() &&
&*pos > &*pos->neighbor(3-b-e) );
pos->neighbor(3-b-e) < pos->handle() );
break;
}
case 3:
@ -341,8 +341,9 @@ public:
Cell_circulator ccir = _tds->incident_cells(&(*pos),b,e);
do {
++ccir;
} while ( &*ccir > &*pos );
if ( &*ccir == &*pos ) // pos is the cell with minimum pointer
} while ( pos->handle() < ccir->handle() );
if ( pos->handle() == ccir->handle() )
// pos is the cell with minimum pointer
notfound = false;
}
else {
@ -385,7 +386,7 @@ public:
Edge operator*() const
{
return Edge(&*pos, b, e);
return Edge(pos->handle(), b, e);
}
private:

View File

@ -63,6 +63,11 @@ public:
return _order_of_creation;
}
Vertex_handle handle() const
{
return this;
}
private:
void set_order_of_creation()
{

View File

@ -57,7 +57,7 @@ public:
Iterator_base end)
: _ib(it), _end(end), _tr(tr)
{
while ( _tr->is_infinite(&*_ib) )
while ( _tr->is_infinite(_ib->handle()) )
++_ib;
}
@ -83,7 +83,7 @@ public:
{
do {
++_ib;
} while ( _ib != _end && _tr->is_infinite(&*_ib) );
} while ( _ib != _end && _tr->is_infinite(_ib->handle()) );
return *this;
}
@ -92,7 +92,7 @@ public:
{
do {
--_ib;
} while ( _ib != _end && _tr->is_infinite(&*_ib) );
} while ( _ib != _end && _tr->is_infinite(_ib->handle()) );
return *this;
}