18 #ifndef IGNITION_GUI_PLUGINS_SCENE3D_HH_ 19 #define IGNITION_GUI_PLUGINS_SCENE3D_HH_ 29 #include <ignition/utils/ImplPtr.hh> 82 public slots:
void OnHovered(
int _mouseX,
int _mouseY);
93 int _mouseX,
int _mouseY);
115 IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
129 public: IgnRenderer();
133 public:
void Render(RenderSync *_renderSync);
141 public:
void Destroy();
154 public:
void NewDropEvent(
const std::string &_dropText,
166 private:
void HandleMouseEvent();
169 private:
void BroadcastHoverPos();
172 private:
void BroadcastDrag();
175 private:
void BroadcastLeftClick();
178 private:
void BroadcastRightClick();
181 private:
void BroadcastMousePress();
184 private:
void BroadcastScroll();
187 private:
void BroadcastKeyRelease();
190 private:
void BroadcastDrop();
193 private:
void BroadcastKeyPress();
217 public:
double cameraNearClip = 0.01;
220 public:
double cameraFarClip = 1000.0;
229 public:
bool initialized =
false;
235 public:
bool textureDirty =
false;
238 public:
bool skyEnable =
false;
242 IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
256 public slots:
void RenderNext(RenderSync *_renderSync);
259 public slots:
void ShutDown();
262 public slots:
void SizeChanged();
268 signals:
void TextureReady(uint _id,
const QSize &_size);
278 public: QOffscreenSurface *surface =
nullptr;
281 public: QOpenGLContext *context =
nullptr;
300 public:
void SetBackgroundColor(
const math::Color &_color);
304 public:
void SetAmbientLight(
const math::Color &_ambient);
308 public:
void SetEngineName(
const std::string &_name);
312 public:
void SetSceneName(
const std::string &_name);
320 public:
void SetCameraNearClip(
double _near);
324 public:
void SetCameraFarClip(
double _far);
339 public:
void SetSkyEnabled(
const bool &_sky);
342 public Q_SLOTS:
void Ready();
357 public:
void StopRendering();
360 protected:
virtual void mousePressEvent(
QMouseEvent *_e)
override;
363 protected:
virtual void mouseReleaseEvent(
QMouseEvent *_e)
override;
366 protected:
virtual void mouseMoveEvent(
QMouseEvent *_e)
override;
369 protected:
virtual void keyPressEvent(
QKeyEvent *_e)
override;
372 protected:
virtual void keyReleaseEvent(
QKeyEvent *_e)
override;
375 protected:
virtual void wheelEvent(
QWheelEvent *_e)
override;
383 private: QSGNode *updatePaintNode(QSGNode *_oldNode,
384 QQuickItem::UpdatePaintNodeData *_data)
override;
388 IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
400 public:
explicit TextureNode(QQuickWindow *_window,
401 RenderSync &_renderSync);
410 public slots:
void NewTexture(uint _id,
const QSize &_size);
414 public slots:
void PrepareNode();
417 signals:
void TextureInUse(RenderSync *_renderSync);
421 signals:
void PendingNewTexture();
436 public: QSGTexture *texture =
nullptr;
439 public: QQuickWindow *window =
nullptr;
Creates an ignition rendering scene and user camera. It is possible to orbit the camera around the sc...
Definition: MinimalScene.hh:64
void OnHovered(int _mouseX, int _mouseY)
Callback when the mouse hovers to a new position.
GLuint textureId
Render texture id.
Definition: MinimalScene.hh:205
Q_INVOKABLE void SetLoadingError(const QString &_loadingError)
Set the loading error message.
Definition: Application.hh:35
Q_INVOKABLE QString LoadingError() const
Get the loading error string.
void OnDropped(const QString &_drop, int _mouseX, int _mouseY)
Callback when receives a drop event.
Base class for Ignition GUI plugins.
Definition: Plugin.hh:54
std::function< void(const QString &)> errorCb
Function to be called if there are errors.
Definition: MinimalScene.hh:275
void OnFocusWindow()
Callback when the mouse enters the render window to focus the window for mouse/key events...
RenderSync & renderSync
See RenderSync.
Definition: MinimalScene.hh:433
A QQUickItem that manages the render window.
Definition: MinimalScene.hh:288
Ign-rendering renderer. All ign-rendering calls should be performed inside this class as it makes sur...
Definition: MinimalScene.hh:126
Rendering thread.
Definition: MinimalScene.hh:246
QMutex mutex
Mutex to protect the texture variables.
Definition: MinimalScene.hh:430
Texture node for displaying the render texture from ign-renderer.
Definition: MinimalScene.hh:392
void LoadingErrorChanged()
Notify that loading error has changed.
QString loadingError
Loading error message.
Definition: MinimalScene.hh:74
IgnRenderer ignRenderer
Ign-rendering renderer.
Definition: MinimalScene.hh:284
virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override
Load the plugin with a configuration file. Override this on custom plugins to handle custom configura...