File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
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 
15 class QComboBox;
16 class QPushButton;
17 class QLineEdit;
18 class QRect;
19 class QToolButton;
20 
21 namespace 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);
90  ~StretchTool();
91  void addTo(QMenu *menu);
92 
96  enum StretchBand {
97  Gray,
98  Red,
101  All
102  };
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);
111  static Histogram histFromBuffer(ViewportBuffer *buffer);
112  static Histogram histFromBuffer(ViewportBuffer *buffer, QRect rect,
113  double min, double max);
114  void updateAdvStretchDialogforAll(void);
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();
146  void stretchGlobal(CubeViewport *);
147  void stretchGlobalAllBands();
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();
163  void enableRubberBandTool();
164  void screenPixelsChanged();
165  void updateHistograms();
166  void rubberBandComplete();
168 
169  private slots:
170  void stretchChanged();
171  void advancedStretchChanged();
172  void changeStretch();
173  void showAdvancedDialog();
174  void setStretchAcrossBands();
175  void setStretchAllViewports();
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;
186  QToolButton *m_stretchRegionalButton;
187  QPushButton *m_flashButton;
188 
193 
195 
196  QLineEdit *m_stretchMinEdit;
197  QLineEdit *m_stretchMaxEdit;
198 
200 
203 
205  };
206 };
207 
208 #endif
Isis::ViewportBuffer
Reads and stores visible DN values.
Definition: ViewportBuffer.h:63
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Isis::StretchTool::m_stretchBandComboBox
QComboBox * m_stretchBandComboBox
Stretch combo box.
Definition: StretchTool.h:194
Isis::StretchTool::stretchChipViewport
void stretchChipViewport(Stretch *, CubeViewport *)
when a viewport is stretched, send the stretch and the viewport associated with it to any ChipViewpor...
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::StretchTool::stretchBandChanged
void stretchBandChanged(int)
The selected band for stretching changed.
Definition: StretchTool.cpp:1593
Isis::StretchTool::stretchBuffer
static Stretch stretchBuffer(ViewportBuffer *buffer, QRect rect)
This method computes the stretch over a region using the viewport buffer.
Definition: StretchTool.cpp:1388
Isis::StretchTool::m_copyBands
QAction * m_copyBands
Copy band stretch action.
Definition: StretchTool.h:192
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
Isis::StretchTool::All
@ All
All Bands.
Definition: StretchTool.h:101
Isis::StretchTool::setStretchAcrossBands
void setStretchAcrossBands()
Sets the stretch for all the bands in the active viewport to the current stretch.
Definition: StretchTool.cpp:1293
Isis::Stretch
Pixel value mapper.
Definition: Stretch.h:58
QMenu
Isis::StretchTool::stretchGlobalAllBands
void stretchGlobalAllBands()
This resets the stretch across all bands.
Definition: StretchTool.cpp:1122
Isis::AdvancedStretchDialog
Advanced Stretch Dialog.
Definition: AdvancedStretchDialog.h:30
Isis::StretchTool::m_stretchRegional
QAction * m_stretchRegional
Regional stretch action.
Definition: StretchTool.h:190
Isis::StretchTool::m_stretchGlobal
QAction * m_stretchGlobal
Global stretch action.
Definition: StretchTool.h:189
Isis::StretchTool::screenPixelsChanged
void screenPixelsChanged()
This is called when the visible area changes.
Definition: StretchTool.cpp:747
Isis::StretchTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget to add to the tool bar.
Definition: StretchTool.cpp:145
Isis::StretchTool::updateHistograms
void updateHistograms()
This updates the visible histograms in the advanced stretch, if present.
Definition: StretchTool.cpp:331
Isis::StretchTool::m_stretchRegionalButton
QToolButton * m_stretchRegionalButton
Regional Stretch Button.
Definition: StretchTool.h:186
Isis::StretchTool::~StretchTool
~StretchTool()
Destructor.
Definition: StretchTool.cpp:94
Isis::StretchTool::stretchBand
static Stretch stretchBand(CubeViewport *cvp, StretchBand band)
This method computes the stretch over the entire cube.
Definition: StretchTool.cpp:1418
Isis::StretchTool::Red
@ Red
Red Band.
Definition: StretchTool.h:98
QComboBox
Isis::StretchTool::statsFromBuffer
static Statistics statsFromBuffer(ViewportBuffer *buffer, QRect rect)
This method will calculate and return the statistics for a given region and viewport buffer.
Definition: StretchTool.cpp:1484
Isis::StretchTool::stretchRequested
void stretchRequested(MdiCubeViewport *cvp, int bandId)
The cube viewport requested a stretch at this time, give it to the viewport.
Definition: StretchTool.cpp:848
Isis::StretchTool::warningSignal
void warningSignal(std::string &pStr, const std::string pExStr)
Shows a warning.
Isis::StretchTool::m_stretchManual
QAction * m_stretchManual
Manual stretch action.
Definition: StretchTool.h:191
Isis::StretchTool::m_copyButton
QToolButton * m_copyButton
Copy Button.
Definition: StretchTool.h:184
Isis::StretchTool::stretchRect
void stretchRect(CubeViewport *cvp, QRect rect)
stretch the specified CubeViewport with the given rect
Definition: StretchTool.cpp:1208
Isis::StretchTool::m_flashButton
QPushButton * m_flashButton
Button to press for global stretch.
Definition: StretchTool.h:187
Isis::StretchTool::showAdvancedDialog
void showAdvancedDialog()
This methods shows and updates the advanced dialog.
Definition: StretchTool.cpp:1096
Isis::StretchTool::rubberBandComplete
void rubberBandComplete()
This method is called when the RubberBandTool is complete.
Definition: StretchTool.cpp:1189
Isis::StretchTool::m_chipViewportStretch
Stretch * m_chipViewportStretch
ChipViewport's stretch.
Definition: StretchTool.h:204
Isis::StretchTool::m_globalButton
QToolButton * m_globalButton
Global Button.
Definition: StretchTool.h:185
Isis::StretchTool::Blue
@ Blue
Blue Band.
Definition: StretchTool.h:100
Isis::StretchTool::histFromCube
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.
Definition: StretchTool.cpp:1519
Isis::StretchTool::histFromBuffer
static Histogram histFromBuffer(ViewportBuffer *buffer)
Given a viewport buffer, this calculates a histogram.
Definition: StretchTool.cpp:1541
Isis::StretchTool::Gray
@ Gray
Gray Band.
Definition: StretchTool.h:97
Isis::StretchTool::advancedStretchChanged
void advancedStretchChanged()
This is called when one of the advanced stretches changed.
Definition: StretchTool.cpp:994
Isis::StretchTool::m_stretchMaxEdit
QLineEdit * m_stretchMaxEdit
Max. line edit.
Definition: StretchTool.h:197
Isis::StretchTool::m_stretchBand
StretchBand m_stretchBand
Current stretch band.
Definition: StretchTool.h:199
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::StretchTool::m_advancedStretch
AdvancedStretchDialog * m_advancedStretch
The advanced dialog.
Definition: StretchTool.h:182
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
Isis::StretchTool::enableRubberBandTool
void enableRubberBandTool()
This method enables the RubberBandTool.
Definition: StretchTool.cpp:1282
Isis::StretchTool::changeStretch
void changeStretch()
This method is called when the stretch has changed and sets the min/max text fields to the correct va...
Definition: StretchTool.cpp:1034
Isis::StretchTool::menuName
QString menuName() const
This let's Tool know which Menu the actions this class has should be added to.
Definition: StretchTool.h:123
Isis::StretchTool::updateAdvStretchDialogforAll
void updateAdvStretchDialogforAll(void)
Update the streches and corresponding histograms for all the colors Red, Green and Blue for Stretch A...
Definition: StretchTool.cpp:379
Isis::StretchTool::stretchRegional
void stretchRegional()
Does a regional stretch for the active viewport.
Definition: StretchTool.cpp:1158
Isis::ToolPad
Definition: ToolPad.h:14
Isis::StretchTool::updateTool
void updateTool()
Updates the stretch tool.
Definition: StretchTool.cpp:795
Isis::StretchTool::loadStretchFromCube
void loadStretchFromCube()
Restores a saved stretch from the cube.
Definition: StretchTool.cpp:407
Isis::Histogram
Container of a cube histogram.
Definition: Histogram.h:74
Isis::StretchTool::mouseButtonRelease
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
This method will call a global stretch if the right mouse button is released.
Definition: StretchTool.cpp:1258
Isis::StretchTool
Stretch image edit tool.
Definition: StretchTool.h:85
Isis::StretchTool::setStretchAllViewports
void setStretchAllViewports()
Sets the stretch for all the viewports to the current stretch in the active viewport.
Definition: StretchTool.cpp:1344
Isis::StretchTool::statsFromCube
static Statistics statsFromCube(Cube *cube, int band)
This method will calculate and return the statistics for a given cube and band.
Definition: StretchTool.cpp:1461
Isis::StretchTool::m_stretchMinEdit
QLineEdit * m_stretchMinEdit
Min. line edit.
Definition: StretchTool.h:196
Isis::StretchTool::Green
@ Green
Green Band.
Definition: StretchTool.h:99
Isis::StretchTool::StretchBand
StretchBand
Enum to store the bands.
Definition: StretchTool.h:96
Isis::StretchTool::stretchChanged
void stretchChanged()
This method is called when the stretch has changed and sets the min/max text fields to the correct va...
Definition: StretchTool.cpp:910
Isis::StretchTool::setCubeViewport
void setCubeViewport(CubeViewport *)
This updates the advanced stretch to use the given viewport.
Definition: StretchTool.cpp:757
Isis::StretchTool::stretchGlobal
void stretchGlobal()
Does a global stretch for the active viewport.
Definition: StretchTool.cpp:1111
QAction
Isis::StretchTool::deleteFromCube
void deleteFromCube()
Deletes a saved stretch from the cube.
Definition: StretchTool.cpp:527
Isis::StretchTool::addTo
void addTo(QMenu *menu)
Adds the stretch action to the given menu.
Definition: StretchTool.cpp:131
Isis::StretchTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Adds the stretch action to the toolpad.
Definition: StretchTool.cpp:111
Isis::StretchTool::m_preGlobalStretches
Stretch * m_preGlobalStretches
Stretches before global button pressed.
Definition: StretchTool.h:202
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::StretchTool::saveStretchToCube
void saveStretchToCube()
Saves a strech to the cube.
Definition: StretchTool.cpp:593
Isis::StretchTool::stretchGlobalAllViewports
void stretchGlobalAllViewports()
Does a global stretch for all the viewports.
Definition: StretchTool.cpp:1145
Isis::StretchTool::StretchTool
StretchTool(QWidget *parent)
StretchTool constructor.
Definition: StretchTool.cpp:48

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:17:20