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 PICKLAYER_H
00029 #define PICKLAYER_H
00030
00031 #include <GeopsyCore.h>
00032 #include <SciFigs.h>
00033 #include "PickFormat.h"
00034 #include "GeopsyGuiDLLExport.h"
00035
00036 namespace GeopsyGui {
00037
00038 class SignalLayer;
00039
00040 class GEOPSYGUI_EXPORT PickLayer : public GraphContentLayer
00041 {
00042 Q_OBJECT
00043 public:
00044 PickLayer(AxisWindow * parent=0);
00045 PickLayer(SignalLayer * sig);
00046 ~PickLayer();
00047
00048 virtual const QString& xml_tagName() const {return xmlPickLayerTag;}
00049 static const QString xmlPickLayerTag;
00050
00051 virtual Rect boundingRect() const;
00052
00053 virtual bool hasProperties() {return true;}
00054 virtual void addProperties(PropertyProxy * pp);
00055 virtual void removeProperties(PropertyProxy * pp);
00056 virtual void properties(PropertyWidget * w) const;
00057 virtual void setProperty(uint wid, int pid, QVariant val);
00058
00059 PickFormat& format() {return _format;}
00060 const PickFormat& format() const {return _format;}
00061 public slots:
00062 virtual void setPick(const QString& pickName=QString::null);
00063 void toggleMouseLine(bool b);
00064 signals:
00065 void mousePressed(bool& accept, QMouseEvent * e, int iSig, QRect * trackingRect);
00066 void mouseReleased(bool& accept, QMouseEvent * e);
00067 void mouseMoved(double t);
00068 void mouseMoved(const QPoint& pt);
00069 void pickBegin(bool magnify, int context, double time, Signal * sig, int iSig);
00070 void pickChanged(Signal * sig);
00071 void pickEnd();
00072 void currentSignalChanged(Signal * sig, int iSig);
00073 protected:
00074 void initMembers();
00075 virtual void paintData(const LayerPainterRequest& lp, QPainter& p, double dotpercm) const;
00076 virtual void paintText(const LayerPainterRequest& lp, double dotpercm);
00077 virtual bool eventFilter(QObject *obj, QEvent *event);
00078 virtual bool mousePressEvent (QMouseEvent * e, int);
00079 virtual bool mouseReleaseEvent (QMouseEvent * e, int);
00080 virtual void mouseMoveEvent (const QPoint& pt, Qt::MouseButtons, Qt::KeyboardModifiers);
00081 virtual bool keyPressEvent (QKeyEvent * e);
00082
00083 virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00084 virtual XMLMember xml_member(XML_MEMBER_ARGS);
00085
00086 void addActions ();
00087
00088 SignalLayer * _sig;
00089
00090
00091 int _showMouseLine;
00092
00093 int _iSigPick;
00094
00095 QString _pickName;
00096
00097 PickFormat _format;
00098 static uint _tab;
00099 private:
00100 QList<QPainterPath> _textPaths;
00101 mutable QMutex _textPathsMutex;
00102 };
00103
00104 }
00105
00106 #endif // PICKLAYER_H