Subject: CGAL users discussion list
List archive
- From: Adam Getchell <>
- To:
- Subject: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation
- Date: Thu, 6 Nov 2014 20:12:42 -0800
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
about.me/adamgetchell
- [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Adam Getchell, 11/07/2014
- Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Per Zetterlund, 11/07/2014
- Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Adam Getchell, 11/07/2014
- Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Per Zetterlund, 11/07/2014
- Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Adam Getchell, 11/07/2014
- Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Per Zetterlund, 11/07/2014
- Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Adam Getchell, 11/07/2014
- <Possible follow-up(s)>
- [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Adam Getchell, 11/07/2014
- Re: [cgal-discuss] Calling delete_cell() on a Delaunay triangulation, Per Zetterlund, 11/07/2014
Archive powered by MHonArc 2.6.18.