QPData.h

Go to the documentation of this file.
00001 //# QPData.h: Connector classes between generic plotter and Qwt data classes.
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 QPDATA_H_
00028 #define QPDATA_H_
00029 
00030 #ifdef AIPS_HAS_QWT
00031 
00032 #include <casaqt/QwtConfig.h>
00033 #include <graphics/GenericPlotter/PlotData.h>
00034 
00035 #if QWT_VERSION < 0x060000
00036 #include <qwt_data.h>
00037 #endif
00038 
00039 #include <qwt_raster_data.h>
00040 
00041 namespace casa {
00042 
00043 // Connects PlotPointData and QwtData.
00044 #if QWT_VERSION >= 0x060000
00045 class QPPointData : public QwtSeriesData<QPointF> {
00046 #else
00047 class QPPointData : public QwtData {
00048 #endif
00049     
00050 public:
00051     // Constructor which takes the data.
00052     QPPointData(PlotPointDataPtr data);
00053     // Destructor.
00054     ~QPPointData();
00055     
00056     // Returns the point data.
00057     // <group>
00058     PlotPointDataPtr data();
00059     const PlotPointDataPtr data() const;
00060     // </group>
00061     
00062     
00063     // QwtData Methods //
00064     
00065     // Implements QwtData::copy().
00066 #if QWT_VERSION >= 0x060000
00067     QPPointData* copy() const;
00068 
00069     // Implements QwtSeriesData::sample().
00070     QPointF sample(size_t i) const;
00071 
00072 #else
00073     QwtData* copy() const;
00074 #endif
00075     
00076     // Implements QwtData::size().
00077     size_t size() const;
00078     
00079     // Implements QwtData::x().
00080     double x(size_t i) const;
00081     
00082     // Implements QwtData::y().
00083     double y(size_t i) const;
00084     
00085     // Overrides QwtData::boundingRect().
00086     QwtDoubleRect boundingRect() const;
00087     
00088 private:
00089     PlotPointDataPtr m_data; // Data
00090 };
00091 
00092 
00093 // Connects PlotRasterData and QwtRasterData.
00094 class QPRasterData : public QwtRasterData {
00095 public:
00096     // Constructor which takes the raster data.
00097     QPRasterData(PlotRasterDataPtr data);
00098     
00099     // Destructor.
00100     ~QPRasterData();
00101     
00102     
00103     // Returns the raster data.
00104     // <group>
00105     PlotRasterDataPtr data();
00106     const PlotRasterDataPtr data() const;
00107     // </group>
00108     
00109     // Returns true if this data is valid, false otherwise.
00110     bool isValid() const;
00111     
00112     
00113     // QwtRasterData Methods //
00114     
00115     // Implements QwtRasterData::copy().
00116     QwtRasterData* copy() const;
00117     
00118     // Implements QwtRasterData::value().
00119     double value(double x, double y) const;
00120     
00121     // Implements QwtRasterData::range().
00122     QwtDoubleInterval range() const;
00123     
00124     // Overrides QwtRasterData::boundingRect().
00125     QwtDoubleRect boundingRect() const;
00126     
00127 private:
00128     PlotRasterDataPtr m_data; // Data
00129 };
00130 
00131 }
00132 
00133 #endif
00134 
00135 #endif /* QPDATA_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1