RadarView.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 //
00003 //  REGCOM: Regimental Command
00004 //  Copyright (C) 2008 Randi J. Relander
00005 //    <rjrelander@users.sourceforge.net>
00006 //
00007 //  This program is free software; you can redistribute it and/or
00008 //  modify it under the terms of the GNU General Public License
00009 //  as published by the Free Software Foundation; either version 3
00010 //  of the License, or (at your option) any later version.
00011 //  
00012 //  This program is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU General Public License for more details.
00016 //  
00017 //  You should have received a copy of the GNU General Public
00018 //  License along with this program.  If not, see 
00019 //  <http://www.gnu.org/licenses/>.
00020 //  
00021 //**********************************************************************
00022 
00023 #ifndef REGCOM_CLIENT_RADAR_VIEW_H
00024 #define REGCOM_CLIENT_RADAR_VIEW_H
00025 
00026 // PROJECT INCLUDES
00027 #include "regcom/gui/Window.h"
00028 #include "regcom/gui/Rect.h"
00029 #include "regcom/gui/Point.h"
00030 #include "regcom/gui/Surface.h"
00031 
00032 #include "regcom/common/Map.h"
00033 
00034 // NAMESPACES
00035 namespace regcom {
00036 namespace client {
00037 
00038 // FORWARD REFERENCES
00039 class MapView;
00040 class Console;
00041 
00043 //  CLASS: RadarView
00049 class RadarView : public gui::Window
00050 {
00051 public:
00052 
00053     // PUBLIC METHODS
00054 
00056     RadarView();
00057 
00059     virtual ~RadarView();
00060 
00062     virtual void Draw(gui::Rect rect);
00063 
00065     void SetConsole(Console* pConsole);
00066 
00068     void SetMapView(MapView* pView);
00069 
00071     void ScanMap(regcom::common::Map* pMap);
00072 
00074     void SetCursor(gui::Rect& rect);
00075 
00077     virtual void OnMouseMove(gui::Point point);
00078 
00080     virtual void OnMouseDown(int n, gui::Point point);
00081 
00083     virtual void OnMouseUp(int n, gui::Point point);
00084 
00085 protected:
00086 
00087     // PROTECTED METHODS
00088 
00090     void DrawMargins(gui::Rect rect);
00091 
00093     void DrawMap(gui::Rect rect);
00094 
00096     void DrawCursor(gui::Rect rect);
00097 
00099     void PixelScanMap(regcom::common::Map* pMap);
00100 
00102     void BlitScanMap(regcom::common::Map* pMap);
00103 
00104 private:
00105 
00106     // MEMBER VARIABLES
00107 
00109     Console* m_pConsole;
00110 
00112     MapView* m_pMapView;
00113 
00115     gui::Point m_ViewportPos;
00116     
00118     gui::Rect m_Cursor;
00119 
00121     gui::Surface* m_pImage;
00122 
00124     bool m_Dragging;
00125 
00127     gui::Point m_DragCorner;
00128 
00130     gui::Rect m_VisibleRect;
00131 };
00132 
00133 } // namespace client
00134 } // namespace regcom
00135 
00136 #endif