##

RenderEngine.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_RENDERING_RENDERENGINE_HH_
#define _GAZEBO_RENDERING_RENDERENGINE_HH_
#include <memory>
#include <string>
#include <vector>
#include "gazebo/common/SingletonT.hh"
#include "gazebo/rendering/ogre_gazebo.h"
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/util/system.hh"
GZ_SINGLETON_DECLARE(GZ_RENDERING_VISIBLE, gazebo, rendering, RenderEngine)
namespace Ogre
{
class Root;
class OverlaySystem;
}
namespace gazebo
{
namespace rendering
{
// Forward declare private data.
class RenderEnginePrivate;
class GZ_RENDERING_VISIBLE RenderEngine : public SingletonT<RenderEngine>
{
public: enum RenderPathType
{
NONE = 0,
VERTEX = 1,
FORWARD = 2,
DEFERRED = 3,
RENDER_PATH_COUNT
};
private: RenderEngine();
private: virtual ~RenderEngine();
public: void Load();
public: void Init();
public: void Fini();
public: ScenePtr CreateScene(const std::string &_name,
bool _enableVisualizations,
bool _isServer = false);
public: void RemoveScene(const std::string &_name);
public: ScenePtr GetScene(const std::string &_name="");
public: ScenePtr GetScene(unsigned int _index);
public: unsigned int SceneCount() const;
public: void AddResourcePath(const std::string &_uri);
public: RenderPathType GetRenderPathType() const;
public: WindowManagerPtr GetWindowManager() const;
public: Ogre::Root *Root() const;
public: std::vector<unsigned int> FSAALevels() const;
#if OGRE_VERSION_MAJOR > 1 || OGRE_VERSION_MINOR >= 9
public: Ogre::OverlaySystem *OverlaySystem() const;
#endif
private: bool CreateContext();
private: void LoadPlugins();
private: void SetupResources();
private: void SetupRenderSystem();
private: void PreRender();
private: void Render();
private: void PostRender();
private: void CheckSystemCapabilities();
protected: uint64_t dummyWindowId;
protected: void *dummyDisplay;
protected: void *dummyContext;
private: friend class SingletonT<RenderEngine>;
private: std::unique_ptr<RenderEnginePrivate> dataPtr;
};
}
}
#endif
Ogre
Definition: JointMaker.hh:39
gazebo::rendering::RenderEngine::Fini
void Fini()
Tears down the rendering engine.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::rendering::RenderEngine::FSAALevels
std::vector< unsigned int > FSAALevels() const
Get a list of all supported FSAA levels for this render system.
gazebo::rendering::RenderEngine::RENDER_PATH_COUNT
Count of the rendering path enums.
Definition: RenderEngine.hh:70
SingletonT
Singleton template class.
Definition: SingletonT.hh:33
gazebo::rendering::RenderEngine::GetRenderPathType
RenderPathType GetRenderPathType() const
Get the type of rendering path to use.
gazebo::rendering::RenderEngine::RenderPathType
RenderPathType
The type of rendering path used by the rendering engine.
Definition: RenderEngine.hh:59
gazebo::rendering::RenderEngine::GetWindowManager
WindowManagerPtr GetWindowManager() const
Get a pointer to the window manager.
gazebo::rendering::RenderEngine::Root
Ogre::Root * Root() const
Get a pointer to the Ogre root object.
gazebo::rendering::RenderEngine
Adaptor to Ogre3d.
Definition: RenderEngine.hh:55
gazebo::rendering::RenderEngine::RemoveScene
void RemoveScene(const std::string &_name)
Remove a scene.
system.hh
gazebo::rendering::RenderEngine::VERTEX
Most basic rendering, with least fidelity.
Definition: RenderEngine.hh:64
gazebo::rendering::RenderEngine::CreateScene
ScenePtr CreateScene(const std::string &_name, bool _enableVisualizations, bool _isServer=false)
Create a scene.
gazebo::rendering::RenderEngine::SceneCount
unsigned int SceneCount() const
Get the number of scenes.
gazebo::rendering::ScenePtr
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
gazebo::rendering::RenderEngine::GetScene
ScenePtr GetScene(const std::string &_name="")
Get a scene by name.
RenderTypes.hh
rendering
rendering
Definition: RenderEngine.hh:31
gazebo
gazebo
Definition: RenderEngine.hh:31
gazebo::rendering::RenderEngine::dummyContext
void * dummyContext
GLX context used to render the scenes.Used for gui-less operation.
Definition: RenderEngine.hh:179
gazebo::rendering::RenderEngine::dummyWindowId
uint64_t dummyWindowId
ID for a dummy window. Used for gui-less operation.
Definition: RenderEngine.hh:172
gazebo::rendering::RenderEngine::DEFERRED
Utilizes deferred rendering. Best fidelity.
Definition: RenderEngine.hh:68
ogre_gazebo.h
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::rendering::RenderEngine::dummyDisplay
void * dummyDisplay
Pointer to the dummy display.Used for gui-less operation.
Definition: RenderEngine.hh:175
gazebo::rendering::RenderEngine::AddResourcePath
void AddResourcePath(const std::string &_uri)
Add a new path for Ogre to search for resources.
gazebo::rendering::RenderEngine::NONE
No rendering is done.
Definition: RenderEngine.hh:62
gazebo::rendering::WindowManagerPtr
boost::shared_ptr< WindowManager > WindowManagerPtr
Definition: RenderTypes.hh:186
gazebo::rendering::RenderEngine::Init
void Init()
Initialize Ogre. Load must happen before Init.
gazebo::rendering::RenderEngine::Load
void Load()
Load the parameters for Ogre. Load must happen before Init.
GZ_SINGLETON_DECLARE
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61
SingletonT.hh
gazebo::rendering::RenderEngine::FORWARD
Utilizes the RTT shader system.
Definition: RenderEngine.hh:66