Isis 3 Programmer Reference
|
This is the configuration dialog for the MosaicSceneWidget's projection parameters (map file). More...
#include <ProjectionConfigDialog.h>
Public Slots | |
void | applySettings () |
Take the settings that have been configured and apply them to the mosaic scene. More... | |
void | readSettings () |
Update the current widgets' states with the current settings in the mosaic scene. More... | |
Signals | |
void | shown () |
Public Member Functions | |
ProjectionConfigDialog (MosaicSceneWidget *scene, QWidget *parent=NULL) | |
Create a projection configuration dialog. More... | |
void | setQuickConfig (bool quick) |
Enable/disable minimal interaction mode. More... | |
Protected Member Functions | |
void | showEvent (QShowEvent *) |
Private Slots | |
void | beginQuickLoad () |
If using quick load, this will prompt the user for an input file right after the show event. More... | |
void | loadFromFile () |
Read mapping parameters from a file (prompts user for the file name). More... | |
void | saveToFile () |
Save mapping parameters to the given file. More... | |
void | refreshWidgetStates () |
Update the enabled/disabled states of the various widgets based on the current user inputs' states. More... | |
void | showErrors (int) |
This is called when "Show Errors" is checked. More... | |
Private Member Functions | |
Q_DISABLE_COPY (ProjectionConfigDialog) | |
Pvl | addMissingKeywords (Pvl mappingPvl) |
Get a modified mapping pvl that the mosaic scene will be compatible with. More... | |
Projection * | createProjection () |
Convert the current text in the text edit to a projection. More... | |
Private Attributes | |
QPointer< QLabel > | m_stateLabel |
This shows a general idea of the current state of the mapping pvl (always shown) More... | |
QPointer< QLabel > | m_errorsLabel |
This shows errors generated by trying to create a projection from the current mapping pvl. More... | |
QPointer< QTextEdit > | m_mapFileEdit |
This is the text area that a user can type in for editing the projection. More... | |
QPointer< QPushButton > | m_readFromFileButton |
This button corresponds to 'Load Map File...' and causes a prompt for file input. More... | |
QPointer< QPushButton > | m_applyButton |
This button applies the current projection to the scene. More... | |
QPointer< QPushButton > | m_okayButton |
This button applies the current projection to the scene and closes the dialog. More... | |
QPointer< MosaicSceneWidget > | m_scene |
The mosaic scene we're configuring the projection for. More... | |
bool | m_dirty |
To reduce redundant computations, keep track of dirty state of the dialog. More... | |
bool | m_quick |
Should we minimize the user interaction? More... | |
This is the configuration dialog for the MosaicSceneWidget's projection parameters (map file).
Definition at line 24 of file ProjectionConfigDialog.h.
Isis::ProjectionConfigDialog::ProjectionConfigDialog | ( | MosaicSceneWidget * | scene, |
QWidget * | parent = NULL |
||
) |
Create a projection configuration dialog.
scene | The mosaic scene for which we're going to set the projection, this must not be NULL. |
parent | The Qt-parent for this dialog. |
Definition at line 29 of file ProjectionConfigDialog.cpp.
References applySettings(), beginQuickLoad(), loadFromFile(), m_applyButton, m_dirty, m_errorsLabel, m_mapFileEdit, m_okayButton, m_quick, m_readFromFileButton, m_scene, m_stateLabel, readSettings(), refreshWidgetStates(), saveToFile(), and showErrors().
Get a modified mapping pvl that the mosaic scene will be compatible with.
Definition at line 217 of file ProjectionConfigDialog.cpp.
References Isis::PvlObject::findGroup(), Isis::PvlContainer::hasKeyword(), and Isis::PvlObject::Traverse.
Referenced by createProjection().
|
slot |
Take the settings that have been configured and apply them to the mosaic scene.
Definition at line 172 of file ProjectionConfigDialog.cpp.
References createProjection(), m_dirty, m_scene, and readSettings().
Referenced by ProjectionConfigDialog().
|
privateslot |
If using quick load, this will prompt the user for an input file right after the show event.
We can't do this inside the show event because we can't accept() or reject() in the show event.
Definition at line 266 of file ProjectionConfigDialog.cpp.
References m_quick, and m_readFromFileButton.
Referenced by ProjectionConfigDialog().
|
private |
Convert the current text in the text edit to a projection.
Definition at line 249 of file ProjectionConfigDialog.cpp.
References addMissingKeywords(), Isis::ProjectionFactory::Create(), and m_mapFileEdit.
Referenced by applySettings(), loadFromFile(), and refreshWidgetStates().
|
privateslot |
Read mapping parameters from a file (prompts user for the file name).
This works with cubes. The mapping parameters will then be put into the text edit.
Definition at line 277 of file ProjectionConfigDialog.cpp.
References createProjection(), Isis::PvlObject::findGroup(), m_mapFileEdit, m_okayButton, m_quick, Isis::IException::toString(), and Isis::PvlObject::Traverse.
Referenced by ProjectionConfigDialog().
|
slot |
Update the current widgets' states with the current settings in the mosaic scene.
Definition at line 189 of file ProjectionConfigDialog.cpp.
References m_dirty, m_mapFileEdit, m_scene, and refreshWidgetStates().
Referenced by applySettings(), and ProjectionConfigDialog().
|
privateslot |
Update the enabled/disabled states of the various widgets based on the current user inputs' states.
Definition at line 351 of file ProjectionConfigDialog.cpp.
References createProjection(), m_applyButton, m_dirty, m_errorsLabel, m_mapFileEdit, m_okayButton, m_stateLabel, and Isis::IException::what().
Referenced by ProjectionConfigDialog(), and readSettings().
|
privateslot |
Save mapping parameters to the given file.
This overwrites the output file with the contents of the text edit.
Definition at line 325 of file ProjectionConfigDialog.cpp.
References m_mapFileEdit.
Referenced by ProjectionConfigDialog().
void Isis::ProjectionConfigDialog::setQuickConfig | ( | bool | quick | ) |
Enable/disable minimal interaction mode.
This is defaulted to false. Setting this option will remove most mouse clicks from the interface and try to immediately use a projection that the user is expected to select from a file.
quick | True to minimize clicks/interaction, false (default) to use standard behavior. |
Definition at line 164 of file ProjectionConfigDialog.cpp.
References m_quick.
|
privateslot |
This is called when "Show Errors" is checked.
This hides/shows the errors label depending on the given check state (0 = hide, 1 = show).
shouldShowErrors | 0 for hiding errors, 1 for showing |
Definition at line 389 of file ProjectionConfigDialog.cpp.
References m_errorsLabel.
Referenced by ProjectionConfigDialog().
|
private |
This button applies the current projection to the scene.
Definition at line 67 of file ProjectionConfigDialog.h.
Referenced by ProjectionConfigDialog(), and refreshWidgetStates().
|
private |
To reduce redundant computations, keep track of dirty state of the dialog.
Definition at line 75 of file ProjectionConfigDialog.h.
Referenced by applySettings(), ProjectionConfigDialog(), readSettings(), and refreshWidgetStates().
|
private |
This shows errors generated by trying to create a projection from the current mapping pvl.
Definition at line 59 of file ProjectionConfigDialog.h.
Referenced by ProjectionConfigDialog(), refreshWidgetStates(), and showErrors().
|
private |
This is the text area that a user can type in for editing the projection.
Definition at line 61 of file ProjectionConfigDialog.h.
Referenced by createProjection(), loadFromFile(), ProjectionConfigDialog(), readSettings(), refreshWidgetStates(), and saveToFile().
|
private |
This button applies the current projection to the scene and closes the dialog.
Definition at line 69 of file ProjectionConfigDialog.h.
Referenced by loadFromFile(), ProjectionConfigDialog(), and refreshWidgetStates().
|
private |
Should we minimize the user interaction?
Definition at line 78 of file ProjectionConfigDialog.h.
Referenced by beginQuickLoad(), loadFromFile(), ProjectionConfigDialog(), and setQuickConfig().
|
private |
This button corresponds to 'Load Map File...' and causes a prompt for file input.
Definition at line 64 of file ProjectionConfigDialog.h.
Referenced by beginQuickLoad(), and ProjectionConfigDialog().
|
private |
The mosaic scene we're configuring the projection for.
Definition at line 72 of file ProjectionConfigDialog.h.
Referenced by applySettings(), ProjectionConfigDialog(), and readSettings().
|
private |
This shows a general idea of the current state of the mapping pvl (always shown)
Definition at line 57 of file ProjectionConfigDialog.h.
Referenced by ProjectionConfigDialog(), and refreshWidgetStates().