Gazebo Gui

API Reference

9.0.0
MinimalSceneRhiVulkan.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHIVULKAN_HH_
19#define GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHIVULKAN_HH_
20
21#include "MinimalSceneRhi.hh"
22#include "gz/gui/Plugin.hh"
23
24#include <QQuickWindow>
25#include <QSGTexture>
26#include <QSize>
27
28#include <memory>
29#include <string>
30
31namespace gz::gui::plugins
32{
34 class GzCameraTextureRhiVulkanPrivate;
35
38 {
39 // Documentation inherited
40 public: virtual ~GzCameraTextureRhiVulkan() override;
41
44
45 // Documentation inherited
46 public: virtual void Update(rendering::CameraPtr _camera) override;
47
50 };
51
53 class RenderThreadRhiVulkanPrivate;
54
57 {
58 // Documentation inherited
59 public: virtual ~RenderThreadRhiVulkan() override;
60
63 public: explicit RenderThreadRhiVulkan(GzRenderer *_renderer);
64
65 // Documentation inherited
66 public: virtual QOffscreenSurface *Surface() const override;
67
68 // Documentation inherited
69 public: virtual void SetSurface(QOffscreenSurface *_surface) override;
70
71 // Documentation inherited
72 public: virtual std::string Initialize() override;
73
74 // Documentation inherited
75 public: virtual void Update(rendering::CameraPtr _camera) override;
76
77 // Documentation inherited
78 public: virtual void RenderNext(RenderSync *_renderSync) override;
79
80 // Documentation inherited
81 public: virtual void* TexturePtr() const override;
82
83 // Documentation inherited
84 public: virtual QSize TextureSize() const override;
85
86 // Documentation inherited
87 public: virtual void ShutDown() override;
88
90 private: RenderThreadRhiVulkan(
91 const RenderThreadRhiVulkan &_other) = delete;
92 private: RenderThreadRhiVulkan& operator=(
93 const RenderThreadRhiVulkan &_other) = delete;
94
97 };
98
100 class TextureNodeRhiVulkanPrivate;
101
104 {
105 // Documentation inherited
106 public: virtual ~TextureNodeRhiVulkan() override;
107
111 public: explicit TextureNodeRhiVulkan(QQuickWindow *_window,
112 rendering::CameraPtr &_camera);
113
114 // Documentation inherited
115 public: virtual QSGTexture *Texture() const override;
116
117 // Documentation inherited
118 public: virtual bool HasNewTexture() const override;
119
120 // Documentation inherited
121 public: virtual void NewTexture(
122 void* _texturePtr, const QSize &_size) override;
123
124 // Documentation inherited
125 public: virtual void PrepareNode() override;
126
128 private: TextureNodeRhiVulkan(
129 const TextureNodeRhiVulkan &_other) = delete;
130 private: TextureNodeRhiVulkan& operator=(
131 const TextureNodeRhiVulkan &_other) = delete;
132
135 };
136} // namespace gz::gui::plugins
137
138#endif