Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Problem with std::map for Cell_handle and Finite_cells_iterator

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Problem with std::map for Cell_handle and Finite_cells_iterator


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Problem with std::map for Cell_handle and Finite_cells_iterator
  • Date: Mon, 26 Sep 2011 09:15:55 +0200

The code written seems correct, there is probably a problem somewhere
else. Are you modifying the triangulation once the map initialization
is done?

If you want to have direct access to the info, you can add an
int as info in a cell and use a vector to access information.

Sebastien.

Noura wrote:
Hi,
I am using Triangulation_3 and I have problems using a std::map with
Finite_cells_iterator and Cell_handle. Until now I have been using
seamlessly the iterator as a Cell_handle but for the map it doesn't work.

To fill the map I go over the cells with the iterator and compute the
information:

std::map&lt;Cell_handle, Information&gt; information_map;
for(Finite_cells_iterator cit = delaunay.finite_cells_begin(); cit !=
delaunay.finite_cells_end() ; ++cit){
...
information_map[cit] = cell_info;
... }
Then I use the locate function to get the cells and I want to get the
information stored in the map:
Cell_handle ch = delaunay.locate(point, locate_type, li, lj, start); if(locate_type != OUTSIDE_CONVEX_HULL && locate_type !=
OUTSIDE_AFFINE_HULL){
...
Information i = information_map[ch];
...
}

But the information the I get is the default of the map, I have done several
tests with the std::find() function and the Cell_handle is not found. I
wanted to avoid using triangulation_with_info because I have big meshes and
I want to limit the memory footprint.

It works for a map built with Finite_vertices_iterator and the look up done
with Vertex_handle. How can I make it work for the cells?

Thank you for your attention, Noura

--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Problem-with-std-map-for-Cell-handle-and-Finite-cells-iterator-tp3837136p3837136.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.16.

Top of Page