FloorItem.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_BUILDING_FLOORITEM_HH_
19 #define _GAZEBO_GUI_BUILDING_FLOORITEM_HH_
20 
21 #include <memory>
22 #include <ignition/math/Vector3.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  class WallSegmentItem;
34 
35  // Forward declare private data.
36  class FloorItemPrivate;
37 
40 
43  class GZ_GUI_VISIBLE FloorItem : public RectItem
44  {
45  Q_OBJECT
46 
48  public: FloorItem();
49 
51  public: ~FloorItem();
52 
53  // Documentation inherited.
54  public: virtual ignition::math::Vector3d Size() const;
55 
56  // Documentation inherited.
57  public: virtual ignition::math::Vector3d ScenePosition() const;
58 
59  // Documentation inherited.
60  public: virtual double SceneRotation() const;
61 
64  public: void AttachWallSegment(WallSegmentItem *_wallSegmentItem);
65 
67  public: void FloorChanged();
68 
69  // Documentation inherited.
70  private: virtual void paint(QPainter *_painter,
71  const QStyleOptionGraphicsItem *_option, QWidget *_widget);
72 
73  // Documentation inherited.
74  private: virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
75 
76  // Documentation inherited.
77  private: virtual void contextMenuEvent(
78  QGraphicsSceneContextMenuEvent *_event);
79 
82  private slots: void NotifyChange();
83 
85  private slots: void RecalculateBoundingBox();
86 
88  private slots: void WallSegmentDeleted();
89 
91  private: void Update();
92 
94  private: void SizeChanged();
95 
98  private: std::unique_ptr<FloorItemPrivate> dataPtr;
99  };
101  }
102 }
103 
104 #endif
2D representation of a floor.
Definition: FloorItem.hh:43
2D rectangle.
Definition: RectItem.hh:49
2D representation of a wall.
Definition: WallSegmentItem.hh:41