How can I use an inherited class of a triangulation in the context of a triangulation in CGAL?
Basically I have the following code:
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_with_info_2<int,K> Vb;
typedef CGAL::Triangulation_face_base_with_info_2<int,K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
typedef CGAL::Delaunay_triangulation_2<K,Tds> Delaunay;
typedef CGAL::Triangulation_2<K,Tds> Triangulation;
typedef Triangulation::Point Point;
...
Triangulation *t = new Delaunay;
...
// x and y are properly defined and instantiated
t->insert(Point(x,y));
Well, of course, Delaunay_triangulation_2 inherits from Triangulation_2
So, when I execute this code, the linking is done against the Triangulation_2 class, in other words, it does not executes a delaunay triangulation, instead it executes a normal triangulation (executing the parent class methods instead of the child methods).
I think this is because the insert method of Triangulation_2 is not declared as virtual so redefinitions won't work.
Do you know a way around this? Maybe using Constrained_triangulation_2 and Constrained_delaunay_triangulation_2? (those classes define some virtual methods, but i've read the source code and I don't think they can be used without adding the explicit constraints)
Any ideas?