casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SpectralPositioningWidget.qo.h
Go to the documentation of this file.
1 #ifndef SPECTRALPOSITIONINGWIDGET_QO_H
2 #define SPECTRALPOSITIONINGWIDGET_QO_H
3 
4 #include <QWidget>
5 #include <display/QtPlotter/SpectralPositioningWidget.ui.h>
6 #include <casa/Arrays/Vector.h>
7 namespace casacore{
8 
9  class LogIO;
10 }
11 
12 namespace casa {
13 
14  class ProfileTaskMonitor;
15 
16  class SpectralPositioningWidget : public QWidget {
17  Q_OBJECT
18 
19  public:
20  SpectralPositioningWidget(QWidget *parent = 0);
21  void setTaskMonitor( ProfileTaskMonitor* monitor );
23 
27 
28  private slots:
29  void boxSpecChanged( int index );
30  void locationSelectionTypeChanged( int index );
31  void locationUnitsChanged( int index );
32  void setPosition();
33 
34  private:
35  void updateUI();
36  void updateUIWorldBox();
37  void updateUIWorldPoint();
38  void updateUIPixelBox();
39  void updateUIPixelPoint();
43  void initSpectrumPosition();
44  void pageUpdate( int selectionIndex, int unitIndex );
45 
46  bool populateWorlds( const QList<int> &pixelX, const QList<int> &pixelY,
47  QList<double> &worldX, QList<double> &worldY );
48  bool fillPointWorld( QList<double> &worldX, QList<double> &worldY );
49  void fillPointPixel( QList<int> &pixelX, QList<int>&pixelY )const;
50  bool fillBoxPixel( QList<int> &pixelX, QList<int>&pixelY );
51  bool fillBoxWorld( QList<double> &worldX, QList<double> & worldY );
52  bool fillBasedOnBoxSpecification( const double* const firstXPix, const double * const firstYPix,
53  const double* const secondXPix, const double* const secondYPix,
54  double* const blcxPix, double* const blcyPix,
55  double* const trcxPix, double* const trcYPix, bool pixels=true );
56  double toRadians( bool& valid, QLineEdit * lineEdit );
57  void switchBoxLabels( int index, int pageIndex, QLabel* const x1Label, QLabel* const y1Label,
58  QLabel* const x2Label, QLabel* const y2Label );
59  void setPixelLineEdits( double topLeft, double bottomLeft,
60  double topRight, double bottomRight );
61  void setWorldEdits( double topLeft, double bottomLeft,
62  double topRight, double bottomRight );
63  void adjustPoint( const casacore::Vector<double>& newX, const casacore::Vector<double>& newY,
65  Ui::SpectralPositioningWidgetClass ui;
66 
69  QIntValidator* pixelValidator;
73  };
74  QMap<BoxSpecificationIndex,QList<QString> > boxLabelMap;
81  };
82 }
83 #endif // SPECTRALPOSITIONINGWIDGET_H
void initSpectrumPosition()
Initializes the spectrum positioning tab.
void locationUnitsChanged(int index)
bool fillBoxPixel(QList< int > &pixelX, QList< int > &pixelY)
Ui::SpectralPositioningWidgetClass ui
void adjustPoint(const casacore::Vector< double > &newX, const casacore::Vector< double > &newY, casacore::Vector< double > &xValues, casacore::Vector< double > &yValues)
void setTaskMonitor(ProfileTaskMonitor *monitor)
void updateRegion(const casacore::Vector< double > px, const casacore::Vector< double > py, const casacore::Vector< double > wx, const casacore::Vector< double > wy)
ostream-like interface to creating log messages.
Definition: LogIO.h:167
void setWorldEdits(double topLeft, double bottomLeft, double topRight, double bottomRight)
bool populateWorlds(const QList< int > &pixelX, const QList< int > &pixelY, QList< double > &worldX, QList< double > &worldY)
bool fillBasedOnBoxSpecification(const double *const firstXPix, const double *const firstYPix, const double *const secondXPix, const double *const secondYPix, double *const blcxPix, double *const blcyPix, double *const trcxPix, double *const trcYPix, bool pixels=true)
double toRadians(bool &valid, QLineEdit *lineEdit)
bool fillPointWorld(QList< double > &worldX, QList< double > &worldY)
bool fillBoxWorld(QList< double > &worldX, QList< double > &worldY)
void setLogger(casacore::LogIO *logger)
void pageUpdate(int selectionIndex, int unitIndex)
void locationSelectionTypeChanged(int index)
void setPixelLineEdits(double topLeft, double bottomLeft, double topRight, double bottomRight)
void switchBoxLabels(int index, int pageIndex, QLabel *const x1Label, QLabel *const y1Label, QLabel *const x2Label, QLabel *const y2Label)
SpectralPositioningWidget(QWidget *parent=0)
void fillPointPixel(QList< int > &pixelX, QList< int > &pixelY) const
QMap< BoxSpecificationIndex, QList< QString > > boxLabelMap
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42