Ignition Gazebo

API Reference

2.10.0
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 
23 #include <sdf/Sensor.hh>
24 
25 #include <ignition/gazebo/config.hh>
26 #include <ignition/gazebo/Export.hh>
28 
30 
31 
32 namespace ignition
33 {
34 namespace gazebo
35 {
36 // Inline bracket to help doxygen filtering.
37 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
38  // forward declaration
39  class RenderUtilPrivate;
40 
42  class IGNITION_GAZEBO_VISIBLE RenderUtil
43  {
45  public: explicit RenderUtil();
46 
48  public: ~RenderUtil();
49 
51  public: void Init();
52 
58  public: int PendingSensors() const;
59 
61  public: void Update();
62 
65  public: rendering::ScenePtr Scene() const;
66 
68  public: void UpdateFromECM(const UpdateInfo &_info,
69  const EntityComponentManager &_ecm);
70 
73  public: void SetEngineName(const std::string &_engineName);
74 
77  public: std::string EngineName() const;
78 
81  public: void SetSceneName(const std::string &_sceneName);
82 
85  public: std::string SceneName() const;
86 
89  public: void SetBackgroundColor(const math::Color &_color);
90 
93  public: void SetAmbientLight(const math::Color &_ambient);
94 
97  public: void SetUseCurrentGLContext(bool _enable);
98 
104  public: void SetEnableSensors(bool _enable, std::function<
105  std::string(const sdf::Sensor &, const std::string &)>
106  _createSensorCb = {});
107 
110  public: class SceneManager &SceneManager();
111 
114  public: void SetSelectedEntity(rendering::NodePtr _node);
115 
118  public: rendering::NodePtr SelectedEntity() const;
119 
122  public: void SetTransformActive(bool _active);
123 
125  private: std::unique_ptr<RenderUtilPrivate> dataPtr;
126  };
127 }
128 }
129 }
130 #endif
Information passed to systems on the update callback.
Definition: Types.hh:37
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:64
Scene manager class for loading and managing objects in the scene.
Definition: SceneManager.hh:47
This library is part of the Ignition Robotics project.
Component< NoData, class SensorTag > Sensor
A component that identifies an entity as being a link.
Definition: Sensor.hh:33
Definition: RenderUtil.hh:42