PlotHolder.qo.h

Go to the documentation of this file.
00001 //# Copyright (C) 2005
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
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     //Data related
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     //Preference changes
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     //Dish changes
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         //Left mouse modes
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     //The x-axis on the slice cuts and original graphs can either be u/v (two graphs)
00119     //or radial (one graph).
00120     bool xAxisUV;
00121 
00122 };
00123 }
00124 
00125 #endif // PLOTHOLDER_QO_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1