You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(153) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(46) |
Mar
(12) |
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(263) |
Mar
(235) |
Apr
(66) |
May
(42) |
Jun
(270) |
Jul
(65) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Oliver O. <fr...@us...> - 2007-03-15 07:27:03
|
Update of /cvsroot/simspark/simspark/spark/oxygen In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/oxygen Modified Files: Makefile.am Added Files: oxygen.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 14 Apr 2006 16:27:26 -0000 1.3 --- Makefile.am 15 Mar 2007 07:26:26 -0000 1.4 *************** *** 167,173 **** nobase_libpkginclude_HEADERS = \ agentaspect/agentaspect.h \ agentaspect/effector.h \ agentaspect/perceptor.h \ - agentaspect/createaction.h \ controlaspect/controlaspect.h \ gamecontrolserver/predicate.h \ --- 167,175 ---- nobase_libpkginclude_HEADERS = \ agentaspect/agentaspect.h \ + agentaspect/createaction.h \ agentaspect/effector.h \ + agentaspect/jointeffector.h \ + agentaspect/jointperceptor.h \ agentaspect/perceptor.h \ controlaspect/controlaspect.h \ gamecontrolserver/predicate.h \ *************** *** 183,187 **** --- 185,191 ---- physicsserver/collisionhandler.h \ physicsserver/contactjointhandler.h \ + physicsserver/dragcontroller.h \ physicsserver/odeobject.h \ + physicsserver/odewrapper.h \ physicsserver/physicsserver.h \ physicsserver/planecollider.h \ *************** *** 190,195 **** physicsserver/space.h \ physicsserver/spherecollider.h \ physicsserver/world.h \ - physicsserver/dragcontroller.h \ physicsserver/velocitycontroller.h \ physicsserver/joint.h \ --- 194,199 ---- physicsserver/space.h \ physicsserver/spherecollider.h \ + physicsserver/transformcollider.h \ physicsserver/world.h \ physicsserver/velocitycontroller.h \ physicsserver/joint.h \ --- NEW FILE: oxygen.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="oxygen" ProjectGUID="{DAB59CC4-E184-40CC-A858-27C432A53AAB}" RootNamespace="oxygen" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\win32;..\;..\utility" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_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="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\win32;..\;..\utility" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_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="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="agentaspect" > <File RelativePath=".\agentaspect\agentaspect.cpp" > </File> <File RelativePath=".\agentaspect\agentaspect.h" > </File> <File RelativePath=".\agentaspect\agentaspect_c.cpp" > </File> <File RelativePath=".\agentaspect\createaction.h" > </File> <File RelativePath=".\agentaspect\effector.cpp" > </File> <File RelativePath=".\agentaspect\effector.h" > </File> <File RelativePath=".\agentaspect\effector_c.cpp" > </File> <File RelativePath=".\agentaspect\perceptor.cpp" > </File> <File RelativePath=".\agentaspect\perceptor.h" > </File> <File RelativePath=".\agentaspect\perceptor_c.cpp" > </File> </Filter> <Filter Name="controlaspect" > <File RelativePath=".\controlaspect\controlaspect.cpp" > </File> <File RelativePath=".\controlaspect\controlaspect.h" > </File> <File RelativePath=".\controlaspect\controlaspect_c.cpp" > </File> </Filter> <Filter Name="gamecontrolserver" > <File RelativePath=".\gamecontrolserver\actionobject.h" > </File> <File RelativePath=".\gamecontrolserver\actionobject_c.cpp" > </File> <File RelativePath=".\gamecontrolserver\baseparser.h" > </File> <File RelativePath=".\gamecontrolserver\baseparser_c.cpp" > </File> <File RelativePath=".\gamecontrolserver\gamecontrolserver.cpp" > </File> <File RelativePath=".\gamecontrolserver\gamecontrolserver.h" > </File> <File RelativePath=".\gamecontrolserver\gamecontrolserver_c.cpp" > </File> <File RelativePath=".\gamecontrolserver\predicate.cpp" > </File> <File RelativePath=".\gamecontrolserver\predicate.h" > </File> </Filter> <Filter Name="geometryserver" > <File RelativePath=".\geometryserver\geometryserver.cpp" > </File> <File RelativePath=".\geometryserver\geometryserver.h" > </File> <File RelativePath=".\geometryserver\geometryserver_c.cpp" > </File> <File RelativePath=".\geometryserver\indexbuffer.cpp" > </File> <File RelativePath=".\geometryserver\indexbuffer.h" > </File> <File RelativePath=".\geometryserver\meshimporter.cpp" > </File> <File RelativePath=".\geometryserver\meshimporter.h" > </File> <File RelativePath=".\geometryserver\meshimporter_c.cpp" > </File> <File RelativePath=".\geometryserver\stdmeshimporter.cpp" > </File> <File RelativePath=".\geometryserver\stdmeshimporter.h" > </File> <File RelativePath=".\geometryserver\stdmeshimporter_c.cpp" > </File> <File RelativePath=".\geometryserver\trimesh.cpp" > </File> <File RelativePath=".\geometryserver\trimesh.h" > </File> </Filter> <Filter Name="monitorserver" > <File RelativePath=".\monitorserver\custommonitor.cpp" > </File> <File RelativePath=".\monitorserver\custommonitor.h" > </File> <File RelativePath=".\monitorserver\custommonitor_c.cpp" > </File> <File RelativePath=".\monitorserver\monitorcmdparser.cpp" > </File> <File RelativePath=".\monitorserver\monitorcmdparser.h" > </File> <File RelativePath=".\monitorserver\monitorcmdparser_c.cpp" > </File> <File RelativePath=".\monitorserver\monitoritem.h" > </File> <File RelativePath=".\monitorserver\monitoritem_c.cpp" > </File> <File RelativePath=".\monitorserver\monitorserver.cpp" > </File> <File RelativePath=".\monitorserver\monitorserver.h" > </File> <File RelativePath=".\monitorserver\monitorserver_c.cpp" > </File> <File RelativePath=".\monitorserver\monitorsystem.cpp" > </File> <File RelativePath=".\monitorserver\monitorsystem.h" > </File> <File RelativePath=".\monitorserver\monitorsystem_c.cpp" > </File> </Filter> <Filter Name="physicsserver" > <File RelativePath=".\physicsserver\angularmotor.cpp" > </File> <File RelativePath=".\physicsserver\angularmotor.h" > </File> <File RelativePath=".\physicsserver\angularmotor_c.cpp" > </File> <File RelativePath=".\physicsserver\balljoint.cpp" > </File> <File RelativePath=".\physicsserver\balljoint.h" > </File> <File RelativePath=".\physicsserver\balljoint_c.cpp" > </File> <File RelativePath=".\physicsserver\body.cpp" > </File> <File RelativePath=".\physicsserver\body.h" > </File> <File RelativePath=".\physicsserver\body_c.cpp" > </File> <File RelativePath=".\physicsserver\bodycontroller.cpp" > </File> <File RelativePath=".\physicsserver\bodycontroller.h" > </File> <File RelativePath=".\physicsserver\bodycontroller_c.cpp" > </File> <File RelativePath=".\physicsserver\boxcollider.cpp" > </File> <File RelativePath=".\physicsserver\boxcollider.h" > </File> <File RelativePath=".\physicsserver\boxcollider_c.cpp" > </File> <File RelativePath=".\physicsserver\ccylindercollider.cpp" > </File> <File RelativePath=".\physicsserver\ccylindercollider.h" > </File> <File RelativePath=".\physicsserver\ccylindercollider_c.cpp" > </File> <File RelativePath=".\physicsserver\collider.cpp" > </File> <File RelativePath=".\physicsserver\collider.h" > </File> <File RelativePath=".\physicsserver\collider_c.cpp" > </File> <File RelativePath=".\physicsserver\collisionhandler.cpp" > </File> <File RelativePath=".\physicsserver\collisionhandler.h" > </File> <File RelativePath=".\physicsserver\collisionhandler_c.cpp" > </File> <File RelativePath=".\physicsserver\contactjointhandler.cpp" > </File> <File RelativePath=".\physicsserver\contactjointhandler.h" > </File> <File RelativePath=".\physicsserver\contactjointhandler_c.cpp" > </File> <File RelativePath=".\physicsserver\dragcontroller.cpp" > </File> <File RelativePath=".\physicsserver\dragcontroller.h" > </File> <File RelativePath=".\physicsserver\dragcontroller_c.cpp" > </File> <File RelativePath=".\physicsserver\fixedjoint.cpp" > </File> <File RelativePath=".\physicsserver\fixedjoint.h" > </File> <File RelativePath=".\physicsserver\fixedjoint_c.cpp" > </File> <File RelativePath=".\physicsserver\hinge2joint.cpp" > </File> <File RelativePath=".\physicsserver\hinge2joint.h" > </File> <File RelativePath=".\physicsserver\hinge2joint_c.cpp" > </File> <File RelativePath=".\physicsserver\hingejoint.cpp" > </File> <File RelativePath=".\physicsserver\hingejoint.h" > </File> <File RelativePath=".\physicsserver\hingejoint_c.cpp" > </File> <File RelativePath=".\physicsserver\joint.cpp" > </File> <File RelativePath=".\physicsserver\joint.h" > </File> <File RelativePath=".\physicsserver\joint_c.cpp" > </File> <File RelativePath=".\physicsserver\odeobject.cpp" > </File> <File RelativePath=".\physicsserver\odeobject.h" > </File> <File RelativePath=".\physicsserver\odeobject_c.cpp" > </File> <File RelativePath=".\physicsserver\odewrapper.h" > </File> <File RelativePath=".\physicsserver\physicsserver.cpp" > </File> <File RelativePath=".\physicsserver\physicsserver.h" > </File> <File RelativePath=".\physicsserver\physicsserver_c.cpp" > </File> <File RelativePath=".\physicsserver\planecollider.cpp" > </File> <File RelativePath=".\physicsserver\planecollider.h" > </File> <File RelativePath=".\physicsserver\planecollider_c.cpp" > </File> <File RelativePath=".\physicsserver\raycollider.cpp" > </File> <File RelativePath=".\physicsserver\raycollider.h" > </File> <File RelativePath=".\physicsserver\raycollider_c.cpp" > </File> <File RelativePath=".\physicsserver\recorderhandler.cpp" > </File> <File RelativePath=".\physicsserver\recorderhandler.h" > </File> <File RelativePath=".\physicsserver\recorderhandler_c.cpp" > </File> <File RelativePath=".\physicsserver\sliderjoint.cpp" > </File> <File RelativePath=".\physicsserver\sliderjoint.h" > </File> <File RelativePath=".\physicsserver\sliderjoint_c.cpp" > </File> <File RelativePath=".\physicsserver\space.cpp" > </File> <File RelativePath=".\physicsserver\space.h" > </File> <File RelativePath=".\physicsserver\space_c.cpp" > </File> <File RelativePath=".\physicsserver\spherecollider.cpp" > </File> <File RelativePath=".\physicsserver\spherecollider.h" > </File> <File RelativePath=".\physicsserver\spherecollider_c.cpp" > </File> <File RelativePath=".\physicsserver\transformcollider.cpp" > </File> <File RelativePath=".\physicsserver\transformcollider.h" > </File> <File RelativePath=".\physicsserver\transformcollider_c.cpp" > </File> <File RelativePath=".\physicsserver\universaljoint.cpp" > </File> <File RelativePath=".\physicsserver\universaljoint.h" > </File> <File RelativePath=".\physicsserver\universaljoint_c.cpp" > </File> <File RelativePath=".\physicsserver\velocitycontroller.cpp" > </File> <File RelativePath=".\physicsserver\velocitycontroller.h" > </File> <File RelativePath=".\physicsserver\velocitycontroller_c.cpp" > </File> <File RelativePath=".\physicsserver\world.cpp" > </File> <File RelativePath=".\physicsserver\world.h" > </File> <File RelativePath=".\physicsserver\world_c.cpp" > </File> </Filter> <Filter Name="sceneserver" > <File RelativePath=".\sceneserver\basenode.cpp" > </File> <File RelativePath=".\sceneserver\basenode.h" > </File> <File RelativePath=".\sceneserver\basenode_c.cpp" > </File> <File RelativePath=".\sceneserver\camera.cpp" > </File> <File RelativePath=".\sceneserver\camera.h" > </File> <File RelativePath=".\sceneserver\camera_c.cpp" > </File> <File RelativePath=".\sceneserver\fpscontroller.cpp" > </File> <File RelativePath=".\sceneserver\fpscontroller.h" > </File> <File RelativePath=".\sceneserver\fpscontroller_c.cpp" > </File> <File RelativePath=".\sceneserver\scene.cpp" > </File> <File RelativePath=".\sceneserver\scene.h" > </File> <File RelativePath=".\sceneserver\scene_c.cpp" > </File> <File RelativePath=".\sceneserver\sceneimporter.h" > </File> <File RelativePath=".\sceneserver\sceneimporter_c.cpp" > </File> <File RelativePath=".\sceneserver\sceneserver.cpp" > </File> <File RelativePath=".\sceneserver\sceneserver.h" > </File> <File RelativePath=".\sceneserver\sceneserver_c.cpp" > </File> <File RelativePath=".\sceneserver\transform.cpp" > </File> <File RelativePath=".\sceneserver\transform.h" > </File> <File RelativePath=".\sceneserver\transform_c.cpp" > </File> </Filter> <Filter Name="simulationserver" > <File RelativePath=".\simulationserver\agentcontrol.cpp" > </File> <File RelativePath=".\simulationserver\agentcontrol.h" > </File> <File RelativePath=".\simulationserver\agentcontrol_c.cpp" > </File> <File RelativePath=".\simulationserver\monitorcontrol.cpp" > </File> <File RelativePath=".\simulationserver\monitorcontrol.h" > </File> <File RelativePath=".\simulationserver\monitorcontrol_c.cpp" > </File> <File RelativePath=".\simulationserver\netbuffer.cpp" > </File> <File RelativePath=".\simulationserver\netbuffer.h" > </File> <File RelativePath=".\simulationserver\netclient.cpp" > </File> <File RelativePath=".\simulationserver\netclient.h" > </File> <File RelativePath=".\simulationserver\netclient_c.cpp" > </File> <File RelativePath=".\simulationserver\netcontrol.cpp" > </File> <File RelativePath=".\simulationserver\netcontrol.h" > </File> <File RelativePath=".\simulationserver\netcontrol_c.cpp" > </File> <File RelativePath=".\simulationserver\netmessage.cpp" > </File> <File RelativePath=".\simulationserver\netmessage.h" > </File> <File RelativePath=".\simulationserver\netmessage_c.cpp" > </File> <File RelativePath=".\simulationserver\simcontrolnode.cpp" > </File> <File RelativePath=".\simulationserver\simcontrolnode.h" > </File> <File RelativePath=".\simulationserver\simcontrolnode_c.cpp" > </File> <File RelativePath=".\simulationserver\simulationserver.cpp" > </File> <File RelativePath=".\simulationserver\simulationserver.h" > </File> <File RelativePath=".\simulationserver\simulationserver_c.cpp" > </File> </Filter> <File RelativePath=".\oxygen.cpp" > </File> <File RelativePath=".\oxygen.h" > </File> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Oliver O. <fr...@us...> - 2007-03-15 07:27:03
|
Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/kerosin/materialserver Modified Files: material2dtexture.cpp materialsolid.cpp Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: materialsolid.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/materialserver/materialsolid.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** materialsolid.cpp 18 Feb 2006 19:41:48 -0000 1.2 --- materialsolid.cpp 15 Mar 2007 07:26:26 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- */ #include "materialsolid.h" + #include <kerosin/openglserver/openglwrapper.h> #include <kerosin/openglserver/openglserver.h> Index: material2dtexture.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/materialserver/material2dtexture.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** material2dtexture.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- material2dtexture.cpp 15 Mar 2007 07:26:26 -0000 1.2 *************** *** 21,29 **** */ #include "material2dtexture.h" #include <kerosin/textureserver/textureserver.h> #include <kerosin/textureserver/texture.h> #include <kerosin/openglserver/openglserver.h> - #include <zeitgeist/logserver/logserver.h> - #include <zeitgeist/scriptserver/scriptserver.h> using namespace zeitgeist; --- 21,30 ---- */ #include "material2dtexture.h" + #include <zeitgeist/logserver/logserver.h> + #include <zeitgeist/scriptserver/scriptserver.h> #include <kerosin/textureserver/textureserver.h> #include <kerosin/textureserver/texture.h> + #include <kerosin/openglserver/openglwrapper.h> #include <kerosin/openglserver/openglserver.h> using namespace zeitgeist; *************** *** 80,84 **** if (mTexDiffuse.get() != 0) { ! glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); mTexDiffuse->Bind(); --- 81,85 ---- if (mTexDiffuse.get() != 0) { ! OpenGLServer::glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); mTexDiffuse->Bind(); *************** *** 87,91 **** if (mTexNormal.get() != 0) { ! glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); mTexNormal->Bind(); --- 88,92 ---- if (mTexNormal.get() != 0) { ! OpenGLServer::glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); mTexNormal->Bind(); *************** *** 94,98 **** if (mTexSpecular.get() != 0) { ! glActiveTextureARB(GL_TEXTURE2_ARB); glEnable(GL_TEXTURE_2D); mTexSpecular->Bind(); --- 95,99 ---- if (mTexSpecular.get() != 0) { ! OpenGLServer::glActiveTextureARB(GL_TEXTURE2_ARB); glEnable(GL_TEXTURE_2D); mTexSpecular->Bind(); |
From: Oliver O. <fr...@us...> - 2007-03-15 07:27:03
|
Update of /cvsroot/simspark/simspark/spark/kerosin/fontserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/kerosin/fontserver Modified Files: font.cpp font.h Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: font.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/fontserver/font.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** font.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- font.cpp 15 Mar 2007 07:26:25 -0000 1.2 *************** *** 13,31 **** #endif - #include <GL/gl.h> - using namespace kerosin; using namespace salt; ! Font::Font(FontServer &fontServer) : mTexID(0), mRowHeight(0), mSize(0), mFontServer(fontServer) { } ! Font::~Font() { } ! bool Font::Init(const std::string &name, unsigned int size, FT_Face face) { mName = name; --- 13,29 ---- #endif using namespace salt; ! kerosin::Font::Font(FontServer &fontServer) : mTexID(0), mRowHeight(0), mSize(0), mFontServer(fontServer) { } ! kerosin::Font::~Font() { } ! bool kerosin::Font::Init(const std::string &name, unsigned int size, FT_Face face) { mName = name; *************** *** 202,206 **** } ! bool Font::Bind(int vRows) { glEnable(GL_TEXTURE_2D); --- 200,204 ---- } ! bool kerosin::Font::Bind(int vRows) { glEnable(GL_TEXTURE_2D); *************** *** 228,232 **** } ! void Font::Dump() { glBegin(GL_QUADS); --- 226,230 ---- } ! void kerosin::Font::Dump() { glBegin(GL_QUADS); *************** *** 242,246 **** } ! void Font::DrawString(float x, float y, const char *string) { const char *c = string; --- 240,244 ---- } ! void kerosin::Font::DrawString(float x, float y, const char *string) { const char *c = string; *************** *** 276,280 **** } ! void Font::Printf(float x, float y, const char *format, ...) { char buffer[4096]; --- 274,278 ---- } ! void kerosin::Font::Printf(float x, float y, const char *format, ...) { char buffer[4096]; *************** *** 286,290 **** } ! void Font::RowPrintf(float x, float row, const char *format, ...) { char buffer[4096]; --- 284,288 ---- } ! void kerosin::Font::RowPrintf(float x, float row, const char *format, ...) { char buffer[4096]; *************** *** 296,300 **** } ! float Font::GetStringWidth(const char* string, int numChar) { if (numChar == -1) numChar = strlen(string); --- 294,298 ---- } ! float kerosin::Font::GetStringWidth(const char* string, int numChar) { if (numChar == -1) numChar = strlen(string); *************** *** 319,333 **** } ! float Font::GetRowHeight() { return (float)mRowHeight; } ! const std::string& Font::GetName() const { return mName; } ! unsigned int Font::GetSize() const { return mSize; --- 317,331 ---- } ! float kerosin::Font::GetRowHeight() { return (float)mRowHeight; } ! const std::string& kerosin::Font::GetName() const { return mName; } ! unsigned int kerosin::Font::GetSize() const { return mSize; Index: font.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/fontserver/font.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** font.h 5 Dec 2005 21:38:22 -0000 1.1 --- font.h 15 Mar 2007 07:26:25 -0000 1.2 *************** *** 27,30 **** --- 27,32 ---- #include "glyph.h" + #include <kerosin/openglserver/openglwrapper.h> + namespace kerosin { *************** *** 107,111 **** //! OpenGL Texture ID ! unsigned int mTexID; //! height (in pixels) of a row --- 109,113 ---- //! OpenGL Texture ID ! GLuint mTexID; //! height (in pixels) of a row |
From: Oliver O. <fr...@us...> - 2007-03-15 07:27:03
|
Update of /cvsroot/simspark/simspark/spark/kerosin/textureserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/kerosin/textureserver Modified Files: texture.cpp texture.h texture2d.cpp texture2d.h textureserver.cpp textureserver.h Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: texture2d.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/textureserver/texture2d.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** texture2d.cpp 5 Dec 2005 21:38:23 -0000 1.1 --- texture2d.cpp 15 Mar 2007 07:26:26 -0000 1.2 *************** *** 1,9 **** #include "texture2d.h" ! #include "../openglserver/openglserver.h" ! #include "../imageserver/image.h" using namespace kerosin; ! Texture2D::Texture2D(const boost::shared_ptr<TextureServer> &textureServer) : Texture(textureServer) { } --- 1,30 ---- + /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id$ + + 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. + */ #include "texture2d.h" ! #include <kerosin/openglserver/openglwrapper.h> ! #include <kerosin/imageserver/image.h> using namespace kerosin; ! Texture2D::Texture2D() : Texture() { } *************** *** 15,21 **** void Texture2D::Bind() const { ! if (mTexID != 0) { ! glBindTexture(GL_TEXTURE_2D, mTexID); } } --- 36,42 ---- void Texture2D::Bind() const { ! if (mTexID != 0) { ! glBindTexture(GL_TEXTURE_2D, mTexID); } } *************** *** 23,67 **** void Texture2D::Enable() const { ! glEnable(GL_TEXTURE_2D); } void Texture2D::Disable() const { ! glDisable(GL_TEXTURE_2D); } void Texture2D::Create(boost::shared_ptr<Image> &image) { ! mWidth = image->Width(); ! mHeight = image->Height(); ! Acquire(); ! Bind(); ! glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE ); ! if(image->HasAlpha()) ! glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, mWidth, mHeight, 0, image->Format(), image->Type(), image->Data()); ! else ! glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, mWidth, mHeight, 0, image->Format(), image->Type(), image->Data()); ! glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); ! glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); } void Texture2D::Clamp() const { ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); } void Texture2D::ClampToEdge() const { ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } void Texture2D::Repeat() const { ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } --- 44,92 ---- void Texture2D::Enable() const { ! glEnable(GL_TEXTURE_2D); } void Texture2D::Disable() const { ! glDisable(GL_TEXTURE_2D); } void Texture2D::Create(boost::shared_ptr<Image> &image) { ! mWidth = image->Width(); ! mHeight = image->Height(); ! Acquire(); ! Bind(); ! glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE ); ! if(image->HasAlpha()) ! { ! glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, mWidth, mHeight, 0, image->Format(), image->Type(), image->Data()); ! } ! else ! { ! glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, mWidth, mHeight, 0, image->Format(), image->Type(), image->Data()); ! } ! glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); ! glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); } void Texture2D::Clamp() const { ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); } void Texture2D::ClampToEdge() const { ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } void Texture2D::Repeat() const { ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } Index: textureserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/textureserver/textureserver.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** textureserver.cpp 5 Dec 2005 21:38:23 -0000 1.1 --- textureserver.cpp 15 Mar 2007 07:26:26 -0000 1.2 *************** *** 24,30 **** #include <zeitgeist/logserver/logserver.h> #include "../openglserver/openglserver.h" - #include "../imageserver/imageserver.h" #include "texture2d.h" using namespace boost; using namespace kerosin; --- 24,33 ---- #include <zeitgeist/logserver/logserver.h> #include "../openglserver/openglserver.h" #include "texture2d.h" + #ifndef WIN32 + #include "../imageserver/imageserver.h" + #endif + using namespace boost; using namespace kerosin; *************** *** 41,74 **** void TextureServer::OnLink() { ! // setup OpenGLServer reference ! mOpenGLServer = shared_dynamic_cast<OpenGLServer> ! (GetCore()->Get("sys/server/opengl")); ! ! if (mOpenGLServer.get() == 0) ! { ! GetLog()->Error() ! << "(TextureServer) ERROR: OpenGLServer not found\n"; ! } ! // setup ImageServer reference ! mImageServer = shared_dynamic_cast<ImageServer> ! (GetCore()->Get("sys/server/image")); ! if (mImageServer.get() == 0) { GetLog()->Error() << "(TextureServer) ERROR: ImageServer not found\n"; } ! } ! ! void TextureServer::OnUnlink() ! { ! mOpenGLServer.reset(); ! mImageServer.reset(); ! } ! ! boost::shared_ptr<OpenGLServer> TextureServer::GetOpenGLServer() const ! { ! return mOpenGLServer; } --- 44,57 ---- void TextureServer::OnLink() { ! #ifndef WIN32 // setup ImageServer reference ! RegisterCachedPath(mImageServer, "/sys/server/image"); ! if (mImageServer.expired()) { GetLog()->Error() << "(TextureServer) ERROR: ImageServer not found\n"; } ! #endif } *************** *** 83,91 **** } ! if (mImageServer.get() == 0) { return shared_ptr<Texture>(); } // no match for that name, so we have to load it shared_ptr<Image> image = mImageServer->Load(name.c_str()); --- 66,77 ---- } ! if (mImageServer.expired()) { return shared_ptr<Texture>(); } + #ifdef WIN32 + return shared_ptr<Texture>(); + #else // no match for that name, so we have to load it shared_ptr<Image> image = mImageServer->Load(name.c_str()); *************** *** 96,101 **** } ! Texture2D *tex2D = new Texture2D(shared_static_cast<TextureServer> ! (make_shared(GetSelf()))); tex2D->Create(image); shared_ptr<Texture> texture(tex2D); --- 82,86 ---- } ! Texture2D *tex2D = new Texture2D(); tex2D->Create(image); shared_ptr<Texture> texture(tex2D); *************** *** 105,107 **** --- 90,93 ---- return texture; + #endif } Index: textureserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/textureserver/textureserver.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** textureserver.h 5 Dec 2005 21:38:23 -0000 1.1 --- textureserver.h 15 Mar 2007 07:26:26 -0000 1.2 *************** *** 44,47 **** --- 44,49 ---- #include <zeitgeist/class.h> #include <zeitgeist/leaf.h> + #include <kerosin/openglserver/openglserver.h> + #include <kerosin/imageserver/imageserver.h> #if HAVE_HASH_MAP *************** *** 57,62 **** #endif - class OpenGLServer; - class ImageServer; class Texture; --- 59,62 ---- *************** *** 91,106 **** virtual void OnLink(); - /** reset OpenGLServer and ImageServer reference */ - virtual void OnUnlink(); - // // members // private: - /** reference to the OpenGLServer */ - boost::shared_ptr<OpenGLServer> mOpenGLServer; - /** reference to the ImageServer */ ! boost::shared_ptr<ImageServer> mImageServer; /** registry of cached textures */ --- 91,100 ---- virtual void OnLink(); // // members // private: /** reference to the ImageServer */ ! CachedPath<ImageServer> mImageServer; /** registry of cached textures */ Index: texture.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/textureserver/texture.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** texture.cpp 5 Dec 2005 21:38:23 -0000 1.1 --- texture.cpp 15 Mar 2007 07:26:26 -0000 1.2 *************** *** 1,10 **** #include "texture.h" - #include "../openglserver/openglserver.h" using namespace boost; using namespace kerosin; ! Texture::Texture(const boost::shared_ptr<TextureServer> &textureServer) : ! mTexID(0), mWidth(0), mHeight(0), mTextureServer(textureServer) { } --- 1,30 ---- + /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id$ + + 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. + */ #include "texture.h" using namespace boost; using namespace kerosin; ! Texture::Texture() ! : mTexID(0), mWidth(0), mHeight(0) { } *************** *** 12,45 **** Texture::~Texture() { ! Reset(); } void Texture::Reset() { ! if (mTexID) ! { ! glDeleteTextures(1, &mTexID); ! mTexID = 0; ! } } void Texture::Acquire() { ! Reset(); ! glGenTextures(1, &mTexID); } unsigned int Texture::GetWidth() const { ! return mWidth; } unsigned int Texture::GetHeight() const { ! return mHeight; ! } ! ! boost::shared_ptr<TextureServer> Texture::GetTextureServer() const ! { ! return make_shared(mTextureServer); } --- 32,62 ---- Texture::~Texture() { ! Reset(); } void Texture::Reset() { ! if (! mTexID) ! { ! return; ! } ! ! glDeleteTextures(1, &mTexID); ! mTexID = 0; } void Texture::Acquire() { ! Reset(); ! glGenTextures(1, &mTexID); } unsigned int Texture::GetWidth() const { ! return mWidth; } unsigned int Texture::GetHeight() const { ! return mHeight; } Index: texture2d.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/textureserver/texture2d.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** texture2d.h 5 Dec 2005 21:38:23 -0000 1.1 --- texture2d.h 15 Mar 2007 07:26:26 -0000 1.2 *************** *** 36,48 **** // public: ! Texture2D(const boost::shared_ptr<TextureServer> &textureServer); ~Texture2D(); ! //! bind the texture contained in this object to the corresponding target (user code is responsible for setting correct enables and tex units) virtual void Bind() const; ! //! enable the target associated with a texture type (e.g. GL_TEXTURE_2D) virtual void Enable() const; ! //! disable the target associated with a texture type (e.g. GL_TEXTURE_2D) virtual void Disable() const; virtual void Clamp() const; virtual void ClampToEdge() const; --- 36,58 ---- // public: ! Texture2D(); ~Texture2D(); ! /** bind the texture contained in this object to the corresponding ! target (user code is responsible for setting correct enables ! and tex units) ! */ virtual void Bind() const; ! ! /** enable the target associated with a texture type ! (e.g. GL_TEXTURE_2D) ! */ virtual void Enable() const; ! ! /** disable the target associated with a texture type ! (e.g. GL_TEXTURE_2D) ! */ virtual void Disable() const; + virtual void Clamp() const; virtual void ClampToEdge() const; Index: texture.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/textureserver/texture.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** texture.h 5 Dec 2005 21:38:23 -0000 1.1 --- texture.h 15 Mar 2007 07:26:26 -0000 1.2 *************** *** 25,28 **** --- 25,29 ---- #include <boost/weak_ptr.hpp> #include <boost/shared_ptr.hpp> + #include <kerosin/openglserver/openglwrapper.h> namespace kerosin *************** *** 57,61 **** // public: ! Texture(const boost::shared_ptr<TextureServer> &textureServer); virtual ~Texture(); --- 58,62 ---- // public: ! Texture(); virtual ~Texture(); *************** *** 66,75 **** void Acquire(); ! //! bind the texture contained in this object to the corresponding target (user code is responsible for setting correct enables and tex units) virtual void Bind() const = 0; ! //! enable the target associated with a texture type (e.g. GL_TEXTURE_2D) virtual void Enable() const = 0; ! //! disable the target associated with a texture type (e.g. GL_TEXTURE_2D) virtual void Disable() const = 0; virtual void Clamp() const = 0; virtual void ClampToEdge() const = 0; --- 67,86 ---- void Acquire(); ! /** bind the texture contained in this object to the corresponding ! target (user code is responsible for setting correct enables ! and tex units) ! */ virtual void Bind() const = 0; ! ! /** enable the target associated with a texture type ! (e.g. GL_TEXTURE_2D) ! */ virtual void Enable() const = 0; ! ! /** disable the target associated with a texture type ! (e.g. GL_TEXTURE_2D) ! */ virtual void Disable() const = 0; + virtual void Clamp() const = 0; virtual void ClampToEdge() const = 0; *************** *** 80,93 **** unsigned int GetHeight() const; - boost::shared_ptr<TextureServer> GetTextureServer() const; // // members // protected: ! unsigned int mTexID; // OpenGL texture handle (initialized to 0) ! unsigned int mWidth; // width of texture ! unsigned int mHeight; // height of texture ! private: ! boost::weak_ptr<TextureServer> mTextureServer; // texture server, which created this object }; --- 91,106 ---- unsigned int GetHeight() const; // // members // protected: ! //! OpenGL texture handle ! GLuint mTexID; ! ! //! width of texture ! unsigned int mWidth; ! ! //! height of texture ! unsigned int mHeight; }; |
From: Oliver O. <fr...@us...> - 2007-03-15 07:27:03
|
Update of /cvsroot/simspark/simspark/spark/plugin/openglsyssdl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/plugin/openglsyssdl Modified Files: Makefile.am openglsystemsdl.cpp Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/openglsyssdl/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 13 Dec 2005 21:48:48 -0000 1.1 --- Makefile.am 15 Mar 2007 07:26:28 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- export.cpp \ openglsystemsdl.cpp \ + openglsystemsdl.h \ openglsystemsdl_c.cpp Index: openglsystemsdl.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/openglsyssdl/openglsystemsdl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** openglsystemsdl.cpp 13 Dec 2005 21:48:48 -0000 1.1 --- openglsystemsdl.cpp 15 Mar 2007 07:26:28 -0000 1.2 *************** *** 24,28 **** #include <zeitgeist/logserver/logserver.h> #include <zeitgeist/scriptserver/scriptserver.h> ! #include <GL/gl.h> #include <SDL/SDL.h> --- 24,28 ---- #include <zeitgeist/logserver/logserver.h> #include <zeitgeist/scriptserver/scriptserver.h> ! #include <kerosin/openglserver/openglwrapper.h> #include <SDL/SDL.h> |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:58
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/simulations/parts/rsg/boxspheres Modified Files: box.rsg ccylinder.rsg sphere.rsg Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: box.rsg =================================================================== RCS file: /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres/box.rsg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** box.rsg 24 Feb 2006 12:04:14 -0000 1.1 --- box.rsg 15 Mar 2007 07:26:25 -0000 1.2 *************** *** 27,34 **** (setContactSoftERPMode true) ! (setContactSoftERP 0.5) (setContactSoftCFM true) ! (setContactSoftCFM 0.3) ) --- 27,34 ---- (setContactSoftERPMode true) ! (setContactSoftERP 0.2) (setContactSoftCFM true) ! (setContactSoftCFM 0.01) ) Index: sphere.rsg =================================================================== RCS file: /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres/sphere.rsg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sphere.rsg 24 Feb 2006 12:04:14 -0000 1.1 --- sphere.rsg 15 Mar 2007 07:26:25 -0000 1.2 *************** *** 14,20 **** (setSphere $density $radius) (node DragController ! (setAngularDrag 0.01) (setLinearDrag 0.01) ! ) ) --- 14,20 ---- (setSphere $density $radius) (node DragController ! (setAngularDrag 0.01) (setLinearDrag 0.01) ! ) ) *************** *** 29,36 **** (setContactSoftERPMode true) ! (setContactSoftERP 0.5) (setContactSoftCFM true) ! (setContactSoftCFM 0.3) ) ) --- 29,36 ---- (setContactSoftERPMode true) ! (setContactSoftERP 0.2) (setContactSoftCFM true) ! (setContactSoftCFM 0.01) ) ) Index: ccylinder.rsg =================================================================== RCS file: /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres/ccylinder.rsg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ccylinder.rsg 24 Feb 2006 12:04:14 -0000 1.1 --- ccylinder.rsg 15 Mar 2007 07:26:25 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- (node Body + (setName ccylinderBody) (setCappedCylinder $density $radius $length) ) |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:58
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/agent In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/simulations/parts/rsg/agent Modified Files: ball.rsg soccer.rsg Added Files: hoap2.rsg soccerbot.rsg Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) --- NEW FILE: hoap2.rsg --- ; -*- mode: lisp; -*- ; ; approximation of the Fujitsu Hoap-2 robot ; (RubySceneGraph 0 1) ( ; ; define constants for the robot parts ; ; feet (define $FootLength 0.6) (define $FootWidth 0.956) (define $FootHeight 0.095) (define $FootMass 0.1) ; static box at the ankles (define $AnkleBoxLength 0.355) (define $AnkleBoxWidth 0.143) (define $AnkleBoxHeight 0.476) ; shanks (define $ShankLength 0.56) (define $ShankWidth 0.56) (define $ShankHeight 0.964) (define $ShankMass 0.25) ; thighs (define $ThighLength 0.56) (define $ThighWidth 0.56) (define $ThighHeight 1.3) (define $ThighMass 0.25) ; hips (define $HipLength 0.273) (define $HipWidth 0.273) (define $HipHeight 0.2) (define $HipMass 0.1) ; hand1 (define $HandBox1Length 0.082) (define $HandBox1Width 0.272) (define $HandBox1Height 0.57) ; hand2 (define $HandBox2Length 0.242) (define $HandBox2Width 0.272) (define $HandBox2Height 0.164) ; hand3 (define $HandBox3Length 0.074) (define $HandBox3Width 0.272) (define $HandBox3Height 0.2) ; lower arms (define $LowerarmLength 0.445) (define $LowerarmWidth 0.316) (define $LowerarmHeight 0.6) (define $LowerarmMass 0.2) ; elbows (define $ElbowDirection 1) (define $ElbowRadius 0.134) (define $ElbowLength 0.3) ; upper arms (define $UpperarmLength 0.445) (define $UpperarmWidth 0.398) (define $UpperarmHeight 0.506) (define $UpperarmMass 0.2) ; shoulders (define $ShoulderLength 0.445) (define $ShoulderWidth 1.017) (define $ShoulderHeight 0.536) (define $ShoulderMass 0.5) ; head (define $HeadRadius 0.39) (define $HeadMass 0.3) ; neck (define $NeckLength 0.2) (define $NeckWidth 0.2) (define $NeckHeight 0.4) (define $NeckMass 0.1) ; torso1 (define $TorsoBox1Length 1.37) (define $TorsoBox1Width 0.96) (define $TorsoBox1Height 1.41) (define $TorsoBox1Mass 1.8) ; torso2 (define $TorsoBox2Length 1.37) (define $TorsoBox2Width 0.54) (define $TorsoBox2Height 1.81) (define $TorsoBox2Mass 1.8) (define $TorsoCylinderDirection 1) ; oriented along x-axis (define $TorsoCylinderRadius 0.1) (define $TorsoCylinderLength 0.3) ; ; assemble the robot ; ; torso position (absolute) (define $TorsoPosX 0) (define $TorsoPosY 0) (define $TorsoPosZ 3.5) ; calculate offset of the battery pack (define $offsetTorsoBox2X 0.0) (define $offsetTorsoBox2Y (eval -1 * (eval (eval $TorsoBox1Width / 2.0) + (eval $TorsoBox2Width / 2.0)))) (define $offsetTorsoBox2Z (eval -1 * (eval (eval $TorsoBox1Height / 2.0) - (eval $TorsoBox2Height / 2.0)))) ; calculate offset for the left shoulder cylinder (define $offsetLeftShoulderCylX (eval -1 * (eval $TorsoBox1Length / 2.0))) (define $offsetLeftShoulderCylY 0.0) (define $offsetLeftShoulderCylZ (eval (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0))) ; calculate offset for the right shoulder cylinder (define $offsetRightShoulderCylX (eval $TorsoBox1Length / 2.0)) (define $offsetRightShoulderCylY 0.0) (define $offsetRightShoulderCylZ (eval (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0))) ; create the torso (node AgentAspect (setName body) (setLocalPos $TorsoPosX $TorsoPosY $TorsoPosZ) (importScene rsg/boxspheres/box.rsg $TorsoBox1Length $TorsoBox1Width $TorsoBox1Height $TorsoBox1Mass matGrey) ; install a node holding agent state data (node AgentState (setName AgentState) ) ; static cylinders for the shoulders (node Transform (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) ) ) (node Transform (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) ) ) ) ;;; DEBUG ;(node FixedJoint ; (attach ../body/boxBody 0) ; attach to the static environment ; (setFixed) ;) ; add battery backpack (node Transform (setName battery) (setLocalPos (eval $TorsoPosX + $offsetTorsoBox2X) (eval $TorsoPosY + $offsetTorsoBox2Y + 0.01) (eval $TorsoPosZ + $offsetTorsoBox2Z)) (importScene rsg/boxspheres/box.rsg $TorsoBox2Length $TorsoBox2Width $TorsoBox2Height $TorsoBox2Mass matGrey) ; +++ ; THIS IS A HACK SINCE WE DON'T HAVE COMPOUND OBJECTS YET ! ; +++ ; install hinge joint to connect to the torso (node HingeJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0.0 0.0 0.0) (setAxis 2) ; move around z-axis (setLowStopDeg 0 0.01) (setHighStopDeg 0 0.01) ) ) ;;; ------------------------------------- ;;; HEAD ;;; ------------------------------------- ; attach neck (node Transform (setName neck) (setLocalPos $TorsoPosX (eval $TorsoPosY - 0.1) (eval $TorsoPosZ + (eval $TorsoBox1Height / 2.0) + (eval $NeckHeight / 2.0))) (importScene rsg/boxspheres/box.rsg $NeckLength $NeckWidth $NeckHeight $NeckMass matGrey) ; install hinge joint to connect to the torso (node HingeJoint (attach ../boxBody ../../body/boxBody) (setAnchor $TorsoPosX (eval $TorsoPosY - 0.1) (eval $TorsoPosZ + (eval $TorsoBox1Height / 2.0))) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName head_joint_2) ) ; install an effector to control the joint motors (node HingeEffector (setName head_eff_2) ) ) ) ; attach head (node Transform (setName head) (setLocalPos $TorsoPosX (eval $TorsoPosY + 0.05) (eval $TorsoPosZ + (eval $TorsoBox1Height / 2.0) + (eval $NeckHeight / 2.0) + (eval $HeadRadius / 2.0))) (importScene rsg/boxspheres/sphere.rsg $HeadRadius $HeadMass matLightBlue) ; install hinge joint to connect to the neck (node HingeJoint (attach ../sphereBody ../../neck/boxBody) (setAnchor $TorsoPosX (eval $TorsoPosY - 0.1) (eval $TorsoPosZ + (eval $TorsoBox1Height / 2.0) + $NeckHeight)) (setAxis 0) ; move around the x-axis ; enable the joint motor (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName head_joint_1) ) ; install an effector to control the joint motor (node HingeEffector (setName head_eff_1) ) ) ) ;;; ------------------------------------- ;;; ARMS ;;; ------------------------------------- (define $LeftShoulderPosX (eval $TorsoPosX - (eval $TorsoBox1Length / 2.0) - (eval $ShoulderLength / 2.0) - (eval $TorsoCylinderLength / 2.0) ) ) (define $LeftShoulderPosY $TorsoPosY) (define $LeftShoulderPosZ (eval $TorsoPosZ + (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0) ) ) (define $RightShoulderPosX (eval $TorsoPosX + (eval $TorsoBox1Length / 2.0) + (eval $ShoulderLength / 2.0) + (eval $TorsoCylinderLength / 2.0) ) ) (define $RightShoulderPosY $TorsoPosY) (define $RightShoulderPosZ $LeftShoulderPosZ) ; left shoulder (node Transform (setName leftshoulder) (setLocalPos $LeftShoulderPosX $LeftShoulderPosY $LeftShoulderPosZ) (importScene rsg/boxspheres/box.rsg $ShoulderLength $ShoulderWidth $ShoulderHeight $ShoulderMass matGrey) ; install universal joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0.0 0.0 0.0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName larm_joint_1_2) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName larm_eff_1_2) ) ) ) ; right shoulder (node Transform (setName rightshoulder) (setLocalPos $RightShoulderPosX $RightShoulderPosY $RightShoulderPosZ) (importScene rsg/boxspheres/box.rsg $ShoulderLength $ShoulderWidth $ShoulderHeight $ShoulderMass matGrey) (setLocalRotation 0 0 180) ; install universal joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0.0 0.0 0.0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName rarm_joint_1_2) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rarm_eff_1_2) ) ) ) (define $LeftUpperArmPosX $LeftShoulderPosX) (define $LeftUpperArmPosY (eval $LeftShoulderPosY + (eval $UpperarmWidth / 2.0))) (define $LeftUpperArmPosZ (eval $LeftShoulderPosZ - (eval $ShoulderHeight / 2.0) - (eval $UpperarmHeight / 2.0))) (define $RightUpperArmPosX $RightShoulderPosX) (define $RightUpperArmPosY (eval $RightShoulderPosY + (eval $UpperarmWidth / 2.0))) (define $RightUpperArmPosZ (eval $RightShoulderPosZ - (eval $ShoulderHeight / 2.0) - (eval $UpperarmHeight / 2.0))) ; left upper arm (node Transform (setName leftupperarm) (setLocalPos $LeftUpperArmPosX $LeftUpperArmPosY $LeftUpperArmPosZ) (importScene rsg/boxspheres/box.rsg $UpperarmLength $UpperarmWidth $UpperarmHeight $UpperarmMass matGrey) ; install hinge joint to connect to the shoulder (node HingeJoint (attach ../boxBody ../../leftshoulder/boxBody) (setAnchor 0.0 0.0 (eval $UpperarmHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName larm_joint_3) ) ; install an effector to control the joint motors (node HingeEffector (setName larm_eff_3) ) ) ; static cylinder for the elbow (node Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) ) ) ; right upper arm (node Transform (setName rightupperarm) (setLocalPos $RightUpperArmPosX $RightUpperArmPosY $RightUpperArmPosZ) (importScene rsg/boxspheres/box.rsg $UpperarmLength $UpperarmWidth $UpperarmHeight $UpperarmMass matGrey) ; install hinge joint to connect to the shoulder (node HingeJoint (attach ../boxBody ../../rightshoulder/boxBody) (setAnchor 0 0 (eval $UpperarmHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName rarm_joint_3) ) ; install an effector to control the joint motors (node HingeEffector (setName rarm_eff_3) ) ) ; static cylinder for the elbow (node Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) ) ) (define $LeftLowerArmPosX $LeftUpperArmPosX) (define $LeftLowerArmPosY $LeftUpperArmPosY) (define $LeftLowerArmPosZ (eval $LeftUpperArmPosZ - (eval $UpperarmHeight / 2.0) - $ElbowRadius - (eval $LowerarmHeight / 2.0) ) ) (define $RightLowerArmPosX $RightUpperArmPosX) (define $RightLowerArmPosY $RightUpperArmPosY) (define $RightLowerArmPosZ (eval $RightUpperArmPosZ - (eval $UpperarmHeight / 2.0) - $ElbowRadius - (eval $LowerarmHeight / 2.0) ) ) ; left lower arm (node Transform (setName leftlowerarm) (setLocalPos $LeftLowerArmPosX $LeftLowerArmPosY $LeftLowerArmPosZ) (importScene rsg/boxspheres/box.rsg $LowerarmLength $LowerarmWidth $LowerarmHeight $LowerarmMass matGrey) ; install hinge joint to connect to the upper arm (node HingeJoint (attach ../boxBody ../../leftupperarm/boxBody) (setAnchor 0 0 (eval $LowerarmHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName larm_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName larm_eff_4) ) ) ; static hand (node Transform (setLocalPos (eval -1 * (eval (eval $LowerarmLength / 2.0) - (eval $HandBox1Length / 2.0) - 0.06)) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox1Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox1Length $HandBox1Width $HandBox1Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox2Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox2Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox2Length $HandBox2Width $HandBox2Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox3Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + $HandBox2Height + (eval $HandBox3Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox3Length $HandBox3Width $HandBox3Width) ) ) ) ; right lower arm (node Transform (setName rightlowerarm) (setLocalPos $RightLowerArmPosX $RightLowerArmPosY $RightLowerArmPosZ) ;(setLocalRotation 0 0 180) (importScene rsg/boxspheres/box.rsg $LowerarmLength $LowerarmWidth $LowerarmHeight $LowerarmMass matGrey) ; install hinge joint to connect to the upper arm (node HingeJoint (attach ../boxBody ../../rightupperarm/boxBody) (setAnchor 0 0 (eval $LowerarmHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName rarm_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName rarm_eff_4) ) ) ; static hand (node Transform (setLocalRotation 0 0 180) (node Transform (setLocalPos (eval -1 * (eval (eval $LowerarmLength / 2.0) - (eval $HandBox1Length / 2.0) - 0.06)) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox1Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox1Length $HandBox1Width $HandBox1Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox2Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox2Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox2Length $HandBox2Width $HandBox2Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox3Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + $HandBox2Height + (eval $HandBox3Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox3Length $HandBox3Width $HandBox3Width) ) ) ) ) ;;; ------------------------------------- ;;; LEGS ;;; ------------------------------------- (define $LeftHipPosX (eval $TorsoPosX - (eval $TorsoBox1Length / 4.0) - 0.06)) (define $LeftHipPosY $TorsoPosY) (define $LeftHipPosZ (eval $TorsoPosZ - (eval $TorsoBox1Height / 2.0) - (eval $HipHeight / 2.0))) (define $RightHipPosX (eval $TorsoPosX + (eval $TorsoBox1Length / 4.0) + 0.06)) (define $RightHipPosY $TorsoPosY) (define $RightHipPosZ (eval $TorsoPosZ - (eval $TorsoBox1Height / 2.0) - (eval $HipHeight / 2.0))) ; left hip (node Transform (setName lefthip) (setLocalPos $LeftHipPosX $LeftHipPosY $LeftHipPosZ) (importScene rsg/boxspheres/box.rsg $HipLength $HipWidth $HipHeight $HipMass matGrey) ; install hinge joint to connect to the torso (node HingeJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0 0 (eval $HipHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName lleg_joint_1) ) ; install an effector to control the joint motors (node HingeEffector (setName lleg_eff_1) ) ) ) ; right hip (node Transform (setName righthip) (setLocalPos $RightHipPosX $RightHipPosY $RightHipPosZ) (importScene rsg/boxspheres/box.rsg $HipLength $HipWidth $HipHeight $HipMass matGrey) ; install hinge joint to connect to the torso (node HingeJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0 0 (eval $HipHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName rleg_joint_1) ) ; install an effector to control the joint motors (node HingeEffector (setName rleg_eff_1) ) ) ) (define $LeftThighPosX $LeftHipPosX) (define $LeftThighPosY $LeftHipPosY) (define $LeftThighPosZ (eval $LeftHipPosZ - (eval $HipHeight / 2.0) - (eval $ThighHeight / 2.0))) (define $RightThighPosX $RightHipPosX) (define $RightThighPosY $RightHipPosY) (define $RightThighPosZ (eval $RightHipPosZ - (eval $HipHeight / 2.0) - (eval $ThighHeight / 2.0))) ; left thigh (node Transform (setName leftthigh) (setLocalPos $LeftThighPosX $LeftThighPosY $LeftThighPosZ) (importScene rsg/boxspheres/box.rsg $ThighLength $ThighWidth $ThighHeight $ThighMass matGrey) ; install hinge joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../lefthip/boxBody) (setAnchor 0.0 0.0 (eval $ThighHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName lleg_joint_2_3) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName lleg_eff_2_3) ) ) ) ; right thigh (node Transform (setName rightthigh) (setLocalPos $RightThighPosX $RightThighPosY $RightThighPosZ) (importScene rsg/boxspheres/box.rsg $ThighLength $ThighWidth $ThighHeight $ThighMass matGrey) ; install hinge joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../righthip/boxBody) (setAnchor 0.0 0.0 (eval $ThighHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName rleg_joint_2_3) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rleg_eff_2_3) ) ) ) (define $LeftShankPosX $LeftThighPosX) (define $LeftShankPosY $LeftThighPosY) (define $LeftShankPosZ (eval $LeftThighPosZ - (eval $ThighHeight / 2.0) - (eval $ShankHeight / 2.0) - 0.05)) (define $RightShankPosX $RightThighPosX) (define $RightShankPosY $RightThighPosY) (define $RightShankPosZ (eval $RightThighPosZ - (eval $ThighHeight / 2.0) - (eval $ShankHeight / 2.0) - 0.05)) ; left shank (node Transform (setName leftshank) (setLocalPos $LeftShankPosX $LeftShankPosY $LeftShankPosZ) (importScene rsg/boxspheres/box.rsg $ShankLength $ShankWidth $ShankHeight $ShankMass matGrey) ; install hinge joint to connect to the thigh (node HingeJoint (attach ../boxBody ../../leftthigh/boxBody) (setAnchor 0.0 0.0 (eval $ShankHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName lleg_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName lleg_eff_4) ) ) ) ; right shank (node Transform (setName rightshank) (setLocalPos $RightShankPosX $RightShankPosY $RightShankPosZ) (importScene rsg/boxspheres/box.rsg $ShankLength $ShankWidth $ShankHeight $ShankMass matGrey) ; install hinge joint to connect to the thigh (node HingeJoint (attach ../boxBody ../../rightthigh/boxBody) (setAnchor 0.0 0.0 (eval $ShankHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName rleg_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName rleg_eff_4) ) ) ) ; left foot (node Transform (setName leftfoot) (setLocalPos $LeftShankPosX $LeftShankPosY (eval $LeftShankPosZ - (eval $ShankHeight / 2.0) - (eval $FootHeight / 2.0) - 0.05) ) (importScene rsg/boxspheres/box.rsg $FootLength $FootWidth $FootHeight $FootMass matGrey) ; install hinge joint to connect to the shank (node UniversalJoint (attach ../boxBody ../../leftshank/boxBody) (setAnchor 0.0 0.0 (eval $FootHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName lleg_joint_5_6) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName lleg_eff_5_6) ) ) ; static box at the back of the foot (node Transform (setLocalPos 0.0 (eval -1 * (eval (eval $FootWidth / 2.0) - (eval $AnkleBoxWidth / 2.0))) (eval (eval $FootHeight / 2.0) + (eval $AnkleBoxHeight / 2.0)) ) (node Box (setMaterial matGrey) (setExtents $AnkleBoxLength $AnkleBoxWidth $AnkleBoxHeight) ) ) ) ; right foot (node Transform (setName rightfoot) (setLocalPos $RightShankPosX $RightShankPosY (eval $RightShankPosZ - (eval $ShankHeight / 2.0) - (eval $FootHeight / 2.0) - 0.05) ) (importScene rsg/boxspheres/box.rsg $FootLength $FootWidth $FootHeight $FootMass matGrey) ; install hinge joint to connect to the shank (node UniversalJoint (attach ../boxBody ../../rightshank/boxBody) (setAnchor 0.0 0.0 (eval $FootHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName rleg_joint_5_6) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rleg_eff_5_6) ) ) ; static box at the back of the foot (node Transform (setLocalPos 0.0 (eval -1 * (eval (eval $FootWidth / 2.0) - (eval $AnkleBoxWidth / 2.0))) (eval (eval $FootHeight / 2.0) + (eval $AnkleBoxHeight / 2.0)) ) (node Box (setMaterial matGrey) (setExtents $AnkleBoxLength $AnkleBoxWidth $AnkleBoxHeight) ) ) ) ) ; EOF Index: ball.rsg =================================================================== RCS file: /cvsroot/simspark/simspark/simulations/parts/rsg/agent/ball.rsg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ball.rsg 24 Feb 2006 10:40:41 -0000 1.1 --- ball.rsg 15 Mar 2007 07:26:25 -0000 1.2 *************** *** 8,12 **** (node Ball ! (setLocalPos 0 0 0.5) (setName Ball) --- 8,12 ---- (node Ball ! (setLocalPos 5.0 0.0 0.5) (setName Ball) *************** *** 29,32 **** --- 29,36 ---- (setRadius $Radius) + (node RecorderHandler + (setName recorder) + ) + (node ContactJointHandler (setContactBounceMode false) *************** *** 44,48 **** (node ObjectState ! (setPerceptName Ball) ) ) --- 48,52 ---- (node ObjectState ! (setPerceptName B) ) ) Index: soccer.rsg =================================================================== RCS file: /cvsroot/simspark/simspark/simulations/parts/rsg/agent/soccer.rsg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** soccer.rsg 24 Feb 2006 10:40:41 -0000 1.1 --- soccer.rsg 15 Mar 2007 07:26:25 -0000 1.2 *************** *** 89,96 **** (node ContactJointHandler (setContactBounceMode false) ) ) ) ! ; create the left goal (node Transform --- 89,115 ---- (node ContactJointHandler (setContactBounceMode false) + + (setContactSlipMode true) + (setContactSlip 0.1 0.1) + + (setContactSoftERPMode true) + (setContactSoftERP 0.2) + + (setContactSoftCFM true) + (setContactSoftCFM 0.01) ) ) ) ! ! ; create box collider around playing field ! (node BoxCollider ! (setName FieldBox) ! (setPosition 0 0 20) ! (setBoxLengths $FieldLength $FieldWidth 40) ! (node RecorderHandler ! (setName recorder) ! ) ! ) ! ; create the left goal (node Transform *************** *** 362,366 **** $FieldHalfWidth 0 ! Flag_1_l matRed ) --- 381,385 ---- $FieldHalfWidth 0 ! F1L matRed ) *************** *** 369,373 **** (eval -1 * $FieldHalfWidth) 0 ! Flag_2_l matRed ) --- 388,392 ---- (eval -1 * $FieldHalfWidth) 0 ! F2L matRed ) *************** *** 376,380 **** $FieldHalfWidth 0 ! Flag_1_r matBlue ) --- 395,399 ---- $FieldHalfWidth 0 ! F1R matBlue ) *************** *** 383,387 **** (eval -1 * $FieldHalfWidth) 0 ! Flag_2_r matBlue ) --- 402,406 ---- (eval -1 * $FieldHalfWidth) 0 ! F2R matBlue ) *************** *** 392,396 **** (eval -1 * $GoalHalfWidth) 0 ! Goal_1_l matRed ) --- 411,415 ---- (eval -1 * $GoalHalfWidth) 0 ! G1L matRed ) *************** *** 399,403 **** $GoalHalfWidth 0 ! Goal_2_l matRed ) --- 418,422 ---- $GoalHalfWidth 0 ! G2L matRed ) *************** *** 407,411 **** (eval -1 * $GoalHalfWidth) 0 ! Goal_1_r matBlue ) --- 426,430 ---- (eval -1 * $GoalHalfWidth) 0 ! G1R matBlue ) *************** *** 414,418 **** $GoalHalfWidth 0 ! Goal_2_r matBlue ) --- 433,437 ---- $GoalHalfWidth 0 ! G2R matBlue ) --- NEW FILE: soccerbot.rsg --- ; -*- mode: lisp; -*- ; ; possible base for the Atlanta 2007 robot ; (RubySceneGraph 0 1) ( ; ; define constants for the robot parts ; ; feet (define $FootLength 0.6) (define $FootWidth 0.956) (define $FootHeight 0.095) (define $FootMass 0.1) ; static box at the ankles (define $AnkleBoxLength 0.355) (define $AnkleBoxWidth 0.143) (define $AnkleBoxHeight 0.476) ; shanks (define $ShankLength 0.56) (define $ShankWidth 0.56) (define $ShankHeight 0.964) (define $ShankMass 0.25) ; thighs (define $ThighLength 0.56) (define $ThighWidth 0.56) (define $ThighHeight 1.3) (define $ThighMass 0.25) ; hips (define $HipLength 0.273) (define $HipWidth 0.273) (define $HipHeight 0.2) (define $HipMass 0.1) ; hand1 (define $HandBox1Length 0.082) (define $HandBox1Width 0.272) (define $HandBox1Height 0.57) ; hand2 (define $HandBox2Length 0.242) (define $HandBox2Width 0.272) (define $HandBox2Height 0.164) ; hand3 (define $HandBox3Length 0.074) (define $HandBox3Width 0.272) (define $HandBox3Height 0.2) ; lower arms (define $LowerarmLength 0.445) (define $LowerarmWidth 0.316) (define $LowerarmHeight 0.6) (define $LowerarmMass 0.2) ; elbows (define $ElbowDirection 1) (define $ElbowRadius 0.134) (define $ElbowLength 0.3) ; upper arms (define $UpperarmLength 0.445) (define $UpperarmWidth 0.398) (define $UpperarmHeight 0.506) (define $UpperarmMass 0.2) ; shoulders (define $ShoulderLength 0.445) (define $ShoulderWidth 1.017) (define $ShoulderHeight 0.536) (define $ShoulderMass 0.5) ; head (define $HeadRadius 0.39) (define $HeadMass 0.00000001) ; neck (define $NeckLength 0.2) (define $NeckWidth 0.2) (define $NeckHeight 0.4) (define $NeckMass 0.1) ; torso1 (define $TorsoBox1Length 1.37) (define $TorsoBox1Width 0.96) (define $TorsoBox1Height 1.41) (define $TorsoBox1Mass 1.8) ; torso2 (define $TorsoBox2Length 1.37) (define $TorsoBox2Width 0.54) (define $TorsoBox2Height 1.81) (define $TorsoBox2Mass 1.8) (define $TorsoCylinderDirection 1) ; oriented along x-axis (define $TorsoCylinderRadius 0.1) (define $TorsoCylinderLength 0.3) ; ; assemble the robot ; ; torso position (absolute) (define $TorsoPosX 5) (define $TorsoPosY 5) (define $TorsoPosZ 3.5) ; calculate offset of the battery pack (define $offsetTorsoBox2X 0.0) (define $offsetTorsoBox2Y (eval -1 * (eval (eval $TorsoBox1Width / 2.0) + (eval $TorsoBox2Width / 2.0)))) (define $offsetTorsoBox2Z (eval -1 * (eval (eval $TorsoBox1Height / 2.0) - (eval $TorsoBox2Height / 2.0)))) ; calculate offset for the left shoulder cylinder (define $offsetLeftShoulderCylX (eval -1 * (eval $TorsoBox1Length / 2.0))) (define $offsetLeftShoulderCylY 0.0) (define $offsetLeftShoulderCylZ (eval (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0))) ; calculate offset for the right shoulder cylinder (define $offsetRightShoulderCylX (eval $TorsoBox1Length / 2.0)) (define $offsetRightShoulderCylY 0.0) (define $offsetRightShoulderCylZ (eval (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0))) ; create the torso (node AgentAspect (setName body) (setLocalPos $TorsoPosX $TorsoPosY $TorsoPosZ) (importScene rsg/boxspheres/box.rsg $TorsoBox1Length $TorsoBox1Width $TorsoBox1Height $TorsoBox1Mass matGrey) ; install a node holding agent state data (node AgentState (setName AgentState) ) ;add a time perceptor (node TimePerceptor) (node VisionPerceptor (setSenseMyPos false) (setStaticSenseAxis false) (addNoise false) ) ; static cylinders for the shoulders (node Transform (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) ) ) (node Transform (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) ) ) ) ;;; ------------------------------------- ;;; HEAD ;;; ------------------------------------- ; attach head (node Transform (setName head) (setLocalPos (eval $TorsoPosX) (eval $TorsoPosY + 0.05) (eval $TorsoPosZ + 0.1 + (eval $TorsoBox1Height / 2.0) + (eval $HeadRadius / 2.0))) (importScene rsg/boxspheres/sphere.rsg $HeadRadius $HeadMass matLightBlue) ; install hinge joint to connect to the neck (node FixedJoint (attach ../sphereBody ../../body/boxBody) (setFixed) ) ) ;;; ------------------------------------- ;;; ARMS ;;; ------------------------------------- (define $LeftShoulderPosX (eval $TorsoPosX - (eval $TorsoBox1Length / 2.0) - (eval $ShoulderLength / 2.0) - (eval $TorsoCylinderLength / 2.0) ) ) (define $LeftShoulderPosY $TorsoPosY) (define $LeftShoulderPosZ (eval $TorsoPosZ + (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0) ) ) (define $RightShoulderPosX (eval $TorsoPosX + (eval $TorsoBox1Length / 2.0) + (eval $ShoulderLength / 2.0) + (eval $TorsoCylinderLength / 2.0) ) ) (define $RightShoulderPosY $TorsoPosY) (define $RightShoulderPosZ $LeftShoulderPosZ) ; left shoulder (node Transform (setName leftshoulder) (setLocalPos $LeftShoulderPosX $LeftShoulderPosY $LeftShoulderPosZ) (importScene rsg/boxspheres/box.rsg $ShoulderLength $ShoulderWidth $ShoulderHeight $ShoulderMass matRed) ; install universal joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0.0 0.0 0.0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName larm_joint_1_2) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName larm_eff_1_2) ) ) ) ; right shoulder (node Transform (setName rightshoulder) (setLocalPos $RightShoulderPosX $RightShoulderPosY $RightShoulderPosZ) (importScene rsg/boxspheres/box.rsg $ShoulderLength $ShoulderWidth $ShoulderHeight $ShoulderMass matRed) (setLocalRotation 0 0 180) ; install universal joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0.0 0.0 0.0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName rarm_joint_1_2) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rarm_eff_1_2) ) ) ) (define $LeftUpperArmPosX $LeftShoulderPosX) ;(define $LeftUpperArmPosY (eval $LeftShoulderPosY + (eval $UpperarmWidth / 2.0))) (define $LeftUpperArmPosY (eval $LeftShoulderPosY)) (define $LeftUpperArmPosZ (eval $LeftShoulderPosZ - (eval $ShoulderHeight / 2.0) - (eval $UpperarmHeight / 2.0))) (define $RightUpperArmPosX $RightShoulderPosX) ;(define $RightUpperArmPosY (eval $RightShoulderPosY + (eval $UpperarmWidth / 2.0))) (define $RightUpperArmPosY (eval $RightShoulderPosY)) (define $RightUpperArmPosZ (eval $RightShoulderPosZ - (eval $ShoulderHeight / 2.0) - (eval $UpperarmHeight / 2.0))) ; left upper arm (node Transform (setName leftupperarm) (setLocalPos $LeftUpperArmPosX $LeftUpperArmPosY $LeftUpperArmPosZ) (importScene rsg/boxspheres/box.rsg $UpperarmLength $UpperarmWidth $UpperarmHeight $UpperarmMass matLightBlue) ; install hinge joint to connect to the shoulder (node HingeJoint (attach ../boxBody ../../leftshoulder/boxBody) (setAnchor 0.0 0.0 (eval $UpperarmHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName larm_joint_3) ) ; install an effector to control the joint motors (node HingeEffector (setName larm_eff_3) ) ) ; static cylinder for the elbow (node Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) ) ) ; right upper arm (node Transform (setName rightupperarm) (setLocalPos $RightUpperArmPosX $RightUpperArmPosY $RightUpperArmPosZ) (importScene rsg/boxspheres/box.rsg $UpperarmLength $UpperarmWidth $UpperarmHeight $UpperarmMass matLightBlue) ;(setLocalRotation 180 0 0) ; install hinge joint to connect to the shoulder (node HingeJoint (attach ../boxBody ../../rightshoulder/boxBody) (setAnchor 0 0 (eval $UpperarmHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName rarm_joint_3) ) ; install an effector to control the joint motors (node HingeEffector (setName rarm_eff_3) ) ) ; static cylinder for the elbow (node Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) ) ) (define $LeftLowerArmPosX $LeftUpperArmPosX) (define $LeftLowerArmPosY $LeftUpperArmPosY) (define $LeftLowerArmPosZ (eval $LeftUpperArmPosZ - (eval $UpperarmHeight / 2.0) - $ElbowRadius - (eval $LowerarmHeight / 2.0) ) ) (define $RightLowerArmPosX $RightUpperArmPosX) (define $RightLowerArmPosY $RightUpperArmPosY) (define $RightLowerArmPosZ (eval $RightUpperArmPosZ - (eval $UpperarmHeight / 2.0) - $ElbowRadius - (eval $LowerarmHeight / 2.0) ) ) ; left lower arm (node Transform (setName leftlowerarm) (setLocalPos $LeftLowerArmPosX $LeftLowerArmPosY $LeftLowerArmPosZ) (importScene rsg/boxspheres/box.rsg $LowerarmLength $LowerarmWidth $LowerarmHeight $LowerarmMass matGrey) ; install hinge joint to connect to the upper arm (node HingeJoint (attach ../boxBody ../../leftupperarm/boxBody) (setAnchor 0 0 (eval $LowerarmHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName larm_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName larm_eff_4) ) ) ; static hand (node Transform (setLocalPos (eval -1 * (eval (eval $LowerarmLength / 2.0) - (eval $HandBox1Length / 2.0) - 0.06)) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox1Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox1Length $HandBox1Width $HandBox1Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox2Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox2Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox2Length $HandBox2Width $HandBox2Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox3Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + $HandBox2Height + (eval $HandBox3Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox3Length $HandBox3Width $HandBox3Width) ) ) ) ; right lower arm (node Transform (setName rightlowerarm) (setLocalPos $RightLowerArmPosX $RightLowerArmPosY $RightLowerArmPosZ) ;(setLocalRotation 0 0 180) (importScene rsg/boxspheres/box.rsg $LowerarmLength $LowerarmWidth $LowerarmHeight $LowerarmMass matGrey) ; install hinge joint to connect to the upper arm (node HingeJoint (attach ../boxBody ../../rightupperarm/boxBody) (setAnchor 0 0 (eval $LowerarmHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName rarm_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName rarm_eff_4) ) ) ; static hand (node Transform (setLocalRotation 0 0 180) (node Transform (setLocalPos (eval -1 * (eval (eval $LowerarmLength / 2.0) - (eval $HandBox1Length / 2.0) - 0.06)) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox1Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox1Length $HandBox1Width $HandBox1Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox2Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox2Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox2Length $HandBox2Width $HandBox2Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox3Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + $HandBox2Height + (eval $HandBox3Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox3Length $HandBox3Width $HandBox3Width) ) ) ) ) ;;; ------------------------------------- ;;; LEGS ;;; ------------------------------------- (define $LeftHipPosX (eval $TorsoPosX - (eval $TorsoBox1Length / 4.0) - 0.06)) (define $LeftHipPosY $TorsoPosY) (define $LeftHipPosZ (eval $TorsoPosZ - (eval $TorsoBox1Height / 2.0) - (eval $HipHeight / 2.0))) (define $RightHipPosX (eval $TorsoPosX + (eval $TorsoBox1Length / 4.0) + 0.06)) (define $RightHipPosY $TorsoPosY) (define $RightHipPosZ (eval $TorsoPosZ - (eval $TorsoBox1Height / 2.0) - (eval $HipHeight / 2.0))) ; left hip (node Transform (setName lefthip) (setLocalPos $LeftHipPosX $LeftHipPosY $LeftHipPosZ) (importScene rsg/boxspheres/box.rsg $HipLength $HipWidth $HipHeight $HipMass matGrey) ; install hinge joint to connect to the torso (node HingeJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0 0 (eval $HipHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName lleg_joint_1) ) ; install an effector to control the joint motors (node HingeEffector (setName lleg_eff_1) ) ) ) ; right hip (node Transform (setName righthip) (setLocalPos $RightHipPosX $RightHipPosY $RightHipPosZ) (importScene rsg/boxspheres/box.rsg $HipLength $HipWidth $HipHeight $HipMass matGrey) ; install hinge joint to connect to the torso (node HingeJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0 0 (eval $HipHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName rleg_joint_1) ) ; install an effector to control the joint motors (node HingeEffector (setName rleg_eff_1) ) ) ) (define $LeftThighPosX $LeftHipPosX) (define $LeftThighPosY $LeftHipPosY) (define $LeftThighPosZ (eval $LeftHipPosZ - (eval $HipHeight / 2.0) - (eval $ThighHeight / 2.0))) (define $RightThighPosX $RightHipPosX) (define $RightThighPosY $RightHipPosY) (define $RightThighPosZ (eval $RightHipPosZ - (eval $HipHeight / 2.0) - (eval $ThighHeight / 2.0))) ; left thigh (node Transform (setName leftthigh) (setLocalPos $LeftThighPosX $LeftThighPosY $LeftThighPosZ) (importScene rsg/boxspheres/box.rsg $ThighLength $ThighWidth $ThighHeight $ThighMass matGrey) ; install hinge joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../lefthip/boxBody) (setAnchor 0.0 0.0 (eval $ThighHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName lleg_joint_2_3) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName lleg_eff_2_3) ) ) ) ; right thigh (node Transform (setName rightthigh) (setLocalPos $RightThighPosX $RightThighPosY $RightThighPosZ) (importScene rsg/boxspheres/box.rsg $ThighLength $ThighWidth $ThighHeight $ThighMass matGrey) ; install hinge joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../righthip/boxBody) (setAnchor 0.0 0.0 (eval $ThighHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName rleg_joint_2_3) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rleg_eff_2_3) ) ) ) (define $LeftShankPosX $LeftThighPosX) (define $LeftShankPosY $LeftThighPosY) (define $LeftShankPosZ (eval $LeftThighPosZ - (eval $ThighHeight / 2.0) - (eval $ShankHeight / 2.0) - 0.05)) (define $RightShankPosX $RightThighPosX) (define $RightShankPosY $RightThighPosY) (define $RightShankPosZ (eval $RightThighPosZ - (eval $ThighHeight / 2.0) - (eval $ShankHeight / 2.0) - 0.05)) ; left shank (node Transform (setName leftshank) (setLocalPos $LeftShankPosX $LeftShankPosY $LeftShankPosZ) (importScene rsg/boxspheres/box.rsg $ShankLength $ShankWidth $ShankHeight $ShankMass matGrey) ; install hinge joint to connect to the thigh (node HingeJoint (attach ../boxBody ../../leftthigh/boxBody) (setAnchor 0.0 0.0 (eval $ShankHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName lleg_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName lleg_eff_4) ) ) ) ; right shank (node Transform (setName rightshank) (setLocalPos $RightShankPosX $RightShankPosY $RightShankPosZ) (importScene rsg/boxspheres/box.rsg $ShankLength $ShankWidth $ShankHeight $ShankMass matGrey) ; install hinge joint to connect to the thigh (node HingeJoint (attach ../boxBody ../../rightthigh/boxBody) (setAnchor 0.0 0.0 (eval $ShankHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName rleg_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName rleg_eff_4) ) ) ) ; left foot (node Transform (setName leftfoot) (setLocalPos $LeftShankPosX $LeftShankPosY (eval $LeftShankPosZ - (eval $ShankHeight / 2.0) - (eval $FootHeight / 2.0) - 0.05) ) (importScene rsg/boxspheres/box.rsg $FootLength $FootWidth $FootHeight $FootMass matGrey) ; install hinge joint to connect to the shank (node UniversalJoint (attach ../boxBody ../../leftshank/boxBody) (setAnchor 0.0 0.0 (eval $FootHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName lleg_joint_5_6) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName lleg_eff_5_6) ) ) ; static box at the back of the foot (node Transform (setLocalPos 0.0 (eval -1 * (eval (eval $FootWidth / 2.0) - (eval $AnkleBoxWidth / 2.0))) (eval (eval $FootHeight / 2.0) + (eval $AnkleBoxHeight / 2.0)) ) (node Box (setMaterial matGrey) (setExtents $AnkleBoxLength $AnkleBoxWidth $AnkleBoxHeight) ) ) ) ; right foot (node Transform (setName rightfoot) (setLocalPos $RightShankPosX $RightShankPosY (eval $RightShankPosZ - (eval $ShankHeight / 2.0) - (eval $FootHeight / 2.0) - 0.05) ) (importScene rsg/boxspheres/box.rsg $FootLength $FootWidth $FootHeight $FootMass matGrey) ; install hinge joint to connect to the shank (node UniversalJoint (attach ../boxBody ../../rightshank/boxBody) (setAnchor 0.0 0.0 (eval $FootHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName rleg_joint_5_6) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rleg_eff_5_6) ) ) ; static box at the back of the foot (node Transform (setLocalPos 0.0 (eval -1 * (eval (eval $FootWidth / 2.0) - (eval $AnkleBoxWidth / 2.0))) (eval (eval $FootHeight / 2.0) + (eval $AnkleBoxHeight / 2.0)) ) (node Box (setMaterial matGrey) (setExtents $AnkleBoxLength $AnkleBoxWidth $AnkleBoxHeight) ) ) ) ) ; EOF |
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] |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:57
|
Update of /cvsroot/simspark/simspark/contrib In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/contrib Modified Files: ChangeLog acinclude.m4 Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: acinclude.m4 =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/acinclude.m4,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** acinclude.m4 14 Apr 2006 14:59:06 -0000 1.2 --- acinclude.m4 15 Mar 2007 07:26:23 -0000 1.3 *************** *** 108,112 **** AC_SUBST(KEROSIN_CPPFLAGS, [$spark_kerosin_cppflags]) ! AC_DEFINE(HAVE_KEROSIN_H, 1, [Define to 1 if using the kerosin header]) ]) # SPARK_LIB_KEROSIN --- 108,112 ---- AC_SUBST(KEROSIN_CPPFLAGS, [$spark_kerosin_cppflags]) ! AC_DEFINE(HAVE_KEROSIN_KEROSIN_H, 1, [Define to 1 if using the kerosin header]) ]) # SPARK_LIB_KEROSIN Index: ChangeLog =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChangeLog 25 Dec 2005 15:06:28 -0000 1.1 --- ChangeLog 15 Mar 2007 07:26:23 -0000 1.2 *************** *** 0 **** --- 1,22 ---- + 2007-03-15 Oliver Obst <fr...@cs...> + 2007-03-15 Oliver Obst <fr...@us...> + + * acinclude.m4: + have to define HAVE_KEROSIN_KEROSIN_H instead of HAVE_KEROSIN_H + * rsgedit/Makefile.am: - added header files + * rsgedit/mainframe.cpp: replaced cast with wT macro + + 2007-02-28 Oliver Obst <fr...@us...> + + * rsgedit/agentframe.cpp, rsgedit/agentframe.h: + - added Output(const char*) method for convenience + - fixed a couple of implicit conversions that didn't work on Mac OS / wx 2.5.3 + + * rsgedit/mainframe.cpp: + - fixed a couple of implicit conversions that didn't work on Mac OS / wx 2.5.3 + - SetSashGravity is supported from wx 2.5.4, so using this function is disabled for + earlier versions of wx + + * rsgedit/sparktree.h: + - had to include wx/wx.h for proper compilation on Mac Os / wx 2.5.3 + |
Update of /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/zeitgeist/scriptserver Modified Files: gcvalue.cpp gcvalue.h rubywrapper.cpp rubywrapper.h scriptserver.cpp scriptserver.h scriptserver_c.cpp Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: scriptserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** scriptserver.cpp 16 May 2006 10:17:32 -0000 1.2 --- scriptserver.cpp 15 Mar 2007 07:26:31 -0000 1.3 *************** *** 23,27 **** --- 23,29 ---- #include <boost/scoped_array.hpp> #include <sstream> + #include <salt/fileclasses.h> #include "scriptserver.h" + #include "rubywrapper.h" #include <zeitgeist/corecontext.h> #include <zeitgeist/core.h> *************** *** 30,33 **** --- 32,49 ---- #include <sys/stat.h> + #undef PREFIX + #undef PACKAGE_NAME + + #ifdef HAVE_CONFIG_H + /* The include search path includes config.h of ruby as well. My system shows a strange behavior + when resolving the search paths: + using - include <config.h> - *before* the rubywrapper includes the correct file (our config.h) + using - include <config.h> - *after* the rubywrapper includes the ruby - config.h + using the same line before *and* after the rubywrapper includes the correct file before the rubywrapper, + and the wrong one after.... :-( + */ + #include "../config.h" + #endif + using namespace boost; using namespace std; *************** *** 118,122 **** Class::TCmdProc cmd = ! gMyPrivateContext->GetObject()->GetClass()->GetCmdProc (STR2CSTR(functionName)); --- 134,138 ---- Class::TCmdProc cmd = ! gMyPrivateContext->GetSelection()->GetClass()->GetCmdProc (STR2CSTR(functionName)); *************** *** 125,129 **** if (cmd != 0) { ! out = cmd(static_cast<Object*>(gMyPrivateContext->GetObject().get()), in); } else { --- 141,145 ---- if (cmd != 0) { ! out = cmd(static_cast<Object*>(gMyPrivateContext->GetSelection().get()), in); } else { *************** *** 243,247 **** rb_define_global_function("dirs", RUBY_METHOD_FUNC(dirs), 0); ! mRelPathPrefix = "../../"; } --- 259,263 ---- rb_define_global_function("dirs", RUBY_METHOD_FUNC(dirs), 0); ! mRelPathPrefix = string("..") + salt::PathSeparator + ".." + salt::PathSeparator; } *************** *** 264,274 **** return false; } ! boost::scoped_array<char> buffer(new char[file->Size() + 1]); file->Read(buffer.get(), file->Size()); buffer[file->Size()] = 0; bool ok = Eval(buffer.get()); UpdateCachedAllNodes(); return ok; } --- 280,293 ---- return false; } ! std::cerr << "Running the script\n"; boost::scoped_array<char> buffer(new char[file->Size() + 1]); file->Read(buffer.get(), file->Size()); buffer[file->Size()] = 0; + std::cerr << "Created buffer\n"; bool ok = Eval(buffer.get()); + std::cerr << "Eval'd buffer\n"; UpdateCachedAllNodes(); + std::cerr << "Updated cached nodes\n"; return ok; } *************** *** 471,476 **** { // run the init script in the sourceDir ! string sourcePath = sourceDir + "/" + name; GetLog()->Debug() << "(ScriptServer) Running " << sourcePath << "... "; shared_ptr<salt::StdFile> file(new(salt::StdFile)); --- 490,496 ---- { // run the init script in the sourceDir ! string sourcePath = sourceDir + salt::PathSeparator + name; GetLog()->Debug() << "(ScriptServer) Running " << sourcePath << "... "; + std::cerr << "(ScriptServer) Running " << sourcePath << "... "; shared_ptr<salt::StdFile> file(new(salt::StdFile)); *************** *** 478,485 **** { GetLog()->Debug() << "failed (script not found)" << endl; return eNotFound; } else if (! Run(file)) { ! GetLog()->Debug() << "failed (error in script" << endl; return eError; } else --- 498,507 ---- { GetLog()->Debug() << "failed (script not found)" << endl; + std::cerr << "failed (script not found)" << endl; return eNotFound; } else if (! Run(file)) { ! GetLog()->Debug() << "failed (error in script)" << endl; ! std::cerr << "failed (error in script)" << endl; return eError; } else *************** *** 494,498 **** } ! string destPath = destDir + "/" + name; GetLog()->Normal() << "Copying " << sourcePath --- 516,520 ---- } ! string destPath = destDir + salt::PathSeparator + name; GetLog()->Normal() << "Copying " << sourcePath *************** *** 515,519 **** } ! char* home = getenv("HOME"); if (!home) { --- 537,548 ---- } ! const char* envName = ! #ifdef WIN32 ! "USERPROFILE"; ! #else ! "HOME"; ! #endif ! ! char* home = getenv(envName); if (!home) { *************** *** 522,527 **** } ! dotDir = string(home) + "/" + mDotName; ! return true; } --- 551,555 ---- } ! dotDir = string(home) + salt::PathSeparator + mDotName; return true; } *************** *** 531,535 **** --- 559,567 ---- { char cwd[PATH_MAX+1]; + #if WIN32 + if (GetCurrentDirectory(PATH_MAX, cwd) == 0) + #else if (getcwd(cwd,sizeof(cwd)) == NULL) + #endif { GetLog()->Error() *************** *** 538,542 **** --- 570,578 ---- } + #if WIN32 + if (! SetCurrentDirectory(dotDir.c_str())) + #else if (chdir(dotDir.c_str()) == 0) + #endif { // dot dir exists; change back to original directory *************** *** 546,550 **** --- 582,590 ---- // dot dir is not existent, try to create it + #if WIN32 + if (! CreateDirectory(dotDir.c_str(), 0)) + #else if (mkdir(dotDir.c_str(),0777) != 0) + #endif { GetLog()->Error() << "(ScriptServer) ERROR: Cannot create directory '" *************** *** 569,580 **** CreateDotDir(dotDir); // some macro magic (not at all) string pkgdatadir = PREFIX "/share/" PACKAGE_NAME; ! //std::cout << "dotDir = " << dotDir << std::endl; ! //std::cout << "pkgdatadir = " << pkgdatadir << std::endl; ! //std::cout << "filename = " << fileName << std::endl; ! ERunScriptErrorType result; if (validDotDir) --- 609,624 ---- CreateDotDir(dotDir); + #ifdef WIN32 + string pkgdatadir = ".\\"; + #else // some macro magic (not at all) string pkgdatadir = PREFIX "/share/" PACKAGE_NAME; ! std::cerr << "dotDir = " << dotDir << "::"; ! std::cerr << "pkgdatadir = " << pkgdatadir << "::"; ! std::cerr << "filename = " << fileName << '\n'; ! #endif ! ERunScriptErrorType result = eNotFound; if (validDotDir) *************** *** 586,613 **** { GetLog()->Debug() << "(ScriptServer) : Ran init script '" ! << dotDir << "/" << fileName << "'\n"; return true; } ! if (result == eNotFound) { GetLog()->Debug() << "(ScriptServer) : Did not find init script '" ! << dotDir << "/" << fileName << "'\n"; } else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << dotDir << "/" << fileName << "'\n"; return false; } - ! // result = RunInitScriptInternal(pkgdatadir, fileName, validDotDir, dotDir); ! if (result == eOK) { GetLog()->Debug() << "(ScriptServer) : Ran init script '" ! << pkgdatadir << "/" << fileName << "'\n"; return true; } --- 630,665 ---- { GetLog()->Debug() << "(ScriptServer) : Ran init script '" ! << dotDir << salt::PathSeparator << fileName << "'\n"; ! std::cerr << "leaving runinitscript (OK)\n"; return true; } ! if (result == eNotFound) { + std::cerr << "init script not found " << dotDir << salt::PathSeparator << fileName << "\n"; GetLog()->Debug() << "(ScriptServer) : Did not find init script '" ! << dotDir << salt::PathSeparator << fileName << "'\n"; } else if (result == eError) { + std::cerr << "error in init script\n"; GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << dotDir << salt::PathSeparator << fileName << "'\n"; ! std::cerr << "leaving runinitscript (ERROR 1)\n"; return false; } ! ! // ! std::cerr << "RunInitScriptInternal(" << pkgdatadir << ", " << fileName << ", " ! << validDotDir << ", " << dotDir << ") (1)\n"; result = RunInitScriptInternal(pkgdatadir, fileName, validDotDir, dotDir); ! if (result == eOK) { + std::cerr << "Ran init script from pkgdatadir: " << pkgdatadir << salt::PathSeparator << fileName << "\n"; GetLog()->Debug() << "(ScriptServer) : Ran init script '" ! << pkgdatadir << salt::PathSeparator << fileName << "'\n"; ! std::cerr << "leaving runinitscript (OK 2)\n"; return true; } *************** *** 616,632 **** { GetLog()->Debug() << "(ScriptServer) : Did not find init script '" ! << pkgdatadir << "/" << fileName << "'\n"; } else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << pkgdatadir << "/" << fileName << "'\n"; ! } ! - result = RunInitScriptInternal(mRelPathPrefix+relPath, fileName, validDotDir, dotDir); ! if (result == eNotFound) { GetLog()->Error() << "(ScriptServer) ERROR: Cannot locate init script '" << fileName << "'\n"; --- 668,689 ---- { GetLog()->Debug() << "(ScriptServer) : Did not find init script '" ! << pkgdatadir << salt::PathSeparator << fileName << "'\n"; } else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << pkgdatadir << salt::PathSeparator << fileName << "'\n"; ! } ! std::cerr << "RunInitScriptInternal(" << mRelPathPrefix+relPath << ", " << fileName << ", " ! << validDotDir << ", " << dotDir << ") (2)\n"; ! ! result = RunInitScriptInternal(mRelPathPrefix+relPath, fileName, validDotDir, dotDir); ! if (result == eOK) ! std::cerr << "Ran init script OK from : " << mRelPathPrefix+relPath << "\n"; ! else if (result == eNotFound) { + std::cerr << "init script not found at " << mRelPathPrefix+relPath << "\n"; GetLog()->Error() << "(ScriptServer) ERROR: Cannot locate init script '" << fileName << "'\n"; *************** *** 634,641 **** else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << mRelPathPrefix+relPath << "/" << fileName << "'\n"; } ! return (result == eOK); } --- 691,699 ---- else if (result == eError) { + std::cerr << "error in init script found at " << mRelPathPrefix+relPath << "\n"; GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << mRelPathPrefix+relPath << salt::PathSeparator << fileName << "'\n"; } ! std::cerr << "leaving runinitscript (FINAL)\n"; return (result == eOK); } Index: rubywrapper.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/rubywrapper.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rubywrapper.h 5 Dec 2005 21:05:01 -0000 1.1 --- rubywrapper.h 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 38,42 **** --- 38,65 ---- #define EXTERN extern __declspec(dllimport) #endif + + #ifdef WIN32 + #include <winsock2.h> + + // disable compiler warning about type cast from VALUE to RBasic* + #pragma warning (disable : 4312) + #endif + #include <ruby.h> + + #ifdef WIN32 + #undef bind + #undef listen + #undef accept + #undef connect + #undef close + #undef recv + #undef socket + #undef send + + // reenable compiler warning + #pragma warning (default : 4312) + #endif + #undef EXTERN *************** *** 53,57 **** /** RbArguments is a structure that describes a ruby function call. ! \param recv is the ruby object that receives the function call \param id is the ruby id of the receiver member function \param n is the number of parameters passed --- 76,80 ---- /** RbArguments is a structure that describes a ruby function call. ! \param receiver is the ruby object that receives the function call \param id is the ruby id of the receiver member function \param n is the number of parameters passed *************** *** 61,71 **** struct RbArguments { ! VALUE recv; ID id; int n; VALUE *argv; ! RbArguments(VALUE recv, ID id, int n, VALUE *argv) : ! recv(recv), id(id), n(n), argv(argv) {}; }; --- 84,94 ---- struct RbArguments { ! VALUE receiver; ID id; int n; VALUE *argv; ! RbArguments(VALUE r, ID id, int n, VALUE *argv) : ! receiver(r), id(id), n(n), argv(argv) {}; }; Index: scriptserver_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver_c.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** scriptserver_c.cpp 5 Dec 2005 21:05:01 -0000 1.1 --- scriptserver_c.cpp 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 25,30 **** --- 25,37 ---- using namespace zeitgeist; + FUNCTION(ScriptServer,updateCachedAllNodes) + { + obj->UpdateCachedAllNodes(); + return true; + } + void CLASS(ScriptServer)::DefineClass() { DEFINE_BASECLASS(zeitgeist/Leaf); + DEFINE_FUNCTION(updateCachedAllNodes); } Index: gcvalue.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/gcvalue.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gcvalue.cpp 5 Dec 2005 21:05:01 -0000 1.1 --- gcvalue.cpp 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 21,24 **** --- 21,25 ---- */ #include "gcvalue.h" + #include "rubywrapper.h" #include <sstream> Index: rubywrapper.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/rubywrapper.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rubywrapper.cpp 5 Dec 2005 21:05:01 -0000 1.1 --- rubywrapper.cpp 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 25,29 **** { RbArguments &a = *reinterpret_cast<RbArguments*>(arg); ! return rb_funcall2(a.recv, a.id, a.n, a.argv); } --- 25,29 ---- { RbArguments &a = *reinterpret_cast<RbArguments*>(arg); ! return rb_funcall2(a.receiver, a.id, a.n, a.argv); } *************** *** 56,60 **** void zeitgeist::RbPrintError() { ! std::cout << RbGetError() << std::endl; rb_backtrace(); } --- 56,60 ---- void zeitgeist::RbPrintError() { ! std::cout << RbGetError().c_str() << std::endl; rb_backtrace(); } Index: scriptserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** scriptserver.h 16 May 2006 10:17:32 -0000 1.2 --- scriptserver.h 15 Mar 2007 07:26:31 -0000 1.3 *************** *** 112,115 **** --- 112,116 ---- bool Eval(const std::string &command, GCValue& value); + /** notify all notes to update their cached references */ void UpdateCachedAllNodes(); Index: gcvalue.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/gcvalue.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gcvalue.h 5 Dec 2005 21:05:01 -0000 1.1 --- gcvalue.h 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 24,28 **** #define ZEITGEIST_GCVALUE_H ! #include <zeitgeist/scriptserver/rubywrapper.h> namespace zeitgeist --- 24,31 ---- #define ZEITGEIST_GCVALUE_H ! typedef unsigned long VALUE; ! typedef unsigned long ID; ! ! #include <string> namespace zeitgeist |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:37
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist/fileserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/zeitgeist/fileserver Modified Files: fileserver.h Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: fileserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/fileserver/fileserver.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fileserver.h 5 Dec 2005 21:05:01 -0000 1.1 --- fileserver.h 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 85,89 **** // public: ! typedef int THandle; protected: --- 85,89 ---- // public: ! typedef long THandle; protected: |
Update of /cvsroot/simspark/simspark/spark/zeitgeist In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/zeitgeist Modified Files: core.cpp core.h corecontext.h leaf.cpp leaf.h node.cpp node_c.cpp zeitgeist.cpp Added Files: zeitgeist.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: leaf.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** leaf.h 5 Dec 2005 20:59:18 -0000 1.1 --- leaf.h 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 38,42 **** #define ZEITGEIST_LEAF_H ! #include <list> #include <string> #include "object.h" --- 38,42 ---- #define ZEITGEIST_LEAF_H ! #include <set> #include <string> #include "object.h" *************** *** 55,59 **** --- 55,65 ---- // public: + template <typename _CLASS> + struct CachedPath : public Core::CachedPath<_CLASS> + { + }; + typedef std::list< boost::shared_ptr<Leaf> > TLeafList; + typedef std::set<Core::CachedLeafPath*> TCachedPathSet; // *************** *** 229,234 **** virtual void Dump() const; /** update variables from a script */ ! virtual void UpdateCached() {} /** constructs the full path of this node by walking up the --- 235,246 ---- virtual void Dump() const; + /** update and register a path reference */ + void RegisterCachedPath(Core::CachedLeafPath& path, const std::string& pathStr); + + /** register a path reference */ + void Leaf::RegisterCachedPath(Core::CachedLeafPath& path); + /** update variables from a script */ ! virtual void UpdateCached(); /** constructs the full path of this node by walking up the *************** *** 239,243 **** /** clears any cached data (e.g. the cached full path and forces the node to recalculate all values */ ! void ClearCachedData() const; /** sets the name of this node */ --- 251,255 ---- /** clears any cached data (e.g. the cached full path and forces the node to recalculate all values */ ! void ClearCachedData(); /** sets the name of this node */ *************** *** 290,294 **** which can hold children. We use a weak pointer to break the cyclic dependency. */ ! boost::weak_ptr<Node> mParent; private: --- 302,306 ---- which can hold children. We use a weak pointer to break the cyclic dependency. */ ! boost::weak_ptr<Node> mParent; private: *************** *** 298,301 **** --- 310,316 ---- /** temporary cached full path of this node in the hierarchy */ mutable std::string *mCachedFullPath; + + /** list of cached path references to other nodes */ + TCachedPathSet mCachedPaths; }; Index: node.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/node.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** node.cpp 5 Dec 2005 20:59:18 -0000 1.1 --- node.cpp 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 199,217 **** Node::UnlinkChildren() { - string cname; - if (GetClass().get() != 0) - { - cname = GetClass()->GetName(); - } - while (! mChildren.empty()) { shared_ptr<Leaf> node = mChildren.front(); - - string className; - if (node->GetClass().get()!= 0) - { - className=node->GetClass()->GetName(); - } node->UnlinkChildren(); node->Unlink(); --- 199,205 ---- *************** *** 285,288 **** --- 273,278 ---- Node::UpdateCached() { + Leaf::UpdateCached(); + // update all Leaves found for (TLeafList::iterator iter = begin(); Index: core.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/core.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** core.cpp 10 Mar 2006 00:16:06 -0000 1.2 --- core.cpp 15 Mar 2007 07:26:31 -0000 1.3 *************** *** 35,43 **** #include <salt/path.h> #include <salt/sharedlibrary.h> - #include <execinfo.h> #include <signal.h> #include <iostream> #include <sstream> using namespace boost; using namespace salt; --- 35,50 ---- #include <salt/path.h> #include <salt/sharedlibrary.h> #include <signal.h> #include <iostream> #include <sstream> + #ifdef HAVE_CONFIG_H + #include <config.h> + #endif + + #ifdef HAVE_EXECINFO_H + #include <execinfo.h> + #endif + using namespace boost; using namespace salt; *************** *** 156,163 **** void Core::CatchSignal(int sig_num) { if (sig_num != SIGSEGV) ! { ! return; ! } cerr << "(Core) caught signal " << sig_num << endl; --- 163,171 ---- void Core::CatchSignal(int sig_num) { + #ifdef __linux__ if (sig_num != SIGSEGV) ! { ! return; ! } cerr << "(Core) caught signal " << sig_num << endl; *************** *** 201,204 **** --- 209,213 ---- cerr << "(Core) exit" << endl; exit(1); + #endif } *************** *** 267,272 **** bool Core::ImportBundle(const std::string& bundleName) { ! shared_ptr<SharedLibrary> bundle(new SharedLibrary()); if (!bundle->Open(bundleName)) { --- 276,287 ---- bool Core::ImportBundle(const std::string& bundleName) { ! TBundleMap::const_iterator iter = mBundles.find(bundleName); ! if (iter != mBundles.end()) ! { ! // already imported ! return true; ! } + shared_ptr<SharedLibrary> bundle(new SharedLibrary()); if (!bundle->Open(bundleName)) { *************** *** 293,297 **** while(!classes.empty()) { - //shared_ptr<Class> theClass(classes.back()); if (RegisterClassObject(classes.back(), "")) { --- 308,311 ---- *************** *** 303,309 **** } ! // we only add the bundle, if it contained a class which was registered if (usingClass) ! mBundles.push_back(bundle); return true; --- 317,324 ---- } ! // we only add the bundle, if it contained a class which was ! // registered if (usingClass) ! mBundles[bundleName] = bundle; return true; *************** *** 325,334 **** } ! boost::shared_ptr<Leaf> Core::GetInternal(const std::string &pathStr, ! const boost::shared_ptr<Leaf>& leaf) { ! // lookup the path in the internal cache ! CacheKey key(leaf, pathStr); ! TPathCache::iterator iter = mPathCache.find(key); if (iter != mPathCache.end()) --- 340,346 ---- } ! boost::weak_ptr<Leaf> Core::GetCachedInternal(const CacheKey& key) { ! // lookup the key in the internal cache TPathCache::iterator iter = mPathCache.find(key); if (iter != mPathCache.end()) *************** *** 337,341 **** if (! entry.expired()) { ! return entry.lock(); } --- 349,353 ---- if (! entry.expired()) { ! return entry; } *************** *** 344,360 **** } // walk the hierarchy ! Path path(pathStr); ! boost::shared_ptr<Leaf> current; if ( (path.IsAbsolute()) || ! (leaf.get() == NULL) ) { ! current= mRoot; } else { ! current = leaf; } --- 356,390 ---- } + return shared_ptr<Leaf>(); + } + + void Core::PutCachedInternal(const CacheKey& key, const boost::weak_ptr<Leaf>& leaf) + { + // update cache; note that we can't cache the fact, that a node is + // not present as it may be created later on + + if (leaf.expired()) + { + return; + } + + mPathCache[key] = leaf; + } + + boost::shared_ptr<Leaf> Core::GetUncachedInternal(const CacheKey& key) + { // walk the hierarchy ! shared_ptr<Leaf> current; ! Path path(key.path); if ( (path.IsAbsolute()) || ! (key.root.expired()) ) { ! current = mRoot; } else { ! current = key.root.lock(); } *************** *** 369,380 **** } ! // update cache; note that we can't cache the fact, that a node is ! // not present as it may be created later on ! if (current.get() != 0) { ! mPathCache[key] = current; } ! return current; } --- 399,421 ---- } ! // update cache ! PutCachedInternal(key, current); ! ! return current; ! } ! ! boost::shared_ptr<Leaf> Core::GetInternal(const std::string &pathStr, ! const boost::shared_ptr<Leaf>& leaf) ! { ! // lookup the path in the internal cache ! CacheKey key(leaf, pathStr); ! ! boost::weak_ptr<Leaf> cached(GetCachedInternal(key)); ! if (! cached.expired()) { ! return cached.lock(); } ! return GetUncachedInternal(key); } *************** *** 437,459 **** void Core::BindClass(const boost::shared_ptr<Class> &newClass) const { ! if (newClass != mClassClass) ! { ! newClass->Construct(newClass, mClassClass); ! newClass->AttachTo(mSelf); ! } } - template <class T> - struct isUnique: public unary_function<T, bool> - { - bool operator()(const T& x){ return x.unique(); } - }; - void Core::GarbageCollectBundles() { ! // don't you just love the STL ;-) ! mBundles.erase(remove_if( ! mBundles.begin(), mBundles.end(), ! isUnique<shared_ptr<SharedLibrary> >() ! ), mBundles.end()); } --- 478,507 ---- void Core::BindClass(const boost::shared_ptr<Class> &newClass) const { ! /* The following condition (true || ...) is always true. ! * The condition right of the || was the original condition, but I had to ! * change it since this caused ClassClass to have no core attached on my system ! * (which in turn made the program crash) -- oliver */ ! if (true || newClass != mClassClass) ! { ! newClass->Construct(newClass, mClassClass); ! newClass->AttachTo(mSelf); ! } } void Core::GarbageCollectBundles() { ! TBundleMap::iterator iter = mBundles.begin(); ! ! while (iter != mBundles.end()) ! { ! const TBundlePair& entry = (*iter); ! if (entry.second.unique()) ! { ! mBundles.erase(iter); ! iter = mBundles.begin(); ! continue; ! } ! ! ++iter; ! } } --- NEW FILE: zeitgeist.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="zeitgeist" ProjectGUID="{B3FAF507-1CEB-437C-8272-30C8DC236192}" RootNamespace="zeitgeist" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\win32;..\" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_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="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\win32;..\" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_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="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="fileserver" > <File RelativePath=".\fileserver\fileserver.cpp" > </File> <File RelativePath=".\fileserver\fileserver.h" > </File> <File RelativePath=".\fileserver\fileserver_c.cpp" > </File> <File RelativePath=".\fileserver\filesystem.h" > </File> <File RelativePath=".\fileserver\filesystem_c.cpp" > </File> </Filter> <Filter Name="logserver" > <File RelativePath=".\logserver\logserver.cpp" > </File> <File RelativePath=".\logserver\logserver.h" > </File> <File RelativePath=".\logserver\logserver_c.cpp" > </File> <File RelativePath=".\logserver\logserverstreambuf.cpp" > </File> <File RelativePath=".\logserver\logserverstreambuf.h" > </File> </Filter> <Filter Name="randomserver" > <File RelativePath=".\randomserver\randomserver.cpp" > </File> <File RelativePath=".\randomserver\randomserver.h" > </File> <File RelativePath=".\randomserver\randomserver_c.cpp" > </File> </Filter> <Filter Name="scriptserver" > <File RelativePath=".\scriptserver\gcvalue.cpp" > </File> <File RelativePath=".\scriptserver\gcvalue.h" > </File> <File RelativePath=".\scriptserver\rubywrapper.cpp" > </File> <File RelativePath=".\scriptserver\rubywrapper.h" > </File> <File RelativePath=".\scriptserver\scriptserver.cpp" > </File> <File RelativePath=".\scriptserver\scriptserver.h" > </File> <File RelativePath=".\scriptserver\scriptserver_c.cpp" > </File> </Filter> <File RelativePath=".\class.cpp" > </File> <File RelativePath=".\class.h" > </File> <File RelativePath=".\class_c.cpp" > </File> <File RelativePath=".\core.cpp" > </File> <File RelativePath=".\core.h" > </File> <File RelativePath=".\corecontext.cpp" > </File> <File RelativePath=".\corecontext.h" > </File> <File RelativePath=".\leaf.cpp" > </File> <File RelativePath=".\leaf.h" > </File> <File RelativePath=".\leaf_c.cpp" > </File> <File RelativePath=".\node.cpp" > </File> <File RelativePath=".\node.h" > </File> <File RelativePath=".\node_c.cpp" > </File> <File RelativePath=".\object.cpp" > </File> <File RelativePath=".\object.h" > </File> <File RelativePath=".\object_c.cpp" > </File> <File RelativePath=".\object_c.h" > </File> <File RelativePath=".\parameterlist.cpp" > </File> <File RelativePath=".\parameterlist.h" > </File> <File RelativePath=".\zeitgeist.cpp" > </File> <File RelativePath=".\zeitgeist.h" > </File> </Files> <Globals> </Globals> </VisualStudioProject> Index: core.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/core.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** core.h 10 Mar 2006 00:16:06 -0000 1.2 --- core.h 15 Mar 2007 07:26:31 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- #include <list> #include <map> + #include <set> #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> *************** *** 55,59 **** class Core { ! protected: // // types --- 56,60 ---- class Core { ! public: // // types *************** *** 73,81 **** public: ! CacheKey(boost::weak_ptr<Leaf> r, const std::string& p) : root(r), path(p) {}; bool operator == (const CacheKey& key) const; bool operator < (const CacheKey& key) const; }; /** TPathCache defines a mapping from a CacheKey to a weak reference of the corresponding Leaf --- 74,190 ---- public: ! CacheKey() ! {} ! ! CacheKey(boost::weak_ptr<Leaf> r, const std::string& p) : root(r), path(p) ! {}; ! bool operator == (const CacheKey& key) const; bool operator < (const CacheKey& key) const; }; + /** CachedLeafPath defines a pair of path key and it's + corresponding weak reference. It acts like a smart pointer + that is able to update the keep the managed reference up to + date with the help of the core and the CacheKey + */ + struct CachedLeafPath + { + protected: + CacheKey key; + boost::weak_ptr<Leaf> leaf; + + public: + // need to have virtual destructor + virtual ~CachedLeafPath() {} + + const CacheKey& GetKey() + { return key; } + + void SetKey(const CacheKey& k) + { key = k; } + + boost::weak_ptr<Leaf>& GetLeaf() + { return leaf; } + + virtual void Cache(boost::shared_ptr<Core> core, const std::string& pathStr) = 0; + virtual void Update(boost::shared_ptr<Core> core) = 0; + + bool operator == (const CachedLeafPath& p) + { + return (key == p.key); + } + + bool operator < (const CachedLeafPath& p) + { + return (key < p.key); + } + + bool expired() + { + return leaf.expired(); + } + + void reset() + { + leaf.reset(); + } + }; + + template<typename _CLASS> + struct CachedPath : public CachedLeafPath + { + public: + CachedPath() : CachedLeafPath() + {} + + CachedPath(const CacheKey& k, const boost::weak_ptr<_CLASS> &l) + : CachedLeafPath(k,l) + {} + + virtual void Cache(boost::shared_ptr<Core> core, const std::string& pathStr) + { + if (core.get() == NULL) + { + leaf.reset(); + return; + } + + key = CacheKey(core->mRoot, pathStr); + Update(core); + } + + virtual void Update(boost::shared_ptr<Core> core) + { + if (core.get() == NULL) + { + leaf.reset(); + return; + } + + // lookup the path in the internal core cache + boost::weak_ptr<Leaf> lookup = core->GetCachedInternal(key); + if (! lookup.expired()) + { + leaf = boost::shared_dynamic_cast<_CLASS>(lookup.lock()); + return; + } + + leaf = boost::shared_dynamic_cast<_CLASS> + (core->GetUncachedInternal(key)); + } + + boost::shared_ptr<_CLASS> get() + { + return boost::shared_static_cast<_CLASS>(leaf.lock()); + } + + _CLASS* operator -> () + { + return boost::shared_static_cast<_CLASS>(leaf.lock()).get(); + } + }; + + protected: /** TPathCache defines a mapping from a CacheKey to a weak reference of the corresponding Leaf *************** *** 83,86 **** --- 192,199 ---- typedef std::map<CacheKey, boost::weak_ptr<Leaf> > TPathCache; + /** TBundleMap defines a registry of loaded bundles */ + typedef std::pair<std::string, boost::shared_ptr<salt::SharedLibrary> > TBundlePair; + typedef std::map<std::string, boost::shared_ptr<salt::SharedLibrary> > TBundleMap; + // // functions *************** *** 141,145 **** boost::shared_ptr<Leaf> GetRoot() const { return mRoot; } ! /** returns a reference to the object denoted by the path expression 'pathStr'. */ boost::shared_ptr<Leaf> Get(const std::string &pathStr); --- 254,260 ---- boost::shared_ptr<Leaf> GetRoot() const { return mRoot; } ! /** returns a reference to the object denoted by the path ! expression 'pathStr'. ! */ boost::shared_ptr<Leaf> Get(const std::string &pathStr); *************** *** 175,178 **** --- 290,311 ---- protected: + /** returns a cached reference to the Leaf corresponding to the + given key. If the cached reference expired the entry is + removed from the cache + */ + boost::weak_ptr<Leaf> GetCachedInternal(const CacheKey& key); + + /** returns a reference to the object denoted by the path + expression 'pathStr', relative to the node base. This method + does not lookup for a cached reference but does update the + cache accordingly + */ + boost::shared_ptr<Leaf> GetUncachedInternal(const CacheKey& key); + + /** checks that the leaf reference isn't expired and inserts the + given key,leaf pair into the cache + */ + void PutCachedInternal(const CacheKey& key, const boost::weak_ptr<Leaf>& leaf); + /** returns a reference to the object denoted by the path expression 'pathStr', relative to the node base. *************** *** 213,221 **** boost::weak_ptr<Core> mSelf; ! /** a list of all registered bundles. Whenever we load a ! bundle, we add it to this list. This is necessary, because ! we have to keep the connection to each bundle open, until ! all the class objects belonging to it are completely ! destructed. This workaround is very ugly ... it cost me about 3-4 --- 346,353 ---- boost::weak_ptr<Core> mSelf; ! /** a registry of all registered bundles. Whenever we load a ! bundle, we add it to this map. This is necessary, because we ! have to keep the connection to each bundle open, until all the ! class objects belonging to it are completely destructed. This workaround is very ugly ... it cost me about 3-4 *************** *** 239,243 **** enough. */ ! std::list<boost::shared_ptr<salt::SharedLibrary> > mBundles; //! the internal node lookup cache --- 371,375 ---- enough. */ ! TBundleMap mBundles; //! the internal node lookup cache Index: node_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/node_c.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** node_c.cpp 5 Dec 2005 20:59:18 -0000 1.1 --- node_c.cpp 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 25,30 **** --- 25,37 ---- using namespace zeitgeist; + FUNCTION(Node,unlinkChildren) + { + obj->UnlinkChildren(); + return true; + } + void CLASS(Node)::DefineClass() { + DEFINE_FUNCTION(unlinkChildren); DEFINE_BASECLASS(zeitgeist/Leaf); } Index: leaf.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** leaf.cpp 5 Dec 2005 20:59:18 -0000 1.1 --- leaf.cpp 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 168,175 **** } ! void Leaf::ClearCachedData() const { delete mCachedFullPath; mCachedFullPath = NULL; } --- 168,176 ---- } ! void Leaf::ClearCachedData() { delete mCachedFullPath; mCachedFullPath = NULL; + mCachedPaths.clear(); } *************** *** 242,243 **** --- 243,269 ---- { } + + void Leaf::UpdateCached() + { + shared_ptr<Core> core(GetCore()); + + for ( + TCachedPathSet::iterator iter = mCachedPaths.begin(); + iter != mCachedPaths.end(); + ++iter + ) + { + (*iter)->Update(core); + } + } + + void Leaf::RegisterCachedPath(Core::CachedLeafPath& path, const std::string& pathStr) + { + path.Cache(GetCore(), pathStr); + mCachedPaths.insert(&path); + } + + void Leaf::RegisterCachedPath(Core::CachedLeafPath& path) + { + mCachedPaths.insert(&path); + } Index: zeitgeist.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/zeitgeist.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** zeitgeist.cpp 5 Dec 2005 20:59:18 -0000 1.1 --- zeitgeist.cpp 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 78,82 **** ( "zeitgeist.rb", ! "lib/zeitgeist", ScriptServer::IS_COMMON ); --- 78,82 ---- ( "zeitgeist.rb", ! "zeitgeist", ScriptServer::IS_COMMON ); Index: corecontext.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/corecontext.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** corecontext.h 5 Dec 2005 20:59:18 -0000 1.1 --- corecontext.h 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 102,106 **** /** returns the currently selected object */ ! boost::shared_ptr<Leaf> GetObject() const { return mObject; } /** returns the core this context belongs to */ --- 102,106 ---- /** returns the currently selected object */ ! boost::shared_ptr<Leaf> GetSelection() const { return mObject; } /** returns the core this context belongs to */ |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:35
|
Update of /cvsroot/simspark/simspark/spark/win32 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/win32 Added Files: config.h simspark.iss spark.ico Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) --- NEW FILE: config.h --- /** this is a static (i.e. not auto generated) win32 specific configuration file */ #define HAVE_KEROSIN_H 1 #define PACKAGE_NAME "simspark" #define HAVE_WINSOCK2_H 1 #define HAVE_SOCKET 1 #define HAVE_SOCKETTYPE 1 --- NEW FILE: simspark.iss --- ; ; This is an Inno Setup Script for SimSpark. Use the Inno Compiler ; available at http://www.jrsoftware.org/isinfo.php to create a ; setup.exe for Windows. This script uses the Inno preprocessor addon ; that has to be installed additionally ; #define MyAppName "SimSpark" #define MyAppVerName "SimSpark" #define MyAppPublisher "RoboCup Soccer Server 3D Maintenance Group" #define MyAppURL "http://sourceforge.net/projects/simspark" #define MyAppExeName "rsgedit.exe" #define MyVcReleaseDir "..\vcrelease" #define MyRsgEditDir "..\..\contrib\rsgedit" #define MyZeitgeistDir "..\zeitgeist" #define MyOxygenDir "..\oxygen" #define MyKerosinDir "..\kerosin" #define MySparkDir "..\spark" #define MyRsgDir "..\..\simulations\parts\rsg" [Setup] AppName={#MyAppName} AppVerName={#MyAppVerName} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}\simspark DefaultGroupName={#MyAppName} DisableProgramGroupPage=yes LicenseFile=..\COPYING OutputBaseFilename=setup Compression=lzma SolidCompression=yes [Languages] Name: english; MessagesFile: compiler:Default.isl [Tasks] Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked [Files] ; applications Source: {#MyVcReleaseDir}\rsgedit.exe; DestDir: {app}; Flags: ignoreversion Source: {#MyVcReleaseDir}\agentspark.exe; DestDir: {app}; Flags: ignoreversion ; plugins Source: {#MyVcReleaseDir}\inputwx.dll; DestDir: {app}; Flags: ignoreversion Source: {#MyVcReleaseDir}\rubysceneimporter.dll; DestDir: {app}; Flags: ignoreversion Source: {#MyVcReleaseDir}\sexpparser.dll; DestDir: {app}; Flags: ignoreversion Source: {#MyVcReleaseDir}\filesystemstd.dll; DestDir: {app}; Flags: ignoreversion Source: {#MyVcReleaseDir}\soccer.dll; DestDir: {app}; Flags: ignoreversion Source: {#MyVcReleaseDir}\sparkagent.dll; DestDir: {app}; Flags: ignoreversion Source: {#MyVcReleaseDir}\sceneeffector.dll; DestDir: {app}; Flags: ignoreversion ; ruby scripts Source: {#MyZeitgeistDir}\zeitgeist.rb; DestDir: {app}; Flags: ignoreversion Source: {#MyOxygenDir}\oxygen.rb; DestDir: {app}; Flags: ignoreversion Source: {#MyKerosinDir}\kerosin.rb; DestDir: {app}; Flags: ignoreversion Source: {#MySparkDir}\spark.rb; DestDir: {app}; Flags: ignoreversion Source: {#MyRsgEditDir}\bindings.rb; DestDir: {app}; Flags: ignoreversion Source: {#MyRsgEditDir}\german.scan.rb; DestDir: {app}; Flags: ignoreversion Source: {#MyRsgEditDir}\rsgedit.rb; DestDir: {app}; Flags: ignoreversion ; rsg files Source: {#MyRsgDir}\*.rsg; DestDir: {app}\rsg; Flags: recursesubdirs Source: {#MyRsgDir}\*.rb; DestDir: {app}\rsg; Flags: recursesubdirs ; support dlls Source: C:\ode\lib\releasedll\ode.dll; DestDir: {app}; Flags: ignoreversion Source: C:\ruby\bin\msvcrt-ruby18.dll; DestDir: {app}; Flags: ignoreversion [Icons] Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; WorkingDir: {app} Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL} Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe} Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; WorkingDir: {app}; Tasks: desktopicon Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; WorkingDir: {app}; Tasks: quicklaunchicon --- NEW FILE: spark.ico --- (This appears to be a binary file; contents omitted.) |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:34
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist/randomserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/zeitgeist/randomserver Modified Files: randomserver.cpp randomserver.h Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: randomserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/randomserver/randomserver.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** randomserver.h 5 Dec 2005 21:05:01 -0000 1.1 --- randomserver.h 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 26,30 **** #include <salt/random.h> #include <zeitgeist/node.h> - #include <sys/time.h> namespace zeitgeist --- 26,29 ---- *************** *** 44,57 **** /** set a random seed */ ! void Seed(salt::RandomEngine::result_type seed) ! { ! if (seed == 0) ! { ! timeval tv; ! gettimeofday(&tv,0); ! seed = tv.tv_usec; ! } ! salt::RandomEngine::instance(seed); ! } /** get a uniformly distributed random number */ --- 43,47 ---- /** set a random seed */ ! void Seed(salt::RandomEngine::result_type seed); /** get a uniformly distributed random number */ Index: randomserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/randomserver/randomserver.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** randomserver.cpp 5 Dec 2005 21:05:01 -0000 1.1 --- randomserver.cpp 15 Mar 2007 07:26:31 -0000 1.2 *************** *** 22,32 **** */ #include "randomserver.h" - #include <cmath> ! #if 0 void RandomServer::Seed(salt::RandomEngine::result_type seed) { ! salt::RandomEngine.instance(seed); ! } #endif --- 22,50 ---- */ #include "randomserver.h" ! #ifdef WIN32 ! #include <windows.h> ! #else ! #include <sys/time.h> ! #endif ! ! using namespace zeitgeist; ! void RandomServer::Seed(salt::RandomEngine::result_type seed) { ! if (seed == 0) ! { ! #ifdef WIN32 ! SYSTEMTIME time; ! GetSystemTime(&time); ! seed = time.wMilliseconds; ! #else ! timeval tv; ! gettimeofday(&tv,0); ! seed = tv.tv_usec; #endif + } + + salt::RandomEngine::instance(seed); + } |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:33
|
Update of /cvsroot/simspark/simspark/spark/utility/rcssnet In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/utility/rcssnet Modified Files: Makefile.am README addr.cpp addr.hpp exception.cpp socket.cpp socket.hpp socketstreambuf.hpp tcpsocket.cpp tcpsocket.hpp udpsocket.cpp udpsocket.hpp Added Files: handler.cpp handler.hpp rcssnet.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: udpsocket.hpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/rcssnet/udpsocket.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** udpsocket.hpp 19 Dec 2005 19:13:30 -0000 1.1 --- udpsocket.hpp 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 2,9 **** /*************************************************************************** ! updsocket.hpp - A simple upd socket class ------------------- begin : 08-JAN-2003 ! copyright : (C) 2003 by The RoboCup Soccer Server Maintenance Group. email : sse...@li... --- 2,9 ---- /*************************************************************************** ! udpsocket.hpp - A simple udp socket class ------------------- begin : 08-JAN-2003 ! copyright : (C) 2003 by The RoboCup Soccer Server Maintenance Group. email : sse...@li... *************** *** 34,42 **** public: UDPSocket(); UDPSocket( const Addr& addr ); UDPSocket( const Addr& addr, const Addr& dest ); ! protected: ! virtual void doOpen( int& fd ); }; } --- 34,44 ---- public: UDPSocket(); + UDPSocket( SocketDesc& s ); UDPSocket( const Addr& addr ); UDPSocket( const Addr& addr, const Addr& dest ); ! private: ! bool ! doOpen( SocketDesc& fd ); }; } Index: socketstreambuf.hpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/rcssnet/socketstreambuf.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** socketstreambuf.hpp 19 Dec 2005 19:13:30 -0000 1.1 --- socketstreambuf.hpp 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 5,9 **** ------------------- begin : 08-JAN-2003 ! copyright : (C) 2003 by The RoboCup Soccer Server Maintenance Group. email : sse...@li... --- 5,9 ---- ------------------- begin : 08-JAN-2003 ! copyright : (C) 2003 by The RoboCup Soccer Server Maintenance Group. email : sse...@li... *************** *** 44,48 **** SocketStreamBuf( Socket& socket, const Addr& dest, ! ConnType conn = CONN_ON_READ, std::streamsize bufsize = 8192 ) : m_socket( socket ), --- 44,48 ---- SocketStreamBuf( Socket& socket, const Addr& dest, ! ConnType conn = CONN_ON_READ, std::streamsize bufsize = 8192 ) : m_socket( socket ), *************** *** 55,59 **** {} ! SocketStreamBuf( Socket& socket, ConnType conn = NO_CONN, --- 55,59 ---- {} ! SocketStreamBuf( Socket& socket, ConnType conn = NO_CONN, *************** *** 67,71 **** {} ! virtual ~SocketStreamBuf() { --- 67,71 ---- {} ! virtual ~SocketStreamBuf() { *************** *** 74,93 **** delete [] m_outbuf; } ! void setEndPoint( const Addr& addr ) { m_end_point = addr; } ! void setConnectType( ConnType conn ) { m_connect = conn; } ! protected: ! virtual bool writeData() { ! int size = (pptr () - m_outbuf) * sizeof(char_type); if( size == 0 ) return true; --- 74,93 ---- delete [] m_outbuf; } ! void setEndPoint( const Addr& addr ) { m_end_point = addr; } ! void setConnectType( ConnType conn ) { m_connect = conn; } ! protected: ! virtual bool writeData() { ! unsigned long size = (unsigned long)((pptr () - m_outbuf) * sizeof(char_type)); if( size == 0 ) return true; *************** *** 98,103 **** return m_socket.send( m_outbuf, size, m_end_point ) > 0; } ! ! virtual int_type overflow( int_type c = EOF ) --- 98,103 ---- return m_socket.send( m_outbuf, size, m_end_point ) > 0; } ! ! virtual int_type overflow( int_type c = EOF ) *************** *** 105,109 **** // this method is supposed to flush the put area of the buffer // to the I/O device ! // if the buffer was not already allocated nor set by user, // do it just now --- 105,109 ---- // this method is supposed to flush the put area of the buffer // to the I/O device ! // if the buffer was not already allocated nor set by user, // do it just now *************** *** 124,130 **** return 0; } ! ! virtual ! int sync() { --- 124,130 ---- return 0; } ! ! virtual ! int sync() { *************** *** 140,151 **** return 0; } ! ! virtual ! int_type ! underflow() { // this method is supposed to read some bytes from the I/O device ! // if the buffer was not already allocated nor set by user, // do it just now --- 140,151 ---- return 0; } ! ! virtual ! int_type ! underflow() { // this method is supposed to read some bytes from the I/O device ! // if the buffer was not already allocated nor set by user, // do it just now *************** *** 154,162 **** m_inbuf = new char_type[m_bufsize]; } ! if( m_remained != 0 ) m_inbuf[0] = m_remained_char; ! ! int readn = m_bufsize * sizeof( char_type ) - m_remained; if( m_socket.isConnected() ) readn = m_socket.recv( m_inbuf + m_remained, --- 154,162 ---- m_inbuf = new char_type[m_bufsize]; } ! if( m_remained != 0 ) m_inbuf[0] = m_remained_char; ! ! int readn = m_bufsize * sizeof( char_type ) - m_remained; if( m_socket.isConnected() ) readn = m_socket.recv( m_inbuf + m_remained, *************** *** 171,176 **** m_socket.connect( addr ); } ! ! if( readn < 0 || readn == 1 && (m_inbuf + m_remained)[ 0 ] == -1 ) { (m_inbuf + m_remained)[ 0 ] = -1; --- 171,176 ---- m_socket.connect( addr ); } ! ! if( readn < 0 || ( readn == 1 && (m_inbuf + m_remained)[ 0 ] == -1 ) ) { (m_inbuf + m_remained)[ 0 ] = -1; *************** *** 180,200 **** setg( m_inbuf, m_inbuf, m_inbuf + totalbytes / sizeof(char_type) ); ! m_remained = totalbytes % sizeof( char_type ); if( m_remained != 0 ) m_remained_char = m_inbuf[totalbytes / sizeof(char_type)]; ! return sgetc(); } ! private: ! // not used SocketStreamBuf( const SocketStreamBuf& ); ! // not used ! SocketStreamBuf& operator=( const SocketStreamBuf& ); ! Socket& m_socket; Addr m_end_point; --- 180,200 ---- setg( m_inbuf, m_inbuf, m_inbuf + totalbytes / sizeof(char_type) ); ! m_remained = totalbytes % sizeof( char_type ); if( m_remained != 0 ) m_remained_char = m_inbuf[totalbytes / sizeof(char_type)]; ! return sgetc(); } ! private: ! // not used SocketStreamBuf( const SocketStreamBuf& ); ! // not used ! SocketStreamBuf& operator=( const SocketStreamBuf& ); ! Socket& m_socket; Addr m_end_point; --- NEW FILE: rcssnet.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="rcssnet" ProjectGUID="{ABCC65CE-0762-42F2-8459-41722DCF02D9}" RootNamespace="rcssnet" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\win32" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_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="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\win32" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;$(NOINHERIT)" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <File RelativePath=".\addr.cpp" > </File> <File RelativePath=".\addr.hpp" > </File> <File RelativePath=".\exception.cpp" > </File> <File RelativePath=".\exception.hpp" > </File> <File RelativePath=".\handler.cpp" > </File> <File RelativePath=".\handler.hpp" > </File> <File RelativePath=".\iosocketstream.hpp" > </File> <File RelativePath=".\isocketstream.hpp" > </File> <File RelativePath=".\osocketstream.hpp" > </File> <File RelativePath=".\socket.cpp" > </File> <File RelativePath=".\socket.hpp" > </File> <File RelativePath=".\socketstreambuf.hpp" > </File> <File RelativePath=".\tcpsocket.cpp" > </File> <File RelativePath=".\tcpsocket.hpp" > </File> <File RelativePath=".\udpsocket.cpp" > </File> <File RelativePath=".\udpsocket.hpp" > </File> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: handler.hpp --- // -*-c++-*- /*************************************************************************** handler.hpp - handles network startup ------------------- begin : 14-AUG-2003 copyright : (C) 2003 by The RoboCup Soccer Server Maintenance Group. email : sse...@li... ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU LGPL as published by the Free Software * * Foundation; either version 2 of the License, or (at your option) any * * later version. * * * ***************************************************************************/ #ifndef RCSS_NET_HANDLER_HPP #define RCSS_NET_HANDLER_HPP #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) #include "Winsock2.h" #endif namespace rcss { namespace net { class Handler { public: static Handler& instance(); bool valid() const { return m_valid; } private: Handler(); Handler( const Handler& ); // not used Handler& operator=( const Handler& ); // not used ~Handler(); #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) WSADATA m_WSAData; #endif bool m_valid; }; } } #endif // RCSS_NET_HANDLER_HPP Index: tcpsocket.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/rcssnet/tcpsocket.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcpsocket.cpp 19 Dec 2005 19:13:30 -0000 1.1 --- tcpsocket.cpp 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 1,28 **** ! /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! ! this file is part of rcssserver3D ! Fri May 9 2003 ! Copyright (C) 2002,2003 Koblenz University ! Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group ! $Id$ ! 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. - */ #include "tcpsocket.hpp" ! #include "exception.hpp" #include <sys/types.h> #include <sys/socket.h> #include <cerrno> namespace rcss --- 1,42 ---- ! // -*-c++-*- ! /*************************************************************************** ! tcpsocket.cpp - A simple tcp socket class ! ------------------- ! begin : 08-JAN-2003 ! copyright : (C) 2003 by The RoboCup Soccer Server ! Maintenance Group. ! email : sse...@li... ! ***************************************************************************/ ! /*************************************************************************** ! * * ! * This program is free software; you can redistribute it and/or modify * ! * it under the terms of the GNU LGPL as published by the Free Software * ! * Foundation; either version 2 of the License, or (at your option) any * ! * later version. * ! * * ! ***************************************************************************/ #include "tcpsocket.hpp" ! ! #ifdef HAVE_CONFIG_H ! #include <config.h> ! #endif ! #include <sys/types.h> + #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> + #endif #include <cerrno> + #ifdef HAVE_NETINET_IN_H + #include <netinet/in.h> + #endif + + #ifdef HAVE_WINSOCK2_H + #include "Winsock2.h" + #endif + + #include <iostream> namespace rcss *************** *** 35,38 **** --- 49,56 ---- } + TCPSocket::TCPSocket( SocketDesc& s ) + : Socket( s ) + {} + TCPSocket::TCPSocket( const Addr& addr ) { *************** *** 44,85 **** { open(); ! bind( addr ); connect( dest ); } ! TCPSocket::TCPSocket( int socket ) ! { ! m_open = true; ! m_connected = true; ! m_socket = socket; ! } ! ! void ! TCPSocket::doOpen( int& fd ) { close(); ! fd = ::socket(AF_INET, SOCK_STREAM, 0 ); ! if( fd < 0 ) ! throw OpenErr( errno ); ! } ! ! ! Socket* TCPSocket::accept(Addr& addr) ! { ! socklen_t len = sizeof(struct sockaddr); ! int fd = ::accept( ! m_socket, ! (struct sockaddr *)&( addr.getAddr() ), ! &len ! ); ! ! if (fd < 0) ! { ! throw AcceptErr( errno ); ! } ! ! return new TCPSocket(fd); } - } } --- 62,76 ---- { open(); ! bind( addr ); connect( dest ); } ! bool ! TCPSocket::doOpen( SocketDesc& fd ) { close(); ! fd = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP ); ! return fd >= 0; } } } Index: addr.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/rcssnet/addr.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** addr.cpp 19 Dec 2005 19:13:30 -0000 1.1 --- addr.cpp 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 5,9 **** ------------------- begin : 07-JAN-2003 ! copyright : (C) 2003 by The RoboCup Soccer Server Maintenance Group. email : sse...@li... --- 5,9 ---- ------------------- begin : 07-JAN-2003 ! copyright : (C) 2003 by The RoboCup Soccer Server Maintenance Group. email : sse...@li... *************** *** 20,29 **** #include "addr.hpp" ! #include "exception.hpp" #include <netdb.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> namespace rcss --- 20,52 ---- #include "addr.hpp" ! ! #ifdef HAVE_CONFIG_H ! #include "config.h" ! #endif ! ! #ifdef HAVE_NETDB_H #include <netdb.h> + #endif + #include <sys/types.h> + + #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> + #endif + #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> + #endif + #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> + #endif + + #ifdef HAVE_WINSOCK2_H + #include "Winsock2.h" + #endif + + #include "handler.hpp" + #include "exception.hpp" + #include <iostream> + #include <errno.h> namespace rcss *************** *** 36,65 **** class AddrImpl { ! public: ! AddrImpl() ! : m_addr() ! { memset( (char *)&m_addr, 0, sizeof( m_addr ) ); } ! ! AddrImpl( const Addr::AddrType& addr ) ! : m_addr( addr ) ! {} ! AddrImpl( Addr::PortType port ) { ! memset( (char *)&m_addr, 0, sizeof( m_addr ) ) ; ! m_addr.sin_family = AF_INET ; ! m_addr.sin_addr.s_addr = htonl( INADDR_ANY ); ! m_addr.sin_port = htons( port ); } ! AddrImpl( Addr::PortType port, Addr::HostType host ) { ! memset( (char *)&m_addr, 0, sizeof( m_addr ) ) ; ! m_addr.sin_family = AF_INET ; ! m_addr.sin_addr.s_addr = htonl( host ); ! m_addr.sin_port = htons( port ); } AddrImpl( Addr::PortType port, const std::string& host ) ! : m_host_name( host ) { struct hostent* host_ent --- 59,100 ---- class AddrImpl { ! private: ! void ! setAddr( Addr::PortType port, Addr::HostType host ) ! { ! memset( (char *)&m_addr, 0, sizeof( m_addr ) ) ; ! m_addr.sin_family = AF_INET ; ! m_addr.sin_addr.s_addr = host; ! m_addr.sin_port = port; ! } ! ! bool ! setPortRaw( Addr::PortType port ) { ! m_addr.sin_port = port; ! return true; } ! ! bool ! setHostRaw( Addr::HostType host ) { ! m_addr.sin_addr.s_addr = host; ! return true; } + public: + AddrImpl( const Addr::AddrType& addr ) + : m_handler( Handler::instance() ), + m_addr( addr ) + {} + AddrImpl( Addr::PortType port, Addr::HostType host ) + : m_handler( Handler::instance() ) + { + setAddr( htons( port ), htonl( host ) ); + } + AddrImpl( Addr::PortType port, const std::string& host ) ! : m_handler( Handler::instance() ), m_host_name( host ) { struct hostent* host_ent *************** *** 75,78 **** --- 110,181 ---- } + + bool + setPort( Addr::PortType port ) + { + m_port_name = std::string(); + return setPortRaw( htons( port ) ); + } + + bool + setPort( const std::string& port, + const std::string& proto = "" ) + { + if( port.empty() ) + { + #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) + errno = WSAHOST_NOT_FOUND; + #else + errno = HOST_NOT_FOUND; + #endif + return false; + } + struct servent* serv_ent + = (struct servent*)getservbyname( port.c_str(), + ( proto.empty() + ? NULL + : proto.c_str() ) ); + if( serv_ent == NULL ) + { + return false; + } + m_port_name = port; + return setPortRaw( serv_ent->s_port ); + } + + bool + setHost( Addr::HostType host ) + { + m_host_name = std::string(); + return setHostRaw( htonl( host ) ); + } + + bool + setHost( const std::string& host ) + { + if( host.empty() ) + { + #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) + errno = WSAHOST_NOT_FOUND; + #else + errno = HOST_NOT_FOUND; + #endif + return false; + } + struct hostent* host_ent + = (struct hostent*)gethostbyname( host.c_str() ); + if( host_ent == NULL ) + { + #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) + return false; + #else + return false; + #endif + } + m_host_name = host; + return setHostRaw( ((struct in_addr *)host_ent->h_addr_list[0])->s_addr ); + } + + const Addr::AddrType& getAddr() const *************** *** 82,90 **** getPort() const { return ntohs( m_addr.sin_port ); } ! ! void ! setPort(Addr::PortType port) ! { m_addr.sin_port = htons(port); } ! Addr::HostType getHost() const --- 185,189 ---- getPort() const { return ntohs( m_addr.sin_port ); } ! Addr::HostType getHost() const *************** *** 100,123 **** return m_host_name; } ! private: ! Addr::AddrType m_addr; mutable std::string m_host_name; }; ! Addr::Addr() ! : m_impl( new AddrImpl() ) {} ! Addr::Addr( const AddrType& addr ) : m_impl( new AddrImpl( addr ) ) {} ! Addr::Addr( PortType port ) ! : m_impl( new AddrImpl( port ) ) ! {} ! Addr::Addr( PortType port, HostType host ) ! : m_impl( new AddrImpl( port, host ) ) ! {} Addr::Addr( PortType port, const std::string& host ) --- 199,261 ---- return m_host_name; } ! ! std::string ! getPortStr( const std::string& proto = "" ) const ! { ! if( m_port_name.empty() ) ! { ! struct servent* serv_ent = getservbyport( m_addr.sin_port, ! ( proto.empty() ! ? NULL ! : proto.c_str() ) ); ! if( serv_ent == NULL ) ! { ! return m_port_name; ! } ! m_port_name = serv_ent->s_name; ! } ! return m_port_name; ! } ! private: ! Handler& m_handler; ! Addr::AddrType m_addr; mutable std::string m_host_name; + mutable std::string m_port_name; + Addr::Error m_error; + int m_errno; }; ! Addr::Addr( PortType port, HostType host ) ! : m_impl( new AddrImpl( port, host ) ) {} ! Addr::Addr( const AddrType& addr ) : m_impl( new AddrImpl( addr ) ) {} ! bool ! Addr::setPort( PortType port ) ! { ! return m_impl->setPort( port ); ! } ! bool ! Addr::setPort( const std::string& port, ! const std::string& proto ) ! { ! return m_impl->setPort( port, proto ); ! } ! ! bool ! Addr::setHost( HostType host ) ! { ! return m_impl->setHost( host ); ! } ! ! bool ! Addr::setHost( const std::string& host ) ! { ! return m_impl->setHost( host ); ! } Addr::Addr( PortType port, const std::string& host ) *************** *** 125,128 **** --- 263,267 ---- {} + const Addr::AddrType& Addr::getAddr() const *************** *** 133,140 **** { return m_impl->getPort(); } - void - Addr::setPort(PortType port) - { m_impl->setPort(port); } - Addr::HostType Addr::getHost() const --- 272,275 ---- *************** *** 145,161 **** { return m_impl->getHostStr(); } ! bool ! Addr::operator==( const Addr& addr ) const { ! return ( addr.getAddr().sin_port == getAddr().sin_port ! && ( addr.getAddr().sin_addr.s_addr ! == getAddr().sin_addr.s_addr ) ); } bool ! Addr::operator < ( const Addr& addr ) const { ! const Addr::HostType host_a = getHost(); ! const Addr::HostType host_b = addr.getHost(); if (host_a != host_b) --- 280,309 ---- { return m_impl->getHostStr(); } ! std::string ! Addr::getPortStr( const std::string& proto ) const ! { return m_impl->getPortStr( proto ); } ! ! bool ! operator==( const Addr& a, ! const Addr& b ) { ! return ( a.getAddr().sin_port == b.getAddr().sin_port ! && ( a.getAddr().sin_addr.s_addr ! == b.getAddr().sin_addr.s_addr ) ); } + bool + operator!=( const Addr& a, + const Addr& b ) + { + return !(a == b); + } + bool ! operator < ( const Addr& a, ! const Addr& b ) { ! const Addr::HostType host_a = a.getHost(); ! const Addr::HostType host_b = b.getHost(); if (host_a != host_b) *************** *** 164,168 **** } ! return getPort() < addr.getPort(); } --- 312,316 ---- } ! return a.getPort() < b.getPort(); } *************** *** 170,173 **** --- 318,322 ---- operator<<( std::ostream& o, const rcss::net::Addr& addr ) { return o << '(' << addr.getPort() << ':' << addr.getHostStr() << ')'; } + } } Index: socket.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/rcssnet/socket.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** socket.cpp 19 Dec 2005 19:13:30 -0000 1.1 --- socket.cpp 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 24,31 **** --- 24,40 ---- #include <sys/types.h> + + #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> + #endif + #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> + #endif + #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> + #endif + #ifdef HAVE_UNISTD_H #include <unistd.h> + #endif #include <fcntl.h> #include <cerrno> *************** *** 33,37 **** #include <poll.h> #endif - #include "exception.hpp" #ifndef HAVE_SOCKLEN_T --- 42,45 ---- *************** *** 39,42 **** --- 47,58 ---- #endif + #ifdef HAVE_WINSOCK2_H + #include "Winsock2.h" + #endif + + #include "handler.hpp" + #include "tcpsocket.hpp" + + #include <iostream> namespace rcss *************** *** 44,61 **** namespace net { Socket::Socket() ! : m_socket( 0 ), ! m_open( false ), ! m_connected( false ) {} Socket::~Socket() { close(); } ! void Socket::open() { ! doOpen( m_socket ); ! m_open = true; int err = setCloseOnExec(); if( err < 0 ) --- 60,108 ---- namespace net { + + + #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) + const Socket::SocketDesc Socket::INVALIDSOCKET = INVALID_SOCKET; + #else + const Socket::SocketDesc Socket::INVALIDSOCKET = -1; + #endif + + + void + Socket::closeFD( SocketDesc* s ) + { + #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) + ::closesocket( *s ); + #else + ::close( *s ); + #endif + delete s; + } + Socket::Socket() ! : m_handler( &Handler::instance() ) {} + Socket::Socket( SocketDesc s ) + : m_handler( &Handler::instance() ) + { + m_handle = boost::shared_ptr< SocketDesc >( new SocketDesc( s ), + Socket::closeFD ); + } + + Socket::~Socket() { close(); } ! bool Socket::open() { ! SocketDesc s; ! if( !doOpen( s ) ) ! return false; ! ! m_handle = boost::shared_ptr< SocketDesc >( new SocketDesc( s ), ! Socket::closeFD ); ! #if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) int err = setCloseOnExec(); if( err < 0 ) *************** *** 63,92 **** err = errno; close(); ! throw OpenErr( err ); } } ! void Socket::bind( const Addr& addr ) { ! int err = ::bind( m_socket, ! (struct sockaddr *)&( addr.getAddr() ), ! sizeof( addr.getAddr() ) ); ! if( err < 0 ) ! throw BindErr( errno ); ! } ! ! void ! Socket::listen( int backlog ) ! { ! int err = ::listen( m_socket, backlog ); ! if (err < 0 ) ! throw ListenErr( errno ); ! } ! ! Socket* Socket::accept(Addr& addr) ! { ! throw AcceptErr( EOPNOTSUPP ); ! return 0; } --- 110,137 ---- err = errno; close(); ! return false; } + #endif + return true; } ! bool Socket::bind( const Addr& addr ) { ! if( isOpen() ) ! { ! int err = ::bind( getFD(), ! (struct sockaddr *)&( addr.getAddr() ), ! sizeof( addr.getAddr() ) ); ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! if( err == SOCKET_ERROR ) ! return false; ! #else ! if( err < 0 ) ! return false; ! #endif ! return true; ! } ! return false; } *************** *** 94,118 **** Socket::getName() const { ! Addr::AddrType name; ! socklen_t from_len = sizeof( name ); ! int err = ::getsockname( m_socket, ! (struct sockaddr *)&name, ! &from_len ); ! if( err < 0 ) ! throw GetNameErr( errno ); ! ! return Addr( name ); } ! void Socket::connect( const Addr& addr ) { ! int err = ::connect( m_socket, ! (const struct sockaddr *)&( addr.getAddr() ), ! sizeof( addr.getAddr() ) ); ! if ( err < 0 ) ! throw ConnectErr( errno ); ! m_connected = true; } --- 139,185 ---- Socket::getName() const { ! if( isOpen() ) ! { ! Addr::AddrType name; ! socklen_t from_len = sizeof( name ); ! int err = ::getsockname( getFD(), ! (struct sockaddr *)&name, ! &from_len ); ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) ! if( err == SOCKET_ERROR ) ! { ! err = WSAGetLastError(); ! return Addr(); ! } ! #else ! if( err < 0 ) ! return Addr(); ! #endif ! return Addr( name ); ! } ! else ! return Addr(); } ! bool Socket::connect( const Addr& addr ) { ! if( isOpen() ) ! { ! int err = ::connect( getFD(), ! (const struct sockaddr *)&( addr.getAddr() ), ! sizeof( addr.getAddr() ) ); ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) ! if( err == SOCKET_ERROR ) ! return false; ! #else ! if( err < 0 ) ! return false; ! #endif ! return true; ! } ! else ! return false; } *************** *** 120,132 **** Socket::getPeer() const { ! Addr::AddrType name; ! socklen_t from_len = sizeof( name ); ! int err = ::getpeername( m_socket, ! (struct sockaddr *)&name, ! &from_len ); ! if( err < 0 ) ! throw GetNameErr( errno ); ! ! return Addr( name ); } --- 187,210 ---- Socket::getPeer() const { ! if( isOpen() ) ! { ! Addr::AddrType name; ! socklen_t from_len = sizeof( name ); ! int err = ::getpeername( getFD(), ! (struct sockaddr *)&name, ! &from_len ); ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) ! if( err == SOCKET_ERROR ) ! { ! return Addr(); ! } ! #else ! if( err < 0 ) ! return Addr(); ! #endif ! return Addr( name ); ! } ! else ! return Addr(); } *************** *** 134,144 **** Socket::close() { ! if( m_open ) ! { ! m_open = false; ! ::close( m_socket ); ! m_socket = 0; ! } ! m_connected = false; } --- 212,216 ---- Socket::close() { ! m_handle.reset(); } *************** *** 146,151 **** Socket::setCloseOnExec( bool on ) { ! return fcntl( m_socket, F_SETFD, ! ( on ? FD_CLOEXEC : ~FD_CLOEXEC ) ); } --- 218,236 ---- Socket::setCloseOnExec( bool on ) { ! if( isOpen() ) ! { ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! errno = EPERM; ! return -1; ! #else ! return fcntl( getFD(), F_SETFD, ! ( on ? FD_CLOEXEC : ~FD_CLOEXEC ) ); ! #endif ! } ! else ! { ! errno = EPERM; ! return -1; ! } } *************** *** 153,166 **** Socket::setNonBlocking( bool on ) { ! int flags = fcntl( m_socket, F_GETFL, 0 ); ! if( flags == -1 ) ! return flags; ! if( on ) ! return fcntl( m_socket, F_SETFL, ! O_NONBLOCK | flags ); else ! return fcntl( m_socket, F_SETFL, ! ~O_NONBLOCK & flags ); } --- 238,264 ---- Socket::setNonBlocking( bool on ) { ! if( isOpen() ) ! { ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! u_long tmp = on; ! return ioctlsocket( getFD(), FIONBIO, &tmp ); ! #else ! int flags = fcntl( getFD(), F_GETFL, 0 ); ! if( flags == -1 ) ! return flags; ! if( on ) ! return fcntl( getFD(), F_SETFL, ! O_NONBLOCK | flags ); ! else ! return fcntl( getFD(), F_SETFL, ! ~O_NONBLOCK & flags ); ! #endif ! } else ! { ! errno = EPERM; ! return -1; ! } } *************** *** 169,184 **** { #ifdef O_ASYNC ! int flags = fcntl( m_socket, F_GETFL, 0 ); ! if ( on ) ! return fcntl ( m_socket, F_SETFL, O_ASYNC | flags ); ! else ! return fcntl ( m_socket, F_SETFL, ! ~O_ASYNC & flags ); ! #else errno = EPERM; return -1; ! #endif } --- 267,285 ---- { #ifdef O_ASYNC ! if( isOpen() ) ! { ! int flags = fcntl( getFD(), F_GETFL, 0 ); ! if ( on ) ! return fcntl ( getFD(), F_SETFL, O_ASYNC | flags ); ! else ! return fcntl ( getFD(), F_SETFL, ! ~O_ASYNC & flags ); ! } ! #endif errno = EPERM; return -1; ! } *************** *** 187,211 **** { #ifdef SO_BROADCAST ! int ison = on; ! return setsockopt( m_socket, SOL_SOCKET, ! SO_BROADCAST, (void*)&ison, sizeof( int ) ); #else errno = EPERM; return -1; - #endif } ! int Socket::getFD() const ! { return m_socket; } bool Socket::isOpen() const ! { return m_open; } bool Socket::isConnected() const { ! return m_connected; } --- 288,320 ---- { #ifdef SO_BROADCAST ! if( isOpen() ) ! { ! int ison = on; ! return setsockopt( getFD(), SOL_SOCKET, ! SO_BROADCAST, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (const char*)&ison, #else + (void*)&ison, + #endif + sizeof( int ) ); + } + #endif errno = EPERM; return -1; } ! Socket::SocketDesc Socket::getFD() const ! { return ( isOpen() ? *(m_handle.get()) : Socket::INVALIDSOCKET ); } bool Socket::isOpen() const ! { return m_handle.get() != NULL; } bool Socket::isConnected() const { ! return getPeer() != Addr(); } *************** *** 223,227 **** if( check == DONT_CHECK ) { ! return ::sendto( m_socket, msg, len, flags, (struct sockaddr *)&( dest.getAddr() ), sizeof( dest.getAddr() ) ); --- 332,342 ---- if( check == DONT_CHECK ) { ! return ::sendto( getFD(), msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags, (struct sockaddr *)&( dest.getAddr() ), sizeof( dest.getAddr() ) ); *************** *** 231,240 **** for(;;) { ! int sent = ::sendto( m_socket, msg, len, flags, (struct sockaddr *)&( dest.getAddr() ), sizeof( dest.getAddr() ) ); if( sent != -1 || ( errno != EINTR ! && errno != EWOULDBLOCK ) ) return sent; } --- 346,366 ---- for(;;) { ! int sent = ::sendto( getFD(), msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags, (struct sockaddr *)&( dest.getAddr() ), sizeof( dest.getAddr() ) ); if( sent != -1 || ( errno != EINTR ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! && errno != WSAEWOULDBLOCK ! #else ! && errno != EWOULDBLOCK ! #endif ! ) ) return sent; } *************** *** 250,254 **** if( check == DONT_CHECK ) { ! return ::send( m_socket, msg, len, flags ); } else --- 376,386 ---- if( check == DONT_CHECK ) { ! return ::send( getFD(), msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags ); } else *************** *** 256,263 **** for(;;) { ! int sent = ::send( m_socket, msg, len, flags ); if( sent != -1 || ( errno != EINTR ! && errno != EWOULDBLOCK ) ) return sent; } --- 388,406 ---- for(;;) { ! int sent = ::send( getFD(), msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags ); if( sent != -1 || ( errno != EINTR ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! && errno != WSAEWOULDBLOCK ! #else ! && errno != EWOULDBLOCK ! #endif ! ) ) return sent; } *************** *** 276,280 **** Addr::AddrType addr; socklen_t from_len = sizeof( addr ); ! int rval = ::recvfrom( m_socket, msg, len, flags, (struct sockaddr *)&addr, &from_len ); from = Addr( addr ); --- 419,429 ---- Addr::AddrType addr; socklen_t from_len = sizeof( addr ); ! int rval = ::recvfrom( getFD(), msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags, (struct sockaddr *)&addr, &from_len ); from = Addr( addr ); *************** *** 287,291 **** Addr::AddrType addr; socklen_t from_len = sizeof( addr ); ! int received = ::recvfrom( m_socket, msg, len, flags, (struct sockaddr *)&addr, &from_len ); --- 436,446 ---- Addr::AddrType addr; socklen_t from_len = sizeof( addr ); ! int received = ::recvfrom( getFD(), msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags, (struct sockaddr *)&addr, &from_len ); *************** *** 305,314 **** { if( check == DONT_CHECK ) ! return ::recv( m_socket, msg, len, flags ); else { for(;;) { ! int received = ::recv( m_socket, msg, len, flags ); if( received != -1 || errno != EINTR ) --- 460,481 ---- { if( check == DONT_CHECK ) ! return ::recv( getFD(), msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags ); else { for(;;) { ! int received = ::recv( getFD(), msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags ); if( received != -1 || errno != EINTR ) *************** *** 318,321 **** --- 485,520 ---- } + bool + Socket::listen( int backlog ) + { + return ::listen( getFD(), backlog ) == 0; + } + + bool + Socket::accept( Socket& sock ) + { + SocketDesc fd = ::accept( getFD(), NULL, 0 ); + if( fd == INVALIDSOCKET ) + return false; + sock = TCPSocket( fd ); + return true; + } + + Socket* Socket::accept(Addr& addr) + { + socklen_t len = sizeof(struct sockaddr); + SocketDesc fd = ::accept( getFD(), + (struct sockaddr *)&( addr.getAddr() ), + &len + ); + + if (fd == INVALIDSOCKET ) + { + return 0; + } + + return new TCPSocket(fd); + } + int Socket::recv( int timeout, *************** *** 326,330 **** { #if defined (HAVE_POLL_H) ! pollfd fd = { m_socket, POLLIN | POLLPRI, 0 }; int res = poll( &fd, 1, timeout ); if( res == 0 ) --- 525,529 ---- { #if defined (HAVE_POLL_H) ! pollfd fd = { getFD(), POLLIN | POLLPRI, 0 }; int res = poll( &fd, 1, timeout ); if( res == 0 ) *************** *** 335,339 **** else if( res == 1 ) { ! return recv( msg, len, from, flags ); } else --- 534,544 ---- else if( res == 1 ) { ! return recv( msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! from, flags ); } else *************** *** 354,358 **** { #if defined (HAVE_POLL_H) ! pollfd fd = { m_socket, POLLIN | POLLPRI, 0 }; int res = poll( &fd, 1, timeout ); if( res == 0 ) --- 559,563 ---- { #if defined (HAVE_POLL_H) ! pollfd fd = { getFD(), POLLIN | POLLPRI, 0 }; int res = poll( &fd, 1, timeout ); if( res == 0 ) *************** *** 363,367 **** else if( res == 1 ) { ! return recv( msg, len, flags ); } else --- 568,578 ---- else if( res == 1 ) { ! return recv( msg, ! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ! (int)len, ! #else ! len, ! #endif ! flags ); } else Index: socket.hpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/rcssnet/socket.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** socket.hpp 19 Dec 2005 19:13:30 -0000 1.1 --- socket.hpp 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 22,57 **** #define RCSS_NET_SOCKET_HPP #include <boost/cstdint.hpp> #include "addr.hpp" namespace rcss { namespace net { class Socket { public: enum CheckingType { CHECK, DONT_CHECK }; Socket(); virtual ~Socket(); ! void open(); ! void bind( const Addr& addr ); - void - listen( int backlog ); - - virtual Socket* accept(Addr& addr); - Addr getName() const; ! void connect( const Addr& addr ); --- 22,78 ---- #define RCSS_NET_SOCKET_HPP + #ifdef HAVE_CONFIG_H + #include <config.h> + #endif + #include <boost/cstdint.hpp> + #include <boost/shared_ptr.hpp> #include "addr.hpp" + #ifdef HAVE_WINSOCK2_H + #include "Winsock2.h" + #endif + namespace rcss { namespace net { + class Handler; + class Socket { public: + #ifdef HAVE_SOCKETTYPE + typedef SOCKET SocketDesc; + #else + typedef int SocketDesc; + #endif + + static const SocketDesc INVALIDSOCKET; + enum CheckingType { CHECK, DONT_CHECK }; + public: + static + void + closeFD( SocketDesc* s ); + Socket(); + Socket( SocketDesc s ); + virtual ~Socket(); ! bool open(); ! bool bind( const Addr& addr ); Addr getName() const; ! bool connect( const Addr& addr ); *************** *** 74,78 **** setBroadcast( bool on = true ); ! int getFD() const; --- 95,99 ---- setBroadcast( bool on = true ); ! SocketDesc getFD() const; *************** *** 112,115 **** --- 133,144 ---- CheckingType check = CHECK ); + bool + accept( Socket& sock ); + + Socket* accept(Addr& addr); + + bool + listen( int backlog ); + // The following two methods allow a timeout to be specified. // Overall, it's slower than the untimed varients so if you do *************** *** 131,147 **** int flags = 0 ); ! protected: virtual ! void ! doOpen( int& fd ) = 0; ! ! // not used ! Socket( const Socket& ); ! Socket& operator=( const Socket& ); ! protected: ! int m_socket; ! bool m_open; ! bool m_connected; }; } --- 160,171 ---- int flags = 0 ); ! private: virtual ! bool ! doOpen( SocketDesc& fd ) = 0; ! private: ! Handler* m_handler; ! boost::shared_ptr< SocketDesc > m_handle; }; } Index: udpsocket.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/rcssnet/udpsocket.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** udpsocket.cpp 19 Dec 2005 19:13:30 -0000 1.1 --- udpsocket.cpp 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 2,6 **** /*************************************************************************** ! updsocket.cpp - A simple upd socket class ------------------- begin : 08-JAN-2003 --- 2,6 ---- /*************************************************************************** ! udpsocket.cpp - A simple udp socket class ------------------- begin : 08-JAN-2003 *************** *** 20,29 **** #include "udpsocket.hpp" #include <sys/types.h> #include <sys/socket.h> #include <cerrno> ! #include "exception.hpp" #include <netinet/in.h> namespace rcss --- 20,42 ---- #include "udpsocket.hpp" + + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + #include <sys/types.h> + #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> + #endif #include <cerrno> ! #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> + #endif + + #ifdef HAVE_WINSOCK2_H + #include "Winsock2.h" + #endif + #include <iostream> namespace rcss *************** *** 36,39 **** --- 49,56 ---- } + UDPSocket::UDPSocket( SocketDesc& s ) + : Socket( s ) + {} + UDPSocket::UDPSocket( const Addr& ad... [truncated message content] |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:33
|
Update of /cvsroot/simspark/simspark/spark/utility/sfsexp In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/utility/sfsexp Modified Files: Makefile.am io.c malloc_util.c sexp.c Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: io.c =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/sfsexp/io.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** io.c 19 Dec 2005 19:13:30 -0000 1.1 --- io.c 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 32,36 **** --- 32,40 ---- #include <fcntl.h> + + #ifndef WIN32 #include <unistd.h> + #endif + #include <stdio.h> #include <stdlib.h> *************** *** 39,42 **** --- 43,51 ---- #include <assert.h> + #ifdef WIN32 + #include <io.h> + #define read _read + #endif + /** * initialize an io-wrapper Index: sexp.c =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/sfsexp/sexp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sexp.c 19 Dec 2005 19:13:30 -0000 1.1 --- sexp.c 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 38,41 **** --- 38,45 ---- #include "faststack.h" + #ifdef WIN32 + #define snprintf _snprintf + #endif + /** * Recursively walk an s-expression and free it. Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/sfsexp/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 19 Dec 2005 19:13:30 -0000 1.1 --- Makefile.am 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 16,18 **** sexp_ops.h - EXTRA_DIST = README --- 16,17 ---- Index: malloc_util.c =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/sfsexp/malloc_util.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** malloc_util.c 19 Dec 2005 19:13:30 -0000 1.1 --- malloc_util.c 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 31,35 **** static int last_check = 0; ! static inline void set_alloc(int i, void *addr, size_t bytes, char *file, int lineno) { alloc_list[i].addr = addr; --- 31,38 ---- static int last_check = 0; ! static ! #ifndef _MSC_VER ! inline ! #endif void set_alloc(int i, void *addr, size_t bytes, char *file, int lineno) { alloc_list[i].addr = addr; |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:33
|
Update of /cvsroot/simspark/simspark/spark/utility/tinyxml In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/utility/tinyxml Modified Files: Makefile.am xmlfunctions.cpp Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/tinyxml/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 18 Feb 2006 19:33:59 -0000 1.2 --- Makefile.am 15 Mar 2007 07:26:30 -0000 1.3 *************** *** 2,10 **** libtinyxml_la_SOURCES = \ ! tinystr.cpp\ ! tinyxml.cpp\ ! tinyxmlerror.cpp\ ! tinyxmlparser.cpp\ ! xmlfunctions.cpp --- 2,13 ---- libtinyxml_la_SOURCES = \ ! tinystr.cpp \ ! tinyxml.cpp \ ! tinyxmlerror.cpp \ ! tinyxmlparser.cpp \ ! xmlfunctions.cpp \ ! tinystr.h \ ! tinyxml.h \ ! xmlfunctions.h Index: xmlfunctions.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/tinyxml/xmlfunctions.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xmlfunctions.cpp 18 Feb 2006 19:33:59 -0000 1.1 --- xmlfunctions.cpp 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 70,74 **** double d; bool ok = GetXMLAttribute(element, attrName, d); ! f = d; return ok; } --- 70,74 ---- double d; bool ok = GetXMLAttribute(element, attrName, d); ! f = static_cast<float>(d); return ok; } |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:33
|
Update of /cvsroot/simspark/simspark/spark/test/coretest In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/test/coretest Modified Files: main.cpp Added Files: coretest.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/spark/test/coretest/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 10 Mar 2006 00:11:48 -0000 1.2 --- main.cpp 15 Mar 2007 07:26:30 -0000 1.3 *************** *** 20,23 **** --- 20,27 ---- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #if HAVE_CONFIG_H + #include <config.h> + #endif + #include <zeitgeist/zeitgeist.h> #include <oxygen/oxygen.h> *************** *** 56,60 **** boost::shared_ptr<Leaf> selectedObject = ! scriptServer->GetContext()->GetObject(); cout << endl << selectedObject->GetFullPath() << "> "; --- 60,64 ---- boost::shared_ptr<Leaf> selectedObject = ! scriptServer->GetContext()->GetSelection(); cout << endl << selectedObject->GetFullPath() << "> "; --- NEW FILE: coretest.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="coretest" ProjectGUID="{FC4C3571-034B-4CB5-9CF3-3411205C9433}" RootNamespace="coretest" 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="..\..\win32;..\..\;..\..\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="msvcrt-ruby18.lib ode.lib wsock32.lib opengl32.lib glu32.lib glaux.lib" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" 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="..\..\win32;..\..\;..\..\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="msvcrt-ruby18.lib ode.lib wsock32.lib opengl32.lib glu32.lib glaux.lib" LinkIncremental="1" GenerateDebugInformation="true" SubSystem="1" 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=".\main.cpp" > </File> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:33
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/spark Modified Files: spark-config.in spark.cpp spark.h spark.rb Added Files: spark.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: spark.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** spark.cpp 8 Mar 2006 18:17:03 -0000 1.3 --- spark.cpp 15 Mar 2007 07:26:29 -0000 1.4 *************** *** 52,55 **** --- 52,60 ---- // reset shared ptr to objects in the zeitgeist hierarchy before // the zeitgeist core is shutdown + ResetCached(); + } + + void Spark::ResetCached() + { mLogServer.reset(); mScriptServer.reset(); *************** *** 58,69 **** } ! bool ! Spark::Init(int argc, char** argv) { mLogServer = mZeitgeist->GetCore()->GetLogServer(); if (mLogServer.get() == 0) { cerr << "(Spark) ERROR: LogServer not found\n"; ! return false; } --- 63,75 ---- } ! bool Spark::UpdateCached() { + bool ok = true; + mLogServer = mZeitgeist->GetCore()->GetLogServer(); if (mLogServer.get() == 0) { cerr << "(Spark) ERROR: LogServer not found\n"; ! ok = false; } *************** *** 72,86 **** { mLogServer->Error() << "(Spark) ERROR: ScriptServer not found\n"; ! return false; } - // run the spark init script - mZeitgeist->GetCore()->GetRoot()->GetScript()->RunInitScript - ( - "spark.rb", - "lib/spark", - ScriptServer::IS_COMMON - ); - mSceneServer = shared_dynamic_cast<SceneServer> (mZeitgeist->GetCore()->Get("/sys/server/scene")); --- 78,84 ---- { mLogServer->Error() << "(Spark) ERROR: ScriptServer not found\n"; ! ok = false; } mSceneServer = shared_dynamic_cast<SceneServer> (mZeitgeist->GetCore()->Get("/sys/server/scene")); *************** *** 89,93 **** { mLogServer->Error() << "(Spark) ERROR: SceneServer not found\n"; ! return false; } --- 87,91 ---- { mLogServer->Error() << "(Spark) ERROR: SceneServer not found\n"; ! ok = false; } *************** *** 98,109 **** { mLogServer->Error() << "(Spark) ERROR: SimulationServer not found\n"; ! return false; } // run the app defined init return InitApp(argc,argv); } ! bool Spark::InitApp(int /*argc*/, char** /*argv*/) { --- 96,123 ---- { mLogServer->Error() << "(Spark) ERROR: SimulationServer not found\n"; ! ok = false; } + return ok; + } + + bool + Spark::Init(int argc, char** argv) + { + // run the spark init script + mZeitgeist->GetCore()->GetScriptServer()->RunInitScript + ( + "spark.rb", + "lib/spark", + ScriptServer::IS_COMMON + ); + + UpdateCached(); + // run the app defined init return InitApp(argc,argv); } ! bool Spark::InitApp(int /*argc*/, char** /*argv*/) { *************** *** 111,115 **** } ! Zeitgeist& Spark::GetZeitgeist() { --- 125,129 ---- } ! Zeitgeist& Spark::GetZeitgeist() { *************** *** 117,121 **** } ! shared_ptr<Core> Spark::GetCore() { --- 131,135 ---- } ! shared_ptr<Core> Spark::GetCore() { *************** *** 123,127 **** } ! shared_ptr<zeitgeist::LogServer> Spark::GetLog() { --- 137,141 ---- } ! shared_ptr<zeitgeist::LogServer> Spark::GetLog() { *************** *** 129,133 **** } ! shared_ptr<SceneServer> Spark::GetSceneServer() { --- 143,147 ---- } ! shared_ptr<SceneServer> Spark::GetSceneServer() { *************** *** 135,139 **** } ! shared_ptr<SimulationServer> Spark::GetSimulationServer() { --- 149,153 ---- } ! shared_ptr<SimulationServer> Spark::GetSimulationServer() { *************** *** 142,146 **** #if HAVE_KEROSIN_H ! shared_ptr<InputControl> Spark::GetInputControl() { --- 156,160 ---- #if HAVE_KEROSIN_H ! shared_ptr<InputControl> Spark::GetInputControl() { *************** *** 154,158 **** } ! shared_ptr<InputServer> Spark::GetInputServer() { --- 168,172 ---- } ! shared_ptr<InputServer> Spark::GetInputServer() { *************** *** 161,165 **** } ! shared_ptr<RenderControl> Spark::GetRenderControl() { --- 175,179 ---- } ! shared_ptr<RenderControl> Spark::GetRenderControl() { *************** *** 174,178 **** #endif // HAVE_KEROSIN_H ! shared_ptr<ScriptServer> Spark::GetScriptServer() { --- 188,192 ---- #endif // HAVE_KEROSIN_H ! shared_ptr<ScriptServer> Spark::GetScriptServer() { *************** *** 180,184 **** } ! shared_ptr<Scene> Spark::GetActiveScene() { --- 194,198 ---- } ! shared_ptr<Scene> Spark::GetActiveScene() { *************** *** 187,191 **** if (scene.get() == 0) { ! mLogServer->Warning() << "(Spark) Warning: no active scene registered\n"; } --- 201,205 ---- if (scene.get() == 0) { ! mLogServer->Warning() << "(Spark) Warning: no active scene registered\n"; } Index: spark-config.in =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark-config.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** spark-config.in 25 Dec 2005 14:55:52 -0000 1.1 --- spark-config.in 15 Mar 2007 07:26:29 -0000 1.2 *************** *** 94,100 **** if test "$echo_libs" = "yes" ; then if test "@debug@" = "true"; then ! libs="-lspark_debug @SPARK_LIBADD@" else ! libs="-lspark @SPARK_LIBADD@" fi echo -L@libdir@/simspark $libs --- 94,100 ---- if test "$echo_libs" = "yes" ; then if test "@debug@" = "true"; then ! libs="-lspark_debug" else ! libs="-lspark" fi echo -L@libdir@/simspark $libs Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** spark.rb 15 Feb 2006 01:08:19 -0000 1.5 --- spark.rb 15 Mar 2007 07:26:29 -0000 1.6 *************** *** 41,47 **** --- 41,73 ---- $monitorType = 'tcp' + # (Global Physics / World) constants + # + $physicsGlobalCFM = 0.001 + $physicsGlobalGravity = -9.81 + # # below is a set of utility functions for the user app # + + # rebuild scene and update all cached references + def sparkResetScene + scene = get($scenePath) + scene.unlinkChildren() + + # (re-)create world and space aspects + world = new('oxygen/World', $scenePath+'world') + world.setGravity(0.0, 0.0, $physicsGlobalGravity) + world.setCFM($physicsGlobalCFM) + new('oxygen/Space', $scenePath+'space') + + # invalidate all cached references + scriptServer = get($serverPath+'script') + scriptServer.updateCachedAllNodes() + + # force update references to scene objects (world, space etc.) + sceneServer = get($serverPath+'scene') + sceneServer.setActiveScene($scenePath) + end + def sparkSetupMonitor print "(spark.rb) sparkSetupMonitor\n" *************** *** 224,227 **** --- 250,254 ---- fpsController = new('oxygen/FPSController',path+'/physics/controller') fpsController.setAcceleration(accel) + fpsController.setVAngle(30.0) inputControl = get($serverPath+'simulation/InputControl') inputControl.setFPSController(path+'/physics/controller') *************** *** 284,288 **** # logs all output to 'fileName' ! def sparkLogAllToFile(filenName) sparkEnableLog(fileName, 'eAll') end --- 311,315 ---- # logs all output to 'fileName' ! def sparkLogAllToFile(fileName) sparkEnableLog(fileName, 'eAll') end *************** *** 323,330 **** sceneServer.initSceneImporter("RosImporter"); ! # create world and space aspects ! world = new('oxygen/World', $scenePath+'world') ! world.setGravity(0.0, 0.0, -9.81) ! new('oxygen/Space', $scenePath+'space') # --- 350,355 ---- sceneServer.initSceneImporter("RosImporter"); ! # prepare scene ! sparkResetScene() # Index: spark.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** spark.h 8 Mar 2006 18:17:03 -0000 1.3 --- spark.h 15 Mar 2007 07:26:29 -0000 1.4 *************** *** 72,75 **** --- 72,81 ---- bool Init(int argc, char** argv); + /** resets all cached object references */ + void ResetCached(); + + /** updated all cached object references */ + bool UpdateCached(); + // // user callbacks --- NEW FILE: spark.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="spark" ProjectGUID="{87C2BFBA-8299-432F-B2E6-08E650E74230}" RootNamespace="spark" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\win32;..\;sceneserver/helper;..\utility" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_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="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\win32;..\;sceneserver/helper;..\utility" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_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="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <File RelativePath=".\spark.cpp" > </File> <File RelativePath=".\spark.h" > </File> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:33
|
Update of /cvsroot/simspark/simspark/spark/utility In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/utility Modified Files: Makefile.am Added Files: utility.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 24 Jan 2006 19:14:54 -0000 1.2 --- Makefile.am 15 Mar 2007 07:26:30 -0000 1.3 *************** *** 1,4 **** ! SUBDIRS = glextgen \ ! libobj \ rcssnet \ sfsexp\ --- 1,3 ---- ! SUBDIRS = libobj \ rcssnet \ sfsexp\ --- NEW FILE: utility.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="utility" ProjectGUID="{001EB793-1243-46C2-B693-B23BD1D3D1B5}" RootNamespace="utility" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_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" CompileAs="1" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories=".." PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="tinyxml" > <File RelativePath=".\tinyxml\tinystr.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="2" /> </FileConfiguration> </File> <File RelativePath=".\tinyxml\tinystr.h" > </File> <File RelativePath=".\tinyxml\tinyxml.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="2" /> </FileConfiguration> </File> <File RelativePath=".\tinyxml\tinyxml.h" > </File> <File RelativePath=".\tinyxml\tinyxmlerror.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="2" /> </FileConfiguration> </File> <File RelativePath=".\tinyxml\tinyxmlparser.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="2" /> </FileConfiguration> </File> <File RelativePath=".\tinyxml\xmlfunctions.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="2" /> </FileConfiguration> </File> <File RelativePath=".\tinyxml\xmlfunctions.h" > </File> </Filter> <Filter Name="sfsexp" > <File RelativePath=".\sfsexp\cstring.c" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="1" /> </FileConfiguration> </File> <File RelativePath=".\sfsexp\cstring.h" > </File> <File RelativePath=".\sfsexp\faststack.c" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="1" /> </FileConfiguration> </File> <File RelativePath=".\sfsexp\faststack.h" > </File> <File RelativePath=".\sfsexp\io.c" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="1" /> </FileConfiguration> </File> <File RelativePath=".\sfsexp\malloc_util.c" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="1" /> </FileConfiguration> </File> <File RelativePath=".\sfsexp\malloc_util.h" > </File> <File RelativePath=".\sfsexp\parser.c" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="1" /> </FileConfiguration> </File> <File RelativePath=".\sfsexp\sexp.c" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="1" /> </FileConfiguration> </File> <File RelativePath=".\sfsexp\sexp.h" > </File> <File RelativePath=".\sfsexp\sexp_ops.c" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" CompileAs="1" /> </FileConfiguration> </File> <File RelativePath=".\sfsexp\sexp_ops.h" > </File> </Filter> <File RelativePath="..\win32\config.h" > </File> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:32
|
Update of /cvsroot/simspark/simspark/spark/test In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/test Modified Files: Makefile.am Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/test/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 19 Dec 2005 20:42:23 -0000 1.1 --- Makefile.am 15 Mar 2007 07:26:30 -0000 1.2 *************** *** 1,4 **** SUBDIRS = \ ! corestest --- 1,4 ---- SUBDIRS = \ ! coretest |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:31
|
Update of /cvsroot/simspark/simspark/spark/plugin/filesystemstd In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/plugin/filesystemstd Added Files: filesystemstd.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) --- NEW FILE: filesystemstd.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="filesystemstd" ProjectGUID="{4A4E1738-60BC-4BB4-AFC8-92320D769D90}" RootNamespace="filesystemstd" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="2" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\win32;..\..\;..\..\utility" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_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="msvcrt-ruby18.lib" LinkIncremental="2" 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="2" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\win32;..\..\;..\..\utility" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_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="msvcrt-ruby18.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=".\export.cpp" > </File> <File RelativePath=".\filesystemstd.cpp" > </File> <File RelativePath=".\filesystemstd.h" > </File> <File RelativePath=".\filesystemstd_c.cpp" > </File> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:30
|
Update of /cvsroot/simspark/simspark/spark/oxygen/agentaspect In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/oxygen/agentaspect Added Files: jointeffector.h jointperceptor.h Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) --- NEW FILE: jointeffector.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Wed Nov 9 2005 Copyright (C) 2005 RoboCup Soccer Server 3D Maintenance Group 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. */ #ifndef JOINTEFFECTOR_H #define JOINTEFFECTOR_H #include <oxygen/agentaspect/effector.h> namespace oxygen { template<typename _JOINT> class JointEffector : public oxygen::Effector { public: JointEffector(const std::string& name) : Effector() { SetName(name); } virtual ~JointEffector() { } virtual void UpdateCached() { Effector::UpdateCached(); mJoint = make_shared(FindParentSupportingClass<_JOINT>()); if (mJoint.get() == 0) { GetLog()->Error() << "(" << GetClass()->GetName() << ") ERROR: found no Joint parent\n"; } } protected: /** setup the reference to the HingeJoint parent node */ virtual void OnLink() { Effector::OnLink(); UpdateCached(); } /** remove the reference to the HingeJoint parent node */ virtual void OnUnlink() { Effector::OnUnlink(); mJoint.reset(); } protected: /** cached reference to the joint */ boost::shared_ptr<_JOINT> mJoint; }; } // namespace oxygen #endif // JOINTEFFECTOR_H --- NEW FILE: jointperceptor.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Nov 8 2005 Copyright (C) 2005 RoboCup Soccer Server 3D Maintenance Group 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. */ #ifndef JOINTPERCEPTOR_H #define JOINTPERCEPTOR_H #include <oxygen/agentaspect/perceptor.h> namespace oxygen { template<typename _JOINT> class JointPerceptor : public oxygen::Perceptor { public: JointPerceptor() { } virtual ~JointPerceptor() { } virtual void UpdateCached() { Perceptor::UpdateCached(); mJoint = make_shared(FindParentSupportingClass<_JOINT>()); if (mJoint.get() == 0) { GetLog()->Error() << "(" << GetClass()->GetName() << ") ERROR: found no Joint parent\n"; } } protected: virtual void OnLink() { Perceptor::OnLink(); UpdateCached(); } virtual void OnUnlink() { Perceptor::OnUnlink(); mJoint.reset(); } protected: /** cached reference to the joint */ boost::shared_ptr<_JOINT> mJoint; }; } // namespace oxygen #endif //JOINTPERCEPTOR_H |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:30
|
Update of /cvsroot/simspark/simspark/spark/macosX In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/macosX Added Files: SDLMain.h SDLMain.m Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) --- NEW FILE: SDLMain.m --- /* SDLMain.m - main entry point for our Cocoa-ized SDL app Initial Version: Darrell Walisser <dwa...@pu...> Non-NIB-Code & other changes: Max Horn <ma...@qu...> Feel free to customize this file to suit your needs */ #import "SDL.h" #import "SDLMain.h" #import <sys/param.h> /* for MAXPATHLEN */ #import <unistd.h> /* For some reaon, Apple removed setAppleMenu from the headers in 10.4, but the method still is there and works. To avoid warnings, we declare it ourselves here. */ @interface NSApplication(SDL_Missing_Methods) - (void)setAppleMenu:(NSMenu *)menu; @end /* Use this flag to determine whether we use SDLMain.nib or not */ #define SDL_USE_NIB_FILE 0 /* Use this flag to determine whether we use CPS (docking) or not */ #define SDL_USE_CPS 1 #ifdef SDL_USE_CPS /* Portions of CPS.h */ typedef struct CPSProcessSerNum { UInt32 lo; UInt32 hi; } CPSProcessSerNum; extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); #endif /* SDL_USE_CPS */ static int gArgc; static char **gArgv; static BOOL gFinderLaunch; static BOOL gCalledAppMainline = FALSE; static NSString *getApplicationName(void) { NSDictionary *dict; NSString *appName = 0; /* Determine the application name */ dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); if (dict) appName = [dict objectForKey: @"CFBundleName"]; if (![appName length]) appName = [[NSProcessInfo processInfo] processName]; return appName; } #if SDL_USE_NIB_FILE /* A helper category for NSString */ @interface NSString (ReplaceSubString) - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; @end #endif @interface SDLApplication : NSApplication @end @implementation SDLApplication /* Invoked from the Quit menu item */ - (void)terminate:(id)sender { /* Post a SDL_QUIT event */ SDL_Event event; event.type = SDL_QUIT; SDL_PushEvent(&event); } @end /* The main class of the application, the application's delegate */ @implementation SDLMain /* Set the working directory to the .app's parent directory */ - (void) setupWorkingDirectory:(BOOL)shouldChdir { if (shouldChdir) { char parentdir[MAXPATHLEN]; CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) { assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ } CFRelease(url); CFRelease(url2); } } #if SDL_USE_NIB_FILE /* Fix menu to contain the real app name instead of "SDL App" */ - (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName { NSRange aRange; NSEnumerator *enumerator; NSMenuItem *menuItem; aRange = [[aMenu title] rangeOfString:@"SDL App"]; if (aRange.length != 0) [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; enumerator = [[aMenu itemArray] objectEnumerator]; while ((menuItem = [enumerator nextObject])) { aRange = [[menuItem title] rangeOfString:@"SDL App"]; if (aRange.length != 0) [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; if ([menuItem hasSubmenu]) [self fixMenu:[menuItem submenu] withAppName:appName]; } [ aMenu sizeToFit ]; } #else static void setApplicationMenu(void) { /* warning: this code is very odd */ NSMenu *appleMenu; NSMenuItem *menuItem; NSString *title; NSString *appName; appName = getApplicationName(); appleMenu = [[NSMenu alloc] initWithTitle:@""]; /* Add menu items */ title = [@"About " stringByAppendingString:appName]; [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; [appleMenu addItem:[NSMenuItem separatorItem]]; title = [@"Hide " stringByAppendingString:appName]; [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; [appleMenu addItem:[NSMenuItem separatorItem]]; title = [@"Quit " stringByAppendingString:appName]; [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; /* Put menu into the menubar */ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; [menuItem setSubmenu:appleMenu]; [[NSApp mainMenu] addItem:menuItem]; /* Tell the application object that this is now the application menu */ [NSApp setAppleMenu:appleMenu]; /* Finally give up our references to the objects */ [appleMenu release]; [menuItem release]; } /* Create a window menu */ static void setupWindowMenu(void) { NSMenu *windowMenu; NSMenuItem *windowMenuItem; NSMenuItem *menuItem; windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; /* "Minimize" item */ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; [windowMenu addItem:menuItem]; [menuItem release]; /* Put menu into the menubar */ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; [windowMenuItem setSubmenu:windowMenu]; [[NSApp mainMenu] addItem:windowMenuItem]; /* Tell the application object that this is now the window menu */ [NSApp setWindowsMenu:windowMenu]; /* Finally give up our references to the objects */ [windowMenu release]; [windowMenuItem release]; } /* Replacement for NSApplicationMain */ static void CustomApplicationMain (int argc, char **argv) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDLMain *sdlMain; /* Ensure the application object is initialised */ [SDLApplication sharedApplication]; #ifdef SDL_USE_CPS { CPSProcessSerNum PSN; /* Tell the dock about us */ if (!CPSGetCurrentProcess(&PSN)) if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) if (!CPSSetFrontProcess(&PSN)) [SDLApplication sharedApplication]; } #endif /* SDL_USE_CPS */ /* Set up the menubar */ [NSApp setMainMenu:[[NSMenu alloc] init]]; setApplicationMenu(); setupWindowMenu(); /* Create SDLMain and make it the app delegate */ sdlMain = [[SDLMain alloc] init]; [NSApp setDelegate:sdlMain]; /* Start the main event loop */ [NSApp run]; [sdlMain release]; [pool release]; } #endif /* * Catch document open requests...this lets us notice files when the app * was launched by double-clicking a document, or when a document was * dragged/dropped on the app's icon. You need to have a * CFBundleDocumentsType section in your Info.plist to get this message, * apparently. * * Files are added to gArgv, so to the app, they'll look like command line * arguments. Previously, apps launched from the finder had nothing but * an argv[0]. * * This message may be received multiple times to open several docs on launch. * * This message is ignored once the app's mainline has been called. */ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { const char *temparg; size_t arglen; char *arg; char **newargv; if (!gFinderLaunch) /* MacOS is passing command line args. */ return FALSE; if (gCalledAppMainline) /* app has started, ignore this document. */ return FALSE; temparg = [filename UTF8String]; arglen = SDL_strlen(temparg) + 1; arg = (char *) SDL_malloc(arglen); if (arg == NULL) return FALSE; newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); if (newargv == NULL) { SDL_free(arg); return FALSE; } gArgv = newargv; SDL_strlcpy(arg, temparg, arglen); gArgv[gArgc++] = arg; gArgv[gArgc] = NULL; return TRUE; } /* Called when the internal event loop has just started running */ - (void) applicationDidFinishLaunching: (NSNotification *) note { int status; /* Set the working directory to the .app's parent directory */ [self setupWorkingDirectory:gFinderLaunch]; #if SDL_USE_NIB_FILE /* Set the main menu to contain the real app name instead of "SDL App" */ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; #endif /* Hand off to main application code */ gCalledAppMainline = TRUE; status = SDL_main (gArgc, gArgv); /* We're done, thank you for playing */ exit(status); } @end @implementation NSString (ReplaceSubString) - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString { unsigned int bufferSize; unsigned int selfLen = [self length]; unsigned int aStringLen = [aString length]; unichar *buffer; NSRange localRange; NSString *result; bufferSize = selfLen + aStringLen - aRange.length; buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar)); /* Get first part into buffer */ localRange.location = 0; localRange.length = aRange.location; [self getCharacters:buffer range:localRange]; /* Get middle part into buffer */ localRange.location = 0; localRange.length = aStringLen; [aString getCharacters:(buffer+aRange.location) range:localRange]; /* Get last part into buffer */ localRange.location = aRange.location + aRange.length; localRange.length = selfLen - localRange.location; [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; /* Build output string */ result = [NSString stringWithCharacters:buffer length:bufferSize]; NSDeallocateMemoryPages(buffer, bufferSize); return result; } @end #ifdef main # undef main #endif /* Main entry point to executable - should *not* be SDL_main! */ int main (int argc, char **argv) { /* Copy the arguments into a global variable */ /* This is passed if we are launched by double-clicking */ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { gArgv = (char **) SDL_malloc(sizeof (char *) * 2); gArgv[0] = argv[0]; gArgv[1] = NULL; gArgc = 1; gFinderLaunch = YES; } else { int i; gArgc = argc; gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); for (i = 0; i <= argc; i++) gArgv[i] = argv[i]; gFinderLaunch = NO; } #if SDL_USE_NIB_FILE [SDLApplication poseAsClass:[NSApplication class]]; NSApplicationMain (argc, argv); #else CustomApplicationMain (argc, argv); #endif return 0; } --- NEW FILE: SDLMain.h --- /* SDLMain.m - main entry point for our Cocoa-ized SDL app Initial Version: Darrell Walisser <dwa...@pu...> Non-NIB-Code & other changes: Max Horn <ma...@qu...> Feel free to customize this file to suit your needs */ #import <Cocoa/Cocoa.h> @interface SDLMain : NSObject @end |
From: Oliver O. <fr...@us...> - 2007-03-15 07:26:28
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/simulations/parts/rsg Added Files: agent.rb boxspheres.rb jointtest.rb Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) --- NEW FILE: boxspheres.rb --- # create an arena to test simple boxes and spheres scene = get($scenePath) scene.importScene('rsg/boxspheres/simspark.rsg') --- NEW FILE: jointtest.rb --- # create an arena to test various joint bodies scene = get($scenePath) scene.importScene('rsg/jointtest/simspark.rsg') --- NEW FILE: agent.rb --- # # test the hoap2 robot # # hoap2 depends on the soccer bundle importBundle('soccer') scene = get($scenePath) scene.importScene('rsg/boxspheres/arena.rsg') |