Gazebo Gui

API Reference

8.3.0
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"
25 
26 #include <QSGTexture>
27 #include <QSize>
28 
29 namespace gz::gui::plugins
30 {
33  //
41  {
43  public: virtual ~GzCameraTextureRhi();
44 
47  public: virtual void Update(rendering::CameraPtr _camera) = 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 
91  public: virtual void Update(rendering::CameraPtr _camera) = 0;
92 
94  public: virtual void* TexturePtr() const = 0;
95 
97  public: virtual QSize TextureSize() const = 0;
98 
100  public: virtual void ShutDown() = 0;
101  };
102 
106  {
108  public: virtual ~TextureNodeRhi();
109 
111  public: virtual QSGTexture *Texture() const = 0;
112 
115  public: virtual bool HasNewTexture() const = 0;
116 
121  public: virtual void NewTexture(
122  void* _texturePtr, const QSize &_size) = 0;
123 
126  public: virtual void PrepareNode() = 0;
127  };
128 } // namespace gz::gui::plugins
129 
130 #endif // GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHI_HH_