Isis 3.0 Object Programmers' Reference |
Home |
Viewport for Isis Chips. More...
#include <ChipViewport.h>
Classes | |
class | BandInfo |
Public Slots | |
void | autoStretch () |
Apply automatic stretch using data from entire chip. | |
void | stretchFromCubeViewport (Stretch *, CubeViewport *) |
void | changeStretchLock (int) |
void | setPoints (bool checked) |
Slot to change state of crosshair. | |
void | setCross (bool checked) |
void | rotateChip (int rotation) |
Slot to rotate chip. | |
void | setCircle (bool checked) |
void | setCircleSize (int size) |
void | geomChip (Chip *matchChip, Cube *matchChipCube) |
Slot to geom chip. | |
void | nogeomChip () |
Slot to geom chip. | |
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. | |
void | zoom (double zoomFactor) |
void | refreshView (double tackSample, double tackLine) |
If mouse enters, make sure key events are processed w/o clicking. | |
void | setControlNet (ControlNet *newControlNet) |
sets the ControlNet to be used for drawing measure locations | |
Signals | |
void | tackPointChanged (double) |
< Signal sent when tack point changes | |
void | userMovedTackPoint () |
Public Member Functions | |
ChipViewport (int width, int height, QWidget *parent=0) | |
Construct an empty viewport. | |
virtual | ~ChipViewport () |
Destructor. | |
bool | cubeToViewport (double samp, double line, int &x, int &y) |
get viewport x and y from cube sample and line | |
void | setChip (Chip *chip, Cube *chipCube) |
Set chip. | |
void | loadView (ChipViewport &newView) |
Load with another ChipViewport, used for blinking. | |
Chip * | chip () 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 () |
Return the position of cube under cross hair. | |
double | tackLine () |
returns tack Line | |
double | zoomFactor () |
Return the zoom factor. | |
Stretch | grayStretch () const |
Draw X on point. | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *e) |
Repaint the viewport. | |
void | enterEvent (QEvent *e) |
Process arrow keystrokes on cube. | |
void | keyPressEvent (QKeyEvent *e) |
void | mousePressEvent (QMouseEvent *event) |
Process mouse events. | |
Private Member Functions | |
void | reloadChip (double tackSample=0., double tackLine=0.) |
Reloads the chip. | |
void | computeStretch (Stretch &stretch, bool force=false) |
Compute automatic stretch for a portion of the cube. | |
void | paintImage () |
Paint QImage. | |
Private Attributes | |
BandInfo | p_gray |
info for the gray bands. | |
Chip * | p_chip |
The chip. | |
Cube * | p_chipCube |
The chip's cube. | |
int | p_width |
Chip width. | |
int | p_height |
Chip height. | |
bool | p_geomIt |
geomIt? | |
Chip * | p_matchChip |
The matching chip. | |
Cube * | p_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_showPoints |
Draw control points. | |
bool | p_cross |
Draw crosshair. | |
bool | p_circle |
Draw circle. | |
int | p_circleSize |
Circle size. | |
ChipViewport * | p_tempView |
Temporary viewport. | |
ControlNet * | p_controlNet |
bool | p_stretchLocked |
Stretch * | p_stretch |
Viewport for Isis Chips.
2008-09-09 Tracie Sucharski - Added setCircle and setCircleSize methods.
2010-06-16 Jeannie Walldren - Modified geomChip(), nogeomChip(), rotateChip() and reloadChip() to catch possible iExceptions from Chip's Load() method and display Error in QMessageBox
2010-11-17 Eric Hyer - Added cubeToViewport method and setControlNet slot. paintEvent can now use the control net to paint measures in the viewport.
2010-11-22 Eric Hyer - ChipViewports can now be stretched by stretching CubeViewports opened to the same cube
2010-11-24 Eric Hyer - Fixed bug where crosses were painted one screen pixel off on each direction. Also no longer paint cross under the large main red crosses.
2010-12-01 Eric Hyer - Added stretch locking
2011-06-07 Debbie A. Cook and Tracie Sucharski - Changed point type "Ground" to "Fixed".
2011-06-14 Tracie Sucharski - Added mouseClick signal. Qnet needed to know if user moved the tackpoint vs. simply loading a new chip, or geoming the chip.
2011-06-15 Tracie Sucharski - Changed signal mouseClick to userMovedTackPoint. TODO: Could not use tackPointChanged signal because that signal is emitted whenever the measure is loaded not just when the user initiates the move. This should be cleaned up.
2011-09-14 Tracie Sucharski - Added user option to determine whether control points are drawn.
2012-07-26 Tracie Sucharski - Added method to return zoom factor and slot to zoom to a specific zoom factor.
Definition at line 85 of file ChipViewport.h.
Isis::ChipViewport::ChipViewport | ( | int | width, |
int | height, | ||
QWidget * | parent = 0 |
||
) |
Construct an empty viewport.
Definition at line 21 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.
|
virtual |
Destructor.
Definition at line 53 of file ChipViewport.cpp.
|
slot |
Apply automatic stretch using data from entire chip.
Definition at line 114 of file ChipViewport.cpp.
References computeStretch(), p_gray, and paintImage().
Referenced by geomChip(), nogeomChip(), reloadChip(), rotateChip(), and setChip().
|
inline |
Return chip.
Definition at line 102 of file ChipViewport.h.
References p_chip.
Referenced by setChip().
|
inline |
Return the number of lines in the chip.
Definition at line 112 of file ChipViewport.h.
References Isis::Chip::Lines(), and p_chip.
|
inline |
Return the number of samples in the chip.
Definition at line 107 of file ChipViewport.h.
References p_chip, and Isis::Chip::Samples().
|
private |
Compute automatic stretch for a portion of the cube.
Definition at line 160 of file ChipViewport.cpp.
References Isis::Statistics::AddData(), Isis::Stretch::AddPair(), Isis::Statistics::BestMaximum(), Isis::Statistics::BestMinimum(), Isis::Stretch::ClearPairs(), Isis::Chip::GetValue(), Isis::Chip::Lines(), p_chip, and Isis::Chip::Samples().
Referenced by autoStretch().
bool Isis::ChipViewport::cubeToViewport | ( | double | samp, |
double | line, | ||
int & | x, | ||
int & | y | ||
) |
get viewport x and y from cube sample and line
samp | Sample in cube |
line | Line in cube |
x | calcualated viewport x coordinate |
y | calcualated viewport y coordinate |
Definition at line 71 of file ChipViewport.cpp.
References Isis::Chip::ChipLine(), Isis::Chip::ChipSample(), Isis::Chip::IsInsideChip(), p_chip, and Isis::Chip::SetCubePosition().
Referenced by paintEvent().
|
protected |
Process arrow keystrokes on cube.
Definition at line 426 of file ChipViewport.cpp.
Slot to geom chip.
Definition at line 535 of file ChipViewport.cpp.
References autoStretch(), Isis::Chip::Load(), p_chip, p_chipCube, p_geomIt, p_matchChip, p_matchChipCube, and Isis::IException::toString().
Referenced by Isis::ControlPointEdit::setGeom(), and Isis::ControlPointEdit::updateRightGeom().
|
inline |
Return the gray band currently viewed.
Definition at line 117 of file ChipViewport.h.
References p_gray.
|
inline |
Draw X on point.
Return the gray band stretch
Definition at line 133 of file ChipViewport.h.
References p_gray.
void Isis::ChipViewport::loadView | ( | ChipViewport & | newView | ) |
Load with another ChipViewport, used for blinking.
Load with info from given ChipViewport.
Definition at line 297 of file ChipViewport.cpp.
References p_tempView.
Referenced by Isis::ControlPointEdit::updateBlink().
|
protected |
Process mouse events.
Slot to set whether control points are drawn
Definition at line 469 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), and Isis::Chip::SetChipPosition().
|
slot |
Slot to geom chip.
Definition at line 561 of file ChipViewport.cpp.
References autoStretch(), Isis::Chip::Load(), p_chip, p_chipCube, p_geomIt, p_rotation, p_zoomFactor, and Isis::IException::toString().
Referenced by Isis::ControlPointEdit::setNoGeom(), and Isis::ControlPointEdit::setRotate().
|
protected |
Repaint the viewport.
2011-08-23 Tracie Sucharski - Use the GetMeasuresInCube method from ControlNet to get list of measures rather than searching through entire net.
2011-11-09 Tracie Sucharski - If there are no measures for this cube, return.
Definition at line 224 of file ChipViewport.cpp.
References Isis::SerialNumber::Compose(), cubeToViewport(), Isis::ControlPoint::Fixed, Isis::ControlNet::GetCubeSerials(), Isis::ControlNet::GetMeasuresInCube(), Isis::ControlNet::GetNumPoints(), Isis::ControlPoint::GetType(), p_chipCube, p_circle, p_circleSize, p_cross, p_height, p_image, p_showPoints, p_tempView, and p_width.
|
private |
Paint QImage.
Definition at line 197 of file ChipViewport.cpp.
References Isis::Chip::GetValue(), Isis::Chip::Lines(), Isis::Stretch::Map(), p_chip, p_gray, p_image, and Isis::Chip::Samples().
Referenced by autoStretch().
|
slot |
Pan left.
Definition at line 339 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
|
slot |
Pan right.
Definition at line 350 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
|
slot |
Pan down.
Definition at line 328 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), p_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
|
slot |
If mouse enters, make sure key events are processed w/o clicking.
Definition at line 418 of file ChipViewport.cpp.
References reloadChip().
|
private |
Reloads the chip.
tackSample | |
tackLine |
Definition at line 617 of file ChipViewport.cpp.
References _FILEINFO_, autoStretch(), Isis::Chip::Load(), p_chip, p_chipCube, p_geomIt, p_matchChip, p_matchChipCube, p_rotation, p_zoomFactor, Isis::IException::Programmer, Isis::Chip::TackCube(), tackPointChanged(), Isis::IException::toString(), and Isis::IException::User.
Referenced by mousePressEvent(), panDown(), panLeft(), panUp(), refreshView(), zoom1(), zoomIn(), and zoomOut().
|
slot |
Slot to rotate chip.
rotation |
Definition at line 590 of file ChipViewport.cpp.
References autoStretch(), Isis::Chip::Load(), p_chip, p_chipCube, p_rotation, p_zoomFactor, and Isis::IException::toString().
Set chip.
Set the chip for this ChipViewport.
Definition at line 91 of file ChipViewport.cpp.
References _FILEINFO_, autoStretch(), chip(), Isis::Chip::Lines(), p_chip, p_chipCube, p_image, p_rotation, p_zoomFactor, Isis::IException::Programmer, Isis::Chip::Samples(), and tackPointChanged().
Referenced by Isis::ControlPointEdit::setLeftMeasure(), and Isis::ControlPointEdit::setRightMeasure().
|
inlineslot |
sets the ControlNet to be used for drawing measure locations
newControlNet | The new ControlNet to be used |
Definition at line 177 of file ChipViewport.h.
|
slot |
Slot to change state of crosshair.
Definition at line 487 of file ChipViewport.cpp.
References p_showPoints.
double Isis::ChipViewport::tackLine | ( | ) |
returns tack Line
Definition at line 321 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), p_chip, Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
Referenced by Isis::ControlPointEdit::findPoint(), Isis::ControlPointEdit::saveMeasure(), Isis::ControlPointEdit::updateLeftPositionLabel(), and Isis::ControlPointEdit::updateRightPositionLabel().
|
signal |
< Signal sent when tack point changes
Referenced by reloadChip(), and setChip().
double Isis::ChipViewport::tackSample | ( | ) |
Return the position of cube under cross hair.
Returns tack sample.
Definition at line 309 of file ChipViewport.cpp.
References Isis::Chip::CubeSample(), p_chip, Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
Referenced by Isis::ControlPointEdit::findPoint(), Isis::ControlPointEdit::saveMeasure(), Isis::ControlPointEdit::updateLeftPositionLabel(), and Isis::ControlPointEdit::updateRightPositionLabel().
|
slot |
Zoom by a factor of one.
Definition at line 397 of file ChipViewport.cpp.
References p_zoomFactor, and reloadChip().
double Isis::ChipViewport::zoomFactor | ( | ) |
Return the zoom factor.
Slot to refresh viewport , point has changed.
Definition at line 411 of file ChipViewport.cpp.
References p_zoomFactor.
Referenced by Isis::ControlPointEdit::setZoomLink(), and Isis::ControlPointEdit::updateLeftPositionLabel().
|
slot |
Zoom in.
Definition at line 375 of file ChipViewport.cpp.
References p_zoomFactor, and reloadChip().
|
slot |
Zoom out.
Definition at line 386 of file ChipViewport.cpp.
References p_zoomFactor, and reloadChip().
|
private |
The chip.
Definition at line 217 of file ChipViewport.h.
Referenced by chip(), chipLines(), chipSamples(), ChipViewport(), computeStretch(), cubeToViewport(), geomChip(), mousePressEvent(), nogeomChip(), paintImage(), panDown(), panLeft(), panUp(), reloadChip(), rotateChip(), setChip(), tackLine(), and tackSample().
|
private |
The chip's cube.
Definition at line 218 of file ChipViewport.h.
Referenced by ChipViewport(), geomChip(), nogeomChip(), paintEvent(), reloadChip(), rotateChip(), and setChip().
|
private |
Draw circle.
Definition at line 234 of file ChipViewport.h.
Referenced by ChipViewport(), and paintEvent().
|
private |
|
private |
Draw crosshair.
Definition at line 233 of file ChipViewport.h.
Referenced by ChipViewport(), and paintEvent().
|
private |
geomIt?
Definition at line 223 of file ChipViewport.h.
Referenced by ChipViewport(), geomChip(), nogeomChip(), and reloadChip().
|
private |
info for the gray bands.
Definition at line 216 of file ChipViewport.h.
Referenced by autoStretch(), grayBand(), grayStretch(), and paintImage().
|
private |
Chip height.
Definition at line 221 of file ChipViewport.h.
Referenced by ChipViewport(), and paintEvent().
|
private |
The image.
Definition at line 230 of file ChipViewport.h.
Referenced by ChipViewport(), paintEvent(), paintImage(), and setChip().
|
private |
The matching chip.
Definition at line 224 of file ChipViewport.h.
Referenced by ChipViewport(), geomChip(), and reloadChip().
|
private |
The matching chip's cube.
Definition at line 225 of file ChipViewport.h.
Referenced by ChipViewport(), geomChip(), and reloadChip().
|
private |
Paint Image?
Definition at line 231 of file ChipViewport.h.
|
private |
Rotation.
Definition at line 228 of file ChipViewport.h.
Referenced by ChipViewport(), nogeomChip(), reloadChip(), rotateChip(), and setChip().
|
private |
Draw control points.
Definition at line 232 of file ChipViewport.h.
Referenced by paintEvent(), and setPoints().
|
private |
Temporary viewport.
Definition at line 237 of file ChipViewport.h.
Referenced by ChipViewport(), loadView(), and paintEvent().
|
private |
Chip width.
Definition at line 220 of file ChipViewport.h.
Referenced by ChipViewport(), and paintEvent().
|
private |
Zoom Factor.
Definition at line 227 of file ChipViewport.h.
Referenced by ChipViewport(), nogeomChip(), reloadChip(), rotateChip(), setChip(), zoom1(), zoomFactor(), zoomIn(), and zoomOut().