diff --git a/tools/lammps-gui/TODO.md b/tools/lammps-gui/TODO.md index a917a4cf62..996ab43a93 100644 --- a/tools/lammps-gui/TODO.md +++ b/tools/lammps-gui/TODO.md @@ -2,8 +2,6 @@ LAMMPS-GUI TODO list: # Short term goals (v1.x) -- add feature to visualize "molecules" from the molecule command. - this could use the image viewer, but create an empty system and then just one molecule - implement a timed "Auto-Save" feature that saves after some idle time. set timeout in Editor preferences. - add a "Filter data" checkbox to the "Charts" window to select whether data should be dropped. - add a "Charts tab" to the preferences with the following (default) settings: diff --git a/tools/lammps-gui/imageviewer.cpp b/tools/lammps-gui/imageviewer.cpp index f796699938..5f519ca9a7 100644 --- a/tools/lammps-gui/imageviewer.cpp +++ b/tools/lammps-gui/imageviewer.cpp @@ -559,6 +559,13 @@ void ImageViewer::change_molecule(int) auto *box = findChild("molecule"); molecule = box ? box->currentText() : "none"; + box = findChild("group"); + if (molecule == "none") { + box->setEnabled(true); + } else { + box->setEnabled(false); + } + createImage(); } @@ -594,6 +601,7 @@ void ImageViewer::createImage() QString molcreate = "create_atoms 0 single %1 %2 %3 mol %4 312944 group %5 units box"; group = "imgviewer_tmp_mol"; lammps->command(molcreate.arg(xmid).arg(ymid).arg(zmid).arg(molecule).arg(group)); + lammps->command(QString("neigh_modify exclude group all %1").arg(group)); lammps->command("run 0 post no"); } @@ -743,6 +751,7 @@ void ImageViewer::createImage() repaint(); if (molecule != "none") { + lammps->command("neigh_modify exclude none"); lammps->command(QString("delete_atoms group %1 compress no").arg(group)); lammps->command(QString("group %1 delete").arg(group)); group = oldgroup;