[Gcblue-commits] gcb_wx/include/sim tcObjectControl.h,1.7,1.8
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-02 04:24:07
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8917/include/sim Modified Files: tcObjectControl.h Log Message: A few more changes related to GDI+ replacement Index: tcObjectControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcObjectControl.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcObjectControl.h 17 Aug 2004 02:22:56 -0000 1.7 --- tcObjectControl.h 2 Nov 2004 04:23:55 -0000 1.8 *************** *** 1,6 **** ! /* ! ** tcObjectControl.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcObjectControl.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 28,35 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif ! #include "tcWindow.h" #include "commandlist.h" #include "aerror.h" --- 28,32 ---- #include "wx/wx.h" ! #include "tc3DWindow.h" #include "commandlist.h" #include "aerror.h" *************** *** 44,52 **** class tcSimState; - class tcOptions; class tcUserInfo; class tcGameObject; namespace Database { --- 41,53 ---- class tcSimState; class tcOptions; class tcUserInfo; class tcGameObject; + namespace osg + { + class Geometry; + } + namespace Database { *************** *** 66,70 **** bool mbMouseOver; float mfMouseHeading_rad; ! Gdiplus::RectF mrectArc; float mfxcenter; float mfycenter; --- 67,71 ---- bool mbMouseOver; float mfMouseHeading_rad; ! tcRect mrectArc; float mfxcenter; float mfycenter; *************** *** 76,81 **** bool mbMouseOver; bool mbVertical; ! Gdiplus::RectF mrectcontrol; ///< control area ! Gdiplus::RectF mrectbar; float mfmaxvalue; float mfminvalue; --- 77,82 ---- bool mbMouseOver; bool mbVertical; ! tcRect mrectcontrol; ///< control area ! tcRect mrectbar; float mfmaxvalue; float mfminvalue; *************** *** 91,137 **** }; - class tcButtonPanel - { - public: - float mfxloc, mfyloc; // upper-left coords - unsigned mnRows, mnColumns; - tcString mstrTitle; - tcString mastrCaption[MAX_PANELROWS][N_PANELBUTTONS]; - Gdiplus::RectF mar[MAX_PANELROWS][N_PANELBUTTONS]; - teButtonState maButtonState[MAX_PANELROWS][N_PANELBUTTONS]; - - void Init(int anPanelType); - void Draw(Gdiplus::Graphics *apGraphics); - void DrawButton(Gdiplus::Graphics *apGraphics, const Gdiplus::RectF& rectf, - const char* azCaption, teButtonState aeState); - bool ButtonContainingPoint(wxPoint point, int& rnRow, int& rnColumn); - void GetRect(Gdiplus::RectF& r); - void SetCaption(char *caption, unsigned row, unsigned button); - tcButtonPanel(); - ~tcButtonPanel(); - private: - Gdiplus::Pen *mpPen; - Gdiplus::SolidBrush *mpBrush; - Gdiplus::Font *mpFont; - }; - class tcAIPanel { public: ! Gdiplus::RectF window; std::string mzCaption; void SetAIData(tcAIData *apAIData) {mpAIData = apAIData;} ! void SetLocation(Gdiplus::RectF rect) {window = rect;} ! void Draw(Gdiplus::Graphics *apGraphics); tcAIPanel(); ~tcAIPanel(); private: ! tcAIData *mpAIData; ! Gdiplus::Pen *mpPen; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; }; #define MAX_OCSYMBOLS 8 ///< symbols to be drawn on map, move this feature out of tcObjectControl eventually --- 92,137 ---- }; class tcAIPanel { public: ! tcRect window; std::string mzCaption; void SetAIData(tcAIData *apAIData) {mpAIData = apAIData;} ! void SetLocation(tcRect rect) {window = rect;} ! void Draw(tc3DWindow* context); tcAIPanel(); ~tcAIPanel(); private: ! tcAIData* mpAIData; }; + + + class tcButtonPanel + { + public: + float mfxloc, mfyloc; // upper-left coords + unsigned mnRows, mnColumns; + tcString mstrTitle; + tcString mastrCaption[MAX_PANELROWS][N_PANELBUTTONS]; + tcRect mar[MAX_PANELROWS][N_PANELBUTTONS]; + teButtonState maButtonState[MAX_PANELROWS][N_PANELBUTTONS]; + float fontSize; + + void Init(int anPanelType); + void Draw(tc3DWindow* context); + void DrawButton(tc3DWindow* context, const tcRect& rectf, + const char* azCaption, teButtonState aeState); + bool ButtonContainingPoint(wxPoint point, int& rnRow, int& rnColumn); + void GetRect(tcRect& r); + void SetCaption(char *caption, unsigned row, unsigned button); + tcButtonPanel(); + ~tcButtonPanel(); + private: + }; + + + #define MAX_OCSYMBOLS 8 ///< symbols to be drawn on map, move this feature out of tcObjectControl eventually *************** *** 151,159 **** }; ! class tcObjectControl : public tcWindow { public: ! int Draw(void); ! void AttachOptions(tcOptions *apOptions) {mpOptions = apOptions;} void AttachSimState(tcSimState *apSS) {mpSS=apSS;} void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} --- 151,161 ---- }; ! /** ! * Old code, needs refactoring ! */ ! class tcObjectControl : public tc3DWindow { public: ! void Draw(); void AttachSimState(tcSimState *apSS) {mpSS=apSS;} void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} *************** *** 178,184 **** tcUserInfo *mpUserInfo; ///< info on which alliance user belongs to for truth view/control tnPoolIndex mnHookID, mnPreviousHookID; ! Gdiplus::Pen *mpPen; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont,*mpFontLarge; tcButtonPanel mcWeaponPanel; tcButtonPanel mcSensorPanel; --- 180,184 ---- tcUserInfo *mpUserInfo; ///< info on which alliance user belongs to for truth view/control tnPoolIndex mnHookID, mnPreviousHookID; ! tcButtonPanel mcWeaponPanel; tcButtonPanel mcSensorPanel; *************** *** 192,212 **** int mnSensors; tsOCSymbolList msOCSymbolList; ! void DrawAltitudeObject(Gdiplus::Graphics *apGraphics, float afAltitude_m); ! void DrawBarObject(Gdiplus::Graphics *apGraphics, tsBarObjectInfo *apBOI, float afValue, float afValueGoal); ! void DrawButton(Gdiplus::Graphics *apGraphics, const Gdiplus::RectF& rectf, char* azCaption, teButtonState aeState); ! void DrawEngagementInfo(Gdiplus::Graphics *apGraphics); ! void DrawFireControl(Gdiplus::Graphics *apGraphics); ! void DrawFormationControl(Gdiplus::Graphics *apGraphics); ! void DrawFuelInfo(Gdiplus::Graphics *apGraphics); ! void DrawHeadingObject(Gdiplus::Graphics *apGraphics, tsHeadingObjectInfo *apHOI, float afHeading_rad, float afHeadingGoal_rad); ! void DrawLandingInfo(Gdiplus::Graphics *graphics); ! void DrawSensorControl(Gdiplus::Graphics *apGraphics); void InitControls(); ! void UpdateControlObjects(void); ! void UpdateSymbolList(void); void GetObjectInfo(tcString& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); }; --- 192,215 ---- int mnSensors; tsOCSymbolList msOCSymbolList; + osg::ref_ptr<osg::Geometry> headingCircle; + osg::ref_ptr<osg::Geometry> headingCircleLight; ! void CreateHeadingCircles(); ! void DrawAltitudeObject(float afAltitude_m); ! void DrawBarObject(tsBarObjectInfo *apBOI, float afValue, float afValueGoal); ! void DrawButton(const tcRect& rectf, char* azCaption, teButtonState aeState); ! void DrawEngagementInfo(); ! void DrawFireControl(); ! void DrawFormationControl(); ! void DrawFuelInfo(); ! void DrawHeadingObject(tsHeadingObjectInfo *apHOI, float afHeading_rad, float afHeadingGoal_rad); ! void DrawLandingInfo(); ! void DrawSensorControl(); void InitControls(); ! void UpdateControlObjects(); ! void UpdateSymbolList(); void GetObjectInfo(tcString& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); }; |