casa
$Rev:20696$
|
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 <graphics/GenericPlotter/PlotData.h> 00033 00034 #include <qwt_data.h> 00035 #include <qwt_raster_data.h> 00036 00037 #include <casa/namespace.h> 00038 00039 namespace casa { 00040 00041 // Connects PlotPointData and QwtData. 00042 class QPPointData : public QwtData { 00043 public: 00044 // Constructor which takes the data. 00045 QPPointData(PlotPointDataPtr data); 00046 00047 // Destructor. 00048 ~QPPointData(); 00049 00050 00051 // Returns the point data. 00052 // <group> 00053 PlotPointDataPtr data(); 00054 const PlotPointDataPtr data() const; 00055 // </group> 00056 00057 00058 // QwtData Methods // 00059 00060 // Implements QwtData::copy(). 00061 QwtData* copy() const; 00062 00063 // Implements QwtData::size(). 00064 size_t size() const; 00065 00066 // Implements QwtData::x(). 00067 double x(size_t i) const; 00068 00069 // Implements QwtData::y(). 00070 double y(size_t i) const; 00071 00072 // Overrides QwtData::boundingRect(). 00073 QwtDoubleRect boundingRect() const; 00074 00075 private: 00076 PlotPointDataPtr m_data; // Data 00077 }; 00078 00079 00080 // Connects PlotRasterData and QwtRasterData. 00081 class QPRasterData : public QwtRasterData { 00082 public: 00083 // Constructor which takes the raster data. 00084 QPRasterData(PlotRasterDataPtr data); 00085 00086 // Destructor. 00087 ~QPRasterData(); 00088 00089 00090 // Returns the raster data. 00091 // <group> 00092 PlotRasterDataPtr data(); 00093 const PlotRasterDataPtr data() const; 00094 // </group> 00095 00096 // Returns true if this data is valid, false otherwise. 00097 bool isValid() const; 00098 00099 00100 // QwtRasterData Methods // 00101 00102 // Implements QwtRasterData::copy(). 00103 QwtRasterData* copy() const; 00104 00105 // Implements QwtRasterData::value(). 00106 double value(double x, double y) const; 00107 00108 // Implements QwtRasterData::range(). 00109 QwtDoubleInterval range() const; 00110 00111 // Overrides QwtRasterData::boundingRect(). 00112 QwtDoubleRect boundingRect() const; 00113 00114 private: 00115 PlotRasterDataPtr m_data; // Data 00116 }; 00117 00118 } 00119 00120 #endif 00121 00122 #endif /* QPDATA_H_ */