Gazebo

Entity.hh

00001 /*
00002  *  Gazebo - Outdoor Multi-Robot Simulator
00003  *  Copyright (C) 2003  
00004  *     Nate Koenig & Andrew Howard
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 /* Desc: External interfaces for Gazebo
00023  * Author: Nate Koenig
00024  * Date: 03 Apr 2007
00025  * SVN: $Id: Entity.hh 123 2007-09-19 20:36:14Z natepak $
00026  */
00027 
00028 #ifndef ENTITY_HH
00029 #define ENTITY_HH
00030 
00031 #include <vector>
00032 #include <string>
00033 #include <ode/ode.h>
00034 
00035 namespace Ogre
00036 {
00037   class SceneNode;
00038 }
00039 
00040 namespace gazebo
00041 {
00042 
00045 
00046 
00048 /*
00049  * Facilitates meshing of physics engine with rendering engine
00050  */
00051 class Entity
00052 {
00055   public: Entity(Entity *parent = NULL);
00056 
00058   public: virtual ~Entity();
00059 
00062   public: int GetId() const;
00063 
00066   public: int GetParentId() const;
00067 
00070   public: void SetParent(Entity *parent);
00071 
00074   public: Entity *GetParent() const;
00075 
00078   public: void AddChild(Entity *child);
00079 
00082   public: std::vector< Entity* > &GetChildren();
00083 
00086   public: Ogre::SceneNode *GetSceneNode() const;
00087 
00090   public: void SetSceneNode(Ogre::SceneNode *sceneNode);
00091 
00094   public: void SetName(const std::string &name);
00095 
00098   public: std::string GetName() const;
00099 
00102   public: void SetStatic(bool s);
00103 
00106   public: bool IsStatic() const;
00107 
00109   public: bool operator==(const Entity &ent);
00110 
00112   protected: Entity *parent;
00113 
00115   public: std::vector< Entity* > children;
00116 
00118   private: unsigned int id;
00119 
00121   private: static unsigned int idCounter;
00122 
00124   protected: Ogre::SceneNode *sceneNode;
00125 
00127   public: dSpaceID spaceId;
00128 
00130   private: std::string name;
00131 
00132   private: bool isStatic;
00133 };
00134 
00136 }
00137 
00138 #endif

Last updated Aug 04 2007