18 #ifndef IGNITION_GUI_PLUGINS_SCENE3D_HH_ 19 #define IGNITION_GUI_PLUGINS_SCENE3D_HH_ 41 class IgnRendererPrivate;
42 class RenderWindowItemPrivate;
74 public slots:
void OnHovered(
int _mouseX,
int _mouseY);
84 public:
virtual void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
107 public:
void Render();
110 public:
void Initialize();
113 public:
void Destroy();
127 public:
void HandleKeyPress(
QKeyEvent *_e);
131 public:
void HandleKeyRelease(
QKeyEvent *_e);
134 private:
void HandleMouseEvent();
137 private:
void HandleMouseViewControl();
140 private:
void BroadcastHoverPos();
143 private:
void BroadcastLeftClick();
146 private:
void BroadcastRightClick();
149 private:
void BroadcastKeyRelease();
152 private:
void BroadcastKeyPress();
162 public: GLuint textureId = 0u;
180 public:
bool initialized =
false;
183 public:
QSize textureSize =
QSize(1024, 1024);
186 public:
bool textureDirty =
false;
219 public slots:
void RenderNext();
222 public slots:
void ShutDown();
225 public slots:
void SizeChanged();
231 signals:
void TextureReady(
int _id,
const QSize &_size);
234 public: QOffscreenSurface *surface =
nullptr;
237 public: QOpenGLContext *context =
nullptr;
258 public:
void SetBackgroundColor(
const math::Color &_color);
262 public:
void SetAmbientLight(
const math::Color &_ambient);
266 public:
void SetEngineName(
const std::string &_name);
270 public:
void SetSceneName(
const std::string &_name);
280 public:
void SetSceneService(
const std::string &_service);
286 public:
void SetPoseTopic(
const std::string &_topic);
292 public:
void SetDeletionTopic(
const std::string &_topic);
297 public:
void SetSceneTopic(
const std::string &_topic);
305 public Q_SLOTS:
void Ready();
309 public:
void HandleKeyPress(
QKeyEvent *_e);
313 public:
void HandleKeyRelease(
QKeyEvent *_e);
316 protected:
virtual void mousePressEvent(
QMouseEvent *_e)
override;
319 protected:
virtual void mouseReleaseEvent(
QMouseEvent *_e)
override;
322 protected:
virtual void mouseMoveEvent(
QMouseEvent *_e)
override;
325 protected:
virtual void wheelEvent(
QWheelEvent *_e)
override;
328 protected:
virtual void keyPressEvent(
QKeyEvent *_event)
override;
331 protected:
virtual void keyReleaseEvent(
QKeyEvent *_event)
override;
339 private: QSGNode *updatePaintNode(QSGNode *_oldNode,
340 QQuickItem::UpdatePaintNodeData *_data)
override;
354 public:
explicit TextureNode(QQuickWindow *_window);
363 public slots:
void NewTexture(
int _id,
const QSize &_size);
367 public slots:
void PrepareNode();
371 signals:
void TextureInUse();
375 signals:
void PendingNewTexture();
387 public: QSGTexture *texture =
nullptr;
390 public: QQuickWindow *window =
nullptr;
void OnHovered(int _mouseX, int _mouseY)
Callback when the mouse hovers to a new position.
virtual ~Scene3D()
Destructor.
Base class for Ignition GUI plugins.
Definition: Plugin.hh:54
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: Scene3D.hh:61
A QQUickItem that manages the render window.
Definition: MinimalScene.hh:259
static const Vector2< T > Zero
void OnFocusWindow()
Callback when the mouse enters the render window to focus the window for mouse/key events...
virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override
Load the plugin with a configuration file. Override this on custom plugins to handle custom configura...
Ign-rendering renderer. All ign-rendering calls should be performed inside this class as it makes sur...
Definition: MinimalScene.hh:96
bool eventFilter(QObject *_obj, QEvent *_event) override
Rendering thread.
Definition: MinimalScene.hh:225
Texture node for displaying the render texture from ign-renderer.
Definition: MinimalScene.hh:371