Isis 3 Developer Reference
StatisticsTool.h
Go to the documentation of this file.
1 #ifndef StatisticsTool_h
2 #define StatisticsTool_h
3 
23 #include <QAction>
24 #include <QPixmap>
25 
26 // Only includes for Parents of classes defined in this file are allowed here!
27 #include "Tool.h"
28 #include <QWidget>
29 
30 
31 // FIXME: remove these includes
32 #include "Stretch.h"
33 #include <vector>
34 
35 class QScrollArea;
36 class QLabel;
37 class QLineEdit;
38 class QCheckBox;
39 class QGroupBox;
40 
41 namespace Isis {
59  class VisualDisplay : public QWidget {
60  Q_OBJECT
61 
62  public:
63  VisualDisplay(QWidget *parent = 0);
64 
65  QSize sizeHint() const;
66 
67  void setSamples(int samps);
68  void setLines(int lines);
69 
70  void updateSize();
71 
72  void setPixelData(QVector<QVector<double> > data, int samp, int line);
73 
74  protected:
75  void paintPixmap();
76  void paintEvent(QPaintEvent *event);
77  void mouseMoveEvent(QMouseEvent *event);
78  void leaveEvent(QEvent *event);
79 
80  signals:
86  void setDn(const QString st);
92  void setSample(const QString st);
98  void setLine(const QString st);
99 
100  protected slots:
101  void setBoxSize(int size);
102  void showText(bool b);
103  void showPixels(bool b);
104  void showDeviation(bool b);
105 
106  private:
107  int p_boxSamps;
108  int p_boxLines;
109  int p_boxWidth;
110  int p_boxHeight;
111  int p_oldWidth;
112  int p_oldHeight;
113  int p_ulSamp;
114  int p_ulLine;
115  bool p_set;
116  bool p_showText;
117  bool p_showPixels;
118  bool p_showDeviation;
119 
120  QPixmap p_pixmap;
121  Stretch p_stretch;
122  Statistics p_stats;
123  QVector<QVector<double> > p_pixelData;
124  };
125 
132  class StatisticsTool : public Tool {
133  Q_OBJECT
134 
135  public:
136  StatisticsTool(QWidget *parent);
137 
138  protected:
139  QAction *toolPadAction(ToolPad *toolpad);
140  QWidget *createToolBarWidget(QStackedWidget *parent);
141 
142  protected slots:
143  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
144  void hideDisplay(bool hide);
145  void resizeScrollbars();
146 
147  private:
148  void getStatistics(QPoint p);
149 
150  QAction *p_action;
151  QDialog *p_dialog;
152  QScrollArea *p_visualScroll;
153  QGroupBox *p_visualBox;
154  VisualDisplay *p_visualDisplay;
155  QLabel *p_boxLabel;
156  QLabel *p_minLabel;
157  QLabel *p_maxLabel;
158  QLabel *p_avgLabel;
159  QLabel *p_stdevLabel;
160  QLabel *p_sampLabel;
161  QLabel *p_lineLabel;
162  QLabel *p_dnLabel;
163  QLineEdit *p_sampsEdit;
164  QLineEdit *p_linesEdit;
165 
166  int p_boxSamps;
167  int p_boxLines;
168 
169  int p_ulSamp;
170  int p_ulLine;
171 
172  bool p_set;
173 
174  private slots:
175  void changeBoxSamples();
176  void changeBoxLines();
177  };
178 };
179 
180 #endif
QWidget * createToolBarWidget(QStackedWidget *parent)
Attaches this tool to the toolbar.
Definition: StatisticsTool.cpp:201
QSize sizeHint() const
Size hint for this widget.
Definition: StatisticsTool.cpp:456
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Called when a mouse button is released.
Definition: StatisticsTool.cpp:255
QAction * toolPadAction(ToolPad *toolpad)
Attaches this tool to the toolpad.
Definition: StatisticsTool.cpp:182
void mouseMoveEvent(QMouseEvent *event)
Called when the mouse moves over this widget.
Definition: StatisticsTool.cpp:717
Definition: StatisticsTool.h:132
void paintPixmap()
Paint the pixmap.
Definition: StatisticsTool.cpp:624
void hideDisplay(bool hide)
Hide/Show the visual display.
Definition: StatisticsTool.cpp:266
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
void setSample(const QString st)
Signal to set the Sample label to st.
void setSamples(int samps)
Set box sample size.
Definition: StatisticsTool.cpp:465
Pixel value mapper.
Definition: Stretch.h:72
void leaveEvent(QEvent *event)
Mouse left widget, update labels.
Definition: StatisticsTool.cpp:745
void setDn(const QString st)
Signal to set the DN label to st.
Tool to visualize statistics in an n * m box.
Definition: StatisticsTool.h:59
void setBoxSize(int size)
Set box size in pixels.
Definition: StatisticsTool.cpp:493
void setLine(const QString st)
Signal to set the Line label to st.
void updateSize()
Update the size of the box.
Definition: StatisticsTool.cpp:505
void showDeviation(bool b)
Show/Hide deviation.
Definition: StatisticsTool.cpp:562
void setPixelData(QVector< QVector< double > > data, int samp, int line)
Set pixel data and upper left sample/line.
Definition: StatisticsTool.cpp:580
Definition: Calculator.h:33
void paintEvent(QPaintEvent *event)
Paint pixmap to the widget.
Definition: StatisticsTool.cpp:702
void setLines(int lines)
Set box line size.
Definition: StatisticsTool.cpp:479
void resizeScrollbars()
Resize the scroll bars and center the point clicked.
Definition: StatisticsTool.cpp:410
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Base class for the Qisis tools.
Definition: Tool.h:81
void showText(bool b)
Show/Hide text.
Definition: StatisticsTool.cpp:529
void showPixels(bool b)
Show/Hide pixels.
Definition: StatisticsTool.cpp:546
StatisticsTool(QWidget *parent)
Constructor, creates and sets up widgets for this tool.
Definition: StatisticsTool.cpp:32
Definition: ToolPad.h:14
VisualDisplay(QWidget *parent=0)
Constructor for visual display.
Definition: StatisticsTool.cpp:422