gcblue-commits Mailing List for Global Conflict Blue (Page 59)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
| 2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
| 2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
|
From: Xavi <xr...@us...> - 2004-04-04 21:02:13
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14170 Modified Files: tcConnectionData.h Log Message: + added ifdef MSV for #pragma once instruction + newline at the end of function Index: tcConnectionData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcConnectionData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcConnectionData.h 6 Mar 2004 20:52:29 -0000 1.3 --- tcConnectionData.h 4 Apr 2004 20:49:42 -0000 1.4 *************** *** 23,27 **** --- 23,29 ---- #define _CONNECTIONDATA_H_ + #if _MSC_VER > 1000 #pragma once + #endif #include "wx/wx.h" *************** *** 73,75 **** END_NAMESPACE ! #endif \ No newline at end of file --- 75,79 ---- END_NAMESPACE ! #endif ! ! |
|
From: Dewitt C. <ddc...@us...> - 2004-04-03 20:36:54
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6167/src/sim Modified Files: Game.cpp tcGameView.cpp tcMapView.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcMapView.cpp 3 Apr 2004 15:39:31 -0000 1.21 --- tcMapView.cpp 3 Apr 2004 20:24:33 -0000 1.22 *************** *** 103,115 **** /* fprintf(stdout, "*** setting map view to L:%f R:%f T:%f B:%f\n", ! mrectCurrentView.left, mrectCurrentView.right, ! mrectCurrentView.top, mrectCurrentView.bottom); fprintf(stdout, " map window L:%d R:%d T:%d B:%d\n", ! mrectWindow.left, mrectWindow.right, mrectWindow.top, mrectWindow.bottom); tcPoint testPoint = GeoToScreen(mfGridBaseLon_rad, mfGridBaseLat_rad); fprintf(stdout, " base geo (%f,%f) screen(%f, %f)\n", ! mfGridBaseLon_rad,mfGridBaseLat_rad, ! testPoint.x, testPoint.y); ! */ } --- 103,115 ---- /* fprintf(stdout, "*** setting map view to L:%f R:%f T:%f B:%f\n", ! mrectCurrentView.left, mrectCurrentView.right, ! mrectCurrentView.top, mrectCurrentView.bottom); fprintf(stdout, " map window L:%d R:%d T:%d B:%d\n", ! mrectWindow.left, mrectWindow.right, mrectWindow.top, mrectWindow.bottom); tcPoint testPoint = GeoToScreen(mfGridBaseLon_rad, mfGridBaseLat_rad); fprintf(stdout, " base geo (%f,%f) screen(%f, %f)\n", ! mfGridBaseLon_rad,mfGridBaseLat_rad, ! testPoint.x, testPoint.y); ! */ } *************** *** 126,130 **** /***********************************************************************************/ ! tcPoint tcMapView::GeoToScreen(tcPoint pgeo) { tcPoint pscreen; pscreen.x = (pgeo.x - mfLonCenter)*mfScaleX_pelprad + mnXCenter; --- 126,131 ---- /***********************************************************************************/ ! tcPoint tcMapView::GeoToScreen(tcPoint pgeo) ! { tcPoint pscreen; pscreen.x = (pgeo.x - mfLonCenter)*mfScaleX_pelprad + mnXCenter; *************** *** 133,137 **** } /***********************************************************************************/ ! tcPoint tcMapView::GeoToScreen(float afLon, float afLat) { tcPoint pscreen; pscreen.x = (afLon - mfLonCenter)*mfScaleX_pelprad + mnXCenter; --- 134,139 ---- } /***********************************************************************************/ ! tcPoint tcMapView::GeoToScreen(float afLon, float afLat) ! { tcPoint pscreen; pscreen.x = (afLon - mfLonCenter)*mfScaleX_pelprad + mnXCenter; *************** *** 140,148 **** } /***********************************************************************************/ ! float tcMapView::GeoExtentToScreen(float afExtent_rad) { return afExtent_rad*mfScaleX_pelprad; } /***********************************************************************************/ ! tcPoint tcMapView::ScreenToGeo(wxPoint pscreen) { tcPoint pgeo; pgeo.x = ((float)pscreen.x - mnXCenter)*mfScaleX_radppel + mfLonCenter; --- 142,152 ---- } /***********************************************************************************/ ! float tcMapView::GeoExtentToScreen(float afExtent_rad) ! { return afExtent_rad*mfScaleX_pelprad; } /***********************************************************************************/ ! tcPoint tcMapView::ScreenToGeo(wxPoint pscreen) ! { tcPoint pgeo; pgeo.x = ((float)pscreen.x - mnXCenter)*mfScaleX_radppel + mfLonCenter; *************** *** 151,155 **** } /***********************************************************************************/ ! tcPoint tcMapView::ScreenToGeo(float x, float y) { tcPoint pgeo; pgeo.x = (x - mnXCenter)*mfScaleX_radppel + mfLonCenter; --- 155,160 ---- } /***********************************************************************************/ ! tcPoint tcMapView::ScreenToGeo(float x, float y) ! { tcPoint pgeo; pgeo.x = (x - mnXCenter)*mfScaleX_radppel + mfLonCenter; *************** *** 241,246 **** /* void tcMapView::SetWindow(RECT& r) { ! tcWindow::SetWindow(r); // call base class to set tcMapView's window ! terrainView->SetWindow(r); } */ --- 246,251 ---- /* void tcMapView::SetWindow(RECT& r) { ! tcWindow::SetWindow(r); // call base class to set tcMapView's window ! terrainView->SetWindow(r); } */ *************** *** 309,313 **** mpPen->SetColor(Color(0xFFFFFFFF)); ! int xLeft = min(buttonDownPoint.x, mpointMouse.x); int yTop = min(buttonDownPoint.y, mpointMouse.y); --- 314,318 ---- mpPen->SetColor(Color(0xFFFFFFFF)); ! int xLeft = min(buttonDownPoint.x, mpointMouse.x); int yTop = min(buttonDownPoint.y, mpointMouse.y); *************** *** 508,525 **** tcMapView::Thaw(); // unfreeze every Draw() call, works with Freeze() to stop resize flicker ! if (mnScrollState >= SCROLL_DELAY) { ScrollMap(mfScrollDirection); } else if (mnScrollState > 0) {mnScrollState++;} ! // done here to avoid artifacts from terrainview being out of sync with mapview terrainView->SetView(mrectCurrentView); - //terrainView->DrawTest(); - Erase(); ! // TODO: add terrain features ! // mpDDS_Offscreen->Blt(NULL,mpDDS_Terrain,NULL,DDBLT_WAIT,&sFX); ! if (!GetGraphics(pGraphics)) { ! //WriteToLog2("Failed to get Graphics in tcTacticalMapView::Draw()\n"); return 0; } --- 513,529 ---- tcMapView::Thaw(); // unfreeze every Draw() call, works with Freeze() to stop resize flicker ! if (mnScrollState >= SCROLL_DELAY) ! { ScrollMap(mfScrollDirection); } else if (mnScrollState > 0) {mnScrollState++;} ! ! // SetView called here to avoid artifacts from terrainview being out of sync with mapview terrainView->SetView(mrectCurrentView); ! Erase(); ! if (!GetGraphics(pGraphics)) ! { return 0; } *************** *** 576,580 **** pGraphics->DrawString(mzwchar, -1, mpFont, pointf, mpBrush); ! if ((mpOptions!=NULL)&&(mpOptions->mbShowMapDebug)) { tsTerrainViewParameters vp; terrainView->GetViewParameters(vp); --- 580,585 ---- pGraphics->DrawString(mzwchar, -1, mpFont, pointf, mpBrush); ! if ((mpOptions!=NULL)&&(mpOptions->mbShowMapDebug)) ! { tsTerrainViewParameters vp; terrainView->GetViewParameters(vp); *************** *** 587,597 **** } ! /**********************/ ! for(i=0;(i<(int)mnObjCount)&&(i<MAXMAPOBJ);i++) { ! if (maMapObj[i].mbExists) { ! //DrawSymbol(pGraphics,&maMapObj[i]); DrawSymbol2(pGraphics,&maMapObj[i]); if (meMapCmd != MC_NONE) { ! if ((maMapObj[i].mnID == mnHookID)&&(meMapCmd == MC_HEADING)&&(maMapObj[i].meSymbol != SYMBOL_SENSOR)) { DrawMapCmd(pGraphics,&maMapObj[i],meMapCmd); } --- 592,616 ---- } ! /*** Draw map command graphics ***/ ! long currentHook; ! if (GetHookCount()) ! { ! currentHook = GetHookID(); ! } ! else ! { ! currentHook = -1; ! } ! ! for(i=0;(i<(int)mnObjCount)&&(i<MAXMAPOBJ);i++) ! { ! if (maMapObj[i].mbExists) ! { DrawSymbol2(pGraphics,&maMapObj[i]); if (meMapCmd != MC_NONE) { ! if ((maMapObj[i].mnID == currentHook)&& ! (meMapCmd == MC_HEADING)&& ! (maMapObj[i].meSymbol != SYMBOL_SENSOR)) ! { DrawMapCmd(pGraphics,&maMapObj[i],meMapCmd); } *************** *** 600,604 **** } ! if ((meMapCmd != MC_NONE)&&(meMapCmd != MC_HEADING)) { DrawMapCmd(pGraphics,NULL,meMapCmd); } --- 619,624 ---- } ! if ((meMapCmd != MC_NONE)&&(meMapCmd != MC_HEADING)) ! { DrawMapCmd(pGraphics,NULL,meMapCmd); } *************** *** 646,650 **** } ! Graphics* tcTacticalMapView::GetGraphicsFromImage(Image* apImage) { Graphics *pGraphics = new Graphics(apImage); pGraphics->SetCompositingMode(CompositingModeSourceOver); // SourceCopy doesn't do blending --- 666,671 ---- } ! Graphics* tcTacticalMapView::GetGraphicsFromImage(Image* apImage) ! { Graphics *pGraphics = new Graphics(apImage); pGraphics->SetCompositingMode(CompositingModeSourceOver); // SourceCopy doesn't do blending *************** *** 655,658 **** --- 676,717 ---- } + /** + * @return number of hooked objects + */ + size_t tcTacticalMapView::GetHookCount() + { + return hookedId.size(); + } + + /** + * @return hook ID of hooked unit with index of idx, or -1 if invalid + */ + long tcTacticalMapView::GetHookID(size_t idx) + { + if (idx < GetHookCount()) + { + return hookedId[idx]; + } + else + { + return -1; + } + } + + /** + * Performs simple search for match by iterating through + * elements of hookedId vector. Could get slow for large sizes. + * @return true if id matches any elements in hookedId vector + */ + bool tcTacticalMapView::IsHooked(long id) + { + for(std::vector<long>::iterator iter = hookedId.begin() + ; iter != hookedId.end(); ++iter) + { + if ((*iter) == id) return true; + } + return false; + } + void tcTacticalMapView::DrawNTDSSurface(Graphics *apGraphics, teAffiliation affil) { float symbsize=15.0f; *************** *** 947,952 **** h = pMO->mfHeading; type = pMO->meSymbol; ! pMO->mbFocus = (pMO->mnID == mnHookID)&&(type != SYMBOL_SENSOR); ! if (pMO->mbFocus) { mfHookLat = pMO->mfLat; // move somewhere else and make this tighter mfHookLon = pMO->mfLon; --- 1006,1012 ---- h = pMO->mfHeading; type = pMO->meSymbol; ! pMO->mbFocus = (IsHooked(pMO->mnID))&&(type != SYMBOL_SENSOR); ! if (pMO->mbFocus) ! { mfHookLat = pMO->mfLat; // move somewhere else and make this tighter mfHookLon = pMO->mfLon; *************** *** 956,960 **** apGraphics->GetClipBounds(&rclipbounds); ! if (type == SYMBOL_SENSOR) { symbsize = 8.0f; vectsize = 10.0f; --- 1016,1021 ---- apGraphics->GetClipBounds(&rclipbounds); ! if (type == SYMBOL_SENSOR) ! { symbsize = 8.0f; vectsize = 10.0f; *************** *** 1129,1134 **** type = pMO->meSymbol; ! pMO->mbFocus = (pMO->mnID == mnHookID)&&(type != SYMBOL_SENSOR); ! if (pMO->mbFocus) { mfHookLat = pMO->mfLat; // move somewhere else and make this tighter mfHookLon = pMO->mfLon; --- 1190,1196 ---- type = pMO->meSymbol; ! pMO->mbFocus = (IsHooked(pMO->mnID))&&(type != SYMBOL_SENSOR); ! if (pMO->mbFocus) ! { mfHookLat = pMO->mfLat; // move somewhere else and make this tighter mfHookLon = pMO->mfLon; *************** *** 1297,1316 **** ! /***********************************************************************************/ ! int tcTacticalMapView::Hook(wxPoint pscreen) { long nMinID; nMinID = GetClosest(pscreen); ! if (nMinID != (long)mnHookID) { - mnHookID = nMinID; wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_NEWHOOK) ; command.SetEventObject(this); ! command.m_extraLong = mnHookID; AddPendingEvent(command); } ! return mnHookID; } --- 1359,1435 ---- ! /** ! * Single-unit hook. ! * Hooks a single object closest to pscreen ! */ ! long tcTacticalMapView::Hook(wxPoint pscreen) { long nMinID; + long currentHook; + + if (GetHookCount() == 1) + { + currentHook = GetHookID(); + } + else + { + currentHook = -1; + } nMinID = GetClosest(pscreen); ! if (nMinID != currentHook) { wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_NEWHOOK) ; command.SetEventObject(this); ! command.m_extraLong = nMinID; AddPendingEvent(command); } ! hookedId.clear(); ! if (nMinID != -1) ! { ! hookedId.push_back(nMinID); ! } ! return nMinID; ! } ! /** ! * Group hook. ! * Selects multiple friendly units. ! * If no units are selected, this clears the hookedId vector. ! */ ! void tcTacticalMapView::HookGroup(wxRect& region) ! { ! tcMapObj *pMO; ! tcPoint northWest, southEast; ! ! northWest = ScreenToGeo(region.GetLeft(), region.GetBottom()); ! southEast = ScreenToGeo(region.GetRight(), region.GetTop()); ! tcGeoRect geoRegion; ! geoRegion.Set(northWest.x, southEast.x, northWest.y, southEast.y); ! ! hookedId.clear(); ! ! // add all friendly units within region ! for(int i=0;i<MAXMAPOBJ;i++) ! { ! pMO = &maMapObj[i]; ! if ((pMO->mbExists)&& ! (geoRegion.ContainsPoint(pMO->mfLon, pMO->mfLat))) ! { ! if (pMO->meAffiliation == FRIENDLY) ! { ! hookedId.push_back(pMO->mnID); ! } ! } ! } ! ! // if single unit is hooked, post a single hook event ! if (GetHookCount()==1) ! { ! wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_NEWHOOK) ; ! command.SetEventObject(this); ! command.m_extraLong = GetHookID(); ! AddPendingEvent(command); ! } } *************** *** 1320,1328 **** long nMinID; ! if (mnHookID == NULL_INDEX) return -1; nMinID = GetClosest(pscreen); ! ! if ((nMinID != (long)mnHookID) && (nMinID != -1)) { wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_SECONDARYHOOK) ; --- 1439,1449 ---- long nMinID; ! if (GetHookCount()==0) return -1; ! ! long currentHook = GetHookID(); nMinID = GetClosest(pscreen); ! ! if ((nMinID != currentHook) && (nMinID != -1)) { wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_SECONDARYHOOK) ; *************** *** 1383,1387 **** dx = sinf(fDirection_rad)*dr; dy = cosf(fDirection_rad)*dr; ! tcPoint p; p.x = mrectCurrentView.XCenter() + dx; --- 1504,1508 ---- dx = sinf(fDirection_rad)*dr; dy = cosf(fDirection_rad)*dr; ! tcPoint p; p.x = mrectCurrentView.XCenter() + dx; *************** *** 1432,1487 **** if (mpCommandInterface == NULL) {return;} ! //TranslatePoint(point); ! switch (meMapCmd) { ! case MC_HEADING: ! meMapCmd = MC_NONE; ! p = ScreenToGeo(point); ! mfMapCmdHeading = atan2f(p.x-mfHookLon,p.y-mfHookLat); ! if (mbBypassPythonCallback) ! { ! mpCommandInterface->AddCommand(PC_CHANGEHEADING,mfMapCmdHeading,0); ! } ! else ! { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Heading",callbackParam); ! } ! mbMapCmdActive = false; ! break; ! case MC_TARGET: ! mnID = GetClosest(mpointMouse); ! if ((mnID!=NULL_INDEX)&&(mnID!=(long)mnHookID)) ! { ! meMapCmd = MC_NONE; ! mbMapCmdActive = false; ! mnMapCmdTarget = mnID; ! if (mbBypassPythonCallback) ! { ! mpCommandInterface->AddCommand(PC_DESIGNATETARGET,0,mnID); ! } ! else ! { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Target",callbackParam); ! } ! } ! else ! { ! } ! break; ! case MC_DATUM: ! meMapCmd = MC_NONE; ! mpointGeoDatum = ScreenToGeo(point); ! mbMapCmdActive = false; ! if (mbBypassPythonCallback) ! { ! mpCommandInterface->AddCommand(PC_DATUMSET,0,0); ! } ! else ! { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Datum",callbackParam); ! } ! break; ! default: ! mbMapCmdActive = false; ! break; } } --- 1553,1609 ---- if (mpCommandInterface == NULL) {return;} ! ! switch (meMapCmd) ! { ! case MC_HEADING: ! meMapCmd = MC_NONE; ! p = ScreenToGeo(point); ! mfMapCmdHeading = atan2f(p.x-mfHookLon,p.y-mfHookLat); ! if (mbBypassPythonCallback) ! { ! mpCommandInterface->AddCommand(PC_CHANGEHEADING,mfMapCmdHeading,0); ! } ! else ! { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Heading",callbackParam); ! } ! mbMapCmdActive = false; ! break; ! case MC_TARGET: ! mnID = GetClosest(mpointMouse); ! if ((mnID!=NULL_INDEX)&&(mnID!=GetHookID())) ! { ! meMapCmd = MC_NONE; ! mbMapCmdActive = false; ! mnMapCmdTarget = mnID; ! if (mbBypassPythonCallback) ! { ! mpCommandInterface->AddCommand(PC_DESIGNATETARGET,0,mnID); ! } ! else ! { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Target",callbackParam); ! } ! } ! else ! { ! } ! break; ! case MC_DATUM: ! meMapCmd = MC_NONE; ! mpointGeoDatum = ScreenToGeo(point); ! mbMapCmdActive = false; ! if (mbBypassPythonCallback) ! { ! mpCommandInterface->AddCommand(PC_DATUMSET,0,0); ! } ! else ! { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Datum",callbackParam); ! } ! break; ! default: ! mbMapCmdActive = false; ! break; } } *************** *** 1499,1505 **** bool isControlDown = event.ControlDown(); bool bFlagsSet = (isShiftDown || isControlDown); ! buttonDownPoint = event.GetPosition(); ! if ((mbMapCmdActive)&&(!bFlagsSet)) --- 1621,1627 ---- bool isControlDown = event.ControlDown(); bool bFlagsSet = (isShiftDown || isControlDown); ! buttonDownPoint = event.GetPosition(); ! if ((mbMapCmdActive)&&(!bFlagsSet)) *************** *** 1522,1526 **** } Hook(buttonDownPoint); ! if (mnHookID == -1) { isLButtonDown = true; --- 1644,1648 ---- } Hook(buttonDownPoint); ! if (GetHookCount()==0) { isLButtonDown = true; *************** *** 1536,1539 **** --- 1658,1667 ---- if (isLButtonDown) { + int xLeft = min(buttonDownPoint.x, mpointMouse.x); + int yTop = min(buttonDownPoint.y, mpointMouse.y); + int width = abs(mpointMouse.x - buttonDownPoint.x); + int height = abs(mpointMouse.y - buttonDownPoint.y); + HookGroup(wxRect(xLeft, yTop, width, height)); + isLButtonDown = false; } *************** *** 1564,1568 **** return; // old returned true } ! if ((mnHookID == NULL_INDEX)||(HookSecondary(point) == -1)) { tcWindow::SkipMouseEvent(event); --- 1692,1696 ---- return; // old returned true } ! if ((GetHookCount()==0)||(HookSecondary(point) == -1)) { tcWindow::SkipMouseEvent(event); *************** *** 1613,1617 **** wxPoint point = event.GetPosition(); int zDelta = event.GetWheelRotation(); ! if (zDelta > 0) { --- 1741,1745 ---- wxPoint point = event.GetPosition(); int zDelta = event.GetWheelRotation(); ! if (zDelta > 0) { *************** *** 1626,1629 **** --- 1754,1770 ---- } + /** + * If id != -1, sets hookedId to have one element equal to id, + * otherwise clears the hookedId vector + */ + void tcTacticalMapView::SetHookID(long id) + { + hookedId.clear(); + if (id != -1) + { + hookedId.push_back(id); + } + } + void tcTacticalMapView::UpdateNavPoints(vector<tcPoint> *mpPoints) { maNavPointGeo.clear(); *************** *** 1647,1652 **** /***********************************************************************************/ tcTacticalMapView::tcTacticalMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name) : tcMapView(parent, pos, size, name) --- 1788,1793 ---- /***********************************************************************************/ tcTacticalMapView::tcTacticalMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name) : tcMapView(parent, pos, size, name) *************** *** 1657,1661 **** wxMessageBox("terrainView init failed\n"); } ! tcWindow::MoveToTop(); // so that color elevation map is underneath --- 1798,1802 ---- wxMessageBox("terrainView init failed\n"); } ! tcWindow::MoveToTop(); // so that color elevation map is underneath *************** *** 1665,1669 **** mnGameMode = GAMEMODE_NORMAL; mbShowTrackID = true; ! mnHookID = NULL_INDEX; mbMapCmdActive = false; meMapCmd = MC_NONE; --- 1806,1810 ---- mnGameMode = GAMEMODE_NORMAL; mbShowTrackID = true; ! hookedId.clear(); mbMapCmdActive = false; meMapCmd = MC_NONE; *************** *** 1877,1882 **** /***********************************************************************************/ tcWorldMapView::tcWorldMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name) : tcMapView(parent, pos, size, name) { --- 2018,2023 ---- /***********************************************************************************/ tcWorldMapView::tcWorldMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name) : tcMapView(parent, pos, size, name) { Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcGameView.cpp 16 Feb 2004 01:06:23 -0000 1.8 --- tcGameView.cpp 3 Apr 2004 20:24:33 -0000 1.9 *************** *** 115,123 **** void tcGameView::UpdateHookInfo(void) { ! mnHookID = mpMapView->mnHookID; ! if (mnHookID == NULL_INDEX) { mpHookedObj = NULL; } ! else { mpHookedObj = mpSS->GetObject(mnHookID); } --- 115,126 ---- void tcGameView::UpdateHookInfo(void) { ! // returns -1 if no hooks, first hooked unit otherwise ! mnHookID = mpMapView->GetHookID(); ! if (mnHookID == NULL_INDEX) ! { mpHookedObj = NULL; } ! else ! { mpHookedObj = mpSS->GetObject(mnHookID); } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** Game.cpp 25 Mar 2004 01:33:39 -0000 1.71 --- Game.cpp 3 Apr 2004 20:24:33 -0000 1.72 *************** *** 1596,1601 **** } ! // pass key to python if object is hooked ! if (tacticalMap->mnHookID != NULL_INDEX) { pythonInterface->ProcessHotKey(nChar, 0); --- 1596,1601 ---- } ! // pass key to python if exactly one object is hooked (no group support yet) ! if (tacticalMap->GetHookCount() == 1) { pythonInterface->ProcessHotKey(nChar, 0); |
|
From: Dewitt C. <ddc...@us...> - 2004-04-03 20:36:54
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6167/include/sim Modified Files: tcMapView.h Log Message: Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapView.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMapView.h 3 Apr 2004 15:39:31 -0000 1.18 --- tcMapView.h 3 Apr 2004 20:24:33 -0000 1.19 *************** *** 87,91 **** teSymbol meSymbol; teAffiliation meAffiliation; ! unsigned long mnID; float mfArc_deg; ///< for pie symbol float mfLonExtent; ///< for pie --- 87,91 ---- teSymbol meSymbol; teAffiliation meAffiliation; ! long mnID; float mfArc_deg; ///< for pie symbol float mfLonExtent; ///< for pie *************** *** 244,248 **** float mfScrollDirection; ! long mnHookID; UINT mnHookAlliance; float mfHookLon,mfHookLat; --- 244,249 ---- float mfScrollDirection; ! std::vector<long> hookedId; ///< vector of hooked obj ids ! UINT mnHookAlliance; float mfHookLon,mfHookLat; *************** *** 258,263 **** void UpdateNavPoints(std::vector<tcPoint> *mpPoints); ! int Hook(wxPoint pscreen); ! long HookSecondary(wxPoint pscreen); int GetClosest(wxPoint pscreen); --- 259,263 ---- void UpdateNavPoints(std::vector<tcPoint> *mpPoints); ! int GetClosest(wxPoint pscreen); *************** *** 273,277 **** void ScrollMap(float afDirection_deg); void ClearMapCmd() {meMapCmd = MC_NONE;} ! //int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); int Draw(void); void DrawGrid(Gdiplus::Graphics *apGraphics); --- 273,277 ---- void ScrollMap(float afDirection_deg); void ClearMapCmd() {meMapCmd = MC_NONE;} ! int Draw(void); void DrawGrid(Gdiplus::Graphics *apGraphics); *************** *** 283,287 **** void DrawIndicator(int anType); void DrawSpecial(Gdiplus::Graphics *graphics); ! long GetHookID() {return mnHookID;} bool IsMapCmdActive() {return meMapCmd != MC_NONE;} void OnChar(wxKeyEvent& event); --- 283,292 ---- void DrawIndicator(int anType); void DrawSpecial(Gdiplus::Graphics *graphics); ! size_t GetHookCount(); ! long GetHookID(size_t idx = 0); ! long Hook(wxPoint pscreen); ! void HookGroup(wxRect& region); ! long HookSecondary(wxPoint pscreen); ! bool IsHooked(long id); bool IsMapCmdActive() {return meMapCmd != MC_NONE;} void OnChar(wxKeyEvent& event); *************** *** 293,302 **** void OnMouseWheel(wxMouseEvent& event); void OnRButtonDown(wxMouseEvent& event); ! void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true;meMapCmd=aeCmd;} ! void DeactivateCmd() {mbMapCmdActive=false;meMapCmd=MC_NONE;} void ClearMapObjects(void); void Init(void); void SetDateTime(std::string s) {dateTime = s;} ! void SetHookID(long id) {mnHookID = id;} void ToggleShowTrackTags() {mbShowTrackID = !mbShowTrackID;} void UpdateViewBounds() {mpMapData->GetTheaterArea(mrectViewBounds);} --- 298,307 ---- void OnMouseWheel(wxMouseEvent& event); void OnRButtonDown(wxMouseEvent& event); ! void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} ! void DeactivateCmd() {mbMapCmdActive=false; meMapCmd=MC_NONE;} void ClearMapObjects(void); void Init(void); void SetDateTime(std::string s) {dateTime = s;} ! void SetHookID(long id); void ToggleShowTrackTags() {mbShowTrackID = !mbShowTrackID;} void UpdateViewBounds() {mpMapData->GetTheaterArea(mrectViewBounds);} *************** *** 319,323 **** wxPoint buttonDownPoint; ///< start point for click-drag operations - void Build2525(); void BuildNTDS(); --- 324,327 ---- |
|
From: Dewitt C. <ddc...@us...> - 2004-04-03 20:36:54
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6167/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CHANGES.txt 3 Apr 2004 15:39:31 -0000 1.6 --- CHANGES.txt 3 Apr 2004 20:24:32 -0000 1.7 *************** *** 5,8 **** --- 5,9 ---- *** 2004-04-03 Dewitt Colclough *** - Added multi-unit selection box drawing to map + - Started adding multi-unit selection logic to tactical map *** 2004-03-29 Dewitt Colclough *** |
|
From: Dewitt C. <ddc...@us...> - 2004-04-03 15:51:51
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22160/src/sim Modified Files: tcMapView.cpp Log Message: selection box drawing Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcMapView.cpp 20 Mar 2004 18:46:46 -0000 1.20 --- tcMapView.cpp 3 Apr 2004 15:39:31 -0000 1.21 *************** *** 301,328 **** ! ! ! /** ! * Override for tactical map. Calls terrainView to copy elevation map image to ! * tc2DGraphicsSurface bitmap. */ ! /* ! int tcTacticalMapView::CreateSurfaces(tcGraphicsEngine* apGraphicsEngine) { ! // set terrain to high res ! terrainView->mbHighRes = true; ! if (mpMapData == NULL) ! { ! wxMessageBox("Error - tcMapView - CreateSurfaces called before attaching tcMapData obj"); ! } ! else ! { ! if (terrainView->CreateSurfaces(apGraphicsEngine) == false) {return false;} ! } ! return tcWindow::CreateSurfaces(apGraphicsEngine); // MapView on top of TerrainView } - */ ! /***********************************************************************************/ void tcTacticalMapView::DrawGrid(Graphics *apGraphics) { --- 301,325 ---- ! /** ! * Draws selection box if left mouse button is down */ ! void tcTacticalMapView::DrawSelectionBox(Gdiplus::Graphics *graphics) { ! if (!isLButtonDown) return; ! ! mpPen->SetColor(Color(0xFFFFFFFF)); ! ! int xLeft = min(buttonDownPoint.x, mpointMouse.x); ! int yTop = min(buttonDownPoint.y, mpointMouse.y); ! int width = abs(mpointMouse.x - buttonDownPoint.x); ! int height = abs(mpointMouse.y - buttonDownPoint.y); ! ! graphics->DrawRectangle(mpPen, xLeft, yTop, width, height); } ! ! /** ! * Draws tactical map grid ! */ void tcTacticalMapView::DrawGrid(Graphics *apGraphics) { *************** *** 346,351 **** } } ! /***********************************************************************************/ ! void tcTacticalMapView::DrawScaleBar(Graphics *apGraphics) { float fKmPerPel, fKmScale; int nScaleBarWidth, nBarX1, nBarX2; --- 343,352 ---- } } ! ! /** ! * Draws tactical map scale bar ! */ ! void tcTacticalMapView::DrawScaleBar(Graphics *apGraphics) ! { float fKmPerPel, fKmScale; int nScaleBarWidth, nBarX1, nBarX2; *************** *** 401,405 **** } /***********************************************************************************/ ! void tcTacticalMapView::DrawMapCmd(Graphics *apGraphics, tcMapObj *pMO, teMapCmdType type) { int x,y; --- 402,407 ---- } /***********************************************************************************/ ! void tcTacticalMapView::DrawMapCmd(Graphics *apGraphics, tcMapObj *pMO, teMapCmdType type) ! { int x,y; *************** *** 449,455 **** } ! /***********************************************************************************/ ! // draw indicator symbol box at appropriate location, for error indication currently ! void tcTacticalMapView::DrawIndicator(int anType) { return; // TODO: update this --- 451,459 ---- } ! /** ! * Draw indicator symbol box at appropriate location, for error indication currently ! */ ! void tcTacticalMapView::DrawIndicator(int anType) ! { return; // TODO: update this *************** *** 539,542 **** --- 543,549 ---- DrawTerrainText(pGraphics); + /*** Draw selection box ***/ + DrawSelectionBox(pGraphics); + /*** Draw date and time text ***/ tcString sText; *************** *** 1332,1336 **** /***********************************************************************************/ ! int tcTacticalMapView::GetClosest(wxPoint pscreen) { tcMapObj *pMO; tcPoint geopoint = ScreenToGeo(pscreen), geopointi; --- 1339,1344 ---- /***********************************************************************************/ ! int tcTacticalMapView::GetClosest(wxPoint pscreen) ! { tcMapObj *pMO; tcPoint geopoint = ScreenToGeo(pscreen), geopointi; *************** *** 1342,1352 **** fMinDistance = 1e15f; nMinID = NULL_INDEX; ! for(int i=0;i<MAXMAPOBJ;i++) { pMO = &maMapObj[i]; ! if (pMO->mbExists) { geopointi.x = pMO->mfLon; geopointi.y = pMO->mfLat; fDistance = geopoint.DistanceTo(geopointi); ! if (fDistance < fMinDistance) { fMinDistance = fDistance; nMinID = pMO->mnID; --- 1350,1363 ---- fMinDistance = 1e15f; nMinID = NULL_INDEX; ! for(int i=0;i<MAXMAPOBJ;i++) ! { pMO = &maMapObj[i]; ! if (pMO->mbExists) ! { geopointi.x = pMO->mfLon; geopointi.y = pMO->mfLat; fDistance = geopoint.DistanceTo(geopointi); ! if (fDistance < fMinDistance) ! { fMinDistance = fDistance; nMinID = pMO->mnID; *************** *** 1354,1361 **** } } ! if (fMinDistance <= fHookDistance) { return nMinID; } ! else { return NULL_INDEX; } --- 1365,1374 ---- } } ! if (fMinDistance <= fHookDistance) ! { return nMinID; } ! else ! { return NULL_INDEX; } *************** *** 1403,1409 **** --- 1416,1426 ---- } + /** + * OnLeaveWindow event handler + */ void tcTacticalMapView::OnLeaveWindow(wxMouseEvent& event) { mnScrollState = 0; + isLButtonDown = false; } *************** *** 1483,1490 **** bool bFlagsSet = (isShiftDown || isControlDown); ! wxPoint point = event.GetPosition(); if ((mbMapCmdActive)&&(!bFlagsSet)) { ! OnLButtonDownMapCmd(point); return; } --- 1500,1509 ---- bool bFlagsSet = (isShiftDown || isControlDown); ! buttonDownPoint = event.GetPosition(); ! ! if ((mbMapCmdActive)&&(!bFlagsSet)) { ! OnLButtonDownMapCmd(buttonDownPoint); return; } *************** *** 1492,1496 **** if (isControlDown) { ! SetViewCenterZoom(point,1.5f); tcSound::Get()->PlayEffect(SEFFECT_BEEP2); return; --- 1511,1515 ---- if (isControlDown) { ! SetViewCenterZoom(buttonDownPoint, 1.5f); tcSound::Get()->PlayEffect(SEFFECT_BEEP2); return; *************** *** 1498,1509 **** else if (isShiftDown) { ! SetViewCenterZoom(point,1.0f); tcSound::Get()->PlayEffect(SEFFECT_BEEP2); return; } ! Hook(point); tcWindow::SkipMouseEvent(event); } ! /***********************************************************************************/ /** * Old version returned true if button click is accepted, false otherwise. --- 1517,1544 ---- else if (isShiftDown) { ! SetViewCenterZoom(buttonDownPoint, 1.0f); tcSound::Get()->PlayEffect(SEFFECT_BEEP2); return; } ! Hook(buttonDownPoint); ! if (mnHookID == -1) ! { ! isLButtonDown = true; ! } tcWindow::SkipMouseEvent(event); } ! ! /** ! * Left mouse button up event handler. ! */ ! void tcTacticalMapView::OnLButtonUp(wxMouseEvent& event) ! { ! if (isLButtonDown) ! { ! isLButtonDown = false; ! } ! } ! ! /** * Old version returned true if button click is accepted, false otherwise. *************** *** 1540,1544 **** wxPoint point = event.GetPosition(); const int nScrollBorder = 10; ! mpointMouse = point; //TranslatePoint(point); if (mpointMouse.x <= nScrollBorder) { --- 1575,1581 ---- wxPoint point = event.GetPosition(); const int nScrollBorder = 10; ! ! mpointMouse = point; ! if (mpointMouse.x <= nScrollBorder) { *************** *** 1638,1641 **** --- 1675,1679 ---- maNavPointScreen.clear(); meSymbology = NTDS; + isLButtonDown = false; ClearMapObjects(); *************** *** 1746,1750 **** } /***********************************************************************************/ ! void tcWorldMapView::DrawTheaterBox(Graphics *apGraphics) { float width,height; tcPoint p1, p2; --- 1784,1789 ---- } /***********************************************************************************/ ! void tcWorldMapView::DrawTheaterBox(Graphics *apGraphics) ! { float width,height; tcPoint p1, p2; |
|
From: Dewitt C. <ddc...@us...> - 2004-04-03 15:51:50
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22160/docs Modified Files: CHANGES.txt Log Message: selection box drawing Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CHANGES.txt 30 Mar 2004 01:18:10 -0000 1.5 --- CHANGES.txt 3 Apr 2004 15:39:31 -0000 1.6 *************** *** 3,6 **** --- 3,9 ---- 0.6 --------------------------------------------------------------------- + *** 2004-04-03 Dewitt Colclough *** + - Added multi-unit selection box drawing to map + *** 2004-03-29 Dewitt Colclough *** - Finished code to write database to XML. This is planned to be used *************** *** 8,11 **** --- 11,17 ---- for a larger database in the future. + *** 2004-03-28 Xavi *** + - Linux compatibility fixes + *** 2004-03-24 Dewitt Colclough *** - Replaced libxml2 with TinyXml C++ library |
|
From: Dewitt C. <ddc...@us...> - 2004-04-03 15:51:50
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22160/include/sim Modified Files: tcMapView.h Log Message: selection box drawing Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapView.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcMapView.h 20 Mar 2004 18:46:46 -0000 1.17 --- tcMapView.h 3 Apr 2004 15:39:31 -0000 1.18 *************** *** 244,253 **** float mfScrollDirection; ! unsigned long mnHookID; UINT mnHookAlliance; float mfHookLon,mfHookLat; int mbMapCmdActive; teMapCmdType meMapCmd; ! wxPoint mpointMouse; tcPoint mpointGeoDatum; ///< for MC_DATUM map command to store user-selected location float mfMapCmdHeading; --- 244,253 ---- float mfScrollDirection; ! long mnHookID; 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; *************** *** 277,280 **** --- 277,281 ---- void DrawGrid(Gdiplus::Graphics *apGraphics); void DrawScaleBar(Gdiplus::Graphics *apGraphics); + void DrawSelectionBox(Gdiplus::Graphics *graphics); void DrawTerrainText(Gdiplus::Graphics *apGraphics); void DrawMapCmd(Gdiplus::Graphics *apGraphics, tcMapObj *pMO, teMapCmdType type); *************** *** 287,290 **** --- 288,292 ---- void OnLeaveWindow(wxMouseEvent& event); void OnLButtonDown(wxMouseEvent& event); + void OnLButtonUp(wxMouseEvent& event); void OnLButtonDownMapCmd(wxPoint point); void OnMouseMove(wxMouseEvent& event); *************** *** 299,302 **** --- 301,305 ---- void ToggleShowTrackTags() {mbShowTrackID = !mbShowTrackID;} void UpdateViewBounds() {mpMapData->GetTheaterArea(mrectViewBounds);} + tcTacticalMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, *************** *** 313,319 **** teSymbology meSymbology; float mfSymbolXOffset, mfSymbolYOffset; ! void Build2525(void); ! void BuildNTDS(void); UINT32 GetAffiliationColor(teAffiliation a); Gdiplus::Image* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); --- 316,325 ---- 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 ! ! void Build2525(); ! void BuildNTDS(); UINT32 GetAffiliationColor(teAffiliation a); Gdiplus::Image* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); |
|
From: Dewitt C. <ddc...@us...> - 2004-04-03 15:51:50
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22160/include/common Modified Files: simmath.h Log Message: selection box drawing Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** simmath.h 7 Feb 2004 02:19:53 -0000 1.9 --- simmath.h 3 Apr 2004 15:39:31 -0000 1.10 *************** *** 43,46 **** --- 43,50 ---- float y; float DistanceTo(tcPoint p) {return (sqrtf((p.x-x)*(p.x-x)+(p.y-y)*(p.y-y)));} + + tcPoint() : x(0), y(0) {} + tcPoint(float ax, float ay) : x(ax), y(ay) {} + tcPoint(const tcPoint &p) : x(p.x), y(p.y) {} }; |
|
From: Dewitt C. <ddc...@us...> - 2004-03-30 01:29:43
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6089/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CHANGES.txt 25 Mar 2004 01:33:38 -0000 1.4 --- CHANGES.txt 30 Mar 2004 01:18:10 -0000 1.5 *************** *** 3,6 **** --- 3,11 ---- 0.6 --------------------------------------------------------------------- + *** 2004-03-29 Dewitt Colclough *** + - Finished code to write database to XML. This is planned to be used + for the database viewer, though performance may make this a bad idea + for a larger database in the future. + *** 2004-03-24 Dewitt Colclough *** - Replaced libxml2 with TinyXml C++ library |
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5617/src/database Modified Files: tcDatabaseObject.cpp tcGenericDBObject.cpp tcLauncherDBObject.cpp tcMissileDBObject.cpp tcRadarDBObject.cpp tcSensorDBObject.cpp Log Message: Code to write database to xml Index: tcSensorDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSensorDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.4 --- tcSensorDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.5 *************** *** 29,35 **** #include "math_constants.h" #include "randfn.h" - //#include "AError.h" #include "CsvTranslator.h" ! using namespace std; --- 29,34 ---- #include "math_constants.h" #include "randfn.h" #include "CsvTranslator.h" ! #include "common/tinyxml.h" using namespace std; *************** *** 95,107 **** if (load) return; // write only for now wxASSERT(node); ! /* ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); ! */ tcDatabaseObject::SerializeXml(node, load); } --- 94,105 ---- if (load) return; // write only for now wxASSERT(node); ! ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("sensor"))->ToElement(); ! ! localNode->SetAttribute("maxRange_km" ,mfMaxRange_km); ! localNode->SetAttribute("refRange_km", mfRefRange_km); ! localNode->SetAttribute("fieldOfView_deg", mfFieldOfView_deg); ! localNode->SetAttribute("scanPeriod_s", mfScanPeriod_s); ! tcDatabaseObject::SerializeXml(node, load); } Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcRadarDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.8 --- tcRadarDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.9 *************** *** 29,35 **** #include "math_constants.h" #include "randfn.h" - //#include "AError.h" #include "CsvTranslator.h" ! using namespace std; --- 29,34 ---- #include "math_constants.h" #include "randfn.h" #include "CsvTranslator.h" ! #include "common/tinyxml.h" using namespace std; *************** *** 143,155 **** if (load) return; // write only for now wxASSERT(node); ! /* ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); ! */ tcSensorDBObject::SerializeXml(node, load); } --- 142,157 ---- if (load) return; // write only for now wxASSERT(node); ! ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("radar"))->ToElement(); ! ! localNode->SetAttribute("minRange_km", mfMinRange_km); ! localNode->SetAttribute("erp", mfERP_dBW); ! localNode->SetAttribute("minRangeRate_mps", mfMinRangeRate_mps); ! localNode->SetAttribute("maxFireControlTracks", (int)maxFireControlTracks); ! localNode->SetAttribute("isSemiactive", (int)isSemiactive); ! localNode->SetAttribute("isCommandReceiver", (int)isCommandReceiver); ! localNode->SetAttribute("detectsSurface", (int)mbDetectsSurface); ! localNode->SetAttribute("detectsAir", (int)mbDetectsAir); ! tcSensorDBObject::SerializeXml(node, load); } Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMissileDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.6 --- tcMissileDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.7 *************** *** 30,37 **** #include "math_constants.h" #include "randfn.h" - //#include "AError.h" #include "CsvTranslator.h" #include "tcDatabase.h" ! using namespace std; --- 30,36 ---- #include "math_constants.h" #include "randfn.h" #include "CsvTranslator.h" #include "tcDatabase.h" ! #include "common/tinyxml.h" using namespace std; *************** *** 261,273 **** if (load) return; // write only for now wxASSERT(node); ! /* ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); ! */ tcDatabaseObject::SerializeXml(node, load); } --- 260,298 ---- if (load) return; // write only for now wxASSERT(node); ! ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("missile"))->ToElement(); ! ! localNode->SetAttribute("mass_kg", mfMass_kg); ! localNode->SetAttribute("dragArea_sm", mfDragArea_sm); ! localNode->SetAttribute("gmax", mfGmax); ! localNode->SetAttribute("maxTurnRate_degps", mfMaxTurnRate_degps); ! localNode->SetAttribute("cdpsub", mfCdpsub); ! localNode->SetAttribute("cdptran", mfCdptran); ! localNode->SetAttribute("cdpsup", mfCdpsup); ! localNode->SetAttribute("mcm", mfMcm); ! localNode->SetAttribute("msupm", mfMsupm); ! localNode->SetAttribute("kdi", mfKdi); ! localNode->SetAttribute("boostThrust_N", mfBoostThrust_N); ! localNode->SetAttribute("boostTime_s", mfBoostTime_s); ! localNode->SetAttribute("sustThrust_N", mfSustThrust_N); ! localNode->SetAttribute("sustTime_s", mfSustTime_s); ! localNode->SetAttribute("damage", mfDamage); ! localNode->SetAttribute("damageType", (int)meDamageType); ! localNode->SetAttribute("rcs_dbsm", mfRcs_dbsm); ! localNode->SetAttribute("range_km", mfRange_km); ! localNode->SetAttribute("shutdownSpeed_mps", mfShutdownSpeed_mps); ! localNode->SetAttribute("primarySensor", maSensorClass[0].mz); ! localNode->SetAttribute("secondarySensor", maSensorClass[1].mz); ! ! for(unsigned int i=0;(i<mnNumSegments)&&(i<MAX_MISSILE_FLIGHT_SEGMENTS);i++) ! { ! TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("segment"))->ToElement(); ! ! childNode->SetAttribute("range", maFlightProfile[i].mfRange_km); ! childNode->SetAttribute("alt", maFlightProfile[i].mfAltitude_m); ! childNode->SetAttribute("altMode", (int)maFlightProfile[i].meAltitudeMode); ! childNode->SetAttribute("guidanceMode", (int)maFlightProfile[i].meGuidanceMode); ! } ! tcDatabaseObject::SerializeXml(node, load); } Index: tcLauncherDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcLauncherDBObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcLauncherDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.5 --- tcLauncherDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.6 *************** *** 32,36 **** //#include "AError.h" #include "CsvTranslator.h" ! using namespace std; --- 32,36 ---- //#include "AError.h" #include "CsvTranslator.h" ! #include "common/tinyxml.h" using namespace std; *************** *** 128,140 **** if (load) return; // write only for now wxASSERT(node); ! /* ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); ! */ tcDatabaseObject::SerializeXml(node, load); } --- 128,146 ---- if (load) return; // write only for now wxASSERT(node); ! ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("launcher"))->ToElement(); ! ! localNode->SetAttribute("capacity", (int)mnCapacity); ! localNode->SetAttribute("childClass", mzChildClass.mz); ! localNode->SetAttribute("fcSensorClass", fireControlSensorClass); ! ! for(unsigned int i=0;(i<mnConfigurations)&&(i<MAX_LAUNCHER_CONFIGURATIONS);i++) ! { ! TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("config"))->ToElement(); ! childNode->SetAttribute("capacity", (int)maCapacity[i]); ! childNode->SetAttribute("childClass", maChildClass[i].mz); ! } ! ! tcDatabaseObject::SerializeXml(node, load); } Index: tcDatabaseObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDatabaseObject.cpp 28 Mar 2004 23:12:28 -0000 1.8 --- tcDatabaseObject.cpp 30 Mar 2004 01:15:21 -0000 1.9 *************** *** 226,231 **** node->SetAttribute("funcType", int(mnType)); node->SetAttribute("image", mzImageFileName.mz); ! node->SetAttribute("3DModel", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); descriptionNode->InsertEndChild(TiXmlText(mzDescription)); } --- 226,231 ---- node->SetAttribute("funcType", int(mnType)); node->SetAttribute("image", mzImageFileName.mz); ! node->SetAttribute("model3D", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("notes")); descriptionNode->InsertEndChild(TiXmlText(mzDescription)); } Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcGenericDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.6 --- tcGenericDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.7 *************** *** 302,314 **** if (load) return; // write only for now wxASSERT(node); - /* - node->SetAttribute("DBCLASS", mzClass.mz); - node->SetAttribute("MODELTYPE", int(mnModelType)); - node->SetAttribute("FUNCTYPE", int(mnType)); - node->SetAttribute("IMAGE", mzImageFileName.mz); - node->SetAttribute("3DMODEL", mz3DModelFileName.mz); - TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); - descriptionNode->InsertEndChild(TiXmlText(mzDescription)); - */ TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("generic"))->ToElement(); --- 302,305 ---- |
|
From: Dewitt C. <ddc...@us...> - 2004-03-29 22:35:01
|
Update of /cvsroot/gcblue/gcblue.com/Templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6621/Templates Modified Files: doc.dwt gc.dwt Log Message: Index: doc.dwt =================================================================== RCS file: /cvsroot/gcblue/gcblue.com/Templates/doc.dwt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** doc.dwt 30 Nov 2003 14:55:47 -0000 1.1 --- doc.dwt 29 Mar 2004 22:23:29 -0000 1.2 *************** *** 18,22 **** <td><div align="center"><font size="-1" face="Arial, Helvetica, sans-serif"><a href="../index.html"><strong>Home</strong></a> <strong>• <a href="../docs.htm">Docs</a> • <a href="../gc_contact.htm"></a> ! <a href="../script_tutorial.htm">Scripting info</a> • <a href="../gc_contact.htm">Contact</a></strong></font></div></td> </tr> <tr> --- 18,22 ---- <td><div align="center"><font size="-1" face="Arial, Helvetica, sans-serif"><a href="../index.html"><strong>Home</strong></a> <strong>• <a href="../docs.htm">Docs</a> • <a href="../gc_contact.htm"></a> ! <a href="../script_tutorial/script_tutorial.htm">Scripting info</a> • <a href="../gc_contact.htm">Contact</a></strong></font></div></td> </tr> <tr> Index: gc.dwt =================================================================== RCS file: /cvsroot/gcblue/gcblue.com/Templates/gc.dwt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gc.dwt 30 Nov 2003 14:55:47 -0000 1.1 --- gc.dwt 29 Mar 2004 22:23:29 -0000 1.2 *************** *** 42,46 **** <tr> <td align="center" bordercolor="#999999"> <hr> ! <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2003 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> --- 42,46 ---- <tr> <td align="center" bordercolor="#999999"> <hr> ! <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> |
|
From: Dewitt C. <ddc...@us...> - 2004-03-28 23:23:49
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1383/src/database Modified Files: tcAirDBObject.cpp tcDatabase.cpp tcDatabaseObject.cpp tcESMDBObject.cpp tcFixedDBObject.cpp tcFlightportDBObject.cpp tcGenericDBObject.cpp tcLauncherDBObject.cpp tcMissileDBObject.cpp tcRadarDBObject.cpp tcSensorDBObject.cpp Log Message: Index: tcESMDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcESMDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcESMDBObject.cpp 28 Mar 2004 19:00:05 -0000 1.4 --- tcESMDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.5 *************** *** 66,69 **** --- 66,81 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcESMDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + + tcSensorDBObject::SerializeXml(node, load); + } + int tcESMDBObject::WriteCSVHeader(Database::CsvTranslator *csv) Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcRadarDBObject.cpp 28 Mar 2004 18:55:40 -0000 1.7 --- tcRadarDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.8 *************** *** 135,138 **** --- 135,158 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcRadarDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + /* + node->SetAttribute("DBCLASS", mzClass.mz); + node->SetAttribute("MODELTYPE", int(mnModelType)); + node->SetAttribute("FUNCTYPE", int(mnType)); + node->SetAttribute("IMAGE", mzImageFileName.mz); + node->SetAttribute("3DMODEL", mz3DModelFileName.mz); + TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); + descriptionNode->InsertEndChild(TiXmlText(mzDescription)); + */ + tcSensorDBObject::SerializeXml(node, load); + } + int tcRadarDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { Index: tcFlightportDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcFlightportDBObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcFlightportDBObject.cpp 4 Jan 2004 22:24:52 -0000 1.1 --- tcFlightportDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- #include "randfn.h" #include "CsvTranslator.h" + #include "common/tinyxml.h" *************** *** 109,112 **** --- 110,182 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcFlightportDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + + + TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("FlightPort"))->ToElement(); + + localNode->SetAttribute("onlyHelo", (int)heloOnly); + localNode->SetAttribute("hangarCap", (int)hangarCapacity); + + for(std::vector<spotDBInfo>::iterator iter = spotInfo.begin() + ; iter != spotInfo.end(); ++iter) + { + TiXmlElement* spotNode = node->InsertEndChild(TiXmlElement("Spot"))->ToElement(); + spotNode->SetAttribute("isLaunch", (*iter).isLaunch); + spotNode->SetAttribute("x", (*iter).x); + spotNode->SetAttribute("y", (*iter).y); + spotNode->SetAttribute("z", (*iter).z); + spotNode->SetAttribute("orientation", (*iter).orientation_deg); + spotNode->SetAttribute("length", (*iter).length); + } + + /* + std::vector::iterator + *csv << (long)heloOnly; ///< set non-zero for helo-only flight port + *csv << (long)hangarCapacity; + size_t numSpots = spotInfo.size(); + size_t i; + for(i=0;i<MAX_DB_SPOTS;i++) + { + if (i<numSpots) + { + spotDBInfo info = spotInfo[i]; + *csv << (long)info.isLaunch; + *csv << info.x; + *csv << info.y; // y and z swapped in header due to OSG coord change + *csv << info.z; + *csv << info.orientation_deg; + *csv << info.length; + } + else + { + *csv << ""; + *csv << ""; + *csv << ""; + *csv << ""; + *csv << ""; + *csv << ""; + } + } + */ + /* + node->SetAttribute("DBCLASS", mzClass.mz); + node->SetAttribute("MODELTYPE", int(mnModelType)); + node->SetAttribute("FUNCTYPE", int(mnType)); + node->SetAttribute("IMAGE", mzImageFileName.mz); + node->SetAttribute("3DMODEL", mz3DModelFileName.mz); + TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); + descriptionNode->InsertEndChild(TiXmlText(mzDescription)); + */ + tcDatabaseObject::SerializeXml(node, load); + } + + int tcFlightportDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { Index: tcLauncherDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcLauncherDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcLauncherDBObject.cpp 28 Mar 2004 18:58:29 -0000 1.4 --- tcLauncherDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.5 *************** *** 120,123 **** --- 120,143 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcLauncherDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + /* + node->SetAttribute("DBCLASS", mzClass.mz); + node->SetAttribute("MODELTYPE", int(mnModelType)); + node->SetAttribute("FUNCTYPE", int(mnType)); + node->SetAttribute("IMAGE", mzImageFileName.mz); + node->SetAttribute("3DMODEL", mz3DModelFileName.mz); + TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); + descriptionNode->InsertEndChild(TiXmlText(mzDescription)); + */ + tcDatabaseObject::SerializeXml(node, load); + } + int tcLauncherDBObject::WriteCSVHeader(Database::CsvTranslator *csv) Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcGenericDBObject.cpp 14 Jan 2004 01:13:22 -0000 1.5 --- tcGenericDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.6 *************** *** 27,30 **** --- 27,31 ---- #include "CsvTranslator.h" #include "tc3DModel.h" + #include "common/tinyxml.h" using namespace std; *************** *** 293,296 **** --- 294,367 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcGenericDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + /* + node->SetAttribute("DBCLASS", mzClass.mz); + node->SetAttribute("MODELTYPE", int(mnModelType)); + node->SetAttribute("FUNCTYPE", int(mnType)); + node->SetAttribute("IMAGE", mzImageFileName.mz); + node->SetAttribute("3DMODEL", mz3DModelFileName.mz); + TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); + descriptionNode->InsertEndChild(TiXmlText(mzDescription)); + */ + + TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("generic"))->ToElement(); + + + localNode->SetAttribute("rcs_dbsm", mfRcs_dbsm); + localNode->SetAttribute("maxSpeed_kts", mfMaxSpeed_kts); + localNode->SetAttribute("accel_ktsps", mfAccel_ktsps); + localNode->SetAttribute("turnRate_degps", mfTurnRate_degps); + localNode->SetAttribute("fuelCapacity_kg", mfFuelCapacity_kg); + localNode->SetAttribute("fuelRate_kgps", mfFuelRate_kgps); + localNode->SetAttribute("maxAltitude_m", mfMaxAltitude_m); + localNode->SetAttribute("maxDepth_m", mfMaxDepth_m); + localNode->SetAttribute("altitudeRate_mps", mfAltitudeRate_mps); + localNode->SetAttribute("toughness", mfToughness); + localNode->SetAttribute("damage", mfDamage); + localNode->SetAttribute("weight_kg", mfWeight_kg); + localNode->SetAttribute("maxThrust_N", mfMaxThrust_N); + localNode->SetAttribute("range_km", mfRange_km); + + // write flightport info if one exists for this object + if (strlen(flightportClass.mz)) + { + TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("flightPort"))->ToElement(); + childNode->SetAttribute("class", flightportClass.mz); + } + + int i; + for(i=0;(i<mnNumLaunchers)&&(i<MAXLAUNCHERS);i++) + { + TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("launcher"))->ToElement(); + childNode->SetAttribute("class", maLauncherClass[i].mz); + childNode->SetAttribute("az", launcherAz[i]); + } + + for(i=0;(i<mnNumSensors)&&(i<MAXSENSORS);i++) + { + TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("sensor"))->ToElement(); + childNode->SetAttribute("class", maSensorClass[i].mz); + childNode->SetAttribute("az", sensorAz[i]); + } + + for(std::vector<animationDBInfo>::iterator iter = animationInfo.begin() + ; iter != animationInfo.end(); ++iter) + { + TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("animation"))->ToElement(); + childNode->SetAttribute("object", (*iter).objectName); + childNode->SetAttribute("type", (*iter).animationType); + childNode->SetAttribute("param", (*iter).param); + } + + tcDatabaseObject::SerializeXml(node, load); + } + int tcGenericDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDatabase.cpp 25 Mar 2004 01:33:39 -0000 1.8 --- tcDatabase.cpp 28 Mar 2004 23:12:28 -0000 1.9 *************** *** 168,172 **** // create root node to be XML compliant ! TiXmlNode* root = doc->InsertEndChild(TiXmlElement("DATA")); // for each DB object: add new TiXmlElement to doc, and call virtual SerializeXml method --- 168,172 ---- // create root node to be XML compliant ! TiXmlNode* root = doc->InsertEndChild(TiXmlElement("data")); // for each DB object: add new TiXmlElement to doc, and call virtual SerializeXml method *************** *** 182,186 **** wxASSERT(obj); ! TiXmlNode* objNode = root->InsertEndChild(TiXmlElement("OBJ")); obj->SerializeXml(objNode->ToElement(), false); } --- 182,186 ---- wxASSERT(obj); ! TiXmlNode* objNode = root->InsertEndChild(TiXmlElement("obj")); obj->SerializeXml(objNode->ToElement(), false); } Index: tcAirDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcAirDBObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcAirDBObject.cpp 29 Jan 2004 00:05:22 -0000 1.6 --- tcAirDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.7 *************** *** 25,28 **** --- 25,29 ---- #include "tcGenericDBObject.h" #include "CsvTranslator.h" + #include "common/tinyxml.h" namespace Database *************** *** 75,78 **** --- 76,108 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcAirDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + + TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("air"))->ToElement(); + + localNode->SetAttribute("altThrustDecay_pm", mfAltThrustDecay_pm); + localNode->SetAttribute("afterburnFuelRate_kgps", mfAfterburnFuelRate_kgps); + localNode->SetAttribute("afterburnThrust_N", mfAfterburnThrust_N); + localNode->SetAttribute("dragArea_sm", mfDragArea_sm); + localNode->SetAttribute("wingArea_sm", mfWingArea_sm); + localNode->SetAttribute("cdpsub", mfCdpsub); + localNode->SetAttribute("cdptran", mfCdptran); + localNode->SetAttribute("cdpsup", mfCdpsup); + localNode->SetAttribute("mcm", mfMcm); + localNode->SetAttribute("msupm", mfMsupm); + localNode->SetAttribute("kdi", mfKdi); + localNode->SetAttribute("maxAoa_rad", mfMaxAoa_rad); + localNode->SetAttribute("maxCl", mfMaxCl); + localNode->SetAttribute("gmax", mfGmax); + + tcGenericDBObject::SerializeXml(node, load); + } + int tcAirDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { Index: tcSensorDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorDBObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorDBObject.cpp 28 Mar 2004 18:53:03 -0000 1.3 --- tcSensorDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.4 *************** *** 87,90 **** --- 87,110 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcSensorDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + /* + node->SetAttribute("DBCLASS", mzClass.mz); + node->SetAttribute("MODELTYPE", int(mnModelType)); + node->SetAttribute("FUNCTYPE", int(mnType)); + node->SetAttribute("IMAGE", mzImageFileName.mz); + node->SetAttribute("3DMODEL", mz3DModelFileName.mz); + TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); + descriptionNode->InsertEndChild(TiXmlText(mzDescription)); + */ + tcDatabaseObject::SerializeXml(node, load); + } + int tcSensorDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { Index: tcFixedDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcFixedDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFixedDBObject.cpp 28 Mar 2004 18:59:05 -0000 1.4 --- tcFixedDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.5 *************** *** 64,67 **** --- 64,79 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcFixedDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + + tcDatabaseObject::SerializeXml(node, load); + } + int tcFixedDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { Index: tcDatabaseObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcDatabaseObject.cpp 28 Mar 2004 18:57:02 -0000 1.7 --- tcDatabaseObject.cpp 28 Mar 2004 23:12:28 -0000 1.8 *************** *** 211,233 **** return 1; } ! ! /** ! * Loads/saves XML data for database object ! * @param load true to load, false to save ! */ ! ! void tcDatabaseObject::SerializeXml(TiXmlElement* node, bool load) ! { ! if (load) return; // write only for now ! wxASSERT(node); ! ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); } int tcDatabaseObject::WriteCSVHeader(Database::CsvTranslator *csv) --- 211,234 ---- return 1; } ! ! ! /** ! * Loads/saves XML data for database object ! * @param load true to load, false to save ! */ ! void tcDatabaseObject::SerializeXml(TiXmlElement* node, bool load) ! { ! if (load) return; // write only for now ! wxASSERT(node); ! node->SetAttribute("dbClass", GetClassName()); ! node->SetAttribute("class", mzClass.mz); ! node->SetAttribute("modelType", int(mnModelType)); ! node->SetAttribute("funcType", int(mnType)); ! node->SetAttribute("image", mzImageFileName.mz); ! node->SetAttribute("3DModel", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); } + int tcDatabaseObject::WriteCSVHeader(Database::CsvTranslator *csv) Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMissileDBObject.cpp 28 Mar 2004 18:57:40 -0000 1.5 --- tcMissileDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.6 *************** *** 253,256 **** --- 253,276 ---- } + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcMissileDBObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + /* + node->SetAttribute("DBCLASS", mzClass.mz); + node->SetAttribute("MODELTYPE", int(mnModelType)); + node->SetAttribute("FUNCTYPE", int(mnType)); + node->SetAttribute("IMAGE", mzImageFileName.mz); + node->SetAttribute("3DMODEL", mz3DModelFileName.mz); + TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); + descriptionNode->InsertEndChild(TiXmlText(mzDescription)); + */ + tcDatabaseObject::SerializeXml(node, load); + } + int tcMissileDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { |
|
From: Dewitt C. <ddc...@us...> - 2004-03-28 23:23:49
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1383/include/database Modified Files: tcAirDBObject.h tcDatabaseObject.h tcESMDBObject.h tcFixedDBObject.h tcFlightportDBObject.h tcGenericDBObject.h tcLauncherDBObject.h tcMissileDBObject.h tcRadarDBObject.h tcSensorDBObject.h Log Message: Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcGenericDBObject.h 28 Mar 2004 14:26:35 -0000 1.6 --- tcGenericDBObject.h 28 Mar 2004 23:12:27 -0000 1.7 *************** *** 31,34 **** --- 31,35 ---- struct animationDBInfo; + class TiXmlElement; namespace Database *************** *** 74,81 **** --- 75,84 ---- void Animate3DModel(); + virtual const char* GetClassName() {return "Generic";} ///< returns class name of database object void RandInit(); virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcGenericDBObject(); Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcDatabaseObject.h 28 Mar 2004 19:02:17 -0000 1.9 --- tcDatabaseObject.h 28 Mar 2004 23:12:27 -0000 1.10 *************** *** 127,130 **** --- 127,131 ---- static void AttachDatabase(tcDatabase *db) {database = db;} + virtual const char* GetClassName() {return "Object";} ///< returns class name of database object tc3DModel* Get3DModel(); void Load3DModel(); Index: tcRadarDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcRadarDBObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcRadarDBObject.h 28 Mar 2004 14:22:57 -0000 1.6 --- tcRadarDBObject.h 28 Mar 2004 23:12:27 -0000 1.7 *************** *** 29,32 **** --- 29,34 ---- #include "tcSensorDBObject.h" + class TiXmlElement; + namespace Database { *************** *** 45,51 **** --- 47,55 ---- float mfGrowth[8]; ///< growth fields (TODO delete, but make sure nothing breaks!) + virtual const char* GetClassName() {return "Radar";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcRadarDBObject(); Index: tcSensorDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSensorDBObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorDBObject.h 28 Mar 2004 18:47:07 -0000 1.3 --- tcSensorDBObject.h 28 Mar 2004 23:12:27 -0000 1.4 *************** *** 29,32 **** --- 29,34 ---- #include "tcDatabaseObject.h" + class TiXmlElement; + namespace Database { *************** *** 39,46 **** --- 41,51 ---- float mfScanPeriod_s; ///< [s] + virtual const char* GetClassName() {return "Sensor";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings + tcSensorDBObject(); tcSensorDBObject(tcSensorDBObject& obj); ///< copy constructor Index: tcFixedDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcFixedDBObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcFixedDBObject.h 28 Mar 2004 18:47:07 -0000 1.3 --- tcFixedDBObject.h 28 Mar 2004 23:12:27 -0000 1.4 *************** *** 29,32 **** --- 29,34 ---- #include "tcDatabaseObject.h" + + namespace Database { *************** *** 34,40 **** --- 36,44 ---- { public: + virtual const char* GetClassName() {return "Fixed";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings Index: tcAirDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcAirDBObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcAirDBObject.h 28 Mar 2004 14:24:27 -0000 1.6 --- tcAirDBObject.h 28 Mar 2004 23:12:27 -0000 1.7 *************** *** 34,37 **** --- 34,39 ---- #include "tcFile.h" + class TiXmlElement; + namespace Database { *************** *** 60,67 **** float mfMaxCl; ///< max lift coefficient float mfGmax; ///< max Gs ! void PrintToFile(tcFile& file) {} ///< not supported, redundant with CSV serialization, TODO get rid of these int Serialize(tcFile& file, bool mbLoad) {return 0;} ///< binary serialization not supported here int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings --- 62,71 ---- float mfMaxCl; ///< max lift coefficient float mfGmax; ///< max Gs ! ! virtual const char* GetClassName() {return "Air";} ///< returns class name of database object void PrintToFile(tcFile& file) {} ///< not supported, redundant with CSV serialization, TODO get rid of these int Serialize(tcFile& file, bool mbLoad) {return 0;} ///< binary serialization not supported here int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings Index: tcLauncherDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcLauncherDBObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcLauncherDBObject.h 28 Mar 2004 14:24:27 -0000 1.4 --- tcLauncherDBObject.h 28 Mar 2004 23:12:27 -0000 1.5 *************** *** 29,32 **** --- 29,34 ---- #include "tcDatabaseObject.h" + class TiXmlElement; + namespace Database { *************** *** 43,50 **** std::string fireControlSensorClass; ///< class of sensor on platform for fire control ///< (track required to launch) ! virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings --- 45,53 ---- std::string fireControlSensorClass; ///< class of sensor on platform for fire control ///< (track required to launch) ! virtual const char* GetClassName() {return "Launcher";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings Index: tcMissileDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcMissileDBObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMissileDBObject.h 28 Mar 2004 14:22:57 -0000 1.7 --- tcMissileDBObject.h 28 Mar 2004 23:12:27 -0000 1.8 *************** *** 29,32 **** --- 29,34 ---- #include "tcDatabaseObject.h" + class TiXmlElement; + namespace Database { *************** *** 109,112 **** --- 111,115 ---- tsMissileFlightSegment maFlightProfile[MAX_MISSILE_FLIGHT_SEGMENTS]; + virtual const char* GetClassName() {return "Missile";} ///< returns class name of database object teWeaponLaunchMode GetLaunchMode(void); tnPoolIndex GetPrimarySeekerKey(); *************** *** 114,117 **** --- 117,121 ---- int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcMissileDBObject(); Index: tcESMDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcESMDBObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcESMDBObject.h 28 Mar 2004 18:47:07 -0000 1.3 --- tcESMDBObject.h 28 Mar 2004 23:12:27 -0000 1.4 *************** *** 36,43 **** { public: ! virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcESMDBObject(); --- 36,44 ---- { public: ! virtual const char* GetClassName() {return "ESM";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcESMDBObject(); Index: tcFlightportDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcFlightportDBObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcFlightportDBObject.h 28 Mar 2004 14:26:35 -0000 1.2 --- tcFlightportDBObject.h 28 Mar 2004 23:12:27 -0000 1.3 *************** *** 29,32 **** --- 29,34 ---- #include <vector> + class TiXmlElement; + namespace Database { *************** *** 53,60 **** unsigned int hangarCapacity; std::vector<spotDBInfo> spotInfo; ! void RandInit(); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcFlightportDBObject(); --- 55,64 ---- unsigned int hangarCapacity; std::vector<spotDBInfo> spotInfo; ! ! virtual const char* GetClassName() {return "FlightPort";} ///< returns class name of database object void RandInit(); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcFlightportDBObject(); |
|
From: Xavi <xr...@us...> - 2004-03-28 19:14:07
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12965 Modified Files: tcDatabase.h Log Message: + newline at the end of file + added ifdef where needed + removed typedef declaration; instead it uses gctypes.h Index: tcDatabase.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabase.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcDatabase.h 25 Mar 2004 01:33:38 -0000 1.4 --- tcDatabase.h 28 Mar 2004 19:02:47 -0000 1.5 *************** *** 23,27 **** --- 23,29 ---- #define _TCDATABASE_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcPool.h" *************** *** 31,42 **** #include "tcDatabaseObject.h" ! #include "wx/wx.h" #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions #endif ! #ifndef UINT16 ! typedef unsigned short UINT16; ! #endif namespace Database --- 33,42 ---- #include "tcDatabaseObject.h" ! #include <wx/wx.h> #ifdef WIN32 ! #include <wx/msw/private.h> // for MS Windows specific definitions #endif ! #include "gctypes.h" namespace Database *************** *** 83,87 **** void LoadDBCSV(std::string suffix = ""); void SaveDBCSV(std::string suffix = ""); ! void LoadDBXml(std::string suffix = ""); void SaveDBXml(std::string suffix = ""); void RandomizePlatforms(void); --- 83,87 ---- void LoadDBCSV(std::string suffix = ""); void SaveDBCSV(std::string suffix = ""); ! void LoadDBXml(std::string suffix = ""); void SaveDBXml(std::string suffix = ""); void RandomizePlatforms(void); *************** *** 89,93 **** int Serialize(tcFile& file, bool mbLoad); int SerializeCSV(std::string suffix, bool mbLoad); ! void SerializeXml(std::string suffix, bool load); tcDatabase(); ~tcDatabase(); --- 89,93 ---- int Serialize(tcFile& file, bool mbLoad); int SerializeCSV(std::string suffix, bool mbLoad); ! void SerializeXml(std::string suffix, bool load); tcDatabase(); ~tcDatabase(); |
|
From: Xavi <xr...@us...> - 2004-03-28 19:13:37
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12892 Modified Files: tcDatabaseObject.h Log Message: + newline at the end of file + added ifdef where needed + removed typedef declaration; instead it uses gctypes.h Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDatabaseObject.h 25 Mar 2004 01:33:38 -0000 1.8 --- tcDatabaseObject.h 28 Mar 2004 19:02:17 -0000 1.9 *************** *** 23,27 **** --- 23,29 ---- #define _DATABASEOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "wx/wx.h" *************** *** 33,40 **** #include "tcFile.h" #include "tcDBString.h" - #ifndef UINT16 - typedef unsigned short UINT16; - #endif class tc3DModel; --- 35,40 ---- #include "tcFile.h" #include "tcDBString.h" + #include "gctypes.h" class tc3DModel; *************** *** 133,137 **** int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization ! virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcDatabaseObject(); --- 133,137 ---- int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization ! virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcDatabaseObject(); *************** *** 146,148 **** } ! #endif \ No newline at end of file --- 146,148 ---- } ! #endif |
|
From: Xavi <xr...@us...> - 2004-03-28 19:11:24
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12580 Modified Files: tcESMDBObject.cpp Log Message: newline at the end of file added ifdef where needed Index: tcESMDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcESMDBObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcESMDBObject.cpp 4 Jan 2004 22:24:52 -0000 1.3 --- tcESMDBObject.cpp 28 Mar 2004 19:00:05 -0000 1.4 *************** *** 22,31 **** #include "stdwx.h" #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #include "tcESMDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "aerror.h" #include "CsvTranslator.h" --- 22,34 ---- #include "stdwx.h" + #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. + #endif // _MSC_VER > 1000 + #include "tcESMDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "AError.h" #include "CsvTranslator.h" *************** *** 95,97 **** ! } \ No newline at end of file --- 98,100 ---- ! } |
|
From: Xavi <xr...@us...> - 2004-03-28 19:10:25
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12355 Modified Files: tcFixedDBObject.cpp Log Message: newline at the end of file added ifdef where needed Index: tcFixedDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcFixedDBObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcFixedDBObject.cpp 4 Jan 2004 22:24:52 -0000 1.3 --- tcFixedDBObject.cpp 28 Mar 2004 18:59:05 -0000 1.4 *************** *** 22,31 **** #include "stdwx.h" #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #include "tcFixedDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "aerror.h" #include "CsvTranslator.h" --- 22,33 ---- #include "stdwx.h" + #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. + #endif // _MSC_VER > 1000 #include "tcFixedDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "AError.h" #include "CsvTranslator.h" *************** *** 87,89 **** } ! } \ No newline at end of file --- 89,92 ---- } ! } ! |
|
From: Xavi <xr...@us...> - 2004-03-28 19:09:49
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12203 Modified Files: tcLauncherDBObject.cpp Log Message: newline at the end of file added ifdef where needed Index: tcLauncherDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcLauncherDBObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcLauncherDBObject.cpp 30 Jan 2004 01:02:35 -0000 1.3 --- tcLauncherDBObject.cpp 28 Mar 2004 18:58:29 -0000 1.4 *************** *** 21,31 **** #include "stdwx.h" ! #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #include "tcLauncherDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "aerror.h" #include "CsvTranslator.h" --- 21,34 ---- #include "stdwx.h" ! #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. + #endif // _MSC_VER > 1000 + + #include "tcLauncherDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "AError.h" #include "CsvTranslator.h" *************** *** 174,176 **** ! } \ No newline at end of file --- 177,179 ---- ! } |
|
From: Xavi <xr...@us...> - 2004-03-28 19:08:59
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12072 Modified Files: tcMissileDBObject.cpp Log Message: newline at the end of file added ifdef where needed Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMissileDBObject.cpp 30 Jan 2004 01:02:35 -0000 1.4 --- tcMissileDBObject.cpp 28 Mar 2004 18:57:40 -0000 1.5 *************** *** 22,31 **** #include "stdwx.h" #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #include "tcMissileDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "aerror.h" #include "CsvTranslator.h" #include "tcDatabase.h" --- 22,34 ---- #include "stdwx.h" + #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. + #endif // _MSC_VER > 1000 + #include "tcMissileDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "AError.h" #include "CsvTranslator.h" #include "tcDatabase.h" *************** *** 371,373 **** } ! } // namespace Database \ No newline at end of file --- 374,377 ---- } ! } // namespace Database ! |
|
From: Xavi <xr...@us...> - 2004-03-28 19:08:22
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11978 Modified Files: tcDatabaseObject.cpp Log Message: newline at the end of file added ifdef where needed Index: tcDatabaseObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDatabaseObject.cpp 25 Mar 2004 01:33:39 -0000 1.6 --- tcDatabaseObject.cpp 28 Mar 2004 18:57:02 -0000 1.7 *************** *** 22,27 **** #include "stdwx.h" ! #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #include "tcDatabaseObject.h" --- 22,29 ---- #include "stdwx.h" ! #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. + #endif + #include "tcDatabaseObject.h" *************** *** 29,33 **** #include "math_constants.h" #include "randfn.h" ! //#include "aerror.h" #include <iostream> #include <fstream> --- 31,35 ---- #include "math_constants.h" #include "randfn.h" ! //#include "AError.h" #include <iostream> #include <fstream> *************** *** 209,231 **** return 1; } ! ! /** ! * Loads/saves XML data for database object ! * @param load true to load, false to save ! */ ! void tcDatabaseObject::SerializeXml(TiXmlElement* node, bool load) ! { ! if (load) return; // write only for now ! wxASSERT(node); ! ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); } ! int tcDatabaseObject::WriteCSVHeader(Database::CsvTranslator *csv) { --- 211,234 ---- return 1; } ! ! /** ! * Loads/saves XML data for database object ! * @param load true to load, false to save ! */ ! ! void tcDatabaseObject::SerializeXml(TiXmlElement* node, bool load) ! { ! if (load) return; // write only for now ! wxASSERT(node); ! ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); } ! int tcDatabaseObject::WriteCSVHeader(Database::CsvTranslator *csv) { *************** *** 275,277 **** ! } \ No newline at end of file --- 278,280 ---- ! } |
|
From: Xavi <xr...@us...> - 2004-03-28 19:07:17
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11689 Modified Files: tcRadarDBObject.cpp Log Message: newline at the end of file Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcRadarDBObject.cpp 5 Feb 2004 23:17:04 -0000 1.6 --- tcRadarDBObject.cpp 28 Mar 2004 18:55:40 -0000 1.7 *************** *** 22,31 **** #include "stdwx.h" #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #include "tcRadarDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "aerror.h" #include "CsvTranslator.h" --- 22,33 ---- #include "stdwx.h" + #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. + #endif // _MSC_VER > 1000 #include "tcRadarDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "AError.h" #include "CsvTranslator.h" *************** *** 185,187 **** ! } \ No newline at end of file --- 187,190 ---- ! } ! |
|
From: Xavi <xr...@us...> - 2004-03-28 19:04:23
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11050 Modified Files: tcDBString.cpp tcSensorDBObject.cpp CsvTranslator.cpp Log Message: newline at the end of file Index: CsvTranslator.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/CsvTranslator.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CsvTranslator.cpp 14 Dec 2003 20:58:47 -0000 1.3 --- CsvTranslator.cpp 28 Mar 2004 18:53:03 -0000 1.4 *************** *** 24,28 **** --- 24,31 ---- */ + #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. + #endif // _MSC_VER > 1000 + #include "CsvTranslator.h" Index: tcSensorDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorDBObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSensorDBObject.cpp 7 Dec 2003 01:53:36 -0000 1.2 --- tcSensorDBObject.cpp 28 Mar 2004 18:53:03 -0000 1.3 *************** *** 22,31 **** #include "stdwx.h" #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #include "tcSensorDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "aerror.h" #include "CsvTranslator.h" --- 22,33 ---- #include "stdwx.h" + #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. + #endif // _MSC_VER > 1000 #include "tcSensorDBObject.h" #include "math_constants.h" #include "randfn.h" ! //#include "AError.h" #include "CsvTranslator.h" *************** *** 120,122 **** } ! } \ No newline at end of file --- 122,125 ---- } ! } ! Index: tcDBString.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDBString.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDBString.cpp 30 Nov 2003 17:23:53 -0000 1.1 --- tcDBString.cpp 28 Mar 2004 18:53:03 -0000 1.2 *************** *** 150,152 **** } ! } \ No newline at end of file --- 150,153 ---- } ! } ! |
|
From: Xavi <xr...@us...> - 2004-03-28 19:01:50
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10547 Modified Files: math_constants.cpp Log Message: newline at the end of file Index: math_constants.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/math_constants.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** math_constants.cpp 15 Dec 2003 04:19:59 -0000 1.2 --- math_constants.cpp 28 Mar 2004 18:50:31 -0000 1.3 *************** *** 27,29 **** double toDegrees(double rad) {return C_180OVERPI*rad;} float toDegrees(float rad) {return C_180OVERPI*rad;} ! } \ No newline at end of file --- 27,30 ---- double toDegrees(double rad) {return C_180OVERPI*rad;} float toDegrees(float rad) {return C_180OVERPI*rad;} ! } ! |
|
From: Xavi <xr...@us...> - 2004-03-28 19:00:46
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10309 Modified Files: nsNav.cpp Log Message: + removed unnecessary code refered to min/max in linux + added "using std::min/max" in order to avoid problems with declarations of these functions Index: nsNav.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/nsNav.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nsNav.cpp 4 Dec 2003 22:31:52 -0000 1.4 --- nsNav.cpp 28 Mar 2004 18:49:24 -0000 1.5 *************** *** 26,41 **** #include "simmath.h" #include <stdio.h> ! #include <math.h> ! #ifdef __unix__ ! #define min(X,Y)\ ! ({ typeof (X) x_ =(X); \ ! typeof (Y) y_ =(Y); \ ! (x_ < y_) ?x_: y_; }) ! #define max(X,Y)\ ! ({ typeof (X) x_ =(X); \ ! typeof (Y) y_ =(Y); \ ! (x_ > y_) ?x_: y_; }) ! #endif // great circle distance in radians between points a and b --- 26,33 ---- #include "simmath.h" #include <stdio.h> ! #include <cmath> ! using std::max; ! using std::min; // great circle distance in radians between points a and b *************** *** 91,98 **** (sinf(fDistanceRad)*cosf(a.mfLat_rad)); if (sinf(a.mfLon_rad-b.mfLon_rad) < 0) { ! return acosf(max(min(fTerm,1.0f),-1.0f)); } else { ! return C_TWOPI - acosf(max(min(fTerm,1.0f),-1.0f)); } } --- 83,90 ---- (sinf(fDistanceRad)*cosf(a.mfLat_rad)); if (sinf(a.mfLon_rad-b.mfLon_rad) < 0) { ! return acosf( max( min( fTerm,1.0f ),-1.0f ) ); } else { ! return C_TWOPI - acosf( max( min(fTerm,1.0f), -1.0f) ); } } |
|
From: Xavi <xr...@us...> - 2004-03-28 18:58:27
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9889 Modified Files: tcESMDBObject.h tcFixedDBObject.h tcSensorDBObject.h Log Message: + added ifdef MSV for #pragma once instruction Index: tcESMDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcESMDBObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcESMDBObject.h 7 Dec 2003 01:53:36 -0000 1.2 --- tcESMDBObject.h 28 Mar 2004 18:47:07 -0000 1.3 *************** *** 23,27 **** --- 23,29 ---- #define _ESMDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcSensorDBObject.h" *************** *** 46,48 **** } // namespace Database ! #endif \ No newline at end of file --- 48,51 ---- } // namespace Database ! #endif ! Index: tcSensorDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSensorDBObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSensorDBObject.h 7 Dec 2003 01:53:36 -0000 1.2 --- tcSensorDBObject.h 28 Mar 2004 18:47:07 -0000 1.3 *************** *** 23,27 **** --- 23,29 ---- #define _SENSORDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" *************** *** 48,50 **** } // namespace Database ! #endif \ No newline at end of file --- 50,53 ---- } // namespace Database ! #endif ! Index: tcFixedDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcFixedDBObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcFixedDBObject.h 7 Dec 2003 01:53:36 -0000 1.2 --- tcFixedDBObject.h 28 Mar 2004 18:47:07 -0000 1.3 *************** *** 23,27 **** --- 23,29 ---- #define _FIXEDDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" *************** *** 45,47 **** } // namespace Database ! #endif \ No newline at end of file --- 47,50 ---- } // namespace Database ! #endif ! |