PlotMSParameters.h

Go to the documentation of this file.
00001 //# PlotMSParameters.h: Parameter classes for plotms.
00002 //# Copyright (C) 2008
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 //#
00025 //# $Id:  $
00026 #ifndef PLOTMSPARAMETERS_H_
00027 #define PLOTMSPARAMETERS_H_
00028 
00029 #include <plotms/PlotMS/PlotMSConstants.h>
00030 #include <plotms/PlotMS/PlotMSWatchedParameters.h>
00031 
00032 namespace casa {
00033 
00034 // Subclass of PlotMSWatchedParameters that hold parameters for the whole
00035 // plotter.  These parameters include:
00036 // * log file name
00037 // * log events flag
00038 // * log minimum priority filter
00039 // * whether to clear any selections when axes are changed or not
00040 // * width and height for the cached image
00041 class PlotMSParameters : public PlotMSWatchedParameters {
00042 public:
00043     // Static //
00044     
00045     // Update flags.
00046     // <group>
00047     static const int UPDATE_LOG;
00048     static const int UPDATE_PLOTMS_OPTIONS;
00049     // </group>
00050     
00051     // Gets/Sets the file chooser history limit.  (See QtFileDialog.)  Static
00052     // parameter.
00053     // <group>
00054     static int chooserHistoryLimit();
00055     static void setChooserListoryLimit(int histLimit);
00056     // </group>
00057     
00058     
00059     // Non-Static //
00060     
00061     // Constructor, with default values for parameters.
00062     PlotMSParameters(const String& logFilename = PMS::DEFAULT_LOG_FILENAME,
00063             int logEvents = PMS::DEFAULT_LOG_EVENTS,
00064             LogMessage::Priority logPriority = PMS::DEFAULT_LOG_PRIORITY,
00065             bool clearSelections = PMS::DEFAULT_CLEAR_SELECTIONS,
00066             int cachedImageWidth = PMS::DEFAULT_CACHED_IMAGE_WIDTH,
00067             int cachedImageHeight = PMS::DEFAULT_CACHED_IMAGE_HEIGHT,
00068             int rowCount = PMS::DEFAULT_GRID_ROWS,
00069             int colCount = PMS::DEFAULT_GRID_COLS);
00070     
00071     // Copy constructor.  See operator=().
00072     PlotMSParameters(const PlotMSParameters& copy);
00073     
00074     // Destructor.
00075     ~PlotMSParameters();
00076 
00077     
00078     // Gets/Sets the log sink location/filename.
00079     // <group>
00080     String logFilename() const;
00081     void setLogFilename(const String& filename);
00082     // </group>
00083     
00084     // Returns the current log events.
00085     int logEvents() const;
00086     
00087     // Returns the current log minimum priority.
00088     LogMessage::Priority logPriority() const;
00089     
00090     // Sets the current log filter.
00091     void setLogFilter(int logEvents, LogMessage::Priority priority);
00092     
00093     // Gets/Sets whether any selections are cleared when plot axes are changed
00094     // or not.
00095     // <group>
00096     bool clearSelectionsOnAxesChange() const;
00097     void setClearSelectionsOnAxesChange(bool flag);
00098     // </group>
00099     
00100     // Gets/Sets the cached image size.  See
00101     // PlotCanvas::cachedAxesStackImageSize().
00102     // <group>
00103     std::pair<int, int> cachedImageSize() const;
00104     void setCachedImageSize(int width, int height);
00105     // </group>
00106     
00107     // Sets the cached image size to the current screen resolution.
00108     void setCachedImageSizeToResolution();
00109     
00110 
00111 
00112     //<group>
00113     bool setGridSize( int rows, int cols );
00114     int getRowCount() const;
00115     int getColCount() const;
00116     void setRowCount( int rowCount );
00117     void setColCount( int colCount );
00118     //</group>
00119 
00120     // Copy operator.
00121     PlotMSParameters& operator=(const PlotMSParameters& copy);
00122     
00123     
00124     // Implements PlotMSWatchedParameters::equals().  Will return false if the
00125     // other parameters are not of type PlotMSParameters.
00126     bool equals(const PlotMSWatchedParameters& other, int updateFlags) const;
00127     
00128 private:
00129     // Log filename.
00130     String itsLogFilename_;
00131     
00132     // Log events flag.
00133     int itsLogEvents_;
00134     
00135     // Log minimum priority.
00136     LogMessage::Priority itsLogPriority_;
00137     
00138     // Clear selections on axes change flag.
00139     bool itsClearSelectionsOnAxesChange_;
00140     
00141     // Cached image sizes.
00142     int itsCachedImageWidth_, itsCachedImageHeight_;
00143 
00144     int rowCount;
00145     int colCount;
00146 
00147 
00148 };
00149 
00150 //Removal of compile warnings for unused variables.
00151 class DummyClass {
00152 private:
00153         static const int dummyDraw;
00154         static const int dummyData;
00155         static const int dummyCache;
00156         static const int dummyAxes;
00157         static const int dummyCanvas;
00158         static const int dummyDisplay;
00159         static const int dummyIter;
00160 };
00161 
00162 }
00163 
00164 #endif /* PLOTMSPARAMETERS_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1