casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FeatherCurve.h
Go to the documentation of this file.
1 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2000
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 
26 #ifndef FEATHERCURVE_H_
27 #define FEATHERCURVE_H_
28 
29 #include <qwt_plot.h>
30 #include <limits>
31 #include <casa/aipstype.h>
33 class QwtPlotCurve;
34 class QwtLegendItem;
35 namespace casa {
36 
37 class FeatherPlot;
38 class LegendCurve;
39 
44 class FeatherCurve : public ColorProvider {
45 
46 public:
47  FeatherCurve( FeatherPlot* plot, QwtPlot::Axis xAxis, QwtPlot::Axis yAxis, bool sumCurve);
48  void initScatterPlot( int dotSize );
49  void setTitle( const QString& title );
50  void setFunctionColor( const QColor& color, bool diagonalLine );
51 
52  //Change the data the curve contains.
53  void setCurveData( const QVector<double>& xVals, const QVector<double>& yVals );
56  QColor getRectColor() const;
57 
58  //Change the scale of existing data (Log<-->No Log)
59  void adjustData( bool uvLog, bool ampLog );
60 
61  void setCurveSize( bool scatterPlot, bool diagonalLine,
62  int dotSize, int lineThickness );
63 
64  std::pair<double,double> getBoundsX() const;
65  std::pair<double,double> getBoundsY() const;
66  QwtPlot::Axis getVerticalAxis() const;
67  QString getTitle() const;
68  virtual ~FeatherCurve();
69 
70 private:
71  FeatherCurve( const FeatherCurve& other );
72  FeatherCurve operator=( const FeatherCurve& other );
73 
74  void setCurvePenColor( const QColor& color );
75 
76  bool isSumCurve() const;
77  bool isWeightCurve() const;
78  double logarithm( double value, casacore::Bool& valid ) const;
79  QList<int> doLogs( double* values, int count ) const;
80 
81  void resetDataBounds();
83  bool scaleLogUV;
94  bool sumCurve;
95  bool firstTime;
96  double minX;
97  double maxX;
98  double minY;
99  double maxY;
104 
105 };
106 
107 } /* namespace casa */
108 #endif /* FEATHERCURVE_H_ */
bool isWeightCurve() const
QVector< double > getYValues() const
QString getTitle() const
void setCurveData(const QVector< double > &xVals, const QVector< double > &yVals)
Change the data the curve contains.
bool sumCurve
This variable was added for scatter plots.
Definition: FeatherCurve.h:94
FeatherCurve(FeatherPlot *plot, QwtPlot::Axis xAxis, QwtPlot::Axis yAxis, bool sumCurve)
QVector< double > yValues
Definition: FeatherCurve.h:103
virtual ~FeatherCurve()
void setTitle(const QString &title)
QList< int > doLogs(double *values, int count) const
std::pair< double, double > getBoundsY() const
void setFunctionColor(const QColor &color, bool diagonalLine)
void setCurvePenColor(const QColor &color)
void adjustData(bool uvLog, bool ampLog)
Change the scale of existing data (Log&lt;–&gt;No Log)
Represents a curve on one of the plots.
Definition: FeatherCurve.h:44
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Interface class for decoupling of a parent from a child.
Definition: ColorProvider.h:34
FeatherCurve operator=(const FeatherCurve &other)
bool isSumCurve() const
QColor getRectColor() const
double logarithm(double value, casacore::Bool &valid) const
void initScatterPlot(int dotSize)
Custom QwtPlotCurve that provides the capability of a thicker (rectangular) legend rather than a hard...
Definition: LegendCurve.h:40
QVector< double > getXValues() const
QwtPlot::Axis getVerticalAxis() 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
LegendCurve * plotCurve
Definition: FeatherCurve.h:100
void setCurveSize(bool scatterPlot, bool diagonalLine, int dotSize, int lineThickness)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
QVector< double > xValues
Definition: FeatherCurve.h:102
std::pair< double, double > getBoundsX() const