USGS

Isis 3.0 Object Programmers' Reference

Home

StretchTool.h
Go to the documentation of this file.
1 #ifndef StretchTool_h
2 #define StretchTool_h
3 
4 // This is the only include allowed in this file!
5 #include "Tool.h"
6 
7 class QComboBox;
8 class QPushButton;
9 class QLineEdit;
10 class QRect;
11 class QToolButton;
12 
35 namespace Isis {
36  class AdvancedStretchDialog;
37  class Cube;
38  class CubeViewport;
39  class Histogram;
40  class Statistics;
41  class Stretch;
42  class ViewportBuffer;
43 
99  class StretchTool : public Tool {
100  Q_OBJECT
101 
102  public:
103  StretchTool(QWidget *parent);
104  ~StretchTool();
105  void addTo(QMenu *menu);
106 
110  enum StretchBand {
112  Red,
116  };
117 
118  static Stretch stretchBuffer(ViewportBuffer *buffer, QRect rect);
119  static Stretch stretchBand(CubeViewport *cvp, StretchBand band);
120 
121  static Statistics statsFromCube(Cube *cube, int band);
122  static Statistics statsFromBuffer(ViewportBuffer *buffer, QRect rect);
123  static Histogram histFromCube(Cube *cube, int band,
124  double min, double max);
125  static Histogram histFromBuffer(ViewportBuffer *buffer);
126  static Histogram histFromBuffer(ViewportBuffer *buffer, QRect rect,
127  double min, double max);
128  void updateAdvStretchDialogforAll(void);
129 
137  QString menuName() const {
138  return "&View";
139  }
140 
141  signals:
147 
156  void warningSignal(std::string &pStr, const std::string pExStr);
157 
158  public slots:
159  void stretchGlobal();
160  void stretchGlobal(CubeViewport *);
161  void stretchGlobalAllBands();
163  void stretchRegional();
165 
166  protected:
168  QWidget *createToolBarWidget(QStackedWidget *parent);
169  void updateTool();
170  void stretchRequested(MdiCubeViewport *cvp, int bandId);
171 
172  protected slots:
173  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
174  void enableRubberBandTool();
175  void screenPixelsChanged();
176  void updateHistograms();
177  void rubberBandComplete();
179 
180  private slots:
181  void stretchChanged();
182  void advancedStretchChanged();
183  void changeStretch();
184  void showAdvancedDialog();
185  void setStretchAcrossBands();
186  void setStretchAllViewports();
187  void stretchBandChanged(int);
188 
189  private:
190  void stretchRect(CubeViewport *cvp, QRect rect);
191 
192  private:
194 
195  QToolButton *m_copyButton;
196  QToolButton *m_globalButton;
197  QToolButton *m_stretchRegionalButton;
198  QPushButton *m_flashButton;
199 
204 
206 
207  QLineEdit *m_stretchMinEdit;
208  QLineEdit *m_stretchMaxEdit;
209 
211 
214 
216  };
217 };
218 
219 #endif
220