Ignition Rendering

API Reference

0.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 <string>
23 
24 namespace Ogre
25 {
26  class Root;
27  class SceneManager;
28 }
29 
30 namespace ignition
31 {
32  namespace rendering
33  {
34  class IGNITION_RENDERING_OGRE_VISIBLE OgreScene :
35  public BaseScene
36  {
37  protected: OgreScene(unsigned int _id, const std::string &_name);
38 
39  public: virtual ~OgreScene();
40 
41  public: virtual void Fini();
42 
43  public: virtual RenderEngine *Engine() const;
44 
45  public: virtual VisualPtr RootVisual() const;
46 
47  public: virtual math::Color AmbientLight() const;
48 
49  public: virtual void SetAmbientLight(const math::Color &_color);
50 
51  public: virtual void SetBackgroundColor(const math::Color &_color);
52 
53  public: virtual void PreRender();
54 
55  public: virtual void Clear();
56 
57  public: virtual void Destroy();
58 
59  public: virtual Ogre::SceneManager *OgreSceneManager() const;
60 
61  protected: virtual bool LoadImpl();
62 
63  protected: virtual bool InitImpl();
64 
65  protected: virtual DirectionalLightPtr CreateDirectionalLightImpl(
66  unsigned int _id, const std::string &_name);
67 
68  protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
69  const std::string &_name);
70 
71  protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
72  const std::string &_name);
73 
74  protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
75  const std::string &_name);
76 
77  protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
78  const std::string &_name);
79 
80  protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
81  const std::string &_name);
82 
83  protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
84  const std::string &_name);
85 
86  protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
87  const std::string &_name);
88 
89  protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
90  const std::string &_name);
91 
92  protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
93  const std::string &_name);
94 
95  protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
96  const std::string &_name);
97 
98  protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
99  const std::string &_name);
100 
101  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
102  const std::string &_name, const std::string &_meshName);
103 
104  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
105  const std::string &_name, const MeshDescriptor &_desc);
106 
107  // Documentation inherited
108  protected: virtual GridPtr CreateGridImpl(unsigned int _id,
109  const std::string &_name);
110 
111  protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
112  const std::string &_name);
113 
114  protected: virtual RenderTexturePtr CreateRenderTextureImpl(
115  unsigned int _id, const std::string &_name);
116 
117  // Documentation inherited.
118  protected: virtual RenderWindowPtr CreateRenderWindowImpl(
119  unsigned int _id, const std::string &_name);
120 
121  protected: virtual RayQueryPtr CreateRayQueryImpl(
122  unsigned int _id, const std::string &_name);
123 
124  protected: virtual bool InitObject(OgreObjectPtr _object,
125  unsigned int _id, const std::string &_name);
126 
127  protected: virtual LightStorePtr Lights() const;
128 
129  protected: virtual SensorStorePtr Sensors() const;
130 
131  protected: virtual VisualStorePtr Visuals() const;
132 
133  protected: virtual MaterialMapPtr Materials() const;
134 
135  private: void CreateContext();
136 
137  private: void CreateRootVisual();
138 
139  private: void CreateMeshFactory();
140 
141  private: void CreateStores();
142 
143  private: OgreScenePtr SharedThis();
144 
146 
148 
150 
152 
154 
156 
157  protected: Ogre::Root *ogreRoot;
158 
160 
161  private: friend class OgreRenderEngine;
162  };
163  }
164 }
165 #endif
OgreMaterialMapPtr materials
Definition: OgreScene.hh:155
OgreVisualPtr rootVisual
Definition: OgreScene.hh:145
Describes how a Mesh should be loaded.
Definition: MeshDescriptor.hh:38
Ogre::Root * ogreRoot
Definition: OgreScene.hh:157
OgreSensorStorePtr sensors
Definition: OgreScene.hh:151
STL class.
Definition: OgreRenderEngine.hh:64
Definition: BaseScene.hh:28
Definition: OgreScene.hh:34
OgreVisualStorePtr visuals
Definition: OgreScene.hh:153
OgreLightStorePtr lights
Definition: OgreScene.hh:149
Ogre::SceneManager * ogreSceneManager
Definition: OgreScene.hh:159
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: RenderEngine.hh:32
Definition: ArrowVisual.hh:22
OgreMeshFactoryPtr meshFactory
Definition: OgreScene.hh:147