Public Types | Public Member Functions | Protected Attributes
Base Class Reference

Base class for most physics classes. More...

#include <Base.hh>

Inheritance diagram for Base:
Inheritance graph
[legend]

List of all members.

Public Types

enum  EntityType {
  BASE = 0x00000000, ENTITY = 0x00000001, MODEL = 0x00000002, LINK = 0x00000004,
  COLLISION = 0x00000010, LIGHT = 0x00000020, VISUAL = 0x00000040, JOINT = 0x10000000,
  BALL_JOINT = 0x10000001, HINGE2_JOINT = 0x10000002, HINGE_JOINT = 0x10000004, SLIDER_JOINT = 0x10000010,
  SCREW_JOINT = 0x10000020, UNIVERSAL_JOINT = 0x10000040, SHAPE = 0x20000000, BOX_SHAPE = 0x20000001,
  CYLINDER_SHAPE = 0x20000002, HEIGHTMAP_SHAPE = 0x20000004, MAP_SHAPE = 0x20000010, MULTIRAY_SHAPE = 0x20000020,
  RAY_SHAPE = 0x20000040, PLANE_SHAPE = 0x20000100, SPHERE_SHAPE = 0x20000200, TRIMESH_SHAPE = 0x20000400
}

Public Member Functions

 Base (BasePtr parent)
 Constructor.
virtual ~Base ()
 Destructor.
virtual void Load (sdf::ElementPtr &_sdf)
 Load.
virtual void Fini ()
 Finialize the object.
virtual void Init ()
virtual void Reset ()
virtual void Update ()
virtual void UpdateParameters (sdf::ElementPtr &_sdf)
 Update the parameters using new sdf values.
virtual void SetName (const std::string &name)
 Set the name of the entity.
std::string GetName () const
 Return the name of the entity.
unsigned int GetId () const
 Return the ID of this entity.
void SetSaveable (bool v)
 Set whether the object should be "saved", when the user selects to save the world to xml.
bool GetSaveable () const
 Get whether the object should be "saved", when the user selects to save the world to xml.
int GetParentId () const
 Return the ID of the parent.
void SetParent (BasePtr parent)
 Set the parent.
BasePtr GetParent () const
 Get the parent.
void AddChild (BasePtr child)
 Add a child to this entity.
virtual void RemoveChild (unsigned int id)
 Remove a child from this entity.
void RemoveChildren ()
 Remove all children.
unsigned int GetChildCount () const
 Get the number of children.
BasePtr GetById (unsigned int _id) const
 Get by id.
BasePtr GetByName (const std::string &name)
 Get by name.
BasePtr GetChild (unsigned int i) const
 Get a child by index.
BasePtr GetChild (const std::string &name)
 Get a child by name.
void RemoveChild (const std::string &_name)
 Remove a child by name.
void AddType (EntityType _type)
 Add a type specifier.
bool HasType (const EntityType &_t) const
 Get the type.
unsigned int GetType () const
 Get a type by index.
std::string GetScopedName () const
 Return the name of this entity with the model scope model1::...::modelN::entityName.
std::string GetCompleteScopedName () const
 Return the name of this entity with the model+body+collision scope model1::...::modelN::bodyN::entityName.
void Print (std::string prefix)
bool GetShowInGui () const
 True == show parameters in the gui.
void SetShowInGui (bool v)
 True == show parameters in the gui.
virtual bool SetSelected (bool s)
 Set whether this entity has been selected by the user through.
bool IsSelected () const
 True if the entity is selected by the user.
bool operator== (const Base &ent) const
 Returns true if the entities are the same. Checks only the name.
void SetWorld (const WorldPtr &_newWorld)
 Set the world this object belongs to.
const WorldPtr & GetWorld () const
 Get the world this object is in.
virtual const sdf::ElementPtr & GetSDF ()
 Get the SDF values for the model.

Protected Attributes

sdf::ElementPtr sdf
BasePtr parent
 Parent of this entity.
Base_V children
 Children of this entity.
Base_V::iterator childrenEnd
WorldPtr world

Detailed Description

Base class for most physics classes.


Constructor & Destructor Documentation

Base ( BasePtr  parent)

Constructor.

Parameters:
parentParent of this object

Member Function Documentation

void AddChild ( BasePtr  child)

Add a child to this entity.

Parameters:
childChild entity
BasePtr GetByName ( const std::string &  name)

Get by name.

Parameters:
nameGet a child (or self) object by name
Returns:
A pointer to the object, NULL if not found
unsigned int GetChildCount ( ) const

Get the number of children.

Returns:
The number of children
unsigned int GetId ( ) const

Return the ID of this entity.

This id is unique

Returns:
Integer ID
std::string GetName ( ) const

Return the name of the entity.

Returns:
Name of the entity
BasePtr GetParent ( ) const

Get the parent.

Returns:
Pointer to the parent entity

Reimplemented in Joint.

int GetParentId ( ) const

Return the ID of the parent.

Returns:
Integer ID
bool GetSaveable ( ) const

Get whether the object should be "saved", when the user selects to save the world to xml.

Returns:
True if the object is saveable
virtual void Load ( sdf::ElementPtr &  _sdf) [virtual]
virtual void RemoveChild ( unsigned int  id) [virtual]

Remove a child from this entity.

Parameters:
childChild to remove
virtual void SetName ( const std::string &  name) [virtual]

Set the name of the entity.

Parameters:
nameLink name

Reimplemented in Entity.

void SetParent ( BasePtr  parent)

Set the parent.

Parameters:
parentParent object
void SetSaveable ( bool  v)

Set whether the object should be "saved", when the user selects to save the world to xml.

Parameters:
vSet to True if the object should be saved.
void SetWorld ( const WorldPtr &  _newWorld)

Set the world this object belongs to.

This will also set the world for all children


The documentation for this class was generated from the following file: