Gazebo Gui

API Reference

8.3.0

gz-rendering renderer. All gz-rendering calls should be performed inside this class as it makes sure that opengl calls in the underlying render engine do not interfere with QtQuick's opengl render operations. The main Render function will render to an offscreen texture and notify via signal and slots when it's ready to be displayed. More...

#include <MinimalScene.hh>

Public Member Functions

 GzRenderer ()
 Constructor. More...
 
rendering::CameraPtr Camera ()
 Retrieves the internal camera. TODO(darksylinc): Remove this hack. More...
 
void Destroy ()
 Destroy camera associated with this renderer. More...
 
void HandleKeyPress (const common::KeyEvent &_e)
 Handle key press event for snapping. More...
 
void HandleKeyRelease (const common::KeyEvent &_e)
 Handle key release event for snapping. More...
 
std::string Initialize (RenderThreadRhi &_rhi)
 Initialize the render engine and scene. On macOS this must be called on the main thread. More...
 
void NewDropEvent (const std::string &_dropText, const math::Vector2i &_dropPos)
 New hover event triggered. More...
 
void NewHoverEvent (const math::Vector2i &_hoverPos)
 New hover event triggered. More...
 
void NewMouseEvent (const common::MouseEvent &_e)
 New mouse event triggered. More...
 
void Render (RenderSync *_renderSync, RenderThreadRhi &_renderThreadRhi)
 
void SetGraphicsAPI (const rendering::GraphicsAPI &_graphicsAPI)
 Set the graphics API. More...
 

Public Attributes

math::Color ambientLight = math::Color(0.3f, 0.3f, 0.3f, 1.0f)
 Ambient color. More...
 
math::Color backgroundColor = math::Color::Black
 Scene background color. More...
 
double cameraFarClip = 1000.0
 Default camera far clipping plane distance. More...
 
math::Angle cameraHFOV = math::Angle(M_PI * 0.5)
 Horizontal FOV of the camera;. More...
 
double cameraNearClip = 0.01
 Default camera near clipping plane distance. More...
 
math::Pose3d cameraPose = math::Pose3d(0, 0, 2, 0, 0.4, 0)
 Initial Camera pose. More...
 
std::string cameraViewController {""}
 View controller type. More...
 
std::string engineName = "ogre"
 Render engine to use. More...
 
bool initialized = false
 True if engine has been initialized;. More...
 
std::string sceneName = "scene"
 Unique scene name. More...
 
bool skyEnable = false
 True if sky is enabled;. More...
 
bool textureDirty = true
 Flag to indicate texture size has changed. More...
 
QSize textureSize = QSize(1024, 1024)
 Render texture size. More...
 

Detailed Description

gz-rendering renderer. All gz-rendering calls should be performed inside this class as it makes sure that opengl calls in the underlying render engine do not interfere with QtQuick's opengl render operations. The main Render function will render to an offscreen texture and notify via signal and slots when it's ready to be displayed.

Constructor & Destructor Documentation

◆ GzRenderer()

Constructor.

Member Function Documentation

◆ Camera()

Retrieves the internal camera. TODO(darksylinc): Remove this hack.

◆ Destroy()

void Destroy ( )

Destroy camera associated with this renderer.

◆ HandleKeyPress()

void HandleKeyPress ( const common::KeyEvent &  _e)

Handle key press event for snapping.

Parameters
[in]_eThe key event to process.

◆ HandleKeyRelease()

void HandleKeyRelease ( const common::KeyEvent &  _e)

Handle key release event for snapping.

Parameters
[in]_eThe key event to process.

◆ Initialize()

std::string Initialize ( RenderThreadRhi _rhi)

Initialize the render engine and scene. On macOS this must be called on the main thread.

Parameters
[in]_rhiour caller
Returns
Error message if initialization failed. If empty, no errors occurred.

◆ NewDropEvent()

void NewDropEvent ( const std::string _dropText,
const math::Vector2i _dropPos 
)

New hover event triggered.

Parameters
[in]_dropTextText dropped on the scene
[in]_dropPosMouse drop screen position

◆ NewHoverEvent()

void NewHoverEvent ( const math::Vector2i _hoverPos)

New hover event triggered.

Parameters
[in]_hoverPosMouse hover screen position

◆ NewMouseEvent()

void NewMouseEvent ( const common::MouseEvent &  _e)

New mouse event triggered.

Parameters
[in]_eNew mouse event

◆ Render()

void Render ( RenderSync *  _renderSync,
RenderThreadRhi _renderThreadRhi 
)
Parameters
[in]_renderSyncRenderSync to safely synchronize Qt and worker thread (this)
[in]_renderThreadRhiOur caller

◆ SetGraphicsAPI()

void SetGraphicsAPI ( const rendering::GraphicsAPI _graphicsAPI)

Set the graphics API.

Parameters
[in]_graphicsAPIThe type of graphics API

Member Data Documentation

◆ ambientLight

math::Color ambientLight = math::Color(0.3f, 0.3f, 0.3f, 1.0f)

Ambient color.

◆ backgroundColor

math::Color backgroundColor = math::Color::Black

Scene background color.

◆ cameraFarClip

double cameraFarClip = 1000.0

Default camera far clipping plane distance.

◆ cameraHFOV

math::Angle cameraHFOV = math::Angle(M_PI * 0.5)

Horizontal FOV of the camera;.

◆ cameraNearClip

double cameraNearClip = 0.01

Default camera near clipping plane distance.

◆ cameraPose

math::Pose3d cameraPose = math::Pose3d(0, 0, 2, 0, 0.4, 0)

Initial Camera pose.

◆ cameraViewController

std::string cameraViewController {""}

View controller type.

◆ engineName

std::string engineName = "ogre"

Render engine to use.

◆ initialized

bool initialized = false

True if engine has been initialized;.

◆ sceneName

std::string sceneName = "scene"

Unique scene name.

◆ skyEnable

bool skyEnable = false

True if sky is enabled;.

◆ textureDirty

bool textureDirty = true

Flag to indicate texture size has changed.

◆ textureSize

QSize textureSize = QSize(1024, 1024)

Render texture size.


The documentation for this class was generated from the following file: