Gazebo Rendering

API Reference

6.6.3
gz/rendering/RenderEngine.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 GZ_RENDERING_RENDERENGINE_HH_
18 #define GZ_RENDERING_RENDERENGINE_HH_
19 
20 #include <map>
21 #include <string>
22 #include "gz/rendering/config.hh"
24 #include "gz/rendering/Export.hh"
25 
26 namespace ignition
27 {
28  namespace rendering
29  {
30  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
31  //
36  class IGNITION_RENDERING_VISIBLE RenderEngine
37  {
39  public: virtual ~RenderEngine() { }
40 
46  public: virtual bool Load(
47  const std::map<std::string, std::string> &_params = {}) = 0;
48 
52  public: virtual bool Init() = 0;
53 
58  public: virtual void Destroy() = 0;
59 
60  // TODO(anyone): merge with Destroy
61  public: virtual bool Fini() = 0;
62 
65  public: virtual bool IsLoaded() const = 0;
66 
69  public: virtual bool IsInitialized() const = 0;
70 
75  public: virtual bool IsEnabled() const = 0;
76 
79  public: virtual std::string Name() const = 0;
80 
84  public: virtual unsigned int SceneCount() const = 0;
85 
90  public: virtual bool HasScene(ConstScenePtr _scene) const = 0;
91 
96  public: virtual bool HasSceneId(unsigned int _id) const = 0;
97 
102  public: virtual bool HasSceneName(const std::string &_name) const = 0;
103 
108  public: virtual ScenePtr SceneById(unsigned int _id) const = 0;
109 
114  public: virtual ScenePtr SceneByName(
115  const std::string &_name) const = 0;
116 
123  public: virtual ScenePtr SceneByIndex(unsigned int _index) const = 0;
124 
128  public: virtual void DestroyScene(ScenePtr _scene) = 0;
129 
133  public: virtual void DestroySceneById(unsigned int _id) = 0;
134 
138  public: virtual void DestroySceneByName(const std::string &_name) = 0;
139 
143  public: virtual void DestroySceneByIndex(unsigned int _index) = 0;
144 
146  public: virtual void DestroyScenes() = 0;
147 
154  public: virtual ScenePtr CreateScene(const std::string &_name) = 0;
155 
163  public: virtual ScenePtr CreateScene(unsigned int _id,
164  const std::string &_name) = 0;
165 
169  public: virtual void SetHeadless(bool _headless) = 0;
170 
173  public: virtual bool Headless() const = 0;
174 
177  public: virtual void AddResourcePath(const std::string &_path) = 0;
178 
180  public: virtual RenderPassSystemPtr RenderPassSystem() const = 0;
181  };
182  }
183  }
184 }
185 #endif
virtual void DestroySceneByName(const std::string &_name)=0
Destroy the scene with the given name. If no scenes exist with the given name, no work will be done.
STL class.
virtual bool HasSceneId(unsigned int _id) const =0
Determine if this render-engine manages a scene with the given ID.
virtual void DestroySceneById(unsigned int _id)=0
Destroy the scene with the given ID. If no scenes exist with the given ID, no work will be done.
virtual bool IsLoaded() const =0
Determines if the render-engine has been loaded.
virtual ~RenderEngine()
Deconstructor.
Definition: gz/rendering/RenderEngine.hh:39
virtual ScenePtr CreateScene(const std::string &_name)=0
Create a new scene with the given name. The given name should be unique across all scenes managed by ...
virtual ScenePtr SceneByIndex(unsigned int _index) const =0
Get the scene at the given index. If no scenes exist at the given index, NULL will be returned.
virtual std::string Name() const =0
Get name of the render-engine.
shared_ptr< const Scene > ConstScenePtr
Definition: gz/rendering/RenderTypes.hh:397
virtual bool HasSceneName(const std::string &_name) const =0
Determine if this render-engine manages a scene with the given name.
shared_ptr< RenderPassSystem > RenderPassSystemPtr
Shared pointer to RenderPassSystem.
Definition: gz/rendering/RenderTypes.hh:231
virtual void SetHeadless(bool _headless)=0
Set headless mode Only available in OGRE 2.2, which makes use of EGL.
virtual ScenePtr SceneById(unsigned int _id) const =0
Get the scene with the given ID. If no scenes exist with the given ID, NULL will be returned.
virtual void Destroy()=0
Destroys all scenes created by render-engine and releases all loaded resources. This should be called...
STL class.
virtual bool IsInitialized() const =0
Determines if the render-engine has been initialized.
virtual RenderPassSystemPtr RenderPassSystem() const =0
Get the render pass system for this engine.
virtual bool IsEnabled() const =0
Determines if the render-engine can be used. Despite loading and initializing the render-engine,...
virtual void DestroyScenes()=0
Destroy all scenes managed by this render-engine.
virtual void AddResourcePath(const std::string &_path)=0
Add path to media resource location.
virtual void DestroySceneByIndex(unsigned int _index)=0
Destroy the scene at the given index. If no scenes exist at the given index, no work will be done.
virtual bool Headless() const =0
Get headless mode.
virtual void DestroyScene(ScenePtr _scene)=0
Destroy the given scene. If the given scene is not managed by this render-engine, no work will be don...
virtual unsigned int SceneCount() const =0
Get the number of scenes actively managed by this render-engine.
shared_ptr< Scene > ScenePtr
Shared pointer to Scene.
Definition: gz/rendering/RenderTypes.hh:246
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: gz/rendering/RenderEngine.hh:36
virtual bool Load(const std::map< std::string, std::string > &_params={})=0
Load any necessary resources to set up render-engine. This should called before any other function.
virtual bool Init()=0
Initialize the render-engine. This should be called immediately after a successful call to Load.
virtual bool HasScene(ConstScenePtr _scene) const =0
Determine if the given scene is actively managed by this render-engine.
virtual ScenePtr SceneByName(const std::string &_name) const =0
Get the scene with the given name. If no scenes exist with the given name, NULL will be returned.