From c5aaf8904649846202f62fcee6d66de48fa5ba7c Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Sat, 16 Dec 2023 16:13:30 -0500 Subject: [PATCH] Fix error with electron density - isosurface values were swapped Signed-off-by: Geoff Hutchison --- avogadro/qtplugins/surfaces/surfaces.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/avogadro/qtplugins/surfaces/surfaces.cpp b/avogadro/qtplugins/surfaces/surfaces.cpp index a2557ace17..ccdf629a17 100644 --- a/avogadro/qtplugins/surfaces/surfaces.cpp +++ b/avogadro/qtplugins/surfaces/surfaces.cpp @@ -591,7 +591,7 @@ void Surfaces::calculateQM(Type type, int index, bool beta, float isoValue, } else { m_slaterConcurrent->calculateElectronDensity(m_cube); } - } else if (type == ElectronDensity) { + } else if (type == SpinDensity) { progressText = tr("Calculating spin density"); m_cube->setName("Spin Density"); m_cube->setCubeType(Core::Cube::Type::SpinDensity); @@ -691,8 +691,6 @@ void Surfaces::displayMesh() if (!m_cube) return; - // qDebug() << " running displayMesh"; - if (m_dialog != nullptr) m_smoothingPasses = m_dialog->smoothingPassesValue(); else @@ -704,7 +702,7 @@ void Surfaces::displayMesh() m_meshGenerator1 = new QtGui::MeshGenerator; connect(m_meshGenerator1, SIGNAL(finished()), SLOT(meshFinished())); } - m_meshGenerator1->initialize(m_cube, m_mesh1, -m_isoValue, m_smoothingPasses); + m_meshGenerator1->initialize(m_cube, m_mesh1, m_isoValue, m_smoothingPasses); bool isMO = false; // if it's from a file we should "play it safe" @@ -720,8 +718,8 @@ void Surfaces::displayMesh() m_meshGenerator2 = new QtGui::MeshGenerator; connect(m_meshGenerator2, SIGNAL(finished()), SLOT(meshFinished())); } - m_meshGenerator2->initialize(m_cube, m_mesh2, m_isoValue, m_smoothingPasses, - true); + m_meshGenerator2->initialize(m_cube, m_mesh2, -m_isoValue, + m_smoothingPasses, true); } // Start the mesh generation - this needs an improved mutex with a read lock