Gazebo Rendering

API Reference

7.4.2
gz/rendering/ogre2/Ogre2ThermalCamera.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_OGRE2_OGRE2THERMALCAMERA_HH_
19 #define GZ_RENDERING_OGRE2_OGRE2THERMALCAMERA_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 
31 #include "gz/rendering/ogre2/Export.hh"
34 
35 #include "gz/common/Event.hh"
36 #include "gz/common/Console.hh"
37 
38 namespace Ogre
39 {
40  class Material;
41  class RenderTarget;
42  class Texture;
43  class Viewport;
44 }
45 
46 namespace gz
47 {
48  namespace rendering
49  {
50  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
51  //
52  // Forward declaration
53  class Ogre2ThermalCameraPrivate;
54 
56  class GZ_RENDERING_OGRE2_VISIBLE Ogre2ThermalCamera :
57  public virtual BaseThermalCamera<Ogre2Sensor>,
58  public virtual Ogre2ObjectInterface
59  {
61  protected: Ogre2ThermalCamera();
62 
64  public: virtual ~Ogre2ThermalCamera();
65 
67  public: virtual void Init() override;
68 
69  // Documentation inherited
70  public: virtual void Destroy() override;
71 
72  // Documentation inherited
73  public: virtual void PreRender() override;
74 
76  public: virtual void PostRender() override;
77 
81  public: virtual gz::common::ConnectionPtr ConnectNewThermalFrame(
82  std::function<void(const uint16_t *, unsigned int, unsigned int,
83  unsigned int, const std::string &)> _subscriber) override;
84 
86  public: virtual void Render() override;
87 
88  // Documentation inherited.
89  public: virtual Ogre::Camera *OgreCamera() const override;
90 
93  protected: virtual RenderTargetPtr RenderTarget() const override;
94 
96  protected: void CreateCamera();
97 
99  protected: virtual void CreateRenderTexture();
100 
102  protected: virtual void CreateThermalTexture();
103 
105  protected: Ogre::Camera *ogreCamera = nullptr;
106 
110 
112  private: friend class Ogre2Scene;
113  };
114  }
115  }
116 }
117 #endif