コード例 #1
0
ファイル: residue.cpp プロジェクト: AlbertDeFusco/avogadro
 void Residue::addAtom(unsigned long id)
 {
   if (!m_molecule->atomById(id))
     return;
   if (!m_atoms.contains(id))
     m_atoms.push_back(id);
   m_molecule->atomById(id)->setResidue(m_id);
   connect(m_molecule->atomById(id), SIGNAL(updated()), this, SLOT(updateAtom()));
 }
コード例 #2
0
ファイル: residue.cpp プロジェクト: AlbertDeFusco/avogadro
  void Residue::removeAtom(unsigned long id)
  {
    int index = m_atoms.indexOf(id);
    if (index != -1 ) {
      m_atoms.removeAt(index);
    }
    if (!m_molecule->atomById(id))
      return;

    m_molecule->atomById(id)->setResidue(FALSE_ID);
    disconnect(m_molecule->atomById(id), SIGNAL(updated()), this, SLOT(updateAtom()));
  }
コード例 #3
0
ファイル: molecule.cpp プロジェクト: foeroyingur/avogadro
  void Molecule::removeAtom(Atom *atom)
  {
    if(atom) {
      // When deleting an atom this also implicitly deletes any bonds to the atom
      foreach (unsigned long bond, atom->bonds()) {
        removeBond(bond);
      }

      m_atoms[atom->id()] = 0;
      // 1 based arrays stored/shown to user
      int index = atom->index();
      m_atomList.removeAt(index);
      for (int i = index; i < m_atomList.size(); ++i)
        m_atomList[i]->setIndex(i);
      atom->deleteLater();

      disconnect(atom, SIGNAL(updated()), this, SLOT(updateAtom()));
      emit atomRemoved(atom);
    }
  }
コード例 #4
0
ファイル: dialog2.cpp プロジェクト: yml210/MolInt_Cpp
void Dialog2::applied()
{
  updateAtom();
  canvas->updateGL();
}