SliceSegment.qo.h
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 #ifndef SLICE_SEGMENT_QO_H
00027 #define SLICE_SEGMENT_QO_H
00028
00029 #include <QtGui/QFrame>
00030 #include <casa/BasicSL/String.h>
00031 #include <display/Slicer/SliceSegment.ui.h>
00032
00033 class QwtPlot;
00034 class QwtPlotCurve;
00035
00036 namespace casa {
00037
00045 class SliceStatistics;
00046 class SegmentTracer;
00047
00048 class SliceSegment : public QFrame {
00049 Q_OBJECT
00050
00051 public:
00052 SliceSegment(int regionId, int index, QWidget *parent = 0);
00053 void addCurve( QwtPlot* plot, const QVector<double>& xValues, const QVector<double>& yValues );
00054 void setEndPointsWorld( double worldX1, double worldY1, double worldX2, double worldY2 );
00055 void setEndPointsPixel( int pixelX1, int pixelY1, int pixelX2, int pixelY2 );
00056 void setColor( QColor color );
00057 void setCurveWidth( int width );
00058 void updateEnds( const String& start, const String& end);
00059 QColor getCurveColor() const;
00060 void clearCurve();
00061 void updateStatistics( SliceStatistics* statistics );
00062 QwtPlot* getPlot();
00063 ~SliceSegment();
00064
00065 signals:
00066 void statisticsSelected( int index );
00067
00068 private:
00069 QString parseEndInfo( const String& info ) const;
00070 void resetCurveWidth();
00071 void setCurveColor();
00072 SliceSegment( const SliceSegment& other );
00073 SliceSegment operator=( const SliceSegment& other );
00074 std::pair<double,double> worldStart;
00075 std::pair<double,double> worldEnd;
00076 std::pair<int,int> pixelStart;
00077 std::pair<int,int> pixelEnd;
00078 int curveWidth;
00079 int regionId;
00080 int index;
00081
00082 QColor defaultColor;
00083 QwtPlotCurve* plotCurve;
00084 SegmentTracer* segmentTracer;
00085 Ui::SliceSegmentClass ui;
00086 };
00087
00088 }
00089
00090 #endif // SLICESEGMENT_QO_H