00001 #ifndef CEP_INTERSECTION_TRIANGLE_3_POINT_3_H
00002 #define CEP_INTERSECTION_TRIANGLE_3_POINT_3_H
00003
00004
00005 #include <CGAL/Triangle_3.h>
00006 #include <CGAL/Point_3.h>
00007
00008
00009 namespace CEP { namespace intersection {
00010
00012
00017 template <class R>
00018 inline bool
00019 coplanar_do_intersect( const CGAL::Triangle_3<R>& triangle,
00020 const CGAL::Point_3<R>& point )
00021 {
00022 CGAL_exactness_precondition( !triangle.is_degenerate() );
00023 CGAL_exactness_precondition
00024 ( CGAL::coplanar( triangle[0], triangle[1], triangle[2], point ) );
00025
00026 return
00027 CGAL::coplanar_orientation( triangle[0],triangle[1],triangle[2],
00028 point ) != CGAL::NEGATIVE
00029 && CGAL::coplanar_orientation( triangle[1],triangle[2],triangle[0],
00030 point ) != CGAL::NEGATIVE
00031 && CGAL::coplanar_orientation( triangle[2],triangle[0],triangle[1],
00032 point ) != CGAL::NEGATIVE;
00033 }
00034
00035
00037
00041 template <class R>
00042 inline bool
00043 do_intersect( const CGAL::Triangle_3<R>& triangle,
00044 const CGAL::Point_3<R>& point )
00045 {
00046 CGAL_exactness_precondition( !triangle.is_degenerate() );
00047 return CGAL::coplanar( triangle[0], triangle[1], triangle[2], point )
00048 && coplanar_do_intersect( triangle, point );
00049 }
00050
00051 }
00052 }
00053
00054
00055 #endif
00056