Gazebo Rendering
API Reference
9.0.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-rendering
ogre2
include
gz
rendering
ogre2
Ogre2SegmentationCamera.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2021 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_OGRE2SEGMENTATIONCAMERA_HH_
19
#define GZ_RENDERING_OGRE2_OGRE2SEGMENTATIONCAMERA_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
30
#include <
gz/common/Console.hh
>
31
#include <
gz/common/Event.hh
>
32
33
#include "
gz/rendering/base/BaseSegmentationCamera.hh
"
34
#include "
gz/rendering/ogre2/Ogre2Includes.hh
"
35
#include "
gz/rendering/ogre2/Ogre2ObjectInterface.hh
"
36
#include "
gz/rendering/ogre2/Ogre2Sensor.hh
"
37
38
namespace
gz
39
{
40
namespace
rendering
41
{
42
inline
namespace
GZ_RENDERING_VERSION_NAMESPACE {
43
//
44
// Forward declaration
45
class
Ogre2SegmentationCameraPrivate;
46
49
class
GZ_RENDERING_OGRE2_VISIBLE
Ogre2SegmentationCamera
:
50
public
virtual
BaseSegmentationCamera
<Ogre2Sensor>,
51
public
virtual
Ogre2ObjectInterface
52
{
54
protected
:
Ogre2SegmentationCamera
();
55
57
public
:
virtual
~Ogre2SegmentationCamera
();
58
59
// Documentation inherited
60
public
:
virtual
void
Init
()
override
;
61
62
// Documentation inherited
63
public
:
virtual
void
Destroy
()
override
;
64
65
// Documentation inherited
66
public
:
virtual
void
PreRender
()
override
;
67
68
// Documentation inherited
69
public
:
virtual
void
PostRender
()
override
;
70
71
// Documentation inherited.
72
public
:
virtual
math::Matrix4d
ProjectionMatrix
()
const override
;
73
74
// Documentation inherited.
75
public
:
virtual
void
SetProjectionMatrix
(
76
const
math::Matrix4d
&_matrix)
override
;
77
78
// Documentation inherited
79
public
:
virtual
gz::common::ConnectionPtr
80
ConnectNewSegmentationFrame
(
81
std::function
<
void
(
const
uint8_t *,
unsigned
int
,
unsigned
int
,
82
unsigned
int
,
const
std::string
&)> _subscriber)
override
;
83
84
// Documentation inherited
85
public
:
virtual
void
Render
()
override
;
86
89
protected
:
virtual
RenderTargetPtr
RenderTarget
()
const override
;
90
91
// Documentation inherited
92
public
:
void
SetBackgroundLabel
(
int
_label)
override
;
93
94
// Documentation inherited
95
public
:
void
LabelMapFromColoredBuffer
(
96
uint8_t * _labelBuffer)
const override
;
97
98
// Documentation inherited.
99
public
:
virtual
Ogre::Camera *
OgreCamera
()
const override
;
100
102
protected
:
void
CreateCamera
();
103
105
protected
:
virtual
void
CreateRenderTexture
();
106
107
// Documentation inherited
108
protected
:
virtual
void
CreateSegmentationTexture
()
override
;
109
111
protected
: Ogre::Camera *ogreCamera =
nullptr
;
112
115
private
:
std::unique_ptr<Ogre2SegmentationCameraPrivate>
dataPtr;
116
118
private
:
friend
class
Ogre2Scene
;
119
};
120
}
121
}
122
}
123
#endif