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 
23 #include "gazebo/gui/qt.h"
25 
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  class WallSegmentItem;
33 
34  // Forward declare private data.
35  class FloorItemPrivate;
36 
39 
43  {
44  Q_OBJECT
45 
47  public: FloorItem();
48 
50  public: ~FloorItem();
51 
52  // Documentation inherited.
53  public: virtual QVector3D GetSize() const;
54 
55  // Documentation inherited.
56  public: virtual QVector3D GetScenePosition() const;
57 
58  // Documentation inherited.
59  public: virtual double GetSceneRotation() const;
60 
63  public: void AttachWallSegment(WallSegmentItem *_wallSegmentItem);
64 
65  // Documentation inherited.
66  private: virtual void paint(QPainter *_painter,
67  const QStyleOptionGraphicsItem *_option, QWidget *_widget);
68 
69  // Documentation inherited.
70  private: virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
71 
72  // Documentation inherited.
73  private: virtual void contextMenuEvent(
74  QGraphicsSceneContextMenuEvent *_event);
75 
78  private slots: void NotifyChange();
79 
81  private slots: void RecalculateBoundingBox();
82 
84  private slots: void WallSegmentDeleted();
85 
87  private: void Update();
88 
90  public: void FloorChanged();
91 
93  private: void SizeChanged();
94 
97  private: std::unique_ptr<FloorItemPrivate> dataPtr;
98  };
100  }
101 }
102 
103 #endif
#define GZ_GUI_VISIBLE
Definition: system.hh:284
2D representation of a floor.
Definition: FloorItem.hh:42
2D rectangle.
Definition: RectItem.hh:45
2D representation of a wall.
Definition: WallSegmentItem.hh:40