Ignition Rendering

API Reference

4.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();
47 
48  public: virtual RenderEngine *Engine() const;
49 
50  public: virtual VisualPtr RootVisual() const;
51 
52  public: virtual math::Color AmbientLight() const;
53 
54  public: virtual void SetAmbientLight(const math::Color &_color);
55 
56  public: virtual void SetBackgroundColor(const math::Color &_color);
57 
58  // Documentation inherited.
59  public: virtual void SetGradientBackgroundColor(
60  const std::array<math::Color, 4> &_colors);
61 
62  // Documentation inherited.
63  public: virtual void RemoveGradientBackgroundColor();
64 
65  public: virtual void PreRender();
66 
67  public: virtual void Clear();
68 
69  public: virtual void Destroy();
70 
71  public: virtual Ogre::SceneManager *OgreSceneManager() const;
72 
73  protected: virtual bool LoadImpl();
74 
75  protected: virtual bool InitImpl();
76 
77  protected: virtual DirectionalLightPtr CreateDirectionalLightImpl(
78  unsigned int _id, const std::string &_name);
79 
80  protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
81  const std::string &_name);
82 
83  protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
84  const std::string &_name);
85 
86  protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
87  const std::string &_name);
88 
89  // Documentation inherited
90  protected: virtual DepthCameraPtr CreateDepthCameraImpl(
91  const unsigned int _id,
92  const std::string &_name);
93 
94  // Documentation inherited
95  protected: virtual ThermalCameraPtr CreateThermalCameraImpl(
96  const unsigned int _id,
97  const std::string &_name);
98 
99  protected: virtual GpuRaysPtr CreateGpuRaysImpl(
100  const unsigned int _id,
101  const std::string &_name);
102 
103  protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
104  const std::string &_name);
105 
106  protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
107  const std::string &_name);
108 
109  protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
110  const std::string &_name);
111 
112  // Documentation inherited
113  protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id,
114  const std::string &_name);
115 
116  protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
117  const std::string &_name);
118 
119  protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
120  const std::string &_name);
121 
122  protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
123  const std::string &_name);
124 
125  protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
126  const std::string &_name);
127 
128  protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
129  const std::string &_name);
130 
131  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
132  const std::string &_name, const std::string &_meshName);
133 
134  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
135  const std::string &_name, const MeshDescriptor &_desc);
136 
137  // Documentation inherited
138  protected: virtual GridPtr CreateGridImpl(unsigned int _id,
139  const std::string &_name);
140 
141  // Documentation inherited
142  protected: virtual MarkerPtr CreateMarkerImpl(unsigned int _id,
143  const std::string &_name);
144 
145  // Documentation inherited
146  protected: virtual LidarVisualPtr CreateLidarVisualImpl(unsigned int _id,
147  const std::string &_name);
148 
149  // Documentation inherited
150  protected: virtual WireBoxPtr CreateWireBoxImpl(unsigned int _id,
151  const std::string &_name);
152 
153  // Documentation inherited
154  protected: virtual TextPtr CreateTextImpl(unsigned int _id,
155  const std::string &_name);
156 
157  protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
158  const std::string &_name);
159 
160  protected: virtual RenderTexturePtr CreateRenderTextureImpl(
161  unsigned int _id, const std::string &_name);
162 
163  // Documentation inherited.
164  protected: virtual RenderWindowPtr CreateRenderWindowImpl(
165  unsigned int _id, const std::string &_name);
166 
167  protected: virtual RayQueryPtr CreateRayQueryImpl(
168  unsigned int _id, const std::string &_name);
169 
170  // Documentation inherited
171  protected: virtual ParticleEmitterPtr CreateParticleEmitterImpl(
172  unsigned int _id, const std::string &_name);
173 
174  protected: virtual bool InitObject(OgreObjectPtr _object,
175  unsigned int _id, const std::string &_name);
176 
177  protected: virtual LightStorePtr Lights() const;
178 
179  protected: virtual SensorStorePtr Sensors() const;
180 
181  protected: virtual VisualStorePtr Visuals() const;
182 
183  protected: virtual MaterialMapPtr Materials() const;
184 
185  private: void CreateContext();
186 
187  private: void CreateRootVisual();
188 
189  private: void CreateMeshFactory();
190 
191  private: void CreateStores();
192 
193  private: OgreScenePtr SharedThis();
194 
196 
198 
200 
202 
204 
206 
207  protected: Ogre::Root *ogreRoot;
208 
209  protected: Ogre::SceneManager *ogreSceneManager;
210 
211  private: friend class OgreRenderEngine;
212  };
213  }
214  }
215 }
216 #endif
OgreMaterialMapPtr materials
Definition: OgreScene.hh:205
OgreVisualPtr rootVisual
Definition: OgreScene.hh:195
Describes how a Mesh should be loaded.
Definition: MeshDescriptor.hh:44
Ogre::Root * ogreRoot
Definition: OgreScene.hh:207
OgreSensorStorePtr sensors
Definition: OgreScene.hh:201
STL class.
Definition: OgreRenderEngine.hh:68
Definition: BaseScene.hh:36
Definition: OgreCamera.hh:27
Definition: OgreScene.hh:39
OgreVisualStorePtr visuals
Definition: OgreScene.hh:203
STL class.
OgreLightStorePtr lights
Definition: OgreScene.hh:199
Ogre::SceneManager * ogreSceneManager
Definition: OgreScene.hh:209
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:197