casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MolecularLine.h
Go to the documentation of this file.
00001 //# Copyright (C) 2005
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
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         void setPeak( float peak );
00050         float getPeak() const;
00051         void setLabel( const QString& label );
00052         QString getLabel() const;
00053         virtual void draw ( QPainter* painter, const QwtScaleMap & xMap,
00054                 const QwtScaleMap & yMap, const QRect & canvasRect) const;
00055         void draw (QPainter * painter, int centerPixel,
00056                 int peakPixel, int zeroPixel, int width, int height ) const;
00057         void getMinMax( Double& xmin, Double& xmax, Double& ymin, Double& ymax ) const;
00058         bool equalTo( const MolecularLine* const other ) const;
00059         void toStream( QTextStream* stream ) const;
00060         virtual ~MolecularLine();
00061 
00062 private:
00063         MolecularLine();
00064         static QColor lineColor;
00065         float center;
00066         float originalFrequency;
00067         float peak;
00068         QString label;
00069         QString resolvedQNs;
00070         QString chemicalName;
00071         QString frequencyUnits;
00072 
00073         void init();
00074 };
00075 
00076 } /* namespace casa */
00077 #endif /* MOLECULARLINE_H_ */