USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::ManualStretchType Class Reference

This handles arbitrary user-input stretches. More...

#include <ManualStretchType.h>

Inheritance diagram for Isis::ManualStretchType:
Inheritance graph
Collaboration diagram for Isis::ManualStretchType:
Collaboration graph

Signals

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

Public Member Functions

 ManualStretchType (const Histogram &, const Stretch &, const QString &name, const QColor &color)
 This constructs a manual stretch type.
 
 ~ManualStretchType ()
 Destructor.
 
virtual void setStretch (Stretch)
 Given an arbitrary stretch, this will re-interpret it, as best as possible, into a manual 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.
 
Histogramp_cubeHist
 Visible area histogram.
 
QTableWidget * p_table
 Pairs table.
 
HistogramWidgetp_graph
 Histogram graph.
 
Stretchp_stretch
 Current stretch pairs stored here.
 

Private Slots

void addButtonPressed (bool)
 This is called when a user clicks "Add / Edit" and is responsible for adding the pair into the correct location or editing the pair at that location (input value).
 
void deleteButtonPressed (bool)
 This is called when a user clicks "Delete" and is responsible for removing the pair with the given input value.
 
void readTable ()
 

Private Member Functions

Stretch convertTableToStretch ()
 

Private Attributes

QLabel * p_errorMessage
 

Detailed Description

This handles arbitrary user-input stretches.

This is designed to take any stretch pairs the user wants that we can handle.

Author
2010-05-20 Steven Lambright
History:
2011-11-04 Steven Lambright - This should be much, much easier to use now. Fixes #567.

Definition at line 31 of file ManualStretchType.h.

Constructor & Destructor Documentation

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

This constructs a manual stretch type.

Parameters
hist
stretch
name
color

Definition at line 24 of file ManualStretchType.cpp.

References addButtonPressed(), deleteButtonPressed(), Isis::StretchType::p_mainLayout, Isis::StretchType::p_table, setStretch(), Isis::StretchType::stretchChanged(), and Isis::StretchType::updateTable().

Isis::ManualStretchType::~ManualStretchType ( )

Destructor.

Definition at line 66 of file ManualStretchType.cpp.

Member Function Documentation

void Isis::ManualStretchType::addButtonPressed ( bool  )
privateslot

This is called when a user clicks "Add / Edit" and is responsible for adding the pair into the correct location or editing the pair at that location (input value).

Definition at line 98 of file ManualStretchType.cpp.

References Isis::StretchType::p_table.

Referenced by ManualStretchType().

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

void Isis::ManualStretchType::deleteButtonPressed ( bool  )
privateslot

This is called when a user clicks "Delete" and is responsible for removing the pair with the given input value.

Definition at line 107 of file ManualStretchType.cpp.

References _FILEINFO_, Isis::StretchType::p_table, and Isis::IException::User.

Referenced by ManualStretchType().

Stretch Isis::StretchType::getStretch ( )
virtualinherited

Returns the current stretch object.

Returns
Stretch

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

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

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

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

It is required that a stretch that represents a manual 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.

Good thing this is a manual stretch so no interpretation is really needed.

Parameters
newStretchStretch to interpret

Implements Isis::StretchType.

Definition at line 84 of file ManualStretchType.cpp.

References Isis::Stretch::CopyPairs(), Isis::StretchType::p_stretch, Isis::StretchType::stretchChanged(), Isis::Stretch::Text(), and Isis::StretchType::updateTable().

Referenced by ManualStretchType().

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

void Isis::StretchType::updateTable ( )
protectedslotinherited

Member Data Documentation

HistogramWidget* Isis::StretchType::p_graph
protectedinherited
QGridLayout* Isis::StretchType::p_mainLayout
protectedinherited
QTableWidget* Isis::StretchType::p_table
protectedinherited

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