Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Linear Cell Complex and Iterators

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Linear Cell Complex and Iterators


Chronological Thread 
  • From: Guillaume Damiand <>
  • To:
  • Subject: Re: [cgal-discuss] Linear Cell Complex and Iterators
  • Date: Mon, 22 Apr 2013 22:09:49 +0200

Hi Jérémie,

Le 22/04/2013 16:52, jdumas a écrit :
Hi there.

I'm using the Linear Cell Complex from CGAL those days, hence the recurring
subject in my email topics =).

Great ! Feel free to send more bug reports ;)


This time I'm trying to create a wrapper
around the Range provided by the Combinatorial Map Package so that I can use
them direcectly with other parts of CGAL (for exemple, CGAL::bounded_side_2
or CGAL::Polytope_distance_d). I've come up with something that seem to work
rather nicely. However there are some issues caused by a destructor being
called at some point albeit I don't really have a clue on how to address the
problem.

This is a bug in Cell_iterators.h; try the patch attached it works for me (some marks that are not shared).

Tell me if it is ok for you now.

Regards
Guillaume

PS: I didn't have the time yet to solve your previous problem. It is still in my todo list.


So, the minimal problematic test code and CMakeLists.txt are here:
http://pastebin.com/afny1jBh
http://pastebin.com/aZeT7zKD

Don't forget to type cmake twice so that the Debug flag gets used.
Configuration is the same as in my previous mail (cgal 4.2, etc.).


Best,
Jérémie.



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Linear-Cell-Complex-and-Iterators-tp4657253.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



--
===================================================================
Guillaume DAMIAND

CNRS, LIRIS UMR 5205
Université Claude Bernard
Bâtiment Nautibus (710)
43 Boulevard du 11 Novembre 1918
69622 Villeurbanne Cedex (France)
-------------------------------------------------------------------
Phone: +33 (0)4.72.43.26.62 Fax: +33 (0)4.72.43.15.36
Mail:

===================================================================

diff --git a/Combinatorial_map/include/CGAL/Cell_iterators.h b/Combinatorial_map/include/CGAL/Cell_iterators.h
index a9a38c1..71958a6 100644
--- a/Combinatorial_map/include/CGAL/Cell_iterators.h
+++ b/Combinatorial_map/include/CGAL/Cell_iterators.h
@@ -112,7 +112,10 @@ namespace CGAL {
     CMap_cell_iterator(const Self& aiterator):
       Ite(aiterator),
       mcell_mark_number(aiterator.mcell_mark_number)
-    { this->mmap->share_a_mark(this->mcell_mark_number); }
+    {
+      this->mmap->share_a_mark(this->mmark_number);
+      this->mmap->share_a_mark(this->mcell_mark_number);
+    }
 
     /// Assignment operator.
     Self& operator=(const Self& aiterator)
@@ -120,6 +123,7 @@ namespace CGAL {
       if (this != &aiterator)
       {
         Ite::operator=(aiterator);
+        this->mmap->share_a_mark(this->mmark_number);
         this->mmap->share_a_mark(mcell_mark_number);
       }
       return *this;
@@ -201,7 +205,7 @@ namespace CGAL {
       mmark_number(amap.get_new_mark())
     {
       CGAL_static_assertion( (boost::is_same<typename Ite::Basic_iterator,
-                              Tag_true>::value) );      
+                              Tag_true>::value) );
       CGAL_assertion(amap.is_whole_map_unmarked(mmark_number));
       mark_cell<Map,i,dim>(amap, adart, mmark_number);
     }



Archive powered by MHonArc 2.6.18.

Top of Page