Ignition Gazebo

API Reference

2.10.0
SceneManager.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 
18 #ifndef IGNITION_GAZEBO_SCENEMANAGER_HH_
19 #define IGNITION_GAZEBO_SCENEMANAGER_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include <sdf/Geometry.hh>
25 #include <sdf/Light.hh>
26 #include <sdf/Link.hh>
27 #include <sdf/Material.hh>
28 #include <sdf/Model.hh>
29 #include <sdf/Visual.hh>
30 
31 #include <ignition/rendering/RenderTypes.hh>
32 
33 #include <ignition/gazebo/config.hh>
35 #include <ignition/gazebo/Export.hh>
36 
37 namespace ignition
38 {
39 namespace gazebo
40 {
41 // Inline bracket to help doxygen filtering.
42 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
43  // Forward declaration
44  class SceneManagerPrivate;
45 
47  class IGNITION_GAZEBO_VISIBLE SceneManager
48  {
50  public: SceneManager();
51 
53  public: ~SceneManager();
54 
57  public: void SetScene(rendering::ScenePtr _scene);
58 
61  public: rendering::ScenePtr Scene() const;
62 
65  public: void SetWorldId(Entity _id);
66 
72  public: rendering::VisualPtr CreateModel(Entity _id,
73  const sdf::Model &_model, Entity _parentId = 0);
74 
80  public: rendering::VisualPtr CreateLink(Entity _id,
81  const sdf::Link &_link, Entity _parentId = 0);
82 
88  public: rendering::VisualPtr CreateVisual(Entity _id,
89  const sdf::Visual &_visual, Entity _parentId = 0);
90 
96  public: rendering::LightPtr CreateLight(Entity _id,
97  const sdf::Light &_light, Entity _parentId);
98 
106  public: bool AddSensor(Entity _gazeboId, const std::string &_sensorName,
107  Entity _parentGazeboId = 0);
108 
112  public: bool HasEntity(Entity _id) const;
113 
117  public: rendering::NodePtr NodeById(Entity _id) const;
118 
121  public: void RemoveEntity(Entity _id);
122 
129  private: rendering::GeometryPtr LoadGeometry(const sdf::Geometry &_geom,
130  math::Vector3d &_scale, math::Pose3d &_localPose);
131 
135  private: rendering::MaterialPtr LoadMaterial(
136  const sdf::Material &_material);
137 
143  public: rendering::VisualPtr TopLevelVisual(
144  rendering::VisualPtr _visual) const;
145 
148  private: std::unique_ptr<SceneManagerPrivate> dataPtr;
149  };
150 }
151 }
152 }
153 
154 #endif
Component< NoData, class VisualTag > Visual
A component that identifies an entity as being a visual.
Definition: Visual.hh:33
Component< sdf::Geometry, class GeometryTag, serializers::GeometrySerializer > Geometry
This component holds an entity&#39;s geometry.
Definition: Geometry.hh:46
Component< sdf::Scene, class SceneTag, serializers::SceneSerializer > Scene
This component holds scene properties of the world.
Definition: Scene.hh:45
STL class.
Component< sdf::Material, class MaterialTag, serializers::MaterialSerializer > Material
This component holds an entity&#39;s material.
Definition: Material.hh:44
Component< NoData, class ModelTag > Model
A component that identifies an entity as being a model.
Definition: components/Model.hh:33
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
Component< NoData, class LinkTag > Link
A component that identifies an entity as being a link.
Definition: components/Link.hh:33
Scene manager class for loading and managing objects in the scene.
Definition: SceneManager.hh:47
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