##

WallSegmentItem.hh
Go to the documentation of this file.
/*
* Copyright (C) 2014 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_WALLSEGMENTITEM_HH_
#define _GAZEBO_GUI_BUILDING_WALLSEGMENTITEM_HH_
#include <memory>
#include <ignition/math/Vector2.hh>
#include "gazebo/gui/qt.h"
#include "gazebo/gui/building/SegmentItem.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
// Forward declare private data.
class WallSegmentItemPrivate;
class GZ_GUI_VISIBLE WallSegmentItem : public SegmentItem
{
Q_OBJECT
public: WallSegmentItem(const ignition::math::Vector2d &_start,
const ignition::math::Vector2d &_end, const double _height);
public: ~WallSegmentItem();
public: double Height() const;
public: void SetHeight(const double _height);
public: WallSegmentItem *Clone() const;
public: void Update();
public: void WallSegmentChanged();
public: void UpdateInspector();
// Documentation inherited
public: void SetHighlighted(const bool _highlighted);
protected: void SegmentUpdated();
private: void contextMenuEvent(QGraphicsSceneContextMenuEvent *_event);
private: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *_event);
private: QVariant itemChange(GraphicsItemChange _change,
const QVariant &_value);
// Documentation inherited
private slots: void OnApply();
// Documentation inherited
private slots: void OnOpenInspector();
// Documentation inherited
private slots: void OnDeleteItem();
private: std::unique_ptr<WallSegmentItemPrivate> dataPtr;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::WallSegmentItem::WallSegmentChanged
void WallSegmentChanged()
Emit wall segment changed Qt signals.
gazebo::gui::WallSegmentItem::~WallSegmentItem
~WallSegmentItem()
Destructor.
system.hh
gazebo::gui::WallSegmentItem::SetHighlighted
void SetHighlighted(const bool _highlighted)
Set whether this item should be highlighted or not.
gazebo::gui::WallSegmentItem::UpdateInspector
void UpdateInspector()
Update inspector with current values.
SegmentItem.hh
gazebo::gui::WallSegmentItem::Clone
WallSegmentItem * Clone() const
Clone the wall segment item.
gazebo::gui::WallSegmentItem::SegmentUpdated
void SegmentUpdated()
Update wall segment when segment updated.
gazebo::gui::WallSegmentItem
2D representation of a wall.
Definition: WallSegmentItem.hh:41
gazebo::gui::WallSegmentItem::Height
double Height() const
Get the height of the wall segment item.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::SegmentItem
2D line segment.
Definition: SegmentItem.hh:44
gazebo::gui::WallSegmentItem::WallSegmentItem
WallSegmentItem(const ignition::math::Vector2d &_start, const ignition::math::Vector2d &_end, const double _height)
Constructor param[in] _start Start position of the item in pixel coordinates.
gazebo::gui::WallSegmentItem::Update
void Update()
Update by emitting Qt signals.
gazebo::gui::WallSegmentItem::SetHeight
void SetHeight(const double _height)
Set the height of the wall segment item.