Isis 3 Programmer Reference
StretchTool.h
1#ifndef StretchTool_h
2#define StretchTool_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12// This is the only include allowed in this file!
13#include "Tool.h"
14
15class QComboBox;
16class QPushButton;
17class QLineEdit;
18class QRect;
19class QToolButton;
20
21namespace Isis {
22 class AdvancedStretchDialog;
23 class Cube;
24 class CubeViewport;
25 class Histogram;
26 class Statistics;
27 class Stretch;
28 class ViewportBuffer;
29
85 class StretchTool : public Tool {
86 Q_OBJECT
87
88 public:
89 StretchTool(QWidget *parent);
91 void addTo(QMenu *menu);
92
103
104 static Stretch stretchBuffer(ViewportBuffer *buffer, QRect rect);
105 static Stretch stretchBand(CubeViewport *cvp, StretchBand band);
106
107 static Statistics statsFromCube(Cube *cube, int band);
108 static Statistics statsFromBuffer(ViewportBuffer *buffer, QRect rect);
109 static Histogram histFromCube(Cube *cube, int band,
110 double min, double max);
112 static Histogram histFromBuffer(ViewportBuffer *buffer, QRect rect,
113 double min, double max);
115
123 QString menuName() const {
124 return "&View";
125 }
126
127 signals:
133
142 void warningSignal(std::string &pStr, const std::string pExStr);
143
144 public slots:
145 void stretchGlobal();
149 void stretchRegional();
151
152 protected:
154 QWidget *createToolBarWidget(QStackedWidget *parent);
155 void updateTool();
156 void stretchRequested(MdiCubeViewport *cvp, int bandId);
157
158 protected slots:
159 void mouseButtonRelease(QPoint p, Qt::MouseButton s);
160 void saveStretchToCube();
161 void deleteFromCube();
162 void loadStretchFromCube();
164 void screenPixelsChanged();
165 void updateHistograms();
166 void rubberBandComplete();
168
169 private slots:
170 void stretchChanged();
172 void changeStretch();
173 void showAdvancedDialog();
176 void stretchBandChanged(int);
177
178 private:
179 void stretchRect(CubeViewport *cvp, QRect rect);
180
181 private:
183
184 QToolButton *m_copyButton;
185 QToolButton *m_globalButton;
187 QPushButton *m_flashButton;
188
193
195
196 QLineEdit *m_stretchMinEdit;
197 QLineEdit *m_stretchMaxEdit;
198
200
203
205 };
206};
207
208#endif
IO Handler for Isis Cubes.
Definition Cube.h:168
Widget to display Isis cubes for qt apps.
Container of a cube histogram.
Definition Histogram.h:74
Cube display widget for certain Isis MDI applications.
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
Pixel value mapper.
Definition Stretch.h:58
Stretch image edit tool.
Definition StretchTool.h:85
void showAdvancedDialog()
This methods shows and updates the advanced dialog.
QAction * m_stretchGlobal
Global stretch action.
QComboBox * m_stretchBandComboBox
Stretch combo box.
QAction * m_stretchRegional
Regional stretch action.
void updateAdvStretchDialogforAll(void)
Update the streches and corresponding histograms for all the colors Red, Green and Blue for Stretch A...
void stretchRect(CubeViewport *cvp, QRect rect)
stretch the specified CubeViewport with the given rect
static Statistics statsFromBuffer(ViewportBuffer *buffer, QRect rect)
This method will calculate and return the statistics for a given region and viewport buffer.
void stretchGlobal()
Does a global stretch for the active viewport.
QAction * m_copyBands
Copy band stretch action.
void setStretchAcrossBands()
Sets the stretch for all the bands in the active viewport to the current stretch.
void stretchRegional()
Does a regional stretch for the active viewport.
QToolButton * m_copyButton
Copy Button.
static Histogram histFromCube(Cube *cube, int band, double min, double max)
This method will calculate and return the histogram for a given cube and band.
void screenPixelsChanged()
This is called when the visible area changes.
Stretch * m_preGlobalStretches
Stretches before global button pressed.
StretchBand m_stretchBand
Current stretch band.
QLineEdit * m_stretchMaxEdit
Max. line edit.
StretchBand
Enum to store the bands.
Definition StretchTool.h:96
@ Gray
Gray Band.
Definition StretchTool.h:97
@ Green
Green Band.
Definition StretchTool.h:99
@ Blue
Blue Band.
@ All
All Bands.
void rubberBandComplete()
This method is called when the RubberBandTool is complete.
QLineEdit * m_stretchMinEdit
Min. line edit.
static Statistics statsFromCube(Cube *cube, int band)
This method will calculate and return the statistics for a given cube and band.
void stretchRequested(MdiCubeViewport *cvp, int bandId)
The cube viewport requested a stretch at this time, give it to the viewport.
~StretchTool()
Destructor.
static Histogram histFromBuffer(ViewportBuffer *buffer)
Given a viewport buffer, this calculates a histogram.
QAction * toolPadAction(ToolPad *pad)
Adds the stretch action to the toolpad.
StretchTool(QWidget *parent)
StretchTool constructor.
void updateHistograms()
This updates the visible histograms in the advanced stretch, if present.
void deleteFromCube()
Deletes a saved stretch from the cube.
void addTo(QMenu *menu)
Adds the stretch action to the given menu.
void setCubeViewport(CubeViewport *)
This updates the advanced stretch to use the given viewport.
void enableRubberBandTool()
This method enables the RubberBandTool.
QToolButton * m_globalButton
Global Button.
void stretchChanged()
This method is called when the stretch has changed and sets the min/max text fields to the correct va...
void changeStretch()
This method is called when the stretch has changed and sets the min/max text fields to the correct va...
void stretchGlobalAllViewports()
Does a global stretch for all the viewports.
Stretch * m_chipViewportStretch
ChipViewport's stretch.
QString menuName() const
This let's Tool know which Menu the actions this class has should be added to.
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
This method will call a global stretch if the right mouse button is released.
static Stretch stretchBuffer(ViewportBuffer *buffer, QRect rect)
This method computes the stretch over a region using the viewport buffer.
void setStretchAllViewports()
Sets the stretch for all the viewports to the current stretch in the active viewport.
AdvancedStretchDialog * m_advancedStretch
The advanced dialog.
void saveStretchToCube()
Saves a strech to the cube.
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget to add to the tool bar.
void stretchGlobalAllBands()
This resets the stretch across all bands.
void advancedStretchChanged()
This is called when one of the advanced stretches changed.
void updateTool()
Updates the stretch tool.
void stretchChipViewport(Stretch *, CubeViewport *)
when a viewport is stretched, send the stretch and the viewport associated with it to any ChipViewpor...
QAction * m_stretchManual
Manual stretch action.
void loadStretchFromCube()
Restores a saved stretch from the cube.
static Stretch stretchBand(CubeViewport *cvp, StretchBand band)
This method computes the stretch over the entire cube.
QPushButton * m_flashButton
Button to press for global stretch.
QToolButton * m_stretchRegionalButton
Regional Stretch Button.
void stretchBandChanged(int)
The selected band for stretching changed.
void warningSignal(std::string &pStr, const std::string pExStr)
Shows a warning.
Base class for the Qisis tools.
Definition Tool.h:67
Reads and stores visible DN values.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16