Gazebo Gui

API Reference

7.2.2
MinimalSceneRhi.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_MINIMALSCENERHI_HH_
19 #define GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHI_HH_
20 
21 #include <string>
22 
23 #include "gz/gui/Plugin.hh"
24 #include "gz/rendering/RenderTypes.hh"
25 
26 #include <QSGTexture>
27 #include <QSize>
28 
29 namespace gz::gui::plugins
30 {
33  //
37  {
39  public: virtual ~GzCameraTextureRhi();
40 
43  public: virtual void Update(rendering::CameraPtr _camera) = 0;
44 
47  public: virtual void TextureId(void* _texturePtr) = 0;
48  };
49 
51  class GzRenderer;
52  class RenderSync;
53 
57  {
59  public: virtual ~RenderThreadRhi();
60 
62  public: virtual QOffscreenSurface *Surface() const;
63 
65  //
67  public: virtual void SetSurface(QOffscreenSurface *_surface);
68 
70  public: virtual QOpenGLContext *Context() const;
71 
73  //
75  public: virtual void SetContext(QOpenGLContext *_context);
76 
78  //
82  public: virtual std::string Initialize() = 0;
83 
87  public: virtual void RenderNext(RenderSync *_renderSync) = 0;
88 
90  public: virtual void* TexturePtr() const = 0;
91 
93  public: virtual QSize TextureSize() const = 0;
94 
96  public: virtual void ShutDown() = 0;
97  };
98 
102  {
104  public: virtual ~TextureNodeRhi();
105 
107  public: virtual QSGTexture *Texture() const = 0;
108 
111  public: virtual bool HasNewTexture() const = 0;
112 
117  public: virtual void NewTexture(
118  void* _texturePtr, const QSize &_size) = 0;
119 
122  public: virtual void PrepareNode() = 0;
123  };
124 } // namespace gz::gui::plugins
125 
126 #endif // GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHI_HH_