casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ImageSlice.qo.h
Go to the documentation of this file.
00001 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2000
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 IMAGE_SLICE_QO_H_
00027 #define IMAGE_SLICE_QO_H_
00028 
00029 #include <display/Slicer/ImageSlice.ui.h>
00030 #include <display/Slicer/SliceStatisticsFactory.h>
00031 #include <display/Slicer/SliceStatistics.h>
00032 #include <display/Slicer/SliceWorker.h>
00033 #include <casa/Arrays/Vector.h>
00034 #include <QtGui/QFrame>
00035 #include <QColor>
00036 #include <QString>
00037 #include <QList>
00038 #include <QTextStream>
00039 
00040 class QwtPlotCurve;
00041 class QwtPlotMarker;
00042 class QwtPlot;
00043 
00044 namespace casa {
00045 
00046 class ImageAnalysis;
00047 class SliceSegment;
00048 class ImageSliceColorBar;
00049 class SliceStatistics;
00050 
00056 class ImageSlice : public QFrame {
00057 
00058         Q_OBJECT
00059 
00060 public:
00061         ImageSlice( int id, QWidget* parent=NULL );
00062         QColor getCurveColor( int index) const;
00063         int getColorCount() const;
00064         void setShowCorners( bool show );
00065         void setSampleCount( int count );
00066         void setAxes( const Vector<Int>& axes );
00067         void setCoords( const Vector<Int>& coords );
00068         void setCurveColor( QList<QColor> colors );
00069         bool isSelected() const;
00070         void setSelected( bool selected );
00071         void setInterpolationMethod( const String& method );
00072         void setImageAnalysis( ImageAnalysis* analysis );
00073         void setUseViewerColors( bool useViewerColors );
00074         void setPolylineColorUnit( bool polyline );
00075         void setPlotPreferences( int curveWidth, int markerSize );
00076         void setViewerCurveColor( const QString& colorName );
00077         void updatePolyLine(  const QList<int> &pixelX, const QList<int> & pixelY,
00078                         const QList<double>& worldX, const QList<double>& worldY );
00079         void updatePositionInformation(const QVector<String>& info );
00080         void toAscii( QTextStream& );
00081         void clearCurve();
00082         void addPlotCurve( QwtPlot* plot);
00083 
00084         virtual ~ImageSlice();
00085 
00086         //X-Axis
00087         void setStatistics( SliceStatistics* statistics );
00088 
00089 private slots:
00090         void openCloseDisplay();
00091 
00092 private:
00093         void minimizeDisplay();
00094         void maximizeDisplay();
00095         void resetPlotCurve();
00096         void updateSliceStatistics();
00097         void clearCorners();
00098         void addCorner( double xValue, double yValue, QwtPlot* plot );
00099         void addSegment( SliceSegment* segment );
00100         void removeSegment( SliceSegment* segment );
00101         void resetSegmentColors();
00102         void runSliceWorker();
00103 
00104         SliceStatistics* statistics;
00105         ImageSlice( const ImageSlice& other );
00106         ImageSlice operator=( const ImageSlice& other );
00107 
00108         int markerSize;
00109         int curveWidth;
00110         int regionId;
00111         bool selected;
00112         bool useViewerColors;
00113         bool showCorners;
00114         bool polylineUnit;
00115         bool minimized;
00116         QColor viewerColor;
00117         QList<QColor> segmentColors;
00118         SliceWorker* sliceWorker;
00119         QList<SliceSegment*> segments;
00120         QList<QwtPlotMarker*> segmentCorners;
00121         ImageSliceColorBar* colorBar;
00122         Ui::ImageSliceClass ui;
00123 };
00124 
00125 } /* namespace casa */
00126 #endif /* IMAGE_SLICE_H_ */