Gazebo Rendering

API Reference

6.6.3
gz/rendering/ogre/OgreScene.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_OGRE_OGRESCENE_HH_
18 #define GZ_RENDERING_OGRE_OGRESCENE_HH_
19 
20 #include <array>
21 #include <string>
23 #include "gz/rendering/ogre/Export.hh"
25 
26 
27 namespace Ogre
28 {
29  class Root;
30  class SceneManager;
31 }
32 
33 namespace ignition
34 {
35  namespace rendering
36  {
37  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
38  //
39  class IGNITION_RENDERING_OGRE_VISIBLE OgreScene :
40  public BaseScene
41  {
42  protected: OgreScene(unsigned int _id, const std::string &_name);
43 
44  public: virtual ~OgreScene();
45 
46  public: virtual void Fini() override;
47 
48  public: virtual RenderEngine *Engine() const override;
49 
50  public: virtual VisualPtr RootVisual() const override;
51 
52  public: virtual math::Color AmbientLight() const override;
53 
54  public: virtual void SetAmbientLight(const math::Color &_color) override;
55 
56  public: virtual void SetBackgroundColor(
57  const math::Color &_color) override;
58 
59  // Documentation inherited.
60  public: virtual void SetGradientBackgroundColor(
61  const std::array<math::Color, 4> &_colors) override;
62 
63  // Documentation inherited.
64  public: virtual void RemoveGradientBackgroundColor() override;
65 
66  public: virtual void PreRender() override;
67 
68  public: virtual void Clear() override;
69 
70  public: virtual void Destroy() override;
71 
72  public: virtual Ogre::SceneManager *OgreSceneManager() const;
73 
74  protected: virtual bool LoadImpl() override;
75 
76  protected: virtual bool InitImpl() override;
77 
78  protected: virtual DirectionalLightPtr CreateDirectionalLightImpl(
79  unsigned int _id, const std::string &_name) override;
80 
81  // Documentation inherited
82  protected: virtual COMVisualPtr CreateCOMVisualImpl(unsigned int _id,
83  const std::string &_name) override;
84 
85  // Documentation inherited
86  protected: virtual InertiaVisualPtr CreateInertiaVisualImpl(
87  unsigned int _id, const std::string &_name) override;
88 
89  // Documentation inherited
90  protected: virtual JointVisualPtr CreateJointVisualImpl(unsigned int _id,
91  const std::string &_name) override;
92 
93  protected: virtual LightVisualPtr CreateLightVisualImpl(unsigned int _id,
94  const std::string &_name) override;
95 
96  protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
97  const std::string &_name) override;
98 
99  protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
100  const std::string &_name) override;
101 
102  protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
103  const std::string &_name) override;
104 
105  // Documentation inherited
106  protected: virtual DepthCameraPtr CreateDepthCameraImpl(
107  const unsigned int _id,
108  const std::string &_name) override;
109 
110  // Documentation inherited
111  protected: virtual ThermalCameraPtr CreateThermalCameraImpl(
112  const unsigned int _id,
113  const std::string &_name) override;
114 
115  protected: virtual GpuRaysPtr CreateGpuRaysImpl(
116  const unsigned int _id,
117  const std::string &_name) override;
118 
119  protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
120  const std::string &_name) override;
121 
122  protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
123  const std::string &_name) override;
124 
125  protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
126  const std::string &_name) override;
127 
128  // Documentation inherited
129  protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id,
130  const std::string &_name) override;
131 
132  protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
133  const std::string &_name) override;
134 
135  protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
136  const std::string &_name) override;
137 
138  protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
139  const std::string &_name) override;
140 
141  protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
142  const std::string &_name) override;
143 
144  protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
145  const std::string &_name) override;
146 
147  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
148  const std::string &_name, const std::string &_meshName);
149 
150  protected: virtual MeshPtr CreateMeshImpl(
151  unsigned int _id,
152  const std::string &_name,
153  const MeshDescriptor &_desc) override;
154 
155  // Documentation inherited
156  protected: virtual HeightmapPtr CreateHeightmapImpl(
157  unsigned int _id,
158  const std::string &_name,
159  const HeightmapDescriptor &_desc) override;
160 
161  // Documentation inherited
162  protected: virtual CapsulePtr CreateCapsuleImpl(unsigned int _id,
163  const std::string &_name) override;
164 
165  protected: virtual GridPtr CreateGridImpl(
166  unsigned int _id,
167  const std::string &_name) override;
168 
169  // Documentation inherited
170  protected: virtual MarkerPtr CreateMarkerImpl(
171  unsigned int _id,
172  const std::string &_name) override;
173 
174  // Documentation inherited
175  protected: virtual LidarVisualPtr CreateLidarVisualImpl(unsigned int _id,
176  const std::string &_name) override;
177 
178  // Documentation inherited
179  protected: virtual WireBoxPtr CreateWireBoxImpl(unsigned int _id,
180  const std::string &_name) override;
181 
182  // Documentation inherited
183  protected: virtual TextPtr CreateTextImpl(unsigned int _id,
184  const std::string &_name) override;
185 
186  protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
187  const std::string &_name) override;
188 
189  protected: virtual RenderTexturePtr CreateRenderTextureImpl(
190  unsigned int _id, const std::string &_name) override;
191 
192  // Documentation inherited.
193  protected: virtual RenderWindowPtr CreateRenderWindowImpl(
194  unsigned int _id, const std::string &_name) override;
195 
196  protected: virtual RayQueryPtr CreateRayQueryImpl(
197  unsigned int _id, const std::string &_name) override;
198 
199  // Documentation inherited
200  protected: virtual ParticleEmitterPtr CreateParticleEmitterImpl(
201  unsigned int _id, const std::string &_name) override;
202 
203  protected: virtual bool InitObject(OgreObjectPtr _object,
204  unsigned int _id, const std::string &_name);
205 
206  protected: virtual LightStorePtr Lights() const override;
207 
208  protected: virtual SensorStorePtr Sensors() const override;
209 
210  protected: virtual VisualStorePtr Visuals() const override;
211 
212  protected: virtual MaterialMapPtr Materials() const override;
213 
216  public: void ClearMaterialsCache(const std::string &_name);
217 
218  private: void CreateContext();
219 
220  private: void CreateRootVisual();
221 
222  private: void CreateMeshFactory();
223 
224  private: void CreateStores();
225 
226  private: OgreScenePtr SharedThis();
227 
229 
231 
233 
235 
237 
239 
240  protected: Ogre::Root *ogreRoot;
241 
242  protected: Ogre::SceneManager *ogreSceneManager;
243 
244  private: friend class OgreRenderEngine;
245  };
246  }
247  }
248 }
249 #endif
OgreVisualPtr rootVisual
Definition: gz/rendering/ogre/OgreScene.hh:228
Definition: gz/rendering/ogre/OgreCamera.hh:27
STL class.
STL class.
Definition: gz/rendering/ogre/OgreScene.hh:39
Describes how a Heightmap should be loaded.
Definition: gz/rendering/HeightmapDescriptor.hh:146
Describes how a Mesh should be loaded.
Definition: gz/rendering/MeshDescriptor.hh:44
Ogre::Root * ogreRoot
Definition: gz/rendering/ogre/OgreScene.hh:240
OgreMaterialMapPtr materials
Definition: gz/rendering/ogre/OgreScene.hh:238
OgreSensorStorePtr sensors
Definition: gz/rendering/ogre/OgreScene.hh:234
STL class.
Definition: gz/rendering/ogre/OgreRenderEngine.hh:68
Definition: gz/rendering/base/BaseScene.hh:37
Ogre::SceneManager * ogreSceneManager
Definition: gz/rendering/ogre/OgreScene.hh:242
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: gz/rendering/RenderEngine.hh:36
OgreVisualStorePtr visuals
Definition: gz/rendering/ogre/OgreScene.hh:236
OgreMeshFactoryPtr meshFactory
Definition: gz/rendering/ogre/OgreScene.hh:230
OgreLightStorePtr lights
Definition: gz/rendering/ogre/OgreScene.hh:232