Skip to content

Commit

Permalink
Add property change flags and use them
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Nov 27, 2023
1 parent 88d885a commit 323086e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions avogadro/qtgui/interfacescript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,8 @@ bool InterfaceScript::processCommand(Core::Molecule* mol)

// how do we handle this result?
if (obj["readProperties"].toBool()) {
qDebug() << " reading properties";
guiMol->readProperties(newMol);
guiMol->emitChanged(Molecule::Atoms);
guiMol->emitChanged(Molecule::Properties | Molecule::Added);
} else if (obj["append"].toBool()) {
guiMol->undoMolecule()->appendMolecule(newMol, m_displayName);
} else { // replace the whole molecule
Expand Down
4 changes: 3 additions & 1 deletion avogadro/qtgui/molecule.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class AVOGADROQTGUI_EXPORT Molecule : public QObject, public Core::Molecule
UnitCell = 0x04,
Selection = 0x08,
Layers = 0x16,
Properties = 0x32,
/** Operations that can affect the above types. */
Added = 0x1024,
Removed = 0x2048,
Expand All @@ -93,7 +94,8 @@ class AVOGADROQTGUI_EXPORT Molecule : public QObject, public Core::Molecule
*/
virtual AtomType addAtom(unsigned char atomicNumber, Index uniqueId);

AtomType addAtom(unsigned char number, Vector3 position3d, Index uniqueId = MaxIndex);
AtomType addAtom(unsigned char number, Vector3 position3d,
Index uniqueId = MaxIndex);

/**
* @brief Remove the specified atom from the molecule.
Expand Down

0 comments on commit 323086e

Please sign in to comment.