Skip to content
Permalink
Browse files

code cleanup

  • Loading branch information
mbernasocchi authored and pka committed Dec 7, 2010
1 parent 3ded44a commit 0d2cdd8673d5b9cb2dda78e0c8216670605e4073
@@ -59,6 +59,13 @@ QString QgsGlobePluginDialog::openFile()
return path;
}

void QgsGlobePluginDialog::showMessageBox( QString text )
{
QMessageBox msgBox;
msgBox.setText(text);
msgBox.exec();
}

void QgsGlobePluginDialog::restartGlobe()
{
//showMessageBox("TODO: restart globe");
@@ -70,52 +77,6 @@ bool QgsGlobePluginDialog::globeRunning()
return true;
}

void QgsGlobePluginDialog::updateStereoDialog()
{
QString stereoMode = comboStereoMode->currentText() ;
screenDistance->setEnabled( true );
screenHeight->setEnabled( true );
screenWidth->setEnabled( true );
eyeSeparation->setEnabled( true );
splitStereoHorizontalSeparation->setEnabled( false );
splitStereoVerticalSeparation->setEnabled( false );
splitStereoHorizontalEyeMapping->setEnabled( false );
splitStereoVerticalEyeMapping->setEnabled( false );

if("OFF" == stereoMode)
{
screenDistance->setEnabled( false );
screenHeight->setEnabled( false );
screenWidth->setEnabled( false );
eyeSeparation->setEnabled( false );
}
else if("ANAGLYPHIC" == stereoMode)
{
//nothing to do
}
else if("VERTICAL_SPLIT" == stereoMode)
{
splitStereoVerticalSeparation->setEnabled( true );
splitStereoVerticalEyeMapping->setEnabled( true );
}
else if("HORIZONTAL_SPLIT" == stereoMode)
{
splitStereoHorizontalSeparation->setEnabled( true );
splitStereoHorizontalEyeMapping->setEnabled( true );
}
else if("QUAD_BUFFER" == stereoMode)
{
//nothing to do
}
else
{
//should never get here
QMessageBox msgBox;
msgBox.setText("This stereo mode has not been implemented yet.");
msgBox.exec();
}
}

void QgsGlobePluginDialog::on_buttonBox_accepted()
{
setStereoConfig();
@@ -218,7 +179,7 @@ void QgsGlobePluginDialog::on_buttonBox_rejected()
reject();
}

void QgsGlobePluginDialog::on_resetDefaults_clicked()
void QgsGlobePluginDialog::on_resetStereoDefaults_clicked()
{
//http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/StereoSettings
comboStereoMode->setCurrentIndex( comboStereoMode->findText("OFF") );
@@ -280,13 +241,6 @@ void QgsGlobePluginDialog::on_splitStereoVerticalEyeMapping_currentIndexChanged(
(osg::DisplaySettings::SplitStereoVerticalEyeMapping) value );
}

void QgsGlobePluginDialog::showMessageBox( QString text )
{
QMessageBox msgBox;
msgBox.setText(text);
msgBox.exec();
}

void QgsGlobePluginDialog::loadStereoConfig()
{
comboStereoMode->setCurrentIndex( comboStereoMode->findText( settings.value( "/Plugin-Globe/stereoMode",
@@ -378,3 +332,49 @@ void QgsGlobePluginDialog::saveStereoConfig()
settings.setValue( "/Plugin-Globe/splitStereoHorizontalEyeMapping", splitStereoHorizontalEyeMapping->currentIndex() );
settings.setValue( "/Plugin-Globe/splitStereoVerticalEyeMapping", splitStereoVerticalEyeMapping->currentIndex() );
}

void QgsGlobePluginDialog::updateStereoDialog()
{
QString stereoMode = comboStereoMode->currentText() ;
screenDistance->setEnabled( true );
screenHeight->setEnabled( true );
screenWidth->setEnabled( true );
eyeSeparation->setEnabled( true );
splitStereoHorizontalSeparation->setEnabled( false );
splitStereoVerticalSeparation->setEnabled( false );
splitStereoHorizontalEyeMapping->setEnabled( false );
splitStereoVerticalEyeMapping->setEnabled( false );

if("OFF" == stereoMode)
{
screenDistance->setEnabled( false );
screenHeight->setEnabled( false );
screenWidth->setEnabled( false );
eyeSeparation->setEnabled( false );
}
else if("ANAGLYPHIC" == stereoMode)
{
//nothing to do
}
else if("VERTICAL_SPLIT" == stereoMode)
{
splitStereoVerticalSeparation->setEnabled( true );
splitStereoVerticalEyeMapping->setEnabled( true );
}
else if("HORIZONTAL_SPLIT" == stereoMode)
{
splitStereoHorizontalSeparation->setEnabled( true );
splitStereoHorizontalEyeMapping->setEnabled( true );
}
else if("QUAD_BUFFER" == stereoMode)
{
//nothing to do
}
else
{
//should never get here
QMessageBox msgBox;
msgBox.setText("This stereo mode has not been implemented yet.");
msgBox.exec();
}
}
@@ -61,8 +61,7 @@ class QgsGlobePluginDialog:public QDialog, private Ui::QgsGlobePluginDialogGuiBa
void on_splitStereoVerticalSeparation_valueChanged(int value);
void on_splitStereoHorizontalEyeMapping_currentIndexChanged(int value);
void on_splitStereoVerticalEyeMapping_currentIndexChanged(int value);

void on_resetDefaults_clicked();
void on_resetStereoDefaults_clicked();
};

#endif // QGIS_GLOBE_PLUGIN_DIALOG_H
@@ -351,7 +351,7 @@
</widget>
</item>
<item row="16" column="2">
<widget class="QPushButton" name="resetDefaults">
<widget class="QPushButton" name="resetStereoDefaults">
<property name="text">
<string>Reset to defaults</string>
</property>

0 comments on commit 0d2cdd8

Please sign in to comment.
You can’t perform that action at this time.