FloorItem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 _FLOOR_ITEM_HH_
19 #define _FLOOR_ITEM_HH_
20 
21 #include <vector>
22 #include "gazebo/gui/qt.h"
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
29  namespace gui
30  {
31  class BuildingItem;
32  class WallSegmentItem;
33 
36 
40  public RectItem, public BuildingItem
41  {
42  Q_OBJECT
43 
45  public: FloorItem();
46 
48  public: ~FloorItem();
49 
50  // Documentation inherited.
51  public: virtual QVector3D GetSize() const;
52 
53  // Documentation inherited.
54  public: virtual QVector3D GetScenePosition() const;
55 
56  // Documentation inherited.
57  public: virtual double GetSceneRotation() const;
58 
61  public: void AttachWallSegment(WallSegmentItem *_wallSegmentItem);
62 
63  // Documentation inherited.
64  private: virtual void paint(QPainter *_painter,
65  const QStyleOptionGraphicsItem *_option, QWidget *_widget);
66 
67  // Documentation inherited.
68  private: virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
69 
70  // Documentation inherited.
71  private: virtual void contextMenuEvent(
72  QGraphicsSceneContextMenuEvent *_event);
73 
76  private slots: void NotifyChange();
77 
79  private slots: void RecalculateBoundingBox();
80 
82  private slots: void WallSegmentDeleted();
83 
85  private: void Update();
86 
88  public: void FloorChanged();
89 
91  private: void SizeChanged();
92 
94  private: double floorDepth;
95 
97  private: double floorHeight;
98 
100  private: double floorWidth;
101 
103  private: QPointF floorPos;
104 
107  private: bool dirty;
108 
110  private: std::vector<WallSegmentItem *> wallSegments;
111 
113  private: QPolygonF floorBoundingRect;
114  };
116  }
117 }
118 
119 #endif
2D representation of a floor.
Definition: FloorItem.hh:39
2D rectangle.
Definition: RectItem.hh:40
#define GZ_GUI_BUILDING_VISIBLE
Definition: system.hh:393
Base class of a items that have building level properties such as the level number and level height...
Definition: BuildingItem.hh:33
2D representation of a wall.
Definition: WallSegmentItem.hh:40