[Gcblue-commits] gcb_wx/include/sim tcSubObject.h,NONE,1.1 tcESMSensor.h,1.6,1.7 tcGameObject.h,1.26
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:32:42
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/include/sim Modified Files: tcESMSensor.h tcGameObject.h tcLauncherState.h tcMissileObject.h tcObjectControl.h tcOpticalSensor.h tcRadar.h tcSensorState.h tcUserInfo.h Added Files: tcSubObject.h Log Message: Text message "message center" GUI screen Index: tcUserInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcUserInfo.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcUserInfo.h 8 Aug 2004 00:31:33 -0000 1.5 --- tcUserInfo.h 23 Nov 2004 23:30:50 -0000 1.6 *************** *** 33,43 **** #endif class tcUserInfo { public: UINT8 mnOwnAlliance; ! int IsOwnAlliance(UINT anAlliance); ! UINT8 GetOwnAlliance(void); void SetOwnAlliance(UINT alliance) {mnOwnAlliance = alliance;} tcUserInfo(); --- 33,46 ---- #endif + /** + * + */ class tcUserInfo { public: UINT8 mnOwnAlliance; ! int IsOwnAlliance(UINT anAlliance) const; ! UINT8 GetOwnAlliance() const; void SetOwnAlliance(UINT alliance) {mnOwnAlliance = alliance;} tcUserInfo(); --- NEW FILE: tcSubObject.h --- /** ** @file tcSubObject.h */ /* Copyright (C) 2004 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 _SUBOBJECT_H_ #define _SUBOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tcPlatformObject.h" #include "tcCommandObject.h" class tcUpdateStream; class tcCommandStream; /** * Models air object that can land */ class tcSubObject : public tcPlatformObject { public: tcGenericDBObject* mpDBObject; virtual void ApplyRestrictions(); virtual void Clear(); virtual void RandInitNear(float afLon_deg, float afLat_deg); virtual void UpdateClimb(float dt_s); virtual void Update(double afStatusTime); void PrintToFile(tcFile& file); void SaveToFile(tcFile& file); void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); float GetPeriscopeDepth() const; bool GetPeriscopeState() const; bool GetRadarMastState() const; bool IsAtPeriscopeDepth() const; bool IsSurfaced() const; void SetPeriscopeState(bool state); void SetRadarMastState(bool state); virtual tcCommandStream& operator<<(tcCommandStream& stream); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcCommandStream& operator>>(tcCommandStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); virtual void ClearNewCommand(); virtual bool HasNewCommand() const; virtual bool HasUnacknowledgedCommand() const; tcSubObject(); tcSubObject(tcSubObject&); tcSubObject(tcGenericDBObject *obj); virtual ~tcSubObject(); protected: tcCommandObject commandObj; const float maxPitch_rad; bool radarMastRaised; bool periscopeRaised; float periscopeDepth_m; ///< periscope depth (positive number) virtual void UpdateEffects(); virtual void UpdateHeading(float dt_s); virtual void UpdateSensors(double t); virtual void UpdateSpeed(float dt_s); }; #endif Index: tcObjectControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcObjectControl.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcObjectControl.h 2 Nov 2004 04:23:55 -0000 1.8 --- tcObjectControl.h 23 Nov 2004 23:30:49 -0000 1.9 *************** *** 44,51 **** class tcUserInfo; class tcGameObject; namespace osg { ! class Geometry; } --- 44,52 ---- class tcUserInfo; class tcGameObject; + class tcControl; namespace osg { ! class Geometry; } *************** *** 65,93 **** struct tsHeadingObjectInfo { ! bool mbMouseOver; ! float mfMouseHeading_rad; ! tcRect mrectArc; ! float mfxcenter; ! float mfycenter; ! float mfradius; }; struct tsBarObjectInfo { ! bool mbMouseOver; ! bool mbVertical; ! tcRect mrectcontrol; ///< control area ! tcRect mrectbar; ! float mfmaxvalue; ! float mfminvalue; ! float mfmousevalue; }; enum teButtonState { ! BS_DISABLED, ! BS_READYING, ! BS_READY, ! BS_ACTIVE }; --- 66,94 ---- struct tsHeadingObjectInfo { ! bool mbMouseOver; ! float mfMouseHeading_rad; ! tcRect mrectArc; ! float mfxcenter; ! float mfycenter; ! float mfradius; }; struct tsBarObjectInfo { ! bool mbMouseOver; ! bool mbVertical; ! tcRect mrectcontrol; ///< control area ! tcRect mrectbar; ! float mfmaxvalue; ! float mfminvalue; ! float mfmousevalue; }; enum teButtonState { ! BS_DISABLED, ! BS_READYING, ! BS_READY, ! BS_ACTIVE }; *************** *** 95,108 **** { 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; }; --- 96,109 ---- { 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; }; *************** *** 112,132 **** { 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: }; --- 113,133 ---- { 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: }; *************** *** 138,216 **** struct tsOCSymbolList { ! struct ! { ! float mfLat_rad; ! float mfLon_rad; ! float mfLatExtent_rad; ! float mfLonExtent_rad; ! float mfArcCenter_deg; ! float mfArcLength_deg; ! UINT32 mnColor; ! } maSymbol[MAX_OCSYMBOLS]; ! unsigned mnSymbols; }; /** * Old code, needs refactoring */ class tcObjectControl : public tc3DWindow { public: ! void Draw(); ! void AttachSimState(tcSimState *apSS) {mpSS=apSS;} ! void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} ! void AttachUserInfo(tcUserInfo *apUserInfo) {mpUserInfo=apUserInfo;} ! bool ButtonContainingPoint(wxPoint point, int& rnRow, int& rnColumn); ! void GetSymbols(tsOCSymbolList*& rpOCSymbolList) {rpOCSymbolList=&msOCSymbolList;} ! void SetHookID(tnPoolIndex anID) {mnHookID=anID;} ! void OnLButtonDown(wxMouseEvent& event); ! void OnMouseMove(wxMouseEvent& event); ! bool ProcessWeaponPanelButton(int anLauncher, int anButton); ! bool ProcessSensorPanelButton(int anSensor, int anButton); ! tcObjectControl(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "ObjectControl"); ! virtual ~tcObjectControl(); private: ! tcGameObject *mpHookedGameObj; ! tcSimState *mpSS; ///< pointer to SimState object to access hook info, change this ! ///< to a UserSimState reference when ready (state as known by user's side) ! tcOptions *mpOptions; ! tcCommandQueue *mpCommandInterface; ! tcUserInfo *mpUserInfo; ///< info on which alliance user belongs to for truth view/control ! tnPoolIndex mnHookID, mnPreviousHookID; ! ! tcButtonPanel mcWeaponPanel; ! tcButtonPanel mcSensorPanel; ! tcAIPanel mcAIPanel; ! tsHeadingObjectInfo msHOI; ! tsBarObjectInfo msSOI; ///< speed object info ! tsHeadingObjectInfo msFormHeading; ! tsBarObjectInfo msFormRange; ! tsBarObjectInfo msAltitude; ! int mnLaunchers; ! 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); }; --- 139,222 ---- struct tsOCSymbolList { ! struct ! { ! float mfLat_rad; ! float mfLon_rad; ! float mfLatExtent_rad; ! float mfLonExtent_rad; ! float mfArcCenter_deg; ! float mfArcLength_deg; ! UINT32 mnColor; ! } maSymbol[MAX_OCSYMBOLS]; ! unsigned mnSymbols; }; /** * Old code, needs refactoring + * Second that, really needs it! */ class tcObjectControl : public tc3DWindow { public: ! void Draw(); ! void AttachSimState(tcSimState *apSS) {mpSS=apSS;} ! void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} ! void AttachUserInfo(tcUserInfo *apUserInfo) {mpUserInfo=apUserInfo;} ! bool ButtonContainingPoint(wxPoint point, int& rnRow, int& rnColumn); ! void GetSymbols(tsOCSymbolList*& rpOCSymbolList) {rpOCSymbolList=&msOCSymbolList;} ! void SetHookID(tnPoolIndex anID) {mnHookID=anID;} ! void OnLButtonDown(wxMouseEvent& event); ! void OnMouseMove(wxMouseEvent& event); ! bool ProcessWeaponPanelButton(int anLauncher, int anButton); ! bool ProcessSensorPanelButton(int anSensor, int anButton); ! tcObjectControl(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "ObjectControl"); ! virtual ~tcObjectControl(); private: ! tcGameObject *mpHookedGameObj; ! tcSimState *mpSS; ///< pointer to SimState object to access hook info, change this ! ///< to a UserSimState reference when ready (state as known by user's side) ! tcOptions *mpOptions; ! tcCommandQueue *mpCommandInterface; ! tcUserInfo *mpUserInfo; ///< info on which alliance user belongs to for truth view/control ! tnPoolIndex mnHookID, mnPreviousHookID; ! tcButtonPanel mcWeaponPanel; ! tcButtonPanel mcSensorPanel; ! tcAIPanel mcAIPanel; ! tsHeadingObjectInfo msHOI; ! tsBarObjectInfo msSOI; ///< speed object info ! tsHeadingObjectInfo msFormHeading; ! tsBarObjectInfo msFormRange; ! int mnLaunchers; ! int mnSensors; ! tsOCSymbolList msOCSymbolList; ! osg::ref_ptr<osg::Geometry> headingCircle; ! osg::ref_ptr<osg::Geometry> headingCircleLight; ! ! std::vector<tcControl*> controls; ! tcControl* altitudeControl; ! ! void CreateHeadingCircles(); ! void DrawBarObject(tsBarObjectInfo *apBOI, float afValue, float afValueGoal); ! void DrawButton(const tcRect& rectf, ! char* azCaption, teButtonState aeState); ! void DrawControls(); ! 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 SetControlGameObject(tcGameObject* obj); ! void UpdateControlObjects(); ! void UpdateSymbolList(); ! void GetObjectInfo(tcString& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); }; Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcMissileObject.h 7 Nov 2004 03:40:43 -0000 1.13 --- tcMissileObject.h 23 Nov 2004 23:30:49 -0000 1.14 *************** *** 46,49 **** --- 46,50 ---- float mfGoalSpeed_kts; double mfInterceptTime; + bool subSurfaceLaunch; ///< true during subsurface launch phase for sub-launched missiles // are all 3 of these necessary? needs refactoring Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcLauncherState.h 16 Aug 2004 01:43:30 -0000 1.9 --- tcLauncherState.h 23 Nov 2004 23:30:49 -0000 1.10 *************** *** 72,75 **** --- 72,76 ---- LAUNCHER_INACTIVE = 10, NO_FIRECONTROL = 11, + TOO_DEEP = 12 ///< too deep for sub launch }; ///< launcher status codes Index: tcRadar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadar.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcRadar.h 7 Nov 2004 03:40:43 -0000 1.10 --- tcRadar.h 23 Nov 2004 23:30:50 -0000 1.11 *************** *** 84,87 **** --- 84,88 ---- void Serialize(tcFile& file, bool mbLoad); + virtual bool IsRadar() const; virtual void Update(double t); Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcGameObject.h 6 Nov 2004 15:13:40 -0000 1.26 --- tcGameObject.h 23 Nov 2004 23:30:49 -0000 1.27 *************** *** 149,152 **** --- 149,153 ---- float GetSpan() const; float GetTerrainElevation() {return mcTerrain.mfHeight_m;} + bool IsOwnAlliance() const; virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher) {} virtual void SetHeading(float afNewHeading) {} Index: tcOpticalSensor.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcOpticalSensor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcOpticalSensor.h 6 Nov 2004 15:13:40 -0000 1.1 --- tcOpticalSensor.h 23 Nov 2004 23:30:50 -0000 1.2 *************** *** 51,54 **** --- 51,55 ---- void Serialize(tcFile& file, bool mbLoad); + virtual bool IsOptical() const; virtual void Update(double t); Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcSensorState.h 6 Nov 2004 15:13:40 -0000 1.12 --- tcSensorState.h 23 Nov 2004 23:30:50 -0000 1.13 *************** *** 75,78 **** --- 75,83 ---- virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key bool IsHidden() const; + + virtual bool IsESM() const; + virtual bool IsRadar() const; + virtual bool IsSonar() const; + virtual bool IsOptical() const; void Serialize(tcFile& file, bool mbLoad); Index: tcESMSensor.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcESMSensor.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcESMSensor.h 6 Nov 2004 15:13:40 -0000 1.6 --- tcESMSensor.h 23 Nov 2004 23:30:47 -0000 1.7 *************** *** 45,48 **** --- 45,49 ---- virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key bool IsDetected(const tcRadar* emitter, float& rfAz_rad); + virtual bool IsESM() const; void Serialize(tcFile& file, bool mbLoad); virtual void Update(double t); |