casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtRegionStats.qo.h
Go to the documentation of this file.
1 #ifndef REGION_QTREGIONSTATS_H_
2 #define REGION_QTREGIONSTATS_H_
3 
4 #include <QGroupBox>
5 #include <QPushButton>
6 #include <QLabel>
7 #include <QVBoxLayout>
8 #include <casa/BasicSL/String.h>
9 #include <display/region/QtImageRegionStats.ui.h>
10 #include <display/region/QtMsRegionStats.ui.h>
11 #include <display/region/SlicerStats.ui.h>
12 #include <display/region/PVLineStats.ui.h>
14 
15 
16 class QStackedWidget;
17 
18 namespace casa {
19  namespace viewer {
20 
21  class Region;
22 
23  namespace qt {
24 
25  typedef std::list<std::pair<QGroupBox*,QLabel*> > statfield_list_t;
26 
27  class stats_t : public QGroupBox {
28  Q_OBJECT
29  public:
30  stats_t( QWidget *parent ) : QGroupBox("",parent) { }
31  void setLabels( const std::string &label, const std::string &desc );
32  virtual RegionInfo::InfoTypes type( ) const = 0;
33  virtual QPushButton *next( ) = 0;
34  virtual bool updateStatisticsInfo( std::shared_ptr<casa::viewer::RegionInfo> ) {
35  return false;
36  }
37  protected:
38  std::string description_;
39  std::string label_;
40  };
41 
42  class image_stats_t : public stats_t, public Ui::QtImageRegionStats {
43  Q_OBJECT
44  public:
45  image_stats_t( statfield_list_t &fields, QWidget *parent=0 );
48  }
49  virtual QPushButton *next( ) {
50  return next_button;
51  }
52  };
53 
54  class ms_stats_t : public stats_t, public Ui::QtMsRegionStats {
55  Q_OBJECT
56  public:
57  ms_stats_t( statfield_list_t &fields, QWidget *parent=0 );
60  }
61  virtual QPushButton *next( ) {
62  return next_button;
63  }
64  };
65 
66  class SliceStats : public stats_t, public Ui::SlicerStats {
67  Q_OBJECT
68  public:
69  SliceStats( QWidget *parent=0 );
72  }
73  virtual QPushButton *next( ) {
74  return next_button;
75  }
76  QWidget* getPlotHolder() {
77  return plotHolderWidget;
78  }
79  bool updateStatisticsInfo( std::shared_ptr<casa::viewer::RegionInfo> );
80  signals:
81  void show1DSliceTool();
82  };
83 
84  class pvline_stats_t : public stats_t, public Ui::PVLineStats {
85  Q_OBJECT
86  public:
87  pvline_stats_t( QWidget *parent=0 );
90  }
91  virtual QPushButton *next( ) {
92  return next_button;
93  }
94  bool updateStatisticsInfo( std::shared_ptr<casa::viewer::RegionInfo> );
95  protected:
96  void enterEvent (QEvent *);
97  void showEvent ( QShowEvent * );
98 
99  signals:
100  void createPVImage(const std::string&,const std::string&,int);
101  void setPVInfo(int width);
102 
103  private slots:
104  void create_pv_image( );
105  };
106  }
107 
108 
109  class QtRegionStats : public QWidget {
110  Q_OBJECT
111  public:
112  QtRegionStats( QWidget *parent=0 );
113  ~QtRegionStats( );
114 
115  void disableNextButton( );
116  void reset( );
117 #if OLDSTUFF
118  void addstats( std::list<std::pair<casacore::String,String> > *stats );
119 #endif
120 
121  void updateStatistics( std::shared_ptr<casa::viewer::RegionInfo> stats, Region* region = NULL );
122 
123  void setCenterBackground(QString background);
124 
125  void setNext( QStackedWidget *, QtRegionStats * );
126 
127  bool updateStatisticsInfo( std::shared_ptr<casa::viewer::RegionInfo> );
128 
129  protected slots:
130  void go_next( );
131 
132  protected:
134 
135  QStackedWidget *container_;
137 
138  private:
139  QVBoxLayout *layout_;
140  qt::stats_t *new_stats_box( RegionInfo::InfoTypes type, Region* region, const string& label );
142  std::string description_;
143  std::string label_;
144  };
145  }
146 }
147 
148 #endif
QtRegionStats(QWidget *parent=0)
virtual QPushButton * next()=0
virtual bool updateStatisticsInfo(std::shared_ptr< casa::viewer::RegionInfo >)
void setNext(QStackedWidget *, QtRegionStats *)
void createPVImage(const std::string &, const std::string &, int)
RegionInfo::InfoTypes type() const
virtual Type type()
Return the type enum.
qt::statfield_list_t fields
virtual QPushButton * next()
SliceStats(QWidget *parent=0)
bool updateStatisticsInfo(std::shared_ptr< casa::viewer::RegionInfo >)
void setLabels(const std::string &label, const std::string &desc)
qt::stats_t * new_stats_box(RegionInfo::InfoTypes type, Region *region, const string &label)
All regions are specified in &quot;linear coordinates&quot;, not &quot;pixel coordinates&quot;.
Definition: Region.qo.h:147
virtual QPushButton * next()
virtual RegionInfo::InfoTypes type() const =0
ms_stats_t(statfield_list_t &fields, QWidget *parent=0)
std::list< std::pair< QGroupBox *, QLabel * > > statfield_list_t
void updateStatistics(std::shared_ptr< casa::viewer::RegionInfo > stats, Region *region=NULL)
void setCenterBackground(QString background)
bool updateStatisticsInfo(std::shared_ptr< casa::viewer::RegionInfo >)
RegionInfo::InfoTypes type() const
RegionInfo::InfoTypes type() const
virtual QPushButton * next()
bool updateStatisticsInfo(std::shared_ptr< casa::viewer::RegionInfo >)
virtual QPushButton * next()
RegionInfo::InfoTypes type() const
image_stats_t(statfield_list_t &fields, QWidget *parent=0)
pvline_stats_t(QWidget *parent=0)