QPFactory.h

Go to the documentation of this file.
00001 //# QPFactory.h: Qwt implementation of generic PlotFactory class.
00002 //# Copyright (C) 2008
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: $
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 // Implementation of PlotFactory for Qwt plotter.
00037 class QPFactory : public PlotFactory {
00038 public:
00039     // Constructor.
00040     QPFactory();
00041     
00042     // Destructor.
00043     ~QPFactory();
00044     
00045     
00046     // Import overloaded methods.    
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     // Implements PlotFactory::canvasHasThreadedDrawing().
00063     bool canvasHasThreadedDrawing() const { return true; }
00064     
00065     // Implements PlotFactory::canvasHasCahcedLayerDrawing().
00066     bool canvasHasCachedLayerDrawing() const { return true; }
00067     
00068     // Implements PlotFactory::canvasHasCachedAxesStack().
00069     bool canvasHasCachedAxesStack() const { return true; }
00070     
00071     
00072     // Implements PlotFactory::execLoop().
00073     int execLoop();
00074     
00075     // Implements PlotFactory::implementation().
00076     Plotter::Implementation implementation() const { return Plotter::QWT; }
00077     
00078     
00079     // Implements PlotFactory::plotter().
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     // Implements PlotFactory::plotter().
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     // Implements PlotFactory::canvas().
00092     PlotCanvasPtr canvas(bool smartDelete = true) const;
00093     
00094     // Implements PlotFactory::panel().
00095     PlotPanelPtr panel(bool smartDelete = true) const;
00096     
00097     // Implements PlotFactory::button().
00098     PlotButtonPtr button(const String& str, bool isText = true,
00099             bool toggleable = false, bool smartDelete = true) const;
00100     
00101     // Implements PlotFactory::checkbox().
00102     PlotCheckboxPtr checkbox(const String& str, bool smartDelete = true) const;
00103 
00104 
00105     // Implements PlotFactory::scatterPlot().
00106     ScatterPlotPtr scatterPlot(PlotPointDataPtr data,
00107             const String& title= "Scatter Plot", bool smartDelete= true) const;
00108     
00109     // Implements PlotFactory::barPlot().
00110     BarPlotPtr barPlot(PlotPointDataPtr data, const String& title = "Bar Plot",
00111             bool smartDelete = true) const;
00112     
00113     // Implements PlotFactory::rasterPlot().
00114     RasterPlotPtr rasterPlot(PlotRasterDataPtr data,
00115             const String& title = "Raster Plot",
00116             PlotRasterData::Format format = PlotRasterData::RGB32,
00117             bool smartDelete = true) const;
00118     
00119     // Implements PlotFactory::annotation().
00120     PlotAnnotationPtr annotation(const String& text,
00121             const PlotCoordinate& coord, bool smartDelete = true) const;
00122     
00123     // Implements PlotFactory::shapeRectangle().
00124     PlotShapeRectanglePtr shapeRectangle(const PlotCoordinate& upperLeft,
00125             const PlotCoordinate& lowerRight, bool smartDelete = true) const;
00126     
00127     // Implements PlotFactory::shapeEllipse().
00128     PlotShapeEllipsePtr shapeEllipse(const PlotCoordinate& center,
00129             const PlotCoordinate& radii, bool smartDelete = true) const;
00130     
00131     // Implements PlotFactory::shapePolygon().
00132     PlotShapePolygonPtr shapePolygon(const vector<PlotCoordinate>& c,
00133             bool smartDelete = true) const;
00134     
00135     // Implements PlotFactory::shapeLine().
00136     PlotShapeLinePtr shapeLine(double location, PlotAxis axis,
00137             bool smartDelete = true) const;
00138     
00139     // Implements PlotFactory::shapeArrow().
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     // Implements PlotFactory::shapePath().
00146     PlotShapePathPtr shapePath(const vector<PlotCoordinate>& coords,
00147             bool smartDelete = true) const;
00148     
00149     // Implements PlotFactory::shapeArc().
00150     PlotShapeArcPtr shapeArc(const PlotCoordinate& start,
00151             const PlotCoordinate& widthHeight, int startAngle,
00152             int spanAngle, bool smartDelete = true) const;
00153     
00154     // Implements PlotFactory::point().
00155     PlotPointPtr point(const PlotCoordinate& coord,
00156             bool smartDelete = true) const;
00157 
00158     
00159     // Implements PlotFactory::color().
00160     // <group>
00161     PlotColorPtr color(const String& color, bool smartDelete = true) const;
00162     PlotColorPtr color(const PlotColor& copy, bool smartDelete = true) const;
00163     // </group>
00164     
00165     // Implements PlotFactory::allNamedColors().
00166     vector<String> allNamedColors() const;
00167     
00168     // Implements PlotFactory::font().
00169     // <group>
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     // </group>
00176     
00177     // Implements PlotFactory::areaFill().
00178     // <group>
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     // </group>
00185     
00186     // Implements PlotFactory::line().
00187     // <group>
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     // </group>
00193     
00194     // Implements PlotFactory::symbol().
00195     // <group>
00196     PlotSymbolPtr symbol(PlotSymbol::Symbol style,
00197             bool smartDelete = true) const;
00198     PlotSymbolPtr symbol(const PlotSymbol& copy, bool smartDelete= true) const;
00199     // </group>
00200 
00201 
00202     // Overrides PlotFactory tool methods.
00203     // <group>
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     // </group>
00218     
00219     
00220     // Implements PlotFactory::mutex().
00221     PlotMutexPtr mutex(bool smartDelete = true) const;
00222     
00223     
00224     // Defaults //
00225     
00226     // Returns a default font for annotations.  Currently: 14-point black
00227     // Arial.
00228     static PlotFontPtr defaultAnnotationFont(bool smartDelete = true);
00229     
00230     // Returns a default area fill for bar plots.  Currently: blue filled.
00231     static PlotAreaFillPtr defaultBarPlotAreaFill(bool smartDelete = true);
00232     
00233     // Returns a default line for legends.  Currently: 1px black solid.
00234     static PlotLinePtr defaultLegendLine(bool smartDelete = true);
00235     
00236     // Returns a default area fill for legends.  Currently: white filled.
00237     static PlotAreaFillPtr defaultLegendAreaFill(bool smartDelete = true);
00238     
00239     // Returns a default line for shapes.  Currently: 1px black solid.
00240     static PlotLinePtr defaultShapeLine(bool smartDelete = true);
00241     
00242     // Returns a default area fill for shapes.  Currently: no fill.
00243     static PlotAreaFillPtr defaultShapeAreaFill(bool smartDelete = true);
00244     
00245     // Returns a default line for scatter plots.  Currently: no line.
00246     static PlotLinePtr defaultPlotLine(bool smartDelete = true);
00247 
00248     // Returns a default symbol for scatter plots.  Currently: 8x8 blue
00249     // circle with no outline.
00250     static PlotSymbolPtr defaultPlotSymbol(bool smartDelete = true);
00251     
00252     // Returns a default masked symbol for masked scatter plots.  Currently:
00253     // 8x8 red no symbol with no outline.
00254     static PlotSymbolPtr defaultPlotMaskedSymbol(bool smartDelete = true);
00255     
00256     // The default error bar cap, currently 10.
00257     static const unsigned int DEFAULT_ERROR_CAP;
00258 };
00259 
00260 }
00261 
00262 #endif
00263 
00264 #endif /*QPFACTORY_H_*/
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1