Gazebo Gui

API Reference

8.3.0
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 
44 
45  // Documentation inherited
46  public: virtual void Update(rendering::CameraPtr _camera) override;
47 
50  };
51 
53  class RenderThreadRhiMetalPrivate;
54 
57  {
58  // Documentation inherited
59  public: virtual ~RenderThreadRhiMetal() override;
60 
63  public: explicit RenderThreadRhiMetal(GzRenderer *_renderer);
64 
65  // Documentation inherited
66  public: virtual std::string Initialize() override;
67 
68  // Documentation inherited
69  public: virtual void Update(rendering::CameraPtr _camera) 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: explicit 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_