Isis 3.0 Object Programmers' Reference |
Home |
This handles the advanced sawtooth stretch. More...
#include <SawtoothStretchType.h>
Signals | |
void | stretchChanged () |
Emitted when a new Stretch object is available. | |
Public Member Functions | |
SawtoothStretchType (const Histogram &, const Stretch &, const QString &name, const QColor &color) | |
This initializes a sawtooth stretch type. | |
~SawtoothStretchType () | |
Destructor. | |
virtual void | setStretch (Stretch) |
Given an arbitrary stretch, this will re-interpret it, as best as possible, into a sawtooth stretch. | |
virtual Stretch | getStretch () |
Returns the current stretch object. | |
virtual void | setHistogram (const Histogram &) |
This should be called when the visible area changes. | |
Protected Slots | |
void | updateGraph () |
This updates the graph with the current stretch object. | |
void | updateTable () |
This updates the table with the current stretch pairs. | |
Protected Member Functions | |
QTableWidget * | createStretchTable () |
This creates the stretch pairs table. | |
Protected Attributes | |
QGridLayout * | p_mainLayout |
Main layout. | |
Histogram * | p_cubeHist |
Visible area histogram. | |
QTableWidget * | p_table |
Pairs table. | |
HistogramWidget * | p_graph |
Histogram graph. | |
Stretch * | p_stretch |
Current stretch pairs stored here. | |
Private Slots | |
void | offsetSliderMoved (int) |
This is called when the sawtooth offset slider moves. | |
void | offsetEditChanged (const QString &) |
This is called when the the sawtooth offset edit changes. | |
void | widthSliderMoved (int) |
This is called when the sawtooth width slider moves. | |
void | widthEditChanged (const QString &) |
This is called when the the sawtooth width edit changes. | |
Private Member Functions | |
Stretch | calculateNewStretch () |
This calculates a new stretch using the GUI edits. | |
Stretch | calculateNewStretch (double, double) |
This uses the parameters offset, width to create a sawtooth stretch. | |
Private Attributes | |
QSlider * | p_offsetSlider |
Offset slider. | |
QLineEdit * | p_offsetEdit |
Offset edit. | |
QSlider * | p_widthSlider |
Width slider. | |
QLineEdit * | p_widthEdit |
Width edit. | |
bool | p_sliderOverride |
This is used to let the edits be changed to where sliders cant go. | |
This handles the advanced sawtooth stretch.
The sawtooth stretch is useful for highlighting things like craters. This highlights areas of DNs - for example it can highlight all of the DNs based on how close to the mean they are (user guesses the mean from the histogram). It can also highlight DNs as they differ from the mean. Anyhow, it existed in a form before so this class was needed to encapsulate it. I'm not sure what the original request for this stretch type derived from.
Definition at line 32 of file SawtoothStretchType.h.
Isis::SawtoothStretchType::SawtoothStretchType | ( | const Histogram & | hist, |
const Stretch & | stretch, | ||
const QString & | name, | ||
const QColor & | color | ||
) |
This initializes a sawtooth stretch type.
hist | |
stretch | |
name | |
color |
Definition at line 23 of file SawtoothStretchType.cpp.
References calculateNewStretch(), Isis::Statistics::Maximum(), Isis::Histogram::Median(), Isis::Statistics::Minimum(), offsetEditChanged(), offsetSliderMoved(), Isis::StretchType::p_cubeHist, Isis::StretchType::p_mainLayout, p_offsetEdit, p_offsetSlider, p_sliderOverride, p_widthEdit, p_widthSlider, setStretch(), widthEditChanged(), and widthSliderMoved().
Isis::SawtoothStretchType::~SawtoothStretchType | ( | ) |
Destructor.
Definition at line 86 of file SawtoothStretchType.cpp.
|
private |
This calculates a new stretch using the GUI edits.
Definition at line 310 of file SawtoothStretchType.cpp.
References p_offsetEdit, and p_widthEdit.
Referenced by offsetEditChanged(), SawtoothStretchType(), setStretch(), and widthEditChanged().
|
private |
This uses the parameters offset, width to create a sawtooth stretch.
offset | A pair mapping (offset, 0) will be created (or would if the histogram had the appropriate range) |
width | How wide the sawtooth is |
Definition at line 253 of file SawtoothStretchType.cpp.
References Isis::Stretch::AddPair(), Isis::Histogram::BinSize(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, and Isis::toDouble().
|
protectedinherited |
This creates the stretch pairs table.
Definition at line 103 of file StretchType.cpp.
Referenced by Isis::StretchType::StretchType().
|
virtualinherited |
Returns the current stretch object.
Reimplemented in Isis::LinearStretchType.
Definition at line 183 of file StretchType.cpp.
References Isis::StretchType::p_stretch.
Referenced by Isis::StretchType::savePairs(), and Isis::StretchType::updateTable().
|
privateslot |
This is called when the the sawtooth offset edit changes.
It updates the slider (while blocking the slider from calling this method again) and calculates a new stretch.
Definition at line 174 of file SawtoothStretchType.cpp.
References calculateNewStretch(), Isis::Stretch::CopyPairs(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_offsetEdit, p_offsetSlider, p_sliderOverride, Isis::StretchType::p_stretch, Isis::StretchType::stretchChanged(), and Isis::Stretch::Text().
Referenced by SawtoothStretchType(), and setStretch().
|
privateslot |
This is called when the sawtooth offset slider moves.
It updates the edit.
Definition at line 155 of file SawtoothStretchType.cpp.
References Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_offsetEdit, p_offsetSlider, p_sliderOverride, and p_widthSlider.
Referenced by SawtoothStretchType().
|
virtualinherited |
This should be called when the visible area changes.
It updates the graph and calls setStretch() so that the children have a chance to update their GUI elements too.
hist |
Definition at line 91 of file StretchType.cpp.
References Isis::StretchType::p_cubeHist, Isis::StretchType::p_graph, Isis::StretchType::p_stretch, Isis::HistogramWidget::setHistogram(), and Isis::StretchType::setStretch().
Referenced by Isis::AdvancedStretch::setHistogram().
|
virtual |
Given an arbitrary stretch, this will re-interpret it, as best as possible, into a sawtooth stretch.
It is required that a stretch that represents a sawtooth stretch always translate into itself and does not cause a stretchChanged(). To ensure this the sliders have been restricted to not be ambiguous.
It is necessary to always update slider positions in this method even if the stretch did not change.
newStretch | Stretch to interpret |
Implements Isis::StretchType.
Definition at line 103 of file SawtoothStretchType.cpp.
References Isis::Histogram::BinSize(), calculateNewStretch(), Isis::Stretch::CopyPairs(), Isis::Stretch::Input(), offsetEditChanged(), Isis::Stretch::Output(), Isis::StretchType::p_cubeHist, p_offsetEdit, Isis::StretchType::p_stretch, p_widthEdit, Isis::Stretch::Pairs(), Isis::StretchType::stretchChanged(), and widthEditChanged().
Referenced by SawtoothStretchType().
|
signalinherited |
Emitted when a new Stretch object is available.
Referenced by Isis::BinaryStretchType::endEditChanged(), Isis::LinearStretchType::endEditChanged(), Isis::ManualStretchType::ManualStretchType(), offsetEditChanged(), Isis::LinearStretchType::setStretch(), Isis::BinaryStretchType::setStretch(), Isis::ManualStretchType::setStretch(), setStretch(), Isis::BinaryStretchType::startEditChanged(), Isis::LinearStretchType::startEditChanged(), Isis::StretchType::StretchType(), and widthEditChanged().
|
protectedslotinherited |
This updates the graph with the current stretch object.
Definition at line 122 of file StretchType.cpp.
References Isis::StretchType::p_graph, Isis::StretchType::p_stretch, and Isis::HistogramWidget::setStretch().
Referenced by Isis::StretchType::StretchType().
|
protectedslotinherited |
This updates the table with the current stretch pairs.
Definition at line 130 of file StretchType.cpp.
References Isis::StretchType::getStretch(), Isis::Stretch::Input(), Isis::Stretch::Output(), Isis::StretchType::p_table, and Isis::Stretch::Pairs().
Referenced by Isis::ManualStretchType::ManualStretchType(), Isis::ManualStretchType::setStretch(), and Isis::StretchType::StretchType().
|
privateslot |
This is called when the the sawtooth width edit changes.
It updates the slider (while blocking the slider from calling this method again) and calculates a new stretch.
Definition at line 219 of file SawtoothStretchType.cpp.
References Isis::Histogram::BinSize(), calculateNewStretch(), Isis::Stretch::CopyPairs(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_sliderOverride, Isis::StretchType::p_stretch, p_widthEdit, p_widthSlider, Isis::StretchType::stretchChanged(), and Isis::Stretch::Text().
Referenced by SawtoothStretchType(), and setStretch().
|
privateslot |
This is called when the sawtooth width slider moves.
It updates the edit.
Definition at line 199 of file SawtoothStretchType.cpp.
References Isis::Histogram::BinSize(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_offsetSlider, p_sliderOverride, p_widthEdit, and p_widthSlider.
Referenced by SawtoothStretchType().
|
protectedinherited |
Visible area histogram.
Definition at line 67 of file StretchType.h.
Referenced by Isis::BinaryStretchType::BinaryStretchType(), Isis::BinaryStretchType::calculateNewStretch(), calculateNewStretch(), Isis::BinaryStretchType::endEditChanged(), Isis::LinearStretchType::endEditChanged(), Isis::BinaryStretchType::endSliderMoved(), Isis::LinearStretchType::endSliderMoved(), offsetEditChanged(), offsetSliderMoved(), SawtoothStretchType(), Isis::StretchType::setHistogram(), Isis::LinearStretchType::setStretch(), Isis::BinaryStretchType::setStretch(), setStretch(), Isis::BinaryStretchType::startEditChanged(), Isis::LinearStretchType::startEditChanged(), Isis::BinaryStretchType::startSliderMoved(), Isis::LinearStretchType::startSliderMoved(), Isis::StretchType::StretchType(), widthEditChanged(), widthSliderMoved(), and Isis::StretchType::~StretchType().
|
protectedinherited |
Histogram graph.
Definition at line 69 of file StretchType.h.
Referenced by Isis::StretchType::setHistogram(), Isis::StretchType::StretchType(), and Isis::StretchType::updateGraph().
|
protectedinherited |
Main layout.
Definition at line 66 of file StretchType.h.
Referenced by Isis::BinaryStretchType::BinaryStretchType(), Isis::LinearStretchType::LinearStretchType(), Isis::ManualStretchType::ManualStretchType(), SawtoothStretchType(), and Isis::StretchType::StretchType().
|
private |
Offset edit.
Definition at line 55 of file SawtoothStretchType.h.
Referenced by calculateNewStretch(), offsetEditChanged(), offsetSliderMoved(), SawtoothStretchType(), and setStretch().
|
private |
Offset slider.
Definition at line 54 of file SawtoothStretchType.h.
Referenced by offsetEditChanged(), offsetSliderMoved(), SawtoothStretchType(), and widthSliderMoved().
|
private |
This is used to let the edits be changed to where sliders cant go.
Definition at line 60 of file SawtoothStretchType.h.
Referenced by offsetEditChanged(), offsetSliderMoved(), SawtoothStretchType(), widthEditChanged(), and widthSliderMoved().
|
protectedinherited |
Current stretch pairs stored here.
Definition at line 70 of file StretchType.h.
Referenced by Isis::BinaryStretchType::endEditChanged(), Isis::LinearStretchType::endEditChanged(), Isis::LinearStretchType::getStretch(), Isis::StretchType::getStretch(), offsetEditChanged(), Isis::StretchType::setHistogram(), Isis::BinaryStretchType::setStretch(), Isis::LinearStretchType::setStretch(), Isis::ManualStretchType::setStretch(), setStretch(), Isis::BinaryStretchType::startEditChanged(), Isis::LinearStretchType::startEditChanged(), Isis::StretchType::StretchType(), Isis::StretchType::updateGraph(), widthEditChanged(), and Isis::StretchType::~StretchType().
|
protectedinherited |
Pairs table.
Definition at line 68 of file StretchType.h.
Referenced by Isis::ManualStretchType::addButtonPressed(), Isis::ManualStretchType::deleteButtonPressed(), Isis::ManualStretchType::ManualStretchType(), Isis::StretchType::StretchType(), and Isis::StretchType::updateTable().
|
private |
Width edit.
Definition at line 57 of file SawtoothStretchType.h.
Referenced by calculateNewStretch(), SawtoothStretchType(), setStretch(), widthEditChanged(), and widthSliderMoved().
|
private |
Width slider.
Definition at line 56 of file SawtoothStretchType.h.
Referenced by offsetSliderMoved(), SawtoothStretchType(), widthEditChanged(), and widthSliderMoved().