00001 //# PlotMSIterateParam.h: Iteration parameters container 00002 //# Copyright (C) 2009 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id: $ 00027 #ifndef PLOTMSITERPARAM_H_ 00028 #define PLOTMSITERPARAM_H_ 00029 00030 #include <plotms/PlotMS/PlotMSConstants.h> 00031 00032 namespace casa { 00033 00034 // Specifies iteration parameters for plotms 00035 class PlotMSIterParam { 00036 public: 00037 // Static // 00038 00039 // None 00040 00041 // Non-Static // 00042 00043 // Constructor, which uses default values. 00044 PlotMSIterParam(); 00045 00046 // Destructor. 00047 ~PlotMSIterParam(); 00048 00049 00050 // Converts this object to/from a record. Each field will have a key that 00051 // is its enum name 00052 // <group> 00053 void fromRecord(const RecordInterface& record); 00054 Record toRecord() const; 00055 // </group> 00056 00057 00058 // Convenience methods for returning the standard field values. 00059 // <group> 00060 PMS::Axis iterAxis() const { return iterAxis_; }; 00061 String iterAxisStr() const { return PMS::axis(iterAxis_); }; 00062 Bool isCommonAxisX() const { return commonAxisX_; }; 00063 Bool isCommonAxisY() const {return commonAxisY_; }; 00064 Bool isGlobalAxisX() const { return globalScaleX_; }; 00065 Bool isGlobalAxisY() const { return globalScaleY_; }; 00066 Int getGridRow() const { return gridRow;}; 00067 Int getGridCol() const { return gridCol;}; 00068 00069 // </group> 00070 00071 00072 // Convenience methods for setting the standard field values. 00073 // <group> 00074 void setIterAxis(PMS::Axis iterAxis) { iterAxis_ = iterAxis; }; 00075 void setIterAxis(String iterAxisStr) { iterAxis_ = PMS::axis(iterAxisStr=="" ? "None" : iterAxisStr); }; 00076 void setCommonAxisX(Bool commonAxisX ){commonAxisX_ = commonAxisX; }; 00077 void setCommonAxisY(Bool commonAxisY ){commonAxisY_ = commonAxisY; }; 00078 void setGlobalScaleX(Bool globalAxisX ){globalScaleX_ = globalAxisX; }; 00079 void setGlobalScaleY(Bool globalAxisY ){globalScaleY_ = globalAxisY; }; 00080 void setGridRow(Int nx) { gridRow = max(nx,-1); }; 00081 void setGridCol(Int ny) { gridCol = max(ny,-1); }; 00082 bool isIteration() const; 00083 // </group> 00084 00085 00086 // Equality operators. 00087 // <group> 00088 bool operator==(const PlotMSIterParam& other) const; 00089 bool operator!=(const PlotMSIterParam& other) const { 00090 return !(operator==(other)); } 00091 // </group> 00092 00093 // Print out a summary 00094 String summary() const; 00095 00096 // Sets the default values. 00097 void setDefaults(); 00098 00099 private: 00100 00101 // The Iteration axis 00102 PMS::Axis iterAxis_; 00103 static const String ITER_AXIS; 00104 00105 // global scale X and Y axes 00106 Bool globalScaleX_, globalScaleY_; 00107 static const String GLOBAL_SCALE_X; 00108 static const String GLOBAL_SCALE_Y; 00109 00110 //Whether to use a common axis when the grid consists of 00111 //multiple plots and the axis has a global scale. 00112 Bool commonAxisX_, commonAxisY_; 00113 static const String COMMON_AXIS_X; 00114 static const String COMMON_AXIS_Y; 00115 00116 00117 // The location of the plot in rows and columns 00118 Int gridRow; 00119 Int gridCol; 00120 static const String ROW_INDEX; 00121 static const String COL_INDEX; 00122 00123 00124 00125 }; 00126 00127 } 00128 00129 #endif /* PLOTMSITERPARAM_H_ */