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 4402 2008-03-09 14:39:27Z robotos $
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 gazebo
00036 {
00037 
00038 class OgreVisual;
00041 
00042 
00044 /*
00045  * Facilitates meshing of physics engine with rendering engine
00046  */
00047 class Entity
00048 {
00051   public: Entity(Entity *parent = NULL);
00052 
00054   public: virtual ~Entity();
00055 
00058   public: int GetId() const;
00059 
00062   public: int GetParentId() const;
00063 
00066   public: void SetParent(Entity *parent);
00067 
00070   public: Entity *GetParent() const;
00071 
00074   public: void AddChild(Entity *child);
00075 
00078   public: std::vector< Entity* > &GetChildren();
00079 
00082   public: OgreVisual *GetVisualNode() const;
00083 
00086   public: void SetVisualNode(OgreVisual *visualNode);
00087 
00090   public: void SetName(const std::string &name);
00091 
00094   public: std::string GetName() const;
00095 
00098   public: std::string GetUniqueName() 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: OgreVisual *visualNode;
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