00001 // This is core/vgl/algo/vgl_convex_hull_2d.h 00002 #ifndef vgl_convex_hull_2d_h_ 00003 #define vgl_convex_hull_2d_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Compute the convex hull of a 2-d point set 00010 // 00011 // \verbatim 00012 // Modifications 00013 // July 13 2004 - J.L. Mundy - Converted to vgl interface 00014 // from code by Ken Clarkson (see .txx file for details) 00015 // \endverbatim 00016 00017 #include <vcl_vector.h> 00018 #include <vgl/vgl_point_2d.h> 00019 #include <vgl/vgl_polygon.h> 00020 00021 template <class T> 00022 class vgl_convex_hull_2d 00023 { 00024 public: 00025 vgl_convex_hull_2d (vcl_vector<vgl_point_2d<T> > const& points); 00026 ~vgl_convex_hull_2d () {} 00027 vgl_polygon<T> hull(); 00028 private: 00029 vgl_convex_hull_2d(); 00030 bool hull_valid_; 00031 void compute_hull(); 00032 vcl_vector<vgl_point_2d<T> > points_; 00033 vgl_polygon<T> hull_; 00034 }; 00035 00036 #define VGL_CONVEX_HULL_2D_INSTANTIATE(T) extern "please include vgl/algo/vgl_convex_hull_2d.txx first" 00037 00038 #endif