23 #ifndef _GAZEBO_PHYSICS_BASE_HH_
24 #define _GAZEBO_PHYSICS_BASE_HH_
26 #include <boost/enable_shared_from_this.hpp>
87 COLLISION = 0x00000008,
98 BALL_JOINT = 0x00000080,
100 HINGE2_JOINT = 0x00000100,
102 HINGE_JOINT = 0x00000200,
104 SLIDER_JOINT = 0x00000400,
106 SCREW_JOINT = 0x00000800,
108 UNIVERSAL_JOINT = 0x00001000,
110 GEARBOX_JOINT = 0x00002000,
115 BOX_SHAPE = 0x00020000,
117 CYLINDER_SHAPE = 0x00040000,
119 HEIGHTMAP_SHAPE = 0x00080000,
121 MAP_SHAPE = 0x00100000,
123 MULTIRAY_SHAPE = 0x00200000,
125 RAY_SHAPE = 0x00400000,
127 PLANE_SHAPE = 0x00800000,
129 SPHERE_SHAPE = 0x01000000,
131 MESH_SHAPE = 0x02000000,
134 SENSOR_COLLISION = 0x10000000
142 public:
virtual ~
Base();
146 public:
virtual void Load(sdf::ElementPtr _sdf);
149 public:
virtual void Fini();
155 public:
virtual void Reset();
167 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
171 public:
virtual void SetName(
const std::string &_name);
175 public: std::string GetName()
const;
179 public: uint32_t GetId()
const;
184 public:
void SetSaveable(
bool _v);
189 public:
bool GetSaveable()
const;
193 public:
int GetParentId()
const;
197 public:
void SetParent(
BasePtr _parent);
201 public:
BasePtr GetParent()
const;
205 public:
void AddChild(
BasePtr _child);
209 public:
virtual void RemoveChild(
unsigned int _id);
212 public:
void RemoveChildren();
216 public:
unsigned int GetChildCount()
const;
223 public:
BasePtr GetById(
unsigned int _id)
const;
229 public:
BasePtr GetByName(
const std::string &_name);
234 public:
BasePtr GetChild(
unsigned int _i)
const;
239 public:
BasePtr GetChild(
const std::string &_name);
243 public:
void RemoveChild(
const std::string &_name);
248 public:
void AddType(EntityType _type);
254 public:
bool HasType(
const EntityType &_t)
const;
258 public:
unsigned int GetType()
const;
263 public: std::string GetScopedName()
const;
267 public:
void Print(
const std::string &_prefix);
272 public:
virtual bool SetSelected(
bool _show);
276 public:
bool IsSelected()
const;
282 public:
bool operator ==(
const Base &_ent)
const;
287 public:
void SetWorld(
const WorldPtr &_newWorld);
291 public:
const WorldPtr &GetWorld()
const;
295 public:
virtual const sdf::ElementPtr GetSDF();
300 protected:
void ComputeScopedName();
303 protected: sdf::ElementPtr
sdf;
315 private:
bool saveable;
318 private: uint32_t id;
321 private:
unsigned int type;
324 private:
bool selected;
327 private: std::string name;
330 private: std::string scopedName;