Class
List
Hierarchy
Modules
Common
Events
Math
Messages
Physics
Rendering
Sensors
Transport
Links
Gazebo Website
Wiki
Tutorials
Download
Report Documentation Issues
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
gazebo
rendering
SelectionObj.hh
Go to the documentation of this file.
1
/*
2
* Copyright 2012 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
#ifndef _SELECTIONOBJ_HH_
18
#define _SELECTIONOBJ_HH_
19
20
#include <string>
21
#include <boost/unordered/unordered_map.hpp>
22
23
#include "
gazebo/rendering/RenderTypes.hh
"
24
25
namespace
gazebo
26
{
27
namespace
rendering
28
{
31
34
class
SelectionObj
:
public
Visual
35
{
38
public
:
enum
SelectionMode
39
{
41
SELECTION_NONE
= 0,
43
TRANS
,
45
ROT
,
47
SCALE
,
49
TRANS_X
,
51
TRANS_Y
,
53
TRANS_Z
,
55
ROT_X
,
57
ROT_Y
,
59
ROT_Z
,
61
SCALE_X
,
63
SCALE_Y
,
65
SCALE_Z
66
};
67
72
public
:
SelectionObj
(
const
std::string &_name,
VisualPtr
_vis);
73
75
public
:
virtual
~SelectionObj
();
76
78
public
:
void
Load
();
79
83
public
:
void
Attach
(
rendering::VisualPtr
_vis);
84
86
public
:
void
Detach
();
87
90
public
:
void
SetMode
(
const
std::string &_mode);
91
94
public
:
void
SetMode
(
SelectionMode
_mode);
95
99
public
:
void
SetState
(
const
std::string &_state);
100
105
public
:
void
SetState
(
SelectionMode
_state);
106
108
public
:
SelectionMode
GetState
();
109
111
public
:
SelectionMode
GetMode
();
112
115
public
:
void
SetGlobal
(
bool
_global);
116
118
public
:
void
UpdateSize
();
119
121
private
:
void
CreateScaleVisual();
122
124
private
:
void
CreateRotateVisual();
125
127
private
:
void
CreateTranslateVisual();
128
130
private
:
VisualPtr
transVisual;
131
133
private
:
VisualPtr
transXVisual;
134
136
private
:
VisualPtr
transYVisual;
137
139
private
:
VisualPtr
transZVisual;
140
142
private
:
VisualPtr
scaleVisual;
143
145
private
:
VisualPtr
scaleXVisual;
146
148
private
:
VisualPtr
scaleYVisual;
149
151
private
:
VisualPtr
scaleZVisual;
152
154
private
:
VisualPtr
rotVisual;
155
157
private
:
VisualPtr
rotXVisual;
158
160
private
:
VisualPtr
rotYVisual;
161
163
private
:
VisualPtr
rotZVisual;
164
166
private
:
SelectionMode
mode;
167
169
private
:
SelectionMode
state;
170
172
private
:
VisualPtr
selectedVis;
173
175
private
:
double
minScale;
176
178
private
:
double
maxScale;
179
181
private
: std::string xAxisMat;
182
184
private
: std::string yAxisMat;
185
187
private
: std::string zAxisMat;
188
190
private
: std::string xAxisMatOverlay;
191
193
private
: std::string yAxisMatOverlay;
194
196
private
: std::string zAxisMatOverlay;
197
};
198
}
199
}
200
201
#endif