Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef MOUSETRACKING_H
00029 #define MOUSETRACKING_H
00030
00031 #include "SciFigsDLLExport.h"
00032 #include "LayerMouseTracking.h"
00033
00034 namespace SciFigs {
00035
00036 class SCIFIGS_EXPORT MouseTracking : private QList<LayerMouseTracking>
00037 {
00038 public:
00039 MouseTracking() {_rectangle=0; _active=true;}
00040 ~MouseTracking() {delete _rectangle;}
00041
00042 void add(const LayerMouseTracking& l);
00043 void remove(int i);
00044
00045 bool isEmpty() const {return QList<LayerMouseTracking>::isEmpty();}
00046 int indexOf(GraphContentLayer * layer, int id=-1) const;
00047 bool contains(GraphContentLayer * layer, int id=-1) const {return indexOf(layer, id)>-1;}
00048 const LayerMouseTracking& activeLayer() const {return first();}
00049
00050 bool isRectangle() const;
00051 bool isRectangleVisible() const;
00052 QRect * rectangle() const {return _rectangle;}
00053 void initRectangle(const QPoint& topLeft);
00054 void resetRectangle();
00055 bool isEmptyRectangle() const {return abs(_rectangle->width())<5 && abs(_rectangle->height())<5;}
00056
00057 bool isActive() const {return _active;}
00058 void setActive(bool a) {_active=a;}
00059 private:
00060 QRect * _rectangle;
00061 bool _active;
00062 };
00063
00064 }
00065
00066 #endif // MOUSETRACKING_H