contrib/brl/bbas/bgui/bgui_bmrf_soview2D.h
Go to the documentation of this file.
00001 // This is brl/bbas/bgui/bgui_bmrf_soview2D.h
00002 #ifndef bgui_bmrf_soview2D_h_
00003 #define bgui_bmrf_soview2D_h_
00004 //--------------------------------------------------------------------------------
00005 //:
00006 // \file
00007 // \brief vgui_soview2D objects for bmrf classes
00008 // \author Matt Leotta (mleotta@lems.brown.edu)
00009 // \date January 23, 2004
00010 //
00011 // \verbatim
00012 //  Modifications
00013 //   <none yet>
00014 // \endverbatim
00015 //--------------------------------------------------------------------------------
00016 
00017 #include <vcl_iosfwd.h>
00018 
00019 #include <bseg/bmrf/bmrf_epi_seg_sptr.h>
00020 #include <bseg/bmrf/bmrf_epipole.h>
00021 #include <vgui/vgui_soview2D.h>
00022 
00023 //: This is a soview2D for a bmrf_epi_seg with a smart pointer back to the bmrf_epi_seg
00024 class bgui_bmrf_epi_seg_soview2D : public vgui_soview2D
00025 {
00026  public:
00027   //: Constructor - creates a default view
00028   bgui_bmrf_epi_seg_soview2D( bmrf_epi_seg_sptr const & seg,
00029                               const bmrf_epipole& epipole = bmrf_epipole(),
00030                               bool intensity = false);
00031 
00032   //: Destructor
00033   ~bgui_bmrf_epi_seg_soview2D();
00034 
00035   //: Render the bmrf_epi_seg on the display.
00036   virtual void draw() const;
00037 
00038   //: Print details about this bmrf_epi_seg to the given stream.
00039   virtual vcl_ostream& print(vcl_ostream&) const;
00040 
00041   //: Returns the type of this class ('dbgui_bmrf_epi_seg_soview2D').
00042   vcl_string type_name() const { return "bgui_bmrf_epi_seg_soview2D"; }
00043 
00044   //: Returns the distance squared from this epi_seg to the given position.
00045   virtual float distance_squared(float x, float y) const;
00046 
00047   //: Returns the centroid of this epi_seg.
00048   void get_centroid(float* x, float* y) const;
00049 
00050   //: Translate this soview2D by the given x and y distances.
00051   virtual void translate(float x, float y);
00052 
00053   //: Returns a smart pointer to the segment
00054   bmrf_epi_seg_sptr seg_sptr() const { return seg_sptr_; }
00055 
00056   vgui_soview2D_image* make_intensity_view(const bmrf_epipole& epipole) const;
00057 
00058  protected:
00059   //: Smart pointer to a bmrf_epi_seg
00060   bmrf_epi_seg_sptr seg_sptr_;
00061 
00062   vgui_soview2D_image* intensity_view_;
00063 };
00064 
00065 
00066 #endif // bgui_bmrf_soview2D_h_