TerrainEditorPalette.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 _TERRAIN_EDITOR_PALETTE_HH_
19 #define _TERRAIN_EDITOR_PALETTE_HH_
20 
21 #include <string>
22 
24 #include "gazebo/common/Event.hh"
26 #include "gazebo/gui/qt.h"
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace rendering
32  {
33  class Heightmap;
34  }
35 
36  namespace gui
37  {
40 
43  class GAZEBO_VISIBLE TerrainEditorPalette : public QWidget
44  {
45  Q_OBJECT
46 
49  public: TerrainEditorPalette(QWidget *_parent = 0);
50 
52  public: ~TerrainEditorPalette();
53 
57  private: bool OnMousePress(const common::MouseEvent &_event);
58 
62  private: bool OnMouseMove(const common::MouseEvent &_event);
63 
69  private: bool Apply(const common::MouseEvent &_event,
70  rendering::CameraPtr _camera,
71  rendering::Heightmap *_heightmap);
72 
76  private: void SetState(const std::string &_state);
77 
80  private slots: void OnRaise(bool _toggle);
81 
84  private slots: void OnLower(bool _toggle);
85 
88  private slots: void OnFlatten(bool _toggle);
89 
92  private slots: void OnPickHeight(bool _toggle);
93 
95  private slots: void OnSave();
96 
99  private slots: void OnOutsideRadiusSpin(double _value);
100 
103  private slots: void OnOutsideRadiusSlider(int _value);
104 
107  private slots: void OnInsideRadiusSpin(double _value);
108 
111  private slots: void OnInsideRadiusSlider(int _value);
112 
115  private slots: void OnWeightSpin(double _value);
116 
119  private slots: void OnWeightSlider(int _value);
120 
123  private slots: void OnHeightSpin(double _value);
124 
127  private slots: void OnHeightSlider(int _value);
128 
130  private: QDoubleSpinBox *outsideRadiusSpin;
131 
133  private: QSlider *outsideRadiusSlider;
134 
136  private: QDoubleSpinBox *insideRadiusSpin;
137 
139  private: QSlider *insideRadiusSlider;
140 
142  private: QDoubleSpinBox *weightSpin;
143 
145  private: QSlider *weightSlider;
146 
148  private: QDoubleSpinBox *heightSpin;
149 
151  private: QSlider *heightSlider;
152 
154  private: std::string state;
155  };
156  }
157 }
158 #endif
Generic description of a mouse event.
Definition: MouseEvent.hh:32
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:82
Rendering a terrain using heightmap information.
Definition: Heightmap.hh:88
A palette of building items which can be added to the editor.
Definition: TerrainEditorPalette.hh:43
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48