Ignition Rendering

API Reference

5.1.0
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 IGNITION_RENDERING_OGRE_OGRESCENE_HH_
18 #define IGNITION_RENDERING_OGRE_OGRESCENE_HH_
19 
20 #include <array>
21 #include <string>
23 #include "ignition/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 LightVisualPtr CreateLightVisualImpl(unsigned int _id,
83  const std::string &_name) override;
84 
85  protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
86  const std::string &_name) override;
87 
88  protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
89  const std::string &_name) override;
90 
91  protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
92  const std::string &_name) override;
93 
94  // Documentation inherited
95  protected: virtual DepthCameraPtr CreateDepthCameraImpl(
96  const unsigned int _id,
97  const std::string &_name) override;
98 
99  // Documentation inherited
100  protected: virtual ThermalCameraPtr CreateThermalCameraImpl(
101  const unsigned int _id,
102  const std::string &_name) override;
103 
104  protected: virtual GpuRaysPtr CreateGpuRaysImpl(
105  const unsigned int _id,
106  const std::string &_name) override;
107 
108  protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
109  const std::string &_name) override;
110 
111  protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
112  const std::string &_name) override;
113 
114  protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
115  const std::string &_name) override;
116 
117  // Documentation inherited
118  protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id,
119  const std::string &_name) override;
120 
121  protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
122  const std::string &_name) override;
123 
124  protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
125  const std::string &_name) override;
126 
127  protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
128  const std::string &_name) override;
129 
130  protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
131  const std::string &_name) override;
132 
133  protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
134  const std::string &_name) override;
135 
136  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
137  const std::string &_name, const std::string &_meshName);
138 
139  protected: virtual MeshPtr CreateMeshImpl(
140  unsigned int _id,
141  const std::string &_name,
142  const MeshDescriptor &_desc) override;
143 
144  // Documentation inherited
145  protected: virtual HeightmapPtr CreateHeightmapImpl(
146  unsigned int _id,
147  const std::string &_name,
148  const HeightmapDescriptor &_desc) override;
149 
150  // Documentation inherited
151  protected: virtual CapsulePtr CreateCapsuleImpl(unsigned int _id,
152  const std::string &_name) override;
153 
154  protected: virtual GridPtr CreateGridImpl(
155  unsigned int _id,
156  const std::string &_name) override;
157 
158  // Documentation inherited
159  protected: virtual MarkerPtr CreateMarkerImpl(
160  unsigned int _id,
161  const std::string &_name) override;
162 
163  // Documentation inherited
164  protected: virtual LidarVisualPtr CreateLidarVisualImpl(unsigned int _id,
165  const std::string &_name) override;
166 
167  // Documentation inherited
168  protected: virtual WireBoxPtr CreateWireBoxImpl(unsigned int _id,
169  const std::string &_name) override;
170 
171  // Documentation inherited
172  protected: virtual TextPtr CreateTextImpl(unsigned int _id,
173  const std::string &_name) override;
174 
175  protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
176  const std::string &_name) override;
177 
178  protected: virtual RenderTexturePtr CreateRenderTextureImpl(
179  unsigned int _id, const std::string &_name) override;
180 
181  // Documentation inherited.
182  protected: virtual RenderWindowPtr CreateRenderWindowImpl(
183  unsigned int _id, const std::string &_name) override;
184 
185  protected: virtual RayQueryPtr CreateRayQueryImpl(
186  unsigned int _id, const std::string &_name) override;
187 
188  // Documentation inherited
189  protected: virtual ParticleEmitterPtr CreateParticleEmitterImpl(
190  unsigned int _id, const std::string &_name) override;
191 
192  protected: virtual bool InitObject(OgreObjectPtr _object,
193  unsigned int _id, const std::string &_name);
194 
195  protected: virtual LightStorePtr Lights() const override;
196 
197  protected: virtual SensorStorePtr Sensors() const override;
198 
199  protected: virtual VisualStorePtr Visuals() const override;
200 
201  protected: virtual MaterialMapPtr Materials() const override;
202 
203  private: void CreateContext();
204 
205  private: void CreateRootVisual();
206 
207  private: void CreateMeshFactory();
208 
209  private: void CreateStores();
210 
211  private: OgreScenePtr SharedThis();
212 
214 
216 
218 
220 
222 
224 
225  protected: Ogre::Root *ogreRoot;
226 
227  protected: Ogre::SceneManager *ogreSceneManager;
228 
229  private: friend class OgreRenderEngine;
230  };
231  }
232  }
233 }
234 #endif
OgreMaterialMapPtr materials
Definition: OgreScene.hh:223
OgreVisualPtr rootVisual
Definition: OgreScene.hh:213
Describes how a Mesh should be loaded.
Definition: MeshDescriptor.hh:44
Ogre::Root * ogreRoot
Definition: OgreScene.hh:225
OgreSensorStorePtr sensors
Definition: OgreScene.hh:219
STL class.
Definition: OgreRenderEngine.hh:68
Definition: BaseScene.hh:37
Describes how a Heightmap should be loaded.
Definition: HeightmapDescriptor.hh:146
Definition: OgreCamera.hh:27
Definition: OgreScene.hh:39
OgreVisualStorePtr visuals
Definition: OgreScene.hh:221
STL class.
OgreLightStorePtr lights
Definition: OgreScene.hh:217
Ogre::SceneManager * ogreSceneManager
Definition: OgreScene.hh:227
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: RenderEngine.hh:36
OgreMeshFactoryPtr meshFactory
Definition: OgreScene.hh:215