Ignition Gazebo

API Reference

6.6.0
SdfEntityCreator.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef IGNITION_GAZEBO_CREATEREMOVE_HH_
18 #define IGNITION_GAZEBO_CREATEREMOVE_HH_
19 
20 #include <memory>
21 
22 #include <sdf/Actor.hh>
23 #include <sdf/Collision.hh>
24 #include <sdf/Gui.hh>
25 #include <sdf/Joint.hh>
26 #include <sdf/Light.hh>
27 #include <sdf/Link.hh>
28 #include <sdf/Model.hh>
29 #include <sdf/ParticleEmitter.hh>
30 #include <sdf/Physics.hh>
31 #include <sdf/Sensor.hh>
32 #include <sdf/Visual.hh>
33 #include <sdf/World.hh>
34 
38 #include <ignition/gazebo/Types.hh>
39 
40 namespace ignition
41 {
42  namespace gazebo
43  {
44  // Inline bracket to help doxygen filtering.
45  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
46  // Forward declarations.
47  class SdfEntityCreatorPrivate;
48  //
58  class IGNITION_GAZEBO_VISIBLE SdfEntityCreator
59  {
65  public: explicit SdfEntityCreator(EntityComponentManager &_ecm,
66  EventManager &_eventManager);
67 
70  public: SdfEntityCreator(const SdfEntityCreator &_creator);
71 
74  public: SdfEntityCreator(SdfEntityCreator &&_creator) noexcept;
75 
79  public: SdfEntityCreator &operator=(SdfEntityCreator &&_creator) noexcept;
80 
84  public: SdfEntityCreator &operator=(const SdfEntityCreator &_creator);
85 
87  public: ~SdfEntityCreator();
88 
93  public: Entity CreateEntities(const sdf::World *_world);
94 
99  public: Entity CreateEntities(const sdf::Model *_model);
100 
105  public: Entity CreateEntities(const sdf::Actor *_actor);
106 
111  public: Entity CreateEntities(const sdf::Light *_light);
112 
117  public: Entity CreateEntities(const sdf::Link *_link);
118 
123  public: Entity CreateEntities(const sdf::Joint *_joint);
124 
130  public: Entity CreateEntities(const sdf::Joint *_joint, bool _resolved);
131 
136  public: Entity CreateEntities(const sdf::Visual *_visual);
137 
142  public: Entity CreateEntities(const sdf::Collision *_collision);
143 
149  public: Entity CreateEntities(const sdf::Sensor *_sensor);
150 
156  public: Entity CreateEntities(const sdf::ParticleEmitter *_emitter);
157 
164  public: void RequestRemoveEntity(const Entity _entity,
165  bool _recursive = true);
166 
171  public: void SetParent(Entity _child, Entity _parent);
172 
179  private: Entity CreateEntities(const sdf::Model *_model,
180  bool _staticParent);
181 
184  };
185  }
186  }
187 }
188 #endif
Component< NoData, class VisualTag > Visual
A component that identifies an entity as being a visual.
Definition: Visual.hh:80
Component< NoData, class WorldTag > World
A component that identifies an entity as being a world.
Definition: components/World.hh:35
Component< NoData, class JointTag > Joint
A component that identifies an entity as being a joint.
Definition: Joint.hh:33
Component< msgs::ParticleEmitter, class ParticleEmitterTag, serializers::MsgSerializer > ParticleEmitter
A component that contains a particle emitter.
Definition: include/ignition/gazebo/components/ParticleEmitter.hh:37
The EntityComponentManager constructs, deletes, and returns components and entities. A component can be of any class which inherits from components::BaseComponent.
Definition: EntityComponentManager.hh:66
The EventManager is used to send/receive notifications of simulator events.
Definition: EventManager.hh:54
Component< NoData, class ModelTag > Model
A component that identifies an entity as being a model.
Definition: components/Model.hh:86
Component< sdf::Light, class LightTag, serializers::LightSerializer > Light
This component contains light source information. For more information on lights, see SDF&#39;s Light ele...
Definition: Light.hh:48
Provides convenient functions to spawn entities and load their plugins from SDF elements, to remove them, and to change their hierarchy.
Definition: SdfEntityCreator.hh:58
Component< NoData, class CollisionTag > Collision
A component that identifies an entity as being a collision.
Definition: Collision.hh:42
Component< NoData, class LinkTag > Link
A component that identifies an entity as being a link.
Definition: components/Link.hh:33
Component< sdf::Actor, class ActorTag, serializers::ActorSerializer > Actor
This component contains actor source information. For more information on actors, see SDF&#39;s Actor ele...
Definition: Actor.hh:80
This library is part of the Ignition Robotics project.
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light. At its core, an Entity is just an identifier.
Definition: Entity.hh:59
Component< NoData, class SensorTag > Sensor
A component that identifies an entity as being a sensor.
Definition: Sensor.hh:35