USGS

Isis 3.0 Object Programmers' Reference

Home

Qisis::ChipViewport Class Reference

#include <ChipViewport.h>

Inheritance diagram for Qisis::ChipViewport:

Inheritance graph
[legend]
Collaboration diagram for Qisis::ChipViewport:

Collaboration graph
[legend]
List of all members.

Detailed Description

Viewport for Isis Chips.

Author:
2007-05-01 Tracie Sucharski

For internal use only.

History:
2008-09-09 Tracie Sucharski - Added setCircle and setCircleSize methods.

Definition at line 51 of file ChipViewport.h.

Public Slots

void autoStretch ()
 Apply automatic stretch using data from entire chip.
void setCross (bool checked)
void rotateChip (int rotation)
 Slot to rotate chip.
void setCircle (bool checked)
void setCircleSize (int size)
 Slot to geom chip.
void geomChip (Isis::Chip *matchChip, Isis::Cube *matchChipCube)
 Slot to geom chip.
void nogeomChip ()
void panUp ()
 Pan down.
void panDown ()
 Pan left.
void panLeft ()
 Pan right.
void panRight ()
void zoomIn ()
 Zoom in.
void zoomOut ()
 Zoom out.
void zoom1 ()
 Zoom by a factor of one. Slot to refresh viewport , point has changed.
void refreshView (double tackSample, double tackLine)
 If mouse enters, make sure key events are processed w/o clicking.

Signals

void tackPointChanged (double)
 < Signal sent when tack point changes

Public Member Functions

 ChipViewport (int width, int height, QWidget *parent=0)
 Construct an empty viewport.
 ~ChipViewport ()
 Destructor.
void setChip (Isis::Chip *chip, Isis::Cube *chipCube)
 Set the chip for this ChipViewport.
void loadView (ChipViewport &newView)
 Load with info from given ChipViewport.
Isis::Chipchip () const
 Return chip.
int chipSamples () const
 Return the number of samples in the chip.
int chipLines () const
 Return the number of lines in the chip.
int grayBand () const
 Return the gray band currently viewed.
double tackSample ()
 Returns tack sample.
double tackLine ()
 returns tack Line Pan up
Isis::Stretch grayStretch () const
 Return the gray band stretch.

Protected Member Functions

void paintEvent (QPaintEvent *e)
 Repaint the viewport.
void enterEvent (QEvent *e)
 Process arrow keystrokes on cube.
void keyPressEvent (QKeyEvent *e)
 Process mouse events.
void mousePressEvent (QMouseEvent *event)
 Slot to change state of crosshair.

Private Member Functions

void reloadChip (double tackSample=0., double tackLine=0.)
 Reloads the chip.
void computeStretch (Isis::Stretch &stretch)
 Compute automatic stretch for a portion of the cube.
void paintImage ()
 Paint QImage.

Private Attributes

BandInfo p_gray
 info for the gray bands.
Isis::Chipp_chip
 The chip.
Isis::Cubep_chipCube
 The chip's cube.
int p_width
 Chip width.
int p_height
 Chip height.
bool p_geomIt
 geomIt?
Isis::Chipp_matchChip
 The matching chip.
Isis::Cubep_matchChipCube
 The matching chip's cube.
double p_zoomFactor
 Zoom Factor.
int p_rotation
 Rotation.
QImage * p_image
 The image.
bool p_paintImage
 Paint Image?
bool p_cross
 Draw crosshair.
bool p_circle
 Draw circle.
int p_circleSize
 Circle size.
ChipViewportp_tempView
 Temporary viewport.

Classes

class  BandInfo


Constructor & Destructor Documentation

Qisis::ChipViewport::ChipViewport ( int  width,
int  height,
QWidget parent = 0 
)

Construct an empty viewport.

Definition at line 8 of file ChipViewport.cpp.

References p_chip, p_chipCube, p_circle, p_cross, p_geomIt, p_height, p_image, p_matchChip, p_matchChipCube, p_rotation, p_tempView, p_width, and p_zoomFactor.

Qisis::ChipViewport::~ChipViewport (  ) 

Destructor.

Definition at line 35 of file ChipViewport.cpp.


Member Function Documentation

void Qisis::ChipViewport::autoStretch (  )  [slot]

Apply automatic stretch using data from entire chip.

Definition at line 72 of file ChipViewport.cpp.

References computeStretch(), p_gray, paintImage(), and Qisis::ChipViewport::BandInfo::stretch.

Referenced by geomChip(), nogeomChip(), reloadChip(), rotateChip(), and setChip().

Isis::Chip* Qisis::ChipViewport::chip (  )  const [inline]

Return chip.

Definition at line 66 of file ChipViewport.h.

References p_chip.

Referenced by setChip().

int Qisis::ChipViewport::chipLines (  )  const [inline]

Return the number of lines in the chip.

Definition at line 72 of file ChipViewport.h.

References Isis::Chip::Lines(), and p_chip.

int Qisis::ChipViewport::chipSamples (  )  const [inline]

Return the number of samples in the chip.

Definition at line 69 of file ChipViewport.h.

References p_chip, and Isis::Chip::Samples().

void Qisis::ChipViewport::computeStretch ( Isis::Stretch stretch  )  [private]

Compute automatic stretch for a portion of the cube.

Definition at line 80 of file ChipViewport.cpp.

References Isis::Chip::GetValue(), line, Isis::Chip::Lines(), p_chip, Isis::Chip::Samples(), stats, stretch, and value.

Referenced by autoStretch().

void Qisis::ChipViewport::enterEvent ( QEvent *  e  )  [protected]

Process arrow keystrokes on cube.

Definition at line 271 of file ChipViewport.cpp.

void Qisis::ChipViewport::geomChip ( Isis::Chip matchChip,
Isis::Cube matchChipCube 
) [slot]

Slot to geom chip.

Definition at line 349 of file ChipViewport.cpp.

References autoStretch(), Isis::Chip::Load(), p_chip, p_chipCube, p_geomIt, p_matchChip, and p_matchChipCube.

Referenced by Qisis::ControlPointEdit::setGeom(), and Qisis::ControlPointEdit::updateRightGeom().

int Qisis::ChipViewport::grayBand (  )  const [inline]

Return the gray band currently viewed.

Definition at line 75 of file ChipViewport.h.

References Qisis::ChipViewport::BandInfo::band, and p_gray.

Isis::Stretch Qisis::ChipViewport::grayStretch (  )  const [inline]

Return the gray band stretch.

Definition at line 86 of file ChipViewport.h.

References p_gray, and Qisis::ChipViewport::BandInfo::stretch.

void Qisis::ChipViewport::keyPressEvent ( QKeyEvent *  e  )  [protected]

Process mouse events.

Definition at line 277 of file ChipViewport.cpp.

References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), Isis::Chip::TackSample(), x, and y.

void Qisis::ChipViewport::loadView ( ChipViewport newView  ) 

Load with info from given ChipViewport.

Definition at line 155 of file ChipViewport.cpp.

References p_tempView.

Referenced by Qisis::ControlPointEdit::updateBlink().

void Qisis::ChipViewport::mousePressEvent ( QMouseEvent *  event  )  [protected]

Slot to change state of crosshair.

Definition at line 308 of file ChipViewport.cpp.

References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), and Isis::Chip::SetChipPosition().

void Qisis::ChipViewport::paintEvent ( QPaintEvent *  e  )  [protected]

Repaint the viewport.

Definition at line 127 of file ChipViewport.cpp.

References p_circle, p_circleSize, p_cross, p_height, p_image, p_tempView, and p_width.

void Qisis::ChipViewport::paintImage (  )  [private]

Paint QImage.

Definition at line 110 of file ChipViewport.cpp.

References b, g, Isis::Chip::GetValue(), Isis::Chip::Lines(), Isis::Stretch::Map(), p_chip, p_gray, p_image, Isis::Chip::Samples(), Qisis::ChipViewport::BandInfo::stretch, x, and y.

Referenced by autoStretch().

void Qisis::ChipViewport::panDown (  )  [slot]

Pan left.

Definition at line 197 of file ChipViewport.cpp.

References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), Isis::Chip::TackSample(), x, and y.

void Qisis::ChipViewport::panLeft (  )  [slot]

Pan right.

Definition at line 208 of file ChipViewport.cpp.

References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), Isis::Chip::TackSample(), x, and y.

void Qisis::ChipViewport::panUp (  )  [slot]

Pan down.

Definition at line 186 of file ChipViewport.cpp.

References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), Isis::Chip::TackSample(), x, and y.

void Qisis::ChipViewport::refreshView ( double  tackSample,
double  tackLine 
) [slot]

If mouse enters, make sure key events are processed w/o clicking.

Definition at line 263 of file ChipViewport.cpp.

References reloadChip().

void Qisis::ChipViewport::reloadChip ( double  tackSample = 0.,
double  tackLine = 0. 
) [private]

Reloads the chip.

Parameters:
tackSample 
tackLine 

Definition at line 397 of file ChipViewport.cpp.

References _FILEINFO_, autoStretch(), Isis::Chip::Load(), Isis::iException::Message(), p_chip, p_chipCube, p_geomIt, p_matchChip, p_matchChipCube, p_rotation, p_zoomFactor, Isis::Chip::TackCube(), and tackPointChanged().

Referenced by keyPressEvent(), mousePressEvent(), panDown(), panLeft(), panRight(), panUp(), refreshView(), zoom1(), zoomIn(), and zoomOut().

void Qisis::ChipViewport::rotateChip ( int  rotation  )  [slot]

Slot to rotate chip.

Parameters:
rotation 

Definition at line 380 of file ChipViewport.cpp.

References autoStretch(), Isis::Chip::Load(), p_chip, p_chipCube, p_rotation, and p_zoomFactor.

void Qisis::ChipViewport::setChip ( Isis::Chip chip,
Isis::Cube chipCube 
)

Set the chip for this ChipViewport.

Author:
Tracie Sucharski

For internal use only.

History:
2009-14-2009 Tracie Sucharski - Make sure the p_image is clear before allocating new.

Definition at line 49 of file ChipViewport.cpp.

References _FILEINFO_, autoStretch(), chip(), Isis::Chip::Lines(), Isis::iException::Message(), p_chip, p_chipCube, p_image, p_rotation, p_zoomFactor, Isis::Chip::Samples(), and tackPointChanged().

Referenced by Qisis::ControlPointEdit::setLeftMeasure(), and Qisis::ControlPointEdit::setRightMeasure().

void Qisis::ChipViewport::setCircleSize ( int  size  )  [slot]

Slot to geom chip.

Definition at line 339 of file ChipViewport.cpp.

References p_circleSize.

double Qisis::ChipViewport::tackLine (  ) 

returns tack Line Pan up

Returns:
double

Definition at line 179 of file ChipViewport.cpp.

References Isis::Chip::CubeLine(), p_chip, Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().

Referenced by Qisis::ControlPointEdit::findPoint(), Qisis::ControlPointEdit::savePoint(), Qisis::ControlPointEdit::updateLeftPositionLabel(), and Qisis::ControlPointEdit::updateRightPositionLabel().

void Qisis::ChipViewport::tackPointChanged ( double   )  [signal]

< Signal sent when tack point changes

Referenced by reloadChip(), and setChip().

double Qisis::ChipViewport::tackSample (  ) 

Returns tack sample.

Returns:
double

Definition at line 167 of file ChipViewport.cpp.

References Isis::Chip::CubeSample(), p_chip, Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().

Referenced by Qisis::ControlPointEdit::findPoint(), Qisis::ControlPointEdit::savePoint(), Qisis::ControlPointEdit::updateLeftPositionLabel(), and Qisis::ControlPointEdit::updateRightPositionLabel().

void Qisis::ChipViewport::zoom1 (  )  [slot]

Zoom by a factor of one. Slot to refresh viewport , point has changed.

Definition at line 255 of file ChipViewport.cpp.

References p_zoomFactor, and reloadChip().

void Qisis::ChipViewport::zoomIn (  )  [slot]

Zoom in.

Definition at line 233 of file ChipViewport.cpp.

References p_zoomFactor, and reloadChip().

void Qisis::ChipViewport::zoomOut (  )  [slot]

Zoom out.

Definition at line 244 of file ChipViewport.cpp.

References p_zoomFactor, and reloadChip().


Member Data Documentation

Isis::Chip* Qisis::ChipViewport::p_chip [private]

The chip.

Definition at line 143 of file ChipViewport.h.

Referenced by chip(), chipLines(), chipSamples(), ChipViewport(), computeStretch(), geomChip(), keyPressEvent(), mousePressEvent(), nogeomChip(), paintImage(), panDown(), panLeft(), panRight(), panUp(), reloadChip(), rotateChip(), setChip(), tackLine(), and tackSample().

Isis::Cube* Qisis::ChipViewport::p_chipCube [private]

The chip's cube.

Definition at line 144 of file ChipViewport.h.

Referenced by ChipViewport(), geomChip(), nogeomChip(), reloadChip(), rotateChip(), and setChip().

bool Qisis::ChipViewport::p_circle [private]

Draw circle.

Definition at line 159 of file ChipViewport.h.

Referenced by ChipViewport(), paintEvent(), and setCircle().

int Qisis::ChipViewport::p_circleSize [private]

Circle size.

Definition at line 160 of file ChipViewport.h.

Referenced by paintEvent(), and setCircleSize().

bool Qisis::ChipViewport::p_cross [private]

Draw crosshair.

Definition at line 158 of file ChipViewport.h.

Referenced by ChipViewport(), paintEvent(), and setCross().

bool Qisis::ChipViewport::p_geomIt [private]

geomIt?

Definition at line 149 of file ChipViewport.h.

Referenced by ChipViewport(), geomChip(), nogeomChip(), and reloadChip().

BandInfo Qisis::ChipViewport::p_gray [private]

info for the gray bands.

Definition at line 142 of file ChipViewport.h.

Referenced by autoStretch(), grayBand(), grayStretch(), and paintImage().

int Qisis::ChipViewport::p_height [private]

Chip height.

Definition at line 147 of file ChipViewport.h.

Referenced by ChipViewport(), and paintEvent().

QImage* Qisis::ChipViewport::p_image [private]

The image.

Definition at line 156 of file ChipViewport.h.

Referenced by ChipViewport(), paintEvent(), paintImage(), and setChip().

Isis::Chip* Qisis::ChipViewport::p_matchChip [private]

The matching chip.

Definition at line 150 of file ChipViewport.h.

Referenced by ChipViewport(), geomChip(), and reloadChip().

Isis::Cube* Qisis::ChipViewport::p_matchChipCube [private]

The matching chip's cube.

Definition at line 151 of file ChipViewport.h.

Referenced by ChipViewport(), geomChip(), and reloadChip().

bool Qisis::ChipViewport::p_paintImage [private]

Paint Image?

Definition at line 157 of file ChipViewport.h.

int Qisis::ChipViewport::p_rotation [private]

Rotation.

Definition at line 154 of file ChipViewport.h.

Referenced by ChipViewport(), nogeomChip(), reloadChip(), rotateChip(), and setChip().

ChipViewport* Qisis::ChipViewport::p_tempView [private]

Temporary viewport.

Definition at line 162 of file ChipViewport.h.

Referenced by ChipViewport(), loadView(), and paintEvent().

int Qisis::ChipViewport::p_width [private]

Chip width.

Definition at line 146 of file ChipViewport.h.

Referenced by ChipViewport(), and paintEvent().

double Qisis::ChipViewport::p_zoomFactor [private]

Zoom Factor.

Definition at line 153 of file ChipViewport.h.

Referenced by ChipViewport(), nogeomChip(), reloadChip(), rotateChip(), setChip(), zoom1(), zoomIn(), and zoomOut().


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