Isis 3 Programmer 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:
113  int p_ulSamp;
114  int p_ulLine;
115  bool p_set;
116  bool p_showText;
119 
120  QPixmap p_pixmap;
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 
152  QScrollArea *p_visualScroll;
153  QGroupBox *p_visualBox;
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 
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
void changeBoxSamples()
Change the box sample size.
QDialog * p_dialog
Dialog to show pixel data and statistics.
QWidget * createToolBarWidget(QStackedWidget *parent)
Attaches this tool to the toolbar.
bool p_showPixels
Display pixels?
int p_oldWidth
Previous box width in pixels.
int p_ulSamp
Upper left sample of region captured.
QLabel * p_avgLabel
Average label.
bool p_showDeviation
Display deviation?
int p_oldHeight
Previous box height in pixels.
QSize sizeHint() const
Size hint for this widget.
QLabel * p_boxLabel
Box label.
QLabel * p_maxLabel
Maximum label.
VisualDisplay * p_visualDisplay
Visual display.
int p_boxWidth
Box width in pixels.
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Called when a mouse button is released.
Stretch p_stretch
Stretch used to display pixels.
QVector< QVector< double > > p_pixelData
Stored pixel values.
QAction * toolPadAction(ToolPad *toolpad)
Attaches this tool to the toolpad.
int p_boxSamps
Sample size for box.
QLabel * p_sampLabel
Sample label.
void mouseMoveEvent(QMouseEvent *event)
Called when the mouse moves over this widget.
int p_boxSamps
Sample size for box.
QLabel * p_lineLabel
Line label.
void changeBoxLines()
Change the box line size.
QGroupBox * p_visualBox
Visual group box to hold visual display.
QLabel * p_stdevLabel
Std Dev label.
void paintPixmap()
Paint the pixmap.
void hideDisplay(bool hide)
Hide/Show the visual display.
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.
bool p_showText
Display text?
void setSamples(int samps)
Set box sample size.
int p_boxLines
Line size for box.
Pixel value mapper.
Definition: Stretch.h:72
bool p_set
Boolean to see if data is set.
void leaveEvent(QEvent *event)
Mouse left widget, update labels.
QLabel * p_dnLabel
DN label.
void setDn(const QString st)
Signal to set the DN label to st.
QAction * p_action
Action associated with this tool.
Tool to visualize statistics in an n * m box.
void setBoxSize(int size)
Set box size in pixels.
int p_ulSamp
Upper left sample of region.
int p_ulLine
Upper left line of region.
int p_boxHeight
Box height in pixels.
int p_ulLine
Upper left line of region captured.
QLabel * p_minLabel
Minimum label.
void setLine(const QString st)
Signal to set the Line label to st.
void getStatistics(QPoint p)
Retrieve the statistics based on the box size and point on the cube.
QPixmap p_pixmap
Pixmap used for drawing.
void updateSize()
Update the size of the box.
void showDeviation(bool b)
Show/Hide deviation.
void setPixelData(QVector< QVector< double > > data, int samp, int line)
Set pixel data and upper left sample/line.
QScrollArea * p_visualScroll
Scroll area to house visual display.
QLineEdit * p_linesEdit
Line size line edit.
QLineEdit * p_sampsEdit
Sample size line edit.
void paintEvent(QPaintEvent *event)
Paint pixmap to the widget.
void setLines(int lines)
Set box line size.
void resizeScrollbars()
Resize the scroll bars and center the point clicked.
bool p_set
Boolean to see if data is set.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
int p_boxLines
Line size for box.
Base class for the Qisis tools.
Definition: Tool.h:81
void showText(bool b)
Show/Hide text.
void showPixels(bool b)
Show/Hide pixels.
StatisticsTool(QWidget *parent)
Constructor, creates and sets up widgets for this tool.
Statistics p_stats
Stats used for calculating stretch and deviation.
VisualDisplay(QWidget *parent=0)
Constructor for visual display.