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 CHRONOGRAMLAYER_H
00029 #define CHRONOGRAMLAYER_H
00030
00031 #include <GeopsyCore.h>
00032 #include <SciFigs.h>
00033
00034 #include "GeopsyGuiDLLExport.h"
00035
00036 #define CHRONOGRAMLAYER_TRACKING_ID 347
00037
00038 namespace GeopsyGui {
00039
00040 class GEOPSYGUI_EXPORT ChronogramLayer : public GraphContentLayer
00041 {
00042 Q_OBJECT
00043 public:
00044 ChronogramLayer(AxisWindow * parent=0);
00045 ~ChronogramLayer();
00046
00047 virtual const QString& xml_tagName() const {return xmlChronogramLayerTag;}
00048 static const QString xmlChronogramLayerTag;
00049
00050 void subPoolUpdate(SubSignalPool * subPool=0);
00051 void rangeUpdate();
00052
00053 const SubSignalPool * subPool() const {return _subPool;}
00054
00055 virtual Rect boundingRect() const;
00056
00057 int hitCount() const {return _stations.count()*_stations.nComponents();}
00058 QString name(int index) const;
00059
00060 virtual bool hasProperties() {return true;}
00061 virtual void addProperties(PropertyProxy * pp);
00062 virtual void removeProperties(PropertyProxy * pp);
00063 virtual void properties(PropertyWidget * w) const;
00064 virtual void setProperty(uint wid, int pid, QVariant val);
00065
00066 void exportGaps(const QString& fileName);
00067
00068 virtual bool trackRectangle(int id, double rx1, double ry1, double rx2, double ry2, Qt::KeyboardModifiers m);
00069 SubSignalPool selection() const;
00070 protected:
00071 virtual void paintData(const LayerPainterRequest& lp, QPainter& p, double dotpercm) const;
00072 void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00073 XMLMember xml_member(XML_MEMBER_ARGS);
00074 void xml_polishChild(XML_POLISHCHILD_ARGS);
00075 private:
00076 void drawRanges(const GraphContentOptions& gc, QPainter& p,
00077 const SparseTimeRange& r,
00078 double yBase, double minY, double maxY,
00079 const QColor& fill, const QColor& border) const;
00080
00081 SubSignalPool * _subPool;
00082 bool _subPoolOwner;
00083 StationList _stations;
00084 double _minimumGap;
00085
00086 static uint _tab;
00087 struct StationRange {
00088 SparseTimeRange _selected, _available, _overlap;
00089 };
00090 QVector<StationRange> _ranges;
00091 };
00092
00093 }
00094
00095 #endif // CHRONOGRAMLAYER_H