![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2010 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 ********************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: .h,v $ $Revision: 1.2 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00009 #ifndef HlaBounceGraphicsScene_H_ 00010 #define HlaBounceGraphicsScene_H_ 00011 00012 #include <qgraphicsscene.h> 00013 #include <qrect.h> 00014 00015 class HlaBounceGraphicsScene : public QGraphicsScene 00016 { 00017 Q_OBJECT 00018 00019 public: 00020 00021 HlaBounceGraphicsScene(QObject * parent = 0 ); 00022 HlaBounceGraphicsScene(const QRectF & sceneRect, QObject * parent = 0); 00023 HlaBounceGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject * parent = 0); 00024 virtual ~HlaBounceGraphicsScene(); 00025 00026 // Enters/exits the graphics scene into a mode where it will draw a 00027 // rectangle when the mouse is down 00028 void setDrawRectangleMode(bool enable); 00029 00030 // Returns the last rectangle to be drawn 00031 QRect getLastRectangle() { return myLastRectangle; }; 00032 00033 protected: 00034 00035 virtual void mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent); 00036 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent); 00037 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent); 00038 00039 signals: 00040 00041 void mouseReleased(const QPointF&); 00042 00043 protected: 00044 00045 bool myDrawRectangle; 00046 QGraphicsRectItem* myRectangle; 00047 QRect myLastRectangle; 00048 00049 }; 00050 00051 #endif