MolecularLine.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef MOLECULARLINE_H_
00027 #define MOLECULARLINE_H_
00028
00029 #include <QString>
00030 #include <qwt_plot_marker.h>
00031 #include <casa/aips.h>
00032
00033 class QTextStream;
00034
00035 namespace casa {
00036
00037
00038
00039 class MolecularLine : public QwtPlotMarker {
00040 public:
00041 static void setMolecularLineColor( QColor lineColor );
00042
00043 MolecularLine( float center, float peak, const QString& name,
00044 const QString& chemicalName, const QString& resolvedQNs,
00045 const QString& frequencyUnits, float originalFrequency );
00046 virtual int rtti() const;
00047 void setCenter( float center );
00048 float getCenter( ) const;
00049 float getOriginalFrequency() const;
00050 QString getOriginalUnits() const;
00051 void setPeak( float peak );
00052 float getPeak() const;
00053 void setLabel( const QString& label );
00054 QString getLabel() const;
00055 virtual void draw ( QPainter* painter, const QwtScaleMap & xMap,
00056 const QwtScaleMap & yMap, const QRect & canvasRect) const;
00057 void draw (QPainter * painter, int centerPixel,
00058 int peakPixel, int zeroPixel, int width, int height ) const;
00059 void getMinMax( Double& xmin, Double& xmax, Double& ymin, Double& ymax ) const;
00060 bool equalTo( const MolecularLine* const other ) const;
00061 void toStream( QTextStream* stream ) const;
00062 virtual ~MolecularLine();
00063
00064 private:
00065 MolecularLine();
00066 static QColor lineColor;
00067 float center;
00068 float originalFrequency;
00069 float peak;
00070 QString label;
00071 QString resolvedQNs;
00072 QString chemicalName;
00073 QString frequencyUnits;
00074
00075 void init();
00076 };
00077
00078 }
00079 #endif