Isis 3 Programmer Reference
Isis::ProjectionConfigDialog Class Reference

This is the configuration dialog for the MosaicSceneWidget's projection parameters (map file). More...

#include <ProjectionConfigDialog.h>

Inheritance diagram for Isis::ProjectionConfigDialog:
Inheritance graph
Collaboration diagram for Isis::ProjectionConfigDialog:
Collaboration graph

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...
 
ProjectioncreateProjection ()
 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< MosaicSceneWidgetm_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...
 

Detailed Description

This is the configuration dialog for the MosaicSceneWidget's projection parameters (map file).

Author
2012-08-06 Steven Lambright

Definition at line 24 of file ProjectionConfigDialog.h.

Constructor & Destructor Documentation

◆ ProjectionConfigDialog()

Isis::ProjectionConfigDialog::ProjectionConfigDialog ( MosaicSceneWidget scene,
QWidget parent = NULL 
)

Create a projection configuration dialog.

Parameters
sceneThe mosaic scene for which we're going to set the projection, this must not be NULL.
parentThe 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().

Member Function Documentation

◆ addMissingKeywords()

Pvl Isis::ProjectionConfigDialog::addMissingKeywords ( Pvl  mappingPvl)
private

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().

◆ applySettings

void Isis::ProjectionConfigDialog::applySettings ( )
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().

◆ beginQuickLoad

void Isis::ProjectionConfigDialog::beginQuickLoad ( )
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().

◆ createProjection()

Projection * Isis::ProjectionConfigDialog::createProjection ( )
private

Convert the current text in the text edit to a projection.

Returns
The projection specified in the text edit

Definition at line 249 of file ProjectionConfigDialog.cpp.

References addMissingKeywords(), Isis::ProjectionFactory::Create(), and m_mapFileEdit.

Referenced by applySettings(), loadFromFile(), and refreshWidgetStates().

◆ loadFromFile

void Isis::ProjectionConfigDialog::loadFromFile ( )
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().

◆ readSettings

void Isis::ProjectionConfigDialog::readSettings ( )
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().

◆ refreshWidgetStates

void Isis::ProjectionConfigDialog::refreshWidgetStates ( )
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().

◆ saveToFile

void Isis::ProjectionConfigDialog::saveToFile ( )
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().

◆ setQuickConfig()

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.

Parameters
quickTrue to minimize clicks/interaction, false (default) to use standard behavior.

Definition at line 164 of file ProjectionConfigDialog.cpp.

References m_quick.

◆ showErrors

void Isis::ProjectionConfigDialog::showErrors ( int  shouldShowErrors)
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).

Parameters
shouldShowErrors0 for hiding errors, 1 for showing

Definition at line 389 of file ProjectionConfigDialog.cpp.

References m_errorsLabel.

Referenced by ProjectionConfigDialog().

Member Data Documentation

◆ m_applyButton

QPointer<QPushButton> Isis::ProjectionConfigDialog::m_applyButton
private

This button applies the current projection to the scene.

Definition at line 67 of file ProjectionConfigDialog.h.

Referenced by ProjectionConfigDialog(), and refreshWidgetStates().

◆ m_dirty

bool Isis::ProjectionConfigDialog::m_dirty
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().

◆ m_errorsLabel

QPointer<QLabel> Isis::ProjectionConfigDialog::m_errorsLabel
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().

◆ m_mapFileEdit

QPointer<QTextEdit> Isis::ProjectionConfigDialog::m_mapFileEdit
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().

◆ m_okayButton

QPointer<QPushButton> Isis::ProjectionConfigDialog::m_okayButton
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().

◆ m_quick

bool Isis::ProjectionConfigDialog::m_quick
private

Should we minimize the user interaction?

Definition at line 78 of file ProjectionConfigDialog.h.

Referenced by beginQuickLoad(), loadFromFile(), ProjectionConfigDialog(), and setQuickConfig().

◆ m_readFromFileButton

QPointer<QPushButton> Isis::ProjectionConfigDialog::m_readFromFileButton
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().

◆ m_scene

QPointer<MosaicSceneWidget> Isis::ProjectionConfigDialog::m_scene
private

The mosaic scene we're configuring the projection for.

Definition at line 72 of file ProjectionConfigDialog.h.

Referenced by applySettings(), ProjectionConfigDialog(), and readSettings().

◆ m_stateLabel

QPointer<QLabel> Isis::ProjectionConfigDialog::m_stateLabel
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().


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