RotateHandle.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 _GAZEBO_GUI_ROTATEHANDLE_HH_
19 #define _GAZEBO_GUI_ROTATEHANDLE_HH_
20 
21 #include <memory>
22 
24 
25 #include "gazebo/gui/qt.h"
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  // Forward declare private data.
33  class RotateHandlePrivate;
34 
37 
40  class GZ_GUI_VISIBLE RotateHandle : public QGraphicsItem
41  {
44  public: RotateHandle(QGraphicsItem *_parent = 0);
45 
47  public: ~RotateHandle();
48 
53  public: void SetMouseState(const int _state);
54 
58  public: int MouseState() const;
59 
63  public: double MouseDownX() const;
64 
68  public: double MouseDownY() const;
69 
73  public: void SetMouseDownX(const double _x);
74 
78  public: void SetMouseDownY(const double _y);
79 
82  protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
83 
86  protected: void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
87 
90  protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
91 
94  protected: void mousePressEvent(QGraphicsSceneMouseEvent *_event);
95 
98  protected: void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event);
99 
102  public: virtual QRectF boundingRect() const;
103 
108  private: void paint(QPainter *_painter,
109  const QStyleOptionGraphicsItem *_option, QWidget *_widget);
110 
113  private: std::unique_ptr<RotateHandlePrivate> dataPtr;
114  };
116  }
117 }
118 
119 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Handle for rotating an editor item.
Definition: RotateHandle.hh:40