Gazebo Rendering

API Reference

6.6.4
gz/rendering/ogre/OgreThermalCamera.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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_RENDERING_OGRE_OGRETHERMALCAMERA_HH_
19 #define GZ_RENDERING_OGRE_OGRETHERMALCAMERA_HH_
20 
21 #ifdef _WIN32
22  // Ensure that Winsock2.h is included before Windows.h, which can get
23  // pulled in by anybody (e.g., Boost).
24  #include <Winsock2.h>
25 #endif
26 
27 #include <memory>
28 #include <string>
29 
32 #include "gz/rendering/ogre/Export.hh"
39 
40 #include "gz/common/Event.hh"
41 #include "gz/common/Console.hh"
42 
43 
44 namespace Ogre
45 {
46  class Material;
47  class Camera;
48 }
49 
50 namespace ignition
51 {
52  namespace rendering
53  {
54  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
55  //
56  // forward declaration
57  class OgreThermalCameraPrivate;
58 
63  class IGNITION_RENDERING_OGRE_VISIBLE OgreThermalCamera :
64  public BaseThermalCamera<OgreSensor>
65  {
67  protected: OgreThermalCamera();
68 
70  public: virtual ~OgreThermalCamera();
71 
73  public: virtual void Init() override;
74 
76  public: virtual void CreateRenderTexture();
77 
80  protected: void DestroyRenderTexture();
81 
83  public: virtual void PostRender() override;
84 
88  public: virtual gz::common::ConnectionPtr ConnectNewThermalFrame(
89  std::function<void(const uint16_t *, unsigned int, unsigned int,
90  unsigned int, const std::string &)> _subscriber) override;
91 
92  // Documentation inherited.
93  public: virtual void PreRender() override;
94 
96  public: virtual void Render() override;
97 
98  // Documentation inherited
99  public: virtual void Destroy() override;
100 
103  protected: virtual RenderTargetPtr RenderTarget() const override;
104 
106  protected: void CreateCamera();
107 
109  private: void CreateThermalTexture();
110 
112  protected: Ogre::Camera *ogreCamera = nullptr;
113 
117 
118  private: friend class OgreScene;
119  };
120  }
121  }
122 }
123 #endif
Base implementation of the ThermalCamera class.
Definition: gz/rendering/base/BaseThermalCamera.hh:37
Definition: gz/rendering/ogre/OgreScene.hh:41
Depth camera used to render thermal data into an image buffer.
Definition: gz/rendering/ogre/OgreThermalCamera.hh:65
void DestroyRenderTexture()
Destroy render texture created by CreateRenderTexture() Note: It's not virtual.
virtual RenderTargetPtr RenderTarget() const override
Get a pointer to the render target.
virtual void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
virtual void PostRender() override
Render the camera.
virtual void Destroy() override
Destroy any resources associated with this object. Invoking any other functions after destroying an o...
void CreateCamera()
Create the camera.
virtual ~OgreThermalCamera()
Destructor.
virtual void Init() override
Initialize the camera.
virtual void Render() override
Implementation of the render call.
virtual void CreateRenderTexture()
Create a texture.
virtual gz::common::ConnectionPtr ConnectNewThermalFrame(std::function< void(const uint16_t *, unsigned int, unsigned int, unsigned int, const std::string &)> _subscriber) override
Connect to the new thermal image signal.
Definition: gz/rendering/ogre/OgreCamera.hh:28