triangulation() is now a reference

This commit is contained in:
Laurent Rineau 2023-06-16 15:33:02 +02:00
parent 80a4064350
commit 5c81b975ae
2 changed files with 17 additions and 17 deletions

View File

@ -638,7 +638,7 @@ public:
const Point& source() const { return _cell_iterator.source(); } const Point& source() const { return _cell_iterator.source(); }
const Point& target() const { return _cell_iterator.target(); } const Point& target() const { return _cell_iterator.target(); }
const Tr* triangulation() const { return _cell_iterator.triangulation(); } const Tr& triangulation() const { return *_cell_iterator.triangulation(); }
private: private:
Triangulation_segment_simplex_iterator_3 Triangulation_segment_simplex_iterator_3
@ -725,7 +725,7 @@ public:
Cell_handle ch = Cell_handle(_cell_iterator); Cell_handle ch = Cell_handle(_cell_iterator);
if (ch == Cell_handle()) if (ch == Cell_handle())
{ {
if(!triangulation()->is_infinite(Cell_handle(_curr_simplex))) if(!triangulation().is_infinite(Cell_handle(_curr_simplex)))
set_curr_simplex_to_entry(); set_curr_simplex_to_entry();
else else
_curr_simplex = Simplex_3(); _curr_simplex = Simplex_3();
@ -761,7 +761,7 @@ public:
if (lt == Locate_type::VERTEX) //facet-cell?-vertex-outside if (lt == Locate_type::VERTEX) //facet-cell?-vertex-outside
{ {
int i; int i;
if (triangulation()->has_vertex(get_facet(), chprev->vertex(li), i)) if (triangulation().has_vertex(get_facet(), chprev->vertex(li), i))
_curr_simplex = chprev->vertex(li); _curr_simplex = chprev->vertex(li);
else else
_curr_simplex = chprev; _curr_simplex = chprev;
@ -769,8 +769,8 @@ public:
else if (lt == Locate_type::EDGE)//facet-cell?-edge-outside else if (lt == Locate_type::EDGE)//facet-cell?-edge-outside
{ {
int i, j; int i, j;
if ( triangulation()->has_vertex(get_facet(), chprev->vertex(li), i) if ( triangulation().has_vertex(get_facet(), chprev->vertex(li), i)
&& triangulation()->has_vertex(get_facet(), chprev->vertex(lj), j)) && triangulation().has_vertex(get_facet(), chprev->vertex(lj), j))
_curr_simplex = Edge(chprev, li, lj); _curr_simplex = Edge(chprev, li, lj);
else else
_curr_simplex = chprev; _curr_simplex = chprev;
@ -778,7 +778,7 @@ public:
else if (lt == Locate_type::FACET) //facet-cell-facet-outside else if (lt == Locate_type::FACET) //facet-cell-facet-outside
{ {
if (Facet(chprev, li) == get_facet() if (Facet(chprev, li) == get_facet()
|| triangulation()->mirror_facet(Facet(chprev, li)) == get_facet()) || triangulation().mirror_facet(Facet(chprev, li)) == get_facet())
_curr_simplex = Simplex_3(); _curr_simplex = Simplex_3();
else else
_curr_simplex = chprev; _curr_simplex = chprev;
@ -797,7 +797,7 @@ public:
{ {
//if the entry vertex is a vertex of current facet //if the entry vertex is a vertex of current facet
int i; int i;
if (triangulation()->has_vertex(get_facet(), chprev->vertex(li), i)) if (triangulation().has_vertex(get_facet(), chprev->vertex(li), i))
set_curr_simplex_to_entry(); set_curr_simplex_to_entry();
else else
_curr_simplex = chprev; _curr_simplex = chprev;
@ -903,12 +903,12 @@ public:
{ {
const Edge e_exit(ch, li_exit, lj_exit); const Edge e_exit(ch, li_exit, lj_exit);
CGAL_assertion(_cell_iterator == _cell_iterator.end() CGAL_assertion(_cell_iterator == _cell_iterator.end()
|| triangulation()->is_infinite(chnext) || triangulation().is_infinite(chnext)
|| _curr_simplex != Simplex_3(e_exit)); || _curr_simplex != Simplex_3(e_exit));
if (_cell_iterator == _cell_iterator.end()) if (_cell_iterator == _cell_iterator.end())
_curr_simplex = Simplex_3();//should not be reached _curr_simplex = Simplex_3();//should not be reached
else if (triangulation()->is_infinite(chnext) && is_same_edge(get_edge(), e_exit)) else if (triangulation().is_infinite(chnext) && is_same_edge(get_edge(), e_exit))
_curr_simplex = chnext; _curr_simplex = chnext;
else { else {
auto facet_opt = shared_facet(get_edge(), e_exit); auto facet_opt = shared_facet(get_edge(), e_exit);
@ -992,7 +992,7 @@ public:
{ {
CGAL_assertion(_cell_iterator == _cell_iterator.end() CGAL_assertion(_cell_iterator == _cell_iterator.end()
|| get_vertex() != prev->vertex(liprev) || get_vertex() != prev->vertex(liprev)
|| triangulation()->is_infinite(chnext)); || triangulation().is_infinite(chnext));
if (_cell_iterator == _cell_iterator.end()) if (_cell_iterator == _cell_iterator.end())
{ {
if (prev == ch && ltprev == Locate_type::VERTEX) if (prev == ch && ltprev == Locate_type::VERTEX)
@ -1017,13 +1017,13 @@ public:
} }
else else
{ {
if (triangulation()->is_infinite(chnext) && get_vertex() == prev->vertex(liprev)) if (triangulation().is_infinite(chnext) && get_vertex() == prev->vertex(liprev))
_curr_simplex = chnext; _curr_simplex = chnext;
else else
{ {
Cell_handle ec; Cell_handle ec;
int ei = -1, ej = -1; int ei = -1, ej = -1;
if (!triangulation()->is_edge(get_vertex(), prev->vertex(liprev), ec, ei, ej)) if (!triangulation().is_edge(get_vertex(), prev->vertex(liprev), ec, ei, ej))
CGAL_unreachable(); CGAL_unreachable();
_curr_simplex = Edge(ec, ei, ej); _curr_simplex = Edge(ec, ei, ej);
} }
@ -1230,7 +1230,7 @@ private:
Vertex_handle nsv2 = (sv == v2a) ? v2b : v2a; Vertex_handle nsv2 = (sv == v2a) ? v2b : v2a;
typename Tr::Facet_circulator circ typename Tr::Facet_circulator circ
= triangulation()->incident_facets(e1); = triangulation().incident_facets(e1);
typename Tr::Facet_circulator end = circ; typename Tr::Facet_circulator end = circ;
do do
{ {
@ -1248,13 +1248,13 @@ private:
Facet shared_facet(const Edge& e, const Vertex_handle v) const Facet shared_facet(const Edge& e, const Vertex_handle v) const
{ {
typename Tr::Facet_circulator circ typename Tr::Facet_circulator circ
= triangulation()->incident_facets(e); = triangulation().incident_facets(e);
typename Tr::Facet_circulator end = circ; typename Tr::Facet_circulator end = circ;
do do
{ {
Facet f = *circ; Facet f = *circ;
int i; int i;
if (triangulation()->has_vertex(f, v, i)) if (triangulation().has_vertex(f, v, i))
return f; return f;
} while (++circ != end); } while (++circ != end);
@ -1266,7 +1266,7 @@ private:
Cell_handle shared_cell(const Edge& e, const Vertex_handle v) const Cell_handle shared_cell(const Edge& e, const Vertex_handle v) const
{ {
typename Tr::Cell_circulator circ typename Tr::Cell_circulator circ
= triangulation()->incident_cells(e); = triangulation().incident_cells(e);
typename Tr::Cell_circulator end = circ; typename Tr::Cell_circulator end = circ;
do do
{ {

View File

@ -1,4 +1,4 @@
#define CGAL_DEBUG_TRIANGULATION_SEGMENT_TRAVERSER_3 1 //#define CGAL_DEBUG_TRIANGULATION_SEGMENT_TRAVERSER_3 1
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h> #include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Base_with_time_stamp.h> #include <CGAL/Base_with_time_stamp.h>