summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-30 22:10:35 (GMT)
committerAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-30 22:24:31 (GMT)
commit877408c4ab8a6c2138322f5de5cec1acb8d02048 (patch)
treebfc18175c76abdec79a952eae7906f49be51e6ca
parenta8995abf114f7bf6958cf953829d4ef882e68e35 (diff)
Comment out optimization button
Currently, there seems to be no proper way for doing the plumbing between OpenBabel and Avogadro2 for this functionality.
-rw-r--r--src/tools/moleculeview.cpp56
-rw-r--r--src/tools/moleculeviewerwidget.ui5
-rw-r--r--src/tools/obconverter.cpp4
3 files changed, 33 insertions, 32 deletions
diff --git a/src/tools/moleculeview.cpp b/src/tools/moleculeview.cpp
index 8f862e2..652bea4 100644
--- a/src/tools/moleculeview.cpp
+++ b/src/tools/moleculeview.cpp
@@ -20,7 +20,6 @@
#include <avogadro/qtgui/molecule.h>
#include <avogadro/qtgui/scenepluginmodel.h>
#include <avogadro/qtgui/toolplugin.h>
-// #include <avogadro/qtplugins/openbabel/openbabel.h>FIXME:Avogadro2
#include <QFileInfo>
#include <QGLFormat>
@@ -71,10 +70,10 @@ MoleculeDialog::MoleculeDialog(QWidget * parent)
ui.setupUi(mainWidget());
// Attempt to set up the UFF forcefield
- m_forceField = OBForceField::FindForceField("UFF");
- if (!m_forceField) {
- ui.optimizeButton->setEnabled(false);
- }
+// m_forceField = OBForceField::FindForceField("UFF");
+// if (!m_forceField) {
+// ui.optimizeButton->setEnabled(false);
+// }
ui.styleCombo->addItems({"Ball and Stick", "Van der Waals", "Wireframe"});
connect(ui.styleCombo, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged),
@@ -85,8 +84,9 @@ MoleculeDialog::MoleculeDialog(QWidget * parent)
this, &MoleculeDialog::setViewEdit);
// Editing parameters
- connect(ui.optimizeButton, &QPushButton::clicked,
- this, &MoleculeDialog::slotGeometryOptimize);
+// commented out until we find new API for pumbling to OpenBabel
+// connect(ui.optimizeButton, &QPushButton::clicked,
+// this, &MoleculeDialog::slotGeometryOptimize);
connect(ui.clearDrawingButton, &QPushButton::clicked,
this, &MoleculeDialog::clearAllElementsInEditor);
@@ -293,28 +293,30 @@ void MoleculeDialog::slotDownloadNewStuff()
}
}
+//TODO there is currently no API to perform the necessary OpenBabel-Avogadro
+// conversions, after the migration to Avogadro2; at least with v0.9
void MoleculeDialog::slotGeometryOptimize()
{
- // Perform a geometry optimization
- if (!m_forceField) {
- return;
- }
-
- Molecule* molecule = ui.glWidget->molecule();
- OpenBabel::OBMol obmol;//(molecule->OBMol());//FIXME:Avogadro2
-
- // Warn the user if the force field cannot be set up for the molecule
- if (!m_forceField->Setup(obmol)) {
- KMessageBox::error(this,
- i18n("Could not set up force field for this molecule"),
- i18n("Kalzium"));
- return;
- }
-
- // Reasonable default values for most users
- m_forceField->SteepestDescentInitialize(500, 1.0e-5);
- // Provide some feedback as the optimization runs
-// while (m_forceField->SteepestDescentTakeNSteps(5)) {//FIXME:Avogadro2
+// // Perform a geometry optimization
+// if (!m_forceField) {
+// return;
+// }
+//
+// Molecule* molecule = ui.glWidget->molecule();
+// OpenBabel::OBMol obmol;//(molecule->OBMol());
+//
+// // Warn the user if the force field cannot be set up for the molecule
+// if (!m_forceField->Setup(obmol)) {
+// KMessageBox::error(this,
+// i18n("Could not set up force field for this molecule"),
+// i18n("Kalzium"));
+// return;
+// }
+//
+// // Reasonable default values for most users
+// m_forceField->SteepestDescentInitialize(500, 1.0e-5);
+// // Provide some feedback as the optimization runs
+// while (m_forceField->SteepestDescentTakeNSteps(5)) {
// m_forceField->UpdateCoordinates(obmol);
// molecule->setOBMol(&obmol);
// molecule->update();
diff --git a/src/tools/moleculeviewerwidget.ui b/src/tools/moleculeviewerwidget.ui
index 9b84f4d..5bd6c2b 100644
--- a/src/tools/moleculeviewerwidget.ui
+++ b/src/tools/moleculeviewerwidget.ui
@@ -138,13 +138,13 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="editTabLayout">
- <item>
+<!-- <item>
<widget class="QPushButton" name="optimizeButton">
<property name="text">
<string>Optimize</string>
</property>
</widget>
- </item>
+ </item>-->
<item>
<spacer name="spacer_2">
<property name="orientation">
@@ -288,7 +288,6 @@
</customwidgets>
<tabstops>
<tabstop>styleCombo</tabstop>
- <tabstop>optimizeButton</tabstop>
</tabstops>
<resources/>
<connections/>
diff --git a/src/tools/obconverter.cpp b/src/tools/obconverter.cpp
index c815f55..f1b21fd 100644
--- a/src/tools/obconverter.cpp
+++ b/src/tools/obconverter.cpp
@@ -89,10 +89,10 @@ void KOpenBabel::setupWindow()
connect(ui.addFileButton,
SIGNAL(clicked()), SLOT(slotAddFile()));
- connect(ui.deleteFileButton,
+ connect(ui.deleteFileButton,
SIGNAL(clicked()), SLOT(slotDeleteFile()));
- connect(ui.selectAllFileButton,
+ connect(ui.selectAllFileButton,
SIGNAL(clicked()), SLOT(slotSelectAll()));
connect(this,