QPExporter.h

Go to the documentation of this file.
00001 //# Copyright (C) 2008
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
00024 //#
00025 
00026 #ifndef QPEXPORTER_H_
00027 #define QPEXPORTER_H_
00028 
00029 #include <graphics/GenericPlotter/PlotOptions.h>
00030 #include <graphics/GenericPlotter/PlotCanvas.h>
00031 #include <QImage>
00032 
00033 namespace casa {
00034 
00035 class PlotCanvas;
00036 class QPExportCanvas;
00037 class QPPlotter;
00042 class QPExporter {
00043 public:
00044 
00045 
00046         // Exports the given canvas to the given format.
00047         static bool exportCanvas(PlotCanvas* canvas, const PlotExportFormat& format);
00048 
00049         // Exports the given plotter to the given format.
00050         static bool exportPlotter(QPPlotter* plotter, const PlotExportFormat& format);
00051 
00052         // Exports a collection of canvases to the given format.
00053         static bool exportCanvases(vector<QPExportCanvas*>& canvases,
00054                         const PlotExportFormat& format, PlotCanvas* grabCanvas,
00055                         QPPlotter* grabPlotter);
00056 
00057         virtual ~QPExporter();
00058 
00059 private:
00060         QPExporter();
00061         static bool exportPostscript( const PlotExportFormat& format,
00062                         vector<QPExportCanvas*> &qcanvases,
00063                         QPExportCanvas* grabCanvas, QPPlotter* grabPlotter);
00064 
00065         static QImage produceHighResImage(
00066                         const PlotExportFormat& format,
00067                         vector<QPExportCanvas*> &qcanvases,
00068                         int width, int height,
00069                         int rowIndex, int columnIndex,
00070                         bool &wasCanceled);
00071 
00072         static QImage produceScreenImage(
00073                         const PlotExportFormat& format,
00074                         vector<QPExportCanvas*> &qcanvases,
00075                         int width, int height,
00076                         int rowCount, int colCount,
00077                         bool &wasCanceled);
00078 
00079         static bool  exportToImageFile(
00080                         const PlotExportFormat& format,
00081                         vector<QPExportCanvas*> &qcanvases,
00082                         QPExportCanvas* grabCanvas,
00083                         QPPlotter* grabPlotter);
00084 
00085         static int findAxisHeight( vector<QPExportCanvas*> &qcanvases );
00086         static int findAxisWidth( vector<QPExportCanvas*> &qcanvases );
00087         static int getCanvasCount( vector<QPExportCanvas*> &qcanvases );
00088     static void getAxesCount(vector<QPExportCanvas*> &qcanvases,
00089             Int& externalX, Int& externalY);
00090         static void findGridProperties( QPExportCanvas* grabCanvas, QPPlotter* grabPlotter,
00091                         Int& width, Int& height, Int& gridRows, Int& gridCols);
00092     static void findXAxisLocations(Int numX, Bool vertical, Bool& top, Bool& bottom);
00093     static void findYAxisLocations(Int numY, Bool vertical, Bool& left, Bool& right);
00094     static void findYAxisSecondRow(Int numY, Bool isLeftAxis, Bool& left, Bool& right);
00095     static void findYAxisSecondRow(Int numY, Int nCols, vector<QPExportCanvas*> &qcanvases,
00096             Bool& left, Bool& right);
00097 
00098         static const String CLASS_NAME;
00099         static const String EXPORT_NAME;
00100 };
00101 
00102 } /* namespace casa */
00103 #endif /* QPEXPORTER_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1