PlotMSPages.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef PLOTMSPAGES_H_
00029 #define PLOTMSPAGES_H_
00030
00031 #include <plotms/Plots/PlotMSPage.h>
00032
00033 namespace casa {
00034
00035 class PlotMSParameters;
00036
00037
00038
00039 class PlotMSPages {
00040
00041
00042 friend class PlotMSPage;
00043 friend class PlotMSPlot;
00044 friend class PlotMSPlotManager;
00045
00046 public:
00047
00048 PlotMSPages(PlotMSPlotManager& manager);
00049
00050
00051 PlotMSPages(const PlotMSPages& copy);
00052
00053
00054 ~PlotMSPages();
00055
00056
00057 unsigned int currentPageNumber() const;
00058
00059
00060 PlotMSPage currentPage() const;
00061
00062 PlotMSPage getFirstPage() const;
00063
00064 void setCurrentPageNum(uInt num);
00065
00066
00067 PlotMSPage& operator[](uInt index) { return itsPages_[index]; }
00068
00069
00070 typedef vector<PlotMSPage>::iterator iterator;
00071 iterator begin() { return itsPages_.begin(); }
00072 iterator end() { return itsPages_.end(); }
00073
00074 typedef vector<PlotMSPage>::const_iterator const_iterator;
00075 const_iterator begin() const { return itsPages_.begin(); }
00076 const_iterator end() const { return itsPages_.end(); }
00077
00078
00079 unsigned int totalPages() const;
00080
00081
00082 void clear() { itsPages_.clear(); }
00083
00084 void resize(size_t pages);
00085
00086
00087 void clearCanvas( int row, int col );
00088
00089
00090 void clearCanvases();
00091
00092
00093 bool gridChanged( int rows, int cols);
00094
00095
00096 PlotMSPages& operator=(const PlotMSPages& copy);
00097
00098
00099 void firstPage();
00100 void nextPage();
00101 void previousPage();
00102 void lastPage();
00103
00104
00105
00106 PlotMSPage insertPage(int index = -1);
00107
00108
00109 void clearPages();
00110
00111
00112 void setupCurrentPage();
00113
00114
00115 void disown( PlotMSPlot* plot );
00116 void disown( int row, int col, PlotMSPlot* plot );
00117
00118 bool canvasIsOwnedBy( int row, int col, PlotMSPlot* plot ) const;
00119
00120 PlotMSParameters getPageParameters();
00121
00122
00123
00124 bool isSpot( int rowIndex, int colIndex, PlotMSPlot* plot ) const;
00125
00126
00127
00128 std::pair<int,int> findEmptySpot() const;
00129
00130 private:
00131
00132
00133 bool isGridChanged( int rows, int cols ) const;
00134
00135
00136
00137
00138 PlotMSPlotManager* itsManager_;
00139
00140
00141 vector<PlotMSPage> itsPages_;
00142
00143
00144 unsigned int itsCurrentPageNum_;
00145 };
00146
00147
00148
00149 }
00150 #endif