i am using CGAL to calculate intersections between 3d triangles. I need to verify if the intersections return points or lines or triangles.
typedef CGAL::Cartesian<double> tc;
typedef tc::Triangle_3 Triangle3;
CGAL::cpp11::result_of<tc::Intersect_3(Triangle3,Triangle3)>::type
resultL1 = CGAL::intersection(*t_3,*tLado1_3);
if (resultL1){ // LINE 110
boost::apply_visitor(Intersection_visitor(), *resultL1); // LINE 111
}
Intersection visitor:
template<typename R>
struct Intersection_visitor {
typedef void result_type;
void operator()(const Point3<R>& p) const{
// handle point
}
void operator()(const Segment_3<R>& s) const{
// handle segment
}
void operator()(const Triangle3<R>& t) const{
// handle triangle
}
};
This is giving me two erros:
TextureManager.cpp:110: error: invalid type argument of unary '*' (have 'bool')
and
TextureManager.cpp:111: error: could not convert 'resultL1' from 'CGAL::cpp11::result_of<CGAL::CommonKernelFunctors::Intersect_3<CGAL::Cartesian<double> >(CGAL::Triangle_3<CGAL::Cartesian<double> >, CGAL::Triangle_3<CGAL::Cartesian<double> >)>::type {aka CGAL::Object}' to 'bool'
Does someone knoe how to fix these?
According to the manual page you are missing a possible type for the operator() in the visitor. The following example compiles fine.