TerrainEditorPalette.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_GUI_TERRAIN_TERRAINEDITORPALETTE_HH_
18 #define GAZEBO_GUI_TERRAIN_TERRAINEDITORPALETTE_HH_
19 
20 #include <memory>
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  {
38  class TerrainEditorPalettePrivate;
39 
42 
45  class GZ_GUI_VISIBLE TerrainEditorPalette : public QWidget
46  {
47  Q_OBJECT
48 
51  public: TerrainEditorPalette(QWidget *_parent = 0);
52 
54  public: ~TerrainEditorPalette();
55 
59  private: bool OnMousePress(const common::MouseEvent &_event);
60 
64  private: bool OnMouseMove(const common::MouseEvent &_event);
65 
71  private: bool Apply(const common::MouseEvent &_event,
72  rendering::CameraPtr _camera,
73  rendering::Heightmap *_heightmap) const;
74 
78  private: void SetState(const std::string &_state);
79 
82  private slots: void OnRaise(bool _toggle);
83 
86  private slots: void OnLower(bool _toggle);
87 
90  private slots: void OnFlatten(bool _toggle);
91 
94  private slots: void OnPickHeight(bool _toggle);
95 
97  private slots: void OnSave();
98 
101  private slots: void OnOutsideRadiusSpin(double _value);
102 
105  private slots: void OnOutsideRadiusSlider(int _value);
106 
109  private slots: void OnInsideRadiusSpin(double _value);
110 
113  private slots: void OnInsideRadiusSlider(int _value);
114 
117  private slots: void OnWeightSpin(double _value);
118 
121  private slots: void OnWeightSlider(int _value);
122 
125  private slots: void OnHeightSpin(double _value);
126 
129  private slots: void OnHeightSlider(int _value);
130 
133  private: std::unique_ptr<TerrainEditorPalettePrivate> dataPtr;
134  };
135  }
136 }
137 #endif
Generic description of a mouse event.
Definition: MouseEvent.hh:35
Rendering a terrain using heightmap information.
Definition: Heightmap.hh:62
A palette of building items which can be added to the editor.
Definition: TerrainEditorPalette.hh:45
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:89