[Gcblue-commits] gcb_wx/include/graphics ObjectUpdater.h,1.7,1.8 tc3DModel.h,1.16,1.17 tc3DWindow.h,
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:11
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/include/graphics Modified Files: ObjectUpdater.h tc3DModel.h tc3DWindow.h tcDisplaySettingsView.h tcGameView.h tcHookInfo.h tcMapObject.h tcMapView.h tcOOBView.h tcPopupControl.h tcTerrainView.h tcXmlWindow.h Log Message: namespace housekeeping Index: tcXmlWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcXmlWindow.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcXmlWindow.h 21 Oct 2004 04:10:58 -0000 1.4 --- tcXmlWindow.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 45,49 **** const wxPoint& pos, const wxSize& size, const wxString& configFile = "", ! const wxString& name = "StandardWindow"); virtual ~tcXmlWindow(); protected: --- 45,50 ---- const wxPoint& pos, const wxSize& size, const wxString& configFile = "", ! const wxString& name = "StandardWindow", ! tc3DWindow* graphicsHost = 0); virtual ~tcXmlWindow(); protected: Index: tcDisplaySettingsView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDisplaySettingsView.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDisplaySettingsView.h 2 Oct 2004 22:41:32 -0000 1.3 --- tcDisplaySettingsView.h 1 Jun 2005 00:13:26 -0000 1.4 *************** *** 31,35 **** ! #include "tcOptions.h" #include "tcXmlWindow.h" #include "tcSound.h" --- 31,35 ---- ! //#include "tcOptions.h" #include "tcXmlWindow.h" #include "tcSound.h" Index: tcOOBView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcOOBView.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcOOBView.h 11 Dec 2004 01:09:04 -0000 1.4 --- tcOOBView.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 37,48 **** #define MAX_OOB_OBJECTS 512 ! namespace MapView ! { ! class tcTacticalMapView; ! } class tcSimState; ! using namespace MapView; ! using namespace Database; struct tsOOBInfo --- 37,46 ---- #define MAX_OOB_OBJECTS 512 ! ! class tcTacticalMapView; ! class tcSimState; ! using namespace database; struct tsOOBInfo Index: ObjectUpdater.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/ObjectUpdater.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ObjectUpdater.h 6 Nov 2004 15:13:40 -0000 1.7 --- ObjectUpdater.h 1 Jun 2005 00:13:26 -0000 1.8 *************** *** 28,36 **** class tc3DViewer; class tcSimState; ! namespace Sensor ! { ! class tcSensorMap; ! } ! using Sensor::tcSensorMap; using osg::Node; using osg::NodeCallback; --- 28,33 ---- class tc3DViewer; class tcSimState; ! class tcSensorMap; ! using osg::Node; using osg::NodeCallback; Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tc3DModel.h 21 May 2005 02:00:27 -0000 1.16 --- tc3DModel.h 1 Jun 2005 00:13:26 -0000 1.17 *************** *** 47,55 **** //} ! namespace Sensor ! { ! class tcSensorMapTrack; ! } ! using Sensor::tcSensorMapTrack; /** --- 47,53 ---- //} ! ! class tcSensorMapTrack; ! /** Index: tcTerrainView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcTerrainView.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcTerrainView.h 16 Apr 2005 20:43:55 -0000 1.4 --- tcTerrainView.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 39,43 **** namespace osg { ! class Texture2D; } --- 39,43 ---- namespace osg { ! class Texture2D; } *************** *** 45,100 **** class tcOptions; ! namespace MapView { ! struct tsTerrainViewParameters ! { ! int mnSurfaceWidth; ! int mnSurfaceHeight; ! tcGeoRect mrectGeo; ! tcRect mrectDisplay; ! }; ! /** ! * Modified to use OSG. This constructs a textured image using map data and ! * uses it to draw a textured quad showing a color elevation map for the view ! * area. ! */ ! class tcTerrainView : public tc3DWindow ! { ! public: ! tcGeoRect mrectCurrentView; ! void Draw(); ! void GetViewParameters(tsTerrainViewParameters& vp); ! void AttachMapData(tcMapData *apMapData) {mpMapData = apMapData;} ! int LoadHighResSurface(); ! int LoadLowResSurface(); ! void Maximize(); ! void Minimize(); ! int RefreshSurfaces(); ///< reloads terrain data to map view ! int CreateSurfaces(); ! void SetActive(bool abActive); ! void SetDisplayRegion(tcRect& r); ! void SetView(tcGeoRect r); - tcTerrainView(wxWindow *parent, - const wxPoint& pos, const wxSize& size, - bool isHighRes, - const wxString& name = "TerrainView"); - ~tcTerrainView(); - private: - const bool highRes; - tcMapData* mpMapData; - tcOptions* mpOptions; - tcGeoRect mrectMap; ///< current borders of loaded map - tcRect displayRegion; ///< normalized coords [0, 1] to display on textured quad - tcRect displayRegionWrapped; ///< wrapped section for wrapped view - float wrapWidth; ///< 0-1.0 fraction of view for wrapped portion of map - bool isWrapped; ///< true if wrapped - osg::ref_ptr<osg::Texture2D> mapImage; - bool redraw; ///< true to redraw - }; - } #endif --- 45,99 ---- class tcOptions; ! ! struct tsTerrainViewParameters { ! int mnSurfaceWidth; ! int mnSurfaceHeight; ! tcGeoRect mrectGeo; ! tcRect mrectDisplay; ! }; ! /** ! * Modified to use OSG. This constructs a textured image using map data and ! * uses it to draw a textured quad showing a color elevation map for the view ! * area. ! */ ! class tcTerrainView : public tc3DWindow ! { ! public: ! tcGeoRect mrectCurrentView; ! void Draw(); ! void GetViewParameters(tsTerrainViewParameters& vp); ! void AttachMapData(tcMapData *apMapData) {mpMapData = apMapData;} ! int LoadHighResSurface(); ! int LoadLowResSurface(); ! void Maximize(); ! void Minimize(); ! int RefreshSurfaces(); ///< reloads terrain data to map view ! int CreateSurfaces(); ! void SetActive(bool abActive); ! void SetDisplayRegion(tcRect& r); ! void SetView(tcGeoRect r); ! ! tcTerrainView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! bool isHighRes, ! const wxString& name = "TerrainView"); ! ~tcTerrainView(); ! private: ! const bool highRes; ! tcMapData* mpMapData; ! tcOptions* mpOptions; ! tcGeoRect mrectMap; ///< current borders of loaded map ! tcRect displayRegion; ///< normalized coords [0, 1] to display on textured quad ! tcRect displayRegionWrapped; ///< wrapped section for wrapped view ! float wrapWidth; ///< 0-1.0 fraction of view for wrapped portion of map ! bool isWrapped; ///< true if wrapped ! osg::ref_ptr<osg::Texture2D> mapImage; ! bool redraw; ///< true to redraw ! }; #endif Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMapView.h 6 May 2005 23:57:15 -0000 1.18 --- tcMapView.h 1 Jun 2005 00:13:26 -0000 1.19 *************** *** 50,55 **** class tcMapOverlay; - namespace MapView - { #define MAXMAPOBJ 256 --- 50,53 ---- *************** *** 60,158 **** #define SYMBOLOGY_PATH "symbology\\" ! enum teSymbol ! { ! SYMBOL_UNKNOWN = 0, ! SYMBOL_SURFACE = 1, ! SYMBOL_SMALLSURFACE = 2, ! SYMBOL_LARGESURFACE = 3, ! SYMBOL_AIR = 4, ! SYMBOL_FIXEDWING = 5, ! SYMBOL_MISSILE = 6, ! SYMBOL_HELO = 7, ! SYMBOL_SUBSURFACE = 8, ! SYMBOL_SUBMARINE = 9, ! SYMBOL_TORPEDO = 10, ! SYMBOL_FIXED = 11, ! SYMBOL_MARK = 12, ! SYMBOL_SENSOR = 13, ! SYMBOL_TARGET = 14, ! SYMBOL_PIE = 15 ! }; #define MAX_SYMBOL 16 ! enum teSymbology ! { ! NTDS = 0, ! M2525 = 1 ! }; ! class tcMapObj ! { ! public: ! UCHAR mbExists; ! UCHAR mbFocus; ! unsigned int mnColor; ///< ARGB (ABGR?) color ! float mfHeading; ! float mfLon,mfLat; ! teSymbol meSymbol; ! teAffiliation meAffiliation; ! long mnID; ! float mfArc_deg; ///< for pie symbol ! float mfLonExtent; ///< for pie ! float mfLatExtent; ///< for pie ! bool isStaleTrack; ///< true for stale track ! bool isDestroyed; ///< true for destroyed track ! bool useAltered; ///< use altered symbol (e.g. for objects not controlled by player in multiplayer mode) ! UINT8 mnFlags; ! void Clear() ! { ! meAffiliation = UNKNOWN; ! meSymbol = SYMBOL_UNKNOWN; ! mbExists=0;mbFocus=0;mnColor=0;mfHeading=0;mfLon=0;mfLat=0;mnID=0; ! mnFlags = 0; ! isStaleTrack = false; ! isDestroyed = false; ! useAltered = false; ! } ! }; ! struct tsWorldMapObj ! { ! UCHAR mbExists; ! unsigned int mnColor; ! teAffiliation meAffiliation; ! float mfLon,mfLat; ! unsigned long mnID; ! void Clear() {mbExists=0;mnColor=0;mfLon=0;mfLat=0;mnID=0;} ! }; ! enum teMapCmdType ! { ! MC_NONE, ! MC_HEADING, ! MC_TARGET, ! MC_DATUM ! }; ! /* map symbol types */ ! /* ! #define SYMBOL_UNKNOWN 0 ! #define SYMBOL_SURFACE 1 ! #define SYMBOL_SMALLSURFACE 2 ! #define SYMBOL_LARGESURFACE 3 ! #define SYMBOL_AIR 4 ! #define SYMBOL_FIXEDWING 5 ! #define SYMBOL_MISSILE 6 ! #define SYMBOL_HELO 7 ! #define SYMBOL_SUBSURFACE 8 ! #define SYMBOL_SUBMARINE 9 ! #define SYMBOL_TORPEDO 10 ! #define SYMBOL_FIXED 11 ! #define SYMBOL_SENSOR 30 ! #define SYMBOL_TARGET 40 ! #define SYMBOL_PIE 50 ! */ #define CMD_DEACTIVATE 0 --- 58,156 ---- #define SYMBOLOGY_PATH "symbology\\" ! enum teSymbol ! { ! SYMBOL_UNKNOWN = 0, ! SYMBOL_SURFACE = 1, ! SYMBOL_SMALLSURFACE = 2, ! SYMBOL_LARGESURFACE = 3, ! SYMBOL_AIR = 4, ! SYMBOL_FIXEDWING = 5, ! SYMBOL_MISSILE = 6, ! SYMBOL_HELO = 7, ! SYMBOL_SUBSURFACE = 8, ! SYMBOL_SUBMARINE = 9, ! SYMBOL_TORPEDO = 10, ! SYMBOL_FIXED = 11, ! SYMBOL_MARK = 12, ! SYMBOL_SENSOR = 13, ! SYMBOL_TARGET = 14, ! SYMBOL_PIE = 15 ! }; #define MAX_SYMBOL 16 ! enum teSymbology ! { ! NTDS = 0, ! M2525 = 1 ! }; ! class tcMapObj ! { ! public: ! UCHAR mbExists; ! UCHAR mbFocus; ! unsigned int mnColor; ///< ARGB (ABGR?) color ! float mfHeading; ! float mfLon,mfLat; ! teSymbol meSymbol; ! teAffiliation meAffiliation; ! long mnID; ! float mfArc_deg; ///< for pie symbol ! float mfLonExtent; ///< for pie ! float mfLatExtent; ///< for pie ! bool isStaleTrack; ///< true for stale track ! bool isDestroyed; ///< true for destroyed track ! bool useAltered; ///< use altered symbol (e.g. for objects not controlled by player in multiplayer mode) ! UINT8 mnFlags; ! void Clear() ! { ! meAffiliation = UNKNOWN; ! meSymbol = SYMBOL_UNKNOWN; ! mbExists=0;mbFocus=0;mnColor=0;mfHeading=0;mfLon=0;mfLat=0;mnID=0; ! mnFlags = 0; ! isStaleTrack = false; ! isDestroyed = false; ! useAltered = false; ! } ! }; ! struct tsWorldMapObj ! { ! UCHAR mbExists; ! unsigned int mnColor; ! teAffiliation meAffiliation; ! float mfLon,mfLat; ! unsigned long mnID; ! void Clear() {mbExists=0;mnColor=0;mfLon=0;mfLat=0;mnID=0;} ! }; ! enum teMapCmdType ! { ! MC_NONE, ! MC_HEADING, ! MC_TARGET, ! MC_DATUM ! }; ! /* map symbol types */ ! /* ! #define SYMBOL_UNKNOWN 0 ! #define SYMBOL_SURFACE 1 ! #define SYMBOL_SMALLSURFACE 2 ! #define SYMBOL_LARGESURFACE 3 ! #define SYMBOL_AIR 4 ! #define SYMBOL_FIXEDWING 5 ! #define SYMBOL_MISSILE 6 ! #define SYMBOL_HELO 7 ! #define SYMBOL_SUBSURFACE 8 ! #define SYMBOL_SUBMARINE 9 ! #define SYMBOL_TORPEDO 10 ! #define SYMBOL_FIXED 11 ! #define SYMBOL_SENSOR 30 ! #define SYMBOL_TARGET 40 ! #define SYMBOL_PIE 50 ! */ #define CMD_DEACTIVATE 0 *************** *** 162,250 **** #define N_PENS 10 ! /** ! * Base class for tactical map and world map views ! */ ! class tcMapView : public tc3DWindow ! { ! public: ! // view parameters ! int mnXCenter,mnYCenter; ///< center pixel coords of map window ! tcGeoRect mrectCurrentView; ! tcGeoRect mrectViewBounds; ///< can't view outside of these ! float mfLonCenter,mfLatCenter; ///< coordinates of center of current view ! float mfLonWidth,mfLatWidth; ! float mfGridSize_rad; ! float mfGridBaseLon_rad,mfGridBaseLat_rad; ! float mfScaleX_pelprad; ///< map scale in X, pixels per radian ! float mfScaleX_radppel; ///< map scale in X, radians per pixel ! float mfScaleY_pelprad; ///< map scale in Y, pixels per radian ! float mfScaleY_radppel; ///< map scale in Y, radians per pixel ! std::vector<tcMapObject*> specialGraphics; ///< mission graphics display for now ! void AddMapObject(tcMapObject *obj); ! void ClearSpecialGraphics(); ! void AttachMapData(tcMapData *apMapData) ! { ! mpMapData=apMapData; ! terrainView->AttachMapData(apMapData); ! } ! void AttachOptions(tcOptions *apOptions) ! { ! mpOptions=apOptions; ! } ! void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} ! void CalcViewParameters(); ! virtual void Freeze(); ! tcPoint GeoToScreen(tcPoint pgeo); ! tcPoint GeoToScreen(float afLon, float afLat); ! float GeoExtentToScreen(float afExtent_rad); ! osg::Vec4 GetAffiliationColor(teAffiliation a); ! /* ! Gdiplus::Pen* GetPen() {return mpPen;} ! Gdiplus::Pen* GetPenThin() {return mpPenThin;} ! Gdiplus::SolidBrush* GetBrush() {return mpBrush;} ! Gdiplus::Font* GetFont() {return mpFont;} ! Gdiplus::Font* GetFontSmall() {return mpFontSmall;} ! */ ! int PointInView(tcPoint& p); ! void RefreshTerrainView() {terrainView->RefreshSurfaces();} ! tcPoint ScreenToGeo(wxPoint pscreen); ! 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); ! void SetViewBounds(tcGeoRect& r) {mrectViewBounds = r;} ! virtual void Thaw(); ! tcMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "MapView"); ! virtual ~tcMapView(); ! protected: ! WCHAR mzwchar[255]; ! tcCommandQueue *mpCommandInterface; ! tcMapData *mpMapData; ! tcOptions *mpOptions; ! tcTerrainView *terrainView; ! /* ! Gdiplus::Pen *mpPen; ///< GDI+ objects ! Gdiplus::Pen *mpPenThin; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; ! Gdiplus::Font *mpFontSmall; ! */ ! osg::Vec4 ConvertColor(unsigned int nColor); ! virtual void OnSize(wxSizeEvent& event); ! }; #define GAMEMODE_NORMAL 0 --- 160,248 ---- #define N_PENS 10 ! /** ! * Base class for tactical map and world map views ! */ ! class tcMapView : public tc3DWindow ! { ! public: ! // view parameters ! int mnXCenter,mnYCenter; ///< center pixel coords of map window ! tcGeoRect mrectCurrentView; ! tcGeoRect mrectViewBounds; ///< can't view outside of these ! float mfLonCenter,mfLatCenter; ///< coordinates of center of current view ! float mfLonWidth,mfLatWidth; ! float mfGridSize_rad; ! float mfGridBaseLon_rad,mfGridBaseLat_rad; ! float mfScaleX_pelprad; ///< map scale in X, pixels per radian ! float mfScaleX_radppel; ///< map scale in X, radians per pixel ! float mfScaleY_pelprad; ///< map scale in Y, pixels per radian ! float mfScaleY_radppel; ///< map scale in Y, radians per pixel ! std::vector<tcMapObject*> specialGraphics; ///< mission graphics display for now ! void AddMapObject(tcMapObject *obj); ! void ClearSpecialGraphics(); ! void AttachMapData(tcMapData *apMapData) ! { ! mpMapData=apMapData; ! terrainView->AttachMapData(apMapData); ! } ! void AttachOptions(tcOptions *apOptions) ! { ! mpOptions=apOptions; ! } ! void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} ! void CalcViewParameters(); ! virtual void Freeze(); ! tcPoint GeoToScreen(tcPoint pgeo); ! tcPoint GeoToScreen(float afLon, float afLat); ! float GeoExtentToScreen(float afExtent_rad); ! osg::Vec4 GetAffiliationColor(teAffiliation a); ! /* ! Gdiplus::Pen* GetPen() {return mpPen;} ! Gdiplus::Pen* GetPenThin() {return mpPenThin;} ! Gdiplus::SolidBrush* GetBrush() {return mpBrush;} ! Gdiplus::Font* GetFont() {return mpFont;} ! Gdiplus::Font* GetFontSmall() {return mpFontSmall;} ! */ ! int PointInView(tcPoint& p); ! void RefreshTerrainView() {terrainView->RefreshSurfaces();} ! tcPoint ScreenToGeo(wxPoint pscreen); ! 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); ! void SetViewBounds(tcGeoRect& r) {mrectViewBounds = r;} ! virtual void Thaw(); ! tcMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "MapView"); ! virtual ~tcMapView(); ! protected: ! WCHAR mzwchar[255]; ! tcCommandQueue *mpCommandInterface; ! tcMapData *mpMapData; ! tcOptions *mpOptions; ! tcTerrainView *terrainView; ! /* ! Gdiplus::Pen *mpPen; ///< GDI+ objects ! Gdiplus::Pen *mpPenThin; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; ! Gdiplus::Font *mpFontSmall; ! */ ! osg::Vec4 ConvertColor(unsigned int nColor); ! virtual void OnSize(wxSizeEvent& event); ! }; #define GAMEMODE_NORMAL 0 *************** *** 252,443 **** #define GAMEMODE_EDIT 2 ! /** ! * Tactical (theater) map with color elevation map ! */ ! class tcTacticalMapView : public tcMapView ! { ! public: ! tcMapObj maMapObj[MAXMAPOBJ]; ! UINT32 mnObjCount; ! bool mbBypassPythonCallback; ! int mnCounter; ! int mnGameMode; ! bool mbShowTrackID; ! float mfFrameRate; ! int mnScrollState; ! float mfScrollDirection; ! std::vector<long> hookedId; ///< vector of hooked obj ids ! UINT mnHookAlliance; ! float mfHookLon,mfHookLat; ! int mbMapCmdActive; ! teMapCmdType meMapCmd; ! wxPoint mpointMouse; ///< current location of mouse cursor ! tcPoint mpointGeoDatum; ///< for MC_DATUM map command to store user-selected location ! float mfMapCmdHeading; ! long mnMapCmdTarget; ! char mzMapCmdCallback[128]; ! int callbackParam; ! std::vector<long> callbackPlatformID; ///< platform ID vector for callback ! void UpdateNavPoints(std::vector<GeoPoint> *mpPoints); ! ! /// returns id of closest unit to <pscreen> within fixed dist or -1 if none ! long GetClosest(wxPoint pscreen); ! void GetMapCmdDatum(tcPoint& p) {p=mpointGeoDatum;} ! float GetMapCmdHeading() {return mfMapCmdHeading;} ! long GetMapCmdTarget() {return mnMapCmdTarget;} ! 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;} ! void Draw(); ! void DrawGrid(); ! void DrawScaleBar(); ! void DrawSelectionBox(); ! void DrawTerrainText(); ! void DrawMapCmd(tcMapObj *pMO, teMapCmdType type); ! void DrawNavPoints(); ! void DrawIndicator(int anType); ! void DrawSpecial(); ! size_t GetHookCount(); ! std::vector<long>& GetHookedGroup(); ! long GetHookID(size_t idx = 0); ! tcMapOverlay* GetMapOverlay() const; ! long Hook(wxPoint pscreen); ! void HookAnother(wxPoint pscreen); ! void HookGroup(wxRect& region); ! long HookSecondary(wxPoint pscreen); ! bool IsFirstHook(long id); ! bool IsHooked(long id); ! bool IsMapCmdActive() {return meMapCmd != MC_NONE;} ! void OnChar(wxKeyEvent& event); ! void OnLeaveWindow(wxMouseEvent& event); ! void OnLButtonDown(wxMouseEvent& event); ! void OnLButtonUp(wxMouseEvent& event); ! void OnLButtonDownMapCmd(wxPoint point); ! void OnMouseMove(wxMouseEvent& event); ! void OnMouseWheel(wxMouseEvent& event); ! void OnRButtonDown(wxMouseEvent& event); ! void OnSize(wxSizeEvent& event); ! void Refresh(); ! void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} ! void DeactivateCmd() {mbMapCmdActive=false; meMapCmd=MC_NONE;} ! 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); ! void SetGroupHook(std::vector<long>& hookedUnits); ! void SetTextLeftMargin(float x); ! void ToggleShowTrackTags() {mbShowTrackID = !mbShowTrackID;} ! void UpdateViewBounds() {mpMapData->GetTheaterArea(mrectViewBounds);} ! tcTacticalMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "TacticalMapView"); ! virtual ~tcTacticalMapView(); ! private: ! tcMapOverlay* overlay; ! std::string dateTime; ///< string with complete date/time ! WCHAR mzwchar[255]; ! std::vector<GeoPoint> maNavPointGeo; ! std::vector<tcPoint> maNavPointScreen; ! osg::ref_ptr<osg::Geometry> maSymbolA[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB[4][MAX_SYMBOL]; ! /// faded versions for stale tracks ! osg::ref_ptr<osg::Geometry> maSymbolA_fade[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB_fade[4][MAX_SYMBOL]; ! /// altered versions of symbols (e.g. objects not under control of player) ! osg::ref_ptr<osg::Geometry> maSymbolA_alt[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB_alt[4][MAX_SYMBOL]; ! teSymbology meSymbology; ! float mfSymbolXOffset, mfSymbolYOffset; ! bool isLButtonDown; ///< true if left mouse button is down while in window (dragging) ! wxPoint buttonDownPoint; ///< start point for click-drag operations ! float leftMargin; ///< screen position to use for info text and symbols ! void Build2525(); ! void BuildNTDS(); ! osg::Geometry* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Geometry* GetSymbolAltered(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Geometry* GetSymbolFaded(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Image* LoadSymbolImage(const char *azSymbolName); ! void AddArcPrimitive(osg::Geometry* symbol, osg::Vec3Array* vertices, ! float xc, float yc, float width, float height, ! float startAngle, float stopAngle, unsigned int nPoints); ! void CreateAlternateSymbols(); ! osg::Geometry* CreateSymbolGeometry(); ! osg::Geometry* CreateTexturedSymbol(const char* symbolName); ! osg::Geometry* DrawDefaultMark(teAffiliation affil); ! osg::Geometry* DrawNTDSSurface(teAffiliation affil); ! osg::Geometry* DrawNTDSGround(teAffiliation affil); ! osg::Geometry* DrawNTDSAirFW(teAffiliation affil); ! osg::Geometry* DrawNTDSAirRW(teAffiliation affil); ! osg::Geometry* DrawNTDSMissile(teAffiliation affil); ! osg::Geometry* DrawNTDSSubsurface(teAffiliation affil); ! osg::Geometry* DrawNTDSTorpedo(teAffiliation affil); ! osg::Geometry* DrawNTDSUnknown(teAffiliation affil); ! void DrawSymbol2(tcMapObj* pMO); ! //Gdiplus::Graphics* GetGraphicsFromImage(Gdiplus::Image* apImage); ! ! void UpdateScreenNavPoints(); ! }; ! /** ! * TODO move this class to separate file ! */ ! class tcWorldMapView : public tcMapView ! { ! public: ! tsWorldMapObj maMapObj[MAXWORLDMAPOBJ]; ! UINT32 mnObjCount; ! int mnCounter; ! void ChangeTheater(float lon_deg, float lat_deg); ! int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! void Draw(); ! void DrawGrid(); ! void DrawTheaterBox(); ! void OnChar(wxKeyEvent& event); ! void OnLButtonDown(wxMouseEvent& event); ! void OnMouseMove(wxMouseEvent& event); ! void OnRButtonDown(wxMouseEvent& event); ! void ClearMapObjects(); ! void Init(); ! virtual void SetActive(bool abActive); ! void SetTheater(tcGeoRect r) {mrectTheater = r;} ! void ToggleMapSize(); ! tcWorldMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "WorldMapView"); ! virtual ~tcWorldMapView(); ! private: ! WCHAR mzwchar[255]; ! wxPoint mpointMouse; ! tcGeoRect mrectTheater; ///< active theater view region - void DrawSymbol(tsWorldMapObj *pMO); - }; - } #endif --- 250,441 ---- #define GAMEMODE_EDIT 2 ! /** ! * Tactical (theater) map with color elevation map ! */ ! class tcTacticalMapView : public tcMapView ! { ! public: ! tcMapObj maMapObj[MAXMAPOBJ]; ! UINT32 mnObjCount; ! bool mbBypassPythonCallback; ! int mnCounter; ! int mnGameMode; ! bool mbShowTrackID; ! float mfFrameRate; ! int mnScrollState; ! float mfScrollDirection; ! std::vector<long> hookedId; ///< vector of hooked obj ids ! UINT mnHookAlliance; ! float mfHookLon,mfHookLat; ! int mbMapCmdActive; ! teMapCmdType meMapCmd; ! wxPoint mpointMouse; ///< current location of mouse cursor ! tcPoint mpointGeoDatum; ///< for MC_DATUM map command to store user-selected location ! float mfMapCmdHeading; ! long mnMapCmdTarget; ! char mzMapCmdCallback[128]; ! int callbackParam; ! std::vector<long> callbackPlatformID; ///< platform ID vector for callback ! void UpdateNavPoints(std::vector<GeoPoint> *mpPoints); ! /// returns id of closest unit to <pscreen> within fixed dist or -1 if none ! long GetClosest(wxPoint pscreen); ! void GetMapCmdDatum(tcPoint& p) {p=mpointGeoDatum;} ! float GetMapCmdHeading() {return mfMapCmdHeading;} ! long GetMapCmdTarget() {return mnMapCmdTarget;} ! 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;} ! void Draw(); ! void DrawGrid(); ! void DrawScaleBar(); ! void DrawSelectionBox(); ! void DrawTerrainText(); ! void DrawMapCmd(tcMapObj *pMO, teMapCmdType type); ! void DrawNavPoints(); ! void DrawIndicator(int anType); ! void DrawSpecial(); ! size_t GetHookCount(); ! std::vector<long>& GetHookedGroup(); ! long GetHookID(size_t idx = 0); ! tcMapOverlay* GetMapOverlay() const; ! long Hook(wxPoint pscreen); ! void HookAnother(wxPoint pscreen); ! void HookGroup(wxRect& region); ! long HookSecondary(wxPoint pscreen); ! bool IsFirstHook(long id); ! bool IsHooked(long id); ! bool IsMapCmdActive() {return meMapCmd != MC_NONE;} ! void OnChar(wxKeyEvent& event); ! void OnLeaveWindow(wxMouseEvent& event); ! void OnLButtonDown(wxMouseEvent& event); ! void OnLButtonUp(wxMouseEvent& event); ! void OnLButtonDownMapCmd(wxPoint point); ! void OnMouseMove(wxMouseEvent& event); ! void OnMouseWheel(wxMouseEvent& event); ! void OnRButtonDown(wxMouseEvent& event); ! void OnSize(wxSizeEvent& event); ! void Refresh(); ! void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} ! void DeactivateCmd() {mbMapCmdActive=false; meMapCmd=MC_NONE;} ! 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); ! void SetGroupHook(std::vector<long>& hookedUnits); ! void SetTextLeftMargin(float x); ! void ToggleShowTrackTags() {mbShowTrackID = !mbShowTrackID;} ! void UpdateViewBounds() {mpMapData->GetTheaterArea(mrectViewBounds);} ! tcTacticalMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "TacticalMapView"); ! virtual ~tcTacticalMapView(); ! private: ! tcMapOverlay* overlay; ! std::string dateTime; ///< string with complete date/time ! WCHAR mzwchar[255]; ! std::vector<GeoPoint> maNavPointGeo; ! std::vector<tcPoint> maNavPointScreen; ! osg::ref_ptr<osg::Geometry> maSymbolA[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB[4][MAX_SYMBOL]; ! /// faded versions for stale tracks ! osg::ref_ptr<osg::Geometry> maSymbolA_fade[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB_fade[4][MAX_SYMBOL]; ! /// altered versions of symbols (e.g. objects not under control of player) ! osg::ref_ptr<osg::Geometry> maSymbolA_alt[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB_alt[4][MAX_SYMBOL]; ! teSymbology meSymbology; ! float mfSymbolXOffset, mfSymbolYOffset; ! bool isLButtonDown; ///< true if left mouse button is down while in window (dragging) ! wxPoint buttonDownPoint; ///< start point for click-drag operations ! float leftMargin; ///< screen position to use for info text and symbols ! void Build2525(); ! void BuildNTDS(); ! osg::Geometry* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Geometry* GetSymbolAltered(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Geometry* GetSymbolFaded(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Image* LoadSymbolImage(const char *azSymbolName); ! void AddArcPrimitive(osg::Geometry* symbol, osg::Vec3Array* vertices, ! float xc, float yc, float width, float height, ! float startAngle, float stopAngle, unsigned int nPoints); ! void CreateAlternateSymbols(); ! osg::Geometry* CreateSymbolGeometry(); ! osg::Geometry* CreateTexturedSymbol(const char* symbolName); ! ! osg::Geometry* DrawDefaultMark(teAffiliation affil); ! osg::Geometry* DrawNTDSSurface(teAffiliation affil); ! osg::Geometry* DrawNTDSGround(teAffiliation affil); ! osg::Geometry* DrawNTDSAirFW(teAffiliation affil); ! osg::Geometry* DrawNTDSAirRW(teAffiliation affil); ! osg::Geometry* DrawNTDSMissile(teAffiliation affil); ! osg::Geometry* DrawNTDSSubsurface(teAffiliation affil); ! osg::Geometry* DrawNTDSTorpedo(teAffiliation affil); ! osg::Geometry* DrawNTDSUnknown(teAffiliation affil); ! void DrawSymbol2(tcMapObj* pMO); ! //Gdiplus::Graphics* GetGraphicsFromImage(Gdiplus::Image* apImage); ! void UpdateScreenNavPoints(); ! }; ! /** ! * TODO move this class to separate file ! */ ! class tcWorldMapView : public tcMapView ! { ! public: ! tsWorldMapObj maMapObj[MAXWORLDMAPOBJ]; ! UINT32 mnObjCount; ! int mnCounter; ! void ChangeTheater(float lon_deg, float lat_deg); ! int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! void Draw(); ! void DrawGrid(); ! void DrawTheaterBox(); ! void OnChar(wxKeyEvent& event); ! void OnLButtonDown(wxMouseEvent& event); ! void OnMouseMove(wxMouseEvent& event); ! void OnRButtonDown(wxMouseEvent& event); ! void ClearMapObjects(); ! void Init(); ! virtual void SetActive(bool abActive); ! void SetTheater(tcGeoRect r) {mrectTheater = r;} ! void ToggleMapSize(); ! tcWorldMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "WorldMapView"); ! virtual ~tcWorldMapView(); ! ! private: ! WCHAR mzwchar[255]; ! wxPoint mpointMouse; ! tcGeoRect mrectTheater; ///< active theater view region ! ! void DrawSymbol(tsWorldMapObj *pMO); ! }; #endif Index: tcMapObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcMapObject.h 8 May 2005 23:27:55 -0000 1.9 --- tcMapObject.h 1 Jun 2005 00:13:26 -0000 1.10 *************** *** 43,50 **** class tcUpdateStream; ! namespace MapView ! { ! class tcMapView; ! } namespace osg { --- 43,48 ---- class tcUpdateStream; ! class tcMapView; ! namespace osg { *************** *** 72,76 **** void SetMarkerActive(bool active) {markerEnabled = active;} void SetUseScreenCoords(bool active) {useRelativeCoords = active;} ! static void SetMapView(MapView::tcMapView *mv); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); --- 70,74 ---- void SetMarkerActive(bool active) {markerEnabled = active;} void SetUseScreenCoords(bool active) {useRelativeCoords = active;} ! static void SetMapView(tcMapView *mv); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); *************** *** 86,90 **** static osg::ref_ptr<osg::Geometry> marker; ! static MapView::tcMapView *mapView; ///< used to translate lat/lon coords into screen coords static void LoadMarker(); --- 84,88 ---- static osg::ref_ptr<osg::Geometry> marker; ! static tcMapView *mapView; ///< used to translate lat/lon coords into screen coords static void LoadMarker(); Index: tcPopupControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcPopupControl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcPopupControl.h 11 Dec 2004 01:09:04 -0000 1.4 --- tcPopupControl.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 38,42 **** ! namespace ScriptInterface { class tcSimPythonInterface; --- 38,42 ---- ! namespace scriptinterface { class tcSimPythonInterface; *************** *** 45,49 **** class tcCommandQueue; ! using namespace ScriptInterface; enum teMenuMode --- 45,49 ---- class tcCommandQueue; ! using namespace scriptinterface; enum teMenuMode Index: tcGameView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcGameView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcGameView.h 2 Oct 2004 22:41:32 -0000 1.1 --- tcGameView.h 1 Jun 2005 00:13:26 -0000 1.2 *************** *** 40,49 **** class tcGameObject; ! namespace MapView ! { ! class tcTacticalMapView; ! class tcWorldMapView; ! enum teSymbol; ! } enum teAffiliation; --- 40,47 ---- class tcGameObject; ! class tcTacticalMapView; ! class tcWorldMapView; ! enum teSymbol; ! enum teAffiliation; *************** *** 57,61 **** #endif - using namespace MapView; /** --- 55,58 ---- *************** *** 111,115 **** void AddTruthTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, teAffiliation aeAffiliation); void AddSensorTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, double afStatusTime); ! MapView::teSymbol GetMapSymbolByClassification(int anClassification); void OnMouseMove3D(UINT nFlags, wxPoint point); int OnMouseWheel3D(UINT nFlags, short zDelta, wxPoint point); --- 108,112 ---- void AddTruthTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, teAffiliation aeAffiliation); void AddSensorTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, double afStatusTime); ! teSymbol GetMapSymbolByClassification(int anClassification); void OnMouseMove3D(UINT nFlags, wxPoint point); int OnMouseWheel3D(UINT nFlags, short zDelta, wxPoint point); Index: tcHookInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcHookInfo.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcHookInfo.h 6 Nov 2004 15:13:40 -0000 1.4 --- tcHookInfo.h 1 Jun 2005 00:13:26 -0000 1.5 *************** *** 38,52 **** class tcSimState; class tcGameObject; ! namespace Database { class tcDatabaseObject; } - namespace Sensor - { - class tcSensorMapTrack; - } ! using namespace Database; #ifndef tnPoolIndex --- 38,51 ---- class tcSimState; class tcGameObject; + class tcSensorMapTrack; ! namespace database { class tcDatabaseObject; } ! ! ! using namespace database; #ifndef tnPoolIndex *************** *** 86,91 **** //Gdiplus::Font *mpFont, *mpFontLarge; ! void DrawTrackEngaged( ! const Sensor::tcSensorMapTrack *smtrack, float& x, float& y); void GetFunctionalName(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); --- 85,89 ---- //Gdiplus::Font *mpFont, *mpFontLarge; ! void DrawTrackEngaged(const tcSensorMapTrack *smtrack, float& x, float& y); void GetFunctionalName(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tc3DWindow.h 31 Mar 2005 03:51:11 -0000 1.14 --- tc3DWindow.h 1 Jun 2005 00:13:26 -0000 1.15 *************** *** 173,177 **** bool IsSurfaceModified(); virtual bool IsWindowMinimized() const; ! void LoadBackgroundImage(char* fileName); static osg::Image* LoadImage(const char* fileName); static osg::Texture2D* LoadTexture(const char* fileName); --- 173,177 ---- bool IsSurfaceModified(); virtual bool IsWindowMinimized() const; ! void LoadBackgroundImage(const char* fileName); static osg::Image* LoadImage(const char* fileName); static osg::Texture2D* LoadTexture(const char* fileName); |