casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotMSParameters.h
Go to the documentation of this file.
1 //# PlotMSParameters.h: Parameter classes for plotms.
2 //# Copyright (C) 2008
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //#
25 //# $Id: $
26 #ifndef PLOTMSPARAMETERS_H_
27 #define PLOTMSPARAMETERS_H_
28 
31 
32 namespace casa {
33 
34 // Subclass of PlotMSWatchedParameters that hold parameters for the whole
35 // plotter. These parameters include:
36 // * log file name
37 // * log events flag
38 // * log minimum priority filter
39 // * whether to clear any selections when axes are changed or not
40 // * width and height for the cached image
42 public:
43  // Static //
44 
45  // Update flags.
46  // <group>
47  static const int UPDATE_LOG;
48  static const int UPDATE_PLOTMS_OPTIONS;
49  // </group>
50 
51  // Gets/Sets the file chooser history limit. (See QtFileDialog.) Static
52  // parameter.
53  // <group>
54  static int chooserHistoryLimit();
55  static void setChooserListoryLimit(int histLimit);
56  // </group>
57 
58 
59  // Non-Static //
60 
61  // Constructor, with default values for parameters.
65  bool clearSelections = PMS::DEFAULT_CLEAR_SELECTIONS,
66  int cachedImageWidth = PMS::DEFAULT_CACHED_IMAGE_WIDTH,
67  int cachedImageHeight = PMS::DEFAULT_CACHED_IMAGE_HEIGHT,
70 
71  // Copy constructor. See operator=().
73 
74  // Destructor.
76 
77 
78  // Gets/Sets the log sink location/filename.
79  // <group>
81  void setLogFilename(const casacore::String& filename);
82  // </group>
83 
84  // Returns the current log events.
85  int logEvents() const;
86 
87  // Returns the current log minimum priority.
89 
90  // Sets the current log filter.
92 
93  // Gets/Sets whether any selections are cleared when plot axes are changed
94  // or not.
95  // <group>
96  bool clearSelectionsOnAxesChange() const;
97  void setClearSelectionsOnAxesChange(bool flag);
98  // </group>
99 
100  // Gets/Sets the cached image size. See
101  // PlotCanvas::cachedAxesStackImageSize().
102  // <group>
103  std::pair<int, int> cachedImageSize() const;
104  void setCachedImageSize(int width, int height);
105  // </group>
106 
107  // Sets the cached image size to the current screen resolution.
109 
110 
111 
112  //<group>
113  bool setGridSize( int rows, int cols );
114  int getRowCount() const;
115  int getColCount() const;
116  void setRowCount( int rowCount );
117  void setColCount( int colCount );
118  //</group>
119 
120  // Copy operator.
122 
123 
124  // Implements PlotMSWatchedParameters::equals(). Will return false if the
125  // other parameters are not of type PlotMSParameters.
126  bool equals(const PlotMSWatchedParameters& other, int updateFlags) const;
127 
128 private:
129  // Log filename.
131 
132  // Log events flag.
134 
135  // Log minimum priority.
137 
138  // Clear selections on axes change flag.
140 
141  // Cached image sizes.
143 
144  int rowCount;
145  int colCount;
146 
147 
148 };
149 
150 //Removal of compile warnings for unused variables.
151 class DummyClass {
152 private:
153  static const int dummyDraw;
154  static const int dummyData;
155  static const int dummyCache;
156  static const int dummyAxes;
157  static const int dummyCanvas;
158  static const int dummyDisplay;
159  static const int dummyIter;
160 };
161 
163 public:
166  PMS::InterpMethod interpMethod=PMS::DEFAULT_INTERPMETHOD
167  );
169  PMS::InterpMethod getInterpMethod() const;
170  friend bool operator<(const DirectionAxisParams & p1, const DirectionAxisParams & p2);
171  friend bool operator!=(const DirectionAxisParams & p1, const DirectionAxisParams & p2);
172 private:
174  PMS::InterpMethod interpMethod_;
175 };
176 
177 }
178 
179 #endif /* PLOTMSPARAMETERS_H_ */
int logEvents() const
Returns the current log events.
static const int dummyDraw
int itsCachedImageWidth_
Cached image sizes.
casacore::String itsLogFilename_
Log filename.
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
std::pair< int, int > cachedImageSize() const
Gets/Sets the cached image size.
static const int DEFAULT_LOG_EVENTS
PMS::InterpMethod interpMethod_
void setClearSelectionsOnAxesChange(bool flag)
void setRowCount(int rowCount)
static const int dummyDisplay
bool clearSelectionsOnAxesChange() const
Gets/Sets whether any selections are cleared when plot axes are changed or not.
bool equals(const PlotMSWatchedParameters &other, int updateFlags) const
Implements PlotMSWatchedParameters::equals().
static int chooserHistoryLimit()
Gets/Sets the file chooser history limit.
bool setGridSize(int rows, int cols)
PMS::CoordSystem getCoordSystem() const
static const int DEFAULT_GRID_ROWS
void setCachedImageSize(int width, int height)
void setLogFilename(const casacore::String &filename)
static const casacore::LogMessage::Priority DEFAULT_LOG_PRIORITY
bool itsClearSelectionsOnAxesChange_
Clear selections on axes change flag.
Subclass of PlotMSWatchedParameters that hold parameters for the whole plotter.
PlotMSParameters(const casacore::String &logFilename=PMS::DEFAULT_LOG_FILENAME, int logEvents=PMS::DEFAULT_LOG_EVENTS, casacore::LogMessage::Priority logPriority=PMS::DEFAULT_LOG_PRIORITY, bool clearSelections=PMS::DEFAULT_CLEAR_SELECTIONS, int cachedImageWidth=PMS::DEFAULT_CACHED_IMAGE_WIDTH, int cachedImageHeight=PMS::DEFAULT_CACHED_IMAGE_HEIGHT, int rowCount=PMS::DEFAULT_GRID_ROWS, int colCount=PMS::DEFAULT_GRID_COLS)
Non-Static //.
Abstract class for parameters that may be watched by one or more interested classes.
static const int dummyData
void setColCount(int colCount)
void updateFlags(int updateFlags)
Provides access to children to indicate which update flags are on.
void setCachedImageSizeToResolution()
Sets the cached image size to the current screen resolution.
static const int dummyAxes
static const int dummyCache
casacore::LogMessage::Priority logPriority() const
Returns the current log minimum priority.
static const casacore::String DEFAULT_LOG_FILENAME
Default Parameter Values //.
static const CoordSystem DEFAULT_COORDSYSTEM
static const int dummyIter
friend bool operator!=(const DirectionAxisParams &p1, const DirectionAxisParams &p2)
friend bool operator<(const DirectionAxisParams &p1, const DirectionAxisParams &p2)
DirectionAxisParams(PMS::CoordSystem coordSystem=PMS::DEFAULT_COORDSYSTEM, PMS::InterpMethod interpMethod=PMS::DEFAULT_INTERPMETHOD)
static const bool DEFAULT_CLEAR_SELECTIONS
PMS::CoordSystem coordSystem_
int getColCount() const
casacore::String logFilename() const
Gets/Sets the log sink location/filename.
PMS::InterpMethod getInterpMethod() const
static const int UPDATE_LOG
Static //.
~PlotMSParameters()
Destructor.
static const int dummyCanvas
static const int DEFAULT_CACHED_IMAGE_HEIGHT
void setLogFilter(int logEvents, casacore::LogMessage::Priority priority)
Sets the current log filter.
Removal of compile warnings for unused variables.
Priority
An &quot;importance&quot; which is assigned to each LogMessage.
Definition: LogMessage.h:105
static const int UPDATE_PLOTMS_OPTIONS
PlotMSParameters & operator=(const PlotMSParameters &copy)
Copy operator.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
static void setChooserListoryLimit(int histLimit)
static const InterpMethod DEFAULT_INTERPMETHOD
int getRowCount() const
static const int DEFAULT_CACHED_IMAGE_WIDTH
int itsLogEvents_
Log events flag.
casacore::LogMessage::Priority itsLogPriority_
Log minimum priority.
static const int DEFAULT_GRID_COLS