casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotHolder.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 #ifndef PLOTHOLDER_QO_H
26 #define PLOTHOLDER_QO_H
27 
28 #include <QWidget>
29 #include <QMenu>
30 #include <qwt_plot.h>
31 #include <guitools/Feather/PlotHolder.ui.h>
35 #include <casa/aipstype.h>
36 #include <casa/Arrays/Vector.h>
37 class QGridLayout;
38 
39 
40 namespace casa {
41 
42 class PlotHolder : public QWidget {
43  Q_OBJECT
44 
45 public:
46  PlotHolder(QWidget *parent = 0);
47 
48  //casacore::Data related
50  void setData( const casacore::Vector<float>& x, const casacore::Vector<float>& xAmp,
51  const casacore::Vector<float>& y, const casacore::Vector<float>& yAmp, DataType dType );
52  void updateScatterData( );
53  void addSumData();
54  void clearPlots();
55  void clearData();
56 
57  //Preference changes
58  void setLineThickness( int thickness );
59  void setDotSize( int dotSize );
60  void setLegendVisibility( bool visible );
61  void setDisplayScatterPlot( bool visible );
62  void setDisplayOutputSlice( bool visible );
63  void setDisplayYGraphs( bool visible );
64  void setDisplayXGraphs( bool visible );
65  void setXAxisUV( bool xAxisUV );
66  void setColors( const QMap<PreferencesColor::CurveType,CurveDisplay>& colorMap);
67  void setScatterCurves( const QString& title, FeatherCurveType::CurveType xScatter, const QList<FeatherCurveType::CurveType>& yScatters );
68  void setLogScale( bool uvScale, bool logScale );
69  void refreshPlots();
70  void layoutPlotWidgets();
71 
72  //Dish changes
73  void dishDiameterXChanged( double value );
74  void dishDiameterYChanged( double value );
75 
76  ~PlotHolder();
77 
78 signals:
79  void dishDiameterChangedX( double newValue);
80  void dishDiameterChangedY( double newValue);
81 
82 public slots:
83  //Left mouse modes
84  void setRectangleZoomMode();
86 
87 private slots:
88  void changePlotType();
89  void changeZoom90();
90  void zoomNeutral();
91  void showContextMenu( const QPoint& pt );
92  void rectangleZoomed( double minX, double maxX, double minY, double maxY );
93 
94 private:
96  void initializePlots();
97  void initializeActions();
98  void emptyLayout(QLayout* layout );
99  void addPlotAxis( int rowIndex, int columnIndex, QGridLayout* layout, QwtPlot::Axis axis, int basePlotIndex );
100  void addPlots( QGridLayout*& layout, int rowIndex, int basePlotIndex );
101  std::pair<int,int> addRadialPlots(QGridLayout*& gridLayout);
102  std::pair<int,int> addUVPlots(QGridLayout*& gridLayout );
103  void adjustLayout( bool scatterPlot );
104 
105  QList<FeatherPlotWidget*> plots;
106  QAction plotTypeAction;
107  QAction zoom90Action;
109  QMenu contextMenu;
110  Ui::PlotHolderClass ui;
111  QWidget* legendHolder;
118  //The x-axis on the slice cuts and original graphs can either be u/v (two graphs)
119  //or radial (one graph).
120  bool xAxisUV;
121 
122 };
123 }
124 
125 #endif // PLOTHOLDER_QO_H
QList< FeatherPlotWidget * > plots
void adjustLayout(bool scatterPlot)
void setLineThickness(int thickness)
Preference changes.
void addPlotAxis(int rowIndex, int columnIndex, QGridLayout *layout, QwtPlot::Axis axis, int basePlotIndex)
std::pair< int, int > addUVPlots(QGridLayout *&gridLayout)
void setLegendVisibility(bool visible)
void initializeActions()
void setData(const casacore::Vector< float > &x, const casacore::Vector< float > &xAmp, const casacore::Vector< float > &y, const casacore::Vector< float > &yAmp, DataType dType)
void setDisplayXGraphs(bool visible)
void initializePlots()
void dishDiameterChangedY(double newValue)
void dishDiameterYChanged(double value)
void rectangleZoomed(double minX, double maxX, double minY, double maxY)
void layoutPlotWidgets()
void updateScatterData()
void showContextMenu(const QPoint &pt)
void setDiameterSelectorMode()
void dishDiameterChangedX(double newValue)
PlotHolder(QWidget *parent=0)
std::pair< int, int > addRadialPlots(QGridLayout *&gridLayout)
void addPlots(QGridLayout *&layout, int rowIndex, int basePlotIndex)
void setDisplayOutputSlice(bool visible)
void setRectangleZoomMode()
Left mouse modes.
void setDotSize(int dotSize)
FeatherPlotWidget::DataType DataType
casacore::Data related
Definition: PlotHolder.qo.h:49
void setScatterCurves(const QString &title, FeatherCurveType::CurveType xScatter, const QList< FeatherCurveType::CurveType > &yScatters)
void emptyLayout(QLayout *layout)
void setLogScale(bool uvScale, bool logScale)
void setDisplayScatterPlot(bool visible)
void dishDiameterXChanged(double value)
Dish changes.
void setColors(const QMap< PreferencesColor::CurveType, CurveDisplay > &colorMap)
QWidget * legendHolder
void setXAxisUV(bool xAxisUV)
Ui::PlotHolderClass ui
QAction zoomNeutralAction
void setDisplayYGraphs(bool visible)
GRID LAYOUT CLASSES casacore::Coordinate for a grid layout
QAction plotTypeAction
bool xAxisUV
The x-axis on the slice cuts and original graphs can either be u/v (two graphs) or radial (one graph)...
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
CurveType
Note: Order in this listing is important.