Ign-rendering renderer. All ign-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 | |
IgnRenderer () | |
Constructor. More... | |
IgnRenderer () | |
Constructor. More... | |
~IgnRenderer () | |
Destructor. More... | |
void | Destroy () |
Destroy camera associated with this renderer. More... | |
void | Destroy () |
Destroy camera associated with this renderer. More... | |
void | HandleKeyPress (const common::KeyEvent &_e) |
Handle key press event for snapping. More... | |
void | HandleKeyPress (QKeyEvent *_e) |
Handle key press event for snapping. More... | |
void | HandleKeyRelease (const common::KeyEvent &_e) |
Handle key release event for snapping. More... | |
void | HandleKeyRelease (QKeyEvent *_e) |
Handle key release event for snapping. More... | |
std::string | Initialize () |
Initialize the render engine. More... | |
std::string | Initialize () |
Initialize the render engine. 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 | NewHoverEvent (const math::Vector2i &_hoverPos) |
New hover event triggered. More... | |
void | NewMouseEvent (const common::MouseEvent &_e) |
New mouse event triggered. More... | |
void | NewMouseEvent (const common::MouseEvent &_e, const math::Vector2d &_drag=math::Vector2d::Zero) |
New mouse event triggered. More... | |
void | Render () |
Main render function. More... | |
void | Render (RenderSync *_renderSync) |
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 | deletionTopic |
Ign-transport deletion topic name. More... | |
std::string | engineName = "ogre" |
Render engine to use. More... | |
bool | initialized = false |
True if engine has been initialized;. More... | |
std::string | poseTopic |
Scene pose topic. If not empty, a node will subcribe to this topic to get pose updates of objects in the scene. More... | |
std::string | sceneName = "scene" |
Unique scene name. More... | |
std::string | sceneService |
Scene service. If not empty, a request will be made to get the scene information using this service and the renderer will populate the scene based on the response data. More... | |
std::string | sceneTopic |
Ign-transport scene topic name New scene messages will be published to this topic when an entities are added. More... | |
bool | skyEnable = false |
True if sky is enabled;. More... | |
bool | textureDirty = false |
Flag to indicate texture size has changed. More... | |
GLuint | textureId = 0u |
Render texture id. More... | |
QSize | textureSize = QSize(1024, 1024) |
Render texture size. More... | |
Detailed Description
Ign-rendering renderer. All ign-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
◆ IgnRenderer() [1/2]
IgnRenderer | ( | ) |
Constructor.
◆ IgnRenderer() [2/2]
IgnRenderer | ( | ) |
Constructor.
◆ ~IgnRenderer()
~IgnRenderer | ( | ) |
Destructor.
Member Function Documentation
◆ Destroy() [1/2]
void Destroy | ( | ) |
Destroy camera associated with this renderer.
◆ Destroy() [2/2]
void Destroy | ( | ) |
Destroy camera associated with this renderer.
◆ HandleKeyPress() [1/2]
void HandleKeyPress | ( | const common::KeyEvent & | _e | ) |
Handle key press event for snapping.
- Parameters
-
[in] _e The key event to process.
◆ HandleKeyPress() [2/2]
void HandleKeyPress | ( | QKeyEvent * | _e | ) |
Handle key press event for snapping.
- Parameters
-
[in] _e The key event to process.
◆ HandleKeyRelease() [1/2]
void HandleKeyRelease | ( | const common::KeyEvent & | _e | ) |
Handle key release event for snapping.
- Parameters
-
[in] _e The key event to process.
◆ HandleKeyRelease() [2/2]
void HandleKeyRelease | ( | QKeyEvent * | _e | ) |
Handle key release event for snapping.
- Parameters
-
[in] _e The key event to process.
◆ Initialize() [1/2]
std::string Initialize | ( | ) |
Initialize the render engine.
- Returns
- Error message if initialization failed. If empty, no errors occurred.
◆ Initialize() [2/2]
std::string Initialize | ( | ) |
Initialize the render engine.
- 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() [1/2]
void NewHoverEvent | ( | const math::Vector2i & | _hoverPos | ) |
New hover event triggered.
- Parameters
-
[in] _hoverPos Mouse hover screen position
◆ NewHoverEvent() [2/2]
void NewHoverEvent | ( | const math::Vector2i & | _hoverPos | ) |
New hover event triggered.
- Parameters
-
[in] _hoverPos Mouse hover screen position
◆ NewMouseEvent() [1/2]
void NewMouseEvent | ( | const common::MouseEvent & | _e | ) |
New mouse event triggered.
- Parameters
-
[in] _e New mouse event
◆ NewMouseEvent() [2/2]
void NewMouseEvent | ( | const common::MouseEvent & | _e, |
const math::Vector2d & | _drag = math::Vector2d::Zero |
||
) |
New mouse event triggered.
- Parameters
-
[in] _e New mouse event [in] _drag Mouse move distance
◆ Render() [1/2]
void Render | ( | ) |
Main render function.
◆ Render() [2/2]
void Render | ( | RenderSync * | _renderSync | ) |
- Parameters
-
[in] _renderSync RenderSync to safely synchronize Qt and worker thread (this)
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.
◆ deletionTopic
std::string deletionTopic |
Ign-transport deletion topic name.
◆ engineName
std::string engineName = "ogre" |
Render engine to use.
◆ initialized
bool initialized = false |
True if engine has been initialized;.
◆ poseTopic
std::string poseTopic |
Scene pose topic. If not empty, a node will subcribe to this topic to get pose updates of objects in the scene.
◆ sceneName
std::string sceneName = "scene" |
Unique scene name.
◆ sceneService
std::string sceneService |
Scene service. If not empty, a request will be made to get the scene information using this service and the renderer will populate the scene based on the response data.
◆ sceneTopic
std::string sceneTopic |
Ign-transport scene topic name New scene messages will be published to this topic when an entities are added.
◆ skyEnable
bool skyEnable = false |
True if sky is enabled;.
◆ textureDirty
bool textureDirty = false |
Flag to indicate texture size has changed.
◆ textureId
GLuint textureId = 0u |
Render texture id.
Values is constantly constantly cycled/swapped/changed from a worker thread Don't read this directly
◆ textureSize
The documentation for this class was generated from the following files: