![]() |
An open-source, flexible 3D physical simulation framework
|
#include <EntityManager.h>
Public Member Functions | |
EntityManager (interfaces::ControlCenter *c) | |
virtual unsigned long | addEntity (const std::string &name) |
creates a new entity with the given name and returns its id More... | |
virtual unsigned long | addEntity (SimEntity *entity) |
adds an existing entity to its entity map, returning the assigned id More... | |
virtual void | addNode (const std::string &entityName, unsigned long nodeId, const std::string &nodeName) |
adds a node and maps the nodeId to the name More... | |
virtual void | addMotor (const std::string &entityName, unsigned long motorId, const std::string &motorName) |
adds a motor to the entity and maps the motorId to its name More... | |
virtual void | addController (const std::string &entityName, unsigned long controllerId) |
adds a controller id to the controller list More... | |
virtual void | addJoint (const std::string &entityName, unsigned long jointId, const std::string &jointName) |
adds a joint to the entity and maps the jointId to its name More... | |
virtual const std::map< unsigned long, SimEntity * > * | subscribeToEntityCreation (interfaces::EntitySubscriberInterface *newsub) |
returns the entity with the given name More... | |
virtual SimEntity * | getEntity (const std::string &name) |
returns the entity with the given name More... | |
virtual SimEntity * | getEntity (unsigned long id) |
returns the entity with the given id More... | |
virtual unsigned long | getEntityNode (const std::string &entityName, const std::string &nodeName) |
returns the node of the given entity; returns 0 if the entity or the node don't exist More... | |
virtual unsigned long | getEntityMotor (const std::string &entityName, const std::string &motorName) |
virtual std::vector< unsigned long > | getEntityControllerList (const std::string &entityName) |
virtual unsigned long | getEntityJoint (const std::string &entityName, const std::string &jointName) |
returns the node of the given entity; returns 0 if the entity or the node don't exist More... | |
virtual void | selectEvent (unsigned long id, bool mode) |
virtual void | printEntityNodes (const std::string &entityName) |
virtual void | printEntityMotors (const std::string &entityName) |
virtual void | printEntityControllers (const std::string &entityName) |
virtual void | resetPose () |
![]() | |
virtual | ~GraphicsEventClient () |
![]() | |
virtual | ~EntityManagerInterface () |
Private Member Functions | |
void | notifySubscribers (SimEntity *entity) |
unsigned long | getNextId () |
returns the id to be assigned to the next entity More... | |
Private Attributes | |
std::vector< interfaces::EntitySubscriberInterface * > | subscribers |
interfaces::ControlCenter * | control |
unsigned long | next_entity_id |
the id assigned to the next created entity; use getNextId function More... | |
std::map< unsigned long, SimEntity * > | entities |
utils::Mutex | iMutex |
Definition at line 53 of file EntityManager.h.
mars::sim::EntityManager::EntityManager | ( | interfaces::ControlCenter * | c | ) |
Definition at line 37 of file EntityManager.cpp.
|
virtual |
adds a controller id to the controller list
Implements mars::interfaces::EntityManagerInterface.
Definition at line 116 of file EntityManager.cpp.
|
virtual |
creates a new entity with the given name and returns its id
Implements mars::interfaces::EntityManagerInterface.
Definition at line 45 of file EntityManager.cpp.
|
virtual |
adds an existing entity to its entity map, returning the assigned id
Implements mars::interfaces::EntityManagerInterface.
Definition at line 53 of file EntityManager.cpp.
|
virtual |
adds a joint to the entity and maps the jointId to its name
Implements mars::interfaces::EntityManagerInterface.
Definition at line 103 of file EntityManager.cpp.
|
virtual |
adds a motor to the entity and maps the motorId to its name
Implements mars::interfaces::EntityManagerInterface.
Definition at line 90 of file EntityManager.cpp.
|
virtual |
adds a node and maps the nodeId to the name
Implements mars::interfaces::EntityManagerInterface.
Definition at line 73 of file EntityManager.cpp.
|
virtual |
returns the entity with the given name
Implements mars::interfaces::EntityManagerInterface.
Definition at line 146 of file EntityManager.cpp.
|
virtual |
returns the entity with the given id
Implements mars::interfaces::EntityManagerInterface.
|
virtual |
Implements mars::interfaces::EntityManagerInterface.
Definition at line 190 of file EntityManager.cpp.
|
virtual |
returns the node of the given entity; returns 0 if the entity or the node don't exist
Implements mars::interfaces::EntityManagerInterface.
Definition at line 201 of file EntityManager.cpp.
|
virtual |
Implements mars::interfaces::EntityManagerInterface.
Definition at line 178 of file EntityManager.cpp.
|
virtual |
returns the node of the given entity; returns 0 if the entity or the node don't exist
Implements mars::interfaces::EntityManagerInterface.
Definition at line 167 of file EntityManager.cpp.
|
inlineprivate |
returns the id to be assigned to the next entity
Definition at line 118 of file EntityManager.h.
|
private |
Definition at line 61 of file EntityManager.cpp.
|
virtual |
Implements mars::interfaces::EntityManagerInterface.
Definition at line 235 of file EntityManager.cpp.
|
virtual |
Implements mars::interfaces::EntityManagerInterface.
Definition at line 224 of file EntityManager.cpp.
|
virtual |
Implements mars::interfaces::EntityManagerInterface.
Definition at line 213 of file EntityManager.cpp.
|
virtual |
Implements mars::interfaces::EntityManagerInterface.
Definition at line 246 of file EntityManager.cpp.
|
virtual |
Implements mars::interfaces::GraphicsEventClient.
Definition at line 129 of file EntityManager.cpp.
|
virtual |
returns the entity with the given name
Implements mars::interfaces::EntityManagerInterface.
Definition at line 68 of file EntityManager.cpp.
|
private |
Definition at line 112 of file EntityManager.h.
|
private |
Definition at line 115 of file EntityManager.h.
|
mutableprivate |
Definition at line 123 of file EntityManager.h.
|
private |
the id assigned to the next created entity; use getNextId function
Definition at line 114 of file EntityManager.h.
|
private |
Definition at line 110 of file EntityManager.h.