SelectionObj.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 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 GAZEBO_RENDERING_SELECTIONOBJ_HH_
18#define GAZEBO_RENDERING_SELECTIONOBJ_HH_
19
20#include <string>
21
23#include "gazebo/util/system.hh"
24
25namespace gazebo
26{
27 namespace rendering
28 {
31
34 class GZ_RENDERING_VISIBLE SelectionObj : public Visual
35 {
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
109
112
115 public: void SetGlobal(bool _global);
116
118 public: void UpdateSize();
119
123 public: void SetHandleVisible(SelectionMode _mode, bool _visible);
124
129 public: bool GetHandleVisible(SelectionMode _mode) const;
130
137 public: void SetHandleMaterial(SelectionMode _mode, const std::string
138 &_material, bool _unique = true);
139
141 private: void CreateScaleVisual();
142
144 private: void CreateRotateVisual();
145
147 private: void CreateTranslateVisual();
148 };
150 }
151}
152
153#endif
rendering
Definition RenderEngine.hh:31
Interactive selection object for models and links.
Definition SelectionObj.hh:35
void SetMode(const std::string &_mode)
Set the manipulation mode.
SelectionMode GetState()
Get the current selection state.
void SetHandleVisible(SelectionMode _mode, bool _visible)
Set the visibility for a specific handle or handle group.
void SetMode(SelectionMode _mode)
Set the selection mode.
void SetState(const std::string &_state)
Set state by highlighting the corresponding selection object visual.
SelectionMode
Definition SelectionObj.hh:39
@ ROT_Z
Rotation in z.
Definition SelectionObj.hh:59
@ TRANS
Translation mode.
Definition SelectionObj.hh:43
@ TRANS_X
Translation in x.
Definition SelectionObj.hh:49
@ SCALE_Y
Scale in y.
Definition SelectionObj.hh:63
@ SCALE
Scale mode.
Definition SelectionObj.hh:47
@ ROT
Rotation mode.
Definition SelectionObj.hh:45
@ ROT_X
Rotation in x.
Definition SelectionObj.hh:55
@ TRANS_Y
Translation in y.
Definition SelectionObj.hh:51
@ ROT_Y
Rotation in y.
Definition SelectionObj.hh:57
@ SELECTION_NONE
Translation in x.
Definition SelectionObj.hh:41
@ SCALE_Z
Scale in z.
Definition SelectionObj.hh:65
@ SCALE_X
Scale in x.
Definition SelectionObj.hh:61
@ TRANS_Z
Translation in z.
Definition SelectionObj.hh:53
void SetGlobal(bool _global)
Set selection object to ignore local transforms.
void SetState(SelectionMode _state)
Set state by highlighting the corresponding selection object visual.
void UpdateSize()
Update selection object size to match the parent visual.
SelectionMode GetMode()
Get the current selection mode.
virtual ~SelectionObj()
Deconstructor.
void Detach()
Detach the selection object from the current visual.
void Attach(rendering::VisualPtr _vis)
Attach the selection object to the given visual.
bool GetHandleVisible(SelectionMode _mode) const
Get the visibility for a specific handle.
void SetHandleMaterial(SelectionMode _mode, const std::string &_material, bool _unique=true)
Set the material for a specific handle or handle group.
SelectionObj(const std::string &_name, VisualPtr _vis)
Constructor.
A renderable object.
Definition Visual.hh:61
std::shared_ptr< Visual > VisualPtr
Definition RenderTypes.hh:114
Forward declarations for the common classes.
Definition Animation.hh:27