Gazebo Gui

API Reference

7.2.2
MinimalSceneRhiMetal.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_MINIMALSCENERHIMETAL_HH_
19 #define GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHIMETAL_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 
31 namespace gz::gui::plugins
32 {
34  class GzCameraTextureRhiMetalPrivate;
35 
38  {
39  // Documentation inherited
40  public: virtual ~GzCameraTextureRhiMetal() override;
41 
43  public: GzCameraTextureRhiMetal();
44 
45  // Documentation inherited
46  public: virtual void Update(rendering::CameraPtr _camera) override;
47 
48  // Documentation inherited
49  public: virtual void TextureId(void* _texturePtr) override;
50 
53  };
54 
56  class RenderThreadRhiMetalPrivate;
57 
60  {
61  // Documentation inherited
62  public: virtual ~RenderThreadRhiMetal() override;
63 
66  public: RenderThreadRhiMetal(GzRenderer *_renderer);
67 
68  // Documentation inherited
69  public: virtual std::string Initialize() override;
70 
71  // Documentation inherited
72  public: virtual void RenderNext(RenderSync *_renderSync) override;
73 
74  // Documentation inherited
75  public: virtual void* TexturePtr() const override;
76 
77  // Documentation inherited
78  public: virtual QSize TextureSize() const override;
79 
80  // Documentation inherited
81  public: virtual void ShutDown() override;
82 
84  private: RenderThreadRhiMetal(
85  const RenderThreadRhiMetal &_other) = delete;
86  private: RenderThreadRhiMetal& operator=(
87  const RenderThreadRhiMetal &_other) = delete;
88 
91  };
92 
94  class TextureNodeRhiMetalPrivate;
95 
98  {
99  // Documentation inherited
100  public: virtual ~TextureNodeRhiMetal() override;
101 
104  public: TextureNodeRhiMetal(QQuickWindow *_window);
105 
106  // Documentation inherited
107  public: virtual QSGTexture *Texture() const override;
108 
109  // Documentation inherited
110  public: virtual bool HasNewTexture() const override;
111 
112  // Documentation inherited
113  public: virtual void NewTexture(
114  void* _texturePtr, const QSize &_size)override;
115 
116  // Documentation inherited
117  public: virtual void PrepareNode() override;
118 
120  private: TextureNodeRhiMetal(
121  const TextureNodeRhiMetal &_other) = delete;
122  private: TextureNodeRhiMetal& operator=(
123  const TextureNodeRhiMetal &_other) = delete;
124 
127  };
128 } // namespace gz::gui::plugins
129 
130 #endif // GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHIMETAL_HH_