Gazebo Rendering
API Reference
7.4.2
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
include
gz
rendering
base
BaseProjector.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2023 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_BASE_BASEPROJECTOR_HH_
19
#define GZ_RENDERING_BASE_BASEPROJECTOR_HH_
20
21
#include <string>
22
#include "
gz/rendering/base/BaseScene.hh
"
23
#include "
gz/rendering/base/BaseNode.hh
"
24
#include "
gz/rendering/Projector.hh
"
25
26
namespace
gz
27
{
28
namespace
rendering
29
{
30
inline
namespace
GZ_RENDERING_VERSION_NAMESPACE {
31
//
32
/* \class BaseProjector BaseProjector.hh \
33
* gz/rendering/base/BaseProjector.hh
34
*/
36
template
<
class
T>
37
class
BaseProjector
:
38
public
virtual
Projector
,
39
public
virtual
T
40
{
42
protected
:
BaseProjector
();
43
45
public
:
virtual
~
BaseProjector
();
46
47
// Documentation inherited
48
public
:
virtual
double
FarClipPlane()
const override
;
49
50
// Documentation inherited
51
public
:
virtual
void
SetFarClipPlane(
double
_far)
override
;
52
53
// Documentation inherited
54
public
:
virtual
double
NearClipPlane()
const override
;
55
56
// Documentation inherited
57
public
:
virtual
void
SetNearClipPlane(
double
_near)
override
;
58
59
// Documentation inherited
60
public
:
virtual
math::Angle
HFOV()
const override
;
61
62
// Documentation inherited
63
public
:
virtual
void
SetHFOV(
const
math::Angle
&_hfov)
override
;
64
65
// Documentation inherited
66
public
:
virtual
std::string
Texture()
const override
;
67
68
// Documentation inherited
69
public
:
void
SetTexture(
const
std::string
&_texture)
override
;
70
71
// Documentation inherited
72
public
:
bool
IsEnabled()
const override
;
73
74
// Documentation inherited
75
public
:
void
SetEnabled(
bool
_enabled)
override
;
76
78
protected
:
double
nearClip = 0.1;
79
81
protected
:
double
farClip = 10.0;
82
84
protected
:
math::Angle
hfov =
math::Angle
(0.785398);
85
87
protected
:
std::string
textureName
;
88
90
protected
:
bool
enabled =
false
;
91
93
private
:
friend
class
BaseScene
;
94
};
95
97
template
<
class
T>
98
BaseProjector<T>::BaseProjector
()
99
{
100
}
101
103
template
<
class
T>
104
BaseProjector<T>::~BaseProjector
()
105
{
106
}
107
109
template
<
class
T>
110
double
BaseProjector<T>::FarClipPlane
()
const
111
{
112
return
this->farClip;
113
}
114
116
template
<
class
T>
117
void
BaseProjector<T>::SetFarClipPlane
(
double
_far)
118
{
119
this->farClip = _far;
120
}
121
123
template
<
class
T>
124
double
BaseProjector<T>::NearClipPlane
()
const
125
{
126
return
this->nearClip;
127
}
128
130
template
<
class
T>
131
void
BaseProjector<T>::SetNearClipPlane
(
double
_near)
132
{
133
this->nearClip = _near;
134
}
135
137
template
<
class
T>
138
math::Angle
BaseProjector<T>::HFOV
()
const
139
{
140
return
this->hfov;
141
}
142
144
template
<
class
T>
145
void
BaseProjector<T>::SetHFOV
(
const
math::Angle
&_hfov)
146
{
147
this->hfov = _hfov;
148
}
149
151
template
<
class
T>
152
std::string
BaseProjector<T>::Texture
()
const
153
{
154
return
this->textureName;
155
}
156
158
template
<
class
T>
159
void
BaseProjector<T>::SetTexture
(
const
std::string
&_texture)
160
{
161
this->textureName = _texture;
162
}
163
165
template
<
class
T>
166
bool
BaseProjector<T>::IsEnabled
()
const
167
{
168
return
this->enabled;
169
}
170
172
template
<
class
T>
173
void
BaseProjector<T>::SetEnabled
(
bool
_enabled)
174
{
175
this->enabled = _enabled;
176
}
177
}
178
}
179
}
180
#endif