RotateHandle.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 #ifndef GAZEBO_GUI_BUILDING_ROTATEHANDLE_HH_
18 #define GAZEBO_GUI_BUILDING_ROTATEHANDLE_HH_
19 
20 #include <memory>
21 
22 #include "gazebo/gui/qt.h"
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
27  namespace gui
28  {
29  // Forward declare private data.
30  class RotateHandlePrivate;
31 
34 
37  class GZ_GUI_VISIBLE RotateHandle : public QGraphicsItem
38  {
41  public: explicit RotateHandle(QGraphicsItem *_parent = 0);
42 
44  public: ~RotateHandle();
45 
50  public: void SetMouseState(const int _state);
51 
55  public: int MouseState() const;
56 
60  public: double MouseDownX() const;
61 
65  public: double MouseDownY() const;
66 
70  public: void SetMouseDownX(const double _x);
71 
75  public: void SetMouseDownY(const double _y);
76 
79  protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
80 
83  protected: void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
84 
87  protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
88 
91  protected: void mousePressEvent(QGraphicsSceneMouseEvent *_event);
92 
95  protected: void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event);
96 
99  public: virtual QRectF boundingRect() const;
100 
105  private: void paint(QPainter *_painter,
106  const QStyleOptionGraphicsItem *_option, QWidget *_widget);
107 
110  private: std::unique_ptr<RotateHandlePrivate> dataPtr;
111  };
113  }
114 }
115 
116 #endif
Handle for rotating an editor item.
Definition: RotateHandle.hh:37