Gazebo Sim

API Reference

7.7.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: Entity CreateEntities(const sdf::Model *_model);
101 
106  public: Entity CreateEntities(const sdf::Actor *_actor);
107 
112  public: Entity CreateEntities(const sdf::Light *_light);
113 
118  public: Entity CreateEntities(const sdf::Link *_link);
119 
124  public: Entity CreateEntities(const sdf::Joint *_joint);
125 
131  public: Entity CreateEntities(const sdf::Joint *_joint, bool _resolved);
132 
137  public: Entity CreateEntities(const sdf::Visual *_visual);
138 
143  public: Entity CreateEntities(const sdf::Collision *_collision);
144 
150  public: Entity CreateEntities(const sdf::Sensor *_sensor);
151 
157  public: Entity CreateEntities(const sdf::ParticleEmitter *_emitter);
158 
163  public: Entity CreateEntities(const sdf::Projector *_projector);
164 
171  public: void RequestRemoveEntity(const Entity _entity,
172  bool _recursive = true);
173 
178  public: void SetParent(Entity _child, Entity _parent);
179 
186  private: Entity CreateEntities(const sdf::Model *_model,
187  bool _staticParent);
188 
191  };
192  }
193  }
194 }
195 #endif