[1241] | 1 | // ----------------------------------------------------------------------- |
---|
| 2 | // MultipleDuchampPlot.hh: Definition of the base class for plots with |
---|
| 3 | // multiple instances per page |
---|
| 4 | // ----------------------------------------------------------------------- |
---|
| 5 | // Copyright (C) 2006, Matthew Whiting, ATNF |
---|
| 6 | // |
---|
| 7 | // This program is free software; you can redistribute it and/or modify it |
---|
| 8 | // under the terms of the GNU General Public License as published by the |
---|
| 9 | // Free Software Foundation; either version 2 of the License, or (at your |
---|
| 10 | // option) any later version. |
---|
| 11 | // |
---|
| 12 | // Duchamp is distributed in the hope that it will be useful, but WITHOUT |
---|
| 13 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
| 14 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
---|
| 15 | // for more details. |
---|
| 16 | // |
---|
| 17 | // You should have received a copy of the GNU General Public License |
---|
| 18 | // along with Duchamp; if not, write to the Free Software Foundation, |
---|
| 19 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA |
---|
| 20 | // |
---|
| 21 | // Correspondence concerning Duchamp may be directed to: |
---|
| 22 | // Internet email: Matthew.Whiting [at] atnf.csiro.au |
---|
| 23 | // Postal address: Dr. Matthew Whiting |
---|
| 24 | // Australia Telescope National Facility, CSIRO |
---|
| 25 | // PO Box 76 |
---|
| 26 | // Epping NSW 1710 |
---|
| 27 | // AUSTRALIA |
---|
| 28 | // ----------------------------------------------------------------------- |
---|
| 29 | #ifndef MULTIPLE_DUCHAMPPLOT_H |
---|
| 30 | #define MULTIPLE_DUCHAMPPLOT_H |
---|
| 31 | |
---|
| 32 | #include <string> |
---|
| 33 | #include <duchamp/duchamp.hh> |
---|
| 34 | #include <duchamp/Plotting/DuchampPlot.hh> |
---|
| 35 | |
---|
| 36 | namespace duchamp |
---|
| 37 | { |
---|
| 38 | |
---|
| 39 | /// @brief A namespace to control plotting of the spectral output and the |
---|
| 40 | /// spatial image output. |
---|
| 41 | |
---|
| 42 | namespace Plot |
---|
| 43 | { |
---|
| 44 | |
---|
| 45 | // constants for labels |
---|
| 46 | const float plotIndexSize = 0.6; ///< PGPlot character height for tick mark labels |
---|
| 47 | const float plotLabelSize = 0.7; ///< PGPlot character height for axis labels |
---|
| 48 | const float plotTitleSize = 0.8; ///< PGPlot character height for plot title line |
---|
| 49 | |
---|
| 50 | class MultipleDuchampPlot : public DuchampPlot |
---|
| 51 | { |
---|
| 52 | public: |
---|
| 53 | MultipleDuchampPlot(); |
---|
| 54 | MultipleDuchampPlot(const MultipleDuchampPlot& other); |
---|
| 55 | MultipleDuchampPlot& operator= (const MultipleDuchampPlot& other); |
---|
| 56 | virtual ~MultipleDuchampPlot(){}; |
---|
| 57 | |
---|
| 58 | /// @brief Calculate boundaries for boxes. |
---|
| 59 | virtual void calcCoords()=0; |
---|
| 60 | /// @brief Set up the header |
---|
| 61 | virtual void gotoHeader(); |
---|
| 62 | |
---|
| 63 | /// @brief Set up PGPLOT output. |
---|
| 64 | virtual int setUpPlot(std::string pgDestination); |
---|
| 65 | |
---|
| 66 | /// @brief Return number of spectra that go on a page. |
---|
| 67 | int getNumOnPage(){return numOnPage;}; |
---|
| 68 | |
---|
| 69 | /// @brief Set number of spectra that go on a page. |
---|
| 70 | void setNumOnPage(int i){numOnPage = i;}; |
---|
| 71 | |
---|
| 72 | /// @brief Write first line of header information (position/velocity info) in correct place. |
---|
| 73 | virtual void firstHeaderLine(std::string line)=0; |
---|
| 74 | |
---|
| 75 | /// @brief Write second line of header information (fluxes) in correct place. |
---|
| 76 | virtual void secondHeaderLine(std::string line)=0; |
---|
| 77 | |
---|
| 78 | /// @brief Write third line of header information (WCS widths) in correct place. |
---|
| 79 | virtual void thirdHeaderLine(std::string line)=0; |
---|
| 80 | |
---|
| 81 | /// @brief Write fourth line of header information (pixel coordinates) in correct place. |
---|
| 82 | virtual void fourthHeaderLine(std::string line)=0; |
---|
| 83 | |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | protected: |
---|
| 88 | int numOnPage; ///< Number of spectra to put on one page. |
---|
| 89 | int spectraCount; ///< Number of spectra done so far: where on the page? |
---|
| 90 | float mainCoords[4]; ///< Boundaries for the main spectrum [inches] |
---|
| 91 | float mapCoords[4]; ///< Boundaries for the map box [inches] |
---|
| 92 | |
---|
| 93 | }; |
---|
| 94 | |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | #endif |
---|