Revision: 8938
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8938&view=rev
Author:   natepak
Date:     2010-10-11 17:00:22 +0000 (Mon, 11 Oct 2010)

Log Message:
-----------
Added render state

Added Paths:
-----------
    code/gazebo/trunk/server/rendering/RenderState.cc
    code/gazebo/trunk/server/rendering/RenderState.hh

Added: code/gazebo/trunk/server/rendering/RenderState.cc
===================================================================
--- code/gazebo/trunk/server/rendering/RenderState.cc                           
(rev 0)
+++ code/gazebo/trunk/server/rendering/RenderState.cc   2010-10-11 17:00:22 UTC 
(rev 8938)
@@ -0,0 +1,176 @@
+/*
+ *  Gazebo - Outdoor Multi-Robot Simulator
+ *  Copyright (C) 2003  
+ *     Nate Koenig & Andrew Howard
+ *
+ *  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; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+/* Desc: Render state container
+ * Author: Nate Koenig
+ * Date: 06 Oct 2010
+ */
+
+#include <boost/bind.hpp>
+
+#include "Events.hh"
+#include "RenderState.hh"
+
+using namespace gazebo;
+
+bool RenderState::showLights = false;
+bool RenderState::showJoints = false;
+bool RenderState::showCameras = false;
+bool RenderState::showContacts = false;
+bool RenderState::showWireframe = false;
+bool RenderState::showPhysics = false;
+bool RenderState::showBoundingBoxes = false;
+
+RenderState *RenderState::self = NULL;
+
+////////////////////////////////////////////////////////////////////////////////
+RenderState::RenderState()
+{
+  Events::ConnectShowLightsSignal(
+      boost::bind(&RenderState::ShowLightsCB,this) );
+
+  Events::ConnectShowJointsSignal(
+      boost::bind(&RenderState::ShowJointsCB,this) );
+
+  Events::ConnectShowCamerasSignal(
+      boost::bind(&RenderState::ShowCamerasCB,this) );
+
+  Events::ConnectShowContactsSignal(
+      boost::bind(&RenderState::ShowContactsCB,this) );
+
+  Events::ConnectShowWireframeSignal(
+      boost::bind(&RenderState::ShowWireframeCB,this) );
+
+  Events::ConnectShowBoundingBoxesSignal(
+      boost::bind(&RenderState::ShowBoundingBoxesCB,this) );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+RenderState::~RenderState()
+{
+  Events::DisconnectShowLightsSignal(
+      boost::bind(&RenderState::ShowLightsCB,this) );
+
+  Events::DisconnectShowJointsSignal(
+      boost::bind(&RenderState::ShowJointsCB,this) );
+
+  Events::DisconnectShowCamerasSignal(
+      boost::bind(&RenderState::ShowCamerasCB,this) );
+
+  Events::DisconnectShowContactsSignal(
+      boost::bind(&RenderState::ShowContactsCB,this) );
+
+  Events::DisconnectShowWireframeSignal(
+      boost::bind(&RenderState::ShowWireframeCB,this) );
+
+  Events::DisconnectShowBoundingBoxesSignal(
+      boost::bind(&RenderState::ShowBoundingBoxesCB,this) );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void RenderState::Init()
+{
+  if (self == NULL)
+    self = new RenderState();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool RenderState::GetShowLights()
+{
+  return showLights;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool RenderState::GetShowJoints()
+{
+  return showJoints;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool RenderState::GetShowCameras() 
+{
+  return showCameras;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool RenderState::GetShowContacts() 
+{
+  return showContacts;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool RenderState::GetShowWireframe() 
+{
+  return showWireframe;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool RenderState::GetShowPhysics() 
+{
+  return showPhysics;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool RenderState::GetShowBoundingBoxes() 
+{
+  return showBoundingBoxes;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void RenderState::ShowLightsCB()
+{
+  this->showLights = !this->showLights;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void RenderState::ShowJointsCB()
+{
+  this->showJoints = !this->showJoints;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void RenderState::ShowCamerasCB()
+{
+  this->showCameras = !this->showCameras;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void RenderState::ShowContactsCB()
+{
+  this->showContacts = !this->showContacts;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void RenderState::ShowWireframeCB()
+{
+  this->showWireframe = !this->showWireframe;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void RenderState::ShowPhysicsCB()
+{
+  this->showPhysics = !this->showPhysics;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void RenderState::ShowBoundingBoxesCB()
+{
+  this->showBoundingBoxes = !this->showBoundingBoxes;
+}

Added: code/gazebo/trunk/server/rendering/RenderState.hh
===================================================================
--- code/gazebo/trunk/server/rendering/RenderState.hh                           
(rev 0)
+++ code/gazebo/trunk/server/rendering/RenderState.hh   2010-10-11 17:00:22 UTC 
(rev 8938)
@@ -0,0 +1,64 @@
+/*
+ *  Gazebo - Outdoor Multi-Robot Simulator
+ *  Copyright (C) 2003  
+ *     Nate Koenig & Andrew Howard
+ *
+ *  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; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+/* Desc: Render state container
+ * Author: Nate Koenig
+ * Date: 06 Oct 2010
+ */
+
+#ifndef RENDERSTATE_HH
+#define RENDERSTATE_HH
+
+namespace gazebo
+{
+  class RenderState 
+  {
+    private: RenderState();
+    private: virtual ~RenderState();
+    public: static void Init();
+
+    public: static bool GetShowLights();
+    public: static bool GetShowJoints();
+    public: static bool GetShowCameras();
+    public: static bool GetShowContacts();
+    public: static bool GetShowWireframe();
+    public: static bool GetShowPhysics();
+    public: static bool GetShowBoundingBoxes();
+
+    private: void ShowLightsCB();
+    private: void ShowJointsCB();
+    private: void ShowCamerasCB();
+    private: void ShowContactsCB();
+    private: void ShowWireframeCB();
+    private: void ShowPhysicsCB();
+    private: void ShowBoundingBoxesCB();
+
+    private: static bool showLights;
+    private: static bool showJoints;
+    private: static bool showCameras;
+    private: static bool showContacts;
+    private: static bool showWireframe;
+    private: static bool showPhysics;
+    private: static bool showBoundingBoxes;
+
+    private: static RenderState *self;
+  };
+}
+#endif


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to