Gazebo Gui

API Reference

9.0.0~pre1

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

Public Attributes

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

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()

rendering::CameraPtr 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.

◆ directionalLightTextureSize

std::optional<unsigned int> directionalLightTextureSize

Shadow texture size for directional light.

◆ 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: