From the CGAL documentation, one can create an alpha_shape_2 from a Delaunay triangulation:
CGAL::Alpha_shape_2< Dt, ExactAlphaComparisonTag >::Alpha_shape_2(Dt& dt, FT alpha = 0, Mode m = GENERAL)
However the operation destroys the triangulation.
In my problem I have a bunch of points which are triangulated. I need to identify the "right" triangles using the alpha shape algorithm. I already computed that myself from the delaunay triangulation (computing the circumcircle radius myself and so on), since I did not find a way to extract the remaining triangles from alpha_shape_2 (I can extract the edges of the alpha shape but not the inner triangles). Is it only possible using CGAL ?
For example in matlab (ouch) one can do:
shp = alphaShape(points.x,points.y);
shp.Alpha = alpha;
tri = alphaTriangulation(shp);
bf = boundaryFacets(shp);
Side question: what is the definition of the alpha value of cgal ? Mine is : r_c/h>alpha, where r_c is the triangle circumcircle radius and h and size parameter?
For the side question see this section. About your initial question I'm not sure to understand precisely what you want to get but you can iterate all the triangles and get their classification using the following code:
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Alpha_shape_2.h>
#include <CGAL/Alpha_shape_vertex_base_2.h>
#include <CGAL/Alpha_shape_face_base_2.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT;
typedef K::Point_2 Point;
typedef CGAL::Alpha_shape_vertex_base_2<K> Vb;
typedef CGAL::Alpha_shape_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
typedef CGAL::Delaunay_triangulation_2<K,Tds> Triangulation_2;
typedef CGAL::Alpha_shape_2<Triangulation_2> Alpha_shape_2;
int main()
{
std::vector<Point> points;
double alpha;
Alpha_shape_2 A(points.begin(), points.end(),
alpha,
Alpha_shape_2::GENERAL);
for (Alpha_shape_2::Finite_faces_iterator fit=A.finite_faces_begin();
fit!=A.finite_faces_end();++fit)
{
switch(A.classify(fit))
{
case Alpha_shape_2::REGULAR:
break;
case Alpha_shape_2::SINGULAR:
break;
case Alpha_shape_2::EXTERIOR:
break;
case Alpha_shape_2::INTERIOR:
break;
}
}
return 0;
}