Provides convenient functions to spawn entities and load their plugins from SDF elements, to remove them, and to change their hierarchy. More...
#include <SdfEntityCreator.hh>
Public Member Functions | |
SdfEntityCreator (const SdfEntityCreator &_creator) | |
Copy constructor. | |
SdfEntityCreator (EntityComponentManager &_ecm, EventManager &_eventManager) | |
Constructor. | |
SdfEntityCreator (SdfEntityCreator &&_creator) noexcept | |
Move constructor. | |
~SdfEntityCreator () | |
Destructor. | |
Entity | CreateEntities (const sdf::Actor *_actor) |
Create all entities that exist in the sdf::Actor object and load their plugins. | |
Entity | CreateEntities (const sdf::Collision *_collision) |
Create all entities that exist in the sdf::Collision object and load their plugins. | |
Entity | CreateEntities (const sdf::Joint *_joint) |
Create all entities that exist in the sdf::Joint object and load their plugins. | |
Entity | CreateEntities (const sdf::Joint *_joint, bool _resolved) |
Create all entities that exist in the sdf::Joint object and load their plugins. | |
Entity | CreateEntities (const sdf::Light *_light) |
Create all entities that exist in the sdf::Light object and load their plugins. | |
Entity | CreateEntities (const sdf::Link *_link) |
Create all entities that exist in the sdf::Link object and load their plugins. | |
Entity | CreateEntities (const sdf::Model *_model) |
Create all entities that exist in the sdf::Model object and load their plugins. Also loads plugins of child sensors. | |
Entity | CreateEntities (const sdf::ParticleEmitter *_emitter) |
Create all entities that exist in the sdf::ParticleEmitter object. | |
Entity | CreateEntities (const sdf::Projector *_projector) |
Create all entities that exist in the sdf::Projector object. | |
Entity | CreateEntities (const sdf::Sensor *_sensor) |
Create all entities that exist in the sdf::Sensor object. Sensor plugins won't be directly loaded by this function. | |
Entity | CreateEntities (const sdf::Visual *_visual) |
Create all entities that exist in the sdf::Visual object and load their plugins. | |
Entity | CreateEntities (const sdf::World *_world) |
Create all entities that exist in the sdf::World object and load their plugins. | |
void | CreateEntities (const sdf::World *_world, Entity _worldEntity) |
Create all entities that exist in the sdf::World object and load their plugins. | |
SdfEntityCreator & | operator= (const SdfEntityCreator &_creator) |
Copy assignment operator. | |
SdfEntityCreator & | operator= (SdfEntityCreator &&_creator) noexcept |
Move assignment operator. | |
void | RequestRemoveEntity (const Entity _entity, bool _recursive=true) |
Request an entity deletion. This will insert the request into a queue. The queue is processed toward the end of a simulation update step. | |
void | SetParent (Entity _child, Entity _parent) |
Set an entity's parent entity. This function takes care of updating the EntityComponentManager and necessary components. | |
Detailed Description
Provides convenient functions to spawn entities and load their plugins from SDF elements, to remove them, and to change their hierarchy.
This class provides wrappers around entities and components which are more convenient and straight-forward to use than dealing with the EntityComponentManager
directly.
Constructor & Destructor Documentation
◆ SdfEntityCreator() [1/3]
|
explicit |
Constructor.
- Parameters
-
[in] _ecm Entity component manager. This class keeps a pointer to it, but doesn't assume ownership. [in] _eventManager Event manager. This class keeps a pointer to it, but doesn't assume ownership.
◆ SdfEntityCreator() [2/3]
SdfEntityCreator | ( | const SdfEntityCreator & | _creator | ) |
Copy constructor.
- Parameters
-
[in] _creator SdfEntityCreator to copy.
◆ SdfEntityCreator() [3/3]
|
noexcept |
Move constructor.
- Parameters
-
[in] _creator SdfEntityCreator to move.
◆ ~SdfEntityCreator()
~SdfEntityCreator | ( | ) |
Destructor.
Member Function Documentation
◆ CreateEntities() [1/13]
Entity CreateEntities | ( | const sdf::Actor * | _actor | ) |
Create all entities that exist in the sdf::Actor object and load their plugins.
- Parameters
-
[in] _actor SDF actor object.
- Returns
- Actor entity.
◆ CreateEntities() [2/13]
Entity CreateEntities | ( | const sdf::Collision * | _collision | ) |
Create all entities that exist in the sdf::Collision object and load their plugins.
- Parameters
-
[in] _collision SDF collision object.
- Returns
- Collision entity.
◆ CreateEntities() [3/13]
Entity CreateEntities | ( | const sdf::Joint * | _joint | ) |
Create all entities that exist in the sdf::Joint object and load their plugins.
- Parameters
-
[in] _joint SDF joint object.
- Returns
- Joint entity.
◆ CreateEntities() [4/13]
Entity CreateEntities | ( | const sdf::Joint * | _joint, |
bool | _resolved | ||
) |
Create all entities that exist in the sdf::Joint object and load their plugins.
- Parameters
-
[in] _joint SDF joint object. [in] _resolved True if all frames are already resolved
- Returns
- Joint entity.
◆ CreateEntities() [5/13]
Entity CreateEntities | ( | const sdf::Light * | _light | ) |
Create all entities that exist in the sdf::Light object and load their plugins.
- Parameters
-
[in] _light SDF light object.
- Returns
- Light entity.
◆ CreateEntities() [6/13]
Entity CreateEntities | ( | const sdf::Link * | _link | ) |
Create all entities that exist in the sdf::Link object and load their plugins.
- Parameters
-
[in] _link SDF link object.
- Returns
- Link entity.
◆ CreateEntities() [7/13]
Entity CreateEntities | ( | const sdf::Model * | _model | ) |
Create all entities that exist in the sdf::Model object and load their plugins. Also loads plugins of child sensors.
- Parameters
-
[in] _model SDF model object.
- Returns
- Model entity.
◆ CreateEntities() [8/13]
Entity CreateEntities | ( | const sdf::ParticleEmitter * | _emitter | ) |
Create all entities that exist in the sdf::ParticleEmitter object.
- Parameters
-
[in] _emitter SDF ParticleEmitter object.
- Returns
- ParticleEmitter entity.
◆ CreateEntities() [9/13]
Entity CreateEntities | ( | const sdf::Projector * | _projector | ) |
Create all entities that exist in the sdf::Projector object.
- Parameters
-
[in] _projector SDF Projector object.
- Returns
- Projector entity.
◆ CreateEntities() [10/13]
Entity CreateEntities | ( | const sdf::Sensor * | _sensor | ) |
◆ CreateEntities() [11/13]
Entity CreateEntities | ( | const sdf::Visual * | _visual | ) |
Create all entities that exist in the sdf::Visual object and load their plugins.
- Parameters
-
[in] _visual SDF visual object.
- Returns
- Visual entity.
◆ CreateEntities() [12/13]
Entity CreateEntities | ( | const sdf::World * | _world | ) |
Create all entities that exist in the sdf::World object and load their plugins.
- Parameters
-
[in] _world SDF world object.
- Returns
- World entity.
◆ CreateEntities() [13/13]
void CreateEntities | ( | const sdf::World * | _world, |
Entity | _worldEntity | ||
) |
Create all entities that exist in the sdf::World object and load their plugins.
- Parameters
-
[in] _world SDF world object. [in] _worldEntity The world entity object.
◆ operator=() [1/2]
SdfEntityCreator & operator= | ( | const SdfEntityCreator & | _creator | ) |
Copy assignment operator.
- Parameters
-
[in] _creator SdfEntityCreator to copy.
- Returns
- Reference to this.
◆ operator=() [2/2]
|
noexcept |
Move assignment operator.
- Parameters
-
[in] _creator SdfEntityCreator component to move.
- Returns
- Reference to this.
◆ RequestRemoveEntity()
void RequestRemoveEntity | ( | const Entity | _entity, |
bool | _recursive = true |
||
) |
Request an entity deletion. This will insert the request into a queue. The queue is processed toward the end of a simulation update step.
- Parameters
-
[in] _entity Entity to be removed. [in] _recursive Whether to recursively delete all child entities. True by default.
◆ SetParent()
Set an entity's parent entity. This function takes care of updating the EntityComponentManager
and necessary components.
- Parameters
-
[in] _child Entity which should be parented. [in] _parent Entity which should be _child's parent.
The documentation for this class was generated from the following file: