00001 /* 00002 * MapArea.h 00003 * Copyright (C) Eduardo Wiputra 2009 <ewiputra@users.sourceforge.net> 00004 * 00005 * MapArea.h is free software: you can redistribute it and/or modify it 00006 * under the terms of the GNU General Public License as published by the 00007 * Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * MapArea.h is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 * See the GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #ifndef MapArea_H 00020 #define MapArea_H 00021 00022 #include <gtkmm.h> 00023 00024 #include "MainWindow.h" 00025 #include "uvsim/guidance/FlightPlan.h" 00026 00027 namespace uvsim 00028 { 00029 00030 // Forward declarations 00031 class MainWindow; 00032 00056 class MapArea : public Gtk::DrawingArea 00057 { 00058 public: 00064 MapArea(BaseObjectType* cobject, 00065 const Glib::RefPtr<Gtk::Builder>& glade); 00066 00072 bool on_expose_event(GdkEventExpose* event); 00076 void drawInitial(); 00081 void draw(std::vector<GeoCoord> waypoint); 00086 void drawRedCircle(GeoCoord waypoint); 00091 void drawRedCircle(std::vector<GeoCoord> waypoint); 00095 Glib::RefPtr<Gdk::Pixbuf> image; 00099 Cairo::RefPtr<Cairo::Context> cr; 00103 double m_zoom; 00107 double m_panUD; 00111 double m_panLR; 00115 double relative_originX; 00119 double relative_originY; 00123 double relative_endX; 00127 double relative_endY; 00131 double scaleX; 00135 double scaleY; 00139 std::vector<GeoCoord> waypoint; 00143 FlightPlan * flightPlan; 00144 private: 00148 const Glib::RefPtr<Gtk::Builder> & m_glade; 00154 virtual bool on_motion_notify_event(GdkEventMotion* event); 00160 virtual bool on_button_press_event(GdkEventButton* event); 00164 double relative_x; 00168 double relative_y; 00172 MainWindow * m_pMainWindow; 00173 }; 00174 } 00175 #endif 00176 00177 // vim:ts=2:sw=2