TerrainEditorPalette.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 
18 #ifndef _GAZEBO_GUI_TERRAINEDITORPALETTE_HH_
19 #define _GAZEBO_GUI_TERRAINEDITORPALETTE_HH_
20 
21 #include <memory>
22 #include <string>
23 
25 #include "gazebo/common/Event.hh"
27 #include "gazebo/gui/qt.h"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace rendering
33  {
34  class Heightmap;
35  }
36 
37  namespace gui
38  {
39  class TerrainEditorPalettePrivate;
40 
43 
46  class GZ_GUI_VISIBLE TerrainEditorPalette : public QWidget
47  {
48  Q_OBJECT
49 
52  public: TerrainEditorPalette(QWidget *_parent = 0);
53 
55  public: ~TerrainEditorPalette();
56 
60  private: bool OnMousePress(const common::MouseEvent &_event);
61 
65  private: bool OnMouseMove(const common::MouseEvent &_event);
66 
72  private: bool Apply(const common::MouseEvent &_event,
73  rendering::CameraPtr _camera,
74  rendering::Heightmap *_heightmap) const;
75 
79  private: void SetState(const std::string &_state);
80 
83  private slots: void OnRaise(bool _toggle);
84 
87  private slots: void OnLower(bool _toggle);
88 
91  private slots: void OnFlatten(bool _toggle);
92 
95  private slots: void OnPickHeight(bool _toggle);
96 
98  private slots: void OnSave();
99 
102  private slots: void OnOutsideRadiusSpin(double _value);
103 
106  private slots: void OnOutsideRadiusSlider(int _value);
107 
110  private slots: void OnInsideRadiusSpin(double _value);
111 
114  private slots: void OnInsideRadiusSlider(int _value);
115 
118  private slots: void OnWeightSpin(double _value);
119 
122  private slots: void OnWeightSlider(int _value);
123 
126  private slots: void OnHeightSpin(double _value);
127 
130  private slots: void OnHeightSlider(int _value);
131 
134  private: std::unique_ptr<TerrainEditorPalettePrivate> dataPtr;
135  };
136  }
137 }
138 #endif
Generic description of a mouse event.
Definition: MouseEvent.hh:35
#define GZ_GUI_VISIBLE
Definition: system.hh:284
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:88
Rendering a terrain using heightmap information.
Definition: Heightmap.hh:68
A palette of building items which can be added to the editor.
Definition: TerrainEditorPalette.hh:46