WallSegmentItem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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_BUILDING_WALLSEGMENTITEM_HH_
19 #define _GAZEBO_GUI_BUILDING_WALLSEGMENTITEM_HH_
20 
21 #include <memory>
22 #include <ignition/math/Vector2.hh>
23 
24 #include "gazebo/gui/qt.h"
26 
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace gui
32  {
33  // Forward declare private data.
34  class WallSegmentItemPrivate;
35 
38 
41  class GZ_GUI_VISIBLE WallSegmentItem : public SegmentItem
42  {
43  Q_OBJECT
44 
49  public: WallSegmentItem(const ignition::math::Vector2d &_start,
50  const ignition::math::Vector2d &_end, const double _height);
51 
53  public: ~WallSegmentItem();
54 
57  public: double Height() const;
58 
61  public: void SetHeight(const double _height);
62 
65  public: WallSegmentItem *Clone() const;
66 
68  public: void Update();
69 
71  public: void WallSegmentChanged();
72 
74  public: void UpdateInspector();
75 
76  // Documentation inherited
77  public: void SetHighlighted(const bool _highlighted);
78 
80  protected: void SegmentUpdated();
81 
84  private: void contextMenuEvent(QGraphicsSceneContextMenuEvent *_event);
85 
88  private: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *_event);
89 
93  private: QVariant itemChange(GraphicsItemChange _change,
94  const QVariant &_value);
95 
96  // Documentation inherited
97  private slots: void OnApply();
98 
99  // Documentation inherited
100  private slots: void OnOpenInspector();
101 
102  // Documentation inherited
103  private slots: void OnDeleteItem();
104 
107  private: std::unique_ptr<WallSegmentItemPrivate> dataPtr;
108  };
110  }
111 }
112 
113 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
2D line segment.
Definition: SegmentItem.hh:44
2D representation of a wall.
Definition: WallSegmentItem.hh:41