repository for casafeather app
Source
//# Copyright (C) 2005
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
using namespace casacore;
namespace casa {
PlotHolder::PlotHolder(QWidget *parent)
: QWidget(parent),
plotTypeAction( "Scatter Plot", this ), zoom90Action( "Auto Zoom", this),
zoomNeutralAction( "Zoom Neutral", this ),contextMenu( this ), legendHolder( NULL ),
legendVisible( false ),
displayOutputSlice(false),
displayScatter( false ), tempScatterPlot(false),
displayYGraphs( false ), displayXGraphs( true ),
xAxisUV( true ){
ui.setupUi(this);
initializePlots();
initializeActions();
}
void PlotHolder::initializeActions(){
plotTypeAction.setStatusTip( "Toggle between a slice plot and a scatter plot.");
plotTypeAction.setCheckable( true );
connect( &plotTypeAction, SIGNAL(triggered()), this, SLOT(changePlotType()));
zoom90Action.setCheckable( true );
connect( &zoom90Action, SIGNAL(triggered()), this, SLOT(changeZoom90()));
zoomNeutralAction.setStatusTip( "Restore the graph back to its original non-zoomed state");
connect( &zoomNeutralAction, SIGNAL(triggered()), this, SLOT(zoomNeutral()));
contextMenu.addAction( &plotTypeAction );
contextMenu.addAction( &zoom90Action );
contextMenu.addAction( &zoomNeutralAction );
setContextMenuPolicy( Qt::CustomContextMenu);
connect( this, SIGNAL(customContextMenuRequested( const QPoint&)), this, SLOT(showContextMenu(const QPoint&)));
}
void PlotHolder::initializePlots(){
//Add the plots to the array
FeatherPlotWidget* xWidget = new FeatherPlotWidgetSlice( "Slice U", FeatherPlot::SLICE_CUT);
connect( xWidget, SIGNAL(dishDiameterChanged(double)), this, SIGNAL(dishDiameterChangedX(double)));
connect( xWidget, SIGNAL(rectangleZoomed(double,double,double,double)), this, SLOT(rectangleZoomed(double,double,double,double)));
plots.append( xWidget );
FeatherPlotWidget* yWidget = new FeatherPlotWidgetSlice( "Slice V", FeatherPlot::SLICE_CUT);
connect( yWidget, SIGNAL(dishDiameterChanged(double)), this, SIGNAL(dishDiameterChangedY(double)));
connect( yWidget, SIGNAL(rectangleZoomed(double,double,double,double)), this, SLOT(rectangleZoomed(double,double,double,double)));
plots.append( yWidget );
FeatherPlotWidget* distanceWidget = new FeatherPlotWidgetSlice( "Slice Radial Distance", FeatherPlot::SLICE_CUT);
connect( distanceWidget, SIGNAL(dishDiameterChanged(double)), this, SIGNAL(dishDiameterChangedY(double)));
connect( distanceWidget, SIGNAL(rectangleZoomed(double,double,double,double)), this, SLOT(rectangleZoomed(double,double,double,double)));
plots.append( distanceWidget );
FeatherPlotWidget* xWidgetScatter = new FeatherPlotWidgetScatter( "Scatter U", FeatherPlot::SCATTER_PLOT);
plots.append( xWidgetScatter );
FeatherPlotWidget* yWidgetScatter = new FeatherPlotWidgetScatter( "Scatter V", FeatherPlot::SCATTER_PLOT);
plots.append( yWidgetScatter );
FeatherPlotWidget* distanceWidgetScatter = new FeatherPlotWidgetScatter( "Scatter Radial Distance", FeatherPlot::SCATTER_PLOT);
plots.append( distanceWidgetScatter );