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
00029 #ifndef PARALLELBANDS_H
00030 #define PARALLELBANDS_H
00031
00032 #include "ParallelBand.h"
00033 #include "GraphContentLayer.h"
00034
00035 namespace SciFigs {
00036
00037 class SCIFIGS_EXPORT ParallelBands : public GraphContentLayer
00038 {
00039 Q_OBJECT
00040 Q_PROPERTY(QString axisType READ axisTypeString WRITE setAxisType SCRIPTABLE true)
00041 public:
00042 ParallelBands(AxisWindow * parent=0);
00043 ~ParallelBands();
00044
00045 virtual const QString& xml_tagName() const {return xmlParallelBandsTag;}
00046 static const QString xmlParallelBandsTag;
00047
00048 void operator=(ParallelBands& o);
00049 void clear();
00050
00051 virtual Rect boundingRect() const;
00052
00053 void setAxisType(AxisType a);
00054 AxisType axisType() const {return _axisType;}
00055 QString axisTypeString() const {return _axisType==XAxis ?"X":"Y";}
00056 void setAxisType(QString t) {if(t.contains("X")) setAxisType(XAxis); else setAxisType(YAxis);}
00057
00058 virtual bool trackRectangle(int, double rx1, double ry1, double rx2, double ry2, Qt::KeyboardModifiers);
00059
00060 void addBand(const Brush& b, const Pen& p=Qt::NoPen);
00061 void addBand(double value, const Pen& p=Qt::SolidLine);
00062 void addBand(double min, double max, const Brush& b=Qt::SolidPattern, const Pen& p=Qt::NoPen);
00063 void addBand(const ParallelBand& b) {_bands.append(b);}
00064 void removeBand(int index);
00065
00066 int count() const {return _bands.count();}
00067 ParallelBand& band(int index) {return _bands[index];}
00068 const ParallelBand& band(int index) const {return _bands[index];}
00069 signals:
00070 void bandPicked(double min, double max);
00071 protected:
00072 virtual void paintData(const LayerPainterRequest& lp, QPainter& p, double dotpercm) const;
00073 virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00074 virtual XMLMember xml_member(XML_MEMBER_ARGS);
00075 protected:
00076 AxisType _axisType;
00077 QVector<ParallelBand> _bands;
00078 };
00079
00080 }
00081
00082 #endif // PARALLELBANDS_H