PlotHolder.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 #ifndef PLOTHOLDER_QO_H
00026 #define PLOTHOLDER_QO_H
00027
00028 #include <QtGui/QWidget>
00029 #include <QMenu>
00030 #include <qwt_plot.h>
00031 #include <guitools/Feather/PlotHolder.ui.h>
00032 #include <guitools/Feather/PreferencesColor.qo.h>
00033 #include <guitools/Feather/FeatherCurveType.h>
00034 #include <guitools/Feather/FeatherPlotWidget.qo.h>
00035 #include <casa/aipstype.h>
00036 #include <casa/Arrays/Vector.h>
00037 class QGridLayout;
00038
00039
00040 namespace casa {
00041
00042 class PlotHolder : public QWidget {
00043 Q_OBJECT
00044
00045 public:
00046 PlotHolder(QWidget *parent = 0);
00047
00048
00049 typedef FeatherPlotWidget::DataType DataType;
00050 void setData( const Vector<Float>& x, const Vector<Float>& xAmp,
00051 const Vector<Float>& y, const Vector<Float>& yAmp, DataType dType );
00052 void updateScatterData( );
00053 void addSumData();
00054 void clearPlots();
00055 void clearData();
00056
00057
00058 void setLineThickness( int thickness );
00059 void setDotSize( int dotSize );
00060 void setLegendVisibility( bool visible );
00061 void setDisplayScatterPlot( bool visible );
00062 void setDisplayOutputSlice( bool visible );
00063 void setDisplayYGraphs( bool visible );
00064 void setDisplayXGraphs( bool visible );
00065 void setXAxisUV( bool xAxisUV );
00066 void setColors( const QMap<PreferencesColor::CurveType,CurveDisplay>& colorMap);
00067 void setScatterCurves( const QString& title, FeatherCurveType::CurveType xScatter, const QList<FeatherCurveType::CurveType>& yScatters );
00068 void setLogScale( bool uvScale, bool logScale );
00069 void refreshPlots();
00070 void layoutPlotWidgets();
00071
00072
00073 void dishDiameterXChanged( double value );
00074 void dishDiameterYChanged( double value );
00075
00076 ~PlotHolder();
00077
00078 signals:
00079 void dishDiameterChangedX( double newValue);
00080 void dishDiameterChangedY( double newValue);
00081
00082 public slots:
00083
00084 void setRectangleZoomMode();
00085 void setDiameterSelectorMode();
00086
00087 private slots:
00088 void changePlotType();
00089 void changeZoom90();
00090 void zoomNeutral();
00091 void showContextMenu( const QPoint& pt );
00092 void rectangleZoomed( double minX, double maxX, double minY, double maxY );
00093
00094 private:
00095 enum Plots { SLICE_X, SLICE_Y, SLICE_DISTANCE, SCATTER_X, SCATTER_Y, SCATTER_DISTANCE };
00096 void initializePlots();
00097 void initializeActions();
00098 void emptyLayout(QLayout* layout );
00099 void addPlotAxis( int rowIndex, int columnIndex, QGridLayout* layout, QwtPlot::Axis axis, int basePlotIndex );
00100 void addPlots( QGridLayout*& layout, int rowIndex, int basePlotIndex );
00101 std::pair<int,int> addRadialPlots(QGridLayout*& gridLayout);
00102 std::pair<int,int> addUVPlots(QGridLayout*& gridLayout );
00103 void adjustLayout( bool scatterPlot );
00104
00105 QList<FeatherPlotWidget*> plots;
00106 QAction plotTypeAction;
00107 QAction zoom90Action;
00108 QAction zoomNeutralAction;
00109 QMenu contextMenu;
00110 Ui::PlotHolderClass ui;
00111 QWidget* legendHolder;
00112 bool legendVisible;
00113 bool displayOutputSlice;
00114 bool displayScatter;
00115 bool tempScatterPlot;
00116 bool displayYGraphs;
00117 bool displayXGraphs;
00118
00119
00120 bool xAxisUV;
00121
00122 };
00123 }
00124
00125 #endif // PLOTHOLDER_QO_H