Ignition Gazebo

API Reference

7.0.0~pre1
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 IGNITION_GAZEBO_RENDERUTIL_HH_
18 #define IGNITION_GAZEBO_RENDERUTIL_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include <sdf/Sensor.hh>
25 
26 #include <ignition/gazebo/config.hh>
27 #include <ignition/gazebo/rendering/Export.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 
72  public: void UpdateECM(const UpdateInfo &_info,
74 
76  public: void UpdateFromECM(const UpdateInfo &_info,
77  const EntityComponentManager &_ecm);
78 
81  public: void SetEngineName(const std::string &_engineName);
82 
85  public: std::string EngineName() const;
86 
89  public: void SetHeadlessRendering(const bool &_headless);
90 
93  public: bool HeadlessRendering() const;
94 
97  public: void SetSceneName(const std::string &_sceneName);
98 
101  public: std::string SceneName() const;
102 
105  public: void SetScene(const rendering::ScenePtr &_scene);
106 
109  public: void SetBackgroundColor(const math::Color &_color);
110 
113  public: void SetAmbientLight(const math::Color &_ambient);
114 
117  public: void SetSkyEnabled(bool _enabled);
118 
120  public: void ShowGrid();
121 
124  public: void SetUseCurrentGLContext(bool _enable);
125 
128  public: void SetWinID(const std::string &_winID);
129 
135  public: void SetEnableSensors(bool _enable, std::function<
136  std::string(const gazebo::Entity &, const sdf::Sensor &,
137  const std::string &)> _createSensorCb = {});
138 
142  public : void SetRemoveSensorCb(
143  std::function<void(const gazebo::Entity &)> _removeSensorCb);
144 
147  public: void ViewTransparent(const Entity &_entity);
148 
151  public: void ViewCOM(const Entity &_entity);
152 
155  public: void ViewInertia(const Entity &_entity);
156 
159  public: void ViewJoints(const Entity &_entity);
160 
163  public: void ViewWireframes(const Entity &_entity);
164 
167  public: void ViewCollisions(const Entity &_entity);
168 
171  public: class SceneManager &SceneManager();
172 
175  public: class MarkerManager &MarkerManager();
176 
180  public: std::chrono::steady_clock::duration SimTime() const;
181 
184  public: void SetSelectedEntity(const rendering::NodePtr &_node);
185 
188  public: const std::vector<Entity> &SelectedEntities() const;
189 
191  public: void DeselectAllEntities();
192 
196  private: std::vector<Entity> FindChildLinks(const Entity &_entity);
197 
200  private: void HideWireboxes(const Entity &_entity);
201 
204  public: void SetTransformActive(bool _active);
205 
207  private: std::unique_ptr<RenderUtilPrivate> dataPtr;
208  };
209 }
210 }
211 }
212 #endif
Creates, deletes, and maintains marker visuals. Only the Scene class should instantiate and use this ...
Definition: MarkerManager.hh:37
Information passed to systems on the update callback.
Definition: Types.hh:38
Component< sdf::Scene, class SceneTag, serializers::SceneSerializer > Scene
This component holds scene properties of the world.
Definition: Scene.hh:45
STL class.
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
Scene manager class for loading and managing objects in the scene.
Definition: SceneManager.hh:90
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
Definition: RenderUtil.hh:44