SelectionObj.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
27  namespace rendering
28  {
31 
35  {
38  public: enum SelectionMode
39  {
41  SELECTION_NONE = 0,
45  ROT,
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 
80  // Documentation inherited.
81  public: virtual void Fini();
82 
86  public: void Attach(rendering::VisualPtr _vis);
87 
89  public: void Detach();
90 
93  public: void SetMode(const std::string &_mode);
94 
97  public: void SetMode(SelectionMode _mode);
98 
102  public: void SetState(const std::string &_state);
103 
108  public: void SetState(SelectionMode _state);
109 
111  public: SelectionMode GetState();
112 
114  public: SelectionMode GetMode();
115 
118  public: void SetGlobal(bool _global);
119 
121  public: void UpdateSize();
122 
126  public: void SetHandleVisible(SelectionMode _mode, bool _visible);
127 
132  public: bool GetHandleVisible(SelectionMode _mode) const;
133 
140  public: void SetHandleMaterial(SelectionMode _mode, const std::string
141  &_material, bool _unique = true);
142 
144  private: void CreateScaleVisual();
145 
147  private: void CreateRotateVisual();
148 
150  private: void CreateTranslateVisual();
151  };
153  }
154 }
155 
156 #endif
Interactive selection object for models and links.
Definition: SelectionObj.hh:34
Scale in y.
Definition: SelectionObj.hh:63
Translation in x.
Definition: SelectionObj.hh:49
Translation in y.
Definition: SelectionObj.hh:51
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
Rotation in x.
Definition: SelectionObj.hh:55
Rotation in y.
Definition: SelectionObj.hh:57
A renderable object.
Definition: Visual.hh:59
Translation mode.
Definition: SelectionObj.hh:43
Translation in z.
Definition: SelectionObj.hh:53
Scale mode.
Definition: SelectionObj.hh:47
#define GZ_RENDERING_VISIBLE
Definition: system.hh:209
SelectionMode
Definition: SelectionObj.hh:38
Rotation mode.
Definition: SelectionObj.hh:45
Rotation in z.
Definition: SelectionObj.hh:59
Scale in x.
Definition: SelectionObj.hh:61