Gazebo Rendering

API Reference

3.7.2
gz/rendering/ogre2/Ogre2Scene.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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_RENDERING_OGRE2_OGRE2SCENE_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2SCENE_HH_
19 
20 #include <string>
21 
22 #include "gz/rendering/Storage.hh"
25 
26 #include "gz/rendering/ogre2/Export.hh"
27 
28 namespace Ogre
29 {
30  class Root;
31  class SceneManager;
32 }
33 
34 namespace ignition
35 {
36  namespace rendering
37  {
38  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
39  //
41  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Scene :
42  public BaseScene
43  {
47  protected: Ogre2Scene(unsigned int _id, const std::string &_name);
48 
50  public: virtual ~Ogre2Scene();
51 
52  // Documentation inherited.
53  public: virtual void Fini() override;
54 
55  // Documentation inherited.
56  public: virtual RenderEngine *Engine() const override;
57 
58  // Documentation inherited.
59  public: virtual VisualPtr RootVisual() const override;
60 
61  // Documentation inherited.
62  public: virtual math::Color AmbientLight() const override;
63 
64  // Documentation inherited.
65  public: virtual void SetAmbientLight(const math::Color &_color) override;
66 
67  // Documentation inherited
68  public: virtual void PreRender() override;
69 
70  // Documentation inherited
71  public: virtual void Clear() override;
72 
73  // Documentation inherited
74  public: virtual void Destroy() override;
75 
78  public: virtual Ogre::SceneManager *OgreSceneManager() const;
79 
86  public: void SetShadowsDirty(bool _dirty);
87 
92  public: bool ShadowsDirty() const;
94 
95  // Documentation inherited
96  protected: virtual bool LoadImpl() override;
97 
98  // Documentation inherited
99  protected: virtual bool InitImpl() override;
100 
101  // Documentation inherited
102  protected: virtual DirectionalLightPtr CreateDirectionalLightImpl(
103  unsigned int _id, const std::string &_name) override;
104 
105  // Documentation inherited
106  protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
107  const std::string &_name) override;
108 
109  // Documentation inherited
110  protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
111  const std::string &_name) override;
112 
113  // Documentation inherited
114  protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
115  const std::string &_name) override;
116 
117  // Documentation inherited
118  protected: virtual DepthCameraPtr CreateDepthCameraImpl(unsigned int _id,
119  const std::string &_name) override;
120 
121  // Documentation inherited
122  protected: virtual ThermalCameraPtr CreateThermalCameraImpl(
123  unsigned int _id, const std::string &_name) override;
124 
125  // Documentation inherited
126  protected: virtual GpuRaysPtr CreateGpuRaysImpl(unsigned int _id,
127  const std::string &_name) override;
128 
129  // Documentation inherited
130  protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
131  const std::string &_name) override;
132 
133  // Documentation inherited
134  protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
135  const std::string &_name) override;
136 
137  // Documentation inherited
138  protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
139  const std::string &_name) override;
140 
141  // Documentation inherited
142  protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id,
143  const std::string &_name) override;
144 
145  // Documentation inherited
146  protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
147  const std::string &_name) override;
148 
149  // Documentation inherited
150  protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
151  const std::string &_name) override;
152 
153  // Documentation inherited
154  protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
155  const std::string &_name) override;
156 
157  // Documentation inherited
158  protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
159  const std::string &_name) override;
160 
161  // Documentation inherited
162  protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
163  const std::string &_name) override;
164 
169  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
170  const std::string &_name, const std::string &_meshName);
171 
172  // Documentation inherited
173  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
174  const std::string &_name, const MeshDescriptor &_desc)
175  override;
176 
177  // Documentation inherited
178  protected: virtual GridPtr CreateGridImpl(unsigned int _id,
179  const std::string &_name) override;
180 
181  // Documentation inherited
182  protected: virtual MarkerPtr CreateMarkerImpl(unsigned int _id,
183  const std::string &_name) override;
184 
185  // Documentation inherited
186  protected: virtual TextPtr CreateTextImpl(unsigned int _id,
187  const std::string &_name) override;
188 
189  protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
190  const std::string &_name) override;
191 
192  protected: virtual RenderTexturePtr CreateRenderTextureImpl(
193  unsigned int _id, const std::string &_name) override;
194 
195  // Documentation inherited.
196  protected: virtual RenderWindowPtr CreateRenderWindowImpl(
197  unsigned int _id, const std::string &_name) override;
198 
199  // Documentation inherited
200  protected: virtual RayQueryPtr CreateRayQueryImpl(
201  unsigned int _id, const std::string &_name) override;
202 
207  protected: virtual bool InitObject(Ogre2ObjectPtr _object,
208  unsigned int _id, const std::string &_name);
209 
210  // Documentation inherited
211  protected: virtual LightStorePtr Lights() const override;
212 
213  // Documentation inherited
214  protected: virtual SensorStorePtr Sensors() const override;
215 
216  // Documentation inherited
217  protected: virtual VisualStorePtr Visuals() const override;
218 
219  // Documentation inherited
220  protected: virtual MaterialMapPtr Materials() const override;
221 
223  private: void CreateContext();
224 
226  private: void CreateRootVisual();
227 
229  private: void CreateMeshFactory();
230 
232  private: void CreateStores();
233 
235  private: Ogre2ScenePtr SharedThis();
236 
239 
242 
245 
248 
251 
254 
256  protected: Ogre::SceneManager *ogreSceneManager = nullptr;
257 
259  private: friend class Ogre2RenderEngine;
260  };
261  }
262  }
263 }
264 #endif
Definition: gz/rendering/ogre/OgreCamera.hh:27
STL class.
STL class.
Describes how a Mesh should be loaded.
Definition: gz/rendering/MeshDescriptor.hh:44
Ogre2LightStorePtr lights
A list of ogre lights.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:250
Ogre2VisualStorePtr visuals
A list of ogre visuals.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:247
Ogre2 render engine class. A singleton class that manages the underlying ogre2 render engine,...
Definition: gz/rendering/ogre2/Ogre2RenderEngine.hh:74
Ogre2SensorStorePtr sensors
A list of ogre sensors, e.g. cameras.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:244
Ogre2.x implementation of the scene class.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:41
Ogre2MeshFactoryPtr meshFactory
Mesh factory for generating ogre meshes.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:241
Ogre2VisualPtr rootVisual
Root visual in the scene.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:238
Definition: gz/rendering/base/BaseScene.hh:37
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: gz/rendering/RenderEngine.hh:36
Ogre2MaterialMapPtr materials
A list of ogre materials.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:253