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  {
41  Q_OBJECT
42 
44  public: FloorItem();
45 
47  public: ~FloorItem();
48 
49  // Documentation inherited.
50  public: virtual QVector3D GetSize() const;
51 
52  // Documentation inherited.
53  public: virtual QVector3D GetScenePosition() const;
54 
55  // Documentation inherited.
56  public: virtual double GetSceneRotation() const;
57 
60  public: void AttachWallSegment(WallSegmentItem *_wallSegmentItem);
61 
62  // Documentation inherited.
63  private: virtual void paint(QPainter *_painter,
64  const QStyleOptionGraphicsItem *_option, QWidget *_widget);
65 
66  // Documentation inherited.
67  private: virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
68 
69  // Documentation inherited.
70  private: virtual void contextMenuEvent(
71  QGraphicsSceneContextMenuEvent *_event);
72 
75  private slots: void NotifyChange();
76 
78  private slots: void RecalculateBoundingBox();
79 
81  private slots: void WallSegmentDeleted();
82 
84  private: void Update();
85 
87  public: void FloorChanged();
88 
90  private: void SizeChanged();
91 
93  private: double floorDepth;
94 
96  private: double floorHeight;
97 
99  private: double floorWidth;
100 
102  private: QPointF floorPos;
103 
106  private: bool dirty;
107 
109  private: std::vector<WallSegmentItem *> wallSegments;
110 
112  private: QPolygonF floorBoundingRect;
113  };
115  }
116 }
117 
118 #endif
2D representation of a floor.
Definition: FloorItem.hh:39
2D rectangle.
Definition: RectItem.hh:40
Base class of a items that have building level properties such as the level number and level height...
Definition: BuildingItem.hh:33
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
2D representation of a wall.
Definition: WallSegmentItem.hh:40