casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CanvasCurve.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 #ifndef CANVASCURVE_H_
26 #define CANVASCURVE_H_
27 
28 #include <casa/aips.h>
29 #include <casa/Arrays/Vector.h>
31 #include <vector>
32 #include <utility> /***for std::pair***/
33 #include <QColor>
34 #include <QString>
35 
40 namespace casa {
41 
42  typedef std::vector<double> CurveData;
43  typedef std::vector<double> ErrorData;
44 
45  class CanvasCurve {
46  public:
47  CanvasCurve();
49  QString legend, QColor curveColor, int curveType,
50  double beamAngle, double beamArea, casacore::SpectralCoordinate coord);
51  QColor getColor() const;
52  void setColor( QColor color );
53  QString getLegend() const;
54  void setLegend( const QString& legend );
55  int getCurveType() const;
60 
61 
62  QString getToolTip( double x, double y , const QString& xUnit, const QString& yUnit ) const;
64  casacore::Double& ymax, bool plotError ) const;
65  std::pair<double,double> getRangeFor(double xMin, double xMax, casacore::Bool& exists );
66  void scaleYValues( const QString& oldDisplayUnits, const QString& yUnitDisplay, const QString& xUnits );
67  double convertValue( double value, double freqValue, const QString& oldDisplayUnits, const QString& yUnitDisplay,
68  const QString& xUnits, casacore::SpectralCoordinate& coord);
69  virtual ~CanvasCurve();
70 
71  private:
73  double getMaxY() const;
74  double getMaxError() const;
75  void storeData( const QString& oldUnits );
76  void setYValues( const casacore::Vector<float>& yValues );
77  void setErrorValues( const casacore::Vector<float>& errorValues );
78  double calculateRelativeError( double minValue, double maxValue ) const ;
79  void calculateRelativeErrors( double& errorX, double& errorY ) const;
80  QColor curveColor;
81  QString legend;
84  QString maxUnits;
85  double maxValue;
86  double maxErrorValue;
87  double beamAngle;
88  double beamArea;
89  int curveType;
91 
92  };
93 
94 } /* namespace casa */
95 #endif /* CANVASCURVE_H_ */
casacore::Vector< float > getYValues() const
QColor getColor() const
void getMinMax(casacore::Double &xmin, casacore::Double &xmax, casacore::Double &ymin, casacore::Double &ymax, bool plotError) const
CurveData curveData
Definition: CanvasCurve.h:82
casacore::SpectralCoordinate spectralCoordinate
Definition: CanvasCurve.h:90
std::pair< double, double > getRangeFor(double xMin, double xMax, casacore::Bool &exists)
casacore::Vector< float > getXValues() const
void setLegend(const QString &legend)
int getCurveType() const
casacore::Vector< float > getErrorValues() const
double getMaxError() const
void scaleYValues(const QString &oldDisplayUnits, const QString &yUnitDisplay, const QString &xUnits)
void setColor(QColor color)
double maxErrorValue
Definition: CanvasCurve.h:86
QString getToolTip(double x, double y, const QString &xUnit, const QString &yUnit) const
QString getLegend() const
double Double
Definition: aipstype.h:55
CurveData getCurveData()
virtual ~CanvasCurve()
double getMaxY() const
ErrorData errorData
Definition: CanvasCurve.h:83
void setYValues(const casacore::Vector< float > &yValues)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
CurveData getErrorData()
double convertValue(double value, double freqValue, const QString &oldDisplayUnits, const QString &yUnitDisplay, const QString &xUnits, casacore::SpectralCoordinate &coord)
void storeData(const QString &oldUnits)
double calculateRelativeError(double minValue, double maxValue) const
std::vector< double > ErrorData
Definition: CanvasCurve.h:43
Interconvert pixel and frequency values.
void calculateRelativeErrors(double &errorX, double &errorY) const
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
std::vector< double > CurveData
void setErrorValues(const casacore::Vector< float > &errorValues)