[Gcblue-commits] gcb_wx/src/graphics tc3DViewer.cpp,1.6,1.7 tcButton.cpp,1.14,1.15 tcLauncherPopup.c
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-12-11 01:09:56
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30338/src/graphics Modified Files: tc3DViewer.cpp tcButton.cpp tcLauncherPopup.cpp tcMapView.cpp tcOOBView.cpp tcPopupControl.cpp Log Message: Sonar work, passive sonar, torpedoes Index: tcLauncherPopup.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcLauncherPopup.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcLauncherPopup.cpp 7 Dec 2004 04:00:41 -0000 1.1 --- tcLauncherPopup.cpp 11 Dec 2004 01:09:06 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- #include "tcSimState.h" #include "tcTime.h" + #include "tcCommandQueue.h" #include <stdio.h> *************** *** 105,108 **** --- 106,116 ---- x += float(textSize.GetWidth()) + 5.0f; + datumButton.Set(x, x + 10.0f, + y - 0.5f * float(textSize.GetHeight()), y + 0.5 * float(textSize.GetHeight())); + DrawRectangleR(datumButton, osg::Vec4(1, 1, 1, 1), FILL_OFF); + + + x += 15.0f; + launchButton.Set(x, x + 10.0f, y - 0.5f * float(textSize.GetHeight()), y + 0.5 * float(textSize.GetHeight())); *************** *** 165,168 **** --- 173,183 ---- } } + else if (datumButton.ContainsPoint(pos.x, pos.y)) + { + if (tcLauncher* launcher = GetLauncher()) + { + tcCommandQueue::Get()->GetUserInputForID("SetDatum", "Datum", platformId, launcherIdx); + } + } else { Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcOOBView.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcOOBView.cpp 7 Dec 2004 04:00:41 -0000 1.5 --- tcOOBView.cpp 11 Dec 2004 01:09:06 -0000 1.6 *************** *** 31,34 **** --- 31,43 ---- #include "tcSimState.h" #include "tcSound.h" + #include "tcHeloObject.h" + #include "tcSubObject.h" + #include "tcSensorMap.h" + #include "tcSensorTrackIterator.h" + + BEGIN_EVENT_TABLE(tcOOBView, tcXmlWindow) + EVT_COMMAND(1, wxEVT_COMMAND_BUTTON_CLICKED, tcOOBView::SetDisplayOwn) [...1182 lines suppressed...] } *************** *** 522,529 **** tcOOBView::~tcOOBView() { ! /* ! if (mpPen != NULL) {delete mpPen;} ! if (mpFont != NULL) {delete mpFont;} ! if (mpBrush != NULL) {delete mpBrush;} ! */ } \ No newline at end of file --- 797,800 ---- tcOOBView::~tcOOBView() { ! } \ No newline at end of file Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcMapView.cpp 7 Dec 2004 04:00:41 -0000 1.11 --- tcMapView.cpp 11 Dec 2004 01:09:06 -0000 1.12 *************** *** 31,34 **** --- 31,35 ---- #include "tcMapView.h" + #include "tcCommandQueue.h" #include "aerror.h" #include "mapsymbols.h" *************** *** 44,49 **** #include <math.h> ! #include <sys/timeb.h> ! #include <wingdi.h> using namespace std; --- 45,50 ---- #include <math.h> ! //#include <sys/timeb.h> ! //#include <wingdi.h> using namespace std; *************** *** 2071,2075 **** else { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Heading",callbackParam); } mbMapCmdActive = false; --- 2072,2077 ---- else { ! mpCommandInterface->AddPythonCallbackForID(mzMapCmdCallback, "Heading", ! callbackPlatformID, callbackParam); } mbMapCmdActive = false; *************** *** 2088,2092 **** else { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Target",callbackParam); } } --- 2090,2095 ---- else { ! mpCommandInterface->AddPythonCallbackForID(mzMapCmdCallback, "Target", ! callbackPlatformID, callbackParam); } } *************** *** 2105,2109 **** else { ! mpCommandInterface->AddPythonCallback(mzMapCmdCallback,"Datum",callbackParam); } break; --- 2108,2113 ---- else { ! mpCommandInterface->AddPythonCallbackForID(mzMapCmdCallback, "Datum", ! callbackPlatformID, callbackParam); } break; *************** *** 2295,2298 **** --- 2299,2312 ---- } + /** + * Sets callback parameters to use when map command is completed + */ + void tcTacticalMapView::SetMapCmdCallback(const char *azCallback, long id, int param) + { + strcpy(mzMapCmdCallback,azCallback); + callbackPlatformID = id; + callbackParam = param; + } + void tcTacticalMapView::UpdateNavPoints(vector<tcPoint> *mpPoints) { Index: tcPopupControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPopupControl.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcPopupControl.cpp 2 Dec 2004 04:17:25 -0000 1.6 --- tcPopupControl.cpp 11 Dec 2004 01:09:06 -0000 1.7 *************** *** 28,31 **** --- 28,32 ---- #include "tcPopupControl.h" #include "AError.h" + #include "tcCommandQueue.h" #include "tcSimPythonInterface.h" Index: tcButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcButton.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcButton.cpp 2 Nov 2004 04:23:56 -0000 1.14 --- tcButton.cpp 11 Dec 2004 01:09:06 -0000 1.15 *************** *** 81,100 **** if (isButtonOn) { ! backgroundColor.set(0.392f, 1.0f, 0.392f, 1.0f); ! textColor.set(0, 0, 0, 1); } else if (isMouseOver) { ! backgroundColor.set(1, 1, 1, 1); ! textColor.set(0, 0, 0, 1); } else { ! backgroundColor.set(0, 0, 0, 1); ! textColor.set(1, 1, 1, 1); } DrawRectangle(0, 0, mnWidth, mnHeight, backgroundColor, FILL_ON); ! DrawRectangle(0, 0, mnWidth, mnHeight, osg::Vec4(1, 1, 1, 1), FILL_OFF); /* --- 81,100 ---- if (isButtonOn) { ! backgroundColor.set(0.392f, 1.0f, 0.392f, backgroundAlpha); ! textColor.set(0, 0, 0, backgroundAlpha); } else if (isMouseOver) { ! backgroundColor.set(1, 1, 1, backgroundAlpha); ! textColor.set(0, 0, 0, backgroundAlpha); } else { ! backgroundColor.set(0, 0, 0, backgroundAlpha); ! textColor.set(1, 1, 1, backgroundAlpha); } DrawRectangle(0, 0, mnWidth, mnHeight, backgroundColor, FILL_ON); ! DrawRectangle(0, 0, mnWidth, mnHeight, osg::Vec4(1, 1, 1, backgroundAlpha), FILL_OFF); /* *************** *** 186,189 **** --- 186,190 ---- fontSize = 12.0f; sendRedraw = false; + backgroundAlpha = 1.0f; ref_count++; *************** *** 201,204 **** --- 202,206 ---- int height; int command; + double alpha; current->Attribute("X", &x); *************** *** 213,216 **** --- 215,233 ---- SetName(caption.c_str()); + int ydir = 0; + current->Attribute("YDir", &ydir); + + if (ydir == 1) + { + wxSize parSize = parent->GetSize(); + y = float(parSize.GetHeight()) - y - height; + } + + current->Attribute("Alpha", &alpha); + if (alpha) backgroundAlpha = alpha; + + double xmlFontSize = fontSize; + current->Attribute("FontSize", &xmlFontSize); + if (xmlFontSize) fontSize = xmlFontSize; TiXmlNode* childNode = config->FirstChild("Image"); *************** *** 248,251 **** --- 265,269 ---- fontSize = 16.0f; sendRedraw = false; + backgroundAlpha = 1.0f; Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tc3DViewer.cpp 23 Nov 2004 23:30:55 -0000 1.6 --- tc3DViewer.cpp 11 Dec 2004 01:09:06 -0000 1.7 *************** *** 1026,1029 **** --- 1026,1035 ---- { if (cameraPosition._v[2] < -480.0) cameraPosition._v[2] = -480.0; + + // avoid sea-air boundary glitch + if ((cameraPosition._v[2] > -1) && (cameraPosition._v[2] < 1.5)) + { + cameraPosition._v[2] = 1.5; + } } else |