Ignition Rendering

API Reference

4.0.0
BaseRenderEngine.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_BASE_BASERENDERENGINE_HH_
18 #define IGNITION_RENDERING_BASE_BASERENDERENGINE_HH_
19 
20 #include <map>
21 #include <string>
22 #include <vector>
25 
26 namespace ignition
27 {
28  namespace rendering
29  {
30  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
31  //
32  class IGNITION_RENDERING_VISIBLE BaseRenderEngine :
33  public virtual RenderEngine
34  {
35  protected: BaseRenderEngine();
36 
37  public: virtual ~BaseRenderEngine();
38 
39  // Documentation Inherited.
40  public: virtual bool Load(
41  const std::map<std::string, std::string> &_params = {}) override;
42 
43  public: virtual bool Init() override;
44 
45  public: virtual bool Fini() override;
46 
47  public: virtual bool IsLoaded() const override;
48 
49  public: virtual bool IsInitialized() const override;
50 
51  public: virtual bool IsEnabled() const override;
52 
53  public: virtual unsigned int SceneCount() const override;
54 
55  public: virtual bool HasScene(ConstScenePtr _scene) const override;
56 
57  public: virtual bool HasSceneId(unsigned int _id) const override;
58 
59  public: virtual bool HasSceneName(const std::string &_name) const
60  override;
61 
62  public: virtual ScenePtr SceneById(unsigned int _id) const override;
63 
64  public: virtual ScenePtr SceneByName(const std::string &_name) const
65  override;
66 
67  public: virtual ScenePtr SceneByIndex(unsigned int _index) const override;
68 
69  public: virtual void DestroyScene(ScenePtr _scene) override;
70 
71  public: virtual void DestroySceneById(unsigned int _id) override;
72 
73  public: virtual void DestroySceneByName(const std::string &_name)
74  override;
75 
76  public: virtual void DestroySceneByIndex(unsigned int _index) override;
77 
78  public: virtual void DestroyScenes() override;
79 
80  public: virtual ScenePtr CreateScene(const std::string &_name) override;
81 
82  public: virtual ScenePtr CreateScene(unsigned int _id,
83  const std::string &_name) override;
84 
85  public: virtual void Destroy() override;
86 
87  // Documentation Inherited
88  public: virtual void AddResourcePath(const std::string &_path) override;
89 
90  // Documentation Inherited
91  public: virtual RenderPassSystemPtr RenderPassSystem() const override;
92 
93  protected: virtual void PrepareScene(ScenePtr _scene);
94 
95  protected: virtual unsigned int NextSceneId();
96 
99  protected: virtual bool LoadImpl(
100  const std::map<std::string, std::string> &_params) = 0;
101 
102  protected: virtual bool InitImpl() = 0;
103 
104  protected: virtual ScenePtr CreateSceneImpl(unsigned int _id,
105  const std::string &_name) = 0;
106 
107  protected: virtual SceneStorePtr Scenes() const = 0;
108 
109  protected: bool loaded = false;
110 
111  protected: bool initialized = false;
112 
113  protected: unsigned int nextSceneId;
114 
118 
121  };
122  }
123  }
124 }
125 #endif
A class for creating and managing render passes.
Definition: RenderPassSystem.hh:54
std::vector< std::string > resourcePaths
a list of paths that render engines use to locate their resources
Definition: BaseRenderEngine.hh:117
RenderPassSystemPtr renderPassSystem
Render pass system for this render engine.
Definition: BaseRenderEngine.hh:120
STL class.
STL class.
Definition: BaseRenderEngine.hh:32
unsigned int nextSceneId
Definition: BaseRenderEngine.hh:113
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: RenderEngine.hh:36