00001
00002
00003 #ifndef _GFM_FOCUSER_HPP_
00004 #define _GFM_FOCUSER_HPP_
00005
00006 #include <geom/Rectangle.hpp>
00007
00008 namespace jafar {
00009 namespace gfm {
00013 class MatchFocus {
00014 public:
00015 virtual ~MatchFocus() {}
00019 virtual bool isFocused(double x, double y ) const = 0;
00024 virtual void initFocus(double x, double y ) = 0;
00025 virtual MatchFocus* clone() = 0;
00026 };
00030 class WindowMatchFocus : public MatchFocus {
00031 public:
00036 WindowMatchFocus(double halfWidth, double halfHeight);
00037 virtual ~WindowMatchFocus();
00038 virtual bool isFocused(double x, double y ) const ;
00039 virtual void initFocus(double x, double y );
00040 virtual MatchFocus* clone() { return new WindowMatchFocus(*this); }
00041 private:
00042 geom::RectangleDouble searchwindow;
00043 double m_halfWidth, m_halfHeight, m_width, m_height;
00044 };
00045 }
00046 }
00047
00048 #endif