USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::ControlPointEdit Class Reference

Point Editor Widget. More...

#include <ControlPointEdit.h>

Inheritance diagram for Isis::ControlPointEdit:
Inheritance graph
[legend]
Collaboration diagram for Isis::ControlPointEdit:
Collaboration graph
[legend]

List of all members.

Public Slots

void setLeftMeasure (ControlMeasure *leftMeasure, Cube *leftCube, QString pointId)
 Set the measure displayed in the left ChipViewport.
void setRightMeasure (ControlMeasure *rightMeasure, Cube *rightCube, QString pointId)
 Set the measure displayed in the right ChipViewport.
void colorizeSaveButton ()
 Turn "Save Measure" button text to red.
void refreshChips ()
void saveChips ()
 Slot to save registration chips to files and fire off qview.

Signals

void updateLeftView (double sample, double line)
void updateRightView (double sample, double line)
void measureSaved ()
void newControlNetwork (ControlNet *)
void stretchChipViewport (Stretch *, CubeViewport *)

Public Member Functions

 ControlPointEdit (ControlNet *cnetQ, QWidget *parent=0, bool allowLeftMouse=false, bool useGeometry=true)
 Constructs a ControlPointEdit widget.
QString templateFileName ()
bool setTemplateFile (QString)
 Allows user to choose a new template file by opening a window from which to select a filename.
void allowLeftMouse (bool allowMouse)
 Set the option that allows mouse movements in the left ChipViewport.

Private Slots

void setNoGeom ()
 Slot to turn off geom.
void setGeom ()
 Turn geom on.
void setRotate ()
 Slot to update the right ChipViewport for zoom operations.
void setCircle (bool)
 Turn circle widgets on/off.
void setZoomLink (bool)
 Turn linking of zoom on or off.
void findPoint ()
 Find point from left ChipViewport in the right ChipViewport.
void registerPoint ()
 Sub-pixel register point in right chipViewport with point in left.
void saveMeasure ()
 Save control measure under the crosshair in right ChipViewport.
void updateLeftPositionLabel (double zoomFactor)
 Update sample/line, lat/lon and zoom factor of left measure.
void updateRightGeom ()
 Slot to update the geomed right ChipViewport for zoom operations.
void updateRightPositionLabel (double zoomFactor)
 Update sample/line, lat/lon and zoom factor of right measure.
void blinkStart ()
 Slot to start blink function.
void blinkStop ()
 Slot to stop blink function.
void changeBlinkTime (double interval)
 Set blink rate.
void updateBlink ()
 Slot to cause the blink to happen coinciding with the timer.

Private Member Functions

void createPointEditor (QWidget *parent)
 Design the PointEdit widget.

Private Attributes

bool p_allowLeftMouse
bool p_useGeometry
QString p_templateFileName
QLabel * p_leftZoomFactor
QLabel * p_rightZoomFactor
QLabel * p_leftSampLinePosition
QLabel * p_rightSampLinePosition
QLabel * p_leftLatLonPosition
QLabel * p_rightLatLonPosition
QRadioButton * p_nogeom
QRadioButton * p_geom
QToolButton * p_rightZoomIn
QToolButton * p_rightZoomOut
QToolButton * p_rightZoom1
bool p_timerOn
QTimer * p_timer
std::vector< ChipViewport * > p_blinkList
unsigned char p_blinkIndex
QDial * p_dial
QLCDNumber * p_dialNumber
QDoubleSpinBox * p_blinkTimeBox
bool p_circle
QScrollBar * p_slider
QPushButton * p_autoReg
QWidgetp_autoRegExtension
QLabel * p_oldPosition
QLabel * p_goodFit
bool p_autoRegShown
bool p_autoRegAttempted
QPushButton * p_saveMeasure
QPalette p_saveDefaultPalette
ChipViewportp_leftView
ChipViewportp_rightView
Cubep_leftCube
Cubep_rightCube
ControlMeasurep_leftMeasure
ControlMeasurep_rightMeasure
Chipp_leftChip
Chipp_rightChip
UniversalGroundMapp_leftGroundMap
UniversalGroundMapp_rightGroundMap
AutoRegp_autoRegFact
QString p_pointId
int p_rotation
bool p_geomIt
bool p_linkZoom

Detailed Description

Point Editor Widget.

Author:
2008-09-09 Tracie Sucharski

For internal use only.

History:
2008-11-19 Tracie Sucharski - Addition option to constructor to allow mouse events on leftChipViewport.
History:
2008-11-24 Tracie Sucharski - Changed class name from PointEdit
History:
2008-12-02 Jeannie Walldren - Modified createPointEditor() to allow the leftChipViewport to refresh even if allowLeftMouse = false.
History:
2008-12-10 Jeannie Walldren - Added a private variable for the template filename. Set the default value of this variable to the previously hard-coded template filename. Added setTemplateFile() method derived from previously unused and commented out method called openTemplateFile().
History:
2008-12-15 Jeannie Walldren - Some QMessageBox warnings had strings tacked on to the list of errors. These strings were changed to iExceptions and added to the error stack to conform with Isis standards.
History:
2008-12-30 Jeannie Walldren - Modified savePoint() method to update user (chooser) name and date when point is saved
History:
2009-03-17 Tracie Sucharski - Add slot to set a boolean to indicate whether the registration chips should be saved.
History:
2010-06-08 Jeannie Walldren - Added warning box in registerPoint() if unable to load left or right chip
History:
2010-06-26 Eric Hyer - now uses MdiCubeViewport instead of CubeViewport. Fixed multiple include problems.
History:
2010-11-17 Eric Hyer - now forwards new ControlNets to the ChipViewports
History:
2010-11-19 Tracie Sucharski - Renamed the "Save Point" button to "Save Measure" along with signals and slots. Add a new "Save Point" button which actually saves the edit point to the network.
History:
2010-11-22 Eric Hyer - Forwarded SIGNAL from StretchTool to ChipViewports
History:
2010-12-01 Eric Hyer - Added checkboxes for stretch locking
History:
2010-12-08 Eric Hyer - Relocated stretch locking checkboxes
History:
2010-12-14 Eric Hyer - setTemplateFile now takes the filename as a parameter (no more open dialog!)
History:
2011-05-04 Jai Rideout - updated saveChips() to reference new AutoReg API for accessing chips used in registration.
History:
2011-06-14 Tracie Sucharski - Added slot to colorize the Save Measure button. If user moved the tack point, the button text will be changed to red. If they push the save button, button will go back to black.
History:
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.
History:
2012-04-17 Tracie Sucharski - If geom is turned on update the right measure in setLeftMeasure.
History:
2012-05-01 Tracie Sucharski - Fix intereface between No Geom, geom and rotate. Make sure resets are done properly when switching beween the options.
History:
2012-05-07 Tracie Sucharski - Change made on 2012-04-17 introduced bug when loading a different control point, so in setLeftMeasure, only update the right chip if we're not loading a different control point.
History:
2012-06-28 Tracie Sucharski - Add parameter to constructor to indicate whether to use cube geometry. This allow cubes with no camera or SPICE information to be used.
History:
2012-07-20 Tracie Sucharski - Change the Save Measure button text and tootip depending on whether movement is allowed on the left chip.
History:
2012-07-26 Tracie Sucharski - Added ability to link zooming between left and right viewports. Added 2 methods, zoomFactor() which returns a zoom factor and zoom(double zoomFactor).
Todo:
Re-think design of the change made on 2012-07-26. The linking was put into updateLeftPositionLabel because it was the fastest solution, but should this be put somewhere else.

Definition at line 127 of file ControlPointEdit.h.


Constructor & Destructor Documentation

Isis::ControlPointEdit::ControlPointEdit ( ControlNet cnet,
QWidget parent = 0,
bool  allowLeftMouse = false,
bool  useGeometry = true 
)

Constructs a ControlPointEdit widget.

Parameters:
parent Input Parent of widget
allowLeftMouse Input Allow/Disallow mouse events on Left ChipViewport
Author:
Tracie Sucharski

For internal use only.

History:
2008-15-2008 Jeannie Walldren - Added error string to iException::Message before creating QMessageBox

Definition at line 51 of file ControlPointEdit.cpp.

References _FILEINFO_, Isis::AutoRegFactory::Create(), createPointEditor(), Isis::IException::Io, and Isis::IException::toString().


Member Function Documentation

void Isis::ControlPointEdit::allowLeftMouse ( bool  allowMouse  ) 

Set the option that allows mouse movements in the left ChipViewport.

Author:
Tracie Sucharski

For internal use only.

Definition at line 1484 of file ControlPointEdit.cpp.

void Isis::ControlPointEdit::blinkStart (  )  [private, slot]

Slot to start blink function.

Definition at line 1376 of file ControlPointEdit.cpp.

References updateBlink().

Referenced by createPointEditor().

void Isis::ControlPointEdit::blinkStop (  )  [private, slot]

Slot to stop blink function.

Definition at line 1393 of file ControlPointEdit.cpp.

Referenced by createPointEditor().

void Isis::ControlPointEdit::changeBlinkTime ( double  interval  )  [private, slot]

Set blink rate.

Parameters:
interval Input Blink rate in seconds
Author:
Tracie Sucharski

Definition at line 1411 of file ControlPointEdit.cpp.

Referenced by createPointEditor().

void Isis::ControlPointEdit::colorizeSaveButton (  )  [slot]

Turn "Save Measure" button text to red.

Author:
2011-06-14 Tracie Sucharski

Definition at line 845 of file ControlPointEdit.cpp.

Referenced by createPointEditor(), findPoint(), and registerPoint().

void Isis::ControlPointEdit::createPointEditor ( QWidget parent  )  [private]

Design the PointEdit widget.

Author:
Tracie Sucharski

For internal use only.

History:
2008-11-19 Tracie Sucharski - Added left pan buttons, but default to hidden.
History:
2008-12-02 Jeannie Walldren - Allow connection between updateLeftView and refreshView for all objects. Previously this was only done if allowLeftMouse = true.
History:
2008-12-02 Tracie Sucharski - Another bug fix due to change on 2008-11-19, The leftView tackPointChanged connection needs to always be made whether mouse button events are allowed or not.
History:
2008-12-10 Jeannie Walldren - Set the default value of the new private variable, p_templateFileName, to the previously hard-coded template filename.

Definition at line 117 of file ControlPointEdit.cpp.

References blinkStart(), blinkStop(), changeBlinkTime(), circle(), colorizeSaveButton(), findPoint(), registerPoint(), saveMeasure(), setCircle(), setGeom(), setNoGeom(), setRotate(), setZoomLink(), updateLeftPositionLabel(), updateRightGeom(), updateRightPositionLabel(), and VIEWSIZE.

Referenced by ControlPointEdit().

void Isis::ControlPointEdit::findPoint (  )  [private, slot]

Find point from left ChipViewport in the right ChipViewport.

Author:
tsucharski (6/27/2011)
History:
2011-06-27 Tracie Sucharski - If measure moves to different samp/line than saved measure, change save button to red.

Definition at line 865 of file ControlPointEdit.cpp.

References colorizeSaveButton(), Isis::UniversalGroundMap::Line(), Isis::UniversalGroundMap::Sample(), Isis::UniversalGroundMap::SetImage(), Isis::UniversalGroundMap::SetUniversalGround(), Isis::ChipViewport::tackLine(), Isis::ChipViewport::tackSample(), Isis::UniversalGroundMap::UniversalLatitude(), and Isis::UniversalGroundMap::UniversalLongitude().

Referenced by createPointEditor().

void Isis::ControlPointEdit::registerPoint (  )  [private, slot]

Sub-pixel register point in right chipViewport with point in left.

For internal use only.

History:
2008-15-2008 Jeannie Walldren - Throw and catch error before creating QMessageBox
History:
2009-03-23 Tracie Sucharski - Added private p_autoRegAttempted for the SaveChips method.
History:
2010-02-16 Tracie Sucharski- If autoreg fails, print registration stats.
History:
2010-02-18 Tracie Sucharski - Registration stats wasn't the correct info to print. Instead, check registrationStatus and print separate errors for each possibility.
History:
2010-02-22 Tracie Sucharski - Added more info for registration failures.
History:
2010-06-08 Jeannie Walldren - Catch error and warn user if unable to load pattern (left) or search (right) chip
History:
2010-10-12 Tracie Sucharski - Clean up try/catch blocks.
History:
2011-06-27 Tracie Sucharski - If un-doing registration, change save button back to black. If registration successful, change save button to red.
History:
2011-10-21 Tracie Sucharski - Add try/catch around registration to catch errors thrown from autoreg class.

Definition at line 919 of file ControlPointEdit.cpp.

References Isis::AutoReg::AdaptiveAlgorithmFailed, colorizeSaveButton(), Isis::AutoReg::CubeLine(), Isis::AutoReg::CubeSample(), Isis::AutoReg::Distance(), Isis::AutoReg::DistanceTolerance(), Isis::AutoReg::FitChipNoData, Isis::AutoReg::FitChipToleranceNotMet, Isis::AutoReg::GoodnessOfFit(), Isis::Chip::Load(), Isis::AutoReg::MinimumZScore(), Isis::AutoReg::PatternChip(), Isis::AutoReg::PatternChipNotEnoughValidData, Isis::AutoReg::PatternValidPercent(), Isis::AutoReg::PatternZScoreNotMet, Isis::AutoReg::Register(), Isis::AutoReg::SearchChip(), Isis::AutoReg::Success(), Isis::AutoReg::SurfaceModelDistanceInvalid, Isis::AutoReg::SurfaceModelNotEnoughValidData, Isis::AutoReg::SurfaceModelSolutionInvalid, Isis::Chip::TackCube(), Isis::AutoReg::Tolerance(), Isis::IException::toString(), and Isis::AutoReg::ZScores().

Referenced by createPointEditor().

void Isis::ControlPointEdit::saveChips (  )  [slot]

Slot to save registration chips to files and fire off qview.

Author:
2009-03-18 Tracie Sucharski

For internal use only.

History:
2009-03-23 Tracie Sucharski - Use p_autoRegAttempted to see if chips exist.

Definition at line 1522 of file ControlPointEdit.cpp.

References Isis::AutoReg::FitChip(), Isis::AutoReg::RegistrationPatternChip(), Isis::AutoReg::RegistrationSearchChip(), Isis::ProgramLauncher::RunSystemCommand(), Isis::toString(), and Isis::Chip::Write().

Referenced by Isis::MatchTool::saveChips().

void Isis::ControlPointEdit::saveMeasure (  )  [private, slot]

Save control measure under the crosshair in right ChipViewport.

For internal use only.

History:
2008-12-30 Jeannie Walldren - Modified to update user (chooser) name and date when point is saved
History:
2010-11-19 Tracie Sucharski - Renamed from savePoint.
History:
2011-03-04 Tracie Sucharski - If auto reg info is shown, save the GoodnessOfFit value to the right ControlMeasure log entry. Changed the way the left viewport is updated if the left and right measure are the same. Simply copy the right measure into the left and re-load the left measure. If measure currently has type of subPixelRegistered, but the new position has not be sub-pixel registered, change measure type and get rid of goodness of fit.
History:
2011-06-14 Tracie Sucharski - Change Save Measure button text back to black.
History:
2011-07-19 Tracie Sucharski - Updated for new functionality of registration pixel shift. ControlMeasure will now calculate based on aprioriSample/Line and current coordinate. If autoreg has been calculated, save coordinate to apriori before updating to subpixel registered coordinate.

Definition at line 1069 of file ControlPointEdit.cpp.

References Isis::ControlMeasure::DeleteLogData(), Isis::ControlMeasure::GetCubeSerialNumber(), Isis::AutoReg::GoodnessOfFit(), Isis::ControlMeasureLogData::GoodnessOfFit, Isis::ControlMeasure::Manual, Isis::ControlMeasureLogData::MaximumPixelZScore, Isis::ControlMeasureLogData::MinimumPixelZScore, Isis::ControlMeasure::RegisteredSubPixel, Isis::ControlMeasure::SetChooserName(), Isis::ControlMeasure::SetCoordinate(), Isis::ControlMeasure::SetDateTime(), setLeftMeasure(), Isis::ControlMeasure::SetLogData(), Isis::ControlMeasure::SetType(), Isis::ChipViewport::tackLine(), Isis::ChipViewport::tackSample(), Isis::Application::UserName(), and Isis::AutoReg::ZScores().

Referenced by createPointEditor().

void Isis::ControlPointEdit::setCircle ( bool  checked  )  [private, slot]

Turn circle widgets on/off.

Parameters:
checked Input Turn cirle on or off
Author:
2008-09-09 Tracie Sucharski

Definition at line 1331 of file ControlPointEdit.cpp.

Referenced by createPointEditor().

void Isis::ControlPointEdit::setGeom (  )  [private, slot]

Turn geom on.

For internal use only.

History:
2007-06-15 Tracie Sucharski - Grey out zoom buttons
History:
2008-15-2008 Jeannie Walldren - Added error string to iException::Message before creating QMessageBox

Definition at line 1245 of file ControlPointEdit.cpp.

References _FILEINFO_, Isis::ChipViewport::geomChip(), Isis::IException::toString(), and Isis::IException::User.

Referenced by createPointEditor().

void Isis::ControlPointEdit::setLeftMeasure ( ControlMeasure leftMeasure,
Cube leftCube,
QString  pointId 
) [slot]

Set the measure displayed in the left ChipViewport.

Parameters:
leftMeasure Input Measure displayed in left ChipViewport
leftCube Input Cube of measure displayed in left ChipViewport
Author:
Tracie Sucharski

For internal use only.

History:
2008-11-19 Tracie Sucharski - If left cube changes, get new universalGroundMap.
History:
2012-04-17 Tracie Sucharski - If geom is turned on update the right measure.
History:
2012-05-07 Tracie Sucharski - Last change introduced bug when loading a different control point, so only update the right chip if we're not loading a different control point.

Definition at line 653 of file ControlPointEdit.cpp.

References Isis::Chip::Load(), Isis::ChipViewport::setChip(), Isis::Chip::TackCube(), updateRightGeom(), and Isis::ChipViewport::zoomFactor().

Referenced by Isis::StereoTool::loadPoint(), Isis::MatchTool::measureSaved(), saveMeasure(), and Isis::MatchTool::selectLeftMeasure().

void Isis::ControlPointEdit::setNoGeom (  )  [private, slot]

Slot to turn off geom.

For internal use only.

History:
2012-05-01 Tracie Sucharski - Reset zoom buttons and rotate dial, then reload chip

Definition at line 1293 of file ControlPointEdit.cpp.

References Isis::ChipViewport::nogeomChip().

Referenced by createPointEditor().

void Isis::ControlPointEdit::setRightMeasure ( ControlMeasure rightMeasure,
Cube rightCube,
QString  pointId 
) [slot]

Set the measure displayed in the right ChipViewport.

Parameters:
rightMeasure Input Measure displayed in right ChipViewport
rightCube Input Cube of measure displayed in right ChipViewport
Author:
Tracie Sucharski

For internal use only.

History:
2008-11-19 Tracie Sucharski - If right cube changes, get new universalGroundMap.
History:
2008-15-2008 Jeannie Walldren - Added error string to iException::Message before creating QMessageBox
History:
2009-09-14 Tracie Sucharski - Call geomChip to make sure left chip is initialized in the ChipViewport. This was done for the changes made to the Chip class and the ChipViewport class where the Cube info is no longer stored.

Definition at line 707 of file ControlPointEdit.cpp.

References _FILEINFO_, Isis::Chip::Load(), Isis::ChipViewport::setChip(), Isis::Chip::TackCube(), Isis::IException::toString(), updateRightGeom(), Isis::IException::User, and Isis::ChipViewport::zoomFactor().

Referenced by Isis::StereoTool::loadPoint(), and Isis::MatchTool::selectRightMeasure().

void Isis::ControlPointEdit::setRotate (  )  [private, slot]

Slot to update the right ChipViewport for zoom operations.

Author:
2012-07-26 Tracie Sucharski

For internal use only.

Slot to enable the rotate dial

History:
2012-05-01 Tracie Sucharski - Reset zoom buttons and reload chip

Definition at line 1205 of file ControlPointEdit.cpp.

References Isis::ChipViewport::nogeomChip().

Referenced by createPointEditor().

bool Isis::ControlPointEdit::setTemplateFile ( QString  fn  ) 

Allows user to choose a new template file by opening a window from which to select a filename.

This file is then registered and set as the new template.

Author:
Tracie Sucharski

For internal use only.

History:
2008-12-10 Jeannie Walldren - Changed name from openTemplateFile() and added functionality to set new template filename to the private variable, p_templateFileName
History:
2008-12-15 Jeannie Walldren - Modified code to only allow the template file to be modified if registration is successfull, otherwise the original template file is kept.

Definition at line 1442 of file ControlPointEdit.cpp.

References _FILEINFO_, Isis::AutoRegFactory::Create(), Isis::IException::Io, and Isis::IException::toString().

Referenced by Isis::MatchTool::openTemplateFile(), Isis::StereoTool::setTemplateFile(), and Isis::MatchTool::writeTemplateFile().

void Isis::ControlPointEdit::setZoomLink ( bool  checked  )  [private, slot]

Turn linking of zoom on or off.

Parameters:
checked Input Turn zoom linking on or off
Author:
2012-07-26 Tracie Sucharski

Definition at line 1363 of file ControlPointEdit.cpp.

References Isis::ChipViewport::zoomFactor().

Referenced by createPointEditor().

void Isis::ControlPointEdit::updateBlink (  )  [private, slot]

Slot to cause the blink to happen coinciding with the timer.

Definition at line 1417 of file ControlPointEdit.cpp.

References Isis::ChipViewport::loadView().

Referenced by blinkStart().

void Isis::ControlPointEdit::updateLeftPositionLabel ( double  zoomFactor  )  [private, slot]

Update sample/line, lat/lon and zoom factor of left measure.

Parameters:
zoomFactor Input zoom factor
Author:
Tracie Sucharski

For internal use only.

History:
2012-07-26 Tracie Sucharski - Added ability to link zooming between left and right viewports. TODO: Re-think design, should this be put somewhere else. This was the fastest solution for now.

Definition at line 773 of file ControlPointEdit.cpp.

References pos, Isis::UniversalGroundMap::SetImage(), Isis::ChipViewport::tackLine(), Isis::ChipViewport::tackSample(), Isis::UniversalGroundMap::UniversalLatitude(), Isis::UniversalGroundMap::UniversalLongitude(), and Isis::ChipViewport::zoomFactor().

Referenced by createPointEditor().

void Isis::ControlPointEdit::updateRightGeom (  )  [private, slot]

Slot to update the geomed right ChipViewport for zoom operations.

For internal use only.

History:
2008-15-2008 Jeannie Walldren - Added error string to iException::Message before creating QMessageBox

Definition at line 1152 of file ControlPointEdit.cpp.

References _FILEINFO_, Isis::ChipViewport::geomChip(), Isis::IException::toString(), and Isis::IException::User.

Referenced by createPointEditor(), setLeftMeasure(), and setRightMeasure().

void Isis::ControlPointEdit::updateRightPositionLabel ( double  zoomFactor  )  [private, slot]

Update sample/line, lat/lon and zoom factor of right measure.

Parameters:
zoomFactor Input zoom factor
Author:
Tracie Sucharski

Definition at line 808 of file ControlPointEdit.cpp.

References pos, Isis::UniversalGroundMap::SetImage(), Isis::ChipViewport::tackLine(), Isis::ChipViewport::tackSample(), Isis::UniversalGroundMap::UniversalLatitude(), and Isis::UniversalGroundMap::UniversalLongitude().

Referenced by createPointEditor().


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