18 #ifndef IGNITION_GUI_PLUGINS_SCENE3D_HH_ 19 #define IGNITION_GUI_PLUGINS_SCENE3D_HH_ 29 #include <ignition/utils/ImplPtr.hh> 66 public slots:
void OnHovered(
int _mouseX,
int _mouseY);
77 int _mouseX,
int _mouseY);
80 public:
virtual void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
85 IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
103 public:
void Render(RenderSync *_renderSync);
106 public:
void Initialize();
109 public:
void Destroy();
122 public:
void NewDropEvent(
const std::string &_dropText,
134 private:
void HandleMouseEvent();
137 private:
void BroadcastHoverPos();
140 private:
void BroadcastDrag();
143 private:
void BroadcastLeftClick();
146 private:
void BroadcastRightClick();
149 private:
void BroadcastMousePress();
152 private:
void BroadcastScroll();
155 private:
void BroadcastKeyRelease();
158 private:
void BroadcastDrop();
161 private:
void BroadcastKeyPress();
191 public:
bool initialized =
false;
197 public:
bool textureDirty =
false;
217 public:
bool skyEnable =
false;
221 IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
234 public slots:
void RenderNext(RenderSync *renderSync);
237 public slots:
void ShutDown();
240 public slots:
void SizeChanged();
246 signals:
void TextureReady(uint _id,
const QSize &_size);
249 public: QOffscreenSurface *surface =
nullptr;
252 public: QOpenGLContext *context =
nullptr;
271 public:
void SetBackgroundColor(
const math::Color &_color);
275 public:
void SetAmbientLight(
const math::Color &_ambient);
279 public:
void SetEngineName(
const std::string &_name);
283 public:
void SetSceneName(
const std::string &_name);
293 public:
void SetSceneService(
const std::string &_service);
299 public:
void SetPoseTopic(
const std::string &_topic);
305 public:
void SetDeletionTopic(
const std::string &_topic);
310 public:
void SetSceneTopic(
const std::string &_topic);
325 public:
void SetSkyEnabled(
const bool &_sky);
328 public Q_SLOTS:
void Ready();
339 protected:
virtual void mousePressEvent(
QMouseEvent *_e)
override;
342 protected:
virtual void mouseReleaseEvent(
QMouseEvent *_e)
override;
345 protected:
virtual void mouseMoveEvent(
QMouseEvent *_e)
override;
348 protected:
virtual void keyPressEvent(
QKeyEvent *_e)
override;
351 protected:
virtual void keyReleaseEvent(
QKeyEvent *_e)
override;
354 protected:
virtual void wheelEvent(
QWheelEvent *_e)
override;
362 private: QSGNode *updatePaintNode(QSGNode *_oldNode,
363 QQuickItem::UpdatePaintNodeData *_data)
override;
367 IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
377 public:
explicit TextureNode(QQuickWindow *_window,
378 RenderSync &_renderSync);
387 public slots:
void NewTexture(uint _id,
const QSize &_size);
391 public slots:
void PrepareNode();
394 signals:
void TextureInUse(RenderSync *_renderSync);
398 signals:
void PendingNewTexture();
413 public: QSGTexture *texture =
nullptr;
416 public: QQuickWindow *window =
nullptr;
Creates a new ignition rendering scene or adds a user-camera to an existing scene. It is possible to orbit the camera around the scene with the mouse. Use other plugins to manage objects in the scene.
Definition: MinimalScene.hh:56
void OnHovered(int _mouseX, int _mouseY)
Callback when the mouse hovers to a new position.
GLuint textureId
Render texture id.
Definition: MinimalScene.hh:173
std::string sceneService
Scene service. If not empty, a request will be made to get the scene information using this service a...
Definition: MinimalScene.hh:202
MinimalScene()
Constructor.
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
void OnFocusWindow()
Callback when the mouse enters the render window to focus the window for mouse/key events...
std::string poseTopic
Scene pose topic. If not empty, a node will subcribe to this topic to get pose updates of objects in ...
Definition: MinimalScene.hh:206
RenderSync & renderSync
See RenderSync.
Definition: MinimalScene.hh:410
A QQUickItem that manages the render window.
Definition: MinimalScene.hh:259
std::string deletionTopic
Ign-transport deletion topic name.
Definition: MinimalScene.hh:209
Ign-rendering renderer. All ign-rendering calls should be performed inside this class as it makes sur...
Definition: MinimalScene.hh:96
Rendering thread.
Definition: MinimalScene.hh:225
QMutex mutex
Mutex to protect the texture variables.
Definition: MinimalScene.hh:407
Texture node for displaying the render texture from ign-renderer.
Definition: MinimalScene.hh:371
std::string sceneTopic
Ign-transport scene topic name New scene messages will be published to this topic when an entities ar...
Definition: MinimalScene.hh:214
IgnRenderer ignRenderer
Ign-rendering renderer.
Definition: MinimalScene.hh:255
virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override
Load the plugin with a configuration file. Override this on custom plugins to handle custom configura...