Isis Developer Reference
Isis::ChipViewport Class Reference

Viewport for Isis Chips. More...

#include <ChipViewport.h>

Inheritance diagram for Isis::ChipViewport:
Inheritance graph
Collaboration diagram for Isis::ChipViewport:
Collaboration graph

Public Slots

void autoStretch ()
 Apply automatic stretch using data from entire chip. More...
 
void stretchFromCubeViewport (Stretch *, CubeViewport *)
 Applies a new stretch to the specified cube viewport. More...
 
void changeStretchLock (int)
 Locks or unlocks the stretch on the chip viewport during transformations (zoom, pan, etc.) More...
 
void setPoints (bool checked)
 Slot to set whether control points are drawn. More...
 
void setCross (bool checked)
 Slot to change state of crosshair. More...
 
void rotateChip (int rotation)
 Slot to rotate chip. More...
 
void setCircle (bool checked)
 Slot to change state of circle. More...
 
void setCircleSize (int size)
 Set the size of the circle. More...
 
void geomChip (Chip *matchChip, Cube *matchChipCube)
 Slot to geom chip (apply geometry transformation) More...
 
void nogeomChip ()
 Slot to un-geom chip (revert geometry transformation) More...
 
void panUp ()
 Pan up. More...
 
void panDown ()
 Pan down. More...
 
void panLeft ()
 Pan left. More...
 
void panRight ()
 Pan right. More...
 
void zoomIn ()
 Zoom in. More...
 
void zoomOut ()
 Zoom out. More...
 
void zoom1 ()
 Zoom by a factor of one. More...
 
void zoom (double zoomFactor)
 Zoom by a specified factor. More...
 
void refreshView (double tackSample, double tackLine)
 Slot to refresh viewport when the tack point has changed. More...
 
void setControlNet (ControlNet *newControlNet)
 sets the ControlNet to be used for drawing measure locations More...
 

Signals

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

Public Member Functions

 ChipViewport (int width, int height, QWidget *parent=0)
 Construct an empty viewport. More...
 
virtual ~ChipViewport ()
 Destructor. More...
 
bool cubeToViewport (double samp, double line, int &x, int &y)
 Get viewport x and y from cube sample and line. More...
 
void setChip (Chip *chip, Cube *chipCube)
 Set chip. More...
 
void loadView (ChipViewport &newView)
 Load with another ChipViewport, used for blinking. More...
 
Chipchip () const
 Return chip. More...
 
CubechipCube () const
 
int chipSamples () const
 Return the number of samples in the chip. More...
 
int chipLines () const
 Return the number of lines in the chip. More...
 
int grayBand () const
 Return the gray band currently viewed. More...
 
double tackSample ()
 Return the position of cube under cross hair. More...
 
double tackLine ()
 Returns tack line. More...
 
double zoomFactor ()
 Return the zoom factor. More...
 
Stretch grayStretch () const
 Draw X on point. More...
 

Protected Member Functions

void paintEvent (QPaintEvent *e)
 Repaint the viewport. More...
 
void enterEvent (QEvent *e)
 If mouse enters, make sure key events are processed w/o clicking. More...
 
void keyPressEvent (QKeyEvent *e)
 Process arrow keystrokes on cube. More...
 
void mousePressEvent (QMouseEvent *event)
 Process mouse events. More...
 

Detailed Description

Viewport for Isis Chips.

Author
2007-05-01 Tracie Sucharski

Constructor & Destructor Documentation

◆ ChipViewport()

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

Construct an empty viewport.

Parameters
widthThe width of the viewport
heightThe height of the viewport
parentThe parent widget

◆ ~ChipViewport()

Isis::ChipViewport::~ChipViewport ( )
virtual

Destructor.

Member Function Documentation

◆ autoStretch

void Isis::ChipViewport::autoStretch ( )
slot

Apply automatic stretch using data from entire chip.

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

◆ changeStretchLock

void Isis::ChipViewport::changeStretchLock ( int  newStatus)
slot

Locks or unlocks the stretch on the chip viewport during transformations (zoom, pan, etc.)

Parameters
newStatusNon-zero locks the stretch

◆ chip()

Chip* Isis::ChipViewport::chip ( ) const
inline

Return chip.

Referenced by setChip().

◆ chipCube()

Cube* Isis::ChipViewport::chipCube ( ) const
inline

Referenced by setChip().

◆ chipLines()

int Isis::ChipViewport::chipLines ( ) const
inline

Return the number of lines in the chip.

References Isis::Chip::Lines().

◆ chipSamples()

int Isis::ChipViewport::chipSamples ( ) const
inline

Return the number of samples in the chip.

References Isis::Chip::Samples().

◆ cubeToViewport()

bool Isis::ChipViewport::cubeToViewport ( double  samp,
double  line,
int &  x,
int &  y 
)

Get viewport x and y from cube sample and line.

Parameters
sampSample in cube
lineLine in cube
xCalcualated viewport x coordinate
yCalcualated viewport y coordinate
Returns
bool true if the point is contained in the viewport, false otherwise

References Isis::Chip::ChipLine(), Isis::Chip::ChipSample(), Isis::Chip::IsInsideChip(), and Isis::Chip::SetCubePosition().

Referenced by paintEvent().

◆ enterEvent()

void Isis::ChipViewport::enterEvent ( QEvent *  e)
protected

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

Parameters
eQEvent

◆ geomChip

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

Slot to geom chip (apply geometry transformation)

Parameters
matchChipThe matching chip for the geometry
matchChipCubeThe matching chip's cube for the geometry

References autoStretch(), Isis::Chip::Load(), and Isis::IException::toString().

◆ grayBand()

int Isis::ChipViewport::grayBand ( ) const
inline

Return the gray band currently viewed.

◆ grayStretch()

Stretch Isis::ChipViewport::grayStretch ( ) const
inline

Draw X on point.

Return the gray band stretch

◆ keyPressEvent()

void Isis::ChipViewport::keyPressEvent ( QKeyEvent *  e)
protected

◆ loadView()

void Isis::ChipViewport::loadView ( ChipViewport newView)

Load with another ChipViewport, used for blinking.

Load with info from given ChipViewport.

Parameters
newViewThe chip viewport to load from

◆ mousePressEvent()

void Isis::ChipViewport::mousePressEvent ( QMouseEvent *  event)
protected

◆ nogeomChip

void Isis::ChipViewport::nogeomChip ( )
slot

Slot to un-geom chip (revert geometry transformation)

References autoStretch(), Isis::Chip::Load(), and Isis::IException::toString().

◆ paintEvent()

◆ panDown

◆ panLeft

◆ panRight

◆ panUp

◆ refreshView

void Isis::ChipViewport::refreshView ( double  tackSample,
double  tackLine 
)
slot

Slot to refresh viewport when the tack point has changed.

Parameters
tackSampleSample on the cube to load the chip viewport at (center)
tackLineLine on the cube to load the chip viewport at (center)

References tackLine(), and tackSample().

◆ rotateChip

void Isis::ChipViewport::rotateChip ( int  rotation)
slot

Slot to rotate chip.

Parameters
rotationHow much to rotate the chip

References autoStretch(), Isis::Chip::Load(), and Isis::IException::toString().

◆ setChip()

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

Set chip.

Set the chip for this ChipViewport.

Parameters
chipPointer to the chip to set the viewport with
chipCubePointer to the chip's cube
Exceptions
IException::Programmer"Can not view NULL chip pointer"
Author
Tracie Sucharski

References _FILEINFO_, autoStretch(), chip(), chipCube(), Isis::Chip::Lines(), Isis::IException::Programmer, Isis::Chip::Samples(), and tackPointChanged().

Referenced by Isis::ControlMeasureEditWidget::setLeftMeasure(), Isis::ControlPointEdit::setLeftMeasure(), Isis::ChipViewportsWidget::setPoint(), Isis::ControlMeasureEditWidget::setRightMeasure(), and Isis::ControlPointEdit::setRightMeasure().

◆ setCircle

void Isis::ChipViewport::setCircle ( bool  checked)
slot

Slot to change state of circle.

Parameters
checkedCircle set to be drawn if true

◆ setCircleSize

void Isis::ChipViewport::setCircleSize ( int  size)
slot

Set the size of the circle.

Parameters
sizeThe size of the circle

◆ setControlNet

void Isis::ChipViewport::setControlNet ( ControlNet newControlNet)
inlineslot

sets the ControlNet to be used for drawing measure locations

Parameters
newControlNetThe new ControlNet to be used

Referenced by Isis::ChipViewportsWidget::setPoint().

◆ setCross

void Isis::ChipViewport::setCross ( bool  checked)
slot

Slot to change state of crosshair.

Parameters
checkedCrosshair set to be drawn if true

◆ setPoints

void Isis::ChipViewport::setPoints ( bool  checked)
slot

Slot to set whether control points are drawn.

Parameters
checkedControl points are set to be drawn if true

Referenced by Isis::ChipViewportsWidget::setPoint().

◆ stretchFromCubeViewport

void Isis::ChipViewport::stretchFromCubeViewport ( Stretch newStretch,
CubeViewport cvp 
)
slot

Applies a new stretch to the specified cube viewport.

Parameters
newStretchPointer to the new stretch to apply
cvpPointer to the cube viewport to apply the stretch to

References ASSERT, Isis::CubeViewport::cube(), and Isis::Cube::fileName().

◆ tackLine()

double Isis::ChipViewport::tackLine ( )

Returns tack line.

Returns
double The tack line for the chip

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

Referenced by refreshView().

◆ tackPointChanged

void Isis::ChipViewport::tackPointChanged ( double  )
signal

< Signal sent when tack point changes

Referenced by setChip().

◆ tackSample()

double Isis::ChipViewport::tackSample ( )

Return the position of cube under cross hair.

Returns tack sample.

Returns
double The tack sample for the chip

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

Referenced by refreshView().

◆ userMovedTackPoint

void Isis::ChipViewport::userMovedTackPoint ( )
signal

Referenced by keyPressEvent(), and mousePressEvent().

◆ zoom

void Isis::ChipViewport::zoom ( double  zoomFactor)
slot

Zoom by a specified factor.

Parameters
zoomFactorThe zoom factor

References zoomFactor().

◆ zoom1

void Isis::ChipViewport::zoom1 ( )
slot

Zoom by a factor of one.

◆ zoomFactor()

double Isis::ChipViewport::zoomFactor ( )

Return the zoom factor.

Returns the current zoom factor.

Returns
double The current zoom factor

Referenced by zoom().

◆ zoomIn

void Isis::ChipViewport::zoomIn ( )
slot

Zoom in.

◆ zoomOut

void Isis::ChipViewport::zoomOut ( )
slot

Zoom out.


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