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... | |
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 () |
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) |
void | SetGraphicsAPI (const rendering::GraphicsAPI &_graphicsAPI) |
Set the graphics API. More... | |
void | TextureId (void *_texturePtr) |
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()
GzRenderer | ( | ) |
Constructor.
Member Function Documentation
◆ Destroy()
void Destroy | ( | ) |
Destroy camera associated with this renderer.
◆ HandleKeyPress()
void HandleKeyPress | ( | const common::KeyEvent & | _e | ) |
Handle key press event for snapping.
- Parameters
-
[in] _e The key event to process.
◆ HandleKeyRelease()
void HandleKeyRelease | ( | const common::KeyEvent & | _e | ) |
Handle key release event for snapping.
- Parameters
-
[in] _e The key event to process.
◆ Initialize()
std::string Initialize | ( | ) |
Initialize the render engine and scene. On macOS this must be called on the main thread.
- 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] _dropText Text dropped on the scene [in] _dropPos Mouse drop screen position
◆ NewHoverEvent()
void NewHoverEvent | ( | const math::Vector2i & | _hoverPos | ) |
New hover event triggered.
- Parameters
-
[in] _hoverPos Mouse hover screen position
◆ NewMouseEvent()
void NewMouseEvent | ( | const common::MouseEvent & | _e | ) |
New mouse event triggered.
- Parameters
-
[in] _e New mouse event
◆ Render()
void Render | ( | RenderSync * | _renderSync | ) |
- Parameters
-
[in] _renderSync RenderSync to safely synchronize Qt and worker thread (this)
◆ SetGraphicsAPI()
void SetGraphicsAPI | ( | const rendering::GraphicsAPI & | _graphicsAPI | ) |
Set the graphics API.
- Parameters
-
[in] _graphicsAPI The type of graphics API
◆ TextureId()
void TextureId | ( | void * | _texturePtr | ) |
Values is constantly constantly cycled/swapped/changed from a worker thread Don't read this directly
- Parameters
-
[out] _texturePtr Pointer to a texture Id
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
The documentation for this class was generated from the following file: