Isis 3 Programmer Reference
Isis::BinaryStretchType Class Reference

This handles the advanced binary stretch. More...

#include <BinaryStretchType.h>

Inheritance diagram for Isis::BinaryStretchType:
Inheritance graph
Collaboration diagram for Isis::BinaryStretchType:
Collaboration graph

Signals

void saveToCube ()
 Emitted when a new Stretch object is available.
 
void deleteFromCube ()
 
void stretchChanged ()
 
void loadStretch ()
 

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 CubeStretch getStretch ()
 Gets the CubeStretch for this Binary Stretch.
 
virtual void setStretch (Stretch)
 Given an arbitrary stretch, this will re-interpret it, as best as possible, into a binary stretch.
 
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.
 
Histogramp_cubeHist
 Visible area histogram.
 
QTableWidget * p_table
 Pairs table.
 
HistogramWidgetp_graph
 Histogram graph.
 
Stretchp_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.
 
void savePairs ()
 This asks the user for a file and saves the current stretch pairs to that file.
 

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.
 

Detailed Description

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.

Author
2010-05-20 Steven Lambright

Definition at line 30 of file BinaryStretchType.h.

Constructor & Destructor Documentation

◆ BinaryStretchType()

Isis::BinaryStretchType::BinaryStretchType ( const Histogram & hist,
const Stretch & stretch,
const QString & name,
const QColor & color )

◆ ~BinaryStretchType()

Isis::BinaryStretchType::~BinaryStretchType ( )

Destroys the binary stretch.

Definition at line 85 of file BinaryStretchType.cpp.

Member Function Documentation

◆ calculateNewStretch()

Stretch Isis::BinaryStretchType::calculateNewStretch ( )
private

This uses the GUI elements to calculate the current binary stretch.

Returns
Stretch

Definition at line 335 of file BinaryStretchType.cpp.

References 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().

◆ createStretchTable()

QTableWidget * Isis::StretchType::createStretchTable ( )
protectedinherited

This creates the stretch pairs table.

Returns
QTableWidget*

Definition at line 121 of file StretchType.cpp.

Referenced by Isis::StretchType::StretchType().

◆ endEditChanged

void Isis::BinaryStretchType::endEditChanged ( const QString & )
privateslot

◆ endSliderMoved

void Isis::BinaryStretchType::endSliderMoved ( int )
privateslot

This is called when the end point slider moves.

It ensures a valid state and updates the stretch pairs.

Definition at line 283 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().

◆ getStretch()

CubeStretch Isis::BinaryStretchType::getStretch ( )
virtual

Gets the CubeStretch for this Binary Stretch.

Returns
CubeStretch

Reimplemented from Isis::StretchType.

Definition at line 385 of file BinaryStretchType.cpp.

References Isis::StretchType::p_stretch.

◆ savePairs

void Isis::StretchType::savePairs ( )
privateslotinherited

This asks the user for a file and saves the current stretch pairs to that file.

Definition at line 170 of file StretchType.cpp.

References Isis::StretchType::getStretch(), and Isis::Stretch::Text().

Referenced by Isis::StretchType::StretchType().

◆ saveToCube

void Isis::StretchType::saveToCube ( )
signalinherited

Emitted when a new Stretch object is available.

Referenced by Isis::StretchType::StretchType().

◆ setHistogram()

void Isis::StretchType::setHistogram ( const Histogram & hist)
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.

Parameters
hist

Definition at line 109 of file StretchType.cpp.

References Isis::StretchType::p_cubeHist, Isis::StretchType::p_graph, Isis::StretchType::p_stretch, Isis::HistogramWidget::setHistogram(), and Isis::StretchType::setStretch().

◆ setStretch()

void Isis::BinaryStretchType::setStretch ( Stretch newStretch)
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.

Parameters
newStretchStretch to interpret

Implements Isis::StretchType.

Definition at line 100 of file BinaryStretchType.cpp.

References Isis::Stretch::AddPair(), Isis::Histogram::BinSize(), calculateNewStretch(), Isis::Stretch::CopyPairs(), endEditChanged(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_editOverride, p_endEdit, p_startEdit, Isis::StretchType::p_stretch, startEditChanged(), and Isis::Stretch::Text().

Referenced by BinaryStretchType().

◆ startEditChanged

void Isis::BinaryStretchType::startEditChanged ( const QString & )
privateslot

◆ startSliderMoved

void Isis::BinaryStretchType::startSliderMoved ( int )
privateslot

This is called when the start point slider moves.

It ensures a valid state and updates the stretch pairs.

Definition at line 233 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().

◆ updateGraph

void Isis::StretchType::updateGraph ( )
protectedslotinherited

This updates the graph with the current stretch object.

Definition at line 140 of file StretchType.cpp.

References Isis::StretchType::p_graph, Isis::StretchType::p_stretch, and Isis::HistogramWidget::setStretch().

Referenced by Isis::StretchType::StretchType().

◆ updateTable

void Isis::StretchType::updateTable ( )
protectedslotinherited

Member Data Documentation

◆ p_cubeHist

◆ p_editOverride

bool Isis::BinaryStretchType::p_editOverride
private

This is used to let the edits be changed without updating the stretch.

Definition at line 60 of file BinaryStretchType.h.

Referenced by BinaryStretchType(), endEditChanged(), setStretch(), and startEditChanged().

◆ p_endEdit

QLineEdit* Isis::BinaryStretchType::p_endEdit
private

◆ p_endSlider

QSlider* Isis::BinaryStretchType::p_endSlider
private

End point slider.

Definition at line 53 of file BinaryStretchType.h.

Referenced by BinaryStretchType(), endEditChanged(), endSliderMoved(), and startSliderMoved().

◆ p_graph

HistogramWidget* Isis::StretchType::p_graph
protectedinherited

◆ p_mainLayout

QGridLayout* Isis::StretchType::p_mainLayout
protectedinherited

◆ p_sliderOverride

bool Isis::BinaryStretchType::p_sliderOverride
private

This is used to let the edits be changed to where sliders cant go.

Definition at line 57 of file BinaryStretchType.h.

Referenced by BinaryStretchType(), endEditChanged(), endSliderMoved(), startEditChanged(), and startSliderMoved().

◆ p_startEdit

QLineEdit* Isis::BinaryStretchType::p_startEdit
private

Start point edit.

Definition at line 52 of file BinaryStretchType.h.

Referenced by BinaryStretchType(), calculateNewStretch(), setStretch(), startEditChanged(), and startSliderMoved().

◆ p_startSlider

QSlider* Isis::BinaryStretchType::p_startSlider
private

Start point slider.

Definition at line 51 of file BinaryStretchType.h.

Referenced by BinaryStretchType(), endSliderMoved(), startEditChanged(), and startSliderMoved().

◆ p_stretch

◆ p_table


The documentation for this class was generated from the following files: