contrib/brl/bseg/segv/segv_misc_manager.h
Go to the documentation of this file.
00001 #ifndef segv_misc_manager_h_
00002 #define segv_misc_manager_h_
00003 //--------------------------------------------------------------------------------
00004 //:
00005 // \file
00006 // \brief Manager for segmentation algorithm execution and display
00007 // \author
00008 //   J.L. Mundy
00009 //
00010 // \verbatim
00011 //  Modifications:
00012 //   J.L. Mundy November 18, 2002    Initial version.
00013 // \endverbatim
00014 //---------------------------------------------------------------------------
00015 
00016 #include <vcl_vector.h>
00017 #include <vil/vil_image_resource.h>
00018 #include <vsol/vsol_line_2d_sptr.h>
00019 #include <vsol/vsol_conic_2d_sptr.h>
00020 #include <vsol/vsol_polyline_2d_sptr.h>
00021 #include <vtol/vtol_edge_2d_sptr.h>
00022 #include <vsol/vsol_point_2d_sptr.h>
00023 #include <vtol/vtol_intensity_face_sptr.h>
00024 #include <vtol/vtol_face_2d_sptr.h>
00025 #include <vgui/vgui_wrapper_tableau.h>
00026 #include <vgui/vgui_style.h>
00027 #include <vgui/vgui_style_sptr.h>
00028 #include <vgui/vgui_grid_tableau_sptr.h>
00029 #include <vgui/vgui_range_map_params_sptr.h>
00030 #include <bgui/bgui_picker_tableau_sptr.h>
00031 #include <bgui/bgui_vtol2D_tableau_sptr.h>
00032 #include <bgui/bgui_image_tableau_sptr.h>
00033 #include <bgui/bgui_bargraph_clipon_tableau_sptr.h>
00034 #include <bgui/bgui_graph_tableau_sptr.h>
00035 #include <bgui/bgui_graph_tableau.h>
00036 
00037 class vgui_window;
00038 
00039 class segv_misc_manager : public vgui_wrapper_tableau
00040 {
00041  public:
00042   segv_misc_manager();
00043   ~segv_misc_manager();
00044   static segv_misc_manager *instance();
00045   void quit();
00046   void load_image();
00047   void save_image();
00048 #if 0
00049   //: visualization
00050   void set_range_params();
00051   void inline_viewer();
00052   void intensity_profile();
00053   void intensity_histogram();
00054 #endif
00055 
00056  //:utilities
00057   void clear_display();
00058   void clear_all();
00059   void init();
00060 #if 0
00061   void remove_image();
00062   void convert_to_grey();
00063 #endif
00064   //:debug and development routines
00065   void project_on_subm();
00066   void project_on_articulation();
00067   //: access to the window
00068   vgui_window* get_window(){return win_;}
00069   void set_window(vgui_window* win){win_=win;}
00070 
00071  protected:
00072   void draw_edges(vcl_vector<vtol_edge_2d_sptr>& edges, bool verts=false);
00073   void draw_lines(vcl_vector<vsol_line_2d_sptr> const & line_segs,
00074                   const vgui_style_sptr& style = NULL);
00075 
00076   void draw_conics(vcl_vector<vsol_conic_2d_sptr> const & conic_segs,
00077                   const vgui_style_sptr& style = NULL);
00078 
00079   void draw_polylines(vcl_vector<vsol_polyline_2d_sptr> const & polys,
00080                       vgui_style_sptr style=(vgui_style*)0);
00081   void draw_regions(vcl_vector<vtol_intensity_face_sptr>& regions,
00082                     bool verts=false);
00083   void draw_points(vcl_vector<vsol_point_2d_sptr> const & points,
00084                    const vgui_style_sptr& style);
00085 
00086   void set_selected_grid_image(vil_image_resource_sptr const& image,
00087                                vgui_range_map_params_sptr const& rmps =0);
00088 
00089   void add_image_at(vil_image_resource_sptr const& image,
00090                     const unsigned col, const unsigned row,
00091                     vgui_range_map_params_sptr const& rmps = 0);
00092 
00093   void add_image(vil_image_resource_sptr const& image,
00094                  vgui_range_map_params_sptr const& rmps =0);
00095 
00096   vil_image_resource_sptr selected_image();
00097   vil_image_resource_sptr image_at(const unsigned col, const unsigned row);
00098   bool
00099   set_image_at(const unsigned col, const unsigned row, vil_image_resource_sptr const& image);
00100   bgui_image_tableau_sptr selected_image_tab();
00101   bgui_vtol2D_tableau_sptr vtol2D_tab_at(const unsigned col,const unsigned row);
00102   bgui_vtol2D_tableau_sptr selected_vtol2D_tab();
00103   bgui_picker_tableau_sptr selected_picker_tab();
00104   vtol_face_2d_sptr face_at(const int col, const int row);
00105   vgui_range_map_params_sptr range_params(vil_image_resource_sptr const& image);
00106  private:
00107   //flags
00108   bool first_; //first image load
00109   vgui_window* win_;
00110   vgui_grid_tableau_sptr grid_;
00111   vtol_face_2d_sptr foreground_face_;
00112   vtol_face_2d_sptr background_face_;
00113   bgui_bargraph_clipon_tableau_sptr bargraph_;
00114   static segv_misc_manager *instance_;
00115 };
00116 
00117 #endif // segv_misc_manager_h_