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: Markus R. <rol...@us...> - 2007-04-15 10:36:44
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5559 Modified Files: rsgedit.vcproj sparkglcanvas.cpp sparkglrender.cpp sparkglrender.h Added Files: sparkcontext.cpp sparkcontext.h Log Message: - move selection state into SparkContext class Index: sparkglrender.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglrender.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sparkglrender.cpp 9 Apr 2007 17:41:01 -0000 1.3 --- sparkglrender.cpp 15 Apr 2007 10:31:04 -0000 1.4 *************** *** 27,30 **** --- 27,31 ---- #include <kerosin/materialserver/material.h> #include "simspark.h" + #include "sparkcontext.h" using namespace boost; *************** *** 97,114 **** void SparkGLRender::RenderSelection() { ! if (mSelectedNode.expired()) ! { ! return; ! } glDisable(GL_LIGHTING); glDisable(GL_DEPTH_TEST); - shared_ptr<RenderNode> node = mSelectedNode.lock(); - glPushMatrix(); glMultMatrixf(node->GetWorldTransform().m); ! shared_ptr<SingleMatNode> sMatNode = shared_dynamic_cast<SingleMatNode>(node); --- 98,116 ---- void SparkGLRender::RenderSelection() { ! shared_ptr<RenderNode> node = shared_dynamic_cast<RenderNode> ! (SparkContext::GetInstance().GetSelection().lock()); ! ! if (node.get() == 0) ! { ! return; ! } glDisable(GL_LIGHTING); glDisable(GL_DEPTH_TEST); glPushMatrix(); glMultMatrixf(node->GetWorldTransform().m); ! shared_ptr<SingleMatNode> sMatNode = shared_dynamic_cast<SingleMatNode>(node); *************** *** 131,142 **** glPopMatrix(); } - - void SparkGLRender::SetSelection(weak_ptr<RenderNode> selection) - { - mSelectedNode = selection; - } - - void SparkGLRender::ResetSelection() - { - mSelectedNode.reset(); - } --- 133,134 ---- Index: sparkglcanvas.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sparkglcanvas.cpp 9 Apr 2007 17:42:50 -0000 1.9 --- sparkglcanvas.cpp 15 Apr 2007 10:31:04 -0000 1.10 *************** *** 23,26 **** --- 23,27 ---- #include "simspark.h" + #include "sparkcontext.h" //! wxWidgets and zeitgeist both use a 'DECLARE_CLASS' macro *************** *** 110,114 **** void SparkGLCanvas::ResetSelection(wxDC& dc) { ! mRender.ResetSelection(); bool swapBuffers = true; --- 111,115 ---- void SparkGLCanvas::ResetSelection(wxDC& dc) { ! SparkContext::GetInstance().ResetSelection(); bool swapBuffers = true; *************** *** 150,154 **** } ! mRender.SetSelection(pickedNode); } --- 151,155 ---- } ! SparkContext::GetInstance().SetSelection(pickedNode); } Index: rsgedit.vcproj =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rsgedit.vcproj 15 Mar 2007 07:26:24 -0000 1.2 --- rsgedit.vcproj 15 Apr 2007 10:31:04 -0000 1.3 *************** *** 264,267 **** --- 264,275 ---- </File> <File + RelativePath=".\sparkcontext.cpp" + > + </File> + <File + RelativePath=".\sparkcontext.h" + > + </File> + <File RelativePath=".\sparkglcanvas.cpp" > --- NEW FILE: sparkcontext.cpp --- /* -*- 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: sparkcontext.cpp,v 1.1 2007/04/15 10:31:09 rollmark 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. */ #include "sparkcontext.h" using namespace oxygen; using namespace boost; SparkContext::SparkContext() { } SparkContext::~SparkContext() { } SparkContext& SparkContext::GetInstance() { static SparkContext theInstance; return theInstance; } void SparkContext::SetSelection(weak_ptr<BaseNode> node) { mSelectedNode = node; } boost::weak_ptr<BaseNode> SparkContext::GetSelection() const { return mSelectedNode; } void SparkContext::ResetSelection() { mSelectedNode.reset(); } --- NEW FILE: sparkcontext.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: sparkcontext.h,v 1.1 2007/04/15 10:31:11 rollmark 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. */ #ifndef SPARKCONTEXT_H__ #define SPARKCONTEXT_H__ #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> namespace oxygen { class BaseNode; } class SparkContext { public: static SparkContext& GetInstance(); ~SparkContext(); void SetSelection(boost::weak_ptr<oxygen::BaseNode> node); boost::weak_ptr<oxygen::BaseNode> GetSelection() const; void ResetSelection(); private: SparkContext(); protected: boost::weak_ptr<oxygen::BaseNode> mSelectedNode; }; #endif // SPARKCONTEXT_H__ Index: sparkglrender.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglrender.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sparkglrender.h 9 Apr 2007 17:41:01 -0000 1.4 --- sparkglrender.h 15 Apr 2007 10:31:05 -0000 1.5 *************** *** 39,43 **** { class RenderServer; - class RenderNode; } --- 39,42 ---- *************** *** 51,57 **** void Render(int width, int height); - void SetSelection(boost::weak_ptr<kerosin::RenderNode> selection); - void ResetSelection(); - protected: void RenderSelection(); --- 50,53 ---- *************** *** 62,66 **** boost::shared_ptr<oxygen::SceneServer> mSceneServer; boost::shared_ptr<kerosin::RenderServer> mRenderServer; - boost::weak_ptr<kerosin::RenderNode> mSelectedNode; }; --- 58,61 ---- |
From: Markus R. <rol...@us...> - 2007-04-09 17:43:11
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17658 Modified Files: mainframe.cpp Log Message: - adapted to changed Render() method signature Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mainframe.cpp 1 Apr 2007 16:10:13 -0000 1.12 --- mainframe.cpp 9 Apr 2007 17:43:09 -0000 1.13 *************** *** 403,407 **** wxClientDC dc(this); ! mCanvas->Render(dc); // recheck and update as soon as posssible --- 403,409 ---- wxClientDC dc(this); ! ! bool swapBuffers = true; ! mCanvas->Render(dc, swapBuffers); // recheck and update as soon as posssible *************** *** 475,479 **** wxClientDC dc(this); ! mCanvas->Render(dc); } --- 477,483 ---- wxClientDC dc(this); ! ! bool swapBuffers = true; ! mCanvas->Render(dc, swapBuffers); } |
From: Markus R. <rol...@us...> - 2007-04-09 17:42:53
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17290 Modified Files: sparkglcanvas.cpp sparkglcanvas.h Log Message: - added additional 'swapBuffers' parameter to the Render() method - don't swap redner buffers when picking objects to avoid flicker - set selected object in mRender Index: sparkglcanvas.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sparkglcanvas.h 9 Apr 2007 17:04:34 -0000 1.6 --- sparkglcanvas.h 9 Apr 2007 17:42:50 -0000 1.7 *************** *** 66,71 **** void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); ! void Render(wxDC& dc); void Reset(); void Pick(wxDC& dc); --- 66,73 ---- void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); ! void Render(wxDC& dc, bool swapBuffers); void Reset(); + + void ResetSelection(wxDC& dc); void Pick(wxDC& dc); Index: sparkglcanvas.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sparkglcanvas.cpp 9 Apr 2007 17:04:33 -0000 1.8 --- sparkglcanvas.cpp 9 Apr 2007 17:42:50 -0000 1.9 *************** *** 81,85 **** } ! void SparkGLCanvas::Render(wxDC& dc) { #ifndef __WXMOTIF__ --- 81,85 ---- } ! void SparkGLCanvas::Render(wxDC& dc, bool swapBuffers) { #ifndef __WXMOTIF__ *************** *** 101,105 **** glFlush(); ! SwapBuffers(); } --- 101,117 ---- glFlush(); ! ! if (swapBuffers) ! { ! SwapBuffers(); ! } ! } ! ! void SparkGLCanvas::ResetSelection(wxDC& dc) ! { ! mRender.ResetSelection(); ! ! bool swapBuffers = true; ! Render(dc, swapBuffers); } *************** *** 122,126 **** mRenderServer->EnablePicking(true, Vector2f(ptMouse.x, ptMouse.y), pickRange); ! Render(dc); mRenderServer->DisablePicking(); --- 134,139 ---- mRenderServer->EnablePicking(true, Vector2f(ptMouse.x, ptMouse.y), pickRange); ! bool swapBuffers = false; ! Render(dc, swapBuffers); mRenderServer->DisablePicking(); *************** *** 136,139 **** --- 149,154 ---- << "(SparkGLCanvas) SparkGLCanvas::Pick picked " << pickedNode.lock()->GetFullPath() << std::endl; } + + mRender.SetSelection(pickedNode); } *************** *** 141,145 **** { wxPaintDC dc(this); ! Render(dc); } --- 156,162 ---- { wxPaintDC dc(this); ! ! bool swapBuffers = true; ! Render(dc, swapBuffers); } *************** *** 200,203 **** --- 217,231 ---- { event.Skip(); + + // handle rsgedit specific keys + if ( + (event.GetModifiers() == 0) && + (event.GetKeyCode() == WXK_ESCAPE) + ) + { + wxClientDC dc(this); + ResetSelection(dc); + } + AddInput(wxInput(event,false)); } *************** *** 217,221 **** wxClientDC dc(this); Pick(dc); ! Render(dc); } --- 245,251 ---- wxClientDC dc(this); Pick(dc); ! ! bool swapBuffers = true; ! Render(dc, swapBuffers); } |
From: Markus R. <rol...@us...> - 2007-04-09 17:41:06
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16521 Modified Files: sparkglrender.cpp sparkglrender.h Log Message: - added member mSelectedObject - added methods RenderSelection(), SetSelection() and ResetSelection() - the selected object is highlighted using 'matSelection' Index: sparkglrender.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglrender.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sparkglrender.h 15 Mar 2007 07:26:24 -0000 1.3 --- sparkglrender.h 9 Apr 2007 17:41:01 -0000 1.4 *************** *** 26,29 **** --- 26,30 ---- #include <boost/shared_ptr.hpp> + #include <boost/weak_ptr.hpp> class SimSpark; *************** *** 38,41 **** --- 39,43 ---- { class RenderServer; + class RenderNode; } *************** *** 49,52 **** --- 51,60 ---- void Render(int width, int height); + void SetSelection(boost::weak_ptr<kerosin::RenderNode> selection); + void ResetSelection(); + + protected: + void RenderSelection(); + protected: boost::shared_ptr<SimSpark> mSpark; *************** *** 54,57 **** --- 62,66 ---- boost::shared_ptr<oxygen::SceneServer> mSceneServer; boost::shared_ptr<kerosin::RenderServer> mRenderServer; + boost::weak_ptr<kerosin::RenderNode> mSelectedNode; }; Index: sparkglrender.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglrender.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sparkglrender.cpp 2 Jan 2006 20:28:49 -0000 1.2 --- sparkglrender.cpp 9 Apr 2007 17:41:01 -0000 1.3 *************** *** 23,26 **** --- 23,29 ---- #include <oxygen/sceneserver/sceneserver.h> #include <kerosin/renderserver/renderserver.h> + #include <kerosin/renderserver/rendernode.h> + #include <kerosin/sceneserver/singlematnode.h> + #include <kerosin/materialserver/material.h> #include "simspark.h" *************** *** 89,91 **** --- 92,142 ---- mCamera->SetViewport(0,0,width,height); mRenderServer->Render(); + RenderSelection(); + } + + void SparkGLRender::RenderSelection() + { + if (mSelectedNode.expired()) + { + return; + } + + glDisable(GL_LIGHTING); + glDisable(GL_DEPTH_TEST); + + shared_ptr<RenderNode> node = mSelectedNode.lock(); + + glPushMatrix(); + glMultMatrixf(node->GetWorldTransform().m); + + shared_ptr<SingleMatNode> sMatNode = + shared_dynamic_cast<SingleMatNode>(node); + + if (sMatNode.get() != 0) + { + shared_ptr<Material> material = sMatNode->GetMaterial(); + sMatNode->SetMaterial("matSelected"); + + node->RenderInternal(); + + if (material.get() != 0) + { + sMatNode->SetMaterial(material->GetName()); + } + } else + { + node->RenderInternal(); + } + + glPopMatrix(); + } + + void SparkGLRender::SetSelection(weak_ptr<RenderNode> selection) + { + mSelectedNode = selection; + } + + void SparkGLRender::ResetSelection() + { + mSelectedNode.reset(); } |
From: Markus R. <rol...@us...> - 2007-04-09 17:39:44
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16073 Modified Files: rsgedit.rb Log Message: - added material 'matSelected' that is used to highlight the selected object Index: rsgedit.rb =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rsgedit.rb 15 Mar 2007 07:26:24 -0000 1.5 --- rsgedit.rb 9 Apr 2007 17:39:38 -0000 1.6 *************** *** 64,65 **** --- 64,67 ---- material.setDiffuse(0.1,0.1,0.1,1.0) + material = new('kerosin/MaterialSolid', $serverPath+'material/matSelected'); + material.setDiffuse(0.9,0.9,1.0,0.9) |
From: Markus R. <rol...@us...> - 2007-04-09 17:33:57
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1814 Modified Files: sparkglcanvas.cpp sparkglcanvas.h Log Message: - added left double click handler OnLeftDClick() - added method Pick() that uses the RenderServer to determine the closest object to the current mouse pointer position Index: sparkglcanvas.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sparkglcanvas.h 1 Apr 2007 15:48:33 -0000 1.5 --- sparkglcanvas.h 9 Apr 2007 17:04:34 -0000 1.6 *************** *** 32,35 **** --- 32,36 ---- { class InputSystem; + class RenderServer; } *************** *** 56,59 **** --- 57,61 ---- void OnKeyUp(wxKeyEvent& event); void OnLeftDown(wxMouseEvent& event); + void OnLeftDClick(wxMouseEvent& event); void OnLeftUp(wxMouseEvent& event); void OnMiddleDown(wxMouseEvent& event); *************** *** 66,69 **** --- 68,72 ---- void Render(wxDC& dc); void Reset(); + void Pick(wxDC& dc); protected: *************** *** 75,78 **** --- 78,82 ---- SparkGLRender mRender; boost::shared_ptr<kerosin::InputSystem> mInputSystem; + boost::shared_ptr<kerosin::RenderServer> mRenderServer; bool mMouseCaptured; Index: sparkglcanvas.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sparkglcanvas.cpp 1 Apr 2007 15:48:33 -0000 1.7 --- sparkglcanvas.cpp 9 Apr 2007 17:04:33 -0000 1.8 *************** *** 30,33 **** --- 30,35 ---- #include <kerosin/inputserver/inputserver.h> #include <kerosin/inputserver/inputsystem.h> + #include <kerosin/renderserver/renderserver.h> + #include <kerosin/renderserver/rendernode.h> BEGIN_EVENT_TABLE(SparkGLCanvas, wxGLCanvas) *************** *** 40,43 **** --- 42,46 ---- EVT_LEFT_DOWN(SparkGLCanvas::OnLeftDown) EVT_LEFT_UP(SparkGLCanvas::OnLeftUp) + EVT_LEFT_DCLICK(SparkGLCanvas::OnLeftDClick) EVT_MIDDLE_DOWN(SparkGLCanvas::OnMiddleDown) EVT_MIDDLE_UP(SparkGLCanvas::OnMiddleUp) *************** *** 50,53 **** --- 53,57 ---- using namespace boost; using namespace kerosin; + using namespace salt; SparkGLCanvas::SparkGLCanvas(wxWindow *parent, wxWindowID id, *************** *** 100,103 **** --- 104,141 ---- } + void SparkGLCanvas::Pick(wxDC& dc) + { + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if ( + (spark.get() == 0) || + (mRenderServer.get() == 0) + ) + { + assert(false); + return; + } + + wxPoint ptMouse = wxGetMousePosition(); + ScreenToClient(&ptMouse.x, &ptMouse.y); + + double pickRange = 5.0; + mRenderServer->EnablePicking(true, Vector2f(ptMouse.x, ptMouse.y), pickRange); + + Render(dc); + + mRenderServer->DisablePicking(); + + weak_ptr<RenderNode> pickedNode = mRenderServer->GetPickedNode(); + if (pickedNode.expired()) + { + spark->GetLog()->Normal() + << "(SparkGLCanvas) SparkGLCanvas::Pick no node picked\n"; + } else + { + spark->GetLog()->Normal() + << "(SparkGLCanvas) SparkGLCanvas::Pick picked " << pickedNode.lock()->GetFullPath() << std::endl; + } + } + void SparkGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) ) { *************** *** 140,143 **** --- 178,190 ---- } + mRenderServer = shared_dynamic_cast<RenderServer> + (spark->GetCore()->Get("/sys/server/render")); + + if (mRenderServer.get() == 0) + { + spark->GetLog()->Error() + << "(SparkGLCanvas) ERROR: RenderServer not found\n"; + } + mRender.Init(spark); return true; *************** *** 166,169 **** --- 213,223 ---- } + void SparkGLCanvas::OnLeftDClick(wxMouseEvent& event) + { + wxClientDC dc(this); + Pick(dc); + Render(dc); + } + void SparkGLCanvas::OnLeftUp(wxMouseEvent& event) { |
From: Markus R. <rol...@us...> - 2007-04-09 17:33:56
|
Update of /cvsroot/simspark/simspark/spark/kerosin/renderserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv950 Modified Files: renderserver.cpp renderserver.h Log Message: - added support for OpenGL object picking. When enabled the RenderServer determines the closest object to the given OpenGL window coordinates. This allows for object selection with the mouse - added public methods EnablePicking(), DisablePicking() and GetPickedNode() Index: renderserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/renderserver/renderserver.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** renderserver.h 15 Mar 2007 07:26:26 -0000 1.3 --- renderserver.h 9 Apr 2007 17:02:25 -0000 1.4 *************** *** 44,47 **** --- 44,48 ---- #include <oxygen/sceneserver/sceneserver.h> #include <kerosin/openglserver/glbase.h> + #include <kerosin/openglserver/openglwrapper.h> namespace oxygen *************** *** 56,59 **** --- 57,61 ---- { class OpenGLServer; + class RenderNode; class RenderServer : public zeitgeist::Leaf *************** *** 63,66 **** --- 65,71 ---- // public: + typedef std::map<GLuint, boost::weak_ptr<kerosin::RenderNode> > TGLNameMap; + + public: RenderServer(); ~RenderServer(); *************** *** 81,84 **** --- 86,98 ---- virtual void UpdateCached(); + /** If enabled the next render pass is used to pick an object */ + void EnablePicking(bool enable, const salt::Vector2f& pickAt, const double pickRange); + + /** Disables object picking for the next render pass */ + void DisablePicking(); + + /** Returns the last picked node */ + boost::weak_ptr<RenderNode> GetPickedNode() const; + protected: /** get the active scene node from the sceneServer */ *************** *** 100,103 **** --- 114,125 ---- void BindCamera(boost::shared_ptr<oxygen::Camera>& camera); + /** clears last intermediate picking state and prepares OpenGL + picking + */ + void PreparePicking(); + + /** processes the collected picking information */ + void ProcessPicks(); + // // Members *************** *** 110,130 **** CachedPath<oxygen::SceneServer> mSceneServer; RGBA mAmbientColor; - }; - - DECLARE_CLASS(RenderServer); - - } //namespace kerosin - - #endif // KEROSIN_RENDERSERVER_H --- 132,162 ---- CachedPath<oxygen::SceneServer> mSceneServer; + /** the OpenGL ambient clear color */ RGBA mAmbientColor; + /** OpenGL name to RenderNode map for object picking */ + TGLNameMap mNameMap; + /** counter to assign OpenGL names to RenderNodes while picking */ + GLuint mNextName; + /** true, iff picking is enabled */ + bool mEnablePicking; + /** the picking position in OpenGL window coordinates */ + salt::Vector2f mPickAt; + /** the pick radius around mPickAt */ + double mPickRange; + /** the picked result node */ + boost::weak_ptr<RenderNode> mPickedNode; + }; + DECLARE_CLASS(RenderServer); + } //namespace kerosin + #endif // KEROSIN_RENDERSERVER_H Index: renderserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/renderserver/renderserver.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** renderserver.cpp 15 Mar 2007 07:26:26 -0000 1.3 --- renderserver.cpp 9 Apr 2007 17:02:25 -0000 1.4 *************** *** 36,42 **** --- 36,49 ---- using namespace zeitgeist; + /** OpenGL picking result buffer */ + static GLuint gSelectBuffer[4096]; + RenderServer::RenderServer() : Leaf() { mAmbientColor = RGBA(0.0,0.0,0.0,0.0); + mEnablePicking = false; + mPickAt = Vector2f(0.0,0.0); + mPickRange = 10.0; + mNextName = 1; } *************** *** 86,91 **** --- 93,109 ---- void + RenderServer::PreparePicking() + { + mNameMap.clear(); + mNextName = 1; + glSelectBuffer(sizeof(gSelectBuffer), gSelectBuffer); + mPickedNode.reset(); + } + + void RenderServer::Render() { + PreparePicking(); + if (! GetActiveScene()) { *************** *** 153,156 **** --- 171,235 ---- // reset GL lights glDisable(GL_LIGHTING); + + if (mEnablePicking) + { + ProcessPicks(); + } + } + + void + RenderServer::ProcessPicks() + { + // restoring the original projection matrix + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glFlush(); + + // returning to normal rendering mode + int hits = glRenderMode(GL_RENDER); + + // if there are hits process them + GLuint numberOfNames = 0; + GLuint minZ = 0xffffffff; + GLuint *ptrNames = 0; + + GLuint* ptr = gSelectBuffer; + + for (int i = 0; i < hits; i++) + { + // read number of stored names in the current record + GLuint names = (*ptr); + ptr++; + + if ((*ptr) < minZ) + { + numberOfNames = names; + minZ = *ptr; + ptrNames = ptr+2; + } + + ptr += names+2; + } + + mPickedNode.reset(); + for (;;) + { + if (ptrNames == 0) + { + break; + } + + TGLNameMap::const_iterator iter = mNameMap.find(*ptrNames); + if (iter == mNameMap.end()) + { + break; + } + + mPickedNode = (*iter).second; + break; + } + + mNameMap.clear(); } *************** *** 163,170 **** --- 242,264 ---- { glPushMatrix(); + + if (mEnablePicking) + { + // assign an OpenGL name to the RenderNode + GLuint name = (mNextName++); + mNameMap[name] = renderNode; + glPushName(name); + } + glMultMatrixf(node->GetWorldTransform().m); renderNode->RenderInternal(); + if (mEnablePicking) + { + // pop name from OpenGL name stack + glPopName(); + } + glPopMatrix(); } *************** *** 199,211 **** glDepthRange(0, 1); ! // setup the projection matrix ! glMatrixMode(GL_PROJECTION); ! glLoadIdentity(); ! glMultMatrixf(camera->GetProjectionTransform().m); ! // initialize the modelview stack ! glMatrixMode(GL_MODELVIEW); ! glLoadIdentity(); ! glMultMatrixf(camera->GetViewTransform().m); } --- 293,325 ---- glDepthRange(0, 1); ! if (mEnablePicking) ! { ! glRenderMode(GL_SELECT); ! GLint viewport[4]; ! glGetIntegerv(GL_VIEWPORT, viewport); ! ! glMatrixMode(GL_PROJECTION); ! glPushMatrix(); ! glLoadIdentity(); ! ! gluPickMatrix(mPickAt[0],viewport[3]-mPickAt[1],mPickRange,mPickRange,viewport); ! ! glMultMatrixf(camera->GetProjectionTransform().m); ! glMatrixMode(GL_MODELVIEW); ! ! glInitNames(); ! } else ! { ! // setup the projection matrix ! glMatrixMode(GL_PROJECTION); ! glLoadIdentity(); ! glMultMatrixf(camera->GetProjectionTransform().m); ! ! // initialize the modelview stack ! glMatrixMode(GL_MODELVIEW); ! glLoadIdentity(); ! glMultMatrixf(camera->GetViewTransform().m); ! } } *************** *** 219,220 **** --- 333,351 ---- mActiveScene.reset(); } + + void RenderServer::DisablePicking() + { + mEnablePicking = false; + } + + void RenderServer::EnablePicking(bool enable, const Vector2f& pickAt, const double pickRange) + { + mEnablePicking = enable; + mPickAt = pickAt; + mPickRange = pickRange; + } + + weak_ptr<RenderNode> RenderServer::GetPickedNode() const + { + return mPickedNode; + } |
From: Markus R. <rol...@us...> - 2007-04-09 17:13:52
|
Update of /cvsroot/simspark/simspark/spark/kerosin/openglserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5718 Modified Files: openglwrapper.h Log Message: - added missing #include, needed for OpenGL picking Index: openglwrapper.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/openglserver/openglwrapper.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** openglwrapper.h 15 Mar 2007 07:26:26 -0000 1.2 --- openglwrapper.h 9 Apr 2007 17:13:44 -0000 1.3 *************** *** 36,39 **** --- 36,40 ---- #include <GL/gl.h> #include <GL/glext.h> + #include <GL/glu.h> #endif |
From: Oliver O. <fr...@us...> - 2007-04-05 04:18:04
|
Update of /cvsroot/simspark/simspark/spark/oxygen In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20887 Modified Files: Tag: projectx Makefile.am Log Message: added meshexporter Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/Makefile.am,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.2.2.1 diff -C2 -d -r1.3.2.2 -r1.3.2.2.2.1 *** Makefile.am 28 Feb 2007 07:59:34 -0000 1.3.2.2 --- Makefile.am 5 Apr 2007 04:18:00 -0000 1.3.2.2.2.1 *************** *** 149,152 **** --- 149,153 ---- geometryserver/geometryserver.cpp \ geometryserver/geometryserver_c.cpp \ + geometryserver/meshexporter_c.cpp \ geometryserver/meshimporter.cpp \ geometryserver/meshimporter_c.cpp \ *************** *** 222,225 **** --- 223,227 ---- simulationserver/netbuffer.h \ geometryserver/geometryserver.h \ + geometryserver/meshexporter.h \ geometryserver/meshimporter.h \ geometryserver/stdmeshimporter.h \ |
From: Oliver O. <fr...@us...> - 2007-04-05 04:17:03
|
Update of /cvsroot/simspark/simspark/spark/oxygen In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20497 Modified Files: Tag: projectx oxygen.cpp Log Message: added meshexporter Index: oxygen.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/oxygen.cpp,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** oxygen.cpp 14 Apr 2006 16:27:26 -0000 1.2 --- oxygen.cpp 5 Apr 2007 04:16:57 -0000 1.2.4.1 *************** *** 46,49 **** --- 46,50 ---- // geometry zg.GetCore()->RegisterClassObject(new CLASS(GeometryServer), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(MeshExporter), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(MeshImporter), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(StdMeshImporter), "oxygen/"); |
From: Oliver O. <fr...@us...> - 2007-04-05 04:16:08
|
Update of /cvsroot/simspark/simspark/spark/oxygen In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20234 Modified Files: Tag: projectx oxygen.h Log Message: - added meshexporter Index: oxygen.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/oxygen.h,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** oxygen.h 14 Apr 2006 16:27:26 -0000 1.2 --- oxygen.h 5 Apr 2007 04:16:05 -0000 1.2.4.1 *************** *** 75,78 **** --- 75,79 ---- #include "geometryserver/geometryserver.h" + #include "geometryserver/meshexporter.h" #include "geometryserver/meshimporter.h" #include "geometryserver/stdmeshimporter.h" |
From: Oliver O. <fr...@us...> - 2007-04-05 04:14:18
|
Update of /cvsroot/simspark/simspark/spark/oxygen/geometryserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19659 Modified Files: Tag: projectx geometryserver_c.cpp Log Message: added support for meshexporter Index: geometryserver_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/geometryserver/geometryserver_c.cpp,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** geometryserver_c.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- geometryserver_c.cpp 5 Apr 2007 04:14:15 -0000 1.1.4.1 *************** *** 34,48 **** (! in.GetValue(in.begin(),inImporterName)) ) ! { ! return false; ! } return obj->InitMeshImporter(inImporterName); } ! void CLASS(GeometryServer)::DefineClass() { DEFINE_BASECLASS(zeitgeist/Node); DEFINE_FUNCTION(initMeshImporter); } --- 34,65 ---- (! in.GetValue(in.begin(),inImporterName)) ) ! { ! return false; ! } return obj->InitMeshImporter(inImporterName); } ! FUNCTION(GeometryServer,initMeshExporter) ! { ! string inExporterName; ! ! if ( ! (in.GetSize() != 1) || ! (! in.GetValue(in.begin(),inExporterName)) ! ) ! { ! return false; ! } ! ! return obj->InitMeshExporter(inExporterName); ! } ! ! void ! CLASS(GeometryServer)::DefineClass() { DEFINE_BASECLASS(zeitgeist/Node); DEFINE_FUNCTION(initMeshImporter); + DEFINE_FUNCTION(initMeshExporter); } |
From: Oliver O. <fr...@us...> - 2007-04-05 04:13:10
|
Update of /cvsroot/simspark/simspark/spark/oxygen/geometryserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19254 Modified Files: Tag: projectx geometryserver.cpp Log Message: added support for meshexporter Index: geometryserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/geometryserver/geometryserver.cpp,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** geometryserver.cpp 30 Mar 2007 03:19:05 -0000 1.2.4.1 --- geometryserver.cpp 5 Apr 2007 04:13:06 -0000 1.2.4.2 *************** *** 22,25 **** --- 22,26 ---- #include "geometryserver.h" #include "meshimporter.h" + #include "meshexporter.h" #include <zeitgeist/logserver/logserver.h> *************** *** 38,50 **** } ! void GeometryServer::OnLink() { if (mChildren.size() == 0) ! { ! InitMeshImporter("oxygen/StdMeshImporter"); ! } } ! bool GeometryServer::InitMeshImporter(const string& importerName) { shared_ptr<MeshImporter> importer --- 39,53 ---- } ! void ! GeometryServer::OnLink() { if (mChildren.size() == 0) ! { ! InitMeshImporter("oxygen/StdMeshImporter"); ! } } ! bool ! GeometryServer::InitMeshImporter(const string& importerName) { shared_ptr<MeshImporter> importer *************** *** 52,60 **** if (importer.get() == 0) ! { ! GetLog()->Error() << "(GeometryServer) ERROR: " ! << "unable to create '" << importerName << "'\n"; ! return false; ! } importer->SetName(importerName); --- 55,63 ---- if (importer.get() == 0) ! { ! GetLog()->Error() << "(GeometryServer) ERROR: " ! << "unable to create '" << importerName << "'\n"; ! return false; ! } importer->SetName(importerName); *************** *** 68,76 **** shared_ptr<TriMesh> ! GeometryServer::GetMesh(const string& name, const::ParameterList& parameter) { // try a direct match string meshName = name; ! TMeshMap::iterator meshIter = mMeshMap.find(meshName); if (meshIter != mMeshMap.end()) --- 71,79 ---- shared_ptr<TriMesh> ! GeometryServer::GetMesh(const string& name, const::ParameterList& parameter) { // try a direct match string meshName = name; ! TMeshMap::const_iterator meshIter = mMeshMap.find(meshName); if (meshIter != mMeshMap.end()) *************** *** 169,173 **** } ! TMeshMap::iterator iter = mMeshMap.find(name); if (iter != mMeshMap.end()) { --- 172,176 ---- } ! TMeshMap::const_iterator iter = mMeshMap.find(name); if (iter != mMeshMap.end()) { *************** *** 177,182 **** --- 180,214 ---- mMeshMap[name] = mesh; GetLog()->Normal() << "(GeometryServer) mesh " << name << " registered\n"; + + TLeafList exporters; + ListChildrenSupportingClass<MeshExporter>(exporters); + + for (TLeafList::const_iterator bi = exporters.begin(); bi != exporters.end(); ++bi) + { + GetLog()->Normal() << "(GeometryServer) additionally registered mesh " + << name << " via MeshExporter '" << (*bi)->GetName() << "'\n"; + shared_ptr<MeshExporter> mb = shared_static_cast<MeshExporter>(*bi); + mb->RegisterMesh(mesh); + } } + bool + GeometryServer::InitMeshExporter(const string& name) + { + shared_ptr<MeshExporter> exporter + = shared_dynamic_cast<MeshExporter>(GetCore()->New(name)); + + if (exporter.get() == 0) + { + GetLog()->Error() << "(GeometryServer) ERROR: " + << "unable to create MeshExporter '" << name << "'\n"; + return false; + } + exporter->SetName(name); + AddChildReference(exporter); + GetLog()->Normal() << "(GeometryServer) MeshExporter '" << name << "' registered\n"; + + return true; + } |
From: Oliver O. <fr...@us...> - 2007-04-05 04:10:41
|
Update of /cvsroot/simspark/simspark/spark/oxygen/geometryserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18361 Added Files: Tag: projectx meshexporter_c.cpp Log Message: added abstract meshexporter --- NEW FILE: meshexporter_c.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of simspark Tue May 9 2006 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2007 RoboCup Soccer Server 3D Maintenance Group $Id: meshexporter_c.cpp,v 1.1.2.1 2007/04/05 04:10:38 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. MeshExporter NOTE: This class serves as an (abstract) exporter, to register meshes with other graphic engines (possibly also for exporting) HISTORY: 30/03/07 - OO - Initial version */ #include "meshexporter.h" using namespace oxygen; void CLASS(MeshExporter)::DefineClass() { DEFINE_BASECLASS(zeitgeist/Leaf); } |
From: Oliver O. <fr...@us...> - 2007-04-05 04:09:25
|
Update of /cvsroot/simspark/simspark/spark/oxygen/geometryserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17885 Modified Files: Tag: projectx geometryserver.h Log Message: - added support for meshexporter Index: geometryserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/geometryserver/geometryserver.h,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** geometryserver.h 30 Mar 2007 03:18:16 -0000 1.2.4.1 --- geometryserver.h 5 Apr 2007 04:09:22 -0000 1.2.4.2 *************** *** 25,28 **** --- 25,29 ---- #include <zeitgeist/class.h> #include <zeitgeist/node.h> + #include "meshexporter.h" #include "trimesh.h" *************** *** 52,57 **** returns a cached reference */ ! boost::shared_ptr<TriMesh> GetMesh ! (const std::string& name, const zeitgeist::ParameterList& parameter); /** register a trimesh to the GeometryServer. The name of the mesh --- 53,58 ---- returns a cached reference */ ! boost::shared_ptr<TriMesh> ! GetMesh (const std::string& name, const zeitgeist::ParameterList& parameter); /** register a trimesh to the GeometryServer. The name of the mesh *************** *** 60,63 **** --- 61,74 ---- void RegisterMesh(boost::shared_ptr<TriMesh> mesh); + /** Create an instance of a mesh bridge and register it to the GeometryServer. + A MeshExporter is a class that takes care to additionally register/export + meshes registered at the GeometryServer at another class (potentially + external to spark). This has to be done only when spark/kerosin + rendering alone is not enough. + \param name name of the MeshBridge class name + \returns true if successful + */ + bool InitMeshExporter(const std::string& name); + protected: /** registers the standard mesh importer */ |
From: Oliver O. <fr...@us...> - 2007-04-05 04:06:11
|
Update of /cvsroot/simspark/simspark/spark/oxygen/geometryserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16328 Added Files: Tag: projectx meshexporter.h Log Message: added abstract meshexporter --- NEW FILE: meshexporter.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of simspark Tue May 9 2006 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2007 RoboCup Soccer Server 3D Maintenance Group $Id: meshexporter.h,v 1.1.2.1 2007/04/05 04:06:08 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. MeshExporter NOTE: This class serves as an (abstract) exporter to register meshes with other graphic engines (possibly also for exporting). HISTORY: 30/03/07 - OO - Initial version */ #ifndef OXYGEN_MESHEXPORTER_H #define OXYGEN_MESHEXPORTER_H #include <zeitgeist/class.h> #include <zeitgeist/node.h> #include "trimesh.h" namespace oxygen { /** \class MeshExporter. This class can be used to implement custom render server, which needs to be informed about the meshes used for a specific simulation. By registering a MeshExporter implementation to the GeometryServer, meshes can be registered (exported) to another class. */ class MeshExporter : public zeitgeist::Leaf { public: virtual ~MeshExporter() {} /** Register / Export the given mesh. \param mesh the mesh to register / export. */ virtual void RegisterMesh(boost::shared_ptr<TriMesh> mesh) = 0; }; DECLARE_ABSTRACTCLASS(MeshExporter); } // end namespace oxygen #endif // OXYGEN_MESHEXPORTER |
From: Oliver O. <fr...@us...> - 2007-04-05 03:54:05
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10877 Modified Files: Tag: projectx spark.rb Log Message: removed second GeometryServer Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.5.2.4 retrieving revision 1.5.2.4.2.1 diff -C2 -d -r1.5.2.4 -r1.5.2.4.2.1 *** spark.rb 28 Feb 2007 20:39:01 -0000 1.5.2.4 --- spark.rb 5 Apr 2007 03:53:58 -0000 1.5.2.4.2.1 *************** *** 340,344 **** # # setup the GeometryServer ! geometryServer = new('oxygen/GeometryServer', $serverPath+'geometry') # use the ruby scene importer to import scenes --- 340,344 ---- # # setup the GeometryServer ! # geometryServer = new('oxygen/GeometryServer', $serverPath+'geometry') # use the ruby scene importer to import scenes |
From: Markus R. <rol...@us...> - 2007-04-01 16:10:21
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13728 Modified Files: mainframe.cpp mainframe.h Log Message: - show the current simulation state and time in the toolbar Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mainframe.h 31 Mar 2007 13:28:50 -0000 1.9 --- mainframe.h 1 Apr 2007 16:10:13 -0000 1.10 *************** *** 123,126 **** --- 123,129 ---- bool OpenSimulation(const wxString& fname); + /** Print the current simulation state on the toolbar */ + void PrintSimState(); + void InitTreeNodeProperties(); *************** *** 166,169 **** --- 169,174 ---- wxToolBar* mToolBar; + wxTextCtrl* mSimState; + SparkTree mSparkTree; PropertyList mPropList; Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** mainframe.cpp 1 Apr 2007 15:14:09 -0000 1.11 --- mainframe.cpp 1 Apr 2007 16:10:13 -0000 1.12 *************** *** 145,148 **** --- 145,152 ---- mToolBar->AddTool(ID_SIM_START, wxT("Start"), wxBitmap(xpm_play)); mToolBar->AddTool(ID_SIM_PAUSE, wxT("Pause"), wxBitmap(xpm_pause)); + mToolBar->AddSeparator(); + + mSimState = new wxTextCtrl( mToolBar, wxID_ANY, _T(""), wxDefaultPosition, wxSize(120, -1), wxTE_READONLY ); + mToolBar->AddControl(mSimState); mToolBar->Realize(); *************** *** 167,170 **** --- 171,175 ---- mTimer.Start(LOGWND_UPDATE_INTERVAL); + PrintSimState(); UpdateTitle(); } *************** *** 436,440 **** --- 441,447 ---- sim->Quit(); + spark->SetSimState(S_PAUSED); spark->GetLog()->Normal() << "(RsgEdit) pausing simulation\n"; + PrintSimState(); } *************** *** 545,548 **** --- 552,557 ---- } + PrintSimState(); + // pump the wxWidgets message loop wxGetApp().Yield(); *************** *** 781,782 **** --- 790,827 ---- frame->StartAgent(filename); } + + void mainframe::PrintSimState() + { + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + + if (spark.get() == 0) + { + mSimState->SetValue(""); + return; + } + + shared_ptr<SimulationServer> sim = spark->GetSimulationServer(); + if (sim.get() == 0) + { + mSimState->SetValue(""); + return; + } + + wxString state; + switch (spark->GetSimState()) + { + default: + break; + + case S_PAUSED: + state = "Paused "; + break; + + case S_RUNNING: + state = "Running "; + break; + } + + float now = sim->GetTime(); + mSimState->SetValue(state + wxString::Format("t=%.1lf",now)); + } |
From: Markus R. <rol...@us...> - 2007-04-01 15:48:43
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27535 Modified Files: sparkglcanvas.cpp sparkglcanvas.h Log Message: - capture mouse input when the mouse is moved and a button is pressed simultaneously. This allows to control the camera even if the mouse pointer leaves the OpenGL window Index: sparkglcanvas.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sparkglcanvas.h 15 Mar 2007 07:26:24 -0000 1.4 --- sparkglcanvas.h 1 Apr 2007 15:48:33 -0000 1.5 *************** *** 62,65 **** --- 62,66 ---- void OnRightUp(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); + void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); void Render(wxDC& dc); *************** *** 74,77 **** --- 75,79 ---- SparkGLRender mRender; boost::shared_ptr<kerosin::InputSystem> mInputSystem; + bool mMouseCaptured; private: Index: sparkglcanvas.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sparkglcanvas.cpp 31 Mar 2007 13:26:41 -0000 1.6 --- sparkglcanvas.cpp 1 Apr 2007 15:48:33 -0000 1.7 *************** *** 45,48 **** --- 45,49 ---- EVT_RIGHT_UP(SparkGLCanvas::OnRightUp) EVT_MOTION(SparkGLCanvas::OnMouseMove) + EVT_MOUSE_CAPTURE_LOST(SparkGLCanvas::OnMouseCaptureLost) END_EVENT_TABLE() *************** *** 54,57 **** --- 55,59 ---- : wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name ) { + mMouseCaptured = false; mInit = false; } *************** *** 62,65 **** --- 64,68 ---- : wxGLCanvas(parent, other->GetContext(), id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name) { + mMouseCaptured = false; mInit = false; } *************** *** 244,247 **** --- 247,270 ---- lastX = event.GetX(); lastY = event.GetY(); + + if ( + (event.LeftIsDown()) || + (event.MiddleIsDown()) || + (event.RightIsDown()) + ) + { + if (! mMouseCaptured) + { + CaptureMouse(); + mMouseCaptured = true; + } + } else + { + if (mMouseCaptured) + { + ReleaseMouse(); + mMouseCaptured = false; + } + } } *************** *** 255,256 **** --- 278,284 ---- mInputSystem->AddInput(input); } + + void SparkGLCanvas::OnMouseCaptureLost(wxMouseCaptureLostEvent& /*event*/) + { + mMouseCaptured = false; + } |
From: Markus R. <rol...@us...> - 2007-04-01 15:30:46
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6752 Modified Files: Tag: WIN32 arena.rsg Log Message: - add some lights to the default arena Index: arena.rsg =================================================================== RCS file: /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres/arena.rsg,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** arena.rsg 24 Feb 2006 12:04:14 -0000 1.1 --- arena.rsg 1 Apr 2007 15:30:36 -0000 1.1.2.1 *************** *** 3,6 **** --- 3,27 ---- (RubySceneGraph 0 1) ( + ; add lights + (node Transform + (setLocalPos -10 10 10) + (node Light + (setDiffuse 1.0 1.0 1.0 1.0) + (setSpecular 0.1 0.1 0.1 1.0) + (setAmbient 0.8 0.8 0.8 1.0) + ) + + ) + + ; add lights + (node Transform + (setLocalPos 10 -10 10) + (node Light + (setDiffuse 1.0 1.0 1.0 1.0) + (setSpecular 0.1 0.1 0.1 1.0) + (setAmbient 0.0 0.0 0.0 1.0) + ) + ) + ; create the base plane (node Transform |
From: Markus R. <rol...@us...> - 2007-04-01 15:14:19
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20640 Modified Files: mainframe.cpp Log Message: - make sure to alos close agent frames and to kill all associated processes if the main frame is closed Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mainframe.cpp 31 Mar 2007 13:28:50 -0000 1.10 --- mainframe.cpp 1 Apr 2007 15:14:09 -0000 1.11 *************** *** 306,309 **** --- 306,326 ---- } + // close agentframes + wxWindowList& children = GetChildren(); + for ( + wxWindowList::Node *node = children.GetFirst(); + node != 0; + node = node->GetNext() + ) + { + agentframe* af = dynamic_cast<agentframe*>(node->GetData()); + if (af == 0) + { + continue; + } + + af->Close(); + } + event.Skip(); } |
From: Markus R. <rol...@us...> - 2007-03-31 14:20:17
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31645 Modified Files: scriptserver.cpp scriptserver.h Log Message: - sync with rcssserver3d CVS; added value eUninit to ERunScriptErrorType to make simspark run on SuSE 9.2 (thanks Jan) Index: scriptserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** scriptserver.cpp 17 Mar 2007 07:01:28 -0000 1.4 --- scriptserver.cpp 31 Mar 2007 14:20:12 -0000 1.5 *************** *** 625,629 **** #endif ! ERunScriptErrorType result = eNotFound; if (validDotDir) --- 625,629 ---- #endif ! ERunScriptErrorType result = eUninit; if (validDotDir) Index: scriptserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scriptserver.h 15 Mar 2007 07:26:31 -0000 1.3 --- scriptserver.h 31 Mar 2007 14:20:12 -0000 1.4 *************** *** 64,67 **** --- 64,68 ---- enum ERunScriptErrorType { + eUninit, // not initialized eOK, // no errors eNotFound, // could not find script *************** *** 112,116 **** bool Eval(const std::string &command, GCValue& value); ! /** notify all notes to update their cached references */ void UpdateCachedAllNodes(); --- 113,117 ---- bool Eval(const std::string &command, GCValue& value); ! /** notify all nodes to update their cached references */ void UpdateCachedAllNodes(); |
From: Markus R. <rol...@us...> - 2007-03-31 14:00:23
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17980 Modified Files: Tag: projectx light.cpp Log Message: - remove renderserver.h #include Index: light.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/light.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.3.2.1 diff -C2 -d -r1.1.2.3 -r1.1.2.3.2.1 *** light.cpp 23 Feb 2007 19:21:10 -0000 1.1.2.3 --- light.cpp 31 Mar 2007 14:00:18 -0000 1.1.2.3.2.1 *************** *** 27,31 **** #include <zeitgeist/logserver/logserver.h> #include <kerosin/openglserver/openglwrapper.h> - #include <kerosin/renderserver/renderserver.h> using namespace boost; --- 27,30 ---- |
From: Markus R. <rol...@us...> - 2007-03-31 13:57:47
|
Update of /cvsroot/simspark/simspark/spark/kerosin In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16539 Modified Files: Tag: projectx kerosin.vcproj Log Message: - move baserenderserver to proper VC project subdir Index: kerosin.vcproj =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/kerosin.vcproj,v retrieving revision 1.1.2.3.2.1 retrieving revision 1.1.2.3.2.2 diff -C2 -d -r1.1.2.3.2.1 -r1.1.2.3.2.2 *** kerosin.vcproj 31 Mar 2007 13:54:58 -0000 1.1.2.3.2.1 --- kerosin.vcproj 31 Mar 2007 13:57:43 -0000 1.1.2.3.2.2 *************** *** 308,311 **** --- 308,323 ---- > <File + RelativePath=".\renderserver\baserenderserver.cpp" + > + </File> + <File + RelativePath=".\renderserver\baserenderserver.h" + > + </File> + <File + RelativePath=".\renderserver\baserenderserver_c.cpp" + > + </File> + <File RelativePath=".\renderserver\customrender.cpp" > *************** *** 509,524 **** </Filter> <File - RelativePath=".\renderserver\baserenderserver.cpp" - > - </File> - <File - RelativePath=".\renderserver\baserenderserver.h" - > - </File> - <File - RelativePath=".\renderserver\baserenderserver_c.cpp" - > - </File> - <File RelativePath=".\kerosin.cpp" > --- 521,524 ---- |
From: Markus R. <rol...@us...> - 2007-03-31 13:56:02
|
Update of /cvsroot/simspark/simspark/spark/salt In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15249 Modified Files: Tag: projectx salt.vcproj Log Message: - added missing include path to win32 directory Index: salt.vcproj =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/salt.vcproj,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.3.2.1 diff -C2 -d -r1.1.2.3 -r1.1.2.3.2.1 *** salt.vcproj 11 Feb 2007 10:40:54 -0000 1.1.2.3 --- salt.vcproj 31 Mar 2007 13:55:57 -0000 1.1.2.3.2.1 *************** *** 41,44 **** --- 41,45 ---- Name="VCCLCompilerTool" Optimization="0" + AdditionalIncludeDirectories="..\win32" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" MinimalRebuild="true" *************** *** 103,106 **** --- 104,108 ---- <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="..\win32" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" RuntimeLibrary="2" |