Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

bgui_roi_tableau_make_roi.h

Go to the documentation of this file.
00001 #ifndef bgui_roi_tableau_make_roi_h_
00002 #define bgui_roi_tableau_make_roi_h_
00003 //:
00004 // \file
00005 // \author  Marko Bacic (u97mb@robots.ox.ac.uk)
00006 // \brief a region of interest associated to an image tableau.
00007 //
00008 // \verbatim
00009 //  Modifications
00010 //   Marko Bacic    AUG-2000  Initial version.
00011 //   Peter Vanroose AUG-2004  Moved into separate file
00012 // \endverbatim
00013 
00014 #include <bgui/bgui_image_tableau.h>
00015 #include <vgui/vgui_rubberband_tableau.h>
00016 
00017 class bgui_roi_tableau_make_roi : public vgui_rubberband_client
00018 {
00019   bool done_;
00020   bgui_image_tableau_sptr image_tableau_;
00021  public:
00022   bool is_done() const { return done_; }
00023 
00024   bgui_roi_tableau_make_roi(bgui_image_tableau_sptr const& imt)
00025    : done_(false), image_tableau_(imt)  {}
00026 
00027   void add_box(float x0,float y0,float x1,float y1)
00028   {
00029     inline void swap(float& a, float& b) { float t=a; a=b; b=t; }
00030     if (x0<x1) swap(x0,x1);
00031     if (y0<y1) swap(y0,y1);
00032     image_tableau_->set_roi(x1,y1,x0-x1,y0-y1);
00033     done_ = true;
00034   }
00035 };
00036 
00037 #endif // bgui_roi_tableau_make_roi_h_

Generated on Thu Jan 10 14:52:11 2008 for contrib/brl/bbas/bgui by  doxygen 1.4.4