Isis 3 Programmer Reference
Isis::LinearStretchType Class Reference

This handles the advanced linear stretch. More...

#include <LinearStretchType.h>

Inheritance diagram for Isis::LinearStretchType:
Inheritance graph
Collaboration diagram for Isis::LinearStretchType:
Collaboration graph

Signals

void stretchChanged ()
 Emitted when a new Stretch object is available. More...
 

Public Member Functions

 LinearStretchType (const Histogram &, const Stretch &, const QString &name, const QColor &color)
 This constructs a linear stretch type. More...
 
 ~LinearStretchType ()
 Destructor. More...
 
virtual Stretch getStretch ()
 Returns the current stretch object. More...
 
virtual void setStretch (Stretch)
 Given an arbitrary stretch, this will re-interpret it, as best as possible, into a linear stretch. More...
 
virtual void setHistogram (const Histogram &)
 This should be called when the visible area changes. More...
 

Protected Slots

void updateGraph ()
 This updates the graph with the current stretch object. More...
 
void updateTable ()
 This updates the table with the current stretch pairs. More...
 

Protected Member Functions

QTableWidget * createStretchTable ()
 This creates the stretch pairs table. More...
 

Protected Attributes

QGridLayout * p_mainLayout
 Main layout. More...
 
Histogramp_cubeHist
 Visible area histogram. More...
 
QTableWidget * p_table
 Pairs table. More...
 
HistogramWidgetp_graph
 Histogram graph. More...
 
Stretchp_stretch
 Current stretch pairs stored here. More...
 

Private Slots

void startSliderMoved (int)
 This is called when the start point slider moves. More...
 
void startEditChanged (const QString &)
 A new start point was typed in. More...
 
void endSliderMoved (int)
 This is called when the end point slider moves. More...
 
void endEditChanged (const QString &)
 A new end point was typed in. More...
 

Private Attributes

QSlider * p_startSlider
 Line start pt slider. More...
 
QLineEdit * p_startEdit
 Line start pt edit. More...
 
QSlider * p_endSlider
 Line end pt slider. More...
 
QLineEdit * p_endEdit
 Line end pt edit. More...
 
bool p_sliderOverride
 This is used to let the edits be changed to where sliders cant go. More...
 
bool p_editOverride
 This is used to let the edits be changed without updating the stretch. More...
 

Detailed Description

This handles the advanced linear stretch.

The linear stretch is what happens without the advanced stretch tool. This is useful for visualizing and making adjustments of the linear stretch with a histogram of the data.

Author
2010-05-20 Steven Lambright

Definition at line 28 of file LinearStretchType.h.

Constructor & Destructor Documentation

◆ LinearStretchType()

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

This constructs a linear stretch type.

Parameters
hist
stretch
name
color

Definition at line 23 of file LinearStretchType.cpp.

References endEditChanged(), endSliderMoved(), p_editOverride, p_endEdit, p_endSlider, Isis::StretchType::p_mainLayout, p_sliderOverride, p_startEdit, p_startSlider, setStretch(), startEditChanged(), and startSliderMoved().

◆ ~LinearStretchType()

Isis::LinearStretchType::~LinearStretchType ( )

Destructor.

Definition at line 83 of file LinearStretchType.cpp.

Member Function Documentation

◆ createStretchTable()

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

This creates the stretch pairs table.

Returns
QTableWidget*

Definition at line 103 of file StretchType.cpp.

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

◆ endEditChanged

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

◆ endSliderMoved

void Isis::LinearStretchType::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 204 of file LinearStretchType.cpp.

References Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_endEdit, p_endSlider, p_sliderOverride, and p_startSlider.

Referenced by LinearStretchType().

◆ getStretch()

Stretch Isis::LinearStretchType::getStretch ( )
virtual

Returns the current stretch object.

Returns
Stretch

Reimplemented from Isis::StretchType.

Definition at line 252 of file LinearStretchType.cpp.

References Isis::StretchType::p_stretch.

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

◆ setStretch()

void Isis::LinearStretchType::setStretch ( Stretch  newStretch)
virtual

Given an arbitrary stretch, this will re-interpret it, as best as possible, into a linear stretch.

It is required that a stretch that represents a linear 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 98 of file LinearStretchType.cpp.

References Isis::Stretch::AddPair(), Isis::Statistics::BestMaximum(), Isis::Statistics::BestMinimum(), Isis::Histogram::BinSize(), Isis::Stretch::CopyPairs(), endEditChanged(), Isis::Stretch::Input(), 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 LinearStretchType().

◆ startEditChanged

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

◆ startSliderMoved

void Isis::LinearStretchType::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 152 of file LinearStretchType.cpp.

References Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::StretchType::p_cubeHist, p_endSlider, p_sliderOverride, p_startEdit, and p_startSlider.

Referenced by LinearStretchType().

◆ stretchChanged

◆ updateGraph

void Isis::StretchType::updateGraph ( )
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().

◆ updateTable

void Isis::StretchType::updateTable ( )
protectedslotinherited

Member Data Documentation

◆ p_cubeHist

◆ p_editOverride

bool Isis::LinearStretchType::p_editOverride
private

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

Definition at line 56 of file LinearStretchType.h.

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

◆ p_endEdit

QLineEdit* Isis::LinearStretchType::p_endEdit
private

Line end pt edit.

Definition at line 50 of file LinearStretchType.h.

Referenced by endEditChanged(), endSliderMoved(), LinearStretchType(), setStretch(), and startEditChanged().

◆ p_endSlider

QSlider* Isis::LinearStretchType::p_endSlider
private

Line end pt slider.

Definition at line 49 of file LinearStretchType.h.

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

◆ p_graph

HistogramWidget* Isis::StretchType::p_graph
protectedinherited

◆ p_mainLayout

QGridLayout* Isis::StretchType::p_mainLayout
protectedinherited

◆ p_sliderOverride

bool Isis::LinearStretchType::p_sliderOverride
private

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

Definition at line 53 of file LinearStretchType.h.

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

◆ p_startEdit

QLineEdit* Isis::LinearStretchType::p_startEdit
private

Line start pt edit.

Definition at line 48 of file LinearStretchType.h.

Referenced by LinearStretchType(), setStretch(), startEditChanged(), and startSliderMoved().

◆ p_startSlider

QSlider* Isis::LinearStretchType::p_startSlider
private

Line start pt slider.

Definition at line 47 of file LinearStretchType.h.

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

◆ p_stretch

◆ p_table


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