casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MolecularLine.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 
26 #ifndef MOLECULARLINE_H_
27 #define MOLECULARLINE_H_
28 
29 #include <QString>
30 #include <qwt_plot_marker.h>
31 #include <casa/aips.h>
32 
33 class QTextStream;
34 
35 namespace casa {
36 
37 
38 
39  class MolecularLine : public QwtPlotMarker {
40  public:
41  static void setMolecularLineColor( QColor lineColor );
42 
43  MolecularLine( float center, float peak, const QString& name,
44  const QString& chemicalName, const QString& resolvedQNs,
45  const QString& frequencyUnits, float originalFrequency );
46  virtual int rtti() const;
47  void setCenter( float center );
48  float getCenter( ) const;
49  float getOriginalFrequency() const;
50  QString getOriginalUnits() const;
51  void setPeak( float peak );
52  float getPeak() const;
53  void setLabel( const QString& label );
54  QString getLabel() const;
55  virtual void draw ( QPainter* painter, const QwtScaleMap & xMap,
56  const QwtScaleMap & yMap, const QRect & canvasRect) const;
57  void draw (QPainter * painter, int centerPixel,
58  int peakPixel, int zeroPixel, int width, int height ) const;
59  void getMinMax( casacore::Double& xmin, casacore::Double& xmax, casacore::Double& ymin, casacore::Double& ymax ) const;
60  bool equalTo( const MolecularLine* const other ) const;
61  void toStream( QTextStream* stream ) const;
62  virtual ~MolecularLine();
63 
64  private:
65  MolecularLine();
66  static QColor lineColor;
67  float center;
69  float peak;
70  QString label;
71  QString resolvedQNs;
72  QString chemicalName;
73  QString frequencyUnits;
74 
75  void init();
76  };
77 
78 } /* namespace casa */
79 #endif /* MOLECULARLINE_H_ */
virtual int rtti() const
float getPeak() const
void setCenter(float center)
float getOriginalFrequency() const
QString getOriginalUnits() const
static void setMolecularLineColor(QColor lineColor)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
bool equalTo(const MolecularLine *const other) const
static QColor lineColor
Definition: MolecularLine.h:66
void toStream(QTextStream *stream) const
double Double
Definition: aipstype.h:55
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &canvasRect) const
void setPeak(float peak)
void getMinMax(casacore::Double &xmin, casacore::Double &xmax, casacore::Double &ymin, casacore::Double &ymax) const
float getCenter() const
QString getLabel() const
void setLabel(const QString &label)
virtual ~MolecularLine()