WallSegmentItem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-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_BUILDING_WALLSEGMENTITEM_HH_
19 #define _GAZEBO_GUI_BUILDING_WALLSEGMENTITEM_HH_
20 
21 #include <memory>
22 
23 #include "gazebo/gui/qt.h"
25 
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  // Forward declare private data.
33  class WallSegmentItemPrivate;
34 
37 
41  {
42  Q_OBJECT
43 
48  public: WallSegmentItem(const QPointF &_start, const QPointF &_end,
49  const double _height);
50 
52  public: ~WallSegmentItem();
53 
56  public: double GetHeight() const;
57 
60  public: void SetHeight(double _height);
61 
64  public: WallSegmentItem *Clone() const;
65 
67  public: void Update();
68 
70  public: void WallSegmentChanged();
71 
73  public: void UpdateInspector();
74 
75  // Documentation inherited
76  public: void SetHighlighted(bool _highlighted);
77 
79  protected: void SegmentUpdated();
80 
83  private: void contextMenuEvent(QGraphicsSceneContextMenuEvent *_event);
84 
87  private: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *_event);
88 
92  private: QVariant itemChange(GraphicsItemChange _change,
93  const QVariant &_value);
94 
95  // Documentation inherited
96  private slots: void OnApply();
97 
98  // Documentation inherited
99  private slots: void OnOpenInspector();
100 
101  // Documentation inherited
102  private slots: void OnDeleteItem();
103 
106  private: std::unique_ptr<WallSegmentItemPrivate> dataPtr;
107  };
109  }
110 }
111 
112 #endif
#define GZ_GUI_VISIBLE
Definition: system.hh:284
2D line segment.
Definition: SegmentItem.hh:43
2D representation of a wall.
Definition: WallSegmentItem.hh:40