Created
February 11, 2020 20:44
-
-
Save ghutchis/bf8d61337d70bf7845fa8c40d4f9ceff to your computer and use it in GitHub Desktop.
Diff for selected atoms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/avogadro/qtgui/interfacescript.cpp b/avogadro/qtgui/interfacescript.cpp | |
index f0ad088..c0c2141 100644 | |
--- a/avogadro/qtgui/interfacescript.cpp | |
+++ b/avogadro/qtgui/interfacescript.cpp | |
@@ -458,6 +458,14 @@ bool InterfaceScript::insertMolecule(QJsonObject& json, | |
if (m_moleculeExtension == QLatin1String("None")) | |
return true; | |
+ // insert the selected atoms | |
+ QJsonArray selectedList; | |
+ for (Index i = 0; i < mol.atomCount(); ++i) { | |
+ if (molecule.atomSelected(i)) | |
+ selectedlist.append(i); | |
+ } | |
+ json.insert("selectedatoms", selectedList; | |
+ | |
Io::FileFormatManager& formats = Io::FileFormatManager::instance(); | |
QScopedPointer<Io::FileFormat> format( | |
formats.newFormatFromFileExtension(m_moleculeExtension.toStdString())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment