#include <iostream>
 
#include <CGAL/Simple_cartesian.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
 
typedef K::FT FT;
typedef K::Point_3 Point;
typedef K::Segment_3 Segment;
 
template <class Kernel, class FaceGraph>
 
  
  
  Tree tree( faces(graph).first, faces(graph).second, graph);
 
  
  Segment segment_query(p,q);
  std::cout << tree.number_of_intersected_primitives(segment_query)
      << " intersections(s) with triangle" << std::endl;
 
  assert( tree.number_of_intersected_primitives(segment_query)== 1 );
 
  
 
  std::cerr << "closest point is: " << closest << std::endl;
}
 
int main()
{
  Point p(1.0, 0.0, 0.0);
  Point q(0.0, 1.0, 0.0);
  Point r(0.0, 0.0, 1.0);
  Point s(0.0, 0.0, 0.0);
  Polyhedron polyhedron;
  polyhedron.make_tetrahedron(p, q, r, s);
 
  run<K>(polyhedron);
  return EXIT_SUCCESS;
}
Primitive type for a facet of a polyhedral surface.
Definition: AABB_face_graph_triangle_primitive.h:75
This traits class handles any type of 3D geometric primitives provided that the proper intersection t...
Definition: AABB_traits_3.h:172
Static data structure for efficient intersection and distance computations in 2D and 3D.
Definition: AABB_tree.h:57