Gazebo Gazebo

API Reference

3.15.2
gz/sim/rendering/RenderUtil.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_GAZEBO_RENDERUTIL_HH_
18 #define GZ_GAZEBO_RENDERUTIL_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include <sdf/Sensor.hh>
25 
26 #include <gz/sim/config.hh>
27 #include <gz/sim/rendering/Export.hh>
28 #include <gz/sim/System.hh>
29 
32 
33 
34 namespace ignition
35 {
36 namespace gazebo
37 {
38 // Inline bracket to help doxygen filtering.
39 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
40  // forward declaration
41  class RenderUtilPrivate;
42 
44  class IGNITION_GAZEBO_RENDERING_VISIBLE RenderUtil
45  {
47  public: explicit RenderUtil();
48 
50  public: ~RenderUtil();
51 
53  public: void Init();
54 
60  public: int PendingSensors() const;
61 
63  public: void Update();
64 
67  public: rendering::ScenePtr Scene() const;
68 
70  public: void UpdateFromECM(const UpdateInfo &_info,
71  const EntityComponentManager &_ecm);
72 
75  public: void SetEngineName(const std::string &_engineName);
76 
79  public: std::string EngineName() const;
80 
83  public: void SetSceneName(const std::string &_sceneName);
84 
87  public: std::string SceneName() const;
88 
92  public: void SetBackgroundColor(const math::Color &_color);
93 
97  public: void SetAmbientLight(const math::Color &_ambient);
98 
100  public: void ShowGrid();
101 
104  public: void SetUseCurrentGLContext(bool _enable);
105 
111  public: void SetEnableSensors(bool _enable, std::function<
112  std::string(const sdf::Sensor &, const std::string &)>
113  _createSensorCb = {});
114 
117  public: void ViewCollisions(const Entity &_entity);
118 
121  public: class SceneManager &SceneManager();
122 
125  public: class MarkerManager &MarkerManager();
126 
130  public: std::chrono::steady_clock::duration SimTime() const;
131 
135  // NOLINTNEXTLINE
136  public: void SetSelectedEntity(rendering::NodePtr _node);
137 
142  public: Entity IGN_DEPRECATED(3)
143  EntityFromNode(const rendering::NodePtr &_node);
144 
148  public: rendering::NodePtr SelectedEntity() const;
149 
152  public: std::vector<Entity> SelectedEntities() const;
153 
155  public: void DeselectAllEntities();
156 
159  public: void SetTransformActive(bool _active);
160 
162  private: std::unique_ptr<RenderUtilPrivate> dataPtr;
163  };
164 }
165 }
166 }
167 #endif
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light....
Definition: gz/sim/Entity.hh:59
#define IGN_DEPRECATED(version)
This library is part of the Ignition Robotics project.
STL class.
The EntityComponentManager constructs, deletes, and returns components and entities....
Definition: gz/sim/EntityComponentManager.hh:65
Creates, deletes, and maintains marker visuals. Only the Scene class should instantiate and use this ...
Definition: gz/sim/rendering/MarkerManager.hh:38
Scene manager class for loading and managing objects in the scene.
Definition: gz/sim/rendering/SceneManager.hh:51
Information passed to systems on the update callback.
Definition: include/gz/sim/Types.hh:37
Definition: gz/sim/rendering/RenderUtil.hh:44
Component< sdf::Scene, class SceneTag, serializers::SceneSerializer > Scene
This component holds scene properties of the world.
Definition: gz/sim/components/Scene.hh:45
Component< NoData, class SensorTag > Sensor
A component that identifies an entity as being a sensor.
Definition: gz/sim/components/Sensor.hh:35