##

FloorItem.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_GUI_BUILDING_FLOORITEM_HH_
#define _GAZEBO_GUI_BUILDING_FLOORITEM_HH_
#include <memory>
#include <ignition/math/Vector3.hh>
#include "gazebo/gui/qt.h"
#include "gazebo/gui/building/RectItem.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
class WallSegmentItem;
// Forward declare private data.
class FloorItemPrivate;
class GZ_GUI_VISIBLE FloorItem : public RectItem
{
Q_OBJECT
public: FloorItem();
public: ~FloorItem();
// Documentation inherited.
public: virtual ignition::math::Vector3d Size() const;
// Documentation inherited.
public: virtual ignition::math::Vector3d ScenePosition() const;
// Documentation inherited.
public: virtual double SceneRotation() const;
public: void AttachWallSegment(WallSegmentItem *_wallSegmentItem);
public: void FloorChanged();
// Documentation inherited.
private: virtual void paint(QPainter *_painter,
const QStyleOptionGraphicsItem *_option, QWidget *_widget);
// Documentation inherited.
private: virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
// Documentation inherited.
private: virtual void contextMenuEvent(
QGraphicsSceneContextMenuEvent *_event);
private slots: void NotifyChange();
private slots: void RecalculateBoundingBox();
private slots: void WallSegmentDeleted();
private: void Update();
private: void SizeChanged();
private: std::unique_ptr<FloorItemPrivate> dataPtr;
};
}
}
#endif
gazebo::gui::FloorItem::~FloorItem
~FloorItem()
Destructor.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::FloorItem::SceneRotation
virtual double SceneRotation() const
Get the scene rotation of the editor item.
gazebo::gui::FloorItem::ScenePosition
virtual ignition::math::Vector3d ScenePosition() const
Get the scene position of editor item.
system.hh
gazebo::gui::FloorItem::FloorItem
FloorItem()
Constructor.
gazebo::gui::FloorItem
2D representation of a floor.
Definition: FloorItem.hh:43
gazebo::gui::RectItem
2D rectangle.
Definition: RectItem.hh:49
gazebo::gui::WallSegmentItem
2D representation of a wall.
Definition: WallSegmentItem.hh:41
gazebo::gui::FloorItem::Size
virtual ignition::math::Vector3d Size() const
Get the size of the item in pixels.
RectItem.hh
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::FloorItem::AttachWallSegment
void AttachWallSegment(WallSegmentItem *_wallSegmentItem)
Attach walls so the floor can auto expand to hold the wall.
gazebo::gui::FloorItem::FloorChanged
void FloorChanged()
Emit floor changed Qt signals.