casa
$Rev:20696$
|
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 /* 00026 * This abstract class is an interface that specifies the basic functionality that 00027 * spectral line moments/fitting should implement. It is expected that it will be subclassed 00028 * by implementation classes to provide specialized behavior. 00029 * 00030 */ 00031 00032 #ifndef PROFILE_TASK_FACILITATOR_H_ 00033 #define PROFILE_TASK_FACILITATOR_H_ 00034 00035 #include <QString> 00036 #include <casa/BasicSL/String.h> 00037 #include <casa/Arrays/Vector.h> 00038 #include <casa/Containers/Record.h> 00039 00040 class QDoubleValidator; 00041 00042 namespace casa { 00043 00044 class QtCanvas; 00045 class ProfileTaskMonitor; 00046 class LogIO; 00047 00048 template <class T> class ImageInterface; 00049 00050 class ProfileTaskFacilitator { 00051 public: 00052 ProfileTaskFacilitator(); 00053 virtual ~ProfileTaskFacilitator(); 00054 00055 virtual void setUnits( QString units ) = 0; 00056 virtual void setRange(double start, double end )=0; 00057 virtual void reset() = 0; 00058 00059 virtual void setCanvas( QtCanvas* pixelCanvas ); 00060 virtual void setTaskMonitor( ProfileTaskMonitor* monitor ); 00061 virtual void setCurveName( const QString& curveName ); 00062 virtual void addCurveName( const QString& curveName ); 00063 virtual void setDisplayYUnits( const QString& units ); 00064 virtual void setImageYUnits( const QString& units ); 00065 virtual void setLogger( LogIO* log ); 00066 virtual void plotMainCurve(); 00067 00068 virtual QString getFileName(); 00069 virtual void logWarning(String msg ); 00070 virtual void postStatus( String status ); 00071 virtual Vector<Float> getXValues() const; 00072 virtual Vector<Float> getYValues() const; 00073 virtual Vector<Float> getZValues() const; 00074 virtual QString getYUnit() const; 00075 virtual QString getYUnitPrefix() const; 00076 virtual String getXAxisUnit() const; 00077 virtual const ImageInterface<Float>* getImage( const QString& name="") const; 00078 virtual const String getPixelBox() const; 00079 00080 bool isOptical(); 00081 void setOptical( bool optical ); 00082 00083 virtual void clear(); 00084 void setCollapseVals(const Vector<Float> &spcVals); 00085 00086 virtual void pixelsChanged(int pixX, int pixY ); 00087 00088 protected: 00089 bool isValidChannelRangeValue( QString str, const QString& endStr ); 00090 void findChannelRange( float startVal, float endVal, 00091 const Vector<Float>& specValues, Int& channelStartIndex, Int& channelEndIndex ); 00092 QtCanvas* pixelCanvas; 00093 ProfileTaskMonitor* taskMonitor; 00094 LogIO* logger; 00095 00096 private: 00097 bool optical; 00098 QDoubleValidator *validator; 00099 }; 00100 00101 } /* namespace casa */ 00102 #endif /* SPECFITTER_H_ */