Gazebo Sim

API Reference

7.9.0
gz/sim/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 GZ_SIM_CREATEREMOVE_HH_
18 #define GZ_SIM_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/Projector.hh>
32 #include <sdf/Sensor.hh>
33 #include <sdf/Visual.hh>
34 #include <sdf/World.hh>
35 
36 #include <gz/sim/Entity.hh>
38 #include <gz/sim/EventManager.hh>
39 #include <gz/sim/Types.hh>
40 
41 namespace gz
42 {
43  namespace sim
44  {
45  // Inline bracket to help doxygen filtering.
46  inline namespace GZ_SIM_VERSION_NAMESPACE {
47  // Forward declarations.
48  class SdfEntityCreatorPrivate;
49  //
59  class GZ_SIM_VISIBLE SdfEntityCreator
60  {
66  public: explicit SdfEntityCreator(EntityComponentManager &_ecm,
67  EventManager &_eventManager);
68 
71  public: SdfEntityCreator(const SdfEntityCreator &_creator);
72 
75  public: SdfEntityCreator(SdfEntityCreator &&_creator) noexcept;
76 
80  public: SdfEntityCreator &operator=(SdfEntityCreator &&_creator) noexcept;
81 
85  public: SdfEntityCreator &operator=(const SdfEntityCreator &_creator);
86 
88  public: ~SdfEntityCreator();
89 
94  public: Entity CreateEntities(const sdf::World *_world);
95 
100  public: void CreateEntities(const sdf::World *_world,
101  Entity _worldEntity);
102 
107  public: Entity CreateEntities(const sdf::Model *_model);
108 
113  public: Entity CreateEntities(const sdf::Actor *_actor);
114 
119  public: Entity CreateEntities(const sdf::Light *_light);
120 
125  public: Entity CreateEntities(const sdf::Link *_link);
126 
131  public: Entity CreateEntities(const sdf::Joint *_joint);
132 
138  public: Entity CreateEntities(const sdf::Joint *_joint, bool _resolved);
139 
144  public: Entity CreateEntities(const sdf::Visual *_visual);
145 
150  public: Entity CreateEntities(const sdf::Collision *_collision);
151 
157  public: Entity CreateEntities(const sdf::Sensor *_sensor);
158 
164  public: Entity CreateEntities(const sdf::ParticleEmitter *_emitter);
165 
170  public: Entity CreateEntities(const sdf::Projector *_projector);
171 
178  public: void RequestRemoveEntity(const Entity _entity,
179  bool _recursive = true);
180 
185  public: void SetParent(Entity _child, Entity _parent);
186 
193  private: Entity CreateEntities(const sdf::Model *_model,
194  bool _staticParent);
195 
197  private: void LoadModelPlugins();
198 
201  };
202  }
203  }
204 }
205 #endif