repository for casafeather app
Source
ExternalAxisControlRight* rightWidget = dynamic_cast<ExternalAxisControlRight*>(axisWidgets[QwtPlot::yRight]);
//# 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 {
const QString FeatherPlot::Y_EQUALS_X = "y=x";
FeatherPlot::FeatherPlot(QWidget* parent):QwtPlot( parent ),
externalLegend( NULL), lineThickness(1),
dotSize(1), AXIS_COUNT(3) {
scaleLogAmplitude = false;
scaleLogUV = false;
initAxes();
setCanvasBackground( Qt::white );
// Disable default plot axes since they are external
enableAxis(QwtPlot::xBottom, false);
enableAxis(QwtPlot::yLeft, false);
}
void FeatherPlot::initializePlot( const QString& graphTitle, PlotType plotType ){
//Store what type of plot we are.
this->plotType = plotType;
//Set the title of the plot
setTitle( graphTitle );
QwtText titleText = title();
QFont titleFont = titleText.font();
titleFont.setPointSize(9);
titleText.setFont( titleFont );
setTitle( titleText );
//Set up the axis scales and labels
setAxisLabels();
resetPlotBounds();
}
void FeatherPlot::initAxes(){
for ( int i = 0; i < AXIS_COUNT; i++ ){
axisBlanks.append( new ExternalAxis() );
axisWidgets.append( NULL );
axisLabels.append( "" );
axisTitles.append( "" );
setAxisScaleDraw( i, axisBlanks[i] );
}
}
void FeatherPlot::resetPlotBounds(){
minX = std::numeric_limits<double>::max();