Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.cpp

    r6a3c83 r575343  
    6767  last_atom(0)
    6868{
    69   // add specific channels
    70   Channels *OurChannel = new Channels;
    71   NotificationChannels.insert( std::make_pair( this, OurChannel) );
    72   for (size_t type = 0; type < (size_t)NotificationType_MAX; ++type)
    73     OurChannel->addChannel(type);
    7469
    7570  strcpy(name,World::getInstance().getDefaultName().c_str());
     
    112107void molecule::setName(const std::string _name){
    113108  OBSERVE;
    114   NOTIFY(MoleculeNameChanged);
    115109  cout << "Set name of molecule " << getId() << " to " << _name << endl;
    116110  strncpy(name,_name.c_str(),MAXSTRINGSIZE);
     
    120114  OBSERVE;
    121115  if(atomIdPool.reserveId(newNr)){
    122     NOTIFY(AtomNrChanged);
    123116    if (oldNr != -1)  // -1 is reserved and indicates no number
    124117      atomIdPool.releaseId(oldNr);
     
    179172{
    180173  OBSERVE;
    181   NOTIFY(AtomRemoved);
    182174  const_iterator iter = loc;
    183175  ++iter;
    184176  atom * const _atom = const_cast<atom *>(*loc);
    185177  atomIds.erase( _atom->getId() );
    186   {
    187     NOTIFY(AtomNrChanged);
    188     atomIdPool.releaseId(_atom->getNr());
    189     _atom->setNr(-1);
    190   }
    191178  formula-=_atom->getType();
    192179  _atom->removeFromMolecule();
     
    197184{
    198185  OBSERVE;
    199   NOTIFY(AtomRemoved);
    200186  const_iterator iter = find(key);
    201187  if (iter != end()){
    202188    ++iter;
    203189    atomIds.erase( key->getId() );
    204     {
    205       NOTIFY(AtomNrChanged);
    206       atomIdPool.releaseId(key->getNr());
    207       key->setNr(-1);
    208     }
     190    atomIdPool.releaseId(key->getNr());
     191    key->setNr(-1);
    209192    formula-=key->getType();
    210193    key->removeFromMolecule();
     
    216199{
    217200  OBSERVE;
    218   NOTIFY(AtomInserted);
    219201  std::pair<iterator,bool> res = atomIds.insert(key->getId());
    220202  if (res.second) { // push atom if went well
    221     NOTIFY(AtomNrChanged);
    222203    key->setNr(atomIdPool.getNextId());
    223204    setAtomName(key);
     
    251232bool molecule::AddAtom(atom *pointer)
    252233{
     234  OBSERVE;
    253235  if (pointer != NULL) {
    254236    insert(pointer);
     
    266248{
    267249  atom *retval = NULL;
     250  OBSERVE;
    268251  if (pointer != NULL) {
    269252    atom *walker = pointer->clone();
     
    315298//  Info info(__func__);
    316299  bool AllWentWell = true;    // flag gathering the boolean return value of molecule::AddAtom and other functions, as return value on exit
     300  OBSERVE;
    317301  double bondlength;  // bond length of the bond to be replaced/cut
    318302  double bondangle;  // bond angle of the bond to be replaced/cut
     
    672656bond * molecule::AddBond(atom *atom1, atom *atom2, int degree)
    673657{
     658  OBSERVE;
    674659  bond *Binder = NULL;
    675660
     
    729714void molecule::SetNameFromFilename(const char *filename)
    730715{
     716  OBSERVE;
    731717  int length = 0;
    732718  const char *molname = strrchr(filename, '/');
     
    763749{
    764750  ASSERT(pointer, "Null pointer passed to molecule::RemoveAtom().");
     751  OBSERVE;
    765752  RemoveBonds(pointer);
    766753  pointer->removeFromMolecule();
Note: See TracChangeset for help on using the changeset viewer.