changes in Complex_2_in_triangulation_3 :

remove set_in_complex and remove_from_complex for vertices
    change  set_in_complex and remove_from_complex for facets
    add iterators on complex faces
This commit is contained in:
Mariette Yvinec 2006-03-08 14:47:38 +00:00
parent 4030f47a42
commit 8f3310e242
3 changed files with 108 additions and 56 deletions

View File

@ -1,10 +1,11 @@
changes in Complex_2_in_triangulatio_3 :
8 March 2006 Mariette
changes in Complex_2_in_triangulation_3 :
remove set_in_complex and remove_from_complex for vertices
change set_in_complex and remove_from_complex for facets
add iterators on complex faces
8 March 2006 Mariette
changes in Complex_2_in_triangulatio_3 :
changes in Complex_2_in_triangulation_3 :
fixed operator Not_in_complex
changed face_type into face_status
changed is_in_complex

View File

@ -113,9 +113,9 @@ vertices of the 2D complex.}
\ccNestedType{Boundary_edges_iterator}{An iterator type to visit the
boundary edges of the 2D complex.}
\ccGlue
\ccNestedType{Boundary_vertices_iterator}{An iterator type to visit the
boundary vertices of the 2D complex.}
%\ccGlue
%\ccNestedType{Boundary_vertices_iterator}{An iterator type to visit the
%boundary vertices of the 2D complex.}
%\ccNestedType{Facet_circulator}{An iterator type to visit the facets
%of the 2D complex around a boundary or regular vertex.}
%\ccGlue
@ -327,41 +327,41 @@ vertices of the 2D complex.}
\ccGlue
\ccMethod{Vertex_iterator vertices_end();}
{Returns the past the end iterator for the above iterator.}
\ccGlue
\ccMethod{Boundary_vertices_iterator
boundary_vertices_begin();}
{Returns an iterator with value type \ccc{Vertex_handle} to visit the
vertices of the 2D complex that are boundary vertices.}
\ccGlue
\ccMethod{Boundary_vertices_iterator
boundary_vertices_end();}
{Returns the past the end iterator for the above iterator.}
%\ccGlue
%\ccMethod{Boundary_vertices_iterator
% boundary_vertices_begin();}
%{Returns an iterator with value type \ccc{Vertex_handle} to visit the
%vertices of the 2D complex that are boundary vertices.}
%\ccGlue
%\ccMethod{Boundary_vertices_iterator
% boundary_vertices_end();}
%{Returns the past the end iterator for the above iterator.}
\ccHeading{Traversal of incident facets}
The data structure also provides member functions to retrieve
the facets of the complex incident to a given face (vertex or edge).
%\ccHeading{Traversal of incident facets}
%The data structure also provides member functions to retrieve
%the facets of the complex incident to a given face (vertex or edge).
\ccMethod{template <class OutputIterator>
OutputIterator
incident_facets(Vertex_handle v, OutputIterator facets);}
{To retrieve the facets of the complex incident to \ccc{v}.}
\ccGlue
\ccMethod{template <class OutputIterator>
OutputIterator
incident_facets(Vertex_handle va, Vertex_handle vb);}
{To retrieve the facets of the complex incident to edge \ccc{v_i, v_j}.}
\ccGlue
\ccMethod{template <class OutputIterator>
OutputIterator
incident_facets(Cell_handle c, int i, int j);}
{To retrieve the facets of the complex incident to edge \ccc{
(c,i,i)}.}
\ccGlue
\ccMethod{template <class OutputIterator>
OutputIterator
incident_facets(Edge e);}
{To retrieve the facets of the complex incident to edge \ccc{e}.}
%\ccMethod{template <class OutputIterator>
% OutputIterator
% incident_facets(Vertex_handle v, OutputIterator facets);}
% {To retrieve the facets of the complex incident to \ccc{v}.}
%\ccGlue
%\ccMethod{template <class OutputIterator>
% OutputIterator
% incident_facets(Vertex_handle va, Vertex_handle vb);}
% {To retrieve the facets of the complex incident to edge \ccc{v_i, v_j}.}
%\ccGlue
%\ccMethod{template <class OutputIterator>
% OutputIterator
% incident_facets(Cell_handle c, int i, int j);}
% {To retrieve the facets of the complex incident to edge \ccc{
%(c,i,i)}.}
%\ccGlue
%\ccMethod{template <class OutputIterator>
% OutputIterator
% incident_facets(Edge e);}
% {To retrieve the facets of the complex incident to edge \ccc{e}.}
%\ccMethod{Facet_circulator

View File

@ -41,23 +41,16 @@ class Complex_2_in_triangulation_3 {
typedef Tr Triangulation_3;
typedef typename Triangulation_3::Vertex_handle Vertex_handle;
typedef typename Triangulation_3::Cell_handle Cell_handle;
typedef typename Triangulation_3::Facet Facet;
typedef typename Triangulation_3::Edge Edge;
typedef std::list<Facet> Facets;
typedef std::list<Cell_handle> Cells;
typedef typename Facets::iterator Facet_list_iterator;
typedef std::size_t size_type;
typedef std::list<Cell_handle> Cells;
typedef typename Facets::iterator Facets_iterator;
typedef typename Cells::iterator Cells_iterator;
typedef Const_circulator_from_container<Facets> Facet_circulator;
typedef std::map <std::pair <Vertex_handle, Vertex_handle>,
@ -69,23 +62,38 @@ class Complex_2_in_triangulation_3 {
struct Not_in_complex {
bool operator()(const Facet& f) const
{
//assert(f.first < f.first->neighbor(f.second));
return ! f.first->is_facet_on_surface(f.second) ;
bool operator()(const Facet& f) const {
return ! f.first->is_facet_on_surface(f.second) ;
}
bool operator()(const Edge& e) const {
return face_status(e)== NOT_IN_COMPLEX;
}
bool operator()(Vertex_handle v) const
{
//return ! v->is_visited();
bool operator()(Vertex_handle v) const {
return ! v->is_in_complex();
}
};
struct Not_on_boundary_tester {
bool operator()(const Edge& e) const {
return face_status(e)!= BOUNDARY;
}
};
typedef typename Filter_iterator<Triangulation_3::Facet_iterator,
Not_in_complex> Facet_iterator;
typedef typename Filter_iterator<Triangulation_3::Edge_iterator,
Not_in_complex> Edge_iterator;
typedef typename Filter_iterator<Triangulation_3::Vertex_iterator,
Not_in_complex> Vertex_iterator;
typedef typename Filter_iterator<Triangulation_3::Edge_iterator,
Not_on_boundary_tester> Boundary_edges_iterator;
protected:
Triangulation_3& tr;
@ -319,13 +327,13 @@ size_type number_of_facets() const
Facets lof = typename Facets::list();
for (Facets_iterator it = lof1.begin();
for (Facet_list_iterator it = lof1.begin();
it != lof1.end();
it++) {
lof.push_back(*it);
}
for (Facets_iterator it = lof2.begin();
for (Facet_list_iterator it = lof2.begin();
it != lof2.end();
it++) {
lof.push_back(*it);
@ -502,6 +510,49 @@ size_type number_of_facets() const
}
}
}
Facet_iterator facets_begin(){
return filter_iterator(triangulation().finite_facets_begin(),
Not_in_complex());
}
Facet_iterator facets_end(){
return filter_iterator(triangulation().finite_facets_end(),
Not_in_complex());
}
Edge_iterator edges_begin(){
return filter_iterator(triangulation().finite_edges_begin(),
Not_in_complex());
}
Edge_iterator edges_end(){
return filter_iterator(triangulation().finite_edges_end(),
Not_in_complex());
}
Vertex_iterator vertices_begin(){
return filter_iterator(triangulation().finite_vertices_begin(),
Not_in_complex());
}
Vertex_iterator vertices_end(){
return filter_iterator(triangulation().finite_vertices_end(),
Not_in_complex());
}
Boundary_edges_iterator boundary_edges_begin() {
return filter_iterator(triangulation().finite_edges_begin(),
Not_on_boundary_tester);
}
Boundary_edges_iterator boundary_edges_end() {
return filter_iterator(triangulation().finite_edges_end(),
Not_on_boundary_tester);
}
}; // end Complex_2_in_triangulation_3
} // end namespace CGAL