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 #ifndef QPFACTORY_H_
00028 #define QPFACTORY_H_
00029
00030 #ifdef AIPS_HAS_QWT
00031
00032 #include <graphics/GenericPlotter/PlotFactory.h>
00033
00034 namespace casa {
00035
00036
00037 class QPFactory : public PlotFactory {
00038 public:
00039
00040 QPFactory();
00041
00042
00043 ~QPFactory();
00044
00045
00046
00047 using PlotFactory::plotter;
00048 using PlotFactory::annotation;
00049 using PlotFactory::shapeRectangle;
00050 using PlotFactory::shapeEllipse;
00051 using PlotFactory::shapePolygon;
00052 using PlotFactory::shapeArrow;
00053 using PlotFactory::shapePath;
00054 using PlotFactory::point;
00055 using PlotFactory::color;
00056 using PlotFactory::font;
00057 using PlotFactory::line;
00058 using PlotFactory::symbol;
00059 using PlotFactory::areaFill;
00060
00061
00062
00063 bool canvasHasThreadedDrawing() const { return true; }
00064
00065
00066 bool canvasHasCachedLayerDrawing() const { return true; }
00067
00068
00069 bool canvasHasCachedAxesStack() const { return true; }
00070
00071
00072
00073 int execLoop();
00074
00075
00076 Plotter::Implementation implementation() const { return Plotter::QWT; }
00077
00078
00079
00080 PlotterPtr plotter(const String& windowTitle = "Qwt Plotter",
00081 bool showSingleCanvas = true, bool showGUI = true,
00082 int logEventFlags = PlotLogger::NO_EVENTS,
00083 bool smartDelete = true) const;
00084
00085
00086 PlotterPtr plotter(unsigned int nrows, unsigned int ncols,
00087 const String& windowTitle = "Qwt Plotter", bool showGUI = true,
00088 int logEventFlags = PlotLogger::NO_EVENTS,
00089 bool smartDelete = true) const;
00090
00091
00092 PlotCanvasPtr canvas(bool smartDelete = true) const;
00093
00094
00095 PlotPanelPtr panel(bool smartDelete = true) const;
00096
00097
00098 PlotButtonPtr button(const String& str, bool isText = true,
00099 bool toggleable = false, bool smartDelete = true) const;
00100
00101
00102 PlotCheckboxPtr checkbox(const String& str, bool smartDelete = true) const;
00103
00104
00105
00106 ScatterPlotPtr scatterPlot(PlotPointDataPtr data,
00107 const String& title= "Scatter Plot", bool smartDelete= true) const;
00108
00109
00110 BarPlotPtr barPlot(PlotPointDataPtr data, const String& title = "Bar Plot",
00111 bool smartDelete = true) const;
00112
00113
00114 RasterPlotPtr rasterPlot(PlotRasterDataPtr data,
00115 const String& title = "Raster Plot",
00116 PlotRasterData::Format format = PlotRasterData::RGB32,
00117 bool smartDelete = true) const;
00118
00119
00120 PlotAnnotationPtr annotation(const String& text,
00121 const PlotCoordinate& coord, bool smartDelete = true) const;
00122
00123
00124 PlotShapeRectanglePtr shapeRectangle(const PlotCoordinate& upperLeft,
00125 const PlotCoordinate& lowerRight, bool smartDelete = true) const;
00126
00127
00128 PlotShapeEllipsePtr shapeEllipse(const PlotCoordinate& center,
00129 const PlotCoordinate& radii, bool smartDelete = true) const;
00130
00131
00132 PlotShapePolygonPtr shapePolygon(const vector<PlotCoordinate>& c,
00133 bool smartDelete = true) const;
00134
00135
00136 PlotShapeLinePtr shapeLine(double location, PlotAxis axis,
00137 bool smartDelete = true) const;
00138
00139
00140 PlotShapeArrowPtr shapeArrow(const PlotCoordinate& from,
00141 const PlotCoordinate& to, PlotShapeArrow::Style fromStyle =
00142 PlotShapeArrow::NOARROW, PlotShapeArrow::Style toStyle =
00143 PlotShapeArrow::V_ARROW, bool smartDelete = true) const;
00144
00145
00146 PlotShapePathPtr shapePath(const vector<PlotCoordinate>& coords,
00147 bool smartDelete = true) const;
00148
00149
00150 PlotShapeArcPtr shapeArc(const PlotCoordinate& start,
00151 const PlotCoordinate& widthHeight, int startAngle,
00152 int spanAngle, bool smartDelete = true) const;
00153
00154
00155 PlotPointPtr point(const PlotCoordinate& coord,
00156 bool smartDelete = true) const;
00157
00158
00159
00160
00161 PlotColorPtr color(const String& color, bool smartDelete = true) const;
00162 PlotColorPtr color(const PlotColor& copy, bool smartDelete = true) const;
00163
00164
00165
00166 vector<String> allNamedColors() const;
00167
00168
00169
00170 PlotFontPtr font(const String& family = "Arial", double pointSize = 12.0,
00171 const String& color = "000000", bool bold = false,
00172 bool italics = false, bool underline = false,
00173 bool smartDelete = true) const;
00174 PlotFontPtr font(const PlotFont& copy, bool smartDelete = true) const;
00175
00176
00177
00178
00179 PlotAreaFillPtr areaFill(const String& color,
00180 PlotAreaFill::Pattern pattern = PlotAreaFill::NOFILL,
00181 bool smartDelete = true) const;
00182 PlotAreaFillPtr areaFill(const PlotAreaFill& copy,
00183 bool smartDelete = true) const;
00184
00185
00186
00187
00188 PlotLinePtr line(const String& color,
00189 PlotLine::Style style = PlotLine::SOLID, double width = 1.0,
00190 bool smartDelete = true) const;
00191 PlotLinePtr line(const PlotLine& copy, bool smartDelete = true) const;
00192
00193
00194
00195
00196 PlotSymbolPtr symbol(PlotSymbol::Symbol style,
00197 bool smartDelete = true) const;
00198 PlotSymbolPtr symbol(const PlotSymbol& copy, bool smartDelete= true) const;
00199
00200
00201
00202
00203
00204 PlotSelectToolPtr selectTool(bool smartDelete = true) const;
00205 PlotZoomToolPtr zoomTool(bool smartDelete = true) const;
00206 PlotPanToolPtr panTool(bool smartDelete = true) const;
00207 PlotTrackerToolPtr trackerTool(bool smartDelete = true) const;
00208
00209 PlotSelectToolPtr selectTool(PlotAxis xAxis, PlotAxis yAxis,
00210 PlotCoordinate::System system, bool smartDelete = true) const;
00211 PlotZoomToolPtr zoomTool(PlotAxis xAxis, PlotAxis yAxis,
00212 PlotCoordinate::System system, bool smartDelete = true) const;
00213 PlotPanToolPtr panTool(PlotAxis xAxis, PlotAxis yAxis,
00214 PlotCoordinate::System system, bool smartDelete = true) const;
00215 PlotTrackerToolPtr trackerTool(PlotAxis xAxis, PlotAxis yAxis,
00216 PlotCoordinate::System system, bool smartDelete = true) const;
00217
00218
00219
00220
00221 PlotMutexPtr mutex(bool smartDelete = true) const;
00222
00223
00224
00225
00226
00227
00228 static PlotFontPtr defaultAnnotationFont(bool smartDelete = true);
00229
00230
00231 static PlotAreaFillPtr defaultBarPlotAreaFill(bool smartDelete = true);
00232
00233
00234 static PlotLinePtr defaultLegendLine(bool smartDelete = true);
00235
00236
00237 static PlotAreaFillPtr defaultLegendAreaFill(bool smartDelete = true);
00238
00239
00240 static PlotLinePtr defaultShapeLine(bool smartDelete = true);
00241
00242
00243 static PlotAreaFillPtr defaultShapeAreaFill(bool smartDelete = true);
00244
00245
00246 static PlotLinePtr defaultPlotLine(bool smartDelete = true);
00247
00248
00249
00250 static PlotSymbolPtr defaultPlotSymbol(bool smartDelete = true);
00251
00252
00253
00254 static PlotSymbolPtr defaultPlotMaskedSymbol(bool smartDelete = true);
00255
00256
00257 static const unsigned int DEFAULT_ERROR_CAP;
00258 };
00259
00260 }
00261
00262 #endif
00263
00264 #endif