Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/contrib/rsgedit Modified Files: Makefile.am main.cpp main.h mainframe.cpp mainframe.h property.h propertyframe.cpp propertyframe.h rsgedit.rb rsgedit.wxg simspark.cpp simspark.h sparkglcanvas.cpp sparkglcanvas.h sparkglrender.h sparktree.cpp sparktree.h Added Files: aboutDlg.cpp aboutDlg.h agentframe.cpp agentframe.h constants.cpp constants.h rsgedit.rc rsgedit.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: main.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/main.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main.cpp 22 Jan 2006 12:19:28 -0000 1.6 --- main.cpp 15 Mar 2007 07:26:24 -0000 1.7 *************** *** 18,21 **** --- 18,22 ---- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #include "main.h" #if defined(__GNUG__) && !defined(__APPLE__) *************** *** 26,29 **** --- 27,31 ---- // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" + #include <wx/splash.h> #ifdef __BORLANDC__ *************** *** 39,43 **** #endif - #include "main.h" #include "mainframe.h" #include "sparkglcanvas.h" --- 41,44 ---- *************** *** 45,48 **** --- 46,51 ---- #include "property.h" + #include <rsgedit/res/xpm_sparklogo.xpm> + IMPLEMENT_APP(RsgEditApp) *************** *** 51,54 **** --- 54,66 ---- bool RsgEditApp::OnInit() { + wxSplashScreen* splash = new wxSplashScreen + ( + wxBitmap(xpm_sparklogo), + wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_NO_TIMEOUT, + 0, NULL, -1, wxDefaultPosition, wxDefaultSize, + wxSIMPLE_BORDER|wxSTAY_ON_TOP + ); + wxYield(); + mSpark = shared_ptr<SimSpark>(new SimSpark("../../")); *************** *** 59,69 **** mProperty = shared_ptr<Property>(new Property); - mainframe* frame = new mainframe(NULL, wxID_ANY, _T("RsgEdit")); // Show the frame frame->Show(true); SetTopWindow(frame); return true; } --- 71,90 ---- mProperty = shared_ptr<Property>(new Property); mainframe* frame = new mainframe(NULL, wxID_ANY, _T("RsgEdit")); + #ifdef __WXMSW__ + frame->SetIcon(wxIcon("Spark", wxBITMAP_TYPE_ICO_RESOURCE)); + ::wxHandleFatalExceptions(true); + #endif + // Show the frame frame->Show(true); SetTopWindow(frame); + splash->Destroy(); + + #ifdef __WXMSW__ + frame->Raise(); + #endif return true; } *************** *** 78,79 **** --- 99,104 ---- return mProperty; } + + void RsgEditApp::OnFatalException() + { + } Index: sparkglcanvas.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sparkglcanvas.cpp 19 Feb 2006 13:21:56 -0000 1.4 --- sparkglcanvas.cpp 15 Mar 2007 07:26:24 -0000 1.5 *************** *** 18,24 **** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <wx/dcclient.h> #include "main.h" ! #include "sparkglcanvas.h" #include "simspark.h" --- 18,25 ---- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #include "sparkglcanvas.h" #include <wx/dcclient.h> #include "main.h" ! #include "simspark.h" *************** *** 68,75 **** } ! void SparkGLCanvas::Render() { ! wxPaintDC dc(this); #ifndef __WXMOTIF__ if (!GetContext()) return; --- 69,79 ---- } ! void SparkGLCanvas::Reset() { ! mInit = false; ! } + void SparkGLCanvas::Render(wxDC& dc) + { #ifndef __WXMOTIF__ if (!GetContext()) return; *************** *** 95,99 **** void SparkGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) ) { ! Render(); } --- 99,104 ---- void SparkGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) ) { ! wxPaintDC dc(this); ! Render(dc); } *************** *** 251,255 **** if ( (spark.get() == 0) || ! (spark->GetSimState() != SimSpark::S_RUNNING) ) { --- 256,260 ---- if ( (spark.get() == 0) || ! (spark->GetSimState() != S_RUNNING) ) { Index: property.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** property.h 18 Feb 2006 19:50:03 -0000 1.5 --- property.h 15 Mar 2007 07:26:24 -0000 1.6 *************** *** 21,24 **** --- 21,28 ---- #define PROPERTY_H__ + #ifdef WIN32 + #include <winsock2.h> + #endif + #include <list> #include <map> --- NEW FILE: aboutDlg.cpp --- // -*- C++ -*- generated by wxGlade 0.4.1 on Sun Feb 18 14:55:33 2007 #include "aboutDlg.h" #include <rsgedit/res/xpm_sparklogo.xpm> aboutDlg::aboutDlg(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE) { // begin wxGlade: aboutDlg::aboutDlg mBitmap = new wxStaticBitmap(this, -1, wxNullBitmap); label_1 = new wxStaticText(this, -1, wxT("SimSpark Copyright (C) RoboCup Soccer Server 3D Maintenance Group")); button_1 = new wxButton(this, wxID_OK, wxT("&Ok")); set_properties(); do_layout(); // end wxGlade mBitmap->SetBitmap(wxBitmap(xpm_sparklogo)); Layout(); } void aboutDlg::set_properties() { // begin wxGlade: aboutDlg::set_properties SetTitle(wxT("dialog_1")); mBitmap->SetMinSize(wxSize(500, 200)); // end wxGlade } void aboutDlg::do_layout() { // begin wxGlade: aboutDlg::do_layout wxBoxSizer* sizer_9 = new wxBoxSizer(wxVERTICAL); sizer_9->Add(mBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE, 5); sizer_9->Add(label_1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE, 5); sizer_9->Add(button_1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE, 5); SetAutoLayout(true); SetSizer(sizer_9); sizer_9->Fit(this); sizer_9->SetSizeHints(this); Layout(); // end wxGlade } Index: rsgedit.rb =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rsgedit.rb 2 Jan 2006 20:28:49 -0000 1.4 --- rsgedit.rb 15 Mar 2007 07:26:24 -0000 1.5 *************** *** 2,5 **** --- 2,20 ---- # rsgedit.rb # + + def rsgeditResetScene + # let spark create a default camera + sparkAddFPSCamera( + $scenePath+'camera', + x = -5, + y = -40, + z = 15, + maxSpeed = 15.0, + accel = 400.0, + drag = 4, + addCollider = false + ) + end + # sparkLogAllToCerr() sparkSetupServer() *************** *** 13,27 **** sparkSetupInput('InputSystemWX') ! # let spark create a default camera ! sparkAddFPSCamera( ! $scenePath+'camera', ! x = -5, ! y = -40, ! z = 2, ! maxSpeed = 15.0, ! accel = 400.0, ! drag = 4, ! addCollider = false ! ) # setup default input bindings --- 28,33 ---- sparkSetupInput('InputSystemWX') ! # prepare a default scene ! rsgeditResetScene() # setup default input bindings *************** *** 38,41 **** --- 44,50 ---- material.setDiffuse(0.0,0.0,1.0,1.0) + material = new('kerosin/MaterialSolid', $serverPath+'material/matLightBlue'); + material.setDiffuse(0.0,0.75,1.0,1.0) + material = new('kerosin/MaterialSolid', $serverPath+'material/matWhite'); material.setDiffuse(1.0,1.0,1.0,1.0) *************** *** 55,71 **** material.setDiffuse(0.1,0.1,0.1,1.0) - # - # uncomment any of the following to run a simulation - # - - # scene = get($scenePath) - #scene = get($scenePath) - #scene.importScene('rsg/boxspheres/simspark.rsg') - - # create an arena to test various joint bodies - scene = get($scenePath) - scene.importScene('rsg/jointtest/simspark.rsg') - - - - --- 64,65 ---- --- NEW FILE: rsgedit.rc --- Spark ICON DISCARDABLE "../../spark/win32/spark.ico" --- NEW FILE: rsgedit.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="rsgedit" ProjectGUID="{38B680B0-B535-40F0-B5DB-FC307C40C7D6}" RootNamespace="rsgedit" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\spark\win32;..\..\spark;..\..\spark\utility;..\" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="comctl32.lib rpcrt4.lib msvcrt-ruby18.lib ode.lib wsock32.lib opengl32.lib glu32.lib glaux.lib wxbase28d.lib wxmsw28d_core.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxbase28d_xml.lib wxexpatd.lib wxmsw28d_aui.lib wxmsw28d_gl.lib wxzlibd.lib wxpngd.lib" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\spark\win32;..\..\spark;..\..\spark\utility;..\" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="comctl32.lib rpcrt4.lib wsock32.lib opengl32.lib glu32.lib glaux.lib c:\ruby\lib\msvcrt-ruby18.lib ode.lib wxbase28.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib wxjpeg.lib wxmsw28_adv.lib wxmsw28_aui.lib wxmsw28_core.lib wxmsw28_gl.lib wxmsw28_html.lib wxmsw28_media.lib wxmsw28_qa.lib wxmsw28_richtext.lib wxmsw28_xrc.lib wxpng.lib wxregex.lib wxtiff.lib wxzlib.lib" LinkIncremental="1" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <File RelativePath=".\aboutDlg.cpp" > </File> <File RelativePath=".\aboutDlg.h" > </File> <File RelativePath=".\agentframe.cpp" > </File> <File RelativePath=".\agentframe.h" > </File> <File RelativePath=".\constants.cpp" > </File> <File RelativePath=".\icon1.ico" > </File> <File RelativePath=".\inputwx.cpp" > </File> <File RelativePath=".\inputwx.h" > </File> <File RelativePath=".\main.cpp" > </File> <File RelativePath=".\main.h" > </File> <File RelativePath=".\mainframe.cpp" > </File> <File RelativePath=".\mainframe.h" > </File> <File RelativePath=".\property.cpp" > </File> <File RelativePath=".\property.h" > </File> <File RelativePath=".\propertyframe.cpp" > </File> <File RelativePath=".\propertyframe.h" > </File> <File RelativePath=".\propertylist.cpp" > </File> <File RelativePath=".\propertylist.h" > </File> <File RelativePath=".\rsgedit.rc" > </File> <File RelativePath=".\simspark.cpp" > </File> <File RelativePath=".\simspark.h" > </File> <File RelativePath="..\..\spark\win32\spark.ico" > </File> <File RelativePath=".\sparkglcanvas.cpp" > </File> <File RelativePath=".\sparkglcanvas.h" > </File> <File RelativePath=".\sparkglrender.cpp" > </File> <File RelativePath=".\sparkglrender.h" > </File> <File RelativePath=".\sparktree.cpp" > </File> <File RelativePath=".\sparktree.h" > </File> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: agentframe.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: agentframe.h,v 1.2 2007/03/15 07:26:24 fruit Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ // -*- C++ -*- generated by wxGlade 0.4.1 on Fri Feb 23 21:06:30 2007 #include <wx/wx.h> #include <wx/image.h> #include <wx/process.h> #ifndef AGENTFRAME_H #define AGENTFRAME_H // begin wxGlade: ::dependencies // end wxGlade class agentframe: public wxFrame { public: // begin wxGlade: agentframe::ids // end wxGlade agentframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); virtual ~agentframe(); void KillAgent(); bool StartAgent(const wxString& cmd); void OnUpdateAgentStart(wxUpdateUIEvent& event); void OnAgentStart(wxCommandEvent& /*event*/); void OnUpdateAgentKill(wxUpdateUIEvent& event); void OnAgentKill(wxCommandEvent& /*event*/); private: // begin wxGlade: agentframe::methods void set_properties(); void do_layout(); // end wxGlade void Output(const wxString& str); void Output(const char* str); void Output(wxInputStream* istream); void OnLogTimer(wxTimerEvent& event); void OnClose(wxCloseEvent& event); void OnEndProcess(wxProcessEvent& event); bool StartAgent(); protected: // begin wxGlade: agentframe::attributes wxTextCtrl* mCtrLog; // end wxGlade wxTimer mTimer; wxProcess *mProcess; int mPid; wxString mCmd; wxToolBar* mToolBar; DECLARE_EVENT_TABLE() }; // wxGlade: end class #endif // AGENTFRAME_H Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mainframe.h 22 Jan 2006 17:25:23 -0000 1.7 --- mainframe.h 15 Mar 2007 07:26:24 -0000 1.8 *************** *** 19,24 **** --- 19,29 ---- */ // -*- C++ -*- generated by wxGlade 0.4 on Wed Jan 4 20:26:10 2006 + #ifdef WIN32 + #include <winsock2.h> + #endif + #include <wx/wx.h> #include <wx/image.h> + #include "constants.h" #include "sparktree.h" #include "propertylist.h" *************** *** 29,32 **** --- 34,42 ---- class SparkGLCanvas; + namespace oxygen + { + class SimulationServer; + } + // begin wxGlade: ::dependencies #include <wx/splitter.h> *************** *** 35,45 **** // end wxGlade - #define ID_SIM_START (wxID_HIGHEST+10) - #define ID_SIM_PAUSE (wxID_HIGHEST+11) - - #define ID_VIEW_LOG (wxID_HIGHEST+20) - #define ID_VIEW_TREE (wxID_HIGHEST+21) - #define ID_VIEW_TOOLBAR (wxID_HIGHEST+22) - class mainframe: public wxFrame { public: --- 45,48 ---- *************** *** 48,51 **** --- 51,55 ---- mainframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); + virtual ~mainframe(); private: *************** *** 62,65 **** --- 66,81 ---- void PauseSimulation(); + /** pause and reset the running simulation */ + void ResetSimulation(); + + /** go through one simulation cycle with the given time step */ + void AdvanceSimulation(boost::shared_ptr<oxygen::SimulationServer>& sim, float tDeltaSec); + + /** prepare to start the simulation */ + void InitSimulation(boost::shared_ptr<oxygen::SimulationServer>& sim); + + /** shut down the simulation */ + void DoneSimulation(boost::shared_ptr<oxygen::SimulationServer>& sim); + void OnUpdateStartSimulation(wxUpdateUIEvent& event); void OnStartSimulation(wxCommandEvent& event); *************** *** 74,77 **** --- 90,103 ---- void OnUpdateViewLog(wxUpdateUIEvent& event); + void OnFileOpen(wxCommandEvent& event); + void OnUpdateFileOpen(wxUpdateUIEvent& event); + + void OnFileReload(wxCommandEvent& event); + void OnUpdateFileReload(wxUpdateUIEvent& event); + + void OnAgentOpen(wxCommandEvent& event); + + void OnHelpAbout(wxCommandEvent& event); + void OnExit(wxCommandEvent& event); void OnClose( wxCloseEvent& event ); *************** *** 85,88 **** --- 111,125 ---- bool CanClose(); + /** returns the current simulation state */ + ESimState GetSimState() const; + + /** update the title of the window */ + void mainframe::UpdateTitle(); + + /** resets the current simulation and starts a new one from the + given script file + */ + bool OpenSimulation(const wxString& fname); + void InitTreeNodeProperties(); *************** *** 97,100 **** --- 134,141 ---- void RefreshProperties(); + /** updated any cached references */ + void UpdateCached(); + + protected: // begin wxGlade: mainframe::attributes *************** *** 102,108 **** wxStatusBar* MainFrame_statusbar; wxListCtrl* mCtrPropList; ! wxPanel* mLeftTopPane; wxTreeCtrl* mCtrTree; ! wxPanel* mLeftBottomPane; wxSplitterWindow* window_1; wxPanel* mLeftPane; --- 143,149 ---- wxStatusBar* MainFrame_statusbar; wxListCtrl* mCtrPropList; ! wxPanel* window_1_pane_1; wxTreeCtrl* mCtrTree; ! wxPanel* window_1_pane_2; wxSplitterWindow* window_1; wxPanel* mLeftPane; *************** *** 125,128 **** --- 166,174 ---- int mLastVertSashPosition; + /** the filename of the current simulation (i.e. the corresponding + startup .rb script) + */ + wxString mSimFName; + DECLARE_EVENT_TABLE() }; // wxGlade: end class Index: propertyframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/propertyframe.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** propertyframe.cpp 22 Jan 2006 17:25:23 -0000 1.2 --- propertyframe.cpp 15 Mar 2007 07:26:24 -0000 1.3 *************** *** 22,25 **** --- 22,26 ---- #include "propertyframe.h" #include "main.h" + #include "simspark.h" //! wxWidgets and zeitgeist both use a 'DECLARE_CLASS' macro *************** *** 35,39 **** { // begin wxGlade: propertyframe::propertyframe ! mCtrList = new wxListCtrl(this, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); set_properties(); --- 36,40 ---- { // begin wxGlade: propertyframe::propertyframe ! mCtrPropList = new wxListCtrl(this, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); set_properties(); *************** *** 56,60 **** // begin wxGlade: propertyframe::do_layout wxBoxSizer* sizer_3 = new wxBoxSizer(wxVERTICAL); ! sizer_3->Add(mCtrList, 1, wxEXPAND, 0); SetAutoLayout(true); SetSizer(sizer_3); --- 57,61 ---- // begin wxGlade: propertyframe::do_layout wxBoxSizer* sizer_3 = new wxBoxSizer(wxVERTICAL); ! sizer_3->Add(mCtrPropList, 1, wxEXPAND, 0); SetAutoLayout(true); SetSizer(sizer_3); *************** *** 63,70 **** } void propertyframe::SetLeaf(weak_ptr<Leaf> leaf) { ! mLeaf = leaf; ! mPropList.Init(mLeaf,mCtrList); RefreshProperties(); } --- 64,97 ---- } + void propertyframe::UpdateCached() + { + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if (spark.get() == 0) + { + return; + } + + mPath.Update(spark->GetCore()); + mPropList.Init(mPath.get(),mCtrPropList); + } + void propertyframe::SetLeaf(weak_ptr<Leaf> leaf) { ! shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); ! if (spark.get() == 0) ! { ! return; ! } ! ! if (leaf.expired()) ! { ! mPath = Leaf::CachedPath<zeitgeist::Leaf>(); ! } else ! { ! std::string path = leaf.lock()->GetFullPath(); ! mPath.SetKey(Core::CacheKey(spark->GetCore()->GetRoot(), path)); ! } ! ! UpdateCached(); RefreshProperties(); } Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 22 Jan 2006 17:25:23 -0000 1.5 --- Makefile.am 15 Mar 2007 07:26:24 -0000 1.6 *************** *** 8,12 **** @OXYGEN_CPPFLAGS@\ @KEROSIN_CPPFLAGS@\ ! @SPARK_CPPFLAGS@ AM_LDFLAGS = @SPARK_LIBADD@\ --- 8,12 ---- @OXYGEN_CPPFLAGS@\ @KEROSIN_CPPFLAGS@\ ! @SPARK_CPPFLAGS@ AM_LDFLAGS = @SPARK_LIBADD@\ *************** *** 18,31 **** rsgedit_SOURCES = \ ! main.cpp\ ! mainframe.cpp\ ! sparkglcanvas.cpp\ ! simspark.cpp\ ! sparkglrender.cpp\ ! inputwx.cpp\ ! sparktree.cpp\ ! propertylist.cpp\ ! propertyframe.cpp\ ! property.cpp --- 18,49 ---- rsgedit_SOURCES = \ ! aboutDlg.cpp \ ! agentframe.cpp \ ! constants.cpp \ ! inputwx.cpp \ ! main.cpp \ ! mainframe.cpp \ ! property.cpp \ ! propertyframe.cpp \ ! propertylist.cpp \ ! simspark.cpp \ ! sparkglcanvas.cpp \ ! sparkglrender.cpp \ ! sparktree.cpp \ ! aboutDlg.h \ ! agentframe.h \ ! constants.h \ ! inputwx.h \ ! main.h \ ! mainframe.h \ ! property.h \ ! propertyframe.h \ ! propertylist.h \ ! simspark.h \ ! sparkglcanvas.h \ ! sparkglrender.h \ ! sparktree.h ! ! Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mainframe.cpp 22 Jan 2006 17:25:23 -0000 1.8 --- mainframe.cpp 15 Mar 2007 07:26:24 -0000 1.9 *************** *** 23,29 **** --- 23,38 ---- #include "main.h" #include "propertyframe.h" + #include "agentframe.h" + + #include <wx/filename.h> + #include <wx/filedlg.h> #include <rsgedit/res/xpm_play.xpm> #include <rsgedit/res/xpm_pause.xpm> + #include <rsgedit/res/xpm_open.xpm> + #include <rsgedit/res/xpm_reload.xpm> + #include <rsgedit/res/xpm_agent.xpm> + + #include "aboutdlg.h" //! wxWidgets and zeitgeist both use a 'DECLARE_CLASS' macro *************** *** 31,34 **** --- 40,44 ---- #include <zeitgeist/logserver/logserver.h> + #include <zeitgeist/scriptserver/scriptserver.h> #include <oxygen/simulationserver/simulationserver.h> #include <oxygen/sceneserver/sceneserver.h> *************** *** 52,55 **** --- 62,75 ---- EVT_UPDATE_UI(ID_VIEW_TREE, mainframe::OnUpdateViewTree) + EVT_MENU(ID_FILE_OPEN, mainframe::OnFileOpen) + EVT_UPDATE_UI(ID_FILE_OPEN, mainframe::OnUpdateFileOpen) + + EVT_MENU(ID_AGENT_OPEN, mainframe::OnAgentOpen) + + EVT_MENU(ID_FILE_RELOAD, mainframe::OnFileReload) + EVT_UPDATE_UI(ID_FILE_RELOAD, mainframe::OnUpdateFileReload) + + EVT_MENU(ID_HELP_ABOUT, mainframe::OnHelpAbout) + EVT_TIMER(1, mainframe::OnLogTimer) *************** *** 65,81 **** using namespace oxygen; - // the default height of the log window pane [pixel] - static const int LOGWND_DEFAULT_HEIGHT = 80; - - // the update interval of the log window [milliseconds} - static const int LOGWND_UPDATE_INTERVAL = 100; - - // the default width of the tree window pane [pixel] - static const int TREEWND_DEFAULT_WIDTH = 270; - mainframe::mainframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE), mTimer(this,1) { // begin wxGlade: mainframe::mainframe mCtrVertSplitter = new wxSplitterWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); --- 85,94 ---- using namespace oxygen; mainframe::mainframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE), mTimer(this,1) { + mToolBar = 0; + // begin wxGlade: mainframe::mainframe mCtrVertSplitter = new wxSplitterWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); *************** *** 86,94 **** mLeftPane = new wxPanel(mCtrVertSplitter, -1); window_1 = new wxSplitterWindow(mLeftPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); ! mLeftBottomPane = new wxPanel(window_1, -1); ! mLeftTopPane = new wxPanel(window_1, -1); MainFrame_menubar = new wxMenuBar(); SetMenuBar(MainFrame_menubar); wxMenu* wxglade_tmp_menu_1 = new wxMenu(); wxglade_tmp_menu_1->Append(wxID_EXIT, wxT("&Exit"), wxT(""), wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_1, wxT("&File")); --- 99,110 ---- mLeftPane = new wxPanel(mCtrVertSplitter, -1); window_1 = new wxSplitterWindow(mLeftPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); ! window_1_pane_2 = new wxPanel(window_1, -1); ! window_1_pane_1 = new wxPanel(window_1, -1); MainFrame_menubar = new wxMenuBar(); SetMenuBar(MainFrame_menubar); wxMenu* wxglade_tmp_menu_1 = new wxMenu(); + wxglade_tmp_menu_1->Append(ID_FILE_OPEN, wxT("&Open"), wxT(""), wxITEM_NORMAL); + wxglade_tmp_menu_1->Append(ID_AGENT_OPEN, wxT("Start &Agent"), wxT(""), wxITEM_NORMAL); + wxglade_tmp_menu_1->Append(ID_FILE_RELOAD, wxT("&Reload"), wxT(""), wxITEM_NORMAL); wxglade_tmp_menu_1->Append(wxID_EXIT, wxT("&Exit"), wxT(""), wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_1, wxT("&File")); *************** *** 101,109 **** wxglade_tmp_menu_3->Append(ID_SIM_PAUSE, wxT("&Pause"), wxT("Pause Simulation"), wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_3, wxT("&Simulation")); MainFrame_statusbar = CreateStatusBar(1, 0); ! mCtrPropList = new wxListCtrl(mLeftTopPane, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); ! mCtrTree = new wxTreeCtrl(mLeftBottomPane, 1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER); mCanvas = new SparkGLCanvas(mTopPane, -1); ! mCtrLog = new wxTextCtrl(mBottomPane, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxTE_LINEWRAP); set_properties(); --- 117,128 ---- wxglade_tmp_menu_3->Append(ID_SIM_PAUSE, wxT("&Pause"), wxT("Pause Simulation"), wxITEM_NORMAL); MainFrame_menubar->Append(wxglade_tmp_menu_3, wxT("&Simulation")); + wxMenu* wxglade_tmp_menu_4 = new wxMenu(); + wxglade_tmp_menu_4->Append(ID_HELP_ABOUT, wxT("&About"), wxT(""), wxITEM_NORMAL); + MainFrame_menubar->Append(wxglade_tmp_menu_4, wxT("&Help")); MainFrame_statusbar = CreateStatusBar(1, 0); ! mCtrPropList = new wxListCtrl(window_1_pane_1, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); ! mCtrTree = new wxTreeCtrl(window_1_pane_2, 1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER); mCanvas = new SparkGLCanvas(mTopPane, -1); ! mCtrLog = new wxTextCtrl(mBottomPane, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL); set_properties(); *************** *** 112,122 **** // create toolbar ! mToolBar = new wxToolBar(this,-1); ! SetToolBar(mToolBar); mToolBar->AddTool(ID_SIM_START, wxT("Start"), wxBitmap(xpm_play)); mToolBar->AddTool(ID_SIM_PAUSE, wxT("Pause"), wxBitmap(xpm_pause)); mToolBar->Realize(); // --- 131,146 ---- // create toolbar ! mToolBar = CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL, wxID_ANY ); + mToolBar->AddTool(ID_FILE_OPEN, wxT("Open"), wxBitmap(xpm_open)); + mToolBar->AddTool(ID_FILE_RELOAD, wxT("Reload"), wxBitmap(xpm_reload)); + mToolBar->AddSeparator(); + mToolBar->AddTool(ID_AGENT_OPEN, wxT("Start Agent"), wxBitmap(xpm_agent)); + mToolBar->AddSeparator(); mToolBar->AddTool(ID_SIM_START, wxT("Start"), wxBitmap(xpm_play)); mToolBar->AddTool(ID_SIM_PAUSE, wxT("Pause"), wxBitmap(xpm_pause)); mToolBar->Realize(); + SetToolBar(mToolBar); // *************** *** 137,140 **** --- 161,181 ---- // init log wnd timer mTimer.Start(LOGWND_UPDATE_INTERVAL); + + UpdateTitle(); + } + + mainframe::~mainframe() + { + } + + void mainframe::UpdateTitle() + { + wxString title(wxT("SimSpark")); + if (! mSimFName.empty()) + { + title += wxT(" <") + mSimFName + wxT(">"); + } + + SetTitle(title); } *************** *** 143,149 **** mCtrHorSplitter->SplitHorizontally(mTopPane, mBottomPane); mCtrHorSplitter->SetSashPosition(mLastHorSashPosition); ! ! mCtrHorSplitter->SetSashGravity(1.0); } --- 184,190 ---- mCtrHorSplitter->SplitHorizontally(mTopPane, mBottomPane); mCtrHorSplitter->SetSashPosition(mLastHorSashPosition); ! #if wxCHECK_VERSION(2,5,4) mCtrHorSplitter->SetSashGravity(1.0); + #endif } *************** *** 152,158 **** mCtrVertSplitter->SplitVertically(mLeftPane, mRightPane); mCtrVertSplitter->SetSashPosition(mLastVertSashPosition); ! // only resize right pane when window is resized mCtrVertSplitter->SetSashGravity(0.0); } --- 193,200 ---- mCtrVertSplitter->SplitVertically(mLeftPane, mRightPane); mCtrVertSplitter->SetSashPosition(mLastVertSashPosition); ! #if wxCHECK_VERSION(2,5,4) // only resize right pane when window is resized mCtrVertSplitter->SetSashGravity(0.0); + #endif } *************** *** 181,197 **** wxBoxSizer* sizer_5 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_7 = new wxBoxSizer(wxVERTICAL); ! wxBoxSizer* sizer_8 = new wxBoxSizer(wxHORIZONTAL); ! wxBoxSizer* sizer_4 = new wxBoxSizer(wxHORIZONTAL); sizer_4->Add(mCtrPropList, 1, wxEXPAND, 0); ! mLeftTopPane->SetAutoLayout(true); ! mLeftTopPane->SetSizer(sizer_4); ! sizer_4->Fit(mLeftTopPane); ! sizer_4->SetSizeHints(mLeftTopPane); sizer_8->Add(mCtrTree, 1, wxEXPAND, 0); ! mLeftBottomPane->SetAutoLayout(true); ! mLeftBottomPane->SetSizer(sizer_8); ! sizer_8->Fit(mLeftBottomPane); ! sizer_8->SetSizeHints(mLeftBottomPane); ! window_1->SplitHorizontally(mLeftTopPane, mLeftBottomPane); sizer_7->Add(window_1, 1, wxEXPAND, 0); mLeftPane->SetAutoLayout(true); --- 223,239 ---- wxBoxSizer* sizer_5 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_7 = new wxBoxSizer(wxVERTICAL); ! wxBoxSizer* sizer_8 = new wxBoxSizer(wxVERTICAL); ! wxBoxSizer* sizer_4 = new wxBoxSizer(wxVERTICAL); sizer_4->Add(mCtrPropList, 1, wxEXPAND, 0); ! window_1_pane_1->SetAutoLayout(true); ! window_1_pane_1->SetSizer(sizer_4); ! sizer_4->Fit(window_1_pane_1); ! sizer_4->SetSizeHints(window_1_pane_1); sizer_8->Add(mCtrTree, 1, wxEXPAND, 0); ! window_1_pane_2->SetAutoLayout(true); ! window_1_pane_2->SetSizer(sizer_8); ! sizer_8->Fit(window_1_pane_2); ! sizer_8->SetSizeHints(window_1_pane_2); ! window_1->SplitHorizontally(window_1_pane_1, window_1_pane_2); sizer_7->Add(window_1, 1, wxEXPAND, 0); mLeftPane->SetAutoLayout(true); *************** *** 223,226 **** --- 265,280 ---- } + ESimState mainframe::GetSimState() const + { + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if (spark.get() == 0) + { + assert(false); + return S_PAUSED; + } + + return spark->GetSimState(); + } + bool mainframe::CanClose() { *************** *** 228,232 **** if ( (spark.get() != 0) && ! (spark->GetSimState() == SimSpark::S_RUNNING) ) { --- 282,286 ---- if ( (spark.get() != 0) && ! (spark->GetSimState() == S_RUNNING) ) { *************** *** 237,240 **** --- 291,295 ---- } + void mainframe::OnClose( wxCloseEvent& event ) { *************** *** 247,251 **** event.Skip(); - Destroy(); } --- 302,305 ---- *************** *** 257,267 **** void mainframe::OnUpdateStartSimulation(wxUpdateUIEvent& event) { ! shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); ! bool enable = ( ! (spark.get() != 0) && ! (spark->GetSimState() == SimSpark::S_PAUSED) ! ); ! ! event.Enable(enable); } --- 311,315 ---- void mainframe::OnUpdateStartSimulation(wxUpdateUIEvent& event) { ! event.Enable(GetSimState() == S_PAUSED); } *************** *** 273,283 **** void mainframe::OnUpdatePauseSimulation(wxUpdateUIEvent& event) { ! shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); ! bool enable = ( ! (spark.get() != 0) && ! (spark->GetSimState() == SimSpark::S_RUNNING) ! ); ! ! event.Enable(enable); } --- 321,325 ---- void mainframe::OnUpdatePauseSimulation(wxUpdateUIEvent& event) { ! event.Enable(GetSimState() == S_RUNNING); } *************** *** 311,315 **** if ( (spark.get() == 0) || ! (spark->GetSimState() != SimSpark::S_RUNNING) ) { --- 353,357 ---- if ( (spark.get() == 0) || ! (spark->GetSimState() != S_RUNNING) ) { *************** *** 327,348 **** } ! void mainframe::StartSimulation() { shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); if ( (spark.get() == 0) || ! (spark->GetSimState() != SimSpark::S_PAUSED) ) { return; } ! shared_ptr<SimulationServer> sim = spark->GetSimulationServer(); ! if (sim.get() == 0) ! { ! return; ! } ! spark->SetSimState(SimSpark::S_RUNNING); // tell the inputControl node the loaction of our camera --- 369,412 ---- } ! void mainframe::ResetSimulation() { + PauseSimulation(); shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if ( (spark.get() == 0) || ! (spark->GetSimState() != S_PAUSED) ) { + assert(false); return; } ! spark->ResetSimulation(); ! mCanvas->Reset(); ! spark->GetLog()->Normal() << "(RsgEdit) resetting simulation\n"; ! } ! void mainframe::AdvanceSimulation(shared_ptr<SimulationServer>& sim, float tDeltaSec) ! { ! // go through the next simulation cycle ! sim->AdvanceTime(tDeltaSec); ! sim->Cycle(); ! ! // refresh the display ! RefreshProperties(); ! ! wxClientDC dc(this); ! mCanvas->Render(dc); ! } ! ! void mainframe::InitSimulation(shared_ptr<SimulationServer>& sim) ! { ! shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); ! if (spark.get() == 0) ! { ! assert(false); ! return; ! } // tell the inputControl node the loaction of our camera *************** *** 354,377 **** } ! sim->SetSimStep(0.0); sim->Init(0,0); sim->SetAutoTimeMode(false); spark->GetLog()->Normal() << "(RsgEdit) starting simulation\n"; wxLongLong tLast = wxGetLocalTimeMillis(); while (! sim->WantsToQuit()) { ! wxLongLong tNow = wxGetLocalTimeMillis(); ! float tDeltaSec = (tNow - tLast).ToLong() / 1000.0; ! tLast = tNow; ! ! // go through the next simulation cycle ! sim->AdvanceTime(tDeltaSec); ! sim->Cycle(); ! // refresh the display ! RefreshProperties(); ! mCanvas->Render(); // pump the wxWidgets message loop --- 418,471 ---- } ! sim->SetSimStep(SIM_SIMSTEP); sim->Init(0,0); sim->SetAutoTimeMode(false); + } + + void mainframe::DoneSimulation(shared_ptr<SimulationServer>& sim) + { + sim->Done(); + } + + void mainframe::StartSimulation() + { + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if ( + (spark.get() == 0) || + (spark->GetSimState() != S_PAUSED) + ) + { + return; + } + + shared_ptr<SimulationServer> sim = spark->GetSimulationServer(); + if (sim.get() == 0) + { + return; + } + + spark->SetSimState(S_RUNNING); + + InitSimulation(sim); spark->GetLog()->Normal() << "(RsgEdit) starting simulation\n"; wxLongLong tLast = wxGetLocalTimeMillis(); + // force update of ui state + UpdateWindowUI(wxUPDATE_UI_RECURSE); + while (! sim->WantsToQuit()) { ! if (SIM_SIMSTEP > 0.0f) ! { ! AdvanceSimulation(sim, SIM_SIMSTEP); ! } else ! { ! wxLongLong tNow = wxGetLocalTimeMillis(); ! float tDeltaSec = (tNow - tLast).ToLong() / 1000.0; ! tLast = tNow; ! AdvanceSimulation(sim, tDeltaSec); ! } // pump the wxWidgets message loop *************** *** 379,385 **** } ! sim->Done(); ! spark->SetSimState(SimSpark::S_PAUSED); spark->GetLog()->Normal() << "(RsgEdit) simulation paused\n"; } --- 473,483 ---- } ! DoneSimulation(sim); ! ! spark->SetSimState(S_PAUSED); spark->GetLog()->Normal() << "(RsgEdit) simulation paused\n"; + + // force update of ui state + UpdateWindowUI(wxUPDATE_UI_RECURSE); } *************** *** 441,444 **** --- 539,569 ---- } + void mainframe::UpdateCached() + { + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if (spark.get() == 0) + { + return; + } + + spark->UpdateCached(); + + wxWindowList& children = GetChildren(); + for ( + wxWindowList::Node *node = children.GetFirst(); + node != 0; + node = node->GetNext() + ) + { + propertyframe* pf = dynamic_cast<propertyframe*>(node->GetData()); + if (pf == 0) + { + continue; + } + + pf->UpdateCached(); + } + } + void mainframe::OnUpdateViewTree(wxUpdateUIEvent& event) { *************** *** 474,475 **** --- 599,706 ---- } } + + void mainframe::OnUpdateFileOpen(wxUpdateUIEvent& event) + { + event.Enable(GetSimState() == S_PAUSED); + } + + bool mainframe::OpenSimulation(const wxString& fname) + { + ResetSimulation(); + mSparkTree.Init(mCtrTree); + InitTreeNodeProperties(); + + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if (spark.get() == 0) + { + assert(false); + return false; + } + + spark->GetLog()->Normal() << "(RsgEdit) reading " << fname << "\n"; + if (! spark->GetScriptServer()->Run((const char*)fname.c_str())) + { + return false; + } + + UpdateCached(); + + shared_ptr<SimulationServer> sim = spark->GetSimulationServer(); + if (sim.get() == 0) + { + assert(false); + return false; + } + + InitSimulation(sim); + + if (SIM_SIMSTEP > 0.0) + { + AdvanceSimulation(sim, SIM_SIMSTEP); + } else + { + AdvanceSimulation(sim, 0.01f); + } + + DoneSimulation(sim); + + mSimFName = fname; + UpdateTitle(); + return true; + } + + void mainframe::OnFileOpen(wxCommandEvent& event) + { + wxString message(wxT("Choose a ruby script to run")); + wxString default_path(wxT("./rsg")); + wxString default_filename(wxT("")); + wxString default_extension(wxT("")); + wxString wildcard(wxT("ruby scripts (*.rb)|*.rb")); + + wxString filename = wxFileSelector(message, default_path, default_filename, default_extension, wildcard); + if (filename.empty() ) + { + return; + } + + OpenSimulation(filename); + } + + void mainframe::OnUpdateFileReload(wxUpdateUIEvent& event) + { + event.Enable( + (GetSimState() == S_PAUSED) && + (! mSimFName.empty()) + ); + } + + void mainframe::OnFileReload(wxCommandEvent& event) + { + OpenSimulation(mSimFName); + } + + void mainframe::OnHelpAbout(wxCommandEvent& event) + { + aboutDlg dlg(this, wxID_ANY, wxT("About SimSpark")); + dlg.ShowModal(); + } + + void mainframe::OnAgentOpen(wxCommandEvent& event) + { + wxString message(wxT("Choose an agent executable to run")); + wxString default_path(wxT(".")); + wxString default_filename(wxT("")); + wxString default_extension(wxT("")); + wxString wildcard(wxT("agent executables (*.exe)|*.exe")); + + wxString filename = wxFileSelector(message, default_path, default_filename, default_extension, wildcard); + if (filename.empty() ) + { + return; + } + + agentframe* frame(new agentframe(this, wxID_ANY, filename)); + frame->SetTitle(wxFileName(filename).GetName()); + frame->Show(); + frame->StartAgent(filename); + } Index: sparktree.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparktree.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sparktree.h 22 Jan 2006 12:19:28 -0000 1.2 --- sparktree.h 15 Mar 2007 07:26:24 -0000 1.3 *************** *** 21,25 **** --- 21,30 ---- #define SPARKTREE_H__ + #ifdef WIN32 + #include <winsock2.h> + #endif + #include <zeitgeist/core.h> + #include <wx/wx.h> #include <wx/treectrl.h> *************** *** 27,31 **** { public: ! struct ItemData : public wxTreeItemData { public: --- 32,36 ---- { public: ! class ItemData : public wxTreeItemData { public: Index: sparkglcanvas.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sparkglcanvas.h 8 Jan 2006 14:15:27 -0000 1.3 --- sparkglcanvas.h 15 Mar 2007 07:26:24 -0000 1.4 *************** *** 21,24 **** --- 21,28 ---- #define SPARKGLCANVAS_H__ + #ifdef WIN32 + #include <winsock2.h> + #endif + #include <wx/glcanvas.h> #include "sparkglrender.h" *************** *** 59,63 **** void OnMouseMove(wxMouseEvent& event); ! void Render(); protected: --- 63,68 ---- void OnMouseMove(wxMouseEvent& event); ! void Render(wxDC& dc); ! void Reset(); protected: --- NEW FILE: aboutDlg.h --- // -*- C++ -*- generated by wxGlade 0.4.1 on Sun Feb 18 14:55:33 2007 #include <wx/wx.h> #include <wx/image.h> #ifndef ABOUTDLG_H #define ABOUTDLG_H // begin wxGlade: ::dependencies // end wxGlade class aboutDlg: public wxDialog { public: // begin wxGlade: aboutDlg::ids // end wxGlade aboutDlg(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE); private: // begin wxGlade: aboutDlg::methods void set_properties(); void do_layout(); // end wxGlade protected: // begin wxGlade: aboutDlg::attributes wxStaticBitmap* mBitmap; wxStaticText* label_1; wxButton* button_1; // end wxGlade }; // wxGlade: end class #endif // ABOUTDLG_H Index: rsgedit.wxg =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.wxg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rsgedit.wxg 22 Jan 2006 12:19:28 -0000 1.4 --- rsgedit.wxg 15 Mar 2007 07:26:24 -0000 1.5 *************** *** 1,6 **** <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4 on Sun Jan 22 13:15:36 2006 --> ! <application path="/home/markus/cvs/simspark/contrib/rsgedit/" name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> <object class="mainframe" name="MainFrame" base="EditFrame"> <style>wxICONIZE|wxCAPTION|wxMINIMIZE|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxCLIP_CHILDREN</style> --- 1,6 ---- <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Tue Mar 06 22:13:36 2007 --> ! <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> <object class="mainframe" name="MainFrame" base="EditFrame"> <style>wxICONIZE|wxCAPTION|wxMINIMIZE|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxCLIP_CHILDREN</style> *************** *** 13,16 **** --- 13,28 ---- <menu name="" label="&File"> <item> + <label>&Open</label> + <id>ID_FILE_OPEN</id> + </item> + <item> + <label>Start &Agent</label> + <id>ID_AGENT_OPEN</id> + </item> + <item> + <label>&Reload</label> + <id>ID_FILE_RELOAD</id> + </item> + <item> <label>&Exit</label> <id>wxID_EXIT</id> *************** *** 43,46 **** --- 55,64 ---- </item> </menu> + <menu name="" itemid="ID_HELP" label="&Help"> + <item> + <label>&About</label> + <id>ID_HELP_ABOUT</id> + </item> + </menu> </menus> </object> *************** *** 66,82 **** <orient>wxVERTICAL</orient> <object class="sizeritem"> - <flag>wxEXPAND|wxADJUST_MINSIZE</flag> - <border>0</border> - <option>0</option> - <object class="wxTextCtrl" name="mCtrLocation" base="EditTextCtrl"> - </object> - </object> - <object class="sizeritem"> <flag>wxEXPAND</flag> <border>0</border> <option>1</option> ! <object class="wxTreeCtrl" name="mCtrTree" base="EditTreeCtrl"> ! <style>wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER</style> ! <id>1</id> </object> </object> --- 84,124 ---- <orient>wxVERTICAL</orient> <object class="sizeritem"> <flag>wxEXPAND</flag> <border>0</border> <option>1</option> ! <object class="wxSplitterWindow" name="window_1" base="EditSplitterWindow"> ! <style>wxSP_3D|wxSP_BORDER</style> ! <orientation>wxSPLIT_HORIZONTAL</orientation> ! <window_2>window_1_pane_2</window_2> ! <window_1>window_1_pane_1</window_1> ! <object class="wxPanel" name="window_1_pane_1" base="EditPanel"> ! <style>wxTAB_TRAVERSAL</style> ! <object class="wxBoxSizer" name="sizer_4" base="EditBoxSizer"> ! <orient>wxVERTICAL</orient> ! <object class="sizeritem"> ! <flag>wxEXPAND</flag> ! <border>0</border> ! <option>1</option> ! <object class="wxListCtrl" name="mCtrPropList" base="EditListCtrl"> ! <style>wxLC_REPORT|wxSUNKEN_BORDER</style> ! </object> ! </object> ! </object> ! </object> ! <object class="wxPanel" name="window_1_pane_2" base="EditPanel"> ! <style>wxTAB_TRAVERSAL</style> ! <object class="wxBoxSizer" name="sizer_8" base="EditBoxSizer"> ! <orient>wxVERTICAL</orient> ! <object class="sizeritem"> ! <flag>wxEXPAND</flag> ! <border>0</border> ! <option>1</option> ! <object class="wxTreeCtrl" name="mCtrTree" base="EditTreeCtrl"> ! <style>wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER</style> ! <id>1</id> ! </object> ! </object> ! </object> ! </object> </object> </object> *************** *** 122,126 **** <option>1</option> <object class="wxTextCtrl" name="mCtrLog" base="EditTextCtrl"> ! <style>wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxTE_LINEWRAP</style> </object> </object> --- 164,168 ---- <option>1</option> <object class="wxTextCtrl" name="mCtrLog" base="EditTextCtrl"> ! <style>wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL</style> </object> </object> *************** *** 136,140 **** </object> <object class="propertyframe" name="Properties" base="EditFrame"> ! <style>wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFRAME_TOOL_WINDOW|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN</style> <title>frame_1</title> <size>300, 150</size> --- 178,182 ---- </object> <object class="propertyframe" name="Properties" base="EditFrame"> ! <style>wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN</style> <title>frame_1</title> <size>300, 150</size> *************** *** 145,149 **** <border>0</border> <option>1</option> ! <object class="wxListCtrl" name="mCtrList" base="EditListCtrl"> <style>wxLC_REPORT|wxSUNKEN_BORDER</style> </object> --- 187,191 ---- <border>0</border> <option>1</option> ! <object class="wxListCtrl" name="mCtrPropList" base="EditListCtrl"> <style>wxLC_REPORT|wxSUNKEN_BORDER</style> </object> *************** *** 151,153 **** --- 193,245 ---- </object> </object> + <object class="aboutDlg" name="dialog_1" base="EditDialog"> + <style>wxDEFAULT_DIALOG_STYLE</style> + <title>dialog_1</title> + <object class="wxBoxSizer" name="sizer_9" base="EditBoxSizer"> + <orient>wxVERTICAL</orient> + <object class="sizeritem"> + <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxStaticBitmap" name="mBitmap" base="EditStaticBitmap"> + <attribute>1</attribute> + <size>500, 200</size> + </object> + </object> + <object class="sizeritem"> + <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxStaticText" name="label_1" base="EditStaticText"> + <attribute>1</attribute> + <label>SimSpark Copyright (C) RoboCup Soccer Server 3D Maintenance Group</label> + </object> + </object> + <object class="sizeritem"> + <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxButton" name="button_1" base="EditButton"> + <label>&Ok</label> + <id>wxID_OK</id> + </object> + </object> + </object> + </object> + <object class="agentframe" name="frame_1" base="EditFrame"> + <style>wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFRAME_TOOL_WINDOW|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN</style> + <title>frame_1</title> + <size>500, 200</size> + <object class="wxBoxSizer" name="sizer_10" base="EditBoxSizer"> + <orient>wxVERTICAL</orient> + <object class="sizeritem"> + <flag>wxEXPAND|wxADJUST_MINSIZE</flag> + <border>0</border> + <option>1</option> + <object class="wxTextCtrl" name="mCtrLog" base="EditTextCtrl"> + <style>wxTE_MULTILINE|wxTE_READONLY</style> + </object> + </object> + </object> + </object> </application> Index: main.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/main.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.h 22 Jan 2006 12:19:28 -0000 1.2 --- main.h 15 Mar 2007 07:26:24 -0000 1.3 *************** *** 21,24 **** --- 21,28 ---- #define MAIN_H__ + #ifdef WIN32 + #include <winsock2.h> + #endif + #include <wx/glcanvas.h> #include <wx/app.h> *************** *** 36,39 **** --- 40,46 ---- protected: + void OnFatalException(); + + protected: boost::shared_ptr<SimSpark> mSpark; boost::shared_ptr<Property> mProperty; Index: propertyframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/propertyframe.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** propertyframe.h 22 Jan 2006 17:25:23 -0000 1.2 --- propertyframe.h 15 Mar 2007 07:26:24 -0000 1.3 *************** *** 32,35 **** --- 32,36 ---- #include <boost/weak_ptr.hpp> + #include <zeitgeist/leaf.h> #include "propertylist.h" *************** *** 46,53 **** --- 47,59 ---- propertyframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); + /** set the managed leaf */ void SetLeaf(boost::weak_ptr<zeitgeist::Leaf> leaf); + /** refresh the displayed properties of the managed leaf */ void RefreshProperties(); + /** update the cached reference to the managed leaf */ + void UpdateCached(); + private: // begin wxGlade: propertyframe::methods *************** *** 58,65 **** protected: // begin wxGlade: propertyframe::attributes ! wxListCtrl* mCtrList; // end wxGlade ! boost::weak_ptr<zeitgeist::Leaf> mLeaf; PropertyList mPropList; }; // wxGlade: end class --- 64,72 ---- protected: // begin wxGlade: propertyframe::attributes ! wxListCtrl* mCtrPropList; // end wxGlade ! zeitgeist::Leaf::CachedPath<zeitgeist::Leaf> mPath; ! PropertyList mPropList; }; // wxGlade: end class --- NEW FILE: constants.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: constants.h,v 1.2 2007/03/15 07:26:24 fruit Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PU... [truncated message content] |