casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SliceSegment.qo.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 SLICE_SEGMENT_QO_H
27 #define SLICE_SEGMENT_QO_H
28 
29 #include <QFrame>
30 #include <casa/BasicSL/String.h>
31 #include <display/Slicer/SliceSegment.ui.h>
32 
33 class QwtPlot;
34 class QwtPlotCurve;
35 
36 namespace casa {
37 
45  class SliceStatistics;
46  class SegmentTracer;
47 
48  class SliceSegment : public QFrame {
49  Q_OBJECT
50 
51  public:
52  SliceSegment(int regionId, int index, QWidget *parent = 0);
53  void addCurve( QwtPlot* plot, const QVector<double>& xValues, const QVector<double>& yValues );
54  void setEndPointsWorld( double worldX1, double worldY1, double worldX2, double worldY2 );
55  void setEndPointsPixel( int pixelX1, int pixelY1, int pixelX2, int pixelY2 );
56  void setColor( QColor color );
57  void setCurveWidth( int width );
58  void updateEnds( const casacore::String& start, const casacore::String& end);
59  QColor getCurveColor() const;
60  void clearCurve();
61  void updateStatistics( SliceStatistics* statistics );
62  QwtPlot* getPlot();
63  ~SliceSegment();
64 
65  signals:
66  void statisticsSelected( int index );
67 
68  private:
69  QString parseEndInfo( const casacore::String& info ) const;
70  void resetCurveWidth();
71  void setCurveColor();
72  SliceSegment( const SliceSegment& other );
73  SliceSegment operator=( const SliceSegment& other );
74  std::pair<double,double> worldStart;
75  std::pair<double,double> worldEnd;
76  std::pair<int,int> pixelStart;
77  std::pair<int,int> pixelEnd;
79  int regionId;
80  int index;
81 
82  QColor defaultColor;
83  QwtPlotCurve* plotCurve;
85  Ui::SliceSegmentClass ui;
86  };
87 
88 }
89 
90 #endif // SLICESEGMENT_QO_H
QwtPlotCurve * plotCurve
std::pair< int, int > pixelEnd
Ui::SliceSegmentClass ui
std::pair< double, double > worldStart
QString parseEndInfo(const casacore::String &info) const
SliceSegment operator=(const SliceSegment &other)
std::pair< double, double > worldEnd
void setColor(QColor color)
void setEndPointsWorld(double worldX1, double worldY1, double worldX2, double worldY2)
void setEndPointsPixel(int pixelX1, int pixelY1, int pixelX2, int pixelY2)
const_iterator end() const
void statisticsSelected(int index)
std::pair< int, int > pixelStart
void setCurveWidth(int width)
Computes the angle and distance for a single line segment in the slice.
QwtPlot * getPlot()
String: the storage and methods of handling collections of characters.
Definition: String.h:223
QColor getCurveColor() const
void updateStatistics(SliceStatistics *statistics)
void addCurve(QwtPlot *plot, const QVector< double > &xValues, const QVector< double > &yValues)
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
SegmentTracer * segmentTracer
void updateEnds(const casacore::String &start, const casacore::String &end)
SliceSegment(int regionId, int index, QWidget *parent=0)