QPExporter.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 #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
00047 static bool exportCanvas(PlotCanvas* canvas, const PlotExportFormat& format);
00048
00049
00050 static bool exportPlotter(QPPlotter* plotter, const PlotExportFormat& format);
00051
00052
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 }
00103 #endif