Isis 3.0 Object Programmers' Reference |
Home |
This handles the advanced binary stretch. More...
#include <BinaryStretchType.h>
Signals | |
void | stretchChanged () |
Emitted when a new Stretch object is available. | |
Public Member Functions | |
BinaryStretchType (const Histogram &, const Stretch &, const QString &name, const QColor &color) | |
This constructs a binary stretch type. | |
~BinaryStretchType () | |
Destroys the binary stretch. | |
virtual void | setStretch (Stretch) |
Given an arbitrary stretch, this will re-interpret it, as best as possible, into a binary 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 | startSliderMoved (int) |
This is called when the start point slider moves. | |
void | startEditChanged (const QString &) |
A new start point was typed in. | |
void | endSliderMoved (int) |
This is called when the end point slider moves. | |
void | endEditChanged (const QString &) |
A new end point was typed in. | |
Private Member Functions | |
Stretch | calculateNewStretch () |
This uses the GUI elements to calculate the current binary stretch. | |
Private Attributes | |
QSlider * | p_startSlider |
Start point slider. | |
QLineEdit * | p_startEdit |
Start point edit. | |
QSlider * | p_endSlider |
End point slider. | |
QLineEdit * | p_endEdit |
End point edit. | |
bool | p_sliderOverride |
This is used to let the edits be changed to where sliders cant go. | |
bool | p_editOverride |
This is used to let the edits be changed without updating the stretch. | |
This handles the advanced binary stretch.
The binary stretch consists off DNs being "ON" or "OFF" (0 or 255). This is useful for finding DNs in a certain range. Because all stretches consist of lines with a slope, we can't actually have a binary stretch. This, however, makes a stretch as close to binary as it can.
Definition at line 29 of file BinaryStretchType.h.
Isis::BinaryStretchType::BinaryStretchType | ( | const Histogram & | hist, |
const Stretch & | stretch, | ||
const QString & | name, | ||
const QColor & | color | ||
) |
This constructs a binary stretch type.
hist | |
stretch | |
name | |
color |
Definition at line 23 of file BinaryStretchType.cpp.
References calculateNewStretch(), endEditChanged(), endSliderMoved(), Isis::StretchType::p_cubeHist, p_editOverride, p_endEdit, p_endSlider, Isis::StretchType::p_mainLayout, p_sliderOverride, p_startEdit, p_startSlider, Isis::Histogram::Percent(), setStretch(), startEditChanged(), and startSliderMoved().
Isis::BinaryStretchType::~BinaryStretchType | ( | ) |
Destroys the binary stretch.
Definition at line 84 of file BinaryStretchType.cpp.
|
private |
This uses the GUI elements to calculate the current binary stretch.
Definition at line 334 of file BinaryStretchType.cpp.
References Isis::Stretch::AddPair(), Isis::Histogram::BinSize(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_endEdit, and p_startEdit.
Referenced by BinaryStretchType(), endEditChanged(), setStretch(), and startEditChanged().
|
protectedinherited |
This creates the stretch pairs table.
Definition at line 103 of file StretchType.cpp.
Referenced by Isis::StretchType::StretchType().
|
privateslot |
A new end point was typed in.
Update the slider and calclate a new stretch.
Definition at line 302 of file BinaryStretchType.cpp.
References calculateNewStretch(), Isis::Stretch::CopyPairs(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_editOverride, p_endEdit, p_endSlider, p_sliderOverride, Isis::StretchType::p_stretch, Isis::StretchType::stretchChanged(), Isis::Stretch::Text(), and Isis::toDouble().
Referenced by BinaryStretchType(), and setStretch().
|
privateslot |
This is called when the end point slider moves.
It ensures a valid state and updates the stretch pairs.
Definition at line 282 of file BinaryStretchType.cpp.
References Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_endEdit, p_endSlider, p_sliderOverride, and p_startSlider.
Referenced by BinaryStretchType().
|
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().
|
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 binary stretch.
It is required that a stretch that represents a binary stretch always translate into itself and does not cause a stretchChanged().
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 99 of file BinaryStretchType.cpp.
References Isis::Stretch::AddPair(), Isis::Histogram::BinSize(), calculateNewStretch(), Isis::Stretch::CopyPairs(), endEditChanged(), Isis::Stretch::Input(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::Stretch::Output(), Isis::StretchType::p_cubeHist, p_editOverride, p_endEdit, p_startEdit, Isis::StretchType::p_stretch, Isis::Stretch::Pairs(), startEditChanged(), Isis::StretchType::stretchChanged(), and Isis::Stretch::Text().
Referenced by BinaryStretchType().
|
privateslot |
A new start point was typed in.
Update the slider and calculate a new stretch.
Definition at line 252 of file BinaryStretchType.cpp.
References calculateNewStretch(), Isis::Stretch::CopyPairs(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_editOverride, p_endEdit, p_sliderOverride, p_startEdit, p_startSlider, Isis::StretchType::p_stretch, Isis::StretchType::stretchChanged(), and Isis::Stretch::Text().
Referenced by BinaryStretchType(), and setStretch().
|
privateslot |
This is called when the start point slider moves.
It ensures a valid state and updates the stretch pairs.
Definition at line 232 of file BinaryStretchType.cpp.
References Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_endSlider, p_sliderOverride, p_startEdit, and p_startSlider.
Referenced by BinaryStretchType().
|
signalinherited |
Emitted when a new Stretch object is available.
Referenced by endEditChanged(), Isis::LinearStretchType::endEditChanged(), Isis::ManualStretchType::ManualStretchType(), Isis::SawtoothStretchType::offsetEditChanged(), Isis::LinearStretchType::setStretch(), setStretch(), Isis::ManualStretchType::setStretch(), Isis::SawtoothStretchType::setStretch(), startEditChanged(), Isis::LinearStretchType::startEditChanged(), Isis::StretchType::StretchType(), and Isis::SawtoothStretchType::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().
|
protectedinherited |
Visible area histogram.
Definition at line 67 of file StretchType.h.
Referenced by BinaryStretchType(), calculateNewStretch(), Isis::SawtoothStretchType::calculateNewStretch(), endEditChanged(), Isis::LinearStretchType::endEditChanged(), endSliderMoved(), Isis::LinearStretchType::endSliderMoved(), Isis::SawtoothStretchType::offsetEditChanged(), Isis::SawtoothStretchType::offsetSliderMoved(), Isis::SawtoothStretchType::SawtoothStretchType(), Isis::StretchType::setHistogram(), Isis::LinearStretchType::setStretch(), setStretch(), Isis::SawtoothStretchType::setStretch(), startEditChanged(), Isis::LinearStretchType::startEditChanged(), startSliderMoved(), Isis::LinearStretchType::startSliderMoved(), Isis::StretchType::StretchType(), Isis::SawtoothStretchType::widthEditChanged(), Isis::SawtoothStretchType::widthSliderMoved(), and Isis::StretchType::~StretchType().
|
private |
This is used to let the edits be changed without updating the stretch.
Definition at line 58 of file BinaryStretchType.h.
Referenced by BinaryStretchType(), endEditChanged(), setStretch(), and startEditChanged().
|
private |
End point edit.
Definition at line 52 of file BinaryStretchType.h.
Referenced by BinaryStretchType(), calculateNewStretch(), endEditChanged(), endSliderMoved(), setStretch(), and startEditChanged().
|
private |
End point slider.
Definition at line 51 of file BinaryStretchType.h.
Referenced by BinaryStretchType(), endEditChanged(), endSliderMoved(), and startSliderMoved().
|
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 BinaryStretchType(), Isis::LinearStretchType::LinearStretchType(), Isis::ManualStretchType::ManualStretchType(), Isis::SawtoothStretchType::SawtoothStretchType(), and Isis::StretchType::StretchType().
|
private |
This is used to let the edits be changed to where sliders cant go.
Definition at line 55 of file BinaryStretchType.h.
Referenced by BinaryStretchType(), endEditChanged(), endSliderMoved(), startEditChanged(), and startSliderMoved().
|
private |
Start point edit.
Definition at line 50 of file BinaryStretchType.h.
Referenced by BinaryStretchType(), calculateNewStretch(), setStretch(), startEditChanged(), and startSliderMoved().
|
private |
Start point slider.
Definition at line 49 of file BinaryStretchType.h.
Referenced by BinaryStretchType(), endSliderMoved(), startEditChanged(), and startSliderMoved().
|
protectedinherited |
Current stretch pairs stored here.
Definition at line 70 of file StretchType.h.
Referenced by endEditChanged(), Isis::LinearStretchType::endEditChanged(), Isis::LinearStretchType::getStretch(), Isis::StretchType::getStretch(), Isis::SawtoothStretchType::offsetEditChanged(), Isis::StretchType::setHistogram(), Isis::LinearStretchType::setStretch(), setStretch(), Isis::ManualStretchType::setStretch(), Isis::SawtoothStretchType::setStretch(), startEditChanged(), Isis::LinearStretchType::startEditChanged(), Isis::StretchType::StretchType(), Isis::StretchType::updateGraph(), Isis::SawtoothStretchType::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().