[Gcblue-commits] gcb_wx/include/graphics tcMapOverlay.h,NONE,1.1 tc3DWindow.h,1.13,1.14 tcMapObject.
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:21
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/include/graphics Modified Files: tc3DWindow.h tcMapObject.h tcMapView.h Added Files: tcMapOverlay.h Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: tcMapObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMapObject.h 21 Oct 2004 04:10:58 -0000 1.7 --- tcMapObject.h 31 Mar 2005 03:51:11 -0000 1.8 *************** *** 33,50 **** #include "simmath.h" #include <osg/Vec4> ! /** ! * Windows GDI+ library TO BE REPLACED with a cross-platform library ! * or cross-platform wrapper. ! */ ! namespace Gdiplus ! { ! class Graphics; ! } namespace MapView { class tcMapView; } /** --- 33,49 ---- #include "simmath.h" + #include <osg/ref_ptr> #include <osg/Vec4> ! class tc3DWindow; ! namespace MapView { class tcMapView; } + namespace osg + { + class Geometry; + } /** *************** *** 62,66 **** bool isActive; ! virtual void Draw(); osg::Vec4 GetColor() const {return color;} void SetActive(bool active) {isActive = active;} --- 61,65 ---- bool isActive; ! virtual void Draw(tc3DWindow* host); osg::Vec4 GetColor() const {return color;} void SetActive(bool active) {isActive = active;} *************** *** 78,82 **** --- 77,84 ---- tcPoint GetScreenPoint() const; + static osg::ref_ptr<osg::Geometry> marker; static MapView::tcMapView *mapView; ///< used to translate lat/lon coords into screen coords + + static void LoadMarker(); private: bool useRelativeCoords; ///< interpret lat_rad and lon_rad as rel screen coords [0-1] *************** *** 93,100 **** std::string caption; ///< text to display ! virtual void Draw(); tcMapTextObject(); ! tcMapTextObject(std::string text, double x, double y, bool useRel = false); virtual ~tcMapTextObject(); }; --- 95,102 ---- std::string caption; ///< text to display ! virtual void Draw(tc3DWindow* host); tcMapTextObject(); ! tcMapTextObject(const std::string& text, double x, double y, bool useRel = false); virtual ~tcMapTextObject(); }; Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tc3DWindow.h 20 Feb 2005 21:54:31 -0000 1.13 --- tc3DWindow.h 31 Mar 2005 03:51:11 -0000 1.14 *************** *** 215,218 **** --- 215,219 ---- const int rectRenderBin; const int textRenderBin; + const int geometryRenderBin; *************** *** 282,286 **** osg::ref_ptr<osg::Geode> backgroundRoot; ///< root node for background graphics osg::ref_ptr<osg::Geode> lineRoot; ///< root node for lines and rectangle graphics ! osg::ref_ptr<osgText::Text> referenceText; ///< text to make size measurements with --- 283,287 ---- osg::ref_ptr<osg::Geode> backgroundRoot; ///< root node for background graphics osg::ref_ptr<osg::Geode> lineRoot; ///< root node for lines and rectangle graphics ! osg::ref_ptr<osgText::Text> referenceText; ///< text to make size measurements with --- NEW FILE: tcMapOverlay.h --- /** ** @file tcMapOverlay.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _MAPOVERLAY_H_ #define _MAPOVERLAY_H_ #if _MSC_VER > 1000 #pragma once #endif #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" //for MS Windows specific definitions #endif #include "tc3DWindow.h" namespace osg { class Image; class Geometry; } class tcMapObject; /** * Class intended to draw map objects on top of map. * Example uses are to mark geopolitical borders, cities, and * items of interest for current scenario. */ class tcMapOverlay : public tc3DWindow { public: void AddMapObject(tcMapObject *obj); void ClearMapObjects(); void Draw(); /// declared public here to allow parent MapView to call void OnSize(wxSizeEvent& event); /// redraw overlay during next call to Draw() void Redraw(); tcMapOverlay(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "MapOverlay"); virtual ~tcMapOverlay(); private: std::vector<tcMapObject*> overlayObjects; // objects to draw /// used to redraw (create and add objects to scenegraph) only when necessary bool redraw; }; #endif Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcMapView.h 19 Mar 2005 15:31:08 -0000 1.16 --- tcMapView.h 31 Mar 2005 03:51:11 -0000 1.17 *************** *** 48,51 **** --- 48,52 ---- class tcMapData; class tcMapObject; + class tcMapOverlay; namespace MapView *************** *** 211,217 **** tcPoint ScreenToGeo(float x, float y); virtual void SetActive(bool abActive); ///< overrides base class ! void SetBaseRenderBin(int n); void SetSize(const wxRect& rect); ! void SetView(tcPoint center, float afLonSpan); void SetViewCenterZoom(wxPoint pscreen, float afZoom); //void SetWindow(RECT& r); --- 212,218 ---- tcPoint ScreenToGeo(float x, float y); virtual void SetActive(bool abActive); ///< overrides base class ! virtual void SetBaseRenderBin(int n); void SetSize(const wxRect& rect); ! virtual void SetView(tcPoint center, float afLonSpan); void SetViewCenterZoom(wxPoint pscreen, float afZoom); //void SetWindow(RECT& r); *************** *** 292,295 **** --- 293,297 ---- void SetMapCmdCallback(const char *azCallback, const std::vector<long>& id, int param = -1); void SetMousePoint(wxPoint point) {mpointMouse = point;} // used to be TranslatePoint(point); + void SetView(tcPoint center, float afLonSpan); void ScrollMap(float afDirection_deg); void ClearMapCmd() {meMapCmd = MC_NONE;} *************** *** 307,310 **** --- 309,313 ---- std::vector<long>& GetHookedGroup(); long GetHookID(size_t idx = 0); + tcMapOverlay* GetMapOverlay() const; long Hook(wxPoint pscreen); void HookAnother(wxPoint pscreen); *************** *** 322,325 **** --- 325,329 ---- void OnMouseWheel(wxMouseEvent& event); void OnRButtonDown(wxMouseEvent& event); + void OnSize(wxSizeEvent& event); void Refresh(); void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} *************** *** 327,330 **** --- 331,336 ---- void ClearMapObjects(); void Init(); + void SetActive(bool abActive); ///< overrides base class + void SetBaseRenderBin(int n); void SetDateTime(const std::string& s) {dateTime = s;} void SetHookID(long id); *************** *** 340,343 **** --- 346,350 ---- private: + tcMapOverlay* overlay; std::string dateTime; ///< string with complete date/time WCHAR mzwchar[255]; *************** *** 350,353 **** --- 357,361 ---- osg::ref_ptr<osg::Geometry> maSymbolB_fade[4][MAX_SYMBOL]; + teSymbology meSymbology; float mfSymbolXOffset, mfSymbolYOffset; |