##

GrabberHandle.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_GRABBERHANDLE_HH_
#define GAZEBO_GUI_BUILDING_GRABBERHANDLE_HH_
#include <vector>
#include <memory>
#include <ignition/math/Color.hh>
#include <ignition/math/Vector2.hh>
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
// Forward declare private data class.
class GrabberHandlePrivate;
class GZ_GUI_VISIBLE GrabberHandle : public QGraphicsItem
{
public: GrabberHandle(QGraphicsItem *_parent = 0, int index = 0);
public: virtual ~GrabberHandle();
public: int Index() const;
public: int MouseState() const;
public: ignition::math::Vector2d CenterPoint() const;
public: double MouseDownX() const;
public: double MouseDownY() const;
public: double Width() const;
public: double Height() const;
public: ignition::math::Color Color() const;
public: void SetMouseState(int _state);
public: void SetMouseDownX(double _x);
public: void SetMouseDownY(double _y);
public: void SetWidth(double _width);
public: void SetHeight(double _height);
public: void SetColor(const ignition::math::Color &_color);
public: void SetBorderColor(const ignition::math::Color &_borderColor);
public: virtual QRectF boundingRect() const;
public: std::vector<GrabberHandle *> LinkedGrabbers() const;
public: void PushLinkedGrabber(GrabberHandle *_grabber);
public: void EraseLinkedGrabber(GrabberHandle *_grabber);
private: virtual void paint(QPainter *_painter,
const QStyleOptionGraphicsItem *_option, QWidget *_widget);
protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
protected: void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
protected: void mousePressEvent(QGraphicsSceneMouseEvent *_event);
protected: void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event);
protected: void mousePressEvent(QGraphicsSceneDragDropEvent *_event);
protected: void mouseMoveEvent(QGraphicsSceneDragDropEvent *_event);
private: std::unique_ptr<GrabberHandlePrivate> dataPtr;
};
}
}
#endif
gazebo::gui::GrabberHandle::SetHeight
void SetHeight(double _height)
Set the height of the grabber handle.
gazebo::gui::GrabberHandle::Color
ignition::math::Color Color() const
Get the fill color of the grabber handle.
gazebo::gui::GrabberHandle::hoverEnterEvent
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event)
Qt mouse hover enter event.
gazebo::gui::GrabberHandle::EraseLinkedGrabber
void EraseLinkedGrabber(GrabberHandle *_grabber)
Erase a grabber from the list of grabbers linked to this.
gazebo::gui::GrabberHandle::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *_event)
Qt mouse press event.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::GrabberHandle::MouseState
int MouseState() const
Get the current mouse state.
gazebo::gui::GrabberHandle::CenterPoint
ignition::math::Vector2d CenterPoint() const
Get the center point of the grabber handle.
gazebo::gui::GrabberHandle::MouseDownY
double MouseDownY() const
Get the Y position of the mouse press.
gazebo::gui::GrabberHandle::LinkedGrabbers
std::vector< GrabberHandle * > LinkedGrabbers() const
Get the vector of grabbers linked to this.
system.hh
gazebo::gui::GrabberHandle::hoverLeaveEvent
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event)
Qt mouse hover leave event.
gazebo::gui::GrabberHandle
Definition: GrabberHandle.hh:38
gazebo::gui::GrabberHandle::SetBorderColor
void SetBorderColor(const ignition::math::Color &_borderColor)
Set the border color of the grabber handle.
gazebo::gui::GrabberHandle::~GrabberHandle
virtual ~GrabberHandle()
Destructor.
gazebo::gui::GrabberHandle::SetColor
void SetColor(const ignition::math::Color &_color)
Set the fill color of the grabber handle.
gazebo::gui::GrabberHandle::Index
int Index() const
Get the index of the grabber handle.
gazebo::gui::GrabberHandle::PushLinkedGrabber
void PushLinkedGrabber(GrabberHandle *_grabber)
Push a grabber to the list of grabbers linked to this.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::GrabberHandle::MouseDownX
double MouseDownX() const
Get the X position of the mouse press.
gazebo::gui::GrabberHandle::SetMouseState
void SetMouseState(int _state)
Set the current mouse state.
gazebo::gui::GrabberHandle::Width
double Width() const
Get the width of the grabber handle.
gazebo::gui::GrabberHandle::SetMouseDownX
void SetMouseDownX(double _x)
Set the X position of the mouse press.
gazebo::gui::GrabberHandle::boundingRect
virtual QRectF boundingRect() const
Get the bounding box of the grabber handle.
gazebo::gui::GrabberHandle::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *_event)
Qt mouse move event.
gazebo::gui::GrabberHandle::Height
double Height() const
Get the height of the grabber handle.
gazebo::gui::GrabberHandle::SetWidth
void SetWidth(double _width)
Set the width of the grabber handle.
gazebo::gui::GrabberHandle::SetMouseDownY
void SetMouseDownY(double _y)
Set the Y position of the mouse press.
gazebo::gui::GrabberHandle::GrabberHandle
GrabberHandle(QGraphicsItem *_parent=0, int index=0)
Constructor.
gazebo::gui::GrabberHandle::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event)
Qt mouse release event.