An official website of the United States government
Here’s how you know
Official websites use .gov
A
.gov website belongs to an official government
organization in the United States.
Secure .gov websites use HTTPS
A
lock
( ) or https:// means you’ve safely connected to
the .gov website. Share sensitive information only on official,
secure websites.
Isis 3 Programmer Reference
|
Stretch image edit tool. More...
#include <StretchTool.h>
Public Types | |
enum | StretchBand { Gray , Red , Green , Blue , All } |
Enum to store the bands. More... | |
Public Slots | |
void | stretchGlobal () |
Does a global stretch for the active viewport. | |
void | stretchGlobal (CubeViewport *) |
Does a global stretch for the specified viewport. | |
void | stretchGlobalAllBands () |
This resets the stretch across all bands. | |
void | stretchGlobalAllViewports () |
Does a global stretch for all the viewports. | |
void | stretchRegional () |
Does a regional stretch for the active viewport. | |
void | stretchRegional (CubeViewport *) |
Does a regional stretch for the specified viewport. | |
void | activate (bool) |
Activates the tool. | |
void | setCubeViewport (MdiCubeViewport *cvp) |
Sets the current viewport to the given cvp. | |
Signals | |
void | stretchChipViewport (Stretch *, CubeViewport *) |
when a viewport is stretched, send the stretch and the viewport associated with it to any ChipViewport's that might be listening | |
void | warningSignal (std::string &pStr, const std::string pExStr) |
Shows a warning. | |
void | clearWarningSignal () |
void | toolActivated () |
void | viewportChanged () |
Public Member Functions | |
StretchTool (QWidget *parent) | |
StretchTool constructor. | |
~StretchTool () | |
Destructor. | |
void | addTo (QMenu *menu) |
Adds the stretch action to the given menu. | |
void | updateAdvStretchDialogforAll (void) |
Update the streches and corresponding histograms for all the colors Red, Green and Blue for Stretch All Mode. | |
QString | menuName () const |
This let's Tool know which Menu the actions this class has should be added to. | |
void | addTo (ViewportMainWindow *mw) |
Adds the tool to the application. | |
void | addTo (ToolPad *toolpad) |
Adds the tool to the toolpad. | |
virtual void | addTo (Workspace *ws) |
Adds the given workspace to the cubeviewport list. | |
virtual void | addToPermanent (QToolBar *toolbar) |
void | addToActive (QToolBar *toolbar) |
QString | toolIconDir () const |
returns the path to the icon directory. | |
virtual void | paintViewport (MdiCubeViewport *vp, QPainter *painter) |
RubberBandTool * | rubberBandTool () |
void | setList (ToolList *currentList) |
Static Public Member Functions | |
static Stretch | stretchBuffer (ViewportBuffer *buffer, QRect rect) |
This method computes the stretch over a region using the viewport buffer. | |
static Stretch | stretchBand (CubeViewport *cvp, StretchBand band) |
This method computes the stretch over the entire cube. | |
static Statistics | statsFromCube (Cube *cube, int band) |
This method will calculate and return the statistics for a given cube and band. | |
static Statistics | statsFromBuffer (ViewportBuffer *buffer, QRect rect) |
This method will calculate and return the statistics for a given region and viewport buffer. | |
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. | |
static Histogram | histFromBuffer (ViewportBuffer *buffer) |
Given a viewport buffer, this calculates a histogram. | |
static Histogram | histFromBuffer (ViewportBuffer *buffer, QRect rect, double min, double max) |
This method will calculate and return the histogram for a given region and viewport buffer. | |
Protected Types | |
typedef QVector< MdiCubeViewport * > | CubeViewportList |
A list of cubeviewports. | |
Protected Slots | |
void | mouseButtonRelease (QPoint p, Qt::MouseButton s) |
This method will call a global stretch if the right mouse button is released. | |
void | saveStretchToCube () |
Saves a strech to the cube. | |
void | deleteFromCube () |
Deletes a saved stretch from the cube. | |
void | loadStretchFromCube () |
Restores a saved stretch from the cube. | |
void | enableRubberBandTool () |
This method enables the RubberBandTool. | |
void | screenPixelsChanged () |
This is called when the visible area changes. | |
void | updateHistograms () |
This updates the visible histograms in the advanced stretch, if present. | |
void | rubberBandComplete () |
This method is called when the RubberBandTool is complete. | |
void | setCubeViewport (CubeViewport *) |
This updates the advanced stretch to use the given viewport. | |
virtual void | mouseEnter () |
virtual void | mouseMove (QPoint p) |
virtual void | mouseMove (QPoint p, Qt::MouseButton) |
virtual void | mouseLeave () |
Protected Member Functions | |
QAction * | toolPadAction (ToolPad *pad) |
Adds the stretch action to the toolpad. | |
QWidget * | createToolBarWidget (QStackedWidget *parent) |
Creates the widget to add to the tool bar. | |
void | updateTool () |
Updates the stretch tool. | |
void | stretchRequested (MdiCubeViewport *cvp, int bandId) |
The cube viewport requested a stretch at this time, give it to the viewport. | |
virtual void | mouseDoubleClick (QPoint p) |
virtual void | mouseButtonPress (QPoint p, Qt::MouseButton s) |
virtual void | updateMeasure () |
virtual void | scaleChanged () |
void | registerTool (MdiCubeViewport *viewport) |
Registers the tool to the viewport. | |
MdiCubeViewport * | cubeViewport () const |
Return the current cubeviewport. | |
CubeViewportList * | cubeViewportList () const |
Return the list of cubeviewports. | |
virtual void | addConnections (MdiCubeViewport *cvp) |
Anytime a tool is created, you must add the connections for it. | |
virtual void | removeConnections (MdiCubeViewport *cvp) |
Anytime a tool is created, you must be able to remove it's connections. | |
Workspace * | workspace () |
Private Slots | |
void | stretchChanged () |
This method is called when the stretch has changed and sets the min/max text fields to the correct values. | |
void | advancedStretchChanged () |
This is called when one of the advanced stretches changed. | |
void | changeStretch (bool useMinMaxTypeSelection=false) |
This method is called when the stretch has changed and sets the min/max text fields to the correct values. | |
void | showAdvancedDialog () |
This methods shows and updates the advanced dialog. | |
void | setStretchAcrossBands () |
Sets the stretch for all the bands in the active viewport to the current stretch. | |
void | setStretchAllViewports () |
Sets the stretch for all the viewports to the current stretch in the active viewport. | |
void | stretchBandChanged (int) |
The selected band for stretching changed. | |
Private Member Functions | |
void | stretchRect (CubeViewport *cvp, QRect rect) |
stretch the specified CubeViewport with the given rect | |
void | stretchMinMaxType (CubeViewport *cvp) |
Sets stretch for current band in active viewport given the min/max type selection. | |
void | addViewportConnections () |
Makes all the connections for the tool. | |
void | removeViewportConnections () |
Removes all the connections from the tool. | |
void | enableToolBar () |
Enables entire tool bar. | |
void | disableToolBar () |
Disables entire tool bar. | |
Private Attributes | |
AdvancedStretchDialog * | m_advancedStretch |
The advanced dialog. | |
QToolButton * | m_copyButton |
Copy Button. | |
QToolButton * | m_globalButton |
Global Button. | |
QToolButton * | m_stretchRegionalButton |
Regional Stretch Button. | |
QPushButton * | m_flashButton |
Button to press for global stretch. | |
QAction * | m_stretchGlobal |
Global stretch action. | |
QAction * | m_stretchRegional |
Regional stretch action. | |
QAction * | m_stretchManual |
Manual stretch action. | |
QAction * | m_copyBands |
Copy band stretch action. | |
QComboBox * | m_stretchBandComboBox |
Stretch combo box. | |
QComboBox * | p_minMaxTypeSelection |
Min/Max type combo box. | |
QLineEdit * | m_stretchMinEdit |
Min. line edit. | |
QLineEdit * | m_stretchMaxEdit |
Max. line edit. | |
StretchBand | m_stretchBand |
Current stretch band. | |
Stretch * | m_preGlobalStretches |
Stretches before global button pressed. | |
Stretch * | m_chipViewportStretch |
ChipViewport's stretch. | |
MdiCubeViewport * | m_cvp |
current cubeviewport | |
Workspace * | m_workspace |
bool | m_active |
Is the tool acitve? | |
QWidget * | m_toolBarWidget |
The tool bar on which this tool resides. | |
QAction * | m_toolPadAction |
The tool pad on which this tool resides. | |
QString | m_toolIconDir |
The pathway to the icon directory. | |
ToolList * | m_toolList |
Stretch image edit tool.
This tool is part of the Qisis namespace and allows interactive editing of displayed images.
2008-05-23 Noah Hilt - Added RubberBandTool
2010-03-18 Sharmila Prasad - Exception handling and emit warning signal to the Viewportwindow to display warning status on the status bar(Track Tool)
2010-04-08 Steven Lambright - Made to work with threaded viewportbuffer and also removed map to viewport stretches due to synchronization problems.
2010-04-08 Steven Lambright - Fixed access of viewport data for statistics
2010-05-20 Steven Lambright - Re-enabled the advanced stretch... without a viewport map!
2010-06-26 Eric Hyer
2010-08-30 Eric Hyer
2010-11-22 Eric Hyer - new SIGNAL called stretchChipViewport exists for sending stretches made in CubeViewports to any ChipViewports that want to get stretched.
2010-12-01 Steven Lambright - Improved stretch copy abilities
2010-12-02 Eric Hyer - changed where stretchChipViewport is emitted.
2011-03-22 Sharmila Prasad - Add option to stretch All Bands
2011-11-04 Steven Lambright - Improved advanced stretch to allow all stretches to be changed despite combo box. References #567.
2012-01-18 Steven Lambright - Fixed a bug that caused the stretch pair line edits to not update properly in grey mode when the color mode band selection was set to all. Also, fixed layout of stretch options to correctly squeeze widgets left. Fixes #640.
2012-06-11 Steven Lambright - Fixed a bug that caused the stretch pair line edits to not update properly when switching between viewports, and another that caused the stretch to be copied the new viewport if the advanced stretch dialog is active. Fixes #771.
2015-08-07 Makayla Shepherd - No longer crashes when the user attempts to apply a stretch while the cube is still loading. This crash was caused by an unhandled exception being thrown in a connected slot. Fixes #2117.
Definition at line 85 of file StretchTool.h.
|
protectedinherited |
Enum to store the bands.
Enumerator | |
---|---|
Gray | Gray Band. |
Red | Red Band. |
Green | Green Band. |
Blue | Blue Band. |
All | All Bands. |
Definition at line 96 of file StretchTool.h.
Isis::StretchTool::StretchTool | ( | QWidget * | parent | ) |
StretchTool constructor.
parent |
Definition at line 48 of file StretchTool.cpp.
References advancedStretchChanged(), deleteFromCube(), loadStretchFromCube(), m_advancedStretch, m_chipViewportStretch, m_preGlobalStretches, m_stretchGlobal, m_stretchRegional, saveStretchToCube(), stretchChanged(), stretchGlobal(), stretchRegional(), Isis::Tool::Tool(), updateTool(), and warningSignal().
Isis::StretchTool::~StretchTool | ( | ) |
Destructor.
Definition at line 94 of file StretchTool.cpp.
References m_chipViewportStretch, and m_preGlobalStretches.
|
slotinherited |
Activates the tool.
on |
Definition at line 131 of file Tool.cpp.
References addViewportConnections(), disableToolBar(), enableToolBar(), m_active, m_toolPadAction, and removeViewportConnections().
Referenced by addTo(), Isis::AdvancedTrackTool::AdvancedTrackTool(), Isis::RubberBandTool::disable(), Isis::RubberBandTool::enable(), Isis::AdvancedTrackTool::eventFilter(), Isis::FileTool::FileTool(), Isis::RubberBandTool::RubberBandTool(), Isis::TrackTool::TrackTool(), Isis::WindowTool::WindowTool(), and Isis::Workspace::Workspace().
|
inlineprotectedvirtualinherited |
Anytime a tool is created, you must add the connections for it.
cvp |
Reimplemented in Isis::TrackTool, and Isis::WindowTool.
Definition at line 239 of file Tool.h.
Referenced by addViewportConnections().
|
virtual |
Adds the stretch action to the given menu.
menu |
Reimplemented from Isis::Tool.
Definition at line 131 of file StretchTool.cpp.
References m_stretchGlobal, and m_stretchRegional.
|
inherited |
Adds the tool to the toolpad.
toolpad |
Definition at line 98 of file Tool.cpp.
References activate(), Isis::ToolPad::addAction(), m_toolPadAction, and toolPadAction().
|
inherited |
Adds the tool to the application.
pViewPortMnWin |
Definition at line 78 of file Tool.cpp.
References Isis::ViewportMainWindow::activeToolBar(), addTo(), addToActive(), addToPermanent(), Isis::ViewportMainWindow::getMenu(), menuName(), Isis::ViewportMainWindow::permanentToolBar(), Isis::ViewportMainWindow::toolPad(), and Isis::ViewportMainWindow::workspace().
Referenced by Isis::EditTool::addTo(), Isis::FileTool::addTo(), Isis::SpecialPixelTool::addTo(), addTo(), Isis::WindowTool::addTo(), and Isis::Workspace::Workspace().
|
virtualinherited |
Adds the given workspace to the cubeviewport list.
ws |
Reimplemented in Isis::EditTool, Isis::FileTool, Isis::SpecialPixelTool, and Isis::WindowTool.
Definition at line 45 of file Tool.cpp.
References registerTool(), and setCubeViewport().
|
inherited |
toolbar |
Definition at line 112 of file Tool.cpp.
References createToolBarWidget(), disableToolBar(), and m_toolBarWidget.
Referenced by addTo(), and Isis::Workspace::Workspace().
|
inlinevirtualinherited |
toolbar |
Reimplemented in Isis::AdvancedTrackTool, Isis::BlinkTool, Isis::FileTool, Isis::HelpTool, Isis::SpecialPixelTool, and Isis::WindowTool.
Definition at line 97 of file Tool.h.
Referenced by addTo(), and Isis::Workspace::Workspace().
|
privateinherited |
Makes all the connections for the tool.
Definition at line 187 of file Tool.cpp.
References addConnections(), enableRubberBandTool(), m_cvp, m_toolPadAction, mouseButtonPress(), mouseButtonRelease(), mouseDoubleClick(), mouseMove(), and screenPixelsChanged().
Referenced by activate(), and setCubeViewport().
|
privateslot |
This is called when one of the advanced stretches changed.
Give the stretch to the viewport.
Definition at line 1021 of file StretchTool.cpp.
References Isis::CubeViewport::blueStretch(), Isis::Stretch::ClearPairs(), Isis::Stretch::CopyPairs(), Isis::Tool::cubeViewport(), Isis::CubeViewport::grayStretch(), Isis::CubeViewport::greenStretch(), m_advancedStretch, m_chipViewportStretch, Isis::CubeViewport::redStretch(), Isis::CubeViewport::stretchBlue(), stretchChanged(), stretchChipViewport(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), and Isis::CubeViewport::stretchRed().
Referenced by StretchTool().
|
privateslot |
This method is called when the stretch has changed and sets the min/max text fields to the correct values.
Does not effect All as the min/max lineedits are hidden for this option
Definition at line 1061 of file StretchTool.cpp.
References Isis::Stretch::AddPair(), Blue, Isis::CubeViewport::blueStretch(), Isis::Stretch::ClearPairs(), Isis::Tool::cubeViewport(), Isis::CubeViewport::grayStretch(), Green, Isis::CubeViewport::greenStretch(), Isis::CubeViewport::isGray(), m_chipViewportStretch, m_stretchBand, m_stretchMaxEdit, m_stretchMinEdit, Red, Isis::CubeViewport::redStretch(), Isis::CubeViewport::stretchBlue(), stretchChanged(), stretchChipViewport(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), stretchMinMaxType(), Isis::CubeViewport::stretchRed(), and updateTool().
Referenced by createToolBarWidget().
|
protectedvirtual |
Creates the widget to add to the tool bar.
parent |
Reimplemented from Isis::Tool.
Definition at line 145 of file StretchTool.cpp.
References All, Blue, changeStretch(), deleteFromCube(), Green, loadStretchFromCube(), m_copyBands, m_copyButton, m_flashButton, m_globalButton, m_stretchBand, m_stretchBandComboBox, m_stretchMaxEdit, m_stretchMinEdit, m_stretchRegionalButton, p_minMaxTypeSelection, Red, saveStretchToCube(), setStretchAcrossBands(), setStretchAllViewports(), showAdvancedDialog(), stretchBandChanged(), stretchChanged(), stretchGlobal(), stretchGlobalAllBands(), stretchGlobalAllViewports(), stretchRegional(), and Isis::Tool::toolIconDir().
|
inlineprotectedinherited |
Return the current cubeviewport.
Definition at line 197 of file Tool.h.
References m_cvp.
Referenced by Isis::TrackTool::addConnections(), Isis::WindowTool::addConnections(), Isis::StretchTool::advancedStretchChanged(), Isis::FindTool::centerLinkedViewports(), Isis::StretchTool::changeStretch(), Isis::BandTool::changeView(), Isis::BandTool::copyLinkedViewports(), Isis::StretchTool::deleteFromCube(), Isis::FileTool::discard(), enableToolBar(), Isis::FileTool::exportToList(), Isis::FileTool::exportView(), Isis::StatisticsTool::getStatistics(), Isis::FindTool::handleRecordClicked(), Isis::EditTool::LineToPoints(), Isis::StretchTool::loadStretchFromCube(), Isis::TrackTool::locateCursor(), Isis::SunShadowTool::mouseButtonPress(), Isis::ControlNetTool::mouseButtonRelease(), Isis::EditTool::mouseButtonRelease(), Isis::FeatureNomenclatureTool::mouseButtonRelease(), Isis::FindTool::mouseButtonRelease(), Isis::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::RubberBandTool::mouseButtonRelease(), Isis::StretchTool::mouseButtonRelease(), Isis::AdvancedTrackTool::mouseLeave(), Isis::RubberBandTool::mouseMove(), Isis::ScatterPlotTool::mouseMove(), Isis::SunShadowTool::mouseMove(), Isis::TrackTool::mouseMove(), Isis::FindTool::paintViewport(), Isis::LatLonGridTool::paintViewport(), Isis::RubberBandTool::paintViewport(), Isis::SunShadowTool::paintViewport(), Isis::FileTool::print(), Isis::SunShadowTool::recalculateShadowHeight(), Isis::EditTool::redoEdit(), Isis::FindTool::refresh(), Isis::HistogramTool::refreshPlot(), Isis::SpatialPlotTool::refreshPlot(), Isis::SpectralPlotTool::refreshPlot(), Isis::TrackTool::removeConnections(), Isis::WindowTool::removeConnections(), Isis::RubberBandTool::repaint(), Isis::WindowTool::resizeWindows(), Isis::EditTool::rubberBandComplete(), Isis::HistogramTool::rubberBandComplete(), Isis::MeasureTool::rubberBandComplete(), Isis::StretchTool::rubberBandComplete(), Isis::ZoomTool::rubberBandComplete(), Isis::FileTool::save(), Isis::FileTool::saveAs(), Isis::FileTool::saveAsCubeByOption(), Isis::FileTool::saveAsReducedCube(), Isis::FileTool::saveInfo(), Isis::StretchTool::saveStretchToCube(), Isis::BandTool::setBandBin(), Isis::BandTool::setList(), Isis::StretchTool::setStretchAcrossBands(), Isis::StretchTool::setStretchAllViewports(), Isis::StretchTool::showAdvancedDialog(), Isis::ScatterPlotTool::showNewScatterPlotConfig(), Isis::StretchTool::stretchChanged(), Isis::StretchTool::stretchGlobal(), Isis::StretchTool::stretchGlobalAllBands(), Isis::StretchTool::stretchRegional(), Isis::EditTool::undoEdit(), Isis::StretchTool::updateAdvStretchDialogforAll(), Isis::StretchTool::updateHistograms(), Isis::TrackTool::updateLabels(), Isis::MeasureTool::updateMeasure(), Isis::AdvancedTrackTool::updateRow(), Isis::AdvancedTrackTool::updateRow(), Isis::AbstractPlotTool::updateTool(), Isis::BandTool::updateTool(), Isis::BlinkTool::updateTool(), Isis::EditTool::updateTool(), Isis::FileTool::updateTool(), Isis::FindTool::updateTool(), Isis::LatLonGridTool::updateTool(), Isis::SpecialPixelTool::updateTool(), Isis::StretchTool::updateTool(), Isis::SunShadowTool::updateTool(), Isis::WindowTool::updateTool(), Isis::ZoomTool::updateTool(), Isis::AbstractPlotTool::viewportsToPlot(), Isis::EditTool::writeToCube(), Isis::ZoomTool::zoomBy(), Isis::ZoomTool::zoomFit(), Isis::ZoomTool::zoomFitHeight(), Isis::ZoomTool::zoomFitWidth(), and Isis::ZoomTool::zoomManual().
|
protectedinherited |
Return the list of cubeviewports.
Definition at line 390 of file Tool.cpp.
Referenced by Isis::BlinkTool::advance(), Isis::SpecialPixelTool::apply(), Isis::FindTool::centerLinkedViewports(), Isis::WindowTool::changeCursor(), Isis::FileTool::closeAll(), Isis::BandTool::copyAllViewports(), Isis::BandTool::copyLinkedViewports(), Isis::MatchTool::createPoint(), Isis::BlinkTool::eventFilter(), Isis::FeatureNomenclatureTool::featuresIdentified(), Isis::FeatureNomenclatureTool::findMissingNomenclature(), Isis::FeatureNomenclatureTool::findNomenclatureStateChanged(), Isis::FindTool::handleLinkClicked(), Isis::WindowTool::linkWindows(), Isis::RubberBandTool::mouseButtonRelease(), Isis::RubberBandTool::mouseMove(), Isis::QnetTool::openGround(), Isis::ControlNetTool::paintAllViewports(), Isis::MatchTool::paintAllViewports(), Isis::QnetTool::paintAllViewports(), Isis::StereoTool::paintAllViewports(), Isis::FindTool::refresh(), Isis::AbstractPlotTool::repaintViewports(), Isis::AbstractPlotTool::repaintViewports(), Isis::ScatterPlotTool::repaintViewports(), Isis::WindowTool::resizeWindows(), Isis::BlinkTool::reverse(), Isis::ZoomTool::rubberBandComplete(), Isis::MatchTool::serialNumberList(), Isis::ControlNetTool::setControlNet(), Isis::FeatureNomenclatureTool::setFontColor(), Isis::FeatureNomenclatureTool::setFontSize(), Isis::FeatureNomenclatureTool::setShowApprovedOnly(), Isis::StretchTool::setStretchAllViewports(), Isis::FeatureNomenclatureTool::setVectorType(), Isis::StretchTool::stretchGlobalAllViewports(), Isis::BlinkTool::toggleLink(), Isis::WindowTool::unlinkWindows(), Isis::MeasureTool::updateMeasure(), Isis::AdvancedTrackTool::updateRow(), Isis::BlinkTool::updateTool(), Isis::FindTool::updateTool(), Isis::WindowTool::updateTool(), Isis::AbstractPlotTool::viewportsToPlot(), Isis::ZoomTool::zoomBy(), Isis::ZoomTool::zoomFit(), Isis::ZoomTool::zoomFitHeight(), Isis::ZoomTool::zoomFitWidth(), and Isis::ZoomTool::zoomManual().
|
protectedslot |
Deletes a saved stretch from the cube.
Definition at line 554 of file StretchTool.cpp.
References Isis::PvlObject::beginObject(), Isis::CubeViewport::cube(), Isis::Tool::cubeViewport(), Isis::Cube::deleteBlob(), Isis::CubeViewport::grayBand(), Isis::Cube::isReadOnly(), Isis::Cube::label(), and Isis::Cube::reopen().
Referenced by createToolBarWidget(), and StretchTool().
|
privateinherited |
Disables entire tool bar.
Definition at line 285 of file Tool.cpp.
References m_toolBarWidget.
Referenced by activate(), and addToActive().
|
protectedslot |
This method enables the RubberBandTool.
Definition at line 1366 of file StretchTool.cpp.
Referenced by mouseButtonRelease().
|
privateinherited |
Enables entire tool bar.
Definition at line 297 of file Tool.cpp.
References cubeViewport(), m_toolBarWidget, and updateTool().
Referenced by activate(), and setCubeViewport().
|
static |
Given a viewport buffer, this calculates a histogram.
buffer |
Definition at line 1625 of file StretchTool.cpp.
References Isis::Statistics::BestMaximum(), Isis::Statistics::BestMinimum(), Isis::ViewportBuffer::bufferXYRect(), histFromBuffer(), and statsFromBuffer().
Referenced by histFromBuffer(), setCubeViewport(), stretchBuffer(), updateAdvStretchDialogforAll(), and updateHistograms().
|
static |
This method will calculate and return the histogram for a given region and viewport buffer.
buffer | |
rect | |
min | |
max |
Definition at line 1644 of file StretchTool.cpp.
References Isis::Histogram::AddData(), Isis::ViewportBuffer::bufferXYRect(), Isis::ViewportBuffer::getLine(), and Isis::IException::Unknown.
This method will calculate and return the histogram for a given cube and band.
cube | |
band | |
min | |
max |
Definition at line 1603 of file StretchTool.cpp.
References Isis::Histogram::AddData(), Isis::Buffer::DoubleBuffer(), Isis::Cube::lineCount(), Isis::Cube::pixelType(), Isis::Cube::read(), Isis::Cube::sampleCount(), and Isis::Brick::SetBasePosition().
Referenced by stretchBand(), and stretchMinMaxType().
|
protectedslot |
Restores a saved stretch from the cube.
Definition at line 434 of file StretchTool.cpp.
References Isis::PvlObject::beginObject(), Isis::CubeViewport::blueBand(), Isis::CubeViewport::blueStretch(), Isis::Stretch::CopyPairs(), Isis::CubeViewport::cube(), Isis::Tool::cubeViewport(), Isis::CubeViewport::grayBand(), Isis::CubeViewport::grayStretch(), Isis::CubeViewport::greenBand(), Isis::CubeViewport::greenStretch(), Isis::CubeViewport::isGray(), Isis::Cube::label(), m_advancedStretch, Isis::Cube::readCubeStretch(), Isis::CubeViewport::redBand(), Isis::CubeViewport::redStretch(), Isis::CubeViewport::stretchBlue(), stretchChanged(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), and Isis::CubeViewport::stretchRed().
Referenced by createToolBarWidget(), and StretchTool().
|
inlinevirtual |
This let's Tool know which Menu the actions this class has should be added to.
Removal of this results in "Ctrl+R" and "Ctrl+G" not working.
Reimplemented from Isis::Tool.
Definition at line 123 of file StretchTool.h.
|
protectedvirtualinherited |
p | |
s |
Definition at line 367 of file Tool.cpp.
Referenced by addViewportConnections(), and removeViewportConnections().
|
protectedslot |
This method will call a global stretch if the right mouse button is released.
start | |
s |
Definition at line 1342 of file StretchTool.cpp.
References Isis::Tool::cubeViewport(), enableRubberBandTool(), Isis::Tool::mouseButtonRelease(), stretchChipViewport(), and stretchGlobal().
|
protectedvirtualinherited |
p |
Definition at line 358 of file Tool.cpp.
Referenced by addViewportConnections(), and removeViewportConnections().
|
inlineprotectedvirtualslotinherited |
|
inlineprotectedvirtualslotinherited |
|
protectedvirtualslotinherited |
p |
Definition at line 352 of file Tool.cpp.
Referenced by addViewportConnections(), and removeViewportConnections().
|
inlineprotectedvirtualslotinherited |
|
inlinevirtualinherited |
vp | |
painter |
Reimplemented in Isis::AbstractPlotTool, Isis::ControlNetTool, Isis::FeatureNomenclatureTool, Isis::FindTool, Isis::LatLonGridTool, Isis::MatchTool, Isis::QnetTool, Isis::RubberBandTool, Isis::ScatterPlotTool, Isis::StereoTool, and Isis::SunShadowTool.
|
protectedinherited |
Registers the tool to the viewport.
viewport |
Definition at line 327 of file Tool.cpp.
References m_cvp, and Isis::MdiCubeViewport::registerTool().
Referenced by addTo().
|
inlineprotectedvirtualinherited |
Anytime a tool is created, you must be able to remove it's connections.
cvp |
Reimplemented in Isis::MeasureTool, Isis::TrackTool, and Isis::WindowTool.
Definition at line 247 of file Tool.h.
Referenced by removeViewportConnections().
|
privateinherited |
Removes all the connections from the tool.
Definition at line 238 of file Tool.cpp.
References m_cvp, mouseButtonPress(), mouseButtonRelease(), mouseDoubleClick(), mouseMove(), removeConnections(), and screenPixelsChanged().
Referenced by activate(), and setCubeViewport().
|
protectedslot |
This method is called when the RubberBandTool is complete.
It will get a rectangle from the RubberBandTool and stretch accordingly.
Definition at line 1273 of file StretchTool.cpp.
References Isis::Tool::cubeViewport(), and stretchRect().
|
inherited |
|
protectedslot |
Saves a strech to the cube.
Definition at line 620 of file StretchTool.cpp.
References Isis::PvlObject::beginObject(), Isis::CubeViewport::blueBand(), Isis::CubeViewport::blueStretch(), Isis::CubeViewport::cube(), Isis::Tool::cubeViewport(), Isis::CubeViewport::grayBand(), Isis::CubeViewport::grayStretch(), Isis::CubeViewport::greenBand(), Isis::CubeViewport::greenStretch(), Isis::CubeViewport::isGray(), Isis::Cube::isReadOnly(), Isis::Cube::label(), m_advancedStretch, Isis::CubeViewport::redBand(), Isis::CubeViewport::redStretch(), Isis::Cube::reopen(), Isis::CubeStretch::setBandNumber(), Isis::CubeStretch::setName(), Isis::CubeStretch::toBlob(), and Isis::Cube::write().
Referenced by createToolBarWidget(), and StretchTool().
|
inlineprotectedvirtualinherited |
|
protectedslot |
This is called when the visible area changes.
Definition at line 774 of file StretchTool.cpp.
References updateHistograms().
Referenced by stretchRequested().
|
protectedslot |
This updates the advanced stretch to use the given viewport.
cvp |
Definition at line 784 of file StretchTool.cpp.
References Isis::CubeViewport::blueBuffer(), Isis::CubeViewport::blueStretch(), Isis::CubeViewport::grayBuffer(), Isis::CubeViewport::grayStretch(), Isis::CubeViewport::greenBuffer(), Isis::CubeViewport::greenStretch(), histFromBuffer(), Isis::CubeViewport::isGray(), m_advancedStretch, Isis::CubeViewport::redBuffer(), Isis::CubeViewport::redStretch(), and Isis::ViewportBuffer::working().
Referenced by updateTool().
|
slotinherited |
Sets the current viewport to the given cvp.
cvp |
Definition at line 160 of file Tool.cpp.
References addViewportConnections(), enableToolBar(), m_active, m_cvp, removeViewportConnections(), and updateTool().
Referenced by addTo(), and Isis::FileTool::closeAll().
|
inherited |
|
privateslot |
Sets the stretch for all the bands in the active viewport to the current stretch.
Definition at line 1377 of file StretchTool.cpp.
References Isis::Stretch::AddPair(), Blue, Isis::CubeViewport::blueStretch(), Isis::Stretch::ClearPairs(), Isis::Tool::cubeViewport(), Isis::CubeViewport::grayStretch(), Green, Isis::CubeViewport::greenStretch(), Isis::CubeViewport::isGray(), m_stretchBand, m_stretchMaxEdit, m_stretchMinEdit, Red, Isis::CubeViewport::redStretch(), Isis::CubeViewport::setAllBandStretches(), Isis::CubeViewport::stretchBlue(), Isis::CubeViewport::stretchGreen(), and Isis::CubeViewport::stretchRed().
Referenced by createToolBarWidget().
|
privateslot |
Sets the stretch for all the viewports to the current stretch in the active viewport.
Definition at line 1428 of file StretchTool.cpp.
References Isis::CubeViewport::blueStretch(), Isis::Stretch::CopyPairs(), Isis::Tool::cubeViewport(), Isis::Tool::cubeViewportList(), Isis::CubeViewport::grayStretch(), Isis::CubeViewport::greenStretch(), Isis::CubeViewport::isGray(), Isis::CubeViewport::redStretch(), Isis::CubeViewport::stretchBlue(), stretchChanged(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), and Isis::CubeViewport::stretchRed().
Referenced by createToolBarWidget().
|
privateslot |
This methods shows and updates the advanced dialog.
Definition at line 1180 of file StretchTool.cpp.
References Isis::Tool::cubeViewport(), m_advancedStretch, and updateTool().
Referenced by createToolBarWidget().
|
static |
This method will calculate and return the statistics for a given region and viewport buffer.
buffer | |
rect |
Definition at line 1568 of file StretchTool.cpp.
References Isis::Statistics::AddData(), Isis::ViewportBuffer::bufferXYRect(), Isis::ViewportBuffer::getLine(), Isis::IException::User, and Isis::ViewportBuffer::working().
Referenced by histFromBuffer(), and stretchBuffer().
|
static |
This method will calculate and return the statistics for a given cube and band.
cube | |
band |
Definition at line 1545 of file StretchTool.cpp.
References Isis::Statistics::AddData(), Isis::Buffer::DoubleBuffer(), Isis::Cube::lineCount(), Isis::Cube::pixelType(), Isis::Cube::read(), Isis::Cube::sampleCount(), and Isis::Brick::SetBasePosition().
Referenced by stretchBand(), and stretchMinMaxType().
|
static |
This method computes the stretch over the entire cube.
cvp | |
band | Band to stretch |
Definition at line 1502 of file StretchTool.cpp.
References Isis::Stretch::AddPair(), Isis::Statistics::BestMaximum(), Isis::Statistics::BestMinimum(), Blue, Isis::CubeViewport::blueBand(), Isis::CubeViewport::blueStretch(), Isis::Stretch::ClearPairs(), Isis::CubeViewport::cube(), Isis::CubeViewport::grayBand(), Isis::CubeViewport::grayStretch(), Green, Isis::CubeViewport::greenBand(), Isis::CubeViewport::greenStretch(), histFromCube(), Isis::Histogram::Percent(), Red, Isis::CubeViewport::redBand(), Isis::CubeViewport::redStretch(), and statsFromCube().
Referenced by Isis::IndependentCubeViewport::restretch(), and stretchRequested().
|
privateslot |
The selected band for stretching changed.
Definition at line 1677 of file StretchTool.cpp.
References All, m_stretchBand, m_stretchBandComboBox, m_stretchMaxEdit, m_stretchMinEdit, and stretchChanged().
Referenced by createToolBarWidget(), and updateTool().
|
static |
This method computes the stretch over a region using the viewport buffer.
buffer | |
rect |
Definition at line 1472 of file StretchTool.cpp.
References Isis::Stretch::AddPair(), Isis::Statistics::BestMaximum(), Isis::Statistics::BestMinimum(), histFromBuffer(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::Stretch::Pairs(), Isis::Histogram::Percent(), statsFromBuffer(), and Isis::Statistics::ValidPixels().
Referenced by stretchRect(), and stretchRequested().
|
privateslot |
This method is called when the stretch has changed and sets the min/max text fields to the correct values.
Definition at line 937 of file StretchTool.cpp.
References All, Blue, Isis::CubeViewport::blueStretch(), Isis::Tool::cubeViewport(), Isis::CubeViewport::grayStretch(), Green, Isis::CubeViewport::greenStretch(), Isis::Stretch::Input(), Isis::CubeViewport::isGray(), m_advancedStretch, m_flashButton, m_preGlobalStretches, m_stretchBand, m_stretchMaxEdit, m_stretchMinEdit, Isis::Stretch::Pairs(), Red, Isis::CubeViewport::redStretch(), Isis::CubeViewport::stretchBlue(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), Isis::CubeViewport::stretchKnownGlobal(), Isis::CubeViewport::stretchRed(), and updateAdvStretchDialogforAll().
Referenced by advancedStretchChanged(), changeStretch(), createToolBarWidget(), loadStretchFromCube(), setStretchAllViewports(), stretchBandChanged(), stretchGlobal(), stretchRect(), stretchRequested(), StretchTool(), and updateTool().
|
signal |
when a viewport is stretched, send the stretch and the viewport associated with it to any ChipViewport's that might be listening
Referenced by advancedStretchChanged(), changeStretch(), mouseButtonRelease(), and stretchRect().
|
slot |
Does a global stretch for the active viewport.
Definition at line 1195 of file StretchTool.cpp.
References Isis::Tool::cubeViewport(), and stretchGlobal().
Referenced by createToolBarWidget(), mouseButtonRelease(), stretchGlobal(), stretchGlobalAllBands(), stretchGlobalAllViewports(), and StretchTool().
|
slot |
Does a global stretch for the specified viewport.
Definition at line 1219 of file StretchTool.cpp.
References stretchChanged(), and Isis::CubeViewport::stretchKnownGlobal().
|
slot |
This resets the stretch across all bands.
Definition at line 1206 of file StretchTool.cpp.
References Isis::Tool::cubeViewport(), Isis::CubeViewport::forgetStretches(), and stretchGlobal().
Referenced by createToolBarWidget().
|
slot |
Does a global stretch for all the viewports.
Definition at line 1229 of file StretchTool.cpp.
References Isis::Tool::cubeViewportList(), and stretchGlobal().
Referenced by createToolBarWidget().
|
private |
Sets stretch for current band in active viewport given the min/max type selection.
Definition at line 1127 of file StretchTool.cpp.
References Isis::Statistics::BestMaximum(), Isis::Statistics::BestMinimum(), Blue, Isis::CubeViewport::blueBand(), Isis::Statistics::ChebyshevMaximum(), Isis::Statistics::ChebyshevMinimum(), Isis::CubeViewport::cube(), Isis::CubeViewport::grayBand(), Green, Isis::CubeViewport::greenBand(), histFromCube(), m_stretchBandComboBox, m_stretchMaxEdit, m_stretchMinEdit, Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), p_minMaxTypeSelection, Isis::Histogram::Percent(), Red, Isis::CubeViewport::redBand(), and statsFromCube().
Referenced by changeStretch().
|
private |
stretch the specified CubeViewport with the given rect
cvp | The CubeViewport to stretch |
rect | The rect with which to stretch the CubeViewport |
Definition at line 1292 of file StretchTool.cpp.
References All, Blue, Isis::CubeViewport::blueBuffer(), Isis::CubeViewport::blueStretch(), Isis::Stretch::ClearPairs(), Isis::Stretch::CopyPairs(), Isis::CubeViewport::grayBuffer(), Isis::CubeViewport::grayStretch(), Green, Isis::CubeViewport::greenBuffer(), Isis::CubeViewport::greenStretch(), Isis::CubeViewport::isGray(), m_chipViewportStretch, m_stretchBand, Isis::IException::Programmer, Red, Isis::CubeViewport::redBuffer(), Isis::CubeViewport::redStretch(), Isis::CubeViewport::stretchBlue(), stretchBuffer(), stretchChanged(), stretchChipViewport(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), and Isis::CubeViewport::stretchRed().
Referenced by rubberBandComplete(), and stretchRegional().
|
slot |
Does a regional stretch for the active viewport.
Definition at line 1242 of file StretchTool.cpp.
References Isis::Tool::cubeViewport(), and stretchRegional().
Referenced by createToolBarWidget(), stretchRegional(), and StretchTool().
|
slot |
Does a regional stretch for the specified viewport.
Definition at line 1253 of file StretchTool.cpp.
References stretchRect().
|
protectedvirtual |
The cube viewport requested a stretch at this time, give it to the viewport.
cvp | |
bandId |
Reimplemented from Isis::Tool.
Definition at line 875 of file StretchTool.cpp.
References All, Blue, Isis::CubeViewport::blueBuffer(), Isis::CubeViewport::blueStretch(), Isis::Stretch::CopyPairs(), Gray, Isis::CubeViewport::grayBuffer(), Isis::CubeViewport::grayStretch(), Green, Isis::CubeViewport::greenBuffer(), Isis::CubeViewport::greenStretch(), Isis::ViewportBuffer::hasEntireCube(), Red, Isis::CubeViewport::redBuffer(), Isis::CubeViewport::redStretch(), screenPixelsChanged(), stretchBand(), Isis::CubeViewport::stretchBlue(), stretchBuffer(), stretchChanged(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), Isis::CubeViewport::stretchRed(), and updateHistograms().
|
inlineinherited |
returns the path to the icon directory.
Definition at line 113 of file Tool.h.
References m_toolIconDir.
Referenced by Isis::AdvancedTrackTool::AdvancedTrackTool(), Isis::BlinkTool::BlinkTool(), Isis::MatchTool::createActions(), Isis::QnetTool::createActions(), Isis::StereoTool::createMenus(), Isis::BandTool::createToolBarWidget(), Isis::EditTool::createToolBarWidget(), Isis::FindTool::createToolBarWidget(), Isis::PanTool::createToolBarWidget(), Isis::StereoTool::createToolBarWidget(), Isis::StretchTool::createToolBarWidget(), Isis::ZoomTool::createToolBarWidget(), Isis::FileTool::FileTool(), Isis::FindTool::FindTool(), Isis::HistogramTool::HistogramTool(), Isis::SpecialPixelTool::SpecialPixelTool(), Isis::BandTool::toolPadAction(), Isis::ControlNetTool::toolPadAction(), Isis::EditTool::toolPadAction(), Isis::FeatureNomenclatureTool::toolPadAction(), Isis::FindTool::toolPadAction(), Isis::HistogramTool::toolPadAction(), Isis::LatLonGridTool::toolPadAction(), Isis::MatchTool::toolPadAction(), Isis::MeasureTool::toolPadAction(), Isis::PanTool::toolPadAction(), Isis::QnetTool::toolPadAction(), Isis::ScatterPlotTool::toolPadAction(), Isis::SpatialPlotTool::toolPadAction(), Isis::SpectralPlotTool::toolPadAction(), Isis::StatisticsTool::toolPadAction(), Isis::StereoTool::toolPadAction(), Isis::StretchTool::toolPadAction(), Isis::SunShadowTool::toolPadAction(), Isis::ZoomTool::toolPadAction(), Isis::WindowTool::WindowTool(), and Isis::ZoomTool::ZoomTool().
Adds the stretch action to the toolpad.
pad |
Reimplemented from Isis::Tool.
Definition at line 111 of file StretchTool.cpp.
References Isis::Tool::toolIconDir().
void Isis::StretchTool::updateAdvStretchDialogforAll | ( | void | ) |
Update the streches and corresponding histograms for all the colors Red, Green and Blue for Stretch All Mode.
Definition at line 406 of file StretchTool.cpp.
References Isis::CubeViewport::blueBuffer(), Isis::CubeViewport::blueStretch(), Isis::Tool::cubeViewport(), Isis::CubeViewport::greenBuffer(), Isis::CubeViewport::greenStretch(), histFromBuffer(), Isis::CubeViewport::isGray(), m_advancedStretch, Isis::CubeViewport::redBuffer(), Isis::CubeViewport::redStretch(), and Isis::ViewportBuffer::working().
Referenced by stretchChanged().
|
protectedslot |
This updates the visible histograms in the advanced stretch, if present.
Definition at line 358 of file StretchTool.cpp.
References Isis::CubeViewport::blueBuffer(), Isis::Tool::cubeViewport(), Isis::CubeViewport::grayBuffer(), Isis::CubeViewport::greenBuffer(), histFromBuffer(), Isis::CubeViewport::isGray(), m_advancedStretch, Isis::CubeViewport::redBuffer(), updateTool(), Isis::Statistics::ValidPixels(), and Isis::ViewportBuffer::working().
Referenced by screenPixelsChanged(), stretchRequested(), and updateTool().
|
inlineprotectedvirtualinherited |
|
protectedvirtual |
Updates the stretch tool.
Reimplemented from Isis::Tool.
Definition at line 822 of file StretchTool.cpp.
References Isis::Tool::cubeViewport(), Isis::CubeViewport::isGray(), m_advancedStretch, m_copyBands, m_stretchBandComboBox, m_stretchMaxEdit, m_stretchMinEdit, setCubeViewport(), stretchBandChanged(), stretchChanged(), and updateHistograms().
Referenced by changeStretch(), showAdvancedDialog(), StretchTool(), and updateHistograms().
|
signal |
Shows a warning.
This sends a signal (meant for when an exception occurs) to display the error using the warning object
pStr | |
pExStr |
Referenced by StretchTool().
|
privateinherited |
Is the tool acitve?
Definition at line 264 of file Tool.h.
Referenced by activate(), setCubeViewport(), and Tool().
|
private |
The advanced dialog.
Definition at line 183 of file StretchTool.h.
Referenced by advancedStretchChanged(), loadStretchFromCube(), saveStretchToCube(), setCubeViewport(), showAdvancedDialog(), stretchChanged(), StretchTool(), updateAdvStretchDialogforAll(), updateHistograms(), and updateTool().
|
private |
ChipViewport's stretch.
Definition at line 206 of file StretchTool.h.
Referenced by advancedStretchChanged(), changeStretch(), stretchRect(), StretchTool(), and ~StretchTool().
|
private |
Copy band stretch action.
Definition at line 193 of file StretchTool.h.
Referenced by createToolBarWidget(), and updateTool().
|
private |
|
privateinherited |
current cubeviewport
Definition at line 261 of file Tool.h.
Referenced by addViewportConnections(), cubeViewport(), registerTool(), removeViewportConnections(), setCubeViewport(), and Tool().
|
private |
Button to press for global stretch.
Definition at line 188 of file StretchTool.h.
Referenced by createToolBarWidget(), and stretchChanged().
|
private |
|
private |
Stretches before global button pressed.
Definition at line 204 of file StretchTool.h.
Referenced by stretchChanged(), StretchTool(), and ~StretchTool().
|
private |
Current stretch band.
Definition at line 201 of file StretchTool.h.
Referenced by changeStretch(), createToolBarWidget(), setStretchAcrossBands(), stretchBandChanged(), stretchChanged(), and stretchRect().
|
private |
Stretch combo box.
Definition at line 195 of file StretchTool.h.
Referenced by createToolBarWidget(), stretchBandChanged(), stretchMinMaxType(), and updateTool().
|
private |
Global stretch action.
Definition at line 190 of file StretchTool.h.
Referenced by addTo(), and StretchTool().
|
private |
Manual stretch action.
Definition at line 192 of file StretchTool.h.
|
private |
Max. line edit.
Definition at line 199 of file StretchTool.h.
Referenced by changeStretch(), createToolBarWidget(), setStretchAcrossBands(), stretchBandChanged(), stretchChanged(), stretchMinMaxType(), and updateTool().
|
private |
Min. line edit.
Definition at line 198 of file StretchTool.h.
Referenced by changeStretch(), createToolBarWidget(), setStretchAcrossBands(), stretchBandChanged(), stretchChanged(), stretchMinMaxType(), and updateTool().
|
private |
Regional stretch action.
Definition at line 191 of file StretchTool.h.
Referenced by addTo(), and StretchTool().
|
private |
Regional Stretch Button.
Definition at line 187 of file StretchTool.h.
Referenced by createToolBarWidget().
|
privateinherited |
The tool bar on which this tool resides.
Definition at line 265 of file Tool.h.
Referenced by addToActive(), disableToolBar(), enableToolBar(), and Tool().
|
privateinherited |
The pathway to the icon directory.
Definition at line 267 of file Tool.h.
Referenced by Tool(), and toolIconDir().
|
privateinherited |
The tool pad on which this tool resides.
Definition at line 266 of file Tool.h.
Referenced by activate(), addTo(), addViewportConnections(), and Tool().
|
private |
Min/Max type combo box.
Definition at line 196 of file StretchTool.h.
Referenced by createToolBarWidget(), and stretchMinMaxType().