Isis 3 Programmer Reference
Isis::StretchType Class Referenceabstract

This is the base class for advanced stretches. More...

#include <StretchType.h>

Inheritance diagram for Isis::StretchType:
Inheritance graph
Collaboration diagram for Isis::StretchType:
Collaboration graph

Signals

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

Public Member Functions

 StretchType (const Histogram &hist, const Stretch &stretch, const QString &name, const QColor &color)
 This constructs a stretch type.
 
virtual ~StretchType ()
 Destructor.
 
virtual CubeStretch getStretch ()
 Returns the current stretch object.
 
virtual void setStretch (Stretch)=0
 Children must re-implement this to update their stretch pairs and GUI elements appropriately.
 
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 savePairs ()
 This asks the user for a file and saves the current stretch pairs to that file.
 

Detailed Description

This is the base class for advanced stretches.

This has the common functionality between the advanced stretch types. It provides a histogram, the stretch table, and layouts. It also stores the stretch pairs. Using this should keep all of the advanced stretch interfaces similar and uniformly accessible from the stretch tool.

Author
2010-05-20 Steven Lambright
History
2011-11-04 Steven Lambright - Split up updateGraph and updateTable and moved them to protected. The manual stretch type needs to choose explicitly when to update the table, but always wants to update the graph.

Definition at line 39 of file StretchType.h.

Constructor & Destructor Documentation

◆ StretchType()

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

This constructs a stretch type.

It provides a main layout, sizing policies, and a few widgets. Children should insert themselves at the main layout grid row 1 column 0.

Parameters
hist
stretch
name
color

Definition at line 31 of file StretchType.cpp.

References createStretchTable(), p_cubeHist, p_graph, p_mainLayout, p_stretch, p_table, savePairs(), saveToCube(), Isis::HistogramWidget::setHistogram(), updateGraph(), and updateTable().

◆ ~StretchType()

Isis::StretchType::~StretchType ( )
virtual

Destructor.

Definition at line 89 of file StretchType.cpp.

References p_cubeHist, and p_stretch.

Member Function Documentation

◆ createStretchTable()

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

This creates the stretch pairs table.

Returns
QTableWidget*

Definition at line 121 of file StretchType.cpp.

Referenced by StretchType().

◆ getStretch()

CubeStretch Isis::StretchType::getStretch ( )
virtual

Returns the current stretch object.

Returns
Stretch

Reimplemented in Isis::BinaryStretchType, Isis::LinearStretchType, Isis::ManualStretchType, and Isis::SawtoothStretchType.

Definition at line 201 of file StretchType.cpp.

References p_stretch.

Referenced by savePairs(), and updateTable().

◆ savePairs

void Isis::StretchType::savePairs ( )
privateslot

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 getStretch(), and Isis::Stretch::Text().

Referenced by StretchType().

◆ saveToCube

void Isis::StretchType::saveToCube ( )
signal

Emitted when a new Stretch object is available.

Referenced by StretchType().

◆ setHistogram()

void Isis::StretchType::setHistogram ( const Histogram & hist)
virtual

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 p_cubeHist, p_graph, p_stretch, Isis::HistogramWidget::setHistogram(), and setStretch().

◆ setStretch()

virtual void Isis::StretchType::setStretch ( Stretch )
pure virtual

Children must re-implement this to update their stretch pairs and GUI elements appropriately.

This could be called with a different histogram but not a different stretch.

Implemented in Isis::BinaryStretchType, Isis::LinearStretchType, Isis::ManualStretchType, and Isis::SawtoothStretchType.

Referenced by setHistogram().

◆ updateGraph

void Isis::StretchType::updateGraph ( )
protectedslot

This updates the graph with the current stretch object.

Definition at line 140 of file StretchType.cpp.

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

Referenced by StretchType().

◆ updateTable

void Isis::StretchType::updateTable ( )
protectedslot

This updates the table with the current stretch pairs.

Definition at line 148 of file StretchType.cpp.

References getStretch(), Isis::Stretch::Input(), Isis::Stretch::Output(), p_table, and Isis::Stretch::Pairs().

Referenced by Isis::ManualStretchType::ManualStretchType(), Isis::ManualStretchType::setStretch(), and StretchType().

Member Data Documentation

◆ p_cubeHist

◆ p_graph

HistogramWidget* Isis::StretchType::p_graph
protected

Histogram graph.

Definition at line 70 of file StretchType.h.

Referenced by setHistogram(), StretchType(), and updateGraph().

◆ p_mainLayout

◆ p_stretch

◆ p_table

QTableWidget* Isis::StretchType::p_table
protected

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