Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation


Chronological Thread 
  • From: Per Zetterlund <>
  • To:
  • Subject: Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation
  • Date: Fri, 7 Nov 2014 08:59:39 +0100

Hi Adam,

It's defined in Triangulation_3.h (line 395 in my system).
Docs is here:

http://doc.cgal.org/latest/Triangulation_3/classCGAL_1_1Triangulation__3.html#a8330f902e49d6280b4a6a498fa4d925a

/Per


On Fri, Nov 7, 2014 at 8:41 AM, Adam Getchell
<>
wrote:
> Hi Per,
>
> Wow! That compiles! Now I’m confused. Where is tds() defined?
>
> I had been using the Tds from the:
>
> typedef CGAL::Triangulation_data_structure_3<Vb> Tds;
>
> Also, I looked at the documentation and realized I could delete vertices,
> so I was doing:
>
> for(size_t i = 0; i < 4; i++)
> {
> /// Remove all vertices in the invalid cell
> D3->remove(cit->vertex(i));
> }
>
> Thank you for your answer, sorry about the further question!
>
> Adam Getchell
> about.me/adamgetchell
>
>> On Nov 6, 2014, at 11:31 PM, Per Zetterlund
>> <>
>> wrote:
>>
>> Hi Adam,
>>
>> I'm didn't test run it on my computer, but
>>
>> D3->tds().delete_cell(cit);
>>
>> compiles for me.
>>
>> /Per
>>
>>
>> On Fri, Nov 7, 2014 at 5:12 AM, Adam Getchell
>> <>
>> wrote:
>>> Hello all,
>>>
>>> I have a function on a Delaunay triangulation which checks the validity of
>>> my cells. I want to call TriangulationDataStructure_3::delete_cell(). How
>>> do
>>> I do that?
>>>
>>> First, I tried just doing Tds::delete_cell(cit);
>>>
>>> But that gives a “call to non-static member function without an object
>>> argument”.
>>>
>>> Next, I tried calling the superclass method from the subclass:
>>>
>>> typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
>>> /// Used so that each timeslice is assigned an integer
>>> typedef CGAL::Triangulation_3<K> Triangulation;
>>> typedef CGAL::Triangulation_vertex_base_with_info_3<unsigned, K> Vb;
>>> typedef CGAL::Triangulation_data_structure_3<Vb> Tds;
>>> typedef CGAL::Delaunay_triangulation_3<K, Tds> Delaunay;
>>> typedef Delaunay::Vertex_handle Vertex_handle;
>>> typedef Delaunay::Locate_type Locate_type;
>>> typedef Delaunay::Point Point;
>>>
>>> inline bool check_timeslices(Delaunay* D3) {
>>> Delaunay::Finite_cells_iterator cit;
>>> for(cit = D3->finite_cells_begin(); cit != D3->finite_cells_end();
>>> ++cit)
>>> {
>>> /// Get the vertices from the cell
>>> //Delaunay::Facet& face = *(cit->first);
>>> // Vertex_handle vs = cit->source();
>>> if (cit->is_valid())
>>> {
>>> std::cout << "Cell is valid." << std::endl;
>>> }
>>> else
>>> {
>>> D3->Tds::delete_cell(cit);
>>> std::cout << "Invalid cell destroyed." << std::endl;
>>> }
>>> }
>>> assert(D3->is_valid());
>>> return true;
>>> }
>>>
>>> It looks like delete_cell is a private function not callable from
>>> subclasses. I get:
>>>
>>> [ 12%] Building CXX object CMakeFiles/cdt.dir/src/cdt.cpp.o
>>> In file included from /Users/adam/CDT-plusplus/src/cdt.cpp:22:
>>> /Users/adam/CDT-plusplus/src/S3Triangulation.h:59:13: error: 'Tds' is a
>>> private
>>> member of 'CGAL::Triangulation_3<CGAL::Epick,
>>>
>>> CGAL::Triangulation_data_structure_3<CGAL::Triangulation_vertex_base_with_info_3<unsigned
>>> int, CGAL::Epick, CGAL::Triangulation_vertex_base_3<CGAL::Epick,
>>> CGAL::Triangulation_ds_vertex_base_3<void> > >,
>>> CGAL::Triangulation_ds_cell_base_3<void>, CGAL::Sequential_tag>,
>>> CGAL::Default>'
>>> D3->Tds::delete_cell(cit);
>>> ^
>>> /usr/local/include/CGAL/Triangulation_3.h:375:83: note: implicitly
>>> declared
>>> private here
>>> ...Triangulation_cell_base_3<GT> > >::type Tds;
>>> ^
>>> In file included from /Users/adam/CDT-plusplus/src/cdt.cpp:22:
>>> /Users/adam/CDT-plusplus/src/S3Triangulation.h:59:18: error:
>>>
>>> 'CGAL::Triangulation_data_structure_3<CGAL::Triangulation_vertex_base_with_info_3<unsigned
>>> int, CGAL::Epick, CGAL::Triangulation_vertex_base_3<CGAL::Epick,
>>> CGAL::Triangulation_ds_vertex_base_3<void> > >,
>>> CGAL::Triangulation_ds_cell_base_3<void>,
>>> CGAL::Sequential_tag>::delete_cell' is not a member of class
>>> 'Delaunay'
>>> (aka 'Delaunay_triangulation_3<K, Tds>')
>>> D3->Tds::delete_cell(cit);
>>>
>>>
>>> Adam Getchell
>>> about.me/adamgetchell
>>>
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>
>>
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>



Archive powered by MHonArc 2.6.18.

Top of Page