![]() |
Isis 3 Programmer Reference
|
Viewport for Isis Chips. More...
#include <ChipViewport.h>
Classes | |
class | BandInfo |
Sets the mapping for gray band stretch. More... | |
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... | |
Chip * | chip () const |
Return chip. More... | |
Cube * | chipCube () 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... | |
Private Member Functions | |
void | reloadChip (double tackSample=0., double tackLine=0.) |
Reloads the chip at the given tack point on the cube. More... | |
void | computeStretch (Stretch &stretch, bool force=false) |
Compute automatic stretch for a portion of the cube. More... | |
void | paintImage () |
Paints the chip viewport after the chip has been updated. More... | |
Private Attributes | |
BandInfo | m_gray |
Info for the gray bands. More... | |
Chip * | m_chip |
The chip. More... | |
Cube * | m_chipCube |
The chip's cube. More... | |
int | m_width |
Chip width. More... | |
int | m_height |
Chip height. More... | |
bool | m_geomIt |
geomIt? More... | |
Chip * | m_matchChip |
The matching chip. More... | |
Cube * | m_matchChipCube |
The matching chip's cube. More... | |
double | m_zoomFactor |
Zoom Factor. More... | |
int | m_rotation |
Rotation. More... | |
QImage * | m_image |
The image. More... | |
bool | m_paintImage |
Paint Image? More... | |
bool | m_showPoints |
Draw control points. More... | |
bool | m_cross |
Draw crosshair. More... | |
bool | m_circle |
Draw circle. More... | |
int | m_circleSize |
Circle size. More... | |
ChipViewport * | m_tempView |
Temporary viewport. More... | |
ControlNet * | m_controlNet |
bool | m_stretchLocked |
Whether or not to lock the stretch when transforming. More... | |
Stretch * | m_stretch |
Current stretch on the chip viewport. More... | |
Viewport for Isis Chips.
Definition at line 71 of file ChipViewport.h.
Isis::ChipViewport::ChipViewport | ( | int | width, |
int | height, | ||
QWidget * | parent = 0 |
||
) |
Construct an empty viewport.
width | The width of the viewport |
height | The height of the viewport |
parent | The parent widget |
Definition at line 35 of file ChipViewport.cpp.
References m_chip, m_chipCube, m_circle, m_cross, m_geomIt, m_height, m_image, m_matchChip, m_matchChipCube, m_rotation, m_stretch, m_stretchLocked, m_tempView, m_width, and m_zoomFactor.
|
virtual |
|
slot |
Apply automatic stretch using data from entire chip.
Definition at line 135 of file ChipViewport.cpp.
References computeStretch(), m_gray, paintImage(), and Isis::ChipViewport::BandInfo::stretch.
Referenced by geomChip(), nogeomChip(), reloadChip(), rotateChip(), and setChip().
|
slot |
Locks or unlocks the stretch on the chip viewport during transformations (zoom, pan, etc.)
newStatus | Non-zero locks the stretch |
Definition at line 182 of file ChipViewport.cpp.
References m_stretchLocked.
|
inline |
Return chip.
Definition at line 88 of file ChipViewport.h.
References m_chip.
Referenced by setChip().
|
inline |
Return the number of lines in the chip.
Definition at line 102 of file ChipViewport.h.
References Isis::Chip::Lines(), and m_chip.
|
inline |
Return the number of samples in the chip.
Definition at line 97 of file ChipViewport.h.
References m_chip, and Isis::Chip::Samples().
|
private |
Compute automatic stretch for a portion of the cube.
If the stretch is locked and force is false, no computations will be performed.
stretch | Reference to the stretch to be computed (if unlocked) |
force | If true, forces the stretch to be computed. |
Definition at line 197 of file ChipViewport.cpp.
References Isis::Histogram::AddData(), Isis::Statistics::AddData(), Isis::Stretch::AddPair(), Isis::Statistics::BestMaximum(), Isis::Statistics::BestMinimum(), Isis::Stretch::ClearPairs(), Isis::Chip::GetValue(), Isis::Chip::Lines(), m_chip, m_stretch, m_stretchLocked, Isis::Histogram::Percent(), and Isis::Chip::Samples().
Referenced by autoStretch(), and stretchFromCubeViewport().
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 85 of file ChipViewport.cpp.
References Isis::Chip::ChipLine(), Isis::Chip::ChipSample(), Isis::Chip::IsInsideChip(), m_chip, and Isis::Chip::SetCubePosition().
Referenced by paintEvent().
|
protected |
If mouse enters, make sure key events are processed w/o clicking.
e | QEvent |
Definition at line 486 of file ChipViewport.cpp.
Slot to geom chip (apply geometry transformation)
matchChip | The matching chip for the geometry |
matchChipCube | The matching chip's cube for the geometry |
Definition at line 621 of file ChipViewport.cpp.
References autoStretch(), Isis::Chip::Load(), m_chip, m_chipCube, m_geomIt, m_matchChip, m_matchChipCube, and Isis::IException::toString().
Referenced by Isis::ControlMeasureEditWidget::blinkStartRight(), Isis::ControlMeasureEditWidget::setGeom(), Isis::ControlPointEdit::setGeom(), Isis::ControlMeasureEditWidget::updateRightGeom(), and Isis::ControlPointEdit::updateRightGeom().
|
inline |
Return the gray band currently viewed.
Definition at line 107 of file ChipViewport.h.
References Isis::ChipViewport::BandInfo::band, and m_gray.
|
inline |
Draw X on point.
Return the gray band stretch
Definition at line 122 of file ChipViewport.h.
References m_gray, and Isis::ChipViewport::BandInfo::stretch.
|
protected |
Process arrow keystrokes on cube.
e | QKeyEvent |
Definition at line 496 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), m_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
void Isis::ChipViewport::loadView | ( | ChipViewport & | newView | ) |
Load with another ChipViewport, used for blinking.
Load with info from given ChipViewport.
newView | The chip viewport to load from |
Definition at line 342 of file ChipViewport.cpp.
References m_tempView.
Referenced by Isis::ControlMeasureEditWidget::updateBlink(), Isis::ControlPointEdit::updateBlink(), and Isis::ControlMeasureEditWidget::updateBlinkRight().
|
protected |
Process mouse events.
event | QMouseEvent |
Definition at line 534 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), m_chip, reloadChip(), and Isis::Chip::SetChipPosition().
|
slot |
Slot to un-geom chip (revert geometry transformation)
Definition at line 649 of file ChipViewport.cpp.
References autoStretch(), Isis::Chip::Load(), m_chip, m_chipCube, m_geomIt, m_rotation, m_zoomFactor, and Isis::IException::toString().
Referenced by Isis::ControlMeasureEditWidget::setNoGeom(), Isis::ControlPointEdit::setNoGeom(), Isis::ControlMeasureEditWidget::setRotate(), and Isis::ControlPointEdit::setRotate().
|
protected |
Repaint the viewport.
e | QPaintEvent |
Definition at line 264 of file ChipViewport.cpp.
References Isis::SerialNumber::Compose(), cubeToViewport(), Isis::ControlPoint::Fixed, Isis::ControlNet::GetCubeSerials(), Isis::ControlNet::GetMeasuresInCube(), Isis::ControlNet::GetNumPoints(), Isis::ControlPoint::GetType(), m_chipCube, m_circle, m_circleSize, m_cross, m_height, m_image, m_showPoints, m_tempView, and m_width.
|
private |
Paints the chip viewport after the chip has been updated.
Definition at line 236 of file ChipViewport.cpp.
References Isis::Chip::GetValue(), Isis::Chip::Lines(), m_chip, m_gray, m_image, Isis::Stretch::Map(), Isis::Chip::Samples(), and Isis::ChipViewport::BandInfo::stretch.
Referenced by autoStretch(), and stretchFromCubeViewport().
|
slot |
Pan down.
Definition at line 386 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), m_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
|
slot |
Pan left.
Definition at line 399 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), m_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
|
slot |
Pan right.
Definition at line 412 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), m_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
|
slot |
Pan up.
Definition at line 373 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), m_chip, reloadChip(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
|
slot |
Slot to refresh viewport when the tack point has changed.
tackSample | Sample on the cube to load the chip viewport at (center) |
tackLine | Line on the cube to load the chip viewport at (center) |
Definition at line 476 of file ChipViewport.cpp.
References reloadChip(), tackLine(), and tackSample().
|
private |
Reloads the chip at the given tack point on the cube.
tackSample | Sample in the cube to load the chip on (center) |
tackLine | Line in the cube to load the chip on (center) |
IException::Programmer | "Can not view NULL chip pointer" |
Definition at line 707 of file ChipViewport.cpp.
References autoStretch(), Isis::Chip::Load(), m_chip, m_chipCube, m_geomIt, m_matchChip, m_matchChipCube, m_rotation, m_zoomFactor, Isis::IException::Programmer, Isis::Chip::TackCube(), tackLine(), tackPointChanged(), tackSample(), Isis::IException::toString(), and Isis::IException::User.
Referenced by keyPressEvent(), mousePressEvent(), panDown(), panLeft(), panRight(), panUp(), refreshView(), zoom(), zoom1(), zoomIn(), and zoomOut().
|
slot |
Slot to rotate chip.
rotation | How much to rotate the chip |
Definition at line 677 of file ChipViewport.cpp.
References autoStretch(), Isis::Chip::Load(), m_chip, m_chipCube, m_rotation, m_zoomFactor, and Isis::IException::toString().
Set chip.
Set the chip for this ChipViewport.
chip | Pointer to the chip to set the viewport with |
chipCube | Pointer to the chip's cube |
IException::Programmer | "Can not view NULL chip pointer" |
Definition at line 110 of file ChipViewport.cpp.
References autoStretch(), chip(), Isis::Chip::Lines(), m_chip, m_chipCube, m_image, m_rotation, m_zoomFactor, Isis::IException::Programmer, Isis::Chip::Samples(), and tackPointChanged().
Referenced by Isis::ControlMeasureEditWidget::blinkStartRight(), Isis::ControlMeasureEditWidget::setLeftMeasure(), Isis::ControlPointEdit::setLeftMeasure(), Isis::ControlMeasureEditWidget::setRightMeasure(), and Isis::ControlPointEdit::setRightMeasure().
|
slot |
Slot to change state of circle.
checked | Circle set to be drawn if true |
Definition at line 588 of file ChipViewport.cpp.
References m_circle.
Referenced by Isis::ControlMeasureEditWidget::setCircle(), and Isis::ControlPointEdit::setCircle().
|
slot |
Set the size of the circle.
size | The size of the circle |
Definition at line 603 of file ChipViewport.cpp.
References m_circleSize.
|
inlineslot |
sets the ControlNet to be used for drawing measure locations
newControlNet | The new ControlNet to be used |
Definition at line 167 of file ChipViewport.h.
|
slot |
Slot to change state of crosshair.
checked | Crosshair set to be drawn if true |
Definition at line 572 of file ChipViewport.cpp.
References m_cross.
|
slot |
Slot to set whether control points are drawn.
checked | Control points are set to be drawn if true |
Definition at line 556 of file ChipViewport.cpp.
References m_showPoints.
Referenced by Isis::ChipViewportsWidget::showPoints().
|
slot |
Applies a new stretch to the specified cube viewport.
newStretch | Pointer to the new stretch to apply |
cvp | Pointer to the cube viewport to apply the stretch to |
Definition at line 148 of file ChipViewport.cpp.
References computeStretch(), Isis::CubeViewport::cube(), Isis::Cube::fileName(), m_chipCube, m_gray, m_stretch, paintImage(), and Isis::ChipViewport::BandInfo::stretch.
double Isis::ChipViewport::tackLine | ( | ) |
Returns tack line.
Definition at line 364 of file ChipViewport.cpp.
References Isis::Chip::CubeLine(), m_chip, Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
Referenced by Isis::ControlMeasureEditWidget::findPoint(), Isis::ControlPointEdit::findPoint(), refreshView(), reloadChip(), Isis::ControlMeasureEditWidget::saveMeasure(), Isis::ControlPointEdit::saveMeasure(), Isis::ControlMeasureEditWidget::updateLeftPositionLabel(), Isis::ControlPointEdit::updateLeftPositionLabel(), Isis::ControlMeasureEditWidget::updateRightPositionLabel(), 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 353 of file ChipViewport.cpp.
References Isis::Chip::CubeSample(), m_chip, Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().
Referenced by Isis::ControlMeasureEditWidget::findPoint(), Isis::ControlPointEdit::findPoint(), refreshView(), reloadChip(), Isis::ControlMeasureEditWidget::saveMeasure(), Isis::ControlPointEdit::saveMeasure(), Isis::ControlMeasureEditWidget::updateLeftPositionLabel(), Isis::ControlPointEdit::updateLeftPositionLabel(), Isis::ControlMeasureEditWidget::updateRightPositionLabel(), and Isis::ControlPointEdit::updateRightPositionLabel().
|
slot |
Zoom by a specified factor.
zoomFactor | The zoom factor |
Definition at line 454 of file ChipViewport.cpp.
References m_zoomFactor, reloadChip(), and zoomFactor().
Referenced by Isis::ControlMeasureEditWidget::blinkStartRight(), Isis::ControlMeasureEditWidget::setZoomLink(), Isis::ControlPointEdit::setZoomLink(), Isis::ControlMeasureEditWidget::updateLeftPositionLabel(), and Isis::ControlPointEdit::updateLeftPositionLabel().
|
slot |
Zoom by a factor of one.
Definition at line 443 of file ChipViewport.cpp.
References m_zoomFactor, and reloadChip().
double Isis::ChipViewport::zoomFactor | ( | ) |
Return the zoom factor.
Returns the current zoom factor.
Definition at line 465 of file ChipViewport.cpp.
References m_zoomFactor.
Referenced by Isis::ControlMeasureEditWidget::blinkStartRight(), Isis::ControlMeasureEditWidget::setZoomLink(), Isis::ControlPointEdit::setZoomLink(), Isis::ControlMeasureEditWidget::updateLeftPositionLabel(), Isis::ControlPointEdit::updateLeftPositionLabel(), and zoom().
|
slot |
Zoom in.
Definition at line 425 of file ChipViewport.cpp.
References m_zoomFactor, and reloadChip().
|
slot |
Zoom out.
Definition at line 434 of file ChipViewport.cpp.
References m_zoomFactor, and reloadChip().
|
private |
The chip.
Definition at line 208 of file ChipViewport.h.
Referenced by chip(), chipLines(), chipSamples(), ChipViewport(), computeStretch(), cubeToViewport(), geomChip(), keyPressEvent(), mousePressEvent(), nogeomChip(), paintImage(), panDown(), panLeft(), panRight(), panUp(), reloadChip(), rotateChip(), setChip(), tackLine(), and tackSample().
|
private |
The chip's cube.
Definition at line 209 of file ChipViewport.h.
Referenced by ChipViewport(), geomChip(), nogeomChip(), paintEvent(), reloadChip(), rotateChip(), setChip(), and stretchFromCubeViewport().
|
private |
Draw circle.
Definition at line 225 of file ChipViewport.h.
Referenced by ChipViewport(), paintEvent(), and setCircle().
|
private |
Circle size.
Definition at line 226 of file ChipViewport.h.
Referenced by paintEvent(), and setCircleSize().
|
private |
Draw crosshair.
Definition at line 224 of file ChipViewport.h.
Referenced by ChipViewport(), paintEvent(), and setCross().
|
private |
geomIt?
Definition at line 214 of file ChipViewport.h.
Referenced by ChipViewport(), geomChip(), nogeomChip(), and reloadChip().
|
private |
Info for the gray bands.
Definition at line 207 of file ChipViewport.h.
Referenced by autoStretch(), grayBand(), grayStretch(), paintImage(), and stretchFromCubeViewport().
|
private |
Chip height.
Definition at line 212 of file ChipViewport.h.
Referenced by ChipViewport(), and paintEvent().
|
private |
The image.
Definition at line 221 of file ChipViewport.h.
Referenced by ChipViewport(), paintEvent(), paintImage(), and setChip().
|
private |
The matching chip.
Definition at line 215 of file ChipViewport.h.
Referenced by ChipViewport(), geomChip(), and reloadChip().
|
private |
The matching chip's cube.
Definition at line 216 of file ChipViewport.h.
Referenced by ChipViewport(), geomChip(), and reloadChip().
|
private |
Paint Image?
Definition at line 222 of file ChipViewport.h.
|
private |
Rotation.
Definition at line 219 of file ChipViewport.h.
Referenced by ChipViewport(), nogeomChip(), reloadChip(), rotateChip(), and setChip().
|
private |
Draw control points.
Definition at line 223 of file ChipViewport.h.
Referenced by paintEvent(), and setPoints().
|
private |
Current stretch on the chip viewport.
Definition at line 240 of file ChipViewport.h.
Referenced by ChipViewport(), computeStretch(), stretchFromCubeViewport(), and ~ChipViewport().
|
private |
Whether or not to lock the stretch when transforming.
Definition at line 239 of file ChipViewport.h.
Referenced by changeStretchLock(), ChipViewport(), and computeStretch().
|
private |
Temporary viewport.
Definition at line 228 of file ChipViewport.h.
Referenced by ChipViewport(), loadView(), and paintEvent().
|
private |
Chip width.
Definition at line 211 of file ChipViewport.h.
Referenced by ChipViewport(), and paintEvent().
|
private |
Zoom Factor.
Definition at line 218 of file ChipViewport.h.
Referenced by ChipViewport(), nogeomChip(), reloadChip(), rotateChip(), setChip(), zoom(), zoom1(), zoomFactor(), zoomIn(), and zoomOut().
U.S. Department of the Interior | U.S. Geological Survey ISIS | Privacy & Disclaimers | Astrogeology Research Program To contact us, please post comments and questions on the USGS Astrogeology Discussion Board To report a bug, or suggest a feature go to: ISIS Github File Modified: 07/13/2023 15:18:17 |