Ignition Rendering

API Reference

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