From: <na...@us...> - 2009-03-10 18:30:06
|
Revision: 7450 http://playerstage.svn.sourceforge.net/playerstage/?rev=7450&view=rev Author: natepak Date: 2009-03-10 18:29:52 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Added delete method to OGreVisualManager Modified Paths: -------------- code/branches/federation/gazebo/server/rendering/OgreVisual.cc code/branches/federation/gazebo/server/rendering/OgreVisualManager.cc code/branches/federation/gazebo/server/rendering/OgreVisualManager.hh code/branches/federation/gazebo/server/rendering/UserCamera.cc Modified: code/branches/federation/gazebo/server/rendering/OgreVisual.cc =================================================================== --- code/branches/federation/gazebo/server/rendering/OgreVisual.cc 2009-03-10 18:02:54 UTC (rev 7449) +++ code/branches/federation/gazebo/server/rendering/OgreVisual.cc 2009-03-10 18:29:52 UTC (rev 7450) @@ -499,7 +499,6 @@ Ogre::MovableObject *obj = this->sceneNode->getAttachedObject(i); obj->setCastShadows(shadows); } - } //////////////////////////////////////////////////////////////////////////////// Modified: code/branches/federation/gazebo/server/rendering/OgreVisualManager.cc =================================================================== --- code/branches/federation/gazebo/server/rendering/OgreVisualManager.cc 2009-03-10 18:02:54 UTC (rev 7449) +++ code/branches/federation/gazebo/server/rendering/OgreVisualManager.cc 2009-03-10 18:29:52 UTC (rev 7450) @@ -26,6 +26,7 @@ #include "Model.hh" #include "GazeboError.hh" +#include "GazeboMessage.hh" #include "Entity.hh" #include "OgreVisual.hh" #include "OgreVisualManager.hh" @@ -67,35 +68,28 @@ } //////////////////////////////////////////////////////////////////////////////// -/// Create a standalone visual -OgreVisual *OgreVisualManager::CreateStandaloneVisual( const std::string &name, - const std::string &type ) +/// Delete a visual +void OgreVisualManager::DeleteVisual( OgreVisual *visual ) { - OgreVisual *newVis = NULL; std::map<std::string, OgreVisual*>::iterator iter; - iter = this->visuals.find(name); + iter = this->visuals.find(visual->GetName()); - if (iter == this->visuals.end()) + if (iter != this->visuals.end()) { - newVis = new OgreVisual(NULL, NULL); - newVis->SetName(name); - this->visuals[name] = newVis; + delete iter->second; + iter->second = NULL; + this->visuals.erase(iter); } else - gzthrow(std::string("Name of ogre visual already exists: ") + name); + { + gzerr(0) << "Unknown visual[" << visual->GetName() << "]\n"; + } - return newVis; } //////////////////////////////////////////////////////////////////////////////// -/// Remove a visual -void OgreVisualManager::RemoveVisual( const std::string &name ) -{ -} - -//////////////////////////////////////////////////////////////////////////////// /// Update all the visuals void OgreVisualManager::Update() { Modified: code/branches/federation/gazebo/server/rendering/OgreVisualManager.hh =================================================================== --- code/branches/federation/gazebo/server/rendering/OgreVisualManager.hh 2009-03-10 18:02:54 UTC (rev 7449) +++ code/branches/federation/gazebo/server/rendering/OgreVisualManager.hh 2009-03-10 18:29:52 UTC (rev 7450) @@ -54,12 +54,8 @@ OgreVisual *parent=NULL, Entity *owner = NULL ); - /// \brief Create a standalone visual - /// \param name Unique name - /// \param type Type of visual object to create - /// \return The newly created visual - public: OgreVisual *CreateStandaloneVisual( const std::string &name, - const std::string &type ); + /// \brief Delete a visual + public: void DeleteVisual( OgreVisual *visual ); /// \brief Remove a visual /// \param name Unique name of the visual to remove Modified: code/branches/federation/gazebo/server/rendering/UserCamera.cc =================================================================== --- code/branches/federation/gazebo/server/rendering/UserCamera.cc 2009-03-10 18:02:54 UTC (rev 7449) +++ code/branches/federation/gazebo/server/rendering/UserCamera.cc 2009-03-10 18:29:52 UTC (rev 7450) @@ -94,7 +94,6 @@ OgreAdaptor::Instance()->UpdateWindow(this->window, this); - if (this->saveFramesP->GetValue()) { char tmp[1024]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |